markview-vue 0.1.11 → 0.1.13
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/assets/_basePickBy-CHITUj4p.cjs +1 -0
- package/dist/assets/_basePickBy-ybeSkJfi.js +151 -0
- package/dist/assets/_baseUniq-BGLq8QRh.cjs +1 -0
- package/dist/assets/_baseUniq-xGqTUv6g.js +614 -0
- package/dist/assets/arc-Ba_uALHe.cjs +1 -0
- package/dist/assets/arc-CbsfC7zA.js +83 -0
- package/dist/assets/architecture-7HQA4BMR-B6phKgs-.js +6 -0
- package/dist/assets/architecture-7HQA4BMR-BdQzdD9-.cjs +1 -0
- package/dist/assets/architectureDiagram-VXUJARFQ-CIAXg-eb.js +4669 -0
- package/dist/assets/architectureDiagram-VXUJARFQ-DDSvQNjx.cjs +36 -0
- package/dist/assets/blockDiagram-VD42YOAC-CWR8l5l2.cjs +122 -0
- package/dist/assets/blockDiagram-VD42YOAC-wQlEggOh.js +2265 -0
- package/dist/assets/c4Diagram-YG6GDRKO-CrrMmY-D.cjs +10 -0
- package/dist/assets/c4Diagram-YG6GDRKO-FBfLZqNW.js +1581 -0
- package/dist/assets/channel-BRGQuuVl.js +5 -0
- package/dist/assets/channel-CZ4XWtuo.cjs +1 -0
- package/dist/assets/chunk-4BX2VUAB-BMbuSe4x.js +9 -0
- package/dist/assets/chunk-4BX2VUAB-FPWk2Aj8.cjs +1 -0
- package/dist/assets/chunk-55IACEB6-Cjgh_--n.cjs +1 -0
- package/dist/assets/chunk-55IACEB6-DiVv8R-7.js +8 -0
- package/dist/assets/chunk-B4BG7PRW-B_CFJmuC.cjs +165 -0
- package/dist/assets/chunk-B4BG7PRW-CObtScCP.js +1376 -0
- package/dist/assets/chunk-DI55MBZ5-BFm-KDUn.js +1382 -0
- package/dist/assets/chunk-DI55MBZ5-BZpMjriS.cjs +220 -0
- package/dist/assets/chunk-FMBD7UC4-Bo7IX0Tg.js +19 -0
- package/dist/assets/chunk-FMBD7UC4-Cd9Z8061.cjs +15 -0
- package/dist/assets/chunk-QN33PNHL-CaS89Uk_.js +20 -0
- package/dist/assets/chunk-QN33PNHL-KOmxd_kK.cjs +1 -0
- package/dist/assets/chunk-QZHKN3VN-Czbci--E.js +15 -0
- package/dist/assets/chunk-QZHKN3VN-D0_TUemW.cjs +1 -0
- package/dist/assets/chunk-TZMSLE5B-DPTrW-NE.js +64 -0
- package/dist/assets/chunk-TZMSLE5B-tWWaxsin.cjs +1 -0
- package/dist/assets/classDiagram-2ON5EDUG-BwYE0avN.js +16 -0
- package/dist/assets/classDiagram-2ON5EDUG-D6CGN0lK.cjs +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-BwYE0avN.js +16 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-D6CGN0lK.cjs +1 -0
- package/dist/assets/clone-BfRhdNm4.cjs +1 -0
- package/dist/assets/clone-CIEijpnt.js +8 -0
- package/dist/assets/cose-bilkent-S5V4N54A-CGYbjcpr.cjs +1 -0
- package/dist/assets/cose-bilkent-S5V4N54A-D8qsMnvS.js +2609 -0
- package/dist/assets/cytoscape.esm-CjI2IsL8.js +18735 -0
- package/dist/assets/cytoscape.esm-o9WRfNPd.cjs +331 -0
- package/dist/assets/dagre-6UL2VRFP-BzWnLxya.cjs +4 -0
- package/dist/assets/dagre-6UL2VRFP-C4Q40rgn.js +447 -0
- package/dist/assets/defaultLocale-BgPVtth8.js +171 -0
- package/dist/assets/defaultLocale-C4wbwF1n.cjs +1 -0
- package/dist/assets/diagram-PSM6KHXK-Cb5u6c6h.js +533 -0
- package/dist/assets/diagram-PSM6KHXK-CwWgRjfE.cjs +24 -0
- package/dist/assets/diagram-QEK2KX5R-Bi2NJFR_.js +221 -0
- package/dist/assets/diagram-QEK2KX5R-CLiJ34Ww.cjs +43 -0
- package/dist/assets/diagram-S2PKOQOG-C3UiRU3w.js +143 -0
- package/dist/assets/diagram-S2PKOQOG-OPuGn1kE.cjs +24 -0
- package/dist/assets/erDiagram-Q2GNP2WA-DVhIup4P.js +842 -0
- package/dist/assets/erDiagram-Q2GNP2WA-mrezvRlN.cjs +60 -0
- package/dist/assets/flowDiagram-NV44I4VS-BI2afYbF.js +1627 -0
- package/dist/assets/flowDiagram-NV44I4VS-uldiRJtW.cjs +162 -0
- package/dist/assets/ganttDiagram-JELNMOA3-B8_pSkSq.js +2671 -0
- package/dist/assets/ganttDiagram-JELNMOA3-XTesuTLx.cjs +267 -0
- package/dist/assets/gitGraph-G5XIXVHT-C3nHpXwk.js +6 -0
- package/dist/assets/gitGraph-G5XIXVHT-DEcLAdEU.cjs +1 -0
- package/dist/assets/gitGraphDiagram-V2S2FVAM-CTOC3DiT.cjs +65 -0
- package/dist/assets/gitGraphDiagram-V2S2FVAM-Cnf8w3oC.js +712 -0
- package/dist/assets/graph-BuIO7SSf.js +247 -0
- package/dist/assets/graph-p9DI0XAm.cjs +1 -0
- package/dist/assets/index-C69mIz56.js +44761 -0
- package/dist/assets/index-C9QevtQd.cjs +547 -0
- package/dist/assets/info-VBDWY6EO-BsNozlXs.cjs +1 -0
- package/dist/assets/info-VBDWY6EO-C_OL8dwF.js +6 -0
- package/dist/assets/infoDiagram-HS3SLOUP-BiRaPpy-.cjs +2 -0
- package/dist/assets/infoDiagram-HS3SLOUP-DguMzWUX.js +24 -0
- package/dist/assets/init-CHZsXQcr.cjs +1 -0
- package/dist/assets/init-DjUOC4st.js +16 -0
- package/dist/assets/journeyDiagram-XKPGCS4Q-DrmZKsPZ.cjs +139 -0
- package/dist/assets/journeyDiagram-XKPGCS4Q-SAJGgxHv.js +834 -0
- package/dist/assets/kanban-definition-3W4ZIXB7-CACD_qKY.cjs +89 -0
- package/dist/assets/kanban-definition-3W4ZIXB7-Dqllh40x.js +721 -0
- package/dist/assets/layout-BfkZhPei.js +1335 -0
- package/dist/assets/layout-DJMp8xuD.cjs +1 -0
- package/dist/assets/linear-B9X-K1ie.js +259 -0
- package/dist/assets/linear-qhmmwiXh.cjs +1 -0
- package/dist/assets/mermaid-parser.core-9igjpGWA.js +17976 -0
- package/dist/assets/mermaid-parser.core-CdI_2l2U.cjs +160 -0
- package/dist/assets/mermaid.core-C0ptc8Ci.js +15357 -0
- package/dist/assets/mermaid.core-D53Nknii.cjs +255 -0
- package/dist/assets/mindmap-definition-VGOIOE7T-C5GlPlyz.cjs +68 -0
- package/dist/assets/mindmap-definition-VGOIOE7T-D9ynDOFV.js +787 -0
- package/dist/assets/ordinal-CagbB1m8.cjs +1 -0
- package/dist/assets/ordinal-DfAQgscy.js +61 -0
- package/dist/assets/packet-DYOGHKS2-1rlG7uoS.js +6 -0
- package/dist/assets/packet-DYOGHKS2-DZgqFf8l.cjs +1 -0
- package/dist/assets/pie-VRWISCQL-BuCxcsRA.cjs +1 -0
- package/dist/assets/pie-VRWISCQL-CSl0KPjm.js +6 -0
- package/dist/assets/pieDiagram-ADFJNKIX-DJy51I_a.cjs +30 -0
- package/dist/assets/pieDiagram-ADFJNKIX-beKcRjnx.js +161 -0
- package/dist/assets/quadrantDiagram-AYHSOK5B-CHvt8eYr.js +1024 -0
- package/dist/assets/quadrantDiagram-AYHSOK5B-DW0ytD6Y.cjs +7 -0
- package/dist/assets/radar-ZZBFDIW7-CTFB0BiB.cjs +1 -0
- package/dist/assets/radar-ZZBFDIW7-rwWCZwIk.js +6 -0
- package/dist/assets/requirementDiagram-UZGBJVZJ-BRAtpmw9.js +852 -0
- package/dist/assets/requirementDiagram-UZGBJVZJ-BaBtXpY5.cjs +64 -0
- package/dist/assets/sankeyDiagram-TZEHDZUN-CC-AD2xc.cjs +10 -0
- package/dist/assets/sankeyDiagram-TZEHDZUN-jQduv77E.js +810 -0
- package/dist/assets/sequenceDiagram-WL72ISMW-CMJL0tZT.cjs +145 -0
- package/dist/assets/sequenceDiagram-WL72ISMW-DeVW1A54.js +2518 -0
- package/dist/assets/stateDiagram-FKZM4ZOC-BlHSDL2f.js +263 -0
- package/dist/assets/stateDiagram-FKZM4ZOC-D8dN0qMe.cjs +1 -0
- package/dist/assets/stateDiagram-v2-4FDKWEC3-B5KcJcLk.cjs +1 -0
- package/dist/assets/stateDiagram-v2-4FDKWEC3-D6MOxCaK.js +16 -0
- package/dist/assets/timeline-definition-IT6M3QCI-CQQMX29d.js +799 -0
- package/dist/assets/timeline-definition-IT6M3QCI-DPNrBMbj.cjs +61 -0
- package/dist/assets/treemap-GDKQZRPO-BRkjlMcy.js +6 -0
- package/dist/assets/treemap-GDKQZRPO-DXgt6YFC.cjs +1 -0
- package/dist/assets/xychartDiagram-PRI3JC2R-BymhHCL4.cjs +7 -0
- package/dist/assets/xychartDiagram-PRI3JC2R-ZD4dLllP.js +1340 -0
- package/dist/index.cjs +1 -537
- package/dist/index.d.ts +58 -32
- package/dist/index.js +68 -44479
- package/dist/style.css +1 -1
- package/package.json +15 -12
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";var hh=Object.defineProperty;var ph=(t,e,n)=>e in t?hh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var en=(t,e,n)=>ph(t,typeof e!="symbol"?e+"":e,n);const F=require("./mermaid.core-D53Nknii.cjs"),E=require("./_baseUniq-BGLq8QRh.cjs"),A=require("./_basePickBy-CHITUj4p.cjs"),qe=require("./clone-BfRhdNm4.cjs"),mh=require("./index-C9QevtQd.cjs");var gh=Object.prototype,yh=gh.hasOwnProperty,ct=F.createAssigner(function(t,e){if(F.isPrototype(e)||F.isArrayLike(e)){F.copyObject(e,E.keys(e),t);return}for(var n in e)yh.call(e,n)&&F.assignValue(t,n,e[n])});function dd(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function zi(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}function Th(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(r,a,n(a),t)}return r}function Rh(t,e,n,r){return E.baseEach(t,function(i,s,a){e(r,i,n(i),a)}),r}function vh(t,e){return function(n,r){var i=F.isArray(n)?Th:Rh,s=e?e():{};return i(n,t,E.baseIteratee(r),s)}}var Eh=200;function Ah(t,e,n,r){var i=-1,s=E.arrayIncludes,a=!0,o=t.length,c=[],l=e.length;if(!o)return c;e.length>=Eh&&(s=E.cacheHas,a=!1,e=new E.SetCache(e));e:for(;++i<o;){var u=t[i],f=u;if(u=u!==0?u:0,a&&f===f){for(var g=l;g--;)if(e[g]===f)continue e;c.push(u)}else s(e,f,r)||c.push(u)}return c}var ga=F.baseRest(function(t,e){return F.isArrayLikeObject(t)?Ah(t,E.baseFlatten(e,1,F.isArrayLikeObject,!0)):[]});function Me(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:A.toInteger(e),dd(t,e<0?0:e,r)):[]}function _i(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:A.toInteger(e),e=r-e,dd(t,0,e<0?0:e)):[]}function Sh(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function kh(t,e){var n=!0;return E.baseEach(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function yt(t,e,n){var r=F.isArray(t)?Sh:kh;return r(t,E.baseIteratee(e))}function Rt(t){return t&&t.length?t[0]:void 0}function ot(t,e){return E.baseFlatten(A.map(t,e))}var Ch=Object.prototype,Nh=Ch.hasOwnProperty,wh=vh(function(t,e,n){Nh.call(t,n)?t[n].push(e):F.baseAssignValue(t,n,[e])}),bh="[object String]";function Ze(t){return typeof t=="string"||!F.isArray(t)&&F.isObjectLike(t)&&F.baseGetTag(t)==bh}var Ih=Math.max;function Xe(t,e,n,r){t=F.isArrayLike(t)?t:E.values(t),n=n?A.toInteger(n):0;var i=t.length;return n<0&&(n=Ih(i+n,0)),Ze(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&E.baseIndexOf(t,e,n)>-1}function fl(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return E.baseIndexOf(t,e,i)}var _h="[object RegExp]";function Ph(t){return F.isObjectLike(t)&&F.baseGetTag(t)==_h}var hl=F.nodeUtil&&F.nodeUtil.isRegExp,Ht=hl?F.baseUnary(hl):Ph,$h="Expected a function";function Lh(t){if(typeof t!="function")throw new TypeError($h);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function vt(t,e){if(t==null)return{};var n=E.arrayMap(E.getAllKeysIn(t),function(r){return[r]});return e=E.baseIteratee(e),A.basePickBy(t,n,function(r,i){return e(r,i[0])})}function ya(t,e){var n=F.isArray(t)?E.arrayFilter:E.baseFilter;return n(t,Lh(E.baseIteratee(e)))}function Oh(t,e){var n;return E.baseEach(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function fd(t,e,n){var r=F.isArray(t)?E.arraySome:Oh;return r(t,E.baseIteratee(e))}function jc(t){return t&&t.length?E.baseUniq(t):[]}function xh(t,e){return t&&t.length?E.baseUniq(t,E.baseIteratee(e)):[]}function je(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function gt(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"ref"in t}function nn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"&&"items"in t}function Dh(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Zr(t){return typeof t=="object"&&t!==null&&typeof t.info=="object"&&typeof t.message=="string"}class hd{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(e){var i;const n=this.types[e.container.$type];if(!n)throw new Error(`Type ${e.container.$type||"undefined"} not found.`);const r=(i=n.properties[e.property])==null?void 0:i.referenceType;if(!r)throw new Error(`Property ${e.property||"undefined"} of type ${e.container.$type} is not a reference.`);return r}getTypeMetaData(e){const n=this.types[e];return n||{name:e,properties:{},superTypes:[]}}isInstance(e,n){return je(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.types[e],a=s?s.superTypes.some(o=>this.isSubtype(o,n)):!1;return r[n]=a,a}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Pi(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function pd(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function md(t){return Pi(t)&&typeof t.fullText=="string"}class Fe{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Fe(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return st})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=Mh(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Fe(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?st:{done:!1,value:e(i)}})}filter(e){return new Fe(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return st})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Fe(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Ks(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return st})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Fe(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Ks(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return st})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Fe(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new Fe(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?st:this.nextFn(n.state)))}distinct(e){return new Fe(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return st})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function Mh(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Ks(t){return!!t&&typeof t[Symbol.iterator]=="function"}const gd=new Fe(()=>{},()=>st),st=Object.freeze({done:!0,value:void 0});function me(...t){if(t.length===1){const e=t[0];if(e instanceof Fe)return e;if(Ks(e))return new Fe(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Fe(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:st)}return t.length>1?new Fe(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];Ks(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return st}):gd}class zc extends Fe{constructor(e,n,r){super(()=>({iterators:r!=null&&r.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return st})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var io;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(io||(io={}));function so(t,e={}){for(const[n,r]of Object.entries(t))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,s)=>{je(i)&&(i.$container=t,i.$containerProperty=n,i.$containerIndex=s,e.deep&&so(i,e))}):je(r)&&(r.$container=t,r.$containerProperty=n,e.deep&&so(r,e)))}function Ta(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Wt(t){const n=$s(t).$document;if(!n)throw new Error("AST node has no document.");return n}function $s(t){for(;t.$container;)t=t.$container;return t}function pl(t){return gt(t)?t.ref?[t.ref]:[]:nn(t)?t.items.map(e=>e.ref):[]}function Bc(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e==null?void 0:e.range;return new Fe(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(je(s)){if(r.keyIndex++,ml(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if(je(o)&&ml(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return st})}function Bi(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new zc(t,n=>Bc(n,e))}function Vt(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new zc(t,n=>Bc(n,e),{includeRoot:!0})}function ml(t,e){var r;if(!e)return!0;const n=(r=t.$cstNode)==null?void 0:r.range;return n?ap(n,e):!1}function Hs(t){return new Fe(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(gt(r)||nn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(gt(s)||nn(r))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return st})}function Fh(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=yd(i.defaultValue))}function yd(t){return Array.isArray(t)?[...t.map(yd)]:t}const it={$type:"AbstractElement",cardinality:"cardinality"};function Gh(t){return ee.isInstance(t,it.$type)}const Ls={$type:"AbstractParserRule"};function Wi(t){return ee.isInstance(t,Ls.$type)}const ys={$type:"AbstractRule"},pt={$type:"AbstractType"},Nn={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function Ra(t){return ee.isInstance(t,Nn.$type)}const Os={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Td(t){return ee.isInstance(t,Os.$type)}const gl={$type:"ArrayLiteral",elements:"elements"},yl={$type:"ArrayType",elementType:"elementType"},wn={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function On(t){return ee.isInstance(t,wn.$type)}const ao={$type:"BooleanLiteral",true:"true"};function Uh(t){return ee.isInstance(t,ao.$type)}const bn={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function qh(t){return ee.isInstance(t,bn.$type)}const Vn={$type:"Condition"},xs={$type:"Conjunction",left:"left",right:"right"};function jh(t){return ee.isInstance(t,xs.$type)}const In={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function va(t){return ee.isInstance(t,In.$type)}const Ds={$type:"Disjunction",left:"left",right:"right"};function zh(t){return ee.isInstance(t,Ds.$type)}const oo={$type:"EndOfFile",cardinality:"cardinality"};function Bh(t){return ee.isInstance(t,oo.$type)}const pn={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"},Tl={$type:"GrammarImport",path:"path"},Qn={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Wc(t){return ee.isInstance(t,Qn.$type)}const co={$type:"InferredType",name:"name"};function Rd(t){return ee.isInstance(t,co.$type)}const Gt={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Ys(t){return ee.isInstance(t,Gt.$type)}const Oa={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"},Rl={$type:"InfixRuleOperators",precedences:"precedences"},vi={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function Wh(t){return ee.isInstance(t,vi.$type)}const Ei={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function xn(t){return ee.isInstance(t,Ei.$type)}const Ts={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"},Zn={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function Vh(t){return ee.isInstance(t,Zn.$type)}const lo={$type:"Negation",value:"value"};function Kh(t){return ee.isInstance(t,lo.$type)}const vl={$type:"NumberLiteral",value:"value"},Rs={$type:"Parameter",name:"name"},uo={$type:"ParameterReference",parameter:"parameter"};function Hh(t){return ee.isInstance(t,uo.$type)}const kt={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function Xt(t){return ee.isInstance(t,kt.$type)}const xa={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"},er={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function Yh(t){return ee.isInstance(t,er.$type)}const fo={$type:"ReturnType",name:"name"};function Xh(t){return ee.isInstance(t,fo.$type)}const tr={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function Dn(t){return ee.isInstance(t,tr.$type)}const Ai={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Jh(t){return ee.isInstance(t,Ai.$type)}const El={$type:"StringLiteral",value:"value"},nr={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Qh(t){return ee.isInstance(t,nr.$type)}const dt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"},rr={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function Zh(t){return ee.isInstance(t,rr.$type)}const tn={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function Jt(t){return ee.isInstance(t,tn.$type)}const ir={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function ep(t){return ee.isInstance(t,ir.$type)}const Ms={$type:"Type",name:"name",type:"type"};function tp(t){return ee.isInstance(t,Ms.$type)}const ei={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"},ti={$type:"TypeDefinition"},Al={$type:"UnionType",types:"types"},Fs={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function vd(t){return ee.isInstance(t,Fs.$type)}const sr={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function np(t){return ee.isInstance(t,sr.$type)}const ni={$type:"ValueLiteral"},Si={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function rp(t){return ee.isInstance(t,Si.$type)}class Ed extends hd{constructor(){super(...arguments),this.types={AbstractElement:{name:it.$type,properties:{cardinality:{name:it.cardinality}},superTypes:[]},AbstractParserRule:{name:Ls.$type,properties:{},superTypes:[ys.$type,pt.$type]},AbstractRule:{name:ys.$type,properties:{},superTypes:[]},AbstractType:{name:pt.$type,properties:{},superTypes:[]},Action:{name:Nn.$type,properties:{cardinality:{name:Nn.cardinality},feature:{name:Nn.feature},inferredType:{name:Nn.inferredType},operator:{name:Nn.operator},type:{name:Nn.type,referenceType:pt.$type}},superTypes:[it.$type]},Alternatives:{name:Os.$type,properties:{cardinality:{name:Os.cardinality},elements:{name:Os.elements,defaultValue:[]}},superTypes:[it.$type]},ArrayLiteral:{name:gl.$type,properties:{elements:{name:gl.elements,defaultValue:[]}},superTypes:[ni.$type]},ArrayType:{name:yl.$type,properties:{elementType:{name:yl.elementType}},superTypes:[ti.$type]},Assignment:{name:wn.$type,properties:{cardinality:{name:wn.cardinality},feature:{name:wn.feature},operator:{name:wn.operator},predicate:{name:wn.predicate},terminal:{name:wn.terminal}},superTypes:[it.$type]},BooleanLiteral:{name:ao.$type,properties:{true:{name:ao.true,defaultValue:!1}},superTypes:[Vn.$type,ni.$type]},CharacterRange:{name:bn.$type,properties:{cardinality:{name:bn.cardinality},left:{name:bn.left},lookahead:{name:bn.lookahead},parenthesized:{name:bn.parenthesized,defaultValue:!1},right:{name:bn.right}},superTypes:[dt.$type]},Condition:{name:Vn.$type,properties:{},superTypes:[]},Conjunction:{name:xs.$type,properties:{left:{name:xs.left},right:{name:xs.right}},superTypes:[Vn.$type]},CrossReference:{name:In.$type,properties:{cardinality:{name:In.cardinality},deprecatedSyntax:{name:In.deprecatedSyntax,defaultValue:!1},isMulti:{name:In.isMulti,defaultValue:!1},terminal:{name:In.terminal},type:{name:In.type,referenceType:pt.$type}},superTypes:[it.$type]},Disjunction:{name:Ds.$type,properties:{left:{name:Ds.left},right:{name:Ds.right}},superTypes:[Vn.$type]},EndOfFile:{name:oo.$type,properties:{cardinality:{name:oo.cardinality}},superTypes:[it.$type]},Grammar:{name:pn.$type,properties:{imports:{name:pn.imports,defaultValue:[]},interfaces:{name:pn.interfaces,defaultValue:[]},isDeclared:{name:pn.isDeclared,defaultValue:!1},name:{name:pn.name},rules:{name:pn.rules,defaultValue:[]},types:{name:pn.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Tl.$type,properties:{path:{name:Tl.path}},superTypes:[]},Group:{name:Qn.$type,properties:{cardinality:{name:Qn.cardinality},elements:{name:Qn.elements,defaultValue:[]},guardCondition:{name:Qn.guardCondition},predicate:{name:Qn.predicate}},superTypes:[it.$type]},InferredType:{name:co.$type,properties:{name:{name:co.name}},superTypes:[pt.$type]},InfixRule:{name:Gt.$type,properties:{call:{name:Gt.call},dataType:{name:Gt.dataType},inferredType:{name:Gt.inferredType},name:{name:Gt.name},operators:{name:Gt.operators},parameters:{name:Gt.parameters,defaultValue:[]},returnType:{name:Gt.returnType,referenceType:pt.$type}},superTypes:[Ls.$type]},InfixRuleOperatorList:{name:Oa.$type,properties:{associativity:{name:Oa.associativity},operators:{name:Oa.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:Rl.$type,properties:{precedences:{name:Rl.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:vi.$type,properties:{attributes:{name:vi.attributes,defaultValue:[]},name:{name:vi.name},superTypes:{name:vi.superTypes,defaultValue:[],referenceType:pt.$type}},superTypes:[pt.$type]},Keyword:{name:Ei.$type,properties:{cardinality:{name:Ei.cardinality},predicate:{name:Ei.predicate},value:{name:Ei.value}},superTypes:[it.$type]},NamedArgument:{name:Ts.$type,properties:{calledByName:{name:Ts.calledByName,defaultValue:!1},parameter:{name:Ts.parameter,referenceType:Rs.$type},value:{name:Ts.value}},superTypes:[]},NegatedToken:{name:Zn.$type,properties:{cardinality:{name:Zn.cardinality},lookahead:{name:Zn.lookahead},parenthesized:{name:Zn.parenthesized,defaultValue:!1},terminal:{name:Zn.terminal}},superTypes:[dt.$type]},Negation:{name:lo.$type,properties:{value:{name:lo.value}},superTypes:[Vn.$type]},NumberLiteral:{name:vl.$type,properties:{value:{name:vl.value}},superTypes:[ni.$type]},Parameter:{name:Rs.$type,properties:{name:{name:Rs.name}},superTypes:[]},ParameterReference:{name:uo.$type,properties:{parameter:{name:uo.parameter,referenceType:Rs.$type}},superTypes:[Vn.$type]},ParserRule:{name:kt.$type,properties:{dataType:{name:kt.dataType},definition:{name:kt.definition},entry:{name:kt.entry,defaultValue:!1},fragment:{name:kt.fragment,defaultValue:!1},inferredType:{name:kt.inferredType},name:{name:kt.name},parameters:{name:kt.parameters,defaultValue:[]},returnType:{name:kt.returnType,referenceType:pt.$type}},superTypes:[Ls.$type]},ReferenceType:{name:xa.$type,properties:{isMulti:{name:xa.isMulti,defaultValue:!1},referenceType:{name:xa.referenceType}},superTypes:[ti.$type]},RegexToken:{name:er.$type,properties:{cardinality:{name:er.cardinality},lookahead:{name:er.lookahead},parenthesized:{name:er.parenthesized,defaultValue:!1},regex:{name:er.regex}},superTypes:[dt.$type]},ReturnType:{name:fo.$type,properties:{name:{name:fo.name}},superTypes:[]},RuleCall:{name:tr.$type,properties:{arguments:{name:tr.arguments,defaultValue:[]},cardinality:{name:tr.cardinality},predicate:{name:tr.predicate},rule:{name:tr.rule,referenceType:ys.$type}},superTypes:[it.$type]},SimpleType:{name:Ai.$type,properties:{primitiveType:{name:Ai.primitiveType},stringType:{name:Ai.stringType},typeRef:{name:Ai.typeRef,referenceType:pt.$type}},superTypes:[ti.$type]},StringLiteral:{name:El.$type,properties:{value:{name:El.value}},superTypes:[ni.$type]},TerminalAlternatives:{name:nr.$type,properties:{cardinality:{name:nr.cardinality},elements:{name:nr.elements,defaultValue:[]},lookahead:{name:nr.lookahead},parenthesized:{name:nr.parenthesized,defaultValue:!1}},superTypes:[dt.$type]},TerminalElement:{name:dt.$type,properties:{cardinality:{name:dt.cardinality},lookahead:{name:dt.lookahead},parenthesized:{name:dt.parenthesized,defaultValue:!1}},superTypes:[it.$type]},TerminalGroup:{name:rr.$type,properties:{cardinality:{name:rr.cardinality},elements:{name:rr.elements,defaultValue:[]},lookahead:{name:rr.lookahead},parenthesized:{name:rr.parenthesized,defaultValue:!1}},superTypes:[dt.$type]},TerminalRule:{name:tn.$type,properties:{definition:{name:tn.definition},fragment:{name:tn.fragment,defaultValue:!1},hidden:{name:tn.hidden,defaultValue:!1},name:{name:tn.name},type:{name:tn.type}},superTypes:[ys.$type]},TerminalRuleCall:{name:ir.$type,properties:{cardinality:{name:ir.cardinality},lookahead:{name:ir.lookahead},parenthesized:{name:ir.parenthesized,defaultValue:!1},rule:{name:ir.rule,referenceType:tn.$type}},superTypes:[dt.$type]},Type:{name:Ms.$type,properties:{name:{name:Ms.name},type:{name:Ms.type}},superTypes:[pt.$type]},TypeAttribute:{name:ei.$type,properties:{defaultValue:{name:ei.defaultValue},isOptional:{name:ei.isOptional,defaultValue:!1},name:{name:ei.name},type:{name:ei.type}},superTypes:[]},TypeDefinition:{name:ti.$type,properties:{},superTypes:[]},UnionType:{name:Al.$type,properties:{types:{name:Al.types,defaultValue:[]}},superTypes:[ti.$type]},UnorderedGroup:{name:Fs.$type,properties:{cardinality:{name:Fs.cardinality},elements:{name:Fs.elements,defaultValue:[]}},superTypes:[it.$type]},UntilToken:{name:sr.$type,properties:{cardinality:{name:sr.cardinality},lookahead:{name:sr.lookahead},parenthesized:{name:sr.parenthesized,defaultValue:!1},terminal:{name:sr.terminal}},superTypes:[dt.$type]},ValueLiteral:{name:ni.$type,properties:{},superTypes:[]},Wildcard:{name:Si.$type,properties:{cardinality:{name:Si.cardinality},lookahead:{name:Si.lookahead},parenthesized:{name:Si.parenthesized,defaultValue:!1}},superTypes:[dt.$type]}}}}const ee=new Ed;function ho(t){return new zc(t,e=>Pi(e)?e.content:[],{includeRoot:!0})}function ip(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function po(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Xs(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var zt;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(zt||(zt={}));function sp(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return zt.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return zt.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?zt.Inside:n?zt.OverlapBack:r?zt.OverlapFront:zt.Outside}function ap(t,e){return sp(t,e)>zt.After}const op=/^[\w\p{L}]$/u;function cp(t,e){if(t){const n=lp(t,!0);if(n&&Sl(n,e))return n;if(md(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(Sl(s,e))return s}}}}function Sl(t,e){return pd(t)&&e.includes(t.tokenType.name)}function lp(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}class Ad extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Vi(t,e="Error: Got unexpected value."){throw new Error(e)}function z(t){return t.charCodeAt(0)}function Da(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function ri(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Kn(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function up(){throw Error("Internal Error - Should never get here!")}function kl(t){return t.type==="Character"}const Js=[];for(let t=z("0");t<=z("9");t++)Js.push(t);const Qs=[z("_")].concat(Js);for(let t=z("a");t<=z("z");t++)Qs.push(t);for(let t=z("A");t<=z("Z");t++)Qs.push(t);const Cl=[z(" "),z("\f"),z(`
|
|
2
|
+
`),z("\r"),z(" "),z("\v"),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z(" "),z("\u2028"),z("\u2029"),z(" "),z(" "),z(" "),z("\uFEFF")],dp=/[0-9a-fA-F]/,vs=/[0-9]/,fp=/[1-9]/;class Sd{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":ri(r,"global");break;case"i":ri(r,"ignoreCase");break;case"m":ri(r,"multiLine");break;case"u":ri(r,"unicode");break;case"y":ri(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}Kn(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return up()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;Kn(n);break}if(!(e===!0&&n===void 0)&&Kn(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Kn(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[z(`
|
|
3
|
+
`),z("\r"),z("\u2028"),z("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=Js;break;case"D":e=Js,n=!0;break;case"s":e=Cl;break;case"S":e=Cl,n=!0;break;case"w":e=Qs;break;case"W":e=Qs,n=!0;break}if(Kn(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=z("\f");break;case"n":e=z(`
|
|
4
|
+
`);break;case"r":e=z("\r");break;case"t":e=z(" ");break;case"v":e=z("\v");break}if(Kn(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:z("\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:z(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:z(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,kl(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,kl(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else Da(r.value,e),e.push(z("-")),Da(i.value,e)}else Da(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:z("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(fp.test(e)===!1)throw Error("Expecting a positive integer");for(;vs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(vs.test(e)===!1)throw Error("Expecting an integer");for(;vs.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:z(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return vs.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(dp.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Ea{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Lookbehind":this.visitLookbehind(e);break;case"NegativeLookbehind":this.visitNegativeLookbehind(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const hp=/\r?\n/gm,pp=new Sd;class mp extends Ea{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
|
|
10
|
+
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Aa(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
|
|
11
|
+
`.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const Ma=new mp;function gp(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Ma.reset(t),Ma.visit(pp.pattern(t)),Ma.multiline}catch{return!1}}const yp=`\f
|
|
12
|
+
\r \v \u2028\u2029 \uFEFF`.split("");function kd(t){const e=typeof t=="string"?new RegExp(t):t;return yp.some(n=>e.test(n))}function Aa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Tp(t,e){const n=Rp(t),r=e.match(n);return!!r&&r[0].length>0}function Rp(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(l){s+=n.substr(r,l),r+=l}function c(l){s+="(?:"+n.substr(r,l)+"|$)",r+=l}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],c(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function vp(t){return t.rules.find(e=>Xt(e)&&e.entry)}function Ep(t){return t.rules.filter(e=>Jt(e)&&e.hidden)}function Cd(t,e){const n=new Set,r=vp(t);if(!r)return new Set(t.rules);const i=[r].concat(Ep(t));for(const a of i)Nd(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||Jt(a)&&a.hidden)&&s.add(a);return s}function Nd(t,e,n){e.add(t.name),Bi(t).forEach(r=>{if(Dn(r)||n){const i=r.rule.ref;i&&!e.has(i.name)&&Nd(i,e,n)}})}function Ap(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=bd(t.type.ref);return e==null?void 0:e.terminal}}function Sp(t){return t.hidden&&!kd(Kc(t))}function kp(t,e){return!t||!e?[]:Vc(t,e,t.astNode,!0)}function wd(t,e,n){if(!t||!e)return;const r=Vc(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Vc(t,e,n,r){if(!r){const i=Ta(t.grammarSource,On);if(i&&i.feature===e)return[t]}return Pi(t)&&t.astNode===n?t.content.flatMap(i=>Vc(i,e,n,!1)):[]}function Cp(t,e,n){if(!t)return;const r=Np(t,e,t==null?void 0:t.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Np(t,e,n){if(t.astNode!==n)return[];if(xn(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=ho(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?xn(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function wp(t){var n;const e=t.astNode;for(;e===((n=t.container)==null?void 0:n.astNode);){const r=Ta(t.grammarSource,On);if(r)return r;t=t.container}}function bd(t){let e=t;return Rd(e)&&(Ra(e.$container)?e=e.$container.$container:Wi(e.$container)?e=e.$container:Vi(e.$container)),Id(t,e,new Map)}function Id(t,e,n){var i;function r(s,a){let o;return Ta(s,On)||(o=Id(a,a,n)),n.set(t,o),o}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of Bi(e)){if(On(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Dn(s)&&Xt(s.rule.ref))return r(s,s.rule.ref);if(Jh(s)&&((i=s.typeRef)!=null&&i.ref))return r(s,s.typeRef.ref)}}function _d(t){return Pd(t,new Set)}function Pd(t,e){if(e.has(t))return!0;e.add(t);for(const n of Bi(t))if(Dn(n)){if(!n.rule.ref||Xt(n.rule.ref)&&!Pd(n.rule.ref,e)||Ys(n.rule.ref))return!1}else{if(On(n))return!1;if(Ra(n))return!1}return!!t.definition}function $d(t){if(!Jt(t)){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e)return e.name}}}function $i(t){if(Wi(t))return Xt(t)&&_d(t)?t.name:$d(t)??t.name;if(Wh(t)||tp(t)||Xh(t))return t.name;if(Ra(t)){const e=bp(t);if(e)return e}else if(Rd(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function bp(t){var e;if(t.inferredType)return t.inferredType.name;if((e=t.type)!=null&&e.ref)return $i(t.type.ref)}function Ip(t){var e;return Jt(t)?((e=t.type)==null?void 0:e.name)??"string":$d(t)??t.name}function Kc(t){const e={s:!1,i:!1,u:!1},n=Dr(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const Hc=/[\s\S]/.source;function Dr(t,e){var n;if(Qh(t))return _p(t);if(Zh(t))return Pp(t);if(qh(t))return Op(t);if(ep(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return Kt(Dr(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}else{if(Vh(t))return Lp(t);if(np(t))return $p(t);if(Yh(t)){const r=t.regex.lastIndexOf("/"),i=t.regex.substring(1,r),s=t.regex.substring(r+1);return e&&(e.i=s.includes("i"),e.s=s.includes("s"),e.u=s.includes("u")),Kt(i,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}else{if(rp(t))return Kt(Hc,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}, ${(n=t==null?void 0:t.$cstNode)==null?void 0:n.text}`)}}}function _p(t){return Kt(t.elements.map(e=>Dr(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Pp(t){return Kt(t.elements.map(e=>Dr(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function $p(t){return Kt(`${Hc}*?${Dr(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Lp(t){return Kt(`(?!${Dr(t.terminal)})${Hc}*?`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized})}function Op(t){return t.right?Kt(`[${Fa(t.left)}-${Fa(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1}):Kt(Fa(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,parenthesized:t.parenthesized,wrap:!1})}function Fa(t){return Aa(t.value)}function Kt(t,e){return(e.parenthesized||e.lookahead||e.wrap!==!1)&&(t=`(${e.lookahead??(e.parenthesized?"":"?:")}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function xp(t){const e=[],n=t.Grammar;for(const r of n.rules)Jt(r)&&Sp(r)&&gp(Kc(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:op}}function mo(t){console&&console.error&&console.error(`Error: ${t}`)}function Ld(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Od(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function xd(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function Dp(t){return Mp(t)?t.LABEL:t.name}function Mp(t){return Ze(t.LABEL)&&t.LABEL!==""}class bt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),E.forEach(this.definition,n=>{n.accept(e)})}}class He extends bt{constructor(e){super([]),this.idx=1,ct(this,vt(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Mr extends bt{constructor(e){super(e.definition),this.orgText="",ct(this,vt(e,n=>n!==void 0))}}class et extends bt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,ct(this,vt(e,n=>n!==void 0))}}let Ue=class extends bt{constructor(e){super(e.definition),this.idx=1,ct(this,vt(e,n=>n!==void 0))}};class lt extends bt{constructor(e){super(e.definition),this.idx=1,ct(this,vt(e,n=>n!==void 0))}}class ut extends bt{constructor(e){super(e.definition),this.idx=1,ct(this,vt(e,n=>n!==void 0))}}class Re extends bt{constructor(e){super(e.definition),this.idx=1,ct(this,vt(e,n=>n!==void 0))}}class tt extends bt{constructor(e){super(e.definition),this.idx=1,ct(this,vt(e,n=>n!==void 0))}}class nt extends bt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,ct(this,vt(e,n=>n!==void 0))}}class ue{constructor(e){this.idx=1,ct(this,vt(e,n=>n!==void 0))}accept(e){e.visit(this)}}function Fp(t){return A.map(t,Gs)}function Gs(t){function e(n){return A.map(n,Gs)}if(t instanceof He){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Ze(t.label)&&(n.label=t.label),n}else{if(t instanceof et)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ue)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof lt)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ut)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Gs(new ue({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof tt)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Gs(new ue({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Re)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof nt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ue){const n={type:"Terminal",name:t.terminalType.name,label:Dp(t.terminalType),idx:t.idx};Ze(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=Ht(r)?r.source:r),n}else{if(t instanceof Mr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Fr{visit(e){const n=e;switch(n.constructor){case He:return this.visitNonTerminal(n);case et:return this.visitAlternative(n);case Ue:return this.visitOption(n);case lt:return this.visitRepetitionMandatory(n);case ut:return this.visitRepetitionMandatoryWithSeparator(n);case tt:return this.visitRepetitionWithSeparator(n);case Re:return this.visitRepetition(n);case nt:return this.visitAlternation(n);case ue:return this.visitTerminal(n);case Mr:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Gp(t){return t instanceof et||t instanceof Ue||t instanceof Re||t instanceof lt||t instanceof ut||t instanceof tt||t instanceof ue||t instanceof Mr}function Zs(t,e=[]){return t instanceof Ue||t instanceof Re||t instanceof tt?!0:t instanceof nt?fd(t.definition,r=>Zs(r,e)):t instanceof He&&Xe(e,t)?!1:t instanceof bt?(t instanceof He&&e.push(t),yt(t.definition,r=>Zs(r,e))):!1}function Up(t){return t instanceof nt}function Ct(t){if(t instanceof He)return"SUBRULE";if(t instanceof Ue)return"OPTION";if(t instanceof nt)return"OR";if(t instanceof lt)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof tt)return"MANY_SEP";if(t instanceof Re)return"MANY";if(t instanceof ue)return"CONSUME";throw Error("non exhaustive match")}class Sa{walk(e,n=[]){E.forEach(e.definition,(r,i)=>{const s=Me(e.definition,i+1);if(r instanceof He)this.walkProdRef(r,s,n);else if(r instanceof ue)this.walkTerminal(r,s,n);else if(r instanceof et)this.walkFlat(r,s,n);else if(r instanceof Ue)this.walkOption(r,s,n);else if(r instanceof lt)this.walkAtLeastOne(r,s,n);else if(r instanceof ut)this.walkAtLeastOneSep(r,s,n);else if(r instanceof tt)this.walkManySep(r,s,n);else if(r instanceof Re)this.walkMany(r,s,n);else if(r instanceof nt)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Ue({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=Nl(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Ue({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=Nl(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);E.forEach(e.definition,s=>{const a=new et({definition:[s]});this.walk(a,i)})}}function Nl(t,e,n){return[new Ue({definition:[new ue({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Ki(t){if(t instanceof He)return Ki(t.referencedRule);if(t instanceof ue)return zp(t);if(Gp(t))return qp(t);if(Up(t))return jp(t);throw Error("non exhaustive match")}function qp(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=Zs(s),e=e.concat(Ki(s)),r=r+1,i=n.length>r;return jc(e)}function jp(t){const e=A.map(t.definition,n=>Ki(n));return jc(A.flatten(e))}function zp(t){return[t.terminalType]}const Dd="_~IN~_";class Bp extends Sa{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=Vp(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new et({definition:s}),o=Ki(a);this.follows[i]=o}}function Wp(t){const e={};return E.forEach(t,n=>{const r=new Bp(n).startWalking();ct(e,r)}),e}function Vp(t,e){return t.name+e+Dd}let Us={};const Kp=new Sd;function ka(t){const e=t.toString();if(Us.hasOwnProperty(e))return Us[e];{const n=Kp.pattern(e);return Us[e]=n,n}}function Hp(){Us={}}const Md="Complement Sets are not supported for first char optimization",ea=`Unable to use "first char" lexer optimizations:
|
|
13
|
+
`;function Yp(t,e=!1){try{const n=ka(t);return go(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===Md)e&&Ld(`${ea} Unable to optimize: < ${t.toString()} >
|
|
14
|
+
Complement Sets cannot be automatically optimized.
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
|
|
17
|
+
This will disable the lexer's first char optimizations.
|
|
18
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),mo(`${ea}
|
|
19
|
+
Failed parsing: < ${t.toString()} >
|
|
20
|
+
Using the @chevrotain/regexp-to-ast library
|
|
21
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function go(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)go(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":Es(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(Md);E.forEach(a.value,c=>{if(typeof c=="number")Es(c,e,n);else{const l=c;if(n===!0)for(let u=l.from;u<=l.to;u++)Es(u,e,n);else{for(let u=l.from;u<=l.to&&u<Ci;u++)Es(u,e,n);if(l.to>=Ci){const u=l.from>=Ci?l.from:Ci,f=l.to,g=rn(u),h=rn(f);for(let S=g;S<=h;S++)e[S]=S}}}});break;case"Group":go(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&yo(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return E.values(e)}function Es(t,e,n){const r=rn(t);e[r]=r,n===!0&&Xp(t,e)}function Xp(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=rn(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=rn(i.charCodeAt(0));e[s]=s}}}function wl(t,e){return A.find(t.value,n=>{if(typeof n=="number")return Xe(e,n);{const r=n;return A.find(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function yo(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?F.isArray(t.value)?yt(t.value,yo):yo(t.value):!1}class Jp extends Ea{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return;case"Lookbehind":this.visitLookbehind(e);return;case"NegativeLookbehind":this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){Xe(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?wl(e,this.targetCharCodes)===void 0&&(this.found=!0):wl(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Yc(t,e){if(e instanceof RegExp){const n=ka(e),r=new Jp(t);return r.visit(n),r.found}else return A.find(e,n=>Xe(t,n.charCodeAt(0)))!==void 0}const Mn="PATTERN",ki="defaultMode",As="modes";let Fd=typeof new RegExp("(?:)").sticky=="boolean";function Qp(t,e){e=A.defaults(e,{useSticky:Fd,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(b,w)=>w()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{Am()});let r;n("Reject Lexer.NA",()=>{r=ya(t,b=>b[Mn]===Qe.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=A.map(r,b=>{const w=b[Mn];if(Ht(w)){const x=w.source;return x.length===1&&x!=="^"&&x!=="$"&&x!=="."&&!w.ignoreCase?x:x.length===2&&x[0]==="\\"&&!Xe(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],x[1])?x[1]:e.useSticky?Il(w):bl(w)}else{if(F.isFunction(w))return i=!0,{exec:w};if(typeof w=="object")return i=!0,w;if(typeof w=="string"){if(w.length===1)return w;{const x=w.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),H=new RegExp(x);return e.useSticky?Il(H):bl(H)}}else throw Error("non exhaustive match")}})});let a,o,c,l,u;n("misc mapping",()=>{a=A.map(r,b=>b.tokenTypeIdx),o=A.map(r,b=>{const w=b.GROUP;if(w!==Qe.SKIPPED){if(Ze(w))return w;if(E.isUndefined(w))return!1;throw Error("non exhaustive match")}}),c=A.map(r,b=>{const w=b.LONGER_ALT;if(w)return F.isArray(w)?A.map(w,H=>fl(r,H)):[fl(r,w)]}),l=A.map(r,b=>b.PUSH_MODE),u=A.map(r,b=>A.has(b,"POP_MODE"))});let f;n("Line Terminator Handling",()=>{const b=qd(e.lineTerminatorCharacters);f=A.map(r,w=>!1),e.positionTracking!=="onlyOffset"&&(f=A.map(r,w=>A.has(w,"LINE_BREAKS")?!!w.LINE_BREAKS:Ud(w,b)===!1&&Yc(b,w.PATTERN)))});let g,h,S,_;n("Misc Mapping #2",()=>{g=A.map(r,Gd),h=A.map(s,Rm),S=E.reduce(r,(b,w)=>{const x=w.GROUP;return Ze(x)&&x!==Qe.SKIPPED&&(b[x]=[]),b},{}),_=A.map(s,(b,w)=>({pattern:s[w],longerAlt:c[w],canLineTerminator:f[w],isCustom:g[w],short:h[w],group:o[w],push:l[w],pop:u[w],tokenTypeIdx:a[w],tokenType:r[w]}))});let $=!0,N=[];return e.safeMode||n("First Char Optimization",()=>{N=E.reduce(r,(b,w,x)=>{if(typeof w.PATTERN=="string"){const H=w.PATTERN.charCodeAt(0),K=rn(H);Ga(b,K,_[x])}else if(F.isArray(w.START_CHARS_HINT)){let H;E.forEach(w.START_CHARS_HINT,K=>{const Q=typeof K=="string"?K.charCodeAt(0):K,ae=rn(Q);H!==ae&&(H=ae,Ga(b,ae,_[x]))})}else if(Ht(w.PATTERN))if(w.PATTERN.unicode)$=!1,e.ensureOptimizations&&mo(`${ea} Unable to analyze < ${w.PATTERN.toString()} > pattern.
|
|
23
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
|
+
This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const H=Yp(w.PATTERN,e.ensureOptimizations);F.isEmpty(H)&&($=!1),E.forEach(H,K=>{Ga(b,K,_[x])})}else e.ensureOptimizations&&mo(`${ea} TokenType: <${w.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
|
+
This will disable the lexer's first char optimizations.
|
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),$=!1;return b},[])}),{emptyGroups:S,patternIdxToConfig:_,charCodeToPatternIdxToConfig:N,hasCustom:i,canBeOptimized:$}}function Zp(t,e){let n=[];const r=tm(t);n=n.concat(r.errors);const i=nm(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(em(s)),n=n.concat(um(s)),n=n.concat(dm(s,e)),n=n.concat(fm(s)),n}function em(t){let e=[];const n=E.filter(t,r=>Ht(r[Mn]));return e=e.concat(im(n)),e=e.concat(om(n)),e=e.concat(cm(n)),e=e.concat(lm(n)),e=e.concat(sm(n)),e}function tm(t){const e=E.filter(t,i=>!A.has(i,Mn)),n=A.map(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ve.MISSING_PATTERN,tokenTypes:[i]})),r=ga(t,e);return{errors:n,valid:r}}function nm(t){const e=E.filter(t,i=>{const s=i[Mn];return!Ht(s)&&!F.isFunction(s)&&!A.has(s,"exec")&&!Ze(s)}),n=A.map(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:ve.INVALID_PATTERN,tokenTypes:[i]})),r=ga(t,e);return{errors:n,valid:r}}const rm=/[^\\][$]/;function im(t){class e extends Ea{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=E.filter(t,i=>{const s=i.PATTERN;try{const a=ka(s),o=new e;return o.visit(a),o.found}catch{return rm.test(s.source)}});return A.map(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ve.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function sm(t){const e=E.filter(t,r=>r.PATTERN.test(""));return A.map(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:ve.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const am=/[^\\[][\^]|^\^/;function om(t){class e extends Ea{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=E.filter(t,i=>{const s=i.PATTERN;try{const a=ka(s),o=new e;return o.visit(a),o.found}catch{return am.test(s.source)}});return A.map(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
30
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ve.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function cm(t){const e=E.filter(t,r=>{const i=r[Mn];return i instanceof RegExp&&(i.multiline||i.global)});return A.map(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ve.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function lm(t){const e=[];let n=A.map(t,s=>E.reduce(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!Xe(e,o)&&o.PATTERN!==Qe.NA&&(e.push(o),a.push(o)),a),[]));n=zi(n);const r=E.filter(n,s=>s.length>1);return A.map(r,s=>{const a=A.map(s,c=>c.name);return{message:`The same RegExp pattern ->${Rt(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:ve.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function um(t){const e=E.filter(t,r=>{if(!A.has(r,"GROUP"))return!1;const i=r.GROUP;return i!==Qe.SKIPPED&&i!==Qe.NA&&!Ze(i)});return A.map(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ve.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function dm(t,e){const n=E.filter(t,i=>i.PUSH_MODE!==void 0&&!Xe(e,i.PUSH_MODE));return A.map(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:ve.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function fm(t){const e=[],n=E.reduce(t,(r,i,s)=>{const a=i.PATTERN;return a===Qe.NA||(Ze(a)?r.push({str:a,idx:s,tokenType:i}):Ht(a)&&pm(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return E.forEach(t,(r,i)=>{E.forEach(n,({str:s,idx:a,tokenType:o})=>{if(i<a&&hm(s,r.PATTERN)){const c=`Token: ->${o.name}<- can never be matched.
|
|
32
|
+
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:ve.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function hm(t,e){if(Ht(e)){if(mm(e))return!1;const n=e.exec(t);return n!==null&&n.index===0}else{if(F.isFunction(e))return e(t,0,[],{});if(A.has(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function pm(t){const e=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return A.find(e,n=>t.source.indexOf(n)!==-1)===void 0}function mm(t){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source)}function bl(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function Il(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function gm(t,e,n){const r=[];return A.has(t,ki)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+ki+`> property in its definition
|
|
34
|
+
`,type:ve.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),A.has(t,As)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+As+`> property in its definition
|
|
35
|
+
`,type:ve.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),A.has(t,As)&&A.has(t,ki)&&!A.has(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${ki}: <${t.defaultMode}>which does not exist
|
|
36
|
+
`,type:ve.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),A.has(t,As)&&E.forEach(t.modes,(i,s)=>{E.forEach(i,(a,o)=>{if(E.isUndefined(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
|
|
37
|
+
`,type:ve.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(A.has(a,"LONGER_ALT")){const c=F.isArray(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];E.forEach(c,l=>{!E.isUndefined(l)&&!Xe(i,l)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${a.name}> outside of mode <${s}>
|
|
38
|
+
`,type:ve.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function ym(t,e,n){const r=[];let i=!1;const s=zi(A.flatten(E.values(t.modes))),a=ya(s,c=>c[Mn]===Qe.NA),o=qd(n);return e&&E.forEach(a,c=>{const l=Ud(c,o);if(l!==!1){const f={message:Em(c,l),type:l.issue,tokenType:c};r.push(f)}else A.has(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):Yc(o,c.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
|
+
This Lexer has been defined to track line and column information,
|
|
40
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
41
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
42
|
+
for details.`,type:ve.NO_LINE_BREAKS_FLAGS}),r}function Tm(t){const e={},n=E.keys(t);return E.forEach(n,r=>{const i=t[r];if(F.isArray(i))e[r]=[];else throw Error("non exhaustive match")}),e}function Gd(t){const e=t.PATTERN;if(Ht(e))return!1;if(F.isFunction(e))return!0;if(A.has(e,"exec"))return!0;if(Ze(e))return!1;throw Error("non exhaustive match")}function Rm(t){return Ze(t)&&t.length===1?t.charCodeAt(0):!1}const vm={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Ud(t,e){if(A.has(t,"LINE_BREAKS"))return!1;if(Ht(t.PATTERN)){try{Yc(e,t.PATTERN)}catch(n){return{issue:ve.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Ze(t.PATTERN))return!1;if(Gd(t))return{issue:ve.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Em(t,e){if(e.issue===ve.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
43
|
+
The problem is in the <${t.name}> Token Type
|
|
44
|
+
Root cause: ${e.errMsg}.
|
|
45
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===ve.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
|
+
The problem is in the <${t.name}> Token Type
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function qd(t){return A.map(t,n=>Ze(n)?n.charCodeAt(0):n)}function Ga(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Ci=256;let qs=[];function rn(t){return t<Ci?t:qs[t]}function Am(){if(F.isEmpty(qs)){qs=new Array(65536);for(let t=0;t<65536;t++)qs[t]=t>255?255+~~(t/255):t}}function Hi(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function ta(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let _l=1;const jd={};function Yi(t){const e=Sm(t);km(e),Nm(e),Cm(e),E.forEach(e,n=>{n.isParent=n.categoryMatches.length>0})}function Sm(t){let e=qe.clone(t),n=t,r=!0;for(;r;){n=zi(A.flatten(A.map(n,s=>s.CATEGORIES)));const i=ga(n,e);e=e.concat(i),F.isEmpty(i)?r=!1:n=i}return e}function km(t){E.forEach(t,e=>{Bd(e)||(jd[_l]=e,e.tokenTypeIdx=_l++),Pl(e)&&!F.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Pl(e)||(e.CATEGORIES=[]),wm(e)||(e.categoryMatches=[]),bm(e)||(e.categoryMatchesMap={})})}function Cm(t){E.forEach(t,e=>{e.categoryMatches=[],E.forEach(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(jd[r].tokenTypeIdx)})})}function Nm(t){E.forEach(t,e=>{zd([],e)})}function zd(t,e){E.forEach(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),E.forEach(e.CATEGORIES,n=>{const r=t.concat(e);Xe(r,n)||zd(r,n)})}function Bd(t){return A.has(t,"tokenTypeIdx")}function Pl(t){return A.has(t,"CATEGORIES")}function wm(t){return A.has(t,"categoryMatches")}function bm(t){return A.has(t,"categoryMatchesMap")}function Im(t){return A.has(t,"tokenTypeIdx")}const To={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i,s){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var ve;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(ve||(ve={}));const Ni={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:To,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ni);class Qe{constructor(e,n=Ni){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);const{time:o,value:c}=Od(s),l=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,c}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
|
+
a boolean 2nd argument is no longer supported`);this.config=ct({},Ni,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ni.lineTerminatorsPattern)this.config.lineTerminatorsPattern=vm;else if(this.config.lineTerminatorCharacters===Ni.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),F.isArray(e)?i={modes:{defaultMode:qe.clone(e)},defaultMode:ki}:(s=!1,i=qe.clone(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(gm(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(ym(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},E.forEach(i.modes,(o,c)=>{i.modes[c]=ya(o,l=>E.isUndefined(l))});const a=E.keys(i.modes);if(E.forEach(i.modes,(o,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Zp(o,a))}),F.isEmpty(this.lexerDefinitionErrors)){Yi(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Qp(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=l.charCodeToPatternIdxToConfig,this.emptyGroups=ct({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!F.isEmpty(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=A.map(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
|
|
51
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
+
`+c)}E.forEach(this.lexerDefinitionWarning,o=>{Ld(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(Fd?(this.chopInput=F.identity,this.match=this.matchWithTest):(this.updateLastIndex=E.noop,this.match=this.matchWithExec),s&&(this.handleModes=E.noop),this.trackStartLines===!1&&(this.computeNewColumn=F.identity),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=E.noop),/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=E.reduce(this.canModeBeOptimized,(c,l,u)=>(l===!1&&c.push(u),c),[]);if(n.ensureOptimizations&&!F.isEmpty(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
53
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Hp()}),this.TRACE_INIT("toFastProperties",()=>{xd(this)})})}tokenize(e,n=this.defaultMode){if(!F.isEmpty(this.lexerDefinitionErrors)){const i=A.map(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
55
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
+
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,c,l,u,f,g,h,S,_,$,N;const b=e,w=b.length;let x=0,H=0;const K=this.hasCustom?0:Math.floor(e.length/10),Q=new Array(K),ae=[];let de=this.trackStartLines?1:void 0,Ee=this.trackStartLines?1:void 0;const P=Tm(this.emptyGroups),R=this.trackStartLines,m=this.config.lineTerminatorsPattern;let C=0,y=[],T=[];const k=[],D=[];Object.freeze(D);let G;function M(){return y}function j(ne){const Ie=rn(ne),Le=T[Ie];return Le===void 0?D:Le}const B=ne=>{if(k.length===1&&ne.tokenType.PUSH_MODE===void 0){const Ie=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ne);ae.push({offset:ne.startOffset,line:ne.startLine,column:ne.startColumn,length:ne.image.length,message:Ie})}else{k.pop();const Ie=A.last(k);y=this.patternIdxToConfig[Ie],T=this.charCodeToPatternIdxToConfig[Ie],C=y.length;const Le=this.canModeBeOptimized[Ie]&&this.config.safeMode===!1;T&&Le?G=j:G=M}};function ie(ne){k.push(ne),T=this.charCodeToPatternIdxToConfig[ne],y=this.patternIdxToConfig[ne],C=y.length,C=y.length;const Ie=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;T&&Ie?G=j:G=M}ie.call(this,n);let V;const be=this.config.recoveryEnabled;for(;x<w;){c=null;const ne=b.charCodeAt(x),Ie=G(ne),Le=Ie.length;for(r=0;r<Le;r++){V=Ie[r];const fe=V.pattern;l=null;const Oe=V.short;if(Oe!==!1?ne===Oe&&(c=fe):V.isCustom===!0?(N=fe.exec(b,x,Q,P),N!==null?(c=N[0],N.payload!==void 0&&(l=N.payload)):c=null):(this.updateLastIndex(fe,x),c=this.match(fe,e,x)),c!==null){if(o=V.longerAlt,o!==void 0){const Ae=o.length;for(s=0;s<Ae;s++){const Y=y[o[s]],Pe=Y.pattern;if(u=null,Y.isCustom===!0?(N=Pe.exec(b,x,Q,P),N!==null?(a=N[0],N.payload!==void 0&&(u=N.payload)):a=null):(this.updateLastIndex(Pe,x),a=this.match(Pe,e,x)),a&&a.length>c.length){c=a,l=u,V=Y;break}}}break}}if(c!==null){if(f=c.length,g=V.group,g!==void 0&&(h=V.tokenTypeIdx,S=this.createTokenInstance(c,x,h,V.tokenType,de,Ee,f),this.handlePayload(S,l),g===!1?H=this.addToken(Q,H,S):P[g].push(S)),e=this.chopInput(e,f),x=x+f,Ee=this.computeNewColumn(Ee,f),R===!0&&V.canLineTerminator===!0){let fe=0,Oe,Ae;m.lastIndex=0;do Oe=m.test(c),Oe===!0&&(Ae=m.lastIndex-1,fe++);while(Oe===!0);fe!==0&&(de=de+fe,Ee=f-Ae,this.updateTokenEndLineColumnLocation(S,g,Ae,fe,de,Ee,f))}this.handleModes(V,B,ie,S)}else{const fe=x,Oe=de,Ae=Ee;let Y=be===!1;for(;Y===!1&&x<w;)for(e=this.chopInput(e,1),x++,i=0;i<C;i++){const Pe=y[i],oe=Pe.pattern,Je=Pe.short;if(Je!==!1?b.charCodeAt(x)===Je&&(Y=!0):Pe.isCustom===!0?Y=oe.exec(b,x,Q,P)!==null:(this.updateLastIndex(oe,x),Y=oe.exec(e)!==null),Y===!0)break}if(_=x-fe,Ee=this.computeNewColumn(Ee,_),$=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(b,fe,_,Oe,Ae,A.last(k)),ae.push({offset:fe,line:Oe,column:Ae,length:_,message:$}),be===!1)break}}return this.hasCustom||(Q.length=H),{tokens:Q,groups:P,errors:ae}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,a,o){let c,l;n!==void 0&&(c=r===o-1,l=c?-1:0,i===1&&c===!0||(e.endLine=s+l,e.endColumn=a-1+-l))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,a){return{image:e,startOffset:n,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:n+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}Qe.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Qe.NA=/NOT_APPLICABLE/;function hr(t){return Wd(t)?t.LABEL:t.name}function Wd(t){return Ze(t.LABEL)&&t.LABEL!==""}const _m="parent",$l="categories",Ll="label",Ol="group",xl="push_mode",Dl="pop_mode",Ml="longer_alt",Fl="line_breaks",Gl="start_chars_hint";function Vd(t){return Pm(t)}function Pm(t){const e=t.pattern,n={};if(n.name=t.name,E.isUndefined(e)||(n.PATTERN=e),A.has(t,_m))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return A.has(t,$l)&&(n.CATEGORIES=t[$l]),Yi([n]),A.has(t,Ll)&&(n.LABEL=t[Ll]),A.has(t,Ol)&&(n.GROUP=t[Ol]),A.has(t,Dl)&&(n.POP_MODE=t[Dl]),A.has(t,xl)&&(n.PUSH_MODE=t[xl]),A.has(t,Ml)&&(n.LONGER_ALT=t[Ml]),A.has(t,Fl)&&(n.LINE_BREAKS=t[Fl]),A.has(t,Gl)&&(n.START_CHARS_HINT=t[Gl]),n}const sn=Vd({name:"EOF",pattern:Qe.NA});Yi([sn]);function Xc(t,e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function Kd(t,e){return Hi(t,e)}const dr={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${Wd(t)?`--> ${hr(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
|
|
58
|
+
but found: '`+Rt(e).image+"'";if(r)return s+r+o;{const c=E.reduce(t,(g,h)=>g.concat(h),[]),l=A.map(c,g=>`[${A.map(g,h=>hr(h)).join(", ")}]`),f=`one of these possible Token sequences:
|
|
59
|
+
${A.map(l,(g,h)=>` ${h+1}. ${g}`).join(`
|
|
60
|
+
`)}`;return s+f+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=`
|
|
61
|
+
but found: '`+Rt(e).image+"'";if(n)return i+n+a;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
+
<${A.map(t,l=>`[${A.map(l,u=>hr(u)).join(",")}]`).join(" ,")}>`;return i+c+a}}};Object.freeze(dr);const $m={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},$n={buildDuplicateFoundError(t,e){function n(u){return u instanceof ue?u.terminalType.name:u instanceof He?u.nonTerminalName:""}const r=t.name,i=Rt(e),s=i.idx,a=Ct(i),o=n(i),c=s>0;let l=`->${a}${c?s:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
64
|
+
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
65
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
+
`;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
|
|
67
|
+
`),l},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
68
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
69
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
70
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
71
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=A.map(t.prefixPath,i=>hr(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
+
in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
75
|
+
For Further details.`},buildAlternationAmbiguityError(t){const e=A.map(t.prefixPath,i=>hr(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
76
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
77
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
78
|
+
For Further details.`,r},buildEmptyRepetitionError(t){let e=Ct(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
79
|
+
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
80
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
81
|
+
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
82
|
+
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=A.map(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
83
|
+
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
84
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
85
|
+
${r}
|
|
86
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
87
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Mr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Lm(t,e){const n=new Om(t,e);return n.resolveRefs(),n.errors}class Om extends Fr{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){E.forEach(E.values(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:Ye.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class xm extends Sa{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=qe.clone(this.path.ruleStack).reverse(),this.occurrenceStack=qe.clone(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){F.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class Dm extends xm{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new et({definition:i});this.possibleTokTypes=Ki(s),this.found=!0}}}class Ca extends Sa{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class Mm extends Ca{walkMany(e,n,r){if(e.idx===this.occurrence){const i=Rt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ue&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class Ul extends Ca{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=Rt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ue&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class Fm extends Ca{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=Rt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ue&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class ql extends Ca{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=Rt(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ue&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Ro(t,e,n=[]){n=qe.clone(n);let r=[],i=0;function s(o){return o.concat(Me(t,i+1))}function a(o){const c=Ro(s(o),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const o=t[i];if(o instanceof et)return a(o.definition);if(o instanceof He)return a(o.definition);if(o instanceof Ue)r=a(o.definition);else if(o instanceof lt){const c=o.definition.concat([new Re({definition:o.definition})]);return a(c)}else if(o instanceof ut){const c=[new et({definition:o.definition}),new Re({definition:[new ue({terminalType:o.separator})].concat(o.definition)})];return a(c)}else if(o instanceof tt){const c=o.definition.concat([new Re({definition:[new ue({terminalType:o.separator})].concat(o.definition)})]);r=a(c)}else if(o instanceof Re){const c=o.definition.concat([new Re({definition:o.definition})]);r=a(c)}else{if(o instanceof nt)return E.forEach(o.definition,c=>{F.isEmpty(c.definition)===!1&&(r=a(c.definition))}),r;if(o instanceof ue)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Me(t,i)}),r}function Hd(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const c=e.length,l=c-r-1,u=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!F.isEmpty(f);){const g=f.pop();if(g===a){o&&A.last(f).idx<=l&&f.pop();continue}const h=g.def,S=g.idx,_=g.ruleStack,$=g.occurrenceStack;if(F.isEmpty(h))continue;const N=h[0];if(N===i){const b={idx:S,def:Me(h),ruleStack:_i(_),occurrenceStack:_i($)};f.push(b)}else if(N instanceof ue)if(S<c-1){const b=S+1,w=e[b];if(n(w,N.terminalType)){const x={idx:b,def:Me(h),ruleStack:_,occurrenceStack:$};f.push(x)}}else if(S===c-1)u.push({nextTokenType:N.terminalType,nextTokenOccurrence:N.idx,ruleStack:_,occurrenceStack:$}),o=!0;else throw Error("non exhaustive match");else if(N instanceof He){const b=qe.clone(_);b.push(N.nonTerminalName);const w=qe.clone($);w.push(N.idx);const x={idx:S,def:N.definition.concat(s,Me(h)),ruleStack:b,occurrenceStack:w};f.push(x)}else if(N instanceof Ue){const b={idx:S,def:Me(h),ruleStack:_,occurrenceStack:$};f.push(b),f.push(a);const w={idx:S,def:N.definition.concat(Me(h)),ruleStack:_,occurrenceStack:$};f.push(w)}else if(N instanceof lt){const b=new Re({definition:N.definition,idx:N.idx}),w=N.definition.concat([b],Me(h)),x={idx:S,def:w,ruleStack:_,occurrenceStack:$};f.push(x)}else if(N instanceof ut){const b=new ue({terminalType:N.separator}),w=new Re({definition:[b].concat(N.definition),idx:N.idx}),x=N.definition.concat([w],Me(h)),H={idx:S,def:x,ruleStack:_,occurrenceStack:$};f.push(H)}else if(N instanceof tt){const b={idx:S,def:Me(h),ruleStack:_,occurrenceStack:$};f.push(b),f.push(a);const w=new ue({terminalType:N.separator}),x=new Re({definition:[w].concat(N.definition),idx:N.idx}),H=N.definition.concat([x],Me(h)),K={idx:S,def:H,ruleStack:_,occurrenceStack:$};f.push(K)}else if(N instanceof Re){const b={idx:S,def:Me(h),ruleStack:_,occurrenceStack:$};f.push(b),f.push(a);const w=new Re({definition:N.definition,idx:N.idx}),x=N.definition.concat([w],Me(h)),H={idx:S,def:x,ruleStack:_,occurrenceStack:$};f.push(H)}else if(N instanceof nt)for(let b=N.definition.length-1;b>=0;b--){const w=N.definition[b],x={idx:S,def:w.definition.concat(Me(h)),ruleStack:_,occurrenceStack:$};f.push(x),f.push(a)}else if(N instanceof et)f.push({idx:S,def:N.definition.concat(Me(h)),ruleStack:_,occurrenceStack:$});else if(N instanceof Mr)f.push(Gm(N,S,_,$));else throw Error("non exhaustive match")}return u}function Gm(t,e,n,r){const i=qe.clone(n);i.push(t.name);const s=qe.clone(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var ge;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ge||(ge={}));function Jc(t){if(t instanceof Ue||t==="Option")return ge.OPTION;if(t instanceof Re||t==="Repetition")return ge.REPETITION;if(t instanceof lt||t==="RepetitionMandatory")return ge.REPETITION_MANDATORY;if(t instanceof ut||t==="RepetitionMandatoryWithSeparator")return ge.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof tt||t==="RepetitionWithSeparator")return ge.REPETITION_WITH_SEPARATOR;if(t instanceof nt||t==="Alternation")return ge.ALTERNATION;throw Error("non exhaustive match")}function jl(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Jc(r);return s===ge.ALTERNATION?Na(e,n,i):wa(e,n,s,i)}function Um(t,e,n,r,i,s){const a=Na(t,e,n),o=Jd(a)?ta:Hi;return s(a,r,o,i)}function qm(t,e,n,r,i,s){const a=wa(t,e,i,n),o=Jd(a)?ta:Hi;return s(a[0],o,r)}function jm(t,e,n,r){const i=t.length,s=yt(t,a=>yt(a,o=>o.length===1));if(e)return function(a){const o=A.map(a,c=>c.GATE);for(let c=0;c<i;c++){const l=t[c],u=l.length,f=o[c];if(!(f!==void 0&&f.call(this)===!1))e:for(let g=0;g<u;g++){const h=l[g],S=h.length;for(let _=0;_<S;_++){const $=this.LA(_+1);if(n($,h[_])===!1)continue e}return c}}};if(s&&!r){const a=A.map(t,c=>A.flatten(c)),o=E.reduce(a,(c,l,u)=>(E.forEach(l,f=>{A.has(c,f.tokenTypeIdx)||(c[f.tokenTypeIdx]=u),E.forEach(f.categoryMatches,g=>{A.has(c,g)||(c[g]=u)})}),c),{});return function(){const c=this.LA(1);return o[c.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],c=o.length;e:for(let l=0;l<c;l++){const u=o[l],f=u.length;for(let g=0;g<f;g++){const h=this.LA(g+1);if(n(h,u[g])===!1)continue e}return a}}}}function zm(t,e,n){const r=yt(t,s=>s.length===1),i=t.length;if(r&&!n){const s=A.flatten(t);if(s.length===1&&F.isEmpty(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=E.reduce(s,(o,c,l)=>(o[c.tokenTypeIdx]=!0,E.forEach(c.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=t[s],o=a.length;for(let c=0;c<o;c++){const l=this.LA(c+1);if(e(l,a[c])===!1)continue e}return!0}return!1}}class Bm extends Sa{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,ge.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,ge.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,ge.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,ge.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,ge.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class Yd extends Fr{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,ge.OPTION)}visitRepetition(e){this.checkIsTarget(e,ge.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ge.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ge.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ge.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ge.ALTERNATION)}}function zl(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Ua(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+r.tokenTypeIdx);for(let o=0;o<r.categoryMatches.length;o++){const c="_"+r.categoryMatches[o];i.push(a+c)}}e=i}return e}function Wm(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function Xd(t,e){const n=A.map(t,a=>Ro([a],1)),r=zl(n.length),i=A.map(n,a=>{const o={};return E.forEach(a,c=>{const l=Ua(c.partialPath);E.forEach(l,u=>{o[u]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=zl(o.length);for(let c=0;c<o.length;c++){const l=o[c];for(let u=0;u<l.length;u++){const f=l[u].partialPath,g=l[u].suffixDef,h=Ua(f);if(Wm(i,h,c)||F.isEmpty(g)||f.length===e){const _=r[c];if(vo(_,f)===!1){_.push(f);for(let $=0;$<h.length;$++){const N=h[$];i[c][N]=!0}}}else{const _=Ro(g,a+1,f);s[c]=s[c].concat(_),E.forEach(_,$=>{const N=Ua($.partialPath);E.forEach(N,b=>{i[c][b]=!0})})}}}}return r}function Na(t,e,n,r){const i=new Yd(t,ge.ALTERNATION,r);return e.accept(i),Xd(i.result,n)}function wa(t,e,n,r){const i=new Yd(t,n);e.accept(i);const s=i.result,o=new Bm(e,t,n).startWalking(),c=new et({definition:s}),l=new et({definition:o});return Xd([c,l],r)}function vo(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],a=r[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Vm(t,e){return t.length<e.length&&yt(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function Jd(t){return yt(t,e=>yt(e,n=>yt(n,r=>F.isEmpty(r.categoryMatches))))}function Km(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return A.map(e,n=>Object.assign({type:Ye.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Hm(t,e,n,r){const i=ot(t,c=>Ym(c,n)),s=og(t,e,n),a=ot(t,c=>rg(c,n)),o=ot(t,c=>Qm(c,t,r,n));return i.concat(s,a,o)}function Ym(t,e){const n=new Jm;t.accept(n);const r=n.allProductions,i=wh(r,Xm),s=vt(i,o=>o.length>1);return A.map(E.values(s),o=>{const c=Rt(o),l=e.buildDuplicateFoundError(t,o),u=Ct(c),f={message:l,type:Ye.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},g=Qd(c);return g&&(f.parameter=g),f})}function Xm(t){return`${Ct(t)}_#_${t.idx}_#_${Qd(t)}`}function Qd(t){return t instanceof ue?t.terminalType.name:t instanceof He?t.nonTerminalName:""}class Jm extends Fr{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 Qm(t,e,n,r){const i=[];if(E.reduce(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:Ye.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Zm(t,e,n){const r=[];let i;return Xe(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:Ye.INVALID_RULE_OVERRIDE,ruleName:t})),r}function Zd(t,e,n,r=[]){const i=[],s=js(e.definition);if(F.isEmpty(s))return[];{const a=t.name;Xe(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:Ye.LEFT_RECURSION,ruleName:a});const c=ga(s,r.concat([t])),l=ot(c,u=>{const f=qe.clone(r);return f.push(u),Zd(t,u,n,f)});return i.concat(l)}}function js(t){let e=[];if(F.isEmpty(t))return e;const n=Rt(t);if(n instanceof He)e.push(n.referencedRule);else if(n instanceof et||n instanceof Ue||n instanceof lt||n instanceof ut||n instanceof tt||n instanceof Re)e=e.concat(js(n.definition));else if(n instanceof nt)e=A.flatten(A.map(n.definition,s=>js(s.definition)));else if(!(n instanceof ue))throw Error("non exhaustive match");const r=Zs(n),i=t.length>1;if(r&&i){const s=Me(t);return e.concat(js(s))}else return e}class Qc extends Fr{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function eg(t,e){const n=new Qc;t.accept(n);const r=n.alternations;return ot(r,s=>{const a=_i(s.definition);return ot(a,(o,c)=>{const l=Hd([o],[],Hi,1);return F.isEmpty(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:Ye.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function tg(t,e,n){const r=new Qc;t.accept(r);let i=r.alternations;return i=ya(i,a=>a.ignoreAmbiguities===!0),ot(i,a=>{const o=a.idx,c=a.maxLookahead||e,l=Na(o,t,c,a),u=sg(l,a,t,n),f=ag(l,a,t,n);return u.concat(f)})}class ng extends Fr{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 rg(t,e){const n=new Qc;t.accept(n);const r=n.alternations;return ot(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:Ye.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function ig(t,e,n){const r=[];return E.forEach(t,i=>{const s=new ng;i.accept(s);const a=s.allProductions;E.forEach(a,o=>{const c=Jc(o),l=o.maxLookahead||e,u=o.idx,g=wa(u,i,c,l)[0];if(F.isEmpty(A.flatten(g))){const h=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:h,type:Ye.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function sg(t,e,n,r){const i=[],s=E.reduce(t,(o,c,l)=>(e.definition[l].ignoreAmbiguities===!0||E.forEach(c,u=>{const f=[l];E.forEach(t,(g,h)=>{l!==h&&vo(g,u)&&e.definition[h].ignoreAmbiguities!==!0&&f.push(h)}),f.length>1&&!vo(i,u)&&(i.push(u),o.push({alts:f,path:u}))}),o),[]);return A.map(s,o=>{const c=A.map(o.alts,u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:o.path}),type:Ye.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function ag(t,e,n,r){const i=E.reduce(t,(a,o,c)=>{const l=A.map(o,u=>({idx:c,path:u}));return a.concat(l)},[]);return zi(ot(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const c=a.idx,l=a.path,u=E.filter(i,g=>e.definition[g.idx].ignoreAmbiguities!==!0&&g.idx<c&&Vm(g.path,l));return A.map(u,g=>{const h=[g.idx+1,c+1],S=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:h,prefixPath:g.path}),type:Ye.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:S,alternatives:h}})}))}function og(t,e,n){const r=[],i=A.map(e,s=>s.name);return E.forEach(t,s=>{const a=s.name;if(Xe(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:Ye.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function cg(t){const e=A.defaults(t,{errMsgProvider:$m}),n={};return E.forEach(t.rules,r=>{n[r.name]=r}),Lm(n,e.errMsgProvider)}function lg(t){return t=A.defaults(t,{errMsgProvider:$n}),Hm(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const ef="MismatchedTokenException",tf="NoViableAltException",nf="EarlyExitException",rf="NotAllInputParsedException",sf=[ef,tf,nf,rf];Object.freeze(sf);function na(t){return Xe(sf,t.name)}class ba extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class af extends ba{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=ef}}class ug extends ba{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=tf}}class dg extends ba{constructor(e,n){super(e,n),this.name=rf}}class fg extends ba{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=nf}}const qa={},of="InRuleRecoveryException";class hg extends Error{constructor(e){super(e),this.name=of}}class pg{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=A.has(e,"recoveryEnabled")?e.recoveryEnabled:Yt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=mg)}getTokenToInsert(e){const n=Xc(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let c=!1;const l=this.LA(1);let u=this.LA(1);const f=()=>{const g=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:g,ruleName:this.getCurrRuleFullName()}),S=new af(h,l,this.LA(0));S.resyncedTokens=_i(o),this.SAVE_ERROR(S)};for(;!c;)if(this.tokenMatcher(u,i)){f();return}else if(r.call(this)){f(),e.apply(this,n);return}else this.tokenMatcher(u,s)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new hg("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||F.isEmpty(n))return!1;const r=this.LA(1);return A.find(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return Xe(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=A.find(e,s=>Kd(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return qa;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return A.map(e,(r,i)=>i===0?qa:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=A.map(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return A.flatten(e)}getFollowSetFromFollowKey(e){if(e===qa)return[sn];const n=e.ruleName+e.idxInCallingRule+Dd+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,sn)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return _i(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=qe.clone(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return A.map(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function mg(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[o];if(c===void 0){const g=this.getCurrRuleFullName(),h=this.getGAstProductions()[g];c=new s(h,i).startWalking(),this.firstAfterRepMap[o]=c}let l=c.token,u=c.occurrence;const f=c.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=sn,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,a)&&this.tryInRepetitionRecovery(t,e,n,l)}const gg=4,on=8,cf=1<<on,lf=2<<on,Eo=3<<on,Ao=4<<on,So=5<<on,zs=6<<on;function ja(t,e,n){return n|e|t}class Zc{constructor(e){var n;this.maxLookahead=(n=e==null?void 0:e.maxLookahead)!==null&&n!==void 0?n:Yt.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(F.isEmpty(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return ot(e,n=>Zd(n,n,$n))}validateEmptyOrAlternatives(e){return ot(e,n=>eg(n,$n))}validateAmbiguousAlternationAlternatives(e,n){return ot(e,r=>tg(r,n,$n))}validateSomeNonEmptyLookaheadPath(e,n){return ig(e,n,$n)}buildLookaheadForAlternation(e){return Um(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,jm)}buildLookaheadForOptional(e){return qm(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Jc(e.prodType),zm)}}class yg{initLooksAhead(e){this.dynamicTokensEnabled=A.has(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Yt.dynamicTokensEnabled,this.maxLookahead=A.has(e,"maxLookahead")?e.maxLookahead:Yt.maxLookahead,this.lookaheadStrategy=A.has(e,"lookaheadStrategy")?e.lookaheadStrategy:new Zc({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){E.forEach(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:c}=Rg(n);E.forEach(r,l=>{const u=l.idx===0?"":l.idx;this.TRACE_INIT(`${Ct(l)}${u}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:n,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),g=ja(this.fullRuleNameToShort[n.name],cf,l.idx);this.setLaFuncCache(g,f)})}),E.forEach(i,l=>{this.computeLookaheadFunc(n,l.idx,Eo,"Repetition",l.maxLookahead,Ct(l))}),E.forEach(s,l=>{this.computeLookaheadFunc(n,l.idx,lf,"Option",l.maxLookahead,Ct(l))}),E.forEach(a,l=>{this.computeLookaheadFunc(n,l.idx,Ao,"RepetitionMandatory",l.maxLookahead,Ct(l))}),E.forEach(o,l=>{this.computeLookaheadFunc(n,l.idx,zs,"RepetitionMandatoryWithSeparator",l.maxLookahead,Ct(l))}),E.forEach(c,l=>{this.computeLookaheadFunc(n,l.idx,So,"RepetitionWithSeparator",l.maxLookahead,Ct(l))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=ja(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return ja(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Tg extends Fr{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 Ss=new Tg;function Rg(t){Ss.reset(),t.accept(Ss);const e=Ss.dslMethods;return Ss.reset(),e}function Bl(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Wl(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function vg(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function Eg(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const Ag="name";function uf(t,e){Object.defineProperty(t,Ag,{enumerable:!1,configurable:!0,writable:!1,value:e})}function Sg(t,e){const n=E.keys(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],a=t[s],o=a.length;for(let c=0;c<o;c++){const l=a[c];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function kg(t,e){const n=function(){};uf(n,t+"BaseSemantics");const r={visit:function(i,s){if(F.isArray(i)&&(i=i[0]),!E.isUndefined(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=Ng(this,e);if(!F.isEmpty(i)){const s=A.map(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
88
|
+
${s.join(`
|
|
89
|
+
|
|
90
|
+
`).replace(/\n/g,`
|
|
91
|
+
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function Cg(t,e,n){const r=function(){};uf(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return E.forEach(e,s=>{i[s]=Sg}),r.prototype=i,r.prototype.constructor=r,r}var ko;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(ko||(ko={}));function Ng(t,e){return wg(t,e)}function wg(t,e){const n=E.filter(e,i=>F.isFunction(t[i])===!1),r=A.map(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:ko.MISSING_METHOD,methodName:i}));return zi(r)}class bg{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=A.has(e,"nodeLocationTracking")?e.nodeLocationTracking:Yt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=E.noop,this.cstFinallyStateUpdate=E.noop,this.cstPostTerminal=E.noop,this.cstPostNonTerminal=E.noop,this.cstPostRule=E.noop;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Wl,this.setNodeLocationFromNode=Wl,this.cstPostRule=E.noop,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=E.noop,this.setNodeLocationFromNode=E.noop,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Bl,this.setNodeLocationFromNode=Bl,this.cstPostRule=E.noop,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=E.noop,this.setNodeLocationFromNode=E.noop,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=E.noop,this.setNodeLocationFromNode=E.noop,this.cstPostRule=E.noop,this.setInitialNodeLocation=E.noop;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];vg(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Eg(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(E.isUndefined(this.baseCstVisitorConstructor)){const e=kg(this.className,E.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(E.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){const e=Cg(this.className,E.keys(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 Ig{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)):ia}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?ia:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class _g{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=sa){if(Xe(this.definedRulesNames,e)){const a={message:$n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Ye.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=sa){const i=Zm(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(na(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Fp(E.values(this.gastProductionsCache))}}class Pg{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=ta,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},A.has(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
92
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
93
|
+
For Further details.`);if(F.isArray(e)){if(F.isEmpty(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
94
|
+
Note that the first argument for the parser constructor
|
|
95
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
96
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
97
|
+
For Further details.`)}if(F.isArray(e))this.tokensMap=E.reduce(e,(s,a)=>(s[a.name]=a,s),{});else if(A.has(e,"modes")&&yt(A.flatten(E.values(e.modes)),Im)){const s=A.flatten(E.values(e.modes)),a=jc(s);this.tokensMap=E.reduce(a,(o,c)=>(o[c.name]=c,o),{})}else if(F.isObject(e))this.tokensMap=qe.clone(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=sn;const r=A.has(e,"modes")?A.flatten(E.values(e.modes)):E.values(e),i=yt(r,s=>F.isEmpty(s.categoryMatches));this.tokenMatcher=i?ta:Hi,Yi(E.values(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
98
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=A.has(r,"resyncEnabled")?r.resyncEnabled:sa.resyncEnabled,s=A.has(r,"recoveryValueFunc")?r.recoveryValueFunc:sa.recoveryValueFunc,a=this.ruleShortNameIdx<<gg+on;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),n.apply(this,u);const f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...u){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,u)}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(na(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,a.partialCstResult=c}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(lf,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const a=e.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Ao,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,ge.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Ao,e,Fm)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(zs,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,ql],o,zs,e,ql)}else throw this.raiseEarlyExitException(e,ge.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(Eo,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const c=i;i=()=>o.call(this)&&c.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,Eo,e,Mm,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(So,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,Ul],o,So,e,Ul)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,zs,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(cf,n),i=F.isArray(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new dg(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw na(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new af(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===of?r:s}}else throw r}saveRecogState(){const e=this.errors,n=qe.clone(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),sn)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class $g{initErrorHandler(e){this._errors=[],this.errorMessageProvider=A.has(e,"errorMessageProvider")?e.errorMessageProvider:Yt.errorMessageProvider}SAVE_ERROR(e){if(na(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:qe.clone(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return qe.clone(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=wa(e,s,n,this.maxLookahead)[0],c=[];for(let u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));const l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new fg(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Na(e,i,this.maxLookahead),a=[];for(let l=1;l<=this.maxLookahead;l++)a.push(this.LA(l));const o=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ug(c,this.LA(1),o))}}class Lg{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(E.isUndefined(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return Hd([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=Rt(e.ruleStack),i=this.getGAstProductions()[n];return new Dm(i,e).startWalking()}}const Ia={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Ia);const Vl=!0,Kl=Math.pow(2,on)-1,df=Vd({name:"RECORDING_PHASE_TOKEN",pattern:Qe.NA});Yi([df]);const ff=Xc(df,`This IToken indicates the Parser is in Recording Phase
|
|
99
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(ff);const Og={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 xg{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return ia}topLevelRuleRecord(e,n){try{const r=new Mr({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
101
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
102
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return ii.call(this,Ue,e,n)}atLeastOneInternalRecord(e,n){ii.call(this,lt,n,e)}atLeastOneSepFirstInternalRecord(e,n){ii.call(this,ut,n,e,Vl)}manyInternalRecord(e,n){ii.call(this,Re,n,e)}manySepFirstInternalRecord(e,n){ii.call(this,tt,n,e,Vl)}orInternalRecord(e,n){return Dg.call(this,e,n)}subruleInternalRecord(e,n,r){if(ra(n),!e||A.has(e,"ruleName")===!1){const o=new Error(`<SUBRULE${Hl(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
103
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=A.last(this.recordingProdStack),s=e.ruleName,a=new He({idx:n,nonTerminalName:s,label:r==null?void 0:r.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?Og:Ia}consumeInternalRecord(e,n,r){if(ra(n),!Bd(e)){const a=new Error(`<CONSUME${Hl(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
104
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=A.last(this.recordingProdStack),s=new ue({idx:n,terminalType:e,label:r==null?void 0:r.LABEL});return i.definition.push(s),ff}}function ii(t,e,n,r=!1){ra(n);const i=A.last(this.recordingProdStack),s=F.isFunction(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),A.has(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),Ia}function Dg(t,e){ra(e);const n=A.last(this.recordingProdStack),r=F.isArray(t)===!1,i=r===!1?t:t.DEF,s=new nt({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});A.has(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=fd(i,o=>F.isFunction(o.GATE));return s.hasPredicates=a,n.definition.push(s),E.forEach(i,o=>{const c=new et({definition:[]});s.definition.push(c),A.has(o,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:A.has(o,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),o.ALT.call(this),this.recordingProdStack.pop()}),Ia}function Hl(t){return t===0?"":`${t}`}function ra(t){if(t<0||t>Kl){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
105
|
+
Idx value must be a none negative value smaller than ${Kl+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class Mg{initPerformanceTracer(e){if(A.has(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=Yt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=Od(n),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function Fg(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const ia=Xc(sn,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(ia);const Yt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:dr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),sa=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Ye;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Ye||(Ye={}));function Yl(t=void 0){return function(){return t}}class Xi{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{xd(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),E.forEach(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=cg({rules:E.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(F.isEmpty(r)&&this.skipValidations===!1){const i=lg({rules:E.values(this.gastProductionsCache),tokenTypes:E.values(this.tokensMap),errMsgProvider:$n,grammarName:n}),s=Km({lookaheadStrategy:this.lookaheadStrategy,rules:E.values(this.gastProductionsCache),tokenTypes:E.values(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),F.isEmpty(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=Wp(E.values(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:E.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(E.values(this.gastProductionsCache))})),!Xi.DEFER_DEFINITION_ERRORS_HANDLING&&!F.isEmpty(this.definitionErrors))throw e=A.map(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
106
|
+
${e.join(`
|
|
107
|
+
-------------------------------
|
|
108
|
+
`)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),A.has(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
109
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
110
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
111
|
+
For further details.`);this.skipValidations=A.has(n,"skipValidations")?n.skipValidations:Yt.skipValidations}}Xi.DEFER_DEFINITION_ERRORS_HANDLING=!1;Fg(Xi,[pg,yg,bg,Ig,Pg,_g,$g,Lg,xg,Mg]);class Gg extends Xi{constructor(e,n=Yt){const r=qe.clone(n);r.outputCst=!1,super(e,r)}}function Pr(t,e,n){return`${t.name}_${e}_${n}`}const an=1,Ug=2,hf=4,pf=5,Ji=7,qg=8,jg=9,zg=10,Bg=11,mf=12;class el{constructor(e){this.target=e}isEpsilon(){return!1}}class tl extends el{constructor(e,n){super(e),this.tokenType=n}}class gf extends el{constructor(e){super(e)}isEpsilon(){return!0}}class nl extends el{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function Wg(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Vg(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Un(e,i,i);s!==void 0&&ry(e,i,s)}return e}function Vg(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=$e(t,i,void 0,{type:Ug}),a=$e(t,i,void 0,{type:Ji});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function yf(t,e,n){return n instanceof ue?rl(t,e,n.terminalType,n):n instanceof He?ny(t,e,n):n instanceof nt?Jg(t,e,n):n instanceof Ue?Qg(t,e,n):n instanceof Re?Kg(t,e,n):n instanceof tt?Hg(t,e,n):n instanceof lt?Yg(t,e,n):n instanceof ut?Xg(t,e,n):Un(t,e,n)}function Kg(t,e,n){const r=$e(t,e,n,{type:pf});cn(t,r);const i=Gr(t,e,r,n,Un(t,e,n));return Rf(t,e,n,i)}function Hg(t,e,n){const r=$e(t,e,n,{type:pf});cn(t,r);const i=Gr(t,e,r,n,Un(t,e,n)),s=rl(t,e,n.separator,n);return Rf(t,e,n,i,s)}function Yg(t,e,n){const r=$e(t,e,n,{type:hf});cn(t,r);const i=Gr(t,e,r,n,Un(t,e,n));return Tf(t,e,n,i)}function Xg(t,e,n){const r=$e(t,e,n,{type:hf});cn(t,r);const i=Gr(t,e,r,n,Un(t,e,n)),s=rl(t,e,n.separator,n);return Tf(t,e,n,i,s)}function Jg(t,e,n){const r=$e(t,e,n,{type:an});cn(t,r);const i=A.map(n.definition,a=>yf(t,e,a));return Gr(t,e,r,n,...i)}function Qg(t,e,n){const r=$e(t,e,n,{type:an});cn(t,r);const i=Gr(t,e,r,n,Un(t,e,n));return Zg(t,e,n,i)}function Un(t,e,n){const r=E.filter(A.map(n.definition,i=>yf(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:ty(t,r)}function Tf(t,e,n,r,i){const s=r.left,a=r.right,o=$e(t,e,n,{type:Bg});cn(t,o);const c=$e(t,e,n,{type:mf});return s.loopback=o,c.loopback=o,t.decisionMap[Pr(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,we(a,o),i===void 0?(we(o,s),we(o,c)):(we(o,c),we(o,i.left),we(i.right,s)),{left:s,right:c}}function Rf(t,e,n,r,i){const s=r.left,a=r.right,o=$e(t,e,n,{type:zg});cn(t,o);const c=$e(t,e,n,{type:mf}),l=$e(t,e,n,{type:jg});return o.loopback=l,c.loopback=l,we(o,s),we(o,c),we(a,l),i!==void 0?(we(l,c),we(l,i.left),we(i.right,s)):we(l,o),t.decisionMap[Pr(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:c}}function Zg(t,e,n,r){const i=r.left,s=r.right;return we(i,s),t.decisionMap[Pr(e,"Option",n.idx)]=i,r}function cn(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Gr(t,e,n,r,...i){const s=$e(t,e,r,{type:qg,start:n});n.end=s;for(const o of i)o!==void 0?(we(n,o.left),we(o.right,s)):we(n,s);const a={left:n,right:s};return t.decisionMap[Pr(e,ey(r),r.idx)]=n,a}function ey(t){if(t instanceof nt)return"Alternation";if(t instanceof Ue)return"Option";if(t instanceof Re)return"Repetition";if(t instanceof tt)return"RepetitionWithSeparator";if(t instanceof lt)return"RepetitionMandatory";if(t instanceof ut)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function ty(t,e){const n=e.length;for(let s=0;s<n-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const c=o instanceof nl,l=o,u=e[s+1].left;a.left.type===an&&a.right.type===an&&o!==void 0&&(c&&l.followState===a.right||o.target===a.right)?(c?l.followState=u:o.target=u,iy(t,a.right)):we(a.right,u)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function rl(t,e,n,r){const i=$e(t,e,r,{type:an}),s=$e(t,e,r,{type:an});return il(i,new tl(s,n)),{left:i,right:s}}function ny(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=$e(t,e,n,{type:an}),a=$e(t,e,n,{type:an}),o=new nl(i,r,a);return il(s,o),{left:s,right:a}}function ry(t,e,n){const r=t.ruleToStartState.get(e);we(r,n.left);const i=t.ruleToStopState.get(e);return we(n.right,i),{left:r,right:i}}function we(t,e){const n=new gf(e);il(t,n)}function $e(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function il(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function iy(t,e){t.states.splice(t.states.indexOf(e),1)}const aa={};class Co{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=vf(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return A.map(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function vf(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function sy(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class Ef{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const Xl=new Ef;class ay extends Zc{constructor(e){var n;super(),this.logging=(n=e==null?void 0:e.logging)!==null&&n!==void 0?n:(r=>console.log(r))}initialize(e){this.atn=Wg(e.rules),this.dfas=oy(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=Pr(r,"Alternation",n),u=this.atn.decisionMap[c].decision,f=A.map(jl({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),g=>A.map(g,h=>h[0]));if(Jl(f,!1)&&!s){const g=E.reduce(f,(h,S,_)=>(E.forEach(S,$=>{$&&(h[$.tokenTypeIdx]=_,E.forEach($.categoryMatches,N=>{h[N]=_}))}),h),{});return i?function(h){var S;const _=this.LA(1),$=g[_.tokenTypeIdx];if(h!==void 0&&$!==void 0){const N=(S=h[$])===null||S===void 0?void 0:S.GATE;if(N!==void 0&&N.call(this)===!1)return}return $}:function(){const h=this.LA(1);return g[h.tokenTypeIdx]}}else return i?function(g){const h=new Ef,S=g===void 0?0:g.length;for(let $=0;$<S;$++){const N=g==null?void 0:g[$].GATE;h.set($,N===void 0||N.call(this))}const _=za.call(this,a,u,h,o);return typeof _=="number"?_:void 0}:function(){const g=za.call(this,a,u,Xl,o);return typeof g=="number"?g:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,c=Pr(r,i,n),u=this.atn.decisionMap[c].decision,f=A.map(jl({maxLookahead:1,occurrence:n,prodType:i,rule:r}),g=>A.map(g,h=>h[0]));if(Jl(f)&&f[0][0]&&!s){const g=f[0],h=A.flatten(g);if(h.length===1&&F.isEmpty(h[0].categoryMatches)){const _=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===_}}else{const S=E.reduce(h,(_,$)=>($!==void 0&&(_[$.tokenTypeIdx]=!0,E.forEach($.categoryMatches,N=>{_[N]=!0})),_),{});return function(){const _=this.LA(1);return S[_.tokenTypeIdx]===!0}}}return function(){const g=za.call(this,a,u,Xl,o);return typeof g=="object"?!1:g===0}}}function Jl(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function oy(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=sy(t.decisionStates[r],r);return n}function za(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const o=Ty(i.atnStartState);s=Sf(i,Af(o)),i.start=s}return cy.apply(this,[i,s,n,r])}function cy(t,e,n,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let c=py(i,o);if(c===void 0&&(c=ly.apply(this,[t,i,o,s,n,r])),c===aa)return hy(a,i,o);if(c.isAcceptState===!0)return c.prediction;i=c,a.push(o),o=this.LA(s++)}}function ly(t,e,n,r,i,s){const a=my(e.configs,n,i);if(a.size===0)return Ql(t,e,n,aa),aa;let o=Af(a);const c=yy(a,i);if(c!==void 0)o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c;else if(Ay(a)){const l=A.min(a.alts);o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l,uy.apply(this,[t,r,a.alts,s])}return o=Ql(t,e,n,o),o}function uy(t,e,n,r){const i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);const s=t.atnStartState,a=s.rule,o=s.production,c=dy({topLevelRule:a,ambiguityIndices:n,production:o,prefixPath:i});r(c)}function dy(t){const e=A.map(t.prefixPath,i=>hr(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${fy(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
112
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
113
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
114
|
+
For Further details.`,r}function fy(t){if(t instanceof He)return"SUBRULE";if(t instanceof Ue)return"OPTION";if(t instanceof nt)return"OR";if(t instanceof lt)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof tt)return"MANY_SEP";if(t instanceof Re)return"MANY";if(t instanceof ue)return"CONSUME";throw Error("non exhaustive match")}function hy(t,e,n){const r=ot(e.configs.elements,s=>s.state.transitions),i=xh(r.filter(s=>s instanceof tl).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function py(t,e){return t.edges[e.tokenTypeIdx]}function my(t,e,n){const r=new Co,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===Ji){i.push(a);continue}const o=a.state.transitions.length;for(let c=0;c<o;c++){const l=a.state.transitions[c],u=gy(l,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 Co;for(const a of r.elements)oa(a,s)}if(i.length>0&&!vy(s))for(const a of i)s.add(a);return s}function gy(t,e){if(t instanceof tl&&Kd(e,t.tokenType))return t.target}function yy(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Af(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function Ql(t,e,n,r){return r=Sf(t,r),e.edges[n.tokenTypeIdx]=r,r}function Sf(t,e){if(e===aa)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function Ty(t){const e=new Co,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};oa(s,e)}return e}function oa(t,e){const n=t.state;if(n.type===Ji){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};oa(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],a=Ry(t,s);a!==void 0&&oa(a,e)}}function Ry(t,e){if(e instanceof gf)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof nl){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function vy(t){for(const e of t.elements)if(e.state.type===Ji)return!0;return!1}function Ey(t){for(const e of t.elements)if(e.state.type!==Ji)return!1;return!0}function Ay(t){if(Ey(t))return!0;const e=Sy(t.elements);return ky(e)&&!Cy(e)}function Sy(t){const e=new Map;for(const n of t){const r=vf(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function ky(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function Cy(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var No;(function(t){function e(n){return typeof n=="string"}t.is=e})(No||(No={}));var ca;(function(t){function e(n){return typeof n=="string"}t.is=e})(ca||(ca={}));var wo;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(wo||(wo={}));var Li;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Li||(Li={}));var te;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Li.MAX_VALUE),i===Number.MAX_VALUE&&(i=Li.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&v.uinteger(i.line)&&v.uinteger(i.character)}t.is=n})(te||(te={}));var J;(function(t){function e(r,i,s,a){if(v.uinteger(r)&&v.uinteger(i)&&v.uinteger(s)&&v.uinteger(a))return{start:te.create(r,i),end:te.create(s,a)};if(te.is(r)&&te.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&te.is(i.start)&&te.is(i.end)}t.is=n})(J||(J={}));var Oi;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&J.is(i.range)&&(v.string(i.uri)||v.undefined(i.uri))}t.is=n})(Oi||(Oi={}));var bo;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&J.is(i.targetRange)&&v.string(i.targetUri)&&J.is(i.targetSelectionRange)&&(J.is(i.originSelectionRange)||v.undefined(i.originSelectionRange))}t.is=n})(bo||(bo={}));var la;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.numberRange(i.red,0,1)&&v.numberRange(i.green,0,1)&&v.numberRange(i.blue,0,1)&&v.numberRange(i.alpha,0,1)}t.is=n})(la||(la={}));var Io;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&J.is(i.range)&&la.is(i.color)}t.is=n})(Io||(Io={}));var _o;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.string(i.label)&&(v.undefined(i.textEdit)||wt.is(i))&&(v.undefined(i.additionalTextEdits)||v.typedArray(i.additionalTextEdits,wt.is))}t.is=n})(_o||(_o={}));var Po;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(Po||(Po={}));var $o;(function(t){function e(r,i,s,a,o,c){const l={startLine:r,endLine:i};return v.defined(s)&&(l.startCharacter=s),v.defined(a)&&(l.endCharacter=a),v.defined(o)&&(l.kind=o),v.defined(c)&&(l.collapsedText=c),l}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.uinteger(i.startLine)&&v.uinteger(i.startLine)&&(v.undefined(i.startCharacter)||v.uinteger(i.startCharacter))&&(v.undefined(i.endCharacter)||v.uinteger(i.endCharacter))&&(v.undefined(i.kind)||v.string(i.kind))}t.is=n})($o||($o={}));var ua;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&Oi.is(i.location)&&v.string(i.message)}t.is=n})(ua||(ua={}));var Lo;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Lo||(Lo={}));var Oo;(function(t){t.Unnecessary=1,t.Deprecated=2})(Oo||(Oo={}));var xo;(function(t){function e(n){const r=n;return v.objectLiteral(r)&&v.string(r.href)}t.is=e})(xo||(xo={}));var xi;(function(t){function e(r,i,s,a,o,c){let l={range:r,message:i};return v.defined(s)&&(l.severity=s),v.defined(a)&&(l.code=a),v.defined(o)&&(l.source=o),v.defined(c)&&(l.relatedInformation=c),l}t.create=e;function n(r){var i;let s=r;return v.defined(s)&&J.is(s.range)&&v.string(s.message)&&(v.number(s.severity)||v.undefined(s.severity))&&(v.integer(s.code)||v.string(s.code)||v.undefined(s.code))&&(v.undefined(s.codeDescription)||v.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(v.string(s.source)||v.undefined(s.source))&&(v.undefined(s.relatedInformation)||v.typedArray(s.relatedInformation,ua.is))}t.is=n})(xi||(xi={}));var Fn;(function(t){function e(r,i,...s){let a={title:r,command:i};return v.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.title)&&v.string(i.command)}t.is=n})(Fn||(Fn={}));var wt;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return v.objectLiteral(a)&&v.string(a.newText)&&J.is(a.range)}t.is=i})(wt||(wt={}));var Ln;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&v.string(i.label)&&(v.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(v.string(i.description)||i.description===void 0)}t.is=n})(Ln||(Ln={}));var Ge;(function(t){function e(n){const r=n;return v.string(r)}t.is=e})(Ge||(Ge={}));var Bt;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return wt.is(a)&&(Ln.is(a.annotationId)||Ge.is(a.annotationId))}t.is=i})(Bt||(Bt={}));var Di;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&Mi.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Di||(Di={}));var $r;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&v.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ge.is(i.annotationId))}t.is=n})($r||($r={}));var Lr;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&v.string(i.oldUri)&&v.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||v.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||v.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ge.is(i.annotationId))}t.is=n})(Lr||(Lr={}));var Or;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&v.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||v.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||v.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Ge.is(i.annotationId))}t.is=n})(Or||(Or={}));var da;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>v.string(i.kind)?$r.is(i)||Lr.is(i)||Or.is(i):Di.is(i)))}t.is=e})(da||(da={}));class ks{constructor(e,n){this.edits=e,this.changeAnnotations=n}insert(e,n,r){let i,s;if(r===void 0?i=wt.insert(e,n):Ge.is(r)?(s=r,i=Bt.insert(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Bt.insert(e,n,s)),this.edits.push(i),s!==void 0)return s}replace(e,n,r){let i,s;if(r===void 0?i=wt.replace(e,n):Ge.is(r)?(s=r,i=Bt.replace(e,n,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Bt.replace(e,n,s)),this.edits.push(i),s!==void 0)return s}delete(e,n){let r,i;if(n===void 0?r=wt.del(e):Ge.is(n)?(i=n,r=Bt.del(e,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Bt.del(e,i)),this.edits.push(r),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class Zl{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,n){let r;if(Ge.is(e)?r=e:(r=this.nextId(),n=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(n===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=n,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class Ny{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Zl(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(n=>{if(Di.is(n)){const r=new ks(n.edits,this._changeAnnotations);this._textEditChanges[n.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(n=>{const r=new ks(e.changes[n]);this._textEditChanges[n]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Mi.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const n={uri:e.uri,version:e.version};let r=this._textEditChanges[n.uri];if(!r){const i=[],s={textDocument:n,edits:i};this._workspaceEdit.documentChanges.push(s),r=new ks(i,this._changeAnnotations),this._textEditChanges[n.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let n=this._textEditChanges[e];if(!n){let r=[];this._workspaceEdit.changes[e]=r,n=new ks(r),this._textEditChanges[e]=n}return n}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Zl,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Ln.is(n)||Ge.is(n)?i=n:r=n;let s,a;if(i===void 0?s=$r.create(e,r):(a=Ge.is(i)?i:this._changeAnnotations.manage(i),s=$r.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}renameFile(e,n,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;Ln.is(r)||Ge.is(r)?s=r:i=r;let a,o;if(s===void 0?a=Lr.create(e,n,i):(o=Ge.is(s)?s:this._changeAnnotations.manage(s),a=Lr.create(e,n,i,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o}deleteFile(e,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Ln.is(n)||Ge.is(n)?i=n:r=n;let s,a;if(i===void 0?s=Or.create(e,r):(a=Ge.is(i)?i:this._changeAnnotations.manage(i),s=Or.create(e,r,a)),this._workspaceEdit.documentChanges.push(s),a!==void 0)return a}}var Do;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)}t.is=n})(Do||(Do={}));var Mo;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)&&v.integer(i.version)}t.is=n})(Mo||(Mo={}));var Mi;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)&&(i.version===null||v.integer(i.version))}t.is=n})(Mi||(Mi={}));var Fo;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.string(i.uri)&&v.string(i.languageId)&&v.integer(i.version)&&v.string(i.text)}t.is=n})(Fo||(Fo={}));var fa;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(fa||(fa={}));var xr;(function(t){function e(n){const r=n;return v.objectLiteral(n)&&fa.is(r.kind)&&v.string(r.value)}t.is=e})(xr||(xr={}));var Go;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Go||(Go={}));var Uo;(function(t){t.PlainText=1,t.Snippet=2})(Uo||(Uo={}));var qo;(function(t){t.Deprecated=1})(qo||(qo={}));var jo;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&v.string(i.newText)&&J.is(i.insert)&&J.is(i.replace)}t.is=n})(jo||(jo={}));var zo;(function(t){t.asIs=1,t.adjustIndentation=2})(zo||(zo={}));var Bo;(function(t){function e(n){const r=n;return r&&(v.string(r.detail)||r.detail===void 0)&&(v.string(r.description)||r.description===void 0)}t.is=e})(Bo||(Bo={}));var Wo;(function(t){function e(n){return{label:n}}t.create=e})(Wo||(Wo={}));var Vo;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(Vo||(Vo={}));var Fi;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return v.string(i)||v.objectLiteral(i)&&v.string(i.language)&&v.string(i.value)}t.is=n})(Fi||(Fi={}));var Ko;(function(t){function e(n){let r=n;return!!r&&v.objectLiteral(r)&&(xr.is(r.contents)||Fi.is(r.contents)||v.typedArray(r.contents,Fi.is))&&(n.range===void 0||J.is(n.range))}t.is=e})(Ko||(Ko={}));var Ho;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(Ho||(Ho={}));var Yo;(function(t){function e(n,r,...i){let s={label:n};return v.defined(r)&&(s.documentation=r),v.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(Yo||(Yo={}));var Xo;(function(t){t.Text=1,t.Read=2,t.Write=3})(Xo||(Xo={}));var Jo;(function(t){function e(n,r){let i={range:n};return v.number(r)&&(i.kind=r),i}t.create=e})(Jo||(Jo={}));var Qo;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Qo||(Qo={}));var Zo;(function(t){t.Deprecated=1})(Zo||(Zo={}));var ec;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(ec||(ec={}));var tc;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(tc||(tc={}));var nc;(function(t){function e(r,i,s,a,o,c){let l={name:r,detail:i,kind:s,range:a,selectionRange:o};return c!==void 0&&(l.children=c),l}t.create=e;function n(r){let i=r;return i&&v.string(i.name)&&v.number(i.kind)&&J.is(i.range)&&J.is(i.selectionRange)&&(i.detail===void 0||v.string(i.detail))&&(i.deprecated===void 0||v.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(nc||(nc={}));var rc;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(rc||(rc={}));var Gi;(function(t){t.Invoked=1,t.Automatic=2})(Gi||(Gi={}));var ic;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return v.defined(i)&&v.typedArray(i.diagnostics,xi.is)&&(i.only===void 0||v.typedArray(i.only,v.string))&&(i.triggerKind===void 0||i.triggerKind===Gi.Invoked||i.triggerKind===Gi.Automatic)}t.is=n})(ic||(ic={}));var sc;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):Fn.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&v.string(i.title)&&(i.diagnostics===void 0||v.typedArray(i.diagnostics,xi.is))&&(i.kind===void 0||v.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Fn.is(i.command))&&(i.isPreferred===void 0||v.boolean(i.isPreferred))&&(i.edit===void 0||da.is(i.edit))}t.is=n})(sc||(sc={}));var ac;(function(t){function e(r,i){let s={range:r};return v.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return v.defined(i)&&J.is(i.range)&&(v.undefined(i.command)||Fn.is(i.command))}t.is=n})(ac||(ac={}));var oc;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return v.defined(i)&&v.uinteger(i.tabSize)&&v.boolean(i.insertSpaces)}t.is=n})(oc||(oc={}));var cc;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return v.defined(i)&&J.is(i.range)&&(v.undefined(i.target)||v.string(i.target))}t.is=n})(cc||(cc={}));var lc;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return v.objectLiteral(i)&&J.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(lc||(lc={}));var uc;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(uc||(uc={}));var dc;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(dc||(dc={}));var fc;(function(t){function e(n){const r=n;return v.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(fc||(fc={}));var hc;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&J.is(i.range)&&v.string(i.text)}t.is=n})(hc||(hc={}));var pc;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&J.is(i.range)&&v.boolean(i.caseSensitiveLookup)&&(v.string(i.variableName)||i.variableName===void 0)}t.is=n})(pc||(pc={}));var mc;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&J.is(i.range)&&(v.string(i.expression)||i.expression===void 0)}t.is=n})(mc||(mc={}));var gc;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return v.defined(i)&&J.is(r.stoppedLocation)}t.is=n})(gc||(gc={}));var ha;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(ha||(ha={}));var pa;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&(i.tooltip===void 0||v.string(i.tooltip)||xr.is(i.tooltip))&&(i.location===void 0||Oi.is(i.location))&&(i.command===void 0||Fn.is(i.command))}t.is=n})(pa||(pa={}));var yc;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return v.objectLiteral(i)&&te.is(i.position)&&(v.string(i.label)||v.typedArray(i.label,pa.is))&&(i.kind===void 0||ha.is(i.kind))&&i.textEdits===void 0||v.typedArray(i.textEdits,wt.is)&&(i.tooltip===void 0||v.string(i.tooltip)||xr.is(i.tooltip))&&(i.paddingLeft===void 0||v.boolean(i.paddingLeft))&&(i.paddingRight===void 0||v.boolean(i.paddingRight))}t.is=n})(yc||(yc={}));var Tc;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(Tc||(Tc={}));var Rc;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(Rc||(Rc={}));var vc;(function(t){function e(n){return{items:n}}t.create=e})(vc||(vc={}));var Ec;(function(t){t.Invoked=0,t.Automatic=1})(Ec||(Ec={}));var Ac;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(Ac||(Ac={}));var Sc;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(Sc||(Sc={}));var kc;(function(t){function e(n){const r=n;return v.objectLiteral(r)&&ca.is(r.uri)&&v.string(r.name)}t.is=e})(kc||(kc={}));const wy=[`
|
|
115
|
+
`,`\r
|
|
116
|
+
`,"\r"];var Cc;(function(t){function e(s,a,o,c){return new by(s,a,o,c)}t.create=e;function n(s){let a=s;return!!(v.defined(a)&&v.string(a.uri)&&(v.undefined(a.languageId)||v.string(a.languageId))&&v.uinteger(a.lineCount)&&v.func(a.getText)&&v.func(a.positionAt)&&v.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),c=i(a,(u,f)=>{let g=u.range.start.line-f.range.start.line;return g===0?u.range.start.character-f.range.start.character:g}),l=o.length;for(let u=c.length-1;u>=0;u--){let f=c[u],g=s.offsetAt(f.range.start),h=s.offsetAt(f.range.end);if(h<=l)o=o.substring(0,g)+f.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");l=g}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,c=s.slice(0,o),l=s.slice(o);i(c,a),i(l,a);let u=0,f=0,g=0;for(;u<c.length&&f<l.length;)a(c[u],l[f])<=0?s[g++]=c[u++]:s[g++]=l[f++];for(;u<c.length;)s[g++]=c[u++];for(;f<l.length;)s[g++]=l[f++];return s}})(Cc||(Cc={}));let by=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
|
|
117
|
+
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
118
|
+
`&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return te.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return te.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var v;(function(t){const e=Object.prototype.toString;function n(h){return typeof h<"u"}t.defined=n;function r(h){return typeof h>"u"}t.undefined=r;function i(h){return h===!0||h===!1}t.boolean=i;function s(h){return e.call(h)==="[object String]"}t.string=s;function a(h){return e.call(h)==="[object Number]"}t.number=a;function o(h,S,_){return e.call(h)==="[object Number]"&&S<=h&&h<=_}t.numberRange=o;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function u(h){return e.call(h)==="[object Function]"}t.func=u;function f(h){return h!==null&&typeof h=="object"}t.objectLiteral=f;function g(h,S){return Array.isArray(h)&&h.every(S)}t.typedArray=g})(v||(v={}));const Iy=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Bt},get ChangeAnnotation(){return Ln},get ChangeAnnotationIdentifier(){return Ge},get CodeAction(){return sc},get CodeActionContext(){return ic},get CodeActionKind(){return rc},get CodeActionTriggerKind(){return Gi},get CodeDescription(){return xo},get CodeLens(){return ac},get Color(){return la},get ColorInformation(){return Io},get ColorPresentation(){return _o},get Command(){return Fn},get CompletionItem(){return Wo},get CompletionItemKind(){return Go},get CompletionItemLabelDetails(){return Bo},get CompletionItemTag(){return qo},get CompletionList(){return Vo},get CreateFile(){return $r},get DeleteFile(){return Or},get Diagnostic(){return xi},get DiagnosticRelatedInformation(){return ua},get DiagnosticSeverity(){return Lo},get DiagnosticTag(){return Oo},get DocumentHighlight(){return Jo},get DocumentHighlightKind(){return Xo},get DocumentLink(){return cc},get DocumentSymbol(){return nc},get DocumentUri(){return No},EOL:wy,get FoldingRange(){return $o},get FoldingRangeKind(){return Po},get FormattingOptions(){return oc},get Hover(){return Ko},get InlayHint(){return yc},get InlayHintKind(){return ha},get InlayHintLabelPart(){return pa},get InlineCompletionContext(){return Sc},get InlineCompletionItem(){return Rc},get InlineCompletionList(){return vc},get InlineCompletionTriggerKind(){return Ec},get InlineValueContext(){return gc},get InlineValueEvaluatableExpression(){return mc},get InlineValueText(){return hc},get InlineValueVariableLookup(){return pc},get InsertReplaceEdit(){return jo},get InsertTextFormat(){return Uo},get InsertTextMode(){return zo},get Location(){return Oi},get LocationLink(){return bo},get MarkedString(){return Fi},get MarkupContent(){return xr},get MarkupKind(){return fa},get OptionalVersionedTextDocumentIdentifier(){return Mi},get ParameterInformation(){return Ho},get Position(){return te},get Range(){return J},get RenameFile(){return Lr},get SelectedCompletionInfo(){return Ac},get SelectionRange(){return lc},get SemanticTokenModifiers(){return dc},get SemanticTokenTypes(){return uc},get SemanticTokens(){return fc},get SignatureInformation(){return Yo},get StringValue(){return Tc},get SymbolInformation(){return ec},get SymbolKind(){return Qo},get SymbolTag(){return Zo},get TextDocument(){return Cc},get TextDocumentEdit(){return Di},get TextDocumentIdentifier(){return Do},get TextDocumentItem(){return Fo},get TextEdit(){return wt},get URI(){return ca},get VersionedTextDocumentIdentifier(){return Mo},WorkspaceChange:Ny,get WorkspaceEdit(){return da},get WorkspaceFolder(){return kc},get WorkspaceSymbol(){return tc},get integer(){return wo},get uinteger(){return Li}},Symbol.toStringTag,{value:"Module"}));class _y{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(e){return this.rootNode=new Cf(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new sl;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new Nc(e.startOffset,e.image.length,po(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new Nc(s.startOffset,s.image.length,po(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&!e.$infixName&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();(r==null?void 0:r.content.length)===0&&this.removeNode(r)}}class kf{get hidden(){return!1}get astNode(){var n,r;const e=typeof((n=this._astNode)==null?void 0:n.$type)=="string"?this._astNode:(r=this.container)==null?void 0:r.astNode;if(!e)throw new Error("This node has no associated AST element");return e}set astNode(e){this._astNode=e}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Nc extends kf{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class sl extends kf{constructor(){super(...arguments),this.content=new al(this)}get offset(){var e;return((e=this.firstNonHiddenNode)==null?void 0:e.offset)??0}get length(){return this.end-this.offset}get end(){var e;return((e=this.lastNonHiddenNode)==null?void 0:e.end)??0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:te.create(0,0),end:te.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class al extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,al.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class Cf extends sl{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const wc=Symbol("Datatype");function Ba(t){return t.$type===wc}const eu="",Nf=t=>t.endsWith(eu)?t:t+eu;class wf{constructor(e){var i;this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";(i=e.shared.profilers.LangiumProfiler)!=null&&i.isActive("parsing")?this.wrapper=new xy(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider},e.shared.profilers.LangiumProfiler.createTask("parsing",e.LanguageMetaData.languageId)):this.wrapper=new If(n,{...e.parser.ParserConfig,skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider})}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Py extends wf{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new _y,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e);let i;Ys(e)&&(i=e.name,this.registerPrecedenceMap(e));const s=this.wrapper.DEFINE_RULE(Nf(e.name),this.startImplementation(r,i,n).bind(this));return this.allRules.set(e.name,s),Xt(e)&&e.entry&&(this.mainRule=s),s}registerPrecedenceMap(e){const n=e.name,r=new Map;for(let i=0;i<e.operators.precedences.length;i++){const s=e.operators.precedences[i];for(const a of s.operators)r.set(a.value,{precedence:i,rightAssoc:s.associativity==="right"})}this.operatorPrecedence.set(n,r)}computeRuleType(e){return Ys(e)?$i(e):e.fragment?void 0:_d(e)?wc:$i(e)}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=this.doParse(i);return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,so(s,{deep:!0}),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}doParse(e){let n=this.wrapper.rule(e);if(this.stack.length>0&&(n=this.construct()),n===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return n}startImplementation(e,n,r){return i=>{const s=!this.isRecording()&&e!==void 0;if(s){const a={$type:e};this.stack.push(a),e===wc?a.value="":n!==void 0&&(a.$infixName=n)}return r(i),s?this.construct():void 0}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,crossRef:c}=this.getAssignment(r),l=this.current;if(o){const u=xn(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,u,a,c)}else if(Ba(l)){let u=i.image;xn(r)||(u=this.converter.convert(u,a).toString()),l.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));let o;try{o=this.wrapper.wrapSubrule(e,n,s)}finally{this.isRecording()||(o===void 0&&!r&&(o=this.construct()),o!==void 0&&a&&a.length>0&&this.performSubruleAssignment(o,i,a))}}performSubruleAssignment(e,n,r){const{assignment:i,crossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(Ba(a))a.value+=e.toString();else if(typeof e=="object"&&e){const c=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(c)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.stack.pop();return this.nodeBuilder.construct(e),"$infixName"in e?this.constructInfix(e,this.operatorPrecedence.get(e.$infixName)):Ba(e)?this.converter.convert(e.value,e.$cstNode):(Fh(this.astReflection,e),e)}constructInfix(e,n){const r=e.parts;if(!Array.isArray(r)||r.length===0)return;const i=e.operators;if(!Array.isArray(i)||r.length<2)return r[0];let s=0,a=-1;for(let _=0;_<i.length;_++){const $=i[_],N=n.get($)??{precedence:1/0,rightAssoc:!1};N.precedence>a?(a=N.precedence,s=_):N.precedence===a&&(N.rightAssoc||(s=_))}const o=i.slice(0,s),c=i.slice(s+1),l=r.slice(0,s+1),u=r.slice(s+1),f={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:l,operators:o},g={$infixName:e.$infixName,$type:e.$type,$cstNode:e.$cstNode,parts:u,operators:c},h=this.constructInfix(f,n),S=this.constructInfix(g,n);return{$type:e.$type,$cstNode:e.$cstNode,left:h,operator:i[s],right:S}}getAssignment(e){if(!this.assignmentMap.has(e)){const n=Ta(e,On);this.assignmentMap.set(e,{assignment:n,crossRef:n&&va(n.terminal)?n.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s==="single"&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):s==="multi"&&typeof r=="string"?o=this.linker.buildMultiReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class $y{buildMismatchTokenMessage(e){return dr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return dr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return dr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return dr.buildEarlyExitMessage(e)}}class bf extends $y{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class Ly extends wf{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(Nf(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const Oy={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new bf};class If extends Gg{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,{...Oy,lookaheadStrategy:r?new Zc({maxLookahead:n.maxLookahead}):new ay({logging:n.skipValidations?()=>{}:void 0}),...n})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n,r){return this.RULE(e,n,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n,void 0)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}rule(e){return e.call(this,{})}}class xy extends If{constructor(e,n,r){super(e,n),this.task=r}rule(e){this.task.start(),this.task.startSubTask(this.ruleName(e));try{return super.rule(e)}finally{this.task.stopSubTask(this.ruleName(e)),this.task.stop()}}ruleName(e){return e.ruleName}subrule(e,n,r){this.task.startSubTask(this.ruleName(n));try{return super.subrule(e,n,r)}finally{this.task.stopSubTask(this.ruleName(n))}}}function _f(t,e,n){return Dy({parser:e,tokens:n,ruleNames:new Map},t),e}function Dy(t,e){const n=Cd(e,!1),r=me(e.rules).filter(Xt).filter(s=>n.has(s));for(const s of r){const a={...t,consume:1,optional:1,subrule:1,many:1,or:1};t.parser.rule(s,Gn(a,s.definition))}const i=me(e.rules).filter(Ys).filter(s=>n.has(s));for(const s of i)t.parser.rule(s,My(t,s))}function My(t,e){const n=e.call.rule.ref;if(!n)throw new Error("Could not resolve reference to infix operator rule: "+e.call.rule.$refText);if(Jt(n))throw new Error("Cannot use terminal rule in infix expression");const r=e.operators.precedences.flatMap(h=>h.operators),i={$type:"Group",elements:[]},s={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:e.call},a={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(s,a);const c={$container:a,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:r}},l={...s,$container:a};a.elements.push(c,l);const f=r.map(h=>t.tokens[h.value]).map((h,S)=>({ALT:()=>t.parser.consume(S,h,c)}));let g;return h=>{g??(g=ol(t,n)),t.parser.subrule(0,g,!1,s,h),t.parser.many(0,{DEF:()=>{t.parser.alternatives(0,f),t.parser.subrule(1,g,!1,l,h)}})}}function Gn(t,e,n=!1){let r;if(xn(e))r=By(t,e);else if(Ra(e))r=Fy(t,e);else if(On(e))r=Gn(t,e.terminal);else if(va(e))r=Pf(t,e);else if(Dn(e))r=Gy(t,e);else if(Td(e))r=qy(t,e);else if(vd(e))r=jy(t,e);else if(Wc(e))r=zy(t,e);else if(Bh(e)){const i=t.consume++;r=()=>t.parser.consume(i,sn,e)}else throw new Ad(e.$cstNode,`Unexpected element type: ${e.$type}`);return $f(t,n?void 0:ma(e),r,e.cardinality)}function Fy(t,e){const n=$i(e);return()=>t.parser.action(n,e)}function Gy(t,e){const n=e.rule.ref;if(Wi(n)){const r=t.subrule++,i=Xt(n)&&n.fragment,s=e.arguments.length>0?Uy(n,e.arguments):()=>({});let a;return o=>{a??(a=ol(t,n)),t.parser.subrule(r,a,i,e,s(o))}}else if(Jt(n)){const r=t.consume++,i=bc(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Vi();else throw new Ad(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function Uy(t,e){if(e.some(r=>r.calledByName)){const r=e.map(i=>{var s,a;return{parameterName:(a=(s=i.parameter)==null?void 0:s.ref)==null?void 0:a.name,predicate:Nt(i.value)}});return i=>{const s={};for(const{parameterName:a,predicate:o}of r)a&&(s[a]=o(i));return s}}else{const r=e.map(i=>Nt(i.value));return i=>{const s={};for(let a=0;a<r.length;a++)if(a<t.parameters.length){const o=t.parameters[a].name,c=r[a];s[o]=c(i)}return s}}}function Nt(t){if(zh(t)){const e=Nt(t.left),n=Nt(t.right);return r=>e(r)||n(r)}else if(jh(t)){const e=Nt(t.left),n=Nt(t.right);return r=>e(r)&&n(r)}else if(Kh(t)){const e=Nt(t.value);return n=>!e(n)}else if(Hh(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(Uh(t)){const e=!!t.true;return()=>e}Vi()}function qy(t,e){if(e.elements.length===1)return Gn(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Gn(t,i,!0)},a=ma(i);a&&(s.GATE=Nt(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function jy(t,e){if(e.elements.length===1)return Gn(t,e.elements[0]);const n=[];for(const o of e.elements){const c={ALT:Gn(t,o,!0)},l=ma(o);l&&(c.GATE=Nt(l)),n.push(c)}const r=t.or++,i=(o,c)=>{const l=c.getRuleStack().join("-");return`uGroup_${o}_${l}`},s=o=>t.parser.alternatives(r,n.map((c,l)=>{const u={ALT:()=>!0},f=t.parser;u.ALT=()=>{if(c.ALT(o),!f.isRecording()){const h=i(r,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);const S=f.unorderedGroups.get(h);typeof(S==null?void 0:S[l])>"u"&&(S[l]=!0)}};const g=c.GATE;return g?u.GATE=()=>g(o):u.GATE=()=>{const h=f.unorderedGroups.get(i(r,f));return!(h!=null&&h[l])},u})),a=$f(t,ma(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function zy(t,e){const n=e.elements.map(r=>Gn(t,r));return r=>n.forEach(i=>i(r))}function ma(t){if(Wc(t))return t.guardCondition}function Pf(t,e,n=e.terminal){if(n)if(Dn(n)&&Xt(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;let s;return a=>{s??(s=ol(t,r)),t.parser.subrule(i,s,!1,e,a)}}else if(Dn(n)&&Jt(n.rule.ref)){const r=t.consume++,i=bc(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(xn(n)){const r=t.consume++,i=bc(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=bd(e.type.ref),i=r==null?void 0:r.terminal;if(!i)throw new Error("Could not find name assignment for type: "+$i(e.type.ref));return Pf(t,e,i)}}function By(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function $f(t,e,n,r){const i=e&&Nt(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:Yl(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:Yl(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else Vi()}function ol(t,e){const n=Wy(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Wy(t,e){if(Wi(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Xt(r);)(Wc(r)||Td(r)||vd(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function bc(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Vy(t){const e=t.Grammar,n=t.parser.Lexer,r=new Ly(t);return _f(e,r,n.definition),r.finalize(),r}function Ky(t){const e=Hy(t);return e.finalize(),e}function Hy(t){const e=t.Grammar,n=t.parser.Lexer,r=new Py(t);return _f(e,r,n.definition)}class Lf{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=me(Cd(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return s.push(...i),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Jt).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Kc(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=kd(n)?Qe.SKIPPED:"hidden"),i}requiresCustomPattern(e){return!!(e.flags.includes("u")||e.flags.includes("s"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(Wi).flatMap(i=>Bi(i).filter(xn)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!(r!=null&&r.caseInsensitive)))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(Aa(e.value),"i"):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i==null?void 0:i.PATTERN;return s!=null&&s.source&&Tp("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Of{convert(e,n){let r=n.grammarSource;if(va(r)&&(r=Ap(r)),Dn(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return qt.convertInt(n);case"STRING":return qt.convertString(n);case"ID":return qt.convertID(n)}switch((i=Ip(e))==null?void 0:i.toLowerCase()){case"number":return qt.convertNumber(n);case"boolean":return qt.convertBoolean(n);case"bigint":return qt.convertBigint(n);case"date":return qt.convertDate(n);default:return n}}}var qt;(function(t){function e(l){let u="";for(let f=1;f<l.length-1;f++){const g=l.charAt(f);if(g==="\\"){const h=l.charAt(++f);u+=n(h)}else u+=g}return u}t.convertString=e;function n(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
119
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function r(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=r;function i(l){return parseInt(l)}t.convertInt=i;function s(l){return BigInt(l)}t.convertBigint=s;function a(l){return new Date(l)}t.convertDate=a;function o(l){return Number(l)}t.convertNumber=o;function c(l){return l.toLowerCase()==="true"}t.convertBoolean=c})(qt||(qt={}));var mn={},Cs={},tu;function qn(){if(tu)return Cs;tu=1,Object.defineProperty(Cs,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return(function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r})(e||(e={})),Cs.default=e,Cs}var xe={},nu;function Qi(){if(nu)return xe;nu=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.stringArray=xe.array=xe.func=xe.error=xe.number=xe.string=xe.boolean=void 0;function t(o){return o===!0||o===!1}xe.boolean=t;function e(o){return typeof o=="string"||o instanceof String}xe.string=e;function n(o){return typeof o=="number"||o instanceof Number}xe.number=n;function r(o){return o instanceof Error}xe.error=r;function i(o){return typeof o=="function"}xe.func=i;function s(o){return Array.isArray(o)}xe.array=s;function a(o){return s(o)&&o.every(c=>e(c))}return xe.stringArray=a,xe}var gn={},ru;function Ur(){if(ru)return gn;ru=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.Emitter=gn.Event=void 0;const t=qn();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(gn.Event=e={}));class n{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 c=0,l=this._callbacks.length;c<l;c++)if(this._callbacks[c]===s)if(this._contexts[c]===a){this._callbacks.splice(c,1),this._contexts.splice(c,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),c=this._contexts.slice(0);for(let l=0,u=o.length;l<u;l++)try{a.push(o[l].apply(c[l],s))}catch(f){(0,t.default)().console.error(f)}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 n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,a);const c={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,a),c.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(c),c}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return gn.Emitter=r,r._noop=function(){},gn}var iu;function _a(){if(iu)return mn;iu=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.CancellationTokenSource=mn.CancellationToken=void 0;const t=qn(),e=Qi(),n=Ur();var r;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(l){const u=l;return u&&(u===o.None||u===o.Cancelled||e.boolean(u.isCancellationRequested)&&!!u.onCancellationRequested)}o.is=c})(r||(mn.CancellationToken=r={}));const i=Object.freeze(function(o,c){const l=(0,t.default)().timer.setTimeout(o.bind(c),0);return{dispose(){l.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 n.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 mn.CancellationTokenSource=a,mn}var ye=_a();function Yy(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Bs=0,Xy=10;function Jy(){return Bs=performance.now(),new ye.CancellationTokenSource}const fr=Symbol("OperationCancelled");function Pa(t){return t===fr}async function Ke(t){if(t===ye.CancellationToken.None)return;const e=performance.now();if(e-Bs>=Xy&&(Bs=e,await Yy(),Bs=performance.now()),t.isCancellationRequested)throw fr}class cl{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Ui{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(const r of e)if(Ui.isIncremental(r)){const i=Df(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let l=this._lineOffsets;const u=su(r.text,!1,s);if(c-o===u.length)for(let g=0,h=u.length;g<h;g++)l[g+o+1]=u[g];else u.length<1e4?l.splice(o+1,c-o,...u):this._lineOffsets=l=l.slice(0,o+1).concat(u,l.slice(c+1));const f=r.text.length-(a-s);if(f!==0)for(let g=o+1+u.length,h=l.length;g<h;g++)l[g]=l[g]+f}else if(Ui.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=su(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const n=this.getLineOffsets();let r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){const a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&xf(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Ic;(function(t){function e(i,s,a,o){return new Ui(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof Ui)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const a=i.getText(),o=_c(s.map(Qy),(u,f)=>{const g=u.range.start.line-f.range.start.line;return g===0?u.range.start.character-f.range.start.character:g});let c=0;const l=[];for(const u of o){const f=i.offsetAt(u.range.start);if(f<c)throw new Error("Overlapping edit");f>c&&l.push(a.substring(c,f)),u.newText.length&&l.push(u.newText),c=i.offsetAt(u.range.end)}return l.push(a.substr(c)),l.join("")}t.applyEdits=r})(Ic||(Ic={}));function _c(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);_c(r,e),_c(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function su(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);xf(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function xf(t){return t===13||t===10}function Df(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Qy(t){const e=Df(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var Mf;(()=>{var t={975:P=>{function R(y){if(typeof y!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(y))}function m(y,T){for(var k,D="",G=0,M=-1,j=0,B=0;B<=y.length;++B){if(B<y.length)k=y.charCodeAt(B);else{if(k===47)break;k=47}if(k===47){if(!(M===B-1||j===1))if(M!==B-1&&j===2){if(D.length<2||G!==2||D.charCodeAt(D.length-1)!==46||D.charCodeAt(D.length-2)!==46){if(D.length>2){var ie=D.lastIndexOf("/");if(ie!==D.length-1){ie===-1?(D="",G=0):G=(D=D.slice(0,ie)).length-1-D.lastIndexOf("/"),M=B,j=0;continue}}else if(D.length===2||D.length===1){D="",G=0,M=B,j=0;continue}}T&&(D.length>0?D+="/..":D="..",G=2)}else D.length>0?D+="/"+y.slice(M+1,B):D=y.slice(M+1,B),G=B-M-1;M=B,j=0}else k===46&&j!==-1?++j:j=-1}return D}var C={resolve:function(){for(var y,T="",k=!1,D=arguments.length-1;D>=-1&&!k;D--){var G;D>=0?G=arguments[D]:(y===void 0&&(y=process.cwd()),G=y),R(G),G.length!==0&&(T=G+"/"+T,k=G.charCodeAt(0)===47)}return T=m(T,!k),k?T.length>0?"/"+T:"/":T.length>0?T:"."},normalize:function(y){if(R(y),y.length===0)return".";var T=y.charCodeAt(0)===47,k=y.charCodeAt(y.length-1)===47;return(y=m(y,!T)).length!==0||T||(y="."),y.length>0&&k&&(y+="/"),T?"/"+y:y},isAbsolute:function(y){return R(y),y.length>0&&y.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var y,T=0;T<arguments.length;++T){var k=arguments[T];R(k),k.length>0&&(y===void 0?y=k:y+="/"+k)}return y===void 0?".":C.normalize(y)},relative:function(y,T){if(R(y),R(T),y===T||(y=C.resolve(y))===(T=C.resolve(T)))return"";for(var k=1;k<y.length&&y.charCodeAt(k)===47;++k);for(var D=y.length,G=D-k,M=1;M<T.length&&T.charCodeAt(M)===47;++M);for(var j=T.length-M,B=G<j?G:j,ie=-1,V=0;V<=B;++V){if(V===B){if(j>B){if(T.charCodeAt(M+V)===47)return T.slice(M+V+1);if(V===0)return T.slice(M+V)}else G>B&&(y.charCodeAt(k+V)===47?ie=V:V===0&&(ie=0));break}var be=y.charCodeAt(k+V);if(be!==T.charCodeAt(M+V))break;be===47&&(ie=V)}var ne="";for(V=k+ie+1;V<=D;++V)V!==D&&y.charCodeAt(V)!==47||(ne.length===0?ne+="..":ne+="/..");return ne.length>0?ne+T.slice(M+ie):(M+=ie,T.charCodeAt(M)===47&&++M,T.slice(M))},_makeLong:function(y){return y},dirname:function(y){if(R(y),y.length===0)return".";for(var T=y.charCodeAt(0),k=T===47,D=-1,G=!0,M=y.length-1;M>=1;--M)if((T=y.charCodeAt(M))===47){if(!G){D=M;break}}else G=!1;return D===-1?k?"/":".":k&&D===1?"//":y.slice(0,D)},basename:function(y,T){if(T!==void 0&&typeof T!="string")throw new TypeError('"ext" argument must be a string');R(y);var k,D=0,G=-1,M=!0;if(T!==void 0&&T.length>0&&T.length<=y.length){if(T.length===y.length&&T===y)return"";var j=T.length-1,B=-1;for(k=y.length-1;k>=0;--k){var ie=y.charCodeAt(k);if(ie===47){if(!M){D=k+1;break}}else B===-1&&(M=!1,B=k+1),j>=0&&(ie===T.charCodeAt(j)?--j==-1&&(G=k):(j=-1,G=B))}return D===G?G=B:G===-1&&(G=y.length),y.slice(D,G)}for(k=y.length-1;k>=0;--k)if(y.charCodeAt(k)===47){if(!M){D=k+1;break}}else G===-1&&(M=!1,G=k+1);return G===-1?"":y.slice(D,G)},extname:function(y){R(y);for(var T=-1,k=0,D=-1,G=!0,M=0,j=y.length-1;j>=0;--j){var B=y.charCodeAt(j);if(B!==47)D===-1&&(G=!1,D=j+1),B===46?T===-1?T=j:M!==1&&(M=1):T!==-1&&(M=-1);else if(!G){k=j+1;break}}return T===-1||D===-1||M===0||M===1&&T===D-1&&T===k+1?"":y.slice(T,D)},format:function(y){if(y===null||typeof y!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof y);return(function(T,k){var D=k.dir||k.root,G=k.base||(k.name||"")+(k.ext||"");return D?D===k.root?D+G:D+"/"+G:G})(0,y)},parse:function(y){R(y);var T={root:"",dir:"",base:"",ext:"",name:""};if(y.length===0)return T;var k,D=y.charCodeAt(0),G=D===47;G?(T.root="/",k=1):k=0;for(var M=-1,j=0,B=-1,ie=!0,V=y.length-1,be=0;V>=k;--V)if((D=y.charCodeAt(V))!==47)B===-1&&(ie=!1,B=V+1),D===46?M===-1?M=V:be!==1&&(be=1):M!==-1&&(be=-1);else if(!ie){j=V+1;break}return M===-1||B===-1||be===0||be===1&&M===B-1&&M===j+1?B!==-1&&(T.base=T.name=j===0&&G?y.slice(1,B):y.slice(j,B)):(j===0&&G?(T.name=y.slice(1,M),T.base=y.slice(1,B)):(T.name=y.slice(j,M),T.base=y.slice(j,B)),T.ext=y.slice(M,B)),j>0?T.dir=y.slice(0,j-1):G&&(T.dir="/"),T},sep:"/",delimiter:":",win32:null,posix:null};C.posix=C,P.exports=C}},e={};function n(P){var R=e[P];if(R!==void 0)return R.exports;var m=e[P]={exports:{}};return t[P](m,m.exports,n),m.exports}n.d=(P,R)=>{for(var m in R)n.o(R,m)&&!n.o(P,m)&&Object.defineProperty(P,m,{enumerable:!0,get:R[m]})},n.o=(P,R)=>Object.prototype.hasOwnProperty.call(P,R),n.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>g,Utils:()=>Ee}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function c(P,R){if(!P.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${P.authority}", path: "${P.path}", query: "${P.query}", fragment: "${P.fragment}"}`);if(P.scheme&&!s.test(P.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(P.path){if(P.authority){if(!a.test(P.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(P.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",u="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class g{constructor(R,m,C,y,T,k=!1){en(this,"scheme");en(this,"authority");en(this,"path");en(this,"query");en(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||l,this.authority=R.authority||l,this.path=R.path||l,this.query=R.query||l,this.fragment=R.fragment||l):(this.scheme=(function(D,G){return D||G?D:"file"})(R,k),this.authority=m||l,this.path=(function(D,G){switch(D){case"https":case"http":case"file":G?G[0]!==u&&(G=u+G):G=u}return G})(this.scheme,C||l),this.query=y||l,this.fragment=T||l,c(this,k))}static isUri(R){return R instanceof g||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return b(this)}with(R){if(!R)return this;let{scheme:m,authority:C,path:y,query:T,fragment:k}=R;return m===void 0?m=this.scheme:m===null&&(m=l),C===void 0?C=this.authority:C===null&&(C=l),y===void 0?y=this.path:y===null&&(y=l),T===void 0?T=this.query:T===null&&(T=l),k===void 0?k=this.fragment:k===null&&(k=l),m===this.scheme&&C===this.authority&&y===this.path&&T===this.query&&k===this.fragment?this:new S(m,C,y,T,k)}static parse(R,m=!1){const C=f.exec(R);return C?new S(C[2]||l,K(C[4]||l),K(C[5]||l),K(C[7]||l),K(C[9]||l),m):new S(l,l,l,l,l)}static file(R){let m=l;if(i&&(R=R.replace(/\\/g,u)),R[0]===u&&R[1]===u){const C=R.indexOf(u,2);C===-1?(m=R.substring(2),R=u):(m=R.substring(2,C),R=R.substring(C)||u)}return new S("file",m,R,l,l)}static from(R){const m=new S(R.scheme,R.authority,R.path,R.query,R.fragment);return c(m,!0),m}toString(R=!1){return w(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof g)return R;{const m=new S(R);return m._formatted=R.external,m._fsPath=R._sep===h?R.fsPath:null,m}}return R}}const h=i?1:void 0;class S extends g{constructor(){super(...arguments);en(this,"_formatted",null);en(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=b(this)),this._fsPath}toString(m=!1){return m?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)}toJSON(){const m={$mid:1};return this._fsPath&&(m.fsPath=this._fsPath,m._sep=h),this._formatted&&(m.external=this._formatted),this.path&&(m.path=this.path),this.scheme&&(m.scheme=this.scheme),this.authority&&(m.authority=this.authority),this.query&&(m.query=this.query),this.fragment&&(m.fragment=this.fragment),m}}const _={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 $(P,R,m){let C,y=-1;for(let T=0;T<P.length;T++){const k=P.charCodeAt(T);if(k>=97&&k<=122||k>=65&&k<=90||k>=48&&k<=57||k===45||k===46||k===95||k===126||R&&k===47||m&&k===91||m&&k===93||m&&k===58)y!==-1&&(C+=encodeURIComponent(P.substring(y,T)),y=-1),C!==void 0&&(C+=P.charAt(T));else{C===void 0&&(C=P.substr(0,T));const D=_[k];D!==void 0?(y!==-1&&(C+=encodeURIComponent(P.substring(y,T)),y=-1),C+=D):y===-1&&(y=T)}}return y!==-1&&(C+=encodeURIComponent(P.substring(y))),C!==void 0?C:P}function N(P){let R;for(let m=0;m<P.length;m++){const C=P.charCodeAt(m);C===35||C===63?(R===void 0&&(R=P.substr(0,m)),R+=_[C]):R!==void 0&&(R+=P[m])}return R!==void 0?R:P}function b(P,R){let m;return m=P.authority&&P.path.length>1&&P.scheme==="file"?`//${P.authority}${P.path}`:P.path.charCodeAt(0)===47&&(P.path.charCodeAt(1)>=65&&P.path.charCodeAt(1)<=90||P.path.charCodeAt(1)>=97&&P.path.charCodeAt(1)<=122)&&P.path.charCodeAt(2)===58?P.path[1].toLowerCase()+P.path.substr(2):P.path,i&&(m=m.replace(/\//g,"\\")),m}function w(P,R){const m=R?N:$;let C="",{scheme:y,authority:T,path:k,query:D,fragment:G}=P;if(y&&(C+=y,C+=":"),(T||y==="file")&&(C+=u,C+=u),T){let M=T.indexOf("@");if(M!==-1){const j=T.substr(0,M);T=T.substr(M+1),M=j.lastIndexOf(":"),M===-1?C+=m(j,!1,!1):(C+=m(j.substr(0,M),!1,!1),C+=":",C+=m(j.substr(M+1),!1,!0)),C+="@"}T=T.toLowerCase(),M=T.lastIndexOf(":"),M===-1?C+=m(T,!1,!0):(C+=m(T.substr(0,M),!1,!0),C+=T.substr(M))}if(k){if(k.length>=3&&k.charCodeAt(0)===47&&k.charCodeAt(2)===58){const M=k.charCodeAt(1);M>=65&&M<=90&&(k=`/${String.fromCharCode(M+32)}:${k.substr(3)}`)}else if(k.length>=2&&k.charCodeAt(1)===58){const M=k.charCodeAt(0);M>=65&&M<=90&&(k=`${String.fromCharCode(M+32)}:${k.substr(2)}`)}C+=m(k,!0,!1)}return D&&(C+="?",C+=m(D,!1,!1)),G&&(C+="#",C+=R?G:$(G,!1,!1)),C}function x(P){try{return decodeURIComponent(P)}catch{return P.length>3?P.substr(0,3)+x(P.substr(3)):P}}const H=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function K(P){return P.match(H)?P.replace(H,(R=>x(R))):P}var Q=n(975);const ae=Q.posix||Q,de="/";var Ee;(function(P){P.joinPath=function(R,...m){return R.with({path:ae.join(R.path,...m)})},P.resolvePath=function(R,...m){let C=R.path,y=!1;C[0]!==de&&(C=de+C,y=!0);let T=ae.resolve(C,...m);return y&&T[0]===de&&!R.authority&&(T=T.substring(1)),R.with({path:T})},P.dirname=function(R){if(R.path.length===0||R.path===de)return R;let m=ae.dirname(R.path);return m.length===1&&m.charCodeAt(0)===46&&(m=""),R.with({path:m})},P.basename=function(R){return ae.basename(R.path)},P.extname=function(R){return ae.extname(R.path)}})(Ee||(Ee={})),Mf=r})();const{URI:Tt,Utils:si}=Mf;var at;(function(t){t.basename=si.basename,t.dirname=si.dirname,t.extname=si.extname,t.joinPath=si.joinPath,t.resolvePath=si.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function n(a,o){return(a==null?void 0:a.toString())===(o==null?void 0:o.toString())}t.equals=n;function r(a,o){const c=typeof a=="string"?Tt.parse(a).path:a.path,l=typeof o=="string"?Tt.parse(o).path:o.path,u=c.split("/").filter(_=>_.length>0),f=l.split("/").filter(_=>_.length>0);if(e){const _=/^[A-Z]:$/;if(u[0]&&_.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&_.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return l.substring(1)}let g=0;for(;g<u.length&&u[g]===f[g];g++);const h="../".repeat(u.length-g),S=f.slice(g).join("/");return h+S}t.relative=r;function i(a){return Tt.parse(a.toString()).toString()}t.normalize=i;function s(a,o){let c=typeof a=="string"?a:a.path,l=typeof o=="string"?o:o.path;return l.charAt(l.length-1)==="/"&&(l=l.slice(0,-1)),c.charAt(c.length-1)==="/"&&(c=c.slice(0,-1)),l===c?!0:l.length<c.length||l.charAt(c.length)!=="/"?!1:l.startsWith(c)}t.contains=s})(at||(at={}));class Zy{constructor(){this.root={name:"",children:new Map}}normalizeUri(e){return at.normalize(e)}clear(){this.root.children.clear()}insert(e,n){const r=this.getNode(this.normalizeUri(e),!0);r.element=n}delete(e){const n=this.getNode(this.normalizeUri(e),!1);n!=null&&n.parent&&n.parent.children.delete(n.name)}has(e){var n;return((n=this.getNode(this.normalizeUri(e),!1))==null?void 0:n.element)!==void 0}hasNode(e){return this.getNode(this.normalizeUri(e),!1)!==void 0}find(e){var n;return(n=this.getNode(this.normalizeUri(e),!1))==null?void 0:n.element}findNode(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);if(r)return{name:r.name,uri:at.joinPath(Tt.parse(n),r.name).toString(),element:r.element}}findChildren(e){const n=this.normalizeUri(e),r=this.getNode(n,!1);return r?Array.from(r.children.values()).map(i=>({name:i.name,uri:at.joinPath(Tt.parse(n),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(e){const n=this.getNode(at.normalize(e),!1);return n?this.collectValues(n):[]}getNode(e,n){const r=e.split("/");e.charAt(e.length-1)==="/"&&r.pop();let i=this.root;for(const s of r){let a=i.children.get(s);if(!a)if(n)a={name:s,children:new Map,parent:i},i.children.set(s,a);else return;i=a}return i}collectValues(e){const n=[];e.element&&n.push(e.element);for(const r of e.children.values())n.push(...this.collectValues(r));return n}}var X;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(X||(X={}));class eT{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ye.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Tt.parse(e.uri),ye.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ye.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:X.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:X.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,n){var a,o;const r=(a=e.parseResult.value.$cstNode)==null?void 0:a.root.fullText,i=(o=this.textDocuments)==null?void 0:o.get(e.uri.toString()),s=i?i.getText():await this.fileSystemProvider.readFile(e.uri);if(i)Object.defineProperty(e,"textDocument",{value:i});else{const c=this.createTextDocumentGetter(e.uri,s);Object.defineProperty(e,"textDocument",{get:c})}return r!==s&&(e.parseResult=await this.parseAsync(e.uri,s,n),e.parseResult.value.$document=e),e.state=X.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=Ic.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class tT{constructor(e){this.documentTrie=new Zy,this.services=e,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.documentBuilder=()=>e.workspace.DocumentBuilder}get all(){return me(this.documentTrie.all())}addDocument(e){const n=e.uri.toString();if(this.documentTrie.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentTrie.insert(n,e)}getDocument(e){const n=e.toString();return this.documentTrie.find(n)}getDocuments(e){const n=e.toString();return this.documentTrie.findAll(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentTrie.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&this.documentBuilder().resetToState(r,X.Changed),r}deleteDocument(e){const n=e.toString(),r=this.documentTrie.find(n);return r&&(r.state=X.Changed,this.documentTrie.delete(n)),r}deleteDocuments(e){const n=e.toString(),r=this.documentTrie.findAll(n);for(const i of r)i.state=X.Changed;return this.documentTrie.delete(n),r}}const Hn=Symbol("RefResolving");class nT{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async link(e,n=ye.CancellationToken.None){var r;if((r=this.profiler)!=null&&r.isActive("linking")){const i=this.profiler.createTask("linking",this.languageId);i.start();try{for(const s of Vt(e.parseResult.value))await Ke(n),Hs(s).forEach(a=>{const o=`${s.$type}:${a.property}`;i.startSubTask(o);try{this.doLink(a,e)}finally{i.stopSubTask(o)}})}finally{i.stop()}}else for(const i of Vt(e.parseResult.value))await Ke(n),Hs(i).forEach(s=>this.doLink(s,e))}doLink(e,n){const r=e.reference;if("_ref"in r&&r._ref===void 0){r._ref=Hn;try{const i=this.getCandidate(e);if(Zr(i))r._ref=i;else{r._nodeDescription=i;const s=this.loadAstNode(i);r._ref=s??this.createLinkingError(e,i)}}catch(i){console.error(`An error occurred while resolving reference to '${r.$refText}':`,i);const s=i.message??String(i);r._ref={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${s}`}}n.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=Hn;try{const i=this.getCandidates(e),s=[];if(Zr(i))r._linkingError=i;else for(const a of i){const o=this.loadAstNode(a);o&&s.push({ref:o,$nodeDescription:a})}r._items=s}catch(i){r._linkingError={info:e,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`},r._items=[]}n.references.push(r)}}unlink(e){for(const n of e.references)"_ref"in n?(n._ref=void 0,delete n._nodeDescription):"_items"in n&&(n._items=void 0,delete n._linkingError);e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}getCandidates(e){const r=this.scopeProvider.getScope(e).getElements(e.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return r.length>0?r:this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_ref:void 0,get ref(){if(je(this._ref))return this._ref;if(Dh(this._nodeDescription)){const o=s.loadAstNode(this._nodeDescription);this._ref=o??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=Hn;const o=$s(e).$document,c=s.getLinkedNode({reference:a,container:e,property:n});if(c.error&&o&&o.state<X.ComputedScopes)return this._ref=void 0;this._ref=c.node??c.error,this._nodeDescription=c.descr,o==null||o.references.push(this)}else this._ref===Hn&&s.throwCyclicReferenceError(e,n,i);return je(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Zr(this._ref)?this._ref:void 0}};return a}buildMultiReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,_items:void 0,get items(){if(Array.isArray(this._items))return this._items;if(this._items===void 0){this._items=Hn;const o=$s(e).$document,c=s.getCandidates({reference:a,container:e,property:n}),l=[];if(Zr(c))this._linkingError=c;else for(const u of c){const f=s.loadAstNode(u);f&&l.push({ref:f,$nodeDescription:u})}this._items=l,o==null||o.references.push(this)}else this._items===Hn&&s.throwCyclicReferenceError(e,n,i);return Array.isArray(this._items)?this._items:[]},get error(){if(this._linkingError)return this._linkingError;if(!(this.items.length>0))return this._linkingError=s.createLinkingError({reference:a,container:e,property:n})}};return a}throwCyclicReferenceError(e,n,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${r}')`)}getLinkedNode(e){try{const n=this.getCandidate(e);if(Zr(n))return{error:n};const r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const r=n.message??String(n);return{error:{info:e,message:`An error occurred while resolving reference to '${e.reference.$refText}': ${r}`}}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=$s(e.container).$document;r&&r.state<X.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return{info:e,message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n}}}function rT(t){return typeof t.name=="string"}class iT{getName(e){if(rT(e))return e.name}getNameNode(e){return wd(e.$cstNode,"name")}}class sT{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator,this.documents=e.shared.workspace.LangiumDocuments,this.hasMultiReference=Vt(e.Grammar).some(n=>va(n)&&n.isMulti)}findDeclarations(e){if(e){const n=wp(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(gt(i)||nn(i))return pl(i);if(Array.isArray(i)){for(const s of i)if((gt(s)||nn(s))&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return pl(s)}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||ip(e,i)))return this.getSelfNodes(r)}}return[]}getSelfNodes(e){if(this.hasMultiReference){const n=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e)),r=this.getNodeFromReferenceDescription(n.head());if(r){for(const i of Hs(r))if(nn(i.reference)&&i.reference.items.some(s=>s.ref===e))return i.reference.items.map(s=>s.ref)}return[e]}else return[e]}getNodeFromReferenceDescription(e){if(!e)return;const n=this.documents.getDocument(e.sourceUri);if(n)return this.nodeLocator.getAstNode(n.parseResult.value,e.sourcePath)}findDeclarationNodes(e){const n=this.findDeclarations(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i)??i.$cstNode;s&&r.push(s)}return r}findReferences(e,n){const r=[];n.includeDeclaration&&r.push(...this.getSelfReferences(e));let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>at.equals(s.sourceUri,n.documentUri))),r.push(...i),me(r)}getSelfReferences(e){const n=this.getSelfNodes(e),r=[];for(const i of n){const s=this.nameProvider.getNameNode(i);if(s){const a=Wt(i),o=this.nodeLocator.getAstNodePath(i);r.push({sourceUri:a.uri,sourcePath:o,targetUri:a.uri,targetPath:o,segment:Xs(s),local:!0})}}return r}}class qi{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return io.sum(me(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){return this.map.get(e)??[]}getStream(e){const n=this.map.get(e);return n?me(n):gd}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return me(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return me(this.map.keys())}values(){return me(this.map.values()).flat()}entriesGroupedByKey(){return me(this.map.entries())}}class au{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class aT{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(e,n=ye.CancellationToken.None){return this.collectExportedSymbolsForNode(e.parseResult.value,e,void 0,n)}async collectExportedSymbolsForNode(e,n,r=Bc,i=ye.CancellationToken.None){const s=[];this.addExportedSymbol(e,s,n);for(const a of r(e))await Ke(i),this.addExportedSymbol(a,s,n);return s}addExportedSymbol(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async collectLocalSymbols(e,n=ye.CancellationToken.None){const r=e.parseResult.value,i=new qi;for(const s of Bi(r))await Ke(n),this.addLocalSymbol(s,e,i);return i}addLocalSymbol(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class ou{constructor(e,n,r){this.elements=e,this.outerScope=n,this.caseInsensitive=(r==null?void 0:r.caseInsensitive)??!1,this.concatOuterScope=(r==null?void 0:r.concatOuterScope)??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===n):this.elements.find(i=>i.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===n):this.elements.filter(i=>i.name===e);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(e)):r}}class oT{constructor(e,n,r){this.elements=new qi,this.caseInsensitive=(r==null?void 0:r.caseInsensitive)??!1,this.concatOuterScope=(r==null?void 0:r.concatOuterScope)??!0;for(const i of e){const s=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(s,i)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getElements(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);return(this.concatOuterScope||r.length===0)&&this.outerScope?me(r).concat(this.outerScope.getElements(e)):me(r)}getAllElements(){let e=me(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class Ff{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 cT extends Ff{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class lT extends Ff{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class uT extends cT{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class dT{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 uT(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=Wt(e.container).localSymbols;if(i){let a=e.container;do i.has(a)&&n.push(i.getStream(a).filter(o=>this.reflection.isSubtype(o.type,r))),a=a.$container;while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new ou(me(e),n,r)}createScopeForNodes(e,n,r){const i=me(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new ou(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new oT(this.indexManager.allElements(e)))}}function fT(t){return typeof t.$comment=="string"}function cu(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class hT{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n==null?void 0:n.replacer,s=(o,c)=>this.replacer(o,c,r),a=i?(o,c)=>i(o,c,s):s;try{return this.currentDocument=Wt(e),JSON.stringify(e,a,n==null?void 0:n.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var c,l,u;if(!this.ignoreProperties.has(e))if(gt(n)){const f=n.ref,g=r?n.$refText:void 0;if(f){const h=Wt(f);let S="";this.currentDocument&&this.currentDocument!==h&&(o?S=o(h.uri,f):S=h.uri.toString());const _=this.astNodeLocator.getAstNodePath(f);return{$ref:`${S}#${_}`,$refText:g}}else return{$error:((c=n.error)==null?void 0:c.message)??"Could not resolve reference",$refText:g}}else if(nn(n)){const f=r?n.$refText:void 0,g=[];for(const h of n.items){const S=h.ref,_=Wt(h.ref);let $="";this.currentDocument&&this.currentDocument!==_&&(o?$=o(_.uri,S):$=_.uri.toString());const N=this.astNodeLocator.getAstNodePath(S);g.push(`${$}#${N}`)}return{$refs:g,$refText:f}}else if(je(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo({...n}),(!e||n.$document)&&(f!=null&&f.$textRegion)&&(f.$textRegion.documentURI=(l=this.currentDocument)==null?void 0:l.uri.toString())),i&&!e&&(f??(f={...n}),f.$sourceText=(u=n.$cstNode)==null?void 0:u.text),a){f??(f={...n});const g=this.commentProvider.getComment(n);g&&(f.$comment=g.replace(/\r/g,""))}return f??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=kp(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[c,l]of Object.entries(e))if(Array.isArray(l))for(let u=0;u<l.length;u++){const f=l[u];cu(f)?l[u]=this.reviveReference(e,c,n,f,r):je(f)&&this.linkNode(f,n,r,e,c,u)}else cu(l)?e[c]=this.reviveReference(e,c,n,l,r):je(l)&&this.linkNode(l,n,r,e,c);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,n,r,i,s){let a=i.$refText,o=i.$error,c;if(i.$ref){const l=this.getRefNode(r,i.$ref,s.uriConverter);if(je(l))return a||(a=this.nameProvider.getName(l)),{$refText:a??"",ref:l};o=l}else if(i.$refs){const l=[];for(const u of i.$refs){const f=this.getRefNode(r,u,s.uriConverter);je(f)&&l.push({ref:f})}if(l.length===0)c={$refText:a??"",items:l},o??(o="Could not resolve multi-reference");else return{$refText:a??"",items:l}}if(o)return c??(c={$refText:a??"",ref:void 0}),c.error={info:{container:e,property:n,reference:c},message:o},c}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):Tt.parse(n),l=this.langiumDocuments.getDocument(c);return l?l.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Tt.parse(n.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+n;if(i===n.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,n.substring(i+1));return o||"Could not resolve URI: "+n}catch(i){return String(i)}}}class pT{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);if(n.fileNames)for(const r of n.fileNames)this.fileNameMap.has(r)&&console.warn(`The file name ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileNameMap.set(r,e);this.languageIdMap.set(n.languageId,e)}getServices(e){var a,o;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const n=(o=(a=this.textDocuments)==null?void 0:a.get(e))==null?void 0:o.languageId;if(n!==void 0){const c=this.languageIdMap.get(n);if(c)return c}const r=at.extname(e),i=at.basename(e),s=this.fileNameMap.get(i)??this.fileExtensionMap.get(r);if(!s)throw n?new Error(`The service registry contains no services for the extension '${r}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${r}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function wi(t){return{code:t}}var Pc;(function(t){t.defaults=["fast","slow","built-in"],t.all=t.defaults})(Pc||(Pc={}));class mT{constructor(e){this.entries=new qi,this.knownCategories=new Set(Pc.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(r);for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const c={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,c)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,o)}else Vi()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(Pa(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=me(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(e){return this.knownCategories}}const gT=Object.freeze({validateNode:!0,validateChildren:!0});class yT{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData,this.profiler=e.shared.profilers.LangiumProfiler,this.languageId=e.LanguageMetaData.languageId}async validateDocument(e,n={},r=ye.CancellationToken.None){const i=e.parseResult,s=[];if(await Ke(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===mt.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===mt.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)==null?void 0:o.code)===mt.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if(Pa(a))throw a;console.error("An error occurred during validation:",a)}return await Ke(r),s}processLexingErrors(e,n,r){var s;const i=[...e.lexerErrors,...((s=e.lexerReport)==null?void 0:s.diagnostics)??[]];for(const a of i){const o=a.severity??"error",c={severity:Wa(o),range:{start:{line:a.line-1,character:a.column-1},end:{line:a.line-1,character:a.column+a.length-1}},message:a.message,data:RT(o),source:this.getSource()};n.push(c)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=po(i.token);if(s){const a={severity:Wa("error"),range:s,message:i.message,data:wi(mt.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){var i;for(const s of e.references){const a=s.error;if(a){const o={node:a.info.container,range:(i=s.$refNode)==null?void 0:i.range,property:a.info.property,index:a.info.index,data:{code:mt.LinkingError,containerType:a.info.container.$type,property:a.info.property,refText:a.info.reference.$refText}};n.push(this.toDiagnostic("error",a.message,o))}}}async validateAst(e,n,r=ye.CancellationToken.None){const i=[],s=(a,o,c)=>{i.push(this.toDiagnostic(a,o,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=ye.CancellationToken.None){const s=this.validationRegistry.checksBefore;for(const a of s)await Ke(i),await a(e,r,n.categories??[],i)}async validateAstNodes(e,n,r,i=ye.CancellationToken.None){var s;if((s=this.profiler)!=null&&s.isActive("validating")){const a=this.profiler.createTask("validating",this.languageId);a.start();try{const o=Vt(e).iterator();for(const c of o){a.startSubTask(c.$type);const l=this.validateSingleNodeOptions(c,n);if(l.validateNode)try{const u=this.validationRegistry.getChecks(c.$type,n.categories);for(const f of u)await f(c,r,i)}finally{a.stopSubTask(c.$type)}l.validateChildren||o.prune()}}finally{a.stop()}}else{const a=Vt(e).iterator();for(const o of a){await Ke(i);const c=this.validateSingleNodeOptions(o,n);if(c.validateNode){const l=this.validationRegistry.getChecks(o.$type,n.categories);for(const u of l)await u(o,r,i)}c.validateChildren||a.prune()}}}validateSingleNodeOptions(e,n){return gT}async validateAstAfter(e,n,r,i=ye.CancellationToken.None){const s=this.validationRegistry.checksAfter;for(const a of s)await Ke(i),await a(e,r,n.categories??[],i)}toDiagnostic(e,n,r){return{message:n,range:TT(r),severity:Wa(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 TT(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=wd(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Cp(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Wa(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function RT(t){switch(t){case"error":return wi(mt.LexingError);case"warning":return wi(mt.LexingWarning);case"info":return wi(mt.LexingInfo);case"hint":return wi(mt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var mt;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(mt||(mt={}));class vT{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??Wt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>a??(a=Xs(this.nameProvider.getNameNode(e)??e.$cstNode));return{node:e,name:n,get nameSegment(){return o()},selectionSegment:Xs(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class ET{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ye.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Vt(i))await Ke(n),Hs(s).forEach(a=>{a.reference.error||r.push(...this.createInfoDescriptions(a))});return r}createInfoDescriptions(e){const n=e.reference;if(n.error||!n.$refNode)return[];let r=[];gt(n)&&n.$nodeDescription?r=[n.$nodeDescription]:nn(n)&&(r=n.items.map(c=>c.$nodeDescription).filter(c=>c!==void 0));const i=Wt(e.container).uri,s=this.nodeLocator.getAstNodePath(e.container),a=[],o=Xs(n.$refNode);for(const c of r)a.push({sourceUri:i,sourcePath:s,targetUri:c.documentUri,targetPath:c.path,segment:o,local:at.equals(c.documentUri,i)});return a}}class AT{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),c=parseInt(s.substring(a+1)),l=i[o];return l==null?void 0:l[c]}return i[s]},e)}}var ST=Ur();class kT{constructor(e){this._ready=new cl,this.onConfigurationSectionUpdateEmitter=new ST.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n;this.workspaceConfig=((n=e.capabilities.workspace)==null?void 0:n.configuration)??!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){typeof e.settings!="object"||e.settings===null||Object.entries(e.settings).forEach(([n,r])=>{this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var yn={},Tn={},Ns={},Va={},q={},lu;function Gf(){if(lu)return q;lu=1,Object.defineProperty(q,"__esModule",{value:!0}),q.Message=q.NotificationType9=q.NotificationType8=q.NotificationType7=q.NotificationType6=q.NotificationType5=q.NotificationType4=q.NotificationType3=q.NotificationType2=q.NotificationType1=q.NotificationType0=q.NotificationType=q.RequestType9=q.RequestType8=q.RequestType7=q.RequestType6=q.RequestType5=q.RequestType4=q.RequestType3=q.RequestType2=q.RequestType1=q.RequestType=q.RequestType0=q.AbstractMessageSignature=q.ParameterStructures=q.ResponseError=q.ErrorCodes=void 0;const t=Qi();var e;(function(R){R.ParseError=-32700,R.InvalidRequest=-32600,R.MethodNotFound=-32601,R.InvalidParams=-32602,R.InternalError=-32603,R.jsonrpcReservedErrorRangeStart=-32099,R.serverErrorStart=-32099,R.MessageWriteError=-32099,R.MessageReadError=-32098,R.PendingResponseRejected=-32097,R.ConnectionInactive=-32096,R.ServerNotInitialized=-32002,R.UnknownErrorCode=-32001,R.jsonrpcReservedErrorRangeEnd=-32e3,R.serverErrorEnd=-32e3})(e||(q.ErrorCodes=e={}));class n extends Error{constructor(m,C,y){super(C),this.code=t.number(m)?m:e.UnknownErrorCode,this.data=y,Object.setPrototypeOf(this,n.prototype)}toJson(){const m={code:this.code,message:this.message};return this.data!==void 0&&(m.data=this.data),m}}q.ResponseError=n;class r{constructor(m){this.kind=m}static is(m){return m===r.auto||m===r.byName||m===r.byPosition}toString(){return this.kind}}q.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(m,C){this.method=m,this.numberOfParams=C}get parameterStructures(){return r.auto}}q.AbstractMessageSignature=i;class s extends i{constructor(m){super(m,0)}}q.RequestType0=s;class a extends i{constructor(m,C=r.auto){super(m,1),this._parameterStructures=C}get parameterStructures(){return this._parameterStructures}}q.RequestType=a;class o extends i{constructor(m,C=r.auto){super(m,1),this._parameterStructures=C}get parameterStructures(){return this._parameterStructures}}q.RequestType1=o;class c extends i{constructor(m){super(m,2)}}q.RequestType2=c;class l extends i{constructor(m){super(m,3)}}q.RequestType3=l;class u extends i{constructor(m){super(m,4)}}q.RequestType4=u;class f extends i{constructor(m){super(m,5)}}q.RequestType5=f;class g extends i{constructor(m){super(m,6)}}q.RequestType6=g;class h extends i{constructor(m){super(m,7)}}q.RequestType7=h;class S extends i{constructor(m){super(m,8)}}q.RequestType8=S;class _ extends i{constructor(m){super(m,9)}}q.RequestType9=_;class $ extends i{constructor(m,C=r.auto){super(m,1),this._parameterStructures=C}get parameterStructures(){return this._parameterStructures}}q.NotificationType=$;class N extends i{constructor(m){super(m,0)}}q.NotificationType0=N;class b extends i{constructor(m,C=r.auto){super(m,1),this._parameterStructures=C}get parameterStructures(){return this._parameterStructures}}q.NotificationType1=b;class w extends i{constructor(m){super(m,2)}}q.NotificationType2=w;class x extends i{constructor(m){super(m,3)}}q.NotificationType3=x;class H extends i{constructor(m){super(m,4)}}q.NotificationType4=H;class K extends i{constructor(m){super(m,5)}}q.NotificationType5=K;class Q extends i{constructor(m){super(m,6)}}q.NotificationType6=Q;class ae extends i{constructor(m){super(m,7)}}q.NotificationType7=ae;class de extends i{constructor(m){super(m,8)}}q.NotificationType8=de;class Ee extends i{constructor(m){super(m,9)}}q.NotificationType9=Ee;var P;return(function(R){function m(T){const k=T;return k&&t.string(k.method)&&(t.string(k.id)||t.number(k.id))}R.isRequest=m;function C(T){const k=T;return k&&t.string(k.method)&&T.id===void 0}R.isNotification=C;function y(T){const k=T;return k&&(k.result!==void 0||!!k.error)&&(t.string(k.id)||t.number(k.id)||k.id===null)}R.isResponse=y})(P||(q.Message=P={})),q}var Pt={},uu;function Uf(){if(uu)return Pt;uu=1;var t;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.LRUCache=Pt.LinkedMap=Pt.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(Pt.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var s;return(s=this._head)==null?void 0:s.value}get last(){var s;return(s=this._tail)==null?void 0:s.value}has(s){return this._map.has(s)}get(s,a=e.None){const o=this._map.get(s);if(o)return a!==e.None&&this.touch(o,a),o.value}set(s,a,o=e.None){let c=this._map.get(s);if(c)c.value=a,o!==e.None&&this.touch(c,o);else{switch(c={key:s,value:a,next:void 0,previous:void 0},o){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const a=this._map.get(s);if(a)return this._map.delete(s),this.removeItem(a),this._size--,a.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,a){const o=this._state;let c=this._head;for(;c;){if(a?s.bind(a)(c.value,c.key,this):s(c.value,c.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const c={value:a.key,done:!1};return a=a.next,c}else return{value:void 0,done:!0}}};return o}values(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const c={value:a.value,done:!1};return a=a.next,c}else return{value:void 0,done:!0}}};return o}entries(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const c={value:[a.key,a.value],done:!1};return a=a.next,c}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let a=this._head,o=this.size;for(;a&&o>s;)this._map.delete(a.key),a=a.next,o--;this._head=a,this._size=o,a&&(a.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const a=s.next,o=s.previous;if(!a||!o)throw new Error("Invalid list");a.previous=o,o.next=a}s.next=void 0,s.previous=void 0,this._state++}touch(s,a){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(a!==e.First&&a!==e.Last)){if(a===e.First){if(s===this._head)return;const o=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(o.previous=c,c.next=o),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(a===e.Last){if(s===this._tail)return;const o=s.next,c=s.previous;s===this._head?(o.previous=void 0,this._head=o):(o.previous=c,c.next=o),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((a,o)=>{s.push([o,a])}),s}fromJSON(s){this.clear();for(const[a,o]of s)this.set(a,o)}}Pt.LinkedMap=n;class r extends n{constructor(s,a=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,a),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,a=e.AsNew){return super.get(s,a)}peek(s){return super.get(s,e.None)}set(s,a){return super.set(s,a,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return Pt.LRUCache=r,Pt}var ai={},du;function CT(){if(du)return ai;du=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.Disposable=void 0;var t;return(function(e){function n(r){return{dispose:r}}e.create=n})(t||(ai.Disposable=t={})),ai}var Rn={},fu;function NT(){if(fu)return Rn;fu=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.SharedArrayReceiverStrategy=Rn.SharedArraySenderStrategy=void 0;const t=_a();var e;(function(a){a.Continue=0,a.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const c=new SharedArrayBuffer(4),l=new Int32Array(c,0,1);l[0]=e.Continue,this.buffers.set(o.id,c),o.$cancellationData=c}async sendCancellation(o,c){const l=this.buffers.get(c);if(l===void 0)return;const u=new Int32Array(l,0,1);Atomics.store(u,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}Rn.SharedArraySenderStrategy=n;class r{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new r(o)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(o){const c=o.$cancellationData;return c===void 0?new t.CancellationTokenSource:new i(c)}}return Rn.SharedArrayReceiverStrategy=s,Rn}var $t={},oi={},hu;function qf(){if(hu)return oi;hu=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.Semaphore=void 0;const t=qn();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return oi.Semaphore=e,oi}var pu;function wT(){if(pu)return $t;pu=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.ReadableStreamMessageReader=$t.AbstractMessageReader=$t.MessageReader=void 0;const t=qn(),e=Qi(),n=Ur(),r=qf();var i;(function(c){function l(u){let f=u;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&e.func(f.onPartialMessage)}c.is=l})(i||($t.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(l){this.errorEmitter.fire(this.asError(l))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(l){this.partialMessageEmitter.fire(l)}asError(l){return l instanceof Error?l:new Error(`Reader received error. Reason: ${e.string(l.message)?l.message:"unknown"}`)}}$t.AbstractMessageReader=s;var a;(function(c){function l(u){let f,g;const h=new Map;let S;const _=new Map;if(u===void 0||typeof u=="string")f=u??"utf-8";else{if(f=u.charset??"utf-8",u.contentDecoder!==void 0&&(g=u.contentDecoder,h.set(g.name,g)),u.contentDecoders!==void 0)for(const $ of u.contentDecoders)h.set($.name,$);if(u.contentTypeDecoder!==void 0&&(S=u.contentTypeDecoder,_.set(S.name,S)),u.contentTypeDecoders!==void 0)for(const $ of u.contentTypeDecoders)_.set($.name,$)}return S===void 0&&(S=(0,t.default)().applicationJson.decoder,_.set(S.name,S)),{charset:f,contentDecoder:g,contentDecoders:h,contentTypeDecoder:S,contentTypeDecoders:_}}c.fromOptions=l})(a||(a={}));class o extends s{constructor(l,u){super(),this.readable=l,this.options=a.fromOptions(u),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(l){this._partialMessageTimeout=l}get partialMessageTimeout(){return this._partialMessageTimeout}listen(l){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=l;const u=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),u}onData(l){try{for(this.buffer.append(l);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const g=f.get("content-length");if(!g){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
120
|
+
${JSON.stringify(Object.fromEntries(f))}`));return}const h=parseInt(g);if(isNaN(h)){this.fireError(new Error(`Content-Length value must be a number. Got ${g}`));return}this.nextMessageLength=h}const u=this.buffer.tryReadBody(this.nextMessageLength);if(u===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(u):u,g=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(g)}).catch(f=>{this.fireError(f)})}}catch(u){this.fireError(u)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((l,u)=>{this.partialMessageTimer=void 0,l===this.messageToken&&(this.firePartialMessage({messageToken:l,waitingTime:u}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return $t.ReadableStreamMessageReader=o,$t}var Lt={},mu;function bT(){if(mu)return Lt;mu=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.WriteableStreamMessageWriter=Lt.AbstractMessageWriter=Lt.MessageWriter=void 0;const t=qn(),e=Qi(),n=qf(),r=Ur(),i="Content-Length: ",s=`\r
|
|
121
|
+
`;var a;(function(u){function f(g){let h=g;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}u.is=f})(a||(Lt.MessageWriter=a={}));class o{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,g,h){this.errorEmitter.fire([this.asError(f),g,h])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}Lt.AbstractMessageWriter=o;var c;(function(u){function f(g){return g===void 0||typeof g=="string"?{charset:g??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:g.charset??"utf-8",contentEncoder:g.contentEncoder,contentTypeEncoder:g.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}u.fromOptions=f})(c||(c={}));class l extends o{constructor(f,g){super(),this.writable=f,this.options=c.fromOptions(g),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(h=>this.fireError(h)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(h=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(h):h).then(h=>{const S=[];return S.push(i,h.byteLength.toString(),s),S.push(s),this.doWrite(f,S,h)},h=>{throw this.fireError(h),h}))}async doWrite(f,g,h){try{return await this.writable.write(g.join(""),"ascii"),this.writable.write(h)}catch(S){return this.handleError(S,f),Promise.reject(S)}}handleError(f,g){this.errorCount++,this.fireError(f,g,this.errorCount)}end(){this.writable.end()}}return Lt.WriteableStreamMessageWriter=l,Lt}var ci={},gu;function IT(){if(gu)return ci;gu=1,Object.defineProperty(ci,"__esModule",{value:!0}),ci.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
|
|
122
|
+
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const a=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(a),this._totalLength+=a.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let a=0,o=0,c=0,l=0;e:for(;o<this._chunks.length;){const h=this._chunks[o];for(c=0;c<h.length;){switch(h[c]){case t:switch(a){case 0:a=1;break;case 2:a=3;break;default:a=0}break;case e:switch(a){case 1:a=2;break;case 3:a=4,c++;break e;default:a=0}break;default:a=0}c++}l+=h.byteLength,o++}if(a!==4)return;const u=this._read(l+c),f=new Map,g=this.toString(u,"ascii").split(n);if(g.length<2)return f;for(let h=0;h<g.length-2;h++){const S=g[h],_=S.indexOf(":");if(_===-1)throw new Error(`Message header must separate key and value using ':'
|
|
123
|
+
${S}`);const $=S.substr(0,_),N=S.substr(_+1).trim();f.set(s?$.toLowerCase():$,N)}return f}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const l=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(l)}if(this._chunks[0].byteLength>s){const l=this._chunks[0],u=this.asNative(l,s);return this._chunks[0]=l.slice(s),this._totalLength-=s,u}const a=this.allocNative(s);let o=0,c=0;for(;s>0;){const l=this._chunks[c];if(l.byteLength>s){const u=l.slice(0,s);a.set(u,o),o+=s,this._chunks[c]=l.slice(s),this._totalLength-=s,s-=s}else a.set(l,o),o+=l.byteLength,this._chunks.shift(),this._totalLength-=l.byteLength,s-=l.byteLength}return a}}return ci.AbstractMessageBuffer=r,ci}var Ka={},yu;function _T(){return yu||(yu=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=qn(),n=Qi(),r=Gf(),i=Uf(),s=Ur(),a=_a();var o;(function(m){m.type=new r.NotificationType("$/cancelRequest")})(o||(o={}));var c;(function(m){function C(y){return typeof y=="string"||typeof y=="number"}m.is=C})(c||(t.ProgressToken=c={}));var l;(function(m){m.type=new r.NotificationType("$/progress")})(l||(l={}));class u{constructor(){}}t.ProgressType=u;var f;(function(m){function C(y){return n.func(y)}m.is=C})(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var g;(function(m){m[m.Off=0]="Off",m[m.Messages=1]="Messages",m[m.Compact=2]="Compact",m[m.Verbose=3]="Verbose"})(g||(t.Trace=g={}));var h;(function(m){m.Off="off",m.Messages="messages",m.Compact="compact",m.Verbose="verbose"})(h||(t.TraceValues=h={})),(function(m){function C(T){if(!n.string(T))return m.Off;switch(T=T.toLowerCase(),T){case"off":return m.Off;case"messages":return m.Messages;case"compact":return m.Compact;case"verbose":return m.Verbose;default:return m.Off}}m.fromString=C;function y(T){switch(T){case m.Off:return"off";case m.Messages:return"messages";case m.Compact:return"compact";case m.Verbose:return"verbose";default:return"off"}}m.toString=y})(g||(t.Trace=g={}));var S;(function(m){m.Text="text",m.JSON="json"})(S||(t.TraceFormat=S={})),(function(m){function C(y){return n.string(y)?(y=y.toLowerCase(),y==="json"?m.JSON:m.Text):m.Text}m.fromString=C})(S||(t.TraceFormat=S={}));var _;(function(m){m.type=new r.NotificationType("$/setTrace")})(_||(t.SetTraceNotification=_={}));var $;(function(m){m.type=new r.NotificationType("$/logTrace")})($||(t.LogTraceNotification=$={}));var N;(function(m){m[m.Closed=1]="Closed",m[m.Disposed=2]="Disposed",m[m.AlreadyListening=3]="AlreadyListening"})(N||(t.ConnectionErrors=N={}));class b extends Error{constructor(C,y){super(y),this.code=C,Object.setPrototypeOf(this,b.prototype)}}t.ConnectionError=b;var w;(function(m){function C(y){const T=y;return T&&n.func(T.cancelUndispatched)}m.is=C})(w||(t.ConnectionStrategy=w={}));var x;(function(m){function C(y){const T=y;return T&&(T.kind===void 0||T.kind==="id")&&n.func(T.createCancellationTokenSource)&&(T.dispose===void 0||n.func(T.dispose))}m.is=C})(x||(t.IdCancellationReceiverStrategy=x={}));var H;(function(m){function C(y){const T=y;return T&&T.kind==="request"&&n.func(T.createCancellationTokenSource)&&(T.dispose===void 0||n.func(T.dispose))}m.is=C})(H||(t.RequestCancellationReceiverStrategy=H={}));var K;(function(m){m.Message=Object.freeze({createCancellationTokenSource(y){return new a.CancellationTokenSource}});function C(y){return x.is(y)||H.is(y)}m.is=C})(K||(t.CancellationReceiverStrategy=K={}));var Q;(function(m){m.Message=Object.freeze({sendCancellation(y,T){return y.sendNotification(o.type,{id:T})},cleanup(y){}});function C(y){const T=y;return T&&n.func(T.sendCancellation)&&n.func(T.cleanup)}m.is=C})(Q||(t.CancellationSenderStrategy=Q={}));var ae;(function(m){m.Message=Object.freeze({receiver:K.Message,sender:Q.Message});function C(y){const T=y;return T&&K.is(T.receiver)&&Q.is(T.sender)}m.is=C})(ae||(t.CancellationStrategy=ae={}));var de;(function(m){function C(y){const T=y;return T&&n.func(T.handleMessage)}m.is=C})(de||(t.MessageStrategy=de={}));var Ee;(function(m){function C(y){const T=y;return T&&(ae.is(T.cancellationStrategy)||w.is(T.connectionStrategy)||de.is(T.messageStrategy))}m.is=C})(Ee||(t.ConnectionOptions=Ee={}));var P;(function(m){m[m.New=1]="New",m[m.Listening=2]="Listening",m[m.Closed=3]="Closed",m[m.Disposed=4]="Disposed"})(P||(P={}));function R(m,C,y,T){const k=y!==void 0?y:t.NullLogger;let D=0,G=0,M=0;const j="2.0";let B;const ie=new Map;let V;const be=new Map,ne=new Map;let Ie,Le=new i.LinkedMap,fe=new Map,Oe=new Set,Ae=new Map,Y=g.Off,Pe=S.Text,oe,Je=P.New;const Bn=new s.Emitter,jr=new s.Emitter,zr=new s.Emitter,Br=new s.Emitter,Wr=new s.Emitter,ft=T&&T.cancellationStrategy?T.cancellationStrategy:ae.Message;function Vr(p){if(p===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+p.toString()}function Zi(p){return p===null?"res-unknown-"+(++M).toString():"res-"+p.toString()}function es(){return"not-"+(++G).toString()}function ts(p,I){r.Message.isRequest(I)?p.set(Vr(I.id),I):r.Message.isResponse(I)?p.set(Zi(I.id),I):p.set(es(),I)}function ns(p){}function Kr(){return Je===P.Listening}function Hr(){return Je===P.Closed}function It(){return Je===P.Disposed}function Yr(){(Je===P.New||Je===P.Listening)&&(Je=P.Closed,jr.fire(void 0))}function rs(p){Bn.fire([p,void 0,void 0])}function is(p){Bn.fire(p)}m.onClose(Yr),m.onError(rs),C.onClose(Yr),C.onError(is);function Xr(){Ie||Le.size===0||(Ie=(0,e.default)().timer.setImmediate(()=>{Ie=void 0,ss()}))}function Jr(p){r.Message.isRequest(p)?os(p):r.Message.isNotification(p)?ls(p):r.Message.isResponse(p)?cs(p):us(p)}function ss(){if(Le.size===0)return;const p=Le.shift();try{const I=T==null?void 0:T.messageStrategy;de.is(I)?I.handleMessage(p,Jr):Jr(p)}finally{Xr()}}const as=p=>{try{if(r.Message.isNotification(p)&&p.method===o.type.method){const I=p.params.id,O=Vr(I),U=Le.get(O);if(r.Message.isRequest(U)){const se=T==null?void 0:T.connectionStrategy,ce=se&&se.cancelUndispatched?se.cancelUndispatched(U,ns):void 0;if(ce&&(ce.error!==void 0||ce.result!==void 0)){Le.delete(O),Ae.delete(I),ce.id=U.id,hn(ce,p.method,Date.now()),C.write(ce).catch(()=>k.error("Sending response for canceled message failed."));return}}const le=Ae.get(I);if(le!==void 0){le.cancel(),Wn(p);return}else Oe.add(I)}ts(Le,p)}finally{Xr()}};function os(p){if(It())return;function I(Z,he,re){const _e={jsonrpc:j,id:p.id};Z instanceof r.ResponseError?_e.error=Z.toJson():_e.result=Z===void 0?null:Z,hn(_e,he,re),C.write(_e).catch(()=>k.error("Sending response failed."))}function O(Z,he,re){const _e={jsonrpc:j,id:p.id,error:Z.toJson()};hn(_e,he,re),C.write(_e).catch(()=>k.error("Sending response failed."))}function U(Z,he,re){Z===void 0&&(Z=null);const _e={jsonrpc:j,id:p.id,result:Z};hn(_e,he,re),C.write(_e).catch(()=>k.error("Sending response failed."))}hs(p);const le=ie.get(p.method);let se,ce;le&&(se=le.type,ce=le.handler);const Ce=Date.now();if(ce||B){const Z=p.id??String(Date.now()),he=x.is(ft.receiver)?ft.receiver.createCancellationTokenSource(Z):ft.receiver.createCancellationTokenSource(p);p.id!==null&&Oe.has(p.id)&&he.cancel(),p.id!==null&&Ae.set(Z,he);try{let re;if(ce)if(p.params===void 0){if(se!==void 0&&se.numberOfParams!==0){O(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${p.method} defines ${se.numberOfParams} params but received none.`),p.method,Ce);return}re=ce(he.token)}else if(Array.isArray(p.params)){if(se!==void 0&&se.parameterStructures===r.ParameterStructures.byName){O(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${p.method} defines parameters by name but received parameters by position`),p.method,Ce);return}re=ce(...p.params,he.token)}else{if(se!==void 0&&se.parameterStructures===r.ParameterStructures.byPosition){O(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${p.method} defines parameters by position but received parameters by name`),p.method,Ce);return}re=ce(p.params,he.token)}else B&&(re=B(p.method,p.params,he.token));const _e=re;re?_e.then?_e.then(Be=>{Ae.delete(Z),I(Be,p.method,Ce)},Be=>{Ae.delete(Z),Be instanceof r.ResponseError?O(Be,p.method,Ce):Be&&n.string(Be.message)?O(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${p.method} failed with message: ${Be.message}`),p.method,Ce):O(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${p.method} failed unexpectedly without providing any details.`),p.method,Ce)}):(Ae.delete(Z),I(re,p.method,Ce)):(Ae.delete(Z),U(re,p.method,Ce))}catch(re){Ae.delete(Z),re instanceof r.ResponseError?I(re,p.method,Ce):re&&n.string(re.message)?O(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${p.method} failed with message: ${re.message}`),p.method,Ce):O(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${p.method} failed unexpectedly without providing any details.`),p.method,Ce)}}else O(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${p.method}`),p.method,Ce)}function cs(p){if(!It())if(p.id===null)p.error?k.error(`Received response message without id: Error is:
|
|
124
|
+
${JSON.stringify(p.error,void 0,4)}`):k.error("Received response message without id. No further error information provided.");else{const I=p.id,O=fe.get(I);if(ps(p,O),O!==void 0){fe.delete(I);try{if(p.error){const U=p.error;O.reject(new r.ResponseError(U.code,U.message,U.data))}else if(p.result!==void 0)O.resolve(p.result);else throw new Error("Should never happen.")}catch(U){U.message?k.error(`Response handler '${O.method}' failed with message: ${U.message}`):k.error(`Response handler '${O.method}' failed unexpectedly.`)}}}}function ls(p){if(It())return;let I,O;if(p.method===o.type.method){const U=p.params.id;Oe.delete(U),Wn(p);return}else{const U=be.get(p.method);U&&(O=U.handler,I=U.type)}if(O||V)try{if(Wn(p),O)if(p.params===void 0)I!==void 0&&I.numberOfParams!==0&&I.parameterStructures!==r.ParameterStructures.byName&&k.error(`Notification ${p.method} defines ${I.numberOfParams} params but received none.`),O();else if(Array.isArray(p.params)){const U=p.params;p.method===l.type.method&&U.length===2&&c.is(U[0])?O({token:U[0],value:U[1]}):(I!==void 0&&(I.parameterStructures===r.ParameterStructures.byName&&k.error(`Notification ${p.method} defines parameters by name but received parameters by position`),I.numberOfParams!==p.params.length&&k.error(`Notification ${p.method} defines ${I.numberOfParams} params but received ${U.length} arguments`)),O(...U))}else I!==void 0&&I.parameterStructures===r.ParameterStructures.byPosition&&k.error(`Notification ${p.method} defines parameters by position but received parameters by name`),O(p.params);else V&&V(p.method,p.params)}catch(U){U.message?k.error(`Notification handler '${p.method}' failed with message: ${U.message}`):k.error(`Notification handler '${p.method}' failed unexpectedly.`)}else zr.fire(p)}function us(p){if(!p){k.error("Received empty message.");return}k.error(`Received message which is neither a response nor a notification message:
|
|
125
|
+
${JSON.stringify(p,null,4)}`);const I=p;if(n.string(I.id)||n.number(I.id)){const O=I.id,U=fe.get(O);U&&U.reject(new Error("The received response has neither a result nor an error property."))}}function ht(p){if(p!=null)switch(Y){case g.Verbose:return JSON.stringify(p,null,4);case g.Compact:return JSON.stringify(p);default:return}}function ds(p){if(!(Y===g.Off||!oe))if(Pe===S.Text){let I;(Y===g.Verbose||Y===g.Compact)&&p.params&&(I=`Params: ${ht(p.params)}
|
|
126
|
+
|
|
127
|
+
`),oe.log(`Sending request '${p.method} - (${p.id})'.`,I)}else _t("send-request",p)}function fs(p){if(!(Y===g.Off||!oe))if(Pe===S.Text){let I;(Y===g.Verbose||Y===g.Compact)&&(p.params?I=`Params: ${ht(p.params)}
|
|
128
|
+
|
|
129
|
+
`:I=`No parameters provided.
|
|
130
|
+
|
|
131
|
+
`),oe.log(`Sending notification '${p.method}'.`,I)}else _t("send-notification",p)}function hn(p,I,O){if(!(Y===g.Off||!oe))if(Pe===S.Text){let U;(Y===g.Verbose||Y===g.Compact)&&(p.error&&p.error.data?U=`Error data: ${ht(p.error.data)}
|
|
132
|
+
|
|
133
|
+
`:p.result?U=`Result: ${ht(p.result)}
|
|
134
|
+
|
|
135
|
+
`:p.error===void 0&&(U=`No result returned.
|
|
136
|
+
|
|
137
|
+
`)),oe.log(`Sending response '${I} - (${p.id})'. Processing request took ${Date.now()-O}ms`,U)}else _t("send-response",p)}function hs(p){if(!(Y===g.Off||!oe))if(Pe===S.Text){let I;(Y===g.Verbose||Y===g.Compact)&&p.params&&(I=`Params: ${ht(p.params)}
|
|
138
|
+
|
|
139
|
+
`),oe.log(`Received request '${p.method} - (${p.id})'.`,I)}else _t("receive-request",p)}function Wn(p){if(!(Y===g.Off||!oe||p.method===$.type.method))if(Pe===S.Text){let I;(Y===g.Verbose||Y===g.Compact)&&(p.params?I=`Params: ${ht(p.params)}
|
|
140
|
+
|
|
141
|
+
`:I=`No parameters provided.
|
|
142
|
+
|
|
143
|
+
`),oe.log(`Received notification '${p.method}'.`,I)}else _t("receive-notification",p)}function ps(p,I){if(!(Y===g.Off||!oe))if(Pe===S.Text){let O;if((Y===g.Verbose||Y===g.Compact)&&(p.error&&p.error.data?O=`Error data: ${ht(p.error.data)}
|
|
144
|
+
|
|
145
|
+
`:p.result?O=`Result: ${ht(p.result)}
|
|
146
|
+
|
|
147
|
+
`:p.error===void 0&&(O=`No result returned.
|
|
148
|
+
|
|
149
|
+
`)),I){const U=p.error?` Request failed: ${p.error.message} (${p.error.code}).`:"";oe.log(`Received response '${I.method} - (${p.id})' in ${Date.now()-I.timerStart}ms.${U}`,O)}else oe.log(`Received response ${p.id} without active response promise.`,O)}else _t("receive-response",p)}function _t(p,I){if(!oe||Y===g.Off)return;const O={isLSPMessage:!0,type:p,message:I,timestamp:Date.now()};oe.log(O)}function Qt(){if(Hr())throw new b(N.Closed,"Connection is closed.");if(It())throw new b(N.Disposed,"Connection is disposed.")}function ms(){if(Kr())throw new b(N.AlreadyListening,"Connection is already listening")}function gs(){if(!Kr())throw new Error("Call listen() first.")}function Zt(p){return p===void 0?null:p}function Qr(p){if(p!==null)return p}function d(p){return p!=null&&!Array.isArray(p)&&typeof p=="object"}function Se(p,I){switch(p){case r.ParameterStructures.auto:return d(I)?Qr(I):[Zt(I)];case r.ParameterStructures.byName:if(!d(I))throw new Error("Received parameters by name but param is not an object literal.");return Qr(I);case r.ParameterStructures.byPosition:return[Zt(I)];default:throw new Error(`Unknown parameter structure ${p.toString()}`)}}function ke(p,I){let O;const U=p.numberOfParams;switch(U){case 0:O=void 0;break;case 1:O=Se(p.parameterStructures,I[0]);break;default:O=[];for(let le=0;le<I.length&&le<U;le++)O.push(Zt(I[le]));if(I.length<U)for(let le=I.length;le<U;le++)O.push(null);break}return O}const W={sendNotification:(p,...I)=>{Qt();let O,U;if(n.string(p)){O=p;const se=I[0];let ce=0,Ce=r.ParameterStructures.auto;r.ParameterStructures.is(se)&&(ce=1,Ce=se);let Z=I.length;const he=Z-ce;switch(he){case 0:U=void 0;break;case 1:U=Se(Ce,I[ce]);break;default:if(Ce===r.ParameterStructures.byName)throw new Error(`Received ${he} parameters for 'by Name' notification parameter structure.`);U=I.slice(ce,Z).map(re=>Zt(re));break}}else{const se=I;O=p.method,U=ke(p,se)}const le={jsonrpc:j,method:O,params:U};return fs(le),C.write(le).catch(se=>{throw k.error("Sending notification failed."),se})},onNotification:(p,I)=>{Qt();let O;return n.func(p)?V=p:I&&(n.string(p)?(O=p,be.set(p,{type:void 0,handler:I})):(O=p.method,be.set(p.method,{type:p,handler:I}))),{dispose:()=>{O!==void 0?be.delete(O):V=void 0}}},onProgress:(p,I,O)=>{if(ne.has(I))throw new Error(`Progress handler for token ${I} already registered`);return ne.set(I,O),{dispose:()=>{ne.delete(I)}}},sendProgress:(p,I,O)=>W.sendNotification(l.type,{token:I,value:O}),onUnhandledProgress:Br.event,sendRequest:(p,...I)=>{Qt(),gs();let O,U,le;if(n.string(p)){O=p;const Z=I[0],he=I[I.length-1];let re=0,_e=r.ParameterStructures.auto;r.ParameterStructures.is(Z)&&(re=1,_e=Z);let Be=I.length;a.CancellationToken.is(he)&&(Be=Be-1,le=he);const At=Be-re;switch(At){case 0:U=void 0;break;case 1:U=Se(_e,I[re]);break;default:if(_e===r.ParameterStructures.byName)throw new Error(`Received ${At} parameters for 'by Name' request parameter structure.`);U=I.slice(re,Be).map(fh=>Zt(fh));break}}else{const Z=I;O=p.method,U=ke(p,Z);const he=p.numberOfParams;le=a.CancellationToken.is(Z[he])?Z[he]:void 0}const se=D++;let ce;le&&(ce=le.onCancellationRequested(()=>{const Z=ft.sender.sendCancellation(W,se);return Z===void 0?(k.log(`Received no promise from cancellation strategy when cancelling id ${se}`),Promise.resolve()):Z.catch(()=>{k.log(`Sending cancellation messages for id ${se} failed`)})}));const Ce={jsonrpc:j,id:se,method:O,params:U};return ds(Ce),typeof ft.sender.enableCancellation=="function"&&ft.sender.enableCancellation(Ce),new Promise(async(Z,he)=>{const re=At=>{Z(At),ft.sender.cleanup(se),ce==null||ce.dispose()},_e=At=>{he(At),ft.sender.cleanup(se),ce==null||ce.dispose()},Be={method:O,timerStart:Date.now(),resolve:re,reject:_e};try{await C.write(Ce),fe.set(se,Be)}catch(At){throw k.error("Sending request failed."),Be.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,At.message?At.message:"Unknown reason")),At}})},onRequest:(p,I)=>{Qt();let O=null;return f.is(p)?(O=void 0,B=p):n.string(p)?(O=null,I!==void 0&&(O=p,ie.set(p,{handler:I,type:void 0}))):I!==void 0&&(O=p.method,ie.set(p.method,{type:p,handler:I})),{dispose:()=>{O!==null&&(O!==void 0?ie.delete(O):B=void 0)}}},hasPendingResponse:()=>fe.size>0,trace:async(p,I,O)=>{let U=!1,le=S.Text;O!==void 0&&(n.boolean(O)?U=O:(U=O.sendNotification||!1,le=O.traceFormat||S.Text)),Y=p,Pe=le,Y===g.Off?oe=void 0:oe=I,U&&!Hr()&&!It()&&await W.sendNotification(_.type,{value:g.toString(p)})},onError:Bn.event,onClose:jr.event,onUnhandledNotification:zr.event,onDispose:Wr.event,end:()=>{C.end()},dispose:()=>{if(It())return;Je=P.Disposed,Wr.fire(void 0);const p=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const I of fe.values())I.reject(p);fe=new Map,Ae=new Map,Oe=new Set,Le=new i.LinkedMap,n.func(C.dispose)&&C.dispose(),n.func(m.dispose)&&m.dispose()},listen:()=>{Qt(),ms(),Je=P.Listening,m.listen(as)},inspect:()=>{(0,e.default)().console.log("inspect")}};return W.onNotification($.type,p=>{if(Y===g.Off||!oe)return;const I=Y===g.Verbose||Y===g.Compact;oe.log(p.message,I?p.verbose:void 0)}),W.onNotification(l.type,p=>{const I=ne.get(p.token);I?I(p.value):Br.fire(p)}),W}t.createMessageConnection=R})(Ka)),Ka}var Tu;function $c(){return Tu||(Tu=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Gf();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=Uf();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=CT();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ur();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=_a();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=NT();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const o=wT();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const c=bT();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const l=IT();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const u=_T();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return u.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return u.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return u.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return u.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return u.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return u.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return u.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return u.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return u.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return u.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return u.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return u.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return u.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return u.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return u.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return u.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return u.MessageStrategy}});const f=qn();t.RAL=f.default})(Va)),Va}var Ru;function PT(){if(Ru)return Ns;Ru=1,Object.defineProperty(Ns,"__esModule",{value:!0});const t=$c();class e extends t.AbstractMessageBuffer{constructor(c="utf-8"){super(c),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return e.emptyBuffer}fromString(c,l){return new TextEncoder().encode(c)}toString(c,l){return l==="ascii"?this.asciiDecoder.decode(c):new TextDecoder(l).decode(c)}asNative(c,l){return l===void 0?c:c.slice(0,l)}allocNative(c){return new Uint8Array(c)}}e.emptyBuffer=new Uint8Array(0);class n{constructor(c){this.socket=c,this._onData=new t.Emitter,this._messageListener=l=>{l.data.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,t.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(c){return this.socket.addEventListener("close",c),t.Disposable.create(()=>this.socket.removeEventListener("close",c))}onError(c){return this.socket.addEventListener("error",c),t.Disposable.create(()=>this.socket.removeEventListener("error",c))}onEnd(c){return this.socket.addEventListener("end",c),t.Disposable.create(()=>this.socket.removeEventListener("end",c))}onData(c){return this._onData.event(c)}}class r{constructor(c){this.socket=c}onClose(c){return this.socket.addEventListener("close",c),t.Disposable.create(()=>this.socket.removeEventListener("close",c))}onError(c){return this.socket.addEventListener("error",c),t.Disposable.create(()=>this.socket.removeEventListener("error",c))}onEnd(c){return this.socket.addEventListener("end",c),t.Disposable.create(()=>this.socket.removeEventListener("end",c))}write(c,l){if(typeof c=="string"){if(l!==void 0&&l!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${l}`);this.socket.send(c)}else this.socket.send(c);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:o=>new e(o)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(o,c)=>{if(c.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${c.charset}`);return Promise.resolve(i.encode(JSON.stringify(o,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(o,c)=>{if(!(o instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(c.charset).decode(o)))}})}),stream:Object.freeze({asReadableStream:o=>new n(o),asWritableStream:o=>new r(o)}),console,timer:Object.freeze({setTimeout(o,c,...l){const u=setTimeout(o,c,...l);return{dispose:()=>clearTimeout(u)}},setImmediate(o,...c){const l=setTimeout(o,0,...c);return{dispose:()=>clearTimeout(l)}},setInterval(o,c,...l){const u=setInterval(o,c,...l);return{dispose:()=>clearInterval(u)}}})});function a(){return s}return(function(o){function c(){t.RAL.install(s)}o.install=c})(a||(a={})),Ns.default=a,Ns}var vu;function qr(){return vu||(vu=1,(function(t){var e=Tn&&Tn.__createBinding||(Object.create?(function(c,l,u,f){f===void 0&&(f=u);var g=Object.getOwnPropertyDescriptor(l,u);(!g||("get"in g?!l.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(c,f,g)}):(function(c,l,u,f){f===void 0&&(f=u),c[f]=l[u]})),n=Tn&&Tn.__exportStar||function(c,l){for(var u in c)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&e(l,c,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.BrowserMessageWriter=t.BrowserMessageReader=void 0,PT().default.install();const i=$c();n($c(),t);class s extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=u=>{this._onData.fire(u.data)},l.addEventListener("error",u=>this.fireError(u)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}t.BrowserMessageReader=s;class a extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",u=>this.fireError(u))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(u){return this.handleError(u,l),Promise.reject(u)}}handleError(l,u){this.errorCount++,this.fireError(l,u,this.errorCount)}end(){}}t.BrowserMessageWriter=a;function o(c,l,u,f){return u===void 0&&(u=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(c,l,u,f)}t.createMessageConnection=o})(Tn)),Tn}var Ha,Eu;function Au(){return Eu||(Eu=1,Ha=qr()),Ha}var vn={};const ll=mh.getAugmentedNamespace(Iy);var We={},Su;function Te(){if(Su)return We;Su=1,Object.defineProperty(We,"__esModule",{value:!0}),We.ProtocolNotificationType=We.ProtocolNotificationType0=We.ProtocolRequestType=We.ProtocolRequestType0=We.RegistrationType=We.MessageDirection=void 0;const t=qr();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(We.MessageDirection=e={}));class n{constructor(c){this.method=c}}We.RegistrationType=n;class r extends t.RequestType0{constructor(c){super(c)}}We.ProtocolRequestType0=r;class i extends t.RequestType{constructor(c){super(c,t.ParameterStructures.byName)}}We.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(c){super(c)}}We.ProtocolNotificationType0=s;class a extends t.NotificationType{constructor(c){super(c,t.ParameterStructures.byName)}}return We.ProtocolNotificationType=a,We}var Ya={},Ne={},ku;function ul(){if(ku)return Ne;ku=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.objectLiteral=Ne.typedArray=Ne.stringArray=Ne.array=Ne.func=Ne.error=Ne.number=Ne.string=Ne.boolean=void 0;function t(l){return l===!0||l===!1}Ne.boolean=t;function e(l){return typeof l=="string"||l instanceof String}Ne.string=e;function n(l){return typeof l=="number"||l instanceof Number}Ne.number=n;function r(l){return l instanceof Error}Ne.error=r;function i(l){return typeof l=="function"}Ne.func=i;function s(l){return Array.isArray(l)}Ne.array=s;function a(l){return s(l)&&l.every(u=>e(u))}Ne.stringArray=a;function o(l,u){return Array.isArray(l)&&l.every(u)}Ne.typedArray=o;function c(l){return l!==null&&typeof l=="object"}return Ne.objectLiteral=c,Ne}var li={},Cu;function $T(){if(Cu)return li;Cu=1,Object.defineProperty(li,"__esModule",{value:!0}),li.ImplementationRequest=void 0;const t=Te();var e;return(function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(li.ImplementationRequest=e={})),li}var ui={},Nu;function LT(){if(Nu)return ui;Nu=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.TypeDefinitionRequest=void 0;const t=Te();var e;return(function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(ui.TypeDefinitionRequest=e={})),ui}var En={},wu;function OT(){if(wu)return En;wu=1,Object.defineProperty(En,"__esModule",{value:!0}),En.DidChangeWorkspaceFoldersNotification=En.WorkspaceFoldersRequest=void 0;const t=Te();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(En.WorkspaceFoldersRequest=e={}));var n;return(function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)})(n||(En.DidChangeWorkspaceFoldersNotification=n={})),En}var di={},bu;function xT(){if(bu)return di;bu=1,Object.defineProperty(di,"__esModule",{value:!0}),di.ConfigurationRequest=void 0;const t=Te();var e;return(function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(e||(di.ConfigurationRequest=e={})),di}var An={},Iu;function DT(){if(Iu)return An;Iu=1,Object.defineProperty(An,"__esModule",{value:!0}),An.ColorPresentationRequest=An.DocumentColorRequest=void 0;const t=Te();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(An.DocumentColorRequest=e={}));var n;return(function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(n||(An.ColorPresentationRequest=n={})),An}var Sn={},_u;function MT(){if(_u)return Sn;_u=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.FoldingRangeRefreshRequest=Sn.FoldingRangeRequest=void 0;const t=Te();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Sn.FoldingRangeRequest=e={}));var n;return(function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(n||(Sn.FoldingRangeRefreshRequest=n={})),Sn}var fi={},Pu;function FT(){if(Pu)return fi;Pu=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.DeclarationRequest=void 0;const t=Te();var e;return(function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(fi.DeclarationRequest=e={})),fi}var hi={},$u;function GT(){if($u)return hi;$u=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.SelectionRangeRequest=void 0;const t=Te();var e;return(function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(hi.SelectionRangeRequest=e={})),hi}var Ot={},Lu;function UT(){if(Lu)return Ot;Lu=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.WorkDoneProgressCancelNotification=Ot.WorkDoneProgressCreateRequest=Ot.WorkDoneProgress=void 0;const t=qr(),e=Te();var n;(function(s){s.type=new t.ProgressType;function a(o){return o===s.type}s.is=a})(n||(Ot.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(Ot.WorkDoneProgressCreateRequest=r={}));var i;return(function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)})(i||(Ot.WorkDoneProgressCancelNotification=i={})),Ot}var xt={},Ou;function qT(){if(Ou)return xt;Ou=1,Object.defineProperty(xt,"__esModule",{value:!0}),xt.CallHierarchyOutgoingCallsRequest=xt.CallHierarchyIncomingCallsRequest=xt.CallHierarchyPrepareRequest=void 0;const t=Te();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(xt.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(xt.CallHierarchyIncomingCallsRequest=n={}));var r;return(function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(xt.CallHierarchyOutgoingCallsRequest=r={})),xt}var Ve={},xu;function jT(){if(xu)return Ve;xu=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.SemanticTokensRefreshRequest=Ve.SemanticTokensRangeRequest=Ve.SemanticTokensDeltaRequest=Ve.SemanticTokensRequest=Ve.SemanticTokensRegistrationType=Ve.TokenFormat=void 0;const t=Te();var e;(function(o){o.Relative="relative"})(e||(Ve.TokenFormat=e={}));var n;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(n||(Ve.SemanticTokensRegistrationType=n={}));var r;(function(o){o.method="textDocument/semanticTokens/full",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(r||(Ve.SemanticTokensRequest=r={}));var i;(function(o){o.method="textDocument/semanticTokens/full/delta",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(i||(Ve.SemanticTokensDeltaRequest=i={}));var s;(function(o){o.method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(s||(Ve.SemanticTokensRangeRequest=s={}));var a;return(function(o){o.method="workspace/semanticTokens/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)})(a||(Ve.SemanticTokensRefreshRequest=a={})),Ve}var pi={},Du;function zT(){if(Du)return pi;Du=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.ShowDocumentRequest=void 0;const t=Te();var e;return(function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)})(e||(pi.ShowDocumentRequest=e={})),pi}var mi={},Mu;function BT(){if(Mu)return mi;Mu=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.LinkedEditingRangeRequest=void 0;const t=Te();var e;return(function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(mi.LinkedEditingRangeRequest=e={})),mi}var De={},Fu;function WT(){if(Fu)return De;Fu=1,Object.defineProperty(De,"__esModule",{value:!0}),De.WillDeleteFilesRequest=De.DidDeleteFilesNotification=De.DidRenameFilesNotification=De.WillRenameFilesRequest=De.DidCreateFilesNotification=De.WillCreateFilesRequest=De.FileOperationPatternKind=void 0;const t=Te();var e;(function(c){c.file="file",c.folder="folder"})(e||(De.FileOperationPatternKind=e={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(De.WillCreateFilesRequest=n={}));var r;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(r||(De.DidCreateFilesNotification=r={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(i||(De.WillRenameFilesRequest=i={}));var s;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(s||(De.DidRenameFilesNotification=s={}));var a;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(a||(De.DidDeleteFilesNotification=a={}));var o;return(function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(o||(De.WillDeleteFilesRequest=o={})),De}var Dt={},Gu;function VT(){if(Gu)return Dt;Gu=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.MonikerRequest=Dt.MonikerKind=Dt.UniquenessLevel=void 0;const t=Te();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(Dt.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(Dt.MonikerKind=n={}));var r;return(function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Dt.MonikerRequest=r={})),Dt}var Mt={},Uu;function KT(){if(Uu)return Mt;Uu=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.TypeHierarchySubtypesRequest=Mt.TypeHierarchySupertypesRequest=Mt.TypeHierarchyPrepareRequest=void 0;const t=Te();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Mt.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Mt.TypeHierarchySupertypesRequest=n={}));var r;return(function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(r||(Mt.TypeHierarchySubtypesRequest=r={})),Mt}var kn={},qu;function HT(){if(qu)return kn;qu=1,Object.defineProperty(kn,"__esModule",{value:!0}),kn.InlineValueRefreshRequest=kn.InlineValueRequest=void 0;const t=Te();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(kn.InlineValueRequest=e={}));var n;return(function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(n||(kn.InlineValueRefreshRequest=n={})),kn}var Ft={},ju;function YT(){if(ju)return Ft;ju=1,Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.InlayHintRefreshRequest=Ft.InlayHintResolveRequest=Ft.InlayHintRequest=void 0;const t=Te();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Ft.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Ft.InlayHintResolveRequest=n={}));var r;return(function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)})(r||(Ft.InlayHintRefreshRequest=r={})),Ft}var rt={},zu;function XT(){if(zu)return rt;zu=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.DiagnosticRefreshRequest=rt.WorkspaceDiagnosticRequest=rt.DocumentDiagnosticRequest=rt.DocumentDiagnosticReportKind=rt.DiagnosticServerCancellationData=void 0;const t=qr(),e=ul(),n=Te();var r;(function(c){function l(u){const f=u;return f&&e.boolean(f.retriggerRequest)}c.is=l})(r||(rt.DiagnosticServerCancellationData=r={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(rt.DocumentDiagnosticReportKind=i={}));var s;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(s||(rt.DocumentDiagnosticRequest=s={}));var a;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(a||(rt.WorkspaceDiagnosticRequest=a={}));var o;return(function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)})(o||(rt.DiagnosticRefreshRequest=o={})),rt}var pe={},Bu;function JT(){if(Bu)return pe;Bu=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.DidCloseNotebookDocumentNotification=pe.DidSaveNotebookDocumentNotification=pe.DidChangeNotebookDocumentNotification=pe.NotebookCellArrayChange=pe.DidOpenNotebookDocumentNotification=pe.NotebookDocumentSyncRegistrationType=pe.NotebookDocument=pe.NotebookCell=pe.ExecutionSummary=pe.NotebookCellKind=void 0;const t=ll,e=ul(),n=Te();var r;(function(h){h.Markup=1,h.Code=2;function S(_){return _===1||_===2}h.is=S})(r||(pe.NotebookCellKind=r={}));var i;(function(h){function S(N,b){const w={executionOrder:N};return(b===!0||b===!1)&&(w.success=b),w}h.create=S;function _(N){const b=N;return e.objectLiteral(b)&&t.uinteger.is(b.executionOrder)&&(b.success===void 0||e.boolean(b.success))}h.is=_;function $(N,b){return N===b?!0:N==null||b===null||b===void 0?!1:N.executionOrder===b.executionOrder&&N.success===b.success}h.equals=$})(i||(pe.ExecutionSummary=i={}));var s;(function(h){function S(b,w){return{kind:b,document:w}}h.create=S;function _(b){const w=b;return e.objectLiteral(w)&&r.is(w.kind)&&t.DocumentUri.is(w.document)&&(w.metadata===void 0||e.objectLiteral(w.metadata))}h.is=_;function $(b,w){const x=new Set;return b.document!==w.document&&x.add("document"),b.kind!==w.kind&&x.add("kind"),b.executionSummary!==w.executionSummary&&x.add("executionSummary"),(b.metadata!==void 0||w.metadata!==void 0)&&!N(b.metadata,w.metadata)&&x.add("metadata"),(b.executionSummary!==void 0||w.executionSummary!==void 0)&&!i.equals(b.executionSummary,w.executionSummary)&&x.add("executionSummary"),x}h.diff=$;function N(b,w){if(b===w)return!0;if(b==null||w===null||w===void 0||typeof b!=typeof w||typeof b!="object")return!1;const x=Array.isArray(b),H=Array.isArray(w);if(x!==H)return!1;if(x&&H){if(b.length!==w.length)return!1;for(let K=0;K<b.length;K++)if(!N(b[K],w[K]))return!1}if(e.objectLiteral(b)&&e.objectLiteral(w)){const K=Object.keys(b),Q=Object.keys(w);if(K.length!==Q.length||(K.sort(),Q.sort(),!N(K,Q)))return!1;for(let ae=0;ae<K.length;ae++){const de=K[ae];if(!N(b[de],w[de]))return!1}}return!0}})(s||(pe.NotebookCell=s={}));var a;(function(h){function S($,N,b,w){return{uri:$,notebookType:N,version:b,cells:w}}h.create=S;function _($){const N=$;return e.objectLiteral(N)&&e.string(N.uri)&&t.integer.is(N.version)&&e.typedArray(N.cells,s.is)}h.is=_})(a||(pe.NotebookDocument=a={}));var o;(function(h){h.method="notebookDocument/sync",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.RegistrationType(h.method)})(o||(pe.NotebookDocumentSyncRegistrationType=o={}));var c;(function(h){h.method="notebookDocument/didOpen",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(c||(pe.DidOpenNotebookDocumentNotification=c={}));var l;(function(h){function S($){const N=$;return e.objectLiteral(N)&&t.uinteger.is(N.start)&&t.uinteger.is(N.deleteCount)&&(N.cells===void 0||e.typedArray(N.cells,s.is))}h.is=S;function _($,N,b){const w={start:$,deleteCount:N};return b!==void 0&&(w.cells=b),w}h.create=_})(l||(pe.NotebookCellArrayChange=l={}));var u;(function(h){h.method="notebookDocument/didChange",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(u||(pe.DidChangeNotebookDocumentNotification=u={}));var f;(function(h){h.method="notebookDocument/didSave",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(f||(pe.DidSaveNotebookDocumentNotification=f={}));var g;return(function(h){h.method="notebookDocument/didClose",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=o.method})(g||(pe.DidCloseNotebookDocumentNotification=g={})),pe}var gi={},Wu;function QT(){if(Wu)return gi;Wu=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.InlineCompletionRequest=void 0;const t=Te();var e;return(function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)})(e||(gi.InlineCompletionRequest=e={})),gi}var Vu;function ZT(){return Vu||(Vu=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=Te(),n=ll,r=ul(),i=$T();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=LT();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=OT();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const o=xT();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const c=DT();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const l=MT();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const u=FT();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});const f=GT();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const g=UT();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return g.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return g.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return g.WorkDoneProgressCancelNotification}});const h=qT();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const S=jT();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return S.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return S.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return S.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return S.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return S.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return S.SemanticTokensRegistrationType}});const _=zT();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return _.ShowDocumentRequest}});const $=BT();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return $.LinkedEditingRangeRequest}});const N=WT();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return N.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return N.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return N.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return N.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return N.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return N.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return N.WillDeleteFilesRequest}});const b=VT();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return b.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return b.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return b.MonikerRequest}});const w=KT();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return w.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return w.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return w.TypeHierarchySupertypesRequest}});const x=HT();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});const H=YT();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return H.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return H.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return H.InlayHintRefreshRequest}});const K=XT();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return K.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return K.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return K.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return K.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return K.DiagnosticRefreshRequest}});const Q=JT();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return Q.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return Q.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return Q.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return Q.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Q.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Q.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Q.DidCloseNotebookDocumentNotification}});const ae=QT();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return ae.InlineCompletionRequest}});var de;(function(d){function Se(ke){const W=ke;return r.string(W)||r.string(W.language)||r.string(W.scheme)||r.string(W.pattern)}d.is=Se})(de||(t.TextDocumentFilter=de={}));var Ee;(function(d){function Se(ke){const W=ke;return r.objectLiteral(W)&&(r.string(W.notebookType)||r.string(W.scheme)||r.string(W.pattern))}d.is=Se})(Ee||(t.NotebookDocumentFilter=Ee={}));var P;(function(d){function Se(ke){const W=ke;return r.objectLiteral(W)&&(r.string(W.notebook)||Ee.is(W.notebook))&&(W.language===void 0||r.string(W.language))}d.is=Se})(P||(t.NotebookCellTextDocumentFilter=P={}));var R;(function(d){function Se(ke){if(!Array.isArray(ke))return!1;for(let W of ke)if(!r.string(W)&&!de.is(W)&&!P.is(W))return!1;return!0}d.is=Se})(R||(t.DocumentSelector=R={}));var m;(function(d){d.method="client/registerCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(m||(t.RegistrationRequest=m={}));var C;(function(d){d.method="client/unregisterCapability",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(C||(t.UnregistrationRequest=C={}));var y;(function(d){d.Create="create",d.Rename="rename",d.Delete="delete"})(y||(t.ResourceOperationKind=y={}));var T;(function(d){d.Abort="abort",d.Transactional="transactional",d.TextOnlyTransactional="textOnlyTransactional",d.Undo="undo"})(T||(t.FailureHandlingKind=T={}));var k;(function(d){d.UTF8="utf-8",d.UTF16="utf-16",d.UTF32="utf-32"})(k||(t.PositionEncodingKind=k={}));var D;(function(d){function Se(ke){const W=ke;return W&&r.string(W.id)&&W.id.length>0}d.hasId=Se})(D||(t.StaticRegistrationOptions=D={}));var G;(function(d){function Se(ke){const W=ke;return W&&(W.documentSelector===null||R.is(W.documentSelector))}d.is=Se})(G||(t.TextDocumentRegistrationOptions=G={}));var M;(function(d){function Se(W){const p=W;return r.objectLiteral(p)&&(p.workDoneProgress===void 0||r.boolean(p.workDoneProgress))}d.is=Se;function ke(W){const p=W;return p&&r.boolean(p.workDoneProgress)}d.hasWorkDoneProgress=ke})(M||(t.WorkDoneProgressOptions=M={}));var j;(function(d){d.method="initialize",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(j||(t.InitializeRequest=j={}));var B;(function(d){d.unknownProtocolVersion=1})(B||(t.InitializeErrorCodes=B={}));var ie;(function(d){d.method="initialized",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ie||(t.InitializedNotification=ie={}));var V;(function(d){d.method="shutdown",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType0(d.method)})(V||(t.ShutdownRequest=V={}));var be;(function(d){d.method="exit",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType0(d.method)})(be||(t.ExitNotification=be={}));var ne;(function(d){d.method="workspace/didChangeConfiguration",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ne||(t.DidChangeConfigurationNotification=ne={}));var Ie;(function(d){d.Error=1,d.Warning=2,d.Info=3,d.Log=4,d.Debug=5})(Ie||(t.MessageType=Ie={}));var Le;(function(d){d.method="window/showMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(Le||(t.ShowMessageNotification=Le={}));var fe;(function(d){d.method="window/showMessageRequest",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType(d.method)})(fe||(t.ShowMessageRequest=fe={}));var Oe;(function(d){d.method="window/logMessage",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(Oe||(t.LogMessageNotification=Oe={}));var Ae;(function(d){d.method="telemetry/event",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(Ae||(t.TelemetryEventNotification=Ae={}));var Y;(function(d){d.None=0,d.Full=1,d.Incremental=2})(Y||(t.TextDocumentSyncKind=Y={}));var Pe;(function(d){d.method="textDocument/didOpen",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Pe||(t.DidOpenTextDocumentNotification=Pe={}));var oe;(function(d){function Se(W){let p=W;return p!=null&&typeof p.text=="string"&&p.range!==void 0&&(p.rangeLength===void 0||typeof p.rangeLength=="number")}d.isIncremental=Se;function ke(W){let p=W;return p!=null&&typeof p.text=="string"&&p.range===void 0&&p.rangeLength===void 0}d.isFull=ke})(oe||(t.TextDocumentContentChangeEvent=oe={}));var Je;(function(d){d.method="textDocument/didChange",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Je||(t.DidChangeTextDocumentNotification=Je={}));var Bn;(function(d){d.method="textDocument/didClose",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Bn||(t.DidCloseTextDocumentNotification=Bn={}));var jr;(function(d){d.method="textDocument/didSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(jr||(t.DidSaveTextDocumentNotification=jr={}));var zr;(function(d){d.Manual=1,d.AfterDelay=2,d.FocusOut=3})(zr||(t.TextDocumentSaveReason=zr={}));var Br;(function(d){d.method="textDocument/willSave",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(Br||(t.WillSaveTextDocumentNotification=Br={}));var Wr;(function(d){d.method="textDocument/willSaveWaitUntil",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Wr||(t.WillSaveTextDocumentWaitUntilRequest=Wr={}));var ft;(function(d){d.method="workspace/didChangeWatchedFiles",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolNotificationType(d.method)})(ft||(t.DidChangeWatchedFilesNotification=ft={}));var Vr;(function(d){d.Created=1,d.Changed=2,d.Deleted=3})(Vr||(t.FileChangeType=Vr={}));var Zi;(function(d){function Se(ke){const W=ke;return r.objectLiteral(W)&&(n.URI.is(W.baseUri)||n.WorkspaceFolder.is(W.baseUri))&&r.string(W.pattern)}d.is=Se})(Zi||(t.RelativePattern=Zi={}));var es;(function(d){d.Create=1,d.Change=2,d.Delete=4})(es||(t.WatchKind=es={}));var ts;(function(d){d.method="textDocument/publishDiagnostics",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolNotificationType(d.method)})(ts||(t.PublishDiagnosticsNotification=ts={}));var ns;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.TriggerForIncompleteCompletions=3})(ns||(t.CompletionTriggerKind=ns={}));var Kr;(function(d){d.method="textDocument/completion",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Kr||(t.CompletionRequest=Kr={}));var Hr;(function(d){d.method="completionItem/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Hr||(t.CompletionResolveRequest=Hr={}));var It;(function(d){d.method="textDocument/hover",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(It||(t.HoverRequest=It={}));var Yr;(function(d){d.Invoked=1,d.TriggerCharacter=2,d.ContentChange=3})(Yr||(t.SignatureHelpTriggerKind=Yr={}));var rs;(function(d){d.method="textDocument/signatureHelp",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(rs||(t.SignatureHelpRequest=rs={}));var is;(function(d){d.method="textDocument/definition",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(is||(t.DefinitionRequest=is={}));var Xr;(function(d){d.method="textDocument/references",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Xr||(t.ReferencesRequest=Xr={}));var Jr;(function(d){d.method="textDocument/documentHighlight",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Jr||(t.DocumentHighlightRequest=Jr={}));var ss;(function(d){d.method="textDocument/documentSymbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ss||(t.DocumentSymbolRequest=ss={}));var as;(function(d){d.method="textDocument/codeAction",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(as||(t.CodeActionRequest=as={}));var os;(function(d){d.method="codeAction/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(os||(t.CodeActionResolveRequest=os={}));var cs;(function(d){d.method="workspace/symbol",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(cs||(t.WorkspaceSymbolRequest=cs={}));var ls;(function(d){d.method="workspaceSymbol/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ls||(t.WorkspaceSymbolResolveRequest=ls={}));var us;(function(d){d.method="textDocument/codeLens",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(us||(t.CodeLensRequest=us={}));var ht;(function(d){d.method="codeLens/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ht||(t.CodeLensResolveRequest=ht={}));var ds;(function(d){d.method="workspace/codeLens/refresh",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType0(d.method)})(ds||(t.CodeLensRefreshRequest=ds={}));var fs;(function(d){d.method="textDocument/documentLink",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(fs||(t.DocumentLinkRequest=fs={}));var hn;(function(d){d.method="documentLink/resolve",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(hn||(t.DocumentLinkResolveRequest=hn={}));var hs;(function(d){d.method="textDocument/formatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(hs||(t.DocumentFormattingRequest=hs={}));var Wn;(function(d){d.method="textDocument/rangeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Wn||(t.DocumentRangeFormattingRequest=Wn={}));var ps;(function(d){d.method="textDocument/rangesFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ps||(t.DocumentRangesFormattingRequest=ps={}));var _t;(function(d){d.method="textDocument/onTypeFormatting",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(_t||(t.DocumentOnTypeFormattingRequest=_t={}));var Qt;(function(d){d.Identifier=1})(Qt||(t.PrepareSupportDefaultBehavior=Qt={}));var ms;(function(d){d.method="textDocument/rename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(ms||(t.RenameRequest=ms={}));var gs;(function(d){d.method="textDocument/prepareRename",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(gs||(t.PrepareRenameRequest=gs={}));var Zt;(function(d){d.method="workspace/executeCommand",d.messageDirection=e.MessageDirection.clientToServer,d.type=new e.ProtocolRequestType(d.method)})(Zt||(t.ExecuteCommandRequest=Zt={}));var Qr;(function(d){d.method="workspace/applyEdit",d.messageDirection=e.MessageDirection.serverToClient,d.type=new e.ProtocolRequestType("workspace/applyEdit")})(Qr||(t.ApplyWorkspaceEditRequest=Qr={}))})(Ya)),Ya}var yi={},Ku;function eR(){if(Ku)return yi;Ku=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.createProtocolConnection=void 0;const t=qr();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return yi.createProtocolConnection=e,yi}var Hu;function tR(){return Hu||(Hu=1,(function(t){var e=vn&&vn.__createBinding||(Object.create?(function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}):(function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]})),n=vn&&vn.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(qr(),t),n(ll,t),n(Te(),t),n(ZT(),t);var r=eR();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))})(vn)),vn}var Yu;function nR(){return Yu||(Yu=1,(function(t){var e=yn&&yn.__createBinding||(Object.create?(function(s,a,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(a,o);(!l||("get"in l?!a.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,c,l)}):(function(s,a,o,c){c===void 0&&(c=o),s[c]=a[o]})),n=yn&&yn.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Au();n(Au(),t),n(tR(),t);function i(s,a,o,c){return(0,r.createMessageConnection)(s,a,o,c)}t.createProtocolConnection=i})(yn)),yn}var ws=nR(),Ii;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Ii||(Ii={}));class rR{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new qi,this.documentPhaseListeners=new qi,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=X.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.fileSystemProvider=e.workspace.FileSystemProvider,this.workspaceManager=()=>e.workspace.WorkspaceManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=ye.CancellationToken.None){var i;for(const s of e){const a=s.uri.toString();if(s.state===X.Validated){if(typeof n.validation=="boolean"&&n.validation)this.resetToState(s,X.IndexedReferences);else if(typeof n.validation=="object"){const o=this.findMissingValidationCategories(s,n);o.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:{categories:o}},result:(i=this.buildState.get(a))==null?void 0:i.result}),s.state=X.IndexedReferences)}}else this.buildState.delete(a)}this.currentState=X.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ye.CancellationToken.None){this.currentState=X.Changed;const i=[];for(const c of n){const l=this.langiumDocuments.deleteDocuments(c);for(const u of l)i.push(u.uri),this.cleanUpDeleted(u)}const s=(await Promise.all(e.map(c=>this.findChangedUris(c)))).flat();for(const c of s){let l=this.langiumDocuments.getDocument(c);l===void 0&&(l=this.langiumDocumentFactory.fromModel({$type:"INVALID"},c),l.state=X.Changed,this.langiumDocuments.addDocument(l)),this.resetToState(l,X.Changed)}const a=me(s).concat(i).map(c=>c.toString()).toSet();this.langiumDocuments.all.filter(c=>!a.has(c.uri.toString())&&this.shouldRelink(c,a)).forEach(c=>this.resetToState(c,X.ComputedScopes)),await this.emitUpdate(s,i),await Ke(r);const o=this.sortDocuments(this.langiumDocuments.all.filter(c=>{var l;return c.state<X.Validated||!((l=this.buildState.get(c.uri.toString()))!=null&&l.completed)||this.resultsAreIncomplete(c,this.updateBuildOptions)}).toArray());await this.buildDocuments(o,this.updateBuildOptions,r)}resultsAreIncomplete(e,n){return this.findMissingValidationCategories(e,n).length>=1}findMissingValidationCategories(e,n){var o,c;const r=this.buildState.get(e.uri.toString()),i=this.serviceRegistry.getServices(e.uri).validation.ValidationRegistry.getAllValidationCategories(e),s=(o=r==null?void 0:r.result)!=null&&o.validationChecks?new Set((c=r==null?void 0:r.result)==null?void 0:c.validationChecks):r!=null&&r.completed?i:new Set,a=n===void 0||n.validation===!0?i:typeof n.validation=="object"?n.validation.categories??i:[];return me(a).filter(l=>!s.has(l)).toArray()}async findChangedUris(e){var r;if(this.langiumDocuments.getDocument(e)??((r=this.textDocuments)==null?void 0:r.get(e)))return[e];try{const i=await this.fileSystemProvider.stat(e);if(i.isDirectory)return await this.workspaceManager().searchFolder(e);if(this.workspaceManager().shouldIncludeEntry(i))return[e]}catch{}return[]}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!((n=this.textDocuments)!=null&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),Ii.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}resetToState(e,n){switch(n){case X.Changed:case X.Parsed:this.indexManager.removeContent(e.uri);case X.IndexedContent:e.localSymbols=void 0;case X.ComputedScopes:this.serviceRegistry.getServices(e.uri).references.Linker.unlink(e);case X.Linked:this.indexManager.removeReferences(e.uri);case X.IndexedReferences:e.diagnostics=void 0,this.buildState.delete(e.uri.toString());case X.Validated:}e.state>n&&(e.state=n)}cleanUpDeleted(e){this.buildState.delete(e.uri.toString()),this.indexManager.remove(e.uri),e.state=X.Changed}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,X.Parsed,r,a=>this.langiumDocumentFactory.update(a,r)),await this.runCancelable(e,X.IndexedContent,r,a=>this.indexManager.updateContent(a,r)),await this.runCancelable(e,X.ComputedScopes,r,async a=>{const o=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.localSymbols=await o.collectLocalSymbols(a,r)});const i=e.filter(a=>this.shouldLink(a));await this.runCancelable(i,X.Linked,r,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,r)),await this.runCancelable(i,X.IndexedReferences,r,a=>this.indexManager.updateReferences(a,r));const s=e.filter(a=>this.shouldValidate(a)?!0:(this.markAsCompleted(a),!1));await this.runCancelable(s,X.Validated,r,async a=>{await this.validate(a,r),this.markAsCompleted(a)})}markAsCompleted(e){const n=this.buildState.get(e.uri.toString());n&&(n.completed=!0)}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s==null?void 0:s.result})}}async runCancelable(e,n,r,i){for(const a of e)a.state<n&&(await Ke(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r));const s=e.filter(a=>a.state===n);await this.notifyBuildPhase(s,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),Ii.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Ii.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;return n&&"path"in n?i=n:r=n,r??(r=ye.CancellationToken.None),i?this.awaitDocumentState(e,i,r):this.awaitBuilderState(e,r)}awaitDocumentState(e,n,r){const i=this.langiumDocuments.getDocument(n);if(i){if(i.state>=e)return Promise.resolve(n);if(r.isCancellationRequested)return Promise.reject(fr);if(this.currentState>=e&&e>i.state)return Promise.reject(new ws.ResponseError(ws.LSPErrorCodes.RequestFailed,`Document state of ${n.toString()} is ${X[i.state]}, requiring ${X[e]}, but workspace state is already ${X[this.currentState]}. Returning undefined.`))}else return Promise.reject(new ws.ResponseError(ws.LSPErrorCodes.ServerCancelled,`No document found for URI: ${n.toString()}`));return new Promise((s,a)=>{const o=this.onDocumentPhase(e,l=>{at.equals(l.uri,n)&&(o.dispose(),c.dispose(),s(l.uri))}),c=r.onCancellationRequested(()=>{o.dispose(),c.dispose(),a(fr)})})}awaitBuilderState(e,n){return this.currentState>=e?Promise.resolve():n.isCancellationRequested?Promise.reject(fr):new Promise((r,i)=>{const s=this.onBuildPhase(e,()=>{s.dispose(),a.dispose(),r()}),a=n.onCancellationRequested(()=>{s.dispose(),a.dispose(),i(fr)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await Ke(r),await a(e,r)}catch(o){if(!Pa(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await Ke(r),await a(e,r)}shouldLink(e){return this.getBuildOptions(e).eagerLinking??!0}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){const r=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,i=this.getBuildOptions(e),s=typeof i.validation=="object"?{...i.validation}:{};s.categories=this.findMissingValidationCategories(e,i);const a=await r.validateDocument(e,s,n);e.diagnostics?e.diagnostics.push(...a):e.diagnostics=a;const o=this.buildState.get(e.uri.toString());o&&(o.result??(o.result={}),o.result.validationChecks?o.result.validationChecks=me(o.result.validationChecks).concat(s.categories).distinct().toArray():o.result.validationChecks=[...s.categories])}getBuildOptions(e){var n;return((n=this.buildState.get(e.uri.toString()))==null?void 0:n.options)??{}}}class iR{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new lT,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=Wt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{at.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),me(i)}allElements(e,n){let r=me(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){return n?this.symbolByTypeIndex.get(e,n,()=>(this.symbolIndex.get(e)??[]).filter(s=>this.astReflection.isSubtype(s.type,n))):this.symbolIndex.get(e)??[]}remove(e){this.removeContent(e),this.removeReferences(e)}removeContent(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n)}removeReferences(e){const n=e.toString();this.referenceIndex.delete(n)}async updateContent(e,n=ye.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.collectExportedSymbols(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=ye.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class sR{constructor(e){this.initialBuildOptions={},this._ready=new cl,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){this.folders=e.workspaceFolders??void 0}initialized(e){return this.mutex.write(n=>this.initializeWorkspace(this.folders??[],n))}async initializeWorkspace(e,n=ye.CancellationToken.None){const r=await this.performStartup(e);await Ke(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=[],r=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};await this.loadAdditionalDocuments(e,r);const i=[];await Promise.all(e.map(a=>this.getRootFolder(a)).map(async a=>this.traverseFolder(a,i)));const s=me(i).distinct(a=>a.toString()).filter(a=>!this.langiumDocuments.hasDocument(a));return await this.loadWorkspaceDocuments(s,r),this._ready.resolve(),n}async loadWorkspaceDocuments(e,n){await Promise.all(e.map(async r=>{const i=await this.langiumDocuments.getOrCreateDocument(r);n(i)}))}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Tt.parse(e.uri)}async traverseFolder(e,n){try{const r=await this.fileSystemProvider.readDirectory(e);await Promise.all(r.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,n):i.isFile&&n.push(i.uri))}))}catch(r){console.error("Failure to read directory content of "+e.toString(!0),r)}}async searchFolder(e){const n=[];return await this.traverseFolder(e,n),n}shouldIncludeEntry(e){const n=at.basename(e.uri);return n.startsWith(".")?!1:e.isDirectory?n!=="node_modules"&&n!=="out":e.isFile?this.serviceRegistry.hasServices(e.uri):!1}}class aR{buildUnexpectedCharactersMessage(e,n,r,i,s){return To.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return To.buildUnableToPopLexerModeMessage(e)}}const oR={mode:"full"};class cR{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=Xu(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Qe(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=oR){var i,s;const r=this.chevrotainLexer.tokenize(e);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:(s=(i=this.tokenBuilder).flushLexingReport)==null?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(Xu(e))return e;const n=jf(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function lR(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function jf(t){return t&&"modes"in t&&"defaultMode"in t}function Xu(t){return!lR(t)&&!jf(t)}function uR(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=te.create(0,0));const s=zf(t),a=dl(r),o=hR({lines:s,position:i,options:a});return TR({index:0,tokens:o,position:i})}function dR(t,e){const n=dl(e),r=zf(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!(a!=null&&a.exec(i))&&!!(o!=null&&o.exec(s))}function zf(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(hp)}const Ju=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,fR=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function hR(t){var i,s,a;const e=[];let n=t.position.line,r=t.position.character;for(let o=0;o<t.lines.length;o++){const c=o===0,l=o===t.lines.length-1;let u=t.lines[o],f=0;if(c&&t.options.start){const h=(i=t.options.start)==null?void 0:i.exec(u);h&&(f=h.index+h[0].length)}else{const h=(s=t.options.line)==null?void 0:s.exec(u);h&&(f=h.index+h[0].length)}if(l){const h=(a=t.options.end)==null?void 0:a.exec(u);h&&(u=u.substring(0,h.index))}if(u=u.substring(0,yR(u)),Lc(u,f)>=u.length){if(e.length>0){const h=te.create(n,r);e.push({type:"break",content:"",range:J.create(h,h)})}}else{Ju.lastIndex=f;const h=Ju.exec(u);if(h){const S=h[0],_=h[1],$=te.create(n,r+f),N=te.create(n,r+f+S.length);e.push({type:"tag",content:_,range:J.create($,N)}),f+=S.length,f=Lc(u,f)}if(f<u.length){const S=u.substring(f),_=Array.from(S.matchAll(fR));e.push(...pR(_,S,n,r+f))}}n++,r=0}return e.length>0&&e[e.length-1].type==="break"?e.slice(0,-1):e}function pR(t,e,n,r){const i=[];if(t.length===0){const s=te.create(n,r),a=te.create(n,r+e.length);i.push({type:"text",content:e,range:J.create(s,a)})}else{let s=0;for(const o of t){const c=o.index,l=e.substring(s,c);l.length>0&&i.push({type:"text",content:e.substring(s,c),range:J.create(te.create(n,s+r),te.create(n,c+r))});let u=l.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:J.create(te.create(n,s+u+r),te.create(n,s+u+f.length+r))}),u+=f.length,o.length===4){u+=o[2].length;const g=o[3];i.push({type:"text",content:g,range:J.create(te.create(n,s+u+r),te.create(n,s+u+g.length+r))})}else i.push({type:"text",content:"",range:J.create(te.create(n,s+u+r),te.create(n,s+u+r))});s=c+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:J.create(te.create(n,s+r),te.create(n,s+r+a.length))})}return i}const mR=/\S/,gR=/\s*$/;function Lc(t,e){const n=t.substring(e).match(mR);return n?e+n.index:t.length}function yR(t){const e=t.match(gR);if(e&&typeof e.index=="number")return e.index}function TR(t){var s,a;const e=te.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Qu([],J.create(e,e));const n=[];for(;t.index<t.tokens.length;){const o=RR(t,n[n.length-1]);o&&n.push(o)}const r=((s=n[0])==null?void 0:s.range.start)??e,i=((a=n[n.length-1])==null?void 0:a.range.end)??e;return new Qu(n,J.create(r,i))}function RR(t,e){const n=t.tokens[t.index];if(n.type==="tag")return Wf(t,!1);if(n.type==="text"||n.type==="inline-tag")return Bf(t);vR(n,e),t.index++}function vR(t,e){if(e){const n=new Kf("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function Bf(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(ER(t)),r=e,e=t.tokens[t.index];return new Oc(i,J.create(n.range.start,r.range.end))}function ER(t){return t.tokens[t.index].type==="inline-tag"?Wf(t,!0):Vf(t)}function Wf(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const s=Vf(t);return new Ja(r,new Oc([s],s.range),e,J.create(n.range.start,s.range.end))}else{const s=Bf(t);return new Ja(r,s,e,J.create(n.range.start,s.range.end))}else{const s=n.range;return new Ja(r,new Oc([],s),e,s)}}function Vf(t){const e=t.tokens[t.index++];return new Kf(e.content,e.range)}function dl(t){if(!t)return dl({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Xa(e,!0),end:Xa(n,!1),line:Xa(r,!0)}}function Xa(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Aa(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class Qu{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=Zu(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=Zu(n)+i}return n.trim()}}class Ja{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
|
|
150
|
+
${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n;return((n=e==null?void 0:e.renderTag)==null?void 0:n.call(e,this))??this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=AR(this.name,n,e??{});if(typeof s=="string")return s}let r="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?r="*":(e==null?void 0:e.tag)==="bold"?r="**":(e==null?void 0:e.tag)==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} — ${n}`:this.content.inlines.length>1&&(i=`${i}
|
|
151
|
+
${n}`),this.inline?`{${i}}`:i}}function AR(t,e,n){var r;if(t==="linkplain"||t==="linkcode"||t==="link"){const i=e.indexOf(" ");let s=e;if(i>0){const o=Lc(e,i);s=e.substring(o),e=e.substring(0,i)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(s=`\`${s}\``),((r=n.renderLink)==null?void 0:r.call(n,e,s))??SR(e,s)}}function SR(t,e){try{return Tt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Oc{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
|
|
152
|
+
`)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
|
|
153
|
+
`)}return n}}class Kf{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function Zu(t){return t.endsWith(`
|
|
154
|
+
`)?`
|
|
155
|
+
`:`
|
|
156
|
+
|
|
157
|
+
`}class kR{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&dR(n))return uR(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){const i=this.findNameInLocalSymbols(e,n)??this.findNameInGlobalScope(e,n);if(i&&i.nameSegment){const s=i.nameSegment.range.start.line+1,a=i.nameSegment.range.start.character+1,o=i.documentUri.with({fragment:`L${s},${a}`});return`[${r}](${o.toString()})`}else return}documentationTagRenderer(e,n){}findNameInLocalSymbols(e,n){const i=Wt(e).localSymbols;if(!i)return;let s=e;do{const o=i.getStream(s).find(c=>c.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class CR{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return fT(e)?e.$comment:(n=cp(e.$cstNode,this.grammarConfig().multilineCommentRules))==null?void 0:n.text}}class NR{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class wR{constructor(){this.previousTokenSource=new ye.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=Jy();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ye.CancellationToken.None){const i=new cl,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Pa(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class bR{constructor(e){this.grammarElementIdMap=new au,this.tokenTypeIdMap=new au,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>({...n,message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Vt(e))n.set(i,{});if(e.$cstNode)for(const i of ho(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)je(o)?a.push(this.dehydrateAstNode(o,n)):gt(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else je(s)?r[i]=this.dehydrateAstNode(s,n):gt(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return md(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Pi(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):pd(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Vt(e))n.set(s,{});let i;if(e.$cstNode)for(const s of ho(e.$cstNode)){let a;"fullText"in s?(a=new Cf(s.fullText),i=a):"content"in s?a=new sl:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)je(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):gt(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else je(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):gt(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Pi(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,c=e.endColumn,l=e.hidden;return new Nc(r,i,{start:{line:s,character:a},end:{line:o,character:c}},n,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Vt(this.grammar))Gh(n)&&this.grammarElementIdMap.set(n,e++)}}function ln(t){return{documentation:{CommentProvider:e=>new CR(e),DocumentationProvider:e=>new kR(e)},parser:{AsyncParser:e=>new NR(e),GrammarConfig:e=>xp(e),LangiumParser:e=>Ky(e),CompletionParser:e=>Vy(e),ValueConverter:()=>new Of,TokenBuilder:()=>new Lf,Lexer:e=>new cR(e),ParserErrorMessageProvider:()=>new bf,LexerErrorMessageProvider:()=>new aR},workspace:{AstNodeLocator:()=>new AT,AstNodeDescriptionProvider:e=>new vT(e),ReferenceDescriptionProvider:e=>new ET(e)},references:{Linker:e=>new nT(e),NameProvider:()=>new iT,ScopeProvider:e=>new dT(e),ScopeComputation:e=>new aT(e),References:e=>new sT(e)},serializer:{Hydrator:e=>new bR(e),JsonSerializer:e=>new hT(e)},validation:{DocumentValidator:e=>new yT(e),ValidationRegistry:e=>new mT(e)},shared:()=>t.shared}}function un(t){return{ServiceRegistry:e=>new pT(e),workspace:{LangiumDocuments:e=>new tT(e),LangiumDocumentFactory:e=>new eT(e),DocumentBuilder:e=>new rR(e),IndexManager:e=>new iR(e),WorkspaceManager:e=>new sR(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new wR,ConfigurationProvider:e=>new kT(e)},profilers:{}}}var ed;(function(t){t.merge=(e,n)=>ji(ji({},e),n)})(ed||(ed={}));function ze(t,e,n,r,i,s,a,o,c){const l=[t,e,n,r,i,s,a,o,c].reduce(ji,{});return Hf(l)}const IR=Symbol("isProxy");function Hf(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===IR?!0:nd(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(nd(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const td=Symbol();function nd(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+t[e]);if(t[e]===td)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=td;try{t[e]=typeof i=="function"?i(r):Hf(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function ji(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!=null)if(typeof r=="object"){const i=t[n];typeof i=="object"&&i!==null?t[n]=ji(i,r):t[n]=ji({},r)}else t[n]=r}return t}class _R{stat(e){throw new Error("No file system is available.")}statSync(e){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}}const dn={fileSystemProvider:()=>new _R},PR={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},$R={AstReflection:()=>new Ed};function LR(){const t=ze(un(dn),$R),e=ze(ln({shared:t}),PR);return t.ServiceRegistry.register(e),e}function jn(t){const e=LR(),n=e.serializer.JsonSerializer.deserialize(t);return e.shared.workspace.LangiumDocumentFactory.fromModel(n,Tt.parse(`memory:/${n.name??"grammar"}.langium`)),n}var OR=Object.defineProperty,L=(t,e)=>OR(t,"name",{value:e,configurable:!0}),xc;(t=>{t.Terminals={ARROW_DIRECTION:/L|R|T|B/,ARROW_GROUP:/\{group\}/,ARROW_INTO:/<|>/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,ARCH_ICON:/\([\w-:]+\)/,ARCH_TITLE:/\[[\w ]+\]/}})(xc||(xc={}));var Dc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/,REFERENCE:/\w([-\./\w]*[-\w])?/}})(Dc||(Dc={}));var Mc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Mc||(Mc={}));var Fc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,INT:/0|[1-9][0-9]*(?!\.)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Fc||(Fc={}));var Gc;(t=>{t.Terminals={NUMBER_PIE:/(?:-?[0-9]+\.[0-9]+(?!\.))|(?:-?(0|[1-9][0-9]*)(?!\.))/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Gc||(Gc={}));var Uc;(t=>{t.Terminals={GRATICULE:/circle|polygon/,BOOLEAN:/true|false/,ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,NUMBER:/(?:[0-9]+\.[0-9]+(?!\.))|(?:0|[1-9][0-9]*(?!\.))/,STRING:/"([^"\\]|\\.)*"|'([^'\\]|\\.)*'/,ID:/[\w]([-\w]*\w)?/,NEWLINE:/\r?\n/,WHITESPACE:/[\t ]+/,YAML:/---[\t ]*\r?\n(?:[\S\s]*?\r?\n)?---(?:\r?\n|(?!\S))/,DIRECTIVE:/[\t ]*%%{[\S\s]*?}%%(?:\r?\n|(?!\S))/,SINGLE_LINE_COMMENT:/[\t ]*%%[^\n\r]*/}})(Uc||(Uc={}));var qc;(t=>{t.Terminals={ACC_DESCR:/[\t ]*accDescr(?:[\t ]*:([^\n\r]*?(?=%%)|[^\n\r]*)|\s*{([^}]*)})/,ACC_TITLE:/[\t ]*accTitle[\t ]*:(?:[^\n\r]*?(?=%%)|[^\n\r]*)/,TITLE:/[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/,TREEMAP_KEYWORD:/treemap-beta|treemap/,CLASS_DEF:/classDef\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\s+([^;\r\n]*))?(?:;)?/,STYLE_SEPARATOR:/:::/,SEPARATOR:/:/,COMMA:/,/,INDENTATION:/[ \t]{1,}/,WS:/[ \t]+/,ML_COMMENT:/\%\%[^\n]*/,NL:/\r?\n/,ID2:/[a-zA-Z_][a-zA-Z0-9_]*/,NUMBER2:/[0-9_\.\,]+/,STRING2:/"[^"]*"|'[^']*'/}})(qc||(qc={}));({...xc.Terminals,...Dc.Terminals,...Mc.Terminals,...Fc.Terminals,...Gc.Terminals,...Uc.Terminals,...qc.Terminals});var Ut={$type:"Architecture",accDescr:"accDescr",accTitle:"accTitle",edges:"edges",groups:"groups",junctions:"junctions",services:"services",title:"title"};function xR(t){return Et.isInstance(t,Ut.$type)}L(xR,"isArchitecture");var bs={$type:"Axis",label:"label",name:"name"},Ws={$type:"Branch",name:"name",order:"order"};function DR(t){return Et.isInstance(t,Ws.$type)}L(DR,"isBranch");var rd={$type:"Checkout",branch:"branch"},Is={$type:"CherryPicking",id:"id",parent:"parent",tags:"tags"},Qa={$type:"ClassDefStatement",className:"className",styleText:"styleText"},ar={$type:"Commit",id:"id",message:"message",tags:"tags",type:"type"};function MR(t){return Et.isInstance(t,ar.$type)}L(MR,"isCommit");var _s={$type:"Curve",entries:"entries",label:"label",name:"name"},Yn={$type:"Direction",accDescr:"accDescr",accTitle:"accTitle",dir:"dir",statements:"statements",title:"title"},St={$type:"Edge",lhsDir:"lhsDir",lhsGroup:"lhsGroup",lhsId:"lhsId",lhsInto:"lhsInto",rhsDir:"rhsDir",rhsGroup:"rhsGroup",rhsId:"rhsId",rhsInto:"rhsInto",title:"title"},Za={$type:"Entry",axis:"axis",value:"value"},_n={$type:"GitGraph",accDescr:"accDescr",accTitle:"accTitle",statements:"statements",title:"title"};function FR(t){return Et.isInstance(t,_n.$type)}L(FR,"isGitGraph");var Ti={$type:"Group",icon:"icon",id:"id",in:"in",title:"title"},bi={$type:"Info",accDescr:"accDescr",accTitle:"accTitle",title:"title"};function GR(t){return Et.isInstance(t,bi.$type)}L(GR,"isInfo");var Ri={$type:"Item",classSelector:"classSelector",name:"name"},eo={$type:"Junction",id:"id",in:"in"},Ps={$type:"Leaf",classSelector:"classSelector",name:"name",value:"value"},or={$type:"Merge",branch:"branch",id:"id",tags:"tags",type:"type"};function UR(t){return Et.isInstance(t,or.$type)}L(UR,"isMerge");var to={$type:"Option",name:"name",value:"value"},cr={$type:"Packet",accDescr:"accDescr",accTitle:"accTitle",blocks:"blocks",title:"title"};function qR(t){return Et.isInstance(t,cr.$type)}L(qR,"isPacket");var lr={$type:"PacketBlock",bits:"bits",end:"end",label:"label",start:"start"};function jR(t){return Et.isInstance(t,lr.$type)}L(jR,"isPacketBlock");var Pn={$type:"Pie",accDescr:"accDescr",accTitle:"accTitle",sections:"sections",showData:"showData",title:"title"};function zR(t){return Et.isInstance(t,Pn.$type)}L(zR,"isPie");var Vs={$type:"PieSection",label:"label",value:"value"};function BR(t){return Et.isInstance(t,Vs.$type)}L(BR,"isPieSection");var Cn={$type:"Radar",accDescr:"accDescr",accTitle:"accTitle",axes:"axes",curves:"curves",options:"options",title:"title"},no={$type:"Section",classSelector:"classSelector",name:"name"},Xn={$type:"Service",icon:"icon",iconText:"iconText",id:"id",in:"in",title:"title"},Jn={$type:"Statement"},ur={$type:"Treemap",accDescr:"accDescr",accTitle:"accTitle",title:"title",TreemapRows:"TreemapRows"};function WR(t){return Et.isInstance(t,ur.$type)}L(WR,"isTreemap");var ro={$type:"TreemapRow",indent:"indent",item:"item"},pr,Yf=(pr=class extends hd{constructor(){super(...arguments),this.types={Architecture:{name:Ut.$type,properties:{accDescr:{name:Ut.accDescr},accTitle:{name:Ut.accTitle},edges:{name:Ut.edges,defaultValue:[]},groups:{name:Ut.groups,defaultValue:[]},junctions:{name:Ut.junctions,defaultValue:[]},services:{name:Ut.services,defaultValue:[]},title:{name:Ut.title}},superTypes:[]},Axis:{name:bs.$type,properties:{label:{name:bs.label},name:{name:bs.name}},superTypes:[]},Branch:{name:Ws.$type,properties:{name:{name:Ws.name},order:{name:Ws.order}},superTypes:[Jn.$type]},Checkout:{name:rd.$type,properties:{branch:{name:rd.branch}},superTypes:[Jn.$type]},CherryPicking:{name:Is.$type,properties:{id:{name:Is.id},parent:{name:Is.parent},tags:{name:Is.tags,defaultValue:[]}},superTypes:[Jn.$type]},ClassDefStatement:{name:Qa.$type,properties:{className:{name:Qa.className},styleText:{name:Qa.styleText}},superTypes:[]},Commit:{name:ar.$type,properties:{id:{name:ar.id},message:{name:ar.message},tags:{name:ar.tags,defaultValue:[]},type:{name:ar.type}},superTypes:[Jn.$type]},Curve:{name:_s.$type,properties:{entries:{name:_s.entries,defaultValue:[]},label:{name:_s.label},name:{name:_s.name}},superTypes:[]},Direction:{name:Yn.$type,properties:{accDescr:{name:Yn.accDescr},accTitle:{name:Yn.accTitle},dir:{name:Yn.dir},statements:{name:Yn.statements,defaultValue:[]},title:{name:Yn.title}},superTypes:[_n.$type]},Edge:{name:St.$type,properties:{lhsDir:{name:St.lhsDir},lhsGroup:{name:St.lhsGroup,defaultValue:!1},lhsId:{name:St.lhsId},lhsInto:{name:St.lhsInto,defaultValue:!1},rhsDir:{name:St.rhsDir},rhsGroup:{name:St.rhsGroup,defaultValue:!1},rhsId:{name:St.rhsId},rhsInto:{name:St.rhsInto,defaultValue:!1},title:{name:St.title}},superTypes:[]},Entry:{name:Za.$type,properties:{axis:{name:Za.axis,referenceType:bs.$type},value:{name:Za.value}},superTypes:[]},GitGraph:{name:_n.$type,properties:{accDescr:{name:_n.accDescr},accTitle:{name:_n.accTitle},statements:{name:_n.statements,defaultValue:[]},title:{name:_n.title}},superTypes:[]},Group:{name:Ti.$type,properties:{icon:{name:Ti.icon},id:{name:Ti.id},in:{name:Ti.in},title:{name:Ti.title}},superTypes:[]},Info:{name:bi.$type,properties:{accDescr:{name:bi.accDescr},accTitle:{name:bi.accTitle},title:{name:bi.title}},superTypes:[]},Item:{name:Ri.$type,properties:{classSelector:{name:Ri.classSelector},name:{name:Ri.name}},superTypes:[]},Junction:{name:eo.$type,properties:{id:{name:eo.id},in:{name:eo.in}},superTypes:[]},Leaf:{name:Ps.$type,properties:{classSelector:{name:Ps.classSelector},name:{name:Ps.name},value:{name:Ps.value}},superTypes:[Ri.$type]},Merge:{name:or.$type,properties:{branch:{name:or.branch},id:{name:or.id},tags:{name:or.tags,defaultValue:[]},type:{name:or.type}},superTypes:[Jn.$type]},Option:{name:to.$type,properties:{name:{name:to.name},value:{name:to.value,defaultValue:!1}},superTypes:[]},Packet:{name:cr.$type,properties:{accDescr:{name:cr.accDescr},accTitle:{name:cr.accTitle},blocks:{name:cr.blocks,defaultValue:[]},title:{name:cr.title}},superTypes:[]},PacketBlock:{name:lr.$type,properties:{bits:{name:lr.bits},end:{name:lr.end},label:{name:lr.label},start:{name:lr.start}},superTypes:[]},Pie:{name:Pn.$type,properties:{accDescr:{name:Pn.accDescr},accTitle:{name:Pn.accTitle},sections:{name:Pn.sections,defaultValue:[]},showData:{name:Pn.showData,defaultValue:!1},title:{name:Pn.title}},superTypes:[]},PieSection:{name:Vs.$type,properties:{label:{name:Vs.label},value:{name:Vs.value}},superTypes:[]},Radar:{name:Cn.$type,properties:{accDescr:{name:Cn.accDescr},accTitle:{name:Cn.accTitle},axes:{name:Cn.axes,defaultValue:[]},curves:{name:Cn.curves,defaultValue:[]},options:{name:Cn.options,defaultValue:[]},title:{name:Cn.title}},superTypes:[]},Section:{name:no.$type,properties:{classSelector:{name:no.classSelector},name:{name:no.name}},superTypes:[Ri.$type]},Service:{name:Xn.$type,properties:{icon:{name:Xn.icon},iconText:{name:Xn.iconText},id:{name:Xn.id},in:{name:Xn.in},title:{name:Xn.title}},superTypes:[]},Statement:{name:Jn.$type,properties:{},superTypes:[]},Treemap:{name:ur.$type,properties:{accDescr:{name:ur.accDescr},accTitle:{name:ur.accTitle},title:{name:ur.title},TreemapRows:{name:ur.TreemapRows,defaultValue:[]}},superTypes:[]},TreemapRow:{name:ro.$type,properties:{indent:{name:ro.indent},item:{name:ro.item}},superTypes:[]}}}},L(pr,"MermaidAstReflection"),pr),Et=new Yf,id,VR=L(()=>id??(id=jn(`{"$type":"Grammar","isDeclared":true,"name":"ArchitectureGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"},"parenthesized":false}],"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"ArchitectureGrammarGrammar"),sd,KR=L(()=>sd??(sd=jn(`{"$type":"Grammar","isDeclared":true,"name":"GitGraphGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[],"types":[]}`)),"GitGraphGrammarGrammar"),ad,HR=L(()=>ad??(ad=jn(`{"$type":"Grammar","isDeclared":true,"name":"InfoGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"InfoGrammarGrammar"),od,YR=L(()=>od??(od=jn(`{"$type":"Grammar","isDeclared":true,"name":"PacketGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PacketGrammarGrammar"),cd,XR=L(()=>cd??(cd=jn(`{"$type":"Grammar","isDeclared":true,"name":"PieGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[],"types":[]}`)),"PieGrammarGrammar"),ld,JR=L(()=>ld??(ld=jn(`{"$type":"Grammar","isDeclared":true,"name":"RadarGrammar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"entry":false,"parameters":[]},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"},"parenthesized":false},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}},"isMulti":false}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"types":[]}`)),"RadarGrammarGrammar"),ud,QR=L(()=>ud??(ud=jn(`{"$type":"Grammar","isDeclared":true,"name":"TreemapGrammar","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"entry":false,"parameters":[]},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"},"parenthesized":false},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"},"parenthesized":false}],"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","},"parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/","parenthesized":false},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"imports":[],"types":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammarGrammar"),ZR={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ev={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},tv={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},nv={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},rv={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},iv={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},sv={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},zn={AstReflection:L(()=>new Yf,"AstReflection")},av={Grammar:L(()=>VR(),"Grammar"),LanguageMetaData:L(()=>ZR,"LanguageMetaData"),parser:{}},ov={Grammar:L(()=>KR(),"Grammar"),LanguageMetaData:L(()=>ev,"LanguageMetaData"),parser:{}},cv={Grammar:L(()=>HR(),"Grammar"),LanguageMetaData:L(()=>tv,"LanguageMetaData"),parser:{}},lv={Grammar:L(()=>YR(),"Grammar"),LanguageMetaData:L(()=>nv,"LanguageMetaData"),parser:{}},uv={Grammar:L(()=>XR(),"Grammar"),LanguageMetaData:L(()=>rv,"LanguageMetaData"),parser:{}},dv={Grammar:L(()=>JR(),"Grammar"),LanguageMetaData:L(()=>iv,"LanguageMetaData"),parser:{}},fv={Grammar:L(()=>QR(),"Grammar"),LanguageMetaData:L(()=>sv,"LanguageMetaData"),parser:{}},hv=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,pv=/accTitle[\t ]*:([^\n\r]*)/,mv=/title([\t ][^\n\r]*|)/,gv={ACC_DESCR:hv,ACC_TITLE:pv,TITLE:mv},mr,$a=(mr=class extends Of{runConverter(e,n,r){let i=this.runCommonConverter(e,n,r);return i===void 0&&(i=this.runCustomConverter(e,n,r)),i===void 0?super.runConverter(e,n,r):i}runCommonConverter(e,n,r){const i=gv[e.name];if(i===void 0)return;const s=i.exec(n);if(s!==null){if(s[1]!==void 0)return s[1].trim().replace(/[\t ]{2,}/gm," ");if(s[2]!==void 0)return s[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
158
|
+
`)}}},L(mr,"AbstractMermaidValueConverter"),mr),gr,La=(gr=class extends $a{runCustomConverter(e,n,r){}},L(gr,"CommonValueConverter"),gr),yr,fn=(yr=class extends Lf{constructor(e){super(),this.keywords=new Set(e)}buildKeywordTokens(e,n,r){const i=super.buildKeywordTokens(e,n,r);return i.forEach(s=>{this.keywords.has(s.name)&&s.PATTERN!==void 0&&(s.PATTERN=new RegExp(s.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),i}},L(yr,"AbstractMermaidTokenBuilder"),yr),Tr;Tr=class extends fn{},L(Tr,"CommonTokenBuilder");var Rr,yv=(Rr=class extends fn{constructor(){super(["gitGraph"])}},L(Rr,"GitGraphTokenBuilder"),Rr),Xf={parser:{TokenBuilder:L(()=>new yv,"TokenBuilder"),ValueConverter:L(()=>new La,"ValueConverter")}};function Jf(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),ov,Xf);return e.ServiceRegistry.register(n),{shared:e,GitGraph:n}}L(Jf,"createGitGraphServices");var vr,Tv=(vr=class extends fn{constructor(){super(["info","showInfo"])}},L(vr,"InfoTokenBuilder"),vr),Qf={parser:{TokenBuilder:L(()=>new Tv,"TokenBuilder"),ValueConverter:L(()=>new La,"ValueConverter")}};function Zf(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),cv,Qf);return e.ServiceRegistry.register(n),{shared:e,Info:n}}L(Zf,"createInfoServices");var Er,Rv=(Er=class extends fn{constructor(){super(["packet"])}},L(Er,"PacketTokenBuilder"),Er),eh={parser:{TokenBuilder:L(()=>new Rv,"TokenBuilder"),ValueConverter:L(()=>new La,"ValueConverter")}};function th(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),lv,eh);return e.ServiceRegistry.register(n),{shared:e,Packet:n}}L(th,"createPacketServices");var Ar,vv=(Ar=class extends fn{constructor(){super(["pie","showData"])}},L(Ar,"PieTokenBuilder"),Ar),Sr,Ev=(Sr=class extends $a{runCustomConverter(e,n,r){if(e.name==="PIE_SECTION_LABEL")return n.replace(/"/g,"").trim()}},L(Sr,"PieValueConverter"),Sr),nh={parser:{TokenBuilder:L(()=>new vv,"TokenBuilder"),ValueConverter:L(()=>new Ev,"ValueConverter")}};function rh(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),uv,nh);return e.ServiceRegistry.register(n),{shared:e,Pie:n}}L(rh,"createPieServices");var kr,Av=(kr=class extends fn{constructor(){super(["architecture"])}},L(kr,"ArchitectureTokenBuilder"),kr),Cr,Sv=(Cr=class extends $a{runCustomConverter(e,n,r){if(e.name==="ARCH_ICON")return n.replace(/[()]/g,"").trim();if(e.name==="ARCH_TEXT_ICON")return n.replace(/["()]/g,"");if(e.name==="ARCH_TITLE")return n.replace(/[[\]]/g,"").trim()}},L(Cr,"ArchitectureValueConverter"),Cr),ih={parser:{TokenBuilder:L(()=>new Av,"TokenBuilder"),ValueConverter:L(()=>new Sv,"ValueConverter")}};function sh(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),av,ih);return e.ServiceRegistry.register(n),{shared:e,Architecture:n}}L(sh,"createArchitectureServices");var Nr,kv=(Nr=class extends fn{constructor(){super(["radar-beta"])}},L(Nr,"RadarTokenBuilder"),Nr),ah={parser:{TokenBuilder:L(()=>new kv,"TokenBuilder"),ValueConverter:L(()=>new La,"ValueConverter")}};function oh(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),dv,ah);return e.ServiceRegistry.register(n),{shared:e,Radar:n}}L(oh,"createRadarServices");var wr,Cv=(wr=class extends fn{constructor(){super(["treemap"])}},L(wr,"TreemapTokenBuilder"),wr),Nv=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,br,wv=(br=class extends $a{runCustomConverter(e,n,r){if(e.name==="NUMBER2")return parseFloat(n.replace(/,/g,""));if(e.name==="SEPARATOR")return n.substring(1,n.length-1);if(e.name==="STRING2")return n.substring(1,n.length-1);if(e.name==="INDENTATION")return n.length;if(e.name==="ClassDef"){if(typeof n!="string")return n;const i=Nv.exec(n);if(i)return{$type:"ClassDefStatement",className:i[1],styleText:i[2]||void 0}}}},L(br,"TreemapValueConverter"),br);function ch(t){const e=t.validation.TreemapValidator,n=t.validation.ValidationRegistry;if(n){const r={Treemap:e.checkSingleRoot.bind(e)};n.register(r,e)}}L(ch,"registerValidationChecks");var Ir,bv=(Ir=class{checkSingleRoot(e,n){let r;for(const i of e.TreemapRows)i.item&&(r===void 0&&i.indent===void 0?r=0:i.indent===void 0?n("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}):r!==void 0&&r>=parseInt(i.indent,10)&&n("error","Multiple root nodes are not allowed in a treemap.",{node:i,property:"item"}))}},L(Ir,"TreemapValidator"),Ir),lh={parser:{TokenBuilder:L(()=>new Cv,"TokenBuilder"),ValueConverter:L(()=>new wv,"ValueConverter")},validation:{TreemapValidator:L(()=>new bv,"TreemapValidator")}};function uh(t=dn){const e=ze(un(t),zn),n=ze(ln({shared:e}),fv,lh);return e.ServiceRegistry.register(n),ch(n),{shared:e,Treemap:n}}L(uh,"createTreemapServices");var jt={},Iv={info:L(async()=>{const{createInfoServices:t}=await Promise.resolve().then(()=>require("./info-VBDWY6EO-BsNozlXs.cjs")),e=t().Info.parser.LangiumParser;jt.info=e},"info"),packet:L(async()=>{const{createPacketServices:t}=await Promise.resolve().then(()=>require("./packet-DYOGHKS2-DZgqFf8l.cjs")),e=t().Packet.parser.LangiumParser;jt.packet=e},"packet"),pie:L(async()=>{const{createPieServices:t}=await Promise.resolve().then(()=>require("./pie-VRWISCQL-BuCxcsRA.cjs")),e=t().Pie.parser.LangiumParser;jt.pie=e},"pie"),architecture:L(async()=>{const{createArchitectureServices:t}=await Promise.resolve().then(()=>require("./architecture-7HQA4BMR-BdQzdD9-.cjs")),e=t().Architecture.parser.LangiumParser;jt.architecture=e},"architecture"),gitGraph:L(async()=>{const{createGitGraphServices:t}=await Promise.resolve().then(()=>require("./gitGraph-G5XIXVHT-DEcLAdEU.cjs")),e=t().GitGraph.parser.LangiumParser;jt.gitGraph=e},"gitGraph"),radar:L(async()=>{const{createRadarServices:t}=await Promise.resolve().then(()=>require("./radar-ZZBFDIW7-CTFB0BiB.cjs")),e=t().Radar.parser.LangiumParser;jt.radar=e},"radar"),treemap:L(async()=>{const{createTreemapServices:t}=await Promise.resolve().then(()=>require("./treemap-GDKQZRPO-DXgt6YFC.cjs")),e=t().Treemap.parser.LangiumParser;jt.treemap=e},"treemap")};async function dh(t,e){const n=Iv[t];if(!n)throw new Error(`Unknown diagram type: ${t}`);jt[t]||await n();const i=jt[t].parse(e);if(i.lexerErrors.length>0||i.parserErrors.length>0)throw new _v(i);return i.value}L(dh,"parse");var _r,_v=(_r=class extends Error{constructor(e){const n=e.lexerErrors.map(i=>i.message).join(`
|
|
159
|
+
`),r=e.parserErrors.map(i=>i.message).join(`
|
|
160
|
+
`);super(`Parsing failed: ${n} ${r}`),this.result=e}},L(_r,"MermaidParseError"),_r);exports.ArchitectureModule=ih;exports.GitGraphModule=Xf;exports.InfoModule=Qf;exports.PacketModule=eh;exports.PieModule=nh;exports.RadarModule=ah;exports.TreemapModule=lh;exports.createArchitectureServices=sh;exports.createGitGraphServices=Jf;exports.createInfoServices=Zf;exports.createPacketServices=th;exports.createPieServices=rh;exports.createRadarServices=oh;exports.createTreemapServices=uh;exports.parse=dh;
|