@doocs/md-cli 0.1.2 → 0.1.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.
- package/dist/index.html +2 -2
- package/dist/mpmd/icon-256-gray.png +0 -0
- package/dist/static/css/md-index-CwlSfNZa.css +1 -0
- package/dist/static/js/{md-_basePickBy-n_ptBhRl.js → md-_basePickBy-6ybsJX4x.js} +1 -1
- package/dist/static/js/{md-_baseUniq-UI9XjDSS.js → md-_baseUniq-C2ybNeBy.js} +1 -1
- package/dist/static/js/{md-arc-CG0xZpwd.js → md-arc-Bvhvbfcq.js} +1 -1
- package/dist/static/js/{md-architectureDiagram-IEHRJDOE-B39-e7po.js → md-architectureDiagram-IEHRJDOE-CD797YU5.js} +1 -1
- package/dist/static/js/{md-blockDiagram-JOT3LUYC-LZ0ocwzX.js → md-blockDiagram-JOT3LUYC-NxgsmysZ.js} +1 -1
- package/dist/static/js/{md-c4Diagram-VJAJSXHY-D9kp_i50.js → md-c4Diagram-VJAJSXHY-C_QBJ76C.js} +1 -1
- package/dist/static/js/md-channel-T3FtoWLA.js +1 -0
- package/dist/static/js/{md-chunk-4BMEZGHF-C8HfuzwX.js → md-chunk-4BMEZGHF-B0f1u3NG.js} +1 -1
- package/dist/static/js/{md-chunk-A2AXSNBT-EpvWi1vW.js → md-chunk-A2AXSNBT-CPXsz34E.js} +1 -1
- package/dist/static/js/{md-chunk-AEK57VVT-DfI_dP3H.js → md-chunk-AEK57VVT-CzkfXXrX.js} +1 -1
- package/dist/static/js/{md-chunk-D6G4REZN-eU4UvCQM.js → md-chunk-D6G4REZN-L36E8ytS.js} +1 -1
- package/dist/static/js/{md-chunk-RZ5BOZE2-Ed7DVqsi.js → md-chunk-RZ5BOZE2-wCxCYXfv.js} +1 -1
- package/dist/static/js/{md-chunk-XZIHB7SX-DSEuEo-L.js → md-chunk-XZIHB7SX-nZwkN4Me.js} +1 -1
- package/dist/static/js/md-classDiagram-GIVACNV2-BwldW2WM.js +1 -0
- package/dist/static/js/md-classDiagram-v2-COTLJTTW-BwldW2WM.js +1 -0
- package/dist/static/js/md-clone-BnmGrwCC.js +1 -0
- package/dist/static/js/{md-cytoscape.esm-CWd-UyhZ.js → md-cytoscape.esm-BKRYsM4t.js} +3 -3
- package/dist/static/js/{md-dagre-OKDRZEBW-bRx_xZmN.js → md-dagre-OKDRZEBW-BrUIbTpL.js} +1 -1
- package/dist/static/js/{md-diagram-SSKATNLV-B-n-ZMhl.js → md-diagram-SSKATNLV-C6aV2Syz.js} +1 -1
- package/dist/static/js/{md-diagram-VNBRO52H-CEMh5zVN.js → md-diagram-VNBRO52H-CMSixOy2.js} +1 -1
- package/dist/static/js/{md-erDiagram-Q7BY3M3F-ClKBDTYs.js → md-erDiagram-Q7BY3M3F-CFf59yHU.js} +1 -1
- package/dist/static/js/{md-flowDiagram-4HSFHLVR-BZet97G-.js → md-flowDiagram-4HSFHLVR-B7Q1A2HV.js} +1 -1
- package/dist/static/js/{md-ganttDiagram-APWFNJXF-xU1noQGk.js → md-ganttDiagram-APWFNJXF-DhvQZFe3.js} +1 -1
- package/dist/static/js/{md-gitGraphDiagram-7IBYFJ6S-sLIFQS94.js → md-gitGraphDiagram-7IBYFJ6S-DC_6TQJa.js} +1 -1
- package/dist/static/js/{md-graph-DwcZOKUv.js → md-graph-yVHbLpuH.js} +1 -1
- package/dist/static/js/{md-index-lEHYkmyN.js → md-index-4K8vrVBp.js} +478 -316
- package/dist/static/js/{md-infoDiagram-PH2N3AL5-D7-qapHx.js → md-infoDiagram-PH2N3AL5-xVb-dRKj.js} +1 -1
- package/dist/static/js/{md-journeyDiagram-U35MCT3I-BNTJgTly.js → md-journeyDiagram-U35MCT3I-DXpRkO1g.js} +1 -1
- package/dist/static/js/{md-kanban-definition-NDS4AKOZ-B1bGm5dE.js → md-kanban-definition-NDS4AKOZ-X9VrCEnQ.js} +1 -1
- package/dist/static/js/{md-layout-BJ3G4Vtz.js → md-layout-Drj-TQiV.js} +1 -1
- package/dist/static/js/{md-linear-BJwrzNxm.js → md-linear-CyC-SZqE.js} +1 -1
- package/dist/static/js/{md-mindmap-definition-ALO5MXBD-DePXZ4X5.js → md-mindmap-definition-ALO5MXBD-B1b4s-xJ.js} +1 -1
- package/dist/static/js/{md-pieDiagram-IB7DONF6-ELBfb3J2.js → md-pieDiagram-IB7DONF6-BqHgJG9f.js} +1 -1
- package/dist/static/js/{md-quadrantDiagram-7GDLP6J5-Dt6sdst_.js → md-quadrantDiagram-7GDLP6J5-Dy5qehP9.js} +1 -1
- package/dist/static/js/{md-radar-MK3ICKWK-BfSn9gz-.js → md-radar-MK3ICKWK-CxWAMR2W.js} +27 -27
- package/dist/static/js/{md-requirementDiagram-KVF5MWMF-5nh_v62_.js → md-requirementDiagram-KVF5MWMF-D0Nwe7Nw.js} +1 -1
- package/dist/static/js/{md-sankeyDiagram-QLVOVGJD-DgxGKuA0.js → md-sankeyDiagram-QLVOVGJD-DlX1f6cH.js} +1 -1
- package/dist/static/js/{md-sequenceDiagram-X6HHIX6F-CLQaG9fm.js → md-sequenceDiagram-X6HHIX6F-DyPBZGqk.js} +1 -1
- package/dist/static/js/{md-stateDiagram-DGXRK772-C8bDEi8S.js → md-stateDiagram-DGXRK772-8Kif4E8Q.js} +1 -1
- package/dist/static/js/md-stateDiagram-v2-YXO3MK2T-Cx_SEk82.js +1 -0
- package/dist/static/js/{md-timeline-definition-BDJGKUSR-D10WCdsV.js → md-timeline-definition-BDJGKUSR-BZGK3wfS.js} +1 -1
- package/dist/static/js/{md-xychartDiagram-VJFVF3MP-DcCVYGwf.js → md-xychartDiagram-VJFVF3MP-DT5XWb5g.js} +1 -1
- package/package.json +3 -3
- package/dist/static/css/md-index-BcSsiNbL.css +0 -1
- package/dist/static/js/md-channel-X9Rtbm_e.js +0 -1
- package/dist/static/js/md-classDiagram-GIVACNV2-C8j3o3BZ.js +0 -1
- package/dist/static/js/md-classDiagram-v2-COTLJTTW-C8j3o3BZ.js +0 -1
- package/dist/static/js/md-clone-BUv47ZVZ.js +0 -1
- package/dist/static/js/md-stateDiagram-v2-YXO3MK2T-DEKZORpF.js +0 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
var _u=Object.defineProperty;var Ru=(n,e,t)=>e in n?_u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Qe=(n,e,t)=>Ru(n,typeof e!="symbol"?e+"":e,t);import{by as Eu,bz as Au,aP as vl,bi as bu,aT as ku,aQ as te,aA as Nu,aB as ua,b8 as Iu,bb as Tl,bc as _l,b9 as Su,bn as da,aD as vt,aE as D,aR as fa,aL as xu,bA as Nt}from"./md-index-lEHYkmyN.js";import{k as Kt,j as Os,g as Zt,S as Cu,w as wu,x as $u,c as Rl,v as z,y as El,l as Ou,z as Lu,A as Mu,B as Pu,C as Du,a as Al,d as S,i as Xe,r as oe,f as be,D as q}from"./md-_baseUniq-UI9XjDSS.js";import{j as Ls,m as k,d as ju,f as xe,g as zt,h as x,i as Ms,l as Xt,e as Gu}from"./md-_basePickBy-n_ptBhRl.js";import{c as re}from"./md-clone-BUv47ZVZ.js";var Uu=Object.prototype,Fu=Uu.hasOwnProperty,Ae=Eu(function(n,e){if(Au(e)||vl(e)){bu(e,Kt(e),n);return}for(var t in e)Fu.call(e,t)&&ku(n,t,e[t])});function bl(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=n[r+e];return s}function Jn(n){for(var e=-1,t=n==null?0:n.length,r=0,i=[];++e<t;){var s=n[e];s&&(i[r++]=s)}return i}function Bu(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;){var a=n[i];e(r,a,t(a),n)}return r}function Hu(n,e,t,r){return Os(n,function(i,s,a){e(r,i,t(i),a)}),r}function Vu(n,e){return function(t,r){var i=te(t)?Bu:Hu,s=e?e():{};return i(t,n,Zt(r),s)}}var Wu=200;function Ku(n,e,t,r){var i=-1,s=wu,a=!0,o=n.length,l=[],c=e.length;if(!o)return l;e.length>=Wu&&(s=$u,a=!1,e=new Cu(e));e:for(;++i<o;){var u=n[i],d=u;if(u=u!==0?u:0,a&&d===d){for(var h=c;h--;)if(e[h]===d)continue e;l.push(u)}else s(e,d,r)||l.push(u)}return l}var li=Nu(function(n,e){return ua(n)?Ku(n,Rl(e,1,ua,!0)):[]});function Q(n,e,t){var r=n==null?0:n.length;return r?(e=e===void 0?1:Ls(e),bl(n,e<0?0:e,r)):[]}function zn(n,e,t){var r=n==null?0:n.length;return r?(e=e===void 0?1:Ls(e),e=r-e,bl(n,0,e<0?0:e)):[]}function zu(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(!e(n[t],t,n))return!1;return!0}function Xu(n,e){var t=!0;return Os(n,function(r,i,s){return t=!!e(r,i,s),t}),t}function Le(n,e,t){var r=te(n)?zu:Xu;return r(n,Zt(e))}function Me(n){return n&&n.length?n[0]:void 0}function Ee(n,e){return Rl(k(n,e))}var qu=Object.prototype,Yu=qu.hasOwnProperty,Ju=Vu(function(n,e,t){Yu.call(n,t)?n[t].push(e):Iu(n,t,[e])}),Qu="[object String]";function fe(n){return typeof n=="string"||!te(n)&&Tl(n)&&_l(n)==Qu}var Zu=Math.max;function ue(n,e,t,r){n=vl(n)?n:z(n),t=t?Ls(t):0;var i=n.length;return t<0&&(t=Zu(i+t,0)),fe(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&El(n,e,t)>-1}function ha(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=0;return El(n,e,i)}var ed="[object RegExp]";function td(n){return Tl(n)&&_l(n)==ed}var pa=da&&da.isRegExp,qe=pa?Su(pa):td,nd="Expected a function";function rd(n){if(typeof n!="function")throw new TypeError(nd);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function Pe(n,e){if(n==null)return{};var t=Ou(Lu(n),function(r){return[r]});return e=Zt(e),ju(n,t,function(r,i){return e(r,i[0])})}function ci(n,e){var t=te(n)?Mu:Pu;return t(n,rd(Zt(e)))}function id(n,e){var t;return Os(n,function(r,i,s){return t=e(r,i,s),!t}),!!t}function kl(n,e,t){var r=te(n)?Du:id;return r(n,Zt(e))}function Ps(n){return n&&n.length?Al(n):[]}function sd(n,e){return n&&n.length?Al(n,Zt(e)):[]}function ae(n){return typeof n=="object"&&n!==null&&typeof n.$type=="string"}function Ue(n){return typeof n=="object"&&n!==null&&typeof n.$refText=="string"}function ad(n){return typeof n=="object"&&n!==null&&typeof n.name=="string"&&typeof n.type=="string"&&typeof n.path=="string"}function br(n){return typeof n=="object"&&n!==null&&ae(n.container)&&Ue(n.reference)&&typeof n.message=="string"}class Nl{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return ae(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[t];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,t);return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Xn(n){return typeof n=="object"&&n!==null&&Array.isArray(n.content)}function Il(n){return typeof n=="object"&&n!==null&&typeof n.tokenType=="object"}function Sl(n){return Xn(n)&&typeof n.fullText=="string"}class Z{constructor(e,t){this.startFn=e,this.nextFn=t}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 t=0,r=e.next();for(;!r.done;)t++,r=e.next();return t}toArray(){const e=[],t=this.iterator();let r;do r=t.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,t){const r=this.map(i=>[e?e(i):i,t?t(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Z(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),t=>{let r;if(!t.firstDone){do if(r=this.nextFn(t.first),!r.done)return r;while(!r.done);t.firstDone=!0}do if(r=t.iterator.next(),!r.done)return r;while(!r.done);return _e})}join(e=","){const t=this.iterator();let r="",i,s=!1;do i=t.next(),i.done||(s&&(r+=e),r+=od(i.value)),s=!0;while(!i.done);return r}indexOf(e,t=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=t&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(!e(r.value))return!1;r=t.next()}return!0}some(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(e(r.value))return!0;r=t.next()}return!1}forEach(e){const t=this.iterator();let r=0,i=t.next();for(;!i.done;)e(i.value,r),i=t.next(),r++}map(e){return new Z(this.startFn,t=>{const{done:r,value:i}=this.nextFn(t);return r?_e:{done:!1,value:e(i)}})}filter(e){return new Z(this.startFn,t=>{let r;do if(r=this.nextFn(t),!r.done&&e(r.value))return r;while(!r.done);return _e})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,t){const r=this.iterator();let i=t,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,t,r);return s===void 0?i.value:t(s,i.value)}find(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(e(r.value))return r.value;r=t.next()}}findIndex(e){const t=this.iterator();let r=0,i=t.next();for(;!i.done;){if(e(i.value))return r;i=t.next(),r++}return-1}includes(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(r.value===e)return!0;r=t.next()}return!1}flatMap(e){return new Z(()=>({this:this.startFn()}),t=>{do{if(t.iterator){const s=t.iterator.next();if(s.done)t.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(t.this);if(!r){const s=e(i);if(Gr(s))t.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(t.iterator);return _e})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const t=e>1?this.flat(e-1):this;return new Z(()=>({this:t.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}=t.nextFn(r.this);if(!i)if(Gr(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return _e})}head(){const t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new Z(()=>{const t=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(t).done)return t;return t},this.nextFn)}limit(e){return new Z(()=>({size:0,state:this.startFn()}),t=>(t.size++,t.size>e?_e:this.nextFn(t.state)))}distinct(e){return new Z(()=>({set:new Set,internalState:this.startFn()}),t=>{let r;do if(r=this.nextFn(t.internalState),!r.done){const i=e?e(r.value):r.value;if(!t.set.has(i))return t.set.add(i),r}while(!r.done);return _e})}exclude(e,t){const r=new Set;for(const i of e){const s=t?t(i):i;r.add(s)}return this.filter(i=>{const s=t?t(i):i;return!r.has(s)})}}function od(n){return typeof n=="string"?n:typeof n>"u"?"undefined":typeof n.toString=="function"?n.toString():Object.prototype.toString.call(n)}function Gr(n){return!!n&&typeof n[Symbol.iterator]=="function"}const ld=new Z(()=>{},()=>_e),_e=Object.freeze({done:!0,value:void 0});function ee(...n){if(n.length===1){const e=n[0];if(e instanceof Z)return e;if(Gr(e))return new Z(()=>e[Symbol.iterator](),t=>t.next());if(typeof e.length=="number")return new Z(()=>({index:0}),t=>t.index<e.length?{done:!1,value:e[t.index++]}:_e)}return n.length>1?new Z(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;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<n.length){const t=n[e.collIndex++];Gr(t)?e.iterator=t[Symbol.iterator]():t&&typeof t.length=="number"&&(e.array=t)}}while(e.iterator||e.array||e.collIndex<n.length);return _e}):ld}class Ds extends Z{constructor(e,t,r){super(()=>({iterators:r!=null&&r.includeRoot?[[e][Symbol.iterator]()]:[t(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(t(a.value)[Symbol.iterator]()),a}return _e})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Ji;(function(n){function e(s){return s.reduce((a,o)=>a+o,0)}n.sum=e;function t(s){return s.reduce((a,o)=>a*o,0)}n.product=t;function r(s){return s.reduce((a,o)=>Math.min(a,o))}n.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}n.max=i})(Ji||(Ji={}));function Qi(n){return new Ds(n,e=>Xn(e)?e.content:[],{includeRoot:!0})}function cd(n,e){for(;n.container;)if(n=n.container,n===e)return!0;return!1}function Zi(n){return{start:{character:n.startColumn-1,line:n.startLine-1},end:{character:n.endColumn,line:n.endLine-1}}}function Ur(n){if(!n)return;const{offset:e,end:t,range:r}=n;return{range:r,offset:e,end:t,length:t-e}}var We;(function(n){n[n.Before=0]="Before",n[n.After=1]="After",n[n.OverlapFront=2]="OverlapFront",n[n.OverlapBack=3]="OverlapBack",n[n.Inside=4]="Inside",n[n.Outside=5]="Outside"})(We||(We={}));function ud(n,e){if(n.end.line<e.start.line||n.end.line===e.start.line&&n.end.character<=e.start.character)return We.Before;if(n.start.line>e.end.line||n.start.line===e.end.line&&n.start.character>=e.end.character)return We.After;const t=n.start.line>e.start.line||n.start.line===e.start.line&&n.start.character>=e.start.character,r=n.end.line<e.end.line||n.end.line===e.end.line&&n.end.character<=e.end.character;return t&&r?We.Inside:t?We.OverlapBack:r?We.OverlapFront:We.Outside}function dd(n,e){return ud(n,e)>We.After}const fd=/^[\w\p{L}]$/u;function hd(n,e){if(n){const t=pd(n,!0);if(t&&ma(t,e))return t;if(Sl(n)){const r=n.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=n.content[i];if(ma(s,e))return s}}}}function ma(n,e){return Il(n)&&e.includes(n.tokenType.name)}function pd(n,e=!0){for(;n.container;){const t=n.container;let r=t.content.indexOf(n);for(;r>0;){r--;const i=t.content[r];if(e||!i.hidden)return i}n=t}}class xl extends Error{constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}}function Qn(n){throw new Error("Error! The input value was not handled.")}const sr="AbstractRule",ar="AbstractType",bi="Condition",ga="TypeDefinition",ki="ValueLiteral",un="AbstractElement";function md(n){return P.isInstance(n,un)}const or="ArrayLiteral",lr="ArrayType",dn="BooleanLiteral";function gd(n){return P.isInstance(n,dn)}const fn="Conjunction";function yd(n){return P.isInstance(n,fn)}const hn="Disjunction";function vd(n){return P.isInstance(n,hn)}const cr="Grammar",Ni="GrammarImport",pn="InferredType";function Cl(n){return P.isInstance(n,pn)}const mn="Interface";function wl(n){return P.isInstance(n,mn)}const Ii="NamedArgument",gn="Negation";function Td(n){return P.isInstance(n,gn)}const ur="NumberLiteral",dr="Parameter",yn="ParameterReference";function _d(n){return P.isInstance(n,yn)}const vn="ParserRule";function Ce(n){return P.isInstance(n,vn)}const fr="ReferenceType",kr="ReturnType";function Rd(n){return P.isInstance(n,kr)}const Tn="SimpleType";function Ed(n){return P.isInstance(n,Tn)}const hr="StringLiteral",St="TerminalRule";function Tt(n){return P.isInstance(n,St)}const _n="Type";function $l(n){return P.isInstance(n,_n)}const Si="TypeAttribute",pr="UnionType",Rn="Action";function ui(n){return P.isInstance(n,Rn)}const En="Alternatives";function Ol(n){return P.isInstance(n,En)}const An="Assignment";function ft(n){return P.isInstance(n,An)}const bn="CharacterRange";function Ad(n){return P.isInstance(n,bn)}const kn="CrossReference";function js(n){return P.isInstance(n,kn)}const Nn="EndOfFile";function bd(n){return P.isInstance(n,Nn)}const In="Group";function Gs(n){return P.isInstance(n,In)}const Sn="Keyword";function ht(n){return P.isInstance(n,Sn)}const xn="NegatedToken";function kd(n){return P.isInstance(n,xn)}const Cn="RegexToken";function Nd(n){return P.isInstance(n,Cn)}const wn="RuleCall";function pt(n){return P.isInstance(n,wn)}const $n="TerminalAlternatives";function Id(n){return P.isInstance(n,$n)}const On="TerminalGroup";function Sd(n){return P.isInstance(n,On)}const Ln="TerminalRuleCall";function xd(n){return P.isInstance(n,Ln)}const Mn="UnorderedGroup";function Ll(n){return P.isInstance(n,Mn)}const Pn="UntilToken";function Cd(n){return P.isInstance(n,Pn)}const Dn="Wildcard";function wd(n){return P.isInstance(n,Dn)}class Ml extends Nl{getAllTypes(){return[un,sr,ar,Rn,En,or,lr,An,dn,bn,bi,fn,kn,hn,Nn,cr,Ni,In,pn,mn,Sn,Ii,xn,gn,ur,dr,yn,vn,fr,Cn,kr,wn,Tn,hr,$n,On,St,Ln,_n,Si,ga,pr,Mn,Pn,ki,Dn]}computeIsSubtype(e,t){switch(e){case Rn:case En:case An:case bn:case kn:case Nn:case In:case Sn:case xn:case Cn:case wn:case $n:case On:case Ln:case Mn:case Pn:case Dn:return this.isSubtype(un,t);case or:case ur:case hr:return this.isSubtype(ki,t);case lr:case fr:case Tn:case pr:return this.isSubtype(ga,t);case dn:return this.isSubtype(bi,t)||this.isSubtype(ki,t);case fn:case hn:case gn:case yn:return this.isSubtype(bi,t);case pn:case mn:case _n:return this.isSubtype(ar,t);case vn:return this.isSubtype(sr,t)||this.isSubtype(ar,t);case St:return this.isSubtype(sr,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return ar;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return sr;case"Grammar:usedGrammars":return cr;case"NamedArgument:parameter":case"ParameterReference:parameter":return dr;case"TerminalRuleCall:rule":return St;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case un:return{name:un,properties:[{name:"cardinality"},{name:"lookahead"}]};case or:return{name:or,properties:[{name:"elements",defaultValue:[]}]};case lr:return{name:lr,properties:[{name:"elementType"}]};case dn:return{name:dn,properties:[{name:"true",defaultValue:!1}]};case fn:return{name:fn,properties:[{name:"left"},{name:"right"}]};case hn:return{name:hn,properties:[{name:"left"},{name:"right"}]};case cr:return{name:cr,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case Ni:return{name:Ni,properties:[{name:"path"}]};case pn:return{name:pn,properties:[{name:"name"}]};case mn:return{name:mn,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ii:return{name:Ii,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case gn:return{name:gn,properties:[{name:"value"}]};case ur:return{name:ur,properties:[{name:"value"}]};case dr:return{name:dr,properties:[{name:"name"}]};case yn:return{name:yn,properties:[{name:"parameter"}]};case vn:return{name:vn,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case fr:return{name:fr,properties:[{name:"referenceType"}]};case kr:return{name:kr,properties:[{name:"name"}]};case Tn:return{name:Tn,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case hr:return{name:hr,properties:[{name:"value"}]};case St:return{name:St,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case _n:return{name:_n,properties:[{name:"name"},{name:"type"}]};case Si:return{name:Si,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case pr:return{name:pr,properties:[{name:"types",defaultValue:[]}]};case Rn:return{name:Rn,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case En:return{name:En,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case An:return{name:An,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case bn:return{name:bn,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case kn:return{name:kn,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Nn:return{name:Nn,properties:[{name:"cardinality"},{name:"lookahead"}]};case In:return{name:In,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Sn:return{name:Sn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case xn:return{name:xn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Cn:return{name:Cn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case wn:return{name:wn,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case $n:return{name:$n,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case On:return{name:On,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Ln:return{name:Ln,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Mn:return{name:Mn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Pn:return{name:Pn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Dn:return{name:Dn,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const P=new Ml;function $d(n){for(const[e,t]of Object.entries(n))e.startsWith("$")||(Array.isArray(t)?t.forEach((r,i)=>{ae(r)&&(r.$container=n,r.$containerProperty=e,r.$containerIndex=i)}):ae(t)&&(t.$container=n,t.$containerProperty=e))}function di(n,e){let t=n;for(;t;){if(e(t))return t;t=t.$container}}function et(n){const t=es(n).$document;if(!t)throw new Error("AST node has no document.");return t}function es(n){for(;n.$container;)n=n.$container;return n}function Us(n,e){if(!n)throw new Error("Node must be an AstNode.");const t=e==null?void 0:e.range;return new Z(()=>({keys:Object.keys(n),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=n[i];if(ae(s)){if(r.keyIndex++,ya(s,t))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(ae(o)&&ya(o,t))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return _e})}function Zn(n,e){if(!n)throw new Error("Root node must be an AstNode.");return new Ds(n,t=>Us(t,e))}function Ct(n,e){if(!n)throw new Error("Root node must be an AstNode.");return new Ds(n,t=>Us(t,e),{includeRoot:!0})}function ya(n,e){var t;if(!e)return!0;const r=(t=n.$cstNode)===null||t===void 0?void 0:t.range;return r?dd(r,e):!1}function Pl(n){return new Z(()=>({keys:Object.keys(n),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const t=e.keys[e.keyIndex];if(!t.startsWith("$")){const r=n[t];if(Ue(r))return e.keyIndex++,{done:!1,value:{reference:r,container:n,property:t}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Ue(s))return{done:!1,value:{reference:s,container:n,property:t,index:i}}}e.arrayIndex=0}}e.keyIndex++}return _e})}function Od(n,e){const t=n.getTypeMetaData(e.$type),r=e;for(const i of t.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=Dl(i.defaultValue))}function Dl(n){return Array.isArray(n)?[...n.map(Dl)]:n}function C(n){return n.charCodeAt(0)}function xi(n,e){Array.isArray(n)?n.forEach(function(t){e.push(t)}):e.push(n)}function on(n,e){if(n[e]===!0)throw"duplicate flag "+e;n[e],n[e]=!0}function It(n){if(n===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ld(){throw Error("Internal Error - Should never get here!")}function va(n){return n.type==="Character"}const Fr=[];for(let n=C("0");n<=C("9");n++)Fr.push(n);const Br=[C("_")].concat(Fr);for(let n=C("a");n<=C("z");n++)Br.push(n);for(let n=C("A");n<=C("Z");n++)Br.push(n);const Ta=[C(" "),C("\f"),C(`
|
1
|
+
var _u=Object.defineProperty;var Ru=(n,e,t)=>e in n?_u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Qe=(n,e,t)=>Ru(n,typeof e!="symbol"?e+"":e,t);import{by as Eu,bz as Au,aP as vl,bi as bu,aT as ku,aQ as te,aA as Nu,aB as ua,b8 as Iu,bb as Tl,bc as _l,b9 as Su,bn as da,aD as vt,aE as D,aR as fa,aL as xu,bA as Nt}from"./md-index-4K8vrVBp.js";import{k as Kt,j as Os,g as Zt,S as Cu,w as wu,x as $u,c as Rl,v as z,y as El,l as Ou,z as Lu,A as Mu,B as Pu,C as Du,a as Al,d as S,i as qe,r as oe,f as be,D as X}from"./md-_baseUniq-C2ybNeBy.js";import{j as Ls,m as k,d as ju,f as xe,g as zt,h as x,i as Ms,l as qt,e as Gu}from"./md-_basePickBy-6ybsJX4x.js";import{c as re}from"./md-clone-BnmGrwCC.js";var Uu=Object.prototype,Fu=Uu.hasOwnProperty,Ae=Eu(function(n,e){if(Au(e)||vl(e)){bu(e,Kt(e),n);return}for(var t in e)Fu.call(e,t)&&ku(n,t,e[t])});function bl(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=n[r+e];return s}function Jn(n){for(var e=-1,t=n==null?0:n.length,r=0,i=[];++e<t;){var s=n[e];s&&(i[r++]=s)}return i}function Bu(n,e,t,r){for(var i=-1,s=n==null?0:n.length;++i<s;){var a=n[i];e(r,a,t(a),n)}return r}function Hu(n,e,t,r){return Os(n,function(i,s,a){e(r,i,t(i),a)}),r}function Vu(n,e){return function(t,r){var i=te(t)?Bu:Hu,s=e?e():{};return i(t,n,Zt(r),s)}}var Wu=200;function Ku(n,e,t,r){var i=-1,s=wu,a=!0,o=n.length,l=[],c=e.length;if(!o)return l;e.length>=Wu&&(s=$u,a=!1,e=new Cu(e));e:for(;++i<o;){var u=n[i],d=u;if(u=u!==0?u:0,a&&d===d){for(var h=c;h--;)if(e[h]===d)continue e;l.push(u)}else s(e,d,r)||l.push(u)}return l}var li=Nu(function(n,e){return ua(n)?Ku(n,Rl(e,1,ua,!0)):[]});function Q(n,e,t){var r=n==null?0:n.length;return r?(e=e===void 0?1:Ls(e),bl(n,e<0?0:e,r)):[]}function zn(n,e,t){var r=n==null?0:n.length;return r?(e=e===void 0?1:Ls(e),e=r-e,bl(n,0,e<0?0:e)):[]}function zu(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(!e(n[t],t,n))return!1;return!0}function qu(n,e){var t=!0;return Os(n,function(r,i,s){return t=!!e(r,i,s),t}),t}function Le(n,e,t){var r=te(n)?zu:qu;return r(n,Zt(e))}function Me(n){return n&&n.length?n[0]:void 0}function Ee(n,e){return Rl(k(n,e))}var Xu=Object.prototype,Yu=Xu.hasOwnProperty,Ju=Vu(function(n,e,t){Yu.call(n,t)?n[t].push(e):Iu(n,t,[e])}),Qu="[object String]";function fe(n){return typeof n=="string"||!te(n)&&Tl(n)&&_l(n)==Qu}var Zu=Math.max;function ue(n,e,t,r){n=vl(n)?n:z(n),t=t?Ls(t):0;var i=n.length;return t<0&&(t=Zu(i+t,0)),fe(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&El(n,e,t)>-1}function ha(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=0;return El(n,e,i)}var ed="[object RegExp]";function td(n){return Tl(n)&&_l(n)==ed}var pa=da&&da.isRegExp,Xe=pa?Su(pa):td,nd="Expected a function";function rd(n){if(typeof n!="function")throw new TypeError(nd);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function Pe(n,e){if(n==null)return{};var t=Ou(Lu(n),function(r){return[r]});return e=Zt(e),ju(n,t,function(r,i){return e(r,i[0])})}function ci(n,e){var t=te(n)?Mu:Pu;return t(n,rd(Zt(e)))}function id(n,e){var t;return Os(n,function(r,i,s){return t=e(r,i,s),!t}),!!t}function kl(n,e,t){var r=te(n)?Du:id;return r(n,Zt(e))}function Ps(n){return n&&n.length?Al(n):[]}function sd(n,e){return n&&n.length?Al(n,Zt(e)):[]}function ae(n){return typeof n=="object"&&n!==null&&typeof n.$type=="string"}function Ue(n){return typeof n=="object"&&n!==null&&typeof n.$refText=="string"}function ad(n){return typeof n=="object"&&n!==null&&typeof n.name=="string"&&typeof n.type=="string"&&typeof n.path=="string"}function br(n){return typeof n=="object"&&n!==null&&ae(n.container)&&Ue(n.reference)&&typeof n.message=="string"}class Nl{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,t){return ae(e)&&this.isSubtype(e.$type,t)}isSubtype(e,t){if(e===t)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[t];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,t);return r[t]=s,s}}getAllSubTypes(e){const t=this.allSubtypes[e];if(t)return t;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function qn(n){return typeof n=="object"&&n!==null&&Array.isArray(n.content)}function Il(n){return typeof n=="object"&&n!==null&&typeof n.tokenType=="object"}function Sl(n){return qn(n)&&typeof n.fullText=="string"}class Z{constructor(e,t){this.startFn=e,this.nextFn=t}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 t=0,r=e.next();for(;!r.done;)t++,r=e.next();return t}toArray(){const e=[],t=this.iterator();let r;do r=t.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,t){const r=this.map(i=>[e?e(i):i,t?t(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Z(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),t=>{let r;if(!t.firstDone){do if(r=this.nextFn(t.first),!r.done)return r;while(!r.done);t.firstDone=!0}do if(r=t.iterator.next(),!r.done)return r;while(!r.done);return _e})}join(e=","){const t=this.iterator();let r="",i,s=!1;do i=t.next(),i.done||(s&&(r+=e),r+=od(i.value)),s=!0;while(!i.done);return r}indexOf(e,t=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=t&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(!e(r.value))return!1;r=t.next()}return!0}some(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(e(r.value))return!0;r=t.next()}return!1}forEach(e){const t=this.iterator();let r=0,i=t.next();for(;!i.done;)e(i.value,r),i=t.next(),r++}map(e){return new Z(this.startFn,t=>{const{done:r,value:i}=this.nextFn(t);return r?_e:{done:!1,value:e(i)}})}filter(e){return new Z(this.startFn,t=>{let r;do if(r=this.nextFn(t),!r.done&&e(r.value))return r;while(!r.done);return _e})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,t){const r=this.iterator();let i=t,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,t){return this.recursiveReduce(this.iterator(),e,t)}recursiveReduce(e,t,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,t,r);return s===void 0?i.value:t(s,i.value)}find(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(e(r.value))return r.value;r=t.next()}}findIndex(e){const t=this.iterator();let r=0,i=t.next();for(;!i.done;){if(e(i.value))return r;i=t.next(),r++}return-1}includes(e){const t=this.iterator();let r=t.next();for(;!r.done;){if(r.value===e)return!0;r=t.next()}return!1}flatMap(e){return new Z(()=>({this:this.startFn()}),t=>{do{if(t.iterator){const s=t.iterator.next();if(s.done)t.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(t.this);if(!r){const s=e(i);if(Gr(s))t.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(t.iterator);return _e})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const t=e>1?this.flat(e-1):this;return new Z(()=>({this:t.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}=t.nextFn(r.this);if(!i)if(Gr(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return _e})}head(){const t=this.iterator().next();if(!t.done)return t.value}tail(e=1){return new Z(()=>{const t=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(t).done)return t;return t},this.nextFn)}limit(e){return new Z(()=>({size:0,state:this.startFn()}),t=>(t.size++,t.size>e?_e:this.nextFn(t.state)))}distinct(e){return new Z(()=>({set:new Set,internalState:this.startFn()}),t=>{let r;do if(r=this.nextFn(t.internalState),!r.done){const i=e?e(r.value):r.value;if(!t.set.has(i))return t.set.add(i),r}while(!r.done);return _e})}exclude(e,t){const r=new Set;for(const i of e){const s=t?t(i):i;r.add(s)}return this.filter(i=>{const s=t?t(i):i;return!r.has(s)})}}function od(n){return typeof n=="string"?n:typeof n>"u"?"undefined":typeof n.toString=="function"?n.toString():Object.prototype.toString.call(n)}function Gr(n){return!!n&&typeof n[Symbol.iterator]=="function"}const ld=new Z(()=>{},()=>_e),_e=Object.freeze({done:!0,value:void 0});function ee(...n){if(n.length===1){const e=n[0];if(e instanceof Z)return e;if(Gr(e))return new Z(()=>e[Symbol.iterator](),t=>t.next());if(typeof e.length=="number")return new Z(()=>({index:0}),t=>t.index<e.length?{done:!1,value:e[t.index++]}:_e)}return n.length>1?new Z(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const t=e.iterator.next();if(!t.done)return t;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<n.length){const t=n[e.collIndex++];Gr(t)?e.iterator=t[Symbol.iterator]():t&&typeof t.length=="number"&&(e.array=t)}}while(e.iterator||e.array||e.collIndex<n.length);return _e}):ld}class Ds extends Z{constructor(e,t,r){super(()=>({iterators:r!=null&&r.includeRoot?[[e][Symbol.iterator]()]:[t(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(t(a.value)[Symbol.iterator]()),a}return _e})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Ji;(function(n){function e(s){return s.reduce((a,o)=>a+o,0)}n.sum=e;function t(s){return s.reduce((a,o)=>a*o,0)}n.product=t;function r(s){return s.reduce((a,o)=>Math.min(a,o))}n.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}n.max=i})(Ji||(Ji={}));function Qi(n){return new Ds(n,e=>qn(e)?e.content:[],{includeRoot:!0})}function cd(n,e){for(;n.container;)if(n=n.container,n===e)return!0;return!1}function Zi(n){return{start:{character:n.startColumn-1,line:n.startLine-1},end:{character:n.endColumn,line:n.endLine-1}}}function Ur(n){if(!n)return;const{offset:e,end:t,range:r}=n;return{range:r,offset:e,end:t,length:t-e}}var We;(function(n){n[n.Before=0]="Before",n[n.After=1]="After",n[n.OverlapFront=2]="OverlapFront",n[n.OverlapBack=3]="OverlapBack",n[n.Inside=4]="Inside",n[n.Outside=5]="Outside"})(We||(We={}));function ud(n,e){if(n.end.line<e.start.line||n.end.line===e.start.line&&n.end.character<=e.start.character)return We.Before;if(n.start.line>e.end.line||n.start.line===e.end.line&&n.start.character>=e.end.character)return We.After;const t=n.start.line>e.start.line||n.start.line===e.start.line&&n.start.character>=e.start.character,r=n.end.line<e.end.line||n.end.line===e.end.line&&n.end.character<=e.end.character;return t&&r?We.Inside:t?We.OverlapBack:r?We.OverlapFront:We.Outside}function dd(n,e){return ud(n,e)>We.After}const fd=/^[\w\p{L}]$/u;function hd(n,e){if(n){const t=pd(n,!0);if(t&&ma(t,e))return t;if(Sl(n)){const r=n.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=n.content[i];if(ma(s,e))return s}}}}function ma(n,e){return Il(n)&&e.includes(n.tokenType.name)}function pd(n,e=!0){for(;n.container;){const t=n.container;let r=t.content.indexOf(n);for(;r>0;){r--;const i=t.content[r];if(e||!i.hidden)return i}n=t}}class xl extends Error{constructor(e,t){super(e?`${t} at ${e.range.start.line}:${e.range.start.character}`:t)}}function Qn(n){throw new Error("Error! The input value was not handled.")}const sr="AbstractRule",ar="AbstractType",bi="Condition",ga="TypeDefinition",ki="ValueLiteral",un="AbstractElement";function md(n){return P.isInstance(n,un)}const or="ArrayLiteral",lr="ArrayType",dn="BooleanLiteral";function gd(n){return P.isInstance(n,dn)}const fn="Conjunction";function yd(n){return P.isInstance(n,fn)}const hn="Disjunction";function vd(n){return P.isInstance(n,hn)}const cr="Grammar",Ni="GrammarImport",pn="InferredType";function Cl(n){return P.isInstance(n,pn)}const mn="Interface";function wl(n){return P.isInstance(n,mn)}const Ii="NamedArgument",gn="Negation";function Td(n){return P.isInstance(n,gn)}const ur="NumberLiteral",dr="Parameter",yn="ParameterReference";function _d(n){return P.isInstance(n,yn)}const vn="ParserRule";function Ce(n){return P.isInstance(n,vn)}const fr="ReferenceType",kr="ReturnType";function Rd(n){return P.isInstance(n,kr)}const Tn="SimpleType";function Ed(n){return P.isInstance(n,Tn)}const hr="StringLiteral",St="TerminalRule";function Tt(n){return P.isInstance(n,St)}const _n="Type";function $l(n){return P.isInstance(n,_n)}const Si="TypeAttribute",pr="UnionType",Rn="Action";function ui(n){return P.isInstance(n,Rn)}const En="Alternatives";function Ol(n){return P.isInstance(n,En)}const An="Assignment";function ft(n){return P.isInstance(n,An)}const bn="CharacterRange";function Ad(n){return P.isInstance(n,bn)}const kn="CrossReference";function js(n){return P.isInstance(n,kn)}const Nn="EndOfFile";function bd(n){return P.isInstance(n,Nn)}const In="Group";function Gs(n){return P.isInstance(n,In)}const Sn="Keyword";function ht(n){return P.isInstance(n,Sn)}const xn="NegatedToken";function kd(n){return P.isInstance(n,xn)}const Cn="RegexToken";function Nd(n){return P.isInstance(n,Cn)}const wn="RuleCall";function pt(n){return P.isInstance(n,wn)}const $n="TerminalAlternatives";function Id(n){return P.isInstance(n,$n)}const On="TerminalGroup";function Sd(n){return P.isInstance(n,On)}const Ln="TerminalRuleCall";function xd(n){return P.isInstance(n,Ln)}const Mn="UnorderedGroup";function Ll(n){return P.isInstance(n,Mn)}const Pn="UntilToken";function Cd(n){return P.isInstance(n,Pn)}const Dn="Wildcard";function wd(n){return P.isInstance(n,Dn)}class Ml extends Nl{getAllTypes(){return[un,sr,ar,Rn,En,or,lr,An,dn,bn,bi,fn,kn,hn,Nn,cr,Ni,In,pn,mn,Sn,Ii,xn,gn,ur,dr,yn,vn,fr,Cn,kr,wn,Tn,hr,$n,On,St,Ln,_n,Si,ga,pr,Mn,Pn,ki,Dn]}computeIsSubtype(e,t){switch(e){case Rn:case En:case An:case bn:case kn:case Nn:case In:case Sn:case xn:case Cn:case wn:case $n:case On:case Ln:case Mn:case Pn:case Dn:return this.isSubtype(un,t);case or:case ur:case hr:return this.isSubtype(ki,t);case lr:case fr:case Tn:case pr:return this.isSubtype(ga,t);case dn:return this.isSubtype(bi,t)||this.isSubtype(ki,t);case fn:case hn:case gn:case yn:return this.isSubtype(bi,t);case pn:case mn:case _n:return this.isSubtype(ar,t);case vn:return this.isSubtype(sr,t)||this.isSubtype(ar,t);case St:return this.isSubtype(sr,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return ar;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return sr;case"Grammar:usedGrammars":return cr;case"NamedArgument:parameter":case"ParameterReference:parameter":return dr;case"TerminalRuleCall:rule":return St;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case un:return{name:un,properties:[{name:"cardinality"},{name:"lookahead"}]};case or:return{name:or,properties:[{name:"elements",defaultValue:[]}]};case lr:return{name:lr,properties:[{name:"elementType"}]};case dn:return{name:dn,properties:[{name:"true",defaultValue:!1}]};case fn:return{name:fn,properties:[{name:"left"},{name:"right"}]};case hn:return{name:hn,properties:[{name:"left"},{name:"right"}]};case cr:return{name:cr,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case Ni:return{name:Ni,properties:[{name:"path"}]};case pn:return{name:pn,properties:[{name:"name"}]};case mn:return{name:mn,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ii:return{name:Ii,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case gn:return{name:gn,properties:[{name:"value"}]};case ur:return{name:ur,properties:[{name:"value"}]};case dr:return{name:dr,properties:[{name:"name"}]};case yn:return{name:yn,properties:[{name:"parameter"}]};case vn:return{name:vn,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case fr:return{name:fr,properties:[{name:"referenceType"}]};case kr:return{name:kr,properties:[{name:"name"}]};case Tn:return{name:Tn,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case hr:return{name:hr,properties:[{name:"value"}]};case St:return{name:St,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case _n:return{name:_n,properties:[{name:"name"},{name:"type"}]};case Si:return{name:Si,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case pr:return{name:pr,properties:[{name:"types",defaultValue:[]}]};case Rn:return{name:Rn,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case En:return{name:En,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case An:return{name:An,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case bn:return{name:bn,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case kn:return{name:kn,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Nn:return{name:Nn,properties:[{name:"cardinality"},{name:"lookahead"}]};case In:return{name:In,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Sn:return{name:Sn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case xn:return{name:xn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Cn:return{name:Cn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case wn:return{name:wn,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case $n:return{name:$n,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case On:return{name:On,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Ln:return{name:Ln,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Mn:return{name:Mn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Pn:return{name:Pn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Dn:return{name:Dn,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const P=new Ml;function $d(n){for(const[e,t]of Object.entries(n))e.startsWith("$")||(Array.isArray(t)?t.forEach((r,i)=>{ae(r)&&(r.$container=n,r.$containerProperty=e,r.$containerIndex=i)}):ae(t)&&(t.$container=n,t.$containerProperty=e))}function di(n,e){let t=n;for(;t;){if(e(t))return t;t=t.$container}}function et(n){const t=es(n).$document;if(!t)throw new Error("AST node has no document.");return t}function es(n){for(;n.$container;)n=n.$container;return n}function Us(n,e){if(!n)throw new Error("Node must be an AstNode.");const t=e==null?void 0:e.range;return new Z(()=>({keys:Object.keys(n),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=n[i];if(ae(s)){if(r.keyIndex++,ya(s,t))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(ae(o)&&ya(o,t))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return _e})}function Zn(n,e){if(!n)throw new Error("Root node must be an AstNode.");return new Ds(n,t=>Us(t,e))}function Ct(n,e){if(!n)throw new Error("Root node must be an AstNode.");return new Ds(n,t=>Us(t,e),{includeRoot:!0})}function ya(n,e){var t;if(!e)return!0;const r=(t=n.$cstNode)===null||t===void 0?void 0:t.range;return r?dd(r,e):!1}function Pl(n){return new Z(()=>({keys:Object.keys(n),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const t=e.keys[e.keyIndex];if(!t.startsWith("$")){const r=n[t];if(Ue(r))return e.keyIndex++,{done:!1,value:{reference:r,container:n,property:t}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Ue(s))return{done:!1,value:{reference:s,container:n,property:t,index:i}}}e.arrayIndex=0}}e.keyIndex++}return _e})}function Od(n,e){const t=n.getTypeMetaData(e.$type),r=e;for(const i of t.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=Dl(i.defaultValue))}function Dl(n){return Array.isArray(n)?[...n.map(Dl)]:n}function C(n){return n.charCodeAt(0)}function xi(n,e){Array.isArray(n)?n.forEach(function(t){e.push(t)}):e.push(n)}function on(n,e){if(n[e]===!0)throw"duplicate flag "+e;n[e],n[e]=!0}function It(n){if(n===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ld(){throw Error("Internal Error - Should never get here!")}function va(n){return n.type==="Character"}const Fr=[];for(let n=C("0");n<=C("9");n++)Fr.push(n);const Br=[C("_")].concat(Fr);for(let n=C("a");n<=C("z");n++)Br.push(n);for(let n=C("A");n<=C("Z");n++)Br.push(n);const Ta=[C(" "),C("\f"),C(`
|
2
2
|
`),C("\r"),C(" "),C("\v"),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C(" "),C("\u2028"),C("\u2029"),C(" "),C(" "),C(" "),C("\uFEFF")],Md=/[0-9a-fA-F]/,mr=/[0-9]/,Pd=/[1-9]/;class jl{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 t=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":on(r,"global");break;case"i":on(r,"ignoreCase");break;case"m":on(r,"multiLine");break;case"u":on(r,"unicode");break;case"y":on(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}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 t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break}It(t);const r=this.disjunction();return this.consumeChar(")"),{type:t,value:r,loc:this.loc(e)}}return Ld()}quantifier(e=!1){let t;const r=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),t={atLeast:i,atMost:s}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;It(t);break}if(!(e===!0&&t===void 0)&&It(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(r),t}atom(){let e;const t=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()),It(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[C(`
|
3
3
|
`),C("\r"),C("\u2028"),C("\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,t=!1;switch(this.popChar()){case"d":e=Fr;break;case"D":e=Fr,t=!0;break;case"s":e=Ta;break;case"S":e=Ta,t=!0;break;case"w":e=Br;break;case"W":e=Br,t=!0;break}if(It(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=C("\f");break;case"n":e=C(`
|
4
4
|
`);break;case"r":e=C("\r");break;case"t":e=C(" ");break;case"v":e=C("\v");break}if(It(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:C("\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:C(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
@@ -9,7 +9,7 @@ var _u=Object.defineProperty;var Ru=(n,e,t)=>e in n?_u(n,e,{enumerable:!0,config
|
|
9
9
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let t="";for(let i=0;i<e;i++){const s=this.popChar();if(Md.test(s)===!1)throw Error("Expecting a HexDecimal digits");t+=s}return{type:"Character",value:parseInt(t,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 fi{visitChildren(e){for(const t in e){const r=e[t];e.hasOwnProperty(t)&&(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"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){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const Dd=/\r?\n/gm,jd=new jl;class Gd extends fi{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 t=String.fromCharCode(e.value);if(!this.multiline&&t===`
|
10
10
|
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=hi(t);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const t=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(t);this.multiline=!!`
|
11
11
|
`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const t=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(t),this.isStarting&&(this.startRegexp+=t)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const Ci=new Gd;function Ud(n){try{return typeof n=="string"&&(n=new RegExp(n)),n=n.toString(),Ci.reset(n),Ci.visit(jd.pattern(n)),Ci.multiline}catch{return!1}}const Fd=`\f
|
12
|
-
\r \v \u2028\u2029 \uFEFF`.split("");function ts(n){const e=typeof n=="string"?new RegExp(n):n;return Fd.some(t=>e.test(t))}function hi(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bd(n){return Array.prototype.map.call(n,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:hi(e)).join("")}function Hd(n,e){const t=Vd(n),r=e.match(t);return!!r&&r[0].length>0}function Vd(n){typeof n=="string"&&(n=new RegExp(n));const e=n,t=n.source;let r=0;function i(){let s="",a;function o(c){s+=t.substr(r,c),r+=c}function l(c){s+="(?:"+t.substr(r,c)+"|$)",r+=c}for(;r<t.length;)switch(t[r]){case"\\":switch(t[r+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?t[r+2]==="{"?l(t.indexOf("}",r)-r+1):l(6):l(2);break;case"p":case"P":e.unicode?l(t.indexOf("}",r)-r+1):l(2);break;case"k":l(t.indexOf(">",r)-r+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(t)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(t),a?o(a[0].length):l(1);break;case"(":if(t[r+1]==="?")switch(t[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=t.substr(a,r-a);break;case"<":switch(t[r+3]){case"=":case"!":a=r,r+=4,i(),s+=t.substr(a,r-a);break;default:o(t.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:l(1);break}return s}return new RegExp(i(),n.flags)}function Wd(n){return n.rules.find(e=>Ce(e)&&e.entry)}function Kd(n){return n.rules.filter(e=>Tt(e)&&e.hidden)}function Gl(n,e){const t=new Set,r=Wd(n);if(!r)return new Set(n.rules);const i=[r].concat(Kd(n));for(const a of i)Ul(a,t,e);const s=new Set;for(const a of n.rules)(t.has(a.name)||Tt(a)&&a.hidden)&&s.add(a);return s}function Ul(n,e,t){e.add(n.name),Zn(n).forEach(r=>{if(pt(r)||t){const i=r.rule.ref;i&&!e.has(i.name)&&Ul(i,e,t)}})}function zd(n){if(n.terminal)return n.terminal;if(n.type.ref){const e=Bl(n.type.ref);return e==null?void 0:e.terminal}}function Xd(n){return n.hidden&&!ts(Vs(n))}function qd(n,e){return!n||!e?[]:Fs(n,e,n.astNode,!0)}function Fl(n,e,t){if(!n||!e)return;const r=Fs(n,e,n.astNode,!0);if(r.length!==0)return t!==void 0?t=Math.max(0,Math.min(t,r.length-1)):t=0,r[t]}function Fs(n,e,t,r){if(!r){const i=di(n.grammarSource,ft);if(i&&i.feature===e)return[n]}return Xn(n)&&n.astNode===t?n.content.flatMap(i=>Fs(i,e,t,!1)):[]}function Yd(n,e,t){if(!n)return;const r=Jd(n,e,n==null?void 0:n.astNode);if(r.length!==0)return t!==void 0?t=Math.max(0,Math.min(t,r.length-1)):t=0,r[t]}function Jd(n,e,t){if(n.astNode!==t)return[];if(ht(n.grammarSource)&&n.grammarSource.value===e)return[n];const r=Qi(n).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===t?ht(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function Qd(n){var e;const t=n.astNode;for(;t===((e=n.container)===null||e===void 0?void 0:e.astNode);){const r=di(n.grammarSource,ft);if(r)return r;n=n.container}}function Bl(n){let e=n;return Cl(e)&&(ui(e.$container)?e=e.$container.$container:Ce(e.$container)?e=e.$container:Qn(e.$container)),Hl(n,e,new Map)}function Hl(n,e,t){var r;function i(s,a){let o;return di(s,ft)||(o=Hl(a,a,t)),t.set(n,o),o}if(t.has(n))return t.get(n);t.set(n,void 0);for(const s of Zn(e)){if(ft(s)&&s.feature.toLowerCase()==="name")return t.set(n,s),s;if(pt(s)&&Ce(s.rule.ref))return i(s,s.rule.ref);if(Ed(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function Vl(n){return Wl(n,new Set)}function Wl(n,e){if(e.has(n))return!0;e.add(n);for(const t of Zn(n))if(pt(t)){if(!t.rule.ref||Ce(t.rule.ref)&&!Wl(t.rule.ref,e))return!1}else{if(ft(t))return!1;if(ui(t))return!1}return!!n.definition}function Bs(n){if(n.inferredType)return n.inferredType.name;if(n.dataType)return n.dataType;if(n.returnType){const e=n.returnType.ref;if(e){if(Ce(e))return e.name;if(wl(e)||$l(e))return e.name}}}function Hs(n){var e;if(Ce(n))return Vl(n)?n.name:(e=Bs(n))!==null&&e!==void 0?e:n.name;if(wl(n)||$l(n)||Rd(n))return n.name;if(ui(n)){const t=Zd(n);if(t)return t}else if(Cl(n))return n.name;throw new Error("Cannot get name of Unknown Type")}function Zd(n){var e;if(n.inferredType)return n.inferredType.name;if(!((e=n.type)===null||e===void 0)&&e.ref)return Hs(n.type.ref)}function ef(n){var e,t,r;return Tt(n)?(t=(e=n.type)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:"string":(r=Bs(n))!==null&&r!==void 0?r:n.name}function Vs(n){const e={s:!1,i:!1,u:!1},t=en(n.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(t,r)}const Ws=/[\s\S]/.source;function en(n,e){if(Id(n))return tf(n);if(Sd(n))return nf(n);if(Ad(n))return af(n);if(xd(n)){const t=n.rule.ref;if(!t)throw new Error("Missing rule reference.");return ze(en(t.definition),{cardinality:n.cardinality,lookahead:n.lookahead})}else{if(kd(n))return sf(n);if(Cd(n))return rf(n);if(Nd(n)){const t=n.regex.lastIndexOf("/"),r=n.regex.substring(1,t),i=n.regex.substring(t+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ze(r,{cardinality:n.cardinality,lookahead:n.lookahead,wrap:!1})}else{if(wd(n))return ze(Ws,{cardinality:n.cardinality,lookahead:n.lookahead});throw new Error(`Invalid terminal element: ${n==null?void 0:n.$type}`)}}}function tf(n){return ze(n.elements.map(e=>en(e)).join("|"),{cardinality:n.cardinality,lookahead:n.lookahead})}function nf(n){return ze(n.elements.map(e=>en(e)).join(""),{cardinality:n.cardinality,lookahead:n.lookahead})}function rf(n){return ze(`${Ws}*?${en(n.terminal)}`,{cardinality:n.cardinality,lookahead:n.lookahead})}function sf(n){return ze(`(?!${en(n.terminal)})${Ws}*?`,{cardinality:n.cardinality,lookahead:n.lookahead})}function af(n){return n.right?ze(`[${wi(n.left)}-${wi(n.right)}]`,{cardinality:n.cardinality,lookahead:n.lookahead,wrap:!1}):ze(wi(n.left),{cardinality:n.cardinality,lookahead:n.lookahead,wrap:!1})}function wi(n){return hi(n.value)}function ze(n,e){var t;return(e.wrap!==!1||e.lookahead)&&(n=`(${(t=e.lookahead)!==null&&t!==void 0?t:""}${n})`),e.cardinality?`${n}${e.cardinality}`:n}function of(n){const e=[],t=n.Grammar;for(const r of t.rules)Tt(r)&&Xd(r)&&Ud(Vs(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:fd}}function ns(n){console&&console.error&&console.error(`Error: ${n}`)}function Kl(n){console&&console.warn&&console.warn(`Warning: ${n}`)}function zl(n){const e=new Date().getTime(),t=n();return{time:new Date().getTime()-e,value:t}}function Xl(n){function e(){}e.prototype=n;const t=new e;function r(){return typeof t.bar}return r(),r(),n}function lf(n){return cf(n)?n.LABEL:n.name}function cf(n){return fe(n.LABEL)&&n.LABEL!==""}class Fe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),S(this.definition,t=>{t.accept(e)})}}class le extends Fe{constructor(e){super([]),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class tn extends Fe{constructor(e){super(e.definition),this.orgText="",Ae(this,Pe(e,t=>t!==void 0))}}class he extends Fe{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Ae(this,Pe(e,t=>t!==void 0))}}let ne=class extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}};class ke extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class Ne extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class V extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class me extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class ge extends Fe{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,Ae(this,Pe(e,t=>t!==void 0))}}class G{constructor(e){this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}accept(e){e.visit(this)}}function uf(n){return k(n,Nr)}function Nr(n){function e(t){return k(t,Nr)}if(n instanceof le){const t={type:"NonTerminal",name:n.nonTerminalName,idx:n.idx};return fe(n.label)&&(t.label=n.label),t}else{if(n instanceof he)return{type:"Alternative",definition:e(n.definition)};if(n instanceof ne)return{type:"Option",idx:n.idx,definition:e(n.definition)};if(n instanceof ke)return{type:"RepetitionMandatory",idx:n.idx,definition:e(n.definition)};if(n instanceof Ne)return{type:"RepetitionMandatoryWithSeparator",idx:n.idx,separator:Nr(new G({terminalType:n.separator})),definition:e(n.definition)};if(n instanceof me)return{type:"RepetitionWithSeparator",idx:n.idx,separator:Nr(new G({terminalType:n.separator})),definition:e(n.definition)};if(n instanceof V)return{type:"Repetition",idx:n.idx,definition:e(n.definition)};if(n instanceof ge)return{type:"Alternation",idx:n.idx,definition:e(n.definition)};if(n instanceof G){const t={type:"Terminal",name:n.terminalType.name,label:lf(n.terminalType),idx:n.idx};fe(n.label)&&(t.terminalLabel=n.label);const r=n.terminalType.PATTERN;return n.terminalType.PATTERN&&(t.pattern=qe(r)?r.source:r),t}else{if(n instanceof tn)return{type:"Rule",name:n.name,orgText:n.orgText,definition:e(n.definition)};throw Error("non exhaustive match")}}}class nn{visit(e){const t=e;switch(t.constructor){case le:return this.visitNonTerminal(t);case he:return this.visitAlternative(t);case ne:return this.visitOption(t);case ke:return this.visitRepetitionMandatory(t);case Ne:return this.visitRepetitionMandatoryWithSeparator(t);case me:return this.visitRepetitionWithSeparator(t);case V:return this.visitRepetition(t);case ge:return this.visitAlternation(t);case G:return this.visitTerminal(t);case tn:return this.visitRule(t);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 df(n){return n instanceof he||n instanceof ne||n instanceof V||n instanceof ke||n instanceof Ne||n instanceof me||n instanceof G||n instanceof tn}function Hr(n,e=[]){return n instanceof ne||n instanceof V||n instanceof me?!0:n instanceof ge?kl(n.definition,r=>Hr(r,e)):n instanceof le&&ue(e,n)?!1:n instanceof Fe?(n instanceof le&&e.push(n),Le(n.definition,r=>Hr(r,e))):!1}function ff(n){return n instanceof ge}function Ge(n){if(n instanceof le)return"SUBRULE";if(n instanceof ne)return"OPTION";if(n instanceof ge)return"OR";if(n instanceof ke)return"AT_LEAST_ONE";if(n instanceof Ne)return"AT_LEAST_ONE_SEP";if(n instanceof me)return"MANY_SEP";if(n instanceof V)return"MANY";if(n instanceof G)return"CONSUME";throw Error("non exhaustive match")}class pi{walk(e,t=[]){S(e.definition,(r,i)=>{const s=Q(e.definition,i+1);if(r instanceof le)this.walkProdRef(r,s,t);else if(r instanceof G)this.walkTerminal(r,s,t);else if(r instanceof he)this.walkFlat(r,s,t);else if(r instanceof ne)this.walkOption(r,s,t);else if(r instanceof ke)this.walkAtLeastOne(r,s,t);else if(r instanceof Ne)this.walkAtLeastOneSep(r,s,t);else if(r instanceof me)this.walkManySep(r,s,t);else if(r instanceof V)this.walkMany(r,s,t);else if(r instanceof ge)this.walkOr(r,s,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const i=t.concat(r);this.walk(e,i)}walkOption(e,t,r){const i=t.concat(r);this.walk(e,i)}walkAtLeastOne(e,t,r){const i=[new ne({definition:e.definition})].concat(t,r);this.walk(e,i)}walkAtLeastOneSep(e,t,r){const i=_a(e,t,r);this.walk(e,i)}walkMany(e,t,r){const i=[new ne({definition:e.definition})].concat(t,r);this.walk(e,i)}walkManySep(e,t,r){const i=_a(e,t,r);this.walk(e,i)}walkOr(e,t,r){const i=t.concat(r);S(e.definition,s=>{const a=new he({definition:[s]});this.walk(a,i)})}}function _a(n,e,t){return[new ne({definition:[new G({terminalType:n.separator})].concat(n.definition)})].concat(e,t)}function er(n){if(n instanceof le)return er(n.referencedRule);if(n instanceof G)return mf(n);if(df(n))return hf(n);if(ff(n))return pf(n);throw Error("non exhaustive match")}function hf(n){let e=[];const t=n.definition;let r=0,i=t.length>r,s,a=!0;for(;i&&a;)s=t[r],a=Hr(s),e=e.concat(er(s)),r=r+1,i=t.length>r;return Ps(e)}function pf(n){const e=k(n.definition,t=>er(t));return Ps(xe(e))}function mf(n){return[n.terminalType]}const ql="_~IN~_";class gf extends pi{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const i=vf(e.referencedRule,e.idx)+this.topProd.name,s=t.concat(r),a=new he({definition:s}),o=er(a);this.follows[i]=o}}function yf(n){const e={};return S(n,t=>{const r=new gf(t).startWalking();Ae(e,r)}),e}function vf(n,e){return n.name+e+ql}let Ir={};const Tf=new jl;function mi(n){const e=n.toString();if(Ir.hasOwnProperty(e))return Ir[e];{const t=Tf.pattern(e);return Ir[e]=t,t}}function _f(){Ir={}}const Yl="Complement Sets are not supported for first char optimization",Vr=`Unable to use "first char" lexer optimizations:
|
12
|
+
\r \v \u2028\u2029 \uFEFF`.split("");function ts(n){const e=typeof n=="string"?new RegExp(n):n;return Fd.some(t=>e.test(t))}function hi(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bd(n){return Array.prototype.map.call(n,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:hi(e)).join("")}function Hd(n,e){const t=Vd(n),r=e.match(t);return!!r&&r[0].length>0}function Vd(n){typeof n=="string"&&(n=new RegExp(n));const e=n,t=n.source;let r=0;function i(){let s="",a;function o(c){s+=t.substr(r,c),r+=c}function l(c){s+="(?:"+t.substr(r,c)+"|$)",r+=c}for(;r<t.length;)switch(t[r]){case"\\":switch(t[r+1]){case"c":l(3);break;case"x":l(4);break;case"u":e.unicode?t[r+2]==="{"?l(t.indexOf("}",r)-r+1):l(6):l(2);break;case"p":case"P":e.unicode?l(t.indexOf("}",r)-r+1):l(2);break;case"k":l(t.indexOf(">",r)-r+1);break;default:l(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(t)||[],l(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(t),a?o(a[0].length):l(1);break;case"(":if(t[r+1]==="?")switch(t[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=t.substr(a,r-a);break;case"<":switch(t[r+3]){case"=":case"!":a=r,r+=4,i(),s+=t.substr(a,r-a);break;default:o(t.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:l(1);break}return s}return new RegExp(i(),n.flags)}function Wd(n){return n.rules.find(e=>Ce(e)&&e.entry)}function Kd(n){return n.rules.filter(e=>Tt(e)&&e.hidden)}function Gl(n,e){const t=new Set,r=Wd(n);if(!r)return new Set(n.rules);const i=[r].concat(Kd(n));for(const a of i)Ul(a,t,e);const s=new Set;for(const a of n.rules)(t.has(a.name)||Tt(a)&&a.hidden)&&s.add(a);return s}function Ul(n,e,t){e.add(n.name),Zn(n).forEach(r=>{if(pt(r)||t){const i=r.rule.ref;i&&!e.has(i.name)&&Ul(i,e,t)}})}function zd(n){if(n.terminal)return n.terminal;if(n.type.ref){const e=Bl(n.type.ref);return e==null?void 0:e.terminal}}function qd(n){return n.hidden&&!ts(Vs(n))}function Xd(n,e){return!n||!e?[]:Fs(n,e,n.astNode,!0)}function Fl(n,e,t){if(!n||!e)return;const r=Fs(n,e,n.astNode,!0);if(r.length!==0)return t!==void 0?t=Math.max(0,Math.min(t,r.length-1)):t=0,r[t]}function Fs(n,e,t,r){if(!r){const i=di(n.grammarSource,ft);if(i&&i.feature===e)return[n]}return qn(n)&&n.astNode===t?n.content.flatMap(i=>Fs(i,e,t,!1)):[]}function Yd(n,e,t){if(!n)return;const r=Jd(n,e,n==null?void 0:n.astNode);if(r.length!==0)return t!==void 0?t=Math.max(0,Math.min(t,r.length-1)):t=0,r[t]}function Jd(n,e,t){if(n.astNode!==t)return[];if(ht(n.grammarSource)&&n.grammarSource.value===e)return[n];const r=Qi(n).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===t?ht(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function Qd(n){var e;const t=n.astNode;for(;t===((e=n.container)===null||e===void 0?void 0:e.astNode);){const r=di(n.grammarSource,ft);if(r)return r;n=n.container}}function Bl(n){let e=n;return Cl(e)&&(ui(e.$container)?e=e.$container.$container:Ce(e.$container)?e=e.$container:Qn(e.$container)),Hl(n,e,new Map)}function Hl(n,e,t){var r;function i(s,a){let o;return di(s,ft)||(o=Hl(a,a,t)),t.set(n,o),o}if(t.has(n))return t.get(n);t.set(n,void 0);for(const s of Zn(e)){if(ft(s)&&s.feature.toLowerCase()==="name")return t.set(n,s),s;if(pt(s)&&Ce(s.rule.ref))return i(s,s.rule.ref);if(Ed(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function Vl(n){return Wl(n,new Set)}function Wl(n,e){if(e.has(n))return!0;e.add(n);for(const t of Zn(n))if(pt(t)){if(!t.rule.ref||Ce(t.rule.ref)&&!Wl(t.rule.ref,e))return!1}else{if(ft(t))return!1;if(ui(t))return!1}return!!n.definition}function Bs(n){if(n.inferredType)return n.inferredType.name;if(n.dataType)return n.dataType;if(n.returnType){const e=n.returnType.ref;if(e){if(Ce(e))return e.name;if(wl(e)||$l(e))return e.name}}}function Hs(n){var e;if(Ce(n))return Vl(n)?n.name:(e=Bs(n))!==null&&e!==void 0?e:n.name;if(wl(n)||$l(n)||Rd(n))return n.name;if(ui(n)){const t=Zd(n);if(t)return t}else if(Cl(n))return n.name;throw new Error("Cannot get name of Unknown Type")}function Zd(n){var e;if(n.inferredType)return n.inferredType.name;if(!((e=n.type)===null||e===void 0)&&e.ref)return Hs(n.type.ref)}function ef(n){var e,t,r;return Tt(n)?(t=(e=n.type)===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:"string":(r=Bs(n))!==null&&r!==void 0?r:n.name}function Vs(n){const e={s:!1,i:!1,u:!1},t=en(n.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(t,r)}const Ws=/[\s\S]/.source;function en(n,e){if(Id(n))return tf(n);if(Sd(n))return nf(n);if(Ad(n))return af(n);if(xd(n)){const t=n.rule.ref;if(!t)throw new Error("Missing rule reference.");return ze(en(t.definition),{cardinality:n.cardinality,lookahead:n.lookahead})}else{if(kd(n))return sf(n);if(Cd(n))return rf(n);if(Nd(n)){const t=n.regex.lastIndexOf("/"),r=n.regex.substring(1,t),i=n.regex.substring(t+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ze(r,{cardinality:n.cardinality,lookahead:n.lookahead,wrap:!1})}else{if(wd(n))return ze(Ws,{cardinality:n.cardinality,lookahead:n.lookahead});throw new Error(`Invalid terminal element: ${n==null?void 0:n.$type}`)}}}function tf(n){return ze(n.elements.map(e=>en(e)).join("|"),{cardinality:n.cardinality,lookahead:n.lookahead})}function nf(n){return ze(n.elements.map(e=>en(e)).join(""),{cardinality:n.cardinality,lookahead:n.lookahead})}function rf(n){return ze(`${Ws}*?${en(n.terminal)}`,{cardinality:n.cardinality,lookahead:n.lookahead})}function sf(n){return ze(`(?!${en(n.terminal)})${Ws}*?`,{cardinality:n.cardinality,lookahead:n.lookahead})}function af(n){return n.right?ze(`[${wi(n.left)}-${wi(n.right)}]`,{cardinality:n.cardinality,lookahead:n.lookahead,wrap:!1}):ze(wi(n.left),{cardinality:n.cardinality,lookahead:n.lookahead,wrap:!1})}function wi(n){return hi(n.value)}function ze(n,e){var t;return(e.wrap!==!1||e.lookahead)&&(n=`(${(t=e.lookahead)!==null&&t!==void 0?t:""}${n})`),e.cardinality?`${n}${e.cardinality}`:n}function of(n){const e=[],t=n.Grammar;for(const r of t.rules)Tt(r)&&qd(r)&&Ud(Vs(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:fd}}function ns(n){console&&console.error&&console.error(`Error: ${n}`)}function Kl(n){console&&console.warn&&console.warn(`Warning: ${n}`)}function zl(n){const e=new Date().getTime(),t=n();return{time:new Date().getTime()-e,value:t}}function ql(n){function e(){}e.prototype=n;const t=new e;function r(){return typeof t.bar}return r(),r(),n}function lf(n){return cf(n)?n.LABEL:n.name}function cf(n){return fe(n.LABEL)&&n.LABEL!==""}class Fe{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),S(this.definition,t=>{t.accept(e)})}}class le extends Fe{constructor(e){super([]),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class tn extends Fe{constructor(e){super(e.definition),this.orgText="",Ae(this,Pe(e,t=>t!==void 0))}}class he extends Fe{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Ae(this,Pe(e,t=>t!==void 0))}}let ne=class extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}};class ke extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class Ne extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class V extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class me extends Fe{constructor(e){super(e.definition),this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}}class ge extends Fe{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,Ae(this,Pe(e,t=>t!==void 0))}}class G{constructor(e){this.idx=1,Ae(this,Pe(e,t=>t!==void 0))}accept(e){e.visit(this)}}function uf(n){return k(n,Nr)}function Nr(n){function e(t){return k(t,Nr)}if(n instanceof le){const t={type:"NonTerminal",name:n.nonTerminalName,idx:n.idx};return fe(n.label)&&(t.label=n.label),t}else{if(n instanceof he)return{type:"Alternative",definition:e(n.definition)};if(n instanceof ne)return{type:"Option",idx:n.idx,definition:e(n.definition)};if(n instanceof ke)return{type:"RepetitionMandatory",idx:n.idx,definition:e(n.definition)};if(n instanceof Ne)return{type:"RepetitionMandatoryWithSeparator",idx:n.idx,separator:Nr(new G({terminalType:n.separator})),definition:e(n.definition)};if(n instanceof me)return{type:"RepetitionWithSeparator",idx:n.idx,separator:Nr(new G({terminalType:n.separator})),definition:e(n.definition)};if(n instanceof V)return{type:"Repetition",idx:n.idx,definition:e(n.definition)};if(n instanceof ge)return{type:"Alternation",idx:n.idx,definition:e(n.definition)};if(n instanceof G){const t={type:"Terminal",name:n.terminalType.name,label:lf(n.terminalType),idx:n.idx};fe(n.label)&&(t.terminalLabel=n.label);const r=n.terminalType.PATTERN;return n.terminalType.PATTERN&&(t.pattern=Xe(r)?r.source:r),t}else{if(n instanceof tn)return{type:"Rule",name:n.name,orgText:n.orgText,definition:e(n.definition)};throw Error("non exhaustive match")}}}class nn{visit(e){const t=e;switch(t.constructor){case le:return this.visitNonTerminal(t);case he:return this.visitAlternative(t);case ne:return this.visitOption(t);case ke:return this.visitRepetitionMandatory(t);case Ne:return this.visitRepetitionMandatoryWithSeparator(t);case me:return this.visitRepetitionWithSeparator(t);case V:return this.visitRepetition(t);case ge:return this.visitAlternation(t);case G:return this.visitTerminal(t);case tn:return this.visitRule(t);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 df(n){return n instanceof he||n instanceof ne||n instanceof V||n instanceof ke||n instanceof Ne||n instanceof me||n instanceof G||n instanceof tn}function Hr(n,e=[]){return n instanceof ne||n instanceof V||n instanceof me?!0:n instanceof ge?kl(n.definition,r=>Hr(r,e)):n instanceof le&&ue(e,n)?!1:n instanceof Fe?(n instanceof le&&e.push(n),Le(n.definition,r=>Hr(r,e))):!1}function ff(n){return n instanceof ge}function Ge(n){if(n instanceof le)return"SUBRULE";if(n instanceof ne)return"OPTION";if(n instanceof ge)return"OR";if(n instanceof ke)return"AT_LEAST_ONE";if(n instanceof Ne)return"AT_LEAST_ONE_SEP";if(n instanceof me)return"MANY_SEP";if(n instanceof V)return"MANY";if(n instanceof G)return"CONSUME";throw Error("non exhaustive match")}class pi{walk(e,t=[]){S(e.definition,(r,i)=>{const s=Q(e.definition,i+1);if(r instanceof le)this.walkProdRef(r,s,t);else if(r instanceof G)this.walkTerminal(r,s,t);else if(r instanceof he)this.walkFlat(r,s,t);else if(r instanceof ne)this.walkOption(r,s,t);else if(r instanceof ke)this.walkAtLeastOne(r,s,t);else if(r instanceof Ne)this.walkAtLeastOneSep(r,s,t);else if(r instanceof me)this.walkManySep(r,s,t);else if(r instanceof V)this.walkMany(r,s,t);else if(r instanceof ge)this.walkOr(r,s,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,r){}walkProdRef(e,t,r){}walkFlat(e,t,r){const i=t.concat(r);this.walk(e,i)}walkOption(e,t,r){const i=t.concat(r);this.walk(e,i)}walkAtLeastOne(e,t,r){const i=[new ne({definition:e.definition})].concat(t,r);this.walk(e,i)}walkAtLeastOneSep(e,t,r){const i=_a(e,t,r);this.walk(e,i)}walkMany(e,t,r){const i=[new ne({definition:e.definition})].concat(t,r);this.walk(e,i)}walkManySep(e,t,r){const i=_a(e,t,r);this.walk(e,i)}walkOr(e,t,r){const i=t.concat(r);S(e.definition,s=>{const a=new he({definition:[s]});this.walk(a,i)})}}function _a(n,e,t){return[new ne({definition:[new G({terminalType:n.separator})].concat(n.definition)})].concat(e,t)}function er(n){if(n instanceof le)return er(n.referencedRule);if(n instanceof G)return mf(n);if(df(n))return hf(n);if(ff(n))return pf(n);throw Error("non exhaustive match")}function hf(n){let e=[];const t=n.definition;let r=0,i=t.length>r,s,a=!0;for(;i&&a;)s=t[r],a=Hr(s),e=e.concat(er(s)),r=r+1,i=t.length>r;return Ps(e)}function pf(n){const e=k(n.definition,t=>er(t));return Ps(xe(e))}function mf(n){return[n.terminalType]}const Xl="_~IN~_";class gf extends pi{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,r){}walkProdRef(e,t,r){const i=vf(e.referencedRule,e.idx)+this.topProd.name,s=t.concat(r),a=new he({definition:s}),o=er(a);this.follows[i]=o}}function yf(n){const e={};return S(n,t=>{const r=new gf(t).startWalking();Ae(e,r)}),e}function vf(n,e){return n.name+e+Xl}let Ir={};const Tf=new jl;function mi(n){const e=n.toString();if(Ir.hasOwnProperty(e))return Ir[e];{const t=Tf.pattern(e);return Ir[e]=t,t}}function _f(){Ir={}}const Yl="Complement Sets are not supported for first char optimization",Vr=`Unable to use "first char" lexer optimizations:
|
13
13
|
`;function Rf(n,e=!1){try{const t=mi(n);return rs(t.value,{},t.flags.ignoreCase)}catch(t){if(t.message===Yl)e&&Kl(`${Vr} Unable to optimize: < ${n.toString()} >
|
14
14
|
Complement Sets cannot be automatically optimized.
|
15
15
|
This will disable the lexer's first char optimizations.
|
@@ -19,41 +19,41 @@ var _u=Object.defineProperty;var Ru=(n,e,t)=>e in n?_u(n,e,{enumerable:!0,config
|
|
19
19
|
Failed parsing: < ${n.toString()} >
|
20
20
|
Using the @chevrotain/regexp-to-ast library
|
21
21
|
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function rs(n,e,t){switch(n.type){case"Disjunction":for(let i=0;i<n.value.length;i++)rs(n.value[i],e,t);break;case"Alternative":const r=n.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"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":gr(a.value,e,t);break;case"Set":if(a.complement===!0)throw Error(Yl);S(a.value,l=>{if(typeof l=="number")gr(l,e,t);else{const c=l;if(t===!0)for(let u=c.from;u<=c.to;u++)gr(u,e,t);else{for(let u=c.from;u<=c.to&&u<Gn;u++)gr(u,e,t);if(c.to>=Gn){const u=c.from>=Gn?c.from:Gn,d=c.to,h=tt(u),f=tt(d);for(let m=h;m<=f;m++)e[m]=m}}}});break;case"Group":rs(a.value,e,t);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&is(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return z(e)}function gr(n,e,t){const r=tt(n);e[r]=r,t===!0&&Ef(n,e)}function Ef(n,e){const t=String.fromCharCode(n),r=t.toUpperCase();if(r!==t){const i=tt(r.charCodeAt(0));e[i]=i}else{const i=t.toLowerCase();if(i!==t){const s=tt(i.charCodeAt(0));e[s]=s}}}function Ra(n,e){return zt(n.value,t=>{if(typeof t=="number")return ue(e,t);{const r=t;return zt(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function is(n){const e=n.quantifier;return e&&e.atLeast===0?!0:n.value?te(n.value)?Le(n.value,is):is(n.value):!1}class Af extends fi{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}super.visitChildren(e)}}visitCharacter(e){ue(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Ra(e,this.targetCharCodes)===void 0&&(this.found=!0):Ra(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Ks(n,e){if(e instanceof RegExp){const t=mi(e),r=new Af(n);return r.visit(t),r.found}else return zt(e,t=>ue(n,t.charCodeAt(0)))!==void 0}const mt="PATTERN",jn="defaultMode",yr="modes";let Jl=typeof new RegExp("(?:)").sticky=="boolean";function bf(n,e){e=Ms(e,{useSticky:Jl,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
22
|
-
`],tracer:(R,T)=>T()});const t=e.tracer;t("initCharCodeToOptimizedIndexMap",()=>{zf()});let r;t("Reject Lexer.NA",()=>{r=ci(n,R=>R[mt]===de.NA)});let i=!1,s;t("Transform Patterns",()=>{i=!1,s=k(r,R=>{const T=R[mt];if(
|
22
|
+
`],tracer:(R,T)=>T()});const t=e.tracer;t("initCharCodeToOptimizedIndexMap",()=>{zf()});let r;t("Reject Lexer.NA",()=>{r=ci(n,R=>R[mt]===de.NA)});let i=!1,s;t("Transform Patterns",()=>{i=!1,s=k(r,R=>{const T=R[mt];if(Xe(T)){const I=T.source;return I.length===1&&I!=="^"&&I!=="$"&&I!=="."&&!T.ignoreCase?I:I.length===2&&I[0]==="\\"&&!ue(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],I[1])?I[1]:e.useSticky?Aa(T):Ea(T)}else{if(vt(T))return i=!0,{exec:T};if(typeof T=="object")return i=!0,T;if(typeof T=="string"){if(T.length===1)return T;{const I=T.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),j=new RegExp(I);return e.useSticky?Aa(j):Ea(j)}}else throw Error("non exhaustive match")}})});let a,o,l,c,u;t("misc mapping",()=>{a=k(r,R=>R.tokenTypeIdx),o=k(r,R=>{const T=R.GROUP;if(T!==de.SKIPPED){if(fe(T))return T;if(qe(T))return!1;throw Error("non exhaustive match")}}),l=k(r,R=>{const T=R.LONGER_ALT;if(T)return te(T)?k(T,j=>ha(r,j)):[ha(r,T)]}),c=k(r,R=>R.PUSH_MODE),u=k(r,R=>x(R,"POP_MODE"))});let d;t("Line Terminator Handling",()=>{const R=ec(e.lineTerminatorCharacters);d=k(r,T=>!1),e.positionTracking!=="onlyOffset"&&(d=k(r,T=>x(T,"LINE_BREAKS")?!!T.LINE_BREAKS:Zl(T,R)===!1&&Ks(R,T.PATTERN)))});let h,f,m,g;t("Misc Mapping #2",()=>{h=k(r,Ql),f=k(s,Vf),m=oe(r,(R,T)=>{const I=T.GROUP;return fe(I)&&I!==de.SKIPPED&&(R[I]=[]),R},{}),g=k(s,(R,T)=>({pattern:s[T],longerAlt:l[T],canLineTerminator:d[T],isCustom:h[T],short:f[T],group:o[T],push:c[T],pop:u[T],tokenTypeIdx:a[T],tokenType:r[T]}))});let _=!0,y=[];return e.safeMode||t("First Char Optimization",()=>{y=oe(r,(R,T,I)=>{if(typeof T.PATTERN=="string"){const j=T.PATTERN.charCodeAt(0),ie=tt(j);$i(R,ie,g[I])}else if(te(T.START_CHARS_HINT)){let j;S(T.START_CHARS_HINT,ie=>{const we=typeof ie=="string"?ie.charCodeAt(0):ie,ye=tt(we);j!==ye&&(j=ye,$i(R,ye,g[I]))})}else if(Xe(T.PATTERN))if(T.PATTERN.unicode)_=!1,e.ensureOptimizations&&ns(`${Vr} Unable to analyze < ${T.PATTERN.toString()} > pattern.
|
23
23
|
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
24
24
|
This will disable the lexer's first char optimizations.
|
25
25
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const j=Rf(T.PATTERN,e.ensureOptimizations);D(j)&&(_=!1),S(j,ie=>{$i(R,ie,g[I])})}else e.ensureOptimizations&&ns(`${Vr} TokenType: <${T.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
26
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`),_=!1;return R},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:_}}function kf(n,e){let t=[];const r=If(n);t=t.concat(r.errors);const i=Sf(r.valid),s=i.valid;return t=t.concat(i.errors),t=t.concat(Nf(s)),t=t.concat(Pf(s)),t=t.concat(Df(s,e)),t=t.concat(jf(s)),t}function Nf(n){let e=[];const t=be(n,r=>
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),_=!1;return R},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:_}}function kf(n,e){let t=[];const r=If(n);t=t.concat(r.errors);const i=Sf(r.valid),s=i.valid;return t=t.concat(i.errors),t=t.concat(Nf(s)),t=t.concat(Pf(s)),t=t.concat(Df(s,e)),t=t.concat(jf(s)),t}function Nf(n){let e=[];const t=be(n,r=>Xe(r[mt]));return e=e.concat(Cf(t)),e=e.concat(Of(t)),e=e.concat(Lf(t)),e=e.concat(Mf(t)),e=e.concat(wf(t)),e}function If(n){const e=be(n,i=>!x(i,mt)),t=k(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:W.MISSING_PATTERN,tokenTypes:[i]})),r=li(n,e);return{errors:t,valid:r}}function Sf(n){const e=be(n,i=>{const s=i[mt];return!Xe(s)&&!vt(s)&&!x(s,"exec")&&!fe(s)}),t=k(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:W.INVALID_PATTERN,tokenTypes:[i]})),r=li(n,e);return{errors:t,valid:r}}const xf=/[^\\][$]/;function Cf(n){class e extends fi{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const t=be(n,i=>{const s=i.PATTERN;try{const a=mi(s),o=new e;return o.visit(a),o.found}catch{return xf.test(s.source)}});return k(t,i=>({message:`Unexpected RegExp Anchor Error:
|
28
28
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
29
29
|
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:W.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function wf(n){const e=be(n,r=>r.PATTERN.test(""));return k(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:W.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const $f=/[^\\[][\^]|^\^/;function Of(n){class e extends fi{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const t=be(n,i=>{const s=i.PATTERN;try{const a=mi(s),o=new e;return o.visit(a),o.found}catch{return $f.test(s.source)}});return k(t,i=>({message:`Unexpected RegExp Anchor Error:
|
30
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:W.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Lf(n){const e=be(n,r=>{const i=r[mt];return i instanceof RegExp&&(i.multiline||i.global)});return k(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:W.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function Mf(n){const e=[];let t=k(n,s=>oe(n,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!ue(e,o)&&o.PATTERN!==de.NA&&(e.push(o),a.push(o)),a),[]));t=Jn(t);const r=be(t,s=>s.length>1);return k(r,s=>{const a=k(s,l=>l.name);return{message:`The same RegExp pattern ->${Me(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:W.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function Pf(n){const e=be(n,r=>{if(!x(r,"GROUP"))return!1;const i=r.GROUP;return i!==de.SKIPPED&&i!==de.NA&&!fe(i)});return k(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:W.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function Df(n,e){const t=be(n,i=>i.PUSH_MODE!==void 0&&!ue(e,i.PUSH_MODE));return k(t,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:W.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function jf(n){const e=[],t=oe(n,(r,i,s)=>{const a=i.PATTERN;return a===de.NA||(fe(a)?r.push({str:a,idx:s,tokenType:i}):
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:W.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function Lf(n){const e=be(n,r=>{const i=r[mt];return i instanceof RegExp&&(i.multiline||i.global)});return k(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:W.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function Mf(n){const e=[];let t=k(n,s=>oe(n,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!ue(e,o)&&o.PATTERN!==de.NA&&(e.push(o),a.push(o)),a),[]));t=Jn(t);const r=be(t,s=>s.length>1);return k(r,s=>{const a=k(s,l=>l.name);return{message:`The same RegExp pattern ->${Me(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:W.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function Pf(n){const e=be(n,r=>{if(!x(r,"GROUP"))return!1;const i=r.GROUP;return i!==de.SKIPPED&&i!==de.NA&&!fe(i)});return k(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:W.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function Df(n,e){const t=be(n,i=>i.PUSH_MODE!==void 0&&!ue(e,i.PUSH_MODE));return k(t,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:W.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function jf(n){const e=[],t=oe(n,(r,i,s)=>{const a=i.PATTERN;return a===de.NA||(fe(a)?r.push({str:a,idx:s,tokenType:i}):Xe(a)&&Uf(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return S(n,(r,i)=>{S(t,({str:s,idx:a,tokenType:o})=>{if(i<a&&Gf(s,r.PATTERN)){const l=`Token: ->${o.name}<- can never be matched.
|
32
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:l,type:W.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function Gf(n,e){if(
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:l,type:W.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function Gf(n,e){if(Xe(e)){const t=e.exec(n);return t!==null&&t.index===0}else{if(vt(e))return e(n,0,[],{});if(x(e,"exec"))return e.exec(n,0,[],{});if(typeof e=="string")return e===n;throw Error("non exhaustive match")}}function Uf(n){return zt([".","\\","[","]","|","^","$","(",")","?","*","+","{"],t=>n.source.indexOf(t)!==-1)===void 0}function Ea(n){const e=n.ignoreCase?"i":"";return new RegExp(`^(?:${n.source})`,e)}function Aa(n){const e=n.ignoreCase?"iy":"y";return new RegExp(`${n.source}`,e)}function Ff(n,e,t){const r=[];return x(n,jn)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+jn+`> property in its definition
|
34
34
|
`,type:W.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),x(n,yr)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+yr+`> property in its definition
|
35
35
|
`,type:W.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),x(n,yr)&&x(n,jn)&&!x(n.modes,n.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${jn}: <${n.defaultMode}>which does not exist
|
36
|
-
`,type:W.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),x(n,yr)&&S(n.modes,(i,s)=>{S(i,(a,o)=>{if(
|
37
|
-
`,type:W.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(x(a,"LONGER_ALT")){const l=te(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];S(l,c=>{!
|
36
|
+
`,type:W.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),x(n,yr)&&S(n.modes,(i,s)=>{S(i,(a,o)=>{if(qe(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
|
37
|
+
`,type:W.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(x(a,"LONGER_ALT")){const l=te(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];S(l,c=>{!qe(c)&&!ue(i,c)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${a.name}> outside of mode <${s}>
|
38
38
|
`,type:W.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function Bf(n,e,t){const r=[];let i=!1;const s=Jn(xe(z(n.modes))),a=ci(s,l=>l[mt]===de.NA),o=ec(t);return e&&S(a,l=>{const c=Zl(l,o);if(c!==!1){const d={message:Kf(l,c),type:c.issue,tokenType:l};r.push(d)}else x(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):Ks(o,l.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
39
39
|
This Lexer has been defined to track line and column information,
|
40
40
|
But none of the Token Types can be identified as matching a line terminator.
|
41
41
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
42
|
-
for details.`,type:W.NO_LINE_BREAKS_FLAGS}),r}function Hf(n){const e={},t=Kt(n);return S(t,r=>{const i=n[r];if(te(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Ql(n){const e=n.PATTERN;if(
|
42
|
+
for details.`,type:W.NO_LINE_BREAKS_FLAGS}),r}function Hf(n){const e={},t=Kt(n);return S(t,r=>{const i=n[r];if(te(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Ql(n){const e=n.PATTERN;if(Xe(e))return!1;if(vt(e))return!0;if(x(e,"exec"))return!0;if(fe(e))return!1;throw Error("non exhaustive match")}function Vf(n){return fe(n)&&n.length===1?n.charCodeAt(0):!1}const Wf={test:function(n){const e=n.length;for(let t=this.lastIndex;t<e;t++){const r=n.charCodeAt(t);if(r===10)return this.lastIndex=t+1,!0;if(r===13)return n.charCodeAt(t+1)===10?this.lastIndex=t+2:this.lastIndex=t+1,!0}return!1},lastIndex:0};function Zl(n,e){if(x(n,"LINE_BREAKS"))return!1;if(Xe(n.PATTERN)){try{Ks(e,n.PATTERN)}catch(t){return{issue:W.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}else{if(fe(n.PATTERN))return!1;if(Ql(n))return{issue:W.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Kf(n,e){if(e.issue===W.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
43
43
|
The problem is in the <${n.name}> Token Type
|
44
44
|
Root cause: ${e.errMsg}.
|
45
45
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===W.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
46
46
|
The problem is in the <${n.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 ec(n){return k(n,t=>fe(t)?t.charCodeAt(0):t)}function $i(n,e,t){n[e]===void 0?n[e]=[t]:n[e].push(t)}const Gn=256;let Sr=[];function tt(n){return n<Gn?n:Sr[n]}function zf(){if(D(Sr)){Sr=new Array(65536);for(let n=0;n<65536;n++)Sr[n]=n>255?255+~~(n/255):n}}function tr(n,e){const t=n.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}function Wr(n,e){return n.tokenTypeIdx===e.tokenTypeIdx}let ba=1;const tc={};function nr(n){const e=
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function ec(n){return k(n,t=>fe(t)?t.charCodeAt(0):t)}function $i(n,e,t){n[e]===void 0?n[e]=[t]:n[e].push(t)}const Gn=256;let Sr=[];function tt(n){return n<Gn?n:Sr[n]}function zf(){if(D(Sr)){Sr=new Array(65536);for(let n=0;n<65536;n++)Sr[n]=n>255?255+~~(n/255):n}}function tr(n,e){const t=n.tokenTypeIdx;return t===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[t]===!0}function Wr(n,e){return n.tokenTypeIdx===e.tokenTypeIdx}let ba=1;const tc={};function nr(n){const e=qf(n);Xf(e),Jf(e),Yf(e),S(e,t=>{t.isParent=t.categoryMatches.length>0})}function qf(n){let e=re(n),t=n,r=!0;for(;r;){t=Jn(xe(k(t,s=>s.CATEGORIES)));const i=li(t,e);e=e.concat(i),D(i)?r=!1:t=i}return e}function Xf(n){S(n,e=>{rc(e)||(tc[ba]=e,e.tokenTypeIdx=ba++),ka(e)&&!te(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),ka(e)||(e.CATEGORIES=[]),Qf(e)||(e.categoryMatches=[]),Zf(e)||(e.categoryMatchesMap={})})}function Yf(n){S(n,e=>{e.categoryMatches=[],S(e.categoryMatchesMap,(t,r)=>{e.categoryMatches.push(tc[r].tokenTypeIdx)})})}function Jf(n){S(n,e=>{nc([],e)})}function nc(n,e){S(n,t=>{e.categoryMatchesMap[t.tokenTypeIdx]=!0}),S(e.CATEGORIES,t=>{const r=n.concat(e);ue(r,t)||nc(r,t)})}function rc(n){return x(n,"tokenTypeIdx")}function ka(n){return x(n,"CATEGORIES")}function Qf(n){return x(n,"categoryMatches")}function Zf(n){return x(n,"categoryMatchesMap")}function eh(n){return x(n,"tokenTypeIdx")}const ss={buildUnableToPopLexerModeMessage(n){return`Unable to pop Lexer Mode after encountering Token ->${n.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(n,e,t,r,i){return`unexpected character: ->${n.charAt(e)}<- at offset: ${e}, skipped ${t} characters.`}};var W;(function(n){n[n.MISSING_PATTERN=0]="MISSING_PATTERN",n[n.INVALID_PATTERN=1]="INVALID_PATTERN",n[n.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",n[n.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",n[n.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",n[n.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",n[n.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",n[n.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",n[n.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",n[n.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",n[n.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",n[n.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",n[n.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",n[n.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",n[n.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",n[n.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",n[n.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",n[n.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(W||(W={}));const Un={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
48
48
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ss,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Un);class de{constructor(e,t=Un){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:l}=zl(s),c=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,l}else return s()},typeof t=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
49
49
|
a boolean 2nd argument is no longer supported`);this.config=Ae({},Un,t);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===Un.lineTerminatorsPattern)this.config.lineTerminatorsPattern=Wf;else if(this.config.lineTerminatorCharacters===Un.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(t.safeMode&&t.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),te(e)?i={modes:{defaultMode:re(e)},defaultMode:jn}:(s=!1,i=re(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ff(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Bf(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},S(i.modes,(o,l)=>{i.modes[l]=ci(o,c=>
|
50
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.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),te(e)?i={modes:{defaultMode:re(e)},defaultMode:jn}:(s=!1,i=re(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Ff(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(Bf(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},S(i.modes,(o,l)=>{i.modes[l]=ci(o,c=>qe(c))});const a=Kt(i.modes);if(S(i.modes,(o,l)=>{this.TRACE_INIT(`Mode: <${l}> processing`,()=>{if(this.modes.push(l),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(kf(o,a))}),D(this.lexerDefinitionErrors)){nr(o);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=bf(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[l]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[l]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Ae({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[l]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!D(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const l=k(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
|
51
51
|
`);throw new Error(`Errors detected in definition of Lexer:
|
52
|
-
`+l)}S(this.lexerDefinitionWarning,o=>{Kl(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Jl?(this.chopInput=fa,this.match=this.matchWithTest):(this.updateLastIndex=
|
52
|
+
`+l)}S(this.lexerDefinitionWarning,o=>{Kl(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Jl?(this.chopInput=fa,this.match=this.matchWithTest):(this.updateLastIndex=X,this.match=this.matchWithExec),s&&(this.handleModes=X),this.trackStartLines===!1&&(this.computeNewColumn=fa),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=X),/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=oe(this.canModeBeOptimized,(l,c,u)=>(c===!1&&l.push(u),l),[]);if(t.ensureOptimizations&&!D(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
53
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",()=>{_f()}),this.TRACE_INIT("toFastProperties",()=>{
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{_f()}),this.TRACE_INIT("toFastProperties",()=>{ql(this)})})}tokenize(e,t=this.defaultMode){if(!D(this.lexerDefinitionErrors)){const i=k(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
55
55
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
56
|
-
`+i)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,i,s,a,o,l,c,u,d,h,f,m,g,_,y;const R=e,T=R.length;let I=0,j=0;const ie=this.hasCustom?0:Math.floor(e.length/10),we=new Array(ie),ye=[];let je=this.trackStartLines?1:void 0,Ie=this.trackStartLines?1:void 0;const b=Hf(this.emptyGroups),v=this.trackStartLines,E=this.config.lineTerminatorsPattern;let N=0,O=[],$=[];const w=[],ve=[];Object.freeze(ve);let
|
56
|
+
`+i)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let r,i,s,a,o,l,c,u,d,h,f,m,g,_,y;const R=e,T=R.length;let I=0,j=0;const ie=this.hasCustom?0:Math.floor(e.length/10),we=new Array(ie),ye=[];let je=this.trackStartLines?1:void 0,Ie=this.trackStartLines?1:void 0;const b=Hf(this.emptyGroups),v=this.trackStartLines,E=this.config.lineTerminatorsPattern;let N=0,O=[],$=[];const w=[],ve=[];Object.freeze(ve);let q;function H(){return O}function ot(se){const Se=tt(se),kt=$[Se];return kt===void 0?ve:kt}const Tu=se=>{if(w.length===1&&se.tokenType.PUSH_MODE===void 0){const Se=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(se);ye.push({offset:se.startOffset,line:se.startLine,column:se.startColumn,length:se.image.length,message:Se})}else{w.pop();const Se=qt(w);O=this.patternIdxToConfig[Se],$=this.charCodeToPatternIdxToConfig[Se],N=O.length;const kt=this.canModeBeOptimized[Se]&&this.config.safeMode===!1;$&&kt?q=ot:q=H}};function oa(se){w.push(se),$=this.charCodeToPatternIdxToConfig[se],O=this.patternIdxToConfig[se],N=O.length,N=O.length;const Se=this.canModeBeOptimized[se]&&this.config.safeMode===!1;$&&Se?q=ot:q=H}oa.call(this,t);let $e;const la=this.config.recoveryEnabled;for(;I<T;){l=null;const se=R.charCodeAt(I),Se=q(se),kt=Se.length;for(r=0;r<kt;r++){$e=Se[r];const Te=$e.pattern;c=null;const Be=$e.short;if(Be!==!1?se===Be&&(l=Te):$e.isCustom===!0?(y=Te.exec(R,I,we,b),y!==null?(l=y[0],y.payload!==void 0&&(c=y.payload)):l=null):(this.updateLastIndex(Te,I),l=this.match(Te,e,I)),l!==null){if(o=$e.longerAlt,o!==void 0){const Je=o.length;for(s=0;s<Je;s++){const He=O[o[s]],lt=He.pattern;if(u=null,He.isCustom===!0?(y=lt.exec(R,I,we,b),y!==null?(a=y[0],y.payload!==void 0&&(u=y.payload)):a=null):(this.updateLastIndex(lt,I),a=this.match(lt,e,I)),a&&a.length>l.length){l=a,c=u,$e=He;break}}}break}}if(l!==null){if(d=l.length,h=$e.group,h!==void 0&&(f=$e.tokenTypeIdx,m=this.createTokenInstance(l,I,f,$e.tokenType,je,Ie,d),this.handlePayload(m,c),h===!1?j=this.addToken(we,j,m):b[h].push(m)),e=this.chopInput(e,d),I=I+d,Ie=this.computeNewColumn(Ie,d),v===!0&&$e.canLineTerminator===!0){let Te=0,Be,Je;E.lastIndex=0;do Be=E.test(l),Be===!0&&(Je=E.lastIndex-1,Te++);while(Be===!0);Te!==0&&(je=je+Te,Ie=d-Je,this.updateTokenEndLineColumnLocation(m,h,Je,Te,je,Ie,d))}this.handleModes($e,Tu,oa,m)}else{const Te=I,Be=je,Je=Ie;let He=la===!1;for(;He===!1&&I<T;)for(e=this.chopInput(e,1),I++,i=0;i<N;i++){const lt=O[i],Ai=lt.pattern,ca=lt.short;if(ca!==!1?R.charCodeAt(I)===ca&&(He=!0):lt.isCustom===!0?He=Ai.exec(R,I,we,b)!==null:(this.updateLastIndex(Ai,I),He=Ai.exec(e)!==null),He===!0)break}if(g=I-Te,Ie=this.computeNewColumn(Ie,g),_=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(R,Te,g,Be,Je),ye.push({offset:Te,line:Be,column:Je,length:g,message:_}),la===!1)break}}return this.hasCustom||(we.length=j),{tokens:we,groups:b,errors:ye}}handleModes(e,t,r,i){if(e.pop===!0){const s=e.push;t(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,t){return e.substring(t)}updateLastIndex(e,t){e.lastIndex=t}updateTokenEndLineColumnLocation(e,t,r,i,s,a,o){let l,c;t!==void 0&&(l=r===o-1,c=l?-1:0,i===1&&l===!0||(e.endLine=s+c,e.endColumn=a-1+-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,r,i){return{image:e,startOffset:t,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,t,r,i,s,a){return{image:e,startOffset:t,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,t,r,i,s,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,t,r){return e.push(r),t}addTokenUsingMemberAccess(e,t,r){return e[t]=r,t++,t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}matchWithTest(e,t,r){return e.test(t)===!0?t.substring(r,e.lastIndex):null}matchWithExec(e,t){const r=e.exec(t);return r!==null?r[0]:null}}de.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";de.NA=/NOT_APPLICABLE/;function wt(n){return ic(n)?n.LABEL:n.name}function ic(n){return fe(n.LABEL)&&n.LABEL!==""}const th="parent",Na="categories",Ia="label",Sa="group",xa="push_mode",Ca="pop_mode",wa="longer_alt",$a="line_breaks",Oa="start_chars_hint";function sc(n){return nh(n)}function nh(n){const e=n.pattern,t={};if(t.name=n.name,qe(e)||(t.PATTERN=e),x(n,th))throw`The parent property is no longer supported.
|
57
57
|
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return x(n,Na)&&(t.CATEGORIES=n[Na]),nr([t]),x(n,Ia)&&(t.LABEL=n[Ia]),x(n,Sa)&&(t.GROUP=n[Sa]),x(n,Ca)&&(t.POP_MODE=n[Ca]),x(n,xa)&&(t.PUSH_MODE=n[xa]),x(n,wa)&&(t.LONGER_ALT=n[wa]),x(n,$a)&&(t.LINE_BREAKS=n[$a]),x(n,Oa)&&(t.START_CHARS_HINT=n[Oa]),t}const nt=sc({name:"EOF",pattern:de.NA});nr([nt]);function zs(n,e,t,r,i,s,a,o){return{image:e,startOffset:t,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:n.tokenTypeIdx,tokenType:n}}function ac(n,e){return tr(n,e)}const xt={buildMismatchTokenMessage({expected:n,actual:e,previous:t,ruleName:r}){return`Expecting ${ic(n)?`--> ${wt(n)} <--`:`token of type --> ${n.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:n,ruleName:e}){return"Redundant input, expecting EOF but found: "+n.image},buildNoViableAltMessage({expectedPathsPerAlt:n,actual:e,previous:t,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
|
58
58
|
but found: '`+Me(e).image+"'";if(r)return s+r+o;{const l=oe(n,(h,f)=>h.concat(f),[]),c=k(l,h=>`[${k(h,f=>wt(f)).join(", ")}]`),d=`one of these possible Token sequences:
|
59
59
|
${k(c,(h,f)=>` ${f+1}. ${h}`).join(`
|
@@ -84,37 +84,37 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
84
84
|
without consuming any Tokens. The grammar path that causes this is:
|
85
85
|
${r}
|
86
86
|
To fix this refactor your grammar to remove the left recursion.
|
87
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(n){return"deprecated"},buildDuplicateRuleNameError(n){let e;return n.topLevelRule instanceof tn?e=n.topLevelRule.name:e=n.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${n.grammarName}<-`}};function ih(n,e){const t=new sh(n,e);return t.resolveRefs(),t.errors}class sh extends nn{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){S(z(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:ce.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class ah extends pi{constructor(e,t){super(),this.topProd=e,this.path=t,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=re(this.path.ruleStack).reverse(),this.occurrenceStack=re(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){D(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class oh extends ah{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=t.concat(r),s=new he({definition:i});this.possibleTokTypes=er(s),this.found=!0}}}class gi extends pi{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class lh extends gi{walkMany(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,t,r)}}class La extends gi{walkManySep(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,t,r)}}class ch extends gi{walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,t,r)}}class Ma extends gi{walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,t,r)}}function as(n,e,t=[]){t=re(t);let r=[],i=0;function s(o){return o.concat(Q(n,i+1))}function a(o){const l=as(s(o),e,t);return r.concat(l)}for(;t.length<e&&i<n.length;){const o=n[i];if(o instanceof he)return a(o.definition);if(o instanceof le)return a(o.definition);if(o instanceof ne)r=a(o.definition);else if(o instanceof ke){const l=o.definition.concat([new V({definition:o.definition})]);return a(l)}else if(o instanceof Ne){const l=[new he({definition:o.definition}),new V({definition:[new G({terminalType:o.separator})].concat(o.definition)})];return a(l)}else if(o instanceof me){const l=o.definition.concat([new V({definition:[new G({terminalType:o.separator})].concat(o.definition)})]);r=a(l)}else if(o instanceof V){const l=o.definition.concat([new V({definition:o.definition})]);r=a(l)}else{if(o instanceof ge)return S(o.definition,l=>{D(l.definition)===!1&&(r=a(l.definition))}),r;if(o instanceof G)t.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:t,suffixDef:Q(n,i)}),r}function oc(n,e,t,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-r-1,u=[],d=[];for(d.push({idx:-1,def:n,ruleStack:[],occurrenceStack:[]});!D(d);){const h=d.pop();if(h===a){o&&Xt(d).idx<=c&&d.pop();continue}const f=h.def,m=h.idx,g=h.ruleStack,_=h.occurrenceStack;if(D(f))continue;const y=f[0];if(y===i){const R={idx:m,def:Q(f),ruleStack:zn(g),occurrenceStack:zn(_)};d.push(R)}else if(y instanceof G)if(m<l-1){const R=m+1,T=e[R];if(t(T,y.terminalType)){const I={idx:R,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(I)}}else if(m===l-1)u.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:g,occurrenceStack:_}),o=!0;else throw Error("non exhaustive match");else if(y instanceof le){const R=re(g);R.push(y.nonTerminalName);const T=re(_);T.push(y.idx);const I={idx:m,def:y.definition.concat(s,Q(f)),ruleStack:R,occurrenceStack:T};d.push(I)}else if(y instanceof ne){const R={idx:m,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(R),d.push(a);const T={idx:m,def:y.definition.concat(Q(f)),ruleStack:g,occurrenceStack:_};d.push(T)}else if(y instanceof ke){const R=new V({definition:y.definition,idx:y.idx}),T=y.definition.concat([R],Q(f)),I={idx:m,def:T,ruleStack:g,occurrenceStack:_};d.push(I)}else if(y instanceof Ne){const R=new G({terminalType:y.separator}),T=new V({definition:[R].concat(y.definition),idx:y.idx}),I=y.definition.concat([T],Q(f)),j={idx:m,def:I,ruleStack:g,occurrenceStack:_};d.push(j)}else if(y instanceof me){const R={idx:m,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(R),d.push(a);const T=new G({terminalType:y.separator}),I=new V({definition:[T].concat(y.definition),idx:y.idx}),j=y.definition.concat([I],Q(f)),ie={idx:m,def:j,ruleStack:g,occurrenceStack:_};d.push(ie)}else if(y instanceof V){const R={idx:m,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(R),d.push(a);const T=new V({definition:y.definition,idx:y.idx}),I=y.definition.concat([T],Q(f)),j={idx:m,def:I,ruleStack:g,occurrenceStack:_};d.push(j)}else if(y instanceof ge)for(let R=y.definition.length-1;R>=0;R--){const T=y.definition[R],I={idx:m,def:T.definition.concat(Q(f)),ruleStack:g,occurrenceStack:_};d.push(I),d.push(a)}else if(y instanceof he)d.push({idx:m,def:y.definition.concat(Q(f)),ruleStack:g,occurrenceStack:_});else if(y instanceof tn)d.push(uh(y,m,g,_));else throw Error("non exhaustive match")}return u}function uh(n,e,t,r){const i=re(t);i.push(n.name);const s=re(r);return s.push(1),{idx:e,def:n.definition,ruleStack:i,occurrenceStack:s}}var F;(function(n){n[n.OPTION=0]="OPTION",n[n.REPETITION=1]="REPETITION",n[n.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",n[n.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",n[n.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",n[n.ALTERNATION=5]="ALTERNATION"})(F||(F={}));function Xs(n){if(n instanceof ne||n==="Option")return F.OPTION;if(n instanceof V||n==="Repetition")return F.REPETITION;if(n instanceof ke||n==="RepetitionMandatory")return F.REPETITION_MANDATORY;if(n instanceof Ne||n==="RepetitionMandatoryWithSeparator")return F.REPETITION_MANDATORY_WITH_SEPARATOR;if(n instanceof me||n==="RepetitionWithSeparator")return F.REPETITION_WITH_SEPARATOR;if(n instanceof ge||n==="Alternation")return F.ALTERNATION;throw Error("non exhaustive match")}function Pa(n){const{occurrence:e,rule:t,prodType:r,maxLookahead:i}=n,s=Xs(r);return s===F.ALTERNATION?yi(e,t,i):vi(e,t,s,i)}function dh(n,e,t,r,i,s){const a=yi(n,e,t),o=uc(a)?Wr:tr;return s(a,r,o,i)}function fh(n,e,t,r,i,s){const a=vi(n,e,i,t),o=uc(a)?Wr:tr;return s(a[0],o,r)}function hh(n,e,t,r){const i=n.length,s=Le(n,a=>Le(a,o=>o.length===1));if(e)return function(a){const o=k(a,l=>l.GATE);for(let l=0;l<i;l++){const c=n[l],u=c.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let h=0;h<u;h++){const f=c[h],m=f.length;for(let g=0;g<m;g++){const _=this.LA(g+1);if(t(_,f[g])===!1)continue e}return l}}};if(s&&!r){const a=k(n,l=>xe(l)),o=oe(a,(l,c,u)=>(S(c,d=>{x(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=u),S(d.categoryMatches,h=>{x(l,h)||(l[h]=u)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=n[a],l=o.length;e:for(let c=0;c<l;c++){const u=o[c],d=u.length;for(let h=0;h<d;h++){const f=this.LA(h+1);if(t(f,u[h])===!1)continue e}return a}}}}function ph(n,e,t){const r=Le(n,s=>s.length===1),i=n.length;if(r&&!t){const s=xe(n);if(s.length===1&&D(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=oe(s,(o,l,c)=>(o[l.tokenTypeIdx]=!0,S(l.categoryMatches,u=>{o[u]=!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=n[s],o=a.length;for(let l=0;l<o;l++){const c=this.LA(l+1);if(e(c,a[l])===!1)continue e}return!0}return!1}}class mh extends pi{constructor(e,t,r){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=r.concat(i),!0):!1}walkOption(e,t,r){this.checkIsTarget(e,F.OPTION,t,r)||super.walkOption(e,t,r)}walkAtLeastOne(e,t,r){this.checkIsTarget(e,F.REPETITION_MANDATORY,t,r)||super.walkOption(e,t,r)}walkAtLeastOneSep(e,t,r){this.checkIsTarget(e,F.REPETITION_MANDATORY_WITH_SEPARATOR,t,r)||super.walkOption(e,t,r)}walkMany(e,t,r){this.checkIsTarget(e,F.REPETITION,t,r)||super.walkOption(e,t,r)}walkManySep(e,t,r){this.checkIsTarget(e,F.REPETITION_WITH_SEPARATOR,t,r)||super.walkOption(e,t,r)}}class lc extends nn{constructor(e,t,r){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=r,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,F.OPTION)}visitRepetition(e){this.checkIsTarget(e,F.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,F.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,F.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,F.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,F.ALTERNATION)}}function Da(n){const e=new Array(n);for(let t=0;t<n;t++)e[t]=[];return e}function Oi(n){let e=[""];for(let t=0;t<n.length;t++){const r=n[t],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 l="_"+r.categoryMatches[o];i.push(a+l)}}e=i}return e}function gh(n,e,t){for(let r=0;r<n.length;r++){if(r===t)continue;const i=n[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function cc(n,e){const t=k(n,a=>as([a],1)),r=Da(t.length),i=k(t,a=>{const o={};return S(a,l=>{const c=Oi(l.partialPath);S(c,u=>{o[u]=!0})}),o});let s=t;for(let a=1;a<=e;a++){const o=s;s=Da(o.length);for(let l=0;l<o.length;l++){const c=o[l];for(let u=0;u<c.length;u++){const d=c[u].partialPath,h=c[u].suffixDef,f=Oi(d);if(gh(i,f,l)||D(h)||d.length===e){const g=r[l];if(os(g,d)===!1){g.push(d);for(let _=0;_<f.length;_++){const y=f[_];i[l][y]=!0}}}else{const g=as(h,a+1,d);s[l]=s[l].concat(g),S(g,_=>{const y=Oi(_.partialPath);S(y,R=>{i[l][R]=!0})})}}}}return r}function yi(n,e,t,r){const i=new lc(n,F.ALTERNATION,r);return e.accept(i),cc(i.result,t)}function vi(n,e,t,r){const i=new lc(n,t);e.accept(i);const s=i.result,o=new mh(e,n,t).startWalking(),l=new he({definition:s}),c=new he({definition:o});return cc([l,c],r)}function os(n,e){e:for(let t=0;t<n.length;t++){const r=n[t];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 yh(n,e){return n.length<e.length&&Le(n,(t,r)=>{const i=e[r];return t===i||i.categoryMatchesMap[t.tokenTypeIdx]})}function uc(n){return Le(n,e=>Le(e,t=>Le(t,r=>D(r.categoryMatches))))}function vh(n){const e=n.lookaheadStrategy.validate({rules:n.rules,tokenTypes:n.tokenTypes,grammarName:n.grammarName});return k(e,t=>Object.assign({type:ce.CUSTOM_LOOKAHEAD_VALIDATION},t))}function Th(n,e,t,r){const i=Ee(n,l=>_h(l,t)),s=$h(n,e,t),a=Ee(n,l=>Sh(l,t)),o=Ee(n,l=>Ah(l,n,r,t));return i.concat(s,a,o)}function _h(n,e){const t=new Eh;n.accept(t);const r=t.allProductions,i=Ju(r,Rh),s=Pe(i,o=>o.length>1);return k(z(s),o=>{const l=Me(o),c=e.buildDuplicateFoundError(n,o),u=Ge(l),d={message:c,type:ce.DUPLICATE_PRODUCTIONS,ruleName:n.name,dslName:u,occurrence:l.idx},h=dc(l);return h&&(d.parameter=h),d})}function Rh(n){return`${Ge(n)}_#_${n.idx}_#_${dc(n)}`}function dc(n){return n instanceof G?n.terminalType.name:n instanceof le?n.nonTerminalName:""}class Eh extends nn{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 Ah(n,e,t,r){const i=[];if(oe(e,(a,o)=>o.name===n.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:n,grammarName:t});i.push({message:a,type:ce.DUPLICATE_RULE_NAME,ruleName:n.name})}return i}function bh(n,e,t){const r=[];let i;return ue(e,n)||(i=`Invalid rule override, rule: ->${n}<- cannot be overridden in the grammar: ->${t}<-as it is not defined in any of the super grammars `,r.push({message:i,type:ce.INVALID_RULE_OVERRIDE,ruleName:n})),r}function fc(n,e,t,r=[]){const i=[],s=xr(e.definition);if(D(s))return[];{const a=n.name;ue(s,n)&&i.push({message:t.buildLeftRecursionError({topLevelRule:n,leftRecursionPath:r}),type:ce.LEFT_RECURSION,ruleName:a});const l=li(s,r.concat([n])),c=Ee(l,u=>{const d=re(r);return d.push(u),fc(n,u,t,d)});return i.concat(c)}}function xr(n){let e=[];if(D(n))return e;const t=Me(n);if(t instanceof le)e.push(t.referencedRule);else if(t instanceof he||t instanceof ne||t instanceof ke||t instanceof Ne||t instanceof me||t instanceof V)e=e.concat(xr(t.definition));else if(t instanceof ge)e=xe(k(t.definition,s=>xr(s.definition)));else if(!(t instanceof G))throw Error("non exhaustive match");const r=Hr(t),i=n.length>1;if(r&&i){const s=Q(n);return e.concat(xr(s))}else return e}class qs extends nn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function kh(n,e){const t=new qs;n.accept(t);const r=t.alternations;return Ee(r,s=>{const a=zn(s.definition);return Ee(a,(o,l)=>{const c=oc([o],[],tr,1);return D(c)?[{message:e.buildEmptyAlternationError({topLevelRule:n,alternation:s,emptyChoiceIdx:l}),type:ce.NONE_LAST_EMPTY_ALT,ruleName:n.name,occurrence:s.idx,alternative:l+1}]:[]})})}function Nh(n,e,t){const r=new qs;n.accept(r);let i=r.alternations;return i=ci(i,a=>a.ignoreAmbiguities===!0),Ee(i,a=>{const o=a.idx,l=a.maxLookahead||e,c=yi(o,n,l,a),u=Ch(c,a,n,t),d=wh(c,a,n,t);return u.concat(d)})}class Ih extends nn{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 Sh(n,e){const t=new qs;n.accept(t);const r=t.alternations;return Ee(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:n,alternation:s}),type:ce.TOO_MANY_ALTS,ruleName:n.name,occurrence:s.idx}]:[])}function xh(n,e,t){const r=[];return S(n,i=>{const s=new Ih;i.accept(s);const a=s.allProductions;S(a,o=>{const l=Xs(o),c=o.maxLookahead||e,u=o.idx,h=vi(u,i,l,c)[0];if(D(xe(h))){const f=t.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:f,type:ce.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function Ch(n,e,t,r){const i=[],s=oe(n,(o,l,c)=>(e.definition[c].ignoreAmbiguities===!0||S(l,u=>{const d=[c];S(n,(h,f)=>{c!==f&&os(h,u)&&e.definition[f].ignoreAmbiguities!==!0&&d.push(f)}),d.length>1&&!os(i,u)&&(i.push(u),o.push({alts:d,path:u}))}),o),[]);return k(s,o=>{const l=k(o.alts,u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:ce.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:o.alts}})}function wh(n,e,t,r){const i=oe(n,(a,o,l)=>{const c=k(o,u=>({idx:l,path:u}));return a.concat(c)},[]);return Jn(Ee(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,c=a.path,u=be(i,h=>e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx<l&&yh(h.path,c));return k(u,h=>{const f=[h.idx+1,l+1],m=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:f,prefixPath:h.path}),type:ce.AMBIGUOUS_PREFIX_ALTS,ruleName:t.name,occurrence:m,alternatives:f}})}))}function $h(n,e,t){const r=[],i=k(e,s=>s.name);return S(n,s=>{const a=s.name;if(ue(i,a)){const o=t.buildNamespaceConflictError(s);r.push({message:o,type:ce.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function Oh(n){const e=Ms(n,{errMsgProvider:rh}),t={};return S(n.rules,r=>{t[r.name]=r}),ih(t,e.errMsgProvider)}function Lh(n){return n=Ms(n,{errMsgProvider:dt}),Th(n.rules,n.tokenTypes,n.errMsgProvider,n.grammarName)}const hc="MismatchedTokenException",pc="NoViableAltException",mc="EarlyExitException",gc="NotAllInputParsedException",yc=[hc,pc,mc,gc];Object.freeze(yc);function Kr(n){return ue(yc,n.name)}class Ti extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class vc extends Ti{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=hc}}class Mh extends Ti{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=pc}}class Ph extends Ti{constructor(e,t){super(e,t),this.name=gc}}class Dh extends Ti{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=mc}}const Li={},Tc="InRuleRecoveryException";class jh extends Error{constructor(e){super(e),this.name=Tc}}class Gh{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=x(e,"recoveryEnabled")?e.recoveryEnabled:Ye.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Uh)}getTokenToInsert(e){const t=zs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const c=this.LA(1);let u=this.LA(1);const d=()=>{const h=this.LA(0),f=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:h,ruleName:this.getCurrRuleFullName()}),m=new vc(f,c,this.LA(0));m.resyncedTokens=zn(o),this.SAVE_ERROR(m)};for(;!l;)if(this.tokenMatcher(u,i)){d();return}else if(r.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,s)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new jh("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||D(t))return!1;const r=this.LA(1);return zt(t,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return ue(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const i=zt(e,s=>ac(t,s));if(i!==void 0)return i;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Li;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return k(e,(r,i)=>i===0?Li:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=k(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return xe(e)}getFollowSetFromFollowKey(e){if(e===Li)return[nt];const t=e.ruleName+e.idxInCallingRule+ql+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,nt)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return zn(t)}attemptInRepetitionRecovery(e,t,r,i,s,a,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),i=re(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return k(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Uh(n,e,t,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[o];if(l===void 0){const h=this.getCurrRuleFullName(),f=this.getGAstProductions()[h];l=new s(f,i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,u=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=nt,u=1),!(c===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,u,a)&&this.tryInRepetitionRecovery(n,e,t,c)}const Fh=4,st=8,_c=1<<st,Rc=2<<st,ls=3<<st,cs=4<<st,us=5<<st,Cr=6<<st;function Mi(n,e,t){return t|e|n}class Ys{constructor(e){var t;this.maxLookahead=(t=e==null?void 0:e.maxLookahead)!==null&&t!==void 0?t:Ye.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(D(t)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...r,...i,...s]}return t}validateNoLeftRecursion(e){return Ee(e,t=>fc(t,t,dt))}validateEmptyOrAlternatives(e){return Ee(e,t=>kh(t,dt))}validateAmbiguousAlternationAlternatives(e,t){return Ee(e,r=>Nh(r,t,dt))}validateSomeNonEmptyLookaheadPath(e,t){return xh(e,t,dt)}buildLookaheadForAlternation(e){return dh(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,hh)}buildLookaheadForOptional(e){return fh(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Xs(e.prodType),ph)}}class Bh{initLooksAhead(e){this.dynamicTokensEnabled=x(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Ye.dynamicTokensEnabled,this.maxLookahead=x(e,"maxLookahead")?e.maxLookahead:Ye.maxLookahead,this.lookaheadStrategy=x(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ys({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){S(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Vh(t);S(r,c=>{const u=c.idx===0?"":c.idx;this.TRACE_INIT(`${Ge(c)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:t,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=Mi(this.fullRuleNameToShort[t.name],_c,c.idx);this.setLaFuncCache(h,d)})}),S(i,c=>{this.computeLookaheadFunc(t,c.idx,ls,"Repetition",c.maxLookahead,Ge(c))}),S(s,c=>{this.computeLookaheadFunc(t,c.idx,Rc,"Option",c.maxLookahead,Ge(c))}),S(a,c=>{this.computeLookaheadFunc(t,c.idx,cs,"RepetitionMandatory",c.maxLookahead,Ge(c))}),S(o,c=>{this.computeLookaheadFunc(t,c.idx,Cr,"RepetitionMandatoryWithSeparator",c.maxLookahead,Ge(c))}),S(l,c=>{this.computeLookaheadFunc(t,c.idx,us,"RepetitionWithSeparator",c.maxLookahead,Ge(c))})})})}computeLookaheadFunc(e,t,r,i,s,a){this.TRACE_INIT(`${a}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Mi(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return Mi(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}}class Hh extends nn{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 vr=new Hh;function Vh(n){vr.reset(),n.accept(vr);const e=vr.dslMethods;return vr.reset(),e}function ja(n,e){isNaN(n.startOffset)===!0?(n.startOffset=e.startOffset,n.endOffset=e.endOffset):n.endOffset<e.endOffset&&(n.endOffset=e.endOffset)}function Ga(n,e){isNaN(n.startOffset)===!0?(n.startOffset=e.startOffset,n.startColumn=e.startColumn,n.startLine=e.startLine,n.endOffset=e.endOffset,n.endColumn=e.endColumn,n.endLine=e.endLine):n.endOffset<e.endOffset&&(n.endOffset=e.endOffset,n.endColumn=e.endColumn,n.endLine=e.endLine)}function Wh(n,e,t){n.children[t]===void 0?n.children[t]=[e]:n.children[t].push(e)}function Kh(n,e,t){n.children[e]===void 0?n.children[e]=[t]:n.children[e].push(t)}const zh="name";function Ec(n,e){Object.defineProperty(n,zh,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Xh(n,e){const t=Kt(n),r=t.length;for(let i=0;i<r;i++){const s=t[i],a=n[s],o=a.length;for(let l=0;l<o;l++){const c=a[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function qh(n,e){const t=function(){};Ec(t,n+"BaseSemantics");const r={visit:function(i,s){if(te(i)&&(i=i[0]),!Xe(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=Jh(this,e);if(!D(i)){const s=k(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
87
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(n){return"deprecated"},buildDuplicateRuleNameError(n){let e;return n.topLevelRule instanceof tn?e=n.topLevelRule.name:e=n.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${n.grammarName}<-`}};function ih(n,e){const t=new sh(n,e);return t.resolveRefs(),t.errors}class sh extends nn{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){S(z(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:ce.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class ah extends pi{constructor(e,t){super(),this.topProd=e,this.path=t,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=re(this.path.ruleStack).reverse(),this.occurrenceStack=re(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=t.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){D(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class oh extends ah{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=t.concat(r),s=new he({definition:i});this.possibleTokTypes=er(s),this.found=!0}}}class gi extends pi{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class lh extends gi{walkMany(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,t,r)}}class La extends gi{walkManySep(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,t,r)}}class ch extends gi{walkAtLeastOne(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,t,r)}}class Ma extends gi{walkAtLeastOneSep(e,t,r){if(e.idx===this.occurrence){const i=Me(t.concat(r));this.result.isEndOfRule=i===void 0,i instanceof G&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,t,r)}}function as(n,e,t=[]){t=re(t);let r=[],i=0;function s(o){return o.concat(Q(n,i+1))}function a(o){const l=as(s(o),e,t);return r.concat(l)}for(;t.length<e&&i<n.length;){const o=n[i];if(o instanceof he)return a(o.definition);if(o instanceof le)return a(o.definition);if(o instanceof ne)r=a(o.definition);else if(o instanceof ke){const l=o.definition.concat([new V({definition:o.definition})]);return a(l)}else if(o instanceof Ne){const l=[new he({definition:o.definition}),new V({definition:[new G({terminalType:o.separator})].concat(o.definition)})];return a(l)}else if(o instanceof me){const l=o.definition.concat([new V({definition:[new G({terminalType:o.separator})].concat(o.definition)})]);r=a(l)}else if(o instanceof V){const l=o.definition.concat([new V({definition:o.definition})]);r=a(l)}else{if(o instanceof ge)return S(o.definition,l=>{D(l.definition)===!1&&(r=a(l.definition))}),r;if(o instanceof G)t.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:t,suffixDef:Q(n,i)}),r}function oc(n,e,t,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const l=e.length,c=l-r-1,u=[],d=[];for(d.push({idx:-1,def:n,ruleStack:[],occurrenceStack:[]});!D(d);){const h=d.pop();if(h===a){o&&qt(d).idx<=c&&d.pop();continue}const f=h.def,m=h.idx,g=h.ruleStack,_=h.occurrenceStack;if(D(f))continue;const y=f[0];if(y===i){const R={idx:m,def:Q(f),ruleStack:zn(g),occurrenceStack:zn(_)};d.push(R)}else if(y instanceof G)if(m<l-1){const R=m+1,T=e[R];if(t(T,y.terminalType)){const I={idx:R,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(I)}}else if(m===l-1)u.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:g,occurrenceStack:_}),o=!0;else throw Error("non exhaustive match");else if(y instanceof le){const R=re(g);R.push(y.nonTerminalName);const T=re(_);T.push(y.idx);const I={idx:m,def:y.definition.concat(s,Q(f)),ruleStack:R,occurrenceStack:T};d.push(I)}else if(y instanceof ne){const R={idx:m,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(R),d.push(a);const T={idx:m,def:y.definition.concat(Q(f)),ruleStack:g,occurrenceStack:_};d.push(T)}else if(y instanceof ke){const R=new V({definition:y.definition,idx:y.idx}),T=y.definition.concat([R],Q(f)),I={idx:m,def:T,ruleStack:g,occurrenceStack:_};d.push(I)}else if(y instanceof Ne){const R=new G({terminalType:y.separator}),T=new V({definition:[R].concat(y.definition),idx:y.idx}),I=y.definition.concat([T],Q(f)),j={idx:m,def:I,ruleStack:g,occurrenceStack:_};d.push(j)}else if(y instanceof me){const R={idx:m,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(R),d.push(a);const T=new G({terminalType:y.separator}),I=new V({definition:[T].concat(y.definition),idx:y.idx}),j=y.definition.concat([I],Q(f)),ie={idx:m,def:j,ruleStack:g,occurrenceStack:_};d.push(ie)}else if(y instanceof V){const R={idx:m,def:Q(f),ruleStack:g,occurrenceStack:_};d.push(R),d.push(a);const T=new V({definition:y.definition,idx:y.idx}),I=y.definition.concat([T],Q(f)),j={idx:m,def:I,ruleStack:g,occurrenceStack:_};d.push(j)}else if(y instanceof ge)for(let R=y.definition.length-1;R>=0;R--){const T=y.definition[R],I={idx:m,def:T.definition.concat(Q(f)),ruleStack:g,occurrenceStack:_};d.push(I),d.push(a)}else if(y instanceof he)d.push({idx:m,def:y.definition.concat(Q(f)),ruleStack:g,occurrenceStack:_});else if(y instanceof tn)d.push(uh(y,m,g,_));else throw Error("non exhaustive match")}return u}function uh(n,e,t,r){const i=re(t);i.push(n.name);const s=re(r);return s.push(1),{idx:e,def:n.definition,ruleStack:i,occurrenceStack:s}}var F;(function(n){n[n.OPTION=0]="OPTION",n[n.REPETITION=1]="REPETITION",n[n.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",n[n.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",n[n.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",n[n.ALTERNATION=5]="ALTERNATION"})(F||(F={}));function qs(n){if(n instanceof ne||n==="Option")return F.OPTION;if(n instanceof V||n==="Repetition")return F.REPETITION;if(n instanceof ke||n==="RepetitionMandatory")return F.REPETITION_MANDATORY;if(n instanceof Ne||n==="RepetitionMandatoryWithSeparator")return F.REPETITION_MANDATORY_WITH_SEPARATOR;if(n instanceof me||n==="RepetitionWithSeparator")return F.REPETITION_WITH_SEPARATOR;if(n instanceof ge||n==="Alternation")return F.ALTERNATION;throw Error("non exhaustive match")}function Pa(n){const{occurrence:e,rule:t,prodType:r,maxLookahead:i}=n,s=qs(r);return s===F.ALTERNATION?yi(e,t,i):vi(e,t,s,i)}function dh(n,e,t,r,i,s){const a=yi(n,e,t),o=uc(a)?Wr:tr;return s(a,r,o,i)}function fh(n,e,t,r,i,s){const a=vi(n,e,i,t),o=uc(a)?Wr:tr;return s(a[0],o,r)}function hh(n,e,t,r){const i=n.length,s=Le(n,a=>Le(a,o=>o.length===1));if(e)return function(a){const o=k(a,l=>l.GATE);for(let l=0;l<i;l++){const c=n[l],u=c.length,d=o[l];if(!(d!==void 0&&d.call(this)===!1))e:for(let h=0;h<u;h++){const f=c[h],m=f.length;for(let g=0;g<m;g++){const _=this.LA(g+1);if(t(_,f[g])===!1)continue e}return l}}};if(s&&!r){const a=k(n,l=>xe(l)),o=oe(a,(l,c,u)=>(S(c,d=>{x(l,d.tokenTypeIdx)||(l[d.tokenTypeIdx]=u),S(d.categoryMatches,h=>{x(l,h)||(l[h]=u)})}),l),{});return function(){const l=this.LA(1);return o[l.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=n[a],l=o.length;e:for(let c=0;c<l;c++){const u=o[c],d=u.length;for(let h=0;h<d;h++){const f=this.LA(h+1);if(t(f,u[h])===!1)continue e}return a}}}}function ph(n,e,t){const r=Le(n,s=>s.length===1),i=n.length;if(r&&!t){const s=xe(n);if(s.length===1&&D(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=oe(s,(o,l,c)=>(o[l.tokenTypeIdx]=!0,S(l.categoryMatches,u=>{o[u]=!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=n[s],o=a.length;for(let l=0;l<o;l++){const c=this.LA(l+1);if(e(c,a[l])===!1)continue e}return!0}return!1}}class mh extends pi{constructor(e,t,r){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=r.concat(i),!0):!1}walkOption(e,t,r){this.checkIsTarget(e,F.OPTION,t,r)||super.walkOption(e,t,r)}walkAtLeastOne(e,t,r){this.checkIsTarget(e,F.REPETITION_MANDATORY,t,r)||super.walkOption(e,t,r)}walkAtLeastOneSep(e,t,r){this.checkIsTarget(e,F.REPETITION_MANDATORY_WITH_SEPARATOR,t,r)||super.walkOption(e,t,r)}walkMany(e,t,r){this.checkIsTarget(e,F.REPETITION,t,r)||super.walkOption(e,t,r)}walkManySep(e,t,r){this.checkIsTarget(e,F.REPETITION_WITH_SEPARATOR,t,r)||super.walkOption(e,t,r)}}class lc extends nn{constructor(e,t,r){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=r,this.result=[]}checkIsTarget(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,F.OPTION)}visitRepetition(e){this.checkIsTarget(e,F.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,F.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,F.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,F.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,F.ALTERNATION)}}function Da(n){const e=new Array(n);for(let t=0;t<n;t++)e[t]=[];return e}function Oi(n){let e=[""];for(let t=0;t<n.length;t++){const r=n[t],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 l="_"+r.categoryMatches[o];i.push(a+l)}}e=i}return e}function gh(n,e,t){for(let r=0;r<n.length;r++){if(r===t)continue;const i=n[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function cc(n,e){const t=k(n,a=>as([a],1)),r=Da(t.length),i=k(t,a=>{const o={};return S(a,l=>{const c=Oi(l.partialPath);S(c,u=>{o[u]=!0})}),o});let s=t;for(let a=1;a<=e;a++){const o=s;s=Da(o.length);for(let l=0;l<o.length;l++){const c=o[l];for(let u=0;u<c.length;u++){const d=c[u].partialPath,h=c[u].suffixDef,f=Oi(d);if(gh(i,f,l)||D(h)||d.length===e){const g=r[l];if(os(g,d)===!1){g.push(d);for(let _=0;_<f.length;_++){const y=f[_];i[l][y]=!0}}}else{const g=as(h,a+1,d);s[l]=s[l].concat(g),S(g,_=>{const y=Oi(_.partialPath);S(y,R=>{i[l][R]=!0})})}}}}return r}function yi(n,e,t,r){const i=new lc(n,F.ALTERNATION,r);return e.accept(i),cc(i.result,t)}function vi(n,e,t,r){const i=new lc(n,t);e.accept(i);const s=i.result,o=new mh(e,n,t).startWalking(),l=new he({definition:s}),c=new he({definition:o});return cc([l,c],r)}function os(n,e){e:for(let t=0;t<n.length;t++){const r=n[t];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 yh(n,e){return n.length<e.length&&Le(n,(t,r)=>{const i=e[r];return t===i||i.categoryMatchesMap[t.tokenTypeIdx]})}function uc(n){return Le(n,e=>Le(e,t=>Le(t,r=>D(r.categoryMatches))))}function vh(n){const e=n.lookaheadStrategy.validate({rules:n.rules,tokenTypes:n.tokenTypes,grammarName:n.grammarName});return k(e,t=>Object.assign({type:ce.CUSTOM_LOOKAHEAD_VALIDATION},t))}function Th(n,e,t,r){const i=Ee(n,l=>_h(l,t)),s=$h(n,e,t),a=Ee(n,l=>Sh(l,t)),o=Ee(n,l=>Ah(l,n,r,t));return i.concat(s,a,o)}function _h(n,e){const t=new Eh;n.accept(t);const r=t.allProductions,i=Ju(r,Rh),s=Pe(i,o=>o.length>1);return k(z(s),o=>{const l=Me(o),c=e.buildDuplicateFoundError(n,o),u=Ge(l),d={message:c,type:ce.DUPLICATE_PRODUCTIONS,ruleName:n.name,dslName:u,occurrence:l.idx},h=dc(l);return h&&(d.parameter=h),d})}function Rh(n){return`${Ge(n)}_#_${n.idx}_#_${dc(n)}`}function dc(n){return n instanceof G?n.terminalType.name:n instanceof le?n.nonTerminalName:""}class Eh extends nn{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 Ah(n,e,t,r){const i=[];if(oe(e,(a,o)=>o.name===n.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:n,grammarName:t});i.push({message:a,type:ce.DUPLICATE_RULE_NAME,ruleName:n.name})}return i}function bh(n,e,t){const r=[];let i;return ue(e,n)||(i=`Invalid rule override, rule: ->${n}<- cannot be overridden in the grammar: ->${t}<-as it is not defined in any of the super grammars `,r.push({message:i,type:ce.INVALID_RULE_OVERRIDE,ruleName:n})),r}function fc(n,e,t,r=[]){const i=[],s=xr(e.definition);if(D(s))return[];{const a=n.name;ue(s,n)&&i.push({message:t.buildLeftRecursionError({topLevelRule:n,leftRecursionPath:r}),type:ce.LEFT_RECURSION,ruleName:a});const l=li(s,r.concat([n])),c=Ee(l,u=>{const d=re(r);return d.push(u),fc(n,u,t,d)});return i.concat(c)}}function xr(n){let e=[];if(D(n))return e;const t=Me(n);if(t instanceof le)e.push(t.referencedRule);else if(t instanceof he||t instanceof ne||t instanceof ke||t instanceof Ne||t instanceof me||t instanceof V)e=e.concat(xr(t.definition));else if(t instanceof ge)e=xe(k(t.definition,s=>xr(s.definition)));else if(!(t instanceof G))throw Error("non exhaustive match");const r=Hr(t),i=n.length>1;if(r&&i){const s=Q(n);return e.concat(xr(s))}else return e}class Xs extends nn{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function kh(n,e){const t=new Xs;n.accept(t);const r=t.alternations;return Ee(r,s=>{const a=zn(s.definition);return Ee(a,(o,l)=>{const c=oc([o],[],tr,1);return D(c)?[{message:e.buildEmptyAlternationError({topLevelRule:n,alternation:s,emptyChoiceIdx:l}),type:ce.NONE_LAST_EMPTY_ALT,ruleName:n.name,occurrence:s.idx,alternative:l+1}]:[]})})}function Nh(n,e,t){const r=new Xs;n.accept(r);let i=r.alternations;return i=ci(i,a=>a.ignoreAmbiguities===!0),Ee(i,a=>{const o=a.idx,l=a.maxLookahead||e,c=yi(o,n,l,a),u=Ch(c,a,n,t),d=wh(c,a,n,t);return u.concat(d)})}class Ih extends nn{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 Sh(n,e){const t=new Xs;n.accept(t);const r=t.alternations;return Ee(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:n,alternation:s}),type:ce.TOO_MANY_ALTS,ruleName:n.name,occurrence:s.idx}]:[])}function xh(n,e,t){const r=[];return S(n,i=>{const s=new Ih;i.accept(s);const a=s.allProductions;S(a,o=>{const l=qs(o),c=o.maxLookahead||e,u=o.idx,h=vi(u,i,l,c)[0];if(D(xe(h))){const f=t.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:f,type:ce.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function Ch(n,e,t,r){const i=[],s=oe(n,(o,l,c)=>(e.definition[c].ignoreAmbiguities===!0||S(l,u=>{const d=[c];S(n,(h,f)=>{c!==f&&os(h,u)&&e.definition[f].ignoreAmbiguities!==!0&&d.push(f)}),d.length>1&&!os(i,u)&&(i.push(u),o.push({alts:d,path:u}))}),o),[]);return k(s,o=>{const l=k(o.alts,u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:l,prefixPath:o.path}),type:ce.AMBIGUOUS_ALTS,ruleName:t.name,occurrence:e.idx,alternatives:o.alts}})}function wh(n,e,t,r){const i=oe(n,(a,o,l)=>{const c=k(o,u=>({idx:l,path:u}));return a.concat(c)},[]);return Jn(Ee(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const l=a.idx,c=a.path,u=be(i,h=>e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx<l&&yh(h.path,c));return k(u,h=>{const f=[h.idx+1,l+1],m=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:t,alternation:e,ambiguityIndices:f,prefixPath:h.path}),type:ce.AMBIGUOUS_PREFIX_ALTS,ruleName:t.name,occurrence:m,alternatives:f}})}))}function $h(n,e,t){const r=[],i=k(e,s=>s.name);return S(n,s=>{const a=s.name;if(ue(i,a)){const o=t.buildNamespaceConflictError(s);r.push({message:o,type:ce.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function Oh(n){const e=Ms(n,{errMsgProvider:rh}),t={};return S(n.rules,r=>{t[r.name]=r}),ih(t,e.errMsgProvider)}function Lh(n){return n=Ms(n,{errMsgProvider:dt}),Th(n.rules,n.tokenTypes,n.errMsgProvider,n.grammarName)}const hc="MismatchedTokenException",pc="NoViableAltException",mc="EarlyExitException",gc="NotAllInputParsedException",yc=[hc,pc,mc,gc];Object.freeze(yc);function Kr(n){return ue(yc,n.name)}class Ti extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class vc extends Ti{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=hc}}class Mh extends Ti{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=pc}}class Ph extends Ti{constructor(e,t){super(e,t),this.name=gc}}class Dh extends Ti{constructor(e,t,r){super(e,t),this.previousToken=r,this.name=mc}}const Li={},Tc="InRuleRecoveryException";class jh extends Error{constructor(e){super(e),this.name=Tc}}class Gh{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=x(e,"recoveryEnabled")?e.recoveryEnabled:Ye.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=Uh)}getTokenToInsert(e){const t=zs(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let l=!1;const c=this.LA(1);let u=this.LA(1);const d=()=>{const h=this.LA(0),f=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:h,ruleName:this.getCurrRuleFullName()}),m=new vc(f,c,this.LA(0));m.resyncedTokens=zn(o),this.SAVE_ERROR(m)};for(;!l;)if(this.tokenMatcher(u,i)){d();return}else if(r.call(this)){d(),e.apply(this,t);return}else this.tokenMatcher(u,s)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))}getFollowsForInRuleRecovery(e,t){const r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new jh("sad sad panda")}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||D(t))return!1;const r=this.LA(1);return zt(t,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return ue(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let t=this.LA(1),r=2;for(;;){const i=zt(e,s=>ac(t,s));if(i!==void 0)return i;t=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Li;const e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK;return k(e,(r,i)=>i===0?Li:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:t[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=k(this.buildFullFollowKeyStack(),t=>this.getFollowSetFromFollowKey(t));return xe(e)}getFollowSetFromFollowKey(e){if(e===Li)return[nt];const t=e.ruleName+e.idxInCallingRule+Xl+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,nt)||t.push(e),t}reSyncTo(e){const t=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return zn(t)}attemptInRepetitionRecovery(e,t,r,i,s,a,o){}getCurrentGrammarPath(e,t){const r=this.getHumanReadableRuleStack(),i=re(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){return k(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function Uh(n,e,t,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let l=this.firstAfterRepMap[o];if(l===void 0){const h=this.getCurrRuleFullName(),f=this.getGAstProductions()[h];l=new s(f,i).startWalking(),this.firstAfterRepMap[o]=l}let c=l.token,u=l.occurrence;const d=l.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=nt,u=1),!(c===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,u,a)&&this.tryInRepetitionRecovery(n,e,t,c)}const Fh=4,st=8,_c=1<<st,Rc=2<<st,ls=3<<st,cs=4<<st,us=5<<st,Cr=6<<st;function Mi(n,e,t){return t|e|n}class Ys{constructor(e){var t;this.maxLookahead=(t=e==null?void 0:e.maxLookahead)!==null&&t!==void 0?t:Ye.maxLookahead}validate(e){const t=this.validateNoLeftRecursion(e.rules);if(D(t)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...r,...i,...s]}return t}validateNoLeftRecursion(e){return Ee(e,t=>fc(t,t,dt))}validateEmptyOrAlternatives(e){return Ee(e,t=>kh(t,dt))}validateAmbiguousAlternationAlternatives(e,t){return Ee(e,r=>Nh(r,t,dt))}validateSomeNonEmptyLookaheadPath(e,t){return xh(e,t,dt)}buildLookaheadForAlternation(e){return dh(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,hh)}buildLookaheadForOptional(e){return fh(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,qs(e.prodType),ph)}}class Bh{initLooksAhead(e){this.dynamicTokensEnabled=x(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Ye.dynamicTokensEnabled,this.maxLookahead=x(e,"maxLookahead")?e.maxLookahead:Ye.maxLookahead,this.lookaheadStrategy=x(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ys({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){S(e,t=>{this.TRACE_INIT(`${t.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:l}=Vh(t);S(r,c=>{const u=c.idx===0?"":c.idx;this.TRACE_INIT(`${Ge(c)}${u}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:t,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=Mi(this.fullRuleNameToShort[t.name],_c,c.idx);this.setLaFuncCache(h,d)})}),S(i,c=>{this.computeLookaheadFunc(t,c.idx,ls,"Repetition",c.maxLookahead,Ge(c))}),S(s,c=>{this.computeLookaheadFunc(t,c.idx,Rc,"Option",c.maxLookahead,Ge(c))}),S(a,c=>{this.computeLookaheadFunc(t,c.idx,cs,"RepetitionMandatory",c.maxLookahead,Ge(c))}),S(o,c=>{this.computeLookaheadFunc(t,c.idx,Cr,"RepetitionMandatoryWithSeparator",c.maxLookahead,Ge(c))}),S(l,c=>{this.computeLookaheadFunc(t,c.idx,us,"RepetitionWithSeparator",c.maxLookahead,Ge(c))})})})}computeLookaheadFunc(e,t,r,i,s,a){this.TRACE_INIT(`${a}${t===0?"":t}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),l=Mi(this.fullRuleNameToShort[e.name],r,t);this.setLaFuncCache(l,o)})}getKeyForAutomaticLookahead(e,t){const r=this.getLastExplicitRuleShortName();return Mi(r,e,t)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,t){this.lookAheadFuncsCache.set(e,t)}}class Hh extends nn{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 vr=new Hh;function Vh(n){vr.reset(),n.accept(vr);const e=vr.dslMethods;return vr.reset(),e}function ja(n,e){isNaN(n.startOffset)===!0?(n.startOffset=e.startOffset,n.endOffset=e.endOffset):n.endOffset<e.endOffset&&(n.endOffset=e.endOffset)}function Ga(n,e){isNaN(n.startOffset)===!0?(n.startOffset=e.startOffset,n.startColumn=e.startColumn,n.startLine=e.startLine,n.endOffset=e.endOffset,n.endColumn=e.endColumn,n.endLine=e.endLine):n.endOffset<e.endOffset&&(n.endOffset=e.endOffset,n.endColumn=e.endColumn,n.endLine=e.endLine)}function Wh(n,e,t){n.children[t]===void 0?n.children[t]=[e]:n.children[t].push(e)}function Kh(n,e,t){n.children[e]===void 0?n.children[e]=[t]:n.children[e].push(t)}const zh="name";function Ec(n,e){Object.defineProperty(n,zh,{enumerable:!1,configurable:!0,writable:!1,value:e})}function qh(n,e){const t=Kt(n),r=t.length;for(let i=0;i<r;i++){const s=t[i],a=n[s],o=a.length;for(let l=0;l<o;l++){const c=a[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function Xh(n,e){const t=function(){};Ec(t,n+"BaseSemantics");const r={visit:function(i,s){if(te(i)&&(i=i[0]),!qe(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=Jh(this,e);if(!D(i)){const s=k(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
88
88
|
${s.join(`
|
89
89
|
|
90
90
|
`).replace(/\n/g,`
|
91
|
-
`)}`)}}};return t.prototype=r,t.prototype.constructor=t,t._RULE_NAMES=e,t}function Yh(n,e,t){const r=function(){};Ec(r,n+"BaseSemanticsWithDefaults");const i=Object.create(t.prototype);return S(e,s=>{i[s]=
|
91
|
+
`)}`)}}};return t.prototype=r,t.prototype.constructor=t,t._RULE_NAMES=e,t}function Yh(n,e,t){const r=function(){};Ec(r,n+"BaseSemanticsWithDefaults");const i=Object.create(t.prototype);return S(e,s=>{i[s]=qh}),r.prototype=i,r.prototype.constructor=r,r}var ds;(function(n){n[n.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",n[n.MISSING_METHOD=1]="MISSING_METHOD"})(ds||(ds={}));function Jh(n,e){return Qh(n,e)}function Qh(n,e){const t=be(e,i=>vt(n[i])===!1),r=k(t,i=>({msg:`Missing visitor method: <${i}> on ${n.constructor.name} CST Visitor.`,type:ds.MISSING_METHOD,methodName:i}));return Jn(r)}class Zh{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=x(e,"nodeLocationTracking")?e.nodeLocationTracking:Ye.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=X,this.cstFinallyStateUpdate=X,this.cstPostTerminal=X,this.cstPostNonTerminal=X,this.cstPostRule=X;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Ga,this.setNodeLocationFromNode=Ga,this.cstPostRule=X,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ja,this.setNodeLocationFromNode=ja,this.cstPostRule=X,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=X,this.setNodeLocationFromNode=X,this.cstPostRule=X,this.setInitialNodeLocation=X;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 t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const t=this.LA(0),r=e.location;r.startOffset<=t.startOffset?r.endOffset=t.endOffset:r.startOffset=NaN}cstPostTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];Wh(r,t,e),this.setNodeLocationFromToken(r.location,t)}cstPostNonTerminal(e,t){const r=this.CST_STACK[this.CST_STACK.length-1];Kh(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(qe(this.baseCstVisitorConstructor)){const e=Xh(this.className,Kt(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(qe(this.baseCstVisitorWithDefaultsConstructor)){const e=Yh(this.className,Kt(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 ep{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)):qr}LA(e){const t=this.currIdx+e;return t<0||this.tokVectorLength<=t?qr:this.tokVector[t]}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 tp{ACTION(e){return e.call(this)}consume(e,t,r){return this.consumeInternal(t,e,r)}subrule(e,t,r){return this.subruleInternal(t,e,r)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}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,t,r=Xr){if(ue(this.definedRulesNames,e)){const a={message:dt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:ce.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,t,r);return this[e]=i,i}OVERRIDE_RULE(e,t,r=Xr){const i=bh(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,t,r);return this[e]=s,s}BACKTRACK(e,t){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,t),!0}catch(i){if(Kr(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return uf(z(this.gastProductionsCache))}}class np{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Wr,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},x(t,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
92
92
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
93
93
|
For Further details.`);if(te(e)){if(D(e))throw Error(`A Token Vocabulary cannot be empty.
|
94
94
|
Note that the first argument for the parser constructor
|
95
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
96
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
97
97
|
For Further details.`)}if(te(e))this.tokensMap=oe(e,(s,a)=>(s[a.name]=a,s),{});else if(x(e,"modes")&&Le(xe(z(e.modes)),eh)){const s=xe(z(e.modes)),a=Ps(s);this.tokensMap=oe(a,(o,l)=>(o[l.name]=l,o),{})}else if(xu(e))this.tokensMap=re(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=nt;const r=x(e,"modes")?xe(z(e.modes)):z(e),i=Le(r,s=>D(s.categoryMatches));this.tokenMatcher=i?Wr:tr,nr(z(this.tokensMap))}defineRule(e,t,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=x(r,"resyncEnabled")?r.resyncEnabled:
|
98
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=x(r,"resyncEnabled")?r.resyncEnabled:Xr.resyncEnabled,s=x(r,"recoveryValueFunc")?r.recoveryValueFunc:Xr.recoveryValueFunc,a=this.ruleShortNameIdx<<Fh+st;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...u){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,u);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...u){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,u)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:t})}invokeRuleCatch(e,t,r){const i=this.RULE_STACK.length===1,s=t&&!this.isBackTracking()&&this.recoveryEnabled;if(Kr(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return r(e);else{if(this.outputCst){const l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,a.partialCstResult=l}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,t){const r=this.getKeyForAutomaticLookahead(Rc,t);return this.optionInternalLogic(e,t,r)}optionInternalLogic(e,t,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,t){const r=this.getKeyForAutomaticLookahead(cs,e);return this.atLeastOneInternalLogic(e,t,r)}atLeastOneInternalLogic(e,t,r){let i=this.getLaFuncFromCache(r),s;if(typeof t!="function"){s=t.DEF;const a=t.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=t;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,F.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,cs,e,ch)}atLeastOneSepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(Cr,e);this.atLeastOneSepFirstInternalLogic(e,t,r)}atLeastOneSepFirstInternalLogic(e,t,r){const i=t.DEF,s=t.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,Ma],o,Cr,e,Ma)}else throw this.raiseEarlyExitException(e,F.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)}manyInternal(e,t){const r=this.getKeyForAutomaticLookahead(ls,e);return this.manyInternalLogic(e,t,r)}manyInternalLogic(e,t,r){let i=this.getLaFuncFromCache(r),s;if(typeof t!="function"){s=t.DEF;const o=t.GATE;if(o!==void 0){const l=i;i=()=>o.call(this)&&l.call(this)}}else s=t;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,ls,e,lh,a)}manySepFirstInternal(e,t){const r=this.getKeyForAutomaticLookahead(us,e);this.manySepFirstInternalLogic(e,t,r)}manySepFirstInternalLogic(e,t,r){const i=t.DEF,s=t.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,La],o,us,e,La)}}repetitionSepSecondInternal(e,t,r,i,s){for(;r();)this.CONSUME(t),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,i,s],r,Cr,e,s)}doSingleRepetition(e){const t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){const r=this.getKeyForAutomaticLookahead(_c,t),i=te(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(t,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),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Ph(t,e))}}subruleInternal(e,t,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=t,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,t,r){throw Kr(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,t,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,t,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,t,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:t,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new vc(i,t,s))}consumeInternalRecovery(e,t,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===Tc?r:s}}else throw r}saveRecogState(){const e=this.errors,t=re(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t)}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),nt)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class rp{initErrorHandler(e){this._errors=[],this.errorMessageProvider=x(e,"errorMessageProvider")?e.errorMessageProvider:Ye.errorMessageProvider}SAVE_ERROR(e){if(Kr(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:re(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return re(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,t,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=vi(e,s,t,this.maxLookahead)[0],l=[];for(let u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new Dh(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=yi(e,i,this.maxLookahead),a=[];for(let c=1;c<=this.maxLookahead;c++)a.push(this.LA(c));const o=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Mh(l,this.LA(1),o))}}class ip{initContentAssist(){}computeContentAssist(e,t){const r=this.gastProductionsCache[e];if(qe(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return oc([r],t,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const t=Me(e.ruleStack),i=this.getGAstProductions()[t];return new oh(i,e).startWalking()}}const _i={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(_i);const Ua=!0,Fa=Math.pow(2,st)-1,Ac=sc({name:"RECORDING_PHASE_TOKEN",pattern:de.NA});nr([Ac]);const bc=zs(Ac,`This IToken indicates the Parser is in Recording Phase
|
99
99
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(bc);const sp={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 ap{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 t=e>0?e:"";this[`CONSUME${t}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${t}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},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 t=0;t<10;t++){const r=t>0?t:"";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,t){return()=>!0}LA_RECORD(e){return
|
100
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class ap{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 t=e>0?e:"";this[`CONSUME${t}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${t}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${t}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${t}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${t}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${t}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${t}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${t}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},this.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},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 t=0;t<10;t++){const r=t>0?t:"";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,t){return()=>!0}LA_RECORD(e){return qr}topLevelRuleRecord(e,t){try{const r=new tn({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
101
101
|
This error was thrown during the "grammar recording phase" For more info see:
|
102
102
|
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,t){return ln.call(this,ne,e,t)}atLeastOneInternalRecord(e,t){ln.call(this,ke,t,e)}atLeastOneSepFirstInternalRecord(e,t){ln.call(this,Ne,t,e,Ua)}manyInternalRecord(e,t){ln.call(this,V,t,e)}manySepFirstInternalRecord(e,t){ln.call(this,me,t,e,Ua)}orInternalRecord(e,t){return op.call(this,e,t)}subruleInternalRecord(e,t,r){if(zr(t),!e||x(e,"ruleName")===!1){const o=new Error(`<SUBRULE${Ba(t)}> 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=
|
104
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=
|
105
|
-
Idx value must be a none negative value smaller than ${Fa+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class lp{initPerformanceTracer(e){if(x(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Ye.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){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}=zl(t),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return t()}}function cp(n,e){e.forEach(t=>{const r=t.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(n.prototype,i,s):n.prototype[i]=t.prototype[i]})})}const
|
103
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=qt(this.recordingProdStack),s=e.ruleName,a=new le({idx:t,nonTerminalName:s,label:r==null?void 0:r.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?sp:_i}consumeInternalRecord(e,t,r){if(zr(t),!rc(e)){const a=new Error(`<CONSUME${Ba(t)}> 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=qt(this.recordingProdStack),s=new G({idx:t,terminalType:e,label:r==null?void 0:r.LABEL});return i.definition.push(s),bc}}function ln(n,e,t,r=!1){zr(t);const i=qt(this.recordingProdStack),s=vt(e)?e:e.DEF,a=new n({definition:[],idx:t});return r&&(a.separator=e.SEP),x(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),_i}function op(n,e){zr(e);const t=qt(this.recordingProdStack),r=te(n)===!1,i=r===!1?n:n.DEF,s=new ge({definition:[],idx:e,ignoreAmbiguities:r&&n.IGNORE_AMBIGUITIES===!0});x(n,"MAX_LOOKAHEAD")&&(s.maxLookahead=n.MAX_LOOKAHEAD);const a=kl(i,o=>vt(o.GATE));return s.hasPredicates=a,t.definition.push(s),S(i,o=>{const l=new he({definition:[]});s.definition.push(l),x(o,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:x(o,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),o.ALT.call(this),this.recordingProdStack.pop()}),_i}function Ba(n){return n===0?"":`${n}`}function zr(n){if(n<0||n>Fa){const e=new Error(`Invalid DSL Method idx value: <${n}>
|
105
|
+
Idx value must be a none negative value smaller than ${Fa+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class lp{initPerformanceTracer(e){if(x(e,"traceInitPerf")){const t=e.traceInitPerf,r=typeof t=="number";this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=Ye.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){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}=zl(t),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return t()}}function cp(n,e){e.forEach(t=>{const r=t.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(n.prototype,i,s):n.prototype[i]=t.prototype[i]})})}const qr=zs(nt,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(qr);const Ye=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:xt,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Xr=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var ce;(function(n){n[n.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",n[n.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",n[n.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",n[n.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",n[n.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",n[n.LEFT_RECURSION=5]="LEFT_RECURSION",n[n.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",n[n.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",n[n.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",n[n.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",n[n.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",n[n.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",n[n.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",n[n.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(ce||(ce={}));function Ha(n=void 0){return function(){return n}}class rr{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 t=this.className;this.TRACE_INIT("toFastProps",()=>{ql(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),S(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=Oh({rules:z(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(D(r)&&this.skipValidations===!1){const i=Lh({rules:z(this.gastProductionsCache),tokenTypes:z(this.tokensMap),errMsgProvider:dt,grammarName:t}),s=vh({lookaheadStrategy:this.lookaheadStrategy,rules:z(this.gastProductionsCache),tokenTypes:z(this.tokensMap),grammarName:t});this.definitionErrors=this.definitionErrors.concat(i,s)}}),D(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=yf(z(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:z(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(z(this.gastProductionsCache))})),!rr.DEFER_DEFINITION_ERRORS_HANDLING&&!D(this.definitionErrors))throw e=k(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
106
106
|
${e.join(`
|
107
107
|
-------------------------------
|
108
108
|
`)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(t),r.initLexerAdapter(),r.initLooksAhead(t),r.initRecognizerEngine(e,t),r.initRecoverable(t),r.initTreeBuilder(t),r.initContentAssist(),r.initGastRecorder(t),r.initPerformanceTracer(t),x(t,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
109
109
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
110
110
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
111
|
-
For further details.`);this.skipValidations=x(t,"skipValidations")?t.skipValidations:Ye.skipValidations}}rr.DEFER_DEFINITION_ERRORS_HANDLING=!1;cp(rr,[Gh,Bh,Zh,ep,np,tp,rp,ip,ap,lp]);class up extends rr{constructor(e,t=Ye){const r=re(t);r.outputCst=!1,super(e,r)}}function
|
111
|
+
For further details.`);this.skipValidations=x(t,"skipValidations")?t.skipValidations:Ye.skipValidations}}rr.DEFER_DEFINITION_ERRORS_HANDLING=!1;cp(rr,[Gh,Bh,Zh,ep,np,tp,rp,ip,ap,lp]);class up extends rr{constructor(e,t=Ye){const r=re(t);r.outputCst=!1,super(e,r)}}function Xt(n,e,t){return`${n.name}_${e}_${t}`}const rt=1,dp=2,kc=4,Nc=5,ir=7,fp=8,hp=9,pp=10,mp=11,Ic=12;class Js{constructor(e){this.target=e}isEpsilon(){return!1}}class Qs extends Js{constructor(e,t){super(e),this.tokenType=t}}class Sc extends Js{constructor(e){super(e)}isEpsilon(){return!0}}class Zs extends Js{constructor(e,t,r){super(e),this.rule=t,this.followState=r}isEpsilon(){return!0}}function gp(n){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};yp(e,n);const t=n.length;for(let r=0;r<t;r++){const i=n[r],s=_t(e,i,i);s!==void 0&&Sp(e,i,s)}return e}function yp(n,e){const t=e.length;for(let r=0;r<t;r++){const i=e[r],s=Y(n,i,void 0,{type:dp}),a=Y(n,i,void 0,{type:ir});s.stop=a,n.ruleToStartState.set(i,s),n.ruleToStopState.set(i,a)}}function xc(n,e,t){return t instanceof G?ea(n,e,t.terminalType,t):t instanceof le?Ip(n,e,t):t instanceof ge?Ep(n,e,t):t instanceof ne?Ap(n,e,t):t instanceof V?vp(n,e,t):t instanceof me?Tp(n,e,t):t instanceof ke?_p(n,e,t):t instanceof Ne?Rp(n,e,t):_t(n,e,t)}function vp(n,e,t){const r=Y(n,e,t,{type:Nc});at(n,r);const i=rn(n,e,r,t,_t(n,e,t));return wc(n,e,t,i)}function Tp(n,e,t){const r=Y(n,e,t,{type:Nc});at(n,r);const i=rn(n,e,r,t,_t(n,e,t)),s=ea(n,e,t.separator,t);return wc(n,e,t,i,s)}function _p(n,e,t){const r=Y(n,e,t,{type:kc});at(n,r);const i=rn(n,e,r,t,_t(n,e,t));return Cc(n,e,t,i)}function Rp(n,e,t){const r=Y(n,e,t,{type:kc});at(n,r);const i=rn(n,e,r,t,_t(n,e,t)),s=ea(n,e,t.separator,t);return Cc(n,e,t,i,s)}function Ep(n,e,t){const r=Y(n,e,t,{type:rt});at(n,r);const i=k(t.definition,a=>xc(n,e,a));return rn(n,e,r,t,...i)}function Ap(n,e,t){const r=Y(n,e,t,{type:rt});at(n,r);const i=rn(n,e,r,t,_t(n,e,t));return bp(n,e,t,i)}function _t(n,e,t){const r=be(k(t.definition,i=>xc(n,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:Np(n,r)}function Cc(n,e,t,r,i){const s=r.left,a=r.right,o=Y(n,e,t,{type:mp});at(n,o);const l=Y(n,e,t,{type:Ic});return s.loopback=o,l.loopback=o,n.decisionMap[Xt(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",t.idx)]=o,K(a,o),i===void 0?(K(o,s),K(o,l)):(K(o,l),K(o,i.left),K(i.right,s)),{left:s,right:l}}function wc(n,e,t,r,i){const s=r.left,a=r.right,o=Y(n,e,t,{type:pp});at(n,o);const l=Y(n,e,t,{type:Ic}),c=Y(n,e,t,{type:hp});return o.loopback=c,l.loopback=c,K(o,s),K(o,l),K(a,c),i!==void 0?(K(c,l),K(c,i.left),K(i.right,s)):K(c,o),n.decisionMap[Xt(e,i?"RepetitionWithSeparator":"Repetition",t.idx)]=o,{left:o,right:l}}function bp(n,e,t,r){const i=r.left,s=r.right;return K(i,s),n.decisionMap[Xt(e,"Option",t.idx)]=i,r}function at(n,e){return n.decisionStates.push(e),e.decision=n.decisionStates.length-1,e.decision}function rn(n,e,t,r,...i){const s=Y(n,e,r,{type:fp,start:t});t.end=s;for(const o of i)o!==void 0?(K(t,o.left),K(o.right,s)):K(t,s);const a={left:t,right:s};return n.decisionMap[Xt(e,kp(r),r.idx)]=t,a}function kp(n){if(n instanceof ge)return"Alternation";if(n instanceof ne)return"Option";if(n instanceof V)return"Repetition";if(n instanceof me)return"RepetitionWithSeparator";if(n instanceof ke)return"RepetitionMandatory";if(n instanceof Ne)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function Np(n,e){const t=e.length;for(let s=0;s<t-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const l=o instanceof Zs,c=o,u=e[s+1].left;a.left.type===rt&&a.right.type===rt&&o!==void 0&&(l&&c.followState===a.right||o.target===a.right)?(l?c.followState=u:o.target=u,xp(n,a.right)):K(a.right,u)}const r=e[0],i=e[t-1];return{left:r.left,right:i.right}}function ea(n,e,t,r){const i=Y(n,e,r,{type:rt}),s=Y(n,e,r,{type:rt});return ta(i,new Qs(s,t)),{left:i,right:s}}function Ip(n,e,t){const r=t.referencedRule,i=n.ruleToStartState.get(r),s=Y(n,e,t,{type:rt}),a=Y(n,e,t,{type:rt}),o=new Zs(i,r,a);return ta(s,o),{left:s,right:a}}function Sp(n,e,t){const r=n.ruleToStartState.get(e);K(r,t.left);const i=n.ruleToStopState.get(e);return K(t.right,i),{left:r,right:i}}function K(n,e){const t=new Sc(e);ta(n,t)}function Y(n,e,t,r){const i=Object.assign({atn:n,production:t,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:n.states.length},r);return n.states.push(i),i}function ta(n,e){n.transitions.length===0&&(n.epsilonOnlyTransitions=e.isEpsilon()),n.transitions.push(e)}function xp(n,e){n.states.splice(n.states.indexOf(e),1)}const Yr={};class fs{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const t=$c(e);t in this.map||(this.map[t]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return k(this.configs,e=>e.alt)}get key(){let e="";for(const t in this.map)e+=t+":";return e}}function $c(n,e=!0){return`${e?`a${n.alt}`:""}s${n.state.stateNumber}:${n.stack.map(t=>t.stateNumber.toString()).join("_")}`}function Cp(n,e){const t={};return r=>{const i=r.toString();let s=t[i];return s!==void 0||(s={atnStartState:n,decision:e,states:{}},t[i]=s),s}}class Oc{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,t){this.predicates[e]=t}toString(){let e="";const t=this.predicates.length;for(let r=0;r<t;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const Va=new Oc;class wp extends Ys{constructor(e){var t;super(),this.logging=(t=e==null?void 0:e.logging)!==null&&t!==void 0?t:r=>console.log(r)}initialize(e){this.atn=gp(e.rules),this.dfas=$p(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:t,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,l=Xt(r,"Alternation",t),u=this.atn.decisionMap[l].decision,d=k(Pa({maxLookahead:1,occurrence:t,prodType:"Alternation",rule:r}),h=>k(h,f=>f[0]));if(Wa(d,!1)&&!s){const h=oe(d,(f,m,g)=>(S(m,_=>{_&&(f[_.tokenTypeIdx]=g,S(_.categoryMatches,y=>{f[y]=g}))}),f),{});return i?function(f){var m;const g=this.LA(1),_=h[g.tokenTypeIdx];if(f!==void 0&&_!==void 0){const y=(m=f[_])===null||m===void 0?void 0:m.GATE;if(y!==void 0&&y.call(this)===!1)return}return _}:function(){const f=this.LA(1);return h[f.tokenTypeIdx]}}else return i?function(h){const f=new Oc,m=h===void 0?0:h.length;for(let _=0;_<m;_++){const y=h==null?void 0:h[_].GATE;f.set(_,y===void 0||y.call(this))}const g=Pi.call(this,a,u,f,o);return typeof g=="number"?g:void 0}:function(){const h=Pi.call(this,a,u,Va,o);return typeof h=="number"?h:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:t,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,l=Xt(r,i,t),u=this.atn.decisionMap[l].decision,d=k(Pa({maxLookahead:1,occurrence:t,prodType:i,rule:r}),h=>k(h,f=>f[0]));if(Wa(d)&&d[0][0]&&!s){const h=d[0],f=xe(h);if(f.length===1&&D(f[0].categoryMatches)){const g=f[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}else{const m=oe(f,(g,_)=>(_!==void 0&&(g[_.tokenTypeIdx]=!0,S(_.categoryMatches,y=>{g[y]=!0})),g),{});return function(){const g=this.LA(1);return m[g.tokenTypeIdx]===!0}}}return function(){const h=Pi.call(this,a,u,Va,o);return typeof h=="object"?!1:h===0}}}function Wa(n,e=!0){const t=new Set;for(const r of n){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(t.has(o)){if(!i.has(o))return!1}else t.add(o),i.add(o)}}return!0}function $p(n){const e=n.decisionStates.length,t=Array(e);for(let r=0;r<e;r++)t[r]=Cp(n.decisionStates[r],r);return t}function Pi(n,e,t,r){const i=n[e](t);let s=i.start;if(s===void 0){const o=Hp(i.atnStartState);s=Mc(i,Lc(o)),i.start=s}return Op.apply(this,[i,s,t,r])}function Op(n,e,t,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let l=Gp(i,o);if(l===void 0&&(l=Lp.apply(this,[n,i,o,s,t,r])),l===Yr)return jp(a,i,o);if(l.isAcceptState===!0)return l.prediction;i=l,a.push(o),o=this.LA(s++)}}function Lp(n,e,t,r,i,s){const a=Up(e.configs,t,i);if(a.size===0)return Ka(n,e,t,Yr),Yr;let o=Lc(a);const l=Bp(a,i);if(l!==void 0)o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l;else if(zp(a)){const c=Gu(a.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,Mp.apply(this,[n,r,a.alts,s])}return o=Ka(n,e,t,o),o}function Mp(n,e,t,r){const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const s=n.atnStartState,a=s.rule,o=s.production,l=Pp({topLevelRule:a,ambiguityIndices:t,production:o,prefixPath:i});r(l)}function Pp(n){const e=k(n.prefixPath,i=>wt(i)).join(", "),t=n.production.idx===0?"":n.production.idx;let r=`Ambiguous Alternatives Detected: <${n.ambiguityIndices.join(", ")}> in <${Dp(n.production)}${t}> inside <${n.topLevelRule.name}> Rule,
|
112
112
|
<${e}> may appears as a prefix path in all these alternatives.
|
113
113
|
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
114
|
-
For Further details.`,r}function Dp(n){if(n instanceof le)return"SUBRULE";if(n instanceof ne)return"OPTION";if(n instanceof ge)return"OR";if(n instanceof ke)return"AT_LEAST_ONE";if(n instanceof Ne)return"AT_LEAST_ONE_SEP";if(n instanceof me)return"MANY_SEP";if(n instanceof V)return"MANY";if(n instanceof G)return"CONSUME";throw Error("non exhaustive match")}function jp(n,e,t){const r=Ee(e.configs.elements,s=>s.state.transitions),i=sd(r.filter(s=>s instanceof Qs).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:t,possibleTokenTypes:i,tokenPath:n}}function Gp(n,e){return n.edges[e.tokenTypeIdx]}function Up(n,e,t){const r=new fs,i=[];for(const a of n.elements){if(t.is(a.alt)===!1)continue;if(a.state.type===ir){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l<o;l++){const c=a.state.transitions[l],u=Fp(c,e);u!==void 0&&r.add({state:u,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new fs;for(const a of r.elements)Jr(a,s)}if(i.length>0&&!Wp(s))for(const a of i)s.add(a);return s}function Fp(n,e){if(n instanceof Qs&&ac(e,n.tokenType))return n.target}function Bp(n,e){let t;for(const r of n.elements)if(e.is(r.alt)===!0){if(t===void 0)t=r.alt;else if(t!==r.alt)return}return t}function Lc(n){return{configs:n,edges:{},isAcceptState:!1,prediction:-1}}function Ka(n,e,t,r){return r=Mc(n,r),e.edges[t.tokenTypeIdx]=r,r}function Mc(n,e){if(e===Yr)return e;const t=e.configs.key,r=n.states[t];return r!==void 0?r:(e.configs.finalize(),n.states[t]=e,e)}function Hp(n){const e=new fs,t=n.transitions.length;for(let r=0;r<t;r++){const s={state:n.transitions[r].target,alt:r,stack:[]};Jr(s,e)}return e}function Jr(n,e){const t=n.state;if(t.type===ir){if(n.stack.length>0){const i=[...n.stack],a={state:i.pop(),alt:n.alt,stack:i};Jr(a,e)}else e.add(n);return}t.epsilonOnlyTransitions||e.add(n);const r=t.transitions.length;for(let i=0;i<r;i++){const s=t.transitions[i],a=Vp(n,s);a!==void 0&&Jr(a,e)}}function Vp(n,e){if(e instanceof Sc)return{state:e.target,alt:n.alt,stack:n.stack};if(e instanceof Zs){const t=[...n.stack,e.followState];return{state:e.target,alt:n.alt,stack:t}}}function Wp(n){for(const e of n.elements)if(e.state.type===ir)return!0;return!1}function Kp(n){for(const e of n.elements)if(e.state.type!==ir)return!1;return!0}function zp(n){if(Kp(n))return!0;const e=Xp(n.elements);return qp(e)&&!Yp(e)}function Xp(n){const e=new Map;for(const t of n){const r=$c(t,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[t.alt]=!0}return e}function qp(n){for(const e of Array.from(n.values()))if(Object.keys(e).length>1)return!0;return!1}function Yp(n){for(const e of Array.from(n.values()))if(Object.keys(e).length===1)return!0;return!1}var za;(function(n){function e(t){return typeof t=="string"}n.is=e})(za||(za={}));var hs;(function(n){function e(t){return typeof t=="string"}n.is=e})(hs||(hs={}));var Xa;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Xa||(Xa={}));var Qr;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Qr||(Qr={}));var M;(function(n){function e(r,i){return r===Number.MAX_VALUE&&(r=Qr.MAX_VALUE),i===Number.MAX_VALUE&&(i=Qr.MAX_VALUE),{line:r,character:i}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&p.uinteger(i.line)&&p.uinteger(i.character)}n.is=t})(M||(M={}));var L;(function(n){function e(r,i,s,a){if(p.uinteger(r)&&p.uinteger(i)&&p.uinteger(s)&&p.uinteger(a))return{start:M.create(r,i),end:M.create(s,a)};if(M.is(r)&&M.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&M.is(i.start)&&M.is(i.end)}n.is=t})(L||(L={}));var Zr;(function(n){function e(r,i){return{uri:r,range:i}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&L.is(i.range)&&(p.string(i.uri)||p.undefined(i.uri))}n.is=t})(Zr||(Zr={}));var qa;(function(n){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&L.is(i.targetRange)&&p.string(i.targetUri)&&L.is(i.targetSelectionRange)&&(L.is(i.originSelectionRange)||p.undefined(i.originSelectionRange))}n.is=t})(qa||(qa={}));var ps;(function(n){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.numberRange(i.red,0,1)&&p.numberRange(i.green,0,1)&&p.numberRange(i.blue,0,1)&&p.numberRange(i.alpha,0,1)}n.is=t})(ps||(ps={}));var Ya;(function(n){function e(r,i){return{range:r,color:i}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&L.is(i.range)&&ps.is(i.color)}n.is=t})(Ya||(Ya={}));var Ja;(function(n){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.string(i.label)&&(p.undefined(i.textEdit)||Jt.is(i))&&(p.undefined(i.additionalTextEdits)||p.typedArray(i.additionalTextEdits,Jt.is))}n.is=t})(Ja||(Ja={}));var Qa;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(Qa||(Qa={}));var Za;(function(n){function e(r,i,s,a,o,l){const c={startLine:r,endLine:i};return p.defined(s)&&(c.startCharacter=s),p.defined(a)&&(c.endCharacter=a),p.defined(o)&&(c.kind=o),p.defined(l)&&(c.collapsedText=l),c}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.uinteger(i.startLine)&&p.uinteger(i.startLine)&&(p.undefined(i.startCharacter)||p.uinteger(i.startCharacter))&&(p.undefined(i.endCharacter)||p.uinteger(i.endCharacter))&&(p.undefined(i.kind)||p.string(i.kind))}n.is=t})(Za||(Za={}));var ms;(function(n){function e(r,i){return{location:r,message:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&Zr.is(i.location)&&p.string(i.message)}n.is=t})(ms||(ms={}));var eo;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(eo||(eo={}));var to;(function(n){n.Unnecessary=1,n.Deprecated=2})(to||(to={}));var no;(function(n){function e(t){const r=t;return p.objectLiteral(r)&&p.string(r.href)}n.is=e})(no||(no={}));var ei;(function(n){function e(r,i,s,a,o,l){let c={range:r,message:i};return p.defined(s)&&(c.severity=s),p.defined(a)&&(c.code=a),p.defined(o)&&(c.source=o),p.defined(l)&&(c.relatedInformation=l),c}n.create=e;function t(r){var i;let s=r;return p.defined(s)&&L.is(s.range)&&p.string(s.message)&&(p.number(s.severity)||p.undefined(s.severity))&&(p.integer(s.code)||p.string(s.code)||p.undefined(s.code))&&(p.undefined(s.codeDescription)||p.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(p.string(s.source)||p.undefined(s.source))&&(p.undefined(s.relatedInformation)||p.typedArray(s.relatedInformation,ms.is))}n.is=t})(ei||(ei={}));var Yt;(function(n){function e(r,i,...s){let a={title:r,command:i};return p.defined(s)&&s.length>0&&(a.arguments=s),a}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.title)&&p.string(i.command)}n.is=t})(Yt||(Yt={}));var Jt;(function(n){function e(s,a){return{range:s,newText:a}}n.replace=e;function t(s,a){return{range:{start:s,end:s},newText:a}}n.insert=t;function r(s){return{range:s,newText:""}}n.del=r;function i(s){const a=s;return p.objectLiteral(a)&&p.string(a.newText)&&L.is(a.range)}n.is=i})(Jt||(Jt={}));var gs;(function(n){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.string(i.label)&&(p.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(p.string(i.description)||i.description===void 0)}n.is=t})(gs||(gs={}));var Qt;(function(n){function e(t){const r=t;return p.string(r)}n.is=e})(Qt||(Qt={}));var ro;(function(n){function e(s,a,o){return{range:s,newText:a,annotationId:o}}n.replace=e;function t(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}n.insert=t;function r(s,a){return{range:s,newText:"",annotationId:a}}n.del=r;function i(s){const a=s;return Jt.is(a)&&(gs.is(a.annotationId)||Qt.is(a.annotationId))}n.is=i})(ro||(ro={}));var ys;(function(n){function e(r,i){return{textDocument:r,edits:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&Es.is(i.textDocument)&&Array.isArray(i.edits)}n.is=t})(ys||(ys={}));var vs;(function(n){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}n.create=e;function t(r){let i=r;return i&&i.kind==="create"&&p.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Qt.is(i.annotationId))}n.is=t})(vs||(vs={}));var Ts;(function(n){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}n.create=e;function t(r){let i=r;return i&&i.kind==="rename"&&p.string(i.oldUri)&&p.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Qt.is(i.annotationId))}n.is=t})(Ts||(Ts={}));var _s;(function(n){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}n.create=e;function t(r){let i=r;return i&&i.kind==="delete"&&p.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||p.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||p.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Qt.is(i.annotationId))}n.is=t})(_s||(_s={}));var Rs;(function(n){function e(t){let r=t;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>p.string(i.kind)?vs.is(i)||Ts.is(i)||_s.is(i):ys.is(i)))}n.is=e})(Rs||(Rs={}));var io;(function(n){function e(r){return{uri:r}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)}n.is=t})(io||(io={}));var so;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)&&p.integer(i.version)}n.is=t})(so||(so={}));var Es;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)&&(i.version===null||p.integer(i.version))}n.is=t})(Es||(Es={}));var ao;(function(n){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)&&p.string(i.languageId)&&p.integer(i.version)&&p.string(i.text)}n.is=t})(ao||(ao={}));var As;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const r=t;return r===n.PlainText||r===n.Markdown}n.is=e})(As||(As={}));var qn;(function(n){function e(t){const r=t;return p.objectLiteral(t)&&As.is(r.kind)&&p.string(r.value)}n.is=e})(qn||(qn={}));var oo;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(oo||(oo={}));var lo;(function(n){n.PlainText=1,n.Snippet=2})(lo||(lo={}));var co;(function(n){n.Deprecated=1})(co||(co={}));var uo;(function(n){function e(r,i,s){return{newText:r,insert:i,replace:s}}n.create=e;function t(r){const i=r;return i&&p.string(i.newText)&&L.is(i.insert)&&L.is(i.replace)}n.is=t})(uo||(uo={}));var fo;(function(n){n.asIs=1,n.adjustIndentation=2})(fo||(fo={}));var ho;(function(n){function e(t){const r=t;return r&&(p.string(r.detail)||r.detail===void 0)&&(p.string(r.description)||r.description===void 0)}n.is=e})(ho||(ho={}));var po;(function(n){function e(t){return{label:t}}n.create=e})(po||(po={}));var mo;(function(n){function e(t,r){return{items:t||[],isIncomplete:!!r}}n.create=e})(mo||(mo={}));var ti;(function(n){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(r){const i=r;return p.string(i)||p.objectLiteral(i)&&p.string(i.language)&&p.string(i.value)}n.is=t})(ti||(ti={}));var go;(function(n){function e(t){let r=t;return!!r&&p.objectLiteral(r)&&(qn.is(r.contents)||ti.is(r.contents)||p.typedArray(r.contents,ti.is))&&(t.range===void 0||L.is(t.range))}n.is=e})(go||(go={}));var yo;(function(n){function e(t,r){return r?{label:t,documentation:r}:{label:t}}n.create=e})(yo||(yo={}));var vo;(function(n){function e(t,r,...i){let s={label:t};return p.defined(r)&&(s.documentation=r),p.defined(i)?s.parameters=i:s.parameters=[],s}n.create=e})(vo||(vo={}));var To;(function(n){n.Text=1,n.Read=2,n.Write=3})(To||(To={}));var _o;(function(n){function e(t,r){let i={range:t};return p.number(r)&&(i.kind=r),i}n.create=e})(_o||(_o={}));var Ro;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(Ro||(Ro={}));var Eo;(function(n){n.Deprecated=1})(Eo||(Eo={}));var Ao;(function(n){function e(t,r,i,s,a){let o={name:t,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}n.create=e})(Ao||(Ao={}));var bo;(function(n){function e(t,r,i,s){return s!==void 0?{name:t,kind:r,location:{uri:i,range:s}}:{name:t,kind:r,location:{uri:i}}}n.create=e})(bo||(bo={}));var ko;(function(n){function e(r,i,s,a,o,l){let c={name:r,detail:i,kind:s,range:a,selectionRange:o};return l!==void 0&&(c.children=l),c}n.create=e;function t(r){let i=r;return i&&p.string(i.name)&&p.number(i.kind)&&L.is(i.range)&&L.is(i.selectionRange)&&(i.detail===void 0||p.string(i.detail))&&(i.deprecated===void 0||p.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}n.is=t})(ko||(ko={}));var No;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(No||(No={}));var ni;(function(n){n.Invoked=1,n.Automatic=2})(ni||(ni={}));var Io;(function(n){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}n.create=e;function t(r){let i=r;return p.defined(i)&&p.typedArray(i.diagnostics,ei.is)&&(i.only===void 0||p.typedArray(i.only,p.string))&&(i.triggerKind===void 0||i.triggerKind===ni.Invoked||i.triggerKind===ni.Automatic)}n.is=t})(Io||(Io={}));var So;(function(n){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):Yt.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}n.create=e;function t(r){let i=r;return i&&p.string(i.title)&&(i.diagnostics===void 0||p.typedArray(i.diagnostics,ei.is))&&(i.kind===void 0||p.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Yt.is(i.command))&&(i.isPreferred===void 0||p.boolean(i.isPreferred))&&(i.edit===void 0||Rs.is(i.edit))}n.is=t})(So||(So={}));var xo;(function(n){function e(r,i){let s={range:r};return p.defined(i)&&(s.data=i),s}n.create=e;function t(r){let i=r;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.command)||Yt.is(i.command))}n.is=t})(xo||(xo={}));var Co;(function(n){function e(r,i){return{tabSize:r,insertSpaces:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.uinteger(i.tabSize)&&p.boolean(i.insertSpaces)}n.is=t})(Co||(Co={}));var wo;(function(n){function e(r,i,s){return{range:r,target:i,data:s}}n.create=e;function t(r){let i=r;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.target)||p.string(i.target))}n.is=t})(wo||(wo={}));var $o;(function(n){function e(r,i){return{range:r,parent:i}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&L.is(i.range)&&(i.parent===void 0||n.is(i.parent))}n.is=t})($o||($o={}));var Oo;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(Oo||(Oo={}));var Lo;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(Lo||(Lo={}));var Mo;(function(n){function e(t){const r=t;return p.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}n.is=e})(Mo||(Mo={}));var Po;(function(n){function e(r,i){return{range:r,text:i}}n.create=e;function t(r){const i=r;return i!=null&&L.is(i.range)&&p.string(i.text)}n.is=t})(Po||(Po={}));var Do;(function(n){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}n.create=e;function t(r){const i=r;return i!=null&&L.is(i.range)&&p.boolean(i.caseSensitiveLookup)&&(p.string(i.variableName)||i.variableName===void 0)}n.is=t})(Do||(Do={}));var jo;(function(n){function e(r,i){return{range:r,expression:i}}n.create=e;function t(r){const i=r;return i!=null&&L.is(i.range)&&(p.string(i.expression)||i.expression===void 0)}n.is=t})(jo||(jo={}));var Go;(function(n){function e(r,i){return{frameId:r,stoppedLocation:i}}n.create=e;function t(r){const i=r;return p.defined(i)&&L.is(r.stoppedLocation)}n.is=t})(Go||(Go={}));var bs;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(bs||(bs={}));var ks;(function(n){function e(r){return{value:r}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&(i.tooltip===void 0||p.string(i.tooltip)||qn.is(i.tooltip))&&(i.location===void 0||Zr.is(i.location))&&(i.command===void 0||Yt.is(i.command))}n.is=t})(ks||(ks={}));var Uo;(function(n){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&M.is(i.position)&&(p.string(i.label)||p.typedArray(i.label,ks.is))&&(i.kind===void 0||bs.is(i.kind))&&i.textEdits===void 0||p.typedArray(i.textEdits,Jt.is)&&(i.tooltip===void 0||p.string(i.tooltip)||qn.is(i.tooltip))&&(i.paddingLeft===void 0||p.boolean(i.paddingLeft))&&(i.paddingRight===void 0||p.boolean(i.paddingRight))}n.is=t})(Uo||(Uo={}));var Fo;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(Fo||(Fo={}));var Bo;(function(n){function e(t,r,i,s){return{insertText:t,filterText:r,range:i,command:s}}n.create=e})(Bo||(Bo={}));var Ho;(function(n){function e(t){return{items:t}}n.create=e})(Ho||(Ho={}));var Vo;(function(n){n.Invoked=0,n.Automatic=1})(Vo||(Vo={}));var Wo;(function(n){function e(t,r){return{range:t,text:r}}n.create=e})(Wo||(Wo={}));var Ko;(function(n){function e(t,r){return{triggerKind:t,selectedCompletionInfo:r}}n.create=e})(Ko||(Ko={}));var zo;(function(n){function e(t){const r=t;return p.objectLiteral(r)&&hs.is(r.uri)&&p.string(r.name)}n.is=e})(zo||(zo={}));var Xo;(function(n){function e(s,a,o,l){return new Jp(s,a,o,l)}n.create=e;function t(s){let a=s;return!!(p.defined(a)&&p.string(a.uri)&&(p.undefined(a.languageId)||p.string(a.languageId))&&p.uinteger(a.lineCount)&&p.func(a.getText)&&p.func(a.positionAt)&&p.func(a.offsetAt))}n.is=t;function r(s,a){let o=s.getText(),l=i(a,(u,d)=>{let h=u.range.start.line-d.range.start.line;return h===0?u.range.start.character-d.range.start.character:h}),c=o.length;for(let u=l.length-1;u>=0;u--){let d=l[u],h=s.offsetAt(d.range.start),f=s.offsetAt(d.range.end);if(f<=c)o=o.substring(0,h)+d.newText+o.substring(f,o.length);else throw new Error("Overlapping edit");c=h}return o}n.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,l=s.slice(0,o),c=s.slice(o);i(l,a),i(c,a);let u=0,d=0,h=0;for(;u<l.length&&d<c.length;)a(l[u],c[d])<=0?s[h++]=l[u++]:s[h++]=c[d++];for(;u<l.length;)s[h++]=l[u++];for(;d<c.length;)s[h++]=c[d++];return s}})(Xo||(Xo={}));let Jp=class{constructor(e,t,r,i){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,r=!0;for(let i=0;i<t.length;i++){r&&(e.push(i),r=!1);let s=t.charAt(i);r=s==="\r"||s===`
|
114
|
+
For Further details.`,r}function Dp(n){if(n instanceof le)return"SUBRULE";if(n instanceof ne)return"OPTION";if(n instanceof ge)return"OR";if(n instanceof ke)return"AT_LEAST_ONE";if(n instanceof Ne)return"AT_LEAST_ONE_SEP";if(n instanceof me)return"MANY_SEP";if(n instanceof V)return"MANY";if(n instanceof G)return"CONSUME";throw Error("non exhaustive match")}function jp(n,e,t){const r=Ee(e.configs.elements,s=>s.state.transitions),i=sd(r.filter(s=>s instanceof Qs).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:t,possibleTokenTypes:i,tokenPath:n}}function Gp(n,e){return n.edges[e.tokenTypeIdx]}function Up(n,e,t){const r=new fs,i=[];for(const a of n.elements){if(t.is(a.alt)===!1)continue;if(a.state.type===ir){i.push(a);continue}const o=a.state.transitions.length;for(let l=0;l<o;l++){const c=a.state.transitions[l],u=Fp(c,e);u!==void 0&&r.add({state:u,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new fs;for(const a of r.elements)Jr(a,s)}if(i.length>0&&!Wp(s))for(const a of i)s.add(a);return s}function Fp(n,e){if(n instanceof Qs&&ac(e,n.tokenType))return n.target}function Bp(n,e){let t;for(const r of n.elements)if(e.is(r.alt)===!0){if(t===void 0)t=r.alt;else if(t!==r.alt)return}return t}function Lc(n){return{configs:n,edges:{},isAcceptState:!1,prediction:-1}}function Ka(n,e,t,r){return r=Mc(n,r),e.edges[t.tokenTypeIdx]=r,r}function Mc(n,e){if(e===Yr)return e;const t=e.configs.key,r=n.states[t];return r!==void 0?r:(e.configs.finalize(),n.states[t]=e,e)}function Hp(n){const e=new fs,t=n.transitions.length;for(let r=0;r<t;r++){const s={state:n.transitions[r].target,alt:r,stack:[]};Jr(s,e)}return e}function Jr(n,e){const t=n.state;if(t.type===ir){if(n.stack.length>0){const i=[...n.stack],a={state:i.pop(),alt:n.alt,stack:i};Jr(a,e)}else e.add(n);return}t.epsilonOnlyTransitions||e.add(n);const r=t.transitions.length;for(let i=0;i<r;i++){const s=t.transitions[i],a=Vp(n,s);a!==void 0&&Jr(a,e)}}function Vp(n,e){if(e instanceof Sc)return{state:e.target,alt:n.alt,stack:n.stack};if(e instanceof Zs){const t=[...n.stack,e.followState];return{state:e.target,alt:n.alt,stack:t}}}function Wp(n){for(const e of n.elements)if(e.state.type===ir)return!0;return!1}function Kp(n){for(const e of n.elements)if(e.state.type!==ir)return!1;return!0}function zp(n){if(Kp(n))return!0;const e=qp(n.elements);return Xp(e)&&!Yp(e)}function qp(n){const e=new Map;for(const t of n){const r=$c(t,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[t.alt]=!0}return e}function Xp(n){for(const e of Array.from(n.values()))if(Object.keys(e).length>1)return!0;return!1}function Yp(n){for(const e of Array.from(n.values()))if(Object.keys(e).length===1)return!0;return!1}var za;(function(n){function e(t){return typeof t=="string"}n.is=e})(za||(za={}));var hs;(function(n){function e(t){return typeof t=="string"}n.is=e})(hs||(hs={}));var qa;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(qa||(qa={}));var Qr;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Qr||(Qr={}));var M;(function(n){function e(r,i){return r===Number.MAX_VALUE&&(r=Qr.MAX_VALUE),i===Number.MAX_VALUE&&(i=Qr.MAX_VALUE),{line:r,character:i}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&p.uinteger(i.line)&&p.uinteger(i.character)}n.is=t})(M||(M={}));var L;(function(n){function e(r,i,s,a){if(p.uinteger(r)&&p.uinteger(i)&&p.uinteger(s)&&p.uinteger(a))return{start:M.create(r,i),end:M.create(s,a)};if(M.is(r)&&M.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&M.is(i.start)&&M.is(i.end)}n.is=t})(L||(L={}));var Zr;(function(n){function e(r,i){return{uri:r,range:i}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&L.is(i.range)&&(p.string(i.uri)||p.undefined(i.uri))}n.is=t})(Zr||(Zr={}));var Xa;(function(n){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&L.is(i.targetRange)&&p.string(i.targetUri)&&L.is(i.targetSelectionRange)&&(L.is(i.originSelectionRange)||p.undefined(i.originSelectionRange))}n.is=t})(Xa||(Xa={}));var ps;(function(n){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.numberRange(i.red,0,1)&&p.numberRange(i.green,0,1)&&p.numberRange(i.blue,0,1)&&p.numberRange(i.alpha,0,1)}n.is=t})(ps||(ps={}));var Ya;(function(n){function e(r,i){return{range:r,color:i}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&L.is(i.range)&&ps.is(i.color)}n.is=t})(Ya||(Ya={}));var Ja;(function(n){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.string(i.label)&&(p.undefined(i.textEdit)||Jt.is(i))&&(p.undefined(i.additionalTextEdits)||p.typedArray(i.additionalTextEdits,Jt.is))}n.is=t})(Ja||(Ja={}));var Qa;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(Qa||(Qa={}));var Za;(function(n){function e(r,i,s,a,o,l){const c={startLine:r,endLine:i};return p.defined(s)&&(c.startCharacter=s),p.defined(a)&&(c.endCharacter=a),p.defined(o)&&(c.kind=o),p.defined(l)&&(c.collapsedText=l),c}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.uinteger(i.startLine)&&p.uinteger(i.startLine)&&(p.undefined(i.startCharacter)||p.uinteger(i.startCharacter))&&(p.undefined(i.endCharacter)||p.uinteger(i.endCharacter))&&(p.undefined(i.kind)||p.string(i.kind))}n.is=t})(Za||(Za={}));var ms;(function(n){function e(r,i){return{location:r,message:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&Zr.is(i.location)&&p.string(i.message)}n.is=t})(ms||(ms={}));var eo;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(eo||(eo={}));var to;(function(n){n.Unnecessary=1,n.Deprecated=2})(to||(to={}));var no;(function(n){function e(t){const r=t;return p.objectLiteral(r)&&p.string(r.href)}n.is=e})(no||(no={}));var ei;(function(n){function e(r,i,s,a,o,l){let c={range:r,message:i};return p.defined(s)&&(c.severity=s),p.defined(a)&&(c.code=a),p.defined(o)&&(c.source=o),p.defined(l)&&(c.relatedInformation=l),c}n.create=e;function t(r){var i;let s=r;return p.defined(s)&&L.is(s.range)&&p.string(s.message)&&(p.number(s.severity)||p.undefined(s.severity))&&(p.integer(s.code)||p.string(s.code)||p.undefined(s.code))&&(p.undefined(s.codeDescription)||p.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(p.string(s.source)||p.undefined(s.source))&&(p.undefined(s.relatedInformation)||p.typedArray(s.relatedInformation,ms.is))}n.is=t})(ei||(ei={}));var Yt;(function(n){function e(r,i,...s){let a={title:r,command:i};return p.defined(s)&&s.length>0&&(a.arguments=s),a}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.title)&&p.string(i.command)}n.is=t})(Yt||(Yt={}));var Jt;(function(n){function e(s,a){return{range:s,newText:a}}n.replace=e;function t(s,a){return{range:{start:s,end:s},newText:a}}n.insert=t;function r(s){return{range:s,newText:""}}n.del=r;function i(s){const a=s;return p.objectLiteral(a)&&p.string(a.newText)&&L.is(a.range)}n.is=i})(Jt||(Jt={}));var gs;(function(n){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&p.string(i.label)&&(p.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(p.string(i.description)||i.description===void 0)}n.is=t})(gs||(gs={}));var Qt;(function(n){function e(t){const r=t;return p.string(r)}n.is=e})(Qt||(Qt={}));var ro;(function(n){function e(s,a,o){return{range:s,newText:a,annotationId:o}}n.replace=e;function t(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}n.insert=t;function r(s,a){return{range:s,newText:"",annotationId:a}}n.del=r;function i(s){const a=s;return Jt.is(a)&&(gs.is(a.annotationId)||Qt.is(a.annotationId))}n.is=i})(ro||(ro={}));var ys;(function(n){function e(r,i){return{textDocument:r,edits:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&Es.is(i.textDocument)&&Array.isArray(i.edits)}n.is=t})(ys||(ys={}));var vs;(function(n){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}n.create=e;function t(r){let i=r;return i&&i.kind==="create"&&p.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Qt.is(i.annotationId))}n.is=t})(vs||(vs={}));var Ts;(function(n){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}n.create=e;function t(r){let i=r;return i&&i.kind==="rename"&&p.string(i.oldUri)&&p.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Qt.is(i.annotationId))}n.is=t})(Ts||(Ts={}));var _s;(function(n){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}n.create=e;function t(r){let i=r;return i&&i.kind==="delete"&&p.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||p.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||p.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Qt.is(i.annotationId))}n.is=t})(_s||(_s={}));var Rs;(function(n){function e(t){let r=t;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>p.string(i.kind)?vs.is(i)||Ts.is(i)||_s.is(i):ys.is(i)))}n.is=e})(Rs||(Rs={}));var io;(function(n){function e(r){return{uri:r}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)}n.is=t})(io||(io={}));var so;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)&&p.integer(i.version)}n.is=t})(so||(so={}));var Es;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)&&(i.version===null||p.integer(i.version))}n.is=t})(Es||(Es={}));var ao;(function(n){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.string(i.uri)&&p.string(i.languageId)&&p.integer(i.version)&&p.string(i.text)}n.is=t})(ao||(ao={}));var As;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const r=t;return r===n.PlainText||r===n.Markdown}n.is=e})(As||(As={}));var Xn;(function(n){function e(t){const r=t;return p.objectLiteral(t)&&As.is(r.kind)&&p.string(r.value)}n.is=e})(Xn||(Xn={}));var oo;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(oo||(oo={}));var lo;(function(n){n.PlainText=1,n.Snippet=2})(lo||(lo={}));var co;(function(n){n.Deprecated=1})(co||(co={}));var uo;(function(n){function e(r,i,s){return{newText:r,insert:i,replace:s}}n.create=e;function t(r){const i=r;return i&&p.string(i.newText)&&L.is(i.insert)&&L.is(i.replace)}n.is=t})(uo||(uo={}));var fo;(function(n){n.asIs=1,n.adjustIndentation=2})(fo||(fo={}));var ho;(function(n){function e(t){const r=t;return r&&(p.string(r.detail)||r.detail===void 0)&&(p.string(r.description)||r.description===void 0)}n.is=e})(ho||(ho={}));var po;(function(n){function e(t){return{label:t}}n.create=e})(po||(po={}));var mo;(function(n){function e(t,r){return{items:t||[],isIncomplete:!!r}}n.create=e})(mo||(mo={}));var ti;(function(n){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(r){const i=r;return p.string(i)||p.objectLiteral(i)&&p.string(i.language)&&p.string(i.value)}n.is=t})(ti||(ti={}));var go;(function(n){function e(t){let r=t;return!!r&&p.objectLiteral(r)&&(Xn.is(r.contents)||ti.is(r.contents)||p.typedArray(r.contents,ti.is))&&(t.range===void 0||L.is(t.range))}n.is=e})(go||(go={}));var yo;(function(n){function e(t,r){return r?{label:t,documentation:r}:{label:t}}n.create=e})(yo||(yo={}));var vo;(function(n){function e(t,r,...i){let s={label:t};return p.defined(r)&&(s.documentation=r),p.defined(i)?s.parameters=i:s.parameters=[],s}n.create=e})(vo||(vo={}));var To;(function(n){n.Text=1,n.Read=2,n.Write=3})(To||(To={}));var _o;(function(n){function e(t,r){let i={range:t};return p.number(r)&&(i.kind=r),i}n.create=e})(_o||(_o={}));var Ro;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(Ro||(Ro={}));var Eo;(function(n){n.Deprecated=1})(Eo||(Eo={}));var Ao;(function(n){function e(t,r,i,s,a){let o={name:t,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}n.create=e})(Ao||(Ao={}));var bo;(function(n){function e(t,r,i,s){return s!==void 0?{name:t,kind:r,location:{uri:i,range:s}}:{name:t,kind:r,location:{uri:i}}}n.create=e})(bo||(bo={}));var ko;(function(n){function e(r,i,s,a,o,l){let c={name:r,detail:i,kind:s,range:a,selectionRange:o};return l!==void 0&&(c.children=l),c}n.create=e;function t(r){let i=r;return i&&p.string(i.name)&&p.number(i.kind)&&L.is(i.range)&&L.is(i.selectionRange)&&(i.detail===void 0||p.string(i.detail))&&(i.deprecated===void 0||p.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}n.is=t})(ko||(ko={}));var No;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(No||(No={}));var ni;(function(n){n.Invoked=1,n.Automatic=2})(ni||(ni={}));var Io;(function(n){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}n.create=e;function t(r){let i=r;return p.defined(i)&&p.typedArray(i.diagnostics,ei.is)&&(i.only===void 0||p.typedArray(i.only,p.string))&&(i.triggerKind===void 0||i.triggerKind===ni.Invoked||i.triggerKind===ni.Automatic)}n.is=t})(Io||(Io={}));var So;(function(n){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):Yt.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}n.create=e;function t(r){let i=r;return i&&p.string(i.title)&&(i.diagnostics===void 0||p.typedArray(i.diagnostics,ei.is))&&(i.kind===void 0||p.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Yt.is(i.command))&&(i.isPreferred===void 0||p.boolean(i.isPreferred))&&(i.edit===void 0||Rs.is(i.edit))}n.is=t})(So||(So={}));var xo;(function(n){function e(r,i){let s={range:r};return p.defined(i)&&(s.data=i),s}n.create=e;function t(r){let i=r;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.command)||Yt.is(i.command))}n.is=t})(xo||(xo={}));var Co;(function(n){function e(r,i){return{tabSize:r,insertSpaces:i}}n.create=e;function t(r){let i=r;return p.defined(i)&&p.uinteger(i.tabSize)&&p.boolean(i.insertSpaces)}n.is=t})(Co||(Co={}));var wo;(function(n){function e(r,i,s){return{range:r,target:i,data:s}}n.create=e;function t(r){let i=r;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.target)||p.string(i.target))}n.is=t})(wo||(wo={}));var $o;(function(n){function e(r,i){return{range:r,parent:i}}n.create=e;function t(r){let i=r;return p.objectLiteral(i)&&L.is(i.range)&&(i.parent===void 0||n.is(i.parent))}n.is=t})($o||($o={}));var Oo;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(Oo||(Oo={}));var Lo;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(Lo||(Lo={}));var Mo;(function(n){function e(t){const r=t;return p.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}n.is=e})(Mo||(Mo={}));var Po;(function(n){function e(r,i){return{range:r,text:i}}n.create=e;function t(r){const i=r;return i!=null&&L.is(i.range)&&p.string(i.text)}n.is=t})(Po||(Po={}));var Do;(function(n){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}n.create=e;function t(r){const i=r;return i!=null&&L.is(i.range)&&p.boolean(i.caseSensitiveLookup)&&(p.string(i.variableName)||i.variableName===void 0)}n.is=t})(Do||(Do={}));var jo;(function(n){function e(r,i){return{range:r,expression:i}}n.create=e;function t(r){const i=r;return i!=null&&L.is(i.range)&&(p.string(i.expression)||i.expression===void 0)}n.is=t})(jo||(jo={}));var Go;(function(n){function e(r,i){return{frameId:r,stoppedLocation:i}}n.create=e;function t(r){const i=r;return p.defined(i)&&L.is(r.stoppedLocation)}n.is=t})(Go||(Go={}));var bs;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(bs||(bs={}));var ks;(function(n){function e(r){return{value:r}}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&(i.tooltip===void 0||p.string(i.tooltip)||Xn.is(i.tooltip))&&(i.location===void 0||Zr.is(i.location))&&(i.command===void 0||Yt.is(i.command))}n.is=t})(ks||(ks={}));var Uo;(function(n){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}n.create=e;function t(r){const i=r;return p.objectLiteral(i)&&M.is(i.position)&&(p.string(i.label)||p.typedArray(i.label,ks.is))&&(i.kind===void 0||bs.is(i.kind))&&i.textEdits===void 0||p.typedArray(i.textEdits,Jt.is)&&(i.tooltip===void 0||p.string(i.tooltip)||Xn.is(i.tooltip))&&(i.paddingLeft===void 0||p.boolean(i.paddingLeft))&&(i.paddingRight===void 0||p.boolean(i.paddingRight))}n.is=t})(Uo||(Uo={}));var Fo;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(Fo||(Fo={}));var Bo;(function(n){function e(t,r,i,s){return{insertText:t,filterText:r,range:i,command:s}}n.create=e})(Bo||(Bo={}));var Ho;(function(n){function e(t){return{items:t}}n.create=e})(Ho||(Ho={}));var Vo;(function(n){n.Invoked=0,n.Automatic=1})(Vo||(Vo={}));var Wo;(function(n){function e(t,r){return{range:t,text:r}}n.create=e})(Wo||(Wo={}));var Ko;(function(n){function e(t,r){return{triggerKind:t,selectedCompletionInfo:r}}n.create=e})(Ko||(Ko={}));var zo;(function(n){function e(t){const r=t;return p.objectLiteral(r)&&hs.is(r.uri)&&p.string(r.name)}n.is=e})(zo||(zo={}));var qo;(function(n){function e(s,a,o,l){return new Jp(s,a,o,l)}n.create=e;function t(s){let a=s;return!!(p.defined(a)&&p.string(a.uri)&&(p.undefined(a.languageId)||p.string(a.languageId))&&p.uinteger(a.lineCount)&&p.func(a.getText)&&p.func(a.positionAt)&&p.func(a.offsetAt))}n.is=t;function r(s,a){let o=s.getText(),l=i(a,(u,d)=>{let h=u.range.start.line-d.range.start.line;return h===0?u.range.start.character-d.range.start.character:h}),c=o.length;for(let u=l.length-1;u>=0;u--){let d=l[u],h=s.offsetAt(d.range.start),f=s.offsetAt(d.range.end);if(f<=c)o=o.substring(0,h)+d.newText+o.substring(f,o.length);else throw new Error("Overlapping edit");c=h}return o}n.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,l=s.slice(0,o),c=s.slice(o);i(l,a),i(c,a);let u=0,d=0,h=0;for(;u<l.length&&d<c.length;)a(l[u],c[d])<=0?s[h++]=l[u++]:s[h++]=c[d++];for(;u<l.length;)s[h++]=l[u++];for(;d<c.length;)s[h++]=c[d++];return s}})(qo||(qo={}));let Jp=class{constructor(e,t,r,i){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,r=!0;for(let i=0;i<t.length;i++){r&&(e.push(i),r=!1);let s=t.charAt(i);r=s==="\r"||s===`
|
115
115
|
`,s==="\r"&&i+1<t.length&&t.charAt(i+1)===`
|
116
|
-
`&&i++}r&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,i=t.length;if(i===0)return M.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);t[a]>e?i=a:r=a+1}let s=r-1;return M.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var p;(function(n){const e=Object.prototype.toString;function t(f){return typeof f<"u"}n.defined=t;function r(f){return typeof f>"u"}n.undefined=r;function i(f){return f===!0||f===!1}n.boolean=i;function s(f){return e.call(f)==="[object String]"}n.string=s;function a(f){return e.call(f)==="[object Number]"}n.number=a;function o(f,m,g){return e.call(f)==="[object Number]"&&m<=f&&f<=g}n.numberRange=o;function l(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}n.integer=l;function c(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}n.uinteger=c;function u(f){return e.call(f)==="[object Function]"}n.func=u;function d(f){return f!==null&&typeof f=="object"}n.objectLiteral=d;function h(f,m){return Array.isArray(f)&&f.every(m)}n.typedArray=h})(p||(p={}));class Qp{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new Dc(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new na;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new Ns(e.startOffset,e.image.length,Zi(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const s of e){const a=new Ns(s.startOffset,s.image.length,Zi(s),s.tokenType,!0);a.root=this.rootNode,t.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...t),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();(r==null?void 0:r.content.length)===0&&this.removeNode(r)}}class Pc{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,t;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(t=this.container)===null||t===void 0?void 0:t.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Ns extends Pc{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,t,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=t,this._range=r}}class na extends Pc{constructor(){super(...arguments),this.content=new ra(this)}get children(){return this.content}get offset(){var e,t;return(t=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&t!==void 0?t:0}get length(){return this.end-this.offset}get end(){var e,t;return(t=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&t!==void 0?t:0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=t;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:M.create(0,0),end:M.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 t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}}class ra extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ra.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...r){return this.addParents(r),super.splice(e,t,...r)}addParents(e){for(const t of e)t.container=this.parent}}class Dc extends na{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Is=Symbol("Datatype");function Di(n){return n.$type===Is}const qo="",jc=n=>n.endsWith(qo)?n:n+qo;class Gc{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new rm(t,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}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 Zp extends Gc{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Qp,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(jc(e.name),this.startImplementation(r,t).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(Vl(e))return Is;{const t=Bs(e);return t??e.name}}}parse(e,t={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=t.rule?this.allRules.get(t.rule):this.mainRule;if(!i)throw new Error(t.rule?`No rule found with name '${t.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,t){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const a={$type:e};this.stack.push(a),e===Is&&(a.value="")}let s;try{s=t(r)}catch{s=void 0}return s===void 0&&i&&(s=this.construct()),s}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let i=0;i<t.length;i++)if(t[i].startOffset>r)return t.splice(0,i);return t.splice(0,t.length)}consume(e,t,r){const i=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:l}=this.getAssignment(r),c=this.current;if(o){const u=ht(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,u,a,l)}else if(Di(c)){let u=i.image;ht(r)||(u=this.converter.convert(u,a).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,t,s);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,i,a)}performSubruleAssignment(e,t,r){const{assignment:i,isCrossRef:s}=this.getAssignment(t);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(Di(a))a.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(t.operator,t.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return $d(e),this.nodeBuilder.construct(e),this.stack.pop(),Di(e)?this.converter.convert(e.value,e.$cstNode):(Od(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const t=di(e,ft);this.assignmentMap.set(e,{assignment:t,isCrossRef:t?js(t.terminal):!1})}return this.assignmentMap.get(e)}assign(e,t,r,i,s){const a=this.current;let o;switch(s&&typeof r=="string"?o=this.linker.buildReference(a,t,i,r):o=r,e){case"=":{a[t]=o;break}case"?=":{a[t]=!0;break}case"+=":Array.isArray(a[t])||(a[t]=[]),a[t].push(o)}}assignWithoutOverride(e,t){for(const[i,s]of Object.entries(t)){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 em{buildMismatchTokenMessage(e){return xt.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return xt.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return xt.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return xt.buildEarlyExitMessage(e)}}class Uc extends em{buildMismatchTokenMessage({expected:e,actual:t}){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 \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class tm extends Gc{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.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,t){const r=this.wrapper.DEFINE_RULE(jc(e.name),this.startImplementation(t).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 t=>{const r=this.keepStackSize();try{e(t)}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,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,t,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}}const nm={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Uc};class rm extends up{constructor(e,t){const r=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},nm),{lookaheadStrategy:r?new Ys({maxLookahead:t.maxLookahead}):new wp({logging:t.skipValidations?()=>{}:void 0})}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}}function Fc(n,e,t){return im({parser:e,tokens:t,ruleNames:new Map},n),e}function im(n,e){const t=Gl(e,!1),r=ee(e.rules).filter(Ce).filter(i=>t.has(i));for(const i of r){const s=Object.assign(Object.assign({},n),{consume:1,optional:1,subrule:1,many:1,or:1});n.parser.rule(i,gt(s,i.definition))}}function gt(n,e,t=!1){let r;if(ht(e))r=dm(n,e);else if(ui(e))r=sm(n,e);else if(ft(e))r=gt(n,e.terminal);else if(js(e))r=Bc(n,e);else if(pt(e))r=am(n,e);else if(Ol(e))r=lm(n,e);else if(Ll(e))r=cm(n,e);else if(Gs(e))r=um(n,e);else if(bd(e)){const i=n.consume++;r=()=>n.parser.consume(i,nt,e)}else throw new xl(e.$cstNode,`Unexpected element type: ${e.$type}`);return Hc(n,t?void 0:ri(e),r,e.cardinality)}function sm(n,e){const t=Hs(e);return()=>n.parser.action(t,e)}function am(n,e){const t=e.rule.ref;if(Ce(t)){const r=n.subrule++,i=t.fragment,s=e.arguments.length>0?om(t,e.arguments):()=>({});return a=>n.parser.subrule(r,Vc(n,t),i,e,s(a))}else if(Tt(t)){const r=n.consume++,i=Ss(n,t.name);return()=>n.parser.consume(r,i,e)}else if(t)Qn();else throw new xl(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function om(n,e){const t=e.map(r=>Ke(r.value));return r=>{const i={};for(let s=0;s<t.length;s++){const a=n.parameters[s],o=t[s];i[a.name]=o(r)}return i}}function Ke(n){if(vd(n)){const e=Ke(n.left),t=Ke(n.right);return r=>e(r)||t(r)}else if(yd(n)){const e=Ke(n.left),t=Ke(n.right);return r=>e(r)&&t(r)}else if(Td(n)){const e=Ke(n.value);return t=>!e(t)}else if(_d(n)){const e=n.parameter.ref.name;return t=>t!==void 0&&t[e]===!0}else if(gd(n)){const e=!!n.true;return()=>e}Qn()}function lm(n,e){if(e.elements.length===1)return gt(n,e.elements[0]);{const t=[];for(const i of e.elements){const s={ALT:gt(n,i,!0)},a=ri(i);a&&(s.GATE=Ke(a)),t.push(s)}const r=n.or++;return i=>n.parser.alternatives(r,t.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function cm(n,e){if(e.elements.length===1)return gt(n,e.elements[0]);const t=[];for(const o of e.elements){const l={ALT:gt(n,o,!0)},c=ri(o);c&&(l.GATE=Ke(c)),t.push(l)}const r=n.or++,i=(o,l)=>{const c=l.getRuleStack().join("-");return`uGroup_${o}_${c}`},s=o=>n.parser.alternatives(r,t.map((l,c)=>{const u={ALT:()=>!0},d=n.parser;u.ALT=()=>{if(l.ALT(o),!d.isRecording()){const f=i(r,d);d.unorderedGroups.get(f)||d.unorderedGroups.set(f,[]);const m=d.unorderedGroups.get(f);typeof(m==null?void 0:m[c])>"u"&&(m[c]=!0)}};const h=l.GATE;return h?u.GATE=()=>h(o):u.GATE=()=>{const f=d.unorderedGroups.get(i(r,d));return!(f!=null&&f[c])},u})),a=Hc(n,ri(e),s,"*");return o=>{a(o),n.parser.isRecording()||n.parser.unorderedGroups.delete(i(r,n.parser))}}function um(n,e){const t=e.elements.map(r=>gt(n,r));return r=>t.forEach(i=>i(r))}function ri(n){if(Gs(n))return n.guardCondition}function Bc(n,e,t=e.terminal){if(t)if(pt(t)&&Ce(t.rule.ref)){const r=t.rule.ref,i=n.subrule++;return s=>n.parser.subrule(i,Vc(n,r),!1,e,s)}else if(pt(t)&&Tt(t.rule.ref)){const r=n.consume++,i=Ss(n,t.rule.ref.name);return()=>n.parser.consume(r,i,e)}else if(ht(t)){const r=n.consume++,i=Ss(n,t.value);return()=>n.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=Bl(e.type.ref),i=r==null?void 0:r.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Hs(e.type.ref));return Bc(n,e,i)}}function dm(n,e){const t=n.consume++,r=n.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>n.parser.consume(t,r,e)}function Hc(n,e,t,r){const i=e&&Ke(e);if(!r)if(i){const s=n.or++;return a=>n.parser.alternatives(s,[{ALT:()=>t(a),GATE:()=>i(a)},{ALT:Ha(),GATE:()=>!i(a)}])}else return t;if(r==="*"){const s=n.many++;return a=>n.parser.many(s,{DEF:()=>t(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=n.many++;if(i){const a=n.or++;return o=>n.parser.alternatives(a,[{ALT:()=>n.parser.atLeastOne(s,{DEF:()=>t(o)}),GATE:()=>i(o)},{ALT:Ha(),GATE:()=>!i(o)}])}else return a=>n.parser.atLeastOne(s,{DEF:()=>t(a)})}else if(r==="?"){const s=n.optional++;return a=>n.parser.optional(s,{DEF:()=>t(a),GATE:i?()=>i(a):void 0})}else Qn()}function Vc(n,e){const t=fm(n,e),r=n.parser.getRule(t);if(!r)throw new Error(`Rule "${t}" not found."`);return r}function fm(n,e){if(Ce(e))return e.name;if(n.ruleNames.has(e))return n.ruleNames.get(e);{let t=e,r=t.$container,i=e.$type;for(;!Ce(r);)(Gs(r)||Ol(r)||Ll(r))&&(i=r.elements.indexOf(t).toString()+":"+i),t=r,r=r.$container;return i=r.name+":"+i,n.ruleNames.set(e,i),i}}function Ss(n,e){const t=n.tokens[e];if(!t)throw new Error(`Token "${e}" not found."`);return t}function hm(n){const e=n.Grammar,t=n.parser.Lexer,r=new tm(n);return Fc(e,r,t.definition),r.finalize(),r}function pm(n){const e=mm(n);return e.finalize(),e}function mm(n){const e=n.Grammar,t=n.parser.Lexer,r=new Zp(n);return Fc(e,r,t.definition)}class Wc{constructor(){this.diagnostics=[]}buildTokens(e,t){const r=ee(Gl(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,t);return i.forEach(a=>{const o=a.PATTERN;typeof o=="object"&&o&&"test"in o&&ts(o)?s.unshift(a):s.push(a)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Tt).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Vs(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=ts(t)?de.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,i)=>(t.lastIndex=i,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Ce).flatMap(i=>Zn(i).filter(ht)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,t,!!(r!=null&&r.caseInsensitive)))}buildKeywordToken(e,t,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,t)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,t){return t?new RegExp(Bd(e.value)):e.value}findLongerAlt(e,t){return t.reduce((r,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&Hd("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Kc{convert(e,t){let r=t.grammarSource;if(js(r)&&(r=zd(r)),pt(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,t)}return e}runConverter(e,t,r){var i;switch(e.name.toUpperCase()){case"INT":return Ve.convertInt(t);case"STRING":return Ve.convertString(t);case"ID":return Ve.convertID(t)}switch((i=ef(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Ve.convertNumber(t);case"boolean":return Ve.convertBoolean(t);case"bigint":return Ve.convertBigint(t);case"date":return Ve.convertDate(t);default:return t}}}var Ve;(function(n){function e(c){let u="";for(let d=1;d<c.length-1;d++){const h=c.charAt(d);if(h==="\\"){const f=c.charAt(++d);u+=t(f)}else u+=h}return u}n.convertString=e;function t(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
117
|
-
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}n.convertID=r;function i(c){return parseInt(c)}n.convertInt=i;function s(c){return BigInt(c)}n.convertBigint=s;function a(c){return new Date(c)}n.convertDate=a;function o(c){return Number(c)}n.convertNumber=o;function l(c){return c.toLowerCase()==="true"}n.convertBoolean=l})(Ve||(Ve={}));var ct={},Tr={},Yo;function zc(){if(Yo)return Tr;Yo=1,Object.defineProperty(Tr,"__esModule",{value:!0});let n;function e(){if(n===void 0)throw new Error("No runtime abstraction layer installed");return n}return function(t){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");n=i}t.install=r}(e||(e={})),Tr.default=e,Tr}var J={},Jo;function gm(){if(Jo)return J;Jo=1,Object.defineProperty(J,"__esModule",{value:!0}),J.stringArray=J.array=J.func=J.error=J.number=J.string=J.boolean=void 0;function n(o){return o===!0||o===!1}J.boolean=n;function e(o){return typeof o=="string"||o instanceof String}J.string=e;function t(o){return typeof o=="number"||o instanceof Number}J.number=t;function r(o){return o instanceof Error}J.error=r;function i(o){return typeof o=="function"}J.func=i;function s(o){return Array.isArray(o)}J.array=s;function a(o){return s(o)&&o.every(l=>e(l))}return J.stringArray=a,J}var ut={},Qo;function Xc(){if(Qo)return ut;Qo=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.Emitter=ut.Event=void 0;const n=zc();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(ut.Event=e={}));class t{add(s,a=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(a),Array.isArray(o)&&o.push({dispose:()=>this.remove(s,a)})}remove(s,a=null){if(!this._callbacks)return;let o=!1;for(let l=0,c=this._callbacks.length;l<c;l++)if(this._callbacks[l]===s)if(this._contexts[l]===a){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const a=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let c=0,u=o.length;c<u;c++)try{a.push(o[c].apply(l[c],s))}catch(d){(0,n.default)().console.error(d)}return a}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,a,o)=>{this._callbacks||(this._callbacks=new t),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,a);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,a),l.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return ut.Emitter=r,r._noop=function(){},ut}var Zo;function ym(){if(Zo)return ct;Zo=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.CancellationTokenSource=ct.CancellationToken=void 0;const n=zc(),e=gm(),t=Xc();var r;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:t.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:t.Event.None});function l(c){const u=c;return u&&(u===o.None||u===o.Cancelled||e.boolean(u.isCancellationRequested)&&!!u.onCancellationRequested)}o.is=l})(r||(ct.CancellationToken=r={}));const i=Object.freeze(function(o,l){const c=(0,n.default)().timer.setTimeout(o.bind(l),0);return{dispose(){c.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class a{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return ct.CancellationTokenSource=a,ct}var B=ym();function vm(){return new Promise(n=>{typeof setImmediate>"u"?setTimeout(n,0):setImmediate(n)})}let wr=0,Tm=10;function _m(){return wr=performance.now(),new B.CancellationTokenSource}const ii=Symbol("OperationCancelled");function Ri(n){return n===ii}async function Re(n){if(n===B.CancellationToken.None)return;const e=performance.now();if(e-wr>=Tm&&(wr=e,await vm(),wr=performance.now()),n.isCancellationRequested)throw ii}class ia{constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}}class Yn{constructor(e,t,r,i){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(const r of e)if(Yn.isIncremental(r)){const i=Yc(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),l=Math.max(i.end.line,0);let c=this._lineOffsets;const u=el(r.text,!1,s);if(l-o===u.length)for(let h=0,f=u.length;h<f;h++)c[h+o+1]=u[h];else u.length<1e4?c.splice(o+1,l-o,...u):this._lineOffsets=c=c.slice(0,o+1).concat(u,c.slice(l+1));const d=r.text.length-(a-s);if(d!==0)for(let h=o+1+u.length,f=c.length;h<f;h++)c[h]=c[h]+d}else if(Yn.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=el(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const t=this.getLineOffsets();let r=0,i=t.length;if(i===0)return{line:0,character:e};for(;r<i;){const a=Math.floor((r+i)/2);t[a]>e?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,t[s]),{line:s,character:e-t[s]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const r=t[e.line];if(e.character<=0)return r;const i=e.line+1<t.length?t[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,t){for(;e>t&&qc(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}}var xs;(function(n){function e(i,s,a,o){return new Yn(i,s,a,o)}n.create=e;function t(i,s,a){if(i instanceof Yn)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(i,s){const a=i.getText(),o=Cs(s.map(Rm),(u,d)=>{const h=u.range.start.line-d.range.start.line;return h===0?u.range.start.character-d.range.start.character:h});let l=0;const c=[];for(const u of o){const d=i.offsetAt(u.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&c.push(a.substring(l,d)),u.newText.length&&c.push(u.newText),l=i.offsetAt(u.range.end)}return c.push(a.substr(l)),c.join("")}n.applyEdits=r})(xs||(xs={}));function Cs(n,e){if(n.length<=1)return n;const t=n.length/2|0,r=n.slice(0,t),i=n.slice(t);Cs(r,e),Cs(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?n[o++]=r[s++]:n[o++]=i[a++];for(;s<r.length;)n[o++]=r[s++];for(;a<i.length;)n[o++]=i[a++];return n}function el(n,e,t=0){const r=e?[t]:[];for(let i=0;i<n.length;i++){const s=n.charCodeAt(i);qc(s)&&(s===13&&i+1<n.length&&n.charCodeAt(i+1)===10&&i++,r.push(t+i+1))}return r}function qc(n){return n===13||n===10}function Yc(n){const e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function Rm(n){const e=Yc(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var ji={version:"v20.19.0",versions:{node:"20.19.0",acorn:"8.14.0",ada:"2.9.2",ares:"1.34.4",brotli:"1.1.0",cjs_module_lexer:"1.4.1",cldr:"46.0",icu:"76.1",llhttp:"8.1.2",modules:"115",napi:"9",nghttp2:"1.61.0",nghttp3:"0.7.0",ngtcp2:"1.1.0",openssl:"3.0.15+quic",simdutf:"6.0.3",tz:"2025a",undici:"6.21.1",unicode:"16.0",uv:"1.46.0",uvwasi:"0.0.21",v8:"11.3.244.8-node.26",zlib:"1.3.0.1-motley-82a5fec"},arch:"x64",platform:"linux",release:{name:"node",lts:"Iron",sourceUrl:"https://nodejs.org/download/release/v20.19.0/node-v20.19.0.tar.gz",headersUrl:"https://nodejs.org/download/release/v20.19.0/node-v20.19.0-headers.tar.gz"},moduleLoadList:["Internal Binding builtins","Internal Binding module_wrap","Internal Binding errors","NativeModule internal/assert","Internal Binding util","NativeModule internal/errors","Internal Binding config","Internal Binding timers","Internal Binding async_wrap","Internal Binding task_queue","Internal Binding symbols","NativeModule internal/async_hooks","Internal Binding constants","Internal Binding types","Internal Binding options","NativeModule internal/options","Internal Binding string_decoder","NativeModule internal/util","NativeModule internal/util/types","NativeModule internal/validators","NativeModule internal/linkedlist","NativeModule internal/priority_queue","Internal Binding icu","NativeModule internal/util/inspect","NativeModule internal/util/debuglog","NativeModule internal/timers","NativeModule internal/events/abort_listener","NativeModule events","Internal Binding buffer","NativeModule internal/buffer","NativeModule buffer","Internal Binding messaging","NativeModule internal/worker/js_transferable","NativeModule internal/querystring","NativeModule internal/constants","NativeModule path","NativeModule querystring","Internal Binding url","NativeModule internal/url","NativeModule internal/fs/utils","Internal Binding process_methods","NativeModule internal/process/per_thread","Internal Binding credentials","NativeModule internal/process/promises","NativeModule internal/fixed_queue","NativeModule async_hooks","NativeModule internal/process/task_queues","NativeModule timers","Internal Binding trace_events","Internal Binding contextify","NativeModule internal/vm","NativeModule internal/process/execution","NativeModule internal/process/warning","NativeModule internal/source_map/source_map_cache","Internal Binding fs","Internal Binding blob","Internal Binding encoding_binding","NativeModule internal/encoding","NativeModule internal/streams/utils","NativeModule util","NativeModule internal/webstreams/util","NativeModule internal/webstreams/queuingstrategies","NativeModule internal/blob","Internal Binding permission","NativeModule internal/process/permission","NativeModule fs","NativeModule internal/modules/helpers","NativeModule internal/console/constructor","NativeModule internal/console/global","NativeModule internal/util/inspector","Internal Binding inspector","NativeModule internal/webidl","Internal Binding performance","NativeModule internal/perf/utils","NativeModule internal/event_target","Internal Binding wasm_web_api","Internal Binding mksnapshot","NativeModule internal/v8/startup_snapshot","NativeModule internal/process/signal","NativeModule url","NativeModule internal/modules/package_json_reader","NativeModule internal/modules/cjs/loader","NativeModule internal/process/pre_execution","NativeModule internal/modules/esm/utils","NativeModule internal/inspector_async_hook","Internal Binding worker","NativeModule internal/modules/run_main","NativeModule internal/net","NativeModule internal/dns/utils","NativeModule internal/modules/esm/assert","NativeModule internal/modules/esm/loader","NativeModule internal/modules/esm/module_map","NativeModule internal/modules/esm/translators","NativeModule internal/modules/esm/package_config","NativeModule internal/modules/esm/formats","NativeModule internal/modules/esm/get_format","NativeModule internal/modules/esm/resolve","NativeModule internal/modules/esm/load","Internal Binding fs_dir","NativeModule internal/fs/dir","NativeModule string_decoder","Internal Binding fs_event_wrap","Internal Binding uv","NativeModule internal/fs/watchers","NativeModule internal/fs/recursive_watch","NativeModule internal/readline/utils","NativeModule internal/readline/callbacks","NativeModule internal/readline/interface","NativeModule internal/fs/promises","NativeModule internal/modules/esm/module_job","NativeModule internal/perf/performance_entry","NativeModule internal/perf/observe","NativeModule internal/perf/resource_timing","NativeModule internal/perf/nodetiming","NativeModule internal/perf/usertiming","NativeModule internal/perf/event_loop_utilization","NativeModule internal/histogram","NativeModule internal/perf/timerify","NativeModule internal/perf/performance","NativeModule internal/perf/event_loop_delay","NativeModule perf_hooks","NativeModule internal/source_map/source_map","NativeModule module","NativeModule internal/modules/esm/initialize_import_meta","NativeModule internal/streams/destroy","NativeModule internal/abort_controller","NativeModule internal/streams/end-of-stream","NativeModule internal/streams/legacy","NativeModule internal/streams/add-abort-signal","NativeModule internal/streams/state","NativeModule internal/streams/from","NativeModule internal/streams/readable","NativeModule internal/streams/writable","NativeModule internal/streams/duplex","NativeModule internal/streams/pipeline","NativeModule internal/streams/compose","NativeModule internal/streams/operators","NativeModule stream/promises","NativeModule internal/streams/transform","NativeModule internal/streams/passthrough","NativeModule internal/streams/duplexpair","NativeModule stream","NativeModule internal/fs/streams","NativeModule fs/promises","NativeModule internal/util/parse_args/utils","NativeModule internal/util/parse_args/parse_args","NativeModule internal/mime","Internal Binding crypto","NativeModule internal/crypto/random","NativeModule internal/crypto/hashnames","NativeModule internal/crypto/util","NativeModule internal/crypto/pbkdf2","NativeModule internal/crypto/scrypt","NativeModule internal/crypto/keys","NativeModule internal/crypto/hkdf","NativeModule internal/crypto/keygen","NativeModule internal/crypto/diffiehellman","NativeModule internal/streams/lazy_transform","NativeModule internal/crypto/cipher","NativeModule internal/crypto/sig","NativeModule internal/crypto/hash","NativeModule internal/crypto/x509","NativeModule internal/crypto/certificate","NativeModule crypto","NativeModule internal/crypto/webcrypto","Internal Binding pipe_wrap","Internal Binding stream_wrap","Internal Binding tcp_wrap","NativeModule internal/stream_base_commons","NativeModule diagnostics_channel","NativeModule net","Internal Binding udp_wrap","NativeModule internal/dgram","NativeModule dgram","Internal Binding process_wrap","Internal Binding tty_wrap","NativeModule internal/socket_list","Internal Binding spawn_sync","NativeModule internal/child_process","NativeModule child_process","NativeModule _http_agent","Internal Binding http_parser","NativeModule internal/freelist","NativeModule _http_incoming","NativeModule _http_common","NativeModule internal/http","NativeModule _http_outgoing","NativeModule _http_client","NativeModule _http_server","NativeModule http","Internal Binding cares_wrap","NativeModule internal/tls/secure-context","NativeModule _tls_common","Internal Binding js_stream","NativeModule internal/js_stream_socket","Internal Binding tls_wrap","NativeModule _tls_wrap","NativeModule internal/tls/secure-pair","NativeModule tls","NativeModule https","NativeModule internal/tty","NativeModule tty","Internal Binding block_list","NativeModule internal/socketaddress","NativeModule internal/blocklist","Internal Binding os","NativeModule os","NativeModule internal/dns/callback_resolver","NativeModule dns","NativeModule internal/dns/promises","NativeModule internal/file","NativeModule internal/readline/emitKeypressEvents","NativeModule internal/readline/promises","NativeModule readline/promises","NativeModule readline","NativeModule process","Internal Binding report","NativeModule internal/process/report","NativeModule internal/util/colors","NativeModule internal/assert/assertion_error","NativeModule internal/assert/utils","NativeModule internal/assert/calltracker","NativeModule assert","Internal Binding serdes","Internal Binding profiler","Internal Binding heap_utils","Internal Binding internal_only_v8","NativeModule internal/heap_utils","NativeModule internal/promise_hooks","Internal Binding v8","NativeModule v8","NativeModule internal/worker/io","NativeModule internal/worker/messaging","NativeModule internal/error_serdes","NativeModule internal/worker","NativeModule worker_threads","Internal Binding zlib","NativeModule zlib","NativeModule internal/deps/cjs-module-lexer/lexer","NativeModule constants","NativeModule internal/crypto/webidl","NativeModule vm","NativeModule internal/webstreams/writablestream","NativeModule internal/webstreams/readablestream","Internal Binding http2","NativeModule internal/http2/util","NativeModule internal/http2/compat","Internal Binding stream_pipe","NativeModule internal/http2/core","NativeModule http2","NativeModule util/types","NativeModule internal/deps/undici/undici"],_events:{newListener:[null,null],removeListener:[null,null]},_eventsCount:4,domain:null,_exiting:!1,config:{target_defaults:{cflags:[],default_configuration:"Release",defines:["NODE_OPENSSL_CONF_NAME=nodejs_conf","NODE_OPENSSL_HAS_QUIC","ICU_NO_USER_DATA_OVERRIDE"],include_dirs:[],libraries:[]},variables:{asan:0,clang:0,coverage:!1,dcheck_always_on:0,debug_nghttp2:!1,debug_node:!1,enable_lto:!1,enable_pgo_generate:!1,enable_pgo_use:!1,error_on_warn:!1,force_dynamic_crt:0,gas_version:"2.35",host_arch:"x64",icu_data_in:"../../deps/icu-tmp/icudt76l.dat",icu_endianness:"l",icu_gyp_path:"tools/icu/icu-generic.gyp",icu_path:"deps/icu-small",icu_small:!1,icu_ver_major:"76",is_debug:0,libdir:"lib",llvm_version:"0.0",napi_build_version:"9",node_builtin_shareable_builtins:["deps/cjs-module-lexer/lexer.js","deps/cjs-module-lexer/dist/lexer.js","deps/undici/undici.js"],node_byteorder:"little",node_debug_lib:!1,node_enable_d8:!1,node_enable_v8_vtunejit:!1,node_fipsinstall:!1,node_install_corepack:!0,node_install_npm:!0,node_library_files:["lib/_http_agent.js","lib/_http_client.js","lib/_http_common.js","lib/_http_incoming.js","lib/_http_outgoing.js","lib/_http_server.js","lib/_stream_duplex.js","lib/_stream_passthrough.js","lib/_stream_readable.js","lib/_stream_transform.js","lib/_stream_wrap.js","lib/_stream_writable.js","lib/_tls_common.js","lib/_tls_wrap.js","lib/assert.js","lib/assert/strict.js","lib/async_hooks.js","lib/buffer.js","lib/child_process.js","lib/cluster.js","lib/console.js","lib/constants.js","lib/crypto.js","lib/dgram.js","lib/diagnostics_channel.js","lib/dns.js","lib/dns/promises.js","lib/domain.js","lib/events.js","lib/fs.js","lib/fs/promises.js","lib/http.js","lib/http2.js","lib/https.js","lib/inspector.js","lib/inspector/promises.js","lib/internal/abort_controller.js","lib/internal/assert.js","lib/internal/assert/assertion_error.js","lib/internal/assert/calltracker.js","lib/internal/assert/utils.js","lib/internal/async_hooks.js","lib/internal/blob.js","lib/internal/blocklist.js","lib/internal/bootstrap/node.js","lib/internal/bootstrap/realm.js","lib/internal/bootstrap/shadow_realm.js","lib/internal/bootstrap/switches/does_not_own_process_state.js","lib/internal/bootstrap/switches/does_own_process_state.js","lib/internal/bootstrap/switches/is_main_thread.js","lib/internal/bootstrap/switches/is_not_main_thread.js","lib/internal/bootstrap/web/exposed-wildcard.js","lib/internal/bootstrap/web/exposed-window-or-worker.js","lib/internal/buffer.js","lib/internal/child_process.js","lib/internal/child_process/serialization.js","lib/internal/cli_table.js","lib/internal/cluster/child.js","lib/internal/cluster/primary.js","lib/internal/cluster/round_robin_handle.js","lib/internal/cluster/shared_handle.js","lib/internal/cluster/utils.js","lib/internal/cluster/worker.js","lib/internal/console/constructor.js","lib/internal/console/global.js","lib/internal/constants.js","lib/internal/crypto/aes.js","lib/internal/crypto/certificate.js","lib/internal/crypto/cfrg.js","lib/internal/crypto/cipher.js","lib/internal/crypto/diffiehellman.js","lib/internal/crypto/ec.js","lib/internal/crypto/hash.js","lib/internal/crypto/hashnames.js","lib/internal/crypto/hkdf.js","lib/internal/crypto/keygen.js","lib/internal/crypto/keys.js","lib/internal/crypto/mac.js","lib/internal/crypto/pbkdf2.js","lib/internal/crypto/random.js","lib/internal/crypto/rsa.js","lib/internal/crypto/scrypt.js","lib/internal/crypto/sig.js","lib/internal/crypto/util.js","lib/internal/crypto/webcrypto.js","lib/internal/crypto/webidl.js","lib/internal/crypto/x509.js","lib/internal/debugger/inspect.js","lib/internal/debugger/inspect_client.js","lib/internal/debugger/inspect_repl.js","lib/internal/dgram.js","lib/internal/dns/callback_resolver.js","lib/internal/dns/promises.js","lib/internal/dns/utils.js","lib/internal/encoding.js","lib/internal/error_serdes.js","lib/internal/errors.js","lib/internal/event_target.js","lib/internal/events/abort_listener.js","lib/internal/events/symbols.js","lib/internal/file.js","lib/internal/fixed_queue.js","lib/internal/freelist.js","lib/internal/freeze_intrinsics.js","lib/internal/fs/cp/cp-sync.js","lib/internal/fs/cp/cp.js","lib/internal/fs/dir.js","lib/internal/fs/promises.js","lib/internal/fs/read/context.js","lib/internal/fs/recursive_watch.js","lib/internal/fs/rimraf.js","lib/internal/fs/streams.js","lib/internal/fs/sync_write_stream.js","lib/internal/fs/utils.js","lib/internal/fs/watchers.js","lib/internal/heap_utils.js","lib/internal/histogram.js","lib/internal/http.js","lib/internal/http2/compat.js","lib/internal/http2/core.js","lib/internal/http2/util.js","lib/internal/inspector_async_hook.js","lib/internal/inspector_network_tracking.js","lib/internal/js_stream_socket.js","lib/internal/legacy/processbinding.js","lib/internal/linkedlist.js","lib/internal/main/check_syntax.js","lib/internal/main/embedding.js","lib/internal/main/eval_stdin.js","lib/internal/main/eval_string.js","lib/internal/main/inspect.js","lib/internal/main/mksnapshot.js","lib/internal/main/print_help.js","lib/internal/main/prof_process.js","lib/internal/main/repl.js","lib/internal/main/run_main_module.js","lib/internal/main/test_runner.js","lib/internal/main/watch_mode.js","lib/internal/main/worker_thread.js","lib/internal/mime.js","lib/internal/modules/cjs/loader.js","lib/internal/modules/esm/assert.js","lib/internal/modules/esm/create_dynamic_module.js","lib/internal/modules/esm/fetch_module.js","lib/internal/modules/esm/formats.js","lib/internal/modules/esm/get_format.js","lib/internal/modules/esm/hooks.js","lib/internal/modules/esm/initialize_import_meta.js","lib/internal/modules/esm/load.js","lib/internal/modules/esm/loader.js","lib/internal/modules/esm/module_job.js","lib/internal/modules/esm/module_map.js","lib/internal/modules/esm/package_config.js","lib/internal/modules/esm/resolve.js","lib/internal/modules/esm/shared_constants.js","lib/internal/modules/esm/translators.js","lib/internal/modules/esm/utils.js","lib/internal/modules/esm/worker.js","lib/internal/modules/helpers.js","lib/internal/modules/package_json_reader.js","lib/internal/modules/run_main.js","lib/internal/navigator.js","lib/internal/net.js","lib/internal/options.js","lib/internal/per_context/domexception.js","lib/internal/per_context/messageport.js","lib/internal/per_context/primordials.js","lib/internal/perf/event_loop_delay.js","lib/internal/perf/event_loop_utilization.js","lib/internal/perf/nodetiming.js","lib/internal/perf/observe.js","lib/internal/perf/performance.js","lib/internal/perf/performance_entry.js","lib/internal/perf/resource_timing.js","lib/internal/perf/timerify.js","lib/internal/perf/usertiming.js","lib/internal/perf/utils.js","lib/internal/policy/manifest.js","lib/internal/policy/sri.js","lib/internal/priority_queue.js","lib/internal/process/execution.js","lib/internal/process/per_thread.js","lib/internal/process/permission.js","lib/internal/process/policy.js","lib/internal/process/pre_execution.js","lib/internal/process/promises.js","lib/internal/process/report.js","lib/internal/process/signal.js","lib/internal/process/task_queues.js","lib/internal/process/warning.js","lib/internal/process/worker_thread_only.js","lib/internal/promise_hooks.js","lib/internal/querystring.js","lib/internal/readline/callbacks.js","lib/internal/readline/emitKeypressEvents.js","lib/internal/readline/interface.js","lib/internal/readline/promises.js","lib/internal/readline/utils.js","lib/internal/repl.js","lib/internal/repl/await.js","lib/internal/repl/history.js","lib/internal/repl/utils.js","lib/internal/socket_list.js","lib/internal/socketaddress.js","lib/internal/source_map/prepare_stack_trace.js","lib/internal/source_map/source_map.js","lib/internal/source_map/source_map_cache.js","lib/internal/source_map/source_map_cache_map.js","lib/internal/stream_base_commons.js","lib/internal/streams/add-abort-signal.js","lib/internal/streams/compose.js","lib/internal/streams/destroy.js","lib/internal/streams/duplex.js","lib/internal/streams/duplexify.js","lib/internal/streams/duplexpair.js","lib/internal/streams/end-of-stream.js","lib/internal/streams/from.js","lib/internal/streams/lazy_transform.js","lib/internal/streams/legacy.js","lib/internal/streams/operators.js","lib/internal/streams/passthrough.js","lib/internal/streams/pipeline.js","lib/internal/streams/readable.js","lib/internal/streams/state.js","lib/internal/streams/transform.js","lib/internal/streams/utils.js","lib/internal/streams/writable.js","lib/internal/test/binding.js","lib/internal/test/transfer.js","lib/internal/test_runner/coverage.js","lib/internal/test_runner/harness.js","lib/internal/test_runner/mock/loader.js","lib/internal/test_runner/mock/mock.js","lib/internal/test_runner/mock/mock_timers.js","lib/internal/test_runner/reporter/dot.js","lib/internal/test_runner/reporter/junit.js","lib/internal/test_runner/reporter/lcov.js","lib/internal/test_runner/reporter/spec.js","lib/internal/test_runner/reporter/tap.js","lib/internal/test_runner/reporter/utils.js","lib/internal/test_runner/reporter/v8-serializer.js","lib/internal/test_runner/runner.js","lib/internal/test_runner/test.js","lib/internal/test_runner/tests_stream.js","lib/internal/test_runner/utils.js","lib/internal/timers.js","lib/internal/tls/secure-context.js","lib/internal/tls/secure-pair.js","lib/internal/trace_events_async_hooks.js","lib/internal/tty.js","lib/internal/url.js","lib/internal/util.js","lib/internal/util/colors.js","lib/internal/util/comparisons.js","lib/internal/util/debuglog.js","lib/internal/util/inspect.js","lib/internal/util/inspector.js","lib/internal/util/parse_args/parse_args.js","lib/internal/util/parse_args/utils.js","lib/internal/util/types.js","lib/internal/v8/startup_snapshot.js","lib/internal/v8_prof_polyfill.js","lib/internal/v8_prof_processor.js","lib/internal/validators.js","lib/internal/vm.js","lib/internal/vm/module.js","lib/internal/wasm_web_api.js","lib/internal/watch_mode/files_watcher.js","lib/internal/watchdog.js","lib/internal/webidl.js","lib/internal/webstreams/adapters.js","lib/internal/webstreams/compression.js","lib/internal/webstreams/encoding.js","lib/internal/webstreams/queuingstrategies.js","lib/internal/webstreams/readablestream.js","lib/internal/webstreams/transfer.js","lib/internal/webstreams/transformstream.js","lib/internal/webstreams/util.js","lib/internal/webstreams/writablestream.js","lib/internal/worker.js","lib/internal/worker/io.js","lib/internal/worker/js_transferable.js","lib/internal/worker/messaging.js","lib/module.js","lib/net.js","lib/os.js","lib/path.js","lib/path/posix.js","lib/path/win32.js","lib/perf_hooks.js","lib/process.js","lib/punycode.js","lib/querystring.js","lib/readline.js","lib/readline/promises.js","lib/repl.js","lib/sea.js","lib/stream.js","lib/stream/consumers.js","lib/stream/promises.js","lib/stream/web.js","lib/string_decoder.js","lib/sys.js","lib/test.js","lib/test/reporters.js","lib/timers.js","lib/timers/promises.js","lib/tls.js","lib/trace_events.js","lib/tty.js","lib/url.js","lib/util.js","lib/util/types.js","lib/v8.js","lib/vm.js","lib/wasi.js","lib/worker_threads.js","lib/zlib.js"],node_module_version:115,node_no_browser_globals:!1,node_prefix:"/",node_release_urlbase:"https://nodejs.org/download/release/",node_section_ordering_info:"",node_shared:!1,node_shared_ada:!1,node_shared_brotli:!1,node_shared_cares:!1,node_shared_http_parser:!1,node_shared_libuv:!1,node_shared_nghttp2:!1,node_shared_nghttp3:!1,node_shared_ngtcp2:!1,node_shared_openssl:!1,node_shared_simdjson:!1,node_shared_simdutf:!1,node_shared_uvwasi:!1,node_shared_zlib:!1,node_tag:"",node_target_type:"executable",node_use_bundled_v8:!0,node_use_node_code_cache:!0,node_use_node_snapshot:!0,node_use_openssl:!0,node_use_v8_platform:!0,node_with_ltcg:!1,node_without_node_options:!1,node_write_snapshot_as_array_literals:!1,openssl_is_fips:!1,openssl_quic:!0,ossfuzz:!1,shlib_suffix:"so.115",single_executable_application:!0,target_arch:"x64",ubsan:0,use_prefix_to_find_headers:!1,v8_enable_31bit_smis_on_64bit_arch:0,v8_enable_extensible_ro_snapshot:0,v8_enable_gdbjit:0,v8_enable_hugepage:0,v8_enable_i18n_support:1,v8_enable_inspector:1,v8_enable_javascript_promise_hooks:1,v8_enable_lite_mode:0,v8_enable_maglev:0,v8_enable_object_print:1,v8_enable_pointer_compression:0,v8_enable_sandbox:0,v8_enable_shared_ro_heap:1,v8_enable_short_builtin_calls:1,v8_enable_v8_checks:0,v8_enable_webassembly:1,v8_no_strict_aliasing:1,v8_optimized_debug:1,v8_promise_internal_field_count:1,v8_random_seed:0,v8_trace_maps:0,v8_use_siphash:1,want_separate_host_toolset:0}},allowedNodeEnvironmentFlags:{},features:{inspector:!0,debug:!1,uv:!0,ipv6:!0,tls_alpn:!0,tls_sni:!0,tls_ocsp:!0,tls:!0,cached_builtins:!0,require_module:!0},sourceMapsEnabled:!1,stdout:{connecting:!1,_hadError:!1,_parent:null,_host:null,_closeAfterHandlingError:!1,_events:{},_readableState:{highWaterMark:16384,buffer:[],bufferIndex:0,length:0,pipes:[],awaitDrainWriters:null,readable:!1},_writableState:{highWaterMark:16384,length:0,corked:0,writelen:0,bufferedIndex:0,pendingcb:0},allowHalfOpen:!1,_eventsCount:1,_sockname:null,_pendingData:null,_pendingEncoding:"",server:null,_server:null,_type:"pipe",fd:1,_isStdio:!0},stdin:{connecting:!1,_hadError:!1,_parent:null,_host:null,_closeAfterHandlingError:!1,_events:{},_readableState:{highWaterMark:16384,buffer:[],bufferIndex:0,length:0,pipes:[],awaitDrainWriters:null},_writableState:{highWaterMark:16384,length:0,corked:0,writelen:0,bufferedIndex:0,pendingcb:0},allowHalfOpen:!1,_eventsCount:2,_sockname:null,_pendingData:null,_pendingEncoding:"",server:null,_server:null,fd:0},stderr:{connecting:!1,_hadError:!1,_parent:null,_host:null,_closeAfterHandlingError:!1,_events:{},_readableState:{highWaterMark:16384,buffer:[],bufferIndex:0,length:0,pipes:[],awaitDrainWriters:null,readable:!1},_writableState:{highWaterMark:16384,length:0,corked:0,writelen:0,bufferedIndex:0,pendingcb:0},allowHalfOpen:!1,_eventsCount:1,_sockname:null,_pendingData:null,_pendingEncoding:"",server:null,_server:null,_type:"pipe",fd:2,_isStdio:!0},env:{GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_b3385d70-ad05-4463-ad38-002e042ddbc1",STATS_TRP:"true",DEPLOYMENT_BASEPATH:"/opt/runner",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.8.2 node/v20.19.0 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_b3385d70-ad05-4463-ad38-002e042ddbc1",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/20.19.0/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/md/md/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"doocs",GRADLE_HOME:"/usr/share/gradle-8.13",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/28.1.13356709",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",STATS_RDCL:"true",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"43716716",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/md/md",SYSTEMD_EXEC_PID:"832",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20250420.1.0",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.12/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",RUNNER_USER:"runner",STATS_V3PS:"true",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.8/x64",JOURNAL_STREAM:"9:7376",GITHUB_WORKFLOW:"Create Cli Release",_:"/opt/hostedtoolcache/node/20.19.0/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/20.19.0/x64",npm_config_npm_version:"10.8.2",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/runner-provisioner.service/memory.pressure",npm_config_registry:"https://registry.npmmirror.com",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",STATS_D:"true",GITHUB_RUN_ID:"14705208584",STATS_VMFE:"true",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"60c050f40f09a3033f59345734339cd1349ed0d1",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"doocs/md/.github/workflows/release-cli.yml@refs/tags/cli-v0.1.2",PERFLOG_LOCATION_SETTING:"RUNNER_PERFLOG",GITHUB_ACTION_REPOSITORY:"",npm_config_node_gyp:"/opt/hostedtoolcache/node/20.19.0/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/md/md/node_modules/.bin:/home/runner/work/md/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/md/md/node_modules/.bin:/home/runner/work/md/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/md/md/node_modules/.bin:/home/runner/work/md/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.0/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/20.19.0/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_49dbdecc-c94c-4915-96da-9634249919a2",INVOCATION_ID:"e2285edb881845bca55000f198eed220",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/20.19.0/x64/bin/node",npm_package_name:"md",GITHUB_ACTION:"__run_2",GITHUB_RUN_NUMBER:"9",GITHUB_TRIGGERING_ACTOR:"yanglbme",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 1000007281",XDG_CONFIG_HOME:"/home/runner/.config",STATS_VMD:"true",GITHUB_REF_NAME:"cli-v0.1.2",GITHUB_REPOSITORY:"doocs/md",STATS_D_D:"true",npm_lifecycle_script:"vite build",STATS_UE:"true",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",GITHUB_REPOSITORY_ID:"218952803",GITHUB_ACTIONS:"true",STATS_PIP:"false",npm_package_version:"2.0.1",npm_lifecycle_event:"build:only",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/md/md",ACCEPT_EULA:"Y",GITHUB_JOB:"build",RUNNER_PERFLOG:"/home/runner/perflog",GITHUB_SHA:"60c050f40f09a3033f59345734339cd1349ed0d1",GITHUB_RUN_ATTEMPT:"1",STATS_D_TC:"true",GITHUB_REF:"refs/tags/cli-v0.1.2",GITHUB_ACTOR:"yanglbme",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/20.19.0/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_b3385d70-ad05-4463-ad38-002e042ddbc1",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/md/md",GITHUB_ACTOR_ID:"21008209",RUNNER_WORKSPACE:"/home/runner/work/md",npm_execpath:"/opt/hostedtoolcache/node/20.19.0/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_b3385d70-ad05-4463-ad38-002e042ddbc1",npm_config_global_prefix:"/opt/hostedtoolcache/node/20.19.0/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",STATS_EXT:"true",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",STATS_EXTP:"https://provjobdprod.z13.web.core.windows.net/settings/provjobdsettings-latest/provjobd.data",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_b3385d70-ad05-4463-ad38-002e042ddbc1",INIT_CWD:"/home/runner/work/md/md",EDITOR:"vi",NODE_ENV:"production",LAUNCH_EDITOR:"code"},title:"node",argv:["/opt/hostedtoolcache/node/20.19.0/x64/bin/node","/home/runner/work/md/md/node_modules/.bin/vite","build"],execArgv:[],pid:2204,ppid:2203,execPath:"/opt/hostedtoolcache/node/20.19.0/x64/bin/node",debugPort:9229,argv0:"node",_preload_modules:[],report:{directory:"",filename:"",compact:!1,excludeNetwork:!1,signal:"SIGUSR2",reportOnFatalError:!1,reportOnSignal:!1,reportOnUncaughtException:!1}},Jc;(()=>{var n={470:i=>{function s(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function a(l,c){for(var u,d="",h=0,f=-1,m=0,g=0;g<=l.length;++g){if(g<l.length)u=l.charCodeAt(g);else{if(u===47)break;u=47}if(u===47){if(!(f===g-1||m===1))if(f!==g-1&&m===2){if(d.length<2||h!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var _=d.lastIndexOf("/");if(_!==d.length-1){_===-1?(d="",h=0):h=(d=d.slice(0,_)).length-1-d.lastIndexOf("/"),f=g,m=0;continue}}else if(d.length===2||d.length===1){d="",h=0,f=g,m=0;continue}}c&&(d.length>0?d+="/..":d="..",h=2)}else d.length>0?d+="/"+l.slice(f+1,g):d=l.slice(f+1,g),h=g-f-1;f=g,m=0}else u===46&&m!==-1?++m:m=-1}return d}var o={resolve:function(){for(var l,c="",u=!1,d=arguments.length-1;d>=-1&&!u;d--){var h;d>=0?h=arguments[d]:(l===void 0&&(l=ji.cwd()),h=l),s(h),h.length!==0&&(c=h+"/"+c,u=h.charCodeAt(0)===47)}return c=a(c,!u),u?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(l){if(s(l),l.length===0)return".";var c=l.charCodeAt(0)===47,u=l.charCodeAt(l.length-1)===47;return(l=a(l,!c)).length!==0||c||(l="."),l.length>0&&u&&(l+="/"),c?"/"+l:l},isAbsolute:function(l){return s(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,c=0;c<arguments.length;++c){var u=arguments[c];s(u),u.length>0&&(l===void 0?l=u:l+="/"+u)}return l===void 0?".":o.normalize(l)},relative:function(l,c){if(s(l),s(c),l===c||(l=o.resolve(l))===(c=o.resolve(c)))return"";for(var u=1;u<l.length&&l.charCodeAt(u)===47;++u);for(var d=l.length,h=d-u,f=1;f<c.length&&c.charCodeAt(f)===47;++f);for(var m=c.length-f,g=h<m?h:m,_=-1,y=0;y<=g;++y){if(y===g){if(m>g){if(c.charCodeAt(f+y)===47)return c.slice(f+y+1);if(y===0)return c.slice(f+y)}else h>g&&(l.charCodeAt(u+y)===47?_=y:y===0&&(_=0));break}var R=l.charCodeAt(u+y);if(R!==c.charCodeAt(f+y))break;R===47&&(_=y)}var T="";for(y=u+_+1;y<=d;++y)y!==d&&l.charCodeAt(y)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+c.slice(f+_):(f+=_,c.charCodeAt(f)===47&&++f,c.slice(f))},_makeLong:function(l){return l},dirname:function(l){if(s(l),l.length===0)return".";for(var c=l.charCodeAt(0),u=c===47,d=-1,h=!0,f=l.length-1;f>=1;--f)if((c=l.charCodeAt(f))===47){if(!h){d=f;break}}else h=!1;return d===-1?u?"/":".":u&&d===1?"//":l.slice(0,d)},basename:function(l,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(l);var u,d=0,h=-1,f=!0;if(c!==void 0&&c.length>0&&c.length<=l.length){if(c.length===l.length&&c===l)return"";var m=c.length-1,g=-1;for(u=l.length-1;u>=0;--u){var _=l.charCodeAt(u);if(_===47){if(!f){d=u+1;break}}else g===-1&&(f=!1,g=u+1),m>=0&&(_===c.charCodeAt(m)?--m==-1&&(h=u):(m=-1,h=g))}return d===h?h=g:h===-1&&(h=l.length),l.slice(d,h)}for(u=l.length-1;u>=0;--u)if(l.charCodeAt(u)===47){if(!f){d=u+1;break}}else h===-1&&(f=!1,h=u+1);return h===-1?"":l.slice(d,h)},extname:function(l){s(l);for(var c=-1,u=0,d=-1,h=!0,f=0,m=l.length-1;m>=0;--m){var g=l.charCodeAt(m);if(g!==47)d===-1&&(h=!1,d=m+1),g===46?c===-1?c=m:f!==1&&(f=1):c!==-1&&(f=-1);else if(!h){u=m+1;break}}return c===-1||d===-1||f===0||f===1&&c===d-1&&c===u+1?"":l.slice(c,d)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return function(c,u){var d=u.dir||u.root,h=u.base||(u.name||"")+(u.ext||"");return d?d===u.root?d+h:d+"/"+h:h}(0,l)},parse:function(l){s(l);var c={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return c;var u,d=l.charCodeAt(0),h=d===47;h?(c.root="/",u=1):u=0;for(var f=-1,m=0,g=-1,_=!0,y=l.length-1,R=0;y>=u;--y)if((d=l.charCodeAt(y))!==47)g===-1&&(_=!1,g=y+1),d===46?f===-1?f=y:R!==1&&(R=1):f!==-1&&(R=-1);else if(!_){m=y+1;break}return f===-1||g===-1||R===0||R===1&&f===g-1&&f===m+1?g!==-1&&(c.base=c.name=m===0&&h?l.slice(1,g):l.slice(m,g)):(m===0&&h?(c.name=l.slice(1,f),c.base=l.slice(1,g)):(c.name=l.slice(m,f),c.base=l.slice(m,g)),c.ext=l.slice(f,g)),m>0?c.dir=l.slice(0,m-1):h&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function t(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return n[i](a,a.exports,t),a.exports}t.d=(i,s)=>{for(var a in s)t.o(s,a)&&!t.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},t.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),t.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;t.r(r),t.d(r,{URI:()=>h,Utils:()=>Ie}),typeof ji=="object"?i=ji.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l(b,v){if(!b.scheme&&v)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${b.authority}", path: "${b.path}", query: "${b.query}", fragment: "${b.fragment}"}`);if(b.scheme&&!s.test(b.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(b.path){if(b.authority){if(!a.test(b.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(b.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",u="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{constructor(v,E,N,O,$,w=!1){Qe(this,"scheme");Qe(this,"authority");Qe(this,"path");Qe(this,"query");Qe(this,"fragment");typeof v=="object"?(this.scheme=v.scheme||c,this.authority=v.authority||c,this.path=v.path||c,this.query=v.query||c,this.fragment=v.fragment||c):(this.scheme=function(ve,X){return ve||X?ve:"file"}(v,w),this.authority=E||c,this.path=function(ve,X){switch(ve){case"https":case"http":case"file":X?X[0]!==u&&(X=u+X):X=u}return X}(this.scheme,N||c),this.query=O||c,this.fragment=$||c,l(this,w))}static isUri(v){return v instanceof h||!!v&&typeof v.authority=="string"&&typeof v.fragment=="string"&&typeof v.path=="string"&&typeof v.query=="string"&&typeof v.scheme=="string"&&typeof v.fsPath=="string"&&typeof v.with=="function"&&typeof v.toString=="function"}get fsPath(){return R(this)}with(v){if(!v)return this;let{scheme:E,authority:N,path:O,query:$,fragment:w}=v;return E===void 0?E=this.scheme:E===null&&(E=c),N===void 0?N=this.authority:N===null&&(N=c),O===void 0?O=this.path:O===null&&(O=c),$===void 0?$=this.query:$===null&&($=c),w===void 0?w=this.fragment:w===null&&(w=c),E===this.scheme&&N===this.authority&&O===this.path&&$===this.query&&w===this.fragment?this:new m(E,N,O,$,w)}static parse(v,E=!1){const N=d.exec(v);return N?new m(N[2]||c,ie(N[4]||c),ie(N[5]||c),ie(N[7]||c),ie(N[9]||c),E):new m(c,c,c,c,c)}static file(v){let E=c;if(i&&(v=v.replace(/\\/g,u)),v[0]===u&&v[1]===u){const N=v.indexOf(u,2);N===-1?(E=v.substring(2),v=u):(E=v.substring(2,N),v=v.substring(N)||u)}return new m("file",E,v,c,c)}static from(v){const E=new m(v.scheme,v.authority,v.path,v.query,v.fragment);return l(E,!0),E}toString(v=!1){return T(this,v)}toJSON(){return this}static revive(v){if(v){if(v instanceof h)return v;{const E=new m(v);return E._formatted=v.external,E._fsPath=v._sep===f?v.fsPath:null,E}}return v}}const f=i?1:void 0;class m extends h{constructor(){super(...arguments);Qe(this,"_formatted",null);Qe(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=R(this)),this._fsPath}toString(E=!1){return E?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){const E={$mid:1};return this._fsPath&&(E.fsPath=this._fsPath,E._sep=f),this._formatted&&(E.external=this._formatted),this.path&&(E.path=this.path),this.scheme&&(E.scheme=this.scheme),this.authority&&(E.authority=this.authority),this.query&&(E.query=this.query),this.fragment&&(E.fragment=this.fragment),E}}const g={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 _(b,v,E){let N,O=-1;for(let $=0;$<b.length;$++){const w=b.charCodeAt($);if(w>=97&&w<=122||w>=65&&w<=90||w>=48&&w<=57||w===45||w===46||w===95||w===126||v&&w===47||E&&w===91||E&&w===93||E&&w===58)O!==-1&&(N+=encodeURIComponent(b.substring(O,$)),O=-1),N!==void 0&&(N+=b.charAt($));else{N===void 0&&(N=b.substr(0,$));const ve=g[w];ve!==void 0?(O!==-1&&(N+=encodeURIComponent(b.substring(O,$)),O=-1),N+=ve):O===-1&&(O=$)}}return O!==-1&&(N+=encodeURIComponent(b.substring(O))),N!==void 0?N:b}function y(b){let v;for(let E=0;E<b.length;E++){const N=b.charCodeAt(E);N===35||N===63?(v===void 0&&(v=b.substr(0,E)),v+=g[N]):v!==void 0&&(v+=b[E])}return v!==void 0?v:b}function R(b,v){let E;return E=b.authority&&b.path.length>1&&b.scheme==="file"?`//${b.authority}${b.path}`:b.path.charCodeAt(0)===47&&(b.path.charCodeAt(1)>=65&&b.path.charCodeAt(1)<=90||b.path.charCodeAt(1)>=97&&b.path.charCodeAt(1)<=122)&&b.path.charCodeAt(2)===58?b.path[1].toLowerCase()+b.path.substr(2):b.path,i&&(E=E.replace(/\//g,"\\")),E}function T(b,v){const E=v?y:_;let N="",{scheme:O,authority:$,path:w,query:ve,fragment:X}=b;if(O&&(N+=O,N+=":"),($||O==="file")&&(N+=u,N+=u),$){let H=$.indexOf("@");if(H!==-1){const ot=$.substr(0,H);$=$.substr(H+1),H=ot.lastIndexOf(":"),H===-1?N+=E(ot,!1,!1):(N+=E(ot.substr(0,H),!1,!1),N+=":",N+=E(ot.substr(H+1),!1,!0)),N+="@"}$=$.toLowerCase(),H=$.lastIndexOf(":"),H===-1?N+=E($,!1,!0):(N+=E($.substr(0,H),!1,!0),N+=$.substr(H))}if(w){if(w.length>=3&&w.charCodeAt(0)===47&&w.charCodeAt(2)===58){const H=w.charCodeAt(1);H>=65&&H<=90&&(w=`/${String.fromCharCode(H+32)}:${w.substr(3)}`)}else if(w.length>=2&&w.charCodeAt(1)===58){const H=w.charCodeAt(0);H>=65&&H<=90&&(w=`${String.fromCharCode(H+32)}:${w.substr(2)}`)}N+=E(w,!0,!1)}return ve&&(N+="?",N+=E(ve,!1,!1)),X&&(N+="#",N+=v?X:_(X,!1,!1)),N}function I(b){try{return decodeURIComponent(b)}catch{return b.length>3?b.substr(0,3)+I(b.substr(3)):b}}const j=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ie(b){return b.match(j)?b.replace(j,v=>I(v)):b}var we=t(470);const ye=we.posix||we,je="/";var Ie;(function(b){b.joinPath=function(v,...E){return v.with({path:ye.join(v.path,...E)})},b.resolvePath=function(v,...E){let N=v.path,O=!1;N[0]!==je&&(N=je+N,O=!0);let $=ye.resolve(N,...E);return O&&$[0]===je&&!v.authority&&($=$.substring(1)),v.with({path:$})},b.dirname=function(v){if(v.path.length===0||v.path===je)return v;let E=ye.dirname(v.path);return E.length===1&&E.charCodeAt(0)===46&&(E=""),v.with({path:E})},b.basename=function(v){return ye.basename(v.path)},b.extname=function(v){return ye.extname(v.path)}})(Ie||(Ie={}))})(),Jc=r})();const{URI:yt,Utils:cn}=Jc;var it;(function(n){n.basename=cn.basename,n.dirname=cn.dirname,n.extname=cn.extname,n.joinPath=cn.joinPath,n.resolvePath=cn.resolvePath;function e(i,s){return(i==null?void 0:i.toString())===(s==null?void 0:s.toString())}n.equals=e;function t(i,s){const a=typeof i=="string"?i:i.path,o=typeof s=="string"?s:s.path,l=a.split("/").filter(f=>f.length>0),c=o.split("/").filter(f=>f.length>0);let u=0;for(;u<l.length&&l[u]===c[u];u++);const d="../".repeat(l.length-u),h=c.slice(u).join("/");return d+h}n.relative=t;function r(i){return yt.parse(i.toString()).toString()}n.normalize=r})(it||(it={}));var U;(function(n){n[n.Changed=0]="Changed",n[n.Parsed=1]="Parsed",n[n.IndexedContent=2]="IndexedContent",n[n.ComputedScopes=3]="ComputedScopes",n[n.Linked=4]="Linked",n[n.IndexedReferences=5]="IndexedReferences",n[n.Validated=6]="Validated"})(U||(U={}));class Em{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=B.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??yt.parse(e.uri),B.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return B.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const i=this.parse(e,t,r);return this.createLangiumDocument(i,e,void 0,t)}else if("$model"in t){const i={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,t.getText(),r);return this.createLangiumDocument(i,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const i=await this.parseAsync(e,t,r);return this.createLangiumDocument(i,e,void 0,t)}else{const i=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(i,e,t)}}createLangiumDocument(e,t,r,i){let s;if(r)s={parseResult:e,uri:t,state:U.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(t,i);s={parseResult:e,uri:t,state:U.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,t){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,a=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=a?a.getText():await this.fileSystemProvider.readFile(e.uri);if(a)Object.defineProperty(e,"textDocument",{value:a});else{const l=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:l})}return s!==o&&(e.parseResult=await this.parseAsync(e.uri,o,t),e.parseResult.value.$document=e),e.state=U.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let i;return()=>i??(i=xs.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}}class Am{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return ee(this.documentMap.values())}addDocument(e){const t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){const t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentMap.get(t);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=U.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const t=e.toString(),r=this.documentMap.get(t);return r&&(r.state=U.Changed,this.documentMap.delete(t)),r}}const Gi=Symbol("ref_resolving");class bm{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,t=B.CancellationToken.None){for(const r of Ct(e.parseResult.value))await Re(t),Pl(r).forEach(i=>this.doLink(i,e))}doLink(e,t){var r;const i=e.reference;if(i._ref===void 0){i._ref=Gi;try{const s=this.getCandidate(e);if(br(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const a=this.loadAstNode(s);i._ref=a??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const a=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${a}`})}t.references.push(i)}}unlink(e){for(const t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,t,r,i){const s=this,a={$refNode:r,$refText:i,get ref(){var o;if(ae(this._ref))return this._ref;if(ad(this._nodeDescription)){const l=s.loadAstNode(this._nodeDescription);this._ref=l??s.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=Gi;const l=es(e).$document,c=s.getLinkedNode({reference:a,container:e,property:t});if(c.error&&l&&l.state<U.ComputedScopes)return this._ref=void 0;this._ref=(o=c.node)!==null&&o!==void 0?o:c.error,this._nodeDescription=c.descr,l==null||l.references.push(this)}else if(this._ref===Gi)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${i}')`);return ae(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return br(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){var t;try{const r=this.getCandidate(e);if(br(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(t=r.message)!==null&&t!==void 0?t:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=es(e.container).$document;r&&r.state<U.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:t})}}function km(n){return typeof n.name=="string"}class Nm{getName(e){if(km(e))return e.name}getNameNode(e){return Fl(e.$cstNode,"name")}}class Im{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const t=Qd(e),r=e.astNode;if(t&&r){const i=r[t.feature];if(Ue(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Ue(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||cd(e,i)))return r}}}findDeclarationNode(e){const t=this.findDeclaration(e);if(t!=null&&t.$cstNode){const r=this.nameProvider.getNameNode(t);return r??t.$cstNode}}findReferences(e,t){const r=[];if(t.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(i=i.filter(s=>it.equals(s.sourceUri,t.documentUri))),r.push(...i),ee(r)}getReferenceToSelf(e){const t=this.nameProvider.getNameNode(e);if(t){const r=et(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Ur(t),local:!0}}}}class si{constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return Ji.sum(ee(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(t);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var t;return(t=this.map.get(e))!==null&&t!==void 0?t:[]}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ee(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return ee(this.map.keys())}values(){return ee(this.map.values()).flat()}entriesGroupedByKey(){return ee(this.map.entries())}}class tl{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}}class Sm{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=B.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,r=Us,i=B.CancellationToken.None){const s=[];this.exportNode(e,s,t);for(const a of r(e))await Re(i),this.exportNode(a,s,t);return s}exportNode(e,t,r){const i=this.nameProvider.getName(e);i&&t.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,t=B.CancellationToken.None){const r=e.parseResult.value,i=new si;for(const s of Zn(r))await Re(t),this.processNode(s,e,i);return i}processNode(e,t,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,t))}}}class nl{constructor(e,t,r){var i;this.elements=e,this.outerScope=t,this.caseInsensitive=(i=r==null?void 0:r.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(t)return t;if(this.outerScope)return this.outerScope.getElement(e)}}class xm{constructor(e,t,r){var i;this.elements=new Map,this.caseInsensitive=(i=r==null?void 0:r.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const a=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(a,s)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=ee(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Qc{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 Cm extends Qc{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();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 wm extends Qc{constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(t))return i.get(t);if(r){const s=r();return i.set(t,s),s}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}}class $m extends Cm{constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{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 Om{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 $m(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),i=et(e.container).precomputedScopes;if(i){let a=e.container;do{const o=i.get(a);o.length>0&&t.push(ee(o).filter(l=>this.reflection.isSubtype(l.type,r))),a=a.$container}while(a)}let s=this.getGlobalScope(r,e);for(let a=t.length-1;a>=0;a--)s=this.createScope(t[a],s);return s}createScope(e,t,r){return new nl(ee(e),t,r)}createScopeForNodes(e,t,r){const i=ee(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new nl(i,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new xm(this.indexManager.allElements(e)))}}function Lm(n){return typeof n.$comment=="string"}function rl(n){return typeof n=="object"&&!!n&&("$ref"in n||"$error"in n)}class Mm{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,t){const r=t??{},i=t==null?void 0:t.replacer,s=(o,l)=>this.replacer(o,l,r),a=i?(o,l)=>i(o,l,s):s;try{return this.currentDocument=et(e),JSON.stringify(e,a,t==null?void 0:t.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,t,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var l,c,u,d;if(!this.ignoreProperties.has(e))if(Ue(t)){const h=t.ref,f=r?t.$refText:void 0;if(h){const m=et(h);let g="";this.currentDocument&&this.currentDocument!==m&&(o?g=o(m.uri,t):g=m.uri.toString());const _=this.astNodeLocator.getAstNodePath(h);return{$ref:`${g}#${_}`,$refText:f}}else return{$error:(c=(l=t.error)===null||l===void 0?void 0:l.message)!==null&&c!==void 0?c:"Could not resolve reference",$refText:f}}else if(ae(t)){let h;if(s&&(h=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),(!e||t.$document)&&(h!=null&&h.$textRegion)&&(h.$textRegion.documentURI=(u=this.currentDocument)===null||u===void 0?void 0:u.uri.toString())),i&&!e&&(h??(h=Object.assign({},t)),h.$sourceText=(d=t.$cstNode)===null||d===void 0?void 0:d.text),a){h??(h=Object.assign({},t));const f=this.commentProvider.getComment(t);f&&(h.$comment=f.replace(/\r/g,""))}return h??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=qd(e.$cstNode,s).map(t);a.length!==0&&(i[s]=a)}),e}}linkNode(e,t,r,i,s,a){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u<c.length;u++){const d=c[u];rl(d)?c[u]=this.reviveReference(e,l,t,d,r):ae(d)&&this.linkNode(d,t,r,e,l,u)}else rl(c)?e[l]=this.reviveReference(e,l,t,c,r):ae(c)&&this.linkNode(c,t,r,e,l);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,t,r,i,s){let a=i.$refText,o=i.$error;if(i.$ref){const l=this.getRefNode(r,i.$ref,s.uriConverter);if(ae(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}if(o){const l={$refText:a??""};return l.error={container:e,property:t,message:o,reference:l},l}else return}getRefNode(e,t,r){try{const i=t.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,t.substring(1));return l||"Could not resolve path: "+t}if(i<0){const l=r?r(t):yt.parse(t),c=this.langiumDocuments.getDocument(l);return c?c.parseResult.value:"Could not find document for URI: "+t}const s=r?r(t.substring(0,i)):yt.parse(t.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+t;if(i===t.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,t.substring(i+1));return o||"Could not resolve URI: "+t}catch(i){return String(i)}}}class Pm{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const t=e.LanguageMetaData;for(const r of t.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${t.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(t.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var t,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(t=this.textDocuments)===null||t===void 0?void 0:t.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const s=it.extname(e),a=this.fileExtensionMap.get(s);if(!a)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Fn(n){return{code:n}}var ai;(function(n){n.all=["fast","slow","built-in"]})(ai||(ai={}));class Dm{constructor(e){this.entries=new si,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,t=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const l={check:this.wrapValidationException(o,t),category:r};this.addEntry(i,l)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,t),category:r};this.addEntry(i,o)}else Qn()}}wrapValidationException(e,t){return async(r,i,s)=>{await this.handleException(()=>e.call(t,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,t,r,i){try{await e()}catch(s){if(Ri(s))throw s;console.error(`${t}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${t}: ${a}`,{node:i})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=ee(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(i=>t.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),t,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class jm{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},r=B.CancellationToken.None){const i=e.parseResult,s=[];if(await Re(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(i,s,t),t.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Oe.LexingError})||(this.processParsingErrors(i,s,t),t.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Oe.ParsingError}))||(this.processLinkingErrors(e,s,t),t.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Oe.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,t,r))}catch(a){if(Ri(a))throw a;console.error("An error occurred during validation:",a)}return await Re(r),s}processLexingErrors(e,t,r){var i,s,a;const o=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const l of o){const c=(a=l.severity)!==null&&a!==void 0?a:"error",u={severity:Ui(c),range:{start:{line:l.line-1,character:l.column-1},end:{line:l.line-1,character:l.column+l.length-1}},message:l.message,data:Um(c),source:this.getSource()};t.push(u)}}processParsingErrors(e,t,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=Zi(i.token);if(s){const a={severity:Ui("error"),range:s,message:i.message,data:Fn(Oe.ParsingError),source:this.getSource()};t.push(a)}}}processLinkingErrors(e,t,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.container,property:s.property,index:s.index,data:{code:Oe.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};t.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,t,r=B.CancellationToken.None){const i=[],s=(a,o,l)=>{i.push(this.toDiagnostic(a,o,l))};return await this.validateAstBefore(e,t,s,r),await this.validateAstNodes(e,t,s,r),await this.validateAstAfter(e,t,s,r),i}async validateAstBefore(e,t,r,i=B.CancellationToken.None){var s;const a=this.validationRegistry.checksBefore;for(const o of a)await Re(i),await o(e,r,(s=t.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,t,r,i=B.CancellationToken.None){await Promise.all(Ct(e).map(async s=>{await Re(i);const a=this.validationRegistry.getChecks(s.$type,t.categories);for(const o of a)await o(s,r,i)}))}async validateAstAfter(e,t,r,i=B.CancellationToken.None){var s;const a=this.validationRegistry.checksAfter;for(const o of a)await Re(i),await o(e,r,(s=t.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,t,r){return{message:t,range:Gm(r),severity:Ui(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 Gm(n){if(n.range)return n.range;let e;return typeof n.property=="string"?e=Fl(n.node.$cstNode,n.property,n.index):typeof n.keyword=="string"&&(e=Yd(n.node.$cstNode,n.keyword,n.index)),e??(e=n.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Ui(n){switch(n){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+n)}}function Um(n){switch(n){case"error":return Fn(Oe.LexingError);case"warning":return Fn(Oe.LexingWarning);case"info":return Fn(Oe.LexingInfo);case"hint":return Fn(Oe.LexingHint);default:throw new Error("Invalid diagnostic severity: "+n)}}var Oe;(function(n){n.LexingError="lexing-error",n.LexingWarning="lexing-warning",n.LexingInfo="lexing-info",n.LexingHint="lexing-hint",n.ParsingError="parsing-error",n.LinkingError="linking-error"})(Oe||(Oe={}));class Fm{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const i=r??et(e);t??(t=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>{var l;return a??(a=Ur((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))};return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Ur(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class Bm{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=B.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Ct(i))await Re(t),Pl(s).filter(a=>!br(a)).forEach(a=>{const o=this.createDescription(a);o&&r.push(o)});return r}createDescription(e){const t=e.reference.$nodeDescription,r=e.reference.$refNode;if(!t||!r)return;const i=et(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:Ur(r),local:it.equals(t.documentUri,i)}}}class Hm{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.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),l=parseInt(s.substring(a+1)),c=i[o];return c==null?void 0:c[l]}return i[s]},e)}}var Vm=Xc();class Wm{constructor(e){this._ready=new ia,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Vm.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,r;this.workspaceConfig=(r=(t=e.capabilities.workspace)===null||t===void 0?void 0:t.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(t=>{const r=e.settings[t];this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Kn;(function(n){function e(t){return{dispose:async()=>await t()}}n.create=e})(Kn||(Kn={}));class Km{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new si,this.documentPhaseListeners=new si,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=U.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=B.CancellationToken.None){var i,s;for(const a of e){const o=a.uri.toString();if(a.state===U.Validated){if(typeof t.validation=="boolean"&&t.validation)a.state=U.IndexedReferences,a.diagnostics=void 0,this.buildState.delete(o);else if(typeof t.validation=="object"){const l=this.buildState.get(o),c=(i=l==null?void 0:l.result)===null||i===void 0?void 0:i.validationChecks;if(c){const d=((s=t.validation.categories)!==null&&s!==void 0?s:ai.all).filter(h=>!c.includes(h));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:d})},result:l.result}),a.state=U.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=U.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=B.CancellationToken.None){this.currentState=U.Changed;for(const a of t)this.langiumDocuments.deleteDocument(a),this.buildState.delete(a.toString()),this.indexManager.remove(a);for(const a of e){if(!this.langiumDocuments.invalidateDocument(a)){const l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},a);l.state=U.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(a.toString())}const i=ee(e).concat(t).map(a=>a.toString()).toSet();this.langiumDocuments.all.filter(a=>!i.has(a.uri.toString())&&this.shouldRelink(a,i)).forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,U.ComputedScopes),a.diagnostics=void 0}),await this.emitUpdate(e,t),await Re(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(a=>{var o;return a.state<U.Linked||!(!((o=this.buildState.get(a.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t<r;){for(;t<e.length&&this.hasTextDocument(e[t]);)t++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;t<r&&([e[t],e[r]]=[e[r],e[t]])}return e}hasTextDocument(e){var t;return!!(!((t=this.textDocuments)===null||t===void 0)&&t.get(e.uri))}shouldRelink(e,t){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),Kn.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,U.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,U.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,U.ComputedScopes,r,async s=>{const a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await a.computeLocalScopes(s,r)}),await this.runCancelable(e,U.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,U.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,U.Validated,r,s=>this.validate(s,r));for(const s of e){const a=this.buildState.get(s.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,t){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:t,result:s==null?void 0:s.result})}}async runCancelable(e,t,r,i){const s=e.filter(o=>o.state<t);for(const o of s)await Re(r),await i(o),o.state=t,await this.notifyDocumentPhase(o,t,r);const a=e.filter(o=>o.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),Kn.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),Kn.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let i;if(t&&"path"in t?i=t:r=t,r??(r=B.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(ii):new Promise((s,a)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),l.dispose(),i){const c=this.langiumDocuments.getDocument(i);s(c==null?void 0:c.uri)}else s(void 0)}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),a(ii)})})}async notifyDocumentPhase(e,t,r){const s=this.documentPhaseListeners.get(t).slice();for(const a of s)try{await a(e,r)}catch(o){if(!Ri(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(t).slice();for(const a of s)await Re(r),await a(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o=typeof a=="object"?a:void 0,l=await s.validateDocument(e,o,t);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;const c=this.buildState.get(e.uri.toString());if(c){(r=c.result)!==null&&r!==void 0||(c.result={});const u=(i=o==null?void 0:o.categories)!==null&&i!==void 0?i:ai.all;c.result.validationChecks?c.result.validationChecks.push(...u):c.result.validationChecks=[...u]}}getBuildOptions(e){var t,r;return(r=(t=this.buildState.get(e.uri.toString()))===null||t===void 0?void 0:t.options)!==null&&r!==void 0?r:{}}}class zm{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new wm,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=et(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{it.equals(a.targetUri,r)&&a.targetPath===t&&i.push(a)})}),ee(i)}allElements(e,t){let r=ee(this.symbolIndex.keys());return t&&(r=r.filter(i=>!t||t.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,t){var r;return t?this.symbolByTypeIndex.get(e,t,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(o=>this.astReflection.isSubtype(o.type,t))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=B.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,t),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,t=B.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&t.has(i.targetUri.toString())):!1}}class Xm{constructor(e){this.initialBuildOptions={},this._ready=new ia,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){var t;this.folders=(t=e.workspaceFolders)!==null&&t!==void 0?t:void 0}initialized(e){return this.mutex.write(t=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],t)})}async initializeWorkspace(e,t=B.CancellationToken.None){const r=await this.performStartup(e);await Re(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,t,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return yt.parse(e.uri)}async traverseFolder(e,t,r,i){const s=await this.fileSystemProvider.readDirectory(t);await Promise.all(s.map(async a=>{if(this.includeEntry(e,a,r)){if(a.isDirectory)await this.traverseFolder(e,a.uri,r,i);else if(a.isFile){const o=await this.langiumDocuments.getOrCreateDocument(a.uri);i(o)}}}))}includeEntry(e,t,r){const i=it.basename(t.uri);if(i.startsWith("."))return!1;if(t.isDirectory)return i!=="node_modules"&&i!=="out";if(t.isFile){const s=it.extname(t.uri);return r.includes(s)}return!1}}class qm{buildUnexpectedCharactersMessage(e,t,r,i,s){return ss.buildUnexpectedCharactersMessage(e,t,r,i,s)}buildUnableToPopLexerModeMessage(e){return ss.buildUnableToPopLexerModeMessage(e)}}const Ym={mode:"full"};class Jm{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=il(t)?Object.values(t):t,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new de(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Ym){var r,i,s;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:(r=a.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(il(e))return e;const t=Zc(e)?Object.values(e.modes).flat():e,r={};return t.forEach(i=>r[i.name]=i),r}}function Qm(n){return Array.isArray(n)&&(n.length===0||"name"in n[0])}function Zc(n){return n&&"modes"in n&&"defaultMode"in n}function il(n){return!Qm(n)&&!Zc(n)}function Zm(n,e,t){let r,i;typeof n=="string"?(i=e,r=t):(i=n.range.start,r=e),i||(i=M.create(0,0));const s=eu(n),a=sa(r),o=ng({lines:s,position:i,options:a});return og({index:0,tokens:o,position:i})}function eg(n,e){const t=sa(e),r=eu(n);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=t.start,o=t.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}function eu(n){let e="";return typeof n=="string"?e=n:e=n.text,e.split(Dd)}const sl=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,tg=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function ng(n){var e,t,r;const i=[];let s=n.position.line,a=n.position.character;for(let o=0;o<n.lines.length;o++){const l=o===0,c=o===n.lines.length-1;let u=n.lines[o],d=0;if(l&&n.options.start){const f=(e=n.options.start)===null||e===void 0?void 0:e.exec(u);f&&(d=f.index+f[0].length)}else{const f=(t=n.options.line)===null||t===void 0?void 0:t.exec(u);f&&(d=f.index+f[0].length)}if(c){const f=(r=n.options.end)===null||r===void 0?void 0:r.exec(u);f&&(u=u.substring(0,f.index))}if(u=u.substring(0,ag(u)),ws(u,d)>=u.length){if(i.length>0){const f=M.create(s,a);i.push({type:"break",content:"",range:L.create(f,f)})}}else{sl.lastIndex=d;const f=sl.exec(u);if(f){const m=f[0],g=f[1],_=M.create(s,a+d),y=M.create(s,a+d+m.length);i.push({type:"tag",content:g,range:L.create(_,y)}),d+=m.length,d=ws(u,d)}if(d<u.length){const m=u.substring(d),g=Array.from(m.matchAll(tg));i.push(...rg(g,m,s,a+d))}}s++,a=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function rg(n,e,t,r){const i=[];if(n.length===0){const s=M.create(t,r),a=M.create(t,r+e.length);i.push({type:"text",content:e,range:L.create(s,a)})}else{let s=0;for(const o of n){const l=o.index,c=e.substring(s,l);c.length>0&&i.push({type:"text",content:e.substring(s,l),range:L.create(M.create(t,s+r),M.create(t,l+r))});let u=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:L.create(M.create(t,s+u+r),M.create(t,s+u+d.length+r))}),u+=d.length,o.length===4){u+=o[2].length;const h=o[3];i.push({type:"text",content:h,range:L.create(M.create(t,s+u+r),M.create(t,s+u+h.length+r))})}else i.push({type:"text",content:"",range:L.create(M.create(t,s+u+r),M.create(t,s+u+r))});s=l+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:L.create(M.create(t,s+r),M.create(t,s+r+a.length))})}return i}const ig=/\S/,sg=/\s*$/;function ws(n,e){const t=n.substring(e).match(ig);return t?e+t.index:n.length}function ag(n){const e=n.match(sg);if(e&&typeof e.index=="number")return e.index}function og(n){var e,t,r,i;const s=M.create(n.position.line,n.position.character);if(n.tokens.length===0)return new al([],L.create(s,s));const a=[];for(;n.index<n.tokens.length;){const c=lg(n,a[a.length-1]);c&&a.push(c)}const o=(t=(e=a[0])===null||e===void 0?void 0:e.range.start)!==null&&t!==void 0?t:s,l=(i=(r=a[a.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new al(a,L.create(o,l))}function lg(n,e){const t=n.tokens[n.index];if(t.type==="tag")return nu(n,!1);if(t.type==="text"||t.type==="inline-tag")return tu(n);cg(t,e),n.index++}function cg(n,e){if(e){const t=new iu("",n.range);"inlines"in e?e.inlines.push(t):e.content.inlines.push(t)}}function tu(n){let e=n.tokens[n.index];const t=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(ug(n)),r=e,e=n.tokens[n.index];return new $s(i,L.create(t.range.start,r.range.end))}function ug(n){return n.tokens[n.index].type==="inline-tag"?nu(n,!0):ru(n)}function nu(n,e){const t=n.tokens[n.index++],r=t.content.substring(1),i=n.tokens[n.index];if((i==null?void 0:i.type)==="text")if(e){const s=ru(n);return new Bi(r,new $s([s],s.range),e,L.create(t.range.start,s.range.end))}else{const s=tu(n);return new Bi(r,s,e,L.create(t.range.start,s.range.end))}else{const s=t.range;return new Bi(r,new $s([],s),e,s)}}function ru(n){const e=n.tokens[n.index++];return new iu(e.content,e.range)}function sa(n){if(!n)return sa({start:"/**",end:"*/",line:"*"});const{start:e,end:t,line:r}=n;return{start:Fi(e,!0),end:Fi(t,!1),line:Fi(r,!0)}}function Fi(n,e){if(typeof n=="string"||typeof n=="object"){const t=typeof n=="string"?hi(n):n.source;return e?new RegExp(`^\\s*${t}`):new RegExp(`\\s*${t}\\s*$`)}else return n}class al{constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=ol(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const i=r.toMarkdown(e);t+=ol(t)+i}return t.trim()}}class Bi{constructor(e,t,r,i){this.name=e,this.content=t,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}
|
116
|
+
`&&i++}r&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,i=t.length;if(i===0)return M.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);t[a]>e?i=a:r=a+1}let s=r-1;return M.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var p;(function(n){const e=Object.prototype.toString;function t(f){return typeof f<"u"}n.defined=t;function r(f){return typeof f>"u"}n.undefined=r;function i(f){return f===!0||f===!1}n.boolean=i;function s(f){return e.call(f)==="[object String]"}n.string=s;function a(f){return e.call(f)==="[object Number]"}n.number=a;function o(f,m,g){return e.call(f)==="[object Number]"&&m<=f&&f<=g}n.numberRange=o;function l(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}n.integer=l;function c(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}n.uinteger=c;function u(f){return e.call(f)==="[object Function]"}n.func=u;function d(f){return f!==null&&typeof f=="object"}n.objectLiteral=d;function h(f,m){return Array.isArray(f)&&f.every(m)}n.typedArray=h})(p||(p={}));class Qp{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new Dc(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const t=new na;return t.grammarSource=e,t.root=this.rootNode,this.current.content.push(t),this.nodeStack.push(t),t}buildLeafNode(e,t){const r=new Ns(e.startOffset,e.image.length,Zi(e),e.tokenType,!t);return r.grammarSource=t,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const t=e.container;if(t){const r=t.content.indexOf(e);r>=0&&t.content.splice(r,1)}}addHiddenNodes(e){const t=[];for(const s of e){const a=new Ns(s.startOffset,s.image.length,Zi(s),s.tokenType,!0);a.root=this.rootNode,t.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...t);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...t),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...t)}construct(e){const t=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=t;const r=this.nodeStack.pop();(r==null?void 0:r.content.length)===0&&this.removeNode(r)}}class Pc{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,t;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(t=this.container)===null||t===void 0?void 0:t.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Ns extends Pc{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,t,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=t,this._range=r}}class na extends Pc{constructor(){super(...arguments),this.content=new ra(this)}get children(){return this.content}get offset(){var e,t;return(t=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&t!==void 0?t:0}get length(){return this.end-this.offset}get end(){var e,t;return(t=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&t!==void 0?t:0}get range(){const e=this.firstNonHiddenNode,t=this.lastNonHiddenNode;if(e&&t){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=t;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:M.create(0,0),end:M.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 t=this.content[e];if(!t.hidden)return t}return this.content[this.content.length-1]}}class ra extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ra.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,t,...r){return this.addParents(r),super.splice(e,t,...r)}addParents(e){for(const t of e)t.container=this.parent}}class Dc extends na{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Is=Symbol("Datatype");function Di(n){return n.$type===Is}const Xo="",jc=n=>n.endsWith(Xo)?n:n+Xo;class Gc{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const t=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new rm(t,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,t){this.wrapper.wrapOr(e,t)}optional(e,t){this.wrapper.wrapOption(e,t)}many(e,t){this.wrapper.wrapMany(e,t)}atLeastOne(e,t){this.wrapper.wrapAtLeastOne(e,t)}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 Zp extends Gc{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Qp,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,t){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(jc(e.name),this.startImplementation(r,t).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(Vl(e))return Is;{const t=Bs(e);return t??e.name}}}parse(e,t={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=t.rule?this.allRules.get(t.rule):this.mainRule;if(!i)throw new Error(t.rule?`No rule found with name '${t.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,t){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const a={$type:e};this.stack.push(a),e===Is&&(a.value="")}let s;try{s=t(r)}catch{s=void 0}return s===void 0&&i&&(s=this.construct()),s}}extractHiddenTokens(e){const t=this.lexerResult.hidden;if(!t.length)return[];const r=e.startOffset;for(let i=0;i<t.length;i++)if(t[i].startOffset>r)return t.splice(0,i);return t.splice(0,t.length)}consume(e,t,r){const i=this.wrapper.wrapConsume(e,t);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:l}=this.getAssignment(r),c=this.current;if(o){const u=ht(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,u,a,l)}else if(Di(c)){let u=i.image;ht(r)||(u=this.converter.convert(u,a).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,t,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,t,s);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,i,a)}performSubruleAssignment(e,t,r){const{assignment:i,isCrossRef:s}=this.getAssignment(t);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(Di(a))a.value+=e.toString();else if(typeof e=="object"&&e){const l=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(l)}}}action(e,t){if(!this.isRecording()){let r=this.current;if(t.feature&&t.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(t).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(t.operator,t.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return $d(e),this.nodeBuilder.construct(e),this.stack.pop(),Di(e)?this.converter.convert(e.value,e.$cstNode):(Od(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const t=di(e,ft);this.assignmentMap.set(e,{assignment:t,isCrossRef:t?js(t.terminal):!1})}return this.assignmentMap.get(e)}assign(e,t,r,i,s){const a=this.current;let o;switch(s&&typeof r=="string"?o=this.linker.buildReference(a,t,i,r):o=r,e){case"=":{a[t]=o;break}case"?=":{a[t]=!0;break}case"+=":Array.isArray(a[t])||(a[t]=[]),a[t].push(o)}}assignWithoutOverride(e,t){for(const[i,s]of Object.entries(t)){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 em{buildMismatchTokenMessage(e){return xt.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return xt.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return xt.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return xt.buildEarlyExitMessage(e)}}class Uc extends em{buildMismatchTokenMessage({expected:e,actual:t}){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 \`${t.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class tm extends Gc{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const t=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=t.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,t){const r=this.wrapper.DEFINE_RULE(jc(e.name),this.startImplementation(t).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 t=>{const r=this.keepStackSize();try{e(t)}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,t,r){this.wrapper.wrapConsume(e,t),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,t,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,t,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const t=this.elementStack.lastIndexOf(e);t>=0&&this.elementStack.splice(t)}}get currIdx(){return this.wrapper.currIdx}}const nm={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Uc};class rm extends up{constructor(e,t){const r=t&&"maxLookahead"in t;super(e,Object.assign(Object.assign(Object.assign({},nm),{lookaheadStrategy:r?new Ys({maxLookahead:t.maxLookahead}):new wp({logging:t.skipValidations?()=>{}:void 0})}),t))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,t){return this.RULE(e,t)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,t){return this.consume(e,t)}wrapSubrule(e,t,r){return this.subrule(e,t,{ARGS:[r]})}wrapOr(e,t){this.or(e,t)}wrapOption(e,t){this.option(e,t)}wrapMany(e,t){this.many(e,t)}wrapAtLeastOne(e,t){this.atLeastOne(e,t)}}function Fc(n,e,t){return im({parser:e,tokens:t,ruleNames:new Map},n),e}function im(n,e){const t=Gl(e,!1),r=ee(e.rules).filter(Ce).filter(i=>t.has(i));for(const i of r){const s=Object.assign(Object.assign({},n),{consume:1,optional:1,subrule:1,many:1,or:1});n.parser.rule(i,gt(s,i.definition))}}function gt(n,e,t=!1){let r;if(ht(e))r=dm(n,e);else if(ui(e))r=sm(n,e);else if(ft(e))r=gt(n,e.terminal);else if(js(e))r=Bc(n,e);else if(pt(e))r=am(n,e);else if(Ol(e))r=lm(n,e);else if(Ll(e))r=cm(n,e);else if(Gs(e))r=um(n,e);else if(bd(e)){const i=n.consume++;r=()=>n.parser.consume(i,nt,e)}else throw new xl(e.$cstNode,`Unexpected element type: ${e.$type}`);return Hc(n,t?void 0:ri(e),r,e.cardinality)}function sm(n,e){const t=Hs(e);return()=>n.parser.action(t,e)}function am(n,e){const t=e.rule.ref;if(Ce(t)){const r=n.subrule++,i=t.fragment,s=e.arguments.length>0?om(t,e.arguments):()=>({});return a=>n.parser.subrule(r,Vc(n,t),i,e,s(a))}else if(Tt(t)){const r=n.consume++,i=Ss(n,t.name);return()=>n.parser.consume(r,i,e)}else if(t)Qn();else throw new xl(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function om(n,e){const t=e.map(r=>Ke(r.value));return r=>{const i={};for(let s=0;s<t.length;s++){const a=n.parameters[s],o=t[s];i[a.name]=o(r)}return i}}function Ke(n){if(vd(n)){const e=Ke(n.left),t=Ke(n.right);return r=>e(r)||t(r)}else if(yd(n)){const e=Ke(n.left),t=Ke(n.right);return r=>e(r)&&t(r)}else if(Td(n)){const e=Ke(n.value);return t=>!e(t)}else if(_d(n)){const e=n.parameter.ref.name;return t=>t!==void 0&&t[e]===!0}else if(gd(n)){const e=!!n.true;return()=>e}Qn()}function lm(n,e){if(e.elements.length===1)return gt(n,e.elements[0]);{const t=[];for(const i of e.elements){const s={ALT:gt(n,i,!0)},a=ri(i);a&&(s.GATE=Ke(a)),t.push(s)}const r=n.or++;return i=>n.parser.alternatives(r,t.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function cm(n,e){if(e.elements.length===1)return gt(n,e.elements[0]);const t=[];for(const o of e.elements){const l={ALT:gt(n,o,!0)},c=ri(o);c&&(l.GATE=Ke(c)),t.push(l)}const r=n.or++,i=(o,l)=>{const c=l.getRuleStack().join("-");return`uGroup_${o}_${c}`},s=o=>n.parser.alternatives(r,t.map((l,c)=>{const u={ALT:()=>!0},d=n.parser;u.ALT=()=>{if(l.ALT(o),!d.isRecording()){const f=i(r,d);d.unorderedGroups.get(f)||d.unorderedGroups.set(f,[]);const m=d.unorderedGroups.get(f);typeof(m==null?void 0:m[c])>"u"&&(m[c]=!0)}};const h=l.GATE;return h?u.GATE=()=>h(o):u.GATE=()=>{const f=d.unorderedGroups.get(i(r,d));return!(f!=null&&f[c])},u})),a=Hc(n,ri(e),s,"*");return o=>{a(o),n.parser.isRecording()||n.parser.unorderedGroups.delete(i(r,n.parser))}}function um(n,e){const t=e.elements.map(r=>gt(n,r));return r=>t.forEach(i=>i(r))}function ri(n){if(Gs(n))return n.guardCondition}function Bc(n,e,t=e.terminal){if(t)if(pt(t)&&Ce(t.rule.ref)){const r=t.rule.ref,i=n.subrule++;return s=>n.parser.subrule(i,Vc(n,r),!1,e,s)}else if(pt(t)&&Tt(t.rule.ref)){const r=n.consume++,i=Ss(n,t.rule.ref.name);return()=>n.parser.consume(r,i,e)}else if(ht(t)){const r=n.consume++,i=Ss(n,t.value);return()=>n.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=Bl(e.type.ref),i=r==null?void 0:r.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Hs(e.type.ref));return Bc(n,e,i)}}function dm(n,e){const t=n.consume++,r=n.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>n.parser.consume(t,r,e)}function Hc(n,e,t,r){const i=e&&Ke(e);if(!r)if(i){const s=n.or++;return a=>n.parser.alternatives(s,[{ALT:()=>t(a),GATE:()=>i(a)},{ALT:Ha(),GATE:()=>!i(a)}])}else return t;if(r==="*"){const s=n.many++;return a=>n.parser.many(s,{DEF:()=>t(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=n.many++;if(i){const a=n.or++;return o=>n.parser.alternatives(a,[{ALT:()=>n.parser.atLeastOne(s,{DEF:()=>t(o)}),GATE:()=>i(o)},{ALT:Ha(),GATE:()=>!i(o)}])}else return a=>n.parser.atLeastOne(s,{DEF:()=>t(a)})}else if(r==="?"){const s=n.optional++;return a=>n.parser.optional(s,{DEF:()=>t(a),GATE:i?()=>i(a):void 0})}else Qn()}function Vc(n,e){const t=fm(n,e),r=n.parser.getRule(t);if(!r)throw new Error(`Rule "${t}" not found."`);return r}function fm(n,e){if(Ce(e))return e.name;if(n.ruleNames.has(e))return n.ruleNames.get(e);{let t=e,r=t.$container,i=e.$type;for(;!Ce(r);)(Gs(r)||Ol(r)||Ll(r))&&(i=r.elements.indexOf(t).toString()+":"+i),t=r,r=r.$container;return i=r.name+":"+i,n.ruleNames.set(e,i),i}}function Ss(n,e){const t=n.tokens[e];if(!t)throw new Error(`Token "${e}" not found."`);return t}function hm(n){const e=n.Grammar,t=n.parser.Lexer,r=new tm(n);return Fc(e,r,t.definition),r.finalize(),r}function pm(n){const e=mm(n);return e.finalize(),e}function mm(n){const e=n.Grammar,t=n.parser.Lexer,r=new Zp(n);return Fc(e,r,t.definition)}class Wc{constructor(){this.diagnostics=[]}buildTokens(e,t){const r=ee(Gl(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,t);return i.forEach(a=>{const o=a.PATTERN;typeof o=="object"&&o&&"test"in o&&ts(o)?s.unshift(a):s.push(a)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Tt).filter(t=>!t.fragment).map(t=>this.buildTerminalToken(t)).toArray()}buildTerminalToken(e){const t=Vs(e),r=this.requiresCustomPattern(t)?this.regexPatternFunction(t):t,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=ts(t)?de.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const t=new RegExp(e,e.flags+"y");return(r,i)=>(t.lastIndex=i,t.exec(r))}buildKeywordTokens(e,t,r){return e.filter(Ce).flatMap(i=>Zn(i).filter(ht)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,t,!!(r!=null&&r.caseInsensitive)))}buildKeywordToken(e,t,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,t)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,t){return t?new RegExp(Bd(e.value)):e.value}findLongerAlt(e,t){return t.reduce((r,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&Hd("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Kc{convert(e,t){let r=t.grammarSource;if(js(r)&&(r=zd(r)),pt(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,t)}return e}runConverter(e,t,r){var i;switch(e.name.toUpperCase()){case"INT":return Ve.convertInt(t);case"STRING":return Ve.convertString(t);case"ID":return Ve.convertID(t)}switch((i=ef(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Ve.convertNumber(t);case"boolean":return Ve.convertBoolean(t);case"bigint":return Ve.convertBigint(t);case"date":return Ve.convertDate(t);default:return t}}}var Ve;(function(n){function e(c){let u="";for(let d=1;d<c.length-1;d++){const h=c.charAt(d);if(h==="\\"){const f=c.charAt(++d);u+=t(f)}else u+=h}return u}n.convertString=e;function t(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
117
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}n.convertID=r;function i(c){return parseInt(c)}n.convertInt=i;function s(c){return BigInt(c)}n.convertBigint=s;function a(c){return new Date(c)}n.convertDate=a;function o(c){return Number(c)}n.convertNumber=o;function l(c){return c.toLowerCase()==="true"}n.convertBoolean=l})(Ve||(Ve={}));var ct={},Tr={},Yo;function zc(){if(Yo)return Tr;Yo=1,Object.defineProperty(Tr,"__esModule",{value:!0});let n;function e(){if(n===void 0)throw new Error("No runtime abstraction layer installed");return n}return function(t){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");n=i}t.install=r}(e||(e={})),Tr.default=e,Tr}var J={},Jo;function gm(){if(Jo)return J;Jo=1,Object.defineProperty(J,"__esModule",{value:!0}),J.stringArray=J.array=J.func=J.error=J.number=J.string=J.boolean=void 0;function n(o){return o===!0||o===!1}J.boolean=n;function e(o){return typeof o=="string"||o instanceof String}J.string=e;function t(o){return typeof o=="number"||o instanceof Number}J.number=t;function r(o){return o instanceof Error}J.error=r;function i(o){return typeof o=="function"}J.func=i;function s(o){return Array.isArray(o)}J.array=s;function a(o){return s(o)&&o.every(l=>e(l))}return J.stringArray=a,J}var ut={},Qo;function qc(){if(Qo)return ut;Qo=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.Emitter=ut.Event=void 0;const n=zc();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(ut.Event=e={}));class t{add(s,a=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(a),Array.isArray(o)&&o.push({dispose:()=>this.remove(s,a)})}remove(s,a=null){if(!this._callbacks)return;let o=!1;for(let l=0,c=this._callbacks.length;l<c;l++)if(this._callbacks[l]===s)if(this._contexts[l]===a){this._callbacks.splice(l,1),this._contexts.splice(l,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const a=[],o=this._callbacks.slice(0),l=this._contexts.slice(0);for(let c=0,u=o.length;c<u;c++)try{a.push(o[c].apply(l[c],s))}catch(d){(0,n.default)().console.error(d)}return a}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,a,o)=>{this._callbacks||(this._callbacks=new t),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,a);const l={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,a),l.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(l),l}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return ut.Emitter=r,r._noop=function(){},ut}var Zo;function ym(){if(Zo)return ct;Zo=1,Object.defineProperty(ct,"__esModule",{value:!0}),ct.CancellationTokenSource=ct.CancellationToken=void 0;const n=zc(),e=gm(),t=qc();var r;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:t.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:t.Event.None});function l(c){const u=c;return u&&(u===o.None||u===o.Cancelled||e.boolean(u.isCancellationRequested)&&!!u.onCancellationRequested)}o.is=l})(r||(ct.CancellationToken=r={}));const i=Object.freeze(function(o,l){const c=(0,n.default)().timer.setTimeout(o.bind(l),0);return{dispose(){c.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class a{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return ct.CancellationTokenSource=a,ct}var B=ym();function vm(){return new Promise(n=>{typeof setImmediate>"u"?setTimeout(n,0):setImmediate(n)})}let wr=0,Tm=10;function _m(){return wr=performance.now(),new B.CancellationTokenSource}const ii=Symbol("OperationCancelled");function Ri(n){return n===ii}async function Re(n){if(n===B.CancellationToken.None)return;const e=performance.now();if(e-wr>=Tm&&(wr=e,await vm(),wr=performance.now()),n.isCancellationRequested)throw ii}class ia{constructor(){this.promise=new Promise((e,t)=>{this.resolve=r=>(e(r),this),this.reject=r=>(t(r),this)})}}class Yn{constructor(e,t,r,i){this._uri=e,this._languageId=t,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 t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(const r of e)if(Yn.isIncremental(r)){const i=Yc(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),l=Math.max(i.end.line,0);let c=this._lineOffsets;const u=el(r.text,!1,s);if(l-o===u.length)for(let h=0,f=u.length;h<f;h++)c[h+o+1]=u[h];else u.length<1e4?c.splice(o+1,l-o,...u):this._lineOffsets=c=c.slice(0,o+1).concat(u,c.slice(l+1));const d=r.text.length-(a-s);if(d!==0)for(let h=o+1+u.length,f=c.length;h<f;h++)c[h]=c[h]+d}else if(Yn.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=el(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const t=this.getLineOffsets();let r=0,i=t.length;if(i===0)return{line:0,character:e};for(;r<i;){const a=Math.floor((r+i)/2);t[a]>e?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,t[s]),{line:s,character:e-t[s]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const r=t[e.line];if(e.character<=0)return r;const i=e.line+1<t.length?t[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,t){for(;e>t&&Xc(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}}var xs;(function(n){function e(i,s,a,o){return new Yn(i,s,a,o)}n.create=e;function t(i,s,a){if(i instanceof Yn)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(i,s){const a=i.getText(),o=Cs(s.map(Rm),(u,d)=>{const h=u.range.start.line-d.range.start.line;return h===0?u.range.start.character-d.range.start.character:h});let l=0;const c=[];for(const u of o){const d=i.offsetAt(u.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&c.push(a.substring(l,d)),u.newText.length&&c.push(u.newText),l=i.offsetAt(u.range.end)}return c.push(a.substr(l)),c.join("")}n.applyEdits=r})(xs||(xs={}));function Cs(n,e){if(n.length<=1)return n;const t=n.length/2|0,r=n.slice(0,t),i=n.slice(t);Cs(r,e),Cs(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?n[o++]=r[s++]:n[o++]=i[a++];for(;s<r.length;)n[o++]=r[s++];for(;a<i.length;)n[o++]=i[a++];return n}function el(n,e,t=0){const r=e?[t]:[];for(let i=0;i<n.length;i++){const s=n.charCodeAt(i);Xc(s)&&(s===13&&i+1<n.length&&n.charCodeAt(i+1)===10&&i++,r.push(t+i+1))}return r}function Xc(n){return n===13||n===10}function Yc(n){const e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function Rm(n){const e=Yc(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var ji={version:"v20.19.1",versions:{node:"20.19.1",acorn:"8.14.0",ada:"2.9.2",ares:"1.34.5",brotli:"1.1.0",cjs_module_lexer:"1.4.1",cldr:"46.0",icu:"76.1",llhttp:"8.1.2",modules:"115",napi:"9",nghttp2:"1.61.0",nghttp3:"0.7.0",ngtcp2:"1.1.0",openssl:"3.0.15+quic",simdutf:"6.0.3",tz:"2025a",undici:"6.21.2",unicode:"16.0",uv:"1.46.0",uvwasi:"0.0.21",v8:"11.3.244.8-node.26",zlib:"1.3.0.1-motley-82a5fec"},arch:"x64",platform:"linux",release:{name:"node",lts:"Iron",sourceUrl:"https://nodejs.org/download/release/v20.19.1/node-v20.19.1.tar.gz",headersUrl:"https://nodejs.org/download/release/v20.19.1/node-v20.19.1-headers.tar.gz"},moduleLoadList:["Internal Binding builtins","Internal Binding module_wrap","Internal Binding errors","NativeModule internal/assert","Internal Binding util","NativeModule internal/errors","Internal Binding config","Internal Binding timers","Internal Binding async_wrap","Internal Binding task_queue","Internal Binding symbols","NativeModule internal/async_hooks","Internal Binding constants","Internal Binding types","Internal Binding options","NativeModule internal/options","Internal Binding string_decoder","NativeModule internal/util","NativeModule internal/util/types","NativeModule internal/validators","NativeModule internal/linkedlist","NativeModule internal/priority_queue","Internal Binding icu","NativeModule internal/util/inspect","NativeModule internal/util/debuglog","NativeModule internal/timers","NativeModule internal/events/abort_listener","NativeModule events","Internal Binding buffer","NativeModule internal/buffer","NativeModule buffer","Internal Binding messaging","NativeModule internal/worker/js_transferable","NativeModule internal/querystring","NativeModule internal/constants","NativeModule path","NativeModule querystring","Internal Binding url","NativeModule internal/url","NativeModule internal/fs/utils","Internal Binding process_methods","NativeModule internal/process/per_thread","Internal Binding credentials","NativeModule internal/process/promises","NativeModule internal/fixed_queue","NativeModule async_hooks","NativeModule internal/process/task_queues","NativeModule timers","Internal Binding trace_events","Internal Binding contextify","NativeModule internal/vm","NativeModule internal/process/execution","NativeModule internal/process/warning","NativeModule internal/source_map/source_map_cache","Internal Binding fs","Internal Binding blob","Internal Binding encoding_binding","NativeModule internal/encoding","NativeModule internal/streams/utils","NativeModule util","NativeModule internal/webstreams/util","NativeModule internal/webstreams/queuingstrategies","NativeModule internal/blob","Internal Binding permission","NativeModule internal/process/permission","NativeModule fs","NativeModule internal/modules/helpers","NativeModule internal/console/constructor","NativeModule internal/console/global","NativeModule internal/util/inspector","Internal Binding inspector","NativeModule internal/webidl","Internal Binding performance","NativeModule internal/perf/utils","NativeModule internal/event_target","Internal Binding wasm_web_api","Internal Binding mksnapshot","NativeModule internal/v8/startup_snapshot","NativeModule internal/process/signal","NativeModule url","NativeModule internal/modules/package_json_reader","NativeModule internal/modules/cjs/loader","NativeModule internal/process/pre_execution","NativeModule internal/modules/esm/utils","NativeModule internal/inspector_async_hook","Internal Binding worker","NativeModule internal/modules/run_main","NativeModule internal/net","NativeModule internal/dns/utils","NativeModule internal/modules/esm/assert","NativeModule internal/modules/esm/loader","NativeModule internal/modules/esm/module_map","NativeModule internal/modules/esm/translators","NativeModule internal/modules/esm/package_config","NativeModule internal/modules/esm/formats","NativeModule internal/modules/esm/get_format","NativeModule internal/modules/esm/resolve","NativeModule internal/modules/esm/load","Internal Binding fs_dir","NativeModule internal/fs/dir","NativeModule string_decoder","Internal Binding fs_event_wrap","Internal Binding uv","NativeModule internal/fs/watchers","NativeModule internal/fs/recursive_watch","NativeModule internal/readline/utils","NativeModule internal/readline/callbacks","NativeModule internal/readline/interface","NativeModule internal/fs/promises","NativeModule internal/modules/esm/module_job","NativeModule internal/perf/performance_entry","NativeModule internal/perf/observe","NativeModule internal/perf/resource_timing","NativeModule internal/perf/nodetiming","NativeModule internal/perf/usertiming","NativeModule internal/perf/event_loop_utilization","NativeModule internal/histogram","NativeModule internal/perf/timerify","NativeModule internal/perf/performance","NativeModule internal/perf/event_loop_delay","NativeModule perf_hooks","NativeModule internal/source_map/source_map","NativeModule module","NativeModule internal/modules/esm/initialize_import_meta","NativeModule internal/streams/destroy","NativeModule internal/abort_controller","NativeModule internal/streams/end-of-stream","NativeModule internal/streams/legacy","NativeModule internal/streams/add-abort-signal","NativeModule internal/streams/state","NativeModule internal/streams/from","NativeModule internal/streams/readable","NativeModule internal/streams/writable","NativeModule internal/streams/duplex","NativeModule internal/streams/pipeline","NativeModule internal/streams/compose","NativeModule internal/streams/operators","NativeModule stream/promises","NativeModule internal/streams/transform","NativeModule internal/streams/passthrough","NativeModule internal/streams/duplexpair","NativeModule stream","NativeModule internal/fs/streams","NativeModule fs/promises","NativeModule internal/util/parse_args/utils","NativeModule internal/util/parse_args/parse_args","NativeModule internal/mime","Internal Binding crypto","NativeModule internal/crypto/random","NativeModule internal/crypto/hashnames","NativeModule internal/crypto/util","NativeModule internal/crypto/pbkdf2","NativeModule internal/crypto/scrypt","NativeModule internal/crypto/keys","NativeModule internal/crypto/hkdf","NativeModule internal/crypto/keygen","NativeModule internal/crypto/diffiehellman","NativeModule internal/streams/lazy_transform","NativeModule internal/crypto/cipher","NativeModule internal/crypto/sig","NativeModule internal/crypto/hash","NativeModule internal/crypto/x509","NativeModule internal/crypto/certificate","NativeModule crypto","NativeModule internal/crypto/webcrypto","Internal Binding pipe_wrap","Internal Binding stream_wrap","Internal Binding tcp_wrap","NativeModule internal/stream_base_commons","NativeModule diagnostics_channel","NativeModule net","Internal Binding udp_wrap","NativeModule internal/dgram","NativeModule dgram","Internal Binding process_wrap","Internal Binding tty_wrap","NativeModule internal/socket_list","Internal Binding spawn_sync","NativeModule internal/child_process","NativeModule child_process","NativeModule _http_agent","Internal Binding http_parser","NativeModule internal/freelist","NativeModule _http_incoming","NativeModule _http_common","NativeModule internal/http","NativeModule _http_outgoing","NativeModule _http_client","NativeModule _http_server","NativeModule http","Internal Binding cares_wrap","NativeModule internal/tls/secure-context","NativeModule _tls_common","Internal Binding js_stream","NativeModule internal/js_stream_socket","Internal Binding tls_wrap","NativeModule _tls_wrap","NativeModule internal/tls/secure-pair","NativeModule tls","NativeModule https","NativeModule internal/tty","NativeModule tty","Internal Binding block_list","NativeModule internal/socketaddress","NativeModule internal/blocklist","Internal Binding os","NativeModule os","NativeModule internal/dns/callback_resolver","NativeModule dns","NativeModule internal/dns/promises","NativeModule internal/file","NativeModule internal/readline/emitKeypressEvents","NativeModule internal/readline/promises","NativeModule readline/promises","NativeModule readline","NativeModule process","Internal Binding report","NativeModule internal/process/report","NativeModule internal/util/colors","NativeModule internal/assert/assertion_error","NativeModule internal/assert/utils","NativeModule internal/assert/calltracker","NativeModule assert","Internal Binding serdes","Internal Binding profiler","Internal Binding heap_utils","Internal Binding internal_only_v8","NativeModule internal/heap_utils","NativeModule internal/promise_hooks","Internal Binding v8","NativeModule v8","NativeModule internal/worker/io","NativeModule internal/worker/messaging","NativeModule internal/error_serdes","NativeModule internal/worker","NativeModule worker_threads","Internal Binding zlib","NativeModule zlib","NativeModule internal/deps/cjs-module-lexer/lexer","NativeModule constants","NativeModule internal/crypto/webidl","NativeModule vm","NativeModule internal/webstreams/writablestream","NativeModule internal/webstreams/readablestream","Internal Binding http2","NativeModule internal/http2/util","NativeModule internal/http2/compat","Internal Binding stream_pipe","NativeModule internal/http2/core","NativeModule http2","NativeModule util/types","NativeModule internal/deps/undici/undici"],_events:{newListener:[null,null],removeListener:[null,null]},_eventsCount:4,domain:null,_exiting:!1,config:{target_defaults:{cflags:[],default_configuration:"Release",defines:["NODE_OPENSSL_CONF_NAME=nodejs_conf","NODE_OPENSSL_HAS_QUIC","ICU_NO_USER_DATA_OVERRIDE"],include_dirs:[],libraries:[]},variables:{asan:0,clang:0,coverage:!1,dcheck_always_on:0,debug_nghttp2:!1,debug_node:!1,enable_lto:!1,enable_pgo_generate:!1,enable_pgo_use:!1,error_on_warn:!1,force_dynamic_crt:0,gas_version:"2.35",host_arch:"x64",icu_data_in:"../../deps/icu-tmp/icudt76l.dat",icu_endianness:"l",icu_gyp_path:"tools/icu/icu-generic.gyp",icu_path:"deps/icu-small",icu_small:!1,icu_ver_major:"76",is_debug:0,libdir:"lib",llvm_version:"0.0",napi_build_version:"9",node_builtin_shareable_builtins:["deps/cjs-module-lexer/lexer.js","deps/cjs-module-lexer/dist/lexer.js","deps/undici/undici.js"],node_byteorder:"little",node_debug_lib:!1,node_enable_d8:!1,node_enable_v8_vtunejit:!1,node_fipsinstall:!1,node_install_corepack:!0,node_install_npm:!0,node_library_files:["lib/_http_agent.js","lib/_http_client.js","lib/_http_common.js","lib/_http_incoming.js","lib/_http_outgoing.js","lib/_http_server.js","lib/_stream_duplex.js","lib/_stream_passthrough.js","lib/_stream_readable.js","lib/_stream_transform.js","lib/_stream_wrap.js","lib/_stream_writable.js","lib/_tls_common.js","lib/_tls_wrap.js","lib/assert.js","lib/assert/strict.js","lib/async_hooks.js","lib/buffer.js","lib/child_process.js","lib/cluster.js","lib/console.js","lib/constants.js","lib/crypto.js","lib/dgram.js","lib/diagnostics_channel.js","lib/dns.js","lib/dns/promises.js","lib/domain.js","lib/events.js","lib/fs.js","lib/fs/promises.js","lib/http.js","lib/http2.js","lib/https.js","lib/inspector.js","lib/inspector/promises.js","lib/internal/abort_controller.js","lib/internal/assert.js","lib/internal/assert/assertion_error.js","lib/internal/assert/calltracker.js","lib/internal/assert/utils.js","lib/internal/async_hooks.js","lib/internal/blob.js","lib/internal/blocklist.js","lib/internal/bootstrap/node.js","lib/internal/bootstrap/realm.js","lib/internal/bootstrap/shadow_realm.js","lib/internal/bootstrap/switches/does_not_own_process_state.js","lib/internal/bootstrap/switches/does_own_process_state.js","lib/internal/bootstrap/switches/is_main_thread.js","lib/internal/bootstrap/switches/is_not_main_thread.js","lib/internal/bootstrap/web/exposed-wildcard.js","lib/internal/bootstrap/web/exposed-window-or-worker.js","lib/internal/buffer.js","lib/internal/child_process.js","lib/internal/child_process/serialization.js","lib/internal/cli_table.js","lib/internal/cluster/child.js","lib/internal/cluster/primary.js","lib/internal/cluster/round_robin_handle.js","lib/internal/cluster/shared_handle.js","lib/internal/cluster/utils.js","lib/internal/cluster/worker.js","lib/internal/console/constructor.js","lib/internal/console/global.js","lib/internal/constants.js","lib/internal/crypto/aes.js","lib/internal/crypto/certificate.js","lib/internal/crypto/cfrg.js","lib/internal/crypto/cipher.js","lib/internal/crypto/diffiehellman.js","lib/internal/crypto/ec.js","lib/internal/crypto/hash.js","lib/internal/crypto/hashnames.js","lib/internal/crypto/hkdf.js","lib/internal/crypto/keygen.js","lib/internal/crypto/keys.js","lib/internal/crypto/mac.js","lib/internal/crypto/pbkdf2.js","lib/internal/crypto/random.js","lib/internal/crypto/rsa.js","lib/internal/crypto/scrypt.js","lib/internal/crypto/sig.js","lib/internal/crypto/util.js","lib/internal/crypto/webcrypto.js","lib/internal/crypto/webidl.js","lib/internal/crypto/x509.js","lib/internal/debugger/inspect.js","lib/internal/debugger/inspect_client.js","lib/internal/debugger/inspect_repl.js","lib/internal/dgram.js","lib/internal/dns/callback_resolver.js","lib/internal/dns/promises.js","lib/internal/dns/utils.js","lib/internal/encoding.js","lib/internal/error_serdes.js","lib/internal/errors.js","lib/internal/event_target.js","lib/internal/events/abort_listener.js","lib/internal/events/symbols.js","lib/internal/file.js","lib/internal/fixed_queue.js","lib/internal/freelist.js","lib/internal/freeze_intrinsics.js","lib/internal/fs/cp/cp-sync.js","lib/internal/fs/cp/cp.js","lib/internal/fs/dir.js","lib/internal/fs/promises.js","lib/internal/fs/read/context.js","lib/internal/fs/recursive_watch.js","lib/internal/fs/rimraf.js","lib/internal/fs/streams.js","lib/internal/fs/sync_write_stream.js","lib/internal/fs/utils.js","lib/internal/fs/watchers.js","lib/internal/heap_utils.js","lib/internal/histogram.js","lib/internal/http.js","lib/internal/http2/compat.js","lib/internal/http2/core.js","lib/internal/http2/util.js","lib/internal/inspector_async_hook.js","lib/internal/inspector_network_tracking.js","lib/internal/js_stream_socket.js","lib/internal/legacy/processbinding.js","lib/internal/linkedlist.js","lib/internal/main/check_syntax.js","lib/internal/main/embedding.js","lib/internal/main/eval_stdin.js","lib/internal/main/eval_string.js","lib/internal/main/inspect.js","lib/internal/main/mksnapshot.js","lib/internal/main/print_help.js","lib/internal/main/prof_process.js","lib/internal/main/repl.js","lib/internal/main/run_main_module.js","lib/internal/main/test_runner.js","lib/internal/main/watch_mode.js","lib/internal/main/worker_thread.js","lib/internal/mime.js","lib/internal/modules/cjs/loader.js","lib/internal/modules/esm/assert.js","lib/internal/modules/esm/create_dynamic_module.js","lib/internal/modules/esm/fetch_module.js","lib/internal/modules/esm/formats.js","lib/internal/modules/esm/get_format.js","lib/internal/modules/esm/hooks.js","lib/internal/modules/esm/initialize_import_meta.js","lib/internal/modules/esm/load.js","lib/internal/modules/esm/loader.js","lib/internal/modules/esm/module_job.js","lib/internal/modules/esm/module_map.js","lib/internal/modules/esm/package_config.js","lib/internal/modules/esm/resolve.js","lib/internal/modules/esm/shared_constants.js","lib/internal/modules/esm/translators.js","lib/internal/modules/esm/utils.js","lib/internal/modules/esm/worker.js","lib/internal/modules/helpers.js","lib/internal/modules/package_json_reader.js","lib/internal/modules/run_main.js","lib/internal/navigator.js","lib/internal/net.js","lib/internal/options.js","lib/internal/per_context/domexception.js","lib/internal/per_context/messageport.js","lib/internal/per_context/primordials.js","lib/internal/perf/event_loop_delay.js","lib/internal/perf/event_loop_utilization.js","lib/internal/perf/nodetiming.js","lib/internal/perf/observe.js","lib/internal/perf/performance.js","lib/internal/perf/performance_entry.js","lib/internal/perf/resource_timing.js","lib/internal/perf/timerify.js","lib/internal/perf/usertiming.js","lib/internal/perf/utils.js","lib/internal/policy/manifest.js","lib/internal/policy/sri.js","lib/internal/priority_queue.js","lib/internal/process/execution.js","lib/internal/process/per_thread.js","lib/internal/process/permission.js","lib/internal/process/policy.js","lib/internal/process/pre_execution.js","lib/internal/process/promises.js","lib/internal/process/report.js","lib/internal/process/signal.js","lib/internal/process/task_queues.js","lib/internal/process/warning.js","lib/internal/process/worker_thread_only.js","lib/internal/promise_hooks.js","lib/internal/querystring.js","lib/internal/readline/callbacks.js","lib/internal/readline/emitKeypressEvents.js","lib/internal/readline/interface.js","lib/internal/readline/promises.js","lib/internal/readline/utils.js","lib/internal/repl.js","lib/internal/repl/await.js","lib/internal/repl/history.js","lib/internal/repl/utils.js","lib/internal/socket_list.js","lib/internal/socketaddress.js","lib/internal/source_map/prepare_stack_trace.js","lib/internal/source_map/source_map.js","lib/internal/source_map/source_map_cache.js","lib/internal/source_map/source_map_cache_map.js","lib/internal/stream_base_commons.js","lib/internal/streams/add-abort-signal.js","lib/internal/streams/compose.js","lib/internal/streams/destroy.js","lib/internal/streams/duplex.js","lib/internal/streams/duplexify.js","lib/internal/streams/duplexpair.js","lib/internal/streams/end-of-stream.js","lib/internal/streams/from.js","lib/internal/streams/lazy_transform.js","lib/internal/streams/legacy.js","lib/internal/streams/operators.js","lib/internal/streams/passthrough.js","lib/internal/streams/pipeline.js","lib/internal/streams/readable.js","lib/internal/streams/state.js","lib/internal/streams/transform.js","lib/internal/streams/utils.js","lib/internal/streams/writable.js","lib/internal/test/binding.js","lib/internal/test/transfer.js","lib/internal/test_runner/coverage.js","lib/internal/test_runner/harness.js","lib/internal/test_runner/mock/loader.js","lib/internal/test_runner/mock/mock.js","lib/internal/test_runner/mock/mock_timers.js","lib/internal/test_runner/reporter/dot.js","lib/internal/test_runner/reporter/junit.js","lib/internal/test_runner/reporter/lcov.js","lib/internal/test_runner/reporter/spec.js","lib/internal/test_runner/reporter/tap.js","lib/internal/test_runner/reporter/utils.js","lib/internal/test_runner/reporter/v8-serializer.js","lib/internal/test_runner/runner.js","lib/internal/test_runner/test.js","lib/internal/test_runner/tests_stream.js","lib/internal/test_runner/utils.js","lib/internal/timers.js","lib/internal/tls/secure-context.js","lib/internal/tls/secure-pair.js","lib/internal/trace_events_async_hooks.js","lib/internal/tty.js","lib/internal/url.js","lib/internal/util.js","lib/internal/util/colors.js","lib/internal/util/comparisons.js","lib/internal/util/debuglog.js","lib/internal/util/inspect.js","lib/internal/util/inspector.js","lib/internal/util/parse_args/parse_args.js","lib/internal/util/parse_args/utils.js","lib/internal/util/types.js","lib/internal/v8/startup_snapshot.js","lib/internal/v8_prof_polyfill.js","lib/internal/v8_prof_processor.js","lib/internal/validators.js","lib/internal/vm.js","lib/internal/vm/module.js","lib/internal/wasm_web_api.js","lib/internal/watch_mode/files_watcher.js","lib/internal/watchdog.js","lib/internal/webidl.js","lib/internal/webstreams/adapters.js","lib/internal/webstreams/compression.js","lib/internal/webstreams/encoding.js","lib/internal/webstreams/queuingstrategies.js","lib/internal/webstreams/readablestream.js","lib/internal/webstreams/transfer.js","lib/internal/webstreams/transformstream.js","lib/internal/webstreams/util.js","lib/internal/webstreams/writablestream.js","lib/internal/worker.js","lib/internal/worker/io.js","lib/internal/worker/js_transferable.js","lib/internal/worker/messaging.js","lib/module.js","lib/net.js","lib/os.js","lib/path.js","lib/path/posix.js","lib/path/win32.js","lib/perf_hooks.js","lib/process.js","lib/punycode.js","lib/querystring.js","lib/readline.js","lib/readline/promises.js","lib/repl.js","lib/sea.js","lib/stream.js","lib/stream/consumers.js","lib/stream/promises.js","lib/stream/web.js","lib/string_decoder.js","lib/sys.js","lib/test.js","lib/test/reporters.js","lib/timers.js","lib/timers/promises.js","lib/tls.js","lib/trace_events.js","lib/tty.js","lib/url.js","lib/util.js","lib/util/types.js","lib/v8.js","lib/vm.js","lib/wasi.js","lib/worker_threads.js","lib/zlib.js"],node_module_version:115,node_no_browser_globals:!1,node_prefix:"/",node_release_urlbase:"https://nodejs.org/download/release/",node_section_ordering_info:"",node_shared:!1,node_shared_ada:!1,node_shared_brotli:!1,node_shared_cares:!1,node_shared_http_parser:!1,node_shared_libuv:!1,node_shared_nghttp2:!1,node_shared_nghttp3:!1,node_shared_ngtcp2:!1,node_shared_openssl:!1,node_shared_simdjson:!1,node_shared_simdutf:!1,node_shared_uvwasi:!1,node_shared_zlib:!1,node_tag:"",node_target_type:"executable",node_use_bundled_v8:!0,node_use_node_code_cache:!0,node_use_node_snapshot:!0,node_use_openssl:!0,node_use_v8_platform:!0,node_with_ltcg:!1,node_without_node_options:!1,node_write_snapshot_as_array_literals:!1,openssl_is_fips:!1,openssl_quic:!0,ossfuzz:!1,shlib_suffix:"so.115",single_executable_application:!0,target_arch:"x64",ubsan:0,use_prefix_to_find_headers:!1,v8_enable_31bit_smis_on_64bit_arch:0,v8_enable_extensible_ro_snapshot:0,v8_enable_gdbjit:0,v8_enable_hugepage:0,v8_enable_i18n_support:1,v8_enable_inspector:1,v8_enable_javascript_promise_hooks:1,v8_enable_lite_mode:0,v8_enable_maglev:0,v8_enable_object_print:1,v8_enable_pointer_compression:0,v8_enable_sandbox:0,v8_enable_shared_ro_heap:1,v8_enable_short_builtin_calls:1,v8_enable_v8_checks:0,v8_enable_webassembly:1,v8_no_strict_aliasing:1,v8_optimized_debug:1,v8_promise_internal_field_count:1,v8_random_seed:0,v8_trace_maps:0,v8_use_siphash:1,want_separate_host_toolset:0}},allowedNodeEnvironmentFlags:{},features:{inspector:!0,debug:!1,uv:!0,ipv6:!0,tls_alpn:!0,tls_sni:!0,tls_ocsp:!0,tls:!0,cached_builtins:!0,require_module:!0},sourceMapsEnabled:!1,stdout:{connecting:!1,_hadError:!1,_parent:null,_host:null,_closeAfterHandlingError:!1,_events:{},_readableState:{highWaterMark:16384,buffer:[],bufferIndex:0,length:0,pipes:[],awaitDrainWriters:null,readable:!1},_writableState:{highWaterMark:16384,length:0,corked:0,writelen:0,bufferedIndex:0,pendingcb:0},allowHalfOpen:!1,_eventsCount:1,_sockname:null,_pendingData:null,_pendingEncoding:"",server:null,_server:null,_type:"pipe",fd:1,_isStdio:!0},stdin:{connecting:!1,_hadError:!1,_parent:null,_host:null,_closeAfterHandlingError:!1,_events:{},_readableState:{highWaterMark:16384,buffer:[],bufferIndex:0,length:0,pipes:[],awaitDrainWriters:null},_writableState:{highWaterMark:16384,length:0,corked:0,writelen:0,bufferedIndex:0,pendingcb:0},allowHalfOpen:!1,_eventsCount:2,_sockname:null,_pendingData:null,_pendingEncoding:"",server:null,_server:null,fd:0},stderr:{connecting:!1,_hadError:!1,_parent:null,_host:null,_closeAfterHandlingError:!1,_events:{},_readableState:{highWaterMark:16384,buffer:[],bufferIndex:0,length:0,pipes:[],awaitDrainWriters:null,readable:!1},_writableState:{highWaterMark:16384,length:0,corked:0,writelen:0,bufferedIndex:0,pendingcb:0},allowHalfOpen:!1,_eventsCount:1,_sockname:null,_pendingData:null,_pendingEncoding:"",server:null,_server:null,_type:"pipe",fd:2,_isStdio:!0},env:{GITHUB_STATE:"/home/runner/work/_temp/_runner_file_commands/save_state_1b6c3768-859e-4cb7-b51f-defedcd96e77",DOTNET_NOLOGO:"1",USER:"runner",npm_config_always_auth:"",npm_config_user_agent:"npm/10.8.2 node/v20.19.1 linux x64 workspaces/false ci/github-actions",CI:"true",RUNNER_ENVIRONMENT:"github-hosted",GITHUB_ENV:"/home/runner/work/_temp/_runner_file_commands/set_env_1b6c3768-859e-4cb7-b51f-defedcd96e77",PIPX_HOME:"/opt/pipx",npm_node_execpath:"/opt/hostedtoolcache/node/20.19.1/x64/bin/node",JAVA_HOME_8_X64:"/usr/lib/jvm/temurin-8-jdk-amd64",NODE_AUTH_TOKEN:"XXXXX-XXXXX-XXXXX-XXXXX",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/runner",RUNNER_TEMP:"/home/runner/work/_temp",GITHUB_EVENT_PATH:"/home/runner/work/_temp/_github_workflow/event.json",npm_package_json:"/home/runner/work/md/md/package.json",JAVA_HOME_11_X64:"/usr/lib/jvm/temurin-11-jdk-amd64",PIPX_BIN_DIR:"/opt/pipx_bin",GITHUB_REPOSITORY_OWNER:"doocs",GRADLE_HOME:"/usr/share/gradle-8.14",ANDROID_NDK_LATEST_HOME:"/usr/local/lib/android/sdk/ndk/28.1.13356709",JAVA_HOME_21_X64:"/usr/lib/jvm/temurin-21-jdk-amd64",GITHUB_RETENTION_DAYS:"90",GITHUB_REPOSITORY_OWNER_ID:"43716716",POWERSHELL_DISTRIBUTION_CHANNEL:"GitHub-Actions-ubuntu24",AZURE_EXTENSION_DIR:"/opt/az/azcliextensions",GITHUB_HEAD_REF:"",npm_config_local_prefix:"/home/runner/work/md/md",SYSTEMD_EXEC_PID:"1893",GITHUB_GRAPHQL_URL:"https://api.github.com/graphql",COLOR:"0",NVM_DIR:"/home/runner/.nvm",DOTNET_SKIP_FIRST_TIME_EXPERIENCE:"1",GOROOT_1_21_X64:"/opt/hostedtoolcache/go/1.21.13/x64",JAVA_HOME_17_X64:"/usr/lib/jvm/temurin-17-jdk-amd64",ImageVersion:"20250511.1.0",LOGNAME:"runner",RUNNER_OS:"Linux",GITHUB_API_URL:"https://api.github.com",GOROOT_1_22_X64:"/opt/hostedtoolcache/go/1.22.12/x64",SWIFT_PATH:"/usr/share/swift/usr/bin",CHROMEWEBDRIVER:"/usr/local/share/chromedriver-linux64",GOROOT_1_23_X64:"/opt/hostedtoolcache/go/1.23.9/x64",JOURNAL_STREAM:"9:9086",GITHUB_WORKFLOW:"Create Cli Release",_:"/opt/hostedtoolcache/node/20.19.1/x64/bin/npm",npm_config_prefix:"/opt/hostedtoolcache/node/20.19.1/x64",npm_config_npm_version:"10.8.2",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/system.slice/hosted-compute-agent.service/memory.pressure",npm_config_registry:"https://registry.npmmirror.com",ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE:"/opt/actionarchivecache",GITHUB_RUN_ID:"15550458072",npm_config_cache:"/home/runner/.npm",GITHUB_REF_TYPE:"tag",BOOTSTRAP_HASKELL_NONINTERACTIVE:"1",GITHUB_WORKFLOW_SHA:"eb385160856cca945df0fe9fbb7a5458d48d8f34",GITHUB_BASE_REF:"",ImageOS:"ubuntu24",GITHUB_WORKFLOW_REF:"doocs/md/.github/workflows/release-cli.yml@refs/tags/cli-v0.1.3",GITHUB_ACTION_REPOSITORY:"",ENABLE_RUNNER_TRACING:"true",npm_config_node_gyp:"/opt/hostedtoolcache/node/20.19.1/x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",PATH:"/home/runner/work/md/md/node_modules/.bin:/home/runner/work/md/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/md/md/node_modules/.bin:/home/runner/work/md/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/runner/work/md/md/node_modules/.bin:/home/runner/work/md/node_modules/.bin:/home/runner/work/node_modules/.bin:/home/runner/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/opt/hostedtoolcache/node/20.19.1/x64/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/opt/hostedtoolcache/node/20.19.1/x64/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",ANT_HOME:"/usr/share/ant",DOTNET_MULTILEVEL_LOOKUP:"0",RUNNER_TRACKING_ID:"github_19dca915-c864-4e25-a68a-6f6062dc96c7",INVOCATION_ID:"c9636358766f476790234e1d468e9190",NPM_CONFIG_USERCONFIG:"/home/runner/work/_temp/.npmrc",RUNNER_TOOL_CACHE:"/opt/hostedtoolcache",NODE:"/opt/hostedtoolcache/node/20.19.1/x64/bin/node",npm_package_name:"md",GITHUB_ACTION:"__run_2",GITHUB_RUN_NUMBER:"12",GITHUB_TRIGGERING_ACTOR:"yanglbme",RUNNER_ARCH:"X64",XDG_RUNTIME_DIR:"/run/user/1001",AGENT_TOOLSDIRECTORY:"/opt/hostedtoolcache",LANG:"C.UTF-8",VCPKG_INSTALLATION_ROOT:"/usr/local/share/vcpkg",CONDA:"/usr/share/miniconda",RUNNER_NAME:"GitHub Actions 1000010086",XDG_CONFIG_HOME:"/home/runner/.config",GITHUB_REF_NAME:"cli-v0.1.3",GITHUB_REPOSITORY:"doocs/md",npm_lifecycle_script:"vite build",ANDROID_NDK_ROOT:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_ACTION_REF:"",DEBIAN_FRONTEND:"noninteractive",SHELL:"/bin/bash",GITHUB_REPOSITORY_ID:"218952803",GITHUB_ACTIONS:"true",npm_package_version:"2.0.3",npm_lifecycle_event:"build:only",GITHUB_REF_PROTECTED:"false",GITHUB_WORKSPACE:"/home/runner/work/md/md",ACCEPT_EULA:"Y",GITHUB_JOB:"build",GITHUB_SHA:"eb385160856cca945df0fe9fbb7a5458d48d8f34",GITHUB_RUN_ATTEMPT:"1",GITHUB_REF:"refs/tags/cli-v0.1.3",GITHUB_ACTOR:"yanglbme",ANDROID_SDK_ROOT:"/usr/local/lib/android/sdk",npm_config_globalconfig:"/opt/hostedtoolcache/node/20.19.1/x64/etc/npmrc",npm_config_init_module:"/home/runner/.npm-init.js",GITHUB_PATH:"/home/runner/work/_temp/_runner_file_commands/add_path_1b6c3768-859e-4cb7-b51f-defedcd96e77",JAVA_HOME:"/usr/lib/jvm/temurin-17-jdk-amd64",PWD:"/home/runner/work/md/md",GITHUB_ACTOR_ID:"21008209",RUNNER_WORKSPACE:"/home/runner/work/md",npm_execpath:"/opt/hostedtoolcache/node/20.19.1/x64/lib/node_modules/npm/bin/npm-cli.js",HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS:"3650",GITHUB_EVENT_NAME:"push",HOMEBREW_NO_AUTO_UPDATE:"1",ANDROID_HOME:"/usr/local/lib/android/sdk",GITHUB_SERVER_URL:"https://github.com",GECKOWEBDRIVER:"/usr/local/share/gecko_driver",GHCUP_INSTALL_BASE_PREFIX:"/usr/local",GITHUB_OUTPUT:"/home/runner/work/_temp/_runner_file_commands/set_output_1b6c3768-859e-4cb7-b51f-defedcd96e77",npm_config_global_prefix:"/opt/hostedtoolcache/node/20.19.1/x64",EDGEWEBDRIVER:"/usr/local/share/edge_driver",npm_command:"run-script",ANDROID_NDK:"/usr/local/lib/android/sdk/ndk/27.2.12479018",SGX_AESM_ADDR:"1",CHROME_BIN:"/usr/bin/google-chrome",SELENIUM_JAR_PATH:"/usr/share/java/selenium-server.jar",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",ANDROID_NDK_HOME:"/usr/local/lib/android/sdk/ndk/27.2.12479018",GITHUB_STEP_SUMMARY:"/home/runner/work/_temp/_runner_file_commands/step_summary_1b6c3768-859e-4cb7-b51f-defedcd96e77",INIT_CWD:"/home/runner/work/md/md",EDITOR:"vi",NODE_ENV:"production",LAUNCH_EDITOR:"code"},title:"node",argv:["/opt/hostedtoolcache/node/20.19.1/x64/bin/node","/home/runner/work/md/md/node_modules/.bin/vite","build"],execArgv:[],pid:2483,ppid:2482,execPath:"/opt/hostedtoolcache/node/20.19.1/x64/bin/node",debugPort:9229,argv0:"node",_preload_modules:[],report:{directory:"",filename:"",compact:!1,excludeNetwork:!1,signal:"SIGUSR2",reportOnFatalError:!1,reportOnSignal:!1,reportOnUncaughtException:!1}},Jc;(()=>{var n={470:i=>{function s(l){if(typeof l!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(l))}function a(l,c){for(var u,d="",h=0,f=-1,m=0,g=0;g<=l.length;++g){if(g<l.length)u=l.charCodeAt(g);else{if(u===47)break;u=47}if(u===47){if(!(f===g-1||m===1))if(f!==g-1&&m===2){if(d.length<2||h!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var _=d.lastIndexOf("/");if(_!==d.length-1){_===-1?(d="",h=0):h=(d=d.slice(0,_)).length-1-d.lastIndexOf("/"),f=g,m=0;continue}}else if(d.length===2||d.length===1){d="",h=0,f=g,m=0;continue}}c&&(d.length>0?d+="/..":d="..",h=2)}else d.length>0?d+="/"+l.slice(f+1,g):d=l.slice(f+1,g),h=g-f-1;f=g,m=0}else u===46&&m!==-1?++m:m=-1}return d}var o={resolve:function(){for(var l,c="",u=!1,d=arguments.length-1;d>=-1&&!u;d--){var h;d>=0?h=arguments[d]:(l===void 0&&(l=ji.cwd()),h=l),s(h),h.length!==0&&(c=h+"/"+c,u=h.charCodeAt(0)===47)}return c=a(c,!u),u?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(l){if(s(l),l.length===0)return".";var c=l.charCodeAt(0)===47,u=l.charCodeAt(l.length-1)===47;return(l=a(l,!c)).length!==0||c||(l="."),l.length>0&&u&&(l+="/"),c?"/"+l:l},isAbsolute:function(l){return s(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,c=0;c<arguments.length;++c){var u=arguments[c];s(u),u.length>0&&(l===void 0?l=u:l+="/"+u)}return l===void 0?".":o.normalize(l)},relative:function(l,c){if(s(l),s(c),l===c||(l=o.resolve(l))===(c=o.resolve(c)))return"";for(var u=1;u<l.length&&l.charCodeAt(u)===47;++u);for(var d=l.length,h=d-u,f=1;f<c.length&&c.charCodeAt(f)===47;++f);for(var m=c.length-f,g=h<m?h:m,_=-1,y=0;y<=g;++y){if(y===g){if(m>g){if(c.charCodeAt(f+y)===47)return c.slice(f+y+1);if(y===0)return c.slice(f+y)}else h>g&&(l.charCodeAt(u+y)===47?_=y:y===0&&(_=0));break}var R=l.charCodeAt(u+y);if(R!==c.charCodeAt(f+y))break;R===47&&(_=y)}var T="";for(y=u+_+1;y<=d;++y)y!==d&&l.charCodeAt(y)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+c.slice(f+_):(f+=_,c.charCodeAt(f)===47&&++f,c.slice(f))},_makeLong:function(l){return l},dirname:function(l){if(s(l),l.length===0)return".";for(var c=l.charCodeAt(0),u=c===47,d=-1,h=!0,f=l.length-1;f>=1;--f)if((c=l.charCodeAt(f))===47){if(!h){d=f;break}}else h=!1;return d===-1?u?"/":".":u&&d===1?"//":l.slice(0,d)},basename:function(l,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(l);var u,d=0,h=-1,f=!0;if(c!==void 0&&c.length>0&&c.length<=l.length){if(c.length===l.length&&c===l)return"";var m=c.length-1,g=-1;for(u=l.length-1;u>=0;--u){var _=l.charCodeAt(u);if(_===47){if(!f){d=u+1;break}}else g===-1&&(f=!1,g=u+1),m>=0&&(_===c.charCodeAt(m)?--m==-1&&(h=u):(m=-1,h=g))}return d===h?h=g:h===-1&&(h=l.length),l.slice(d,h)}for(u=l.length-1;u>=0;--u)if(l.charCodeAt(u)===47){if(!f){d=u+1;break}}else h===-1&&(f=!1,h=u+1);return h===-1?"":l.slice(d,h)},extname:function(l){s(l);for(var c=-1,u=0,d=-1,h=!0,f=0,m=l.length-1;m>=0;--m){var g=l.charCodeAt(m);if(g!==47)d===-1&&(h=!1,d=m+1),g===46?c===-1?c=m:f!==1&&(f=1):c!==-1&&(f=-1);else if(!h){u=m+1;break}}return c===-1||d===-1||f===0||f===1&&c===d-1&&c===u+1?"":l.slice(c,d)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return function(c,u){var d=u.dir||u.root,h=u.base||(u.name||"")+(u.ext||"");return d?d===u.root?d+h:d+"/"+h:h}(0,l)},parse:function(l){s(l);var c={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return c;var u,d=l.charCodeAt(0),h=d===47;h?(c.root="/",u=1):u=0;for(var f=-1,m=0,g=-1,_=!0,y=l.length-1,R=0;y>=u;--y)if((d=l.charCodeAt(y))!==47)g===-1&&(_=!1,g=y+1),d===46?f===-1?f=y:R!==1&&(R=1):f!==-1&&(R=-1);else if(!_){m=y+1;break}return f===-1||g===-1||R===0||R===1&&f===g-1&&f===m+1?g!==-1&&(c.base=c.name=m===0&&h?l.slice(1,g):l.slice(m,g)):(m===0&&h?(c.name=l.slice(1,f),c.base=l.slice(1,g)):(c.name=l.slice(m,f),c.base=l.slice(m,g)),c.ext=l.slice(f,g)),m>0?c.dir=l.slice(0,m-1):h&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function t(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return n[i](a,a.exports,t),a.exports}t.d=(i,s)=>{for(var a in s)t.o(s,a)&&!t.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},t.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),t.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;t.r(r),t.d(r,{URI:()=>h,Utils:()=>Ie}),typeof ji=="object"?i=ji.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function l(b,v){if(!b.scheme&&v)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${b.authority}", path: "${b.path}", query: "${b.query}", fragment: "${b.fragment}"}`);if(b.scheme&&!s.test(b.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(b.path){if(b.authority){if(!a.test(b.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(b.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",u="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class h{constructor(v,E,N,O,$,w=!1){Qe(this,"scheme");Qe(this,"authority");Qe(this,"path");Qe(this,"query");Qe(this,"fragment");typeof v=="object"?(this.scheme=v.scheme||c,this.authority=v.authority||c,this.path=v.path||c,this.query=v.query||c,this.fragment=v.fragment||c):(this.scheme=function(ve,q){return ve||q?ve:"file"}(v,w),this.authority=E||c,this.path=function(ve,q){switch(ve){case"https":case"http":case"file":q?q[0]!==u&&(q=u+q):q=u}return q}(this.scheme,N||c),this.query=O||c,this.fragment=$||c,l(this,w))}static isUri(v){return v instanceof h||!!v&&typeof v.authority=="string"&&typeof v.fragment=="string"&&typeof v.path=="string"&&typeof v.query=="string"&&typeof v.scheme=="string"&&typeof v.fsPath=="string"&&typeof v.with=="function"&&typeof v.toString=="function"}get fsPath(){return R(this)}with(v){if(!v)return this;let{scheme:E,authority:N,path:O,query:$,fragment:w}=v;return E===void 0?E=this.scheme:E===null&&(E=c),N===void 0?N=this.authority:N===null&&(N=c),O===void 0?O=this.path:O===null&&(O=c),$===void 0?$=this.query:$===null&&($=c),w===void 0?w=this.fragment:w===null&&(w=c),E===this.scheme&&N===this.authority&&O===this.path&&$===this.query&&w===this.fragment?this:new m(E,N,O,$,w)}static parse(v,E=!1){const N=d.exec(v);return N?new m(N[2]||c,ie(N[4]||c),ie(N[5]||c),ie(N[7]||c),ie(N[9]||c),E):new m(c,c,c,c,c)}static file(v){let E=c;if(i&&(v=v.replace(/\\/g,u)),v[0]===u&&v[1]===u){const N=v.indexOf(u,2);N===-1?(E=v.substring(2),v=u):(E=v.substring(2,N),v=v.substring(N)||u)}return new m("file",E,v,c,c)}static from(v){const E=new m(v.scheme,v.authority,v.path,v.query,v.fragment);return l(E,!0),E}toString(v=!1){return T(this,v)}toJSON(){return this}static revive(v){if(v){if(v instanceof h)return v;{const E=new m(v);return E._formatted=v.external,E._fsPath=v._sep===f?v.fsPath:null,E}}return v}}const f=i?1:void 0;class m extends h{constructor(){super(...arguments);Qe(this,"_formatted",null);Qe(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=R(this)),this._fsPath}toString(E=!1){return E?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){const E={$mid:1};return this._fsPath&&(E.fsPath=this._fsPath,E._sep=f),this._formatted&&(E.external=this._formatted),this.path&&(E.path=this.path),this.scheme&&(E.scheme=this.scheme),this.authority&&(E.authority=this.authority),this.query&&(E.query=this.query),this.fragment&&(E.fragment=this.fragment),E}}const g={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 _(b,v,E){let N,O=-1;for(let $=0;$<b.length;$++){const w=b.charCodeAt($);if(w>=97&&w<=122||w>=65&&w<=90||w>=48&&w<=57||w===45||w===46||w===95||w===126||v&&w===47||E&&w===91||E&&w===93||E&&w===58)O!==-1&&(N+=encodeURIComponent(b.substring(O,$)),O=-1),N!==void 0&&(N+=b.charAt($));else{N===void 0&&(N=b.substr(0,$));const ve=g[w];ve!==void 0?(O!==-1&&(N+=encodeURIComponent(b.substring(O,$)),O=-1),N+=ve):O===-1&&(O=$)}}return O!==-1&&(N+=encodeURIComponent(b.substring(O))),N!==void 0?N:b}function y(b){let v;for(let E=0;E<b.length;E++){const N=b.charCodeAt(E);N===35||N===63?(v===void 0&&(v=b.substr(0,E)),v+=g[N]):v!==void 0&&(v+=b[E])}return v!==void 0?v:b}function R(b,v){let E;return E=b.authority&&b.path.length>1&&b.scheme==="file"?`//${b.authority}${b.path}`:b.path.charCodeAt(0)===47&&(b.path.charCodeAt(1)>=65&&b.path.charCodeAt(1)<=90||b.path.charCodeAt(1)>=97&&b.path.charCodeAt(1)<=122)&&b.path.charCodeAt(2)===58?b.path[1].toLowerCase()+b.path.substr(2):b.path,i&&(E=E.replace(/\//g,"\\")),E}function T(b,v){const E=v?y:_;let N="",{scheme:O,authority:$,path:w,query:ve,fragment:q}=b;if(O&&(N+=O,N+=":"),($||O==="file")&&(N+=u,N+=u),$){let H=$.indexOf("@");if(H!==-1){const ot=$.substr(0,H);$=$.substr(H+1),H=ot.lastIndexOf(":"),H===-1?N+=E(ot,!1,!1):(N+=E(ot.substr(0,H),!1,!1),N+=":",N+=E(ot.substr(H+1),!1,!0)),N+="@"}$=$.toLowerCase(),H=$.lastIndexOf(":"),H===-1?N+=E($,!1,!0):(N+=E($.substr(0,H),!1,!0),N+=$.substr(H))}if(w){if(w.length>=3&&w.charCodeAt(0)===47&&w.charCodeAt(2)===58){const H=w.charCodeAt(1);H>=65&&H<=90&&(w=`/${String.fromCharCode(H+32)}:${w.substr(3)}`)}else if(w.length>=2&&w.charCodeAt(1)===58){const H=w.charCodeAt(0);H>=65&&H<=90&&(w=`${String.fromCharCode(H+32)}:${w.substr(2)}`)}N+=E(w,!0,!1)}return ve&&(N+="?",N+=E(ve,!1,!1)),q&&(N+="#",N+=v?q:_(q,!1,!1)),N}function I(b){try{return decodeURIComponent(b)}catch{return b.length>3?b.substr(0,3)+I(b.substr(3)):b}}const j=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function ie(b){return b.match(j)?b.replace(j,v=>I(v)):b}var we=t(470);const ye=we.posix||we,je="/";var Ie;(function(b){b.joinPath=function(v,...E){return v.with({path:ye.join(v.path,...E)})},b.resolvePath=function(v,...E){let N=v.path,O=!1;N[0]!==je&&(N=je+N,O=!0);let $=ye.resolve(N,...E);return O&&$[0]===je&&!v.authority&&($=$.substring(1)),v.with({path:$})},b.dirname=function(v){if(v.path.length===0||v.path===je)return v;let E=ye.dirname(v.path);return E.length===1&&E.charCodeAt(0)===46&&(E=""),v.with({path:E})},b.basename=function(v){return ye.basename(v.path)},b.extname=function(v){return ye.extname(v.path)}})(Ie||(Ie={}))})(),Jc=r})();const{URI:yt,Utils:cn}=Jc;var it;(function(n){n.basename=cn.basename,n.dirname=cn.dirname,n.extname=cn.extname,n.joinPath=cn.joinPath,n.resolvePath=cn.resolvePath;function e(i,s){return(i==null?void 0:i.toString())===(s==null?void 0:s.toString())}n.equals=e;function t(i,s){const a=typeof i=="string"?i:i.path,o=typeof s=="string"?s:s.path,l=a.split("/").filter(f=>f.length>0),c=o.split("/").filter(f=>f.length>0);let u=0;for(;u<l.length&&l[u]===c[u];u++);const d="../".repeat(l.length-u),h=c.slice(u).join("/");return d+h}n.relative=t;function r(i){return yt.parse(i.toString()).toString()}n.normalize=r})(it||(it={}));var U;(function(n){n[n.Changed=0]="Changed",n[n.Parsed=1]="Parsed",n[n.IndexedContent=2]="IndexedContent",n[n.ComputedScopes=3]="ComputedScopes",n[n.Linked=4]="Linked",n[n.IndexedReferences=5]="IndexedReferences",n[n.Validated=6]="Validated"})(U||(U={}));class Em{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,t=B.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,t)}fromTextDocument(e,t,r){return t=t??yt.parse(e.uri),B.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromString(e,t,r){return B.CancellationToken.is(r)?this.createAsync(t,e,r):this.create(t,e,r)}fromModel(e,t){return this.create(t,{$model:e})}create(e,t,r){if(typeof t=="string"){const i=this.parse(e,t,r);return this.createLangiumDocument(i,e,void 0,t)}else if("$model"in t){const i={value:t.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,t.getText(),r);return this.createLangiumDocument(i,e,t)}}async createAsync(e,t,r){if(typeof t=="string"){const i=await this.parseAsync(e,t,r);return this.createLangiumDocument(i,e,void 0,t)}else{const i=await this.parseAsync(e,t.getText(),r);return this.createLangiumDocument(i,e,t)}}createLangiumDocument(e,t,r,i){let s;if(r)s={parseResult:e,uri:t,state:U.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(t,i);s={parseResult:e,uri:t,state:U.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,t){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,a=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=a?a.getText():await this.fileSystemProvider.readFile(e.uri);if(a)Object.defineProperty(e,"textDocument",{value:a});else{const l=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:l})}return s!==o&&(e.parseResult=await this.parseAsync(e.uri,o,t),e.parseResult.value.$document=e),e.state=U.Parsed,e}parse(e,t,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(t,r)}parseAsync(e,t,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(t,r)}createTextDocumentGetter(e,t){const r=this.serviceRegistry;let i;return()=>i??(i=xs.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,t??""))}}class Am{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return ee(this.documentMap.values())}addDocument(e){const t=e.uri.toString();if(this.documentMap.has(t))throw new Error(`A document with the URI '${t}' is already present.`);this.documentMap.set(t,e)}getDocument(e){const t=e.toString();return this.documentMap.get(t)}async getOrCreateDocument(e,t){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,t),this.addDocument(r),r)}createDocument(e,t,r){if(r)return this.langiumDocumentFactory.fromString(t,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(t,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const t=e.toString(),r=this.documentMap.get(t);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=U.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const t=e.toString(),r=this.documentMap.get(t);return r&&(r.state=U.Changed,this.documentMap.delete(t)),r}}const Gi=Symbol("ref_resolving");class bm{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,t=B.CancellationToken.None){for(const r of Ct(e.parseResult.value))await Re(t),Pl(r).forEach(i=>this.doLink(i,e))}doLink(e,t){var r;const i=e.reference;if(i._ref===void 0){i._ref=Gi;try{const s=this.getCandidate(e);if(br(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const a=this.loadAstNode(s);i._ref=a??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const a=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${a}`})}t.references.push(i)}}unlink(e){for(const t of e.references)delete t._ref,delete t._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,t,r,i){const s=this,a={$refNode:r,$refText:i,get ref(){var o;if(ae(this._ref))return this._ref;if(ad(this._nodeDescription)){const l=s.loadAstNode(this._nodeDescription);this._ref=l??s.createLinkingError({reference:a,container:e,property:t},this._nodeDescription)}else if(this._ref===void 0){this._ref=Gi;const l=es(e).$document,c=s.getLinkedNode({reference:a,container:e,property:t});if(c.error&&l&&l.state<U.ComputedScopes)return this._ref=void 0;this._ref=(o=c.node)!==null&&o!==void 0?o:c.error,this._nodeDescription=c.descr,l==null||l.references.push(this)}else if(this._ref===Gi)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${t} (symbol '${i}')`);return ae(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return br(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){var t;try{const r=this.getCandidate(e);if(br(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(t=r.message)!==null&&t!==void 0?t:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const t=this.langiumDocuments().getDocument(e.documentUri);if(t)return this.astNodeLocator.getAstNode(t.parseResult.value,e.path)}createLinkingError(e,t){const r=es(e.container).$document;r&&r.state<U.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:t})}}function km(n){return typeof n.name=="string"}class Nm{getName(e){if(km(e))return e.name}getNameNode(e){return Fl(e.$cstNode,"name")}}class Im{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const t=Qd(e),r=e.astNode;if(t&&r){const i=r[t.feature];if(Ue(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Ue(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||cd(e,i)))return r}}}findDeclarationNode(e){const t=this.findDeclaration(e);if(t!=null&&t.$cstNode){const r=this.nameProvider.getNameNode(t);return r??t.$cstNode}}findReferences(e,t){const r=[];if(t.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return t.documentUri&&(i=i.filter(s=>it.equals(s.sourceUri,t.documentUri))),r.push(...i),ee(r)}getReferenceToSelf(e){const t=this.nameProvider.getNameNode(e);if(t){const r=et(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Ur(t),local:!0}}}}class si{constructor(e){if(this.map=new Map,e)for(const[t,r]of e)this.add(t,r)}get size(){return Ji.sum(ee(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,t){if(t===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(t);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var t;return(t=this.map.get(e))!==null&&t!==void 0?t:[]}has(e,t){if(t===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(t)>=0:!1}}add(e,t){return this.map.has(e)?this.map.get(e).push(t):this.map.set(e,[t]),this}addAll(e,t){return this.map.has(e)?this.map.get(e).push(...t):this.map.set(e,Array.from(t)),this}forEach(e){this.map.forEach((t,r)=>t.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ee(this.map.entries()).flatMap(([e,t])=>t.map(r=>[e,r]))}keys(){return ee(this.map.keys())}values(){return ee(this.map.values()).flat()}entriesGroupedByKey(){return ee(this.map.entries())}}class tl{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[t,r]of e)this.set(t,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,t){return this.map.set(e,t),this.inverse.set(t,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const t=this.map.get(e);return t!==void 0?(this.map.delete(e),this.inverse.delete(t),!0):!1}}class Sm{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,t=B.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,t)}async computeExportsForNode(e,t,r=Us,i=B.CancellationToken.None){const s=[];this.exportNode(e,s,t);for(const a of r(e))await Re(i),this.exportNode(a,s,t);return s}exportNode(e,t,r){const i=this.nameProvider.getName(e);i&&t.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,t=B.CancellationToken.None){const r=e.parseResult.value,i=new si;for(const s of Zn(r))await Re(t),this.processNode(s,e,i);return i}processNode(e,t,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,t))}}}class nl{constructor(e,t,r){var i;this.elements=e,this.outerScope=t,this.caseInsensitive=(i=r==null?void 0:r.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const t=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(t)return t;if(this.outerScope)return this.outerScope.getElement(e)}}class xm{constructor(e,t,r){var i;this.elements=new Map,this.caseInsensitive=(i=r==null?void 0:r.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const a=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(a,s)}this.outerScope=t}getElement(e){const t=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=ee(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Qc{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 Cm extends Qc{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,t){this.throwIfDisposed(),this.cache.set(e,t)}get(e,t){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(t){const r=t();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 wm extends Qc{constructor(e){super(),this.cache=new Map,this.converter=e??(t=>t)}has(e,t){return this.throwIfDisposed(),this.cacheForContext(e).has(t)}set(e,t,r){this.throwIfDisposed(),this.cacheForContext(e).set(t,r)}get(e,t,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(t))return i.get(t);if(r){const s=r();return i.set(t,s),s}else return}delete(e,t){return this.throwIfDisposed(),this.cacheForContext(e).delete(t)}clear(e){if(this.throwIfDisposed(),e){const t=this.converter(e);this.cache.delete(t)}else this.cache.clear()}cacheForContext(e){const t=this.converter(e);let r=this.cache.get(t);return r||(r=new Map,this.cache.set(t,r)),r}}class $m extends Cm{constructor(e,t){super(),t?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(t,()=>{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 Om{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 $m(e.shared)}getScope(e){const t=[],r=this.reflection.getReferenceType(e),i=et(e.container).precomputedScopes;if(i){let a=e.container;do{const o=i.get(a);o.length>0&&t.push(ee(o).filter(l=>this.reflection.isSubtype(l.type,r))),a=a.$container}while(a)}let s=this.getGlobalScope(r,e);for(let a=t.length-1;a>=0;a--)s=this.createScope(t[a],s);return s}createScope(e,t,r){return new nl(ee(e),t,r)}createScopeForNodes(e,t,r){const i=ee(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new nl(i,t,r)}getGlobalScope(e,t){return this.globalScopeCache.get(e,()=>new xm(this.indexManager.allElements(e)))}}function Lm(n){return typeof n.$comment=="string"}function rl(n){return typeof n=="object"&&!!n&&("$ref"in n||"$error"in n)}class Mm{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,t){const r=t??{},i=t==null?void 0:t.replacer,s=(o,l)=>this.replacer(o,l,r),a=i?(o,l)=>i(o,l,s):s;try{return this.currentDocument=et(e),JSON.stringify(e,a,t==null?void 0:t.space)}finally{this.currentDocument=void 0}}deserialize(e,t){const r=t??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,t,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var l,c,u,d;if(!this.ignoreProperties.has(e))if(Ue(t)){const h=t.ref,f=r?t.$refText:void 0;if(h){const m=et(h);let g="";this.currentDocument&&this.currentDocument!==m&&(o?g=o(m.uri,t):g=m.uri.toString());const _=this.astNodeLocator.getAstNodePath(h);return{$ref:`${g}#${_}`,$refText:f}}else return{$error:(c=(l=t.error)===null||l===void 0?void 0:l.message)!==null&&c!==void 0?c:"Could not resolve reference",$refText:f}}else if(ae(t)){let h;if(s&&(h=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},t)),(!e||t.$document)&&(h!=null&&h.$textRegion)&&(h.$textRegion.documentURI=(u=this.currentDocument)===null||u===void 0?void 0:u.uri.toString())),i&&!e&&(h??(h=Object.assign({},t)),h.$sourceText=(d=t.$cstNode)===null||d===void 0?void 0:d.text),a){h??(h=Object.assign({},t));const f=this.commentProvider.getComment(t);f&&(h.$comment=f.replace(/\r/g,""))}return h??t}else return t}addAstNodeRegionWithAssignmentsTo(e){const t=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=t(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=Xd(e.$cstNode,s).map(t);a.length!==0&&(i[s]=a)}),e}}linkNode(e,t,r,i,s,a){for(const[l,c]of Object.entries(e))if(Array.isArray(c))for(let u=0;u<c.length;u++){const d=c[u];rl(d)?c[u]=this.reviveReference(e,l,t,d,r):ae(d)&&this.linkNode(d,t,r,e,l,u)}else rl(c)?e[l]=this.reviveReference(e,l,t,c,r):ae(c)&&this.linkNode(c,t,r,e,l);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,t,r,i,s){let a=i.$refText,o=i.$error;if(i.$ref){const l=this.getRefNode(r,i.$ref,s.uriConverter);if(ae(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}if(o){const l={$refText:a??""};return l.error={container:e,property:t,message:o,reference:l},l}else return}getRefNode(e,t,r){try{const i=t.indexOf("#");if(i===0){const l=this.astNodeLocator.getAstNode(e,t.substring(1));return l||"Could not resolve path: "+t}if(i<0){const l=r?r(t):yt.parse(t),c=this.langiumDocuments.getDocument(l);return c?c.parseResult.value:"Could not find document for URI: "+t}const s=r?r(t.substring(0,i)):yt.parse(t.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+t;if(i===t.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,t.substring(i+1));return o||"Could not resolve URI: "+t}catch(i){return String(i)}}}class Pm{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const t=e.LanguageMetaData;for(const r of t.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${t.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(t.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var t,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(t=this.textDocuments)===null||t===void 0?void 0:t.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const s=it.extname(e),a=this.fileExtensionMap.get(s);if(!a)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Fn(n){return{code:n}}var ai;(function(n){n.all=["fast","slow","built-in"]})(ai||(ai={}));class Dm{constructor(e){this.entries=new si,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,t=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const l={check:this.wrapValidationException(o,t),category:r};this.addEntry(i,l)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,t),category:r};this.addEntry(i,o)}else Qn()}}wrapValidationException(e,t){return async(r,i,s)=>{await this.handleException(()=>e.call(t,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,t,r,i){try{await e()}catch(s){if(Ri(s))throw s;console.error(`${t}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${t}: ${a}`,{node:i})}}addEntry(e,t){if(e==="AstNode"){this.entries.add("AstNode",t);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,t)}getChecks(e,t){let r=ee(this.entries.get(e)).concat(this.entries.get("AstNode"));return t&&(r=r.filter(i=>t.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,t=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",t))}registerAfterDocument(e,t=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",t))}wrapPreparationException(e,t,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),t,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class jm{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,t={},r=B.CancellationToken.None){const i=e.parseResult,s=[];if(await Re(r),(!t.categories||t.categories.includes("built-in"))&&(this.processLexingErrors(i,s,t),t.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Oe.LexingError})||(this.processParsingErrors(i,s,t),t.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Oe.ParsingError}))||(this.processLinkingErrors(e,s,t),t.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===Oe.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,t,r))}catch(a){if(Ri(a))throw a;console.error("An error occurred during validation:",a)}return await Re(r),s}processLexingErrors(e,t,r){var i,s,a;const o=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const l of o){const c=(a=l.severity)!==null&&a!==void 0?a:"error",u={severity:Ui(c),range:{start:{line:l.line-1,character:l.column-1},end:{line:l.line-1,character:l.column+l.length-1}},message:l.message,data:Um(c),source:this.getSource()};t.push(u)}}processParsingErrors(e,t,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=Zi(i.token);if(s){const a={severity:Ui("error"),range:s,message:i.message,data:Fn(Oe.ParsingError),source:this.getSource()};t.push(a)}}}processLinkingErrors(e,t,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.container,property:s.property,index:s.index,data:{code:Oe.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};t.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,t,r=B.CancellationToken.None){const i=[],s=(a,o,l)=>{i.push(this.toDiagnostic(a,o,l))};return await this.validateAstBefore(e,t,s,r),await this.validateAstNodes(e,t,s,r),await this.validateAstAfter(e,t,s,r),i}async validateAstBefore(e,t,r,i=B.CancellationToken.None){var s;const a=this.validationRegistry.checksBefore;for(const o of a)await Re(i),await o(e,r,(s=t.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,t,r,i=B.CancellationToken.None){await Promise.all(Ct(e).map(async s=>{await Re(i);const a=this.validationRegistry.getChecks(s.$type,t.categories);for(const o of a)await o(s,r,i)}))}async validateAstAfter(e,t,r,i=B.CancellationToken.None){var s;const a=this.validationRegistry.checksAfter;for(const o of a)await Re(i),await o(e,r,(s=t.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,t,r){return{message:t,range:Gm(r),severity:Ui(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 Gm(n){if(n.range)return n.range;let e;return typeof n.property=="string"?e=Fl(n.node.$cstNode,n.property,n.index):typeof n.keyword=="string"&&(e=Yd(n.node.$cstNode,n.keyword,n.index)),e??(e=n.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Ui(n){switch(n){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+n)}}function Um(n){switch(n){case"error":return Fn(Oe.LexingError);case"warning":return Fn(Oe.LexingWarning);case"info":return Fn(Oe.LexingInfo);case"hint":return Fn(Oe.LexingHint);default:throw new Error("Invalid diagnostic severity: "+n)}}var Oe;(function(n){n.LexingError="lexing-error",n.LexingWarning="lexing-warning",n.LexingInfo="lexing-info",n.LexingHint="lexing-hint",n.ParsingError="parsing-error",n.LinkingError="linking-error"})(Oe||(Oe={}));class Fm{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,t,r){const i=r??et(e);t??(t=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!t)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>{var l;return a??(a=Ur((l=this.nameProvider.getNameNode(e))!==null&&l!==void 0?l:e.$cstNode))};return{node:e,name:t,get nameSegment(){return o()},selectionSegment:Ur(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class Bm{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,t=B.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Ct(i))await Re(t),Pl(s).filter(a=>!br(a)).forEach(a=>{const o=this.createDescription(a);o&&r.push(o)});return r}createDescription(e){const t=e.reference.$nodeDescription,r=e.reference.$refNode;if(!t||!r)return;const i=et(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:t.documentUri,targetPath:t.path,segment:Ur(r),local:it.equals(t.documentUri,i)}}}class Hm{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const t=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return t+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:t}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return t!==void 0?e+this.indexSeparator+t:e}getAstNode(e,t){return t.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),l=parseInt(s.substring(a+1)),c=i[o];return c==null?void 0:c[l]}return i[s]},e)}}var Vm=qc();class Wm{constructor(e){this._ready=new ia,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Vm.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var t,r;this.workspaceConfig=(r=(t=e.capabilities.workspace)===null||t===void 0?void 0:t.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const t=this.serviceRegistry.all;e.register({section:t.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const t=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(t);t.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(t=>{const r=e.settings[t];this.updateSectionConfiguration(t,r),this.onConfigurationSectionUpdateEmitter.fire({section:t,configuration:r})})}updateSectionConfiguration(e,t){this.settings[e]=t}async getConfiguration(e,t){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][t]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Kn;(function(n){function e(t){return{dispose:async()=>await t()}}n.create=e})(Kn||(Kn={}));class Km{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new si,this.documentPhaseListeners=new si,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=U.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,t={},r=B.CancellationToken.None){var i,s;for(const a of e){const o=a.uri.toString();if(a.state===U.Validated){if(typeof t.validation=="boolean"&&t.validation)a.state=U.IndexedReferences,a.diagnostics=void 0,this.buildState.delete(o);else if(typeof t.validation=="object"){const l=this.buildState.get(o),c=(i=l==null?void 0:l.result)===null||i===void 0?void 0:i.validationChecks;if(c){const d=((s=t.validation.categories)!==null&&s!==void 0?s:ai.all).filter(h=>!c.includes(h));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},t.validation),{categories:d})},result:l.result}),a.state=U.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=U.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,t,r)}async update(e,t,r=B.CancellationToken.None){this.currentState=U.Changed;for(const a of t)this.langiumDocuments.deleteDocument(a),this.buildState.delete(a.toString()),this.indexManager.remove(a);for(const a of e){if(!this.langiumDocuments.invalidateDocument(a)){const l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},a);l.state=U.Changed,this.langiumDocuments.addDocument(l)}this.buildState.delete(a.toString())}const i=ee(e).concat(t).map(a=>a.toString()).toSet();this.langiumDocuments.all.filter(a=>!i.has(a.uri.toString())&&this.shouldRelink(a,i)).forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,U.ComputedScopes),a.diagnostics=void 0}),await this.emitUpdate(e,t),await Re(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(a=>{var o;return a.state<U.Linked||!(!((o=this.buildState.get(a.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,t){await Promise.all(this.updateListeners.map(r=>r(e,t)))}sortDocuments(e){let t=0,r=e.length-1;for(;t<r;){for(;t<e.length&&this.hasTextDocument(e[t]);)t++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;t<r&&([e[t],e[r]]=[e[r],e[t]])}return e}hasTextDocument(e){var t;return!!(!((t=this.textDocuments)===null||t===void 0)&&t.get(e.uri))}shouldRelink(e,t){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,t)}onUpdate(e){return this.updateListeners.push(e),Kn.create(()=>{const t=this.updateListeners.indexOf(e);t>=0&&this.updateListeners.splice(t,1)})}async buildDocuments(e,t,r){this.prepareBuild(e,t),await this.runCancelable(e,U.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,U.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,U.ComputedScopes,r,async s=>{const a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await a.computeLocalScopes(s,r)}),await this.runCancelable(e,U.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,U.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,U.Validated,r,s=>this.validate(s,r));for(const s of e){const a=this.buildState.get(s.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,t){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:t,result:s==null?void 0:s.result})}}async runCancelable(e,t,r,i){const s=e.filter(o=>o.state<t);for(const o of s)await Re(r),await i(o),o.state=t,await this.notifyDocumentPhase(o,t,r);const a=e.filter(o=>o.state===t);await this.notifyBuildPhase(a,t,r),this.currentState=t}onBuildPhase(e,t){return this.buildPhaseListeners.add(e,t),Kn.create(()=>{this.buildPhaseListeners.delete(e,t)})}onDocumentPhase(e,t){return this.documentPhaseListeners.add(e,t),Kn.create(()=>{this.documentPhaseListeners.delete(e,t)})}waitUntil(e,t,r){let i;if(t&&"path"in t?i=t:r=t,r??(r=B.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(ii):new Promise((s,a)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),l.dispose(),i){const c=this.langiumDocuments.getDocument(i);s(c==null?void 0:c.uri)}else s(void 0)}),l=r.onCancellationRequested(()=>{o.dispose(),l.dispose(),a(ii)})})}async notifyDocumentPhase(e,t,r){const s=this.documentPhaseListeners.get(t).slice();for(const a of s)try{await a(e,r)}catch(o){if(!Ri(o))throw o}}async notifyBuildPhase(e,t,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(t).slice();for(const a of s)await Re(r),await a(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,t){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o=typeof a=="object"?a:void 0,l=await s.validateDocument(e,o,t);e.diagnostics?e.diagnostics.push(...l):e.diagnostics=l;const c=this.buildState.get(e.uri.toString());if(c){(r=c.result)!==null&&r!==void 0||(c.result={});const u=(i=o==null?void 0:o.categories)!==null&&i!==void 0?i:ai.all;c.result.validationChecks?c.result.validationChecks.push(...u):c.result.validationChecks=[...u]}}getBuildOptions(e){var t,r;return(r=(t=this.buildState.get(e.uri.toString()))===null||t===void 0?void 0:t.options)!==null&&r!==void 0?r:{}}}class zm{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new wm,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,t){const r=et(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{it.equals(a.targetUri,r)&&a.targetPath===t&&i.push(a)})}),ee(i)}allElements(e,t){let r=ee(this.symbolIndex.keys());return t&&(r=r.filter(i=>!t||t.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,t){var r;return t?this.symbolByTypeIndex.get(e,t,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(o=>this.astReflection.isSubtype(o.type,t))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const t=e.toString();this.symbolIndex.delete(t),this.symbolByTypeIndex.clear(t),this.referenceIndex.delete(t)}async updateContent(e,t=B.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,t),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,t=B.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,t);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,t){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&t.has(i.targetUri.toString())):!1}}class qm{constructor(e){this.initialBuildOptions={},this._ready=new ia,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){var t;this.folders=(t=e.workspaceFolders)!==null&&t!==void 0?t:void 0}initialized(e){return this.mutex.write(t=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],t)})}async initializeWorkspace(e,t=B.CancellationToken.None){const r=await this.performStartup(e);await Re(t),await this.documentBuilder.build(r,this.initialBuildOptions,t)}async performStartup(e){const t=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,t,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,t){return Promise.resolve()}getRootFolder(e){return yt.parse(e.uri)}async traverseFolder(e,t,r,i){const s=await this.fileSystemProvider.readDirectory(t);await Promise.all(s.map(async a=>{if(this.includeEntry(e,a,r)){if(a.isDirectory)await this.traverseFolder(e,a.uri,r,i);else if(a.isFile){const o=await this.langiumDocuments.getOrCreateDocument(a.uri);i(o)}}}))}includeEntry(e,t,r){const i=it.basename(t.uri);if(i.startsWith("."))return!1;if(t.isDirectory)return i!=="node_modules"&&i!=="out";if(t.isFile){const s=it.extname(t.uri);return r.includes(s)}return!1}}class Xm{buildUnexpectedCharactersMessage(e,t,r,i,s){return ss.buildUnexpectedCharactersMessage(e,t,r,i,s)}buildUnableToPopLexerModeMessage(e){return ss.buildUnableToPopLexerModeMessage(e)}}const Ym={mode:"full"};class Jm{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const t=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(t);const r=il(t)?Object.values(t):t,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new de(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,t=Ym){var r,i,s;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:(r=a.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(il(e))return e;const t=Zc(e)?Object.values(e.modes).flat():e,r={};return t.forEach(i=>r[i.name]=i),r}}function Qm(n){return Array.isArray(n)&&(n.length===0||"name"in n[0])}function Zc(n){return n&&"modes"in n&&"defaultMode"in n}function il(n){return!Qm(n)&&!Zc(n)}function Zm(n,e,t){let r,i;typeof n=="string"?(i=e,r=t):(i=n.range.start,r=e),i||(i=M.create(0,0));const s=eu(n),a=sa(r),o=ng({lines:s,position:i,options:a});return og({index:0,tokens:o,position:i})}function eg(n,e){const t=sa(e),r=eu(n);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=t.start,o=t.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}function eu(n){let e="";return typeof n=="string"?e=n:e=n.text,e.split(Dd)}const sl=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,tg=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function ng(n){var e,t,r;const i=[];let s=n.position.line,a=n.position.character;for(let o=0;o<n.lines.length;o++){const l=o===0,c=o===n.lines.length-1;let u=n.lines[o],d=0;if(l&&n.options.start){const f=(e=n.options.start)===null||e===void 0?void 0:e.exec(u);f&&(d=f.index+f[0].length)}else{const f=(t=n.options.line)===null||t===void 0?void 0:t.exec(u);f&&(d=f.index+f[0].length)}if(c){const f=(r=n.options.end)===null||r===void 0?void 0:r.exec(u);f&&(u=u.substring(0,f.index))}if(u=u.substring(0,ag(u)),ws(u,d)>=u.length){if(i.length>0){const f=M.create(s,a);i.push({type:"break",content:"",range:L.create(f,f)})}}else{sl.lastIndex=d;const f=sl.exec(u);if(f){const m=f[0],g=f[1],_=M.create(s,a+d),y=M.create(s,a+d+m.length);i.push({type:"tag",content:g,range:L.create(_,y)}),d+=m.length,d=ws(u,d)}if(d<u.length){const m=u.substring(d),g=Array.from(m.matchAll(tg));i.push(...rg(g,m,s,a+d))}}s++,a=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function rg(n,e,t,r){const i=[];if(n.length===0){const s=M.create(t,r),a=M.create(t,r+e.length);i.push({type:"text",content:e,range:L.create(s,a)})}else{let s=0;for(const o of n){const l=o.index,c=e.substring(s,l);c.length>0&&i.push({type:"text",content:e.substring(s,l),range:L.create(M.create(t,s+r),M.create(t,l+r))});let u=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:L.create(M.create(t,s+u+r),M.create(t,s+u+d.length+r))}),u+=d.length,o.length===4){u+=o[2].length;const h=o[3];i.push({type:"text",content:h,range:L.create(M.create(t,s+u+r),M.create(t,s+u+h.length+r))})}else i.push({type:"text",content:"",range:L.create(M.create(t,s+u+r),M.create(t,s+u+r))});s=l+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:L.create(M.create(t,s+r),M.create(t,s+r+a.length))})}return i}const ig=/\S/,sg=/\s*$/;function ws(n,e){const t=n.substring(e).match(ig);return t?e+t.index:n.length}function ag(n){const e=n.match(sg);if(e&&typeof e.index=="number")return e.index}function og(n){var e,t,r,i;const s=M.create(n.position.line,n.position.character);if(n.tokens.length===0)return new al([],L.create(s,s));const a=[];for(;n.index<n.tokens.length;){const c=lg(n,a[a.length-1]);c&&a.push(c)}const o=(t=(e=a[0])===null||e===void 0?void 0:e.range.start)!==null&&t!==void 0?t:s,l=(i=(r=a[a.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new al(a,L.create(o,l))}function lg(n,e){const t=n.tokens[n.index];if(t.type==="tag")return nu(n,!1);if(t.type==="text"||t.type==="inline-tag")return tu(n);cg(t,e),n.index++}function cg(n,e){if(e){const t=new iu("",n.range);"inlines"in e?e.inlines.push(t):e.content.inlines.push(t)}}function tu(n){let e=n.tokens[n.index];const t=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(ug(n)),r=e,e=n.tokens[n.index];return new $s(i,L.create(t.range.start,r.range.end))}function ug(n){return n.tokens[n.index].type==="inline-tag"?nu(n,!0):ru(n)}function nu(n,e){const t=n.tokens[n.index++],r=t.content.substring(1),i=n.tokens[n.index];if((i==null?void 0:i.type)==="text")if(e){const s=ru(n);return new Bi(r,new $s([s],s.range),e,L.create(t.range.start,s.range.end))}else{const s=tu(n);return new Bi(r,s,e,L.create(t.range.start,s.range.end))}else{const s=t.range;return new Bi(r,new $s([],s),e,s)}}function ru(n){const e=n.tokens[n.index++];return new iu(e.content,e.range)}function sa(n){if(!n)return sa({start:"/**",end:"*/",line:"*"});const{start:e,end:t,line:r}=n;return{start:Fi(e,!0),end:Fi(t,!1),line:Fi(r,!0)}}function Fi(n,e){if(typeof n=="string"||typeof n=="object"){const t=typeof n=="string"?hi(n):n.source;return e?new RegExp(`^\\s*${t}`):new RegExp(`\\s*${t}\\s*$`)}else return n}class al{constructor(e,t){this.elements=e,this.range=t}getTag(e){return this.getAllTags().find(t=>t.name===e)}getTags(e){return this.getAllTags().filter(t=>t.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const t of this.elements)if(e.length===0)e=t.toString();else{const r=t.toString();e+=ol(e)+r}return e.trim()}toMarkdown(e){let t="";for(const r of this.elements)if(t.length===0)t=r.toMarkdown(e);else{const i=r.toMarkdown(e);t+=ol(t)+i}return t.trim()}}class Bi{constructor(e,t,r,i){this.name=e,this.content=t,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const t=this.content.toString();return this.content.inlines.length===1?e=`${e} ${t}`:this.content.inlines.length>1&&(e=`${e}
|
118
118
|
${t}`),this.inline?`{${e}}`:e}toMarkdown(e){var t,r;return(r=(t=e==null?void 0:e.renderTag)===null||t===void 0?void 0:t.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const t=this.content.toMarkdown(e);if(this.inline){const s=dg(this.name,t,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} — ${t}`:this.content.inlines.length>1&&(i=`${i}
|
119
119
|
${t}`),this.inline?`{${i}}`:i}}function dg(n,e,t){var r,i;if(n==="linkplain"||n==="linkcode"||n==="link"){const s=e.indexOf(" ");let a=e;if(s>0){const l=ws(e,s);a=e.substring(l),e=e.substring(0,s)}return(n==="linkcode"||n==="link"&&t.link==="code")&&(a=`\`${a}\``),(i=(r=t.renderLink)===null||r===void 0?void 0:r.call(t,e,a))!==null&&i!==void 0?i:fg(e,a)}}function fg(n,e){try{return yt.parse(n,!0),`[${e}](${n})`}catch{return n}}class $s{constructor(e,t){this.inlines=e,this.range=t}toString(){let e="";for(let t=0;t<this.inlines.length;t++){const r=this.inlines[t],i=this.inlines[t+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
|
120
120
|
`)}return e}toMarkdown(e){let t="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];t+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(t+=`
|
@@ -122,7 +122,7 @@ ${t}`),this.inline?`{${i}}`:i}}function dg(n,e,t){var r,i;if(n==="linkplain"||n=
|
|
122
122
|
`)?`
|
123
123
|
`:`
|
124
124
|
|
125
|
-
`}class hg{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&eg(t))return Zm(t).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,t,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,t))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,t);if(s&&s.nameSegment){const a=s.nameSegment.range.start.line+1,o=s.nameSegment.range.start.character+1,l=s.documentUri.with({fragment:`L${a},${o}`});return`[${r}](${l.toString()})`}else return}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){const i=et(e).precomputedScopes;if(!i)return;let s=e;do{const o=i.get(s).find(l=>l.name===t);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(i=>i.name===t)}}class pg{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return Lm(e)?e.$comment:(t=hd(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||t===void 0?void 0:t.text}}class mg{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}}class gg{constructor(){this.previousTokenSource=new B.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=_m();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=B.CancellationToken.None){const i=new ia,s={action:t,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:t,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>t(i));r.resolve(s)}catch(s){Ri(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class yg{constructor(e){this.grammarElementIdMap=new tl,this.tokenTypeIdMap=new tl,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(t=>Object.assign(Object.assign({},t),{message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const i of Ct(e))t.set(i,{});if(e.$cstNode)for(const i of Qi(e.$cstNode))r.set(i,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.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,t));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)ae(o)?a.push(this.dehydrateAstNode(o,t)):Ue(o)?a.push(this.dehydrateReference(o,t)):a.push(o)}else ae(s)?r[i]=this.dehydrateAstNode(s,t):Ue(s)?r[i]=this.dehydrateReference(s,t):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return Sl(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),Xn(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,t)):Il(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 t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const s of Ct(e))t.set(s,{});let i;if(e.$cstNode)for(const s of Qi(e.$cstNode)){let a;"fullText"in s?(a=new Dc(s.fullText),i=a):"content"in s?a=new na:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.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)ae(o)?a.push(this.setParent(this.hydrateAstNode(o,t),r)):Ue(o)?a.push(this.hydrateReference(o,r,i,t)):a.push(o)}else ae(s)?r[i]=this.setParent(this.hydrateAstNode(s,t),r):Ue(s)?r[i]=this.hydrateReference(s,r,i,t):s!==void 0&&(r[i]=s);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,i){return this.linker.buildReference(t,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const i=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=t.astNodes.get(e.astNode),Xn(i))for(const s of e.content){const a=this.hydrateCstNode(s,t,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,l=e.endColumn,c=e.hidden;return new Ns(r,i,{start:{line:s,character:a},end:{line:o,character:l}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Ct(this.grammar))md(t)&&this.grammarElementIdMap.set(t,e++)}}function Rt(n){return{documentation:{CommentProvider:e=>new pg(e),DocumentationProvider:e=>new hg(e)},parser:{AsyncParser:e=>new mg(e),GrammarConfig:e=>of(e),LangiumParser:e=>pm(e),CompletionParser:e=>hm(e),ValueConverter:()=>new Kc,TokenBuilder:()=>new Wc,Lexer:e=>new Jm(e),ParserErrorMessageProvider:()=>new Uc,LexerErrorMessageProvider:()=>new qm},workspace:{AstNodeLocator:()=>new Hm,AstNodeDescriptionProvider:e=>new Fm(e),ReferenceDescriptionProvider:e=>new Bm(e)},references:{Linker:e=>new bm(e),NameProvider:()=>new Nm,ScopeProvider:e=>new Om(e),ScopeComputation:e=>new Sm(e),References:e=>new Im(e)},serializer:{Hydrator:e=>new yg(e),JsonSerializer:e=>new Mm(e)},validation:{DocumentValidator:e=>new jm(e),ValidationRegistry:e=>new Dm(e)},shared:()=>n.shared}}function Et(n){return{ServiceRegistry:e=>new Pm(e),workspace:{LangiumDocuments:e=>new Am(e),LangiumDocumentFactory:e=>new Em(e),DocumentBuilder:e=>new Km(e),IndexManager:e=>new zm(e),WorkspaceManager:e=>new Xm(e),FileSystemProvider:e=>n.fileSystemProvider(e),WorkspaceLock:()=>new gg,ConfigurationProvider:e=>new Wm(e)}}}var ll;(function(n){n.merge=(e,t)=>oi(oi({},e),t)})(ll||(ll={}));function pe(n,e,t,r,i,s,a,o,l){const c=[n,e,t,r,i,s,a,o,l].reduce(oi,{});return su(c)}const vg=Symbol("isProxy");function su(n,e){const t=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===vg?!0:ul(r,i,n,e||t),getOwnPropertyDescriptor:(r,i)=>(ul(r,i,n,e||t),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in n,ownKeys:()=>[...Object.getOwnPropertyNames(n)]});return t}const cl=Symbol();function ul(n,e,t,r){if(e in n){if(n[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:n[e]});if(n[e]===cl)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return n[e]}else if(e in t){const i=t[e];n[e]=cl;try{n[e]=typeof i=="function"?i(r):su(i,r)}catch(s){throw n[e]=s instanceof Error?s:void 0,s}return n[e]}else return}function oi(n,e){if(e){for(const[t,r]of Object.entries(e))if(r!==void 0){const i=n[t];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?n[t]=oi(i,r):n[t]=r}}return n}class Tg{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const At={fileSystemProvider:()=>new Tg},_g={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Rg={AstReflection:()=>new Ml};function Eg(){const n=pe(Et(At),Rg),e=pe(Rt({shared:n}),_g);return n.ServiceRegistry.register(e),e}function sn(n){var e;const t=Eg(),r=t.serializer.JsonSerializer.deserialize(n);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,yt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var Ag=Object.defineProperty,A=(n,e)=>Ag(n,"name",{value:e,configurable:!0}),dl="Statement",$r="Architecture";function bg(n){return De.isInstance(n,$r)}A(bg,"isArchitecture");var _r="Axis",Bn="Branch";function kg(n){return De.isInstance(n,Bn)}A(kg,"isBranch");var Rr="Checkout",Er="CherryPicking",Hn="Commit";function Ng(n){return De.isInstance(n,Hn)}A(Ng,"isCommit");var Or="Common";function Ig(n){return De.isInstance(n,Or)}A(Ig,"isCommon");var Hi="Curve",Vi="Edge",Wi="Entry",Vn="GitGraph";function Sg(n){return De.isInstance(n,Vn)}A(Sg,"isGitGraph");var Ki="Group",Lr="Info";function xg(n){return De.isInstance(n,Lr)}A(xg,"isInfo");var zi="Junction",Wn="Merge";function Cg(n){return De.isInstance(n,Wn)}A(Cg,"isMerge");var Xi="Option",Mr="Packet";function wg(n){return De.isInstance(n,Mr)}A(wg,"isPacket");var Pr="PacketBlock";function $g(n){return De.isInstance(n,Pr)}A($g,"isPacketBlock");var Dr="Pie";function Og(n){return De.isInstance(n,Dr)}A(Og,"isPie");var jr="PieSection";function Lg(n){return De.isInstance(n,jr)}A(Lg,"isPieSection");var qi="Radar",Yi="Service",Ar="Direction",$t,au=($t=class extends Nl{getAllTypes(){return[$r,_r,Bn,Rr,Er,Hn,Or,Hi,Ar,Vi,Wi,Vn,Ki,Lr,zi,Wn,Xi,Mr,Pr,Dr,jr,qi,Yi,dl]}computeIsSubtype(e,t){switch(e){case Bn:case Rr:case Er:case Hn:case Wn:return this.isSubtype(dl,t);case Ar:return this.isSubtype(Vn,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Entry:axis":return _r;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case $r:return{name:$r,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case _r:return{name:_r,properties:[{name:"label"},{name:"name"}]};case Bn:return{name:Bn,properties:[{name:"name"},{name:"order"}]};case Rr:return{name:Rr,properties:[{name:"branch"}]};case Er:return{name:Er,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case Hn:return{name:Hn,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case Or:return{name:Or,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case Hi:return{name:Hi,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case Vi:return{name:Vi,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case Wi:return{name:Wi,properties:[{name:"axis"},{name:"value"}]};case Vn:return{name:Vn,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case Ki:return{name:Ki,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Lr:return{name:Lr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case zi:return{name:zi,properties:[{name:"id"},{name:"in"}]};case Wn:return{name:Wn,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case Xi:return{name:Xi,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case Mr:return{name:Mr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case Pr:return{name:Pr,properties:[{name:"end"},{name:"label"},{name:"start"}]};case Dr:return{name:Dr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case jr:return{name:jr,properties:[{name:"label"},{name:"value"}]};case qi:return{name:qi,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case Yi:return{name:Yi,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case Ar:return{name:Ar,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:e,properties:[]}}}},A($t,"MermaidAstReflection"),$t),De=new au,fl,Mg=A(()=>fl??(fl=sn('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"InfoGrammar"),hl,Pg=A(()=>hl??(hl=sn(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),pl,Dg=A(()=>pl??(pl=sn('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PieGrammar"),ml,jg=A(()=>ml??(ml=sn('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@15"},"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@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"ArchitectureGrammar"),gl,Gg=A(()=>gl??(gl=sn(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"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@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),yl,Ug=A(()=>yl??(yl=sn(`{"$type":"Grammar","isDeclared":true,"name":"Radar","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"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@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"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@18"},"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@18"},"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@18"},"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@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)),"RadarGrammar"),Fg={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bg={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Hg={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vg={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wg={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Kg={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},an={AstReflection:A(()=>new au,"AstReflection")},zg={Grammar:A(()=>Mg(),"Grammar"),LanguageMetaData:A(()=>Fg,"LanguageMetaData"),parser:{}},Xg={Grammar:A(()=>Pg(),"Grammar"),LanguageMetaData:A(()=>Bg,"LanguageMetaData"),parser:{}},qg={Grammar:A(()=>Dg(),"Grammar"),LanguageMetaData:A(()=>Hg,"LanguageMetaData"),parser:{}},Yg={Grammar:A(()=>jg(),"Grammar"),LanguageMetaData:A(()=>Vg,"LanguageMetaData"),parser:{}},Jg={Grammar:A(()=>Gg(),"Grammar"),LanguageMetaData:A(()=>Wg,"LanguageMetaData"),parser:{}},Qg={Grammar:A(()=>Ug(),"Grammar"),LanguageMetaData:A(()=>Kg,"LanguageMetaData"),parser:{}},Zg=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ey=/accTitle[\t ]*:([^\n\r]*)/,ty=/title([\t ][^\n\r]*|)/,ny={ACC_DESCR:Zg,ACC_TITLE:ey,TITLE:ty},Ot,aa=(Ot=class extends Kc{runConverter(e,t,r){let i=this.runCommonConverter(e,t,r);return i===void 0&&(i=this.runCustomConverter(e,t,r)),i===void 0?super.runConverter(e,t,r):i}runCommonConverter(e,t,r){const i=ny[e.name];if(i===void 0)return;const s=i.exec(t);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,`
|
126
|
-
`)}}},A(Ot,"AbstractMermaidValueConverter"),Ot),Lt,Ei=(Lt=class extends aa{runCustomConverter(e,t,r){}},A(Lt,"CommonValueConverter"),Lt),Mt,bt=(Mt=class extends Wc{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const i=super.buildKeywordTokens(e,t,r);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},A(Mt,"AbstractMermaidTokenBuilder"),Mt),Pt;Pt=class extends bt{},A(Pt,"CommonTokenBuilder");var Dt,ry=(Dt=class extends bt{constructor(){super(["gitGraph"])}},A(Dt,"GitGraphTokenBuilder"),Dt),ou={parser:{TokenBuilder:A(()=>new ry,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function lu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),Jg,ou);return e.ServiceRegistry.register(t),{shared:e,GitGraph:t}}A(lu,"createGitGraphServices");var jt,iy=(jt=class extends bt{constructor(){super(["info","showInfo"])}},A(jt,"InfoTokenBuilder"),jt),cu={parser:{TokenBuilder:A(()=>new iy,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function uu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),zg,cu);return e.ServiceRegistry.register(t),{shared:e,Info:t}}A(uu,"createInfoServices");var Gt,sy=(Gt=class extends bt{constructor(){super(["packet-beta"])}},A(Gt,"PacketTokenBuilder"),Gt),du={parser:{TokenBuilder:A(()=>new sy,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function fu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),
|
125
|
+
`}class hg{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const t=this.commentProvider.getComment(e);if(t&&eg(t))return Zm(t).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,t,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,t))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,t);if(s&&s.nameSegment){const a=s.nameSegment.range.start.line+1,o=s.nameSegment.range.start.character+1,l=s.documentUri.with({fragment:`L${a},${o}`});return`[${r}](${l.toString()})`}else return}documentationTagRenderer(e,t){}findNameInPrecomputedScopes(e,t){const i=et(e).precomputedScopes;if(!i)return;let s=e;do{const o=i.get(s).find(l=>l.name===t);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,t){return this.indexManager.allElements().find(i=>i.name===t)}}class pg{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var t;return Lm(e)?e.$comment:(t=hd(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||t===void 0?void 0:t.text}}class mg{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,t){return Promise.resolve(this.syncParser.parse(e))}}class gg{constructor(){this.previousTokenSource=new B.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const t=_m();return this.previousTokenSource=t,this.enqueue(this.writeQueue,e,t.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,t,r=B.CancellationToken.None){const i=new ia,s={action:t,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:t,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>t(i));r.resolve(s)}catch(s){Ri(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class yg{constructor(e){this.grammarElementIdMap=new tl,this.tokenTypeIdMap=new tl,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(t=>Object.assign(Object.assign({},t),{message:t.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const t=new Map,r=new Map;for(const i of Ct(e))t.set(i,{});if(e.$cstNode)for(const i of Qi(e.$cstNode))r.set(i,{});return{astNodes:t,cstNodes:r}}dehydrateAstNode(e,t){const r=t.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,t));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)ae(o)?a.push(this.dehydrateAstNode(o,t)):Ue(o)?a.push(this.dehydrateReference(o,t)):a.push(o)}else ae(s)?r[i]=this.dehydrateAstNode(s,t):Ue(s)?r[i]=this.dehydrateReference(s,t):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,t){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=t.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,t){const r=t.cstNodes.get(e);return Sl(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=t.astNodes.get(e.astNode),qn(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,t)):Il(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 t=e.value,r=this.createHydrationContext(t);return"$cstNode"in t&&this.hydrateCstNode(t.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(t,r)}}createHydrationContext(e){const t=new Map,r=new Map;for(const s of Ct(e))t.set(s,{});let i;if(e.$cstNode)for(const s of Qi(e.$cstNode)){let a;"fullText"in s?(a=new Dc(s.fullText),i=a):"content"in s?a=new na:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:t,cstNodes:r}}hydrateAstNode(e,t){const r=t.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=t.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)ae(o)?a.push(this.setParent(this.hydrateAstNode(o,t),r)):Ue(o)?a.push(this.hydrateReference(o,r,i,t)):a.push(o)}else ae(s)?r[i]=this.setParent(this.hydrateAstNode(s,t),r):Ue(s)?r[i]=this.hydrateReference(s,r,i,t):s!==void 0&&(r[i]=s);return r}setParent(e,t){return e.$container=t,e}hydrateReference(e,t,r,i){return this.linker.buildReference(t,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,t,r=0){const i=t.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=t.astNodes.get(e.astNode),qn(i))for(const s of e.content){const a=this.hydrateCstNode(s,t,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const t=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,l=e.endColumn,c=e.hidden;return new Ns(r,i,{start:{line:s,character:a},end:{line:o,character:l}},t,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const t of Ct(this.grammar))md(t)&&this.grammarElementIdMap.set(t,e++)}}function Rt(n){return{documentation:{CommentProvider:e=>new pg(e),DocumentationProvider:e=>new hg(e)},parser:{AsyncParser:e=>new mg(e),GrammarConfig:e=>of(e),LangiumParser:e=>pm(e),CompletionParser:e=>hm(e),ValueConverter:()=>new Kc,TokenBuilder:()=>new Wc,Lexer:e=>new Jm(e),ParserErrorMessageProvider:()=>new Uc,LexerErrorMessageProvider:()=>new Xm},workspace:{AstNodeLocator:()=>new Hm,AstNodeDescriptionProvider:e=>new Fm(e),ReferenceDescriptionProvider:e=>new Bm(e)},references:{Linker:e=>new bm(e),NameProvider:()=>new Nm,ScopeProvider:e=>new Om(e),ScopeComputation:e=>new Sm(e),References:e=>new Im(e)},serializer:{Hydrator:e=>new yg(e),JsonSerializer:e=>new Mm(e)},validation:{DocumentValidator:e=>new jm(e),ValidationRegistry:e=>new Dm(e)},shared:()=>n.shared}}function Et(n){return{ServiceRegistry:e=>new Pm(e),workspace:{LangiumDocuments:e=>new Am(e),LangiumDocumentFactory:e=>new Em(e),DocumentBuilder:e=>new Km(e),IndexManager:e=>new zm(e),WorkspaceManager:e=>new qm(e),FileSystemProvider:e=>n.fileSystemProvider(e),WorkspaceLock:()=>new gg,ConfigurationProvider:e=>new Wm(e)}}}var ll;(function(n){n.merge=(e,t)=>oi(oi({},e),t)})(ll||(ll={}));function pe(n,e,t,r,i,s,a,o,l){const c=[n,e,t,r,i,s,a,o,l].reduce(oi,{});return su(c)}const vg=Symbol("isProxy");function su(n,e){const t=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===vg?!0:ul(r,i,n,e||t),getOwnPropertyDescriptor:(r,i)=>(ul(r,i,n,e||t),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in n,ownKeys:()=>[...Object.getOwnPropertyNames(n)]});return t}const cl=Symbol();function ul(n,e,t,r){if(e in n){if(n[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:n[e]});if(n[e]===cl)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return n[e]}else if(e in t){const i=t[e];n[e]=cl;try{n[e]=typeof i=="function"?i(r):su(i,r)}catch(s){throw n[e]=s instanceof Error?s:void 0,s}return n[e]}else return}function oi(n,e){if(e){for(const[t,r]of Object.entries(e))if(r!==void 0){const i=n[t];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?n[t]=oi(i,r):n[t]=r}}return n}class Tg{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const At={fileSystemProvider:()=>new Tg},_g={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Rg={AstReflection:()=>new Ml};function Eg(){const n=pe(Et(At),Rg),e=pe(Rt({shared:n}),_g);return n.ServiceRegistry.register(e),e}function sn(n){var e;const t=Eg(),r=t.serializer.JsonSerializer.deserialize(n);return t.shared.workspace.LangiumDocumentFactory.fromModel(r,yt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var Ag=Object.defineProperty,A=(n,e)=>Ag(n,"name",{value:e,configurable:!0}),dl="Statement",$r="Architecture";function bg(n){return De.isInstance(n,$r)}A(bg,"isArchitecture");var _r="Axis",Bn="Branch";function kg(n){return De.isInstance(n,Bn)}A(kg,"isBranch");var Rr="Checkout",Er="CherryPicking",Hn="Commit";function Ng(n){return De.isInstance(n,Hn)}A(Ng,"isCommit");var Or="Common";function Ig(n){return De.isInstance(n,Or)}A(Ig,"isCommon");var Hi="Curve",Vi="Edge",Wi="Entry",Vn="GitGraph";function Sg(n){return De.isInstance(n,Vn)}A(Sg,"isGitGraph");var Ki="Group",Lr="Info";function xg(n){return De.isInstance(n,Lr)}A(xg,"isInfo");var zi="Junction",Wn="Merge";function Cg(n){return De.isInstance(n,Wn)}A(Cg,"isMerge");var qi="Option",Mr="Packet";function wg(n){return De.isInstance(n,Mr)}A(wg,"isPacket");var Pr="PacketBlock";function $g(n){return De.isInstance(n,Pr)}A($g,"isPacketBlock");var Dr="Pie";function Og(n){return De.isInstance(n,Dr)}A(Og,"isPie");var jr="PieSection";function Lg(n){return De.isInstance(n,jr)}A(Lg,"isPieSection");var Xi="Radar",Yi="Service",Ar="Direction",$t,au=($t=class extends Nl{getAllTypes(){return[$r,_r,Bn,Rr,Er,Hn,Or,Hi,Ar,Vi,Wi,Vn,Ki,Lr,zi,Wn,qi,Mr,Pr,Dr,jr,Xi,Yi,dl]}computeIsSubtype(e,t){switch(e){case Bn:case Rr:case Er:case Hn:case Wn:return this.isSubtype(dl,t);case Ar:return this.isSubtype(Vn,t);default:return!1}}getReferenceType(e){const t=`${e.container.$type}:${e.property}`;switch(t){case"Entry:axis":return _r;default:throw new Error(`${t} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case $r:return{name:$r,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case _r:return{name:_r,properties:[{name:"label"},{name:"name"}]};case Bn:return{name:Bn,properties:[{name:"name"},{name:"order"}]};case Rr:return{name:Rr,properties:[{name:"branch"}]};case Er:return{name:Er,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case Hn:return{name:Hn,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case Or:return{name:Or,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case Hi:return{name:Hi,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case Vi:return{name:Vi,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case Wi:return{name:Wi,properties:[{name:"axis"},{name:"value"}]};case Vn:return{name:Vn,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case Ki:return{name:Ki,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Lr:return{name:Lr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case zi:return{name:zi,properties:[{name:"id"},{name:"in"}]};case Wn:return{name:Wn,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case qi:return{name:qi,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case Mr:return{name:Mr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case Pr:return{name:Pr,properties:[{name:"end"},{name:"label"},{name:"start"}]};case Dr:return{name:Dr,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case jr:return{name:jr,properties:[{name:"label"},{name:"value"}]};case Xi:return{name:Xi,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case Yi:return{name:Yi,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case Ar:return{name:Ar,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};default:return{name:e,properties:[]}}}},A($t,"MermaidAstReflection"),$t),De=new au,fl,Mg=A(()=>fl??(fl=sn('{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"InfoGrammar"),hl,Pg=A(()=>hl??(hl=sn(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"packet-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"?"},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),pl,Dg=A(()=>pl??(pl=sn('{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"+"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"PIE_SECTION_LABEL","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]+\\"/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"PIE_SECTION_VALUE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"PieGrammar"),ml,jg=A(()=>ml??(ml=sn('{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@15"},"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@13"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ID","definition":{"$type":"RegexToken","regex":"/[\\\\w]+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TEXT_ICON","definition":{"$type":"RegexToken","regex":"/\\\\(\\"[^\\"]+\\"\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"types":[],"usedGrammars":[]}')),"ArchitectureGrammar"),gl,Gg=A(()=>gl??(gl=sn(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"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@12"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"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@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+(?=\\\\s)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),yl,Ug=A(()=>yl??(yl=sn(`{"$type":"Grammar","isDeclared":true,"name":"Radar","interfaces":[{"$type":"Interface","name":"Common","attributes":[{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@12"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"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@2"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@12"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@19"},"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@18"},"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@18"},"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@18"},"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@20"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/(0|[1-9][0-9]*)(\\\\.[0-9]+)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9\\\\-_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[]}`)),"RadarGrammar"),Fg={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Bg={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Hg={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Vg={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Wg={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},Kg={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},an={AstReflection:A(()=>new au,"AstReflection")},zg={Grammar:A(()=>Mg(),"Grammar"),LanguageMetaData:A(()=>Fg,"LanguageMetaData"),parser:{}},qg={Grammar:A(()=>Pg(),"Grammar"),LanguageMetaData:A(()=>Bg,"LanguageMetaData"),parser:{}},Xg={Grammar:A(()=>Dg(),"Grammar"),LanguageMetaData:A(()=>Hg,"LanguageMetaData"),parser:{}},Yg={Grammar:A(()=>jg(),"Grammar"),LanguageMetaData:A(()=>Vg,"LanguageMetaData"),parser:{}},Jg={Grammar:A(()=>Gg(),"Grammar"),LanguageMetaData:A(()=>Wg,"LanguageMetaData"),parser:{}},Qg={Grammar:A(()=>Ug(),"Grammar"),LanguageMetaData:A(()=>Kg,"LanguageMetaData"),parser:{}},Zg=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,ey=/accTitle[\t ]*:([^\n\r]*)/,ty=/title([\t ][^\n\r]*|)/,ny={ACC_DESCR:Zg,ACC_TITLE:ey,TITLE:ty},Ot,aa=(Ot=class extends Kc{runConverter(e,t,r){let i=this.runCommonConverter(e,t,r);return i===void 0&&(i=this.runCustomConverter(e,t,r)),i===void 0?super.runConverter(e,t,r):i}runCommonConverter(e,t,r){const i=ny[e.name];if(i===void 0)return;const s=i.exec(t);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,`
|
126
|
+
`)}}},A(Ot,"AbstractMermaidValueConverter"),Ot),Lt,Ei=(Lt=class extends aa{runCustomConverter(e,t,r){}},A(Lt,"CommonValueConverter"),Lt),Mt,bt=(Mt=class extends Wc{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,t,r){const i=super.buildKeywordTokens(e,t,r);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},A(Mt,"AbstractMermaidTokenBuilder"),Mt),Pt;Pt=class extends bt{},A(Pt,"CommonTokenBuilder");var Dt,ry=(Dt=class extends bt{constructor(){super(["gitGraph"])}},A(Dt,"GitGraphTokenBuilder"),Dt),ou={parser:{TokenBuilder:A(()=>new ry,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function lu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),Jg,ou);return e.ServiceRegistry.register(t),{shared:e,GitGraph:t}}A(lu,"createGitGraphServices");var jt,iy=(jt=class extends bt{constructor(){super(["info","showInfo"])}},A(jt,"InfoTokenBuilder"),jt),cu={parser:{TokenBuilder:A(()=>new iy,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function uu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),zg,cu);return e.ServiceRegistry.register(t),{shared:e,Info:t}}A(uu,"createInfoServices");var Gt,sy=(Gt=class extends bt{constructor(){super(["packet-beta"])}},A(Gt,"PacketTokenBuilder"),Gt),du={parser:{TokenBuilder:A(()=>new sy,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function fu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),qg,du);return e.ServiceRegistry.register(t),{shared:e,Packet:t}}A(fu,"createPacketServices");var Ut,ay=(Ut=class extends bt{constructor(){super(["pie","showData"])}},A(Ut,"PieTokenBuilder"),Ut),Ft,oy=(Ft=class extends aa{runCustomConverter(e,t,r){if(e.name==="PIE_SECTION_LABEL")return t.replace(/"/g,"").trim()}},A(Ft,"PieValueConverter"),Ft),hu={parser:{TokenBuilder:A(()=>new ay,"TokenBuilder"),ValueConverter:A(()=>new oy,"ValueConverter")}};function pu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),Xg,hu);return e.ServiceRegistry.register(t),{shared:e,Pie:t}}A(pu,"createPieServices");var Bt,ly=(Bt=class extends bt{constructor(){super(["architecture"])}},A(Bt,"ArchitectureTokenBuilder"),Bt),Ht,cy=(Ht=class extends aa{runCustomConverter(e,t,r){if(e.name==="ARCH_ICON")return t.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return t.replace(/["()]/g,"");if(e.name==="ARCH_TITLE")return t.replace(/[[\]]/g,"").trim()}},A(Ht,"ArchitectureValueConverter"),Ht),mu={parser:{TokenBuilder:A(()=>new ly,"TokenBuilder"),ValueConverter:A(()=>new cy,"ValueConverter")}};function gu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),Yg,mu);return e.ServiceRegistry.register(t),{shared:e,Architecture:t}}A(gu,"createArchitectureServices");var Vt,uy=(Vt=class extends bt{constructor(){super(["radar-beta"])}},A(Vt,"RadarTokenBuilder"),Vt),yu={parser:{TokenBuilder:A(()=>new uy,"TokenBuilder"),ValueConverter:A(()=>new Ei,"ValueConverter")}};function vu(n=At){const e=pe(Et(n),an),t=pe(Rt({shared:e}),Qg,yu);return e.ServiceRegistry.register(t),{shared:e,Radar:t}}A(vu,"createRadarServices");var Ze={},dy={info:A(async()=>{const{createInfoServices:n}=await Nt(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>py);return{createInfoServices:t}},void 0),e=n().Info.parser.LangiumParser;Ze.info=e},"info"),packet:A(async()=>{const{createPacketServices:n}=await Nt(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>my);return{createPacketServices:t}},void 0),e=n().Packet.parser.LangiumParser;Ze.packet=e},"packet"),pie:A(async()=>{const{createPieServices:n}=await Nt(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>gy);return{createPieServices:t}},void 0),e=n().Pie.parser.LangiumParser;Ze.pie=e},"pie"),architecture:A(async()=>{const{createArchitectureServices:n}=await Nt(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>yy);return{createArchitectureServices:t}},void 0),e=n().Architecture.parser.LangiumParser;Ze.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:n}=await Nt(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>vy);return{createGitGraphServices:t}},void 0),e=n().GitGraph.parser.LangiumParser;Ze.gitGraph=e},"gitGraph"),radar:A(async()=>{const{createRadarServices:n}=await Nt(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>Ty);return{createRadarServices:t}},void 0),e=n().Radar.parser.LangiumParser;Ze.radar=e},"radar")};async function fy(n,e){const t=dy[n];if(!t)throw new Error(`Unknown diagram type: ${n}`);Ze[n]||await t();const i=Ze[n].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new hy(i);return i.value}A(fy,"parse");var Wt,hy=(Wt=class extends Error{constructor(e){const t=e.lexerErrors.map(i=>i.message).join(`
|
127
127
|
`),r=e.parserErrors.map(i=>i.message).join(`
|
128
128
|
`);super(`Parsing failed: ${t} ${r}`),this.result=e}},A(Wt,"MermaidParseError"),Wt);const py=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:cu,createInfoServices:uu},Symbol.toStringTag,{value:"Module"})),my=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:du,createPacketServices:fu},Symbol.toStringTag,{value:"Module"})),gy=Object.freeze(Object.defineProperty({__proto__:null,PieModule:hu,createPieServices:pu},Symbol.toStringTag,{value:"Module"})),yy=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:mu,createArchitectureServices:gu},Symbol.toStringTag,{value:"Module"})),vy=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:ou,createGitGraphServices:lu},Symbol.toStringTag,{value:"Module"})),Ty=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:yu,createRadarServices:vu},Symbol.toStringTag,{value:"Module"}));export{fy as p};
|