UNPKG

290 kBJavaScriptView Raw
1#!/usr/bin/env node
2
3!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r.w={},r(r.s=129)}([function(t,e,r){"use strict";e.NotNull=function(t,e,r){},e.Nullable=function(t,e,r){},e.Override=function(t,e,r){},e.SuppressWarnings=function(t){return(t,e,r)=>{}}},function(t,e,r){"use strict";const n=r(21);!function(t){t.INVALID_TYPE=0,t.EPSILON=-2,t.MIN_USER_TOKEN_TYPE=1,t.EOF=n.IntStream.EOF,t.DEFAULT_CHANNEL=0,t.HIDDEN_CHANNEL=1,t.MIN_USER_CHANNEL_VALUE=2}(e.Token||(e.Token={}))},function(t,e,r){"use strict";!function(t){const e=0;function r(t=e){return t}function n(t,e){null==e?e=0:"string"==typeof e?e=function(t){let e=t.length;if(0===e)return 0;let r=0;for(let n=0;n<e;n++){r=(r<<5>>>0)-r+t.charCodeAt(n),r|=0}return r}(e):"object"==typeof e&&(e=e.hashCode());let r=e;return r=(r=Math.imul(r,3432918353))<<15|r>>>17,t=(t^=r=Math.imul(r,461845907))<<13|t>>>19,4294967295&Math.imul(t,5)+3864292196}function i(t,e){return t^=4*e,t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,(t=Math.imul(t,3266489909))^t>>>16}t.initialize=r,t.update=n,t.finish=i,t.hashCode=function(t,o=e){let s=r(o),a=0;for(let e of t)s=n(s,e),a++;return i(s,a)}}(e.MurmurHash||(e.MurmurHash={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=1e3;class s{constructor(t,e){this.a=t,this.b=e}static get INVALID(){return s._INVALID}static of(t,e){return t!==e||t<0||t>o?new s(t,e):(null==s.cache[t]&&(s.cache[t]=new s(t,t)),s.cache[t])}get length(){return this.b<this.a?0:this.b-this.a+1}equals(t){if(t===this)return!0;if(!(t instanceof s))return!1;let e=t;return this.a===e.a&&this.b===e.b}hashCode(){let t=23;return 31*(t=31*t+this.a)+this.b}startsBeforeDisjoint(t){return this.a<t.a&&this.b<t.a}startsBeforeNonDisjoint(t){return this.a<=t.a&&this.b>=t.a}startsAfter(t){return this.a>t.a}startsAfterDisjoint(t){return this.a>t.b}startsAfterNonDisjoint(t){return this.a>t.a&&this.a<=t.b}disjoint(t){return this.startsBeforeDisjoint(t)||this.startsAfterDisjoint(t)}adjacent(t){return this.a===t.b+1||this.b===t.a-1}properlyContains(t){return t.a>=this.a&&t.b<=this.b}union(t){return s.of(Math.min(this.a,t.a),Math.max(this.b,t.b))}intersection(t){return s.of(Math.max(this.a,t.a),Math.min(this.b,t.b))}differenceNotProperlyContained(t){let e;return t.startsBeforeNonDisjoint(this)?e=s.of(Math.max(this.a,t.b+1),this.b):t.startsAfterNonDisjoint(this)&&(e=s.of(this.a,t.a-1)),e}toString(){return this.a+".."+this.b}}s._INVALID=new s(-1,-2),s.cache=new Array(o+1),n([i.Override],s.prototype,"equals",null),n([i.Override],s.prototype,"hashCode",null),n([i.Override],s.prototype,"toString",null),e.Interval=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(20),s=r(13),a=r(49),l=r(2),u=r(0),c=r(45),h=r(5),p=1;class d{constructor(t){this.cachedHashCode=t}static calculateEmptyHashCode(){let t=l.MurmurHash.initialize(p);return l.MurmurHash.finish(t,0)}static calculateSingleHashCode(t,e){let r=l.MurmurHash.initialize(p);return r=l.MurmurHash.update(r,t),r=l.MurmurHash.update(r,e),l.MurmurHash.finish(r,2)}static calculateHashCode(t,e){let r=l.MurmurHash.initialize(p);for(let e of t)r=l.MurmurHash.update(r,e);for(let t of e)r=l.MurmurHash.update(r,t);return l.MurmurHash.finish(r,2*t.length)}static fromRuleContext(t,e,r=!0){if(e.isEmpty)return r?d.EMPTY_FULL:d.EMPTY_LOCAL;let n;n=e._parent?d.fromRuleContext(t,e._parent,r):r?d.EMPTY_FULL:d.EMPTY_LOCAL;let i=t.states[e.invokingState].transition(0);return n.getChild(i.followState.stateNumber)}static addEmptyContext(t){return t.addEmptyContext()}static removeEmptyContext(t){return t.removeEmptyContext()}static join(t,e,r=c.PredictionContextCache.UNCACHED){if(t==e)return t;if(t.isEmpty)return d.isEmptyLocal(t)?t:d.addEmptyContext(e);if(e.isEmpty)return d.isEmptyLocal(e)?e:d.addEmptyContext(t);let n=t.size,i=e.size;if(1===n&&1===i&&t.getReturnState(0)===e.getReturnState(0)){let n=r.join(t.getParent(0),e.getParent(0));return n===t.getParent(0)?t:n===e.getParent(0)?e:n.getChild(t.getReturnState(0))}let o=0,s=new Array(n+i),a=new Array(s.length),l=0,u=0,p=!0,f=!0;for(;l<n&&u<i;)t.getReturnState(l)===e.getReturnState(u)?(s[o]=r.join(t.getParent(l),e.getParent(u)),a[o]=t.getReturnState(l),p=p&&s[o]===t.getParent(l),f=f&&s[o]===e.getParent(u),l++,u++):t.getReturnState(l)<e.getReturnState(u)?(s[o]=t.getParent(l),a[o]=t.getReturnState(l),f=!1,l++):(h(e.getReturnState(u)<t.getReturnState(l)),s[o]=e.getParent(u),a[o]=e.getReturnState(u),p=!1,u++),o++;for(;l<n;)s[o]=t.getParent(l),a[o]=t.getReturnState(l),l++,f=!1,o++;for(;u<i;)s[o]=e.getParent(u),a[o]=e.getReturnState(u),u++,p=!1,o++;return p?t:f?e:(o<s.length&&(s=s.slice(0,o),a=a.slice(0,o)),0===s.length?d.EMPTY_FULL:1===s.length?new y(s[0],a[0]):new g(s,a))}static isEmptyLocal(t){return t===d.EMPTY_LOCAL}static getCachedContext(t,e,r){if(t.isEmpty)return t;let n=r.get(t);if(n)return n;if(n=e.get(t))return r.put(t,n),n;let i,o=!1,s=new Array(t.size);for(let n=0;n<s.length;n++){let i=d.getCachedContext(t.getParent(n),e,r);if(o||i!==t.getParent(n)){if(!o){s=new Array(t.size);for(let e=0;e<t.size;e++)s[e]=t.getParent(e);o=!0}s[n]=i}}if(!o)return n=e.putIfAbsent(t,t),r.put(t,null!=n?n:t),t;if(1===s.length)i=new y(s[0],t.getReturnState(0));else{let e=new Array(t.size);for(let r=0;r<t.size;r++)e[r]=t.getReturnState(r);i=new g(s,e,t.hashCode())}return n=e.putIfAbsent(i,i),r.put(i,n||i),r.put(t,n||i),i}appendSingleContext(t,e){return this.appendContext(d.EMPTY_FULL.getChild(t),e)}getChild(t){return new y(this,t)}hashCode(){return this.cachedHashCode}toStrings(t,e,r=d.EMPTY_FULL){let n=[];t:for(let i=0;;i++){let o=0,s=!0,a=this,l=e,u="";for(u+="[";!a.isEmpty&&a!==r;){let e=0;if(a.size>0){let t=1;for(;1<<t>>>0<a.size;)t++;if(e=i>>o&(1<<t>>>0)-1,s=s&&e>=a.size-1,e>=a.size)continue t;o+=t}if(t){u.length>1&&(u+=" ");let e=t.atn.states[l];u+=t.ruleNames[e.ruleIndex]}else a.getReturnState(e)!==d.EMPTY_FULL_STATE_KEY&&(a.isEmpty||(u.length>1&&(u+=" "),u+=a.getReturnState(e)));l=a.getReturnState(e),a=a.getParent(e)}if(u+="]",n.push(u),s)break}return n}}n([u.Override],d.prototype,"hashCode",null),n([i(0,u.NotNull),i(1,u.NotNull),i(2,u.NotNull)],d,"join",null),n([i(0,u.NotNull),i(1,u.NotNull),i(2,u.NotNull)],d,"getCachedContext",null),e.PredictionContext=d;class f extends d{constructor(t){super(d.calculateEmptyHashCode()),this.fullContext=t}get isFullContext(){return this.fullContext}addEmptyContext(){return this}removeEmptyContext(){throw"Cannot remove the empty context from itself."}getParent(t){throw"index out of bounds"}getReturnState(t){throw"index out of bounds"}findReturnState(t){return-1}get size(){return 0}appendSingleContext(t,e){return e.getChild(this,t)}appendContext(t,e){return t}get isEmpty(){return!0}get hasEmpty(){return!0}equals(t){return this===t}toStrings(t,e,r){return["[]"]}}n([u.Override],f.prototype,"addEmptyContext",null),n([u.Override],f.prototype,"removeEmptyContext",null),n([u.Override],f.prototype,"getParent",null),n([u.Override],f.prototype,"getReturnState",null),n([u.Override],f.prototype,"findReturnState",null),n([u.Override],f.prototype,"size",null),n([u.Override],f.prototype,"appendSingleContext",null),n([u.Override],f.prototype,"appendContext",null),n([u.Override],f.prototype,"isEmpty",null),n([u.Override],f.prototype,"hasEmpty",null),n([u.Override],f.prototype,"equals",null),n([u.Override],f.prototype,"toStrings",null);let g=class t extends d{constructor(t,e,r){super(r||d.calculateHashCode(t,e)),h(t.length===e.length),h(e.length>1||e[0]!==d.EMPTY_FULL_STATE_KEY,"Should be using PredictionContext.EMPTY instead."),this.parents=t,this.returnStates=e}getParent(t){return this.parents[t]}getReturnState(t){return this.returnStates[t]}findReturnState(t){return a.Arrays.binarySearch(this.returnStates,t)}get size(){return this.returnStates.length}get isEmpty(){return!1}get hasEmpty(){return this.returnStates[this.returnStates.length-1]===d.EMPTY_FULL_STATE_KEY}addEmptyContext(){if(this.hasEmpty)return this;let e=this.parents.slice(0),r=this.returnStates.slice(0);return e.push(d.EMPTY_FULL),r.push(d.EMPTY_FULL_STATE_KEY),new t(e,r)}removeEmptyContext(){if(!this.hasEmpty)return this;if(2===this.returnStates.length)return new y(this.parents[0],this.returnStates[0]);{let e=this.parents.slice(0,this.parents.length-1),r=this.returnStates.slice(0,this.returnStates.length-1);return new t(e,r)}}appendContext(e,r){return t.appendContextImpl(this,e,new d.IdentityHashMap)}static appendContextImpl(e,r,n){if(r.isEmpty){if(d.isEmptyLocal(r)){if(e.hasEmpty)return d.EMPTY_LOCAL;throw"what to do here?"}return e}if(1!==r.size)throw"Appending a tree suffix is not yet supported.";let i=n.get(e);if(!i){if(e.isEmpty)i=r;else{let o=e.size;e.hasEmpty&&o--;let s=new Array(o),a=new Array(o);for(let t=0;t<o;t++)a[t]=e.getReturnState(t);for(let i=0;i<o;i++)s[i]=t.appendContextImpl(e.getParent(i),r,n);1===s.length?i=new y(s[0],a[0]):(h(s.length>1),i=new t(s,a)),e.hasEmpty&&(i=d.join(i,r))}n.put(e,i)}return i}equals(e){if(this===e)return!0;if(!(e instanceof t))return!1;if(this.hashCode()!==e.hashCode())return!1;let r=e;return this.equalsImpl(r,new s.Array2DHashSet)}equalsImpl(t,e){let r=[],n=[];for(r.push(this),n.push(t);;){let t=r.pop(),i=n.pop();if(!t||!i)break;let o=new c.PredictionContextCache.IdentityCommutativePredictionContextOperands(t,i);if(!e.add(o))continue;let s=o.x.size;if(0!==s){if(s!==o.y.size)return!1;for(let t=0;t<s;t++){if(o.x.getReturnState(t)!==o.y.getReturnState(t))return!1;let e=o.x.getParent(t),i=o.y.getParent(t);if(e.hashCode()!==i.hashCode())return!1;e!==i&&(r.push(e),n.push(i))}}else if(!o.x.equals(o.y))return!1}return!0}};n([u.NotNull],g.prototype,"parents",void 0),n([u.NotNull],g.prototype,"returnStates",void 0),n([u.Override],g.prototype,"getParent",null),n([u.Override],g.prototype,"getReturnState",null),n([u.Override],g.prototype,"findReturnState",null),n([u.Override],g.prototype,"size",null),n([u.Override],g.prototype,"isEmpty",null),n([u.Override],g.prototype,"hasEmpty",null),n([u.Override],g.prototype,"addEmptyContext",null),n([u.Override],g.prototype,"removeEmptyContext",null),n([u.Override],g.prototype,"appendContext",null),n([u.Override],g.prototype,"equals",null),g=n([i(0,u.NotNull)],g);let y=class t extends d{constructor(t,e){super(d.calculateSingleHashCode(t,e)),this.parent=t,this.returnState=e}getParent(t){return this.parent}getReturnState(t){return this.returnState}findReturnState(t){return this.returnState===t?0:-1}get size(){return 1}get isEmpty(){return!1}get hasEmpty(){return!1}appendContext(t,e){return e.getChild(this.parent.appendContext(t,e),this.returnState)}addEmptyContext(){let t=[this.parent,d.EMPTY_FULL],e=[this.returnState,d.EMPTY_FULL_STATE_KEY];return new g(t,e)}removeEmptyContext(){return this}equals(e){if(e===this)return!0;if(!(e instanceof t))return!1;let r=e;return this.hashCode()===r.hashCode()&&this.returnState===r.returnState&&this.parent.equals(r.parent)}};n([u.NotNull],y.prototype,"parent",void 0),n([u.Override],y.prototype,"getParent",null),n([u.Override],y.prototype,"getReturnState",null),n([u.Override],y.prototype,"findReturnState",null),n([u.Override],y.prototype,"size",null),n([u.Override],y.prototype,"isEmpty",null),n([u.Override],y.prototype,"hasEmpty",null),n([u.Override],y.prototype,"appendContext",null),n([u.Override],y.prototype,"addEmptyContext",null),n([u.Override],y.prototype,"removeEmptyContext",null),n([u.Override],y.prototype,"equals",null),y=n([i(0,u.NotNull)],y),e.SingletonPredictionContext=y,function(t){t.EMPTY_LOCAL=new f(!1),t.EMPTY_FULL=new f(!0),t.EMPTY_LOCAL_STATE_KEY=-2147483648,t.EMPTY_FULL_STATE_KEY=2147483647,t.IdentityHashMap=class extends o.Array2DHashMap{constructor(){super(e.INSTANCE)}};class e{IdentityEqualityComparator(){}hashCode(t){return t.hashCode()}equals(t,e){return t===e}}e.INSTANCE=new e,n([u.Override],e.prototype,"hashCode",null),n([u.Override],e.prototype,"equals",null),t.IdentityEqualityComparator=e}(d=e.PredictionContext||(e.PredictionContext={}))},function(t,e){t.exports=require("assert")},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0);class o{hashCode(t){return null==t?0:t.hashCode()}equals(t,e){return null==t?null==e:t.equals(e)}}o.INSTANCE=new o,n([i.Override],o.prototype,"hashCode",null),n([i.Override],o.prototype,"equals",null),e.ObjectEqualityComparator=o},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(20),s=r(46),a=r(18),l=r(66),u=r(116),c=r(0),h=r(6),p=r(4),d=r(1),f=r(5);let g=class{constructor(t,e){this.states=[],this.decisionToState=[],this.modeNameToStartState=new Map,this.modeToStartState=[],this.contextCache=new o.Array2DHashMap(h.ObjectEqualityComparator.INSTANCE),this.decisionToDFA=[],this.modeToDFA=[],this.LL1Table=new Map,this.grammarType=t,this.maxTokenType=e}clearDFA(){this.decisionToDFA=new Array(this.decisionToState.length);for(let t=0;t<this.decisionToDFA.length;t++)this.decisionToDFA[t]=new s.DFA(this.decisionToState[t],t);this.modeToDFA=new Array(this.modeToStartState.length);for(let t=0;t<this.modeToDFA.length;t++)this.modeToDFA[t]=new s.DFA(this.modeToStartState[t]);this.contextCache.clear(),this.LL1Table.clear()}get contextCacheSize(){return this.contextCache.size}getCachedContext(t){return p.PredictionContext.getCachedContext(t,this.contextCache,new p.PredictionContext.IdentityHashMap)}getDecisionToDFA(){return f(null!=this.decisionToDFA&&this.decisionToDFA.length===this.decisionToState.length),this.decisionToDFA}nextTokens(t,e){return e?new u.LL1Analyzer(this).LOOK(t,e):t.nextTokenWithinRule?t.nextTokenWithinRule:(t.nextTokenWithinRule=this.nextTokens(t,p.PredictionContext.EMPTY_LOCAL),t.nextTokenWithinRule.setReadonly(!0),t.nextTokenWithinRule)}addState(t){t.atn=this,t.stateNumber=this.states.length,this.states.push(t)}removeState(t){let e=new l.InvalidState;e.atn=this,e.stateNumber=t.stateNumber,this.states[t.stateNumber]=e}defineMode(t,e){this.modeNameToStartState.set(t,e),this.modeToStartState.push(e),this.modeToDFA.push(new s.DFA(e)),this.defineDecisionState(e)}defineDecisionState(t){return this.decisionToState.push(t),t.decision=this.decisionToState.length-1,this.decisionToDFA.push(new s.DFA(t,t.decision)),t.decision}getDecisionState(t){if(this.decisionToState.length>0)return this.decisionToState[t]}get numberOfDecisions(){return this.decisionToState.length}getExpectedTokens(t,e){if(t<0||t>=this.states.length)throw new RangeError("Invalid state number.");let r=e,n=this.states[t],i=this.nextTokens(n);if(!i.contains(d.Token.EPSILON))return i;let o=new a.IntervalSet;for(o.addAll(i),o.remove(d.Token.EPSILON);null!=r&&r.invokingState>=0&&i.contains(d.Token.EPSILON);){let t=this.states[r.invokingState].transition(0);i=this.nextTokens(t.followState),o.addAll(i),o.remove(d.Token.EPSILON),r=r._parent}return i.contains(d.Token.EPSILON)&&o.add(d.Token.EOF),o}};n([c.NotNull],g.prototype,"states",void 0),n([c.NotNull],g.prototype,"decisionToState",void 0),n([c.NotNull],g.prototype,"modeNameToStartState",void 0),n([c.NotNull],g.prototype,"modeToStartState",void 0),n([c.NotNull],g.prototype,"decisionToDFA",void 0),n([c.NotNull],g.prototype,"modeToDFA",void 0),n([c.NotNull],g.prototype,"nextTokens",null),n([i(0,c.NotNull)],g.prototype,"removeState",null),n([i(0,c.NotNull),i(1,c.NotNull)],g.prototype,"defineMode",null),n([i(0,c.NotNull)],g.prototype,"defineDecisionState",null),n([c.NotNull],g.prototype,"getExpectedTokens",null),g=n([i(0,c.NotNull)],g),e.ATN=g,(g=e.ATN||(e.ATN={})).INVALID_ALT_NUMBER=0,e.ATN=g},function(t,e,r){"use strict";e.escapeWhitespace=function(t,e){return e?t.replace(/ /,"·"):t.replace(/\t/,"\\t").replace(/\n/,"\\n").replace(/\r/,"\\r")},e.join=function(t,e){let r="",n=!0;for(let i of t)n?n=!1:r+=e,r+=i;return r},e.equals=function(t,e){return t===e||null!=t&&null!=e&&t.equals(e)},e.toMap=function(t){let e=new Map;for(let r=0;r<t.length;r++)e.set(t[r],r);return e},e.toCharArray=function(t){let e=new Uint16Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(59),o=r(3),s=r(0),a=r(58),l=r(35);class u extends a.RuleContext{constructor(t,e){null==e?super():super(t,e)}static emptyContext(){return u.EMPTY}copyFrom(t){if(this._parent=t._parent,this.invokingState=t.invokingState,this._start=t._start,this._stop=t._stop,t.children){this.children=[];for(let e of t.children)e instanceof i.ErrorNode&&(this.children.push(e),e._parent=this)}}enterRule(t){}exitRule(t){}addChild(t){let e;return t instanceof l.TerminalNode||t instanceof a.RuleContext||((t=new l.TerminalNode(t))._parent=this,e=t),this.children?this.children.push(t):this.children=[t],e}removeLastChild(){this.children&&this.children.pop()}addErrorNode(t){let e=new i.ErrorNode(t);return this.addChild(e),e._parent=this,e}get parent(){let t=super.parent;if(void 0===t||t instanceof u)return t;throw new TypeError("Invalid parent type for ParserRuleContext")}getChild(t,e){if(!this.children||t<0||t>=this.children.length)throw new RangeError("index parameter must be between >= 0 and <= number of children.");if(null==e)return this.children[t];let r=this.tryGetChild(t,e);if(void 0===r)throw new Error("The specified node does not exist");return r}tryGetChild(t,e){if(!this.children||t<0||t>=this.children.length)return;let r=-1;for(let n of this.children)if(n instanceof e&&++r===t)return n}getToken(t,e){let r=this.tryGetToken(t,e);if(void 0===r)throw new Error("The specified token does not exist");return r}tryGetToken(t,e){if(!this.children||e<0||e>=this.children.length)return;let r=-1;for(let n of this.children)if(n instanceof l.TerminalNode&&n.symbol.type===t&&++r===e)return n}getTokens(t){let e=[];if(!this.children)return e;for(let r of this.children)r instanceof l.TerminalNode&&r.symbol.type===t&&e.push(r);return e}get ruleContext(){return this}getRuleContext(t,e){return this.getChild(t,e)}tryGetRuleContext(t,e){return this.tryGetChild(t,e)}getRuleContexts(t){let e=[];if(!this.children)return e;for(let r of this.children)r instanceof t&&e.push(r);return e}get childCount(){return this.children?this.children.length:0}get sourceInterval(){return this._start?!this._stop||this._stop.tokenIndex<this._start.tokenIndex?o.Interval.of(this._start.tokenIndex,this._start.tokenIndex-1):o.Interval.of(this._start.tokenIndex,this._stop.tokenIndex):o.Interval.INVALID}get start(){return this._start}get stop(){return this._stop}toInfoString(t){return"ParserRuleContext"+t.getRuleInvocationStack(this).reverse()+"{start="+this._start+", stop="+this._stop+"}"}}u.EMPTY=new u,n([s.Override],u.prototype,"parent",null),n([s.Override],u.prototype,"childCount",null),n([s.Override],u.prototype,"sourceInterval",null),e.ParserRuleContext=u},function(t,e,r){"use strict";const n=r(74),i=r(2),o=new Uint16Array(0);function s(t){return t>>>4}function a(t){return 16*t}function l(t){let e=1;for(let r=0;r<16;r++){if(0!=(t&e))return r;e=e<<1>>>0}throw new RangeError("No specified bit found")}function u(t){let e=32768;for(let r=15;r>=0;r--){if(0!=(t&e))return r;e>>>=1}throw new RangeError("No specified bit found")}function c(t,e){return(t&=15)==(e&=15)?1<<t>>>0:65535>>>15-e^65535>>>16-t}const h=new Uint8Array(65536);for(let t=0;t<16;t++){const e=1<<t>>>0;let r=0;for(;r<h.length;){r+=e;for(let t=0;t<e;t++)h[r]++,r++}}class p{constructor(t){if(t)if("number"==typeof t){if(t<0)throw new RangeError("nbits cannot be negative");this.data=new Uint16Array(s(t-1)+1)}else if(t instanceof p)this.data=t.data.slice(0);else{let e=-1;for(let r of t)e<r&&(e=r);this.data=new Uint16Array(s(e-1)+1);for(let e of t)this.set(e)}else this.data=o}and(t){const e=this.data,r=t.data,n=Math.min(e.length,r.length);let i=-1;for(let t=0;t<n;t++)0!=(e[t]&=r[t])&&(i=t);-1===i&&(this.data=o),i<e.length-1&&(this.data=e.slice(0,i+1))}andNot(t){const e=this.data,r=t.data,n=Math.min(e.length,r.length);let i=-1;for(let t=0;t<n;t++)0!=(e[t]&=65535^r[t])&&(i=t);-1===i&&(this.data=o),i<e.length-1&&(this.data=e.slice(0,i+1))}cardinality(){if(this.isEmpty)return 0;const t=this.data,e=t.length;let r=0;for(let n=0;n<e;n++)r+=h[t[n]];return r}clear(t,e){null==t?this.data.fill(0):null==e?this.set(t,!1):this.set(t,e,!1)}flip(t,e){if(null==e&&(e=t),t<0||e<t)throw new RangeError;let r=s(t);const n=s(e);if(r===n)this.data[r]^=c(t,e);else{for(this.data[r++]^=c(t,15);r<n;)this.data[r++]^=65535;this.data[r++]^=c(0,e)}}get(t,e){if(void 0===e)return!!(this.data[s(t)]&c(t,t));{let r=new p(e+1);for(let n=t;n<=e;n++)r.set(n,this.get(n));return r}}intersects(t){let e=Math.min(this.length(),t.length());if(0===e)return!1;let r=s(e-1);for(let e=0;e<=r;e++)if(0!=(this.data[e]&t.data[e]))return!0;return!1}get isEmpty(){return 0===this.length()}length(){return this.data.length?this.previousSetBit(a(this.data.length)-1)+1:0}nextClearBit(t){if(t<0)throw new RangeError("fromIndex cannot be negative");const e=this.data,r=e.length;let n=s(t);if(n>r)return-1;let i=65535^c(t,15);if(65535==(e[n]|i)){for(n++,i=0;n<r&&65535===e[n];n++);if(n===r)return-1}return a(n)+l(65535^(e[n]|i))}nextSetBit(t){if(t<0)throw new RangeError("fromIndex cannot be negative");const e=this.data,r=e.length;let n=s(t);if(n>r)return-1;let i=c(t,15);if(0==(e[n]&i)){for(n++,i=65535;n<r&&0===e[n];n++);if(n>=r)return-1}return a(n)+l(e[n]&i)}or(t){const e=this.data,r=t.data,n=Math.min(e.length,r.length),i=Math.max(e.length,r.length),s=e.length===i?e:new Uint16Array(i);let a=-1;for(let t=0;t<n;t++)0!=(s[t]=e[t]|r[t])&&(a=t);const l=e.length>r.length?e:r;for(let t=n;t<i;t++)0!==(s[t]=l[t])&&(a=t);-1===a?this.data=o:s.length===a+1?this.data=s:this.data=s.slice(0,a)}previousClearBit(t){if(t<0)throw new RangeError("fromIndex cannot be negative");const e=this.data,r=e.length;let n=s(t);n>=r&&(n=r-1);let i=65535^c(0,t);if(65535==(e[n]|i)){for(i=0,n--;n>=0&&65535===e[n];n--);if(n<0)return-1}return a(n)+u(65535^(e[n]|i))}previousSetBit(t){if(t<0)throw new RangeError("fromIndex cannot be negative");const e=this.data,r=e.length;let n=s(t);n>=r&&(n=r-1);let i=c(0,t);if(0==(e[n]&i)){for(n--,i=65535;n>=0&&0===e[n];n--);if(n<0)return-1}return a(n)+u(e[n]&i)}set(t,e,r){if(void 0===e?(e=t,r=!0):"boolean"==typeof e&&(r=e,e=t),void 0===r&&(r=!0),t<0||t>e)throw new RangeError;let n=s(t),i=s(e);if(r&&i>=this.data.length){var o=new Uint16Array(i+1);this.data.forEach((t,e)=>o[e]=t),this.data=o}else if(!r){if(n>=this.data.length)return;i>=this.data.length&&(i=this.data.length-1,e=16*this.data.length-1)}if(n===i)this._setBits(n,r,c(t,e));else{for(this._setBits(n++,r,c(t,15));n<i;)this.data[n++]=r?65535:0;this._setBits(n,r,c(0,e))}}_setBits(t,e,r){e?this.data[t]|=r:this.data[t]&=65535^r}get size(){return 8*this.data.byteLength}hashCode(){return i.MurmurHash.hashCode(this.data,22)}equals(t){if(t===this)return!0;if(!(t instanceof p))return!1;const e=this.length();if(e!==t.length())return!1;if(0===e)return!0;let r=s(e-1);for(let e=0;e<=r;e++)if(this.data[e]!==t.data[e])return!1;return!0}toString(){let t="{",e=!0;for(let r=this.nextSetBit(0);r>=0;r=this.nextSetBit(r+1))e?e=!1:t+=", ",t+=r;return t+"}"}xor(t){const e=this.data,r=t.data,n=Math.min(e.length,r.length),i=Math.max(e.length,r.length),s=e.length===i?e:new Uint16Array(i);let a=-1;for(let t=0;t<n;t++)0!=(s[t]=e[t]^r[t])&&(a=t);const l=e.length>r.length?e:r;for(let t=n;t<i;t++)0!==(s[t]=l[t])&&(a=t);-1===a?this.data=o:s.length===a+1?this.data=s:this.data=s.slice(0,a+1)}clone(){return new p(this)}[Symbol.iterator](){return new d(this.data)}[n.inspect.custom](){return"BitSet "+this.toString()}}e.BitSet=p;class d{constructor(t){this.data=t,this.index=0,this.mask=65535}next(){for(;this.index<this.data.length;){const t=this.data[this.index]&this.mask;if(0!==t){const e=a(this.index)+l(t);return this.mask=c(e+1,15),{done:!1,value:e}}this.index++,this.mask=65535}return{done:!0,value:-1}}[Symbol.iterator](){return this}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0);class o{constructor(){this.stateNumber=o.INVALID_STATE_NUMBER,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.optimizedTransitions=this.transitions}getStateNumber(){return this.stateNumber}get nonStopStateNumber(){return this.getStateNumber()}hashCode(){return this.stateNumber}equals(t){return t instanceof o&&this.stateNumber===t.stateNumber}get isNonGreedyExitState(){return!1}toString(){return String(this.stateNumber)}getTransitions(){return this.transitions.slice(0)}get numberOfTransitions(){return this.transitions.length}addTransition(t,e){if(0===this.transitions.length)this.epsilonOnlyTransitions=t.isEpsilon;else if(this.epsilonOnlyTransitions!==t.isEpsilon)throw this.epsilonOnlyTransitions=!1,new Error("ATN state "+this.stateNumber+" has both epsilon and non-epsilon transitions.");this.transitions.splice(void 0!==e?e:this.transitions.length,0,t)}transition(t){return this.transitions[t]}setTransition(t,e){this.transitions[t]=e}removeTransition(t){return this.transitions.splice(t,1)[0]}get onlyHasEpsilonTransitions(){return this.epsilonOnlyTransitions}setRuleIndex(t){this.ruleIndex=t}get isOptimized(){return this.optimizedTransitions!==this.transitions}get numberOfOptimizedTransitions(){return this.optimizedTransitions.length}getOptimizedTransition(t){return this.optimizedTransitions[t]}addOptimizedTransition(t){this.isOptimized||(this.optimizedTransitions=new Array),this.optimizedTransitions.push(t)}setOptimizedTransition(t,e){if(!this.isOptimized)throw new Error("This ATNState is not optimized.");this.optimizedTransitions[t]=e}removeOptimizedTransition(t){if(!this.isOptimized)throw new Error("This ATNState is not optimized.");this.optimizedTransitions.splice(t,1)}}o.serializationNames=["INVALID","BASIC","RULE_START","BLOCK_START","PLUS_BLOCK_START","STAR_BLOCK_START","TOKEN_START","RULE_STOP","BLOCK_END","STAR_LOOP_BACK","STAR_LOOP_ENTRY","PLUS_LOOP_BACK","LOOP_END"],n([i.Override],o.prototype,"hashCode",null),n([i.Override],o.prototype,"equals",null),n([i.Override],o.prototype,"toString",null),e.ATNState=o,(o=e.ATNState||(e.ATNState={})).INVALID_STATE_NUMBER=-1},function(t,e,r){"use strict";e.asIterable=function(t){return t[Symbol.iterator]?t:new class{constructor(t){this.collection=t}[Symbol.iterator](){return this._iterator=this.collection.iterator(),this}next(){return this._iterator.hasNext()?{done:!1,value:this._iterator.next()}:{done:!0,value:void 0}}}(t)}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(5),s=r(71),a=r(0),l=r(12),u=r(2),c=16,h=8,p=.75;class d{constructor(t,e=c,r=h){if(this.n=0,this.threshold=Math.floor(c*p),this.initialBucketCapacity=h,t instanceof d){this.comparator=t.comparator,this.buckets=t.buckets.slice(0);for(let t=0;t<this.buckets.length;t++)this.buckets[t]&&(this.buckets[t]=this.buckets[t].slice(0));this.n=t.n,this.threshold=t.threshold,this.initialBucketCapacity=t.initialBucketCapacity}else this.comparator=t||s.DefaultEqualityComparator.INSTANCE,this.buckets=this.createBuckets(e),this.initialBucketCapacity=r}getOrAdd(t){return this.n>this.threshold&&this.expand(),this.getOrAddImpl(t)}getOrAddImpl(t){let e=this.getBucket(t),r=this.buckets[e];if(!r)return(r=this.createBucket(this.initialBucketCapacity))[0]=t,this.buckets[e]=r,this.n++,t;for(let e=0;e<r.length;e++){let n=r[e];if(!n)return r[e]=t,this.n++,t;if(this.comparator.equals(n,t))return n}let n=r.length;return r.length*=2,r[n]=t,this.n++,t}get(t){if(null==t)return t;let e=this.getBucket(t),r=this.buckets[e];if(r)for(let e of r){if(!e)return;if(this.comparator.equals(e,t))return e}}getBucket(t){return this.comparator.hashCode(t)&this.buckets.length-1}hashCode(){let t=u.MurmurHash.initialize();for(let e of this.buckets)if(null!=e)for(let r of e){if(null==r)break;t=u.MurmurHash.update(t,this.comparator.hashCode(r))}return u.MurmurHash.finish(t,this.size)}equals(t){return t===this||t instanceof d&&(t.size===this.size&&this.containsAll(t))}expand(){let t=this.buckets,e=2*this.buckets.length,r=this.createBuckets(e),n=new Uint32Array(r.length);this.buckets=r,this.threshold=Math.floor(e*p);let i=this.size;for(let e of t)if(null!=e)for(let t of e){if(null==t)break;let e,i=this.getBucket(t),o=n[i];0===o?(e=this.createBucket(this.initialBucketCapacity),r[i]=e):o===(e=r[i]).length&&(e.length*=2),e[o]=t,n[i]++}o(this.n===i)}add(t){return this.getOrAdd(t)===t}get size(){return this.n}get isEmpty(){return 0===this.n}contains(t){return this.containsFast(this.asElementType(t))}containsFast(t){return null!=t&&null!=this.get(t)}iterator(){return new f(this.toArray(),this)}toArray(t){(!t||t.length<this.size)&&(t=new Array(this.size));let e=0;for(let r of this.buckets)if(null!=r)for(let n of r){if(null==n)break;t[e++]=n}return t}remove(t){return this.removeFast(this.asElementType(t))}removeFast(t){if(null==t)return!1;let e=this.getBucket(t),r=this.buckets[e];if(!r)return!1;for(let e=0;e<r.length;e++){let n=r[e];if(!n)return!1;if(this.comparator.equals(n,t))return r.copyWithin(e,e+1),r[r.length-1]=void 0,this.n--,!0}return!1}containsAll(t){if(t instanceof d){let e=t;for(let t of e.buckets)if(null!=t)for(let e of t){if(null==e)break;if(!this.containsFast(this.asElementType(e)))return!1}}else for(let e of l.asIterable(t))if(!this.containsFast(this.asElementType(e)))return!1;return!0}addAll(t){let e=!1;for(let r of l.asIterable(t))this.getOrAdd(r)!==r&&(e=!0);return e}retainAll(t){let e=0;for(let r of this.buckets){if(null==r)continue;let n,i;for(n=0,i=0;n<r.length&&null!=r[n];n++)t.contains(r[n])&&(n!==i&&(r[i]=r[n]),i++,e++);for(e+=i;i<n;)r[i]=void 0,i++}let r=e!=this.n;return this.n=e,r}removeAll(t){let e=!1;for(let r of l.asIterable(t))this.removeFast(this.asElementType(r))&&(e=!0);return e}clear(){this.buckets=this.createBuckets(c),this.n=0,this.threshold=Math.floor(c*p)}toString(){if(0===this.size)return"{}";let t="{",e=!0;for(let r of this.buckets)if(null!=r)for(let n of r){if(null==n)break;e?e=!1:t+=", ",t+=n.toString()}return t+"}"}toTableString(){let t="";for(let e of this.buckets){if(null==e){t+="null\n";continue}t+="[";let r=!0;for(let n of e)r?r=!1:t+=" ",t+=null==n?"_":n.toString();t+="]\n"}return t}asElementType(t){return t}createBuckets(t){return new Array(t)}createBucket(t){return new Array(t)}}n([a.NotNull],d.prototype,"comparator",void 0),n([a.Override],d.prototype,"hashCode",null),n([a.Override],d.prototype,"equals",null),n([a.Override],d.prototype,"add",null),n([a.Override],d.prototype,"size",null),n([a.Override],d.prototype,"isEmpty",null),n([a.Override],d.prototype,"contains",null),n([i(0,a.Nullable)],d.prototype,"containsFast",null),n([a.Override],d.prototype,"iterator",null),n([a.Override],d.prototype,"toArray",null),n([a.Override],d.prototype,"remove",null),n([i(0,a.Nullable)],d.prototype,"removeFast",null),n([a.Override],d.prototype,"containsAll",null),n([a.Override],d.prototype,"addAll",null),n([a.Override],d.prototype,"retainAll",null),n([a.Override],d.prototype,"removeAll",null),n([a.Override],d.prototype,"clear",null),n([a.Override],d.prototype,"toString",null),n([a.SuppressWarnings("unchecked")],d.prototype,"asElementType",null),n([a.SuppressWarnings("unchecked")],d.prototype,"createBuckets",null),n([a.SuppressWarnings("unchecked")],d.prototype,"createBucket",null),e.Array2DHashSet=d;class f{constructor(t,e){this.data=t,this.set=e,this.nextIndex=0,this.removed=!0}hasNext(){return this.nextIndex<this.data.length}next(){if(this.nextIndex>=this.data.length)throw new RangeError("Attempted to iterate past end.");return this.removed=!1,this.data[this.nextIndex++]}remove(){if(this.removed)throw new Error("This entry has already been removed");this.set.remove(this.data[this.nextIndex-1]),this.removed=!0}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0);let s=class{constructor(t){if(null==t)throw"target cannot be null.";this.target=t}get isEpsilon(){return!1}get label(){}};s.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],n([o.NotNull],s.prototype,"target",void 0),s=n([i(0,o.NotNull)],s),e.Transition=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=r(1);class s{constructor(t,e,r){this.literalNames=t,this.symbolicNames=e,this.displayNames=r,this._maxTokenType=Math.max(this.displayNames.length,Math.max(this.literalNames.length,this.symbolicNames.length))-1}get maxTokenType(){return this._maxTokenType}getLiteralName(t){if(t>=0&&t<this.literalNames.length)return this.literalNames[t]}getSymbolicName(t){return t>=0&&t<this.symbolicNames.length?this.symbolicNames[t]:t===o.Token.EOF?"EOF":void 0}getDisplayName(t){if(t>=0&&t<this.displayNames.length){let e=this.displayNames[t];if(e)return e}let e=this.getLiteralName(t);return e||(this.getSymbolicName(t)||String(t))}}s.EMPTY_VOCABULARY=new s([],[],[]),n([i.NotNull],s.prototype,"literalNames",void 0),n([i.NotNull],s.prototype,"symbolicNames",void 0),n([i.NotNull],s.prototype,"displayNames",void 0),n([i.Override],s.prototype,"maxTokenType",null),n([i.Override],s.prototype,"getLiteralName",null),n([i.Override],s.prototype,"getSymbolicName",null),n([i.Override,i.NotNull],s.prototype,"getDisplayName",null),n([i.NotNull],s,"EMPTY_VOCABULARY",void 0),e.VocabularyImpl=s},function(t,e,r){"use strict";const n=r(11);e.DecisionState=class extends n.ATNState{constructor(){super(...arguments),this.decision=-1,this.nonGreedy=!1,this.sll=!1}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(48),o=r(70),s=r(3),a=r(21),l=r(47),u=r(38),c=r(0),h=r(24),p=r(1);class d extends h.Recognizer{constructor(t){super(),this._factory=i.CommonTokenFactory.DEFAULT,this._tokenStartCharIndex=-1,this._tokenStartLine=0,this._tokenStartCharPositionInLine=0,this._hitEOF=!1,this._channel=0,this._type=0,this._modeStack=new o.IntegerStack,this._mode=d.DEFAULT_MODE,this._input=t,this._tokenFactorySourcePair={source:this,stream:t}}static get DEFAULT_TOKEN_CHANNEL(){return p.Token.DEFAULT_CHANNEL}static get HIDDEN(){return p.Token.HIDDEN_CHANNEL}reset(t){void 0!==t&&!0!==t||this._input.seek(0),this._token=void 0,this._type=p.Token.INVALID_TYPE,this._channel=p.Token.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartCharPositionInLine=-1,this._tokenStartLine=-1,this._text=void 0,this._hitEOF=!1,this._mode=d.DEFAULT_MODE,this._modeStack.clear(),this.interpreter.reset()}nextToken(){if(null==this._input)throw new Error("nextToken requires a non-null input stream.");let t=this._input.mark();try{t:for(;;){if(this._hitEOF)return this.emitEOF();this._token=void 0,this._channel=p.Token.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartCharPositionInLine=this.interpreter.charPositionInLine,this._tokenStartLine=this.interpreter.line,this._text=void 0;do{let t;this._type=p.Token.INVALID_TYPE;try{t=this.interpreter.match(this._input,this._mode)}catch(e){if(!(e instanceof u.LexerNoViableAltException))throw e;this.notifyListeners(e),this.recover(e),t=d.SKIP}if(this._input.LA(1)===a.IntStream.EOF&&(this._hitEOF=!0),this._type===p.Token.INVALID_TYPE&&(this._type=t),this._type===d.SKIP)continue t}while(this._type===d.MORE);return null==this._token?this.emit():this._token}}finally{this._input.release(t)}}skip(){this._type=d.SKIP}more(){this._type=d.MORE}mode(t){this._mode=t}pushMode(t){l.LexerATNSimulator.debug&&console.log("pushMode "+t),this._modeStack.push(this._mode),this.mode(t)}popMode(){if(this._modeStack.isEmpty)throw new Error("EmptyStackException");return l.LexerATNSimulator.debug&&console.log("popMode back to "+this._modeStack.peek()),this.mode(this._modeStack.pop()),this._mode}get tokenFactory(){return this._factory}set tokenFactory(t){this._factory=t}set inputStream(t){this.reset(!1),this._input=t,this._tokenFactorySourcePair={source:this,stream:this._input}}get sourceName(){return this._input.sourceName}get inputStream(){return this._input}emit(t){return t||(t=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.charIndex-1,this._tokenStartLine,this._tokenStartCharPositionInLine)),this._token=t,t}emitEOF(){let t=this.charPositionInLine,e=this.line,r=this._factory.create(this._tokenFactorySourcePair,p.Token.EOF,void 0,p.Token.DEFAULT_CHANNEL,this._input.index,this._input.index-1,e,t);return this.emit(r),r}get line(){return this.interpreter.line}get charPositionInLine(){return this.interpreter.charPositionInLine}set line(t){this.interpreter.line=t}set charPositionInLine(t){this.interpreter.charPositionInLine=t}get charIndex(){return this._input.index}get text(){return null!=this._text?this._text:this.interpreter.getText(this._input)}set text(t){this._text=t}get token(){return this._token}set token(t){this._token=t}set type(t){this._type=t}get type(){return this._type}set channel(t){this._channel=t}get channel(){return this._channel}getAllTokens(){let t=[],e=this.nextToken();for(;e.type!=p.Token.EOF;)t.push(e),e=this.nextToken();return t}notifyListeners(t){let e=this._input.getText(s.Interval.of(this._tokenStartCharIndex,this._input.index)),r="token recognition error at: '"+this.getErrorDisplay(e)+"'";this.getErrorListenerDispatch().syntaxError(this,void 0,this._tokenStartLine,this._tokenStartCharPositionInLine,r,t)}getErrorDisplay(t){if("number"==typeof t){switch(t){case p.Token.EOF:return"<EOF>";case 10:return"\\n";case 9:return"\\t";case 13:return"\\r"}return String.fromCharCode(t)}return t.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")}getCharErrorDisplay(t){return"'"+this.getErrorDisplay(t)+"'"}recover(t){t instanceof u.LexerNoViableAltException?this._input.LA(1)!=a.IntStream.EOF&&this.interpreter.consume(this._input):this._input.consume()}}d.DEFAULT_MODE=0,d.MORE=-2,d.SKIP=-3,d.MIN_CHAR_VALUE=0,d.MAX_CHAR_VALUE=65535,n([c.Override],d.prototype,"nextToken",null),n([c.Override],d.prototype,"tokenFactory",null),n([c.Override],d.prototype,"sourceName",null),n([c.Override],d.prototype,"line",null),n([c.Override],d.prototype,"charPositionInLine",null),e.Lexer=d},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(33),s=r(50),a=r(3),l=r(17),u=r(2),c=r(0),h=r(1);class p{constructor(t){this.readonly=!1,this._intervals=null!=t?t.slice(0):[]}static get COMPLETE_CHAR_SET(){return void 0===p._COMPLETE_CHAR_SET&&(p._COMPLETE_CHAR_SET=p.of(l.Lexer.MIN_CHAR_VALUE,l.Lexer.MAX_CHAR_VALUE),p._COMPLETE_CHAR_SET.setReadonly(!0)),p._COMPLETE_CHAR_SET}static get EMPTY_SET(){return null==p._EMPTY_SET&&(p._EMPTY_SET=new p,p._EMPTY_SET.setReadonly(!0)),p._EMPTY_SET}static of(t,e=t){let r=new p;return r.add(t,e),r}clear(){if(this.readonly)throw"can't alter readonly IntervalSet";this._intervals.length=0}add(t,e=t){this.addRange(a.Interval.of(t,e))}addRange(t){if(this.readonly)throw"can't alter readonly IntervalSet";if(!(t.b<t.a)){for(let e=0;e<this._intervals.length;e++){let r=this._intervals[e];if(t.equals(r))return;if(t.adjacent(r)||!t.disjoint(r)){let n=t.union(r);for(this._intervals[e]=n;e<this._intervals.length-1;){e++;let t=this._intervals[e];if(!n.adjacent(t)&&n.disjoint(t))break;this._intervals.splice(e,1),e--,this._intervals[e]=n.union(t)}return}if(t.startsBeforeDisjoint(r))return void this._intervals.splice(e,0,t)}this._intervals.push(t)}}static or(t){let e=new p;for(let r of t)e.addAll(r);return e}addAll(t){if(null==t)return this;if(t instanceof p){let e=t,r=e._intervals.length;for(let t=0;t<r;t++){let r=e._intervals[t];this.add(r.a,r.b)}}else for(let e of t.toList())this.add(e);return this}complementRange(t,e){return this.complement(p.of(t,e))}complement(t){if(t.isNil)return p.EMPTY_SET;let e;return t instanceof p?e=t:(e=new p).addAll(t),e.subtract(this)}subtract(t){if(null==t||t.isNil)return new p(this._intervals);if(t instanceof p)return p.subtract(this,t);let e=new p;return e.addAll(t),p.subtract(this,e)}static subtract(t,e){if(t.isNil)return new p;let r=new p(t._intervals);if(e.isNil)return r;let n=0,i=0;for(;n<r._intervals.length&&i<e._intervals.length;){let t,o,s=r._intervals[n],l=e._intervals[i];if(l.b<s.a)i++;else if(l.a>s.b)n++;else if(l.a>s.a&&(t=new a.Interval(s.a,l.a-1)),l.b<s.b&&(o=new a.Interval(l.b+1,s.b)),t){if(o){r._intervals[n]=t,r._intervals.splice(n+1,0,o),n++,i++;continue}r._intervals[n]=t,n++}else o?(r._intervals[n]=o,i++):r._intervals.splice(n,1)}return r}or(t){let e=new p;return e.addAll(this),e.addAll(t),e}and(t){if(t.isNil)return new p;let e,r=this._intervals,n=t._intervals,i=r.length,o=n.length,s=0,a=0;for(;s<i&&a<o;){let t=r[s],i=n[a];t.startsBeforeDisjoint(i)?s++:i.startsBeforeDisjoint(t)?a++:t.properlyContains(i)?(e||(e=new p),e.addRange(t.intersection(i)),a++):i.properlyContains(t)?(e||(e=new p),e.addRange(t.intersection(i)),s++):t.disjoint(i)||(e||(e=new p),e.addRange(t.intersection(i)),t.startsAfterNonDisjoint(i)?a++:i.startsAfterNonDisjoint(t)&&s++)}return e||new p}contains(t){let e=this._intervals.length;for(let r=0;r<e;r++){let e=this._intervals[r],n=e.a,i=e.b;if(t<n)break;if(t>=n&&t<=i)return!0}return!1}get isNil(){return null==this._intervals||0===this._intervals.length}getSingleElement(){if(null!=this._intervals&&1===this._intervals.length){let t=this._intervals[0];if(t.a===t.b)return t.a}return h.Token.INVALID_TYPE}get maxElement(){return this.isNil?h.Token.INVALID_TYPE:this._intervals[this._intervals.length-1].b}get minElement(){return this.isNil?h.Token.INVALID_TYPE:this._intervals[0].a}get intervals(){return this._intervals}hashCode(){let t=u.MurmurHash.initialize();for(let e of this._intervals)t=u.MurmurHash.update(t,e.a),t=u.MurmurHash.update(t,e.b);return u.MurmurHash.finish(t,2*this._intervals.length)}equals(t){return null!=t&&t instanceof p&&o.ArrayEqualityComparator.INSTANCE.equals(this._intervals,t._intervals)}toString(t=!1){let e="";if(null==this._intervals||0===this._intervals.length)return"{}";this.size>1&&(e+="{");let r=!0;for(let n of this._intervals){r?r=!1:e+=", ";let i=n.a,o=n.b;i===o?i==h.Token.EOF?e+="<EOF>":e+=t?"'"+String.fromCharCode(i)+"'":i:e+=t?"'"+String.fromCharCode(i)+"'..'"+String.fromCharCode(o)+"'":i+".."+o}return this.size>1&&(e+="}"),e}toStringVocabulary(t){if(null==this._intervals||0===this._intervals.length)return"{}";let e="";this.size>1&&(e+="{");let r=!0;for(let n of this._intervals){r?r=!1:e+=", ";let i=n.a,o=n.b;if(i===o)e+=this.elementName(t,i);else for(let r=i;r<=o;r++)r>i&&(e+=", "),e+=this.elementName(t,r)}return this.size>1&&(e+="}"),e}elementName(t,e){return e===h.Token.EOF?"<EOF>":e===h.Token.EPSILON?"<EPSILON>":t.getDisplayName(e)}get size(){let t=0,e=this._intervals.length;if(1==e){let t=this._intervals[0];return t.b-t.a+1}for(let r=0;r<e;r++){let e=this._intervals[r];t+=e.b-e.a+1}return t}toIntegerList(){let t=new s.IntegerList(this.size),e=this._intervals.length;for(let r=0;r<e;r++){let e=this._intervals[r],n=e.a,i=e.b;for(let e=n;e<=i;e++)t.add(e)}return t}toList(){let t=new Array,e=this._intervals.length;for(let r=0;r<e;r++){let e=this._intervals[r],n=e.a,i=e.b;for(let e=n;e<=i;e++)t.push(e)}return t}toSet(){let t=new Set;for(let e of this._intervals){let r=e.a,n=e.b;for(let e=r;e<=n;e++)t.add(e)}return t}toArray(){return this.toList()}remove(t){if(this.readonly)throw"can't alter readonly IntervalSet";let e=this._intervals.length;for(let r=0;r<e;r++){let e=this._intervals[r],n=e.a,i=e.b;if(t<n)break;if(t===n&&t===i){this._intervals.splice(r,1);break}if(t===n){this._intervals[r]=a.Interval.of(e.a+1,e.b);break}if(t===i){this._intervals[r]=a.Interval.of(e.a,e.b-1);break}if(t>n&&t<i){let n=e.b;this._intervals[r]=a.Interval.of(e.a,t-1),this.add(t+1,n)}}}get isReadonly(){return this.readonly}setReadonly(t){if(this.readonly&&!t)throw"can't alter readonly IntervalSet";this.readonly=t}}n([c.Override],p.prototype,"addAll",null),n([c.Override],p.prototype,"complement",null),n([c.Override],p.prototype,"subtract",null),n([c.Override],p.prototype,"or",null),n([c.Override],p.prototype,"and",null),n([c.Override],p.prototype,"contains",null),n([c.Override],p.prototype,"isNil",null),n([c.Override],p.prototype,"getSingleElement",null),n([c.Override],p.prototype,"hashCode",null),n([c.Override],p.prototype,"equals",null),n([i(0,c.NotNull)],p.prototype,"toStringVocabulary",null),n([c.NotNull,i(0,c.NotNull)],p.prototype,"elementName",null),n([c.Override],p.prototype,"size",null),n([c.Override],p.prototype,"toList",null),n([c.Override],p.prototype,"remove",null),n([c.NotNull],p,"of",null),n([c.NotNull],p,"subtract",null),e.IntervalSet=p},function(t,e,r){"use strict";e.RecognitionException=class extends Error{constructor(t,e,r,n){super(n),this._offendingState=-1,this._recognizer=t,this.input=e,this.ctx=r,t&&(this._offendingState=t.state)}get offendingState(){return this._offendingState}setOffendingState(t){this._offendingState=t}get expectedTokens(){if(this._recognizer)return this._recognizer.atn.getExpectedTokens(this._offendingState,this.ctx)}get context(){return this.ctx}get inputStream(){return this.input}getOffendingToken(t){if(!t||t===this._recognizer)return this.offendingToken}setOffendingToken(t,e){t===this._recognizer&&(this.offendingToken=e)}get recognizer(){return this._recognizer}}},function(t,e,r){"use strict";const n=r(13),i=r(12),o=r(71);class s{constructor(t){this.keyComparator=t}hashCode(t){return this.keyComparator.hashCode(t.key)}equals(t,e){return this.keyComparator.equals(t.key,e.key)}}class a{constructor(t){this.backingStore=t instanceof a?new n.Array2DHashSet(t.backingStore):new n.Array2DHashSet(new s(t))}clear(){this.backingStore.clear()}containsKey(t){return this.backingStore.contains({key:t})}containsValue(t){return this.values().contains(t)}entrySet(){return new l(this,this.backingStore)}get(t){let e=this.backingStore.get({key:t});if(e)return e.value}get isEmpty(){return this.backingStore.isEmpty}keySet(){return new u(this,this.backingStore)}put(t,e){let r,n=this.backingStore.get({key:t,value:e});return n?(r=n.value,n.value=e):this.backingStore.add({key:t,value:e}),r}putIfAbsent(t,e){let r,n=this.backingStore.get({key:t,value:e});return n?r=n.value:this.backingStore.add({key:t,value:e}),r}putAll(t){for(let e of i.asIterable(t.entrySet()))this.put(e.getKey(),e.getValue())}remove(t){let e=this.get(t);return this.backingStore.remove({key:t}),e}get size(){return this.backingStore.size}values(){return new c(this,this.backingStore)}hashCode(){return this.backingStore.hashCode()}equals(t){return t instanceof a&&this.backingStore.equals(t.backingStore)}}e.Array2DHashMap=a;class l{constructor(t,e){this.map=t,this.backingStore=e}add(t){throw new Error("Not implemented")}addAll(t){throw new Error("Not implemented")}clear(){this.map.clear()}contains(t){throw new Error("Not implemented")}containsAll(t){for(let e of i.asIterable(t))if(!this.contains(e))return!1;return!0}equals(t){return t===this||t instanceof l&&this.backingStore.equals(t.backingStore)}hashCode(){return this.backingStore.hashCode()}get isEmpty(){return this.backingStore.isEmpty}iterator(){throw new Error("Not implemented")}remove(t){throw new Error("Not implemented")}removeAll(t){let e=!1;for(let r of i.asIterable(t))e=this.remove(r)||e;return e}retainAll(t){throw new Error("Not implemented")}get size(){return this.backingStore.size}toArray(t){throw new Error("Not implemented")}}class u{constructor(t,e){this.map=t,this.backingStore=e}add(t){throw new Error("Not supported")}addAll(t){throw new Error("Not supported")}clear(){this.map.clear()}contains(t){return this.backingStore.contains({key:t})}containsAll(t){for(let e of i.asIterable(t))if(!this.contains(e))return!1;return!0}equals(t){return t===this||t instanceof u&&this.backingStore.equals(t.backingStore)}hashCode(){return this.backingStore.hashCode()}get isEmpty(){return this.backingStore.isEmpty}iterator(){throw new Error("Not implemented")}remove(t){return this.backingStore.remove({key:t})}removeAll(t){let e=!1;for(let r of i.asIterable(t))e=this.remove(r)||e;return e}retainAll(t){throw new Error("Not implemented")}get size(){return this.backingStore.size}toArray(t){throw new Error("Not implemented")}}class c{constructor(t,e){this.map=t,this.backingStore=e}add(t){throw new Error("Not supported")}addAll(t){throw new Error("Not supported")}clear(){this.map.clear()}contains(t){for(let e of i.asIterable(this.backingStore))if(o.DefaultEqualityComparator.INSTANCE.equals(t,e.value))return!0;return!1}containsAll(t){for(let e of i.asIterable(t))if(!this.contains(e))return!1;return!0}equals(t){return t===this||t instanceof c&&this.backingStore.equals(t.backingStore)}hashCode(){return this.backingStore.hashCode()}get isEmpty(){return this.backingStore.isEmpty}iterator(){let t=this.backingStore.iterator();return{hasNext:()=>t.hasNext(),next:()=>t.next().value,remove(){throw new Error("Not supported")}}}remove(t){throw new Error("Not implemented")}removeAll(t){let e=!1;for(let r of i.asIterable(t))e=this.remove(r)||e;return e}retainAll(t){throw new Error("Not implemented")}get size(){return this.backingStore.size}toArray(t){(void 0===t||t.length<this.backingStore.size)&&(t=new Array(this.backingStore.size));let e=0;for(let r of i.asIterable(this.backingStore))t[e++]=r.value;return t}}},function(t,e,r){"use strict";!function(t){t.EOF=-1,t.UNKNOWN_SOURCE_NAME="<unknown>"}(e.IntStream||(e.IntStream={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(8),s=r(63),a=r(37),l=r(52),u=r(70),c=r(17),h=r(0),p=r(56),d=r(24),f=r(1);class g{constructor(t,e){this.ruleNames=t,this.tokenStream=e}enterEveryRule(t){console.log("enter "+this.ruleNames[t.ruleIndex]+", LT(1)="+this.tokenStream.LT(1).text)}exitEveryRule(t){console.log("exit "+this.ruleNames[t.ruleIndex]+", LT(1)="+this.tokenStream.LT(1).text)}visitErrorNode(t){}visitTerminal(t){let e=t.parent.ruleContext,r=t.symbol;console.log("consume "+r+" rule "+this.ruleNames[e.ruleIndex])}}n([h.Override],g.prototype,"enterEveryRule",null),n([h.Override],g.prototype,"exitEveryRule",null),n([h.Override],g.prototype,"visitErrorNode",null),n([h.Override],g.prototype,"visitTerminal",null);class y extends d.Recognizer{constructor(t){super(),this._errHandler=new l.DefaultErrorStrategy,this._precedenceStack=new u.IntegerStack,this._buildParseTrees=!0,this._parseListeners=[],this._syntaxErrors=0,this.matchedEOF=!1,this._precedenceStack.push(0),this.inputStream=t}reset(t){void 0!==t&&!0!==t||this.inputStream.seek(0),this._errHandler.reset(this),this._ctx=void 0,this._syntaxErrors=0,this.matchedEOF=!1,this.isTrace=!1,this._precedenceStack.clear(),this._precedenceStack.push(0);let e=this.interpreter;null!=e&&e.reset()}match(t){let e=this.currentToken;return e.type===t?(t===f.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this._buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e}matchWildcard(){let t=this.currentToken;return t.type>0?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this._buildParseTrees&&-1==t.tokenIndex&&this._ctx.addErrorNode(t)),t}set buildParseTree(t){this._buildParseTrees=t}get buildParseTree(){return this._buildParseTrees}getParseListeners(){return this._parseListeners}addParseListener(t){if(null==t)throw new TypeError("listener cannot be null");this._parseListeners.push(t)}removeParseListener(t){let e=this._parseListeners.findIndex(e=>e===t);-1!=e&&this._parseListeners.splice(e,1)}removeParseListeners(){this._parseListeners.length=0}triggerEnterRuleEvent(){for(let t of this._parseListeners)t.enterEveryRule&&t.enterEveryRule(this._ctx),this._ctx.enterRule(t)}triggerExitRuleEvent(){for(let t=this._parseListeners.length-1;t>=0;t--){let e=this._parseListeners[t];this._ctx.exitRule(e),e.exitEveryRule&&e.exitEveryRule(this._ctx)}}get numberOfSyntaxErrors(){return this._syntaxErrors}get tokenFactory(){return this._input.tokenSource.tokenFactory}getATNWithBypassAlts(){let t=this.serializedATN;if(null==t)throw new Error("The current parser does not support an ATN with bypass alternatives.");let e=y.bypassAltsAtnCache.get(t);if(null==e){let r=new s.ATNDeserializationOptions;r.isGenerateRuleBypassTransitions=!0,e=new a.ATNDeserializer(r).deserialize(o.toCharArray(t)),y.bypassAltsAtnCache.set(t,e)}return e}compileParseTreePattern(t,e,r){if(!r){if(this.inputStream){let t=this.inputStream.tokenSource;t instanceof c.Lexer&&(r=t)}if(!r)throw new Error("Parser can't discover a lexer to use")}throw new Error("Not implemented")}get errorHandler(){return this._errHandler}set errorHandler(t){this._errHandler=t}get inputStream(){return this._input}set inputStream(t){this.reset(!1),this._input=t}get currentToken(){return this._input.LT(1)}notifyErrorListeners(t,e,r){void 0===e?e=this.currentToken:null===e&&(e=void 0),this._syntaxErrors++;let n=-1,i=-1;null!=e&&(n=e.line,i=e.charPositionInLine),this.getErrorListenerDispatch().syntaxError(this,e,n,i,t,r)}consume(){let t=this.currentToken;t.type!=y.EOF&&this.inputStream.consume();let e=0!==this._parseListeners.length;if(this._buildParseTrees||e)if(this._errHandler.inErrorRecoveryMode(this)){let r=this._ctx.addErrorNode(t);if(e)for(let t of this._parseListeners)t.visitErrorNode&&t.visitErrorNode(r)}else{let r=this._ctx.addChild(t);if(e)for(let t of this._parseListeners)t.visitTerminal&&t.visitTerminal(r)}return t}addContextToParseTree(){let t=this._ctx._parent;null!=t&&t.addChild(this._ctx)}enterRule(t,e,r){this.state=e,this._ctx=t,this._ctx._start=this._input.LT(1),this._buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}enterLeftFactoredRule(t,e,r){if(this.state=e,this._buildParseTrees){let e=this._ctx.getChild(this._ctx.childCount-1);this._ctx.removeLastChild(),e._parent=t,t.addChild(e)}this._ctx=t,this._ctx._start=this._input.LT(1),this._buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this.matchedEOF?this._ctx._stop=this._input.LT(1):this._ctx._stop=this._input.tryLT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx._parent}enterOuterAlt(t,e){if(t.altNumber=e,this._buildParseTrees&&this._ctx!==t){let e=this._ctx._parent;null!=e&&(e.removeLastChild(),e.addChild(t))}this._ctx=t}get precedence(){return this._precedenceStack.isEmpty?-1:this._precedenceStack.peek()}enterRecursionRule(t,e,r,n){this.state=e,this._precedenceStack.push(n),this._ctx=t,this._ctx._start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(t,e,r){let n=this._ctx;n._parent=t,n.invokingState=e,n._stop=this._input.tryLT(-1),this._ctx=t,this._ctx._start=n._start,this._buildParseTrees&&this._ctx.addChild(n),this.triggerEnterRuleEvent()}unrollRecursionContexts(t){this._precedenceStack.pop(),this._ctx._stop=this._input.tryLT(-1);let e=this._ctx;if(this._parseListeners.length>0)for(;this._ctx!==t;)this.triggerExitRuleEvent(),this._ctx=this._ctx._parent;else this._ctx=t;e._parent=t,this._buildParseTrees&&null!=t&&t.addChild(e)}getInvokingContext(t){let e=this._ctx;for(;e&&e.ruleIndex!==t;)e=e._parent;return e}get context(){return this._ctx}set context(t){this._ctx=t}precpred(t,e){return e>=this._precedenceStack.peek()}getErrorListenerDispatch(){return new p.ProxyParserErrorListener(this.getErrorListeners())}inContext(t){return!1}isExpectedToken(t){let e=this.interpreter.atn,r=this._ctx,n=e.states[this.state],i=e.nextTokens(n);if(i.contains(t))return!0;if(!i.contains(f.Token.EPSILON))return!1;for(;null!=r&&r.invokingState>=0&&i.contains(f.Token.EPSILON);){let n=e.states[r.invokingState].transition(0);if((i=e.nextTokens(n.followState)).contains(t))return!0;r=r._parent}return!(!i.contains(f.Token.EPSILON)||t!=f.Token.EOF)}get isMatchedEOF(){return this.matchedEOF}getExpectedTokens(){return this.atn.getExpectedTokens(this.state,this.context)}getExpectedTokensWithinCurrentRule(){let t=this.interpreter.atn,e=t.states[this.state];return t.nextTokens(e)}getRuleIndex(t){let e=this.getRuleIndexMap().get(t);return null!=e?e:-1}get ruleContext(){return this._ctx}getRuleInvocationStack(t=this._ctx){let e=this.ruleNames,r=[];for(;null!=t;){let n=t.ruleIndex;n<0?r.push("n/a"):r.push(e[n]),t=t._parent}return r}getDFAStrings(){let t=[];for(let e=0;e<this._interp.atn.decisionToDFA.length;e++){let r=this._interp.atn.decisionToDFA[e];t.push(r.toString(this.vocabulary,this.ruleNames))}return t}dumpDFA(){let t=!1;for(let e=0;e<this._interp.atn.decisionToDFA.length;e++){let r=this._interp.atn.decisionToDFA[e];r.isEmpty||(t&&console.log(),console.log("Decision "+r.decision+":"),process.stdout.write(r.toString(this.vocabulary,this.ruleNames)),t=!0)}}get sourceName(){return this._input.sourceName}get parseInfo(){throw new Error("Not implemented")}setProfile(t){throw new Error("Not implemented")}set isTrace(t){t?(this._tracer?this.removeParseListener(this._tracer):this._tracer=new g(this.ruleNames,this._input),this.addParseListener(this._tracer)):this._tracer&&(this.removeParseListener(this._tracer),this._tracer=void 0)}get isTrace(){return null!=this._tracer}}y.bypassAltsAtnCache=new WeakMap,n([h.NotNull],y.prototype,"_errHandler",void 0),n([h.NotNull],y.prototype,"match",null),n([h.NotNull],y.prototype,"matchWildcard",null),n([h.NotNull],y.prototype,"getParseListeners",null),n([i(0,h.NotNull)],y.prototype,"addParseListener",null),n([h.NotNull],y.prototype,"getATNWithBypassAlts",null),n([h.NotNull,i(0,h.NotNull)],y.prototype,"errorHandler",null),n([h.Override],y.prototype,"inputStream",null),n([h.NotNull],y.prototype,"currentToken",null),n([i(0,h.NotNull)],y.prototype,"enterRule",null),n([h.Override,i(0,h.Nullable)],y.prototype,"precpred",null),n([h.Override],y.prototype,"getErrorListenerDispatch",null),n([h.NotNull],y.prototype,"getExpectedTokens",null),n([h.NotNull],y.prototype,"getExpectedTokensWithinCurrentRule",null),n([h.Override],y.prototype,"parseInfo",null),e.Parser=y},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(11),o=r(0);class s extends i.ATNState{get nonStopStateNumber(){return-1}get stateType(){return 7}}n([o.Override],s.prototype,"nonStopStateNumber",null),n([o.Override],s.prototype,"stateType",null),e.RuleStopState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(67),s=r(43),a=r(0),l=r(1),u=r(8);class c{constructor(){this._listeners=[o.ConsoleErrorListener.INSTANCE],this._stateNumber=-1}getTokenTypeMap(){let t=this.vocabulary,e=c.tokenTypeMapCache.get(t);if(null==e){let r=new Map;for(let e=0;e<=this.atn.maxTokenType;e++){let n=t.getLiteralName(e);null!=n&&r.set(n,e);let i=t.getSymbolicName(e);null!=i&&r.set(i,e)}r.set("EOF",l.Token.EOF),e=Object.freeze(r),c.tokenTypeMapCache.set(t,e)}return e}getRuleIndexMap(){let t=this.ruleNames;if(null==t)throw new Error("The current recognizer does not provide a list of rule names.");let e=c.ruleIndexMapCache.get(t);return null==e&&(e=Object.freeze(u.toMap(t)),c.ruleIndexMapCache.set(t,e)),e}getTokenType(t){let e=this.getTokenTypeMap().get(t);return null!=e?e:l.Token.INVALID_TYPE}get serializedATN(){throw new Error("there is no serialized ATN")}get atn(){return this._interp.atn}get interpreter(){return this._interp}get parseInfo(){}set interpreter(t){this._interp=t}getErrorHeader(t){let e=t.getOffendingToken();return e?"line "+e.line+":"+e.charPositionInLine:""}addErrorListener(t){if(!t)throw new TypeError("listener must not be null");this._listeners.push(t)}removeErrorListener(t){let e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}removeErrorListeners(){this._listeners.length=0}getErrorListeners(){return this._listeners.slice(0)}getErrorListenerDispatch(){return new s.ProxyErrorListener(this.getErrorListeners())}sempred(t,e,r){return!0}precpred(t,e){return!0}action(t,e,r){}get state(){return this._stateNumber}set state(t){this._stateNumber=t}}c.EOF=-1,c.tokenTypeMapCache=new WeakMap,c.ruleIndexMapCache=new WeakMap,n([a.SuppressWarnings("serial"),a.NotNull],c.prototype,"_listeners",void 0),n([a.NotNull],c.prototype,"getTokenTypeMap",null),n([a.NotNull],c.prototype,"getRuleIndexMap",null),n([a.NotNull],c.prototype,"serializedATN",null),n([a.NotNull],c.prototype,"atn",null),n([a.NotNull,i(0,a.NotNull)],c.prototype,"interpreter",null),n([a.NotNull,i(0,a.NotNull)],c.prototype,"getErrorHeader",null),n([i(0,a.NotNull)],c.prototype,"addErrorListener",null),n([i(0,a.NotNull)],c.prototype,"removeErrorListener",null),n([a.NotNull],c.prototype,"getErrorListeners",null),e.Recognizer=c},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(20),o=r(13),s=r(33),a=r(7),l=r(30),u=r(10),c=r(12),h=r(0),p=r(6),d=r(4),f=r(45),g=r(26),y=r(5),_=r(8);class m{hashCode(t){return t.state^t.alt}equals(t,e){return t.state===e.state&&t.alt===e.alt}}function x(t){return t?new i.Array2DHashMap(t):new i.Array2DHashMap(m.INSTANCE)}m.INSTANCE=new m;class N{constructor(t,e){this._uniqueAlt=0,this._hasSemanticContext=!1,this._dipsIntoOuterContext=!1,this.outermostConfigSet=!1,this.cachedHashCode=-1,t?(e?(this.mergedConfigs=void 0,this.unmerged=void 0):t.isReadOnly?(this.mergedConfigs=x(),this.unmerged=[]):(this.mergedConfigs=x(t.mergedConfigs),this.unmerged=t.unmerged.slice(0)),this.configs=t.configs.slice(0),this._dipsIntoOuterContext=t._dipsIntoOuterContext,this._hasSemanticContext=t._hasSemanticContext,this.outermostConfigSet=t.outermostConfigSet,!e&&t.isReadOnly||(this._uniqueAlt=t._uniqueAlt,this._conflictInfo=t._conflictInfo)):(this.mergedConfigs=x(),this.unmerged=[],this.configs=[],this._uniqueAlt=a.ATN.INVALID_ALT_NUMBER)}getRepresentedAlternatives(){if(null!=this._conflictInfo)return this._conflictInfo.conflictedAlts.clone();let t=new u.BitSet;for(let e of c.asIterable(this))t.set(e.alt);return t}get isReadOnly(){return null==this.mergedConfigs}get isOutermostConfigSet(){return this.outermostConfigSet}set isOutermostConfigSet(t){if(this.outermostConfigSet&&!t)throw new Error("IllegalStateException");y(!t||!this._dipsIntoOuterContext),this.outermostConfigSet=t}getStates(){let t=new o.Array2DHashSet(p.ObjectEqualityComparator.INSTANCE);for(let e of this.configs)t.add(e.state);return t}optimizeConfigs(t){if(0!==this.configs.length)for(let e=0;e<this.configs.length;e++){let r=this.configs[e];r.context=t.atn.getCachedContext(r.context)}}clone(t){let e=new N(this,t);return!t&&this.isReadOnly&&e.addAll(this.configs),e}get size(){return this.configs.length}get isEmpty(){return 0===this.configs.length}contains(t){if(!(t instanceof l.ATNConfig))return!1;if(this.mergedConfigs&&this.unmerged){let e=t,r=this.getKey(e),n=this.mergedConfigs.get(r);if(null!=n&&this.canMerge(e,r,n))return n.contains(e);for(let e of this.unmerged)if(e.contains(t))return!0}else for(let e of this.configs)if(e.contains(t))return!0;return!1}iterator(){return new S(this,this.configs)}toArray(t){if(!t||t.length<this.configs.length)return this.configs;for(let e=0;e<this.configs.length;e++)t[e]=this.configs[e];return t}add(t,e){if(this.ensureWritable(),!this.mergedConfigs||!this.unmerged)throw new Error("Covered by ensureWritable but duplicated here for strict null check limitation");let r;y(!this.outermostConfigSet||!t.reachesIntoOuterContext),null==e&&(e=f.PredictionContextCache.UNCACHED);let n=this.getKey(t),i=this.mergedConfigs.get(n);if(r=null==i,null!=i&&this.canMerge(t,n,i)){i.outerContextDepth=Math.max(i.outerContextDepth,t.outerContextDepth),t.isPrecedenceFilterSuppressed&&(i.isPrecedenceFilterSuppressed=!0);let r=d.PredictionContext.join(i.context,t.context,e);return this.updatePropertiesForMergedConfig(t),i.context!=r&&(i.context=r,!0)}for(let i=0;i<this.unmerged.length;i++){let o=this.unmerged[i];if(this.canMerge(t,n,o)){o.outerContextDepth=Math.max(o.outerContextDepth,t.outerContextDepth),t.isPrecedenceFilterSuppressed&&(o.isPrecedenceFilterSuppressed=!0);let s=d.PredictionContext.join(o.context,t.context,e);return this.updatePropertiesForMergedConfig(t),o.context!=s&&(o.context=s,r&&(this.mergedConfigs.put(n,o),this.unmerged.splice(i,1)),!0)}}return this.configs.push(t),r?this.mergedConfigs.put(n,t):this.unmerged.push(t),this.updatePropertiesForAddedConfig(t),!0}updatePropertiesForMergedConfig(t){this._dipsIntoOuterContext=this._dipsIntoOuterContext||t.reachesIntoOuterContext,y(!this.outermostConfigSet||!this._dipsIntoOuterContext)}updatePropertiesForAddedConfig(t){1===this.configs.length?this._uniqueAlt=t.alt:this._uniqueAlt!==t.alt&&(this._uniqueAlt=a.ATN.INVALID_ALT_NUMBER),this._hasSemanticContext=this._hasSemanticContext||!g.SemanticContext.NONE.equals(t.semanticContext),this._dipsIntoOuterContext=this._dipsIntoOuterContext||t.reachesIntoOuterContext,y(!this.outermostConfigSet||!this._dipsIntoOuterContext)}canMerge(t,e,r){return t.state.stateNumber==r.state.stateNumber&&e.alt===r.alt&&t.semanticContext.equals(r.semanticContext)}getKey(t){return{state:t.state.stateNumber,alt:t.alt}}containsAll(t){for(let e of c.asIterable(t)){if(!(e instanceof l.ATNConfig))return!1;if(!this.contains(e))return!1}return!0}addAll(t,e){this.ensureWritable();let r=!1;for(let n of c.asIterable(t))this.add(n,e)&&(r=!0);return r}retainAll(t){throw this.ensureWritable(),new Error("Not supported yet.")}removeAll(t){throw this.ensureWritable(),new Error("Not supported yet.")}clear(){if(this.ensureWritable(),!this.mergedConfigs||!this.unmerged)throw new Error("Covered by ensureWritable but duplicated here for strict null check limitation");this.mergedConfigs.clear(),this.unmerged.length=0,this.configs.length=0,this._dipsIntoOuterContext=!1,this._hasSemanticContext=!1,this._uniqueAlt=a.ATN.INVALID_ALT_NUMBER,this._conflictInfo=void 0}equals(t){return this===t||t instanceof N&&this.outermostConfigSet==t.outermostConfigSet&&_.equals(this._conflictInfo,t._conflictInfo)&&s.ArrayEqualityComparator.INSTANCE.equals(this.configs,t.configs)}hashCode(){if(this.isReadOnly&&-1!=this.cachedHashCode)return this.cachedHashCode;let t=1;return t=5*(t=5*t^(this.outermostConfigSet?1:0))^s.ArrayEqualityComparator.INSTANCE.hashCode(this.configs),this.isReadOnly&&(this.cachedHashCode=t),t}toString(t){null==t&&(t=!1);let e="",r=this.configs.slice(0);r.sort((t,e)=>t.alt!=e.alt?t.alt-e.alt:t.state.stateNumber!=e.state.stateNumber?t.state.stateNumber-e.state.stateNumber:t.semanticContext.toString().localeCompare(e.semanticContext.toString())),e+="[";for(let n=0;n<r.length;n++)n>0&&(e+=", "),e+=r[n].toString(void 0,!0,t);return e+="]",this._hasSemanticContext&&(e+=",hasSemanticContext="+this._hasSemanticContext),this._uniqueAlt!==a.ATN.INVALID_ALT_NUMBER&&(e+=",uniqueAlt="+this._uniqueAlt),null!=this._conflictInfo&&(e+=",conflictingAlts="+this._conflictInfo.conflictedAlts,this._conflictInfo.isExact||(e+="*")),this._dipsIntoOuterContext&&(e+=",dipsIntoOuterContext"),e.toString()}get uniqueAlt(){return this._uniqueAlt}get hasSemanticContext(){return this._hasSemanticContext}set hasSemanticContext(t){this.ensureWritable(),this._hasSemanticContext=t}get conflictInfo(){return this._conflictInfo}set conflictInfo(t){this.ensureWritable(),this._conflictInfo=t}get conflictingAlts(){if(null!=this._conflictInfo)return this._conflictInfo.conflictedAlts}get isExactConflict(){return null!=this._conflictInfo&&this._conflictInfo.isExact}get dipsIntoOuterContext(){return this._dipsIntoOuterContext}get(t){return this.configs[t]}remove(t){if(this.ensureWritable(),!this.mergedConfigs||!this.unmerged)throw new Error("Covered by ensureWritable but duplicated here for strict null check limitation");if("number"!=typeof t)throw new Error("Not supported yet");let e=t,r=this.configs[e];this.configs.splice(e,1);let n=this.getKey(r);if(this.mergedConfigs.get(n)===r)this.mergedConfigs.remove(n);else for(let t=0;t<this.unmerged.length;t++)if(this.unmerged[t]===r)return void this.unmerged.splice(t,1)}ensureWritable(){if(this.isReadOnly)throw new Error("This ATNConfigSet is read only.")}}n([h.NotNull],N.prototype,"getRepresentedAlternatives",null),n([h.Override],N.prototype,"size",null),n([h.Override],N.prototype,"isEmpty",null),n([h.Override],N.prototype,"contains",null),n([h.Override],N.prototype,"iterator",null),n([h.Override],N.prototype,"toArray",null),n([h.Override],N.prototype,"containsAll",null),n([h.Override],N.prototype,"retainAll",null),n([h.Override],N.prototype,"removeAll",null),n([h.Override],N.prototype,"clear",null),n([h.Override],N.prototype,"equals",null),n([h.Override],N.prototype,"hashCode",null),e.ATNConfigSet=N;class S{constructor(t,e){this.index=-1,this.removed=!1,this.configs=e}hasNext(){return this.index+1<this.configs.length}next(){if(!this.hasNext())throw new Error("NoSuchElementException");return this.index++,this.removed=!1,this.configs[this.index]}remove(){if(this.removed||this.index<0||this.index>=this.configs.length)throw new Error("IllegalStateException");this.set.remove(this.index),this.removed=!0}}n([h.Override],S.prototype,"hasNext",null),n([h.Override],S.prototype,"next",null),n([h.Override],S.prototype,"remove",null)},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(13),s=r(33),a=r(2),l=r(0),u=r(6),c=r(8);class h{static get NONE(){return void 0===h._NONE&&(h._NONE=new h.Predicate),h._NONE}evalPrecedence(t,e){return this}static and(t,e){if(!t||t===h.NONE)return e;if(e===h.NONE)return t;let r=new h.AND(t,e);return 1===r.opnds.length?r.opnds[0]:r}static or(t,e){if(!t)return e;if(t===h.NONE||e===h.NONE)return h.NONE;let r=new h.OR(t,e);return 1===r.opnds.length?r.opnds[0]:r}}e.SemanticContext=h,function(t){function e(e){let r=[];for(let n=0;n<e.length;n++){let i=e[n];i instanceof t.PrecedencePredicate&&(r.push(i),e.splice(n,1),n--)}return r}class r extends t{constructor(t=-1,e=-1,r=!1){super(),this.ruleIndex=t,this.predIndex=e,this.isCtxDependent=r}eval(t,e){let r=this.isCtxDependent?e:void 0;return t.sempred(r,this.ruleIndex,this.predIndex)}hashCode(){let t=a.MurmurHash.initialize();return t=a.MurmurHash.update(t,this.ruleIndex),t=a.MurmurHash.update(t,this.predIndex),t=a.MurmurHash.update(t,this.isCtxDependent?1:0),a.MurmurHash.finish(t,3)}equals(t){return t instanceof r&&(this===t||this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent)}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}n([l.Override],r.prototype,"eval",null),n([l.Override],r.prototype,"hashCode",null),n([l.Override],r.prototype,"equals",null),n([l.Override],r.prototype,"toString",null),t.Predicate=r;class h extends t{constructor(t){super(),this.precedence=t}eval(t,e){return t.precpred(e,this.precedence)}evalPrecedence(e,r){return e.precpred(r,this.precedence)?t.NONE:void 0}compareTo(t){return this.precedence-t.precedence}hashCode(){let t=1;return 31*t+this.precedence}equals(t){return t instanceof h&&(this===t||this.precedence===t.precedence)}toString(){return"{"+this.precedence+">=prec}?"}}n([l.Override],h.prototype,"eval",null),n([l.Override],h.prototype,"evalPrecedence",null),n([l.Override],h.prototype,"compareTo",null),n([l.Override],h.prototype,"hashCode",null),n([l.Override],h.prototype,"equals",null),n([l.Override],h.prototype,"toString",null),t.PrecedencePredicate=h;class p extends t{}t.Operator=p;let d=class r extends p{constructor(t,n){super();let i=new o.Array2DHashSet(u.ObjectEqualityComparator.INSTANCE);t instanceof r?i.addAll(t.opnds):i.add(t),n instanceof r?i.addAll(n.opnds):i.add(n),this.opnds=i.toArray();let s=function(t){let e;for(let r of t)void 0!==e?e.compareTo(r)>0&&(e=r):e=r;return e}(e(this.opnds));s&&this.opnds.push(s)}get operands(){return this.opnds}equals(t){return this===t||t instanceof r&&s.ArrayEqualityComparator.INSTANCE.equals(this.opnds,t.opnds)}hashCode(){return a.MurmurHash.hashCode(this.opnds,40363613)}eval(t,e){for(let r of this.opnds)if(!r.eval(t,e))return!1;return!0}evalPrecedence(e,r){let n=!1,i=[];for(let o of this.opnds){let s=o.evalPrecedence(e,r);if(n=n||s!==o,null==s)return;s!==t.NONE&&i.push(s)}if(!n)return this;if(0===i.length)return t.NONE;let o=i[0];for(let e=1;e<i.length;e++)o=t.and(o,i[e]);return o}toString(){return c.join(this.opnds,"&&")}};n([l.Override],d.prototype,"operands",null),n([l.Override],d.prototype,"equals",null),n([l.Override],d.prototype,"hashCode",null),n([l.Override],d.prototype,"eval",null),n([l.Override],d.prototype,"evalPrecedence",null),n([l.Override],d.prototype,"toString",null),d=n([i(0,l.NotNull),i(1,l.NotNull)],d),t.AND=d;let f=class r extends p{constructor(t,n){super();let i=new o.Array2DHashSet(u.ObjectEqualityComparator.INSTANCE);t instanceof r?i.addAll(t.opnds):i.add(t),n instanceof r?i.addAll(n.opnds):i.add(n),this.opnds=i.toArray();let s=function(t){let e;for(let r of t)void 0!==e?e.compareTo(r)<0&&(e=r):e=r;return e}(e(this.opnds));s&&this.opnds.push(s)}get operands(){return this.opnds}equals(t){return this===t||t instanceof r&&s.ArrayEqualityComparator.INSTANCE.equals(this.opnds,t.opnds)}hashCode(){return a.MurmurHash.hashCode(this.opnds,486279973)}eval(t,e){for(let r of this.opnds)if(r.eval(t,e))return!0;return!1}evalPrecedence(e,r){let n=!1,i=[];for(let o of this.opnds){let s=o.evalPrecedence(e,r);if(n=n||s!==o,s===t.NONE)return t.NONE;s&&i.push(s)}if(!n)return this;if(0===i.length)return;let o=i[0];for(let e=1;e<i.length;e++)o=t.or(o,i[e]);return o}toString(){return c.join(this.opnds,"||")}};n([l.Override],f.prototype,"operands",null),n([l.Override],f.prototype,"equals",null),n([l.Override],f.prototype,"hashCode",null),n([l.Override],f.prototype,"eval",null),n([l.Override],f.prototype,"evalPrecedence",null),n([l.Override],f.prototype,"toString",null),f=n([i(0,l.NotNull),i(1,l.NotNull)],f),t.OR=f}(h=e.SemanticContext||(e.SemanticContext={}))},function(t,e,r){"use strict";const n=r(16);e.BlockStartState=class extends n.DecisionState{}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(22),o=r(19),s=r(0);class a extends o.RecognitionException{constructor(t,e,r,n,o,s){t instanceof i.Parser&&(void 0===e&&(e=t.inputStream),void 0===r&&(r=t.currentToken),void 0===n&&(n=t.currentToken),void 0===s&&(s=t.context)),super(t,e,s),this._deadEndConfigs=o,this._startToken=r,this.setOffendingToken(t,n)}get startToken(){return this._startToken}get deadEndConfigs(){return this._deadEndConfigs}}n([s.NotNull],a.prototype,"_startToken",void 0),e.NoViableAltException=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(7),s=r(10),a=r(46),l=r(2),u=r(0),c=r(4),h=r(5);class p{constructor(t,e){let r;this.stateNumber=-1,r=t instanceof a.DFA?e:t,this.configs=r,this.edges=new Map,this.contextEdges=new Map}get isContextSensitive(){return!!this.contextSymbols}isContextSymbol(t){return!!this.isContextSensitive&&this.contextSymbols.get(t)}setContextSymbol(t){h(this.isContextSensitive),this.contextSymbols.set(t)}setContextSensitive(t){h(!this.configs.isOutermostConfigSet),this.isContextSensitive||this.contextSymbols||(this.contextSymbols=new s.BitSet)}get acceptStateInfo(){return this._acceptStateInfo}set acceptStateInfo(t){this._acceptStateInfo=t}get isAcceptState(){return!!this._acceptStateInfo}get prediction(){return this._acceptStateInfo?this._acceptStateInfo.prediction:o.ATN.INVALID_ALT_NUMBER}get lexerActionExecutor(){if(this._acceptStateInfo)return this._acceptStateInfo.lexerActionExecutor}getTarget(t){return this.edges.get(t)}setTarget(t,e){this.edges.set(t,e)}getEdgeMap(){return this.edges}getContextTarget(t){return t===c.PredictionContext.EMPTY_FULL_STATE_KEY&&(t=-1),this.contextEdges.get(t)}setContextTarget(t,e){if(!this.isContextSensitive)throw new Error("The state is not context sensitive.");t===c.PredictionContext.EMPTY_FULL_STATE_KEY&&(t=-1),this.contextEdges.set(t,e)}getContextEdgeMap(){let t=new Map(this.contextEdges);if(t.has(-1)){if(1===t.size){let e=new Map;return e.set(c.PredictionContext.EMPTY_FULL_STATE_KEY,t.get(-1)),e}{let e=t.get(-1);t.delete(-1),t.set(c.PredictionContext.EMPTY_FULL_STATE_KEY,e)}}return t}hashCode(){let t=l.MurmurHash.initialize(7);return t=l.MurmurHash.update(t,this.configs.hashCode()),l.MurmurHash.finish(t,1)}equals(t){if(this===t)return!0;if(!(t instanceof p))return!1;let e=t;return this.configs.equals(e.configs)}toString(){let t="";return t+=this.stateNumber+":"+this.configs,this.isAcceptState&&(t+="=>",this.predicates?t+=this.predicates:t+=this.prediction),t.toString()}}n([u.NotNull],p.prototype,"configs",void 0),n([u.NotNull],p.prototype,"edges",void 0),n([u.NotNull],p.prototype,"contextEdges",void 0),n([u.Override],p.prototype,"hashCode",null),n([u.Override],p.prototype,"equals",null),n([u.Override],p.prototype,"toString",null),e.DFAState=p,function(t){let e=class{constructor(t,e){this.alt=e,this.pred=t}toString(){return"("+this.pred+", "+this.alt+")"}};n([u.NotNull],e.prototype,"pred",void 0),n([u.Override],e.prototype,"toString",null),e=n([i(0,u.NotNull)],e),t.PredPrediction=e}(p=e.DFAState||(e.DFAState={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(20),s=r(16),a=r(2),l=r(0),u=r(6),c=r(4),h=r(26),p=r(5);let d=class t{constructor(t,e,r){"number"==typeof e?(p((16777215&e)==e),this._state=t,this.altAndOuterContextDepth=e,this._context=r):(this._state=t,this.altAndOuterContextDepth=e.altAndOuterContextDepth,this._context=r)}static create(e,r,n,i=h.SemanticContext.NONE,o){return i!=h.SemanticContext.NONE?null!=o?new y(o,i,e,r,n,!1):new f(i,e,r,n):null!=o?new g(o,e,r,n,!1):new t(e,r,n)}get state(){return this._state}get alt(){return 16777215&this.altAndOuterContextDepth}get context(){return this._context}set context(t){this._context=t}get reachesIntoOuterContext(){return 0!==this.outerContextDepth}get outerContextDepth(){return this.altAndOuterContextDepth>>>24&127}set outerContextDepth(t){p(t>=0),t=Math.min(t,127),this.altAndOuterContextDepth=t<<24|(-2130706433&this.altAndOuterContextDepth)>>>0}get lexerActionExecutor(){}get semanticContext(){return h.SemanticContext.NONE}get hasPassedThroughNonGreedyDecision(){return!1}clone(){return this.transform(this.state,!1)}transform(t,e,r){return null==r?this.transformImpl(t,this._context,this.semanticContext,e,this.lexerActionExecutor):r instanceof c.PredictionContext?this.transformImpl(t,r,this.semanticContext,e,this.lexerActionExecutor):r instanceof h.SemanticContext?this.transformImpl(t,this._context,r,e,this.lexerActionExecutor):this.transformImpl(t,this._context,this.semanticContext,e,r)}transformImpl(e,r,n,i,o){let s=i&&t.checkNonGreedyDecision(this,e);return n!=h.SemanticContext.NONE?null!=o||s?new y(o,n,e,this,r,s):new f(n,e,this,r):null!=o||s?new g(o,e,this,r,s):new t(e,this,r)}static checkNonGreedyDecision(t,e){return t.hasPassedThroughNonGreedyDecision||e instanceof s.DecisionState&&e.nonGreedy}appendContext(t,e){if("number"==typeof t){let r=this.context.appendSingleContext(t,e);return this.transform(this.state,!1,r)}{let r=this.context.appendContext(t,e);return this.transform(this.state,!1,r)}}contains(t){if(this.state.stateNumber!==t.state.stateNumber||this.alt!==t.alt||!this.semanticContext.equals(t.semanticContext))return!1;let e=[],r=[];for(e.push(this.context),r.push(t.context);;){let t=e.pop(),n=r.pop();if(!t||!n)break;if(t===n)return!0;if(t.size<n.size)return!1;if(n.isEmpty)return t.hasEmpty;for(let i=0;i<n.size;i++){let o=t.findReturnState(n.getReturnState(i));if(o<0)return!1;e.push(t.getParent(o)),r.push(n.getParent(i))}}return!1}get isPrecedenceFilterSuppressed(){return 0!=(2147483648&this.altAndOuterContextDepth)}set isPrecedenceFilterSuppressed(t){t?this.altAndOuterContextDepth|=2147483648:this.altAndOuterContextDepth&=2147483647}equals(e){return this===e||e instanceof t&&this.state.stateNumber==e.state.stateNumber&&this.alt==e.alt&&this.reachesIntoOuterContext==e.reachesIntoOuterContext&&this.context.equals(e.context)&&this.semanticContext.equals(e.semanticContext)&&this.isPrecedenceFilterSuppressed==e.isPrecedenceFilterSuppressed&&this.hasPassedThroughNonGreedyDecision==e.hasPassedThroughNonGreedyDecision&&u.ObjectEqualityComparator.INSTANCE.equals(this.lexerActionExecutor,e.lexerActionExecutor)}hashCode(){let t=a.MurmurHash.initialize(7);return t=a.MurmurHash.update(t,this.state.stateNumber),t=a.MurmurHash.update(t,this.alt),t=a.MurmurHash.update(t,this.reachesIntoOuterContext?1:0),t=a.MurmurHash.update(t,this.context),t=a.MurmurHash.update(t,this.semanticContext),t=a.MurmurHash.update(t,this.hasPassedThroughNonGreedyDecision?1:0),t=a.MurmurHash.update(t,this.lexerActionExecutor),a.MurmurHash.finish(t,7)}toDotString(){let t="";t+="digraph G {\n",t+="rankdir=LR;\n";let e=new o.Array2DHashMap(c.PredictionContext.IdentityEqualityComparator.INSTANCE),r=[];function n(t){let n=e.size,i=e.putIfAbsent(t,n);return null!=i?i:(r.push(t),n)}for(r.push(this.context),e.put(this.context,0);;){let e=r.pop();if(!e)break;for(let r=0;r<e.size;r++)t+=" s"+n(e),t+="->",t+="s"+n(e.getParent(r)),t+='[label="'+e.getReturnState(r)+'"];\n'}return(t+="}\n").toString()}toString(t,e,r){null==r&&(r=null!=e),null==e&&(e=!0);let n,i="";n=r?this.context.toStrings(t,this.state.stateNumber):["?"];let o=!0;for(let t of n)o?o=!1:i+=", ",i+="(",i+=this.state,e&&(i+=",",i+=this.alt),this.context&&(i+=",",i+=t),this.semanticContext!==h.SemanticContext.NONE&&(i+=",",i+=this.semanticContext),this.reachesIntoOuterContext&&(i+=",up="+this.outerContextDepth),i+=")";return i.toString()}};n([l.NotNull],d.prototype,"_state",void 0),n([l.NotNull],d.prototype,"_context",void 0),n([l.NotNull],d.prototype,"state",null),n([l.NotNull,i(0,l.NotNull)],d.prototype,"context",null),n([l.NotNull],d.prototype,"semanticContext",null),n([l.Override],d.prototype,"clone",null),n([i(0,l.NotNull),i(2,l.NotNull)],d.prototype,"transformImpl",null),n([l.Override],d.prototype,"equals",null),n([l.Override],d.prototype,"hashCode",null),n([i(0,l.NotNull),i(3,l.NotNull)],d,"create",null),d=n([i(0,l.NotNull),i(2,l.NotNull)],d),e.ATNConfig=d;let f=class extends d{constructor(t,e,r,n){super(e,r,n),this._semanticContext=t}get semanticContext(){return this._semanticContext}};n([l.NotNull],f.prototype,"_semanticContext",void 0),n([l.Override],f.prototype,"semanticContext",null),f=n([i(1,l.NotNull),i(2,l.NotNull)],f);let g=class extends d{constructor(t,e,r,n,i){if("number"==typeof r)super(e,r,n);else if(super(e,r,n),r.semanticContext!==h.SemanticContext.NONE)throw new Error("Not supported");this._lexerActionExecutor=t,this.passedThroughNonGreedyDecision=i}get lexerActionExecutor(){return this._lexerActionExecutor}get hasPassedThroughNonGreedyDecision(){return this.passedThroughNonGreedyDecision}};n([l.Override],g.prototype,"lexerActionExecutor",null),n([l.Override],g.prototype,"hasPassedThroughNonGreedyDecision",null),g=n([i(1,l.NotNull),i(2,l.NotNull)],g);let y=class extends f{constructor(t,e,r,n,i,o){super(e,r,n,i),this._lexerActionExecutor=t,this.passedThroughNonGreedyDecision=o}get lexerActionExecutor(){return this._lexerActionExecutor}get hasPassedThroughNonGreedyDecision(){return this.passedThroughNonGreedyDecision}};n([l.Override],y.prototype,"lexerActionExecutor",null),n([l.Override],y.prototype,"hasPassedThroughNonGreedyDecision",null),y=n([i(1,l.NotNull),i(2,l.NotNull)],y)},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(3),s=r(0),a=r(1);let l=class t{constructor(e,r,n=t.EMPTY_SOURCE,i=a.Token.DEFAULT_CHANNEL,o=0,s=0){this._line=0,this._charPositionInLine=-1,this._channel=a.Token.DEFAULT_CHANNEL,this.index=-1,this._text=r,this._type=e,this.source=n,this._channel=i,this.start=o,this.stop=s,null!=n.source&&(this._line=n.source.line,this._charPositionInLine=n.source.charPositionInLine)}static fromToken(e){let r=new t(e.type,void 0,t.EMPTY_SOURCE,e.channel,e.startIndex,e.stopIndex);return r._line=e.line,r.index=e.tokenIndex,r._charPositionInLine=e.charPositionInLine,e instanceof t?(r._text=e.text,r.source=e.source):(r._text=e.text,r.source={source:e.tokenSource,stream:e.inputStream}),r}get type(){return this._type}set line(t){this._line=t}get text(){if(null!=this._text)return this._text;let t=this.inputStream;if(null==t)return;let e=t.size;return this.start<e&&this.stop<e?t.getText(o.Interval.of(this.start,this.stop)):"<EOF>"}set text(t){this._text=t}get line(){return this._line}get charPositionInLine(){return this._charPositionInLine}set charPositionInLine(t){this._charPositionInLine=t}get channel(){return this._channel}set channel(t){this._channel=t}set type(t){this._type=t}get startIndex(){return this.start}set startIndex(t){this.start=t}get stopIndex(){return this.stop}set stopIndex(t){this.stop=t}get tokenIndex(){return this.index}set tokenIndex(t){this.index=t}get tokenSource(){return this.source.source}get inputStream(){return this.source.stream}toString(t){let e="";this._channel>0&&(e=",channel="+this._channel);let r=this.text;r=null!=r?(r=(r=r.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"):"<no text>";let n=String(this._type);return t&&(n=t.vocabulary.getDisplayName(this._type)),"[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+r+"',<"+n+">"+e+","+this._line+":"+this.charPositionInLine+"]"}};l.EMPTY_SOURCE={source:void 0,stream:void 0},n([s.NotNull],l.prototype,"source",void 0),n([s.Override],l.prototype,"type",null),n([s.Override],l.prototype,"text",null),n([s.Override],l.prototype,"charPositionInLine",null),n([s.Override],l.prototype,"channel",null),n([s.Override],l.prototype,"startIndex",null),n([s.Override],l.prototype,"stopIndex",null),n([s.Override],l.prototype,"tokenIndex",null),n([s.Override],l.prototype,"tokenSource",null),n([s.Override],l.prototype,"inputStream",null),n([s.Override],l.prototype,"toString",null),n([i(0,s.NotNull)],l,"fromToken",null),l=n([i(2,s.NotNull)],l),e.CommonToken=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(19);let s=class extends o.RecognitionException{constructor(t){super(t,t.inputStream,t.context),super.setOffendingToken(t,t.currentToken)}};s=n([i(0,r(0).NotNull)],s),e.InputMismatchException=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=r(2),s=r(6);class a{hashCode(t){return null==t?0:o.MurmurHash.hashCode(t,0)}equals(t,e){if(null==t)return null==e;if(null==e)return!1;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(!s.ObjectEqualityComparator.INSTANCE.equals(t[r],e[r]))return!1;return!0}}a.INSTANCE=new a,n([i.Override],a.prototype,"hashCode",null),n([i.Override],a.prototype,"equals",null),e.ArrayEqualityComparator=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(19),s=r(0),a=r(72);let l=class t extends o.RecognitionException{constructor(e,r,n){super(e,e.inputStream,e.context,t.formatMessage(r,n));let i=e.interpreter.atn.states[e.state].transition(0);i instanceof a.PredicateTransition?(this._ruleIndex=i.ruleIndex,this._predicateIndex=i.predIndex):(this._ruleIndex=0,this._predicateIndex=0),this._predicate=r,super.setOffendingToken(e,e.currentToken)}get ruleIndex(){return this._ruleIndex}get predicateIndex(){return this._predicateIndex}get predicate(){return this._predicate}static formatMessage(t,e){return e||`failed predicate: {${t}}?`}};n([s.NotNull],l,"formatMessage",null),l=n([i(0,s.NotNull)],l),e.FailedPredicateException=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(3),o=r(0),s=r(1);class a{constructor(t){this._symbol=t}getChild(t){throw new RangeError("Terminal Node has no children.")}get symbol(){return this._symbol}get parent(){return this._parent}get payload(){return this._symbol}get sourceInterval(){let t=this._symbol.tokenIndex;return new i.Interval(t,t)}get childCount(){return 0}accept(t){return t.visitTerminal(this)}get text(){return this._symbol.text||""}toStringTree(t){return this.toString()}toString(){return this._symbol.type===s.Token.EOF?"<EOF>":this._symbol.text||""}}n([o.Override],a.prototype,"getChild",null),n([o.Override],a.prototype,"parent",null),n([o.Override],a.prototype,"payload",null),n([o.Override],a.prototype,"sourceInterval",null),n([o.Override],a.prototype,"childCount",null),n([o.Override],a.prototype,"accept",null),n([o.Override],a.prototype,"text",null),n([o.Override],a.prototype,"toStringTree",null),n([o.Override],a.prototype,"toString",null),e.TerminalNode=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(69),s=r(62),a=r(13),l=r(49),u=r(12),c=r(7),h=r(30),p=r(25),d=r(44),f=r(61),g=r(10),y=r(101),_=r(16),m=r(29),x=r(50),N=r(3),S=r(21),T=r(0),v=r(41),E=r(28),O=r(6),A=r(9),C=r(4),b=r(45),R=r(99),I=r(23),L=r(39),k=r(26),w=r(40),P=r(98),D=r(1),M=r(15),F=r(5);let j=class t extends d.ATNSimulator{constructor(t,e){super(t),this.predictionMode=R.PredictionMode.LL,this.force_global_context=!1,this.always_try_local_context=!0,this.enable_global_context_dfa=!1,this.optimize_unique_closure=!0,this.optimize_ll1=!0,this.optimize_tail_calls=!0,this.tail_call_preserves_sll=!0,this.treat_sllk1_conflict_as_ambiguity=!1,this.reportAmbiguities=!1,this.userWantsCtxSensitive=!0,this._parser=e}getPredictionMode(){return this.predictionMode}setPredictionMode(t){this.predictionMode=t}reset(){}adaptivePredict(e,r,n,i){void 0===i&&(i=!1);let o,s=this.atn.decisionToDFA[r];if(F(null!=s),this.optimize_ll1&&!s.isPrecedenceDfa&&!s.isEmpty){let t=e.LA(1);if(t>=0&&t<=65535){let e=(r<<16>>>0)+t,n=this.atn.LL1Table.get(e);if(null!=n)return n}}this.dfa=s,this.force_global_context?i=!0:this.always_try_local_context||(i=i||s.isContextSensitive),this.userWantsCtxSensitive=i||this.predictionMode!==R.PredictionMode.SLL&&null!=n&&!this.atn.decisionToState[r].sll,null==n&&(n=A.ParserRuleContext.emptyContext()),s.isEmpty||(o=this.getStartState(s,e,n,i)),null==o&&(null==n&&(n=A.ParserRuleContext.emptyContext()),t.debug&&console.log("ATN decision "+s.decision+" exec LA(1)=="+this.getLookaheadName(e)+", outerContext="+n.toString(this._parser)),o=this.computeStartState(s,n,i));let a=e.mark(),l=e.index;try{let r=this.execDFA(s,e,l,o);return t.debug&&console.log("DFA after predictATN: "+s.toString(this._parser.vocabulary,this._parser.ruleNames)),r}finally{this.dfa=void 0,e.seek(l),e.release(a)}}getStartState(t,e,r,n){if(!n){if(t.isPrecedenceDfa){let e=t.getPrecedenceStartState(this._parser.precedence,!1);if(null==e)return;return new P.SimulatorState(r,e,!1,r)}if(null==t.s0)return;return new P.SimulatorState(r,t.s0,!1,r)}if(!this.enable_global_context_dfa)return;let i,o=r;for(F(null!=r),i=t.isPrecedenceDfa?t.getPrecedenceStartState(this._parser.precedence,!0):t.s0full;null!=o&&null!=i&&i.isContextSensitive;)o=this.skipTailCalls(o),i=i.getContextTarget(this.getReturnState(o)),o.isEmpty?F(null==i||!i.isContextSensitive):o=o.parent;return null!=i?new P.SimulatorState(r,i,n,o):void 0}execDFA(e,r,n,i){let o=i.outerContext;t.dfa_debug&&console.log("DFA decision "+e.decision+" exec LA(1)=="+this.getLookaheadName(r)+", outerContext="+o.toString(this._parser)),t.dfa_debug&&console.log(e.toString(this._parser.vocabulary,this._parser.ruleNames));let s=i.s0,a=r.LA(1),l=i.remainingOuterContext;for(;;){if(t.dfa_debug&&console.log("DFA state "+s.stateNumber+" LA(1)=="+this.getLookaheadName(r)),i.useContext)for(;s.isContextSymbol(a);){let t;if(null!=l&&(l=this.skipTailCalls(l),t=s.getContextTarget(this.getReturnState(l))),null==t){let t=new P.SimulatorState(i.outerContext,s,i.useContext,l);return this.execATN(e,r,n,t)}F(null!=l),l=l.parent,s=t}if(this.isAcceptState(s,i.useContext)){null!=s.predicates?t.dfa_debug&&console.log("accept "+s):t.dfa_debug&&console.log("accept; predict "+s.prediction+" in state "+s.stateNumber);break}F(!this.isAcceptState(s,i.useContext));let u=this.getExistingTargetState(s,a);if(null==u){let u;if(t.dfa_debug&&a>=0&&console.log("no edge for "+this._parser.vocabulary.getDisplayName(a)),t.dfa_debug){let t=N.Interval.of(n,this._parser.inputStream.index);console.log("ATN exec upon "+this._parser.inputStream.getText(t)+" at DFA state "+s.stateNumber)}let c=new P.SimulatorState(o,s,i.useContext,l);return u=this.execATN(e,r,n,c),t.dfa_debug&&console.log("back from DFA update, alt="+u+", dfa=\n"+e.toString(this._parser.vocabulary,this._parser.ruleNames)),t.dfa_debug&&console.log("DFA decision "+e.decision+" predicts "+u),u}if(u===d.ATNSimulator.ERROR){let t=new P.SimulatorState(o,s,i.useContext,l);return this.handleNoViableAlt(r,n,t)}s=u,this.isAcceptState(s,i.useContext)||a===S.IntStream.EOF||(r.consume(),a=r.LA(1))}if(!i.useContext&&null!=s.configs.conflictInfo&&e.atnStartState instanceof _.DecisionState&&!(!this.userWantsCtxSensitive||!s.configs.dipsIntoOuterContext&&s.configs.isExactConflict||this.treat_sllk1_conflict_as_ambiguity&&r.index===n)){let t;F(!i.useContext);let a=s.predicates;if(null!=a){let e=r.index;if(e!==n&&r.seek(n),1===(t=this.evalSemanticContext(a,o,!0)).cardinality())return t.nextSetBit(0);e!==n&&r.seek(e)}if(this.reportAmbiguities){let a=new P.SimulatorState(o,s,i.useContext,l);this.reportAttemptingFullContext(e,t,a,n,r.index)}return r.seek(n),this.adaptivePredict(r,e.decision,o,!0)}let u=s.predicates;if(null!=u){let t=r.index;n!==t&&r.seek(n);let i=this.evalSemanticContext(u,o,this.reportAmbiguities&&this.predictionMode===R.PredictionMode.LL_EXACT_AMBIG_DETECTION);switch(i.cardinality()){case 0:throw this.noViableAlt(r,o,s.configs,n);case 1:return i.nextSetBit(0);default:return n!==t&&r.seek(t),this.reportAmbiguity(e,s,n,t,s.configs.isExactConflict,i,s.configs),i.nextSetBit(0)}}return t.dfa_debug&&console.log("DFA decision "+e.decision+" predicts "+s.prediction),s.prediction}isAcceptState(t,e){return!!t.isAcceptState&&(null==t.configs.conflictingAlts||!e||this.predictionMode!==R.PredictionMode.LL_EXACT_AMBIG_DETECTION||t.configs.isExactConflict)}execATN(e,r,n,i){t.debug&&console.log("execATN decision "+e.decision+" exec LA(1)=="+this.getLookaheadName(r));let o=i.outerContext,s=i.useContext,a=r.LA(1),l=i,u=new b.PredictionContextCache;for(;;){let i=this.computeReachSet(e,l,a,u);if(null==i)return this.setDFAEdge(l.s0,r.LA(1),d.ATNSimulator.ERROR),this.handleNoViableAlt(r,n,l);let h=i.s0;if(F(h.isAcceptState||h.prediction===c.ATN.INVALID_ALT_NUMBER),F(h.isAcceptState||null==h.configs.conflictInfo),this.isAcceptState(h,s)){let l=h.configs.conflictingAlts,u=null==l?h.prediction:c.ATN.INVALID_ALT_NUMBER;if(u!==c.ATN.INVALID_ALT_NUMBER){if(this.optimize_ll1&&r.index===n&&!e.isPrecedenceDfa&&i.outerContext===i.remainingOuterContext&&e.decision>=0&&!h.configs.hasSemanticContext&&a>=0&&a<=65535){let t=(e.decision<<16>>>0)+a;this.atn.LL1Table.set(t,u)}s&&this.always_try_local_context&&this.reportContextSensitivity(e,u,i,n,r.index)}u=h.prediction;let p=null!=l&&this.userWantsCtxSensitive;if(p&&(p=!s&&(h.configs.dipsIntoOuterContext||!h.configs.isExactConflict)&&(!this.treat_sllk1_conflict_as_ambiguity||r.index!==n)),h.configs.hasSemanticContext){let t=h.predicates;if(null!=t){let e=r.index;switch(e!==n&&r.seek(n),(l=this.evalSemanticContext(t,o,p||this.reportAmbiguities)).cardinality()){case 0:throw this.noViableAlt(r,o,h.configs,n);case 1:return l.nextSetBit(0)}e!==n&&r.seek(e)}}if(p){F(!s),F(this.isAcceptState(h,!1)),t.debug&&console.log("RETRY with outerContext="+o);let a=this.computeStartState(e,o,!0);return this.reportAmbiguities&&this.reportAttemptingFullContext(e,l,i,n,r.index),r.seek(n),this.execATN(e,r,n,a)}return null!=l&&(this.reportAmbiguities&&l.cardinality()>1&&this.reportAmbiguity(e,h,n,r.index,h.configs.isExactConflict,l,h.configs),u=l.nextSetBit(0)),u}l=i,a!==S.IntStream.EOF&&(r.consume(),a=r.LA(1))}}handleNoViableAlt(t,e,r){if(null!=r.s0){let n=new g.BitSet,i=0;for(let t of u.asIterable(r.s0.configs))(t.reachesIntoOuterContext||t.state instanceof I.RuleStopState)&&(n.set(t.alt),i=Math.max(i,t.alt));switch(n.cardinality()){case 0:break;case 1:return n.nextSetBit(0);default:if(!r.s0.configs.hasSemanticContext)return n.nextSetBit(0);let o=new p.ATNConfigSet;for(let t of u.asIterable(r.s0.configs))(t.reachesIntoOuterContext||t.state instanceof I.RuleStopState)&&o.add(t);let s=this.getPredsForAmbigAlts(n,o,i);if(null!=s){let i=this.getPredicatePredictions(n,s);if(null!=i){let n=t.index;try{t.seek(e);let o=this.evalSemanticContext(i,r.outerContext,!1);if(!o.isEmpty)return o.nextSetBit(0)}finally{t.seek(n)}}}return n.nextSetBit(0)}}throw this.noViableAlt(t,r.outerContext,r.s0.configs,e)}computeReachSet(t,e,r,n){let i=e.useContext,o=e.remainingOuterContext,s=e.s0;if(i)for(;s.isContextSymbol(r);){let t;if(null!=o&&(o=this.skipTailCalls(o),t=s.getContextTarget(this.getReturnState(o))),null==t)break;F(null!=o),o=o.parent,s=t}if(F(!this.isAcceptState(s,i)),this.isAcceptState(s,i))return new P.SimulatorState(e.outerContext,s,i,o);let a=s,l=this.getExistingTargetState(a,r);if(null==l){let e=this.computeTargetState(t,a,o,r,i,n);l=e[0],o=e[1]}return l!==d.ATNSimulator.ERROR?(F(!i||!l.configs.dipsIntoOuterContext),new P.SimulatorState(e.outerContext,l,i,o)):void 0}getExistingTargetState(t,e){return t.getTarget(e)}computeTargetState(e,r,n,i,o,s){let a,l,u=r.configs.toArray(),h=new p.ATNConfigSet;do{let e=!o||null!=n;e||(h.isOutermostConfigSet=!0);let r,d=new p.ATNConfigSet;for(let e of u){if(t.debug&&console.log("testing "+this.getTokenName(i)+" at "+e.toString()),e.state instanceof I.RuleStopState){F(e.context.isEmpty),(o&&!e.reachesIntoOuterContext||i===S.IntStream.EOF)&&(null==r&&(r=[]),r.push(e));continue}let n=e.state.numberOfOptimizedTransitions;for(let t=0;t<n;t++){let r=e.state.getOptimizedTransition(t),n=this.getReachableTarget(e,r,i);null!=n&&d.add(e.transform(n,!1),s)}}if(this.optimize_unique_closure&&null==r&&i!==D.Token.EOF&&d.uniqueAlt!==c.ATN.INVALID_ALT_NUMBER){d.isOutermostConfigSet=h.isOutermostConfigSet,h=d;break}let f=!1,g=i===D.Token.EOF;if(this.closure(d,h,f,e,s,g),l=h.dipsIntoOuterContext,i===S.IntStream.EOF&&(h=this.removeAllConfigsNotInRuleStopState(h,s)),!(null==r||o&&R.PredictionMode.hasConfigInRuleStopState(h))){F(r.length>0);for(let t of r)h.add(t,s)}if(o&&l){h.clear(),n=n,n=this.skipTailCalls(n);let t=this.getReturnState(n);if(null==a&&(a=new x.IntegerList),n=n.isEmpty?void 0:n.parent,a.add(t),t!==C.PredictionContext.EMPTY_FULL_STATE_KEY)for(let e=0;e<u.length;e++)u[e]=u[e].appendContext(t,s)}}while(o&&l);return h.isEmpty?(this.setDFAEdge(r,i,d.ATNSimulator.ERROR),[d.ATNSimulator.ERROR,n]):[this.addDFAEdge(e,r,i,a,h,s),n]}removeAllConfigsNotInRuleStopState(t,e){if(R.PredictionMode.allConfigsInRuleStopStates(t))return t;let r=new p.ATNConfigSet;for(let n of u.asIterable(t))n.state instanceof I.RuleStopState&&r.add(n,e);return r}computeStartState(t,e,r){let n=t.isPrecedenceDfa?t.getPrecedenceStartState(this._parser.precedence,r):r?t.s0full:t.s0;if(null!=n){if(!r)return new P.SimulatorState(e,n,r,e);n.setContextSensitive(this.atn)}t.decision;let i=t.atnStartState,o=0,s=e,a=r?C.PredictionContext.EMPTY_FULL:C.PredictionContext.EMPTY_LOCAL,l=new b.PredictionContextCache;if(r){if(!this.enable_global_context_dfa)for(;null!=s;)s.isEmpty?(o=C.PredictionContext.EMPTY_FULL_STATE_KEY,s=void 0):(o=this.getReturnState(s),a=a.appendSingleContext(o,l),s=s.parent);for(;null!=n&&n.isContextSensitive&&null!=s;){let t;if((s=this.skipTailCalls(s)).isEmpty?(t=n.getContextTarget(C.PredictionContext.EMPTY_FULL_STATE_KEY),o=C.PredictionContext.EMPTY_FULL_STATE_KEY,s=void 0):(o=this.getReturnState(s),t=n.getContextTarget(o),a=a.appendSingleContext(o,l),s=s.parent),null==t)break;n=t}}if(null!=n&&!n.isContextSensitive)return new P.SimulatorState(e,n,r,s);let u=new p.ATNConfigSet;for(;;){let c=new p.ATNConfigSet,d=i.numberOfTransitions;for(let t=0;t<d;t++){let e=i.transition(t).target;c.add(h.ATNConfig.create(e,t+1,a))}let f=null!=s;f||(u.isOutermostConfigSet=!0);let g=!0;this.closure(c,u,g,f,l,!1);let y,_=u.dipsIntoOuterContext;if(r&&!this.enable_global_context_dfa){n=this.addDFAState(t,u,l);break}if(null==n?t.isPrecedenceDfa?(u=this.applyPrecedenceFilter(u,e,l),y=this.addDFAState(t,u,l),t.setPrecedenceStartState(this._parser.precedence,r,y)):(y=this.addDFAState(t,u,l),r?t.s0full?y=t.s0full:t.s0full=y:t.s0?y=t.s0:t.s0=y):(t.isPrecedenceDfa&&(u=this.applyPrecedenceFilter(u,e,l)),y=this.addDFAState(t,u,l),n.setContextTarget(o,y)),n=y,!r||!_)break;y.setContextSensitive(this.atn),s=s,u.clear(),s=this.skipTailCalls(s);let m=this.getReturnState(s);s=s.isEmpty?void 0:s.parent,m!==C.PredictionContext.EMPTY_FULL_STATE_KEY&&(a=a.appendSingleContext(m,l)),o=m}return new P.SimulatorState(e,n,r,s)}applyPrecedenceFilter(t,e,r){let n=new Map,i=new p.ATNConfigSet;for(let o of u.asIterable(t)){if(1!==o.alt)continue;let t=o.semanticContext.evalPrecedence(this._parser,e);null!=t&&(n.set(o.state.stateNumber,o.context),t!==o.semanticContext?i.add(o.transform(o.state,!1,t),r):i.add(o,r))}for(let e of u.asIterable(t))if(1!==e.alt){if(!e.isPrecedenceFilterSuppressed){let t=n.get(e.state.stateNumber);if(null!=t&&t.equals(e.context))continue}i.add(e,r)}return i}getReachableTarget(t,e,r){if(e.matches(r,0,this.atn.maxTokenType))return e.target}predicateDFAState(e,r,n){let i=this.getConflictingAltsFromConfigSet(r);if(!i)throw new Error("This unhandled scenario is intended to be unreachable, but I'm currently not sure of why we know that's the case.");t.debug&&console.log("predicateDFAState "+e);let o,s=this.getPredsForAmbigAlts(i,r,n);return null!=s&&(o=this.getPredicatePredictions(i,s),e.predicates=o),o}getPredsForAmbigAlts(e,r,n){let i=new Array(n+1),o=i.length;for(let t of u.asIterable(r))e.get(t.alt)&&(i[t.alt]=k.SemanticContext.or(i[t.alt],t.semanticContext));let s=0;for(let t=0;t<o;t++)null==i[t]?i[t]=k.SemanticContext.NONE:i[t]!==k.SemanticContext.NONE&&s++;let a=i;return 0===s&&(a=void 0),t.debug&&console.log("getPredsForAmbigAlts result "+(a?l.Arrays.toString(a):"undefined")),a}getPredicatePredictions(t,e){let r=[],n=!1;for(let i=1;i<e.length;i++){let o=e[i];F(null!=o),null!=t&&t.get(i)&&o===k.SemanticContext.NONE?r.push(new m.DFAState.PredPrediction(o,i)):o!==k.SemanticContext.NONE&&(n=!0,r.push(new m.DFAState.PredPrediction(o,i)))}if(n)return r}evalSemanticContext(e,r,n){let i=new g.BitSet;for(let o of e){if(o.pred===k.SemanticContext.NONE){if(i.set(o.alt),!n)break;continue}let e=this.evalSemanticContextImpl(o.pred,r,o.alt);if((t.debug||t.dfa_debug)&&console.log("eval pred "+o+"="+e),e&&((t.debug||t.dfa_debug)&&console.log("PREDICT "+o.alt),i.set(o.alt),!n))break}return i}evalSemanticContextImpl(t,e,r){return t.eval(this._parser,e)}closure(t,e,r,n,i,o){null==i&&(i=b.PredictionContextCache.UNCACHED);let s=t,l=new a.Array2DHashSet(O.ObjectEqualityComparator.INSTANCE);for(;s.size>0;){let t=new p.ATNConfigSet;for(let a of u.asIterable(s))this.closureImpl(a,e,t,l,r,n,i,0,o);s=t}}closureImpl(e,r,n,i,o,a,l,u,c){if(t.debug&&console.log("closure("+e.toString(this._parser,!0)+")"),e.state instanceof I.RuleStopState)if(e.context.isEmpty){if(!a)return void r.add(e,l);t.debug&&console.log("FALLING off rule "+this.getRuleName(e.state.ruleIndex)),e.context===C.PredictionContext.EMPTY_FULL?e=e.transform(e.state,!1,C.PredictionContext.EMPTY_LOCAL):!e.reachesIntoOuterContext&&C.PredictionContext.isEmptyLocal(e.context)&&r.add(e,l)}else{let t=e.context.hasEmpty,s=e.context.size-(t?1:0);for(let t=0;t<s;t++){let s=e.context.getParent(t),p=this.atn.states[e.context.getReturnState(t)],d=h.ATNConfig.create(p,e.alt,s,e.semanticContext);d.outerContextDepth=e.outerContextDepth,d.isPrecedenceFilterSuppressed=e.isPrecedenceFilterSuppressed,F(u>-2147483648),this.closureImpl(d,r,n,i,o,a,l,u-1,c)}if(!t||!a)return;e=e.transform(e.state,!1,C.PredictionContext.EMPTY_LOCAL)}let p=e.state;p.onlyHasEpsilonTransitions||(r.add(e,l),t.debug&&console.log("added config "+r));for(let h=0;h<p.numberOfOptimizedTransitions;h++){if(0===h&&10===p.stateType&&p.precedenceRuleDecision&&!e.context.hasEmpty){let t=p,r=!0;for(let n=0;n<e.context.size;n++)if(!t.precedenceLoopbackStates.get(e.context.getReturnState(n))){r=!1;break}if(r)continue}let d=p.getOptimizedTransition(h),f=!(d instanceof s.ActionTransition)&&o,g=this.getEpsilonTarget(e,d,f,0===u,l,c);if(null!=g){if(d instanceof L.RuleTransition&&null!=n&&!o){n.add(g,l);continue}if(!d.isEpsilon&&!i.add(g))continue;let s=u;if(e.state instanceof I.RuleStopState){if(!i.add(g))continue;null!=this.dfa&&this.dfa.isPrecedenceDfa&&d.outermostPrecedenceReturn==this.dfa.atnStartState.ruleIndex&&(g.isPrecedenceFilterSuppressed=!0),g.outerContextDepth=g.outerContextDepth+1,F(s>-2147483648),s--,t.debug&&console.log("dips into outer ctx: "+g)}else d instanceof L.RuleTransition&&(!this.optimize_tail_calls||!d.optimizedTailCall||this.tail_call_preserves_sll&&C.PredictionContext.isEmptyLocal(e.context)?s>=0&&s++:(F(g.context===e.context),0===s&&(s--,!this.tail_call_preserves_sll&&C.PredictionContext.isEmptyLocal(e.context)&&(g.outerContextDepth=g.outerContextDepth+1))));this.closureImpl(g,r,n,i,f,a,l,s,c)}}}getRuleName(t){return null!=this._parser&&t>=0?this._parser.ruleNames[t]:"<rule "+t+">"}getEpsilonTarget(t,e,r,n,i,o){switch(e.serializationType){case 3:return this.ruleTransition(t,e,i);case 10:return this.precedenceTransition(t,e,r,n);case 4:return this.predTransition(t,e,r,n);case 6:return this.actionTransition(t,e);case 1:return t.transform(e.target,!1);case 5:case 2:case 7:return o&&e.matches(D.Token.EOF,0,1)?t.transform(e.target,!1):void 0;default:return}}actionTransition(e,r){return t.debug&&console.log("ACTION edge "+r.ruleIndex+":"+r.actionIndex),e.transform(r.target,!1)}precedenceTransition(e,r,n,i){let o;if(t.debug&&(console.log("PRED (collectPredicates="+n+") "+r.precedence+">=_p, ctx dependent=true"),null!=this._parser&&console.log("context surrounding pred is "+this._parser.getRuleInvocationStack())),n&&i){let t=k.SemanticContext.and(e.semanticContext,r.predicate);o=e.transform(r.target,!1,t)}else o=e.transform(r.target,!1);return t.debug&&console.log("config from pred transition="+o),o}predTransition(e,r,n,i){let o;if(t.debug&&(console.log("PRED (collectPredicates="+n+") "+r.ruleIndex+":"+r.predIndex+", ctx dependent="+r.isCtxDependent),null!=this._parser&&console.log("context surrounding pred is "+this._parser.getRuleInvocationStack())),n&&(!r.isCtxDependent||r.isCtxDependent&&i)){let t=k.SemanticContext.and(e.semanticContext,r.predicate);o=e.transform(r.target,!1,t)}else o=e.transform(r.target,!1);return t.debug&&console.log("config from pred transition="+o),o}ruleTransition(e,r,n){t.debug&&console.log("CALL rule "+this.getRuleName(r.target.ruleIndex)+", ctx="+e.context);let i,o=r.followState;return i=!this.optimize_tail_calls||!r.optimizedTailCall||this.tail_call_preserves_sll&&C.PredictionContext.isEmptyLocal(e.context)?null!=n?n.getChild(e.context,o.stateNumber):e.context.getChild(o.stateNumber):e.context,e.transform(r.target,!1,i)}isConflicted(e,r){if(e.uniqueAlt!==c.ATN.INVALID_ALT_NUMBER||e.size<=1)return;let n=e.toArray();n.sort(t.STATE_ALT_SORT_COMPARATOR);let i=!e.dipsIntoOuterContext,o=new g.BitSet,s=n[0].alt;o.set(s);let a,l=n[0].state.nonStopStateNumber;for(let t of n){let e=t.state.nonStopStateNumber;if(e!==l){if(t.alt!==s)return;l=e}}if(i){l=n[0].state.nonStopStateNumber,a=new g.BitSet;let t=s;for(let e of n){if(e.state.nonStopStateNumber!=l)break;let r=e.alt;a.set(r),t=r}l=n[0].state.nonStopStateNumber;let e=s;for(let r of n){let n=r.state.nonStopStateNumber,o=r.alt;if(n!==l){if(e!==t){i=!1;break}l=n,e=s}else if(o!==e){if(o!==a.nextSetBit(e+1)){i=!1;break}e=o}}}l=n[0].state.nonStopStateNumber;let u=0,h=0,p=n[0].context;for(let t=1;t<n.length;t++){let e=n[t];if(e.alt!==s)break;if(e.state.nonStopStateNumber!==l)break;h=t,p=r.join(p,n[t].context)}for(let t=h+1;t<n.length;t++){let e=n[t],a=e.state;if(o.set(e.alt),a.nonStopStateNumber!==l){l=a.nonStopStateNumber,u=t,h=t,p=e.context;for(let t=u+1;t<n.length;t++){let e=n[t];if(e.alt!==s)break;if(e.state.nonStopStateNumber!==l)break;h=t,p=r.join(p,e.context)}t=h;continue}let c=e.context,d=e.alt,f=t;for(let t=f+1;t<n.length;t++){let e=n[t];if(e.alt!==d)break;if(e.state.nonStopStateNumber!==l)break;f=t,c=r.join(c,e.context)}t=f;let g=r.join(p,c);if(!p.equals(g))return;i=i&&p.equals(c)}return new y.ConflictInfo(o,i)}getConflictingAltsFromConfigSet(t){let e=t.conflictingAlts;return null==e&&t.uniqueAlt!==c.ATN.INVALID_ALT_NUMBER&&(e=new g.BitSet).set(t.uniqueAlt),e}getTokenName(t){if(t===D.Token.EOF)return"EOF";let e=(null!=this._parser?this._parser.vocabulary:M.VocabularyImpl.EMPTY_VOCABULARY).getDisplayName(t);return e===String(t)?e:e+"<"+t+">"}getLookaheadName(t){return this.getTokenName(t.LA(1))}dumpDeadEndConfigs(t){console.log("dead end configs: ");let e=t.deadEndConfigs;if(e)for(let t of u.asIterable(e)){let e="no edges";if(t.state.numberOfOptimizedTransitions>0){let r=t.state.getOptimizedTransition(0);r instanceof f.AtomTransition?e="Atom "+this.getTokenName(r._label):r instanceof w.SetTransition&&(e=(r instanceof v.NotSetTransition?"~":"")+"Set "+r.set.toString())}console.log(t.toString(this._parser,!0)+":"+e)}}noViableAlt(t,e,r,n){return new E.NoViableAltException(this._parser,t,t.get(n),t.LT(1),r,e)}getUniqueAlt(t){let e=c.ATN.INVALID_ALT_NUMBER;for(let r of u.asIterable(t))if(e===c.ATN.INVALID_ALT_NUMBER)e=r.alt;else if(r.alt!==e)return c.ATN.INVALID_ALT_NUMBER;return e}configWithAltAtStopState(t,e){for(let r of u.asIterable(t))if(r.alt===e&&r.state instanceof I.RuleStopState)return!0;return!1}addDFAEdge(e,r,n,i,o,s){F(null==i||i.isEmpty||e.isContextSensitive);let a=r,l=this.addDFAState(e,o,s);if(null!=i)for(let t of i.toArray()){if(t===C.PredictionContext.EMPTY_FULL_STATE_KEY&&a.configs.isOutermostConfigSet)continue;a.setContextSensitive(this.atn),a.setContextSymbol(n);let r=a.getContextTarget(t);null==r?(r=this.addDFAContextState(e,a.configs,t,s),F(t!==C.PredictionContext.EMPTY_FULL_STATE_KEY||r.configs.isOutermostConfigSet),a.setContextTarget(t,r),a=r):a=r}return t.debug&&console.log("EDGE "+a+" -> "+l+" upon "+this.getTokenName(n)),this.setDFAEdge(a,n,l),t.debug&&console.log("DFA=\n"+e.toString(null!=this._parser?this._parser.vocabulary:M.VocabularyImpl.EMPTY_VOCABULARY,null!=this._parser?this._parser.ruleNames:void 0)),l}setDFAEdge(t,e,r){null!=t&&t.setTarget(e,r)}addDFAContextState(t,e,r,n){if(r!==C.PredictionContext.EMPTY_FULL_STATE_KEY){let i=new p.ATNConfigSet;for(let t of u.asIterable(e))i.add(t.appendContext(r,n));return this.addDFAState(t,i,n)}return F(!e.isOutermostConfigSet,"Shouldn't be adding a duplicate edge."),(e=e.clone(!0)).isOutermostConfigSet=!0,this.addDFAState(t,e,n)}addDFAState(e,r,n){let i=this.enable_global_context_dfa||!r.isOutermostConfigSet;if(i){r.isReadOnly||r.optimizeConfigs(this);let t=this.createDFAState(e,r),n=e.states.get(t);if(null!=n)return n}r.isReadOnly||null==r.conflictInfo&&(r.conflictInfo=this.isConflicted(r,n));let s=this.createDFAState(e,r.clone(!0)),a=this.atn.getDecisionState(e.decision),l=this.getUniqueAlt(r);if(l!==c.ATN.INVALID_ALT_NUMBER)s.acceptStateInfo=new o.AcceptStateInfo(l);else if(null!=r.conflictingAlts){let t=r.conflictingAlts;t&&(s.acceptStateInfo=new o.AcceptStateInfo(t.nextSetBit(0)))}if(s.isAcceptState&&r.hasSemanticContext&&this.predicateDFAState(s,r,a.numberOfTransitions),!i)return s;let u=e.addState(s);return t.debug&&u===s&&console.log("adding new DFA state: "+s),u}createDFAState(t,e){return new m.DFAState(t,e)}reportAttemptingFullContext(e,r,n,i,o){if(t.debug||t.retry_debug){let t=N.Interval.of(i,o);console.log("reportAttemptingFullContext decision="+e.decision+":"+n.s0.configs+", input="+this._parser.inputStream.getText(t))}null!=this._parser&&this._parser.getErrorListenerDispatch().reportAttemptingFullContext(this._parser,e,i,o,r,n)}reportContextSensitivity(e,r,n,i,o){if(t.debug||t.retry_debug){let t=N.Interval.of(i,o);console.log("reportContextSensitivity decision="+e.decision+":"+n.s0.configs+", input="+this._parser.inputStream.getText(t))}null!=this._parser&&this._parser.getErrorListenerDispatch().reportContextSensitivity(this._parser,e,i,o,r,n)}reportAmbiguity(e,r,n,i,o,s,a){if(t.debug||t.retry_debug){let t=N.Interval.of(n,i);console.log("reportAmbiguity "+s+":"+a+", input="+this._parser.inputStream.getText(t))}null!=this._parser&&this._parser.getErrorListenerDispatch().reportAmbiguity(this._parser,e,n,i,o,s,a)}getReturnState(t){return t.isEmpty?C.PredictionContext.EMPTY_FULL_STATE_KEY:this.atn.states[t.invokingState].transition(0).followState.stateNumber}skipTailCalls(t){if(!this.optimize_tail_calls)return t;for(;!t.isEmpty;){let e=this.atn.states[t.invokingState];if(F(1===e.numberOfTransitions&&3===e.transition(0).serializationType),!e.transition(0).tailCall)break;t=t.parent}return t}get parser(){return this._parser}};j.debug=!1,j.dfa_debug=!1,j.retry_debug=!1,j.STATE_ALT_SORT_COMPARATOR=((t,e)=>{let r=t.state.nonStopStateNumber-e.state.nonStopStateNumber;return 0!==r?r:0!=(r=t.alt-e.alt)?r:0}),n([T.NotNull],j.prototype,"predictionMode",void 0),n([T.NotNull],j.prototype,"getPredictionMode",null),n([i(0,T.NotNull)],j.prototype,"setPredictionMode",null),n([T.Override],j.prototype,"reset",null),n([i(0,T.NotNull)],j.prototype,"adaptivePredict",null),n([i(0,T.NotNull),i(1,T.NotNull),i(2,T.NotNull)],j.prototype,"getStartState",null),n([i(0,T.NotNull),i(1,T.NotNull),i(3,T.NotNull)],j.prototype,"execDFA",null),n([i(0,T.NotNull),i(1,T.NotNull),i(3,T.NotNull)],j.prototype,"execATN",null),n([i(0,T.NotNull),i(2,T.NotNull)],j.prototype,"handleNoViableAlt",null),n([i(0,T.NotNull)],j.prototype,"getExistingTargetState",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"computeTargetState",null),n([T.NotNull,i(0,T.NotNull)],j.prototype,"removeAllConfigsNotInRuleStopState",null),n([T.NotNull],j.prototype,"computeStartState",null),n([T.NotNull,i(0,T.NotNull)],j.prototype,"applyPrecedenceFilter",null),n([i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"getReachableTarget",null),n([i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"getPredsForAmbigAlts",null),n([i(0,T.NotNull)],j.prototype,"evalSemanticContext",null),n([i(0,T.NotNull)],j.prototype,"evalSemanticContextImpl",null),n([i(1,T.NotNull),i(4,T.Nullable)],j.prototype,"closure",null),n([i(0,T.NotNull),i(1,T.NotNull),i(2,T.Nullable),i(3,T.NotNull),i(6,T.NotNull)],j.prototype,"closureImpl",null),n([T.NotNull],j.prototype,"getRuleName",null),n([i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"getEpsilonTarget",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"actionTransition",null),n([T.Nullable,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"precedenceTransition",null),n([T.Nullable,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"predTransition",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull),i(2,T.Nullable)],j.prototype,"ruleTransition",null),n([i(0,T.NotNull)],j.prototype,"isConflicted",null),n([T.NotNull],j.prototype,"getTokenName",null),n([i(0,T.NotNull)],j.prototype,"dumpDeadEndConfigs",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull),i(2,T.NotNull)],j.prototype,"noViableAlt",null),n([i(0,T.NotNull)],j.prototype,"getUniqueAlt",null),n([i(0,T.NotNull)],j.prototype,"configWithAltAtStopState",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull),i(4,T.NotNull)],j.prototype,"addDFAEdge",null),n([i(0,T.Nullable),i(2,T.Nullable)],j.prototype,"setDFAEdge",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"addDFAContextState",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"addDFAState",null),n([T.NotNull,i(0,T.NotNull),i(1,T.NotNull)],j.prototype,"createDFAState",null),n([i(0,T.NotNull),i(2,T.NotNull)],j.prototype,"reportAttemptingFullContext",null),n([i(0,T.NotNull),i(2,T.NotNull)],j.prototype,"reportContextSensitivity",null),n([i(0,T.NotNull),i(5,T.NotNull),i(6,T.NotNull)],j.prototype,"reportAmbiguity",null),j=n([i(0,T.NotNull)],j),e.ParserATNSimulator=j},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(62),s=r(13),a=r(7),l=r(63),u=r(61),c=r(112),h=r(65),p=r(10),d=r(111),f=r(27),g=r(16),y=r(46),_=r(110),m=r(18),x=r(66),N=r(109),S=r(108),T=r(107),v=r(106),E=r(105),O=r(104),A=r(103),C=r(102),b=r(60),R=r(0),I=r(41),L=r(36),k=r(97),w=r(96),P=r(95),D=r(72),M=r(94),F=r(93),j=r(23),z=r(39),H=r(40),U=r(92),B=r(91),q=r(42),Y=r(1),K=r(90),V=r(89),$=r(64);class W{constructor(t){null==t&&(t=l.ATNDeserializationOptions.defaultOptions),this.deserializationOptions=t}static get SERIALIZED_VERSION(){return 3}isFeatureSupported(t,e){let r=W.SUPPORTED_UUIDS.findIndex(e=>e.equals(t));return!(r<0)&&W.SUPPORTED_UUIDS.findIndex(t=>t.equals(e))>=r}deserialize(t){t=t.slice(0);for(let e=1;e<t.length;e++)t[e]=t[e]-2&65535;let e=0,r=W.toInt(t[e++]);if(r!=W.SERIALIZED_VERSION){let t=`Could not deserialize ATN with version ${r} (expected ${W.SERIALIZED_VERSION}).`;throw new Error(t)}let n=W.toUUID(t,e);if(e+=8,W.SUPPORTED_UUIDS.findIndex(t=>t.equals(n))<0){let t=`Could not deserialize ATN with UUID ${n} (expected ${W.SERIALIZED_UUID} or a legacy UUID).`;throw new Error(t)}let i=this.isFeatureSupported(W.ADDED_LEXER_ACTIONS,n),l=W.toInt(t[e++]),p=W.toInt(t[e++]),g=new a.ATN(l,p),N=[],T=[],v=W.toInt(t[e++]);for(let r=0;r<v;r++){let r=W.toInt(t[e++]);if(0===r){g.addState(new x.InvalidState);continue}let n=W.toInt(t[e++]);65535===n&&(n=-1);let i=this.stateFactory(r,n);if(12===r){let r=W.toInt(t[e++]);N.push([i,r])}else if(i instanceof f.BlockStartState){let r=W.toInt(t[e++]);T.push([i,r])}g.addState(i)}for(let t of N)t[0].loopBackState=g.states[t[1]];for(let t of T)t[0].endState=g.states[t[1]];let E=W.toInt(t[e++]);for(let r=0;r<E;r++){let r=W.toInt(t[e++]);g.states[r].nonGreedy=!0}let O=W.toInt(t[e++]);for(let r=0;r<O;r++){let r=W.toInt(t[e++]);g.states[r].sll=!0}let A=W.toInt(t[e++]);for(let r=0;r<A;r++){let r=W.toInt(t[e++]);g.states[r].isPrecedenceRule=!0}let C=W.toInt(t[e++]);0===g.grammarType&&(g.ruleToTokenType=new Int32Array(C)),g.ruleToStartState=new Array(C);for(let r=0;r<C;r++){let i=W.toInt(t[e++]),o=g.states[i];if(o.leftFactored=0!=W.toInt(t[e++]),g.ruleToStartState[r]=o,0===g.grammarType){let i=W.toInt(t[e++]);if(65535===i&&(i=Y.Token.EOF),g.ruleToTokenType[r]=i,!this.isFeatureSupported(W.ADDED_LEXER_ACTIONS,n)){let r=W.toInt(t[e++]);65535===r&&(r=-1)}}}g.ruleToStopState=new Array(C);for(let t of g.states)t instanceof j.RuleStopState&&(g.ruleToStopState[t.ruleIndex]=t,g.ruleToStartState[t.ruleIndex].stopState=t);let R=W.toInt(t[e++]);for(let r=0;r<R;r++){let r=W.toInt(t[e++]);g.modeToStartState.push(g.states[r])}g.modeToDFA=new Array(R);for(let t=0;t<R;t++)g.modeToDFA[t]=new y.DFA(g.modeToStartState[t]);let I=[],L=W.toInt(t[e++]);for(let r=0;r<L;r++){let r=W.toInt(t[e]);e++;let n=new m.IntervalSet;I.push(n),0!=W.toInt(t[e++])&&n.add(-1);for(let i=0;i<r;i++)n.add(W.toInt(t[e]),W.toInt(t[e+1])),e+=2}let P=W.toInt(t[e++]);for(let r=0;r<P;r++){let r=W.toInt(t[e]),n=W.toInt(t[e+1]),i=W.toInt(t[e+2]),o=W.toInt(t[e+3]),s=W.toInt(t[e+4]),a=W.toInt(t[e+5]),l=this.edgeFactory(g,i,r,n,o,s,a,I);g.states[r].addTransition(l),e+=6}let D=new s.Array2DHashSet({hashCode:t=>t.stopState^t.returnState^t.outermostPrecedenceReturn,equals:function(t,e){return t.stopState===e.stopState&&t.returnState===e.returnState&&t.outermostPrecedenceReturn===e.outermostPrecedenceReturn}}),M=[];for(let t of g.states){let e=t.ruleIndex>=0&&g.ruleToStartState[t.ruleIndex].leftFactored;for(let r=0;r<t.numberOfTransitions;r++){let n=t.transition(r);if(!(n instanceof z.RuleTransition))continue;let i=n;if(!g.ruleToStartState[i.target.ruleIndex].leftFactored&&e)continue;let o=-1;g.ruleToStartState[i.target.ruleIndex].isPrecedenceRule&&0===i.precedence&&(o=i.target.ruleIndex);let s={stopState:i.target.ruleIndex,returnState:i.followState.stateNumber,outermostPrecedenceReturn:o};D.add(s)&&M.push(s)}}for(let t of M){let e=new _.EpsilonTransition(g.states[t.returnState],t.outermostPrecedenceReturn);g.ruleToStopState[t.stopState].addTransition(e)}for(let t of g.states){if(t instanceof f.BlockStartState){if(null==t.endState)throw new Error("IllegalStateException");if(null!=t.endState.startState)throw new Error("IllegalStateException");t.endState.startState=t}if(t instanceof w.PlusLoopbackState){let e=t;for(let t=0;t<e.numberOfTransitions;t++){let r=e.transition(t).target;r instanceof k.PlusBlockStartState&&(r.loopBackState=e)}}else if(t instanceof B.StarLoopbackState){let e=t;for(let t=0;t<e.numberOfTransitions;t++){let r=e.transition(t).target;r instanceof q.StarLoopEntryState&&(r.loopBackState=e)}}}let F=W.toInt(t[e++]);for(let r=1;r<=F;r++){let n=W.toInt(t[e++]),i=g.states[n];g.decisionToState.push(i),i.decision=r-1}if(0===g.grammarType)if(i){g.lexerActions=new Array(W.toInt(t[e++]));for(let r=0;r<g.lexerActions.length;r++){let n=W.toInt(t[e++]),i=W.toInt(t[e++]);65535==i&&(i=-1);let o=W.toInt(t[e++]);65535==o&&(o=-1);let s=this.lexerActionFactory(n,i,o);g.lexerActions[r]=s}}else{let t=[];for(let e of g.states)for(let r=0;r<e.numberOfTransitions;r++){let n=e.transition(r);if(!(n instanceof o.ActionTransition))continue;let i=n.ruleIndex,s=n.actionIndex,a=new S.LexerCustomAction(i,s);e.setTransition(r,new o.ActionTransition(n.target,i,t.length,!1)),t.push(a)}g.lexerActions=t}this.markPrecedenceDecisions(g),g.decisionToDFA=new Array(F);for(let t=0;t<F;t++)g.decisionToDFA[t]=new y.DFA(g.decisionToState[t],t);if(this.deserializationOptions.isVerifyATN&&this.verifyATN(g),this.deserializationOptions.isGenerateRuleBypassTransitions&&1===g.grammarType){g.ruleToTokenType=new Int32Array(g.ruleToStartState.length);for(let t=0;t<g.ruleToStartState.length;t++)g.ruleToTokenType[t]=g.maxTokenType+t+1;for(let t=0;t<g.ruleToStartState.length;t++){let e=new c.BasicBlockStartState;e.ruleIndex=t,g.addState(e);let r,n,i=new d.BlockEndState;if(i.ruleIndex=t,g.addState(i),e.endState=i,g.defineDecisionState(e),i.startState=e,g.ruleToStartState[t].isPrecedenceRule){r=void 0;for(let e of g.states){if(e.ruleIndex!==t)continue;if(!(e instanceof q.StarLoopEntryState))continue;let n=e.transition(e.numberOfTransitions-1).target;if(n instanceof b.LoopEndState&&n.epsilonOnlyTransitions&&n.transition(0).target instanceof j.RuleStopState){r=e;break}}if(!r)throw new Error("Couldn't identify final state of the precedence rule prefix section.");n=r.loopBackState.transition(0)}else r=g.ruleToStopState[t];for(let t of g.states)for(let e=0;e<t.numberOfTransitions;e++){let o=t.transition(e);o!==n&&o.target===r&&(o.target=i)}for(;g.ruleToStartState[t].numberOfTransitions>0;){let r=g.ruleToStartState[t].removeTransition(g.ruleToStartState[t].numberOfTransitions-1);e.addTransition(r)}g.ruleToStartState[t].addTransition(new _.EpsilonTransition(e)),i.addTransition(new _.EpsilonTransition(r));let o=new h.BasicState;g.addState(o),o.addTransition(new u.AtomTransition(i,g.ruleToTokenType[t])),e.addTransition(new _.EpsilonTransition(o))}this.deserializationOptions.isVerifyATN&&this.verifyATN(g)}if(this.deserializationOptions.isOptimize){for(;;){let t=0;t+=W.inlineSetRules(g),t+=W.combineChainedEpsilons(g);let e=0===g.grammarType;if(0===(t+=W.optimizeSets(g,e)))break}this.deserializationOptions.isVerifyATN&&this.verifyATN(g)}return W.identifyTailCalls(g),g}markPrecedenceDecisions(t){let e=new Map;for(let r of t.states)if(r instanceof q.StarLoopEntryState&&t.ruleToStartState[r.ruleIndex].isPrecedenceRule){let n=r.transition(r.numberOfTransitions-1).target;n instanceof b.LoopEndState&&n.epsilonOnlyTransitions&&n.transition(0).target instanceof j.RuleStopState&&(e.set(r.ruleIndex,r),r.precedenceRuleDecision=!0,r.precedenceLoopbackStates=new p.BitSet(t.states.length))}for(let r of e)for(let e of t.ruleToStopState[r[0]].getTransitions())1===e.serializationType&&-1===e.outermostPrecedenceReturn&&r[1].precedenceLoopbackStates.set(e.target.stateNumber)}verifyATN(t){for(let e of t.states)if(this.checkCondition(null!=e,"ATN states should not be null."),0!==e.stateType){if(this.checkCondition(e.onlyHasEpsilonTransitions||e.numberOfTransitions<=1),e instanceof k.PlusBlockStartState&&this.checkCondition(null!=e.loopBackState),e instanceof q.StarLoopEntryState){let t=e;if(this.checkCondition(null!=t.loopBackState),this.checkCondition(2===t.numberOfTransitions),t.transition(0).target instanceof U.StarBlockStartState)this.checkCondition(t.transition(1).target instanceof b.LoopEndState),this.checkCondition(!t.nonGreedy);else{if(!(t.transition(0).target instanceof b.LoopEndState))throw new Error("IllegalStateException");this.checkCondition(t.transition(1).target instanceof U.StarBlockStartState),this.checkCondition(t.nonGreedy)}}if(e instanceof B.StarLoopbackState&&(this.checkCondition(1===e.numberOfTransitions),this.checkCondition(e.transition(0).target instanceof q.StarLoopEntryState)),e instanceof b.LoopEndState&&this.checkCondition(null!=e.loopBackState),e instanceof F.RuleStartState&&this.checkCondition(null!=e.stopState),e instanceof f.BlockStartState&&this.checkCondition(null!=e.endState),e instanceof d.BlockEndState&&this.checkCondition(null!=e.startState),e instanceof g.DecisionState){let t=e;this.checkCondition(t.numberOfTransitions<=1||t.decision>=0)}else this.checkCondition(e.numberOfTransitions<=1||e instanceof j.RuleStopState)}}checkCondition(t,e){if(!t)throw new Error("IllegalStateException: "+e)}static inlineSetRules(t){let e=0,r=new Array(t.ruleToStartState.length);for(let e=0;e<t.ruleToStartState.length;e++){let n=t.ruleToStartState[e];for(;n.onlyHasEpsilonTransitions&&1===n.numberOfOptimizedTransitions&&1===n.getOptimizedTransition(0).serializationType;)n=n.getOptimizedTransition(0).target;if(1!==n.numberOfOptimizedTransitions)continue;let i=n.getOptimizedTransition(0),o=i.target;if(!i.isEpsilon&&o.onlyHasEpsilonTransitions&&1===o.numberOfOptimizedTransitions&&o.getOptimizedTransition(0).target instanceof j.RuleStopState)switch(i.serializationType){case 5:case 2:case 7:r[e]=i;break;case 8:case 9:default:continue}}for(let n=0;n<t.states.length;n++){let i,o=t.states[n];if(!(o.ruleIndex<0)){for(let n=0;n<o.numberOfOptimizedTransitions;n++){let s=o.getOptimizedTransition(n);if(!(s instanceof z.RuleTransition)){null!=i&&i.push(s);continue}let a=s,l=r[a.target.ruleIndex];if(null==l){null!=i&&i.push(s);continue}if(null==i){i=[];for(let t=0;t<n;t++)i.push(o.getOptimizedTransition(n))}e++;let c=a.followState,p=new h.BasicState;switch(p.setRuleIndex(c.ruleIndex),t.addState(p),i.push(new _.EpsilonTransition(p)),l.serializationType){case 5:p.addTransition(new u.AtomTransition(c,l._label));break;case 2:p.addTransition(new M.RangeTransition(c,l.from,l.to));break;case 7:p.addTransition(new H.SetTransition(c,l.label));break;default:throw new Error("UnsupportedOperationException")}}if(null!=i){if(o.isOptimized)for(;o.numberOfOptimizedTransitions>0;)o.removeOptimizedTransition(o.numberOfOptimizedTransitions-1);for(let t of i)o.addOptimizedTransition(t)}}}return L.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+e+" rule invocations by inlining sets."),e}static combineChainedEpsilons(t){let e=0;for(let r of t.states){if(!r.onlyHasEpsilonTransitions||r instanceof j.RuleStopState)continue;let t;t:for(let n=0;n<r.numberOfOptimizedTransitions;n++){let i=r.getOptimizedTransition(n),o=i.target;if(1===i.serializationType&&-1===i.outermostPrecedenceReturn&&1===o.stateType&&o.onlyHasEpsilonTransitions){for(let e=0;e<o.numberOfOptimizedTransitions;e++)if(1!==o.getOptimizedTransition(e).serializationType||-1!==o.getOptimizedTransition(e).outermostPrecedenceReturn){null!=t&&t.push(i);continue t}if(e++,null==t){t=[];for(let e=0;e<n;e++)t.push(r.getOptimizedTransition(e))}for(let e=0;e<o.numberOfOptimizedTransitions;e++){let r=o.getOptimizedTransition(e).target;t.push(new _.EpsilonTransition(r))}}else null!=t&&t.push(i)}if(null!=t){if(r.isOptimized)for(;r.numberOfOptimizedTransitions>0;)r.removeOptimizedTransition(r.numberOfOptimizedTransitions-1);for(let e of t)r.addOptimizedTransition(e)}}return L.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+e+" transitions by combining chained epsilon transitions."),e}static optimizeSets(t,e){if(e)return 0;let r=0,n=t.decisionToState;for(let e of n){let n=new m.IntervalSet;for(let t=0;t<e.numberOfOptimizedTransitions;t++){let r=e.getOptimizedTransition(t);if(!(r instanceof _.EpsilonTransition))continue;if(1!==r.target.numberOfOptimizedTransitions)continue;let i=r.target.getOptimizedTransition(0);i.target instanceof d.BlockEndState&&(i instanceof I.NotSetTransition||(i instanceof u.AtomTransition||i instanceof M.RangeTransition||i instanceof H.SetTransition)&&n.add(t))}if(n.size<=1)continue;let i=[];for(let t=0;t<e.numberOfOptimizedTransitions;t++)n.contains(t)||i.push(e.getOptimizedTransition(t));let o,s=e.getOptimizedTransition(n.minElement).target.getOptimizedTransition(0).target,a=new m.IntervalSet;for(let t=0;t<n.intervals.length;t++){let r=n.intervals[t];for(let t=r.a;t<=r.b;t++){let r=e.getOptimizedTransition(t).target.getOptimizedTransition(0);if(r instanceof I.NotSetTransition)throw new Error("Not yet implemented.");a.addAll(r.label)}}if(1===a.intervals.length)if(1===a.size)o=new u.AtomTransition(s,a.minElement);else{let t=a.intervals[0];o=new M.RangeTransition(s,t.a,t.b)}else o=new H.SetTransition(s,a);let l=new h.BasicState;if(l.setRuleIndex(e.ruleIndex),t.addState(l),l.addTransition(o),i.push(new _.EpsilonTransition(l)),r+=e.numberOfOptimizedTransitions-i.length,e.isOptimized)for(;e.numberOfOptimizedTransitions>0;)e.removeOptimizedTransition(e.numberOfOptimizedTransitions-1);for(let t of i)e.addOptimizedTransition(t)}return L.ParserATNSimulator.debug&&console.log("ATN runtime optimizer removed "+r+" paths by collapsing sets."),r}static identifyTailCalls(t){for(let e of t.states){for(let r=0;r<e.numberOfTransitions;r++){let n=e.transition(r);n instanceof z.RuleTransition&&(n.tailCall=this.testTailCall(t,n,!1),n.optimizedTailCall=this.testTailCall(t,n,!0))}if(e.isOptimized)for(let r=0;r<e.numberOfOptimizedTransitions;r++){let n=e.getOptimizedTransition(r);n instanceof z.RuleTransition&&(n.tailCall=this.testTailCall(t,n,!1),n.optimizedTailCall=this.testTailCall(t,n,!0))}}}static testTailCall(t,e,r){if(!r&&e.tailCall)return!0;if(r&&e.optimizedTailCall)return!0;let n=new p.BitSet(t.states.length),i=[];for(i.push(e.followState);;){let t=i.pop();if(!t)break;if(n.get(t.stateNumber))continue;if(t instanceof j.RuleStopState)continue;if(!t.onlyHasEpsilonTransitions)return!1;let e=r?t.numberOfOptimizedTransitions:t.numberOfTransitions;for(let n=0;n<e;n++){let e=r?t.getOptimizedTransition(n):t.transition(n);if(1!==e.serializationType)return!1;i.push(e.target)}}return!0}static toInt(t){return t}static toInt32(t,e){return(t[e]|t[e+1]<<16)>>>0}static toUUID(t,e){let r=W.toInt32(t,e),n=W.toInt32(t,e+2),i=W.toInt32(t,e+4),o=W.toInt32(t,e+6);return new V.UUID(o,i,n,r)}edgeFactory(t,e,r,n,i,s,a,l){let c=t.states[n];switch(e){case 1:return new _.EpsilonTransition(c);case 2:return 0!==a?new M.RangeTransition(c,Y.Token.EOF,s):new M.RangeTransition(c,i,s);case 3:return new z.RuleTransition(t.states[i],s,a,c);case 4:return new D.PredicateTransition(c,i,s,0!==a);case 10:return new P.PrecedencePredicateTransition(c,i);case 5:return 0!==a?new u.AtomTransition(c,Y.Token.EOF):new u.AtomTransition(c,i);case 6:return new o.ActionTransition(c,i,s,0!==a);case 7:return new H.SetTransition(c,l[i]);case 8:return new I.NotSetTransition(c,l[i]);case 9:return new $.WildcardTransition(c)}throw new Error("The specified transition type is not valid.")}stateFactory(t,e){let r;switch(t){case 0:return new x.InvalidState;case 1:r=new h.BasicState;break;case 2:r=new F.RuleStartState;break;case 3:r=new c.BasicBlockStartState;break;case 4:r=new k.PlusBlockStartState;break;case 5:r=new U.StarBlockStartState;break;case 6:r=new K.TokensStartState;break;case 7:r=new j.RuleStopState;break;case 8:r=new d.BlockEndState;break;case 9:r=new B.StarLoopbackState;break;case 10:r=new q.StarLoopEntryState;break;case 11:r=new w.PlusLoopbackState;break;case 12:r=new b.LoopEndState;break;default:let e=`The specified state type ${t} is not valid.`;throw new Error(e)}return r.ruleIndex=e,r}lexerActionFactory(t,e,r){switch(t){case 0:return new N.LexerChannelAction(e);case 1:return new S.LexerCustomAction(e,r);case 2:return new T.LexerModeAction(e);case 3:return v.LexerMoreAction.INSTANCE;case 4:return E.LexerPopModeAction.INSTANCE;case 5:return new O.LexerPushModeAction(e);case 6:return A.LexerSkipAction.INSTANCE;case 7:return new C.LexerTypeAction(e);default:let n=`The specified lexer action type ${t} is not valid.`;throw new Error(n)}}}W.BASE_SERIALIZED_UUID=V.UUID.fromString("E4178468-DF95-44D0-AD87-F22A5D5FB6D3"),W.ADDED_LEXER_ACTIONS=V.UUID.fromString("AB35191A-1603-487E-B75A-479B831EAF6D"),W.SUPPORTED_UUIDS=[W.BASE_SERIALIZED_UUID,W.ADDED_LEXER_ACTIONS],W.SERIALIZED_UUID=W.ADDED_LEXER_ACTIONS,n([R.NotNull],W.prototype,"deserializationOptions",void 0),n([i(0,R.NotNull)],W.prototype,"deserialize",null),n([i(0,R.NotNull)],W.prototype,"markPrecedenceDecisions",null),n([R.NotNull,i(0,R.NotNull)],W.prototype,"edgeFactory",null),e.ATNDeserializer=W},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(19),s=r(0),a=r(3),l=r(8);let u=class extends o.RecognitionException{constructor(t,e,r,n){super(t,e),this._startIndex=r,this._deadEndConfigs=n}get startIndex(){return this._startIndex}get deadEndConfigs(){return this._deadEndConfigs}get inputStream(){return super.inputStream}toString(){let t="";return this._startIndex>=0&&this._startIndex<this.inputStream.size&&(t=this.inputStream.getText(a.Interval.of(this._startIndex,this._startIndex)),t=l.escapeWhitespace(t,!1)),`LexerNoViableAltException('${t}')`}};n([s.Override],u.prototype,"inputStream",null),n([s.Override],u.prototype,"toString",null),u=n([i(1,s.NotNull)],u),e.LexerNoViableAltException=u},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0),s=r(14);let a=class extends s.Transition{constructor(t,e,r,n){super(t),this.tailCall=!1,this.optimizedTailCall=!1,this.ruleIndex=e,this.precedence=r,this.followState=n}get serializationType(){return 3}get isEpsilon(){return!0}matches(t,e,r){return!1}};n([o.NotNull],a.prototype,"followState",void 0),n([o.Override],a.prototype,"serializationType",null),n([o.Override],a.prototype,"isEpsilon",null),n([o.Override],a.prototype,"matches",null),a=n([i(0,o.NotNull),i(3,o.NotNull)],a),e.RuleTransition=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(18),s=r(0),a=r(1),l=r(14);let u=class extends l.Transition{constructor(t,e){super(t),null==e&&(e=o.IntervalSet.of(a.Token.INVALID_TYPE)),this.set=e}get serializationType(){return 7}get label(){return this.set}matches(t,e,r){return this.set.contains(t)}toString(){return this.set.toString()}};n([s.NotNull],u.prototype,"set",void 0),n([s.Override],u.prototype,"serializationType",null),n([s.Override,s.NotNull],u.prototype,"label",null),n([s.Override],u.prototype,"matches",null),n([s.Override,s.NotNull],u.prototype,"toString",null),u=n([i(0,s.NotNull),i(1,s.Nullable)],u),e.SetTransition=u},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0),s=r(40);let a=class extends s.SetTransition{constructor(t,e){super(t,e)}get serializationType(){return 8}matches(t,e,r){return t>=e&&t<=r&&!super.matches(t,e,r)}toString(){return"~"+super.toString()}};n([o.Override],a.prototype,"serializationType",null),n([o.Override],a.prototype,"matches",null),n([o.Override],a.prototype,"toString",null),a=n([i(0,o.NotNull),i(1,o.Nullable)],a),e.NotSetTransition=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(10),o=r(16),s=r(0);class a extends o.DecisionState{constructor(){super(...arguments),this.precedenceRuleDecision=!1,this.precedenceLoopbackStates=new i.BitSet}get stateType(){return 10}}n([s.Override],a.prototype,"stateType",null),e.StarLoopEntryState=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0);class s{constructor(t){if(this.delegates=t,!t)throw new Error("Invalid delegates")}getDelegates(){return this.delegates}syntaxError(t,e,r,n,i,o){this.delegates.forEach(s=>{s.syntaxError(t,e,r,n,i,o)})}}n([o.Override,i(0,o.NotNull),i(4,o.NotNull)],s.prototype,"syntaxError",null),e.ProxyErrorListener=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(25),s=r(29),a=r(0),l=r(4);let u=class t{constructor(t){this.atn=t}static get ERROR(){return t._ERROR||(t._ERROR=new s.DFAState(new o.ATNConfigSet),t._ERROR.stateNumber=l.PredictionContext.EMPTY_FULL_STATE_KEY),t._ERROR}clearDFA(){this.atn.clearDFA()}};n([a.NotNull],u.prototype,"atn",void 0),n([a.NotNull],u,"ERROR",null),u=n([i(0,a.NotNull)],u),e.ATNSimulator=u,u=e.ATNSimulator||(e.ATNSimulator={}),e.ATNSimulator=u},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(20),o=r(0),s=r(6),a=r(4),l=r(5);class u{constructor(t=!0){this.contexts=new i.Array2DHashMap(s.ObjectEqualityComparator.INSTANCE),this.childContexts=new i.Array2DHashMap(s.ObjectEqualityComparator.INSTANCE),this.joinContexts=new i.Array2DHashMap(s.ObjectEqualityComparator.INSTANCE),this.enableCache=t}getAsCached(t){if(!this.enableCache)return t;let e=this.contexts.get(t);return e||(e=t,this.contexts.put(t,t)),e}getChild(t,e){if(!this.enableCache)return t.getChild(e);let r=new u.PredictionContextAndInt(t,e),n=this.childContexts.get(r);return n||(n=t.getChild(e),n=this.getAsCached(n),this.childContexts.put(r,n)),n}join(t,e){if(!this.enableCache)return a.PredictionContext.join(t,e,this);let r=new u.IdentityCommutativePredictionContextOperands(t,e),n=this.joinContexts.get(r);return n||(n=a.PredictionContext.join(t,e,this),n=this.getAsCached(n),this.joinContexts.put(r,n),n)}}u.UNCACHED=new u(!1),e.PredictionContextCache=u,function(t){class e{constructor(t,e){this.obj=t,this.value=e}equals(t){if(!(t instanceof e))return!1;if(t==this)return!0;let r=t;return this.value===r.value&&(this.obj===r.obj||null!=this.obj&&this.obj.equals(r.obj))}hashCode(){let t=5;return 7*(t=7*t+(null!=this.obj?this.obj.hashCode():0))+this.value}}n([o.Override],e.prototype,"equals",null),n([o.Override],e.prototype,"hashCode",null),t.PredictionContextAndInt=e;class r{constructor(t,e){l(null!=t),l(null!=e),this._x=t,this._y=e}get x(){return this._x}get y(){return this._y}equals(t){if(!(t instanceof r))return!1;if(this===t)return!0;let e=t;return this._x===e._x&&this._y===e._y||this._x===e._y&&this._y===e._x}hashCode(){return this._x.hashCode()^this._y.hashCode()}}n([o.Override],r.prototype,"equals",null),n([o.Override],r.prototype,"hashCode",null),t.IdentityCommutativePredictionContextOperands=r}(u=e.PredictionContextCache||(e.PredictionContextCache={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(13),s=r(25),a=r(68),l=r(29),u=r(117),c=r(0),h=r(6),p=r(42),d=r(15);let f=class{constructor(t,e=0){if(this.states=new o.Array2DHashSet(h.ObjectEqualityComparator.INSTANCE),this.nextStateNumber=0,!t.atn)throw new Error("The ATNState must be associated with an ATN");this.atnStartState=t,this.atn=t.atn,this.decision=e;let r=!1;t instanceof p.StarLoopEntryState&&t.precedenceRuleDecision&&(r=!0,this.s0=new l.DFAState(new s.ATNConfigSet),this.s0full=new l.DFAState(new s.ATNConfigSet)),this.precedenceDfa=r}get isPrecedenceDfa(){return this.precedenceDfa}getPrecedenceStartState(t,e){if(!this.isPrecedenceDfa)throw new Error("Only precedence DFAs may contain a precedence start state.");return e?this.s0full.getTarget(t):this.s0.getTarget(t)}setPrecedenceStartState(t,e,r){if(!this.isPrecedenceDfa)throw new Error("Only precedence DFAs may contain a precedence start state.");t<0||(e?this.s0full.setTarget(t,r):this.s0.setTarget(t,r))}get isEmpty(){return this.isPrecedenceDfa?0===this.s0.getEdgeMap().size&&0===this.s0full.getEdgeMap().size:null==this.s0&&null==this.s0full}get isContextSensitive(){return this.isPrecedenceDfa?this.s0full.getEdgeMap().size>0:null!=this.s0full}addState(t){return t.stateNumber=this.nextStateNumber++,this.states.getOrAdd(t)}toString(t,e){if(t||(t=d.VocabularyImpl.EMPTY_VOCABULARY),!this.s0)return"";let r;return(r=e?new a.DFASerializer(this,t,e,this.atnStartState.atn):new a.DFASerializer(this,t)).toString()}toLexerString(){return this.s0?new u.LexerDFASerializer(this).toString():""}};n([c.NotNull],f.prototype,"states",void 0),n([c.NotNull],f.prototype,"atnStartState",void 0),n([c.NotNull],f.prototype,"atn",void 0),f=n([i(0,c.NotNull)],f),e.DFA=f},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(69),s=r(12),a=r(7),l=r(30),u=r(25),c=r(44),h=r(29),p=r(3),d=r(21),f=r(17),g=r(115),y=r(38),_=r(0),m=r(113),x=r(4),N=r(23),S=r(1),T=r(5);let v=class t extends c.ATNSimulator{constructor(e,r){super(e),this.optimize_tail_calls=!0,this.startIndex=-1,this._line=1,this._charPositionInLine=0,this.mode=f.Lexer.DEFAULT_MODE,this.prevAccept=new t.SimState,this.recog=r}copyState(t){this._charPositionInLine=t.charPositionInLine,this._line=t._line,this.mode=t.mode,this.startIndex=t.startIndex}match(e,r){t.match_calls++,this.mode=r;let n=e.mark();try{this.startIndex=e.index,this.prevAccept.reset();let t=this.atn.modeToDFA[r].s0;return null==t?this.matchATN(e):this.execATN(e,t)}finally{e.release(n)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this._line=1,this._charPositionInLine=0,this.mode=f.Lexer.DEFAULT_MODE}matchATN(e){let r=this.atn.modeToStartState[this.mode];t.debug&&console.log(`matchATN mode ${this.mode} start: ${r}`);let n=this.mode,i=this.computeStartState(e,r),o=i.hasSemanticContext;o&&(i.hasSemanticContext=!1);let s=this.addDFAState(i);if(!o){let t=this.atn.modeToDFA[this.mode];t.s0?s=t.s0:t.s0=s}let a=this.execATN(e,s);return t.debug&&console.log(`DFA after matchATN: ${this.atn.modeToDFA[n].toLexerString()}`),a}execATN(e,r){t.debug&&console.log(`start state closure=${r.configs}`),r.isAcceptState&&this.captureSimState(this.prevAccept,e,r);let n=e.LA(1),i=r;for(;;){t.debug&&console.log(`execATN loop starting closure: ${i.configs}`);let r=this.getExistingTargetState(i,n);if(null==r&&(r=this.computeTargetState(e,i,n)),r===c.ATNSimulator.ERROR)break;if(n!==d.IntStream.EOF&&this.consume(e),r.isAcceptState&&(this.captureSimState(this.prevAccept,e,r),n===d.IntStream.EOF))break;n=e.LA(1),i=r}return this.failOrAccept(this.prevAccept,e,i.configs,n)}getExistingTargetState(e,r){let n=e.getTarget(r);return t.debug&&null!=n&&console.log("reuse state "+e.stateNumber+" edge to "+n.stateNumber),n}computeTargetState(t,e,r){let n=new m.OrderedATNConfigSet;return this.getReachableConfigSet(t,e.configs,n,r),n.isEmpty?(n.hasSemanticContext||this.addDFAEdge(e,r,c.ATNSimulator.ERROR),c.ATNSimulator.ERROR):this.addDFAEdge(e,r,n)}failOrAccept(t,e,r,n){if(null!=t.dfaState){let r=t.dfaState.lexerActionExecutor;return this.accept(e,r,this.startIndex,t.index,t.line,t.charPos),t.dfaState.prediction}if(n===d.IntStream.EOF&&e.index===this.startIndex)return S.Token.EOF;throw new y.LexerNoViableAltException(this.recog,e,this.startIndex,r)}getReachableConfigSet(e,r,n,i){let o=a.ATN.INVALID_ALT_NUMBER;for(let a of s.asIterable(r)){let r=a.alt===o;if(r&&a.hasPassedThroughNonGreedyDecision)continue;t.debug&&console.log(`testing ${this.getTokenName(i)} at ${a.toString(this.recog,!0)}`);let s=a.state.numberOfOptimizedTransitions;for(let t=0;t<s;t++){let s=a.state.getOptimizedTransition(t),l=this.getReachableTarget(s,i);if(null!=l){let t,s=a.lexerActionExecutor;null!=s?(s=s.fixOffsetBeforeMatch(e.index-this.startIndex),t=a.transform(l,!0,s)):(T(null==a.lexerActionExecutor),t=a.transform(l,!0));let u=i===d.IntStream.EOF;if(this.closure(e,t,n,r,!0,u)){o=a.alt;break}}}}}accept(e,r,n,i,o,s){t.debug&&console.log(`ACTION ${r}`),e.seek(i),this._line=o,this._charPositionInLine=s,null!=r&&null!=this.recog&&r.execute(this.recog,e,n)}getReachableTarget(t,e){if(t.matches(e,f.Lexer.MIN_CHAR_VALUE,f.Lexer.MAX_CHAR_VALUE))return t.target}computeStartState(t,e){let r=x.PredictionContext.EMPTY_FULL,n=new m.OrderedATNConfigSet;for(let i=0;i<e.numberOfTransitions;i++){let o=e.transition(i).target,s=l.ATNConfig.create(o,i+1,r);this.closure(t,s,n,!1,!1,!1)}return n}closure(e,r,n,i,o,s){if(t.debug&&console.log("closure("+r.toString(this.recog,!0)+")"),r.state instanceof N.RuleStopState){t.debug&&(null!=this.recog?console.log(`closure at ${this.recog.ruleNames[r.state.ruleIndex]} rule stop ${r}`):console.log(`closure at rule stop ${r}`));let a=r.context;if(a.isEmpty)return n.add(r),!0;a.hasEmpty&&(n.add(r.transform(r.state,!0,x.PredictionContext.EMPTY_FULL)),i=!0);for(let t=0;t<a.size;t++){let l=a.getReturnState(t);if(l==x.PredictionContext.EMPTY_FULL_STATE_KEY)continue;let u=a.getParent(t),c=this.atn.states[l],h=r.transform(c,!1,u);i=this.closure(e,h,n,i,o,s)}return i}r.state.onlyHasEpsilonTransitions||i&&r.hasPassedThroughNonGreedyDecision||n.add(r);let a=r.state;for(let t=0;t<a.numberOfOptimizedTransitions;t++){let l=a.getOptimizedTransition(t),u=this.getEpsilonTarget(e,r,l,n,o,s);null!=u&&(i=this.closure(e,u,n,i,o,s))}return i}getEpsilonTarget(e,r,n,i,o,s){let a;switch(n.serializationType){case 3:let l=n;if(this.optimize_tail_calls&&l.optimizedTailCall&&!r.context.hasEmpty)a=r.transform(n.target,!0);else{let t=r.context.getChild(l.followState.stateNumber);a=r.transform(n.target,!0,t)}break;case 10:throw new Error("Precedence predicates are not supported in lexers.");case 4:let u=n;t.debug&&console.log("EVAL rule "+u.ruleIndex+":"+u.predIndex),i.hasSemanticContext=!0,a=this.evaluatePredicate(e,u.ruleIndex,u.predIndex,o)?r.transform(n.target,!0):void 0;break;case 6:if(r.context.hasEmpty){let t=g.LexerActionExecutor.append(r.lexerActionExecutor,this.atn.lexerActions[n.actionIndex]);a=r.transform(n.target,!0,t);break}a=r.transform(n.target,!0);break;case 1:a=r.transform(n.target,!0);break;case 5:case 2:case 7:if(s&&n.matches(d.IntStream.EOF,f.Lexer.MIN_CHAR_VALUE,f.Lexer.MAX_CHAR_VALUE)){a=r.transform(n.target,!1);break}a=void 0;break;default:a=void 0}return a}evaluatePredicate(t,e,r,n){if(null==this.recog)return!0;if(!n)return this.recog.sempred(void 0,e,r);let i=this._charPositionInLine,o=this._line,s=t.index,a=t.mark();try{return this.consume(t),this.recog.sempred(void 0,e,r)}finally{this._charPositionInLine=i,this._line=o,t.seek(s),t.release(a)}}captureSimState(t,e,r){t.index=e.index,t.line=this._line,t.charPos=this._charPositionInLine,t.dfaState=r}addDFAEdge(e,r,n){if(n instanceof u.ATNConfigSet){let t=n.hasSemanticContext;t&&(n.hasSemanticContext=!1);let i=this.addDFAState(n);return t?i:(this.addDFAEdge(e,r,i),i)}t.debug&&console.log("EDGE "+e+" -> "+n+" upon "+String.fromCharCode(r)),null!=e&&e.setTarget(r,n)}addDFAState(t){T(!t.hasSemanticContext);let e=new h.DFAState(this.atn.modeToDFA[this.mode],t),r=this.atn.modeToDFA[this.mode].states.get(e);if(null!=r)return r;t.optimizeConfigs(this);let n=new h.DFAState(this.atn.modeToDFA[this.mode],t.clone(!0)),i=void 0;for(let e of s.asIterable(t))if(e.state instanceof N.RuleStopState){i=e;break}if(null!=i){let t=this.atn.ruleToTokenType[i.state.ruleIndex],e=i.lexerActionExecutor;n.acceptStateInfo=new o.AcceptStateInfo(t,e)}return this.atn.modeToDFA[this.mode].addState(n)}getDFA(t){return this.atn.modeToDFA[t]}getText(t){return t.getText(p.Interval.of(this.startIndex,t.index-1))}get line(){return this._line}set line(t){this._line=t}get charPositionInLine(){return this._charPositionInLine}set charPositionInLine(t){this._charPositionInLine=t}consume(t){t.LA(1)=="\n".charCodeAt(0)?(this._line++,this._charPositionInLine=0):this._charPositionInLine++,t.consume()}getTokenName(t){return-1===t?"EOF":"'"+String.fromCharCode(t)+"'"}};v.match_calls=0,n([_.NotNull],v.prototype,"prevAccept",void 0),n([i(0,_.NotNull)],v.prototype,"copyState",null),n([i(0,_.NotNull)],v.prototype,"match",null),n([_.Override],v.prototype,"reset",null),n([i(0,_.NotNull)],v.prototype,"matchATN",null),n([i(0,_.NotNull),i(1,_.NotNull)],v.prototype,"execATN",null),n([i(0,_.NotNull)],v.prototype,"getExistingTargetState",null),n([_.NotNull,i(0,_.NotNull),i(1,_.NotNull)],v.prototype,"computeTargetState",null),n([i(0,_.NotNull),i(1,_.NotNull),i(2,_.NotNull)],v.prototype,"getReachableConfigSet",null),n([i(0,_.NotNull)],v.prototype,"accept",null),n([_.NotNull,i(0,_.NotNull),i(1,_.NotNull)],v.prototype,"computeStartState",null),n([i(0,_.NotNull),i(1,_.NotNull),i(2,_.NotNull)],v.prototype,"closure",null),n([i(0,_.NotNull),i(1,_.NotNull),i(2,_.NotNull),i(3,_.NotNull)],v.prototype,"getEpsilonTarget",null),n([i(0,_.NotNull)],v.prototype,"evaluatePredicate",null),n([i(0,_.NotNull),i(1,_.NotNull),i(2,_.NotNull)],v.prototype,"captureSimState",null),n([_.NotNull,i(0,_.NotNull)],v.prototype,"addDFAState",null),n([_.NotNull],v.prototype,"getDFA",null),n([_.NotNull,i(0,_.NotNull)],v.prototype,"getText",null),n([i(0,_.NotNull)],v.prototype,"consume",null),n([_.NotNull],v.prototype,"getTokenName",null),v=n([i(0,_.NotNull)],v),e.LexerATNSimulator=v,function(t){t.debug=!1,t.dfa_debug=!1,t.SimState=class{constructor(){this.index=-1,this.line=0,this.charPos=-1}reset(){this.index=-1,this.line=0,this.charPos=-1,this.dfaState=void 0}}}(v=e.LexerATNSimulator||(e.LexerATNSimulator={})),e.LexerATNSimulator=v},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(31),o=r(3),s=r(0);class a{constructor(t=!1){this.copyText=t}create(t,e,r,n,s,a,l,u){let c=new i.CommonToken(e,r,t,n,s,a);return c.line=l,c.charPositionInLine=u,null==r&&this.copyText&&null!=t.stream&&(c.text=t.stream.getText(o.Interval.of(s,a))),c}createSimple(t,e){return new i.CommonToken(t,e)}}n([s.Override],a.prototype,"create",null),n([s.Override],a.prototype,"createSimple",null),e.CommonTokenFactory=a,function(t){t.DEFAULT=new t}(a=e.CommonTokenFactory||(e.CommonTokenFactory={}))},function(t,e,r){"use strict";!function(t){t.binarySearch=function(t,e,r,n){return function(t,e,r,n){let i=e,o=r-1;for(;i<=o;){let e=i+o>>>1,r=t[e];if(r<n)i=e+1;else{if(!(r>n))return e;o=e-1}}return-(i+1)}(t,void 0!==r?r:0,void 0!==n?n:t.length,e)},t.toString=function(t){let e="[",r=!0;for(let n=0;n<t.length;n++){r?r=!1:e+=", ";let i=t[n];e+=null===i?"null":void 0===i?"undefined":i}return e+"]"}}(e.Arrays||(e.Arrays={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(49),o=r(0),s=new Int32Array(0),a=4,l=2147483639;class u{constructor(t){if(t)if(t instanceof u)this._data=t._data.slice(0),this._size=t._size;else if("number"==typeof t)0===t?(this._data=s,this._size=0):(this._data=new Int32Array(t),this._size=0);else{this._data=s,this._size=0;for(let e of t)this.add(e)}else this._data=s,this._size=0}add(t){this._data.length===this._size&&this.ensureCapacity(this._size+1),this._data[this._size]=t,this._size++}addAll(t){if(Array.isArray(t))this.ensureCapacity(this._size+t.length),this._data.subarray(this._size,this._size+t.length).set(t),this._size+=t.length;else if(t instanceof u)this.ensureCapacity(this._size+t._size),this._data.subarray(this._size,this._size+t.size).set(t._data),this._size+=t._size;else{this.ensureCapacity(this._size+t.size);let e=0;for(let r=t.iterator();r.hasNext();)this._data[this._size+e]=r.next(),e++;this._size+=t.size}}get(t){if(t<0||t>=this._size)throw RangeError();return this._data[t]}contains(t){for(let e=0;e<this._size;e++)if(this._data[e]===t)return!0;return!1}set(t,e){if(t<0||t>=this._size)throw RangeError();let r=this._data[t];return this._data[t]=e,r}removeAt(t){let e=this.get(t);return this._data.copyWithin(t,t+1,this._size),this._data[this._size-1]=0,this._size--,e}removeRange(t,e){if(t<0||e<0||t>this._size||e>this._size)throw RangeError();if(t>e)throw RangeError();this._data.copyWithin(e,t,this._size),this._data.fill(0,this._size-(e-t),this._size),this._size-=e-t}get isEmpty(){return 0===this._size}get size(){return this._size}trimToSize(){this._data.length!==this._size&&(this._data=this._data.slice(0,this._size))}clear(){this._data.fill(0,0,this._size),this._size=0}toArray(){return 0===this._size?[]:Array.from(this._data.subarray(0,this._size))}sort(){this._data.subarray(0,this._size).sort()}equals(t){if(t===this)return!0;if(!(t instanceof u))return!1;if(this._size!==t._size)return!1;for(let e=0;e<this._size;e++)if(this._data[e]!==t._data[e])return!1;return!0}hashCode(){let t=1;for(let e=0;e<this._size;e++)t=31*t+this._data[e];return t}toString(){return this._data.toString()}binarySearch(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this._size),e<0||r<0||e>this._size||r>this._size)throw new RangeError;if(e>r)throw new RangeError;return i.Arrays.binarySearch(this._data,t,e,r)}ensureCapacity(t){if(t<0||t>l)throw new RangeError;let e;for(e=0===this._data.length?a:this._data.length;e<t;)((e*=2)<0||e>l)&&(e=l);let r=new Int32Array(e);r.set(this._data),this._data=r}}n([o.NotNull],u.prototype,"_data",void 0),n([o.Override],u.prototype,"equals",null),n([o.Override],u.prototype,"hashCode",null),n([o.Override],u.prototype,"toString",null),e.IntegerList=u},function(t,e,r){"use strict";const n=r(14);e.AbstractPredicateTransition=class extends n.Transition{constructor(t){super(t)}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(34),s=r(32),a=r(18),l=r(28),u=r(4),c=r(1),h=r(0);class p{constructor(){this.errorRecoveryMode=!1,this.lastErrorIndex=-1}reset(t){this.endErrorCondition(t)}beginErrorCondition(t){this.errorRecoveryMode=!0}inErrorRecoveryMode(t){return this.errorRecoveryMode}endErrorCondition(t){this.errorRecoveryMode=!1,this.lastErrorStates=void 0,this.lastErrorIndex=-1}reportMatch(t){this.endErrorCondition(t)}reportError(t,e){this.inErrorRecoveryMode(t)||(this.beginErrorCondition(t),e instanceof l.NoViableAltException?this.reportNoViableAlternative(t,e):e instanceof s.InputMismatchException?this.reportInputMismatch(t,e):e instanceof o.FailedPredicateException?this.reportFailedPredicate(t,e):(console.error(`unknown recognition error type: ${e}`),this.notifyErrorListeners(t,e.toString(),e)))}notifyErrorListeners(t,e,r){let n=r.getOffendingToken(t);void 0===n&&(n=null),t.notifyErrorListeners(e,n,r)}recover(t,e){this.lastErrorIndex===t.inputStream.index&&this.lastErrorStates&&this.lastErrorStates.contains(t.state)&&t.consume(),this.lastErrorIndex=t.inputStream.index,this.lastErrorStates||(this.lastErrorStates=new a.IntervalSet),this.lastErrorStates.add(t.state);let r=this.getErrorRecoverySet(t);this.consumeUntil(t,r)}sync(t){let e=t.interpreter.atn.states[t.state];if(this.inErrorRecoveryMode(t))return;let r=t.inputStream.LA(1),n=t.atn.nextTokens(e);if(!n.contains(c.Token.EPSILON)&&!n.contains(r))switch(e.stateType){case 3:case 5:case 4:case 10:if(this.singleTokenDeletion(t))return;throw new s.InputMismatchException(t);case 11:case 9:this.reportUnwantedToken(t);let r=t.getExpectedTokens().or(this.getErrorRecoverySet(t));this.consumeUntil(t,r)}}reportNoViableAlternative(t,e){let r,n=t.inputStream;r=n?e.startToken.type===c.Token.EOF?"<EOF>":n.getTextFromRange(e.startToken,e.getOffendingToken()):"<unknown input>";let i="no viable alternative at input "+this.escapeWSAndQuote(r);this.notifyErrorListeners(t,i,e)}reportInputMismatch(t,e){let r=e.expectedTokens,n=r?r.toStringVocabulary(t.vocabulary):"",i="mismatched input "+this.getTokenErrorDisplay(e.getOffendingToken(t))+" expecting "+n;this.notifyErrorListeners(t,i,e)}reportFailedPredicate(t,e){let r="rule "+t.ruleNames[t.context.ruleIndex]+" "+e.message;this.notifyErrorListeners(t,r,e)}reportUnwantedToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);let e=t.currentToken,r="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toStringVocabulary(t.vocabulary);t.notifyErrorListeners(r,e,void 0)}reportMissingToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);let e=t.currentToken,r="missing "+this.getExpectedTokens(t).toStringVocabulary(t.vocabulary)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(r,e,void 0)}recoverInline(t){let e=this.singleTokenDeletion(t);if(e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new s.InputMismatchException(t)}singleTokenInsertion(t){let e=t.inputStream.LA(1),r=t.interpreter.atn.states[t.state].transition(0).target,n=t.interpreter.atn;return!!n.nextTokens(r,u.PredictionContext.fromRuleContext(n,t.context)).contains(e)&&(this.reportMissingToken(t),!0)}singleTokenDeletion(t){let e=t.inputStream.LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();let e=t.currentToken;return this.reportMatch(t),e}}getMissingSymbol(t){let e,r=t.currentToken,n=this.getExpectedTokens(t).minElement;e=n===c.Token.EOF?"<missing EOF>":"<missing "+t.vocabulary.getDisplayName(n)+">";let i=r,o=t.inputStream.tryLT(-1);return i.type===c.Token.EOF&&null!=o&&(i=o),this.constructToken(t.inputStream.tokenSource,n,e,i)}constructToken(t,e,r,n){let i=t.tokenFactory,o=n.tokenSource,s=o?o.inputStream:void 0;return i.create({source:t,stream:s},e,r,c.Token.DEFAULT_CHANNEL,-1,-1,n.line,n.charPositionInLine)}getExpectedTokens(t){return t.getExpectedTokens()}getTokenErrorDisplay(t){if(!t)return"<no token>";let e=this.getSymbolText(t);return e||(e=this.getSymbolType(t)===c.Token.EOF?"<EOF>":`<${this.getSymbolType(t)}>`),this.escapeWSAndQuote(e)}getSymbolText(t){return t.text}getSymbolType(t){return t.type}escapeWSAndQuote(t){return"'"+(t=(t=(t=t.replace("\n","\\n")).replace("\r","\\r")).replace("\t","\\t"))+"'"}getErrorRecoverySet(t){let e=t.interpreter.atn,r=t.context,n=new a.IntervalSet;for(;r&&r.invokingState>=0;){let t=e.states[r.invokingState].transition(0),i=e.nextTokens(t.followState);n.addAll(i),r=r._parent}return n.remove(c.Token.EPSILON),n}consumeUntil(t,e){let r=t.inputStream.LA(1);for(;r!==c.Token.EOF&&!e.contains(r);)t.consume(),r=t.inputStream.LA(1)}}n([h.Override],p.prototype,"reset",null),n([i(0,h.NotNull)],p.prototype,"beginErrorCondition",null),n([h.Override],p.prototype,"inErrorRecoveryMode",null),n([i(0,h.NotNull)],p.prototype,"endErrorCondition",null),n([h.Override],p.prototype,"reportMatch",null),n([h.Override],p.prototype,"reportError",null),n([i(0,h.NotNull)],p.prototype,"notifyErrorListeners",null),n([h.Override],p.prototype,"recover",null),n([h.Override],p.prototype,"sync",null),n([i(0,h.NotNull),i(1,h.NotNull)],p.prototype,"reportNoViableAlternative",null),n([i(0,h.NotNull),i(1,h.NotNull)],p.prototype,"reportInputMismatch",null),n([i(0,h.NotNull),i(1,h.NotNull)],p.prototype,"reportFailedPredicate",null),n([i(0,h.NotNull)],p.prototype,"reportUnwantedToken",null),n([i(0,h.NotNull)],p.prototype,"reportMissingToken",null),n([h.Override],p.prototype,"recoverInline",null),n([i(0,h.NotNull)],p.prototype,"singleTokenInsertion",null),n([i(0,h.NotNull)],p.prototype,"singleTokenDeletion",null),n([h.NotNull,i(0,h.NotNull)],p.prototype,"getMissingSymbol",null),n([h.NotNull,i(0,h.NotNull)],p.prototype,"getExpectedTokens",null),n([i(0,h.NotNull)],p.prototype,"getSymbolText",null),n([i(0,h.NotNull)],p.prototype,"getSymbolType",null),n([h.NotNull,i(0,h.NotNull)],p.prototype,"escapeWSAndQuote",null),n([h.NotNull,i(0,h.NotNull)],p.prototype,"getErrorRecoverySet",null),n([i(0,h.NotNull),i(1,h.NotNull)],p.prototype,"consumeUntil",null),e.DefaultErrorStrategy=p},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=r(9);class s extends o.ParserRuleContext{constructor(t,e,r){void 0!==r?super(e,r):super(),this._ruleIndex=t}get ruleIndex(){return this._ruleIndex}}n([i.Override],s.prototype,"ruleIndex",null),e.InterpreterRuleContext=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(5),s=r(31),a=r(3),l=r(17),u=r(0),c=r(1);let h=class{constructor(t){if(this.tokens=[],this.p=-1,this.fetchedEOF=!1,null==t)throw new Error("tokenSource cannot be null");this._tokenSource=t}get tokenSource(){return this._tokenSource}get index(){return this.p}mark(){return 0}release(t){}reset(){this.seek(0)}seek(t){this.lazyInit(),this.p=this.adjustSeekIndex(t)}get size(){return this.tokens.length}consume(){let t;if(!(t=this.p>=0&&(this.fetchedEOF?this.p<this.tokens.length-1:this.p<this.tokens.length))&&this.LA(1)===c.Token.EOF)throw new Error("cannot consume EOF");this.sync(this.p+1)&&(this.p=this.adjustSeekIndex(this.p+1))}sync(t){o(t>=0);let e=t-this.tokens.length+1;return!(e>0)||this.fetch(e)>=e}fetch(t){if(this.fetchedEOF)return 0;for(let e=0;e<t;e++){let t=this.tokenSource.nextToken();if(this.isWritableToken(t)&&(t.tokenIndex=this.tokens.length),this.tokens.push(t),t.type===c.Token.EOF)return this.fetchedEOF=!0,e+1}return t}get(t){if(t<0||t>=this.tokens.length)throw new RangeError("token index "+t+" out of range 0.."+(this.tokens.length-1));return this.tokens[t]}getRange(t,e){if(t<0||e<0)return[];this.lazyInit();let r=new Array;e>=this.tokens.length&&(e=this.tokens.length-1);for(let n=t;n<=e;n++){let t=this.tokens[n];if(t.type===c.Token.EOF)break;r.push(t)}return r}LA(t){let e=this.LT(t);return e?e.type:c.Token.INVALID_TYPE}tryLB(t){if(!(this.p-t<0))return this.tokens[this.p-t]}LT(t){let e=this.tryLT(t);if(void 0===e)throw new RangeError("requested lookback index out of range");return e}tryLT(t){if(this.lazyInit(),0===t)throw new RangeError("0 is not a valid lookahead index");if(t<0)return this.tryLB(-t);let e=this.p+t-1;return this.sync(e),e>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]}adjustSeekIndex(t){return t}lazyInit(){-1===this.p&&this.setup()}setup(){this.sync(0),this.p=this.adjustSeekIndex(0)}set tokenSource(t){this._tokenSource=t,this.tokens.length=0,this.p=-1}getTokens(t,e,r){if(this.lazyInit(),t=t||0,e=e||this.tokens.length-1,t<0||e>=this.tokens.length||e<0||t>=this.tokens.length)throw new RangeError("start "+t+" or stop "+e+" not in 0.."+(this.tokens.length-1));if(0===t&&e===this.tokens.length-1)return this.tokens;if(t>e)return[];if(null==r)return this.tokens.slice(t,e+1);"number"==typeof r&&(r=(new Set).add(r));let n=r,i=this.tokens.slice(t,e+1);return i.filter(t=>n.has(t.type))}nextTokenOnChannel(t,e){if(this.sync(t),t>=this.size)return this.size-1;let r=this.tokens[t];for(;r.channel!==e;){if(r.type===c.Token.EOF)return t;t++,this.sync(t),r=this.tokens[t]}return t}previousTokenOnChannel(t,e){if(this.sync(t),t>=this.size)return this.size-1;for(;t>=0;){let r=this.tokens[t];if(r.type===c.Token.EOF||r.channel===e)return t;t--}return t}getHiddenTokensToRight(t,e=-1){if(this.lazyInit(),t<0||t>=this.tokens.length)throw new RangeError(t+" not in 0.."+(this.tokens.length-1));let r,n=this.nextTokenOnChannel(t+1,l.Lexer.DEFAULT_TOKEN_CHANNEL),i=t+1;return r=-1===n?this.size-1:n,this.filterForChannel(i,r,e)}getHiddenTokensToLeft(t,e=-1){if(this.lazyInit(),t<0||t>=this.tokens.length)throw new RangeError(t+" not in 0.."+(this.tokens.length-1));if(0===t)return[];let r=this.previousTokenOnChannel(t-1,l.Lexer.DEFAULT_TOKEN_CHANNEL);if(r===t-1)return[];let n=r+1,i=t-1;return this.filterForChannel(n,i,e)}filterForChannel(t,e,r){let n=new Array;for(let i=t;i<=e;i++){let t=this.tokens[i];-1===r?t.channel!==l.Lexer.DEFAULT_TOKEN_CHANNEL&&n.push(t):t.channel===r&&n.push(t)}return n}get sourceName(){return this.tokenSource.sourceName}getText(t){void 0===t?t=a.Interval.of(0,this.size-1):t instanceof a.Interval||(t=t.sourceInterval);let e=t.a,r=t.b;if(e<0||r<0)return"";this.fill(),r>=this.tokens.length&&(r=this.tokens.length-1);let n="";for(let t=e;t<=r;t++){let e=this.tokens[t];if(e.type===c.Token.EOF)break;n+=e.text}return n.toString()}getTextFromRange(t,e){return this.isToken(t)&&this.isToken(e)?this.getText(a.Interval.of(t.tokenIndex,e.tokenIndex)):""}fill(){for(this.lazyInit();;)if(this.fetch(1e3)<1e3)return}isWritableToken(t){return t instanceof s.CommonToken}isToken(t){return t instanceof s.CommonToken}};n([u.NotNull],h.prototype,"_tokenSource",void 0),n([u.Override],h.prototype,"tokenSource",null),n([u.Override],h.prototype,"index",null),n([u.Override],h.prototype,"mark",null),n([u.Override],h.prototype,"release",null),n([u.Override],h.prototype,"seek",null),n([u.Override],h.prototype,"size",null),n([u.Override],h.prototype,"consume",null),n([u.Override],h.prototype,"get",null),n([u.Override],h.prototype,"LA",null),n([u.NotNull,u.Override],h.prototype,"LT",null),n([u.Override],h.prototype,"sourceName",null),n([u.NotNull,u.Override],h.prototype,"getText",null),n([u.NotNull,u.Override],h.prototype,"getTextFromRange",null),h=n([i(0,u.NotNull)],h),e.BufferedTokenStream=h},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0);class s{syntaxError(t,e,r,n,i,o){}reportAmbiguity(t,e,r,n,i,o,s){}reportAttemptingFullContext(t,e,r,n,i,o){}reportContextSensitivity(t,e,r,n,i,o){}}n([o.Override,i(0,o.NotNull),i(4,o.NotNull)],s.prototype,"syntaxError",null),n([o.Override,i(0,o.NotNull),i(1,o.NotNull),i(6,o.NotNull)],s.prototype,"reportAmbiguity",null),n([o.Override,i(0,o.NotNull),i(1,o.NotNull),i(5,o.NotNull)],s.prototype,"reportAttemptingFullContext",null),n([o.Override,i(0,o.NotNull),i(1,o.NotNull),i(5,o.NotNull)],s.prototype,"reportContextSensitivity",null),e.BaseErrorListener=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(43),o=r(0);class s extends i.ProxyErrorListener{constructor(t){super(t)}reportAmbiguity(t,e,r,n,i,o,a){this.getDelegates().forEach(l=>{s.isParserErrorListener(l)&&l.reportAmbiguity(t,e,r,n,i,o,a)})}reportAttemptingFullContext(t,e,r,n,i,o){this.getDelegates().forEach(a=>{s.isParserErrorListener(a)&&a.reportAttemptingFullContext(t,e,r,n,i,o)})}reportContextSensitivity(t,e,r,n,i,o){this.getDelegates().forEach(a=>{s.isParserErrorListener(a)&&a.reportContextSensitivity(t,e,r,n,i,o)})}static isParserErrorListener(t){return t.reportAmbiguity}}n([o.Override],s.prototype,"reportAmbiguity",null),n([o.Override],s.prototype,"reportAttemptingFullContext",null),n([o.Override],s.prototype,"reportContextSensitivity",null),e.ProxyParserErrorListener=s},function(t,e,r){"use strict";e.RuleNode=class{}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(7),o=r(24),s=r(57),a=r(3),l=r(0),u=r(100),c=r(9);class h extends s.RuleNode{constructor(t,e){super(),this._parent=t,this.invokingState=null!=e?e:-1}static getChildContext(t,e){return new h(t,e)}depth(){let t=0,e=this;for(;e;)e=e._parent,t++;return t}get isEmpty(){return-1===this.invokingState}get sourceInterval(){return a.Interval.INVALID}get ruleContext(){return this}get parent(){return this._parent}get payload(){return this}get text(){if(0===this.childCount)return"";let t="";for(let e=0;e<this.childCount;e++)t+=this.getChild(e).text;return t.toString()}get ruleIndex(){return-1}get altNumber(){return i.ATN.INVALID_ALT_NUMBER}set altNumber(t){}getChild(t){throw new RangeError("i must be greater than or equal to 0 and less than childCount")}get childCount(){return 0}accept(t){return t.visitChildren(this)}toStringTree(t){return u.Trees.toStringTree(this,t)}toString(t,e){const r=t instanceof o.Recognizer?t.ruleNames:t;e=e||c.ParserRuleContext.emptyContext();let n="",i=this;for(n+="[";i&&i!==e;){if(r){let t=i.ruleIndex;n+=t>=0&&t<r.length?r[t]:t.toString()}else i.isEmpty||(n+=i.invokingState);!i._parent||!r&&i._parent.isEmpty||(n+=" "),i=i._parent}return(n+="]").toString()}}n([l.Override],h.prototype,"sourceInterval",null),n([l.Override],h.prototype,"ruleContext",null),n([l.Override],h.prototype,"parent",null),n([l.Override],h.prototype,"payload",null),n([l.Override],h.prototype,"text",null),n([l.Override],h.prototype,"getChild",null),n([l.Override],h.prototype,"childCount",null),n([l.Override],h.prototype,"accept",null),n([l.Override],h.prototype,"toStringTree",null),e.RuleContext=h},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=r(35);class s extends o.TerminalNode{constructor(t){super(t)}accept(t){return t.visitErrorNode(this)}}n([i.Override],s.prototype,"accept",null),e.ErrorNode=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(11),o=r(0);class s extends i.ATNState{get stateType(){return 12}}n([o.Override],s.prototype,"stateType",null),e.LoopEndState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(18),s=r(0),a=r(14);let l=class extends a.Transition{constructor(t,e){super(t),this._label=e}get serializationType(){return 5}get label(){return o.IntervalSet.of(this._label)}matches(t,e,r){return this._label===t}toString(){return String(this.label)}};n([s.Override],l.prototype,"serializationType",null),n([s.Override,s.NotNull],l.prototype,"label",null),n([s.Override],l.prototype,"matches",null),n([s.Override,s.NotNull],l.prototype,"toString",null),l=n([i(0,s.NotNull)],l),e.AtomTransition=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0),s=r(14);let a=class extends s.Transition{constructor(t,e,r=-1,n=!1){super(t),this.ruleIndex=e,this.actionIndex=r,this.isCtxDependent=n}get serializationType(){return 6}get isEpsilon(){return!0}matches(t,e,r){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}};n([o.Override],a.prototype,"serializationType",null),n([o.Override],a.prototype,"isEpsilon",null),n([o.Override],a.prototype,"matches",null),n([o.Override],a.prototype,"toString",null),a=n([i(0,o.NotNull)],a),e.ActionTransition=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0);class o{constructor(t){this.readOnly=!1,t?(this.verifyATN=t.verifyATN,this.generateRuleBypassTransitions=t.generateRuleBypassTransitions,this.optimize=t.optimize):(this.verifyATN=!0,this.generateRuleBypassTransitions=!1,this.optimize=!0)}static get defaultOptions(){return null==o._defaultOptions&&(o._defaultOptions=new o,o._defaultOptions.makeReadOnly()),o._defaultOptions}get isReadOnly(){return this.readOnly}makeReadOnly(){this.readOnly=!0}get isVerifyATN(){return this.verifyATN}set isVerifyATN(t){this.throwIfReadOnly(),this.verifyATN=t}get isGenerateRuleBypassTransitions(){return this.generateRuleBypassTransitions}set isGenerateRuleBypassTransitions(t){this.throwIfReadOnly(),this.generateRuleBypassTransitions=t}get isOptimize(){return this.optimize}set isOptimize(t){this.throwIfReadOnly(),this.optimize=t}throwIfReadOnly(){if(this.isReadOnly)throw"The object is read only."}}n([i.NotNull],o,"defaultOptions",null),e.ATNDeserializationOptions=o},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0),s=r(14);let a=class extends s.Transition{constructor(t){super(t)}get serializationType(){return 9}matches(t,e,r){return t>=e&&t<=r}toString(){return"."}};n([o.Override],a.prototype,"serializationType",null),n([o.Override],a.prototype,"matches",null),n([o.Override,o.NotNull],a.prototype,"toString",null),a=n([i(0,o.NotNull)],a),e.WildcardTransition=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(11),o=r(0);class s extends i.ATNState{get stateType(){return 1}}n([o.Override],s.prototype,"stateType",null),e.BasicState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(65),o=r(0);class s extends i.BasicState{get stateType(){return 0}}n([o.Override],s.prototype,"stateType",null),e.InvalidState=s},function(t,e,r){"use strict";class n{syntaxError(t,e,r,n,i,o){console.error(`line ${r}:${n} ${i}`)}}n.INSTANCE=new n,e.ConsoleErrorListener=n},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(12),o=r(44),s=r(0),a=r(4),l=r(24),u=r(15);class c{constructor(t,e,r,n){e instanceof l.Recognizer?(r=e.ruleNames,n=e.atn,e=e.vocabulary):e||(e=u.VocabularyImpl.EMPTY_VOCABULARY),this.dfa=t,this.vocabulary=e,this.ruleNames=r,this.atn=n}toString(){if(!this.dfa.s0)return"";let t="";if(this.dfa.states){let e=new Array(...this.dfa.states.toArray());e.sort((t,e)=>t.stateNumber-e.stateNumber);for(let r of e){let e=r.getEdgeMap(),n=[...e.keys()].sort((t,e)=>t-e),i=r.getContextEdgeMap(),s=[...i.keys()].sort((t,e)=>t-e);for(let i of n){let n=e.get(i);if((null==n||n===o.ATNSimulator.ERROR)&&!r.isContextSymbol(i))continue;let s=!1;t+=this.getStateString(r)+"-"+this.getEdgeLabel(i)+"->",r.isContextSymbol(i)&&(t+="!",s=!0);let a=n;a&&a.stateNumber!==o.ATNSimulator.ERROR.stateNumber?t+=this.getStateString(a)+"\n":s&&(t+="ctx\n")}if(r.isContextSensitive)for(let e of s)t+=this.getStateString(r)+"-"+this.getContextLabel(e)+"->"+this.getStateString(i.get(e))+"\n"}}let e=t;return 0===e.length?"":e}getContextLabel(t){if(t===a.PredictionContext.EMPTY_FULL_STATE_KEY)return"ctx:EMPTY_FULL";if(t===a.PredictionContext.EMPTY_LOCAL_STATE_KEY)return"ctx:EMPTY_LOCAL";if(this.atn&&t>0&&t<=this.atn.states.length){let e=this.atn.states[t].ruleIndex;if(this.ruleNames&&e>=0&&e<this.ruleNames.length)return"ctx:"+String(t)+"("+this.ruleNames[e]+")"}return"ctx:"+String(t)}getEdgeLabel(t){return this.vocabulary.getDisplayName(t)}getStateString(t){if(t===o.ATNSimulator.ERROR)return"ERROR";let e=t.stateNumber,r="s"+e;if(t.isAcceptState&&(r=t.predicates?":s"+e+"=>"+t.predicates:":s"+e+"=>"+t.prediction),t.isContextSensitive){r+="*";for(let e of i.asIterable(t.configs))if(e.reachesIntoOuterContext){r+="*";break}}return r}}n([s.NotNull],c.prototype,"dfa",void 0),n([s.NotNull],c.prototype,"vocabulary",void 0),n([s.Override],c.prototype,"toString",null),e.DFASerializer=c},function(t,e,r){"use strict";e.AcceptStateInfo=class{constructor(t,e){this._prediction=t,this._lexerActionExecutor=e}get prediction(){return this._prediction}get lexerActionExecutor(){return this._lexerActionExecutor}}},function(t,e,r){"use strict";const n=r(50);e.IntegerStack=class extends n.IntegerList{constructor(t){super(t)}push(t){this.add(t)}pop(){return this.removeAt(this.size-1)}peek(){return this.get(this.size-1)}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=r(2),s=r(6);class a{hashCode(t){return null==t?0:"string"==typeof t||"number"==typeof t?o.MurmurHash.hashCode([t]):s.ObjectEqualityComparator.INSTANCE.hashCode(t)}equals(t,e){return null==t?null==e:"string"==typeof t||"number"==typeof t?t===e:s.ObjectEqualityComparator.INSTANCE.equals(t,e)}}a.INSTANCE=new a,n([i.Override],a.prototype,"hashCode",null),n([i.Override],a.prototype,"equals",null),e.DefaultEqualityComparator=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(51),s=r(0),a=r(26);let l=class extends o.AbstractPredicateTransition{constructor(t,e,r,n){super(t),this.ruleIndex=e,this.predIndex=r,this.isCtxDependent=n}get serializationType(){return 4}get isEpsilon(){return!0}matches(t,e,r){return!1}get predicate(){return new a.SemanticContext.Predicate(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}};n([s.Override],l.prototype,"serializationType",null),n([s.Override],l.prototype,"isEpsilon",null),n([s.Override],l.prototype,"matches",null),n([s.Override,s.NotNull],l.prototype,"toString",null),l=n([i(0,s.NotNull)],l),e.PredicateTransition=l},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PRIMITIVE_TYPES=new Set(["bool","int","long","float","double","string","null"])},function(t,e){t.exports=require("util")},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(73);e.resolve=function(t){const e=[],r={},i={};for(const r of t.typeDefs){let t=!1;n.PRIMITIVE_TYPES.has(r.name)&&(e.push(`Cannot redefine known type ${r.name}.`),t=!0),r.name in i&&(e.push(`Type ${r.name} is defined multiple times.`),t=!0),t||(i[r.name]=r.type)}for(const[t,r]of Object.entries(i))o(t,r,e);for(const o of t.endpoints){let t=!1;o.name in r&&(e.push(`Cannot redefine endpoint ${o.name}.`),t=!0),!o.headers||n.PRIMITIVE_TYPES.has(o.headers)||o.headers in i||(e.push(`No such type ${o.headers}.`),t=!0),"void"===o.input||n.PRIMITIVE_TYPES.has(o.input)||o.input in i||(e.push(`No such type ${o.input}.`),t=!0),"void"===o.output||n.PRIMITIVE_TYPES.has(o.output)||o.output in i||(e.push(`No such type ${o.output}.`),t=!0),t||(r[o.name]=o)}return 0===e.length?{kind:"success",definedEndpoints:r,definedTypes:i}:{kind:"failure",errors:e};function o(t,e,r){if("string"==typeof e)n.PRIMITIVE_TYPES.has(e)||e in i||r.push(`Type ${t} refers to unknown type ${e}.`);else if("array"===e.kind)o(t,e.items,r);else if("union"===e.kind)for(const n of e.items)o(t,n,r);else if("struct"===e.kind)for(const[n,i]of Object.entries(e.items))o(`${t}.${n}`,i,r);else if("optional"===e.kind)o(t,e.type,r);else if("symbol"!==e.kind)throw new Error}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const o=r(7),s=r(37),a=r(34),l=r(0),u=r(28),c=r(0),h=r(22),p=r(9),d=r(36),f=r(19),g=r(1),y=r(15),_=i(r(8));class m extends h.Parser{constructor(t){super(t),this._interp=new d.ParserATNSimulator(m._ATN,this)}get vocabulary(){return m.VOCABULARY}get grammarFileName(){return"ApiDef.g4"}get ruleNames(){return m.ruleNames}get serializedATN(){return m._serializedATN}api(){let t,e=new x(this._ctx,this.state);this.enterRule(e,0,m.RULE_api);try{for(this.enterOuterAlt(e,1),this.state=37,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=34,this.match(m.LINEBREAK),this.state=39,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=44,this._errHandler.sync(this),t=this._input.LA(1);0==(-32&t)&&0!=(1<<t&(1<<m.T__0|1<<m.T__3|1<<m.T__11));){switch(this.state=42,this._errHandler.sync(this),this._input.LA(1)){case m.T__0:case m.T__3:this.state=40,this.endpoint();break;case m.T__11:this.state=41,this.typedef();break;default:throw new u.NoViableAltException(this)}this.state=46,this._errHandler.sync(this),t=this._input.LA(1)}this.state=47,this.match(m.EOF)}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}endpoint(){let t,e=new N(this._ctx,this.state);this.enterRule(e,2,m.RULE_endpoint);try{for(this.enterOuterAlt(e,1),this.state=50,this._errHandler.sync(this),(t=this._input.LA(1))===m.T__3&&(this.state=49,this.headers()),this.state=52,this.match(m.T__0),this.state=56,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=53,this.match(m.LINEBREAK),this.state=58,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=59,this.endpointname(),this.state=63,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=60,this.match(m.LINEBREAK),this.state=65,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=66,this.match(m.T__1),this.state=70,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=67,this.match(m.LINEBREAK),this.state=72,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=73,this.method(),this.state=77,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=74,this.match(m.LINEBREAK),this.state=79,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=80,this.route(),this.state=84,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=81,this.match(m.LINEBREAK),this.state=86,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=87,this.typename(),this.state=91,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=88,this.match(m.LINEBREAK),this.state=93,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=94,this.match(m.T__2),this.state=98,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=95,this.match(m.LINEBREAK),this.state=100,this._errHandler.sync(this),t=this._input.LA(1);this.state=101,this.typename(),this.state=102,this.separator()}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}headers(){let t,e=new S(this._ctx,this.state);this.enterRule(e,4,m.RULE_headers);try{for(this.enterOuterAlt(e,1),this.state=104,this.match(m.T__3),this.state=105,this.match(m.T__4),this.state=106,this.typename(),this.state=107,this.match(m.T__5),this.state=111,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=108,this.match(m.LINEBREAK),this.state=113,this._errHandler.sync(this),t=this._input.LA(1)}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}endpointname(){let t=new T(this._ctx,this.state);this.enterRule(t,6,m.RULE_endpointname);try{this.enterOuterAlt(t,1),this.state=114,this.name()}catch(e){if(!(e instanceof f.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}method(){let t,e=new v(this._ctx,this.state);this.enterRule(e,8,m.RULE_method);try{this.enterOuterAlt(e,1),this.state=116,0!=(-32&(t=this._input.LA(1)))||0==(1<<t&(1<<m.T__6|1<<m.T__7|1<<m.T__8|1<<m.T__9))?this._errHandler.recoverInline(this):(this._input.LA(1)===g.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}route(){let t,e=new E(this._ctx,this.state);this.enterRule(e,10,m.RULE_route);try{this.enterOuterAlt(e,1),this.state=120,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=118,this.match(m.T__10),this.state=119,this.subpath(),this.state=122,this._errHandler.sync(this),t=this._input.LA(1)}while(t===m.T__10)}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}subpath(){let t,e=new O(this._ctx,this.state);this.enterRule(e,12,m.RULE_subpath);try{this.enterOuterAlt(e,1),this.state=125,this._errHandler.sync(this),(t=this._input.LA(1))===m.T__1&&(this.state=124,e._dynamic=this.match(m.T__1)),this.state=127,this.name()}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}typedef(){let t,e=new A(this._ctx,this.state);this.enterRule(e,14,m.RULE_typedef);try{for(this.enterOuterAlt(e,1),this.state=129,this.match(m.T__11),this.state=130,this.typename(),this.state=134,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=131,this.match(m.LINEBREAK),this.state=136,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=137,this.match(m.T__12),this.state=141,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=138,this.match(m.LINEBREAK),this.state=143,this._errHandler.sync(this),t=this._input.LA(1);this.state=144,this.type(0),this.state=145,this.separator()}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}type(t){void 0===t&&(t=0);let e,r=this._ctx,n=this.state,i=new C(this._ctx,n);this.enterRecursionRule(i,16,m.RULE_type,t);try{let s;switch(this.enterOuterAlt(i,1),this.state=176,this._errHandler.sync(this),this.interpreter.adaptivePredict(this._input,20,this._ctx)){case 1:for(this.state=148,this.array(),this.state=152,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,16,this._ctx);2!==s&&s!==o.ATN.INVALID_ALT_NUMBER;)1===s&&(this.state=149,this.match(m.LINEBREAK)),this.state=154,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,16,this._ctx);break;case 2:for(this.state=155,this.struct(),this.state=159,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,17,this._ctx);2!==s&&s!==o.ATN.INVALID_ALT_NUMBER;)1===s&&(this.state=156,this.match(m.LINEBREAK)),this.state=161,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,17,this._ctx);break;case 3:for(this.state=162,this.symbol(),this.state=166,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,18,this._ctx);2!==s&&s!==o.ATN.INVALID_ALT_NUMBER;)1===s&&(this.state=163,this.match(m.LINEBREAK)),this.state=168,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,18,this._ctx);break;case 4:for(this.state=169,this.typename(),this.state=173,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,19,this._ctx);2!==s&&s!==o.ATN.INVALID_ALT_NUMBER;)1===s&&(this.state=170,this.match(m.LINEBREAK)),this.state=175,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,19,this._ctx)}for(this._ctx._stop=this._input.tryLT(-1),this.state=189,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,22,this._ctx);2!==s&&s!==o.ATN.INVALID_ALT_NUMBER;){if(1===s){if(null!=this._parseListeners&&this.triggerExitRuleEvent(),i=new C(r,n),this.pushNewRecursionContext(i,16,m.RULE_type),this.state=178,!this.precpred(this._ctx,4))throw new a.FailedPredicateException(this,"this.precpred(this._ctx, 4)");for(this.state=179,this.match(m.T__13),this.state=183,this._errHandler.sync(this),e=this._input.LA(1);e===m.LINEBREAK;)this.state=180,this.match(m.LINEBREAK),this.state=185,this._errHandler.sync(this),e=this._input.LA(1);this.state=186,this.type(5)}this.state=191,this._errHandler.sync(this),s=this.interpreter.adaptivePredict(this._input,22,this._ctx)}}catch(t){if(!(t instanceof f.RecognitionException))throw t;i.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.unrollRecursionContexts(r)}return i}array(){let t=new b(this._ctx,this.state);this.enterRule(t,18,m.RULE_array);try{this.enterOuterAlt(t,1),this.state=192,this.typename(),this.state=193,this.match(m.T__14)}catch(e){if(!(e instanceof f.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}struct(){let t,e=new R(this._ctx,this.state);this.enterRule(e,20,m.RULE_struct);try{for(this.enterOuterAlt(e,1),this.state=195,this.match(m.T__15),this.state=199,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=196,this.match(m.LINEBREAK),this.state=201,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=207,this._errHandler.sync(this),t=this._input.LA(1);0==(-32&t)&&0!=(1<<t&(1<<m.T__0|1<<m.T__11|1<<m.NAME));)this.state=202,this.structfield(),this.state=203,this.separator(),this.state=209,this._errHandler.sync(this),t=this._input.LA(1);this.state=210,this.match(m.T__16)}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}structfield(){let t,e=new I(this._ctx,this.state);this.enterRule(e,22,m.RULE_structfield);try{this.enterOuterAlt(e,1),this.state=212,this.fieldname(),this.state=214,this._errHandler.sync(this),(t=this._input.LA(1))===m.T__17&&(this.state=213,e._optional=this.match(m.T__17)),this.state=216,this.match(m.T__1),this.state=217,this.type(0)}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}fieldname(){let t=new L(this._ctx,this.state);this.enterRule(t,24,m.RULE_fieldname);try{this.enterOuterAlt(t,1),this.state=219,this.name()}catch(e){if(!(e instanceof f.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}typename(){let t=new k(this._ctx,this.state);this.enterRule(t,26,m.RULE_typename);try{this.enterOuterAlt(t,1),this.state=221,this.name()}catch(e){if(!(e instanceof f.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}symbol(){let t=new w(this._ctx,this.state);this.enterRule(t,28,m.RULE_symbol);try{this.enterOuterAlt(t,1),this.state=223,this.match(m.T__18),this.state=224,this.name()}catch(e){if(!(e instanceof f.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}name(){let t,e=new P(this._ctx,this.state);this.enterRule(e,30,m.RULE_name);try{this.enterOuterAlt(e,1),this.state=226,0!=(-32&(t=this._input.LA(1)))||0==(1<<t&(1<<m.T__0|1<<m.T__11|1<<m.NAME))?this._errHandler.recoverInline(this):(this._input.LA(1)===g.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}separator(){let t,e=new D(this._ctx,this.state);this.enterRule(e,32,m.RULE_separator);try{switch(this.state=246,this._errHandler.sync(this),this.interpreter.adaptivePredict(this._input,29,this._ctx)){case 1:for(this.enterOuterAlt(e,1),this.state=231,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=228,this.match(m.LINEBREAK),this.state=233,this._errHandler.sync(this),t=this._input.LA(1);for(this.state=234,this.match(m.T__19),this.state=238,this._errHandler.sync(this),t=this._input.LA(1);t===m.LINEBREAK;)this.state=235,this.match(m.LINEBREAK),this.state=240,this._errHandler.sync(this),t=this._input.LA(1);break;case 2:this.enterOuterAlt(e,2),this.state=242,this._errHandler.sync(this),t=this._input.LA(1);do{this.state=241,this.match(m.LINEBREAK),this.state=244,this._errHandler.sync(this),t=this._input.LA(1)}while(t===m.LINEBREAK)}}catch(t){if(!(t instanceof f.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}sempred(t,e,r){switch(e){case 8:return this.type_sempred(t,r)}return!0}type_sempred(t,e){switch(e){case 0:return this.precpred(this._ctx,4)}return!0}static get _ATN(){return m.__ATN||(m.__ATN=(new s.ATNDeserializer).deserialize(_.toCharArray(m._serializedATN))),m.__ATN}}m.T__0=1,m.T__1=2,m.T__2=3,m.T__3=4,m.T__4=5,m.T__5=6,m.T__6=7,m.T__7=8,m.T__8=9,m.T__9=10,m.T__10=11,m.T__11=12,m.T__12=13,m.T__13=14,m.T__14=15,m.T__15=16,m.T__16=17,m.T__17=18,m.T__18=19,m.T__19=20,m.NAME=21,m.LINEBREAK=22,m.WHITESPACE=23,m.BLOCK_COMMENT=24,m.LINE_COMMENT=25,m.RULE_api=0,m.RULE_endpoint=1,m.RULE_headers=2,m.RULE_endpointname=3,m.RULE_method=4,m.RULE_route=5,m.RULE_subpath=6,m.RULE_typedef=7,m.RULE_type=8,m.RULE_array=9,m.RULE_struct=10,m.RULE_structfield=11,m.RULE_fieldname=12,m.RULE_typename=13,m.RULE_symbol=14,m.RULE_name=15,m.RULE_separator=16,m.ruleNames=["api","endpoint","headers","endpointname","method","route","subpath","typedef","type","array","struct","structfield","fieldname","typename","symbol","name","separator"],m._LITERAL_NAMES=[void 0,"'endpoint'","':'","'->'","'@headers'","'('","')'","'GET'","'POST'","'PUT'","'DELETE'","'/'","'type'","'='","'|'","'[]'","'{'","'}'","'?'","'@'","';'"],m._SYMBOLIC_NAMES=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"NAME","LINEBREAK","WHITESPACE","BLOCK_COMMENT","LINE_COMMENT"],m.VOCABULARY=new y.VocabularyImpl(m._LITERAL_NAMES,m._SYMBOLIC_NAMES,[]),m._serializedATN="꽯茠䞝띜䢀ᘅᤜꬷû\t\t\t\t\t\t\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f\r\t\r\t\t\t\t\t&\n\f)\v-\n\f0\v5\n9\n\f<\v@\n\fC\vG\n\fJ\vN\n\fQ\vU\n\fX\v\\\n\f_\vc\n\ff\vp\n\fs\v{\n\r|\b\b€\n\b\b\b\t\t\t\t‡\n\t\f\t\tŠ\v\t\t\t\tŽ\n\t\f\t\t‘\v\t\t\t\t\n\n\n\n™\n\n\f\n\nœ\v\n\n\n\n \n\n\f\n\n£\v\n\n\n\n§\n\n\f\n\nª\v\n\n\n\n®\n\n\f\n\n±\v\n\n³\n\n\n\n\n\n¸\n\n\f\n\n»\v\n\n\n¾\n\n\f\n\nÁ\v\n\v\v\v\f\f\fÈ\n\f\f\f\fË\v\f\f\f\f\fÐ\n\f\f\f\fÓ\v\f\f\f\r\r\rÙ\n\r\r\r\rè\n\fë\vï\n\fò\võ\n\röù\n\b\n\f \"\t\fĉ'4j\bt\nv\fzƒ²ÂÅÖÝßá ä\"ø$&%$&)'%'((.)'*-+-\t,*,+-0.,.//10.122354345566:79879<:8:;;=<:=A\b>@?>@CA?ABBDCADHEGFEGJHFHIIKJHKO\nLNMLNQOMOPPRQORV\fSUTSUXVTVWWYXVY]Z\\[Z\\_][]^^`_]`dacbacfdbdeegfdghhi\"ijkkllmmq\bnponpsqoqrrsqtu u\tvw\tw\vxy\ry{\bzx{||z|}}\r~€~€€‚ ‚ƒ„„ˆ…‡†…‡Šˆ†ˆ‰‰‹Šˆ‹ŒŽŒŽ‘’‘’“\n“”\"”•–\b\n–š\v—™˜—™œš˜š››³œš¡\fž Ÿž £¡Ÿ¡¢¢³£¡¤¨¥§¦¥§ª¨¦¨©©³ª¨«¯¬®­¬®±¯­¯°°³±¯²•²²¤²«³¿´µ\fµ¹¶¸·¶¸»¹·¹ºº¼»¹¼¾\n½´¾Á¿½¿ÀÀÁ¿ÂÃÃÄÄÅÉÆÈÇÆÈËÉÇÉÊÊÑËÉÌÍ\rÍÎ\"ÎÐÏÌÐÓÑÏÑÒÒÔÓÑÔÕÕÖØ×ÙØ×ØÙÙÚÚÛÛÜ\nÜÝÞ Þßà àáââã ãäå\tå!æèçæèëéçéêêìëéìðíïîíïòðîðññùòðóõôóõööôö÷÷ùøéøôù# ',.4:AHOV]dq|ˆš¡¨¯²¹¿ÉÑØéðöø",n([c.Override,l.NotNull],m.prototype,"vocabulary",null),n([c.Override],m.prototype,"grammarFileName",null),n([c.Override],m.prototype,"ruleNames",null),n([c.Override],m.prototype,"serializedATN",null),e.ApiDefParser=m;class x extends p.ParserRuleContext{constructor(t,e){super(t,e)}EOF(){return this.getToken(m.EOF,0)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}endpoint(t){return void 0===t?this.getRuleContexts(N):this.getRuleContext(t,N)}typedef(t){return void 0===t?this.getRuleContexts(A):this.getRuleContext(t,A)}get ruleIndex(){return m.RULE_api}}n([c.Override],x.prototype,"ruleIndex",null),e.ApiContext=x;class N extends p.ParserRuleContext{constructor(t,e){super(t,e)}endpointname(){return this.getRuleContext(0,T)}method(){return this.getRuleContext(0,v)}route(){return this.getRuleContext(0,E)}typename(t){return void 0===t?this.getRuleContexts(k):this.getRuleContext(t,k)}separator(){return this.getRuleContext(0,D)}headers(){return this.tryGetRuleContext(0,S)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}get ruleIndex(){return m.RULE_endpoint}}n([c.Override],N.prototype,"ruleIndex",null),e.EndpointContext=N;class S extends p.ParserRuleContext{constructor(t,e){super(t,e)}typename(){return this.getRuleContext(0,k)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}get ruleIndex(){return m.RULE_headers}}n([c.Override],S.prototype,"ruleIndex",null),e.HeadersContext=S;class T extends p.ParserRuleContext{constructor(t,e){super(t,e)}name(){return this.getRuleContext(0,P)}get ruleIndex(){return m.RULE_endpointname}}n([c.Override],T.prototype,"ruleIndex",null),e.EndpointnameContext=T;class v extends p.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return m.RULE_method}}n([c.Override],v.prototype,"ruleIndex",null),e.MethodContext=v;class E extends p.ParserRuleContext{constructor(t,e){super(t,e)}subpath(t){return void 0===t?this.getRuleContexts(O):this.getRuleContext(t,O)}get ruleIndex(){return m.RULE_route}}n([c.Override],E.prototype,"ruleIndex",null),e.RouteContext=E;class O extends p.ParserRuleContext{constructor(t,e){super(t,e)}name(){return this.getRuleContext(0,P)}get ruleIndex(){return m.RULE_subpath}}n([c.Override],O.prototype,"ruleIndex",null),e.SubpathContext=O;class A extends p.ParserRuleContext{constructor(t,e){super(t,e)}typename(){return this.getRuleContext(0,k)}type(){return this.getRuleContext(0,C)}separator(){return this.getRuleContext(0,D)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}get ruleIndex(){return m.RULE_typedef}}n([c.Override],A.prototype,"ruleIndex",null),e.TypedefContext=A;class C extends p.ParserRuleContext{constructor(t,e){super(t,e)}array(){return this.tryGetRuleContext(0,b)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}type(t){return void 0===t?this.getRuleContexts(C):this.getRuleContext(t,C)}struct(){return this.tryGetRuleContext(0,R)}symbol(){return this.tryGetRuleContext(0,w)}typename(){return this.tryGetRuleContext(0,k)}get ruleIndex(){return m.RULE_type}}n([c.Override],C.prototype,"ruleIndex",null),e.TypeContext=C;class b extends p.ParserRuleContext{constructor(t,e){super(t,e)}typename(){return this.getRuleContext(0,k)}get ruleIndex(){return m.RULE_array}}n([c.Override],b.prototype,"ruleIndex",null),e.ArrayContext=b;class R extends p.ParserRuleContext{constructor(t,e){super(t,e)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}structfield(t){return void 0===t?this.getRuleContexts(I):this.getRuleContext(t,I)}separator(t){return void 0===t?this.getRuleContexts(D):this.getRuleContext(t,D)}get ruleIndex(){return m.RULE_struct}}n([c.Override],R.prototype,"ruleIndex",null),e.StructContext=R;class I extends p.ParserRuleContext{constructor(t,e){super(t,e)}fieldname(){return this.getRuleContext(0,L)}type(){return this.getRuleContext(0,C)}get ruleIndex(){return m.RULE_structfield}}n([c.Override],I.prototype,"ruleIndex",null),e.StructfieldContext=I;class L extends p.ParserRuleContext{constructor(t,e){super(t,e)}name(){return this.getRuleContext(0,P)}get ruleIndex(){return m.RULE_fieldname}}n([c.Override],L.prototype,"ruleIndex",null),e.FieldnameContext=L;class k extends p.ParserRuleContext{constructor(t,e){super(t,e)}name(){return this.getRuleContext(0,P)}get ruleIndex(){return m.RULE_typename}}n([c.Override],k.prototype,"ruleIndex",null),e.TypenameContext=k;class w extends p.ParserRuleContext{constructor(t,e){super(t,e)}name(){return this.getRuleContext(0,P)}get ruleIndex(){return m.RULE_symbol}}n([c.Override],w.prototype,"ruleIndex",null),e.SymbolContext=w;class P extends p.ParserRuleContext{constructor(t,e){super(t,e)}NAME(){return this.getToken(m.NAME,0)}get ruleIndex(){return m.RULE_name}}n([c.Override],P.prototype,"ruleIndex",null),e.NameContext=P;class D extends p.ParserRuleContext{constructor(t,e){super(t,e)}LINEBREAK(t){return void 0===t?this.getTokens(m.LINEBREAK):this.getToken(m.LINEBREAK,t)}get ruleIndex(){return m.RULE_separator}}n([c.Override],D.prototype,"ruleIndex",null),e.SeparatorContext=D},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const o=r(37),s=r(17),a=r(47),l=r(0),u=r(0),c=r(15),h=i(r(8));class p extends s.Lexer{constructor(t){super(t),this._interp=new a.LexerATNSimulator(p._ATN,this)}get vocabulary(){return p.VOCABULARY}get grammarFileName(){return"ApiDef.g4"}get ruleNames(){return p.ruleNames}get serializedATN(){return p._serializedATN}get modeNames(){return p.modeNames}static get _ATN(){return p.__ATN||(p.__ATN=(new o.ATNDeserializer).deserialize(h.toCharArray(p._serializedATN))),p.__ATN}}p.T__0=1,p.T__1=2,p.T__2=3,p.T__3=4,p.T__4=5,p.T__5=6,p.T__6=7,p.T__7=8,p.T__8=9,p.T__9=10,p.T__10=11,p.T__11=12,p.T__12=13,p.T__13=14,p.T__14=15,p.T__15=16,p.T__16=17,p.T__17=18,p.T__18=19,p.T__19=20,p.NAME=21,p.LINEBREAK=22,p.WHITESPACE=23,p.BLOCK_COMMENT=24,p.LINE_COMMENT=25,p.modeNames=["DEFAULT_MODE"],p.ruleNames=["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","NAME","LINEBREAK","WHITESPACE","BLOCK_COMMENT","LINE_COMMENT"],p._LITERAL_NAMES=[void 0,"'endpoint'","':'","'->'","'@headers'","'('","')'","'GET'","'POST'","'PUT'","'DELETE'","'/'","'type'","'='","'|'","'[]'","'{'","'}'","'?'","'@'","';'"],p._SYMBOLIC_NAMES=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"NAME","LINEBREAK","WHITESPACE","BLOCK_COMMENT","LINE_COMMENT"],p.VOCABULARY=new c.VocabularyImpl(p._LITERAL_NAMES,p._SYMBOLIC_NAMES,[]),p._serializedATN="꽯茠䞝띜䢀ᘅᤜꬷ¥\b\t\t\t\t\t\t\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f\r\t\r\t\t\t\t\t\t\t\t\t\t\t\t\t\b\b\b\b\t\t\t\t\t\n\n\n\n\v\v\v\v\v\v\v\f\f\r\r\r\r\r\n\f‚\v‡\n\rˆ‘\n\f”\vŸ\n\f¢\v’\t\v\r\b\t\n\v\f\r!#%')+-/13C\\c|2;C\\c|\f\f\v\v\"\"¨\t\v\r!#%')+-/135>@\tC\vL\rNPTY]dfkmo!r#t%v'x)z+|-ƒ/†1Œ3š56g67p78f89r9:q:;k;<p<=v=>?<?@A/AB@B\bCDBDEjEFgFGcGHfHIgIJtJKuK\nLM*M\fNO+OPQIQRGRSVSTURUVQVWUWXVXYZRZ[W[\\V\\]^F^_G_`N`aGabVbcGcde1efgvgh{hirijgjkl?lmn~nop]pq_q rs}s\"tuu$vwAw&xyBy(z{={*|€\t}\t~}‚€~€,‚€ƒ„\t„.…‡\t†…‡ˆˆ†ˆ‰‰ŠŠ‹\b‹0Œ1Ž,Ž’‘\v‘”’“’“•”’•–,–—1—˜˜™\b™2š›1›œ1œ Ÿ\nžŸ¢ ž ¡¡£¢ £¤\b¤4€ˆ’ \b",n([u.Override,l.NotNull],p.prototype,"vocabulary",null),n([u.Override],p.prototype,"grammarFileName",null),n([u.Override],p.prototype,"ruleNames",null),n([u.Override],p.prototype,"serializedATN",null),n([u.Override],p.prototype,"modeNames",null),e.ApiDefLexer=p},function(t,e,r){"use strict";e.RuleVersion=function(t){return function(t,e,r){}}},function(t,e,r){"use strict";e.RuleDependency=function(t){return function(t,e,r){}}},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(7),o=r(0),s=r(9);class a extends s.ParserRuleContext{constructor(t,e){void 0!==e?super(t,e):super(),this._altNumber=i.ATN.INVALID_ALT_NUMBER}get altNumber(){return this._altNumber}set altNumber(t){this._altNumber=t}}n([o.Override],a.prototype,"altNumber",null),e.RuleContextWithAltNum=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(11),s=r(10),a=r(34),l=r(32),u=r(53),c=r(60),h=r(0),p=r(0),d=r(22),f=r(36),g=r(19),y=r(42),_=r(1);let m=class t extends d.Parser{constructor(e,r,n,i,o){if(super(e instanceof t?e.inputStream:o),this._parentContextStack=[],this.overrideDecision=-1,this.overrideDecisionInputIndex=-1,this.overrideDecisionAlt=-1,this.overrideDecisionReached=!1,this._overrideDecisionRoot=void 0,e instanceof t){let t=e;this._grammarFileName=t._grammarFileName,this._atn=t._atn,this.pushRecursionContextStates=t.pushRecursionContextStates,this._ruleNames=t._ruleNames,this._vocabulary=t._vocabulary,this.interpreter=new f.ParserATNSimulator(this._atn,this)}else{r=r,n=n,i=i,this._grammarFileName=e,this._atn=i,this._ruleNames=n.slice(0),this._vocabulary=r,this.pushRecursionContextStates=new s.BitSet(i.states.length);for(let t of i.states)t instanceof y.StarLoopEntryState&&t.precedenceRuleDecision&&this.pushRecursionContextStates.set(t.stateNumber);this.interpreter=new f.ParserATNSimulator(i,this)}}reset(t){void 0===t?super.reset():super.reset(t),this.overrideDecisionReached=!1,this._overrideDecisionRoot=void 0}get atn(){return this._atn}get vocabulary(){return this._vocabulary}get ruleNames(){return this._ruleNames}get grammarFileName(){return this._grammarFileName}parse(t){let e=this._atn.ruleToStartState[t];for(this._rootContext=this.createInterpreterRuleContext(void 0,o.ATNState.INVALID_STATE_NUMBER,t),e.isPrecedenceRule?this.enterRecursionRule(this._rootContext,e.stateNumber,t,0):this.enterRule(this._rootContext,e.stateNumber,t);;){let t=this.atnState;switch(t.stateType){case 7:if(this._ctx.isEmpty){if(e.isPrecedenceRule){let t=this._ctx,e=this._parentContextStack.pop();return this.unrollRecursionContexts(e[0]),t}return this.exitRule(),this._rootContext}this.visitRuleStopState(t);break;default:try{this.visitState(t)}catch(e){if(!(e instanceof g.RecognitionException))throw e;this.state=this._atn.ruleToStopState[t.ruleIndex].stateNumber,this.context.exception=e,this.errorHandler.reportError(this,e),this.recover(e)}}}}enterRecursionRule(t,e,r,n){this._parentContextStack.push([this._ctx,t.invokingState]),super.enterRecursionRule(t,e,r,n)}get atnState(){return this._atn.states[this.state]}visitState(t){let e=1;t.numberOfTransitions>1&&(e=this.visitDecisionState(t));let r=t.transition(e-1);switch(r.serializationType){case 1:if(this.pushRecursionContextStates.get(t.stateNumber)&&!(r.target instanceof c.LoopEndState)){let e=this._parentContextStack[this._parentContextStack.length-1],r=this.createInterpreterRuleContext(e[0],e[1],this._ctx.ruleIndex);this.pushNewRecursionContext(r,this._atn.ruleToStartState[t.ruleIndex].stateNumber,this._ctx.ruleIndex)}break;case 5:this.match(r._label);break;case 2:case 7:case 8:r.matches(this._input.LA(1),_.Token.MIN_USER_TOKEN_TYPE,65535)||this.recoverInline(),this.matchWildcard();break;case 9:this.matchWildcard();break;case 3:let e=r.target,n=e.ruleIndex,i=this.createInterpreterRuleContext(this._ctx,t.stateNumber,n);e.isPrecedenceRule?this.enterRecursionRule(i,e.stateNumber,n,r.precedence):this.enterRule(i,r.target.stateNumber,n);break;case 4:let o=r;if(!this.sempred(this._ctx,o.ruleIndex,o.predIndex))throw new a.FailedPredicateException(this);break;case 6:let s=r;this.action(this._ctx,s.ruleIndex,s.actionIndex);break;case 10:if(!this.precpred(this._ctx,r.precedence)){let t=r.precedence;throw new a.FailedPredicateException(this,`precpred(_ctx, ${t})`)}break;default:throw new Error("UnsupportedOperationException: Unrecognized ATN transition type.")}this.state=r.target.stateNumber}visitDecisionState(t){let e;this.errorHandler.sync(this);let r=t.decision;return r!==this.overrideDecision||this._input.index!==this.overrideDecisionInputIndex||this.overrideDecisionReached?e=this.interpreter.adaptivePredict(this._input,r,this._ctx):(e=this.overrideDecisionAlt,this.overrideDecisionReached=!0),e}createInterpreterRuleContext(t,e,r){return new u.InterpreterRuleContext(r,t,e)}visitRuleStopState(t){if(this._atn.ruleToStartState[t.ruleIndex].isPrecedenceRule){let t=this._parentContextStack.pop();this.unrollRecursionContexts(t[0]),this.state=t[1]}else this.exitRule();let e=this._atn.states[this.state].transition(0);this.state=e.followState.stateNumber}addDecisionOverride(t,e,r){this.overrideDecision=t,this.overrideDecisionInputIndex=e,this.overrideDecisionAlt=r}get overrideDecisionRoot(){return this._overrideDecisionRoot}recover(t){let e=this._input.index;if(this.errorHandler.recover(this,t),this._input.index===e){let e=t.getOffendingToken();if(!e)throw new Error("Expected exception to have an offending token");let r=e.tokenSource,n={source:r,stream:void 0!==r?r.inputStream:void 0};if(t instanceof l.InputMismatchException){let r=t.expectedTokens;if(void 0===r)throw new Error("Expected the exception to provide expected tokens");let i=r.minElement,o=this.tokenFactory.create(n,i,e.text,_.Token.DEFAULT_CHANNEL,-1,-1,e.line,e.charPositionInLine);this._ctx.addErrorNode(o)}else{e.tokenSource;let t=this.tokenFactory.create(n,_.Token.INVALID_TYPE,e.text,_.Token.DEFAULT_CHANNEL,-1,-1,e.line,e.charPositionInLine);this._ctx.addErrorNode(t)}}}recoverInline(){return this._errHandler.recoverInline(this)}get rootContext(){return this._rootContext}};n([h.NotNull],m.prototype,"_vocabulary",void 0),n([p.Override],m.prototype,"reset",null),n([p.Override],m.prototype,"atn",null),n([p.Override],m.prototype,"vocabulary",null),n([p.Override],m.prototype,"ruleNames",null),n([p.Override],m.prototype,"grammarFileName",null),n([p.Override],m.prototype,"enterRecursionRule",null),m=n([i(1,h.NotNull)],m),e.ParserInterpreter=m},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(48),s=r(0),a=r(1);let l=class{constructor(t,e){if(this.i=0,this._factory=o.CommonTokenFactory.DEFAULT,null==t)throw new Error("tokens cannot be null");this.tokens=t,this._sourceName=e}get charPositionInLine(){if(this.i<this.tokens.length)return this.tokens[this.i].charPositionInLine;if(null!=this.eofToken)return this.eofToken.charPositionInLine;if(this.tokens.length>0){let t=this.tokens[this.tokens.length-1],e=t.text;if(null!=e){let t=e.lastIndexOf("\n");if(t>=0)return e.length-t-1}return t.charPositionInLine+t.stopIndex-t.startIndex+1}return 0}nextToken(){if(this.i>=this.tokens.length){if(null==this.eofToken){let t=-1;if(this.tokens.length>0){let e=this.tokens[this.tokens.length-1].stopIndex;-1!==e&&(t=e+1)}let e=Math.max(-1,t-1);this.eofToken=this._factory.create({source:this,stream:this.inputStream},a.Token.EOF,"EOF",a.Token.DEFAULT_CHANNEL,t,e,this.line,this.charPositionInLine)}return this.eofToken}let t=this.tokens[this.i];return this.i===this.tokens.length-1&&t.type===a.Token.EOF&&(this.eofToken=t),this.i++,t}get line(){if(this.i<this.tokens.length)return this.tokens[this.i].line;if(null!=this.eofToken)return this.eofToken.line;if(this.tokens.length>0){let t=this.tokens[this.tokens.length-1],e=t.line,r=t.text;if(null!=r)for(let t=0;t<r.length;t++)"\n"==r.charAt(t)&&e++;return e}return 1}get inputStream(){return this.i<this.tokens.length?this.tokens[this.i].inputStream:null!=this.eofToken?this.eofToken.inputStream:this.tokens.length>0?this.tokens[this.tokens.length-1].inputStream:void 0}get sourceName(){if(this._sourceName)return this._sourceName;let t=this.inputStream;return null!=t?t.sourceName:"List"}set tokenFactory(t){this._factory=t}get tokenFactory(){return this._factory}};n([s.Override],l.prototype,"charPositionInLine",null),n([s.Override],l.prototype,"nextToken",null),n([s.Override],l.prototype,"line",null),n([s.Override],l.prototype,"inputStream",null),n([s.Override],l.prototype,"sourceName",null),n([s.Override,s.NotNull,i(0,s.NotNull)],l.prototype,"tokenFactory",null),l=n([i(0,s.NotNull)],l),e.ListTokenSource=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(17),s=r(47),a=r(0),l=r(0);let u=class extends o.Lexer{constructor(t,e,r,n,i,o){if(super(o),0!=i.grammarType)throw new Error("IllegalArgumentException: The ATN must be a lexer ATN.");this._grammarFileName=t,this._atn=i,this._ruleNames=n.slice(0),this._modeNames=r.slice(0),this._vocabulary=e,this._interp=new s.LexerATNSimulator(i,this)}get atn(){return this._atn}get grammarFileName(){return this._grammarFileName}get ruleNames(){return this._ruleNames}get modeNames(){return this._modeNames}get vocabulary(){return this._vocabulary}};n([a.NotNull],u.prototype,"_vocabulary",void 0),n([l.Override],u.prototype,"atn",null),n([l.Override],u.prototype,"grammarFileName",null),n([l.Override],u.prototype,"ruleNames",null),n([l.Override],u.prototype,"modeNames",null),n([l.Override],u.prototype,"vocabulary",null),u=n([i(1,a.NotNull)],u),e.LexerInterpreter=u},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(55),s=r(10),a=r(0),l=r(3),u=r(12);class c extends o.BaseErrorListener{constructor(t=!0){super(),this.exactOnly=t,this.exactOnly=t}reportAmbiguity(t,e,r,n,i,o,s){if(this.exactOnly&&!i)return;let a=`reportAmbiguity d=${this.getDecisionDescription(t,e)}: ambigAlts=${this.getConflictingAlts(o,s)}, input='${t.inputStream.getText(l.Interval.of(r,n))}'`;t.notifyErrorListeners(a)}reportAttemptingFullContext(t,e,r,n,i,o){let s=`reportAttemptingFullContext d=${this.getDecisionDescription(t,e)}, input='${t.inputStream.getText(l.Interval.of(r,n))}'`;t.notifyErrorListeners(s)}reportContextSensitivity(t,e,r,n,i,o){let s=`reportContextSensitivity d=${this.getDecisionDescription(t,e)}, input='${t.inputStream.getText(l.Interval.of(r,n))}'`;t.notifyErrorListeners(s)}getDecisionDescription(t,e){let r=e.decision,n=e.atnStartState.ruleIndex,i=t.ruleNames;if(n<0||n>=i.length)return r.toString();let o=i[n];return o?`${r} (${o})`:r.toString()}getConflictingAlts(t,e){if(null!=t)return t;let r=new s.BitSet;for(let t of u.asIterable(e))r.set(t.alt);return r}}n([a.Override,i(0,a.NotNull),i(1,a.NotNull),i(6,a.NotNull)],c.prototype,"reportAmbiguity",null),n([a.Override,i(0,a.NotNull),i(1,a.NotNull),i(5,a.NotNull)],c.prototype,"reportAttemptingFullContext",null),n([a.Override,i(0,a.NotNull),i(1,a.NotNull),i(5,a.NotNull)],c.prototype,"reportContextSensitivity",null),n([i(0,a.NotNull),i(1,a.NotNull)],c.prototype,"getDecisionDescription",null),n([a.NotNull,i(1,a.NotNull)],c.prototype,"getConflictingAlts",null),e.DiagnosticErrorListener=c},function(t,e,r){"use strict";!function(t){t[t.SELF=0]="SELF",t[t.PARENTS=1]="PARENTS",t[t.CHILDREN=2]="CHILDREN",t[t.ANCESTORS=3]="ANCESTORS",t[t.DESCENDANTS=4]="DESCENDANTS",t[t.SIBLINGS=5]="SIBLINGS",t[t.PRECEEDING_SIBLINGS=6]="PRECEEDING_SIBLINGS",t[t.FOLLOWING_SIBLINGS=7]="FOLLOWING_SIBLINGS",t[t.PRECEEDING=8]="PRECEEDING",t[t.FOLLOWING=9]="FOLLOWING"}(e.Dependents||(e.Dependents={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(54),s=r(0),a=r(1);let l=class extends o.BufferedTokenStream{constructor(t,e=a.Token.DEFAULT_CHANNEL){super(t),this.channel=e}adjustSeekIndex(t){return this.nextTokenOnChannel(t,this.channel)}tryLB(t){if(this.p-t<0)return;let e=this.p,r=1;for(;r<=t&&e>0;)e=this.previousTokenOnChannel(e-1,this.channel),r++;return e<0?void 0:this.tokens[e]}tryLT(t){if(this.lazyInit(),0===t)throw new RangeError("0 is not a valid lookahead index");if(t<0)return this.tryLB(-t);let e=this.p,r=1;for(;r<t;)this.sync(e+1)&&(e=this.nextTokenOnChannel(e+1,this.channel)),r++;return this.tokens[e]}getNumberOfOnChannelTokens(){let t=0;this.fill();for(let e=0;e<this.tokens.length;e++){let r=this.tokens[e];if(r.channel===this.channel&&t++,r.type===a.Token.EOF)break}return t}};n([s.Override],l.prototype,"adjustSeekIndex",null),n([s.Override],l.prototype,"tryLB",null),n([s.Override],l.prototype,"tryLT",null),l=n([i(0,s.NotNull)],l),e.CommonTokenStream=l},function(t,e,r){"use strict";e.ParseCancellationException=class extends Error{constructor(t){super(t.message),this.cause=t,this.stack=t.stack}getCause(){return this.cause}}},function(t,e,r){"use strict";const n=r(2);class i{constructor(t,e,r,n){this.data=new Uint32Array(4),this.data[0]=t,this.data[1]=e,this.data[2]=r,this.data[3]=n}static fromString(t){if(!/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/.test(t))throw new Error("Incorrectly formatted UUID");let e=t.split("-"),r=parseInt(e[0],16),n=(parseInt(e[1],16)<<16>>>0)+parseInt(e[2],16),o=(parseInt(e[3],16)<<16>>>0)+parseInt(e[4].substr(0,4),16),s=parseInt(e[4].substr(-8),16);return new i(r,n,o,s)}hashCode(){return n.MurmurHash.hashCode([this.data[0],this.data[1],this.data[2],this.data[3]])}equals(t){return t===this||t instanceof i&&this.data[0]===t.data[0]&&this.data[1]===t.data[1]&&this.data[2]===t.data[2]&&this.data[3]===t.data[3]}toString(){return("00000000"+this.data[0].toString(16)).substr(-8)+"-"+("0000"+(this.data[1]>>>16).toString(16)).substr(-4)+"-"+("0000"+this.data[1].toString(16)).substr(-4)+"-"+("0000"+(this.data[2]>>>16).toString(16)).substr(-4)+"-"+("0000"+this.data[2].toString(16)).substr(-4)+("00000000"+this.data[3].toString(16)).substr(-8)}}e.UUID=i},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(16),o=r(0);class s extends i.DecisionState{get stateType(){return 6}}n([o.Override],s.prototype,"stateType",null),e.TokensStartState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(11),o=r(0);class s extends i.ATNState{get loopEntryState(){return this.transition(0).target}get stateType(){return 9}}n([o.Override],s.prototype,"stateType",null),e.StarLoopbackState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(27),o=r(0);class s extends i.BlockStartState{get stateType(){return 5}}n([o.Override],s.prototype,"stateType",null),e.StarBlockStartState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(11),o=r(0);class s extends i.ATNState{constructor(){super(...arguments),this.isPrecedenceRule=!1,this.leftFactored=!1}get stateType(){return 2}}n([o.Override],s.prototype,"stateType",null),e.RuleStartState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(18),s=r(0),a=r(14);let l=class extends a.Transition{constructor(t,e,r){super(t),this.from=e,this.to=r}get serializationType(){return 2}get label(){return o.IntervalSet.of(this.from,this.to)}matches(t,e,r){return t>=this.from&&t<=this.to}toString(){return"'"+String.fromCharCode(this.from)+"'..'"+String.fromCharCode(this.to)+"'"}};n([s.Override],l.prototype,"serializationType",null),n([s.Override,s.NotNull],l.prototype,"label",null),n([s.Override],l.prototype,"matches",null),n([s.Override,s.NotNull],l.prototype,"toString",null),l=n([i(0,s.NotNull)],l),e.RangeTransition=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(51),s=r(0),a=r(26);let l=class extends o.AbstractPredicateTransition{constructor(t,e){super(t),this.precedence=e}get serializationType(){return 10}get isEpsilon(){return!0}matches(t,e,r){return!1}get predicate(){return new a.SemanticContext.PrecedencePredicate(this.precedence)}toString(){return this.precedence+" >= _p"}};n([s.Override],l.prototype,"serializationType",null),n([s.Override],l.prototype,"isEpsilon",null),n([s.Override],l.prototype,"matches",null),n([s.Override],l.prototype,"toString",null),l=n([i(0,s.NotNull)],l),e.PrecedencePredicateTransition=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(16),o=r(0);class s extends i.DecisionState{get stateType(){return 11}}n([o.Override],s.prototype,"stateType",null),e.PlusLoopbackState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(27),o=r(0);class s extends i.BlockStartState{get stateType(){return 4}}n([o.Override],s.prototype,"stateType",null),e.PlusBlockStartState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0),s=r(9);let a=class{constructor(t,e,r,n){this.outerContext=null!=t?t:s.ParserRuleContext.emptyContext(),this.s0=e,this.useContext=r,this.remainingOuterContext=n}};a=n([i(1,o.NotNull)],a),e.SimulatorState=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};r(20);const i=r(12),o=r(2),s=r(0),a=r(23);!function(t){t[t.SLL=0]="SLL",t[t.LL=1]="LL",t[t.LL_EXACT_AMBIG_DETECTION=2]="LL_EXACT_AMBIG_DETECTION"}(e.PredictionMode||(e.PredictionMode={})),function(t){class e{AltAndContextConfigEqualityComparator(){}hashCode(t){let e=o.MurmurHash.initialize(7);return e=o.MurmurHash.update(e,t.state.stateNumber),e=o.MurmurHash.update(e,t.context),o.MurmurHash.finish(e,2)}equals(t,e){return t===e||null!=t&&null!=e&&t.state.stateNumber==e.state.stateNumber&&t.context.equals(e.context)}}e.INSTANCE=new e,n([s.Override],e.prototype,"hashCode",null),n([s.Override],e.prototype,"equals",null),t.hasConfigInRuleStopState=function(t){for(let e of i.asIterable(t))if(e.state instanceof a.RuleStopState)return!0;return!1},t.allConfigsInRuleStopStates=function(t){for(let e of i.asIterable(t))if(!(e.state instanceof a.RuleStopState))return!1;return!0}}(e.PredictionMode||(e.PredictionMode={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(7),s=r(31),a=r(59),l=r(0),u=r(22),c=r(9),h=r(57),p=r(35),d=r(1),f=r(8);class g{static toStringTree(t,e){let r;r=e instanceof u.Parser?e.ruleNames:e;let n=f.escapeWhitespace(this.getNodeText(t,r),!1);if(0==t.childCount)return n;let i="";i+="(",i+=n=f.escapeWhitespace(this.getNodeText(t,r),!1),i+=" ";for(let e=0;e<t.childCount;e++)e>0&&(i+=" "),i+=this.toStringTree(t.getChild(e),r);return i+")"}static getNodeText(t,e){let r;if(e instanceof u.Parser)r=e.ruleNames;else{if(!e){let e=t.payload;return"string"==typeof e.text?e.text:t.payload.toString()}r=e}if(t instanceof h.RuleNode){let e=t.ruleContext,n=r[e.ruleIndex],i=e.altNumber;return i!==o.ATN.INVALID_ALT_NUMBER?n+":"+i:n}if(t instanceof a.ErrorNode)return t.toString();if(t instanceof p.TerminalNode)return t.symbol.text||"";throw new TypeError("Unexpected node type")}static getChildren(t){let e=[];for(let r=0;r<t.childCount;r++)e.push(t.getChild(r));return e}static getAncestors(t){let e=[],r=t.parent;for(;r;)e.unshift(r),r=r.parent;return e}static isAncestorOf(t,e){if(!t||!e||!t.parent)return!1;let r=e.parent;for(;r;){if(t===r)return!0;r=r.parent}return!1}static findAllTokenNodes(t,e){return g.findAllNodes(t,e,!0)}static findAllRuleNodes(t,e){return g.findAllNodes(t,e,!1)}static findAllNodes(t,e,r){let n=[];return g._findAllNodes(t,e,r,n),n}static _findAllNodes(t,e,r,n){r&&t instanceof p.TerminalNode?t.symbol.type===e&&n.push(t):!r&&t instanceof c.ParserRuleContext&&t.ruleIndex===e&&n.push(t);for(let i=0;i<t.childCount;i++)g._findAllNodes(t.getChild(i),e,r,n)}static getDescendants(t){let e=[];return function t(r){e.push(r);const n=r.childCount;for(let e=0;e<n;e++)t(r.getChild(e))}(t),e}static getRootOfSubtreeEnclosingRegion(t,e,r){let n=t.childCount;for(let i=0;i<n;i++){let n=t.getChild(i),o=g.getRootOfSubtreeEnclosingRegion(n,e,r);if(o)return o}if(t instanceof c.ParserRuleContext){let n=t.stop;if(e>=t.start.tokenIndex&&(null==n||r<=n.tokenIndex))return t}}static stripChildrenOutOfRange(t,e,r,n){if(!t)return;let i=t.childCount;for(let o=0;o<i;o++){let i=t.getChild(o),a=i.sourceInterval;if(i instanceof c.ParserRuleContext&&(a.b<r||a.a>n)&&g.isAncestorOf(i,e)){let e=new s.CommonToken(d.Token.INVALID_TYPE,"...");t.children[o]=new p.TerminalNode(e)}}}}n([i(0,l.NotNull)],g,"toStringTree",null),n([l.NotNull,i(0,l.NotNull)],g,"getAncestors",null),n([i(0,l.NotNull)],g,"getRootOfSubtreeEnclosingRegion",null),e.Trees=g},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(0),o=r(8);class s{constructor(t,e){this._conflictedAlts=t,this.exact=e}get conflictedAlts(){return this._conflictedAlts}get isExact(){return this.exact}equals(t){return t===this||t instanceof s&&this.isExact===t.isExact&&o.equals(this.conflictedAlts,t.conflictedAlts)}hashCode(){return this.conflictedAlts.hashCode()}}n([i.Override],s.prototype,"equals",null),n([i.Override],s.prototype,"hashCode",null),e.ConflictInfo=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(t){this._type=t}get type(){return this._type}get actionType(){return 7}get isPositionDependent(){return!1}execute(t){t.type=this._type}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),t=o.MurmurHash.update(t,this._type),o.MurmurHash.finish(t,2)}equals(t){return t===this||t instanceof a&&this._type===t._type}toString(){return`type(${this._type})`}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerTypeAction=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(){}get actionType(){return 6}get isPositionDependent(){return!1}execute(t){t.skip()}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),o.MurmurHash.finish(t,1)}equals(t){return t===this}toString(){return"skip"}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerSkipAction=a,function(t){t.INSTANCE=new t}(a=e.LexerSkipAction||(e.LexerSkipAction={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(t){this._mode=t}get mode(){return this._mode}get actionType(){return 5}get isPositionDependent(){return!1}execute(t){t.pushMode(this._mode)}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),t=o.MurmurHash.update(t,this._mode),o.MurmurHash.finish(t,2)}equals(t){return t===this||t instanceof a&&this._mode===t._mode}toString(){return`pushMode(${this._mode})`}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerPushModeAction=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(){}get actionType(){return 4}get isPositionDependent(){return!1}execute(t){t.popMode()}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),o.MurmurHash.finish(t,1)}equals(t){return t===this}toString(){return"popMode"}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerPopModeAction=a,function(t){t.INSTANCE=new t}(a=e.LexerPopModeAction||(e.LexerPopModeAction={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(){}get actionType(){return 3}get isPositionDependent(){return!1}execute(t){t.more()}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),o.MurmurHash.finish(t,1)}equals(t){return t===this}toString(){return"more"}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerMoreAction=a,function(t){t.INSTANCE=new t}(a=e.LexerMoreAction||(e.LexerMoreAction={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(t){this._mode=t}get mode(){return this._mode}get actionType(){return 2}get isPositionDependent(){return!1}execute(t){t.mode(this._mode)}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),t=o.MurmurHash.update(t,this._mode),o.MurmurHash.finish(t,2)}equals(t){return t===this||t instanceof a&&this._mode===t._mode}toString(){return`mode(${this._mode})`}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerModeAction=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(t,e){this._ruleIndex=t,this._actionIndex=e}get ruleIndex(){return this._ruleIndex}get actionIndex(){return this._actionIndex}get actionType(){return 1}get isPositionDependent(){return!0}execute(t){t.action(void 0,this._ruleIndex,this._actionIndex)}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),t=o.MurmurHash.update(t,this._ruleIndex),t=o.MurmurHash.update(t,this._actionIndex),o.MurmurHash.finish(t,3)}equals(t){return t===this||t instanceof a&&this._ruleIndex===t._ruleIndex&&this._actionIndex===t._actionIndex}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),e.LexerCustomAction=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);class a{constructor(t){this._channel=t}get channel(){return this._channel}get actionType(){return 0}get isPositionDependent(){return!1}execute(t){t.channel=this._channel}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this.actionType),t=o.MurmurHash.update(t,this._channel),o.MurmurHash.finish(t,2)}equals(t){return t===this||t instanceof a&&this._channel===t._channel}toString(){return`channel(${this._channel})`}}n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override,i(0,s.NotNull)],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),n([s.Override],a.prototype,"toString",null),e.LexerChannelAction=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(0),s=r(14);let a=class extends s.Transition{constructor(t,e=-1){super(t),this._outermostPrecedenceReturn=e}get outermostPrecedenceReturn(){return this._outermostPrecedenceReturn}get serializationType(){return 1}get isEpsilon(){return!0}matches(t,e,r){return!1}toString(){return"epsilon"}};n([o.Override],a.prototype,"serializationType",null),n([o.Override],a.prototype,"isEpsilon",null),n([o.Override],a.prototype,"matches",null),n([o.Override,o.NotNull],a.prototype,"toString",null),a=n([i(0,o.NotNull)],a),e.EpsilonTransition=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(11),o=r(0);class s extends i.ATNState{get stateType(){return 8}}n([o.Override],s.prototype,"stateType",null),e.BlockEndState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(27),o=r(0);class s extends i.BlockStartState{get stateType(){return 3}}n([o.Override],s.prototype,"stateType",null),e.BasicBlockStartState=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(25),o=r(0);class s extends i.ATNConfigSet{constructor(t,e){null!=t&&null!=e?super(t,e):super()}clone(t){let e=new s(this,t);return!t&&this.isReadOnly&&e.addAll(this),e}getKey(t){return{state:0,alt:t.hashCode()}}canMerge(t,e,r){return t.equals(r)}}n([o.Override],s.prototype,"clone",null),n([o.Override],s.prototype,"getKey",null),n([o.Override],s.prototype,"canMerge",null),e.OrderedATNConfigSet=s},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(2),s=r(0);let a=class t{constructor(t,e){this._offset=t,this._action=e}get offset(){return this._offset}get action(){return this._action}get actionType(){return this._action.actionType}get isPositionDependent(){return!0}execute(t){this._action.execute(t)}hashCode(){let t=o.MurmurHash.initialize();return t=o.MurmurHash.update(t,this._offset),t=o.MurmurHash.update(t,this._action),o.MurmurHash.finish(t,2)}equals(e){return e===this||e instanceof t&&this._offset===e._offset&&this._action.equals(e._action)}};n([s.NotNull],a.prototype,"action",null),n([s.Override],a.prototype,"actionType",null),n([s.Override],a.prototype,"isPositionDependent",null),n([s.Override],a.prototype,"execute",null),n([s.Override],a.prototype,"hashCode",null),n([s.Override],a.prototype,"equals",null),a=n([i(1,s.NotNull)],a),e.LexerIndexedCustomAction=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(33),s=r(114),a=r(2),l=r(0);let u=class t{constructor(t){this._lexerActions=t;let e=a.MurmurHash.initialize();for(let r of t)e=a.MurmurHash.update(e,r);this.cachedHashCode=a.MurmurHash.finish(e,t.length)}static append(e,r){if(!e)return new t([r]);let n=e._lexerActions.slice(0);return n.push(r),new t(n)}fixOffsetBeforeMatch(e){let r;for(let t=0;t<this._lexerActions.length;t++)!this._lexerActions[t].isPositionDependent||this._lexerActions[t]instanceof s.LexerIndexedCustomAction||(r||(r=this._lexerActions.slice(0)),r[t]=new s.LexerIndexedCustomAction(e,this._lexerActions[t]));return r?new t(r):this}get lexerActions(){return this._lexerActions}execute(t,e,r){let n=!1,i=e.index;try{for(let o of this._lexerActions){if(o instanceof s.LexerIndexedCustomAction){let t=o.offset;e.seek(r+t),o=o.action,n=r+t!==i}else o.isPositionDependent&&(e.seek(i),n=!1);o.execute(t)}}finally{n&&e.seek(i)}}hashCode(){return this.cachedHashCode}equals(e){return e===this||e instanceof t&&this.cachedHashCode===e.cachedHashCode&&o.ArrayEqualityComparator.INSTANCE.equals(this._lexerActions,e._lexerActions)}};n([l.NotNull],u.prototype,"_lexerActions",void 0),n([l.NotNull],u.prototype,"lexerActions",null),n([i(0,l.NotNull)],u.prototype,"execute",null),n([l.Override],u.prototype,"hashCode",null),n([l.Override],u.prototype,"equals",null),n([l.NotNull,i(1,l.NotNull)],u,"append",null),u=n([i(0,l.NotNull)],u),e.LexerActionExecutor=u},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(51),s=r(13),a=r(30),l=r(10),u=r(18),c=r(0),h=r(41),p=r(6),d=r(4),f=r(23),g=r(39),y=r(1),_=r(64);let m=class t{constructor(t){this.atn=t}getDecisionLookahead(e){if(null==e)return;let r=new Array(e.numberOfTransitions);for(let n=0;n<e.numberOfTransitions;n++){let i=new u.IntervalSet;r[n]=i;let o=new s.Array2DHashSet(p.ObjectEqualityComparator.INSTANCE),a=!1;this._LOOK(e.transition(n).target,void 0,d.PredictionContext.EMPTY_LOCAL,i,o,new l.BitSet,a,!1),(0===i.size||i.contains(t.HIT_PRED))&&(i=void 0,r[n]=i)}return r}LOOK(t,e,r){if(void 0===r){if(null==t.atn)throw new Error("Illegal state");r=t.atn.ruleToStopState[t.ruleIndex]}else null===r&&(r=void 0);let n=new u.IntervalSet;return this._LOOK(t,r,e,n,new s.Array2DHashSet,new l.BitSet,!0,!0),n}_LOOK(e,r,n,i,s,l,c,p){let m=a.ATNConfig.create(e,0,n);if(!s.add(m))return;if(e===r){if(d.PredictionContext.isEmptyLocal(n))return void i.add(y.Token.EPSILON);if(n.isEmpty)return void(p&&i.add(y.Token.EOF))}if(e instanceof f.RuleStopState){if(n.isEmpty&&!d.PredictionContext.isEmptyLocal(n))return void(p&&i.add(y.Token.EOF));let t=l.get(e.ruleIndex);try{l.clear(e.ruleIndex);for(let t=0;t<n.size;t++){if(n.getReturnState(t)===d.PredictionContext.EMPTY_FULL_STATE_KEY)continue;let e=this.atn.states[n.getReturnState(t)];this._LOOK(e,r,n.getParent(t),i,s,l,c,p)}}finally{t&&l.set(e.ruleIndex)}}let x=e.numberOfTransitions;for(let a=0;a<x;a++){let d=e.transition(a);if(d instanceof g.RuleTransition){if(l.get(d.ruleIndex))continue;let t=n.getChild(d.followState.stateNumber);try{l.set(d.ruleIndex),this._LOOK(d.target,r,t,i,s,l,c,p)}finally{l.clear(d.ruleIndex)}}else if(d instanceof o.AbstractPredicateTransition)c?this._LOOK(d.target,r,n,i,s,l,c,p):i.add(t.HIT_PRED);else if(d.isEpsilon)this._LOOK(d.target,r,n,i,s,l,c,p);else if(d instanceof _.WildcardTransition)i.addAll(u.IntervalSet.of(y.Token.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType));else{let t=d.label;null!=t&&(d instanceof h.NotSetTransition&&(t=t.complement(u.IntervalSet.of(y.Token.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType))),i.addAll(t))}}}};m.HIT_PRED=y.Token.INVALID_TYPE,n([c.NotNull],m.prototype,"atn",void 0),n([c.NotNull,i(0,c.NotNull),i(1,c.NotNull)],m.prototype,"LOOK",null),n([i(0,c.NotNull),i(2,c.NotNull),i(3,c.NotNull),i(4,c.NotNull),i(5,c.NotNull)],m.prototype,"_LOOK",null),m=n([i(0,c.NotNull)],m),e.LL1Analyzer=m},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};const o=r(68),s=r(0),a=r(15);let l=class extends o.DFASerializer{constructor(t){super(t,a.VocabularyImpl.EMPTY_VOCABULARY)}getEdgeLabel(t){return"'"+String.fromCharCode(t)+"'"}};n([s.Override,s.NotNull],l.prototype,"getEdgeLabel",null),l=n([i(0,s.NotNull)],l),e.LexerDFASerializer=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(52),o=r(32),s=r(0),a=r(88);class l extends i.DefaultErrorStrategy{recover(t,e){for(let r=t.context;r;r=r.parent)r.exception=e;throw new a.ParseCancellationException(e)}recoverInline(t){let e=new o.InputMismatchException(t);for(let r=t.context;r;r=r.parent)r.exception=e;throw new a.ParseCancellationException(e)}sync(t){}}n([s.Override],l.prototype,"recover",null),n([s.Override],l.prototype,"recoverInline",null),n([s.Override],l.prototype,"sync",null),e.BailErrorStrategy=l},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var i,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,r,s):i(e,r))||s);return o>3&&s&&Object.defineProperty(e,r,s),s};const i=r(5),o=r(0),s=r(21);class a{constructor(t){this.p=0,this.data=t,this.n=t.length}reset(){this.p=0}consume(){if(this.p>=this.n)throw i(this.LA(1)===s.IntStream.EOF),new Error("cannot consume EOF");this.p<this.n&&this.p++}LA(t){return 0===t?0:t<0&&(t++,this.p+t-1<0)?s.IntStream.EOF:this.p+t-1>=this.n?s.IntStream.EOF:this.data.charCodeAt(this.p+t-1)}LT(t){return this.LA(t)}get index(){return this.p}get size(){return this.n}mark(){return-1}release(t){}seek(t){if(t<=this.p)this.p=t;else for(t=Math.min(t,this.n);this.p<t;)this.consume()}getText(t){let e=t.a,r=t.b;r>=this.n&&(r=this.n-1);let n=r-e+1;return e>=this.n?"":this.data.substr(e,n)}get sourceName(){return this.name?this.name:s.IntStream.UNKNOWN_SOURCE_NAME}toString(){return this.data}}n([o.Override],a.prototype,"consume",null),n([o.Override],a.prototype,"LA",null),n([o.Override],a.prototype,"index",null),n([o.Override],a.prototype,"size",null),n([o.Override],a.prototype,"mark",null),n([o.Override],a.prototype,"release",null),n([o.Override],a.prototype,"seek",null),n([o.Override],a.prototype,"getText",null),n([o.Override],a.prototype,"sourceName",null),n([o.Override],a.prototype,"toString",null),e.ANTLRInputStream=a},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}n(r(119)),n(r(118)),n(r(55)),n(r(54)),n(r(31)),n(r(48)),n(r(87)),n(r(67)),n(r(52)),n(r(86)),n(r(85)),n(r(34)),n(r(32)),n(r(53)),n(r(21)),n(r(17)),n(r(84)),n(r(38)),n(r(83)),n(r(28)),n(r(22)),n(r(82)),n(r(9)),n(r(43)),n(r(56)),n(r(19)),n(r(24)),n(r(58)),n(r(81)),n(r(80)),n(r(79)),n(r(1)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(120),i=r(78),o=r(77);function s(t){return{name:t.endpointname().text,method:(n=t.method(),n.text),route:(r=t.route(),r.subpath().map(a)),headers:(e=t.headers(),e?h(e.typename()):void 0),input:h(t.typename()[0]),output:h(t.typename()[1])};var e,r,n}function a(t){return{name:t.name().text,dynamic:!!t._dynamic}}function l(t){return{name:t.typename().text,type:u(t.type())}}function u(t){if(t.array())return{kind:"array",items:h(t.array().typename())};if(t.type().length)return{kind:"union",items:(e=t.type().map(u),e.map(t=>"string"!=typeof t&&"union"===t.kind?t.items:[t]).reduce((t,e)=>t.concat(e),[]))};if(t.struct())return{kind:"struct",items:t.struct().structfield().map(c).reduce((t,[e,r])=>Object.assign({},t,{[e]:r}),{})};if(t.symbol())return{kind:"symbol",value:t.symbol().name().text};if(t.typename())return h(t.typename());throw new Error;var e}function c(t){const e=t.fieldname().text;let r=u(t.type());return t._optional&&(r={kind:"optional",type:r}),[e,r]}function h(t){return t.text}e.parse=function(t){const e=new n.ANTLRInputStream(t),r=new i.ApiDefLexer(e),a=new n.CommonTokenStream(r),u=new o.ApiDefParser(a);let c=null;r.removeErrorListeners(),r.addErrorListener({syntaxError:(t,e,r,n,i,o)=>{c||(c={line:r,charPositionInLine:n,message:i})}}),u.removeErrorListeners(),u.addErrorListener({syntaxError:(t,e,r,n,i,o)=>{c||(c={line:r,charPositionInLine:n,message:i})}});const h=u.api();if(c)throw new Error(`Syntax error (${c.line}:${c.charPositionInLine}): ${c.message}.`);return{endpoints:h.endpoint().map(s),typeDefs:h.typedef().map(l)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{constructor(){this._parts=[],this._indentLevel=0}append(...t){let e=0;for(let r of t)e+=r.length;if(0!==e){if("\n"===this._getLastCharacter())for(let t=0;t<this._indentLevel;t++)this._parts.push(" ");for(let e of t)0!==e.length&&this._parts.push(e)}}indented(t){this._indentLevel++,this._addLinebreakIfNotBeginning();try{t()}finally{this._indentLevel--;let t=this._getLastCharacter();t.length&&"\n"!==t&&this._addLinebreakIfNotBeginning()}}linebreak(){this._parts.push("\n")}build(){return this._parts.join("")}_addLinebreakIfNotBeginning(){let t=this._getLastCharacter();t.length&&"\n"!==t&&this.linebreak()}_getLastCharacter(){if(0===this._parts.length)return"";let t=this._parts[this._parts.length-1];return t[t.length-1]}}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const i=n(r(122)),o=r(73);e.generateTypeScript=function(t,e,r={}){const n=new i.default;let s=!0;if(r.endpoints&&"client"===r.endpoints.kind){if(r.endpoints.baseUrl.endsWith("/"))throw new Error("Base URL should not end with /.");n.append('import axios from "axios";\n\n'),n.append(`const URL = "${r.endpoints.baseUrl}";\n\n`);for(const e of Object.values(t))a(e),n.append("\n\n")}if(r.endpoints&&"server"===r.endpoints.kind){n.append('import express from "express";\n');for(const e of Object.values(t))n.append(`import { ${e.name} } from './endpoints/${e.name}';\n`);n.append("\n"),n.append("const PORT = 3010;\n\n"),n.append("const app = express();\n\n");for(const e of Object.values(t))l(e),n.append("\n\n");n.append("// tslint:disable-next-line no-console\n"),n.append("app.listen(PORT, () => console.log(`Listening on port ${PORT}`));\n\n")}for(const[t,r]of Object.entries(e))s||n.append("\n"),u(r,t),s=!1;return n.build();function a(t){const e=[];t.headers&&e.push(`headers: ${t.headers}`);for(const r of t.route)r.dynamic&&e.push(`${r.name}: string`);"void"!==t.input&&e.push(`request: ${t.input}`),n.append(`export async function ${t.name}(${e.join(", ")}): Promise<${t.output}> {`),n.indented(()=>{n.append("const url = `${URL}");for(const e of t.route)e.dynamic?n.append(`/\${${e.name}}`):n.append(`/${e.name}`);n.append("`;\n"),"void"!==t.output&&n.append("const response = "),n.append("await axios({"),n.indented(()=>{n.append("url,\n"),n.append(`method: "${t.method}",\n`),"void"!==t.input&&n.append("data: request,\n"),t.headers&&n.append("headers,\n")}),n.append("});\n"),"void"!==t.output&&n.append("return response.data;\n")}),n.append("}")}function l(t){const r=t.route.map(t=>t.dynamic?":"+t.name:t.name).join("/");n.append(`app.${t.method.toLowerCase()}("/${r}", async (req, res, next) => {`),n.indented(()=>{n.append("try {"),n.indented(()=>{const r=[];t.headers&&(r.push("headers"),n.append(`const headers: ${t.headers} = {`),n.indented(()=>{const r=e[t.headers];if("string"==typeof r||"struct"!==r.kind)throw new Error(`Headers type ${t.headers} must be a struct.`);for(const[t,e]of Object.entries(r.items)){if("string"!==e)throw new Error(`Header ${t} must be a string.`);n.append(`${t}: req.header("${t}") || "",\n`)}}),n.append("};\n"));for(const e of t.route)e.dynamic&&(n.append(`const ${e.name} = req.params["${e.name}"];\n`),r.push(e.name));"void"!==t.input&&(r.push("request"),n.append(`const request: ${t.input} = req.body;\n`)),"void"!==t.output&&n.append(`const response: ${t.output} = `),n.append(`await ${t.name}(${r.join(", ")});\n`),"void"!==t.output?n.append("res.json(response);\n"):n.append("res.end();\n")}),n.append("} catch (err) {"),n.indented(()=>{n.append("next(err);")}),n.append("}")}),n.append("});")}function u(t,e){if("string"==typeof t)e&&n.append(`export type ${e} = `),o.PRIMITIVE_TYPES.has(t)?n.append(function(t){if("bool"===t)return"boolean";if("int"===t)return"number";if("long"===t)return"number";if("float"===t)return"number";if("double"===t)return"number";if("string"===t)return"string";if("null"===t)return"null";throw new Error(`Unknown primary type: ${t}.`)}(t)):n.append(t),e&&n.append(";\n");else if("array"===t.kind)e&&n.append(`export type ${e} = `),u(t.items),n.append("[]"),e&&n.append(";\n");else if("union"===t.kind){e&&n.append(`export type ${e} = `);let r=!0;for(const e of t.items)r||n.append(" | "),u(e),r=!1;e&&n.append(";\n")}else if("struct"===t.kind)e&&n.append(`export interface ${e} `),n.append("{"),n.indented(()=>{for(const[e,r]of Object.entries(t.items))"string"!=typeof r&&"optional"===r.kind?(n.append(e,"?: "),u(r.type)):(n.append(e,": "),u(r)),n.append(";\n")}),n.append("}"),e&&n.append("\n");else{if("symbol"!==t.kind)throw new Error;e&&n.append(`export type ${e} = `),n.append(`'${t.value}'`),e&&n.append(";\n")}}}},function(t,e){t.exports=require("path")},function(t,e){t.exports=require("child_process")},function(t,e){t.exports=require("events")},function(t,e,r){var n=r(126).EventEmitter,i=r(125).spawn,o=r(124),s=o.dirname,a=o.basename,l=r(75);function u(t,e){this.flags=t,this.required=~t.indexOf("<"),this.optional=~t.indexOf("["),this.bool=!~t.indexOf("-no-"),(t=t.split(/[ ,|]+/)).length>1&&!/^[[<]/.test(t[1])&&(this.short=t.shift()),this.long=t.shift(),this.description=e||""}function c(t){this.commands=[],this.options=[],this._execs={},this._allowUnknownOption=!1,this._args=[],this._name=t||""}function h(t,e){var r=Math.max(0,e-t.length);return t+Array(r+1).join(" ")}function p(t,e){e=e||[];for(var r=0;r<e.length;r++)"--help"!==e[r]&&"-h"!==e[r]||(t.outputHelp(),process.exit(0))}function d(t){var e=t.name+(!0===t.variadic?"...":"");return t.required?"<"+e+">":"["+e+"]"}function f(t){try{if(l.statSync(t).isFile())return!0}catch(t){return!1}}r(74).inherits(c,n),(e=t.exports=new c).Command=c,e.Option=u,u.prototype.name=function(){return this.long.replace("--","").replace("no-","")},u.prototype.attributeName=function(){return this.name().split("-").reduce(function(t,e){return t+e[0].toUpperCase()+e.slice(1)})},u.prototype.is=function(t){return this.short===t||this.long===t},c.prototype.command=function(t,e,r){"object"==typeof e&&null!==e&&(r=e,e=null),r=r||{};var n=t.split(/ +/),i=new c(n.shift());return e&&(i.description(e),this.executables=!0,this._execs[i._name]=!0,r.isDefault&&(this.defaultExecutable=i._name)),i._noHelp=!!r.noHelp,this.commands.push(i),i.parseExpectedArgs(n),i.parent=this,e?this:i},c.prototype.arguments=function(t){return this.parseExpectedArgs(t.split(/ +/))},c.prototype.addImplicitHelpCommand=function(){this.command("help [cmd]","display help for [cmd]")},c.prototype.parseExpectedArgs=function(t){if(t.length){var e=this;return t.forEach(function(t){var r={required:!1,name:"",variadic:!1};switch(t[0]){case"<":r.required=!0,r.name=t.slice(1,-1);break;case"[":r.name=t.slice(1,-1)}r.name.length>3&&"..."===r.name.slice(-3)&&(r.variadic=!0,r.name=r.name.slice(0,-3)),r.name&&e._args.push(r)}),this}},c.prototype.action=function(t){var e=this,r=function(r,n){r=r||[],n=n||[];var i=e.parseOptions(n);p(e,i.unknown),i.unknown.length>0&&e.unknownOption(i.unknown[0]),i.args.length&&(r=i.args.concat(r)),e._args.forEach(function(t,n){t.required&&null==r[n]?e.missingArgument(t.name):t.variadic&&(n!==e._args.length-1&&e.variadicArgNotLast(t.name),r[n]=r.splice(n))}),e._args.length?r[e._args.length]=e:r.push(e),t.apply(e,r)},n=this.parent||this,i=n===this?"*":this._name;return n.on("command:"+i,r),this._alias&&n.on("command:"+this._alias,r),this},c.prototype.option=function(t,e,r,n){var i=this,o=new u(t,e),s=o.name(),a=o.attributeName();if("function"!=typeof r)if(r instanceof RegExp){var l=r;r=function(t,e){var r=l.exec(t);return r?r[0]:e}}else n=r,r=null;return(!o.bool||o.optional||o.required)&&(o.bool||(n=!0),void 0!==n&&(i[a]=n,o.defaultValue=n)),this.options.push(o),this.on("option:"+s,function(t){null!==t&&r&&(t=r(t,void 0===i[a]?n:i[a])),"boolean"==typeof i[a]||void 0===i[a]?i[a]=null==t?!!o.bool&&(n||!0):t:null!==t&&(i[a]=t)}),this},c.prototype.allowUnknownOption=function(t){return this._allowUnknownOption=0===arguments.length||t,this},c.prototype.parse=function(t){this.executables&&this.addImplicitHelpCommand(),this.rawArgs=t,this._name=this._name||a(t[1],".js"),this.executables&&t.length<3&&!this.defaultExecutable&&t.push("--help");var e=this.parseOptions(this.normalize(t.slice(2))),r=this.args=e.args,n=this.parseArgs(this.args,e.unknown),i=n.args[0],o=null;return i&&(o=this.commands.filter(function(t){return t.alias()===i})[0]),this._execs[i]&&"function"!=typeof this._execs[i]?this.executeSubCommand(t,r,e.unknown):o?(r[0]=o._name,this.executeSubCommand(t,r,e.unknown)):this.defaultExecutable?(r.unshift(this.defaultExecutable),this.executeSubCommand(t,r,e.unknown)):n},c.prototype.executeSubCommand=function(t,e,r){(e=e.concat(r)).length||this.help(),"help"===e[0]&&1===e.length&&this.help(),"help"===e[0]&&(e[0]=e[1],e[1]="--help");var n,u=t[1],c=a(u,".js")+"-"+e[0],h=l.lstatSync(u).isSymbolicLink()?l.readlinkSync(u):u;h!==u&&"/"!==h.charAt(0)&&(h=o.join(s(u),h)),n=s(h);var p,d=o.join(n,c),g=!1;f(d+".js")?(c=d+".js",g=!0):f(d)&&(c=d),e=e.slice(1),"win32"!==process.platform?g?(e.unshift(c),e=(process.execArgv||[]).concat(e),p=i(process.argv[0],e,{stdio:"inherit",customFds:[0,1,2]})):p=i(c,e,{stdio:"inherit",customFds:[0,1,2]}):(e.unshift(c),p=i(process.execPath,e,{stdio:"inherit"})),["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(function(t){process.on(t,function(){!1===p.killed&&null===p.exitCode&&p.kill(t)})}),p.on("close",process.exit.bind(process)),p.on("error",function(t){"ENOENT"===t.code?console.error("\n %s(1) does not exist, try --help\n",c):"EACCES"===t.code&&console.error("\n %s(1) not executable. try chmod or run with root\n",c),process.exit(1)}),this.runningCommand=p},c.prototype.normalize=function(t){for(var e,r,n,i=[],o=0,s=t.length;o<s;++o){if(e=t[o],o>0&&(r=this.optionFor(t[o-1])),"--"===e){i=i.concat(t.slice(o));break}r&&r.required?i.push(e):e.length>1&&"-"===e[0]&&"-"!==e[1]?e.slice(1).split("").forEach(function(t){i.push("-"+t)}):/^--/.test(e)&&~(n=e.indexOf("="))?i.push(e.slice(0,n),e.slice(n+1)):i.push(e)}return i},c.prototype.parseArgs=function(t,e){var r;return t.length?(r=t[0],this.listeners("command:"+r).length?this.emit("command:"+t.shift(),t,e):this.emit("command:*",t)):(p(this,e),e.length>0&&this.unknownOption(e[0])),this},c.prototype.optionFor=function(t){for(var e=0,r=this.options.length;e<r;++e)if(this.options[e].is(t))return this.options[e]},c.prototype.parseOptions=function(t){for(var e,r,n,i=[],o=t.length,s=[],a=0;a<o;++a)if(n=t[a],e)i.push(n);else if("--"!==n)if(r=this.optionFor(n))if(r.required){if(null==(n=t[++a]))return this.optionMissingArgument(r);this.emit("option:"+r.name(),n)}else r.optional?(null==(n=t[a+1])||"-"===n[0]&&"-"!==n?n=null:++a,this.emit("option:"+r.name(),n)):this.emit("option:"+r.name());else n.length>1&&"-"===n[0]?(s.push(n),a+1<t.length&&"-"!==t[a+1][0]&&s.push(t[++a])):i.push(n);else e=!0;return{args:i,unknown:s}},c.prototype.opts=function(){for(var t={},e=this.options.length,r=0;r<e;r++){var n=this.options[r].attributeName();t[n]=n===this._versionOptionName?this._version:this[n]}return t},c.prototype.missingArgument=function(t){console.error(),console.error(" error: missing required argument `%s'",t),console.error(),process.exit(1)},c.prototype.optionMissingArgument=function(t,e){console.error(),e?console.error(" error: option `%s' argument missing, got `%s'",t.flags,e):console.error(" error: option `%s' argument missing",t.flags),console.error(),process.exit(1)},c.prototype.unknownOption=function(t){this._allowUnknownOption||(console.error(),console.error(" error: unknown option `%s'",t),console.error(),process.exit(1))},c.prototype.variadicArgNotLast=function(t){console.error(),console.error(" error: variadic arguments must be last `%s'",t),console.error(),process.exit(1)},c.prototype.version=function(t,e){if(0===arguments.length)return this._version;this._version=t;var r=new u(e=e||"-V, --version","output the version number");return this._versionOptionName=r.long.substr(2)||"version",this.options.push(r),this.on("option:"+this._versionOptionName,function(){process.stdout.write(t+"\n"),process.exit(0)}),this},c.prototype.description=function(t,e){return 0===arguments.length?this._description:(this._description=t,this._argsDescription=e,this)},c.prototype.alias=function(t){var e=this;if(0!==this.commands.length&&(e=this.commands[this.commands.length-1]),0===arguments.length)return e._alias;if(t===e._name)throw new Error("Command alias can't be the same as its name");return e._alias=t,this},c.prototype.usage=function(t){var e=this._args.map(function(t){return d(t)}),r="[options]"+(this.commands.length?" [command]":"")+(this._args.length?" "+e.join(" "):"");return 0===arguments.length?this._usage||r:(this._usage=t,this)},c.prototype.name=function(t){return 0===arguments.length?this._name:(this._name=t,this)},c.prototype.prepareCommands=function(){return this.commands.filter(function(t){return!t._noHelp}).map(function(t){var e=t._args.map(function(t){return d(t)}).join(" ");return[t._name+(t._alias?"|"+t._alias:"")+(t.options.length?" [options]":"")+(e?" "+e:""),t._description]})},c.prototype.largestCommandLength=function(){return this.prepareCommands().reduce(function(t,e){return Math.max(t,e[0].length)},0)},c.prototype.largestOptionLength=function(){var t=[].slice.call(this.options);return t.push({flags:"-h, --help"}),t.reduce(function(t,e){return Math.max(t,e.flags.length)},0)},c.prototype.largestArgLength=function(){return this._args.reduce(function(t,e){return Math.max(t,e.name.length)},0)},c.prototype.padWidth=function(){var t=this.largestOptionLength();return this._argsDescription&&this._args.length&&this.largestArgLength()>t&&(t=this.largestArgLength()),this.commands&&this.commands.length&&this.largestCommandLength()>t&&(t=this.largestCommandLength()),t},c.prototype.optionHelp=function(){var t=this.padWidth();return this.options.map(function(e){return h(e.flags,t)+" "+e.description+(e.bool&&void 0!==e.defaultValue?" (default: "+e.defaultValue+")":"")}).concat([h("-h, --help",t)+" output usage information"]).join("\n")},c.prototype.commandHelp=function(){if(!this.commands.length)return"";var t=this.prepareCommands(),e=this.padWidth();return[" Commands:","",t.map(function(t){var r=t[1]?" "+t[1]:"";return(r?h(t[0],e):t[0])+r}).join("\n").replace(/^/gm," "),""].join("\n")},c.prototype.helpInformation=function(){var t=[];if(this._description){t=[" "+this._description,""];var e=this._argsDescription;if(e&&this._args.length){var r=this.padWidth();t.push(" Arguments:"),t.push(""),this._args.forEach(function(n){t.push(" "+h(n.name,r)+" "+e[n.name])}),t.push("")}}var n=this._name;this._alias&&(n=n+"|"+this._alias);var i=[""," Usage: "+n+" "+this.usage(),""],o=[],s=this.commandHelp();s&&(o=[s]);var a=[" Options:","",""+this.optionHelp().replace(/^/gm," "),""];return i.concat(t).concat(a).concat(o).join("\n")},c.prototype.outputHelp=function(t){t||(t=function(t){return t}),process.stdout.write(t(this.helpInformation())),this.emit("--help")},c.prototype.help=function(t){this.outputHelp(t),process.exit()}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";(function(t){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});const o=n(r(127)),s=i(r(75)),a=r(123),l=r(121),u=r(76);function c(t){o.default.command("generate <target> <source>").option("-c, --client <base-url>").option("-s, --server").action((e,r,n)=>{try{if(!s.existsSync(r))return void t.error(`No such file: ${r}.`);const i=s.readFileSync(r,"utf8"),o=l.parse(i);switch(e){case"typescript":const r=u.resolve(o);if("failure"===r.kind){t.error(r.errors.join("\n"));break}const i={};n.client?i.endpoints={kind:"client",baseUrl:n.client}:n.server&&(i.endpoints={kind:"server"});const s=a.generateTypeScript(r.definedEndpoints,r.definedTypes,i);t.info(s);break;default:t.error(`Unknown target: ${e}.`)}}catch(e){t.error(e)}}),o.default.command("*").action(e=>{t.error(`Unknown command: ${e}.`)}),o.default.parse(t.argv)}e.cli=c,r.c[r.s]===t&&c({argv:process.argv,info:console.log,warn:console.warn,error:(t,e)=>{e?console.error(t,e):console.error(t),process.exitCode=1}})}).call(this,r(128)(t))}]);
4//# sourceMappingURL=cli.bundle.js.map
\No newline at end of file