@guihz/trading-vue-editor-tes 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,8 @@ var Ug=Object.defineProperty;var Vg=(lo,li,Tr)=>li in lo?Ug(lo,li,{enumerable:!0
7
7
  `,d)),d.context===null||d.context.hasEmptyPath()){if(d.context===null||d.context.isEmpty())return i.add(d),!0;i.add(new xi({state:d.state,context:it.EMPTY},d)),s=!0}if(d.context!==null&&!d.context.isEmpty()){for(var k=0;k<d.context.length;k++)if(d.context.getReturnState(k)!==it.EMPTY_RETURN_STATE){var ee=d.context.getParent(k),Ce=this.atn.states[d.context.getReturnState(k)];E=new xi({state:Ce,context:ee},d),s=this.closure(c,E,i,s,v,S)}}return s}d.state.epsilonOnlyTransitions||s&&d.passedThroughNonGreedyDecision||i.add(d);for(var xe=0;xe<d.state.transitions.length;xe++){var Ge=d.state.transitions[xe];(E=this.getEpsilonTarget(c,d,Ge,i,v,S))!==null&&(s=this.closure(c,E,i,s,v,S))}return s}},{key:"getEpsilonTarget",value:function(c,d,i,s,v,S){var E=null;if(i.serializationType===pe.RULE){var k=ct.create(d.context,i.followState.stateNumber);E=new xi({state:i.target,context:k},d)}else{if(i.serializationType===pe.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(i.serializationType===pe.PREDICATE)f.debug&&console.log("EVAL rule "+i.ruleIndex+":"+i.predIndex),s.hasSemanticContext=!0,this.evaluatePredicate(c,i.ruleIndex,i.predIndex,v)&&(E=new xi({state:i.target},d));else if(i.serializationType===pe.ACTION)if(d.context===null||d.context.hasEmptyPath()){var ee=Q0.append(d.lexerActionExecutor,this.atn.lexerActions[i.actionIndex]);E=new xi({state:i.target,lexerActionExecutor:ee},d)}else E=new xi({state:i.target},d);else i.serializationType===pe.EPSILON?E=new xi({state:i.target},d):i.serializationType!==pe.ATOM&&i.serializationType!==pe.RANGE&&i.serializationType!==pe.SET||S&&i.matches(n.EOF,0,rr.MAX_CHAR_VALUE)&&(E=new xi({state:i.target},d))}return E}},{key:"evaluatePredicate",value:function(c,d,i,s){if(this.recog===null)return!0;if(!s)return this.recog.sempred(null,d,i);var v=this.column,S=this.line,E=c.index,k=c.mark();try{return this.consume(c),this.recog.sempred(null,d,i)}finally{this.column=v,this.line=S,c.seek(E),c.release(k)}}},{key:"captureSimState",value:function(c,d,i){c.index=d.index,c.line=this.line,c.column=this.column,c.dfaState=i}},{key:"addDFAEdge",value:function(c,d,i,s){if(i===void 0&&(i=null),s===void 0&&(s=null),i===null&&s!==null){var v=s.hasSemanticContext;if(s.hasSemanticContext=!1,i=this.addDFAState(s),v)return i}return d<f.MIN_DFA_EDGE||d>f.MAX_DFA_EDGE||(f.debug&&console.log("EDGE "+c+" -> "+i+" upon "+d),c.edges===null&&(c.edges=[]),c.edges[d-f.MIN_DFA_EDGE]=i),i}},{key:"addDFAState",value:function(c){for(var d=new Bo(null,c),i=null,s=0;s<c.items.length;s++){var v=c.items[s];if(v.state instanceof Dt){i=v;break}}i!==null&&(d.isAcceptState=!0,d.lexerActionExecutor=i.lexerActionExecutor,d.prediction=this.atn.ruleToTokenType[i.state.ruleIndex]);var S=this.decisionToDFA[this.mode],E=S.states.get(d);if(E!==null)return E;var k=d;return k.stateNumber=S.states.length,c.setReadonly(!0),k.configs=c,S.states.add(k),k}},{key:"getDFA",value:function(c){return this.decisionToDFA[c]}},{key:"getText",value:function(c){return c.getText(this.startIndex,c.index-1)}},{key:"consume",value:function(c){c.LA(1)===10?(this.line+=1,this.column=0):this.column+=1,c.consume()}},{key:"getTokenName",value:function(c){return c===-1?"EOF":"'"+String.fromCharCode(c)+"'"}}]),f}(Ai);function Ls(l){return Ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ls(l)}function tg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ls(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ls(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ls(f)==="symbol"?f:String(f)),a)}var f}Ba.debug=!1,Ba.dfa_debug=!1,Ba.MIN_DFA_EDGE=0,Ba.MAX_DFA_EDGE=127;var gy=function(){function l(a,f){(function(c,d){if(!(c instanceof d))throw new TypeError("Cannot call a class as a function")})(this,l),this.alt=f,this.pred=a}var r,p;return r=l,(p=[{key:"toString",value:function(){return"("+this.pred+", "+this.alt+")"}}])&&tg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Bs(l){return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bs(l)}function ng(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Bs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Bs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Bs(f)==="symbol"?f:String(f)),a)}var f}var rg=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l),this.data={}}var r,p;return r=l,(p=[{key:"get",value:function(a){return this.data["k-"+a]||null}},{key:"set",value:function(a,f){this.data["k-"+a]=f}},{key:"values",value:function(){var a=this;return Object.keys(this.data).filter(function(f){return f.startsWith("k-")}).map(function(f){return a.data[f]},this)}}])&&ng(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}(),Oi={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(l,r){if(Oi.allConfigsInRuleStopStates(r))return!0;if(l===Oi.SLL&&r.hasSemanticContext){for(var p=new Ir,a=0;a<r.items.length;a++){var f=r.items[a];f=new le({semanticContext:G.NONE},f),p.add(f)}r=p}var c=Oi.getConflictingAltSubsets(r);return Oi.hasConflictingAltSet(c)&&!Oi.hasStateAssociatedWithOneAlt(r)},hasConfigInRuleStopState:function(l){for(var r=0;r<l.items.length;r++)if(l.items[r].state instanceof Dt)return!0;return!1},allConfigsInRuleStopStates:function(l){for(var r=0;r<l.items.length;r++)if(!(l.items[r].state instanceof Dt))return!1;return!0},resolvesToJustOneViableAlt:function(l){return Oi.getSingleViableAlt(l)},allSubsetsConflict:function(l){return!Oi.hasNonConflictingAltSet(l)},hasNonConflictingAltSet:function(l){for(var r=0;r<l.length;r++)if(l[r].length===1)return!0;return!1},hasConflictingAltSet:function(l){for(var r=0;r<l.length;r++)if(l[r].length>1)return!0;return!1},allSubsetsEqual:function(l){for(var r=null,p=0;p<l.length;p++){var a=l[p];if(r===null)r=a;else if(a!==r)return!1}return!0},getUniqueAlt:function(l){var r=Oi.getAlts(l);return r.length===1?r.minValue():dn.INVALID_ALT_NUMBER},getAlts:function(l){var r=new Pr;return l.map(function(p){r.or(p)}),r},getConflictingAltSubsets:function(l){var r=new Xi;return r.hashFunction=function(p){x.hashStuff(p.state.stateNumber,p.context)},r.equalsFunction=function(p,a){return p.state.stateNumber===a.state.stateNumber&&p.context.equals(a.context)},l.items.map(function(p){var a=r.get(p);a===null&&(a=new Pr,r.set(p,a)),a.add(p.alt)}),r.getValues()},getStateToAltMap:function(l){var r=new rg;return l.items.map(function(p){var a=r.get(p.state);a===null&&(a=new Pr,r.set(p.state,a)),a.add(p.alt)}),r},hasStateAssociatedWithOneAlt:function(l){for(var r=Oi.getStateToAltMap(l).values(),p=0;p<r.length;p++)if(r[p].length===1)return!0;return!1},getSingleViableAlt:function(l){for(var r=null,p=0;p<l.length;p++){var a=l[p].minValue();if(r===null)r=a;else if(r!==a)return dn.INVALID_ALT_NUMBER}return r}};const Hn=Oi;function Th(l){return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Th(l)}function Ah(l,r){return Ah=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Ah(l,r)}function wc(l){return wc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wc(l)}var Nc=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Ah(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=wc(p);if(a){var s=wc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(Th(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d,i,s,v,S,E){var k;return function(ee,Ce){if(!(ee instanceof Ce))throw new TypeError("Cannot call a class as a function")}(this,c),E=E||d._ctx,v=v||d.getCurrentToken(),s=s||d.getCurrentToken(),i=i||d.getInputStream(),(k=f.call(this,{message:"",recognizer:d,input:i,ctx:E})).deadEndConfigs=S,k.startToken=s,k.offendingToken=v,k}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Lo);function Us(l){return Us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Us(l)}function ig(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Us(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Us(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Us(f)==="symbol"?f:String(f)),a)}var f}var og=function(){function l(a){(function(f,c){if(!(f instanceof c))throw new TypeError("Cannot call a class as a function")})(this,l),this.defaultMapCtor=a||Xi,this.cacheMap=new this.defaultMapCtor}var r,p;return r=l,(p=[{key:"get",value:function(a,f){var c=this.cacheMap.get(a)||null;return c===null?null:c.get(f)||null}},{key:"set",value:function(a,f,c){var d=this.cacheMap.get(a)||null;d===null&&(d=new this.defaultMapCtor,this.cacheMap.set(a,d)),d.set(f,c)}}])&&ig(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Ua(l){return Ua=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ua(l)}function ag(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ua(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ua(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ua(f)==="symbol"?f:String(f)),a)}var f}function xh(l,r){return xh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},xh(l,r)}function Pc(l){return Pc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Pc(l)}var by=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&xh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Pc(a);if(f){var v=Pc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ua(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s,v,S){var E;return function(k,ee){if(!(k instanceof ee))throw new TypeError("Cannot call a class as a function")}(this,d),(E=c.call(this,s,S)).parser=i,E.decisionToDFA=v,E.predictionMode=Hn.LL,E._input=null,E._startIndex=0,E._outerContext=null,E._dfa=null,E.mergeCache=null,E.debug=!1,E.debug_closure=!1,E.debug_add=!1,E.trace_atn_sim=!1,E.dfa_debug=!1,E.retry_debug=!1,E}return r=d,p=[{key:"reset",value:function(){}},{key:"adaptivePredict",value:function(i,s,v){(this.debug||this.trace_atn_sim)&&console.log("adaptivePredict decision "+s+" exec LA(1)=="+this.getLookaheadName(i)+" line "+i.LT(1).line+":"+i.LT(1).column),this._input=i,this._startIndex=i.index,this._outerContext=v;var S=this.decisionToDFA[s];this._dfa=S;var E=i.mark(),k=i.index;try{var ee;if((ee=S.precedenceDfa?S.getPrecedenceStartState(this.parser.getPrecedence()):S.s0)===null){v===null&&(v=Wi.EMPTY),this.debug&&console.log("predictATN decision "+S.decision+" exec LA(1)=="+this.getLookaheadName(i)+", outerContext="+v.toString(this.parser.ruleNames));var Ce=this.computeStartState(S.atnStartState,Wi.EMPTY,!1);S.precedenceDfa?(S.s0.configs=Ce,Ce=this.applyPrecedenceFilter(Ce),ee=this.addDFAState(S,new Bo(null,Ce)),S.setPrecedenceStartState(this.parser.getPrecedence(),ee)):(ee=this.addDFAState(S,new Bo(null,Ce)),S.s0=ee)}var xe=this.execATN(S,ee,i,k,v);return this.debug&&console.log("DFA after predictATN: "+S.toString(this.parser.literalNames,this.parser.symbolicNames)),xe}finally{this._dfa=null,this.mergeCache=null,i.seek(k),i.release(E)}}},{key:"execATN",value:function(i,s,v,S,E){var k;(this.debug||this.trace_atn_sim)&&console.log("execATN decision "+i.decision+", DFA state "+s+", LA(1)=="+this.getLookaheadName(v)+" line "+v.LT(1).line+":"+v.LT(1).column);var ee=s;this.debug&&console.log("s0 = "+s);for(var Ce=v.LA(1);;){var xe=this.getExistingTargetState(ee,Ce);if(xe===null&&(xe=this.computeTargetState(i,ee,Ce)),xe===Ai.ERROR){var Ge=this.noViableAlt(v,E,ee.configs,S);if(v.seek(S),(k=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(ee.configs,E))!==dn.INVALID_ALT_NUMBER)return k;throw Ge}if(xe.requiresFullContext&&this.predictionMode!==Hn.SLL){var at=null;if(xe.predicates!==null){this.debug&&console.log("DFA state has preds in DFA sim LL failover");var $e=v.index;if($e!==S&&v.seek(S),(at=this.evalSemanticContext(xe.predicates,E,!0)).length===1)return this.debug&&console.log("Full LL avoided"),at.minValue();$e!==S&&v.seek($e)}this.dfa_debug&&console.log("ctx sensitive state "+E+" in "+xe);var yn=this.computeStartState(i.atnStartState,E,!0);return this.reportAttemptingFullContext(i,at,xe.configs,S,v.index),this.execATNWithFullContext(i,xe,yn,v,S,E)}if(xe.isAcceptState){if(xe.predicates===null)return xe.prediction;var hn=v.index;v.seek(S);var Gn=this.evalSemanticContext(xe.predicates,E,!0);if(Gn.length===0)throw this.noViableAlt(v,E,xe.configs,S);return Gn.length===1||this.reportAmbiguity(i,xe,S,hn,!1,Gn,xe.configs),Gn.minValue()}ee=xe,Ce!==n.EOF&&(v.consume(),Ce=v.LA(1))}}},{key:"getExistingTargetState",value:function(i,s){var v=i.edges;return v===null?null:v[s+1]||null}},{key:"computeTargetState",value:function(i,s,v){var S=this.computeReachSet(s.configs,v,!1);if(S===null)return this.addDFAEdge(i,s,v,Ai.ERROR),Ai.ERROR;var E=new Bo(null,S),k=this.getUniqueAlt(S);if(this.debug){var ee=Hn.getConflictingAltSubsets(S);console.log("SLL altSubSets="+$(ee)+", configs="+S+", predict="+k+", allSubsetsConflict="+Hn.allSubsetsConflict(ee)+", conflictingAlts="+this.getConflictingAlts(S))}return k!==dn.INVALID_ALT_NUMBER?(E.isAcceptState=!0,E.configs.uniqueAlt=k,E.prediction=k):Hn.hasSLLConflictTerminatingPrediction(this.predictionMode,S)&&(E.configs.conflictingAlts=this.getConflictingAlts(S),E.requiresFullContext=!0,E.isAcceptState=!0,E.prediction=E.configs.conflictingAlts.minValue()),E.isAcceptState&&E.configs.hasSemanticContext&&(this.predicateDFAState(E,this.atn.getDecisionState(i.decision)),E.predicates!==null&&(E.prediction=dn.INVALID_ALT_NUMBER)),this.addDFAEdge(i,s,v,E)}},{key:"predicateDFAState",value:function(i,s){var v=s.transitions.length,S=this.getConflictingAltsOrUniqueAlt(i.configs),E=this.getPredsForAmbigAlts(S,i.configs,v);E!==null?(i.predicates=this.getPredicatePredictions(S,E),i.prediction=dn.INVALID_ALT_NUMBER):i.prediction=S.minValue()}},{key:"execATNWithFullContext",value:function(i,s,v,S,E,k){(this.debug||this.trace_atn_sim)&&console.log("execATNWithFullContext "+v);var ee,Ce=!1,xe=v;S.seek(E);for(var Ge=S.LA(1),at=-1;;){if((ee=this.computeReachSet(xe,Ge,!0))===null){var $e=this.noViableAlt(S,k,xe,E);S.seek(E);var yn=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(xe,k);if(yn!==dn.INVALID_ALT_NUMBER)return yn;throw $e}var hn=Hn.getConflictingAltSubsets(ee);if(this.debug&&console.log("LL altSubSets="+hn+", predict="+Hn.getUniqueAlt(hn)+", resolvesToJustOneViableAlt="+Hn.resolvesToJustOneViableAlt(hn)),ee.uniqueAlt=this.getUniqueAlt(ee),ee.uniqueAlt!==dn.INVALID_ALT_NUMBER){at=ee.uniqueAlt;break}if(this.predictionMode!==Hn.LL_EXACT_AMBIG_DETECTION){if((at=Hn.resolvesToJustOneViableAlt(hn))!==dn.INVALID_ALT_NUMBER)break}else if(Hn.allSubsetsConflict(hn)&&Hn.allSubsetsEqual(hn)){Ce=!0,at=Hn.getSingleViableAlt(hn);break}xe=ee,Ge!==n.EOF&&(S.consume(),Ge=S.LA(1))}return ee.uniqueAlt!==dn.INVALID_ALT_NUMBER?(this.reportContextSensitivity(i,at,ee,E,S.index),at):(this.reportAmbiguity(i,s,E,S.index,Ce,null,ee),at)}},{key:"computeReachSet",value:function(i,s,v){this.debug&&console.log("in computeReachSet, starting closure: "+i),this.mergeCache===null&&(this.mergeCache=new og);for(var S=new Ir(v),E=null,k=0;k<i.items.length;k++){var ee=i.items[k];if(this.debug&&console.log("testing "+this.getTokenName(s)+" at "+ee),ee.state instanceof Dt)(v||s===n.EOF)&&(E===null&&(E=[]),E.push(ee),this.debug_add&&console.log("added "+ee+" to skippedStopStates"));else for(var Ce=0;Ce<ee.state.transitions.length;Ce++){var xe=ee.state.transitions[Ce],Ge=this.getReachableTarget(xe,s);if(Ge!==null){var at=new le({state:Ge},ee);S.add(at,this.mergeCache),this.debug_add&&console.log("added "+at+" to intermediate")}}}var $e=null;if(E===null&&s!==n.EOF&&(S.items.length===1||this.getUniqueAlt(S)!==dn.INVALID_ALT_NUMBER)&&($e=S),$e===null){$e=new Ir(v);for(var yn=new g,hn=s===n.EOF,Gn=0;Gn<S.items.length;Gn++)this.closure(S.items[Gn],$e,yn,!1,v,hn)}if(s===n.EOF&&($e=this.removeAllConfigsNotInRuleStopState($e,$e===S)),!(E===null||v&&Hn.hasConfigInRuleStopState($e)))for(var Fr=0;Fr<E.length;Fr++)$e.add(E[Fr],this.mergeCache);return this.trace_atn_sim&&console.log("computeReachSet "+i+" -> "+$e),$e.items.length===0?null:$e}},{key:"removeAllConfigsNotInRuleStopState",value:function(i,s){if(Hn.allConfigsInRuleStopStates(i))return i;for(var v=new Ir(i.fullCtx),S=0;S<i.items.length;S++){var E=i.items[S];if(E.state instanceof Dt)v.add(E,this.mergeCache);else if(s&&E.state.epsilonOnlyTransitions&&this.atn.nextTokens(E.state).contains(n.EPSILON)){var k=this.atn.ruleToStopState[E.state.ruleIndex];v.add(new le({state:k},E),this.mergeCache)}}return v}},{key:"computeStartState",value:function(i,s,v){var S=aa(this.atn,s),E=new Ir(v);this.trace_atn_sim&&console.log("computeStartState from ATN state "+i+" initialContext="+S.toString(this.parser));for(var k=0;k<i.transitions.length;k++){var ee=i.transitions[k].target,Ce=new le({state:ee,alt:k+1,context:S},null),xe=new g;this.closure(Ce,E,xe,!0,v,!1)}return E}},{key:"applyPrecedenceFilter",value:function(i){for(var s,v=[],S=new Ir(i.fullCtx),E=0;E<i.items.length;E++)if((s=i.items[E]).alt===1){var k=s.semanticContext.evalPrecedence(this.parser,this._outerContext);k!==null&&(v[s.state.stateNumber]=s.context,k!==s.semanticContext?S.add(new le({semanticContext:k},s),this.mergeCache):S.add(s,this.mergeCache))}for(var ee=0;ee<i.items.length;ee++)if((s=i.items[ee]).alt!==1){if(!s.precedenceFilterSuppressed){var Ce=v[s.state.stateNumber]||null;if(Ce!==null&&Ce.equals(s.context))continue}S.add(s,this.mergeCache)}return S}},{key:"getReachableTarget",value:function(i,s){return i.matches(s,0,this.atn.maxTokenType)?i.target:null}},{key:"getPredsForAmbigAlts",value:function(i,s,v){for(var S=[],E=0;E<s.items.length;E++){var k=s.items[E];i.has(k.alt)&&(S[k.alt]=G.orContext(S[k.alt]||null,k.semanticContext))}for(var ee=0,Ce=1;Ce<v+1;Ce++){var xe=S[Ce]||null;xe===null?S[Ce]=G.NONE:xe!==G.NONE&&(ee+=1)}return ee===0&&(S=null),this.debug&&console.log("getPredsForAmbigAlts result "+$(S)),S}},{key:"getPredicatePredictions",value:function(i,s){for(var v=[],S=!1,E=1;E<s.length;E++){var k=s[E];i!==null&&i.has(E)&&v.push(new gy(k,E)),k!==G.NONE&&(S=!0)}return S?v:null}},{key:"getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule",value:function(i,s){var v=this.splitAccordingToSemanticValidity(i,s),S=v[0],E=v[1],k=this.getAltThatFinishedDecisionEntryRule(S);return k!==dn.INVALID_ALT_NUMBER||E.items.length>0&&(k=this.getAltThatFinishedDecisionEntryRule(E))!==dn.INVALID_ALT_NUMBER?k:dn.INVALID_ALT_NUMBER}},{key:"getAltThatFinishedDecisionEntryRule",value:function(i){for(var s=[],v=0;v<i.items.length;v++){var S=i.items[v];(S.reachesIntoOuterContext>0||S.state instanceof Dt&&S.context.hasEmptyPath())&&s.indexOf(S.alt)<0&&s.push(S.alt)}return s.length===0?dn.INVALID_ALT_NUMBER:Math.min.apply(null,s)}},{key:"splitAccordingToSemanticValidity",value:function(i,s){for(var v=new Ir(i.fullCtx),S=new Ir(i.fullCtx),E=0;E<i.items.length;E++){var k=i.items[E];k.semanticContext!==G.NONE?k.semanticContext.evaluate(this.parser,s)?v.add(k):S.add(k):v.add(k)}return[v,S]}},{key:"evalSemanticContext",value:function(i,s,v){for(var S=new Pr,E=0;E<i.length;E++){var k=i[E];if(k.pred!==G.NONE){var ee=k.pred.evaluate(this.parser,s);if((this.debug||this.dfa_debug)&&console.log("eval pred "+k+"="+ee),ee&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+k.alt),S.add(k.alt),!v))break}else if(S.add(k.alt),!v)break}return S}},{key:"closure",value:function(i,s,v,S,E,k){this.closureCheckingStopState(i,s,v,S,E,0,k)}},{key:"closureCheckingStopState",value:function(i,s,v,S,E,k,ee){if((this.trace_atn_sim||this.debug_closure)&&console.log("closure("+i.toString(this.parser,!0)+")"),i.state instanceof Dt){if(!i.context.isEmpty()){for(var Ce=0;Ce<i.context.length;Ce++)if(i.context.getReturnState(Ce)!==it.EMPTY_RETURN_STATE){var xe=this.atn.states[i.context.getReturnState(Ce)],Ge=i.context.getParent(Ce),at={state:xe,alt:i.alt,context:Ge,semanticContext:i.semanticContext},$e=new le(at,null);$e.reachesIntoOuterContext=i.reachesIntoOuterContext,this.closureCheckingStopState($e,s,v,S,E,k-1,ee)}else{if(E){s.add(new le({state:i.state,context:it.EMPTY},i),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(i.state.ruleIndex)),this.closure_(i,s,v,S,E,k,ee)}return}if(E)return void s.add(i,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(i.state.ruleIndex))}this.closure_(i,s,v,S,E,k,ee)}},{key:"closure_",value:function(i,s,v,S,E,k,ee){var Ce=i.state;Ce.epsilonOnlyTransitions||s.add(i,this.mergeCache);for(var xe=0;xe<Ce.transitions.length;xe++)if(xe!==0||!this.canDropLoopEntryEdgeInLeftRecursiveRule(i)){var Ge=Ce.transitions[xe],at=S&&!(Ge instanceof Jd),$e=this.getEpsilonTarget(i,Ge,at,k===0,E,ee);if($e!==null){var yn=k;if(i.state instanceof Dt){if(this._dfa!==null&&this._dfa.precedenceDfa&&Ge.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&($e.precedenceFilterSuppressed=!0),$e.reachesIntoOuterContext+=1,v.add($e)!==$e)continue;s.dipsIntoOuterContext=!0,yn-=1,this.debug&&console.log("dips into outer ctx: "+$e)}else{if(!Ge.isEpsilon&&v.add($e)!==$e)continue;Ge instanceof Zt&&yn>=0&&(yn+=1)}this.closureCheckingStopState($e,s,v,at,E,yn,ee)}}}},{key:"canDropLoopEntryEdgeInLeftRecursiveRule",value:function(i){var s=i.state;if(s.stateType!==me.STAR_LOOP_ENTRY||s.stateType!==me.STAR_LOOP_ENTRY||!s.isPrecedenceDecision||i.context.isEmpty()||i.context.hasEmptyPath())return!1;for(var v=i.context.length,S=0;S<v;S++)if(this.atn.states[i.context.getReturnState(S)].ruleIndex!==s.ruleIndex)return!1;for(var E=s.transitions[0].target.endState.stateNumber,k=this.atn.states[E],ee=0;ee<v;ee++){var Ce=i.context.getReturnState(ee),xe=this.atn.states[Ce];if(xe.transitions.length!==1||!xe.transitions[0].isEpsilon)return!1;var Ge=xe.transitions[0].target;if(!(xe.stateType===me.BLOCK_END&&Ge===s||xe===k||Ge===k||Ge.stateType===me.BLOCK_END&&Ge.transitions.length===1&&Ge.transitions[0].isEpsilon&&Ge.transitions[0].target===s))return!1}return!0}},{key:"getRuleName",value:function(i){return this.parser!==null&&i>=0?this.parser.ruleNames[i]:"<rule "+i+">"}},{key:"getEpsilonTarget",value:function(i,s,v,S,E,k){switch(s.serializationType){case pe.RULE:return this.ruleTransition(i,s);case pe.PRECEDENCE:return this.precedenceTransition(i,s,v,S,E);case pe.PREDICATE:return this.predTransition(i,s,v,S,E);case pe.ACTION:return this.actionTransition(i,s);case pe.EPSILON:return new le({state:s.target},i);case pe.ATOM:case pe.RANGE:case pe.SET:return k&&s.matches(n.EOF,0,1)?new le({state:s.target},i):null;default:return null}}},{key:"actionTransition",value:function(i,s){if(this.debug){var v=s.actionIndex===-1?65535:s.actionIndex;console.log("ACTION edge "+s.ruleIndex+":"+v)}return new le({state:s.target},i)}},{key:"precedenceTransition",value:function(i,s,v,S,E){this.debug&&(console.log("PRED (collectPredicates="+v+") "+s.precedence+">=_p, ctx dependent=true"),this.parser!==null&&console.log("context surrounding pred is "+$(this.parser.getRuleInvocationStack())));var k=null;if(v&&S)if(E){var ee=this._input.index;this._input.seek(this._startIndex);var Ce=s.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(ee),Ce&&(k=new le({state:s.target},i))}else{var xe=G.andContext(i.semanticContext,s.getPredicate());k=new le({state:s.target,semanticContext:xe},i)}else k=new le({state:s.target},i);return this.debug&&console.log("config from pred transition="+k),k}},{key:"predTransition",value:function(i,s,v,S,E){this.debug&&(console.log("PRED (collectPredicates="+v+") "+s.ruleIndex+":"+s.predIndex+", ctx dependent="+s.isCtxDependent),this.parser!==null&&console.log("context surrounding pred is "+$(this.parser.getRuleInvocationStack())));var k=null;if(v&&(s.isCtxDependent&&S||!s.isCtxDependent))if(E){var ee=this._input.index;this._input.seek(this._startIndex);var Ce=s.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(ee),Ce&&(k=new le({state:s.target},i))}else{var xe=G.andContext(i.semanticContext,s.getPredicate());k=new le({state:s.target,semanticContext:xe},i)}else k=new le({state:s.target},i);return this.debug&&console.log("config from pred transition="+k),k}},{key:"ruleTransition",value:function(i,s){this.debug&&console.log("CALL rule "+this.getRuleName(s.target.ruleIndex)+", ctx="+i.context);var v=s.followState,S=ct.create(i.context,v.stateNumber);return new le({state:s.target,context:S},i)}},{key:"getConflictingAlts",value:function(i){var s=Hn.getConflictingAltSubsets(i);return Hn.getAlts(s)}},{key:"getConflictingAltsOrUniqueAlt",value:function(i){var s=null;return i.uniqueAlt!==dn.INVALID_ALT_NUMBER?(s=new Pr).add(i.uniqueAlt):s=i.conflictingAlts,s}},{key:"getTokenName",value:function(i){if(i===n.EOF)return"EOF";if(this.parser!==null&&this.parser.literalNames!==null){if(!(i>=this.parser.literalNames.length&&i>=this.parser.symbolicNames.length))return(this.parser.literalNames[i]||this.parser.symbolicNames[i])+"<"+i+">";console.log(i+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+i}},{key:"getLookaheadName",value:function(i){return this.getTokenName(i.LA(1))}},{key:"dumpDeadEndConfigs",value:function(i){console.log("dead end configs: ");for(var s=i.getDeadEndConfigs(),v=0;v<s.length;v++){var S=s[v],E="no edges";if(S.state.transitions.length>0){var k=S.state.transitions[0];k instanceof Uf?E="Atom "+this.getTokenName(k.label):k instanceof Si&&(E=(k instanceof rn?"~":"")+"Set "+k.set)}console.error(S.toString(this.parser,!0)+":"+E)}}},{key:"noViableAlt",value:function(i,s,v,S){return new Nc(this.parser,i,i.get(S),i.LT(1),v,s)}},{key:"getUniqueAlt",value:function(i){for(var s=dn.INVALID_ALT_NUMBER,v=0;v<i.items.length;v++){var S=i.items[v];if(s===dn.INVALID_ALT_NUMBER)s=S.alt;else if(S.alt!==s)return dn.INVALID_ALT_NUMBER}return s}},{key:"addDFAEdge",value:function(i,s,v,S){if(this.debug&&console.log("EDGE "+s+" -> "+S+" upon "+this.getTokenName(v)),S===null)return null;if(S=this.addDFAState(i,S),s===null||v<-1||v>this.atn.maxTokenType)return S;if(s.edges===null&&(s.edges=[]),s.edges[v+1]=S,this.debug){var E=this.parser===null?null:this.parser.literalNames,k=this.parser===null?null:this.parser.symbolicNames;console.log(`DFA=
8
8
  `+i.toString(E,k))}return S}},{key:"addDFAState",value:function(i,s){if(s===Ai.ERROR)return s;var v=i.states.get(s);return v!==null?(this.trace_atn_sim&&console.log("addDFAState "+s+" exists"),v):(s.stateNumber=i.states.length,s.configs.readOnly||(s.configs.optimizeConfigs(this),s.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+s),i.states.add(s),this.debug&&console.log("adding new DFA state: "+s),s)}},{key:"reportAttemptingFullContext",value:function(i,s,v,S,E){if(this.debug||this.retry_debug){var k=new _e(S,E+1);console.log("reportAttemptingFullContext decision="+i.decision+":"+v+", input="+this.parser.getTokenStream().getText(k))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,i,S,E,s,v)}},{key:"reportContextSensitivity",value:function(i,s,v,S,E){if(this.debug||this.retry_debug){var k=new _e(S,E+1);console.log("reportContextSensitivity decision="+i.decision+":"+v+", input="+this.parser.getTokenStream().getText(k))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,i,S,E,s,v)}},{key:"reportAmbiguity",value:function(i,s,v,S,E,k,ee){if(this.debug||this.retry_debug){var Ce=new _e(v,S+1);console.log("reportAmbiguity "+k+":"+ee+", input="+this.parser.getTokenStream().getText(Ce))}this.parser!==null&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,i,v,S,E,k,ee)}}],p&&ag(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Ai);function Vs(l){return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Vs(l)}function sg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Vs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Vs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Vs(f)==="symbol"?f:String(f)),a)}var f}var vy=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l),this.cache=new Xi}var r,p;return r=l,(p=[{key:"add",value:function(a){if(a===it.EMPTY)return it.EMPTY;var f=this.cache.get(a)||null;return f!==null?f:(this.cache.set(a,a),a)}},{key:"get",value:function(a){return this.cache.get(a)||null}},{key:"length",get:function(){return this.cache.length}}])&&sg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();const ug={ATN:dn,ATNDeserializer:ih,LexerATNSimulator:Ba,ParserATNSimulator:by,PredictionMode:Hn,PredictionContextCache:vy};function js(l){return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},js(l)}function cg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(js(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(js(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),js(f)==="symbol"?f:String(f)),a)}var f}var Oh=function(){function l(a,f,c){(function(d,i){if(!(d instanceof i))throw new TypeError("Cannot call a class as a function")})(this,l),this.dfa=a,this.literalNames=f||[],this.symbolicNames=c||[]}var r,p;return r=l,(p=[{key:"toString",value:function(){if(this.dfa.s0===null)return null;for(var a="",f=this.dfa.sortedStates(),c=0;c<f.length;c++){var d=f[c];if(d.edges!==null)for(var i=d.edges.length,s=0;s<i;s++){var v=d.edges[s]||null;v!==null&&v.stateNumber!==2147483647&&(a=(a=(a=(a=(a=(a=a.concat(this.getStateString(d))).concat("-")).concat(this.getEdgeLabel(s))).concat("->")).concat(this.getStateString(v))).concat(`
9
9
  `))}}return a.length===0?null:a}},{key:"getEdgeLabel",value:function(a){return a===0?"EOF":this.literalNames!==null||this.symbolicNames!==null?this.literalNames[a-1]||this.symbolicNames[a-1]:String.fromCharCode(a-1)}},{key:"getStateString",value:function(a){var f=(a.isAcceptState?":":"")+"s"+a.stateNumber+(a.requiresFullContext?"^":"");return a.isAcceptState?a.predicates!==null?f+"=>"+$(a.predicates):f+"=>"+a.prediction.toString():f}}])&&cg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Va(l){return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Va(l)}function lg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Va(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Va(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Va(f)==="symbol"?f:String(f)),a)}var f}function Dh(l,r){return Dh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Dh(l,r)}function Ic(l){return Ic=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ic(l)}var Ey=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Dh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Ic(a);if(f){var v=Ic(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Va(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,d),c.call(this,i,null)}return r=d,(p=[{key:"getEdgeLabel",value:function(i){return"'"+String.fromCharCode(i)+"'"}}])&&lg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Oh);function Hs(l){return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Hs(l)}function fg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Hs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Hs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Hs(f)==="symbol"?f:String(f)),a)}var f}var Sy=function(){function l(a,f){if(function(d,i){if(!(d instanceof i))throw new TypeError("Cannot call a class as a function")}(this,l),f===void 0&&(f=0),this.atnStartState=a,this.decision=f,this._states=new g,this.s0=null,this.precedenceDfa=!1,a instanceof Mo&&a.isPrecedenceDecision){this.precedenceDfa=!0;var c=new Bo(null,new Ir);c.edges=[],c.isAcceptState=!1,c.requiresFullContext=!1,this.s0=c}}var r,p;return r=l,(p=[{key:"getPrecedenceStartState",value:function(a){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return a<0||a>=this.s0.edges.length?null:this.s0.edges[a]||null}},{key:"setPrecedenceStartState",value:function(a,f){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";a<0||(this.s0.edges[a]=f)}},{key:"setPrecedenceDfa",value:function(a){if(this.precedenceDfa!==a){if(this._states=new g,a){var f=new Bo(null,new Ir);f.edges=[],f.isAcceptState=!1,f.requiresFullContext=!1,this.s0=f}else this.s0=null;this.precedenceDfa=a}}},{key:"sortedStates",value:function(){return this._states.values().sort(function(a,f){return a.stateNumber-f.stateNumber})}},{key:"toString",value:function(a,f){return a=a||null,f=f||null,this.s0===null?"":new Oh(this,a,f).toString()}},{key:"toLexerString",value:function(){return this.s0===null?"":new Ey(this).toString()}},{key:"states",get:function(){return this._states}}])&&fg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();const hg={DFA:Sy,DFASerializer:Oh,LexerDFASerializer:Ey,PredPrediction:gy},pg={PredictionContext:it},dg={Interval:_e,IntervalSet:ne};function Gs(l){return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Gs(l)}function yg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Gs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Gs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Gs(f)==="symbol"?f:String(f)),a)}var f}var Ch=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"visitTerminal",value:function(a){}},{key:"visitErrorNode",value:function(a){}},{key:"enterEveryRule",value:function(a){}},{key:"exitEveryRule",value:function(a){}}])&&yg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function Ks(l){return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ks(l)}function mg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ks(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ks(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ks(f)==="symbol"?f:String(f)),a)}var f}var Ty=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"visit",value:function(a){return Array.isArray(a)?a.map(function(f){return f.accept(this)},this):a.accept(this)}},{key:"visitChildren",value:function(a){return a.children?this.visit(a.children):null}},{key:"visitTerminal",value:function(a){}},{key:"visitErrorNode",value:function(a){}}])&&mg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function zs(l){return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},zs(l)}function _g(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(zs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(zs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),zs(f)==="symbol"?f:String(f)),a)}var f}var Fc=function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"walk",value:function(a,f){if(f instanceof zr||f.isErrorNode!==void 0&&f.isErrorNode())a.visitErrorNode(f);else if(f instanceof on)a.visitTerminal(f);else{this.enterRule(a,f);for(var c=0;c<f.getChildCount();c++){var d=f.getChild(c);this.walk(a,d)}this.exitRule(a,f)}}},{key:"enterRule",value:function(a,f){var c=f.ruleContext;a.enterEveryRule(c),c.enterRule(a)}},{key:"exitRule",value:function(a,f){var c=f.ruleContext;c.exitRule(a),a.exitEveryRule(c)}}])&&_g(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();Fc.DEFAULT=new Fc;const gg={Trees:Hu,RuleNode:Fe,ErrorNode:zr,TerminalNode:on,ParseTreeListener:Ch,ParseTreeVisitor:Ty,ParseTreeWalker:Fc};function kh(l){return kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},kh(l)}function Rh(l,r){return Rh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Rh(l,r)}function Mc(l){return Mc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mc(l)}var $s=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Rh(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=Mc(p);if(a){var s=Mc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(kh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d){var i;return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,c),(i=f.call(this,{message:"",recognizer:d,input:d.getInputStream(),ctx:d._ctx})).offendingToken=d.getCurrentToken(),i}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Lo);function wh(l){return wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},wh(l)}function Nh(l,r){return Nh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Nh(l,r)}function Lc(l){return Lc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lc(l)}var Ph=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Nh(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=Lc(p);if(a){var s=Lc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(wh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d,i,s){var v;(function(E,k){if(!(E instanceof k))throw new TypeError("Cannot call a class as a function")})(this,c),v=f.call(this,{message:bg(i,s||null),recognizer:d,input:d.getInputStream(),ctx:d._ctx});var S=d._interp.atn.states[d.state].transitions[0];return S instanceof Qd?(v.ruleIndex=S.ruleIndex,v.predicateIndex=S.predIndex):(v.ruleIndex=0,v.predicateIndex=0),v.predicate=i,v.offendingToken=d.getCurrentToken(),v}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Lo);function bg(l,r){return r!==null?r:"failed predicate: {"+l+"}?"}function ja(l){return ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ja(l)}function vg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(ja(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(ja(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),ja(f)==="symbol"?f:String(f)),a)}var f}function Ih(l,r){return Ih=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Ih(l,r)}function Bc(l){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bc(l)}var Ay=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Ih(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Bc(a);if(f){var v=Bc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(ja(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),i=i||!0,(s=c.call(this)).exactOnly=i,s}return r=d,p=[{key:"reportAmbiguity",value:function(i,s,v,S,E,k,ee){if(!this.exactOnly||E){var Ce="reportAmbiguity d="+this.getDecisionDescription(i,s)+": ambigAlts="+this.getConflictingAlts(k,ee)+", input='"+i.getTokenStream().getText(new _e(v,S))+"'";i.notifyErrorListeners(Ce)}}},{key:"reportAttemptingFullContext",value:function(i,s,v,S,E,k){var ee="reportAttemptingFullContext d="+this.getDecisionDescription(i,s)+", input='"+i.getTokenStream().getText(new _e(v,S))+"'";i.notifyErrorListeners(ee)}},{key:"reportContextSensitivity",value:function(i,s,v,S,E,k){var ee="reportContextSensitivity d="+this.getDecisionDescription(i,s)+", input='"+i.getTokenStream().getText(new _e(v,S))+"'";i.notifyErrorListeners(ee)}},{key:"getDecisionDescription",value:function(i,s){var v=s.decision,S=s.atnStartState.ruleIndex,E=i.ruleNames;if(S<0||S>=E.length)return""+v;var k=E[S]||null;return k===null||k.length===0?""+v:"".concat(v," (").concat(k,")")}},{key:"getConflictingAlts",value:function(i,s){if(i!==null)return i;for(var v=new Pr,S=0;S<s.items.length;S++)v.add(s.items[S].alt);return"{".concat(v.values().join(", "),"}")}}],p&&vg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Cs);function Fh(l){return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fh(l)}function xy(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Mh(l){var r=typeof Map=="function"?new Map:void 0;return Mh=function(p){if(p===null||(a=p,Function.toString.call(a).indexOf("[native code]")===-1))return p;var a;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(p))return r.get(p);r.set(p,f)}function f(){return Lh(p,arguments,Xs(this).constructor)}return f.prototype=Object.create(p.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),Ws(f,p)},Mh(l)}function Lh(l,r,p){return Lh=Oy()?Reflect.construct.bind():function(a,f,c){var d=[null];d.push.apply(d,f);var i=new(Function.bind.apply(a,d));return c&&Ws(i,c.prototype),i},Lh.apply(null,arguments)}function Oy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ws(l,r){return Ws=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Ws(l,r)}function Xs(l){return Xs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xs(l)}var Eg=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Ws(d,i)})(c,l);var r,p,a,f=(p=c,a=Oy(),function(){var d,i=Xs(p);if(a){var s=Xs(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(Fh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xy(v)}(this,d)});function c(){var d;return function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}(this,c),d=f.call(this),Error.captureStackTrace(xy(d),c),d}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Mh(Error));function qs(l){return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qs(l)}function Sg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(qs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(qs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),qs(f)==="symbol"?f:String(f)),a)}var f}function Ha(l){return Ha=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ha(l)}function Tg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ha(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ha(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ha(f)==="symbol"?f:String(f)),a)}var f}function Bh(l,r){return Bh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Bh(l,r)}function Uc(l){return Uc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uc(l)}var Uh=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Bh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Uc(a);if(f){var v=Uc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ha(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(){var i;return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,d),(i=c.call(this)).errorRecoveryMode=!1,i.lastErrorIndex=-1,i.lastErrorStates=null,i.nextTokensContext=null,i.nextTokenState=0,i}return r=d,p=[{key:"reset",value:function(i){this.endErrorCondition(i)}},{key:"beginErrorCondition",value:function(i){this.errorRecoveryMode=!0}},{key:"inErrorRecoveryMode",value:function(i){return this.errorRecoveryMode}},{key:"endErrorCondition",value:function(i){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}},{key:"reportMatch",value:function(i){this.endErrorCondition(i)}},{key:"reportError",value:function(i,s){this.inErrorRecoveryMode(i)||(this.beginErrorCondition(i),s instanceof Nc?this.reportNoViableAlternative(i,s):s instanceof $s?this.reportInputMismatch(i,s):s instanceof Ph?this.reportFailedPredicate(i,s):(console.log("unknown recognition error type: "+s.constructor.name),console.log(s.stack),i.notifyErrorListeners(s.getOffendingToken(),s.getMessage(),s)))}},{key:"recover",value:function(i,s){this.lastErrorIndex===i.getInputStream().index&&this.lastErrorStates!==null&&this.lastErrorStates.indexOf(i.state)>=0&&i.consume(),this.lastErrorIndex=i._input.index,this.lastErrorStates===null&&(this.lastErrorStates=[]),this.lastErrorStates.push(i.state);var v=this.getErrorRecoverySet(i);this.consumeUntil(i,v)}},{key:"sync",value:function(i){if(!this.inErrorRecoveryMode(i)){var s=i._interp.atn.states[i.state],v=i.getTokenStream().LA(1),S=i.atn.nextTokens(s);if(S.contains(v))return this.nextTokensContext=null,void(this.nextTokenState=me.INVALID_STATE_NUMBER);if(S.contains(n.EPSILON))this.nextTokensContext===null&&(this.nextTokensContext=i._ctx,this.nextTokensState=i._stateNumber);else switch(s.stateType){case me.BLOCK_START:case me.STAR_BLOCK_START:case me.PLUS_BLOCK_START:case me.STAR_LOOP_ENTRY:if(this.singleTokenDeletion(i)!==null)return;throw new $s(i);case me.PLUS_LOOP_BACK:case me.STAR_LOOP_BACK:this.reportUnwantedToken(i);var E=new ne;E.addSet(i.getExpectedTokens());var k=E.addSet(this.getErrorRecoverySet(i));this.consumeUntil(i,k)}}}},{key:"reportNoViableAlternative",value:function(i,s){var v,S=i.getTokenStream();v=S!==null?s.startToken.type===n.EOF?"<EOF>":S.getText(new _e(s.startToken.tokenIndex,s.offendingToken.tokenIndex)):"<unknown input>";var E="no viable alternative at input "+this.escapeWSAndQuote(v);i.notifyErrorListeners(E,s.offendingToken,s)}},{key:"reportInputMismatch",value:function(i,s){var v="mismatched input "+this.getTokenErrorDisplay(s.offendingToken)+" expecting "+s.getExpectedTokens().toString(i.literalNames,i.symbolicNames);i.notifyErrorListeners(v,s.offendingToken,s)}},{key:"reportFailedPredicate",value:function(i,s){var v="rule "+i.ruleNames[i._ctx.ruleIndex]+" "+s.message;i.notifyErrorListeners(v,s.offendingToken,s)}},{key:"reportUnwantedToken",value:function(i){if(!this.inErrorRecoveryMode(i)){this.beginErrorCondition(i);var s=i.getCurrentToken(),v="extraneous input "+this.getTokenErrorDisplay(s)+" expecting "+this.getExpectedTokens(i).toString(i.literalNames,i.symbolicNames);i.notifyErrorListeners(v,s,null)}}},{key:"reportMissingToken",value:function(i){if(!this.inErrorRecoveryMode(i)){this.beginErrorCondition(i);var s=i.getCurrentToken(),v="missing "+this.getExpectedTokens(i).toString(i.literalNames,i.symbolicNames)+" at "+this.getTokenErrorDisplay(s);i.notifyErrorListeners(v,s,null)}}},{key:"recoverInline",value:function(i){var s=this.singleTokenDeletion(i);if(s!==null)return i.consume(),s;if(this.singleTokenInsertion(i))return this.getMissingSymbol(i);throw new $s(i)}},{key:"singleTokenInsertion",value:function(i){var s=i.getTokenStream().LA(1),v=i._interp.atn,S=v.states[i.state].transitions[0].target;return!!v.nextTokens(S,i._ctx).contains(s)&&(this.reportMissingToken(i),!0)}},{key:"singleTokenDeletion",value:function(i){var s=i.getTokenStream().LA(2);if(this.getExpectedTokens(i).contains(s)){this.reportUnwantedToken(i),i.consume();var v=i.getCurrentToken();return this.reportMatch(i),v}return null}},{key:"getMissingSymbol",value:function(i){var s,v=i.getCurrentToken(),S=this.getExpectedTokens(i).first();s=S===n.EOF?"<missing EOF>":"<missing "+i.literalNames[S]+">";var E=v,k=i.getTokenStream().LT(-1);return E.type===n.EOF&&k!==null&&(E=k),i.getTokenFactory().create(E.source,S,s,n.DEFAULT_CHANNEL,-1,-1,E.line,E.column)}},{key:"getExpectedTokens",value:function(i){return i.getExpectedTokens()}},{key:"getTokenErrorDisplay",value:function(i){if(i===null)return"<no token>";var s=i.text;return s===null&&(s=i.type===n.EOF?"<EOF>":"<"+i.type+">"),this.escapeWSAndQuote(s)}},{key:"escapeWSAndQuote",value:function(i){return"'"+(i=(i=(i=i.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}},{key:"getErrorRecoverySet",value:function(i){for(var s=i._interp.atn,v=i._ctx,S=new ne;v!==null&&v.invokingState>=0;){var E=s.states[v.invokingState].transitions[0],k=s.nextTokens(E.followState);S.addSet(k),v=v.parentCtx}return S.removeOne(n.EPSILON),S}},{key:"consumeUntil",value:function(i,s){for(var v=i.getTokenStream().LA(1);v!==n.EOF&&!s.contains(v);)i.consume(),v=i.getTokenStream().LA(1)}}],p&&Tg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(function(){function l(){(function(a,f){if(!(a instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l)}var r,p;return r=l,(p=[{key:"reset",value:function(a){}},{key:"recoverInline",value:function(a){}},{key:"recover",value:function(a,f){}},{key:"sync",value:function(a){}},{key:"inErrorRecoveryMode",value:function(a){}},{key:"reportError",value:function(a){}}])&&Sg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}());function Ga(l){return Ga=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ga(l)}function Ag(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ga(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ga(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ga(f)==="symbol"?f:String(f)),a)}var f}function Vh(l,r){return Vh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Vh(l,r)}function Vc(l){return Vc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vc(l)}var Dy=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Vh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Vc(a);if(f){var v=Vc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ga(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(){return function(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}(this,d),c.call(this)}return r=d,p=[{key:"recover",value:function(i,s){for(var v=i._ctx;v!==null;)v.exception=s,v=v.parentCtx;throw new Eg(s)}},{key:"recoverInline",value:function(i){this.recover(i,new $s(i))}},{key:"sync",value:function(i){}}],p&&Ag(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Uh);const xg={RecognitionException:Lo,NoViableAltException:Nc,LexerNoViableAltException:dh,InputMismatchException:$s,FailedPredicateException:Ph,DiagnosticErrorListener:Ay,BailErrorStrategy:Dy,DefaultErrorStrategy:Uh,ErrorListener:Cs};function Ys(l){return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ys(l)}function Og(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ys(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ys(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ys(f)==="symbol"?f:String(f)),a)}var f}var Js=function(){function l(a,f){if(function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,l),this.name="<empty>",this.strdata=a,this.decodeToUnicodeCodePoints=f||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(var c=0;c<this.strdata.length;){var d=this.strdata.codePointAt(c);this.data.push(d),c+=d<=65535?1:2}else{this.data=new Array(this.strdata.length);for(var i=0;i<this.strdata.length;i++)this.data[i]=this.strdata.charCodeAt(i)}this._size=this.data.length}var r,p;return r=l,(p=[{key:"reset",value:function(){this._index=0}},{key:"consume",value:function(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}},{key:"LA",value:function(a){if(a===0)return 0;a<0&&(a+=1);var f=this._index+a-1;return f<0||f>=this._size?n.EOF:this.data[f]}},{key:"LT",value:function(a){return this.LA(a)}},{key:"mark",value:function(){return-1}},{key:"release",value:function(a){}},{key:"seek",value:function(a){a<=this._index?this._index=a:this._index=Math.min(a,this._size)}},{key:"getText",value:function(a,f){if(f>=this._size&&(f=this._size-1),a>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var c="",d=a;d<=f;d++)c+=String.fromCodePoint(this.data[d]);return c}return this.strdata.slice(a,f+1)}},{key:"toString",value:function(){return this.strdata}},{key:"index",get:function(){return this._index}},{key:"size",get:function(){return this._size}}])&&Og(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),l}();function jh(l){return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},jh(l)}function Hh(l,r){return Hh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Hh(l,r)}function jc(l){return jc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jc(l)}var Zs=function(l){(function(d,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");d.prototype=Object.create(i&&i.prototype,{constructor:{value:d,writable:!0,configurable:!0}}),Object.defineProperty(d,"prototype",{writable:!1}),i&&Hh(d,i)})(c,l);var r,p,a,f=(p=c,a=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var d,i=jc(p);if(a){var s=jc(this).constructor;d=Reflect.construct(i,arguments,s)}else d=i.apply(this,arguments);return function(v,S){if(S&&(jh(S)==="object"||typeof S=="function"))return S;if(S!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E}(v)}(this,d)});function c(d,i){return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,c),f.call(this,d,i)}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(Js),Cy=Tr(92);function Ka(l){return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ka(l)}function Dg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ka(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ka(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ka(f)==="symbol"?f:String(f)),a)}var f}function Gh(l,r){return Gh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Gh(l,r)}function Hc(l){return Hc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hc(l)}var ky=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Ry=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Gh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Hc(a);if(f){var v=Hc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ka(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s,v){var S;if(function(k,ee){if(!(k instanceof ee))throw new TypeError("Cannot call a class as a function")}(this,d),!ky)throw new Error("FileStream is only available when running in Node!");var E=Cy.readFileSync(i,s||"utf-8");return(S=c.call(this,E,v)).fileName=i,S}return r=d,p=[{key:"fromPath",value:function(i,s,v){if(!ky)throw new Error("FileStream is only available when running in Node!");Cy.readFile(i,s,function(S,E){var k=null;E!==null&&(k=new Js(E,!0)),v(S,k)})}}],p&&Dg(r,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Zs);const wy={fromString:function(l){return new Js(l,!0)},fromBlob:function(l,r,p,a){var f=new window.FileReader;f.onload=function(c){var d=new Js(c.target.result,!0);p(d)},f.onerror=a,f.readAsText(l,r)},fromBuffer:function(l,r){return new Js(l.toString(r),!0)},fromPath:function(l,r,p){Ry.fromPath(l,r,p)},fromPathSync:function(l,r){return new Ry(l,r)}},Cg={arrayToString:$,stringToCharArray:function(l){for(var r=new Uint16Array(l.length),p=0;p<l.length;p++)r[p]=l.charCodeAt(p);return r}};function Qs(l){return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Qs(l)}function Ny(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Qs(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Qs(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Qs(f)==="symbol"?f:String(f)),a)}var f}function kg(l,r,p){return r&&Ny(l.prototype,r),p&&Ny(l,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function za(l){return za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},za(l)}function Rg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(za(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(za(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),za(f)==="symbol"?f:String(f)),a)}var f}function Kh(l,r){return Kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Kh(l,r)}function Gc(l){return Gc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gc(l)}var Py=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Kh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Gc(a);if(f){var v=Gc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(za(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this)).tokenSource=i,s.tokens=[],s.index=-1,s.fetchedEOF=!1,s}return r=d,(p=[{key:"mark",value:function(){return 0}},{key:"release",value:function(i){}},{key:"reset",value:function(){this.seek(0)}},{key:"seek",value:function(i){this.lazyInit(),this.index=this.adjustSeekIndex(i)}},{key:"size",get:function(){return this.tokens.length}},{key:"get",value:function(i){return this.lazyInit(),this.tokens[i]}},{key:"consume",value:function(){if(!(this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length))&&this.LA(1)===n.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}},{key:"sync",value:function(i){var s=i-this.tokens.length+1;return!(s>0)||this.fetch(s)>=s}},{key:"fetch",value:function(i){if(this.fetchedEOF)return 0;for(var s=0;s<i;s++){var v=this.tokenSource.nextToken();if(v.tokenIndex=this.tokens.length,this.tokens.push(v),v.type===n.EOF)return this.fetchedEOF=!0,s+1}return i}},{key:"getTokens",value:function(i,s,v){if(v===void 0&&(v=null),i<0||s<0)return null;this.lazyInit();var S=[];s>=this.tokens.length&&(s=this.tokens.length-1);for(var E=i;E<s;E++){var k=this.tokens[E];if(k.type===n.EOF)break;(v===null||v.contains(k.type))&&S.push(k)}return S}},{key:"LA",value:function(i){return this.LT(i).type}},{key:"LB",value:function(i){return this.index-i<0?null:this.tokens[this.index-i]}},{key:"LT",value:function(i){if(this.lazyInit(),i===0)return null;if(i<0)return this.LB(-i);var s=this.index+i-1;return this.sync(s),s>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[s]}},{key:"adjustSeekIndex",value:function(i){return i}},{key:"lazyInit",value:function(){this.index===-1&&this.setup()}},{key:"setup",value:function(){this.sync(0),this.index=this.adjustSeekIndex(0)}},{key:"setTokenSource",value:function(i){this.tokenSource=i,this.tokens=[],this.index=-1,this.fetchedEOF=!1}},{key:"nextTokenOnChannel",value:function(i,s){if(this.sync(i),i>=this.tokens.length)return-1;for(var v=this.tokens[i];v.channel!==this.channel;){if(v.type===n.EOF)return-1;i+=1,this.sync(i),v=this.tokens[i]}return i}},{key:"previousTokenOnChannel",value:function(i,s){for(;i>=0&&this.tokens[i].channel!==s;)i-=1;return i}},{key:"getHiddenTokensToRight",value:function(i,s){if(s===void 0&&(s=-1),this.lazyInit(),i<0||i>=this.tokens.length)throw i+" not in 0.."+this.tokens.length-1;var v=this.nextTokenOnChannel(i+1,rr.DEFAULT_TOKEN_CHANNEL),S=i+1,E=v===-1?this.tokens.length-1:v;return this.filterForChannel(S,E,s)}},{key:"getHiddenTokensToLeft",value:function(i,s){if(s===void 0&&(s=-1),this.lazyInit(),i<0||i>=this.tokens.length)throw i+" not in 0.."+this.tokens.length-1;var v=this.previousTokenOnChannel(i-1,rr.DEFAULT_TOKEN_CHANNEL);if(v===i-1)return null;var S=v+1,E=i-1;return this.filterForChannel(S,E,s)}},{key:"filterForChannel",value:function(i,s,v){for(var S=[],E=i;E<s+1;E++){var k=this.tokens[E];v===-1?k.channel!==rr.DEFAULT_TOKEN_CHANNEL&&S.push(k):k.channel===v&&S.push(k)}return S.length===0?null:S}},{key:"getSourceName",value:function(){return this.tokenSource.getSourceName()}},{key:"getText",value:function(i){this.lazyInit(),this.fill(),i||(i=new _e(0,this.tokens.length-1));var s=i.start;s instanceof n&&(s=s.tokenIndex);var v=i.stop;if(v instanceof n&&(v=v.tokenIndex),s===null||v===null||s<0||v<0)return"";v>=this.tokens.length&&(v=this.tokens.length-1);for(var S="",E=s;E<v+1;E++){var k=this.tokens[E];if(k.type===n.EOF)break;S+=k.text}return S}},{key:"fill",value:function(){for(this.lazyInit();this.fetch(1e3)===1e3;);}}])&&Rg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(kg(function l(){(function(r,p){if(!(r instanceof p))throw new TypeError("Cannot call a class as a function")})(this,l)}));function $a(l){return $a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},$a(l)}function wg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if($a(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if($a(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),$a(f)==="symbol"?f:String(f)),a)}var f}function zh(l,r){return zh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},zh(l,r)}function Kc(l){return Kc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kc(l)}Object.defineProperty(Py,"size",{get:function(){return this.tokens.length}});var Iy=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&zh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Kc(a);if(f){var v=Kc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&($a(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s){var v;return function(S,E){if(!(S instanceof E))throw new TypeError("Cannot call a class as a function")}(this,d),(v=c.call(this,i)).channel=s===void 0?n.DEFAULT_CHANNEL:s,v}return r=d,(p=[{key:"adjustSeekIndex",value:function(i){return this.nextTokenOnChannel(i,this.channel)}},{key:"LB",value:function(i){if(i===0||this.index-i<0)return null;for(var s=this.index,v=1;v<=i;)s=this.previousTokenOnChannel(s-1,this.channel),v+=1;return s<0?null:this.tokens[s]}},{key:"LT",value:function(i){if(this.lazyInit(),i===0)return null;if(i<0)return this.LB(-i);for(var s=this.index,v=1;v<i;)this.sync(s+1)&&(s=this.nextTokenOnChannel(s+1,this.channel)),v+=1;return this.tokens[s]}},{key:"getNumberOfOnChannelTokens",value:function(){var i=0;this.fill();for(var s=0;s<this.tokens.length;s++){var v=this.tokens[s];if(v.channel===this.channel&&(i+=1),v.type===n.EOF)break}return i}}])&&wg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Py);function Wa(l){return Wa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Wa(l)}function Ng(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Wa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Wa(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Wa(f)==="symbol"?f:String(f)),a)}var f}function $h(l,r){return $h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},$h(l,r)}function zc(l){return zc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zc(l)}var Pg=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&$h(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=zc(a);if(f){var v=zc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Wa(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this)).parser=i,s}return r=d,(p=[{key:"enterEveryRule",value:function(i){console.log("enter "+this.parser.ruleNames[i.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}},{key:"visitTerminal",value:function(i){console.log("consume "+i.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}},{key:"exitEveryRule",value:function(i){console.log("exit "+this.parser.ruleNames[i.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}])&&Ng(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Ch);function Xa(l){return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Xa(l)}function Ig(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Xa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Xa(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Xa(f)==="symbol"?f:String(f)),a)}var f}function Wh(l,r){return Wh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Wh(l,r)}function $c(l){return $c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$c(l)}var Xh=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Wh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=$c(a);if(f){var v=$c(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Xa(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this))._input=null,s._errHandler=new Uh,s._precedenceStack=[],s._precedenceStack.push(0),s._ctx=null,s.buildParseTrees=!0,s._tracer=null,s._parseListeners=null,s._syntaxErrors=0,s.setInputStream(i),s}return r=d,p=[{key:"reset",value:function(){this._input!==null&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),this._interp!==null&&this._interp.reset()}},{key:"match",value:function(i){var s=this.getCurrentToken();return s.type===i?(this._errHandler.reportMatch(this),this.consume()):(s=this._errHandler.recoverInline(this),this.buildParseTrees&&s.tokenIndex===-1&&this._ctx.addErrorNode(s)),s}},{key:"matchWildcard",value:function(){var i=this.getCurrentToken();return i.type>0?(this._errHandler.reportMatch(this),this.consume()):(i=this._errHandler.recoverInline(this),this.buildParseTrees&&i.tokenIndex===-1&&this._ctx.addErrorNode(i)),i}},{key:"getParseListeners",value:function(){return this._parseListeners||[]}},{key:"addParseListener",value:function(i){if(i===null)throw"listener";this._parseListeners===null&&(this._parseListeners=[]),this._parseListeners.push(i)}},{key:"removeParseListener",value:function(i){if(this._parseListeners!==null){var s=this._parseListeners.indexOf(i);s>=0&&this._parseListeners.splice(s,1),this._parseListeners.length===0&&(this._parseListeners=null)}}},{key:"removeParseListeners",value:function(){this._parseListeners=null}},{key:"triggerEnterRuleEvent",value:function(){if(this._parseListeners!==null){var i=this._ctx;this._parseListeners.forEach(function(s){s.enterEveryRule(i),i.enterRule(s)})}}},{key:"triggerExitRuleEvent",value:function(){if(this._parseListeners!==null){var i=this._ctx;this._parseListeners.slice(0).reverse().forEach(function(s){i.exitRule(s),s.exitEveryRule(i)})}}},{key:"getTokenFactory",value:function(){return this._input.tokenSource._factory}},{key:"setTokenFactory",value:function(i){this._input.tokenSource._factory=i}},{key:"getATNWithBypassAlts",value:function(){var i=this.getSerializedATN();if(i===null)throw"The current parser does not support an ATN with bypass alternatives.";var s=this.bypassAltsAtnCache[i];if(s===null){var v=new As;v.generateRuleBypassTransitions=!0,s=new ih(v).deserialize(i),this.bypassAltsAtnCache[i]=s}return s}},{key:"getInputStream",value:function(){return this.getTokenStream()}},{key:"setInputStream",value:function(i){this.setTokenStream(i)}},{key:"getTokenStream",value:function(){return this._input}},{key:"setTokenStream",value:function(i){this._input=null,this.reset(),this._input=i}},{key:"syntaxErrorsCount",get:function(){return this._syntaxErrors}},{key:"getCurrentToken",value:function(){return this._input.LT(1)}},{key:"notifyErrorListeners",value:function(i,s,v){v=v||null,(s=s||null)===null&&(s=this.getCurrentToken()),this._syntaxErrors+=1;var S=s.line,E=s.column;this.getErrorListenerDispatch().syntaxError(this,s,S,E,i,v)}},{key:"consume",value:function(){var i=this.getCurrentToken();i.type!==n.EOF&&this.getInputStream().consume();var s,v=this._parseListeners!==null&&this._parseListeners.length>0;return(this.buildParseTrees||v)&&((s=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(i):this._ctx.addTokenNode(i)).invokingState=this.state,v&&this._parseListeners.forEach(function(S){s instanceof zr||s.isErrorNode!==void 0&&s.isErrorNode()?S.visitErrorNode(s):s instanceof on&&S.visitTerminal(s)})),i}},{key:"addContextToParseTree",value:function(){this._ctx.parentCtx!==null&&this._ctx.parentCtx.addChild(this._ctx)}},{key:"enterRule",value:function(i,s,v){this.state=s,this._ctx=i,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}},{key:"exitRule",value:function(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}},{key:"enterOuterAlt",value:function(i,s){i.setAltNumber(s),this.buildParseTrees&&this._ctx!==i&&this._ctx.parentCtx!==null&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(i)),this._ctx=i}},{key:"getPrecedence",value:function(){return this._precedenceStack.length===0?-1:this._precedenceStack[this._precedenceStack.length-1]}},{key:"enterRecursionRule",value:function(i,s,v,S){this.state=s,this._precedenceStack.push(S),this._ctx=i,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}},{key:"pushNewRecursionContext",value:function(i,s,v){var S=this._ctx;S.parentCtx=i,S.invokingState=s,S.stop=this._input.LT(-1),this._ctx=i,this._ctx.start=S.start,this.buildParseTrees&&this._ctx.addChild(S),this.triggerEnterRuleEvent()}},{key:"unrollRecursionContexts",value:function(i){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var s=this._ctx,v=this.getParseListeners();if(v!==null&&v.length>0)for(;this._ctx!==i;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=i;s.parentCtx=i,this.buildParseTrees&&i!==null&&i.addChild(s)}},{key:"getInvokingContext",value:function(i){for(var s=this._ctx;s!==null;){if(s.ruleIndex===i)return s;s=s.parentCtx}return null}},{key:"precpred",value:function(i,s){return s>=this._precedenceStack[this._precedenceStack.length-1]}},{key:"inContext",value:function(i){return!1}},{key:"isExpectedToken",value:function(i){var s=this._interp.atn,v=this._ctx,S=s.states[this.state],E=s.nextTokens(S);if(E.contains(i))return!0;if(!E.contains(n.EPSILON))return!1;for(;v!==null&&v.invokingState>=0&&E.contains(n.EPSILON);){var k=s.states[v.invokingState].transitions[0];if((E=s.nextTokens(k.followState)).contains(i))return!0;v=v.parentCtx}return!(!E.contains(n.EPSILON)||i!==n.EOF)}},{key:"getExpectedTokens",value:function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}},{key:"getExpectedTokensWithinCurrentRule",value:function(){var i=this._interp.atn,s=i.states[this.state];return i.nextTokens(s)}},{key:"getRuleIndex",value:function(i){var s=this.getRuleIndexMap()[i];return s!==null?s:-1}},{key:"getRuleInvocationStack",value:function(i){(i=i||null)===null&&(i=this._ctx);for(var s=[];i!==null;){var v=i.ruleIndex;v<0?s.push("n/a"):s.push(this.ruleNames[v]),i=i.parentCtx}return s}},{key:"getDFAStrings",value:function(){return this._interp.decisionToDFA.toString()}},{key:"dumpDFA",value:function(){for(var i=!1,s=0;s<this._interp.decisionToDFA.length;s++){var v=this._interp.decisionToDFA[s];v.states.length>0&&(i&&console.log(),this.printer.println("Decision "+v.decision+":"),this.printer.print(v.toString(this.literalNames,this.symbolicNames)),i=!0)}}},{key:"getSourceName",value:function(){return this._input.sourceName}},{key:"setTrace",value:function(i){i?(this._tracer!==null&&this.removeParseListener(this._tracer),this._tracer=new Pg(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}],p&&Ig(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Tc);function qa(l){return qa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qa(l)}function Fg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(qa(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(qa(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),qa(f)==="symbol"?f:String(f)),a)}var f}function qh(l,r){return qh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},qh(l,r)}function Wc(l){return Wc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wc(l)}Xh.bypassAltsAtnCache={};var Fy=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&qh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Wc(a);if(f){var v=Wc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(qa(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){var s;return function(v,S){if(!(v instanceof S))throw new TypeError("Cannot call a class as a function")}(this,d),(s=c.call(this)).parentCtx=null,s.symbol=i,s}return r=d,(p=[{key:"getChild",value:function(i){return null}},{key:"getSymbol",value:function(){return this.symbol}},{key:"getParent",value:function(){return this.parentCtx}},{key:"getPayload",value:function(){return this.symbol}},{key:"getSourceInterval",value:function(){if(this.symbol===null)return _e.INVALID_INTERVAL;var i=this.symbol.tokenIndex;return new _e(i,i)}},{key:"getChildCount",value:function(){return 0}},{key:"accept",value:function(i){return i.visitTerminal(this)}},{key:"getText",value:function(){return this.symbol.text}},{key:"toString",value:function(){return this.symbol.type===n.EOF?"<EOF>":this.symbol.text}}])&&Fg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(on);function Ya(l){return Ya=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ya(l)}function Mg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ya(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ya(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ya(f)==="symbol"?f:String(f)),a)}var f}function Yh(l,r){return Yh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Yh(l,r)}function Xc(l){return Xc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xc(l)}var My=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Yh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=Xc(a);if(f){var v=Xc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ya(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i){return function(s,v){if(!(s instanceof v))throw new TypeError("Cannot call a class as a function")}(this,d),c.call(this,i)}return r=d,(p=[{key:"isErrorNode",value:function(){return!0}},{key:"accept",value:function(i){return i.visitErrorNode(this)}}])&&Mg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Fy);function Ja(l){return Ja=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ja(l)}function Lg(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,(f=function(c,d){if(Ja(c)!=="object"||c===null)return c;var i=c[Symbol.toPrimitive];if(i!==void 0){var s=i.call(c,"string");if(Ja(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a.key),Ja(f)==="symbol"?f:String(f)),a)}var f}function Jh(l,r){return Jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},Jh(l,r)}function qc(l){return qc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qc(l)}var Zh=function(l){(function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(s&&s.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),s&&Jh(i,s)})(d,l);var r,p,a,f,c=(a=d,f=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var i,s=qc(a);if(f){var v=qc(this).constructor;i=Reflect.construct(s,arguments,v)}else i=s.apply(this,arguments);return function(S,E){if(E&&(Ja(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}(S)}(this,i)});function d(i,s){var v;return function(S,E){if(!(S instanceof E))throw new TypeError("Cannot call a class as a function")}(this,d),(v=c.call(this,i,s)).children=null,v.start=null,v.stop=null,v.exception=null,v}return r=d,(p=[{key:"copyFrom",value:function(i){this.parentCtx=i.parentCtx,this.invokingState=i.invokingState,this.children=null,this.start=i.start,this.stop=i.stop,i.children&&(this.children=[],i.children.map(function(s){s instanceof My&&(this.children.push(s),s.parentCtx=this)},this))}},{key:"enterRule",value:function(i){}},{key:"exitRule",value:function(i){}},{key:"addChild",value:function(i){return this.children===null&&(this.children=[]),this.children.push(i),i}},{key:"removeLastChild",value:function(){this.children!==null&&this.children.pop()}},{key:"addTokenNode",value:function(i){var s=new Fy(i);return this.addChild(s),s.parentCtx=this,s}},{key:"addErrorNode",value:function(i){var s=new My(i);return this.addChild(s),s.parentCtx=this,s}},{key:"getChild",value:function(i,s){if(s=s||null,this.children===null||i<0||i>=this.children.length)return null;if(s===null)return this.children[i];for(var v=0;v<this.children.length;v++){var S=this.children[v];if(S instanceof s){if(i===0)return S;i-=1}}return null}},{key:"getToken",value:function(i,s){if(this.children===null||s<0||s>=this.children.length)return null;for(var v=0;v<this.children.length;v++){var S=this.children[v];if(S instanceof on&&S.symbol.type===i){if(s===0)return S;s-=1}}return null}},{key:"getTokens",value:function(i){if(this.children===null)return[];for(var s=[],v=0;v<this.children.length;v++){var S=this.children[v];S instanceof on&&S.symbol.type===i&&s.push(S)}return s}},{key:"getTypedRuleContext",value:function(i,s){return this.getChild(s,i)}},{key:"getTypedRuleContexts",value:function(i){if(this.children===null)return[];for(var s=[],v=0;v<this.children.length;v++){var S=this.children[v];S instanceof i&&s.push(S)}return s}},{key:"getChildCount",value:function(){return this.children===null?0:this.children.length}},{key:"getSourceInterval",value:function(){return this.start===null||this.stop===null?_e.INVALID_INTERVAL:new _e(this.start.tokenIndex,this.stop.tokenIndex)}}])&&Lg(r.prototype,p),Object.defineProperty(r,"prototype",{writable:!1}),d}(Wi);function Qh(l,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(r&&r.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),r&&ep(l,r)}function ep(l,r){return ep=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,a){return p.__proto__=a,p},ep(l,r)}function tp(l){var r=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var p,a=Yc(l);if(r){var f=Yc(this).constructor;p=Reflect.construct(a,arguments,f)}else p=a.apply(this,arguments);return function(c,d){if(d&&(Za(d)==="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}(c)}(this,p)}}function Yc(l){return Yc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yc(l)}function Za(l){return Za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Za(l)}function Qa(l,r){var p=typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(!p){if(Array.isArray(l)||(p=function(s,v){if(s){if(typeof s=="string")return Ly(s,v);var S=Object.prototype.toString.call(s).slice(8,-1);return S==="Object"&&s.constructor&&(S=s.constructor.name),S==="Map"||S==="Set"?Array.from(s):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?Ly(s,v):void 0}}(l))||r&&l&&typeof l.length=="number"){p&&(l=p);var a=0,f=function(){};return{s:f,n:function(){return a>=l.length?{done:!0}:{done:!1,value:l[a++]}},e:function(s){throw s},f}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
10
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,i=!1;return{s:function(){p=p.call(l)},n:function(){var s=p.next();return d=s.done,s},e:function(s){i=!0,c=s},f:function(){try{d||p.return==null||p.return()}finally{if(i)throw c}}}}function Ly(l,r){(r==null||r>l.length)&&(r=l.length);for(var p=0,a=new Array(r);p<r;p++)a[p]=l[p];return a}function eu(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function By(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,Uy(a.key),a)}}function tu(l,r,p){return r&&By(l.prototype,r),p&&By(l,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function Uy(l){var r=function(p,a){if(Za(p)!=="object"||p===null)return p;var f=p[Symbol.toPrimitive];if(f!==void 0){var c=f.call(p,"string");if(Za(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}(l);return Za(r)==="symbol"?r:String(r)}Wi.EMPTY=new Zh;var Jc,Zc,np,Vy=function(){function l(r){eu(this,l),this.tokens=r,this.programs=new Map}return tu(l,[{key:"getTokenStream",value:function(){return this.tokens}},{key:"insertAfter",value:function(r,p){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(f),d=new Hy(this.tokens,a,c.length,p);c.push(d)}},{key:"insertBefore",value:function(r,p){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(f),d=new es(this.tokens,a,c.length,p);c.push(d)}},{key:"replaceSingle",value:function(r,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;this.replace(r,r,p,a)}},{key:"replace",value:function(r,p,a){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l.DEFAULT_PROGRAM_NAME;if(typeof r!="number"&&(r=r.tokenIndex),typeof p!="number"&&(p=p.tokenIndex),r>p||r<0||p<0||p>=this.tokens.size)throw new RangeError("replace: range invalid: ".concat(r,"..").concat(p,"(size=").concat(this.tokens.size,")"));var c=this.getProgram(f),d=new Qc(this.tokens,r,p,c.length,a);c.push(d)}},{key:"delete",value:function(r,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;p===void 0&&(p=r),this.replace(r,p,null,a)}},{key:"getProgram",value:function(r){var p=this.programs.get(r);return p==null&&(p=this.initializeProgram(r)),p}},{key:"initializeProgram",value:function(r){var p=[];return this.programs.set(r,p),p}},{key:"getText",value:function(r){var p,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l.DEFAULT_PROGRAM_NAME;p=r instanceof _e?r:new _e(0,this.tokens.size-1),typeof r=="string"&&(a=r);var f=this.programs.get(a),c=p.start,d=p.stop;if(d>this.tokens.size-1&&(d=this.tokens.size-1),c<0&&(c=0),f==null||f.length===0)return this.tokens.getText(new _e(c,d));for(var i=[],s=this.reduceToSingleOperationPerIndex(f),v=c;v<=d&&v<this.tokens.size;){var S=s.get(v);s.delete(v);var E=this.tokens.get(v);S==null?(E.type!==n.EOF&&i.push(String(E.text)),v++):v=S.execute(i)}if(d===this.tokens.size-1){var k,ee=Qa(s.values());try{for(ee.s();!(k=ee.n()).done;){var Ce=k.value;Ce.index>=this.tokens.size-1&&i.push(Ce.text.toString())}}catch(xe){ee.e(xe)}finally{ee.f()}}return i.join("")}},{key:"reduceToSingleOperationPerIndex",value:function(r){for(var p=0;p<r.length;p++){var a=r[p];if(a!=null&&a instanceof Qc){var f,c=a,d=Qa(this.getKindOfOps(r,es,p));try{for(d.s();!(f=d.n()).done;){var i=f.value;i.index===c.index?(r[i.instructionIndex]=void 0,c.text=i.text.toString()+(c.text!=null?c.text.toString():"")):i.index>c.index&&i.index<=c.lastIndex&&(r[i.instructionIndex]=void 0)}}catch(Sr){d.e(Sr)}finally{d.f()}var s,v=Qa(this.getKindOfOps(r,Qc,p));try{for(v.s();!(s=v.n()).done;){var S=s.value;if(S.index>=c.index&&S.lastIndex<=c.lastIndex)r[S.instructionIndex]=void 0;else{var E=S.lastIndex<c.index||S.index>c.lastIndex;if(S.text!=null||c.text!=null||E){if(!E)throw new Error("replace op boundaries of ".concat(c," overlap with previous ").concat(S))}else r[S.instructionIndex]=void 0,c.index=Math.min(S.index,c.index),c.lastIndex=Math.max(S.lastIndex,c.lastIndex)}}}catch(Sr){v.e(Sr)}finally{v.f()}}}for(var k=0;k<r.length;k++){var ee=r[k];if(ee!=null&&ee instanceof es){var Ce,xe=ee,Ge=Qa(this.getKindOfOps(r,es,k));try{for(Ge.s();!(Ce=Ge.n()).done;){var at=Ce.value;at.index===xe.index&&(at instanceof Hy?(xe.text=this.catOpText(at.text,xe.text),r[at.instructionIndex]=void 0):at instanceof es&&(xe.text=this.catOpText(xe.text,at.text),r[at.instructionIndex]=void 0))}}catch(Sr){Ge.e(Sr)}finally{Ge.f()}var $e,yn=Qa(this.getKindOfOps(r,Qc,k));try{for(yn.s();!($e=yn.n()).done;){var hn=$e.value;if(xe.index!==hn.index){if(xe.index>=hn.index&&xe.index<=hn.lastIndex)throw new Error("insert op ".concat(xe," within boundaries of previous ").concat(hn))}else hn.text=this.catOpText(xe.text,hn.text),r[k]=void 0}}catch(Sr){yn.e(Sr)}finally{yn.f()}}}var Gn,Fr=new Map,Di=Qa(r);try{for(Di.s();!(Gn=Di.n()).done;){var Ci=Gn.value;if(Ci!=null){if(Fr.get(Ci.index)!=null)throw new Error("should only be one op per index");Fr.set(Ci.index,Ci)}}}catch(Sr){Di.e(Sr)}finally{Di.f()}return Fr}},{key:"catOpText",value:function(r,p){var a="",f="";return r!=null&&(a=r.toString()),p!=null&&(f=p.toString()),a+f}},{key:"getKindOfOps",value:function(r,p,a){return r.slice(0,a).filter(function(f){return f&&f instanceof p})}}]),l}();Jc=Vy,np="default",(Zc=Uy(Zc="DEFAULT_PROGRAM_NAME"))in Jc?Object.defineProperty(Jc,Zc,{value:np,enumerable:!0,configurable:!0,writable:!0}):Jc[Zc]=np;var jy=function(){function l(r,p,a,f){eu(this,l),this.tokens=r,this.instructionIndex=a,this.index=p,this.text=f===void 0?"":f}return tu(l,[{key:"toString",value:function(){var r=this.constructor.name,p=r.indexOf("$");return"<"+(r=r.substring(p+1,r.length))+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}]),l}(),es=function(l){Qh(p,l);var r=tp(p);function p(a,f,c,d){return eu(this,p),r.call(this,a,f,c,d)}return tu(p,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.tokens.get(this.index).type!==n.EOF&&a.push(String(this.tokens.get(this.index).text)),this.index+1}}]),p}(jy),Hy=function(l){Qh(p,l);var r=tp(p);function p(a,f,c,d){return eu(this,p),r.call(this,a,f+1,c,d)}return tu(p)}(es),Qc=function(l){Qh(p,l);var r=tp(p);function p(a,f,c,d,i){var s;return eu(this,p),(s=r.call(this,a,f,d,i)).lastIndex=c,s}return tu(p,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.lastIndex+1}},{key:"toString",value:function(){return this.text==null?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}]),p}(jy);const Bg={atn:ug,dfa:hg,context:pg,misc:dg,tree:gg,error:xg,Token:n,CommonToken:Rs,CharStreams:wy,CharStream:Zs,InputStream:Zs,CommonTokenStream:Iy,Lexer:rr,Parser:Xh,ParserRuleContext:Zh,Interval:_e,IntervalSet:ne,LL1Analyzer:Fo,Utils:Cg,TokenStreamRewriter:Vy}})();var Mr=kt.dx,rp=kt.q2;kt.FO,kt.xf,kt.Gy;var Gy=kt.s4,Ky=kt.c7,ip=kt._7;kt.gp;var zy=kt.cK,$y=kt.zs,Wy=kt.AV;kt.Xp,kt.VS,kt.ul;var Xy=kt.hW,qy=kt.x1,fi=kt.z5;kt.oN;var Yy=kt.TB;kt.u1;var Jy=kt._b,Zy=kt.$F,Qe=kt._T,op=kt.db,Qy=kt.Zx,et=kt._x;kt.r8,kt.JI,kt.TP;var ap=kt.WU;kt.Nj,kt.ZP;const M=class M extends Jy{get grammarFileName(){return"tccScriptParser.g4"}get literalNames(){return M.literalNames}get symbolicNames(){return M.symbolicNames}get ruleNames(){return M.ruleNames}get serializedATN(){return M._serializedATN}createFailedPredicateException(e,n){return new $y(this,e,n)}constructor(e){super(e),this._interp=new Zy(this,M._ATN,M.DecisionsToDFA,new op)}program(){let e=new em(this,this._ctx,this.state);this.enterRule(e,0,M.RULE_program);let n;try{this.enterOuterAlt(e,1);{for(this.state=102,this._errHandler.sync(this),n=this._input.LA(1);n===4||n===6||!(n-36&-32)&&1<<n-36&10848503;){switch(this.state=100,this._errHandler.sync(this),this._input.LA(1)){case 59:this.state=98,this.match(M.NEWLINE);break;case 4:case 6:case 36:case 37:case 38:case 40:case 41:case 42:case 43:case 47:case 51:case 52:case 54:case 57:this.state=99,this.globalStmt();break;default:throw new fi(this)}this.state=104,this._errHandler.sync(this),n=this._input.LA(1)}this.state=105,this.match(M.EOF)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}globalStmt(){let e=new el(this,this._ctx,this.state);this.enterRule(e,2,M.RULE_globalStmt);let n;try{switch(this.state=118,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,3,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=107,this.variableDeclarationStmt(),this.state=109,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=108,this.match(M.Comma)),this.state=111,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=113,this.blockStmt();break;case 3:this.enterOuterAlt(e,3),this.state=114,this.importStmt();break;case 4:this.enterOuterAlt(e,4),this.state=115,this.arrowFunction();break;case 5:this.enterOuterAlt(e,5),this.state=116,this.arrowMethod();break;case 6:this.enterOuterAlt(e,6),this.state=117,this.typeStatement();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockStmt(){let e=new sp(this,this._ctx,this.state);this.enterRule(e,4,M.RULE_blockStmt);try{let n;this.enterOuterAlt(e,1);{for(this.state=125,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=120,this.variableDeclarationStmt(),this.state=121,this.match(M.Comma)),this.state=127,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);switch(this.state=130,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=128,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=129,this.blockExpression();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}stmt(){let e=new tl(this,this._ctx,this.state);this.enterRule(e,6,M.RULE_stmt);let n;try{switch(this.state=139,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,7,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=132,this.simpleStmt(),this.state=134,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=133,this.match(M.Comma)),this.state=136,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=138,this.expressionBlockSequence();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}simpleStmt(){let e=new nl(this,this._ctx,this.state);this.enterRule(e,8,M.RULE_simpleStmt);try{switch(this.state=145,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,8,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=141,this.expressionSequence();break;case 2:this.enterOuterAlt(e,2),this.state=142,this.blockSequence();break;case 3:this.enterOuterAlt(e,3),this.state=143,this.brackethesized();break;case 4:this.enterOuterAlt(e,4),this.state=144,this.flowStmt();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}flowStmt(){let e=new up(this,this._ctx,this.state);this.enterRule(e,10,M.RULE_flowStmt);let n;try{this.enterOuterAlt(e,1),this.state=147,n=this._input.LA(1),n===34||n===39?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}block(){let e=new ts(this,this._ctx,this.state);this.enterRule(e,12,M.RULE_block);let n;try{switch(this.state=156,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 12:case 13:case 31:case 32:case 33:case 34:case 38:case 39:case 40:case 46:case 51:case 54:case 55:case 56:case 57:this.enterOuterAlt(e,1),this.state=149,this.simpleStmt(),this.state=151,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=150,this.match(M.Comma)),this.state=153,this.match(M.NEWLINE);break;case 59:this.enterOuterAlt(e,2),this.state=155,this.blockLine();break;default:throw new fi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockLine(){let e=new fo(this,this._ctx,this.state);this.enterRule(e,14,M.RULE_blockLine);let n;try{this.enterOuterAlt(e,1);{this.state=158,this.match(M.NEWLINE),this.state=159,this.match(M.INDENT),this.state=161,this._errHandler.sync(this),n=this._input.LA(1);do this.state=160,this.stmt(),this.state=163,this._errHandler.sync(this),n=this._input.LA(1);while(!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63459303);this.state=165,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}variableDeclarationStmt(){let e=new nu(this,this._ctx,this.state);this.enterRule(e,16,M.RULE_variableDeclarationStmt);try{let n;this.enterOuterAlt(e,1);{switch(this.state=169,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,12,this._ctx)){case 1:this.state=167,this.methodStmt();break;case 2:this.state=168,this.variableDeclarationList();break}for(this.state=178,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=171,this.match(M.Comma),this.state=174,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,13,this._ctx)){case 1:this.state=172,this.methodStmt();break;case 2:this.state=173,this.variableDeclarationList();break}this.state=180,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}variableDeclarationList(){let e=new ki(this,this._ctx,this.state);this.enterRule(e,18,M.RULE_variableDeclarationList);try{switch(this.state=189,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,15,this._ctx)){case 1:e=new nm(this,e),this.enterOuterAlt(e,1),this.state=181,this.varArrayDeclaration(),this.state=182,this.match(M.Assign),this.state=183,this.singleExpression(0);break;case 2:e=new tm(this,e),this.enterOuterAlt(e,2),this.state=185,this.name(),this.state=186,this.assignmentOperator(),this.state=187,this.singleExpression(0);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varModifier(){let e=new rl(this,this._ctx,this.state);this.enterRule(e,20,M.RULE_varModifier);let n;try{this.enterOuterAlt(e,1),this.state=191,n=this._input.LA(1),n===38||n===40?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockSequence(){let e=new cp(this,this._ctx,this.state);this.enterRule(e,22,M.RULE_blockSequence);try{let n;this.enterOuterAlt(e,1);{switch(this.state=195,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,16,this._ctx)){case 1:this.state=193,this.singleExpression(0);break;case 2:this.state=194,this.variableDeclarationList();break}for(this.state=204,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=197,this.match(M.Comma),this.state=200,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,17,this._ctx)){case 1:this.state=198,this.singleExpression(0);break;case 2:this.state=199,this.variableDeclarationList();break}this.state=206,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionSequence(){let e=new il(this,this._ctx,this.state);this.enterRule(e,24,M.RULE_expressionSequence);try{let n;for(this.enterOuterAlt(e,1),this.state=207,this.singleExpression(0),this.state=212,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=208,this.match(M.Comma),this.state=209,this.singleExpression(0)),this.state=214,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionBlockSequence(){let e=new lp(this,this._ctx,this.state);this.enterRule(e,26,M.RULE_expressionBlockSequence);try{let n;this.enterOuterAlt(e,1);{for(this.state=223,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=217,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,20,this._ctx)){case 1:this.state=215,this.singleExpression(0);break;case 2:this.state=216,this.variableDeclarationList();break}this.state=219,this.match(M.Comma)}this.state=225,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx)}switch(this.state=228,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=226,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=227,this.blockExpression();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varBlockStmt(){let e=new ol(this,this._ctx,this.state);this.enterRule(e,28,M.RULE_varBlockStmt);try{this.enterOuterAlt(e,1);{switch(this.state=236,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,23,this._ctx)){case 1:this.state=230,this.varArrayDeclaration(),this.state=231,this.match(M.Assign);break;case 2:this.state=233,this.name(),this.state=234,this.assignmentOperator();break}this.state=238,this.blockExpression()}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varArrayDeclaration(){let e=new ns(this,this._ctx,this.state);this.enterRule(e,30,M.RULE_varArrayDeclaration);let n;try{switch(this.state=258,this._errHandler.sync(this),this._input.LA(1)){case 38:case 40:case 51:case 54:case 57:e=new im(this,e),this.enterOuterAlt(e,1);{switch(this.state=241,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=240,this.varModifier()),this.state=244,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,25,this._ctx)){case 1:this.state=243,this.typeGather();break}this.state=246,this.identifier()}break;case 4:e=new rm(this,e),this.enterOuterAlt(e,2);{for(this.state=247,this.match(M.OpenBracket),this.state=248,this.identifier(),this.state=253,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=249,this.match(M.Comma),this.state=250,this.identifier(),this.state=255,this._errHandler.sync(this),n=this._input.LA(1);this.state=256,this.match(M.CloseBracket)}break;default:throw new fi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockExpression(){let e=new ru(this,this._ctx,this.state);this.enterRule(e,32,M.RULE_blockExpression);try{switch(this.state=264,this._errHandler.sync(this),this._input.LA(1)){case 43:this.enterOuterAlt(e,1),this.state=260,this.ifStatement();break;case 37:this.enterOuterAlt(e,2),this.state=261,this.forStatement();break;case 42:this.enterOuterAlt(e,3),this.state=262,this.whileStatement();break;case 41:this.enterOuterAlt(e,4),this.state=263,this.switchStatement();break;default:throw new fi(this)}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}singleExpression(e){e===void 0&&(e=0);let n=this._ctx,o=this.state,u=new Ve(this,this._ctx,o),h=u,m=34;this.enterRecursionRule(u,34,M.RULE_singleExpression,e);let _;try{let T;this.enterOuterAlt(u,1);{switch(this.state=278,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:u=new mm(this,u),this._ctx=u,h=u,this.state=267,this.methodStmt();break;case 2:u=new pm(this,u),this._ctx=u,h=u,this.state=268,_=this._input.LA(1),_===12||_===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=269,this.singleExpression(12);break;case 3:u=new dm(this,u),this._ctx=u,h=u,this.state=270,this.match(M.Not),this.state=271,this.singleExpression(11);break;case 4:u=new lm(this,u),this._ctx=u,h=u,this.state=272,this.name();break;case 5:u=new fm(this,u),this._ctx=u,h=u,this.state=273,this.literal();break;case 6:u=new om(this,u),this._ctx=u,h=u,this.state=274,this.match(M.OpenParen),this.state=275,this.singleExpression(0),this.state=276,this.match(M.CloseParen);break}for(this._ctx.stop=this._input.LT(-1),this.state=311,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,31,this._ctx);T!==2&&T!==Mr.INVALID_ALT_NUMBER;){if(T===1)switch(this._parseListeners!=null&&this.triggerExitRuleEvent(),h=u,this.state=309,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,30,this._ctx)){case 1:{if(u=new gm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=280,!this.precpred(this._ctx,10))throw this.createFailedPredicateException("this.precpred(this._ctx, 10)");this.state=281,_=this._input.LA(1),!(_&-32)&&1<<_&114688?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=282,this.singleExpression(11)}break;case 2:{if(u=new am(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=283,!this.precpred(this._ctx,9))throw this.createFailedPredicateException("this.precpred(this._ctx, 9)");this.state=284,_=this._input.LA(1),_===12||_===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=285,this.singleExpression(10)}break;case 3:{if(u=new sm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=286,!this.precpred(this._ctx,8))throw this.createFailedPredicateException("this.precpred(this._ctx, 8)");this.state=287,_=this._input.LA(1),!(_&-32)&&1<<_&3932160?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=288,this.singleExpression(9)}break;case 4:{if(u=new _m(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=289,!this.precpred(this._ctx,7))throw this.createFailedPredicateException("this.precpred(this._ctx, 7)");this.state=290,_=this._input.LA(1),_===22||_===23?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=291,this.singleExpression(8)}break;case 5:{if(u=new cm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=292,!this.precpred(this._ctx,6))throw this.createFailedPredicateException("this.precpred(this._ctx, 6)");this.state=293,this.match(M.And),this.state=294,this.singleExpression(7)}break;case 6:{if(u=new hm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=295,!this.precpred(this._ctx,5))throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");this.state=296,this.match(M.Or),this.state=297,this.singleExpression(6)}break;case 7:{if(u=new um(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=298,!this.precpred(this._ctx,4))throw this.createFailedPredicateException("this.precpred(this._ctx, 4)");this.state=299,this.match(M.QuestionMark),this.state=300,this.singleExpression(0),this.state=301,this.match(M.Colon),this.state=302,this.singleExpression(4)}break;case 8:{if(u=new ym(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=304,!this.precpred(this._ctx,13))throw this.createFailedPredicateException("this.precpred(this._ctx, 13)");this.state=305,this.match(M.OpenBracket),this.state=306,this.singleExpression(0),this.state=307,this.match(M.CloseBracket)}break}this.state=313,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,31,this._ctx)}}}catch(T){if(T instanceof et)u.exception=T,this._errHandler.reportError(this,T),this._errHandler.recover(this,T);else throw T}finally{this.unrollRecursionContexts(n)}return u}brackethesized(){let e=new al(this,this._ctx,this.state);this.enterRule(e,36,M.RULE_brackethesized);try{this.enterOuterAlt(e,1),this.state=314,this.match(M.OpenBracket),this.state=315,this.expressionSequence(),this.state=316,this.match(M.CloseBracket)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}arguments(){let e=new fp(this,this._ctx,this.state);this.enterRule(e,38,M.RULE_arguments);let n;try{let o;this.enterOuterAlt(e,1);{if(this.state=318,this.match(M.OpenParen),this.state=330,this._errHandler.sync(this),n=this._input.LA(1),!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63455235){for(this.state=319,this.argument(),this.state=324,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=320,this.match(M.Comma),this.state=321,this.argument()),this.state=326,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);this.state=328,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=327,this.match(M.Comma))}this.state=332,this.match(M.CloseParen)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}argument(){let e=new sl(this,this._ctx,this.state);this.enterRule(e,40,M.RULE_argument);try{this.enterOuterAlt(e,1);{switch(this.state=337,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,35,this._ctx)){case 1:this.state=334,this.identifier(),this.state=335,this.match(M.Assign);break}switch(this.state=341,this._errHandler.sync(this),this._input.LA(1)){case 6:case 12:case 13:case 31:case 32:case 33:case 46:case 51:case 54:case 55:case 56:case 57:this.state=339,this.singleExpression(0);break;case 4:this.state=340,this.brackethesized();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}ifStatement(){let e=new hp(this,this._ctx,this.state);this.enterRule(e,42,M.RULE_ifStatement);let n;try{let o;this.enterOuterAlt(e,1);{for(this.state=343,this.match(M.If),this.state=344,this.singleExpression(0),this.state=345,this.blockLine(),this.state=353,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=346,this.match(M.Else),this.state=347,this.match(M.If),this.state=348,this.singleExpression(0),this.state=349,this.blockLine()),this.state=355,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);this.state=358,this._errHandler.sync(this),n=this._input.LA(1),n===48&&(this.state=356,this.match(M.Else),this.state=357,this.blockLine())}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}forStatement(){let e=new iu(this,this._ctx,this.state);this.enterRule(e,44,M.RULE_forStatement);let n;try{switch(this.state=392,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,43,this._ctx)){case 1:e=new bm(this,e),this.enterOuterAlt(e,1);{switch(this.state=360,this.match(M.For),this.state=362,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=361,this.varModifier()),this.state=365,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,40,this._ctx)){case 1:this.state=364,this.typeGather();break}this.state=367,this.identifier(),this.state=368,this.match(M.Assign),this.state=369,this.singleExpression(0),this.state=370,this.match(M.To),this.state=371,this.singleExpression(0),this.state=374,this._errHandler.sync(this),n=this._input.LA(1),n===50&&(this.state=372,this.match(M.By),this.state=373,this.singleExpression(0)),this.state=376,this.blockLine()}break;case 2:e=new vm(this,e),this.enterOuterAlt(e,2);{switch(this.state=378,this.match(M.For),this.state=386,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:this.state=379,this.identifier();break;case 4:this.state=380,this.match(M.OpenBracket),this.state=381,this.identifier(),this.state=382,this.match(M.Comma),this.state=383,this.identifier(),this.state=384,this.match(M.CloseBracket);break;default:throw new fi(this)}this.state=388,this.match(M.In),this.state=389,this.singleExpression(0),this.state=390,this.blockLine()}break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}switchStatement(){let e=new pp(this,this._ctx,this.state);this.enterRule(e,46,M.RULE_switchStatement);let n;try{this.enterOuterAlt(e,1);{this.state=394,this.match(M.Switch),this.state=396,this._errHandler.sync(this),n=this._input.LA(1),(!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235)&&(this.state=395,this.singleExpression(0)),this.state=398,this.match(M.NEWLINE),this.state=399,this.match(M.INDENT);{for(this.state=403,this._errHandler.sync(this),n=this._input.LA(1);!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235;)this.state=400,this.caseClause(),this.state=405,this._errHandler.sync(this),n=this._input.LA(1);this.state=407,this._errHandler.sync(this),n=this._input.LA(1),n===29&&(this.state=406,this.defaultCaluse())}this.state=409,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}caseClause(){let e=new ul(this,this._ctx,this.state);this.enterRule(e,48,M.RULE_caseClause);try{this.enterOuterAlt(e,1),this.state=411,this.singleExpression(0),this.state=412,this.match(M.ARROW),this.state=413,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}defaultCaluse(){let e=new dp(this,this._ctx,this.state);this.enterRule(e,50,M.RULE_defaultCaluse);try{this.enterOuterAlt(e,1),this.state=415,this.match(M.ARROW),this.state=416,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}whileStatement(){let e=new yp(this,this._ctx,this.state);this.enterRule(e,52,M.RULE_whileStatement);try{this.enterOuterAlt(e,1),this.state=418,this.match(M.While),this.state=419,this.singleExpression(0),this.state=420,this.blockLine()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}importStmt(){let e=new mp(this,this._ctx,this.state);this.enterRule(e,54,M.RULE_importStmt);let n;try{this.enterOuterAlt(e,1);{for(this.state=422,this.importElement(),this.state=427,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=423,this.match(M.Comma),this.state=424,this.importElement(),this.state=429,this._errHandler.sync(this),n=this._input.LA(1);this.state=430,this.match(M.NEWLINE)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}importElement(){let e=new cl(this,this._ctx,this.state);this.enterRule(e,56,M.RULE_importElement);let n;try{this.enterOuterAlt(e,1),this.state=432,this.match(M.Import),this.state=433,this.identifier(),this.state=434,this.match(M.Divide),this.state=435,this.identifier(),this.state=436,this.match(M.Divide),this.state=437,this.match(M.IntegerLiteral),this.state=440,this._errHandler.sync(this),n=this._input.LA(1),n===53&&(this.state=438,this.match(M.As),this.state=439,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}literal(){let e=new _p(this,this._ctx,this.state);this.enterRule(e,58,M.RULE_literal);let n;try{this.enterOuterAlt(e,1),this.state=442,n=this._input.LA(1),!(n-31&-32)&&1<<n-31&50331655?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}methodStmt(){let e=new ou(this,this._ctx,this.state);this.enterRule(e,60,M.RULE_methodStmt);try{let n;for(this.enterOuterAlt(e,1),this.state=444,this.methodElement(),this.state=449,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,49,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=445,this.match(M.Point),this.state=446,this.methodElement()),this.state=451,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,49,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodElement(){let e=new rs(this,this._ctx,this.state);this.enterRule(e,62,M.RULE_methodElement);try{this.enterOuterAlt(e,1),this.state=452,this.methodName(),this.state=453,this.arguments()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodName(){let e=new gp(this,this._ctx,this.state);this.enterRule(e,64,M.RULE_methodName);let n;try{let o;this.enterOuterAlt(e,1);{switch(this.state=468,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:for(this.state=460,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,50,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=455,this.identifier(),this.state=456,this.match(M.Point)),this.state=462,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,50,this._ctx);break;case 6:this.state=463,this.match(M.OpenParen),this.state=464,this.singleExpression(0),this.state=465,this.match(M.CloseParen),this.state=466,this.match(M.Point);break;default:throw new fi(this)}this.state=470,this.identifier(),this.state=479,this._errHandler.sync(this),n=this._input.LA(1),n===18&&(this.state=471,this.match(M.LessThan),this.state=472,this.typeName(),this.state=475,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=473,this.match(M.Comma),this.state=474,this.typeName()),this.state=477,this.match(M.MoreThan))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunction(){let e=new bp(this,this._ctx,this.state);this.enterRule(e,66,M.RULE_arrowFunction);let n;try{this.enterOuterAlt(e,1),this.state=482,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=481,this.match(M.Export)),this.state=484,this.identifier(),this.state=485,this.arrowFunctionParameters(),this.state=486,this.match(M.ARROW),this.state=487,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunctionParameters(){let e=new vp(this,this._ctx,this.state);this.enterRule(e,68,M.RULE_arrowFunctionParameters);let n;try{this.enterOuterAlt(e,1),this.state=489,this.match(M.OpenParen),this.state=491,this._errHandler.sync(this),n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73&&(this.state=490,this.formalParameterList()),this.state=493,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterList(){let e=new ll(this,this._ctx,this.state);this.enterRule(e,70,M.RULE_formalParameterList);let n;try{for(this.enterOuterAlt(e,1),this.state=495,this.formalParameterArg(),this.state=500,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=496,this.match(M.Comma),this.state=497,this.formalParameterArg(),this.state=502,this._errHandler.sync(this),n=this._input.LA(1)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterArg(){let e=new fl(this,this._ctx,this.state);this.enterRule(e,72,M.RULE_formalParameterArg);let n;try{this.enterOuterAlt(e,1);{switch(this.state=504,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,57,this._ctx)){case 1:this.state=503,this.typeGather();break}this.state=506,this.identifier(),this.state=509,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=507,this.match(M.Assign),this.state=508,this.singleExpression(0))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethod(){let e=new Ep(this,this._ctx,this.state);this.enterRule(e,74,M.RULE_arrowMethod);let n;try{this.enterOuterAlt(e,1),this.state=512,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=511,this.match(M.Export)),this.state=514,this.match(M.Method),this.state=515,this.identifier(),this.state=516,this.arrowMethodParameters(),this.state=517,this.match(M.ARROW),this.state=518,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethodParameters(){let e=new Sp(this,this._ctx,this.state);this.enterRule(e,76,M.RULE_arrowMethodParameters);let n;try{this.enterOuterAlt(e,1),this.state=520,this.match(M.OpenParen),this.state=521,this.typeGather(),this.state=522,this.identifier(),this.state=525,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=523,this.match(M.Comma),this.state=524,this.formalParameterList()),this.state=527,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeStatement(){let e=new Tp(this,this._ctx,this.state);this.enterRule(e,78,M.RULE_typeStatement);let n;try{this.enterOuterAlt(e,1);{this.state=530,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=529,this.match(M.Export)),this.state=532,this.match(M.Type),this.state=533,this.identifier(),this.state=534,this.match(M.NEWLINE),this.state=535,this.match(M.INDENT),this.state=537,this._errHandler.sync(this),n=this._input.LA(1);do this.state=536,this.typeElement(),this.state=539,this._errHandler.sync(this),n=this._input.LA(1);while(!(n-40&-32)&&1<<n-40&149505);this.state=541,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeElement(){let e=new hl(this,this._ctx,this.state);this.enterRule(e,80,M.RULE_typeElement);let n;try{this.enterOuterAlt(e,1),this.state=544,this._errHandler.sync(this),n=this._input.LA(1),n===40&&(this.state=543,this.match(M.Varip)),this.state=546,this.typeGather(),this.state=547,this.identifier(),this.state=550,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=548,this.match(M.Assign),this.state=549,this.singleExpression(0)),this.state=552,this.match(M.NEWLINE)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}assignmentOperator(){let e=new pl(this,this._ctx,this.state);this.enterRule(e,82,M.RULE_assignmentOperator);let n;try{this.enterOuterAlt(e,1),this.state=554,n=this._input.LA(1),!(n&-32)&&1<<n&1593835520?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeMap(){let e=new dl(this,this._ctx,this.state);this.enterRule(e,84,M.RULE_typeMap);try{this.enterOuterAlt(e,1),this.state=556,this.match(M.Map),this.state=557,this.match(M.LessThan),this.state=558,this.typeName(),this.state=559,this.match(M.Comma),this.state=560,this.typeName(),this.state=561,this.match(M.MoreThan)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeSeries(){let e=new Ap(this,this._ctx,this.state);this.enterRule(e,86,M.RULE_typeSeries);try{switch(this.enterOuterAlt(e,1),this.state=563,this.typeName(),this.state=567,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,65,this._ctx)){case 1:this.state=564,this.typeName();break;case 2:this.state=565,this.typeArray();break;case 3:this.state=566,this.typeMap();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeArray(){let e=new yl(this,this._ctx,this.state);this.enterRule(e,88,M.RULE_typeArray);try{switch(this.state=578,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,66,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=569,this.typeName(),this.state=570,this.match(M.LessThan),this.state=571,this.typeName(),this.state=572,this.match(M.MoreThan);break;case 2:this.enterOuterAlt(e,2),this.state=574,this.typeName(),this.state=575,this.match(M.OpenBracket),this.state=576,this.match(M.CloseBracket);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeGather(){let e=new Uo(this,this._ctx,this.state);this.enterRule(e,90,M.RULE_typeGather);try{switch(this.state=584,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,67,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=580,this.typeName();break;case 2:this.enterOuterAlt(e,2),this.state=581,this.typeArray();break;case 3:this.enterOuterAlt(e,3),this.state=582,this.typeMap();break;case 4:this.enterOuterAlt(e,4),this.state=583,this.typeSeries();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}identifier(){let e=new xn(this,this._ctx,this.state);this.enterRule(e,92,M.RULE_identifier);let n;try{this.enterOuterAlt(e,1),this.state=586,n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeName(){let e=new hi(this,this._ctx,this.state);this.enterRule(e,94,M.RULE_typeName);let n;try{this.enterOuterAlt(e,1),this.state=588,this.identifier(),this.state=591,this._errHandler.sync(this),n=this._input.LA(1),n===3&&(this.state=589,this.match(M.Point),this.state=590,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}name(){let e=new au(this,this._ctx,this.state);this.enterRule(e,96,M.RULE_name);try{let n;switch(this.state=614,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,72,this._ctx)){case 1:this.enterOuterAlt(e,1);{for(this.state=601,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,70,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=595,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,69,this._ctx)){case 1:this.state=593,this.identifier();break;case 2:this.state=594,this.methodElement();break}this.state=597,this.match(M.Point)}this.state=603,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,70,this._ctx)}this.state=604,this.identifier()}break;case 2:this.enterOuterAlt(e,2);{this.state=605,this.match(M.OpenParen),this.state=606,this.singleExpression(0),this.state=607,this.match(M.CloseParen),this.state=610,this._errHandler.sync(this),n=1;do{switch(n){case 1:this.state=608,this.match(M.Point),this.state=609,this.identifier();break;default:throw new fi(this)}this.state=612,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx)}while(n!==2&&n!==Mr.INVALID_ALT_NUMBER)}break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}sempred(e,n,o){switch(n){case 17:return this.singleExpression_sempred(e,o)}return!0}singleExpression_sempred(e,n){switch(n){case 0:return this.precpred(this._ctx,10);case 1:return this.precpred(this._ctx,9);case 2:return this.precpred(this._ctx,8);case 3:return this.precpred(this._ctx,7);case 4:return this.precpred(this._ctx,6);case 5:return this.precpred(this._ctx,5);case 6:return this.precpred(this._ctx,4);case 7:return this.precpred(this._ctx,13)}return!0}static get _ATN(){return M.__ATN||(M.__ATN=new rp().deserialize(M._serializedATN)),M.__ATN}};w(M,"INDENT",1),w(M,"DEDENT",2),w(M,"Point",3),w(M,"OpenBracket",4),w(M,"CloseBracket",5),w(M,"OpenParen",6),w(M,"CloseParen",7),w(M,"Comma",8),w(M,"Assign",9),w(M,"QuestionMark",10),w(M,"Colon",11),w(M,"Plus",12),w(M,"Minus",13),w(M,"Multiply",14),w(M,"Divide",15),w(M,"Modulus",16),w(M,"Hashtag",17),w(M,"LessThan",18),w(M,"MoreThan",19),w(M,"LessThanEquals",20),w(M,"GreaterThanEquals",21),w(M,"Equals_",22),w(M,"NotEquals",23),w(M,"MultiplyAssign",24),w(M,"DivideAssign",25),w(M,"ModulusAssign",26),w(M,"PlusAssign",27),w(M,"MinusAssign",28),w(M,"ARROW",29),w(M,"ColonEquals",30),w(M,"BooleanLiteral",31),w(M,"IntegerLiteral",32),w(M,"DecimalLiteral",33),w(M,"Break",34),w(M,"And",35),w(M,"Export",36),w(M,"For",37),w(M,"Var",38),w(M,"Continue",39),w(M,"Varip",40),w(M,"Switch",41),w(M,"While",42),w(M,"If",43),w(M,"In",44),w(M,"Or",45),w(M,"Not",46),w(M,"Method",47),w(M,"Else",48),w(M,"To",49),w(M,"By",50),w(M,"Type",51),w(M,"Import",52),w(M,"As",53),w(M,"Map",54),w(M,"ColorLiteral",55),w(M,"StringLiteral",56),w(M,"Identifier",57),w(M,"SKIP_",58),w(M,"NEWLINE",59),w(M,"EOF",ap.EOF),w(M,"RULE_program",0),w(M,"RULE_globalStmt",1),w(M,"RULE_blockStmt",2),w(M,"RULE_stmt",3),w(M,"RULE_simpleStmt",4),w(M,"RULE_flowStmt",5),w(M,"RULE_block",6),w(M,"RULE_blockLine",7),w(M,"RULE_variableDeclarationStmt",8),w(M,"RULE_variableDeclarationList",9),w(M,"RULE_varModifier",10),w(M,"RULE_blockSequence",11),w(M,"RULE_expressionSequence",12),w(M,"RULE_expressionBlockSequence",13),w(M,"RULE_varBlockStmt",14),w(M,"RULE_varArrayDeclaration",15),w(M,"RULE_blockExpression",16),w(M,"RULE_singleExpression",17),w(M,"RULE_brackethesized",18),w(M,"RULE_arguments",19),w(M,"RULE_argument",20),w(M,"RULE_ifStatement",21),w(M,"RULE_forStatement",22),w(M,"RULE_switchStatement",23),w(M,"RULE_caseClause",24),w(M,"RULE_defaultCaluse",25),w(M,"RULE_whileStatement",26),w(M,"RULE_importStmt",27),w(M,"RULE_importElement",28),w(M,"RULE_literal",29),w(M,"RULE_methodStmt",30),w(M,"RULE_methodElement",31),w(M,"RULE_methodName",32),w(M,"RULE_arrowFunction",33),w(M,"RULE_arrowFunctionParameters",34),w(M,"RULE_formalParameterList",35),w(M,"RULE_formalParameterArg",36),w(M,"RULE_arrowMethod",37),w(M,"RULE_arrowMethodParameters",38),w(M,"RULE_typeStatement",39),w(M,"RULE_typeElement",40),w(M,"RULE_assignmentOperator",41),w(M,"RULE_typeMap",42),w(M,"RULE_typeSeries",43),w(M,"RULE_typeArray",44),w(M,"RULE_typeGather",45),w(M,"RULE_identifier",46),w(M,"RULE_typeName",47),w(M,"RULE_name",48),w(M,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(M,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","SKIP_","NEWLINE"]),w(M,"ruleNames",["program","globalStmt","blockStmt","stmt","simpleStmt","flowStmt","block","blockLine","variableDeclarationStmt","variableDeclarationList","varModifier","blockSequence","expressionSequence","expressionBlockSequence","varBlockStmt","varArrayDeclaration","blockExpression","singleExpression","brackethesized","arguments","argument","ifStatement","forStatement","switchStatement","caseClause","defaultCaluse","whileStatement","importStmt","importElement","literal","methodStmt","methodElement","methodName","arrowFunction","arrowFunctionParameters","formalParameterList","formalParameterArg","arrowMethod","arrowMethodParameters","typeStatement","typeElement","assignmentOperator","typeMap","typeSeries","typeArray","typeGather","identifier","typeName","name"]),w(M,"_serializedATN",[4,1,59,617,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,1,0,1,0,5,0,101,8,0,10,0,12,0,104,9,0,1,0,1,0,1,1,1,1,3,1,110,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,119,8,1,1,2,1,2,1,2,5,2,124,8,2,10,2,12,2,127,9,2,1,2,1,2,3,2,131,8,2,1,3,1,3,3,3,135,8,3,1,3,1,3,1,3,3,3,140,8,3,1,4,1,4,1,4,1,4,3,4,146,8,4,1,5,1,5,1,6,1,6,3,6,152,8,6,1,6,1,6,1,6,3,6,157,8,6,1,7,1,7,1,7,4,7,162,8,7,11,7,12,7,163,1,7,1,7,1,8,1,8,3,8,170,8,8,1,8,1,8,1,8,3,8,175,8,8,5,8,177,8,8,10,8,12,8,180,9,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,190,8,9,1,10,1,10,1,11,1,11,3,11,196,8,11,1,11,1,11,1,11,3,11,201,8,11,5,11,203,8,11,10,11,12,11,206,9,11,1,12,1,12,1,12,5,12,211,8,12,10,12,12,12,214,9,12,1,13,1,13,3,13,218,8,13,1,13,1,13,5,13,222,8,13,10,13,12,13,225,9,13,1,13,1,13,3,13,229,8,13,1,14,1,14,1,14,1,14,1,14,1,14,3,14,237,8,14,1,14,1,14,1,15,3,15,242,8,15,1,15,3,15,245,8,15,1,15,1,15,1,15,1,15,1,15,5,15,252,8,15,10,15,12,15,255,9,15,1,15,1,15,3,15,259,8,15,1,16,1,16,1,16,1,16,3,16,265,8,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,279,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,5,17,310,8,17,10,17,12,17,313,9,17,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,5,19,323,8,19,10,19,12,19,326,9,19,1,19,3,19,329,8,19,3,19,331,8,19,1,19,1,19,1,20,1,20,1,20,3,20,338,8,20,1,20,1,20,3,20,342,8,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,5,21,352,8,21,10,21,12,21,355,9,21,1,21,1,21,3,21,359,8,21,1,22,1,22,3,22,363,8,22,1,22,3,22,366,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,375,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,387,8,22,1,22,1,22,1,22,1,22,3,22,393,8,22,1,23,1,23,3,23,397,8,23,1,23,1,23,1,23,5,23,402,8,23,10,23,12,23,405,9,23,1,23,3,23,408,8,23,1,23,1,23,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,27,1,27,1,27,5,27,426,8,27,10,27,12,27,429,9,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,441,8,28,1,29,1,29,1,30,1,30,1,30,5,30,448,8,30,10,30,12,30,451,9,30,1,31,1,31,1,31,1,32,1,32,1,32,5,32,459,8,32,10,32,12,32,462,9,32,1,32,1,32,1,32,1,32,1,32,3,32,469,8,32,1,32,1,32,1,32,1,32,1,32,3,32,476,8,32,1,32,1,32,3,32,480,8,32,1,33,3,33,483,8,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,492,8,34,1,34,1,34,1,35,1,35,1,35,5,35,499,8,35,10,35,12,35,502,9,35,1,36,3,36,505,8,36,1,36,1,36,1,36,3,36,510,8,36,1,37,3,37,513,8,37,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,3,38,526,8,38,1,38,1,38,1,39,3,39,531,8,39,1,39,1,39,1,39,1,39,1,39,4,39,538,8,39,11,39,12,39,539,1,39,1,39,1,40,3,40,545,8,40,1,40,1,40,1,40,1,40,3,40,551,8,40,1,40,1,40,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,43,1,43,1,43,1,43,3,43,568,8,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,579,8,44,1,45,1,45,1,45,1,45,3,45,585,8,45,1,46,1,46,1,47,1,47,1,47,3,47,592,8,47,1,48,1,48,3,48,596,8,48,1,48,1,48,5,48,600,8,48,10,48,12,48,603,9,48,1,48,1,48,1,48,1,48,1,48,1,48,4,48,611,8,48,11,48,12,48,612,3,48,615,8,48,1,48,0,1,34,49,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,0,9,2,0,34,34,39,39,2,0,38,38,40,40,1,0,12,13,1,0,14,16,1,0,18,21,1,0,22,23,2,0,31,33,55,56,2,0,24,28,30,30,3,0,51,51,54,54,57,57,661,0,102,1,0,0,0,2,118,1,0,0,0,4,125,1,0,0,0,6,139,1,0,0,0,8,145,1,0,0,0,10,147,1,0,0,0,12,156,1,0,0,0,14,158,1,0,0,0,16,169,1,0,0,0,18,189,1,0,0,0,20,191,1,0,0,0,22,195,1,0,0,0,24,207,1,0,0,0,26,223,1,0,0,0,28,236,1,0,0,0,30,258,1,0,0,0,32,264,1,0,0,0,34,278,1,0,0,0,36,314,1,0,0,0,38,318,1,0,0,0,40,337,1,0,0,0,42,343,1,0,0,0,44,392,1,0,0,0,46,394,1,0,0,0,48,411,1,0,0,0,50,415,1,0,0,0,52,418,1,0,0,0,54,422,1,0,0,0,56,432,1,0,0,0,58,442,1,0,0,0,60,444,1,0,0,0,62,452,1,0,0,0,64,468,1,0,0,0,66,482,1,0,0,0,68,489,1,0,0,0,70,495,1,0,0,0,72,504,1,0,0,0,74,512,1,0,0,0,76,520,1,0,0,0,78,530,1,0,0,0,80,544,1,0,0,0,82,554,1,0,0,0,84,556,1,0,0,0,86,563,1,0,0,0,88,578,1,0,0,0,90,584,1,0,0,0,92,586,1,0,0,0,94,588,1,0,0,0,96,614,1,0,0,0,98,101,5,59,0,0,99,101,3,2,1,0,100,98,1,0,0,0,100,99,1,0,0,0,101,104,1,0,0,0,102,100,1,0,0,0,102,103,1,0,0,0,103,105,1,0,0,0,104,102,1,0,0,0,105,106,5,0,0,1,106,1,1,0,0,0,107,109,3,16,8,0,108,110,5,8,0,0,109,108,1,0,0,0,109,110,1,0,0,0,110,111,1,0,0,0,111,112,5,59,0,0,112,119,1,0,0,0,113,119,3,4,2,0,114,119,3,54,27,0,115,119,3,66,33,0,116,119,3,74,37,0,117,119,3,78,39,0,118,107,1,0,0,0,118,113,1,0,0,0,118,114,1,0,0,0,118,115,1,0,0,0,118,116,1,0,0,0,118,117,1,0,0,0,119,3,1,0,0,0,120,121,3,16,8,0,121,122,5,8,0,0,122,124,1,0,0,0,123,120,1,0,0,0,124,127,1,0,0,0,125,123,1,0,0,0,125,126,1,0,0,0,126,130,1,0,0,0,127,125,1,0,0,0,128,131,3,28,14,0,129,131,3,32,16,0,130,128,1,0,0,0,130,129,1,0,0,0,131,5,1,0,0,0,132,134,3,8,4,0,133,135,5,8,0,0,134,133,1,0,0,0,134,135,1,0,0,0,135,136,1,0,0,0,136,137,5,59,0,0,137,140,1,0,0,0,138,140,3,26,13,0,139,132,1,0,0,0,139,138,1,0,0,0,140,7,1,0,0,0,141,146,3,24,12,0,142,146,3,22,11,0,143,146,3,36,18,0,144,146,3,10,5,0,145,141,1,0,0,0,145,142,1,0,0,0,145,143,1,0,0,0,145,144,1,0,0,0,146,9,1,0,0,0,147,148,7,0,0,0,148,11,1,0,0,0,149,151,3,8,4,0,150,152,5,8,0,0,151,150,1,0,0,0,151,152,1,0,0,0,152,153,1,0,0,0,153,154,5,59,0,0,154,157,1,0,0,0,155,157,3,14,7,0,156,149,1,0,0,0,156,155,1,0,0,0,157,13,1,0,0,0,158,159,5,59,0,0,159,161,5,1,0,0,160,162,3,6,3,0,161,160,1,0,0,0,162,163,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,165,1,0,0,0,165,166,5,2,0,0,166,15,1,0,0,0,167,170,3,60,30,0,168,170,3,18,9,0,169,167,1,0,0,0,169,168,1,0,0,0,170,178,1,0,0,0,171,174,5,8,0,0,172,175,3,60,30,0,173,175,3,18,9,0,174,172,1,0,0,0,174,173,1,0,0,0,175,177,1,0,0,0,176,171,1,0,0,0,177,180,1,0,0,0,178,176,1,0,0,0,178,179,1,0,0,0,179,17,1,0,0,0,180,178,1,0,0,0,181,182,3,30,15,0,182,183,5,9,0,0,183,184,3,34,17,0,184,190,1,0,0,0,185,186,3,96,48,0,186,187,3,82,41,0,187,188,3,34,17,0,188,190,1,0,0,0,189,181,1,0,0,0,189,185,1,0,0,0,190,19,1,0,0,0,191,192,7,1,0,0,192,21,1,0,0,0,193,196,3,34,17,0,194,196,3,18,9,0,195,193,1,0,0,0,195,194,1,0,0,0,196,204,1,0,0,0,197,200,5,8,0,0,198,201,3,34,17,0,199,201,3,18,9,0,200,198,1,0,0,0,200,199,1,0,0,0,201,203,1,0,0,0,202,197,1,0,0,0,203,206,1,0,0,0,204,202,1,0,0,0,204,205,1,0,0,0,205,23,1,0,0,0,206,204,1,0,0,0,207,212,3,34,17,0,208,209,5,8,0,0,209,211,3,34,17,0,210,208,1,0,0,0,211,214,1,0,0,0,212,210,1,0,0,0,212,213,1,0,0,0,213,25,1,0,0,0,214,212,1,0,0,0,215,218,3,34,17,0,216,218,3,18,9,0,217,215,1,0,0,0,217,216,1,0,0,0,218,219,1,0,0,0,219,220,5,8,0,0,220,222,1,0,0,0,221,217,1,0,0,0,222,225,1,0,0,0,223,221,1,0,0,0,223,224,1,0,0,0,224,228,1,0,0,0,225,223,1,0,0,0,226,229,3,28,14,0,227,229,3,32,16,0,228,226,1,0,0,0,228,227,1,0,0,0,229,27,1,0,0,0,230,231,3,30,15,0,231,232,5,9,0,0,232,237,1,0,0,0,233,234,3,96,48,0,234,235,3,82,41,0,235,237,1,0,0,0,236,230,1,0,0,0,236,233,1,0,0,0,237,238,1,0,0,0,238,239,3,32,16,0,239,29,1,0,0,0,240,242,3,20,10,0,241,240,1,0,0,0,241,242,1,0,0,0,242,244,1,0,0,0,243,245,3,90,45,0,244,243,1,0,0,0,244,245,1,0,0,0,245,246,1,0,0,0,246,259,3,92,46,0,247,248,5,4,0,0,248,253,3,92,46,0,249,250,5,8,0,0,250,252,3,92,46,0,251,249,1,0,0,0,252,255,1,0,0,0,253,251,1,0,0,0,253,254,1,0,0,0,254,256,1,0,0,0,255,253,1,0,0,0,256,257,5,5,0,0,257,259,1,0,0,0,258,241,1,0,0,0,258,247,1,0,0,0,259,31,1,0,0,0,260,265,3,42,21,0,261,265,3,44,22,0,262,265,3,52,26,0,263,265,3,46,23,0,264,260,1,0,0,0,264,261,1,0,0,0,264,262,1,0,0,0,264,263,1,0,0,0,265,33,1,0,0,0,266,267,6,17,-1,0,267,279,3,60,30,0,268,269,7,2,0,0,269,279,3,34,17,12,270,271,5,46,0,0,271,279,3,34,17,11,272,279,3,96,48,0,273,279,3,58,29,0,274,275,5,6,0,0,275,276,3,34,17,0,276,277,5,7,0,0,277,279,1,0,0,0,278,266,1,0,0,0,278,268,1,0,0,0,278,270,1,0,0,0,278,272,1,0,0,0,278,273,1,0,0,0,278,274,1,0,0,0,279,311,1,0,0,0,280,281,10,10,0,0,281,282,7,3,0,0,282,310,3,34,17,11,283,284,10,9,0,0,284,285,7,2,0,0,285,310,3,34,17,10,286,287,10,8,0,0,287,288,7,4,0,0,288,310,3,34,17,9,289,290,10,7,0,0,290,291,7,5,0,0,291,310,3,34,17,8,292,293,10,6,0,0,293,294,5,35,0,0,294,310,3,34,17,7,295,296,10,5,0,0,296,297,5,45,0,0,297,310,3,34,17,6,298,299,10,4,0,0,299,300,5,10,0,0,300,301,3,34,17,0,301,302,5,11,0,0,302,303,3,34,17,4,303,310,1,0,0,0,304,305,10,13,0,0,305,306,5,4,0,0,306,307,3,34,17,0,307,308,5,5,0,0,308,310,1,0,0,0,309,280,1,0,0,0,309,283,1,0,0,0,309,286,1,0,0,0,309,289,1,0,0,0,309,292,1,0,0,0,309,295,1,0,0,0,309,298,1,0,0,0,309,304,1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0,0,0,312,35,1,0,0,0,313,311,1,0,0,0,314,315,5,4,0,0,315,316,3,24,12,0,316,317,5,5,0,0,317,37,1,0,0,0,318,330,5,6,0,0,319,324,3,40,20,0,320,321,5,8,0,0,321,323,3,40,20,0,322,320,1,0,0,0,323,326,1,0,0,0,324,322,1,0,0,0,324,325,1,0,0,0,325,328,1,0,0,0,326,324,1,0,0,0,327,329,5,8,0,0,328,327,1,0,0,0,328,329,1,0,0,0,329,331,1,0,0,0,330,319,1,0,0,0,330,331,1,0,0,0,331,332,1,0,0,0,332,333,5,7,0,0,333,39,1,0,0,0,334,335,3,92,46,0,335,336,5,9,0,0,336,338,1,0,0,0,337,334,1,0,0,0,337,338,1,0,0,0,338,341,1,0,0,0,339,342,3,34,17,0,340,342,3,36,18,0,341,339,1,0,0,0,341,340,1,0,0,0,342,41,1,0,0,0,343,344,5,43,0,0,344,345,3,34,17,0,345,353,3,14,7,0,346,347,5,48,0,0,347,348,5,43,0,0,348,349,3,34,17,0,349,350,3,14,7,0,350,352,1,0,0,0,351,346,1,0,0,0,352,355,1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,358,1,0,0,0,355,353,1,0,0,0,356,357,5,48,0,0,357,359,3,14,7,0,358,356,1,0,0,0,358,359,1,0,0,0,359,43,1,0,0,0,360,362,5,37,0,0,361,363,3,20,10,0,362,361,1,0,0,0,362,363,1,0,0,0,363,365,1,0,0,0,364,366,3,90,45,0,365,364,1,0,0,0,365,366,1,0,0,0,366,367,1,0,0,0,367,368,3,92,46,0,368,369,5,9,0,0,369,370,3,34,17,0,370,371,5,49,0,0,371,374,3,34,17,0,372,373,5,50,0,0,373,375,3,34,17,0,374,372,1,0,0,0,374,375,1,0,0,0,375,376,1,0,0,0,376,377,3,14,7,0,377,393,1,0,0,0,378,386,5,37,0,0,379,387,3,92,46,0,380,381,5,4,0,0,381,382,3,92,46,0,382,383,5,8,0,0,383,384,3,92,46,0,384,385,5,5,0,0,385,387,1,0,0,0,386,379,1,0,0,0,386,380,1,0,0,0,387,388,1,0,0,0,388,389,5,44,0,0,389,390,3,34,17,0,390,391,3,14,7,0,391,393,1,0,0,0,392,360,1,0,0,0,392,378,1,0,0,0,393,45,1,0,0,0,394,396,5,41,0,0,395,397,3,34,17,0,396,395,1,0,0,0,396,397,1,0,0,0,397,398,1,0,0,0,398,399,5,59,0,0,399,403,5,1,0,0,400,402,3,48,24,0,401,400,1,0,0,0,402,405,1,0,0,0,403,401,1,0,0,0,403,404,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,406,408,3,50,25,0,407,406,1,0,0,0,407,408,1,0,0,0,408,409,1,0,0,0,409,410,5,2,0,0,410,47,1,0,0,0,411,412,3,34,17,0,412,413,5,29,0,0,413,414,3,12,6,0,414,49,1,0,0,0,415,416,5,29,0,0,416,417,3,12,6,0,417,51,1,0,0,0,418,419,5,42,0,0,419,420,3,34,17,0,420,421,3,14,7,0,421,53,1,0,0,0,422,427,3,56,28,0,423,424,5,8,0,0,424,426,3,56,28,0,425,423,1,0,0,0,426,429,1,0,0,0,427,425,1,0,0,0,427,428,1,0,0,0,428,430,1,0,0,0,429,427,1,0,0,0,430,431,5,59,0,0,431,55,1,0,0,0,432,433,5,52,0,0,433,434,3,92,46,0,434,435,5,15,0,0,435,436,3,92,46,0,436,437,5,15,0,0,437,440,5,32,0,0,438,439,5,53,0,0,439,441,3,92,46,0,440,438,1,0,0,0,440,441,1,0,0,0,441,57,1,0,0,0,442,443,7,6,0,0,443,59,1,0,0,0,444,449,3,62,31,0,445,446,5,3,0,0,446,448,3,62,31,0,447,445,1,0,0,0,448,451,1,0,0,0,449,447,1,0,0,0,449,450,1,0,0,0,450,61,1,0,0,0,451,449,1,0,0,0,452,453,3,64,32,0,453,454,3,38,19,0,454,63,1,0,0,0,455,456,3,92,46,0,456,457,5,3,0,0,457,459,1,0,0,0,458,455,1,0,0,0,459,462,1,0,0,0,460,458,1,0,0,0,460,461,1,0,0,0,461,469,1,0,0,0,462,460,1,0,0,0,463,464,5,6,0,0,464,465,3,34,17,0,465,466,5,7,0,0,466,467,5,3,0,0,467,469,1,0,0,0,468,460,1,0,0,0,468,463,1,0,0,0,469,470,1,0,0,0,470,479,3,92,46,0,471,472,5,18,0,0,472,475,3,94,47,0,473,474,5,8,0,0,474,476,3,94,47,0,475,473,1,0,0,0,475,476,1,0,0,0,476,477,1,0,0,0,477,478,5,19,0,0,478,480,1,0,0,0,479,471,1,0,0,0,479,480,1,0,0,0,480,65,1,0,0,0,481,483,5,36,0,0,482,481,1,0,0,0,482,483,1,0,0,0,483,484,1,0,0,0,484,485,3,92,46,0,485,486,3,68,34,0,486,487,5,29,0,0,487,488,3,12,6,0,488,67,1,0,0,0,489,491,5,6,0,0,490,492,3,70,35,0,491,490,1,0,0,0,491,492,1,0,0,0,492,493,1,0,0,0,493,494,5,7,0,0,494,69,1,0,0,0,495,500,3,72,36,0,496,497,5,8,0,0,497,499,3,72,36,0,498,496,1,0,0,0,499,502,1,0,0,0,500,498,1,0,0,0,500,501,1,0,0,0,501,71,1,0,0,0,502,500,1,0,0,0,503,505,3,90,45,0,504,503,1,0,0,0,504,505,1,0,0,0,505,506,1,0,0,0,506,509,3,92,46,0,507,508,5,9,0,0,508,510,3,34,17,0,509,507,1,0,0,0,509,510,1,0,0,0,510,73,1,0,0,0,511,513,5,36,0,0,512,511,1,0,0,0,512,513,1,0,0,0,513,514,1,0,0,0,514,515,5,47,0,0,515,516,3,92,46,0,516,517,3,76,38,0,517,518,5,29,0,0,518,519,3,12,6,0,519,75,1,0,0,0,520,521,5,6,0,0,521,522,3,90,45,0,522,525,3,92,46,0,523,524,5,8,0,0,524,526,3,70,35,0,525,523,1,0,0,0,525,526,1,0,0,0,526,527,1,0,0,0,527,528,5,7,0,0,528,77,1,0,0,0,529,531,5,36,0,0,530,529,1,0,0,0,530,531,1,0,0,0,531,532,1,0,0,0,532,533,5,51,0,0,533,534,3,92,46,0,534,535,5,59,0,0,535,537,5,1,0,0,536,538,3,80,40,0,537,536,1,0,0,0,538,539,1,0,0,0,539,537,1,0,0,0,539,540,1,0,0,0,540,541,1,0,0,0,541,542,5,2,0,0,542,79,1,0,0,0,543,545,5,40,0,0,544,543,1,0,0,0,544,545,1,0,0,0,545,546,1,0,0,0,546,547,3,90,45,0,547,550,3,92,46,0,548,549,5,9,0,0,549,551,3,34,17,0,550,548,1,0,0,0,550,551,1,0,0,0,551,552,1,0,0,0,552,553,5,59,0,0,553,81,1,0,0,0,554,555,7,7,0,0,555,83,1,0,0,0,556,557,5,54,0,0,557,558,5,18,0,0,558,559,3,94,47,0,559,560,5,8,0,0,560,561,3,94,47,0,561,562,5,19,0,0,562,85,1,0,0,0,563,567,3,94,47,0,564,568,3,94,47,0,565,568,3,88,44,0,566,568,3,84,42,0,567,564,1,0,0,0,567,565,1,0,0,0,567,566,1,0,0,0,568,87,1,0,0,0,569,570,3,94,47,0,570,571,5,18,0,0,571,572,3,94,47,0,572,573,5,19,0,0,573,579,1,0,0,0,574,575,3,94,47,0,575,576,5,4,0,0,576,577,5,5,0,0,577,579,1,0,0,0,578,569,1,0,0,0,578,574,1,0,0,0,579,89,1,0,0,0,580,585,3,94,47,0,581,585,3,88,44,0,582,585,3,84,42,0,583,585,3,86,43,0,584,580,1,0,0,0,584,581,1,0,0,0,584,582,1,0,0,0,584,583,1,0,0,0,585,91,1,0,0,0,586,587,7,8,0,0,587,93,1,0,0,0,588,591,3,92,46,0,589,590,5,3,0,0,590,592,3,92,46,0,591,589,1,0,0,0,591,592,1,0,0,0,592,95,1,0,0,0,593,596,3,92,46,0,594,596,3,62,31,0,595,593,1,0,0,0,595,594,1,0,0,0,596,597,1,0,0,0,597,598,5,3,0,0,598,600,1,0,0,0,599,595,1,0,0,0,600,603,1,0,0,0,601,599,1,0,0,0,601,602,1,0,0,0,602,604,1,0,0,0,603,601,1,0,0,0,604,615,3,92,46,0,605,606,5,6,0,0,606,607,3,34,17,0,607,610,5,7,0,0,608,609,5,3,0,0,609,611,3,92,46,0,610,608,1,0,0,0,611,612,1,0,0,0,612,610,1,0,0,0,612,613,1,0,0,0,613,615,1,0,0,0,614,601,1,0,0,0,614,605,1,0,0,0,615,97,1,0,0,0,73,100,102,109,118,125,130,134,139,145,151,156,163,169,174,178,189,195,200,204,212,217,223,228,236,241,244,253,258,264,278,309,311,324,328,330,337,341,353,358,362,365,374,386,392,396,403,407,427,440,449,460,468,475,479,482,491,500,504,509,512,525,530,539,544,550,567,578,584,591,595,601,612,614]),w(M,"__ATN"),w(M,"DecisionsToDFA",M._ATN.decisionToState.map((e,n)=>new ip(e,n)));let I=M;class em extends Qe{constructor(e,n,o){super(n,o),this.parser=e}EOF(){return this.getToken(I.EOF,0)}NEWLINE_list(){return this.getTokens(I.NEWLINE)}NEWLINE(e){return this.getToken(I.NEWLINE,e)}globalStmt_list(){return this.getTypedRuleContexts(el)}globalStmt(e){return this.getTypedRuleContext(el,e)}get ruleIndex(){return I.RULE_program}accept(e){return e.visitProgram?e.visitProgram(this):e.visitChildren(this)}}class el extends Qe{constructor(e,n,o){super(n,o),this.parser=e}variableDeclarationStmt(){return this.getTypedRuleContext(nu,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}blockStmt(){return this.getTypedRuleContext(sp,0)}importStmt(){return this.getTypedRuleContext(mp,0)}arrowFunction(){return this.getTypedRuleContext(bp,0)}arrowMethod(){return this.getTypedRuleContext(Ep,0)}typeStatement(){return this.getTypedRuleContext(Tp,0)}get ruleIndex(){return I.RULE_globalStmt}accept(e){return e.visitGlobalStmt?e.visitGlobalStmt(this):e.visitChildren(this)}}class sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ol,0)}blockExpression(){return this.getTypedRuleContext(ru,0)}variableDeclarationStmt_list(){return this.getTypedRuleContexts(nu)}variableDeclarationStmt(e){return this.getTypedRuleContext(nu,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_blockStmt}accept(e){return e.visitBlockStmt?e.visitBlockStmt(this):e.visitChildren(this)}}class tl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(nl,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}expressionBlockSequence(){return this.getTypedRuleContext(lp,0)}get ruleIndex(){return I.RULE_stmt}accept(e){return e.visitStmt?e.visitStmt(this):e.visitChildren(this)}}class nl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}expressionSequence(){return this.getTypedRuleContext(il,0)}blockSequence(){return this.getTypedRuleContext(cp,0)}brackethesized(){return this.getTypedRuleContext(al,0)}flowStmt(){return this.getTypedRuleContext(up,0)}get ruleIndex(){return I.RULE_simpleStmt}accept(e){return e.visitSimpleStmt?e.visitSimpleStmt(this):e.visitChildren(this)}}class up extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Break(){return this.getToken(I.Break,0)}Continue(){return this.getToken(I.Continue,0)}get ruleIndex(){return I.RULE_flowStmt}accept(e){return e.visitFlowStmt?e.visitFlowStmt(this):e.visitChildren(this)}}class ts extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(nl,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}blockLine(){return this.getTypedRuleContext(fo,0)}get ruleIndex(){return I.RULE_block}accept(e){return e.visitBlock?e.visitBlock(this):e.visitChildren(this)}}class fo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}stmt_list(){return this.getTypedRuleContexts(tl)}stmt(e){return this.getTypedRuleContext(tl,e)}get ruleIndex(){return I.RULE_blockLine}accept(e){return e.visitBlockLine?e.visitBlockLine(this):e.visitChildren(this)}}class nu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodStmt_list(){return this.getTypedRuleContexts(ou)}methodStmt(e){return this.getTypedRuleContext(ou,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_variableDeclarationStmt}accept(e){return e.visitVariableDeclarationStmt?e.visitVariableDeclarationStmt(this):e.visitChildren(this)}}class ki extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_variableDeclarationList}copyFrom(e){super.copyFrom(e)}}class tm extends ki{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(au,0)}assignmentOperator(){return this.getTypedRuleContext(pl,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitAgainAssign?e.visitAgainAssign(this):e.visitChildren(this)}}class nm extends ki{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}varArrayDeclaration(){return this.getTypedRuleContext(ns,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitDeclareAssign?e.visitDeclareAssign(this):e.visitChildren(this)}}class rl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Var(){return this.getToken(I.Var,0)}Varip(){return this.getToken(I.Varip,0)}get ruleIndex(){return I.RULE_varModifier}accept(e){return e.visitVarModifier?e.visitVarModifier(this):e.visitChildren(this)}}class cp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_blockSequence}accept(e){return e.visitBlockSequence?e.visitBlockSequence(this):e.visitChildren(this)}}class il extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_expressionSequence}accept(e){return e.visitExpressionSequence?e.visitExpressionSequence(this):e.visitChildren(this)}}class lp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ol,0)}blockExpression(){return this.getTypedRuleContext(ru,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}get ruleIndex(){return I.RULE_expressionBlockSequence}accept(e){return e.visitExpressionBlockSequence?e.visitExpressionBlockSequence(this):e.visitChildren(this)}}class ol extends Qe{constructor(e,n,o){super(n,o),this.parser=e}blockExpression(){return this.getTypedRuleContext(ru,0)}varArrayDeclaration(){return this.getTypedRuleContext(ns,0)}Assign(){return this.getToken(I.Assign,0)}name(){return this.getTypedRuleContext(au,0)}assignmentOperator(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return I.RULE_varBlockStmt}accept(e){return e.visitVarBlockStmt?e.visitVarBlockStmt(this):e.visitChildren(this)}}class ns extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_varArrayDeclaration}copyFrom(e){super.copyFrom(e)}}class rm extends ns{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenBracket(){return this.getToken(I.OpenBracket,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}CloseBracket(){return this.getToken(I.CloseBracket,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}accept(e){return e.visitVarMultiple?e.visitVarMultiple(this):e.visitChildren(this)}}class im extends ns{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}identifier(){return this.getTypedRuleContext(xn,0)}varModifier(){return this.getTypedRuleContext(rl,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}accept(e){return e.visitVarSingle?e.visitVarSingle(this):e.visitChildren(this)}}class ru extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ifStatement(){return this.getTypedRuleContext(hp,0)}forStatement(){return this.getTypedRuleContext(iu,0)}whileStatement(){return this.getTypedRuleContext(yp,0)}switchStatement(){return this.getTypedRuleContext(pp,0)}get ruleIndex(){return I.RULE_blockExpression}accept(e){return e.visitBlockExpression?e.visitBlockExpression(this):e.visitChildren(this)}}class Ve extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_singleExpression}copyFrom(e){super.copyFrom(e)}}class om extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}accept(e){return e.visitParenthesizedExpression?e.visitParenthesizedExpression(this):e.visitChildren(this)}}class am extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Plus(){return this.getToken(I.Plus,0)}Minus(){return this.getToken(I.Minus,0)}accept(e){return e.visitAdditiveExpression?e.visitAdditiveExpression(this):e.visitChildren(this)}}class sm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}LessThan(){return this.getToken(I.LessThan,0)}MoreThan(){return this.getToken(I.MoreThan,0)}LessThanEquals(){return this.getToken(I.LessThanEquals,0)}GreaterThanEquals(){return this.getToken(I.GreaterThanEquals,0)}accept(e){return e.visitRelationalExpression?e.visitRelationalExpression(this):e.visitChildren(this)}}class um extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}QuestionMark(){return this.getToken(I.QuestionMark,0)}Colon(){return this.getToken(I.Colon,0)}accept(e){return e.visitTernaryExpression?e.visitTernaryExpression(this):e.visitChildren(this)}}class cm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}And(){return this.getToken(I.And,0)}accept(e){return e.visitLogicalAndExpression?e.visitLogicalAndExpression(this):e.visitChildren(this)}}class lm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(au,0)}accept(e){return e.visitNameExpression?e.visitNameExpression(this):e.visitChildren(this)}}class fm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}literal(){return this.getTypedRuleContext(_p,0)}accept(e){return e.visitLiteralExpression?e.visitLiteralExpression(this):e.visitChildren(this)}}class hm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Or(){return this.getToken(I.Or,0)}accept(e){return e.visitLogicalOrExpression?e.visitLogicalOrExpression(this):e.visitChildren(this)}}class pm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression(){return this.getTypedRuleContext(Ve,0)}Minus(){return this.getToken(I.Minus,0)}Plus(){return this.getToken(I.Plus,0)}accept(e){return e.visitUnaryExpression?e.visitUnaryExpression(this):e.visitChildren(this)}}class dm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}Not(){return this.getToken(I.Not,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitNotExpression?e.visitNotExpression(this):e.visitChildren(this)}}class ym extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}OpenBracket(){return this.getToken(I.OpenBracket,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}accept(e){return e.visitMemberIndexExpression?e.visitMemberIndexExpression(this):e.visitChildren(this)}}class mm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}methodStmt(){return this.getTypedRuleContext(ou,0)}accept(e){return e.visitMethodExpression?e.visitMethodExpression(this):e.visitChildren(this)}}class _m extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Equals_(){return this.getToken(I.Equals_,0)}NotEquals(){return this.getToken(I.NotEquals,0)}accept(e){return e.visitEqualityExpression?e.visitEqualityExpression(this):e.visitChildren(this)}}class gm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Multiply(){return this.getToken(I.Multiply,0)}Divide(){return this.getToken(I.Divide,0)}Modulus(){return this.getToken(I.Modulus,0)}accept(e){return e.visitMultiplicativeExpression?e.visitMultiplicativeExpression(this):e.visitChildren(this)}}class al extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenBracket(){return this.getToken(I.OpenBracket,0)}expressionSequence(){return this.getTypedRuleContext(il,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}get ruleIndex(){return I.RULE_brackethesized}accept(e){return e.visitBrackethesized?e.visitBrackethesized(this):e.visitChildren(this)}}class fp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}CloseParen(){return this.getToken(I.CloseParen,0)}argument_list(){return this.getTypedRuleContexts(sl)}argument(e){return this.getTypedRuleContext(sl,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_arguments}accept(e){return e.visitArguments?e.visitArguments(this):e.visitChildren(this)}}class sl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}brackethesized(){return this.getTypedRuleContext(al,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(I.Assign,0)}get ruleIndex(){return I.RULE_argument}accept(e){return e.visitArgument?e.visitArgument(this):e.visitChildren(this)}}class hp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}If_list(){return this.getTokens(I.If)}If(e){return this.getToken(I.If,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}blockLine_list(){return this.getTypedRuleContexts(fo)}blockLine(e){return this.getTypedRuleContext(fo,e)}Else_list(){return this.getTokens(I.Else)}Else(e){return this.getToken(I.Else,e)}get ruleIndex(){return I.RULE_ifStatement}accept(e){return e.visitIfStatement?e.visitIfStatement(this):e.visitChildren(this)}}class iu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_forStatement}copyFrom(e){super.copyFrom(e)}}class bm extends iu{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(I.For,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}To(){return this.getToken(I.To,0)}blockLine(){return this.getTypedRuleContext(fo,0)}varModifier(){return this.getTypedRuleContext(rl,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}By(){return this.getToken(I.By,0)}accept(e){return e.visitForToStatement?e.visitForToStatement(this):e.visitChildren(this)}}class vm extends iu{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(I.For,0)}In(){return this.getToken(I.In,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(fo,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenBracket(){return this.getToken(I.OpenBracket,0)}Comma(){return this.getToken(I.Comma,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}accept(e){return e.visitForInStatement?e.visitForInStatement(this):e.visitChildren(this)}}class pp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Switch(){return this.getToken(I.Switch,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}caseClause_list(){return this.getTypedRuleContexts(ul)}caseClause(e){return this.getTypedRuleContext(ul,e)}defaultCaluse(){return this.getTypedRuleContext(dp,0)}get ruleIndex(){return I.RULE_switchStatement}accept(e){return e.visitSwitchStatement?e.visitSwitchStatement(this):e.visitChildren(this)}}class ul extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}get ruleIndex(){return I.RULE_caseClause}accept(e){return e.visitCaseClause?e.visitCaseClause(this):e.visitChildren(this)}}class dp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}get ruleIndex(){return I.RULE_defaultCaluse}accept(e){return e.visitDefaultCaluse?e.visitDefaultCaluse(this):e.visitChildren(this)}}class yp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}While(){return this.getToken(I.While,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(fo,0)}get ruleIndex(){return I.RULE_whileStatement}accept(e){return e.visitWhileStatement?e.visitWhileStatement(this):e.visitChildren(this)}}class mp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}importElement_list(){return this.getTypedRuleContexts(cl)}importElement(e){return this.getTypedRuleContext(cl,e)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_importStmt}accept(e){return e.visitImportStmt?e.visitImportStmt(this):e.visitChildren(this)}}class cl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Import(){return this.getToken(I.Import,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Divide_list(){return this.getTokens(I.Divide)}Divide(e){return this.getToken(I.Divide,e)}IntegerLiteral(){return this.getToken(I.IntegerLiteral,0)}As(){return this.getToken(I.As,0)}get ruleIndex(){return I.RULE_importElement}accept(e){return e.visitImportElement?e.visitImportElement(this):e.visitChildren(this)}}class _p extends Qe{constructor(e,n,o){super(n,o),this.parser=e}BooleanLiteral(){return this.getToken(I.BooleanLiteral,0)}ColorLiteral(){return this.getToken(I.ColorLiteral,0)}StringLiteral(){return this.getToken(I.StringLiteral,0)}IntegerLiteral(){return this.getToken(I.IntegerLiteral,0)}DecimalLiteral(){return this.getToken(I.DecimalLiteral,0)}get ruleIndex(){return I.RULE_literal}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}class ou extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodElement_list(){return this.getTypedRuleContexts(rs)}methodElement(e){return this.getTypedRuleContext(rs,e)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}get ruleIndex(){return I.RULE_methodStmt}accept(e){return e.visitMethodStmt?e.visitMethodStmt(this):e.visitChildren(this)}}class rs extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodName(){return this.getTypedRuleContext(gp,0)}arguments(){return this.getTypedRuleContext(fp,0)}get ruleIndex(){return I.RULE_methodElement}accept(e){return e.visitMethodElement?e.visitMethodElement(this):e.visitChildren(this)}}class gp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}LessThan(){return this.getToken(I.LessThan,0)}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}MoreThan(){return this.getToken(I.MoreThan,0)}Comma(){return this.getToken(I.Comma,0)}get ruleIndex(){return I.RULE_methodName}accept(e){return e.visitMethodName?e.visitMethodName(this):e.visitChildren(this)}}class bp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}arrowFunctionParameters(){return this.getTypedRuleContext(vp,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}Export(){return this.getToken(I.Export,0)}get ruleIndex(){return I.RULE_arrowFunction}accept(e){return e.visitArrowFunction?e.visitArrowFunction(this):e.visitChildren(this)}}class vp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}CloseParen(){return this.getToken(I.CloseParen,0)}formalParameterList(){return this.getTypedRuleContext(ll,0)}get ruleIndex(){return I.RULE_arrowFunctionParameters}accept(e){return e.visitArrowFunctionParameters?e.visitArrowFunctionParameters(this):e.visitChildren(this)}}class ll extends Qe{constructor(e,n,o){super(n,o),this.parser=e}formalParameterArg_list(){return this.getTypedRuleContexts(fl)}formalParameterArg(e){return this.getTypedRuleContext(fl,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_formalParameterList}accept(e){return e.visitFormalParameterList?e.visitFormalParameterList(this):e.visitChildren(this)}}class fl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return I.RULE_formalParameterArg}accept(e){return e.visitFormalParameterArg?e.visitFormalParameterArg(this):e.visitChildren(this)}}class Ep extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Method(){return this.getToken(I.Method,0)}identifier(){return this.getTypedRuleContext(xn,0)}arrowMethodParameters(){return this.getTypedRuleContext(Sp,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}Export(){return this.getToken(I.Export,0)}get ruleIndex(){return I.RULE_arrowMethod}accept(e){return e.visitArrowMethod?e.visitArrowMethod(this):e.visitChildren(this)}}class Sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}identifier(){return this.getTypedRuleContext(xn,0)}CloseParen(){return this.getToken(I.CloseParen,0)}Comma(){return this.getToken(I.Comma,0)}formalParameterList(){return this.getTypedRuleContext(ll,0)}get ruleIndex(){return I.RULE_arrowMethodParameters}accept(e){return e.visitArrowMethodParameters?e.visitArrowMethodParameters(this):e.visitChildren(this)}}class Tp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Type(){return this.getToken(I.Type,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}Export(){return this.getToken(I.Export,0)}typeElement_list(){return this.getTypedRuleContexts(hl)}typeElement(e){return this.getTypedRuleContext(hl,e)}get ruleIndex(){return I.RULE_typeStatement}accept(e){return e.visitTypeStatement?e.visitTypeStatement(this):e.visitChildren(this)}}class hl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeGather(){return this.getTypedRuleContext(Uo,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Varip(){return this.getToken(I.Varip,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return I.RULE_typeElement}accept(e){return e.visitTypeElement?e.visitTypeElement(this):e.visitChildren(this)}}class pl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ColonEquals(){return this.getToken(I.ColonEquals,0)}MultiplyAssign(){return this.getToken(I.MultiplyAssign,0)}DivideAssign(){return this.getToken(I.DivideAssign,0)}ModulusAssign(){return this.getToken(I.ModulusAssign,0)}PlusAssign(){return this.getToken(I.PlusAssign,0)}MinusAssign(){return this.getToken(I.MinusAssign,0)}get ruleIndex(){return I.RULE_assignmentOperator}accept(e){return e.visitAssignmentOperator?e.visitAssignmentOperator(this):e.visitChildren(this)}}class dl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Map(){return this.getToken(I.Map,0)}LessThan(){return this.getToken(I.LessThan,0)}Comma(){return this.getToken(I.Comma,0)}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}MoreThan(){return this.getToken(I.MoreThan,0)}get ruleIndex(){return I.RULE_typeMap}accept(e){return e.visitTypeMap?e.visitTypeMap(this):e.visitChildren(this)}}class Ap extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}typeArray(){return this.getTypedRuleContext(yl,0)}typeMap(){return this.getTypedRuleContext(dl,0)}get ruleIndex(){return I.RULE_typeSeries}accept(e){return e.visitTypeSeries?e.visitTypeSeries(this):e.visitChildren(this)}}class yl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}LessThan(){return this.getToken(I.LessThan,0)}MoreThan(){return this.getToken(I.MoreThan,0)}OpenBracket(){return this.getToken(I.OpenBracket,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}get ruleIndex(){return I.RULE_typeArray}accept(e){return e.visitTypeArray?e.visitTypeArray(this):e.visitChildren(this)}}class Uo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName(){return this.getTypedRuleContext(hi,0)}typeArray(){return this.getTypedRuleContext(yl,0)}typeMap(){return this.getTypedRuleContext(dl,0)}typeSeries(){return this.getTypedRuleContext(Ap,0)}get ruleIndex(){return I.RULE_typeGather}accept(e){return e.visitTypeGather?e.visitTypeGather(this):e.visitChildren(this)}}class xn extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Identifier(){return this.getToken(I.Identifier,0)}Map(){return this.getToken(I.Map,0)}Type(){return this.getToken(I.Type,0)}get ruleIndex(){return I.RULE_identifier}accept(e){return e.visitIdentifier?e.visitIdentifier(this):e.visitChildren(this)}}class hi extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point(){return this.getToken(I.Point,0)}get ruleIndex(){return I.RULE_typeName}accept(e){return e.visitTypeName?e.visitTypeName(this):e.visitChildren(this)}}class au extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}methodElement_list(){return this.getTypedRuleContexts(rs)}methodElement(e){return this.getTypedRuleContext(rs,e)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}get ruleIndex(){return I.RULE_name}accept(e){return e.visitName?e.visitName(this):e.visitChildren(this)}}class Em extends Xy{constructor(n){super(n);w(this,"tokens");w(this,"indents");w(this,"opened");this.tokens=[],this.indents=[],this.opened=0}reset(){this.tokens=[],this.indents=[],this.opened=0,super.reset()}emitToken(n){super.emitToken(n),this.tokens.push(n)}nextToken(){if(this._input.LA(1)===I.EOF&&this.indents.length){for(this.tokens=this.tokens.filter(function(o){return o.type!==I.EOF}),this.emitToken(this.commonToken(I.NEWLINE,`
11
- `));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(I.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(I.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const u=this.getCharIndex()-1,h=o.length?u-o.length+1:u;return new Gy([this,this._input],n,0,h,u)}getIndentationCount(n){let o=0;for(let u=0;u<n.length;u++)n[u]===" "?o+=4-o%4:o++;return o}atStartOfInput(){return this.getCharIndex()===0}openBrace(){this.opened++}closeBrace(){this.opened--}onNewLine(){const n=this.text.replace(/[^\r\n]+/g,""),o=this.text.replace(/[\r\n]+/g,""),u=this._input.LA(1),h=this._input.LA(2),m=this.getIndentationCount(o);if(this.opened>0||h!=-1&&(u===13||u===10||u===47&&h===47||m%4))this.skip();else{this.emitToken(this.commonToken(I.NEWLINE,n));const _=this.indents.length?this.indents[this.indents.length-1]:0;if(m===_)this.skip();else if(m>_)this.indents.push(m),this.emitToken(this.commonToken(I.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>m;)this.emitToken(this.createDedent()),this.indents.pop()}}}const Re=class Re extends Em{constructor(e){super(e),this._interp=new qy(this,Re._ATN,Re.DecisionsToDFA,new op)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return Re.literalNames}get symbolicNames(){return Re.symbolicNames}get ruleNames(){return Re.ruleNames}get serializedATN(){return Re._serializedATN}get channelNames(){return Re.channelNames}get modeNames(){return Re.modeNames}action(e,n,o){switch(n){case 1:this.OpenBracket_action(e,o);break;case 2:this.CloseBracket_action(e,o);break;case 3:this.OpenParen_action(e,o);break;case 4:this.CloseParen_action(e,o);break;case 56:this.NEWLINE_action(e,o);break}}OpenBracket_action(e,n){switch(n){case 0:this.openBrace();break}}CloseBracket_action(e,n){switch(n){case 1:this.closeBrace();break}}OpenParen_action(e,n){switch(n){case 2:this.openBrace();break}}CloseParen_action(e,n){switch(n){case 3:this.closeBrace();break}}NEWLINE_action(e,n){switch(n){case 4:this.onNewLine();break}}sempred(e,n,o){switch(n){case 56:return this.NEWLINE_sempred(e,o)}return!0}NEWLINE_sempred(e,n){switch(n){case 0:return this.atStartOfInput()}return!0}static get _ATN(){return Re.__ATN||(Re.__ATN=new rp().deserialize(Re._serializedATN)),Re.__ATN}};w(Re,"INDENT",1),w(Re,"DEDENT",2),w(Re,"Point",3),w(Re,"OpenBracket",4),w(Re,"CloseBracket",5),w(Re,"OpenParen",6),w(Re,"CloseParen",7),w(Re,"Comma",8),w(Re,"Assign",9),w(Re,"QuestionMark",10),w(Re,"Colon",11),w(Re,"Plus",12),w(Re,"Minus",13),w(Re,"Multiply",14),w(Re,"Divide",15),w(Re,"Modulus",16),w(Re,"Hashtag",17),w(Re,"LessThan",18),w(Re,"MoreThan",19),w(Re,"LessThanEquals",20),w(Re,"GreaterThanEquals",21),w(Re,"Equals_",22),w(Re,"NotEquals",23),w(Re,"MultiplyAssign",24),w(Re,"DivideAssign",25),w(Re,"ModulusAssign",26),w(Re,"PlusAssign",27),w(Re,"MinusAssign",28),w(Re,"ARROW",29),w(Re,"ColonEquals",30),w(Re,"BooleanLiteral",31),w(Re,"IntegerLiteral",32),w(Re,"DecimalLiteral",33),w(Re,"Break",34),w(Re,"And",35),w(Re,"Export",36),w(Re,"For",37),w(Re,"Var",38),w(Re,"Continue",39),w(Re,"Varip",40),w(Re,"Switch",41),w(Re,"While",42),w(Re,"If",43),w(Re,"In",44),w(Re,"Or",45),w(Re,"Not",46),w(Re,"Method",47),w(Re,"Else",48),w(Re,"To",49),w(Re,"By",50),w(Re,"Type",51),w(Re,"Import",52),w(Re,"As",53),w(Re,"Map",54),w(Re,"ColorLiteral",55),w(Re,"StringLiteral",56),w(Re,"Identifier",57),w(Re,"SKIP_",58),w(Re,"NEWLINE",59),w(Re,"EOF",ap.EOF),w(Re,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),w(Re,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(Re,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","SKIP_","NEWLINE"]),w(Re,"modeNames",["DEFAULT_MODE"]),w(Re,"ruleNames",["Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","SKIP_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),w(Re,"_serializedATN",[4,0,59,436,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,210,8,28,1,29,1,29,1,30,1,30,1,30,3,30,217,8,30,1,30,1,30,1,30,1,30,3,30,223,8,30,3,30,225,8,30,1,30,3,30,228,8,30,3,30,230,8,30,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,353,8,52,1,53,1,53,1,54,1,54,5,54,359,8,54,10,54,12,54,362,9,54,1,55,1,55,3,55,366,8,55,1,55,1,55,1,56,1,56,1,56,3,56,373,8,56,1,56,1,56,3,56,377,8,56,1,56,3,56,380,8,56,3,56,382,8,56,1,56,1,56,1,57,1,57,1,57,1,57,5,57,390,8,57,10,57,12,57,393,9,57,1,57,1,57,1,57,1,57,1,57,5,57,400,8,57,10,57,12,57,403,9,57,1,57,3,57,406,8,57,1,58,1,58,1,59,4,59,411,8,59,11,59,12,59,412,1,60,1,60,1,61,4,61,418,8,61,11,61,12,61,419,1,62,1,62,1,62,1,62,5,62,426,8,62,10,62,12,62,429,9,62,1,63,1,63,3,63,433,8,63,1,63,1,63,0,0,64,1,3,3,4,5,5,7,6,9,7,11,8,13,9,15,10,17,11,19,12,21,13,23,14,25,15,27,16,29,17,31,18,33,19,35,20,37,21,39,22,41,23,43,24,45,25,47,26,49,27,51,28,53,29,55,30,57,31,59,32,61,33,63,34,65,35,67,36,69,37,71,38,73,39,75,40,77,41,79,42,81,43,83,44,85,45,87,46,89,47,91,48,93,49,95,50,97,51,99,52,101,53,103,54,105,55,107,56,109,57,111,58,113,59,115,0,117,0,119,0,121,0,123,0,125,0,127,0,1,0,10,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,39,39,1,0,34,34,1,0,48,57,3,0,48,57,65,70,97,102,2,0,9,9,32,32,2,0,10,10,12,13,2,0,69,69,101,101,2,0,43,43,45,45,450,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,1,129,1,0,0,0,3,131,1,0,0,0,5,134,1,0,0,0,7,137,1,0,0,0,9,140,1,0,0,0,11,143,1,0,0,0,13,145,1,0,0,0,15,147,1,0,0,0,17,149,1,0,0,0,19,151,1,0,0,0,21,153,1,0,0,0,23,155,1,0,0,0,25,157,1,0,0,0,27,159,1,0,0,0,29,161,1,0,0,0,31,163,1,0,0,0,33,165,1,0,0,0,35,167,1,0,0,0,37,170,1,0,0,0,39,173,1,0,0,0,41,176,1,0,0,0,43,179,1,0,0,0,45,182,1,0,0,0,47,185,1,0,0,0,49,188,1,0,0,0,51,191,1,0,0,0,53,194,1,0,0,0,55,197,1,0,0,0,57,209,1,0,0,0,59,211,1,0,0,0,61,229,1,0,0,0,63,231,1,0,0,0,65,237,1,0,0,0,67,241,1,0,0,0,69,248,1,0,0,0,71,252,1,0,0,0,73,256,1,0,0,0,75,265,1,0,0,0,77,271,1,0,0,0,79,278,1,0,0,0,81,284,1,0,0,0,83,287,1,0,0,0,85,290,1,0,0,0,87,293,1,0,0,0,89,297,1,0,0,0,91,304,1,0,0,0,93,309,1,0,0,0,95,312,1,0,0,0,97,315,1,0,0,0,99,320,1,0,0,0,101,327,1,0,0,0,103,330,1,0,0,0,105,352,1,0,0,0,107,354,1,0,0,0,109,356,1,0,0,0,111,365,1,0,0,0,113,381,1,0,0,0,115,405,1,0,0,0,117,407,1,0,0,0,119,410,1,0,0,0,121,414,1,0,0,0,123,417,1,0,0,0,125,421,1,0,0,0,127,430,1,0,0,0,129,130,5,46,0,0,130,2,1,0,0,0,131,132,5,91,0,0,132,133,6,1,0,0,133,4,1,0,0,0,134,135,5,93,0,0,135,136,6,2,1,0,136,6,1,0,0,0,137,138,5,40,0,0,138,139,6,3,2,0,139,8,1,0,0,0,140,141,5,41,0,0,141,142,6,4,3,0,142,10,1,0,0,0,143,144,5,44,0,0,144,12,1,0,0,0,145,146,5,61,0,0,146,14,1,0,0,0,147,148,5,63,0,0,148,16,1,0,0,0,149,150,5,58,0,0,150,18,1,0,0,0,151,152,5,43,0,0,152,20,1,0,0,0,153,154,5,45,0,0,154,22,1,0,0,0,155,156,5,42,0,0,156,24,1,0,0,0,157,158,5,47,0,0,158,26,1,0,0,0,159,160,5,37,0,0,160,28,1,0,0,0,161,162,5,35,0,0,162,30,1,0,0,0,163,164,5,60,0,0,164,32,1,0,0,0,165,166,5,62,0,0,166,34,1,0,0,0,167,168,5,60,0,0,168,169,5,61,0,0,169,36,1,0,0,0,170,171,5,62,0,0,171,172,5,61,0,0,172,38,1,0,0,0,173,174,5,61,0,0,174,175,5,61,0,0,175,40,1,0,0,0,176,177,5,33,0,0,177,178,5,61,0,0,178,42,1,0,0,0,179,180,5,42,0,0,180,181,5,61,0,0,181,44,1,0,0,0,182,183,5,47,0,0,183,184,5,61,0,0,184,46,1,0,0,0,185,186,5,37,0,0,186,187,5,61,0,0,187,48,1,0,0,0,188,189,5,43,0,0,189,190,5,61,0,0,190,50,1,0,0,0,191,192,5,45,0,0,192,193,5,61,0,0,193,52,1,0,0,0,194,195,5,61,0,0,195,196,5,62,0,0,196,54,1,0,0,0,197,198,5,58,0,0,198,199,5,61,0,0,199,56,1,0,0,0,200,201,5,116,0,0,201,202,5,114,0,0,202,203,5,117,0,0,203,210,5,101,0,0,204,205,5,102,0,0,205,206,5,97,0,0,206,207,5,108,0,0,207,208,5,115,0,0,208,210,5,101,0,0,209,200,1,0,0,0,209,204,1,0,0,0,210,58,1,0,0,0,211,212,3,119,59,0,212,60,1,0,0,0,213,214,5,46,0,0,214,216,3,119,59,0,215,217,3,127,63,0,216,215,1,0,0,0,216,217,1,0,0,0,217,230,1,0,0,0,218,227,3,119,59,0,219,224,5,46,0,0,220,222,3,119,59,0,221,223,3,127,63,0,222,221,1,0,0,0,222,223,1,0,0,0,223,225,1,0,0,0,224,220,1,0,0,0,224,225,1,0,0,0,225,228,1,0,0,0,226,228,3,127,63,0,227,219,1,0,0,0,227,226,1,0,0,0,228,230,1,0,0,0,229,213,1,0,0,0,229,218,1,0,0,0,230,62,1,0,0,0,231,232,5,98,0,0,232,233,5,114,0,0,233,234,5,101,0,0,234,235,5,97,0,0,235,236,5,107,0,0,236,64,1,0,0,0,237,238,5,97,0,0,238,239,5,110,0,0,239,240,5,100,0,0,240,66,1,0,0,0,241,242,5,101,0,0,242,243,5,120,0,0,243,244,5,112,0,0,244,245,5,111,0,0,245,246,5,114,0,0,246,247,5,116,0,0,247,68,1,0,0,0,248,249,5,102,0,0,249,250,5,111,0,0,250,251,5,114,0,0,251,70,1,0,0,0,252,253,5,118,0,0,253,254,5,97,0,0,254,255,5,114,0,0,255,72,1,0,0,0,256,257,5,99,0,0,257,258,5,111,0,0,258,259,5,110,0,0,259,260,5,116,0,0,260,261,5,105,0,0,261,262,5,110,0,0,262,263,5,117,0,0,263,264,5,101,0,0,264,74,1,0,0,0,265,266,5,118,0,0,266,267,5,97,0,0,267,268,5,114,0,0,268,269,5,105,0,0,269,270,5,112,0,0,270,76,1,0,0,0,271,272,5,115,0,0,272,273,5,119,0,0,273,274,5,105,0,0,274,275,5,116,0,0,275,276,5,99,0,0,276,277,5,104,0,0,277,78,1,0,0,0,278,279,5,119,0,0,279,280,5,104,0,0,280,281,5,105,0,0,281,282,5,108,0,0,282,283,5,101,0,0,283,80,1,0,0,0,284,285,5,105,0,0,285,286,5,102,0,0,286,82,1,0,0,0,287,288,5,105,0,0,288,289,5,110,0,0,289,84,1,0,0,0,290,291,5,111,0,0,291,292,5,114,0,0,292,86,1,0,0,0,293,294,5,110,0,0,294,295,5,111,0,0,295,296,5,116,0,0,296,88,1,0,0,0,297,298,5,109,0,0,298,299,5,101,0,0,299,300,5,116,0,0,300,301,5,104,0,0,301,302,5,111,0,0,302,303,5,100,0,0,303,90,1,0,0,0,304,305,5,101,0,0,305,306,5,108,0,0,306,307,5,115,0,0,307,308,5,101,0,0,308,92,1,0,0,0,309,310,5,116,0,0,310,311,5,111,0,0,311,94,1,0,0,0,312,313,5,98,0,0,313,314,5,121,0,0,314,96,1,0,0,0,315,316,5,116,0,0,316,317,5,121,0,0,317,318,5,112,0,0,318,319,5,101,0,0,319,98,1,0,0,0,320,321,5,105,0,0,321,322,5,109,0,0,322,323,5,112,0,0,323,324,5,111,0,0,324,325,5,114,0,0,325,326,5,116,0,0,326,100,1,0,0,0,327,328,5,97,0,0,328,329,5,115,0,0,329,102,1,0,0,0,330,331,5,109,0,0,331,332,5,97,0,0,332,333,5,112,0,0,333,104,1,0,0,0,334,335,5,35,0,0,335,336,3,121,60,0,336,337,3,121,60,0,337,338,3,121,60,0,338,339,3,121,60,0,339,340,3,121,60,0,340,341,3,121,60,0,341,353,1,0,0,0,342,343,5,35,0,0,343,344,3,121,60,0,344,345,3,121,60,0,345,346,3,121,60,0,346,347,3,121,60,0,347,348,3,121,60,0,348,349,3,121,60,0,349,350,3,121,60,0,350,351,3,121,60,0,351,353,1,0,0,0,352,334,1,0,0,0,352,342,1,0,0,0,353,106,1,0,0,0,354,355,3,115,57,0,355,108,1,0,0,0,356,360,7,0,0,0,357,359,7,1,0,0,358,357,1,0,0,0,359,362,1,0,0,0,360,358,1,0,0,0,360,361,1,0,0,0,361,110,1,0,0,0,362,360,1,0,0,0,363,366,3,123,61,0,364,366,3,125,62,0,365,363,1,0,0,0,365,364,1,0,0,0,366,367,1,0,0,0,367,368,6,55,4,0,368,112,1,0,0,0,369,370,4,56,0,0,370,382,3,123,61,0,371,373,5,13,0,0,372,371,1,0,0,0,372,373,1,0,0,0,373,374,1,0,0,0,374,377,5,10,0,0,375,377,2,12,13,0,376,372,1,0,0,0,376,375,1,0,0,0,377,379,1,0,0,0,378,380,3,123,61,0,379,378,1,0,0,0,379,380,1,0,0,0,380,382,1,0,0,0,381,369,1,0,0,0,381,376,1,0,0,0,382,383,1,0,0,0,383,384,6,56,5,0,384,114,1,0,0,0,385,391,5,39,0,0,386,390,8,2,0,0,387,388,5,92,0,0,388,390,5,39,0,0,389,386,1,0,0,0,389,387,1,0,0,0,390,393,1,0,0,0,391,389,1,0,0,0,391,392,1,0,0,0,392,394,1,0,0,0,393,391,1,0,0,0,394,406,5,39,0,0,395,401,5,34,0,0,396,400,8,3,0,0,397,398,5,92,0,0,398,400,5,34,0,0,399,396,1,0,0,0,399,397,1,0,0,0,400,403,1,0,0,0,401,399,1,0,0,0,401,402,1,0,0,0,402,404,1,0,0,0,403,401,1,0,0,0,404,406,5,34,0,0,405,385,1,0,0,0,405,395,1,0,0,0,406,116,1,0,0,0,407,408,7,4,0,0,408,118,1,0,0,0,409,411,3,117,58,0,410,409,1,0,0,0,411,412,1,0,0,0,412,410,1,0,0,0,412,413,1,0,0,0,413,120,1,0,0,0,414,415,7,5,0,0,415,122,1,0,0,0,416,418,7,6,0,0,417,416,1,0,0,0,418,419,1,0,0,0,419,417,1,0,0,0,419,420,1,0,0,0,420,124,1,0,0,0,421,422,5,47,0,0,422,423,5,47,0,0,423,427,1,0,0,0,424,426,8,7,0,0,425,424,1,0,0,0,426,429,1,0,0,0,427,425,1,0,0,0,427,428,1,0,0,0,428,126,1,0,0,0,429,427,1,0,0,0,430,432,7,8,0,0,431,433,7,9,0,0,432,431,1,0,0,0,432,433,1,0,0,0,433,434,1,0,0,0,434,435,3,119,59,0,435,128,1,0,0,0,23,0,209,216,222,224,227,229,352,360,365,372,376,379,381,389,391,399,401,405,412,419,427,432,6,1,1,0,1,2,1,1,3,2,1,4,3,6,0,0,1,56,4]),w(Re,"__ATN"),w(Re,"DecisionsToDFA",Re._ATN.decisionToState.map((e,n)=>new ip(e,n)));let ml=Re;var W=(t=>(t.BOOL="bool",t.INT="int",t.FLOAT="float",t.ARRAY="array",t.BOX="box",t.CHART_POINT="chart.point",t.COLOR="color",t.CONST="const",t.LABEL="label",t.LINE="line",t.LINEFILL="linefill",t.MAP="map",t.MATRIX="matrix",t.POLYLINE="polyline",t.SERIES="series",t.SIMPLE="simple",t.STRING="string",t.TABLE="table",t.UNDETERMINED="undetermined type",t.INPUT="input",t.NA="na",t.VOID="void",t))(W||{}),Oe=(t=>(t.FlowStmt="FlowStmt",t.DeclareAssign="DeclareAssign",t.VarBlockStmt="VarBlockStmt",t.VarSingle="VarSingle",t.VarMultiple="VarMultiple",t.ParenthesizedExpression="ParenthesizedExpression",t.AdditiveExpression="AdditiveExpression",t.RelationalExpression="RelationalExpression",t.EqualityExpression="EqualityExpression",t.TernaryExpression="TernaryExpression",t.UnaryExpression="UnaryExpression",t.NotExpression="NotExpression",t.MemberIndexExpression="MemberIndexExpression",t.MethodExpression="MethodExpression",t.LogicalAndExpression="LogicalAndExpression",t.LogicalOrExpression="LogicalOrExpression",t.MultiplicativeExpression="MultiplicativeExpression",t.Brackethesized="Brackethesized",t.IfStatement="IfStatement",t.ForToStatement="ForToStatement",t.ForInStatement="ForInStatement",t.SwitchStatement="SwitchStatement",t.CaseClause="CaseClause",t.DefaultCaluse="DefaultCaluse",t.WhileStatement="WhileStatement",t.ImportElement="ImportElement",t.Literal="Literal",t.ArrowFunction="ArrowFunction",t.ArrowMethod="ArrowMethod",t.TypeStatement="TypeStatement",t.Name="Name",t.AgainAssign="AgainAssign",t))(Oe||{});const Pe={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an undefined object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in."},Ri={repeatVar:"Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",typeMismatch:"The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",moreSameArg:"More than one '$arg' arguments are supplied. Only the first one will be used.",localScopeGetHistory:"The variable '$name' is declared in local scope, which may not be executed at every update. So, obtaining its historical values may lead to unexpected results",localScopeWarning:"The function '$name' should be called on each calculation for consistency. It is recommended to extract the call from this scope"},wi=[W.SERIES,W.SIMPLE,W.INPUT,W.CONST],Sm=[W.INT,W.FLOAT,W.BOOL,W.COLOR,W.STRING],_l=["indicator","strategy","library"],Tm=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","indicator","alertcondition","barcolor","bgcolor","fill","library","strategy","strategy.risk.max_drawdown","strategy.risk.allow_entry_in","strategy.risk.max_cons_loss_days","max_intraday_filled_orders","strategy.risk.max_intraday_loss","strategy.risk.max_position_size"],Am=["strategy","input","table","color","line","linefill","label","box"],xp=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"];var Op=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xm={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Op,function(){var n=1e3,o=6e4,u=36e5,h="millisecond",m="second",_="minute",T="hour",x="day",P="week",A="month",F="quarter",$="year",V="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ye){var te=["th","st","nd","rd"],he=ye%100;return"["+ye+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(ye,te,he){var le=String(ye);return!le||le.length>=te?ye:""+Array(te+1-le.length).join(he)+ye},O={s:R,z:function(ye){var te=-ye.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),Ae=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(Ae,2,"0")},m:function ye(te,he){if(te.date()<he.date())return-ye(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),Ae=te.clone().add(le,A),Ne=he-Ae<0,_e=te.clone().add(le+(Ne?-1:1),A);return+(-(le+(he-Ae)/(Ne?Ae-_e:_e-Ae))||0)},a:function(ye){return ye<0?Math.ceil(ye)||0:Math.floor(ye)},p:function(ye){return{M:A,y:$,w:P,d:x,D:V,h:T,m:_,s:m,ms:h,Q:F}[ye]||String(ye||"").toLowerCase().replace(/s$/,"")},u:function(ye){return ye===void 0}},U="en",X={};X[U]=D;var ue="$isDayjsObject",K=function(ye){return ye instanceof Q||!(!ye||!ye[ue])},Y=function ye(te,he,le){var Ae;if(!te)return U;if(typeof te=="string"){var Ne=te.toLowerCase();X[Ne]&&(Ae=Ne),he&&(X[Ne]=he,Ae=Ne);var _e=te.split("-");if(!Ae&&_e.length>1)return ye(_e[0])}else{var Ue=te.name;X[Ue]=te,Ae=Ue}return!le&&Ae&&(U=Ae),Ae||!le&&U},G=function(ye,te){if(K(ye))return ye.clone();var he=typeof te=="object"?te:{};return he.date=ye,he.args=arguments,new Q(he)},ce=O;ce.l=Y,ce.i=K,ce.w=function(ye,te){return G(ye,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function ye(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[ue]=!0}var te=ye.prototype;return te.parse=function(he){this.$d=function(le){var Ae=le.date,Ne=le.utc;if(Ae===null)return new Date(NaN);if(ce.u(Ae))return new Date;if(Ae instanceof Date)return new Date(Ae);if(typeof Ae=="string"&&!/Z$/i.test(Ae)){var _e=Ae.match(y);if(_e){var Ue=_e[2]-1||0,J=(_e[7]||"0").substring(0,3);return Ne?new Date(Date.UTC(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)):new Date(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)}}return new Date(Ae)}(he),this.init()},te.init=function(){var he=this.$d;this.$y=he.getFullYear(),this.$M=he.getMonth(),this.$D=he.getDate(),this.$W=he.getDay(),this.$H=he.getHours(),this.$m=he.getMinutes(),this.$s=he.getSeconds(),this.$ms=he.getMilliseconds()},te.$utils=function(){return ce},te.isValid=function(){return this.$d.toString()!==b},te.isSame=function(he,le){var Ae=G(he);return this.startOf(le)<=Ae&&Ae<=this.endOf(le)},te.isAfter=function(he,le){return G(he)<this.startOf(le)},te.isBefore=function(he,le){return this.endOf(le)<G(he)},te.$g=function(he,le,Ae){return ce.u(he)?this[le]:this.set(Ae,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var Ae=this,Ne=!!ce.u(le)||le,_e=ce.p(he),Ue=function(Et,Lt){var gt=ce.w(Ae.$u?Date.UTC(Ae.$y,Lt,Et):new Date(Ae.$y,Lt,Et),Ae);return Ne?gt:gt.endOf(x)},J=function(Et,Lt){return ce.w(Ae.toDate()[Et].apply(Ae.toDate("s"),(Ne?[0,0,0,0]:[23,59,59,999]).slice(Lt)),Ae)},ne=this.$W,ae=this.$M,Ee=this.$D,me="set"+(this.$u?"UTC":"");switch(_e){case $:return Ne?Ue(1,0):Ue(31,11);case A:return Ne?Ue(1,ae):Ue(0,ae+1);case P:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ne?Ee-jt:Ee+(6-jt),ae);case x:case V:return J(me+"Hours",0);case T:return J(me+"Minutes",1);case _:return J(me+"Seconds",2);case m:return J(me+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var Ae,Ne=ce.p(he),_e="set"+(this.$u?"UTC":""),Ue=(Ae={},Ae[x]=_e+"Date",Ae[V]=_e+"Date",Ae[A]=_e+"Month",Ae[$]=_e+"FullYear",Ae[T]=_e+"Hours",Ae[_]=_e+"Minutes",Ae[m]=_e+"Seconds",Ae[h]=_e+"Milliseconds",Ae)[Ne],J=Ne===x?this.$D+(le-this.$W):le;if(Ne===A||Ne===$){var ne=this.clone().set(V,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(V,Math.min(this.$D,ne.daysInMonth())).$d}else Ue&&this.$d[Ue](J);return this.init(),this},te.set=function(he,le){return this.clone().$set(he,le)},te.get=function(he){return this[ce.p(he)]()},te.add=function(he,le){var Ae,Ne=this;he=Number(he);var _e=ce.p(le),Ue=function(ae){var Ee=G(Ne);return ce.w(Ee.date(Ee.date()+Math.round(ae*he)),Ne)};if(_e===A)return this.set(A,this.$M+he);if(_e===$)return this.set($,this.$y+he);if(_e===x)return Ue(1);if(_e===P)return Ue(7);var J=(Ae={},Ae[_]=o,Ae[T]=u,Ae[m]=n,Ae)[_e]||1,ne=this.$d.getTime()+he*J;return ce.w(ne,this)},te.subtract=function(he,le){return this.add(-1*he,le)},te.format=function(he){var le=this,Ae=this.$locale();if(!this.isValid())return Ae.invalidDate||b;var Ne=he||"YYYY-MM-DDTHH:mm:ssZ",_e=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,ae=Ae.weekdays,Ee=Ae.months,me=Ae.meridiem,At=function(Lt,gt,Dt,Jt){return Lt&&(Lt[gt]||Lt(le,Ne))||Dt[gt].slice(0,Jt)},jt=function(Lt){return ce.s(Ue%12||12,Lt,"0")},Et=me||function(Lt,gt,Dt){var Jt=Lt<12?"AM":"PM";return Dt?Jt.toLowerCase():Jt};return Ne.replace(g,function(Lt,gt){return gt||function(Dt){switch(Dt){case"YY":return String(le.$y).slice(-2);case"YYYY":return ce.s(le.$y,4,"0");case"M":return ne+1;case"MM":return ce.s(ne+1,2,"0");case"MMM":return At(Ae.monthsShort,ne,Ee,3);case"MMMM":return At(Ee,ne);case"D":return le.$D;case"DD":return ce.s(le.$D,2,"0");case"d":return String(le.$W);case"dd":return At(Ae.weekdaysMin,le.$W,ae,2);case"ddd":return At(Ae.weekdaysShort,le.$W,ae,3);case"dddd":return ae[le.$W];case"H":return String(Ue);case"HH":return ce.s(Ue,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Et(Ue,J,!0);case"A":return Et(Ue,J,!1);case"m":return String(J);case"mm":return ce.s(J,2,"0");case"s":return String(le.$s);case"ss":return ce.s(le.$s,2,"0");case"SSS":return ce.s(le.$ms,3,"0");case"Z":return _e}return null}(Lt)||_e.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,Ae){var Ne,_e=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,ae=this-J,Ee=function(){return ce.m(_e,J)};switch(Ue){case $:Ne=Ee()/12;break;case A:Ne=Ee();break;case F:Ne=Ee()/3;break;case P:Ne=(ae-ne)/6048e5;break;case x:Ne=(ae-ne)/864e5;break;case T:Ne=ae/u;break;case _:Ne=ae/o;break;case m:Ne=ae/n;break;default:Ne=ae}return Ae?Ne:ce.a(Ne)},te.daysInMonth=function(){return this.endOf(A).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var Ae=this.clone(),Ne=Y(he,le,!0);return Ne&&(Ae.$L=Ne),Ae},te.clone=function(){return ce.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},ye}(),de=Q.prototype;return G.prototype=de,[["$ms",h],["$s",m],["$m",_],["$H",T],["$W",x],["$M",A],["$y",$],["$D",V]].forEach(function(ye){de[ye[1]]=function(te){return this.$g(te,ye[0],ye[1])}}),G.extend=function(ye,te){return ye.$i||(ye(te,Q,G),ye.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(ye){return G(1e3*ye)},G.en=X[U],G.Ls=X,G.p={},G})})(xm);function we(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class Om extends Yy{constructor(){super(...arguments);w(this,"visitProgram");w(this,"visitGlobalStmt");w(this,"visitBlockStmt");w(this,"visitStmt");w(this,"visitSimpleStmt");w(this,"visitFlowStmt");w(this,"visitBlock");w(this,"visitBlockLine");w(this,"visitVariableDeclarationStmt");w(this,"visitDeclareAssign");w(this,"visitAgainAssign");w(this,"visitVarModifier");w(this,"visitBlockSequence");w(this,"visitExpressionSequence");w(this,"visitExpressionBlockSequence");w(this,"visitVarBlockStmt");w(this,"visitVarSingle");w(this,"visitVarMultiple");w(this,"visitBlockExpression");w(this,"visitParenthesizedExpression");w(this,"visitAdditiveExpression");w(this,"visitRelationalExpression");w(this,"visitTernaryExpression");w(this,"visitLogicalAndExpression");w(this,"visitNameExpression");w(this,"visitLiteralExpression");w(this,"visitLogicalOrExpression");w(this,"visitUnaryExpression");w(this,"visitNotExpression");w(this,"visitMemberIndexExpression");w(this,"visitMethodExpression");w(this,"visitEqualityExpression");w(this,"visitMultiplicativeExpression");w(this,"visitBrackethesized");w(this,"visitArguments");w(this,"visitArgument");w(this,"visitIfStatement");w(this,"visitForToStatement");w(this,"visitForInStatement");w(this,"visitSwitchStatement");w(this,"visitCaseClause");w(this,"visitDefaultCaluse");w(this,"visitWhileStatement");w(this,"visitImportStmt");w(this,"visitImportElement");w(this,"visitLiteral");w(this,"visitMethodStmt");w(this,"visitMethodElement");w(this,"visitMethodName");w(this,"visitArrowFunction");w(this,"visitArrowFunctionParameters");w(this,"visitFormalParameterList");w(this,"visitFormalParameterArg");w(this,"visitArrowMethod");w(this,"visitArrowMethodParameters");w(this,"visitTypeStatement");w(this,"visitTypeElement");w(this,"visitAssignmentOperator");w(this,"visitTypeMap");w(this,"visitTypeSeries");w(this,"visitTypeArray");w(this,"visitTypeGather");w(this,"visitIdentifier");w(this,"visitTypeName");w(this,"visitName")}}class Dm extends Om{constructor(n){super();w(this,"_buildinVariables");w(this,"_buildinTypes");w(this,"_buildinConstants");w(this,"_buildinMethods");w(this,"_buildinFunctions");this._buildinVariables=new Map,this._buildinConstants=new Map,this._buildinFunctions=new Map,this._buildinTypes=new Map,this._buildinMethods=new Map,this._buildinHandle(n)}_buildinHandle(n){for(const o in n){const u=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=u;break;case"functions":this._buildinFunctions=u;break;case"methods":this._buildinMethods=u;break;case"types":this._buildinTypes=u;break;case"variables":this._buildinVariables=u;break}}}_typeHandle(n=[],o){if(!n.length)return W.UNDETERMINED;if(n=n.filter(m=>!m.endsWith(W.NA)),!n.length)return`${W.SIMPLE} ${W.NA}`;let u=100,h="";for(const m of n){if(m===W.UNDETERMINED)return W.UNDETERMINED;m.startsWith(W.SERIES)?u=0:m.startsWith(W.SIMPLE)&&u>0?u=1:m.startsWith(W.INPUT)&&u>1?u=2:m.startsWith(W.CONST)&&u>2&&(u=3);const _=this._removePrefix(m);(_!==W.INT||!h)&&(h=_)}return u===100?h:`${wi[u]} ${o||h}`}_returnTypesOtherHandle(n,o,u,h){if(!u.length||u[0].includes("<>")){const m=n.type;let _=m;if(!m||m===W.UNDETERMINED)return[W.UNDETERMINED];switch(o){case"series <type>":_=this._getArrayType(m),_||(_=this._removePrefix(m)),u=[this._typeAddSeries(_)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(m)){const T=this._getMapType(m)||[];h.includes("keys")?_=T[0]:_=T[1]}else _=this._getArrayType(m),_||(_=this._removePrefix(m));u=[this._typeReplace(o,_)];break;case"<matrix_type>":_=this._getArrayType(m),u=[this._typeAddSeries(_)];break;case"map<keyType, valueType>":u=[_];break;case"<value_type>":_=this._getMapType(m),u=[_[1]];break}}return u}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;o=this._removePrefix(o);const u=o.replace("int","float");return n.some(h=>h===o||u===h||h.endsWith(o))}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==W.INT;{const u=this._getPrefix(n),h=this._getPrefix(o);return u===h?!!n.endsWith(W.INT):!(wi.indexOf(u)<wi.indexOf(h))}}_compareType(n,o){if(n===W.UNDETERMINED||o===W.UNDETERMINED)return!0;const u=[W.FLOAT,W.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const h=this._getArrayType(n)||"",m=this._getArrayType(o)||"";return h===m||u.includes(h)&&u.includes(m)}else if(this._isMapType(n)){const h=this._getMapType(n)||[],m=this._getMapType(o)||[];return(h[0]===m[0]||u.includes(h[0])&&u.includes(m[0]))&&(h[1]===m[1]||u.includes(h[1])&&u.includes(m[1]))}else{const h=this._removePrefix(n),m=this._removePrefix(o);return h===W.NA||m===W.NA||h===m||u.includes(h)&&u.includes(m)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.SERIES} ${n}`:n}_typeAddConst(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.CONST} ${n}`:n}_getOriginMethodName(n,o){let u="";return this._isArrayType(n)?u=`${W.ARRAY}.${o}`:this._isMatrixType(n)?u=`${W.MATRIX}.${o}`:this._isMapType(n)?u=`${W.MAP}.${o}`:u=`${this._removePrefix(n)}.${o}`,u}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(u=>u.trim()):n}_removePrefix(n=""){return n.replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}_getPrefix(n){if(!n)return"";const o=n.replace(/(series|simple|const|input).+/,"$1");return wi.includes(o)?o:""}_getArrayType(n){let o=/\w+<([\w\d.]+)>/.exec(n);return o||(o=/([\w\d.]+)\[\]/.exec(n)),o==null?void 0:o[1]}_getMapType(n){const o=/\w+<(\w+),\s*([\w\d.]+)>/.exec(n);return(o==null?void 0:o[1])&&(o==null?void 0:o[2])&&[o==null?void 0:o[1],o==null?void 0:o[2]]}_isMatrixType(n){return/^matrix<[\w\d.]+>$/.test(n)}_isArrayType(n){return/^array<[\w\d.]+>$/.test(n)||/^[\w\d.]+\[\]$/.test(n)}_isMapType(n){return/^map<\w+,\s*[\w\d.]+>$/.test(n)}_arrayTypeConvert(n){return!this._isArrayType(n)||!n.includes("<")?n:`${this._getArrayType(n)}[]`}_getMethodTypeName(n){return this._isArrayType(n)?W.ARRAY:this._isMapType(n)?W.MAP:this._isMatrixType(n)?W.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(W.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var Lr=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(Lr||{});class Cm extends Dm{constructor(n){super(n);w(this,"_loopCount");w(this,"_errors");w(this,"_variables");w(this,"_functions");w(this,"_methods");w(this,"_types");w(this,"_currentBlockVars");w(this,"_currentFuncParams");w(this,"_isNeedCalc");w(this,"_blockCount");w(this,"_isInFunc");w(this,"_onlyStatementsCount");w(this,"_blockRanges");w(this,"_overloadsFuncs");w(this,"_hasMemberIndex");w(this,"_isInLocalScop");w(this,"visitProgram",n=>{const{children:o}=n;let u=0;const h=[];for(this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_globalStmt&&h.push(this.visit(m))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:1,endLineNumber:1,message:we(Pe.onlyStatementErr,{count:this._onlyStatementsCount})}),h});w(this,"visitGlobalStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_methodStmt&&_l.includes(h.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),u)),h}return null});w(this,"visitBlockStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationStmt:h.push(...this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break}}return h});w(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitFlowStmt",n=>{const{children:o}=n,{column:u,line:h,text:m}=o[0].symbol;if(this._loopCount<=0){const _=u+1;this._errors.push({startColumn:_,endColumn:parseInt(_+m.length),startLineNumber:h,endLineNumber:h,message:we(Pe.onlyInLoop,{text:m})})}return{ruleType:Oe.FlowStmt,value:m}});w(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return u.ruleIndex===I.RULE_simpleStmt?this._inBlock(u):this.visit(u)}return null});w(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let u=0;const h=[];for(this._blockCount++,this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_stmt&&h.push(this.visit(m))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),h});w(this,"visitDeclareAssign",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.DeclareAssign};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(m);break;case I.RULE_singleExpression:h.value=this.visit(m);break}}return this._variablesHandle(h,n),h});w(this,"visitAgainAssign",n=>{const{children:o}=n;if(o.length>=3){const u=this.visit(o[0]);this._verifyGloablVar(u,o[0]);const h=this.visit(o[2]),m=this.visit(o[1]);return u.type?this._againAssignHandle([u,h],[o[0],o[2]],m):null}return null});w(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});w(this,"visitExpressionSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_singleExpression){const _=this.visit(m);_&&(_.ctx=m,h.push(_))}}return h});w(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.push(this.visit(m));break;case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break}}return h});w(this,"visitBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_singleExpression:h.push(this.visit(m));break}}return h});w(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_methodStmt:const _=this.visit(m);_l.includes(_.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),m)),h.push(_);break}}return h});w(this,"visitVarBlockStmt",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.VarBlockStmt,ctx:n},m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(_);break;case I.RULE_assignmentOperator:h.operator=this.visit(_);break;case I.RULE_name:m.push(_),h.name=this.visit(_);break;case I.RULE_blockExpression:this._isNeedCalc=!0,h.value=this.visit(_),m.push(_);const T=this._getBlockReturnTypes(h.value);T.length===1?h.value.type=T[0]:h.value.types=T,this._isNeedCalc=!1;break}}return h.name?this._againAssignHandle([h.name,h.value],m,h.operator):(this._variablesHandle(h,n),h)});w(this,"visitVarSingle",n=>{const{children:o}=n,u={ruleType:Oe.VarSingle};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h];switch(_.ruleIndex){case I.RULE_varModifier:u.declare=this.visit(_);break;case I.RULE_typeGather:const T=this.visit(_);u.prefix=this._getPrefix(T),u.type=T&&this._typeAddConst(T);break;case I.RULE_identifier:const x=this.visit(_);this._repeatVarJudge(x,_),m={lineNumber:_.start.line,column:_.start.column},u.name=x,u.pos=m;break}}return u});w(this,"visitVarMultiple",n=>{const{children:o}=n;let u=0;const h=[],m=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_identifier){const T=this.visit(_);this._repeatVarJudge(T,_),h.push(T),m.push({lineNumber:_.start.line,column:_.start.column})}}return{ruleType:Oe.VarMultiple,names:h,posList:m}});w(this,"visitBlockExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitParenthesizedExpression",n=>{const{children:o}=n,u=o[1],h=this.visit(u);return{ruleType:Oe.ParenthesizedExpression,type:h.type,ctx:n,exprs:h}});w(this,"visitAdditiveExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _={ruleType:Oe.AdditiveExpression,operator:h,ctx:n,exprs:m};if(["+","-"].includes(h)){const T=[W.UNDETERMINED,W.INT,W.FLOAT];h==="+"&&T.push(W.STRING);const x=this._sameTypeJudge(m,[o[0],o[2]],h,T);_.type=this._typeHandle(x)}else{const T=this._calcTypeJudge(m[0],o[0],h),x=this._calcTypeJudge(m[1],o[2],h,1);_.type=this._typeHandle([T,x])}return _});w(this,"visitRelationalExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.RelationalExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitEqualityExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _=this._sameTypeJudge(m,[o[0],o[2]],h,[W.UNDETERMINED,W.COLOR,W.STRING,W.BOOL,W.INT,W.FLOAT]);return{ruleType:Oe.EqualityExpression,operator:h,ctx:n,type:this._typeHandle(_,W.BOOL),exprs:m}});w(this,"visitTernaryExpression",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_singleExpression){const T=this._isInLocalScop;u!==0&&(this._isInLocalScop=!0),h.push(this.visit(_)),this._isInLocalScop=T}}let m=W.UNDETERMINED;if(h.length>=3){this._boolTypeJudge(h[0],o[0],"?:");const _=this._sameTypeJudge(h.slice(1),[o[2],o[4]],"?:",[]),T=this._getPrefix(h[0].type);m=this._typeHandle(_),T&&this._getPrefix(m)&&(m=this._typeHandle([m,`${T} ${this._removePrefix(m)}`]))}return{ruleType:Oe.TernaryExpression,type:m,ctx:n,exprs:h}});w(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[u,h]=o,m=[this.visit(h)],_=u.symbol.text,T=this._calcTypeJudge(m[0],h,_);return((x=m[0])==null?void 0:x.ruleType)===Oe.UnaryExpression&&this._errors.push({message:we(Pe.unaryErr,{sign:_}),startColumn:u.symbol.column+1,startLineNumber:u.symbol.line,endColumn:u.symbol.column+2,endLineNumber:u.symbol.line}),{ruleType:Oe.UnaryExpression,operator:_,type:T,ctx:n,exprs:m}});w(this,"visitNotExpression",n=>{const{children:o}=n,u=o[1],h=[this.visit(u)],m=this._boolTypeJudge(h[0],u,"not");return{ruleType:Oe.NotExpression,ctx:n,type:this._typeHandle([m],W.BOOL),exprs:h}});w(this,"visitMemberIndexExpression",n=>{var m,_;const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression&&h.push(this.visit(T))}if(this._memberIndexVerify(h[0],n),this._hasMemberIndex=!0,((m=h[0])==null?void 0:m.ruleType)===Oe.MemberIndexExpression){const T=o[1];this._errors.push({message:we(Pe.unaryErr,{sign:"["}),startColumn:T.symbol.column+1,startLineNumber:T.symbol.line,endColumn:T.symbol.column+2,endLineNumber:T.symbol.line}),this._hasMemberIndex=!1}return{ruleType:Oe.MemberIndexExpression,type:(_=h[0])==null?void 0:_.type,ctx:n,isInFunc:this._isInFunc,exprs:h}});w(this,"visitMethodStmt",n=>{const{children:o}=n;let u=0;const h=[],m=[];let _;for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_methodElement&&(h.push(this.visit(T)),m.push(T))}return _=this._getMethodTypes(h,m)||[],{ruleType:Oe.MethodExpression,types:_.length>1||_.isBrackethesized||_.isUnknown?_:void 0,ctx:n,type:_.length===1?_[0]:void 0,exprs:h}});w(this,"visitMethodExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLogicalAndExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalAndExpression,type:this._typeHandle([_,T],W.BOOL),operator:h,ctx:n,exprs:m}});w(this,"visitLogicalOrExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalOrExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitMultiplicativeExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.MultiplicativeExpression,operator:h,ctx:n,type:this._typeHandle([_,T]),exprs:m}});w(this,"visitBrackethesized",n=>{const{children:o}=n,u=o[1];return{ruleType:Oe.Brackethesized,ctx:n,exprs:this.visit(u)}});w(this,"visitArguments",n=>{const{children:o}=n;let u=0;const h={params:[]};let m="";for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_argument){const T=this.visit(_),x=T.paramKey;x?(m=x,h[x]?this._errorHandle(we(Ri.moreSameArg,{arg:x}),n.parentCtx,Lr.Warning):(h[x]=T.param,h[x].ctx=_)):m?this._errorHandle(we(Pe.argsSyntaxErr,{argName:m}),_):(T.ctx=_,h.params.push(T))}}return h});w(this,"visitArgument",n=>{const{children:o}=n;return o.length===1?this.visit(o[0]):{paramKey:this.visit(o[0]),param:this.visit(o[2])}});w(this,"visitIfStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.IfStatement,condition:[],block:[],ctx:n,typeList:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition.push(this.visit(m));break;case I.RULE_blockLine:const _=this._isInLocalScop;this._isInLocalScop=!0;const T=this.visit(m);h.typeList.push(this._getBlockReturnTypes(T)),h.block.push(T),this._isInLocalScop=_;break}}return h});w(this,"visitForToStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForToStatement,numerical:[],ctx:n,block:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varModifier:h.declare=this.visit(m);break;case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m),this._repeatVarJudge(h.name,m);break;case I.RULE_singleExpression:h.numerical.push(this.visit(m));break;case I.RULE_blockLine:this._blockCount++,this._pushBlockRanges(n),h.name&&this._variablesHandle({nameList:{name:h.name,isForVar:!0,type:h.type},value:{type:h.type||`${W.SERIES} ${W.INT}`}},n),this._blockCount--,this._blockRanges.pop(),this._loopCount++;const T=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._loopCount--,this._isInLocalScop=T,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitForInStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForInStatement,ctx:n,names:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_identifier:const _=this.visit(m);this._repeatVarJudge(_,m),h.names.push(_);break;case I.RULE_singleExpression:h.array=this.visit(m);const T=h.array.type;this._isArrayType(T)||this._isMatrixType(T)||T===W.UNDETERMINED||this._errorHandle(we(Pe.typeMismatch,{operator:"foreach",index:"id",typeE:T,typeR:"array<fun_arg>"}),m);break;case I.RULE_blockLine:if(this._blockCount++,this._pushBlockRanges(n),h.names.length){let[P,A]=h.names;const F=h.array.type;A?this._variablesHandle({nameList:{name:P,isForVar:!0,type:`${W.SERIES} ${W.INT}`},value:{type:`${W.SERIES} ${W.INT}`}},n):A=P;const $=F===W.UNDETERMINED?F:this._isMatrixType(F)?`${this._getArrayType(F)}[]`:this._typeAddSeries(this._getArrayType(F));this._variablesHandle({nameList:{name:A,isForVar:!0,type:$},value:{type:$}},n)}this._blockCount--,this._blockRanges.pop(),this._loopCount++;const x=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._isInLocalScop=x,this._loopCount--,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitSwitchStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.SwitchStatement,condition:!0,ctx:n,cases:[],defaultCase:void 0};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition=this.visit(m);break;case I.RULE_caseClause:h.cases.push(this.visit(m));break;case I.RULE_defaultCaluse:h.defaultCase=this.visit(m);break}}return h});w(this,"visitCaseClause",n=>{const{children:o}=n,u={ruleType:Oe.CaseClause},h=this._isInLocalScop;return this._isInLocalScop=!0,u.condition=this.visit(o[0]),u.block=this.visit(o[2]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitDefaultCaluse",n=>{const{children:o}=n,u={ruleType:Oe.DefaultCaluse},h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[1]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitWhileStatement",n=>{const{children:o}=n,u={ruleType:Oe.WhileStatement,ctx:n};u.condition=this.visit(o[1]),this._loopCount++;const h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[2]),this._isInLocalScop=h,this._loopCount--,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitImportStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_importElement&&h.push(this.visit(m))}return h});w(this,"visitImportElement",n=>{const{children:o}=n;let u=0;const h=[],m={ruleType:Oe.ImportElement,ctx:n};for(;u<o.length;u++){const _=o[u];_.ruleIndex===I.RULE_identifier?h.push(this.visit(_)):_.symbol&&_.symbol.type===I.IntegerLiteral&&(m.libraryVersion=_.symbol.text)}return m.username=h[0],m.libraryName=h[1],m.name=h[2],m});w(this,"visitLiteral",n=>{const{children:o}=n,u=o[0],{type:h,text:m}=u.symbol,_={ruleType:Oe.Literal,ctx:n,type:"",value:m};switch(h){case I.ColorLiteral:_.type=W.COLOR;break;case I.BooleanLiteral:_.type=W.BOOL;break;case I.StringLiteral:_.type=W.STRING;break;case I.IntegerLiteral:_.type=W.INT;break;case I.DecimalLiteral:_.type=W.FLOAT;break}return _.type&&(_.type=`${W.CONST} ${_.type}`),_});w(this,"visitMethodElement",n=>{const{children:o}=n,[u,h]=o,[m,_,T]=this.visit(u),x=this.visit(h);return{name:m,type:_,args:x,expr:T}});w(this,"visitMethodName",n=>{const{children:o}=n,u=[],h=[];let m=0,_=null;for(;m<o.length;m++){const x=o[m],P=x.ruleIndex,A=x.symbol;switch(P){case I.RULE_identifier:u.push(this.visit(x));break;case I.RULE_singleExpression:_=this.visit(x);break;case I.RULE_typeName:const F=this.visit(x);h.push(F),this._typeCheck(F,I.RULE_typeName,x);break;default:A&&A.text==="."&&u.push(".")}}return[u.join(""),h,_]});w(this,"visitArrowFunction",n=>{const{children:o}=n,u={ruleType:Oe.ArrowFunction,returnedTypes:[]};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h],T=_.ruleIndex,x=_.symbol;switch(T){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},u.name=this.visit(_);break;case I.RULE_arrowFunctionParameters:u.params=this.visit(_),this._setFuncParams(u);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,u.block=this.visit(_),u.hasMemberIndex=this._hasMemberIndex,u.returnedTypes=this._getBlockReturnTypes(u.block),this._isInFunc=!1;break;default:x&&x.type===I.Export&&(u.isExport=!0)}}return this._setFunc(u,m),this._currentFuncParams.clear(),u});w(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let u=0,h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterList&&(h=this.visit(m))}return h});w(this,"visitFormalParameterList",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterArg&&h.push(this.visit(m))}return h});w(this,"visitFormalParameterArg",n=>{const{children:o}=n;let u=0;const h={};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m);break;case I.RULE_singleExpression:h.defaultValue=this.visit(m)}}return h.type=h.type||W.UNDETERMINED,h});w(this,"visitArrowMethod",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ArrowMethod,returnedTypes:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_arrowMethodParameters:h.params=this.visit(_),this._setFuncParams(h);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,h.block=this.visit(_),h.hasMemberIndex=this._hasMemberIndex,h.returnedTypes=this._getBlockReturnTypes(h.block),this._isInFunc=!1;break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setFunc(h,m),this._setMethod(h,m),this._currentFuncParams.clear(),h});w(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let u=0;const h={};let m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_formalParameterList:m=this.visit(_);break}}return[h,...m]});w(this,"visitTypeStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.TypeStatement,fields:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_typeElement:h.fields.push(this.visit(_));break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setUserType(h,m),this._setNewFunc(h,m),this._setCopyFunc(h,m),this._setCopyMethod(h,m),h});w(this,"visitTypeElement",n=>{const{children:o}=n;let u=0;const h={};let m=null;for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);if(_.children[0].ruleIndex===I.RULE_typeSeries){const{column:x,line:P,text:A}=_.start,F=x+1;this._errors.push({startColumn:F,endColumn:parseInt(F+A.length),startLineNumber:P,endLineNumber:P,message:we(this._buildinTypes.has(A)?Pe.typeUseError:Pe.notTypeKeyword,{text:A})}),h.type=W.UNDETERMINED}else h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_singleExpression:m=_,h.value=this.visit(_);break;default:_.symbol&&_.symbol.type===I.Varip&&(h.isVarip=!0);break}}return this._typeElementVerify(h,m),h});w(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});w(this,"visitTypeMap",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_typeName){const _=this.visit(m);h.push(_),this._typeCheck(_,I.RULE_typeName,m)}}return`map<${h[0]},${h[1]}>`});w(this,"visitTypeSeries",n=>{const{children:o}=n,[u,h]=o,m=this.visit(u),_=this.visit(h);return this._typeCheck(m,I.RULE_typeSeries,u),this._typeCheck(_,I.RULE_typeName,h),`${m} ${_}`});w(this,"visitTypeArray",n=>{const{children:o}=n,u=o[0];let h=this.visit(u),m=h;if(o.length===3)h=W.ARRAY;else{this._typeCheck(h,I.RULE_typeArray,u);let _=1;for(;_<o.length;_++){const T=o[_];T.ruleIndex===I.RULE_typeName&&(m=this.visit(T),this._typeCheck(m,I.RULE_typeName,T))}}return this._arrayTypeConvert(`${h}<${m}>`)});w(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_typeName&&this._typeCheck(h,I.RULE_typeName,u),h}return null});w(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);w(this,"visitTypeName",n=>{const{children:o}=n;let u=0,h="";for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_identifier?h=`${h}${this.visit(m)}`:h=`${h}.`}return h});w(this,"visitName",n=>{var x,P;const{children:o}=n;let u=0,h=!1;const m=[];let _=null;for(;u<o.length;u++){const A=o[u];switch(A.ruleIndex){case I.RULE_identifier:m.push(this.visit(A));break;case I.RULE_singleExpression:_=this.visit(A);break;case I.RULE_methodElement:h=!0,m.push(this.visit(A));break}}const T={ruleType:Oe.Name,hasMethod:h,exprs:m,expr:_};if(h){let A="";const F=[];for(const V of m)typeof V=="string"?A=A?`${A}.${V}`:V:(A&&(V.name=`${A}.${V.name}`),F.push(V),A="");T.exprs=[...F,A];const $=this._getMethodTypes(F,Array.from(F,()=>n));if($&&$.length){const V=we(Pe.noFiledErr,{name:A});$.length>1&&this._errorHandle(V,n),T.type=((P=this._nameCheck(this._getOriginMethodName($[0],A),n,V))==null?void 0:P.type)||W.UNDETERMINED}}else{let A=m.join(".");if(_&&_.type&&_.type===W.UNDETERMINED)T.type=W.UNDETERMINED,A=`expr0.${A}`;else{_&&_.type&&(A=`${this._getMethodTypeName(_.type)}.${A}`);const F=this._nameCheck(A,n)||{};(x=F.title)!=null&&x.startsWith("built-in")&&(T.isBuiltIn=!0,T.isConst=F.isConst),T.varPos=F.pos,T.declare=F.declare,T.type=(F==null?void 0:F.type)||W.UNDETERMINED,F!=null&&F.isArg&&(T.arg=F),T.scope=this._blockCount}T.name=A}return T});this._loopCount=0,this._errors=[],this._variables=new Map,this._functions=new Map,this._methods=new Map,this._currentFuncParams=new Map,this._types=new Map,this._currentBlockVars=[new Map],this._blockCount=0,this._isInFunc=!1,this._isNeedCalc=!1,this._blockRanges=[],this._overloadsFuncs=[],this._hasMemberIndex=!1,this._isInLocalScop=!1,this._onlyStatementsCount=0}get overloadsFuncs(){return this._overloadsFuncs}get errors(){return this._errors}get userTypes(){return this._types}get userFunctions(){return this._functions}get userVariables(){return this._variables}get userMethods(){return this._methods}_verifyGloablVar(n,o){const{name:u,varPos:h,isBuiltIn:m}=n;if(m&&this._errorHandle(we(Pe.buidinAssignErr,{name:u}),o),!h)return;const _=this._currentBlockVars[0].get(u);if(!_)return;const{column:T,lineNumber:x}=_.pos||{};this._isInFunc&&T===h.column&&x===h.lineNumber&&this._errorHandle(we(Pe.modifyGlobalVarErr,{name:u}),o)}_typeElementVerify(n,o){var _,T;const{type:u,value:h}=n;if(!h)return;if(![Oe.Literal,Oe.UnaryExpression].includes(h.ruleType)&&!h.isBuiltIn){this._errorHandle(Pe.defaultValueErr,o);return}else if(h.ruleType===Oe.UnaryExpression){const{exprs:x}=h;if(![Oe.Literal,Oe.UnaryExpression].includes((_=x[0])==null?void 0:_.ruleType)&&!((T=x[0])!=null&&T.isBuiltIn)){this._errorHandle(Pe.defaultValueErr,o);return}}(!this._compareType(u,h.type)||u.endsWith(W.INT)&&h.type.endsWith(W.FLOAT))&&this._errorHandle(we(Pe.defaultValueTypeErr,{typeE:h.type,typeR:u}),o)}_memberIndexVerify(n,o){if(n.ruleType===Oe.Name&&!n.hasMethod&&this._blockCount){const h=this._currentBlockVars[this._blockCount],m=h&&h.get(n.name);m&&(m.isForVar?this._errorHandle(we(Pe.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(we(Ri.localScopeGetHistory,{name:n.name}),o,Lr.Warning))}const u=n&&n.type;if(u){const h=this._removePrefix(u);!this._types.has(h)&&!this._buildinTypes.has(h)&&!this._isArrayType(h)&&!this._isMatrixType(h)&&!this._isMapType(h)&&h!==W.UNDETERMINED&&this._errorHandle(we(Pe.invalidType,{index:0}),o)}}_setFuncParams(n){var o;for(const u of n.params){const h=(o=this._types.get(u.type))==null?void 0:o[0];if(h&&h.fields)for(const m of h.fields){const _=`${u.name}.${m.name}`;this._currentFuncParams.set(_,{...m,originName:_})}this._setVariablesMap(u),this._currentFuncParams.set(u.name,u)}}_pushBlockRanges(n){!n||!n.start||!n.stop||this._blockRanges.push({startColumn:n.start.column,endColumn:n.stop.column,startLineNumber:n.start.line,endLineNumber:n.stop.line})}_setUserType(n,o){const{fields:u,name:h}=n;this._types.set(h,[{fields:u.map(m=>({name:m.name,type:m.type})),name:h,pos:o}]),this._addVarToMap(h,h,o,!1,!1)}_againAssignHandle(n,o,u){const h=u!==":="?u.replace("=",""):u,m=u!==":="?[W.UNDETERMINED,W.INT,W.FLOAT]:[];h==="+"&&m.push(W.STRING);const[_,T]=n;_.arg&&!_.name.includes(".")&&this._errorHandle(we(Pe.funcArgAssignErr,{name:_.name}),o[0]);const x=this._sameTypeJudge(n,o,h,m),P=this._typeHandle(x);return this._updateUserVar(_.name,P,T.type),_.type=P,{ruleType:Oe.AgainAssign,name:_,operator:u,type:P,value:T}}_typeCheck(n,o,u){const h=[W.SERIES,W.SIMPLE,W.CONST];switch(o){case I.RULE_typeName:const m=this._buildinTypes.get(n);m&&![...h,W.ARRAY,W.MATRIX,W.MAP].includes(m[0].name)||this._types.get(n)||this._errorHandle(we(Pe.notTypeKeyword,{text:n}),u);break;case I.RULE_typeArray:[W.ARRAY,W.MATRIX].includes(n)||this._errorHandle(Pe.tempateTypeErr,u);break;case I.RULE_typeSeries:h.includes(n)||this._errorHandle(we(Pe.qualifierErr,{name:n}),u);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const u=this._buildinConstants.get(n);if(u&&u[0])return Object.assign(u[0],{isConst:!0})}_verifyName(n,o){var h,m;const u=this._getBuildVar(n);if(u)return u;if(n.includes(".")){const _=n.split("."),T=_.pop(),x=_.join(".");let P=this._blockCount;for(;P>=0;){if(!this._currentBlockVars[P]){P--;continue}const A=this._currentBlockVars[P].get(x);if(o&&this._judgeGatherValue(T||"",o,A==null?void 0:A.valueType,!0),(A==null?void 0:A.type)==="chart.point"){const $=(((m=(h=this._buildinTypes.get(A.type))==null?void 0:h[0])==null?void 0:m.fields)||[]).find(V=>V.name===T);if($)return Object.assign($,{pos:A.pos})}P--}}return this._getUserVar(n)}_judgeGatherValue(n,o,u,h){u===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(we(Pe.objectIsNaErr,{name:n,type:h?"field":"method"}),o)}_nameCheck(n,o,u=we(Pe.undeclared,{name:n})){const h=this._verifyName(n,o);return h||this._errorHandle(u,o),h}_inBlock(n){this._blockCount++,this._pushBlockRanges(n);const o=this.visit(n);return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),o}_errorHandle(n,o,u=Lr.Error){this._errors.push({message:n,startColumn:o.start.column+1,startLineNumber:o.start.line,endColumn:o.start.column+2+o.stop.stop-o.start.start,endLineNumber:o.stop.line,type:u})}_boolTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,W.BOOL,[W.UNDETERMINED,W.INT,W.FLOAT,W.BOOL],h)}_calcTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,"int/float",[W.UNDETERMINED,W.INT,W.FLOAT],h)}_typeJudge(n,o,u,h,m,_=0){const T=n&&n.type;if(T){const x=this._removePrefix(T);if(!m.includes(x)&&x!==W.NA)return this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,typeE:x,typeR:h}),o),W.UNDETERMINED;h===W.BOOL&&[W.INT,W.FLOAT].includes(x)&&this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,type:W.BOOL}),o,Lr.Warning)}return T||W.UNDETERMINED}_sameTypeJudge(n,o,u,h){let m="";const _=[],T=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(u)&&(h=h.concat(T));for(const[x,P]of n.entries()){let A=P&&P.type||W.UNDETERMINED;const F=this._removePrefix(A);if(m||(m=F),!h.includes(F)&&h.length&&F!==W.NA){this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:A,typeR:h.slice(1).join("/")}),o[x]),m=W.UNDETERMINED,_.push(m);continue}if(m===W.UNDETERMINED||F===W.UNDETERMINED)A=m=W.UNDETERMINED;else if(m!==F&&m!==W.NA&&F!==W.NA&&(![W.INT,W.FLOAT].includes(m)||![W.INT,W.FLOAT].includes(F)))if(u===":=")this._errorHandle(we(Pe.assignTypeMismatch,{typeE:F,name:n[0].name,typeR:m}),o[0]),A=m=W.UNDETERMINED;else if(["==","!=","?:"].includes(u)&&[W.INT,W.FLOAT,W.BOOL].includes(m)&&[W.INT,W.FLOAT,W.BOOL].includes(F))this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,type:m}),o[x],Lr.Warning),A=m=W.UNDETERMINED;else if(T.includes(m)&&T.includes(F)){if(m!==F){const $=this._getPrefix(A);_[x-1]=`${this._getPrefix(_[x-1])} ${T[0]}`,A=m=`${$} ${T[0]}`}}else this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:F,typeR:m}),o[x]),A=m=W.UNDETERMINED;_.push(A)}return _}_getUserVar(n,o=!1){for(let u=this._blockCount;u>=0;u--){const h=this._currentBlockVars[u];if(u<=0){const m=this._currentFuncParams.get(n);if(m)return m.isArg=!0,m}if(h){const m=h.get(n);if(m)return m}}if(n.includes(".")&&!o){let u=!1,h=null;if(n.split(".").reduce((m,_)=>{let T=m?`${m}.${_}`:_;const x=this._getUserVar(T,!0);return x!=null&&x.type?x.type===W.UNDETERMINED?u=!0:(T=x.type,h=x):h=null,T},""),u)return{name:n,type:W.UNDETERMINED};if(h)return h}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(we(Pe.buidinVarErr,{name:n}),o);for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m&&m.get(n)){if(this._blockCount===h)return this._errorHandle(we(Pe.repeatVar,{name:n}),o),!0;this._errorHandle(we(Ri.repeatVar,{name:n}),o,Lr.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const u=this._currentBlockVars[o];if(u&&u.get(n))return!0}return!1}_updateUserVar(n,o,u){for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m){const _=m.get(n);if(_){_.type=o,_.valueType=u;return}}}}_variablesHandle(n,o){var m,_,T,x;if(!(n&&n.nameList))return;const u=n.nameList;if(u.name==="_")return;const h=n.value;if(u.ruleType===Oe.VarMultiple){u.types=[],this._checkVarMultiple(u.names,h,o);for(const[P,A]of u.names.entries()){const F=this._varTypeJudge("",((m=h==null?void 0:h.types)==null?void 0:m[P])||W.UNDETERMINED,o);u.types.push(F),this._addVarToMap(A,F,u.posList[P],!0)}}else{const P=(h==null?void 0:h.type)||((_=h==null?void 0:h.returnedTypes)==null?void 0:_[0]);((T=h==null?void 0:h.types)!=null&&T.isBrackethesized||(x=h==null?void 0:h.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(we(Pe.tupleLeftVarErr,{name:u.name}),o),!u.type&&P===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(Pe.naVarErr,o),u.prefix&&wi.indexOf(u.prefix)>wi.indexOf(this._getPrefix(P))&&this._errorHandle(we(Pe.declaredErr,{prefix:u.prefix,type:P}),o);const A=this._varTypeJudge(u.type,P||W.UNDETERMINED,o);u.type=A,this._addVarToMap(u.name,A,u.pos,!0,u.isForVar,u.declare,h.type)}}_checkVarMultiple(n,o,u){var x,P,A,F;const h=n.length,m=(o.types||o.returnedTypes||[]).length,_=((x=o.types)==null?void 0:x.isBrackethesized)||((P=o.returnedTypes)==null?void 0:P.isBrackethesized);(A=o.types)!=null&&A.isUnknown||(F=o.returnedTypes)!=null&&F.isUnknown||(m===1&&!_||!m?this._errorHandle(Pe.tupleRightVarErr,u):h!==m&&this._errorHandle(we(Pe.tupleVarErr,{indexA:m,indexB:h}),u))}_addVarToMap(n,o,u,h=!0,m=!1,_,T){var F;const x=this._currentBlockVars[this._blockCount]||new Map,P=(F=this._types.get(o))==null?void 0:F[0];if(P&&P.fields)for(const $ of P.fields)x.set(`${n}.${$.name}`,$);const A={name:n,type:o,pos:u,valueType:T};h&&this._setVariablesMap(A),x.set(n,Object.assign(A,{isForVar:m,declare:_})),this._currentBlockVars[this._blockCount]=x}_setVariablesMap(n){const o=this._blockRanges[this._blockCount];n.range=o,n.scope=this._blockCount;const u=this._variables.get(n.name)||[];u.push(n),this._variables.set(n.name,u)}_varTypeJudge(n,o,u){if(o===W.VOID)return this._errorHandle(Pe.voidNotVar,u),W.UNDETERMINED;if(n&&o!==W.UNDETERMINED){const h=this._removePrefix(n),m=this._removePrefix(o);return m!==h&&m!==W.NA&&!(h===W.FLOAT&&m===W.INT)?(this._errorHandle(we(Pe.declareTypeErr,{type:n,valueType:o}),u),W.UNDETERMINED):this._typeHandle([n,o])}else if(o===W.UNDETERMINED)return W.UNDETERMINED;return n||o||W.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===W.UNDETERMINED)return o;const u=this._getPrefix(n);if(u){const h=this._removePrefix(n);let m=-1;for(const[_,T]of wi.entries())T===u&&(m=_),m>=0&&m<=_&&(h===W.FLOAT&&o.push(`${T} ${W.INT}`),o.push(`${T} ${h}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(W.FLOAT)&&o.push(n.replace(/float/,W.INT));return o}_setNewFunc(n,o){const u=`${n.name}.new`,h=[],m=[];for(const _ of n.fields)h.push({name:_.name,required:!1,allowedTypeIDs:this._getAllowTypes(_.type),displayType:_.type}),m.push(`${_.type} ${_.name}`);this._functions.set(u,[{name:u,args:h,returnedTypes:[n.name],isUser:!0,pos:o,syntax:[`${u}(${m.join(", ")}) → ${n.name}`]}])}_setCopyFunc(n,o){const u=n.name,h=`${u}.copy`;this._functions.set(h,[{name:h,args:[{name:"object",required:!0,allowedTypeIDs:[u],displayType:u}],returnedTypes:[u],isUser:!0,pos:o,info:"The identifier of the object to be copied.",syntax:[`${h}(${u} object) → ${u}`]}])}_setCopyMethod(n,o){const u=n.name,h=`${u}.copy`;this._methods.set(h,[{name:h,args:[],returnedTypes:[u],thisType:[u],isUser:!0,pos:o,syntax:[`${h}() → ${u}`]}])}_setFunc(n,o){const u=[],h=[];for(const x of n.params){const{type:P,name:A,defaultValue:F}=x;u.push({name:A,required:!F,allowedTypeIDs:this._getAllowTypes(P),displayType:P}),h.push(`${P===W.UNDETERMINED?"":`${P} `}${A}`)}const{returnedTypes:m=[]}=n,_=n.name,T=m.length>1?`[${m.join(", ")}]`:m.toString();this._functions.set(_,[{name:_,args:u,syntax:[`${_}(${h.join(", ")}) → ${T||"void"}`],isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,returnedTypes:m}])}_setMethod(n,o){const{name:u,returnedTypes:h,params:m}=n,_=m[0].type,T=[],x=[];for(const $ of m.slice(1)){const{type:V,name:b,defaultValue:y}=$;T.push({name:b,required:!y,allowedTypeIDs:this._getAllowTypes(V),displayType:V}),x.push(`${V} ${b}`)}const P=h.length>1?`[${h.join(", ")}]`:h.toString(),A=this._getMethodTypeName(_),F=`${A}.${u}`;n.typeName=A,this._methods.set(F,[{name:u,args:T,originalName:F,syntax:[`${u}(${x.join(", ")}) → ${P||"void"}`],returnedTypes:h,isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[_]}])}_getMethodTypes(n,o){let u;for(const[h,m]of n.entries()){const{type:_,expr:T,args:x}=m;let{name:P}=m;const A=o[h];if(T){if(T.type===W.UNDETERMINED)return[W.UNDETERMINED];P=`${this._getMethodTypeName(T.type)}${P}`,x.params.unshift(T)}if(u&&u.length>=1)if(u.length===1){const F=u[0];if(F===W.UNDETERMINED)return[W.UNDETERMINED];const $=this._getOriginMethodName(F,P);P.includes(".")?u=this._getOtherNamesMethodType($,u,A,x,m):u=this._expandMethodHandle($,A,x,{type:F},F,m)}else this._errorHandle(we(Pe.noFiledErr,{name:P}),A);else{const[F,$]=this._tempFuncNameHandle(P,A,_);P=$;const V=this._buildinFunctions.get(F);if(V)this._globalFuncVerify(V[0],A),this._hasMemberIndexVerify(V[0],A,m),m.isBuiltIn=!0,u=this._getBuildInReturnTypes(V,x,P,A,void 0,_);else{const b=this._functions.get(P);if(b){this._hasMemberIndexVerify(b[0],A,m),u=b[0].returnedTypes;const{hasErr:y}=this._checkArgs(x,b[0].args||[],P,A,u[0]);if(y)return[W.UNDETERMINED]}else u=this._getOtherNamesMethodType(P,u,A,x,m)}}m.returnTypes=u}return u===void 0&&this._errorHandle(we(Pe.notFindFuncErr,{name:n[0].name}),o[0]),u}_globalFuncVerify(n,o){this._blockCount!==0&&Tm.includes(n.name)&&this._errorHandle(we(Pe.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,u){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,u.hasMemberIndex=!0,u.position=o.start.tokenIndex,this._isInLocalScop&&this._errorHandle(we(Ri.localScopeWarning,{name:u.name}),o,Lr.Warning))}_tempFuncNameHandle(n,o,u){let h=n;if(u&&u.length>=1){const m=["array.new","matrix.new"].includes(n),_=n==="map.new";if(u.length===1)if(m)h=`${n}<type>`,n=`${n}<${u[0]}>`;else return _?this._errorHandle(we(Pe.templateErr,{countA:2,countB:1}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];else{if(!_)return m?this._errorHandle(we(Pe.templateErr,{countA:1,countB:2}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];if(!Sm.includes(u[0]))return this._errorHandle(we(Pe.mapKeyErr,{type:this._typeAddSeries(u[0])}),o),[W.UNDETERMINED];h=`${n}<type,type>`,n=`${n}<${u[0]},${u[1]}>`}}return[h,n]}_getOtherNamesMethodType(n,o,u,h,m){const _=n.split("."),T=_.length-1,x=_.slice(0,T).join("."),P=this._getUserVar(x);this._judgeGatherValue(_[T],u,P==null?void 0:P.valueType);const A=P==null?void 0:P.type;if(A){if(A===W.UNDETERMINED)return o=[W.UNDETERMINED],o.isUnknown=!0,o;const F=this._getOriginMethodName(A,_[T]);o=this._expandMethodHandle(F,u,h,P,x,m)}else{let F="",$="",V="";for(const b of _.slice(0,T)){F?$=this._getOriginMethodName(F,b):$=$?`${$}.${b}`:b;const y=this._verifyName($);y!=null&&y.type?(F=y.type,V=""):this._buildinTypes.get($)?V=we(Pe.methodNotExistErr,{name:$,methodName:_[T]}):V=we(Pe.noFiledErr,{name:b})}V&&this._errorHandle(V,u)}return o}_expandMethodHandle(n,o,u,h,m,_){var P,A;let T;const x=this._buildinMethods.get(n);if(x)T=this._getBuildInReturnTypes(x,u,n,o,h);else{const F=this._methods.get(n);if(F&&F.length){const $=F[0],V=this._getMethodTypeName(((P=$.thisType)==null?void 0:P[0])||"");if(!this._types.get(V)){const g=this._functions.get($.name);g&&(_.selfArg=(A=g[0].args)==null?void 0:A[0])}this._hasMemberIndexVerify($,o,_),T=$.returnedTypes;const{hasErr:y}=this._checkArgs(u,$.args||[],n,o,(T==null?void 0:T[0])||"");if(y)return[W.UNDETERMINED]}else this._errorHandle(we(Pe.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:m}),o)}return T}_getBuildInReturnTypes(n,o,u,h,m,_){var x;let T;if(n.length===1){const{returnedTypes:P,syntax:A,args:F=[],thisType:$}=n[0],V=A[0].split("→")[1].trim(),b=m||o.params[0]||((x=F[0])==null?void 0:x.name)&&o[F[0].name];b&&!this._checkMethodThisType($,b.type)&&this._errorHandle(we(Pe.typeMismatch,{operator:u,index:b.name||"id",typeE:b.type,typeR:$[0]}),h);const{hasErr:y,types:g}=this._checkArgs(o,F,u,h,V,b);if(y)return[W.UNDETERMINED];if(T=g.length&&g||this._returnedTypesParse(P),T.length>1)return T;(_==null?void 0:_.length)===1?T=[this._typeReplace(V,_[0])]:(_==null?void 0:_.length)===2&&(T=[`${W.MAP}<${_[0]},${_[1]}>`]),T=this._returnTypesOtherHandle(b,V,T,u)}else{const P=this._overloadsFuncGetTypes(n,o,h,m);T=this._returnedTypesParse([P])}return T}_overloadsFuncGetTypes(n,o,u,h){var F,$;let m="",_=[],T=[],x=0;for(const[V,b]of n.entries()){const{args:y,returnedTypes:g,name:D,thisType:R}=b,O=h||o.params[0]||o[y[0].name],{errMsg:U,warnMsg:X}=this._overloadsCheckArgs(o,y,D,u,O);O&&!this._checkMethodThisType(R,O.type)&&U.unshift({msg:we(Pe.typeMismatch,{operator:D,index:O.name||"id",typeE:O.type,typeR:R[0]}),ctx:u}),V===0?(_=U,T=X,!U.length&&(m=g[0])):U.length?((F=_[0])!=null&&F.isLenErr&&!(($=U[0])!=null&&$.isLenErr)||_.length>U.length)&&(_=U,T=X,x=V):this._priorityComparison(m,g[0])||(g[0]===`${W.ARRAY}<>`?m=`${O.type}[]`:m=g[0],_=U,T=X,x=V)}for(const V of _)this._errorHandle(V.msg,V.ctx);for(const V of T)this._errorHandle(V.msg,V.ctx,Lr.Warning);const P=u.children[0],A=n[0].name;return P&&this._overloadsFuncs.push({name:A,index:x,line:P.start.line,startColumn:P.start.column+1,endColumn:P.start.column+A.length}),this._funcArgsAddOriginName(o,n[x].args,A),m||W.UNDETERMINED}_funcArgsAddOriginName(n,o,u){const h=n.params||[];for(const[m,_]of o.entries())m<h.length&&(h[m].originName=_.name);if(u==="input"){const m=h[0]||n.defval;Object.assign(n,{inputType:{name:`'${m!=null&&m.isSourceType?"source":this._removePrefix(m==null?void 0:m.type)}'`}})}}_overloadsCheckArgs(n,o,u,h,m){const _={...n},T=_.params;delete _.params;const x=Object.keys(_).length+T.length,P=o.length,A=[],F=[];if(x>P&&!o.some(V=>["arg0, arg1, ...","number0, number1, ..."].includes(V.name)))return A.push({msg:we(Pe.argsLenErr,{name:u,lenA:x,lenB:P}),isLenErr:!0,ctx:h}),{errMsg:A,warnMsg:F};for(const[$,V]of o.entries()){let b=_[V.name];if($<T.length&&(b&&F.push({msg:we(Ri.moreSameArg,{arg:V.name}),ctx:h}),b=T[$]),!b)V.required&&A.push({msg:we(Pe.requiredParamErr,{name:u,argName:V.name}),ctx:h});else{const y=b.type!==`${W.SIMPLE} na`?this._checkArg(b,V,u,m,b.ctx,!0):"";y&&A.push({msg:y,ctx:b.ctx}),delete _[V.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(V.name)&&T.length>$+1){const y=T.slice($+1);let g=T[$];for(const D of y){g.type===`${W.SIMPLE} ${W.NA}`&&(g=D);const R=D.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(D,V,u,g,D.ctx,!0):"";R&&A.push({msg:R,ctx:D.ctx})}}}if(Object.keys(_).length)for(const $ of Object.keys(_))A.push({msg:we(Pe.argsNameErr,{name:u,argName:$}),ctx:_[$].ctx});return{errMsg:A,warnMsg:F}}_checkArgs(n,o,u,h,m,_){var V;const T={...n},x=T.params;delete T.params;const P=Object.keys(T).length+x.length,A=o.length;let F=!1,$=[];if(P>A&&!o.some(y=>["arg0, arg1, ...","number0, number1, ..."].includes(y.name)))return this._errorHandle(we(Pe.argsLenErr,{name:u,lenA:P,lenB:A}),h),F=!0,{hasErr:F,types:$};for(const[b,y]of o.entries()){let g=T[y.name];if(b<x.length&&(g&&this._errorHandle(we(Ri.moreSameArg,{arg:y.name}),h,Lr.Warning),g=x[b],g.originName=y.name),!g)y.required&&(this._errorHandle(we(Pe.requiredParamErr,{name:u,argName:y.name}),h),F=!0);else{const D=g.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(g,y,u,_,g.ctx):"";if(D)this._errorHandle(D,g.ctx),F=!0;else if(D===!1)F=!0;else if(u.startsWith("request.")&&y.name==="expression")if(g.ruleType===Oe.Brackethesized)$=g.exprs.map(R=>this._typeReplace(m,R.type));else if((V=g.types||g.returnedTypes)!=null&&V.isBrackethesized)$=(g.types||g.returnedTypes).map(R=>this._typeReplace(m,R));else{const R=this._typeReplace(m,g.type);$.push(R)}delete T[y.name]}}if(Object.keys(T).length)for(const b of Object.keys(T))this._errorHandle(we(Pe.argsNameErr,{name:u,argName:b}),T[b].ctx),F=!0;return{hasErr:F,types:$}}_checkArg(n,o,u,h,m,_){const{ruleType:T,exprs:x,name:P}=n;let A=n.type;T===Oe.Brackethesized&&(A=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:F=[],displayType:$,name:V}=o;if(!(!A||A===W.UNDETERMINED||$===W.UNDETERMINED)&&!(this._checkMethodThisType(F,this._arrayTypeConvert(A))&&!(u==="input.source"&&V==="defval"))){if(V==="condition"&&($!=null&&$.endsWith(W.BOOL))&&(A.endsWith(W.INT)||A.endsWith(W.FLOAT))){m&&this._errorHandle(we(Ri.typeMismatch,{index:V,operator:u,type:W.BOOL}),m,Lr.Warning);return}switch($){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.STRING}`],u,A);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.FLOAT}`,`${W.CONST} ${W.INT}`],u,A);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.INT}`],u,A);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!P||!xp.includes(P))return we(Pe.inputSourceErr,{name:V,funcName:u});if(this._judgeVarBuildIn(P))return we(Pe.buildInUseErr,{name:P});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(u)||"";if(!A.endsWith(b)&&!(A.endsWith(W.INT)&&b===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const y=this._getArrayType(h==null?void 0:h.type)||"";if(!A.endsWith(y)&&!(A.endsWith(W.INT)&&y===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(y)});break;case"any map type":if(this._isMapType(A)){if(V==="id2"){const O=this._getMapType(h==null?void 0:h.type);if(!O)return;const U=this._getMapType(A)||[];if(O[0]!==U[0]||O[1]!==U[1])return we(Pe.mapKeyValErr,{typeA:this._typeAddSeries(U[0]),typeB:this._typeAddSeries(U[1]),typeC:this._typeAddSeries(O[0]),typeD:this._typeAddSeries(O[1]),name:u})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(h==null?void 0:h.type);if(!g)return;const D=V==="key"?0:1;if(!A.endsWith(g[D])&&!(A.endsWith(W.INT)&&g[D]===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(g[D])});break;case"<arg_expr_type>":if(T===Oe.Brackethesized)return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""});break;case"<arg_type>":case"variable, function, object, array or matrix of series int/float/bool/string/color, or a tuple of these":break;case"variable, object or function of series int/float/bool/string/color, or a tuple of these":if(T===Oe.Brackethesized){for(const O of x)if(!F.includes(O.type))return this._errorHandle(we(Pe.requestArgsErr,{name:u,argName:V,type:O.type}),O.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(xp.includes(n.name)&&F[0].endsWith(this._removePrefix(A)))n.isSourceType=!0;else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(T===Oe.Brackethesized||this._isArrayType(A)||this._isMapType(A)||this._isMatrixType(A))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:`${W.SERIES} ${W.INT}`});if(A!==(h==null?void 0:h.type))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:h==null?void 0:h.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!_){const O=F.find(U=>U.endsWith(R));if(O){n.type=O,n.arg.type=O;return}}if(F.length===1&&F[0].endsWith(R)){const O=this._getPrefix(n.type),U=this._getPrefix(F[0]);if(wi.indexOf(O)>=wi.indexOf(U))return}return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""})}}}_tupleToCheck(n,o,u,h,m){var _,T;if(u.push(`${W.SIMPLE} ${W.NA}`),n.ruleType===Oe.Brackethesized){const x=[];let P=!1;for(const A of n.exprs)x.push(A.type),u.includes(A.type)||(P=!0);if(P)return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((_=o.allowedTypeIDs)==null?void 0:_[0])||""})}else return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:m,typeR:((T=o.allowedTypeIDs)==null?void 0:T[0])||""})}_getBlockReturnTypes(n){var F,$;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[W.UNDETERMINED];const{ruleType:u,type:h,types:m,returnedTypes:_,exprs:T,nameList:x,typeList:P,block:A}=o;if(m&&m.length)return m;if(_&&_.length)return _;if(h)return[h];switch(u){case Oe.Brackethesized:const V=T.map(ue=>ue.type);return V.isBrackethesized=!0,V;case Oe.VarBlockStmt:case Oe.DeclareAssign:return x?x.ruleType===Oe.VarMultiple?x.types:[x.type]:[((F=o.name)==null?void 0:F.type)||W.UNDETERMINED];case Oe.SwitchStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let y=(($=b[0])==null?void 0:$.returnedTypes)||[],g=y.length<=1?y[0]:`[${y.join(", ")}]`,D=null;for(const ue of b.slice(1)){const K=ue.returnedTypes||[W.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(ue.block)?ue.block.slice(-1)[0]:ue.block;if(K.length!==y.length)D=Y.ctx;else for(const[G,ce]of y.entries())if(this._compareType(K[G],ce))(K[G].includes(W.FLOAT)&&!ce.includes(W.FLOAT)||y[G]===`${W.SIMPLE} ${W.NA}`||y[G]===W.UNDETERMINED)&&(y[G]=K[G]);else{D=Y.ctx;break}}return D&&(this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"switch",types:g}),D),y=y.map(()=>W.UNDETERMINED)),o.returnedTypes=y,y;case Oe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];if(!P.filter(ue=>ue&&ue.length).length)return[W.UNDETERMINED];let R=P[0]||[],O=R.length<=1?R[0]:`[${R.join(", ")}]`,U=0,X=0;for(const ue of P.slice(1))if(ue)if(U++,O+=ue.length<=1?`; ${ue[0]}`:`; [${ue.join(", ")}]`,ue.length!==R.length)X=U;else for(const[K,Y]of R.entries())if(this._compareType(ue[K],Y))(ue[K].includes(W.FLOAT)&&!Y.includes(W.FLOAT)||R[K]===`${W.SIMPLE} ${W.NA}`)&&(R[K]=ue[K]);else{X=U;break}if(X){const ue=A[X].slice(-1)[0],K=Array.isArray(ue)?ue.slice(-1)[0]:ue;this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"if",types:O}),K.ctx),R=R.map(()=>W.UNDETERMINED)}return o.returnedTypes=R,R}return[W.UNDETERMINED]}}class km{constructor(e){w(this,"_nameMap");w(this,"_prefixNameVar");w(this,"_prefixNameFunc");w(this,"_prefixNameConst");w(this,"_userTypes");w(this,"_isInFunc");w(this,"_varlist");w(this,"_memberIndexList");w(this,"_blockCount");this._nameMap=new Map,this._prefixNameVar=`${e}_var`,this._prefixNameFunc=`${e}_func`,this._prefixNameConst=`${e}_const`,this._userTypes=[],this._isInFunc=!1,this._varlist=[{}],this._memberIndexList=[{}],this._blockCount=0}preParser(e){var o,u;const n=[];for(const h of e){if(!h)return;if(Array.isArray(h)){for(const m of h)if(n.push(this._parserStmt(m)),_l.includes((u=(o=m.exprs)==null?void 0:o[0])==null?void 0:u.name))return n.join(`;
10
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,d=!0,i=!1;return{s:function(){p=p.call(l)},n:function(){var s=p.next();return d=s.done,s},e:function(s){i=!0,c=s},f:function(){try{d||p.return==null||p.return()}finally{if(i)throw c}}}}function Ly(l,r){(r==null||r>l.length)&&(r=l.length);for(var p=0,a=new Array(r);p<r;p++)a[p]=l[p];return a}function eu(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function By(l,r){for(var p=0;p<r.length;p++){var a=r[p];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,Uy(a.key),a)}}function tu(l,r,p){return r&&By(l.prototype,r),p&&By(l,p),Object.defineProperty(l,"prototype",{writable:!1}),l}function Uy(l){var r=function(p,a){if(Za(p)!=="object"||p===null)return p;var f=p[Symbol.toPrimitive];if(f!==void 0){var c=f.call(p,"string");if(Za(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(p)}(l);return Za(r)==="symbol"?r:String(r)}Wi.EMPTY=new Zh;var Jc,Zc,np,Vy=function(){function l(r){eu(this,l),this.tokens=r,this.programs=new Map}return tu(l,[{key:"getTokenStream",value:function(){return this.tokens}},{key:"insertAfter",value:function(r,p){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(f),d=new Hy(this.tokens,a,c.length,p);c.push(d)}},{key:"insertBefore",value:function(r,p){var a,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(f),d=new es(this.tokens,a,c.length,p);c.push(d)}},{key:"replaceSingle",value:function(r,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;this.replace(r,r,p,a)}},{key:"replace",value:function(r,p,a){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l.DEFAULT_PROGRAM_NAME;if(typeof r!="number"&&(r=r.tokenIndex),typeof p!="number"&&(p=p.tokenIndex),r>p||r<0||p<0||p>=this.tokens.size)throw new RangeError("replace: range invalid: ".concat(r,"..").concat(p,"(size=").concat(this.tokens.size,")"));var c=this.getProgram(f),d=new Qc(this.tokens,r,p,c.length,a);c.push(d)}},{key:"delete",value:function(r,p){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;p===void 0&&(p=r),this.replace(r,p,null,a)}},{key:"getProgram",value:function(r){var p=this.programs.get(r);return p==null&&(p=this.initializeProgram(r)),p}},{key:"initializeProgram",value:function(r){var p=[];return this.programs.set(r,p),p}},{key:"getText",value:function(r){var p,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l.DEFAULT_PROGRAM_NAME;p=r instanceof _e?r:new _e(0,this.tokens.size-1),typeof r=="string"&&(a=r);var f=this.programs.get(a),c=p.start,d=p.stop;if(d>this.tokens.size-1&&(d=this.tokens.size-1),c<0&&(c=0),f==null||f.length===0)return this.tokens.getText(new _e(c,d));for(var i=[],s=this.reduceToSingleOperationPerIndex(f),v=c;v<=d&&v<this.tokens.size;){var S=s.get(v);s.delete(v);var E=this.tokens.get(v);S==null?(E.type!==n.EOF&&i.push(String(E.text)),v++):v=S.execute(i)}if(d===this.tokens.size-1){var k,ee=Qa(s.values());try{for(ee.s();!(k=ee.n()).done;){var Ce=k.value;Ce.index>=this.tokens.size-1&&i.push(Ce.text.toString())}}catch(xe){ee.e(xe)}finally{ee.f()}}return i.join("")}},{key:"reduceToSingleOperationPerIndex",value:function(r){for(var p=0;p<r.length;p++){var a=r[p];if(a!=null&&a instanceof Qc){var f,c=a,d=Qa(this.getKindOfOps(r,es,p));try{for(d.s();!(f=d.n()).done;){var i=f.value;i.index===c.index?(r[i.instructionIndex]=void 0,c.text=i.text.toString()+(c.text!=null?c.text.toString():"")):i.index>c.index&&i.index<=c.lastIndex&&(r[i.instructionIndex]=void 0)}}catch(Sr){d.e(Sr)}finally{d.f()}var s,v=Qa(this.getKindOfOps(r,Qc,p));try{for(v.s();!(s=v.n()).done;){var S=s.value;if(S.index>=c.index&&S.lastIndex<=c.lastIndex)r[S.instructionIndex]=void 0;else{var E=S.lastIndex<c.index||S.index>c.lastIndex;if(S.text!=null||c.text!=null||E){if(!E)throw new Error("replace op boundaries of ".concat(c," overlap with previous ").concat(S))}else r[S.instructionIndex]=void 0,c.index=Math.min(S.index,c.index),c.lastIndex=Math.max(S.lastIndex,c.lastIndex)}}}catch(Sr){v.e(Sr)}finally{v.f()}}}for(var k=0;k<r.length;k++){var ee=r[k];if(ee!=null&&ee instanceof es){var Ce,xe=ee,Ge=Qa(this.getKindOfOps(r,es,k));try{for(Ge.s();!(Ce=Ge.n()).done;){var at=Ce.value;at.index===xe.index&&(at instanceof Hy?(xe.text=this.catOpText(at.text,xe.text),r[at.instructionIndex]=void 0):at instanceof es&&(xe.text=this.catOpText(xe.text,at.text),r[at.instructionIndex]=void 0))}}catch(Sr){Ge.e(Sr)}finally{Ge.f()}var $e,yn=Qa(this.getKindOfOps(r,Qc,k));try{for(yn.s();!($e=yn.n()).done;){var hn=$e.value;if(xe.index!==hn.index){if(xe.index>=hn.index&&xe.index<=hn.lastIndex)throw new Error("insert op ".concat(xe," within boundaries of previous ").concat(hn))}else hn.text=this.catOpText(xe.text,hn.text),r[k]=void 0}}catch(Sr){yn.e(Sr)}finally{yn.f()}}}var Gn,Fr=new Map,Di=Qa(r);try{for(Di.s();!(Gn=Di.n()).done;){var Ci=Gn.value;if(Ci!=null){if(Fr.get(Ci.index)!=null)throw new Error("should only be one op per index");Fr.set(Ci.index,Ci)}}}catch(Sr){Di.e(Sr)}finally{Di.f()}return Fr}},{key:"catOpText",value:function(r,p){var a="",f="";return r!=null&&(a=r.toString()),p!=null&&(f=p.toString()),a+f}},{key:"getKindOfOps",value:function(r,p,a){return r.slice(0,a).filter(function(f){return f&&f instanceof p})}}]),l}();Jc=Vy,np="default",(Zc=Uy(Zc="DEFAULT_PROGRAM_NAME"))in Jc?Object.defineProperty(Jc,Zc,{value:np,enumerable:!0,configurable:!0,writable:!0}):Jc[Zc]=np;var jy=function(){function l(r,p,a,f){eu(this,l),this.tokens=r,this.instructionIndex=a,this.index=p,this.text=f===void 0?"":f}return tu(l,[{key:"toString",value:function(){var r=this.constructor.name,p=r.indexOf("$");return"<"+(r=r.substring(p+1,r.length))+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}]),l}(),es=function(l){Qh(p,l);var r=tp(p);function p(a,f,c,d){return eu(this,p),r.call(this,a,f,c,d)}return tu(p,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.tokens.get(this.index).type!==n.EOF&&a.push(String(this.tokens.get(this.index).text)),this.index+1}}]),p}(jy),Hy=function(l){Qh(p,l);var r=tp(p);function p(a,f,c,d){return eu(this,p),r.call(this,a,f+1,c,d)}return tu(p)}(es),Qc=function(l){Qh(p,l);var r=tp(p);function p(a,f,c,d,i){var s;return eu(this,p),(s=r.call(this,a,f,d,i)).lastIndex=c,s}return tu(p,[{key:"execute",value:function(a){return this.text&&a.push(this.text.toString()),this.lastIndex+1}},{key:"toString",value:function(){return this.text==null?"<DeleteOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+">":"<ReplaceOp@"+this.tokens.get(this.index)+".."+this.tokens.get(this.lastIndex)+':"'+this.text+'">'}}]),p}(jy);const Bg={atn:ug,dfa:hg,context:pg,misc:dg,tree:gg,error:xg,Token:n,CommonToken:Rs,CharStreams:wy,CharStream:Zs,InputStream:Zs,CommonTokenStream:Iy,Lexer:rr,Parser:Xh,ParserRuleContext:Zh,Interval:_e,IntervalSet:ne,LL1Analyzer:Fo,Utils:Cg,TokenStreamRewriter:Vy}})();var Mr=kt.dx,rp=kt.q2;kt.FO,kt.xf,kt.Gy;var Gy=kt.s4,Ky=kt.c7,ip=kt._7;kt.gp;var zy=kt.cK,$y=kt.zs,Wy=kt.AV;kt.Xp,kt.VS,kt.ul;var Xy=kt.hW,qy=kt.x1,fi=kt.z5;kt.oN;var Yy=kt.TB;kt.u1;var Jy=kt._b,Zy=kt.$F,Qe=kt._T,op=kt.db,Qy=kt.Zx,et=kt._x;kt.r8,kt.JI,kt.TP;var ap=kt.WU;kt.Nj,kt.ZP;const M=class M extends Jy{get grammarFileName(){return"tccScriptParser.g4"}get literalNames(){return M.literalNames}get symbolicNames(){return M.symbolicNames}get ruleNames(){return M.ruleNames}get serializedATN(){return M._serializedATN}createFailedPredicateException(e,n){return new $y(this,e,n)}constructor(e){super(e),this._interp=new Zy(this,M._ATN,M.DecisionsToDFA,new op)}program(){let e=new em(this,this._ctx,this.state);this.enterRule(e,0,M.RULE_program);let n;try{this.enterOuterAlt(e,1);{for(this.state=102,this._errHandler.sync(this),n=this._input.LA(1);n===4||n===6||!(n-36&-32)&&1<<n-36&19237111;){switch(this.state=100,this._errHandler.sync(this),this._input.LA(1)){case 60:this.state=98,this.match(M.NEWLINE);break;case 4:case 6:case 36:case 37:case 38:case 40:case 41:case 42:case 43:case 47:case 51:case 52:case 54:case 57:this.state=99,this.globalStmt();break;default:throw new fi(this)}this.state=104,this._errHandler.sync(this),n=this._input.LA(1)}this.state=105,this.match(M.EOF)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}globalStmt(){let e=new el(this,this._ctx,this.state);this.enterRule(e,2,M.RULE_globalStmt);let n;try{switch(this.state=118,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,3,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=107,this.variableDeclarationStmt(),this.state=109,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=108,this.match(M.Comma)),this.state=111,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=113,this.blockStmt();break;case 3:this.enterOuterAlt(e,3),this.state=114,this.importStmt();break;case 4:this.enterOuterAlt(e,4),this.state=115,this.arrowFunction();break;case 5:this.enterOuterAlt(e,5),this.state=116,this.arrowMethod();break;case 6:this.enterOuterAlt(e,6),this.state=117,this.typeStatement();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockStmt(){let e=new sp(this,this._ctx,this.state);this.enterRule(e,4,M.RULE_blockStmt);try{let n;this.enterOuterAlt(e,1);{for(this.state=125,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=120,this.variableDeclarationStmt(),this.state=121,this.match(M.Comma)),this.state=127,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,4,this._ctx);switch(this.state=130,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=128,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=129,this.blockExpression();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}stmt(){let e=new tl(this,this._ctx,this.state);this.enterRule(e,6,M.RULE_stmt);let n;try{switch(this.state=139,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,7,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=132,this.simpleStmt(),this.state=134,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=133,this.match(M.Comma)),this.state=136,this.match(M.NEWLINE);break;case 2:this.enterOuterAlt(e,2),this.state=138,this.expressionBlockSequence();break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}simpleStmt(){let e=new nl(this,this._ctx,this.state);this.enterRule(e,8,M.RULE_simpleStmt);try{switch(this.state=145,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,8,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=141,this.expressionSequence();break;case 2:this.enterOuterAlt(e,2),this.state=142,this.blockSequence();break;case 3:this.enterOuterAlt(e,3),this.state=143,this.brackethesized();break;case 4:this.enterOuterAlt(e,4),this.state=144,this.flowStmt();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}flowStmt(){let e=new up(this,this._ctx,this.state);this.enterRule(e,10,M.RULE_flowStmt);let n;try{this.enterOuterAlt(e,1),this.state=147,n=this._input.LA(1),n===34||n===39?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}block(){let e=new ts(this,this._ctx,this.state);this.enterRule(e,12,M.RULE_block);let n;try{switch(this.state=156,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 12:case 13:case 31:case 32:case 33:case 34:case 38:case 39:case 40:case 46:case 51:case 54:case 55:case 56:case 57:this.enterOuterAlt(e,1),this.state=149,this.simpleStmt(),this.state=151,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=150,this.match(M.Comma)),this.state=153,this.match(M.NEWLINE);break;case 60:this.enterOuterAlt(e,2),this.state=155,this.blockLine();break;default:throw new fi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockLine(){let e=new fo(this,this._ctx,this.state);this.enterRule(e,14,M.RULE_blockLine);let n;try{this.enterOuterAlt(e,1);{this.state=158,this.match(M.NEWLINE),this.state=159,this.match(M.INDENT),this.state=161,this._errHandler.sync(this),n=this._input.LA(1);do this.state=160,this.stmt(),this.state=163,this._errHandler.sync(this),n=this._input.LA(1);while(!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63459303);this.state=165,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}variableDeclarationStmt(){let e=new nu(this,this._ctx,this.state);this.enterRule(e,16,M.RULE_variableDeclarationStmt);try{let n;this.enterOuterAlt(e,1);{switch(this.state=169,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,12,this._ctx)){case 1:this.state=167,this.methodStmt();break;case 2:this.state=168,this.variableDeclarationList();break}for(this.state=178,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=171,this.match(M.Comma),this.state=174,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,13,this._ctx)){case 1:this.state=172,this.methodStmt();break;case 2:this.state=173,this.variableDeclarationList();break}this.state=180,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,14,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}variableDeclarationList(){let e=new ki(this,this._ctx,this.state);this.enterRule(e,18,M.RULE_variableDeclarationList);try{switch(this.state=189,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,15,this._ctx)){case 1:e=new nm(this,e),this.enterOuterAlt(e,1),this.state=181,this.varArrayDeclaration(),this.state=182,this.match(M.Assign),this.state=183,this.singleExpression(0);break;case 2:e=new tm(this,e),this.enterOuterAlt(e,2),this.state=185,this.name(),this.state=186,this.assignmentOperator(),this.state=187,this.singleExpression(0);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varModifier(){let e=new rl(this,this._ctx,this.state);this.enterRule(e,20,M.RULE_varModifier);let n;try{this.enterOuterAlt(e,1),this.state=191,n=this._input.LA(1),n===38||n===40?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockSequence(){let e=new cp(this,this._ctx,this.state);this.enterRule(e,22,M.RULE_blockSequence);try{let n;this.enterOuterAlt(e,1);{switch(this.state=195,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,16,this._ctx)){case 1:this.state=193,this.singleExpression(0);break;case 2:this.state=194,this.variableDeclarationList();break}for(this.state=204,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1)switch(this.state=197,this.match(M.Comma),this.state=200,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,17,this._ctx)){case 1:this.state=198,this.singleExpression(0);break;case 2:this.state=199,this.variableDeclarationList();break}this.state=206,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,18,this._ctx)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionSequence(){let e=new il(this,this._ctx,this.state);this.enterRule(e,24,M.RULE_expressionSequence);try{let n;for(this.enterOuterAlt(e,1),this.state=207,this.singleExpression(0),this.state=212,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=208,this.match(M.Comma),this.state=209,this.singleExpression(0)),this.state=214,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,19,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}expressionBlockSequence(){let e=new lp(this,this._ctx,this.state);this.enterRule(e,26,M.RULE_expressionBlockSequence);try{let n;this.enterOuterAlt(e,1);{for(this.state=223,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=217,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,20,this._ctx)){case 1:this.state=215,this.singleExpression(0);break;case 2:this.state=216,this.variableDeclarationList();break}this.state=219,this.match(M.Comma)}this.state=225,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx)}switch(this.state=228,this._errHandler.sync(this),this._input.LA(1)){case 4:case 6:case 38:case 40:case 51:case 54:case 57:this.state=226,this.varBlockStmt();break;case 37:case 41:case 42:case 43:this.state=227,this.blockExpression();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varBlockStmt(){let e=new ol(this,this._ctx,this.state);this.enterRule(e,28,M.RULE_varBlockStmt);try{this.enterOuterAlt(e,1);{switch(this.state=236,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,23,this._ctx)){case 1:this.state=230,this.varArrayDeclaration(),this.state=231,this.match(M.Assign);break;case 2:this.state=233,this.name(),this.state=234,this.assignmentOperator();break}this.state=238,this.blockExpression()}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}varArrayDeclaration(){let e=new ns(this,this._ctx,this.state);this.enterRule(e,30,M.RULE_varArrayDeclaration);let n;try{switch(this.state=258,this._errHandler.sync(this),this._input.LA(1)){case 38:case 40:case 51:case 54:case 57:e=new im(this,e),this.enterOuterAlt(e,1);{switch(this.state=241,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=240,this.varModifier()),this.state=244,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,25,this._ctx)){case 1:this.state=243,this.typeGather();break}this.state=246,this.identifier()}break;case 4:e=new rm(this,e),this.enterOuterAlt(e,2);{for(this.state=247,this.match(M.OpenBracket),this.state=248,this.identifier(),this.state=253,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=249,this.match(M.Comma),this.state=250,this.identifier(),this.state=255,this._errHandler.sync(this),n=this._input.LA(1);this.state=256,this.match(M.CloseBracket)}break;default:throw new fi(this)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}blockExpression(){let e=new ru(this,this._ctx,this.state);this.enterRule(e,32,M.RULE_blockExpression);try{switch(this.state=264,this._errHandler.sync(this),this._input.LA(1)){case 43:this.enterOuterAlt(e,1),this.state=260,this.ifStatement();break;case 37:this.enterOuterAlt(e,2),this.state=261,this.forStatement();break;case 42:this.enterOuterAlt(e,3),this.state=262,this.whileStatement();break;case 41:this.enterOuterAlt(e,4),this.state=263,this.switchStatement();break;default:throw new fi(this)}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}singleExpression(e){e===void 0&&(e=0);let n=this._ctx,o=this.state,u=new Ve(this,this._ctx,o),h=u,m=34;this.enterRecursionRule(u,34,M.RULE_singleExpression,e);let _;try{let T;this.enterOuterAlt(u,1);{switch(this.state=278,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:u=new mm(this,u),this._ctx=u,h=u,this.state=267,this.methodStmt();break;case 2:u=new pm(this,u),this._ctx=u,h=u,this.state=268,_=this._input.LA(1),_===12||_===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=269,this.singleExpression(12);break;case 3:u=new dm(this,u),this._ctx=u,h=u,this.state=270,this.match(M.Not),this.state=271,this.singleExpression(11);break;case 4:u=new lm(this,u),this._ctx=u,h=u,this.state=272,this.name();break;case 5:u=new fm(this,u),this._ctx=u,h=u,this.state=273,this.literal();break;case 6:u=new om(this,u),this._ctx=u,h=u,this.state=274,this.match(M.OpenParen),this.state=275,this.singleExpression(0),this.state=276,this.match(M.CloseParen);break}for(this._ctx.stop=this._input.LT(-1),this.state=311,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,31,this._ctx);T!==2&&T!==Mr.INVALID_ALT_NUMBER;){if(T===1)switch(this._parseListeners!=null&&this.triggerExitRuleEvent(),h=u,this.state=309,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,30,this._ctx)){case 1:{if(u=new gm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=280,!this.precpred(this._ctx,10))throw this.createFailedPredicateException("this.precpred(this._ctx, 10)");this.state=281,_=this._input.LA(1),!(_&-32)&&1<<_&114688?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=282,this.singleExpression(11)}break;case 2:{if(u=new am(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=283,!this.precpred(this._ctx,9))throw this.createFailedPredicateException("this.precpred(this._ctx, 9)");this.state=284,_=this._input.LA(1),_===12||_===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=285,this.singleExpression(10)}break;case 3:{if(u=new sm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=286,!this.precpred(this._ctx,8))throw this.createFailedPredicateException("this.precpred(this._ctx, 8)");this.state=287,_=this._input.LA(1),!(_&-32)&&1<<_&3932160?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=288,this.singleExpression(9)}break;case 4:{if(u=new _m(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=289,!this.precpred(this._ctx,7))throw this.createFailedPredicateException("this.precpred(this._ctx, 7)");this.state=290,_=this._input.LA(1),_===22||_===23?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=291,this.singleExpression(8)}break;case 5:{if(u=new cm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=292,!this.precpred(this._ctx,6))throw this.createFailedPredicateException("this.precpred(this._ctx, 6)");this.state=293,this.match(M.And),this.state=294,this.singleExpression(7)}break;case 6:{if(u=new hm(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=295,!this.precpred(this._ctx,5))throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");this.state=296,this.match(M.Or),this.state=297,this.singleExpression(6)}break;case 7:{if(u=new um(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=298,!this.precpred(this._ctx,4))throw this.createFailedPredicateException("this.precpred(this._ctx, 4)");this.state=299,this.match(M.QuestionMark),this.state=300,this.singleExpression(0),this.state=301,this.match(M.Colon),this.state=302,this.singleExpression(4)}break;case 8:{if(u=new ym(this,new Ve(this,n,o)),this.pushNewRecursionContext(u,m,M.RULE_singleExpression),this.state=304,!this.precpred(this._ctx,13))throw this.createFailedPredicateException("this.precpred(this._ctx, 13)");this.state=305,this.match(M.OpenBracket),this.state=306,this.singleExpression(0),this.state=307,this.match(M.CloseBracket)}break}this.state=313,this._errHandler.sync(this),T=this._interp.adaptivePredict(this._input,31,this._ctx)}}}catch(T){if(T instanceof et)u.exception=T,this._errHandler.reportError(this,T),this._errHandler.recover(this,T);else throw T}finally{this.unrollRecursionContexts(n)}return u}brackethesized(){let e=new al(this,this._ctx,this.state);this.enterRule(e,36,M.RULE_brackethesized);try{this.enterOuterAlt(e,1),this.state=314,this.match(M.OpenBracket),this.state=315,this.expressionSequence(),this.state=316,this.match(M.CloseBracket)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}arguments(){let e=new fp(this,this._ctx,this.state);this.enterRule(e,38,M.RULE_arguments);let n;try{let o;this.enterOuterAlt(e,1);{if(this.state=318,this.match(M.OpenParen),this.state=330,this._errHandler.sync(this),n=this._input.LA(1),!(n&-32)&&1<<n&2147496016||!(n-32&-32)&&1<<n-32&63455235){for(this.state=319,this.argument(),this.state=324,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=320,this.match(M.Comma),this.state=321,this.argument()),this.state=326,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,32,this._ctx);this.state=328,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=327,this.match(M.Comma))}this.state=332,this.match(M.CloseParen)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}argument(){let e=new sl(this,this._ctx,this.state);this.enterRule(e,40,M.RULE_argument);try{this.enterOuterAlt(e,1);{switch(this.state=337,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,35,this._ctx)){case 1:this.state=334,this.identifier(),this.state=335,this.match(M.Assign);break}switch(this.state=341,this._errHandler.sync(this),this._input.LA(1)){case 6:case 12:case 13:case 31:case 32:case 33:case 46:case 51:case 54:case 55:case 56:case 57:this.state=339,this.singleExpression(0);break;case 4:this.state=340,this.brackethesized();break;default:throw new fi(this)}}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}ifStatement(){let e=new hp(this,this._ctx,this.state);this.enterRule(e,42,M.RULE_ifStatement);let n;try{let o;this.enterOuterAlt(e,1);{for(this.state=343,this.match(M.If),this.state=344,this.singleExpression(0),this.state=345,this.blockLine(),this.state=353,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=346,this.match(M.Else),this.state=347,this.match(M.If),this.state=348,this.singleExpression(0),this.state=349,this.blockLine()),this.state=355,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,37,this._ctx);this.state=358,this._errHandler.sync(this),n=this._input.LA(1),n===48&&(this.state=356,this.match(M.Else),this.state=357,this.blockLine())}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}forStatement(){let e=new iu(this,this._ctx,this.state);this.enterRule(e,44,M.RULE_forStatement);let n;try{switch(this.state=392,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,43,this._ctx)){case 1:e=new bm(this,e),this.enterOuterAlt(e,1);{switch(this.state=360,this.match(M.For),this.state=362,this._errHandler.sync(this),n=this._input.LA(1),(n===38||n===40)&&(this.state=361,this.varModifier()),this.state=365,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,40,this._ctx)){case 1:this.state=364,this.typeGather();break}this.state=367,this.identifier(),this.state=368,this.match(M.Assign),this.state=369,this.singleExpression(0),this.state=370,this.match(M.To),this.state=371,this.singleExpression(0),this.state=374,this._errHandler.sync(this),n=this._input.LA(1),n===50&&(this.state=372,this.match(M.By),this.state=373,this.singleExpression(0)),this.state=376,this.blockLine()}break;case 2:e=new vm(this,e),this.enterOuterAlt(e,2);{switch(this.state=378,this.match(M.For),this.state=386,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:this.state=379,this.identifier();break;case 4:this.state=380,this.match(M.OpenBracket),this.state=381,this.identifier(),this.state=382,this.match(M.Comma),this.state=383,this.identifier(),this.state=384,this.match(M.CloseBracket);break;default:throw new fi(this)}this.state=388,this.match(M.In),this.state=389,this.singleExpression(0),this.state=390,this.blockLine()}break}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}switchStatement(){let e=new pp(this,this._ctx,this.state);this.enterRule(e,46,M.RULE_switchStatement);let n;try{this.enterOuterAlt(e,1);{this.state=394,this.match(M.Switch),this.state=396,this._errHandler.sync(this),n=this._input.LA(1),(!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235)&&(this.state=395,this.singleExpression(0)),this.state=398,this.match(M.NEWLINE),this.state=399,this.match(M.INDENT);{for(this.state=403,this._errHandler.sync(this),n=this._input.LA(1);!(n&-32)&&1<<n&2147496e3||!(n-32&-32)&&1<<n-32&63455235;)this.state=400,this.caseClause(),this.state=405,this._errHandler.sync(this),n=this._input.LA(1);this.state=407,this._errHandler.sync(this),n=this._input.LA(1),n===29&&(this.state=406,this.defaultCaluse())}this.state=409,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}caseClause(){let e=new ul(this,this._ctx,this.state);this.enterRule(e,48,M.RULE_caseClause);try{this.enterOuterAlt(e,1),this.state=411,this.singleExpression(0),this.state=412,this.match(M.ARROW),this.state=413,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}defaultCaluse(){let e=new dp(this,this._ctx,this.state);this.enterRule(e,50,M.RULE_defaultCaluse);try{this.enterOuterAlt(e,1),this.state=415,this.match(M.ARROW),this.state=416,this.block()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}whileStatement(){let e=new yp(this,this._ctx,this.state);this.enterRule(e,52,M.RULE_whileStatement);try{this.enterOuterAlt(e,1),this.state=418,this.match(M.While),this.state=419,this.singleExpression(0),this.state=420,this.blockLine()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}importStmt(){let e=new mp(this,this._ctx,this.state);this.enterRule(e,54,M.RULE_importStmt);let n;try{this.enterOuterAlt(e,1);{for(this.state=422,this.importElement(),this.state=427,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=423,this.match(M.Comma),this.state=424,this.importElement(),this.state=429,this._errHandler.sync(this),n=this._input.LA(1);this.state=430,this.match(M.NEWLINE)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}importElement(){let e=new cl(this,this._ctx,this.state);this.enterRule(e,56,M.RULE_importElement);let n;try{this.enterOuterAlt(e,1),this.state=432,this.match(M.Import),this.state=433,this.identifier(),this.state=434,this.match(M.Divide),this.state=435,this.identifier(),this.state=436,this.match(M.Divide),this.state=437,this.match(M.IntegerLiteral),this.state=440,this._errHandler.sync(this),n=this._input.LA(1),n===53&&(this.state=438,this.match(M.As),this.state=439,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}literal(){let e=new _p(this,this._ctx,this.state);this.enterRule(e,58,M.RULE_literal);let n;try{this.enterOuterAlt(e,1),this.state=442,n=this._input.LA(1),!(n-31&-32)&&1<<n-31&50331655?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}methodStmt(){let e=new ou(this,this._ctx,this.state);this.enterRule(e,60,M.RULE_methodStmt);try{let n;for(this.enterOuterAlt(e,1),this.state=444,this.methodElement(),this.state=449,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,49,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;)n===1&&(this.state=445,this.match(M.Point),this.state=446,this.methodElement()),this.state=451,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,49,this._ctx)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodElement(){let e=new rs(this,this._ctx,this.state);this.enterRule(e,62,M.RULE_methodElement);try{this.enterOuterAlt(e,1),this.state=452,this.methodName(),this.state=453,this.arguments()}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}methodName(){let e=new gp(this,this._ctx,this.state);this.enterRule(e,64,M.RULE_methodName);let n;try{let o;this.enterOuterAlt(e,1);{switch(this.state=468,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:for(this.state=460,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,50,this._ctx);o!==2&&o!==Mr.INVALID_ALT_NUMBER;)o===1&&(this.state=455,this.identifier(),this.state=456,this.match(M.Point)),this.state=462,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,50,this._ctx);break;case 6:this.state=463,this.match(M.OpenParen),this.state=464,this.singleExpression(0),this.state=465,this.match(M.CloseParen),this.state=466,this.match(M.Point);break;default:throw new fi(this)}this.state=470,this.identifier(),this.state=479,this._errHandler.sync(this),n=this._input.LA(1),n===18&&(this.state=471,this.match(M.LessThan),this.state=472,this.typeName(),this.state=475,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=473,this.match(M.Comma),this.state=474,this.typeName()),this.state=477,this.match(M.MoreThan))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunction(){let e=new bp(this,this._ctx,this.state);this.enterRule(e,66,M.RULE_arrowFunction);let n;try{this.enterOuterAlt(e,1),this.state=482,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=481,this.match(M.Export)),this.state=484,this.identifier(),this.state=485,this.arrowFunctionParameters(),this.state=486,this.match(M.ARROW),this.state=487,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowFunctionParameters(){let e=new vp(this,this._ctx,this.state);this.enterRule(e,68,M.RULE_arrowFunctionParameters);let n;try{this.enterOuterAlt(e,1),this.state=489,this.match(M.OpenParen),this.state=491,this._errHandler.sync(this),n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73&&(this.state=490,this.formalParameterList()),this.state=493,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterList(){let e=new ll(this,this._ctx,this.state);this.enterRule(e,70,M.RULE_formalParameterList);let n;try{for(this.enterOuterAlt(e,1),this.state=495,this.formalParameterArg(),this.state=500,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=496,this.match(M.Comma),this.state=497,this.formalParameterArg(),this.state=502,this._errHandler.sync(this),n=this._input.LA(1)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}formalParameterArg(){let e=new fl(this,this._ctx,this.state);this.enterRule(e,72,M.RULE_formalParameterArg);let n;try{this.enterOuterAlt(e,1);{switch(this.state=504,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,57,this._ctx)){case 1:this.state=503,this.typeGather();break}this.state=506,this.identifier(),this.state=509,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=507,this.match(M.Assign),this.state=508,this.singleExpression(0))}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethod(){let e=new Ep(this,this._ctx,this.state);this.enterRule(e,74,M.RULE_arrowMethod);let n;try{this.enterOuterAlt(e,1),this.state=512,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=511,this.match(M.Export)),this.state=514,this.match(M.Method),this.state=515,this.identifier(),this.state=516,this.arrowMethodParameters(),this.state=517,this.match(M.ARROW),this.state=518,this.block()}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}arrowMethodParameters(){let e=new Sp(this,this._ctx,this.state);this.enterRule(e,76,M.RULE_arrowMethodParameters);let n;try{this.enterOuterAlt(e,1),this.state=520,this.match(M.OpenParen),this.state=521,this.typeGather(),this.state=522,this.identifier(),this.state=525,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=523,this.match(M.Comma),this.state=524,this.formalParameterList()),this.state=527,this.match(M.CloseParen)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeStatement(){let e=new Tp(this,this._ctx,this.state);this.enterRule(e,78,M.RULE_typeStatement);let n;try{this.enterOuterAlt(e,1);{this.state=530,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=529,this.match(M.Export)),this.state=532,this.match(M.Type),this.state=533,this.identifier(),this.state=534,this.match(M.NEWLINE),this.state=535,this.match(M.INDENT),this.state=537,this._errHandler.sync(this),n=this._input.LA(1);do this.state=536,this.typeElement(),this.state=539,this._errHandler.sync(this),n=this._input.LA(1);while(!(n-40&-32)&&1<<n-40&149505);this.state=541,this.match(M.DEDENT)}}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeElement(){let e=new hl(this,this._ctx,this.state);this.enterRule(e,80,M.RULE_typeElement);let n;try{this.enterOuterAlt(e,1),this.state=544,this._errHandler.sync(this),n=this._input.LA(1),n===40&&(this.state=543,this.match(M.Varip)),this.state=546,this.typeGather(),this.state=547,this.identifier(),this.state=550,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=548,this.match(M.Assign),this.state=549,this.singleExpression(0)),this.state=552,this.match(M.NEWLINE)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}assignmentOperator(){let e=new pl(this,this._ctx,this.state);this.enterRule(e,82,M.RULE_assignmentOperator);let n;try{this.enterOuterAlt(e,1),this.state=554,n=this._input.LA(1),!(n&-32)&&1<<n&1593835520?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeMap(){let e=new dl(this,this._ctx,this.state);this.enterRule(e,84,M.RULE_typeMap);try{this.enterOuterAlt(e,1),this.state=556,this.match(M.Map),this.state=557,this.match(M.LessThan),this.state=558,this.typeName(),this.state=559,this.match(M.Comma),this.state=560,this.typeName(),this.state=561,this.match(M.MoreThan)}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeSeries(){let e=new Ap(this,this._ctx,this.state);this.enterRule(e,86,M.RULE_typeSeries);try{switch(this.enterOuterAlt(e,1),this.state=563,this.typeName(),this.state=567,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,65,this._ctx)){case 1:this.state=564,this.typeName();break;case 2:this.state=565,this.typeArray();break;case 3:this.state=566,this.typeMap();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeArray(){let e=new yl(this,this._ctx,this.state);this.enterRule(e,88,M.RULE_typeArray);try{switch(this.state=578,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,66,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=569,this.typeName(),this.state=570,this.match(M.LessThan),this.state=571,this.typeName(),this.state=572,this.match(M.MoreThan);break;case 2:this.enterOuterAlt(e,2),this.state=574,this.typeName(),this.state=575,this.match(M.OpenBracket),this.state=576,this.match(M.CloseBracket);break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}typeGather(){let e=new Uo(this,this._ctx,this.state);this.enterRule(e,90,M.RULE_typeGather);try{switch(this.state=584,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,67,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=580,this.typeName();break;case 2:this.enterOuterAlt(e,2),this.state=581,this.typeArray();break;case 3:this.enterOuterAlt(e,3),this.state=582,this.typeMap();break;case 4:this.enterOuterAlt(e,4),this.state=583,this.typeSeries();break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}identifier(){let e=new xn(this,this._ctx,this.state);this.enterRule(e,92,M.RULE_identifier);let n;try{this.enterOuterAlt(e,1),this.state=586,n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}typeName(){let e=new hi(this,this._ctx,this.state);this.enterRule(e,94,M.RULE_typeName);let n;try{this.enterOuterAlt(e,1),this.state=588,this.identifier(),this.state=591,this._errHandler.sync(this),n=this._input.LA(1),n===3&&(this.state=589,this.match(M.Point),this.state=590,this.identifier())}catch(o){if(o instanceof et)e.exception=o,this._errHandler.reportError(this,o),this._errHandler.recover(this,o);else throw o}finally{this.exitRule()}return e}name(){let e=new au(this,this._ctx,this.state);this.enterRule(e,96,M.RULE_name);try{let n;switch(this.state=614,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,72,this._ctx)){case 1:this.enterOuterAlt(e,1);{for(this.state=601,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,70,this._ctx);n!==2&&n!==Mr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=595,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,69,this._ctx)){case 1:this.state=593,this.identifier();break;case 2:this.state=594,this.methodElement();break}this.state=597,this.match(M.Point)}this.state=603,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,70,this._ctx)}this.state=604,this.identifier()}break;case 2:this.enterOuterAlt(e,2);{this.state=605,this.match(M.OpenParen),this.state=606,this.singleExpression(0),this.state=607,this.match(M.CloseParen),this.state=610,this._errHandler.sync(this),n=1;do{switch(n){case 1:this.state=608,this.match(M.Point),this.state=609,this.identifier();break;default:throw new fi(this)}this.state=612,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx)}while(n!==2&&n!==Mr.INVALID_ALT_NUMBER)}break}}catch(n){if(n instanceof et)e.exception=n,this._errHandler.reportError(this,n),this._errHandler.recover(this,n);else throw n}finally{this.exitRule()}return e}sempred(e,n,o){switch(n){case 17:return this.singleExpression_sempred(e,o)}return!0}singleExpression_sempred(e,n){switch(n){case 0:return this.precpred(this._ctx,10);case 1:return this.precpred(this._ctx,9);case 2:return this.precpred(this._ctx,8);case 3:return this.precpred(this._ctx,7);case 4:return this.precpred(this._ctx,6);case 5:return this.precpred(this._ctx,5);case 6:return this.precpred(this._ctx,4);case 7:return this.precpred(this._ctx,13)}return!0}static get _ATN(){return M.__ATN||(M.__ATN=new rp().deserialize(M._serializedATN)),M.__ATN}};w(M,"INDENT",1),w(M,"DEDENT",2),w(M,"Point",3),w(M,"OpenBracket",4),w(M,"CloseBracket",5),w(M,"OpenParen",6),w(M,"CloseParen",7),w(M,"Comma",8),w(M,"Assign",9),w(M,"QuestionMark",10),w(M,"Colon",11),w(M,"Plus",12),w(M,"Minus",13),w(M,"Multiply",14),w(M,"Divide",15),w(M,"Modulus",16),w(M,"Hashtag",17),w(M,"LessThan",18),w(M,"MoreThan",19),w(M,"LessThanEquals",20),w(M,"GreaterThanEquals",21),w(M,"Equals_",22),w(M,"NotEquals",23),w(M,"MultiplyAssign",24),w(M,"DivideAssign",25),w(M,"ModulusAssign",26),w(M,"PlusAssign",27),w(M,"MinusAssign",28),w(M,"ARROW",29),w(M,"ColonEquals",30),w(M,"BooleanLiteral",31),w(M,"IntegerLiteral",32),w(M,"DecimalLiteral",33),w(M,"Break",34),w(M,"And",35),w(M,"Export",36),w(M,"For",37),w(M,"Var",38),w(M,"Continue",39),w(M,"Varip",40),w(M,"Switch",41),w(M,"While",42),w(M,"If",43),w(M,"In",44),w(M,"Or",45),w(M,"Not",46),w(M,"Method",47),w(M,"Else",48),w(M,"To",49),w(M,"By",50),w(M,"Type",51),w(M,"Import",52),w(M,"As",53),w(M,"Map",54),w(M,"ColorLiteral",55),w(M,"StringLiteral",56),w(M,"Identifier",57),w(M,"HIDDEN_",58),w(M,"SKIP_",59),w(M,"NEWLINE",60),w(M,"EOF",ap.EOF),w(M,"RULE_program",0),w(M,"RULE_globalStmt",1),w(M,"RULE_blockStmt",2),w(M,"RULE_stmt",3),w(M,"RULE_simpleStmt",4),w(M,"RULE_flowStmt",5),w(M,"RULE_block",6),w(M,"RULE_blockLine",7),w(M,"RULE_variableDeclarationStmt",8),w(M,"RULE_variableDeclarationList",9),w(M,"RULE_varModifier",10),w(M,"RULE_blockSequence",11),w(M,"RULE_expressionSequence",12),w(M,"RULE_expressionBlockSequence",13),w(M,"RULE_varBlockStmt",14),w(M,"RULE_varArrayDeclaration",15),w(M,"RULE_blockExpression",16),w(M,"RULE_singleExpression",17),w(M,"RULE_brackethesized",18),w(M,"RULE_arguments",19),w(M,"RULE_argument",20),w(M,"RULE_ifStatement",21),w(M,"RULE_forStatement",22),w(M,"RULE_switchStatement",23),w(M,"RULE_caseClause",24),w(M,"RULE_defaultCaluse",25),w(M,"RULE_whileStatement",26),w(M,"RULE_importStmt",27),w(M,"RULE_importElement",28),w(M,"RULE_literal",29),w(M,"RULE_methodStmt",30),w(M,"RULE_methodElement",31),w(M,"RULE_methodName",32),w(M,"RULE_arrowFunction",33),w(M,"RULE_arrowFunctionParameters",34),w(M,"RULE_formalParameterList",35),w(M,"RULE_formalParameterArg",36),w(M,"RULE_arrowMethod",37),w(M,"RULE_arrowMethodParameters",38),w(M,"RULE_typeStatement",39),w(M,"RULE_typeElement",40),w(M,"RULE_assignmentOperator",41),w(M,"RULE_typeMap",42),w(M,"RULE_typeSeries",43),w(M,"RULE_typeArray",44),w(M,"RULE_typeGather",45),w(M,"RULE_identifier",46),w(M,"RULE_typeName",47),w(M,"RULE_name",48),w(M,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(M,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE"]),w(M,"ruleNames",["program","globalStmt","blockStmt","stmt","simpleStmt","flowStmt","block","blockLine","variableDeclarationStmt","variableDeclarationList","varModifier","blockSequence","expressionSequence","expressionBlockSequence","varBlockStmt","varArrayDeclaration","blockExpression","singleExpression","brackethesized","arguments","argument","ifStatement","forStatement","switchStatement","caseClause","defaultCaluse","whileStatement","importStmt","importElement","literal","methodStmt","methodElement","methodName","arrowFunction","arrowFunctionParameters","formalParameterList","formalParameterArg","arrowMethod","arrowMethodParameters","typeStatement","typeElement","assignmentOperator","typeMap","typeSeries","typeArray","typeGather","identifier","typeName","name"]),w(M,"_serializedATN",[4,1,60,617,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,1,0,1,0,5,0,101,8,0,10,0,12,0,104,9,0,1,0,1,0,1,1,1,1,3,1,110,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,119,8,1,1,2,1,2,1,2,5,2,124,8,2,10,2,12,2,127,9,2,1,2,1,2,3,2,131,8,2,1,3,1,3,3,3,135,8,3,1,3,1,3,1,3,3,3,140,8,3,1,4,1,4,1,4,1,4,3,4,146,8,4,1,5,1,5,1,6,1,6,3,6,152,8,6,1,6,1,6,1,6,3,6,157,8,6,1,7,1,7,1,7,4,7,162,8,7,11,7,12,7,163,1,7,1,7,1,8,1,8,3,8,170,8,8,1,8,1,8,1,8,3,8,175,8,8,5,8,177,8,8,10,8,12,8,180,9,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,190,8,9,1,10,1,10,1,11,1,11,3,11,196,8,11,1,11,1,11,1,11,3,11,201,8,11,5,11,203,8,11,10,11,12,11,206,9,11,1,12,1,12,1,12,5,12,211,8,12,10,12,12,12,214,9,12,1,13,1,13,3,13,218,8,13,1,13,1,13,5,13,222,8,13,10,13,12,13,225,9,13,1,13,1,13,3,13,229,8,13,1,14,1,14,1,14,1,14,1,14,1,14,3,14,237,8,14,1,14,1,14,1,15,3,15,242,8,15,1,15,3,15,245,8,15,1,15,1,15,1,15,1,15,1,15,5,15,252,8,15,10,15,12,15,255,9,15,1,15,1,15,3,15,259,8,15,1,16,1,16,1,16,1,16,3,16,265,8,16,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,279,8,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,5,17,310,8,17,10,17,12,17,313,9,17,1,18,1,18,1,18,1,18,1,19,1,19,1,19,1,19,5,19,323,8,19,10,19,12,19,326,9,19,1,19,3,19,329,8,19,3,19,331,8,19,1,19,1,19,1,20,1,20,1,20,3,20,338,8,20,1,20,1,20,3,20,342,8,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,1,21,5,21,352,8,21,10,21,12,21,355,9,21,1,21,1,21,3,21,359,8,21,1,22,1,22,3,22,363,8,22,1,22,3,22,366,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,375,8,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,1,22,3,22,387,8,22,1,22,1,22,1,22,1,22,3,22,393,8,22,1,23,1,23,3,23,397,8,23,1,23,1,23,1,23,5,23,402,8,23,10,23,12,23,405,9,23,1,23,3,23,408,8,23,1,23,1,23,1,24,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,27,1,27,1,27,5,27,426,8,27,10,27,12,27,429,9,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,441,8,28,1,29,1,29,1,30,1,30,1,30,5,30,448,8,30,10,30,12,30,451,9,30,1,31,1,31,1,31,1,32,1,32,1,32,5,32,459,8,32,10,32,12,32,462,9,32,1,32,1,32,1,32,1,32,1,32,3,32,469,8,32,1,32,1,32,1,32,1,32,1,32,3,32,476,8,32,1,32,1,32,3,32,480,8,32,1,33,3,33,483,8,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,492,8,34,1,34,1,34,1,35,1,35,1,35,5,35,499,8,35,10,35,12,35,502,9,35,1,36,3,36,505,8,36,1,36,1,36,1,36,3,36,510,8,36,1,37,3,37,513,8,37,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,3,38,526,8,38,1,38,1,38,1,39,3,39,531,8,39,1,39,1,39,1,39,1,39,1,39,4,39,538,8,39,11,39,12,39,539,1,39,1,39,1,40,3,40,545,8,40,1,40,1,40,1,40,1,40,3,40,551,8,40,1,40,1,40,1,41,1,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,43,1,43,1,43,1,43,3,43,568,8,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,579,8,44,1,45,1,45,1,45,1,45,3,45,585,8,45,1,46,1,46,1,47,1,47,1,47,3,47,592,8,47,1,48,1,48,3,48,596,8,48,1,48,1,48,5,48,600,8,48,10,48,12,48,603,9,48,1,48,1,48,1,48,1,48,1,48,1,48,4,48,611,8,48,11,48,12,48,612,3,48,615,8,48,1,48,0,1,34,49,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,0,9,2,0,34,34,39,39,2,0,38,38,40,40,1,0,12,13,1,0,14,16,1,0,18,21,1,0,22,23,2,0,31,33,55,56,2,0,24,28,30,30,3,0,51,51,54,54,57,57,661,0,102,1,0,0,0,2,118,1,0,0,0,4,125,1,0,0,0,6,139,1,0,0,0,8,145,1,0,0,0,10,147,1,0,0,0,12,156,1,0,0,0,14,158,1,0,0,0,16,169,1,0,0,0,18,189,1,0,0,0,20,191,1,0,0,0,22,195,1,0,0,0,24,207,1,0,0,0,26,223,1,0,0,0,28,236,1,0,0,0,30,258,1,0,0,0,32,264,1,0,0,0,34,278,1,0,0,0,36,314,1,0,0,0,38,318,1,0,0,0,40,337,1,0,0,0,42,343,1,0,0,0,44,392,1,0,0,0,46,394,1,0,0,0,48,411,1,0,0,0,50,415,1,0,0,0,52,418,1,0,0,0,54,422,1,0,0,0,56,432,1,0,0,0,58,442,1,0,0,0,60,444,1,0,0,0,62,452,1,0,0,0,64,468,1,0,0,0,66,482,1,0,0,0,68,489,1,0,0,0,70,495,1,0,0,0,72,504,1,0,0,0,74,512,1,0,0,0,76,520,1,0,0,0,78,530,1,0,0,0,80,544,1,0,0,0,82,554,1,0,0,0,84,556,1,0,0,0,86,563,1,0,0,0,88,578,1,0,0,0,90,584,1,0,0,0,92,586,1,0,0,0,94,588,1,0,0,0,96,614,1,0,0,0,98,101,5,60,0,0,99,101,3,2,1,0,100,98,1,0,0,0,100,99,1,0,0,0,101,104,1,0,0,0,102,100,1,0,0,0,102,103,1,0,0,0,103,105,1,0,0,0,104,102,1,0,0,0,105,106,5,0,0,1,106,1,1,0,0,0,107,109,3,16,8,0,108,110,5,8,0,0,109,108,1,0,0,0,109,110,1,0,0,0,110,111,1,0,0,0,111,112,5,60,0,0,112,119,1,0,0,0,113,119,3,4,2,0,114,119,3,54,27,0,115,119,3,66,33,0,116,119,3,74,37,0,117,119,3,78,39,0,118,107,1,0,0,0,118,113,1,0,0,0,118,114,1,0,0,0,118,115,1,0,0,0,118,116,1,0,0,0,118,117,1,0,0,0,119,3,1,0,0,0,120,121,3,16,8,0,121,122,5,8,0,0,122,124,1,0,0,0,123,120,1,0,0,0,124,127,1,0,0,0,125,123,1,0,0,0,125,126,1,0,0,0,126,130,1,0,0,0,127,125,1,0,0,0,128,131,3,28,14,0,129,131,3,32,16,0,130,128,1,0,0,0,130,129,1,0,0,0,131,5,1,0,0,0,132,134,3,8,4,0,133,135,5,8,0,0,134,133,1,0,0,0,134,135,1,0,0,0,135,136,1,0,0,0,136,137,5,60,0,0,137,140,1,0,0,0,138,140,3,26,13,0,139,132,1,0,0,0,139,138,1,0,0,0,140,7,1,0,0,0,141,146,3,24,12,0,142,146,3,22,11,0,143,146,3,36,18,0,144,146,3,10,5,0,145,141,1,0,0,0,145,142,1,0,0,0,145,143,1,0,0,0,145,144,1,0,0,0,146,9,1,0,0,0,147,148,7,0,0,0,148,11,1,0,0,0,149,151,3,8,4,0,150,152,5,8,0,0,151,150,1,0,0,0,151,152,1,0,0,0,152,153,1,0,0,0,153,154,5,60,0,0,154,157,1,0,0,0,155,157,3,14,7,0,156,149,1,0,0,0,156,155,1,0,0,0,157,13,1,0,0,0,158,159,5,60,0,0,159,161,5,1,0,0,160,162,3,6,3,0,161,160,1,0,0,0,162,163,1,0,0,0,163,161,1,0,0,0,163,164,1,0,0,0,164,165,1,0,0,0,165,166,5,2,0,0,166,15,1,0,0,0,167,170,3,60,30,0,168,170,3,18,9,0,169,167,1,0,0,0,169,168,1,0,0,0,170,178,1,0,0,0,171,174,5,8,0,0,172,175,3,60,30,0,173,175,3,18,9,0,174,172,1,0,0,0,174,173,1,0,0,0,175,177,1,0,0,0,176,171,1,0,0,0,177,180,1,0,0,0,178,176,1,0,0,0,178,179,1,0,0,0,179,17,1,0,0,0,180,178,1,0,0,0,181,182,3,30,15,0,182,183,5,9,0,0,183,184,3,34,17,0,184,190,1,0,0,0,185,186,3,96,48,0,186,187,3,82,41,0,187,188,3,34,17,0,188,190,1,0,0,0,189,181,1,0,0,0,189,185,1,0,0,0,190,19,1,0,0,0,191,192,7,1,0,0,192,21,1,0,0,0,193,196,3,34,17,0,194,196,3,18,9,0,195,193,1,0,0,0,195,194,1,0,0,0,196,204,1,0,0,0,197,200,5,8,0,0,198,201,3,34,17,0,199,201,3,18,9,0,200,198,1,0,0,0,200,199,1,0,0,0,201,203,1,0,0,0,202,197,1,0,0,0,203,206,1,0,0,0,204,202,1,0,0,0,204,205,1,0,0,0,205,23,1,0,0,0,206,204,1,0,0,0,207,212,3,34,17,0,208,209,5,8,0,0,209,211,3,34,17,0,210,208,1,0,0,0,211,214,1,0,0,0,212,210,1,0,0,0,212,213,1,0,0,0,213,25,1,0,0,0,214,212,1,0,0,0,215,218,3,34,17,0,216,218,3,18,9,0,217,215,1,0,0,0,217,216,1,0,0,0,218,219,1,0,0,0,219,220,5,8,0,0,220,222,1,0,0,0,221,217,1,0,0,0,222,225,1,0,0,0,223,221,1,0,0,0,223,224,1,0,0,0,224,228,1,0,0,0,225,223,1,0,0,0,226,229,3,28,14,0,227,229,3,32,16,0,228,226,1,0,0,0,228,227,1,0,0,0,229,27,1,0,0,0,230,231,3,30,15,0,231,232,5,9,0,0,232,237,1,0,0,0,233,234,3,96,48,0,234,235,3,82,41,0,235,237,1,0,0,0,236,230,1,0,0,0,236,233,1,0,0,0,237,238,1,0,0,0,238,239,3,32,16,0,239,29,1,0,0,0,240,242,3,20,10,0,241,240,1,0,0,0,241,242,1,0,0,0,242,244,1,0,0,0,243,245,3,90,45,0,244,243,1,0,0,0,244,245,1,0,0,0,245,246,1,0,0,0,246,259,3,92,46,0,247,248,5,4,0,0,248,253,3,92,46,0,249,250,5,8,0,0,250,252,3,92,46,0,251,249,1,0,0,0,252,255,1,0,0,0,253,251,1,0,0,0,253,254,1,0,0,0,254,256,1,0,0,0,255,253,1,0,0,0,256,257,5,5,0,0,257,259,1,0,0,0,258,241,1,0,0,0,258,247,1,0,0,0,259,31,1,0,0,0,260,265,3,42,21,0,261,265,3,44,22,0,262,265,3,52,26,0,263,265,3,46,23,0,264,260,1,0,0,0,264,261,1,0,0,0,264,262,1,0,0,0,264,263,1,0,0,0,265,33,1,0,0,0,266,267,6,17,-1,0,267,279,3,60,30,0,268,269,7,2,0,0,269,279,3,34,17,12,270,271,5,46,0,0,271,279,3,34,17,11,272,279,3,96,48,0,273,279,3,58,29,0,274,275,5,6,0,0,275,276,3,34,17,0,276,277,5,7,0,0,277,279,1,0,0,0,278,266,1,0,0,0,278,268,1,0,0,0,278,270,1,0,0,0,278,272,1,0,0,0,278,273,1,0,0,0,278,274,1,0,0,0,279,311,1,0,0,0,280,281,10,10,0,0,281,282,7,3,0,0,282,310,3,34,17,11,283,284,10,9,0,0,284,285,7,2,0,0,285,310,3,34,17,10,286,287,10,8,0,0,287,288,7,4,0,0,288,310,3,34,17,9,289,290,10,7,0,0,290,291,7,5,0,0,291,310,3,34,17,8,292,293,10,6,0,0,293,294,5,35,0,0,294,310,3,34,17,7,295,296,10,5,0,0,296,297,5,45,0,0,297,310,3,34,17,6,298,299,10,4,0,0,299,300,5,10,0,0,300,301,3,34,17,0,301,302,5,11,0,0,302,303,3,34,17,4,303,310,1,0,0,0,304,305,10,13,0,0,305,306,5,4,0,0,306,307,3,34,17,0,307,308,5,5,0,0,308,310,1,0,0,0,309,280,1,0,0,0,309,283,1,0,0,0,309,286,1,0,0,0,309,289,1,0,0,0,309,292,1,0,0,0,309,295,1,0,0,0,309,298,1,0,0,0,309,304,1,0,0,0,310,313,1,0,0,0,311,309,1,0,0,0,311,312,1,0,0,0,312,35,1,0,0,0,313,311,1,0,0,0,314,315,5,4,0,0,315,316,3,24,12,0,316,317,5,5,0,0,317,37,1,0,0,0,318,330,5,6,0,0,319,324,3,40,20,0,320,321,5,8,0,0,321,323,3,40,20,0,322,320,1,0,0,0,323,326,1,0,0,0,324,322,1,0,0,0,324,325,1,0,0,0,325,328,1,0,0,0,326,324,1,0,0,0,327,329,5,8,0,0,328,327,1,0,0,0,328,329,1,0,0,0,329,331,1,0,0,0,330,319,1,0,0,0,330,331,1,0,0,0,331,332,1,0,0,0,332,333,5,7,0,0,333,39,1,0,0,0,334,335,3,92,46,0,335,336,5,9,0,0,336,338,1,0,0,0,337,334,1,0,0,0,337,338,1,0,0,0,338,341,1,0,0,0,339,342,3,34,17,0,340,342,3,36,18,0,341,339,1,0,0,0,341,340,1,0,0,0,342,41,1,0,0,0,343,344,5,43,0,0,344,345,3,34,17,0,345,353,3,14,7,0,346,347,5,48,0,0,347,348,5,43,0,0,348,349,3,34,17,0,349,350,3,14,7,0,350,352,1,0,0,0,351,346,1,0,0,0,352,355,1,0,0,0,353,351,1,0,0,0,353,354,1,0,0,0,354,358,1,0,0,0,355,353,1,0,0,0,356,357,5,48,0,0,357,359,3,14,7,0,358,356,1,0,0,0,358,359,1,0,0,0,359,43,1,0,0,0,360,362,5,37,0,0,361,363,3,20,10,0,362,361,1,0,0,0,362,363,1,0,0,0,363,365,1,0,0,0,364,366,3,90,45,0,365,364,1,0,0,0,365,366,1,0,0,0,366,367,1,0,0,0,367,368,3,92,46,0,368,369,5,9,0,0,369,370,3,34,17,0,370,371,5,49,0,0,371,374,3,34,17,0,372,373,5,50,0,0,373,375,3,34,17,0,374,372,1,0,0,0,374,375,1,0,0,0,375,376,1,0,0,0,376,377,3,14,7,0,377,393,1,0,0,0,378,386,5,37,0,0,379,387,3,92,46,0,380,381,5,4,0,0,381,382,3,92,46,0,382,383,5,8,0,0,383,384,3,92,46,0,384,385,5,5,0,0,385,387,1,0,0,0,386,379,1,0,0,0,386,380,1,0,0,0,387,388,1,0,0,0,388,389,5,44,0,0,389,390,3,34,17,0,390,391,3,14,7,0,391,393,1,0,0,0,392,360,1,0,0,0,392,378,1,0,0,0,393,45,1,0,0,0,394,396,5,41,0,0,395,397,3,34,17,0,396,395,1,0,0,0,396,397,1,0,0,0,397,398,1,0,0,0,398,399,5,60,0,0,399,403,5,1,0,0,400,402,3,48,24,0,401,400,1,0,0,0,402,405,1,0,0,0,403,401,1,0,0,0,403,404,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,406,408,3,50,25,0,407,406,1,0,0,0,407,408,1,0,0,0,408,409,1,0,0,0,409,410,5,2,0,0,410,47,1,0,0,0,411,412,3,34,17,0,412,413,5,29,0,0,413,414,3,12,6,0,414,49,1,0,0,0,415,416,5,29,0,0,416,417,3,12,6,0,417,51,1,0,0,0,418,419,5,42,0,0,419,420,3,34,17,0,420,421,3,14,7,0,421,53,1,0,0,0,422,427,3,56,28,0,423,424,5,8,0,0,424,426,3,56,28,0,425,423,1,0,0,0,426,429,1,0,0,0,427,425,1,0,0,0,427,428,1,0,0,0,428,430,1,0,0,0,429,427,1,0,0,0,430,431,5,60,0,0,431,55,1,0,0,0,432,433,5,52,0,0,433,434,3,92,46,0,434,435,5,15,0,0,435,436,3,92,46,0,436,437,5,15,0,0,437,440,5,32,0,0,438,439,5,53,0,0,439,441,3,92,46,0,440,438,1,0,0,0,440,441,1,0,0,0,441,57,1,0,0,0,442,443,7,6,0,0,443,59,1,0,0,0,444,449,3,62,31,0,445,446,5,3,0,0,446,448,3,62,31,0,447,445,1,0,0,0,448,451,1,0,0,0,449,447,1,0,0,0,449,450,1,0,0,0,450,61,1,0,0,0,451,449,1,0,0,0,452,453,3,64,32,0,453,454,3,38,19,0,454,63,1,0,0,0,455,456,3,92,46,0,456,457,5,3,0,0,457,459,1,0,0,0,458,455,1,0,0,0,459,462,1,0,0,0,460,458,1,0,0,0,460,461,1,0,0,0,461,469,1,0,0,0,462,460,1,0,0,0,463,464,5,6,0,0,464,465,3,34,17,0,465,466,5,7,0,0,466,467,5,3,0,0,467,469,1,0,0,0,468,460,1,0,0,0,468,463,1,0,0,0,469,470,1,0,0,0,470,479,3,92,46,0,471,472,5,18,0,0,472,475,3,94,47,0,473,474,5,8,0,0,474,476,3,94,47,0,475,473,1,0,0,0,475,476,1,0,0,0,476,477,1,0,0,0,477,478,5,19,0,0,478,480,1,0,0,0,479,471,1,0,0,0,479,480,1,0,0,0,480,65,1,0,0,0,481,483,5,36,0,0,482,481,1,0,0,0,482,483,1,0,0,0,483,484,1,0,0,0,484,485,3,92,46,0,485,486,3,68,34,0,486,487,5,29,0,0,487,488,3,12,6,0,488,67,1,0,0,0,489,491,5,6,0,0,490,492,3,70,35,0,491,490,1,0,0,0,491,492,1,0,0,0,492,493,1,0,0,0,493,494,5,7,0,0,494,69,1,0,0,0,495,500,3,72,36,0,496,497,5,8,0,0,497,499,3,72,36,0,498,496,1,0,0,0,499,502,1,0,0,0,500,498,1,0,0,0,500,501,1,0,0,0,501,71,1,0,0,0,502,500,1,0,0,0,503,505,3,90,45,0,504,503,1,0,0,0,504,505,1,0,0,0,505,506,1,0,0,0,506,509,3,92,46,0,507,508,5,9,0,0,508,510,3,34,17,0,509,507,1,0,0,0,509,510,1,0,0,0,510,73,1,0,0,0,511,513,5,36,0,0,512,511,1,0,0,0,512,513,1,0,0,0,513,514,1,0,0,0,514,515,5,47,0,0,515,516,3,92,46,0,516,517,3,76,38,0,517,518,5,29,0,0,518,519,3,12,6,0,519,75,1,0,0,0,520,521,5,6,0,0,521,522,3,90,45,0,522,525,3,92,46,0,523,524,5,8,0,0,524,526,3,70,35,0,525,523,1,0,0,0,525,526,1,0,0,0,526,527,1,0,0,0,527,528,5,7,0,0,528,77,1,0,0,0,529,531,5,36,0,0,530,529,1,0,0,0,530,531,1,0,0,0,531,532,1,0,0,0,532,533,5,51,0,0,533,534,3,92,46,0,534,535,5,60,0,0,535,537,5,1,0,0,536,538,3,80,40,0,537,536,1,0,0,0,538,539,1,0,0,0,539,537,1,0,0,0,539,540,1,0,0,0,540,541,1,0,0,0,541,542,5,2,0,0,542,79,1,0,0,0,543,545,5,40,0,0,544,543,1,0,0,0,544,545,1,0,0,0,545,546,1,0,0,0,546,547,3,90,45,0,547,550,3,92,46,0,548,549,5,9,0,0,549,551,3,34,17,0,550,548,1,0,0,0,550,551,1,0,0,0,551,552,1,0,0,0,552,553,5,60,0,0,553,81,1,0,0,0,554,555,7,7,0,0,555,83,1,0,0,0,556,557,5,54,0,0,557,558,5,18,0,0,558,559,3,94,47,0,559,560,5,8,0,0,560,561,3,94,47,0,561,562,5,19,0,0,562,85,1,0,0,0,563,567,3,94,47,0,564,568,3,94,47,0,565,568,3,88,44,0,566,568,3,84,42,0,567,564,1,0,0,0,567,565,1,0,0,0,567,566,1,0,0,0,568,87,1,0,0,0,569,570,3,94,47,0,570,571,5,18,0,0,571,572,3,94,47,0,572,573,5,19,0,0,573,579,1,0,0,0,574,575,3,94,47,0,575,576,5,4,0,0,576,577,5,5,0,0,577,579,1,0,0,0,578,569,1,0,0,0,578,574,1,0,0,0,579,89,1,0,0,0,580,585,3,94,47,0,581,585,3,88,44,0,582,585,3,84,42,0,583,585,3,86,43,0,584,580,1,0,0,0,584,581,1,0,0,0,584,582,1,0,0,0,584,583,1,0,0,0,585,91,1,0,0,0,586,587,7,8,0,0,587,93,1,0,0,0,588,591,3,92,46,0,589,590,5,3,0,0,590,592,3,92,46,0,591,589,1,0,0,0,591,592,1,0,0,0,592,95,1,0,0,0,593,596,3,92,46,0,594,596,3,62,31,0,595,593,1,0,0,0,595,594,1,0,0,0,596,597,1,0,0,0,597,598,5,3,0,0,598,600,1,0,0,0,599,595,1,0,0,0,600,603,1,0,0,0,601,599,1,0,0,0,601,602,1,0,0,0,602,604,1,0,0,0,603,601,1,0,0,0,604,615,3,92,46,0,605,606,5,6,0,0,606,607,3,34,17,0,607,610,5,7,0,0,608,609,5,3,0,0,609,611,3,92,46,0,610,608,1,0,0,0,611,612,1,0,0,0,612,610,1,0,0,0,612,613,1,0,0,0,613,615,1,0,0,0,614,601,1,0,0,0,614,605,1,0,0,0,615,97,1,0,0,0,73,100,102,109,118,125,130,134,139,145,151,156,163,169,174,178,189,195,200,204,212,217,223,228,236,241,244,253,258,264,278,309,311,324,328,330,337,341,353,358,362,365,374,386,392,396,403,407,427,440,449,460,468,475,479,482,491,500,504,509,512,525,530,539,544,550,567,578,584,591,595,601,612,614]),w(M,"__ATN"),w(M,"DecisionsToDFA",M._ATN.decisionToState.map((e,n)=>new ip(e,n)));let I=M;class em extends Qe{constructor(e,n,o){super(n,o),this.parser=e}EOF(){return this.getToken(I.EOF,0)}NEWLINE_list(){return this.getTokens(I.NEWLINE)}NEWLINE(e){return this.getToken(I.NEWLINE,e)}globalStmt_list(){return this.getTypedRuleContexts(el)}globalStmt(e){return this.getTypedRuleContext(el,e)}get ruleIndex(){return I.RULE_program}accept(e){return e.visitProgram?e.visitProgram(this):e.visitChildren(this)}}class el extends Qe{constructor(e,n,o){super(n,o),this.parser=e}variableDeclarationStmt(){return this.getTypedRuleContext(nu,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}blockStmt(){return this.getTypedRuleContext(sp,0)}importStmt(){return this.getTypedRuleContext(mp,0)}arrowFunction(){return this.getTypedRuleContext(bp,0)}arrowMethod(){return this.getTypedRuleContext(Ep,0)}typeStatement(){return this.getTypedRuleContext(Tp,0)}get ruleIndex(){return I.RULE_globalStmt}accept(e){return e.visitGlobalStmt?e.visitGlobalStmt(this):e.visitChildren(this)}}class sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ol,0)}blockExpression(){return this.getTypedRuleContext(ru,0)}variableDeclarationStmt_list(){return this.getTypedRuleContexts(nu)}variableDeclarationStmt(e){return this.getTypedRuleContext(nu,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_blockStmt}accept(e){return e.visitBlockStmt?e.visitBlockStmt(this):e.visitChildren(this)}}class tl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(nl,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}expressionBlockSequence(){return this.getTypedRuleContext(lp,0)}get ruleIndex(){return I.RULE_stmt}accept(e){return e.visitStmt?e.visitStmt(this):e.visitChildren(this)}}class nl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}expressionSequence(){return this.getTypedRuleContext(il,0)}blockSequence(){return this.getTypedRuleContext(cp,0)}brackethesized(){return this.getTypedRuleContext(al,0)}flowStmt(){return this.getTypedRuleContext(up,0)}get ruleIndex(){return I.RULE_simpleStmt}accept(e){return e.visitSimpleStmt?e.visitSimpleStmt(this):e.visitChildren(this)}}class up extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Break(){return this.getToken(I.Break,0)}Continue(){return this.getToken(I.Continue,0)}get ruleIndex(){return I.RULE_flowStmt}accept(e){return e.visitFlowStmt?e.visitFlowStmt(this):e.visitChildren(this)}}class ts extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(nl,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma(){return this.getToken(I.Comma,0)}blockLine(){return this.getTypedRuleContext(fo,0)}get ruleIndex(){return I.RULE_block}accept(e){return e.visitBlock?e.visitBlock(this):e.visitChildren(this)}}class fo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}stmt_list(){return this.getTypedRuleContexts(tl)}stmt(e){return this.getTypedRuleContext(tl,e)}get ruleIndex(){return I.RULE_blockLine}accept(e){return e.visitBlockLine?e.visitBlockLine(this):e.visitChildren(this)}}class nu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodStmt_list(){return this.getTypedRuleContexts(ou)}methodStmt(e){return this.getTypedRuleContext(ou,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_variableDeclarationStmt}accept(e){return e.visitVariableDeclarationStmt?e.visitVariableDeclarationStmt(this):e.visitChildren(this)}}class ki extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_variableDeclarationList}copyFrom(e){super.copyFrom(e)}}class tm extends ki{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(au,0)}assignmentOperator(){return this.getTypedRuleContext(pl,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitAgainAssign?e.visitAgainAssign(this):e.visitChildren(this)}}class nm extends ki{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}varArrayDeclaration(){return this.getTypedRuleContext(ns,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitDeclareAssign?e.visitDeclareAssign(this):e.visitChildren(this)}}class rl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Var(){return this.getToken(I.Var,0)}Varip(){return this.getToken(I.Varip,0)}get ruleIndex(){return I.RULE_varModifier}accept(e){return e.visitVarModifier?e.visitVarModifier(this):e.visitChildren(this)}}class cp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_blockSequence}accept(e){return e.visitBlockSequence?e.visitBlockSequence(this):e.visitChildren(this)}}class il extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_expressionSequence}accept(e){return e.visitExpressionSequence?e.visitExpressionSequence(this):e.visitChildren(this)}}class lp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ol,0)}blockExpression(){return this.getTypedRuleContext(ru,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(ki)}variableDeclarationList(e){return this.getTypedRuleContext(ki,e)}get ruleIndex(){return I.RULE_expressionBlockSequence}accept(e){return e.visitExpressionBlockSequence?e.visitExpressionBlockSequence(this):e.visitChildren(this)}}class ol extends Qe{constructor(e,n,o){super(n,o),this.parser=e}blockExpression(){return this.getTypedRuleContext(ru,0)}varArrayDeclaration(){return this.getTypedRuleContext(ns,0)}Assign(){return this.getToken(I.Assign,0)}name(){return this.getTypedRuleContext(au,0)}assignmentOperator(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return I.RULE_varBlockStmt}accept(e){return e.visitVarBlockStmt?e.visitVarBlockStmt(this):e.visitChildren(this)}}class ns extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_varArrayDeclaration}copyFrom(e){super.copyFrom(e)}}class rm extends ns{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenBracket(){return this.getToken(I.OpenBracket,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}CloseBracket(){return this.getToken(I.CloseBracket,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}accept(e){return e.visitVarMultiple?e.visitVarMultiple(this):e.visitChildren(this)}}class im extends ns{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}identifier(){return this.getTypedRuleContext(xn,0)}varModifier(){return this.getTypedRuleContext(rl,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}accept(e){return e.visitVarSingle?e.visitVarSingle(this):e.visitChildren(this)}}class ru extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ifStatement(){return this.getTypedRuleContext(hp,0)}forStatement(){return this.getTypedRuleContext(iu,0)}whileStatement(){return this.getTypedRuleContext(yp,0)}switchStatement(){return this.getTypedRuleContext(pp,0)}get ruleIndex(){return I.RULE_blockExpression}accept(e){return e.visitBlockExpression?e.visitBlockExpression(this):e.visitChildren(this)}}class Ve extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_singleExpression}copyFrom(e){super.copyFrom(e)}}class om extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}accept(e){return e.visitParenthesizedExpression?e.visitParenthesizedExpression(this):e.visitChildren(this)}}class am extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Plus(){return this.getToken(I.Plus,0)}Minus(){return this.getToken(I.Minus,0)}accept(e){return e.visitAdditiveExpression?e.visitAdditiveExpression(this):e.visitChildren(this)}}class sm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}LessThan(){return this.getToken(I.LessThan,0)}MoreThan(){return this.getToken(I.MoreThan,0)}LessThanEquals(){return this.getToken(I.LessThanEquals,0)}GreaterThanEquals(){return this.getToken(I.GreaterThanEquals,0)}accept(e){return e.visitRelationalExpression?e.visitRelationalExpression(this):e.visitChildren(this)}}class um extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}QuestionMark(){return this.getToken(I.QuestionMark,0)}Colon(){return this.getToken(I.Colon,0)}accept(e){return e.visitTernaryExpression?e.visitTernaryExpression(this):e.visitChildren(this)}}class cm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}And(){return this.getToken(I.And,0)}accept(e){return e.visitLogicalAndExpression?e.visitLogicalAndExpression(this):e.visitChildren(this)}}class lm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(au,0)}accept(e){return e.visitNameExpression?e.visitNameExpression(this):e.visitChildren(this)}}class fm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}literal(){return this.getTypedRuleContext(_p,0)}accept(e){return e.visitLiteralExpression?e.visitLiteralExpression(this):e.visitChildren(this)}}class hm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Or(){return this.getToken(I.Or,0)}accept(e){return e.visitLogicalOrExpression?e.visitLogicalOrExpression(this):e.visitChildren(this)}}class pm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression(){return this.getTypedRuleContext(Ve,0)}Minus(){return this.getToken(I.Minus,0)}Plus(){return this.getToken(I.Plus,0)}accept(e){return e.visitUnaryExpression?e.visitUnaryExpression(this):e.visitChildren(this)}}class dm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}Not(){return this.getToken(I.Not,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitNotExpression?e.visitNotExpression(this):e.visitChildren(this)}}class ym extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}OpenBracket(){return this.getToken(I.OpenBracket,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}accept(e){return e.visitMemberIndexExpression?e.visitMemberIndexExpression(this):e.visitChildren(this)}}class mm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}methodStmt(){return this.getTypedRuleContext(ou,0)}accept(e){return e.visitMethodExpression?e.visitMethodExpression(this):e.visitChildren(this)}}class _m extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Equals_(){return this.getToken(I.Equals_,0)}NotEquals(){return this.getToken(I.NotEquals,0)}accept(e){return e.visitEqualityExpression?e.visitEqualityExpression(this):e.visitChildren(this)}}class gm extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}Multiply(){return this.getToken(I.Multiply,0)}Divide(){return this.getToken(I.Divide,0)}Modulus(){return this.getToken(I.Modulus,0)}accept(e){return e.visitMultiplicativeExpression?e.visitMultiplicativeExpression(this):e.visitChildren(this)}}class al extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenBracket(){return this.getToken(I.OpenBracket,0)}expressionSequence(){return this.getTypedRuleContext(il,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}get ruleIndex(){return I.RULE_brackethesized}accept(e){return e.visitBrackethesized?e.visitBrackethesized(this):e.visitChildren(this)}}class fp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}CloseParen(){return this.getToken(I.CloseParen,0)}argument_list(){return this.getTypedRuleContexts(sl)}argument(e){return this.getTypedRuleContext(sl,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_arguments}accept(e){return e.visitArguments?e.visitArguments(this):e.visitChildren(this)}}class sl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}brackethesized(){return this.getTypedRuleContext(al,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(I.Assign,0)}get ruleIndex(){return I.RULE_argument}accept(e){return e.visitArgument?e.visitArgument(this):e.visitChildren(this)}}class hp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}If_list(){return this.getTokens(I.If)}If(e){return this.getToken(I.If,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}blockLine_list(){return this.getTypedRuleContexts(fo)}blockLine(e){return this.getTypedRuleContext(fo,e)}Else_list(){return this.getTokens(I.Else)}Else(e){return this.getToken(I.Else,e)}get ruleIndex(){return I.RULE_ifStatement}accept(e){return e.visitIfStatement?e.visitIfStatement(this):e.visitChildren(this)}}class iu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return I.RULE_forStatement}copyFrom(e){super.copyFrom(e)}}class bm extends iu{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(I.For,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}To(){return this.getToken(I.To,0)}blockLine(){return this.getTypedRuleContext(fo,0)}varModifier(){return this.getTypedRuleContext(rl,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}By(){return this.getToken(I.By,0)}accept(e){return e.visitForToStatement?e.visitForToStatement(this):e.visitChildren(this)}}class vm extends iu{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(I.For,0)}In(){return this.getToken(I.In,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(fo,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenBracket(){return this.getToken(I.OpenBracket,0)}Comma(){return this.getToken(I.Comma,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}accept(e){return e.visitForInStatement?e.visitForInStatement(this):e.visitChildren(this)}}class pp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Switch(){return this.getToken(I.Switch,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}caseClause_list(){return this.getTypedRuleContexts(ul)}caseClause(e){return this.getTypedRuleContext(ul,e)}defaultCaluse(){return this.getTypedRuleContext(dp,0)}get ruleIndex(){return I.RULE_switchStatement}accept(e){return e.visitSwitchStatement?e.visitSwitchStatement(this):e.visitChildren(this)}}class ul extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}get ruleIndex(){return I.RULE_caseClause}accept(e){return e.visitCaseClause?e.visitCaseClause(this):e.visitChildren(this)}}class dp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}get ruleIndex(){return I.RULE_defaultCaluse}accept(e){return e.visitDefaultCaluse?e.visitDefaultCaluse(this):e.visitChildren(this)}}class yp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}While(){return this.getToken(I.While,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(fo,0)}get ruleIndex(){return I.RULE_whileStatement}accept(e){return e.visitWhileStatement?e.visitWhileStatement(this):e.visitChildren(this)}}class mp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}importElement_list(){return this.getTypedRuleContexts(cl)}importElement(e){return this.getTypedRuleContext(cl,e)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_importStmt}accept(e){return e.visitImportStmt?e.visitImportStmt(this):e.visitChildren(this)}}class cl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Import(){return this.getToken(I.Import,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Divide_list(){return this.getTokens(I.Divide)}Divide(e){return this.getToken(I.Divide,e)}IntegerLiteral(){return this.getToken(I.IntegerLiteral,0)}As(){return this.getToken(I.As,0)}get ruleIndex(){return I.RULE_importElement}accept(e){return e.visitImportElement?e.visitImportElement(this):e.visitChildren(this)}}class _p extends Qe{constructor(e,n,o){super(n,o),this.parser=e}BooleanLiteral(){return this.getToken(I.BooleanLiteral,0)}ColorLiteral(){return this.getToken(I.ColorLiteral,0)}StringLiteral(){return this.getToken(I.StringLiteral,0)}IntegerLiteral(){return this.getToken(I.IntegerLiteral,0)}DecimalLiteral(){return this.getToken(I.DecimalLiteral,0)}get ruleIndex(){return I.RULE_literal}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}class ou extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodElement_list(){return this.getTypedRuleContexts(rs)}methodElement(e){return this.getTypedRuleContext(rs,e)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}get ruleIndex(){return I.RULE_methodStmt}accept(e){return e.visitMethodStmt?e.visitMethodStmt(this):e.visitChildren(this)}}class rs extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodName(){return this.getTypedRuleContext(gp,0)}arguments(){return this.getTypedRuleContext(fp,0)}get ruleIndex(){return I.RULE_methodElement}accept(e){return e.visitMethodElement?e.visitMethodElement(this):e.visitChildren(this)}}class gp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}LessThan(){return this.getToken(I.LessThan,0)}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}MoreThan(){return this.getToken(I.MoreThan,0)}Comma(){return this.getToken(I.Comma,0)}get ruleIndex(){return I.RULE_methodName}accept(e){return e.visitMethodName?e.visitMethodName(this):e.visitChildren(this)}}class bp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}arrowFunctionParameters(){return this.getTypedRuleContext(vp,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}Export(){return this.getToken(I.Export,0)}get ruleIndex(){return I.RULE_arrowFunction}accept(e){return e.visitArrowFunction?e.visitArrowFunction(this):e.visitChildren(this)}}class vp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}CloseParen(){return this.getToken(I.CloseParen,0)}formalParameterList(){return this.getTypedRuleContext(ll,0)}get ruleIndex(){return I.RULE_arrowFunctionParameters}accept(e){return e.visitArrowFunctionParameters?e.visitArrowFunctionParameters(this):e.visitChildren(this)}}class ll extends Qe{constructor(e,n,o){super(n,o),this.parser=e}formalParameterArg_list(){return this.getTypedRuleContexts(fl)}formalParameterArg(e){return this.getTypedRuleContext(fl,e)}Comma_list(){return this.getTokens(I.Comma)}Comma(e){return this.getToken(I.Comma,e)}get ruleIndex(){return I.RULE_formalParameterList}accept(e){return e.visitFormalParameterList?e.visitFormalParameterList(this):e.visitChildren(this)}}class fl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return I.RULE_formalParameterArg}accept(e){return e.visitFormalParameterArg?e.visitFormalParameterArg(this):e.visitChildren(this)}}class Ep extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Method(){return this.getToken(I.Method,0)}identifier(){return this.getTypedRuleContext(xn,0)}arrowMethodParameters(){return this.getTypedRuleContext(Sp,0)}ARROW(){return this.getToken(I.ARROW,0)}block(){return this.getTypedRuleContext(ts,0)}Export(){return this.getToken(I.Export,0)}get ruleIndex(){return I.RULE_arrowMethod}accept(e){return e.visitArrowMethod?e.visitArrowMethod(this):e.visitChildren(this)}}class Sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(I.OpenParen,0)}typeGather(){return this.getTypedRuleContext(Uo,0)}identifier(){return this.getTypedRuleContext(xn,0)}CloseParen(){return this.getToken(I.CloseParen,0)}Comma(){return this.getToken(I.Comma,0)}formalParameterList(){return this.getTypedRuleContext(ll,0)}get ruleIndex(){return I.RULE_arrowMethodParameters}accept(e){return e.visitArrowMethodParameters?e.visitArrowMethodParameters(this):e.visitChildren(this)}}class Tp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Type(){return this.getToken(I.Type,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}INDENT(){return this.getToken(I.INDENT,0)}DEDENT(){return this.getToken(I.DEDENT,0)}Export(){return this.getToken(I.Export,0)}typeElement_list(){return this.getTypedRuleContexts(hl)}typeElement(e){return this.getTypedRuleContext(hl,e)}get ruleIndex(){return I.RULE_typeStatement}accept(e){return e.visitTypeStatement?e.visitTypeStatement(this):e.visitChildren(this)}}class hl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeGather(){return this.getTypedRuleContext(Uo,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(I.NEWLINE,0)}Varip(){return this.getToken(I.Varip,0)}Assign(){return this.getToken(I.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return I.RULE_typeElement}accept(e){return e.visitTypeElement?e.visitTypeElement(this):e.visitChildren(this)}}class pl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ColonEquals(){return this.getToken(I.ColonEquals,0)}MultiplyAssign(){return this.getToken(I.MultiplyAssign,0)}DivideAssign(){return this.getToken(I.DivideAssign,0)}ModulusAssign(){return this.getToken(I.ModulusAssign,0)}PlusAssign(){return this.getToken(I.PlusAssign,0)}MinusAssign(){return this.getToken(I.MinusAssign,0)}get ruleIndex(){return I.RULE_assignmentOperator}accept(e){return e.visitAssignmentOperator?e.visitAssignmentOperator(this):e.visitChildren(this)}}class dl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Map(){return this.getToken(I.Map,0)}LessThan(){return this.getToken(I.LessThan,0)}Comma(){return this.getToken(I.Comma,0)}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}MoreThan(){return this.getToken(I.MoreThan,0)}get ruleIndex(){return I.RULE_typeMap}accept(e){return e.visitTypeMap?e.visitTypeMap(this):e.visitChildren(this)}}class Ap extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}typeArray(){return this.getTypedRuleContext(yl,0)}typeMap(){return this.getTypedRuleContext(dl,0)}get ruleIndex(){return I.RULE_typeSeries}accept(e){return e.visitTypeSeries?e.visitTypeSeries(this):e.visitChildren(this)}}class yl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(hi)}typeName(e){return this.getTypedRuleContext(hi,e)}LessThan(){return this.getToken(I.LessThan,0)}MoreThan(){return this.getToken(I.MoreThan,0)}OpenBracket(){return this.getToken(I.OpenBracket,0)}CloseBracket(){return this.getToken(I.CloseBracket,0)}get ruleIndex(){return I.RULE_typeArray}accept(e){return e.visitTypeArray?e.visitTypeArray(this):e.visitChildren(this)}}class Uo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName(){return this.getTypedRuleContext(hi,0)}typeArray(){return this.getTypedRuleContext(yl,0)}typeMap(){return this.getTypedRuleContext(dl,0)}typeSeries(){return this.getTypedRuleContext(Ap,0)}get ruleIndex(){return I.RULE_typeGather}accept(e){return e.visitTypeGather?e.visitTypeGather(this):e.visitChildren(this)}}class xn extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Identifier(){return this.getToken(I.Identifier,0)}Map(){return this.getToken(I.Map,0)}Type(){return this.getToken(I.Type,0)}get ruleIndex(){return I.RULE_identifier}accept(e){return e.visitIdentifier?e.visitIdentifier(this):e.visitChildren(this)}}class hi extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point(){return this.getToken(I.Point,0)}get ruleIndex(){return I.RULE_typeName}accept(e){return e.visitTypeName?e.visitTypeName(this):e.visitChildren(this)}}class au extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Point_list(){return this.getTokens(I.Point)}Point(e){return this.getToken(I.Point,e)}methodElement_list(){return this.getTypedRuleContexts(rs)}methodElement(e){return this.getTypedRuleContext(rs,e)}OpenParen(){return this.getToken(I.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(I.CloseParen,0)}get ruleIndex(){return I.RULE_name}accept(e){return e.visitName?e.visitName(this):e.visitChildren(this)}}class Em extends Xy{constructor(n){super(n);w(this,"tokens");w(this,"indents");w(this,"opened");this.tokens=[],this.indents=[],this.opened=0}reset(){this.tokens=[],this.indents=[],this.opened=0,super.reset()}emitToken(n){super.emitToken(n),this.tokens.push(n)}nextToken(){if(this._input.LA(1)===I.EOF&&this.indents.length){for(this.tokens=this.tokens.filter(function(o){return o.type!==I.EOF}),this.emitToken(this.commonToken(I.NEWLINE,`
11
+ `));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(I.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(I.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const u=this.getCharIndex()-1,h=o.length?u-o.length+1:u;return new Gy([this,this._input],n,0,h,u)}getIndentationCount(n){let o=0;for(let u=0;u<n.length;u++)n[u]===" "?o+=4-o%4:o++;return o}atStartOfInput(){return this.getCharIndex()===0}openBrace(){this.opened++}closeBrace(){this.opened--}onNewLine(){const n=this.text.replace(/[^\r\n]+/g,""),o=this.text.replace(/[\r\n]+/g,""),u=this._input.LA(1),h=this._input.LA(2),m=this.getIndentationCount(o);if(this.opened>0||h!=-1&&(u===13||u===10||u===47&&h===47||m%4))this.skip();else{this.emitToken(this.commonToken(I.NEWLINE,n));const _=this.indents.length?this.indents[this.indents.length-1]:0;if(m===_)this.skip();else if(m>_)this.indents.push(m),this.emitToken(this.commonToken(I.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>m;)this.emitToken(this.createDedent()),this.indents.pop()}}}const Re=class Re extends Em{constructor(e){super(e),this._interp=new qy(this,Re._ATN,Re.DecisionsToDFA,new op)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return Re.literalNames}get symbolicNames(){return Re.symbolicNames}get ruleNames(){return Re.ruleNames}get serializedATN(){return Re._serializedATN}get channelNames(){return Re.channelNames}get modeNames(){return Re.modeNames}action(e,n,o){switch(n){case 1:this.OpenBracket_action(e,o);break;case 2:this.CloseBracket_action(e,o);break;case 3:this.OpenParen_action(e,o);break;case 4:this.CloseParen_action(e,o);break;case 57:this.NEWLINE_action(e,o);break}}OpenBracket_action(e,n){switch(n){case 0:this.openBrace();break}}CloseBracket_action(e,n){switch(n){case 1:this.closeBrace();break}}OpenParen_action(e,n){switch(n){case 2:this.openBrace();break}}CloseParen_action(e,n){switch(n){case 3:this.closeBrace();break}}NEWLINE_action(e,n){switch(n){case 4:this.onNewLine();break}}sempred(e,n,o){switch(n){case 57:return this.NEWLINE_sempred(e,o)}return!0}NEWLINE_sempred(e,n){switch(n){case 0:return this.atStartOfInput()}return!0}static get _ATN(){return Re.__ATN||(Re.__ATN=new rp().deserialize(Re._serializedATN)),Re.__ATN}};w(Re,"INDENT",1),w(Re,"DEDENT",2),w(Re,"Point",3),w(Re,"OpenBracket",4),w(Re,"CloseBracket",5),w(Re,"OpenParen",6),w(Re,"CloseParen",7),w(Re,"Comma",8),w(Re,"Assign",9),w(Re,"QuestionMark",10),w(Re,"Colon",11),w(Re,"Plus",12),w(Re,"Minus",13),w(Re,"Multiply",14),w(Re,"Divide",15),w(Re,"Modulus",16),w(Re,"Hashtag",17),w(Re,"LessThan",18),w(Re,"MoreThan",19),w(Re,"LessThanEquals",20),w(Re,"GreaterThanEquals",21),w(Re,"Equals_",22),w(Re,"NotEquals",23),w(Re,"MultiplyAssign",24),w(Re,"DivideAssign",25),w(Re,"ModulusAssign",26),w(Re,"PlusAssign",27),w(Re,"MinusAssign",28),w(Re,"ARROW",29),w(Re,"ColonEquals",30),w(Re,"BooleanLiteral",31),w(Re,"IntegerLiteral",32),w(Re,"DecimalLiteral",33),w(Re,"Break",34),w(Re,"And",35),w(Re,"Export",36),w(Re,"For",37),w(Re,"Var",38),w(Re,"Continue",39),w(Re,"Varip",40),w(Re,"Switch",41),w(Re,"While",42),w(Re,"If",43),w(Re,"In",44),w(Re,"Or",45),w(Re,"Not",46),w(Re,"Method",47),w(Re,"Else",48),w(Re,"To",49),w(Re,"By",50),w(Re,"Type",51),w(Re,"Import",52),w(Re,"As",53),w(Re,"Map",54),w(Re,"ColorLiteral",55),w(Re,"StringLiteral",56),w(Re,"Identifier",57),w(Re,"HIDDEN_",58),w(Re,"SKIP_",59),w(Re,"NEWLINE",60),w(Re,"EOF",ap.EOF),w(Re,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),w(Re,"literalNames",[null,null,null,"'.'","'['","']'","'('","')'","','","'='","'?'","':'","'+'","'-'","'*'","'/'","'%'","'#'","'<'","'>'","'<='","'>='","'=='","'!='","'*='","'/='","'%='","'+='","'-='","'=>'","':='",null,null,null,"'break'","'and'","'export'","'for'","'var'","'continue'","'varip'","'switch'","'while'","'if'","'in'","'or'","'not'","'method'","'else'","'to'","'by'","'type'","'import'","'as'","'map'"]),w(Re,"symbolicNames",[null,"INDENT","DEDENT","Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE"]),w(Re,"modeNames",["DEFAULT_MODE"]),w(Re,"ruleNames",["Point","OpenBracket","CloseBracket","OpenParen","CloseParen","Comma","Assign","QuestionMark","Colon","Plus","Minus","Multiply","Divide","Modulus","Hashtag","LessThan","MoreThan","LessThanEquals","GreaterThanEquals","Equals_","NotEquals","MultiplyAssign","DivideAssign","ModulusAssign","PlusAssign","MinusAssign","ARROW","ColonEquals","BooleanLiteral","IntegerLiteral","DecimalLiteral","Break","And","Export","For","Var","Continue","Varip","Switch","While","If","In","Or","Not","Method","Else","To","By","Type","Import","As","Map","ColorLiteral","StringLiteral","Identifier","HIDDEN_","SKIP_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),w(Re,"_serializedATN",[4,0,60,440,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,1,0,1,0,1,1,1,1,1,1,1,2,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,212,8,28,1,29,1,29,1,30,1,30,1,30,3,30,219,8,30,1,30,1,30,1,30,1,30,3,30,225,8,30,3,30,227,8,30,1,30,3,30,230,8,30,3,30,232,8,30,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,45,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,48,1,48,1,49,1,49,1,49,1,49,1,49,1,49,1,49,1,50,1,50,1,50,1,51,1,51,1,51,1,51,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,1,52,3,52,355,8,52,1,53,1,53,1,54,1,54,5,54,361,8,54,10,54,12,54,364,9,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,1,57,1,57,1,57,3,57,377,8,57,1,57,1,57,3,57,381,8,57,1,57,3,57,384,8,57,3,57,386,8,57,1,57,1,57,1,58,1,58,1,58,1,58,5,58,394,8,58,10,58,12,58,397,9,58,1,58,1,58,1,58,1,58,1,58,5,58,404,8,58,10,58,12,58,407,9,58,1,58,3,58,410,8,58,1,59,1,59,1,60,4,60,415,8,60,11,60,12,60,416,1,61,1,61,1,62,4,62,422,8,62,11,62,12,62,423,1,63,1,63,1,63,1,63,5,63,430,8,63,10,63,12,63,433,9,63,1,64,1,64,3,64,437,8,64,1,64,1,64,0,0,65,1,3,3,4,5,5,7,6,9,7,11,8,13,9,15,10,17,11,19,12,21,13,23,14,25,15,27,16,29,17,31,18,33,19,35,20,37,21,39,22,41,23,43,24,45,25,47,26,49,27,51,28,53,29,55,30,57,31,59,32,61,33,63,34,65,35,67,36,69,37,71,38,73,39,75,40,77,41,79,42,81,43,83,44,85,45,87,46,89,47,91,48,93,49,95,50,97,51,99,52,101,53,103,54,105,55,107,56,109,57,111,58,113,59,115,60,117,0,119,0,121,0,123,0,125,0,127,0,129,0,1,0,10,3,0,65,90,95,95,97,122,4,0,48,57,65,90,95,95,97,122,1,0,39,39,1,0,34,34,1,0,48,57,3,0,48,57,65,70,97,102,2,0,9,9,32,32,2,0,10,10,12,13,2,0,69,69,101,101,2,0,43,43,45,45,453,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,1,131,1,0,0,0,3,133,1,0,0,0,5,136,1,0,0,0,7,139,1,0,0,0,9,142,1,0,0,0,11,145,1,0,0,0,13,147,1,0,0,0,15,149,1,0,0,0,17,151,1,0,0,0,19,153,1,0,0,0,21,155,1,0,0,0,23,157,1,0,0,0,25,159,1,0,0,0,27,161,1,0,0,0,29,163,1,0,0,0,31,165,1,0,0,0,33,167,1,0,0,0,35,169,1,0,0,0,37,172,1,0,0,0,39,175,1,0,0,0,41,178,1,0,0,0,43,181,1,0,0,0,45,184,1,0,0,0,47,187,1,0,0,0,49,190,1,0,0,0,51,193,1,0,0,0,53,196,1,0,0,0,55,199,1,0,0,0,57,211,1,0,0,0,59,213,1,0,0,0,61,231,1,0,0,0,63,233,1,0,0,0,65,239,1,0,0,0,67,243,1,0,0,0,69,250,1,0,0,0,71,254,1,0,0,0,73,258,1,0,0,0,75,267,1,0,0,0,77,273,1,0,0,0,79,280,1,0,0,0,81,286,1,0,0,0,83,289,1,0,0,0,85,292,1,0,0,0,87,295,1,0,0,0,89,299,1,0,0,0,91,306,1,0,0,0,93,311,1,0,0,0,95,314,1,0,0,0,97,317,1,0,0,0,99,322,1,0,0,0,101,329,1,0,0,0,103,332,1,0,0,0,105,354,1,0,0,0,107,356,1,0,0,0,109,358,1,0,0,0,111,365,1,0,0,0,113,369,1,0,0,0,115,385,1,0,0,0,117,409,1,0,0,0,119,411,1,0,0,0,121,414,1,0,0,0,123,418,1,0,0,0,125,421,1,0,0,0,127,425,1,0,0,0,129,434,1,0,0,0,131,132,5,46,0,0,132,2,1,0,0,0,133,134,5,91,0,0,134,135,6,1,0,0,135,4,1,0,0,0,136,137,5,93,0,0,137,138,6,2,1,0,138,6,1,0,0,0,139,140,5,40,0,0,140,141,6,3,2,0,141,8,1,0,0,0,142,143,5,41,0,0,143,144,6,4,3,0,144,10,1,0,0,0,145,146,5,44,0,0,146,12,1,0,0,0,147,148,5,61,0,0,148,14,1,0,0,0,149,150,5,63,0,0,150,16,1,0,0,0,151,152,5,58,0,0,152,18,1,0,0,0,153,154,5,43,0,0,154,20,1,0,0,0,155,156,5,45,0,0,156,22,1,0,0,0,157,158,5,42,0,0,158,24,1,0,0,0,159,160,5,47,0,0,160,26,1,0,0,0,161,162,5,37,0,0,162,28,1,0,0,0,163,164,5,35,0,0,164,30,1,0,0,0,165,166,5,60,0,0,166,32,1,0,0,0,167,168,5,62,0,0,168,34,1,0,0,0,169,170,5,60,0,0,170,171,5,61,0,0,171,36,1,0,0,0,172,173,5,62,0,0,173,174,5,61,0,0,174,38,1,0,0,0,175,176,5,61,0,0,176,177,5,61,0,0,177,40,1,0,0,0,178,179,5,33,0,0,179,180,5,61,0,0,180,42,1,0,0,0,181,182,5,42,0,0,182,183,5,61,0,0,183,44,1,0,0,0,184,185,5,47,0,0,185,186,5,61,0,0,186,46,1,0,0,0,187,188,5,37,0,0,188,189,5,61,0,0,189,48,1,0,0,0,190,191,5,43,0,0,191,192,5,61,0,0,192,50,1,0,0,0,193,194,5,45,0,0,194,195,5,61,0,0,195,52,1,0,0,0,196,197,5,61,0,0,197,198,5,62,0,0,198,54,1,0,0,0,199,200,5,58,0,0,200,201,5,61,0,0,201,56,1,0,0,0,202,203,5,116,0,0,203,204,5,114,0,0,204,205,5,117,0,0,205,212,5,101,0,0,206,207,5,102,0,0,207,208,5,97,0,0,208,209,5,108,0,0,209,210,5,115,0,0,210,212,5,101,0,0,211,202,1,0,0,0,211,206,1,0,0,0,212,58,1,0,0,0,213,214,3,121,60,0,214,60,1,0,0,0,215,216,5,46,0,0,216,218,3,121,60,0,217,219,3,129,64,0,218,217,1,0,0,0,218,219,1,0,0,0,219,232,1,0,0,0,220,229,3,121,60,0,221,226,5,46,0,0,222,224,3,121,60,0,223,225,3,129,64,0,224,223,1,0,0,0,224,225,1,0,0,0,225,227,1,0,0,0,226,222,1,0,0,0,226,227,1,0,0,0,227,230,1,0,0,0,228,230,3,129,64,0,229,221,1,0,0,0,229,228,1,0,0,0,230,232,1,0,0,0,231,215,1,0,0,0,231,220,1,0,0,0,232,62,1,0,0,0,233,234,5,98,0,0,234,235,5,114,0,0,235,236,5,101,0,0,236,237,5,97,0,0,237,238,5,107,0,0,238,64,1,0,0,0,239,240,5,97,0,0,240,241,5,110,0,0,241,242,5,100,0,0,242,66,1,0,0,0,243,244,5,101,0,0,244,245,5,120,0,0,245,246,5,112,0,0,246,247,5,111,0,0,247,248,5,114,0,0,248,249,5,116,0,0,249,68,1,0,0,0,250,251,5,102,0,0,251,252,5,111,0,0,252,253,5,114,0,0,253,70,1,0,0,0,254,255,5,118,0,0,255,256,5,97,0,0,256,257,5,114,0,0,257,72,1,0,0,0,258,259,5,99,0,0,259,260,5,111,0,0,260,261,5,110,0,0,261,262,5,116,0,0,262,263,5,105,0,0,263,264,5,110,0,0,264,265,5,117,0,0,265,266,5,101,0,0,266,74,1,0,0,0,267,268,5,118,0,0,268,269,5,97,0,0,269,270,5,114,0,0,270,271,5,105,0,0,271,272,5,112,0,0,272,76,1,0,0,0,273,274,5,115,0,0,274,275,5,119,0,0,275,276,5,105,0,0,276,277,5,116,0,0,277,278,5,99,0,0,278,279,5,104,0,0,279,78,1,0,0,0,280,281,5,119,0,0,281,282,5,104,0,0,282,283,5,105,0,0,283,284,5,108,0,0,284,285,5,101,0,0,285,80,1,0,0,0,286,287,5,105,0,0,287,288,5,102,0,0,288,82,1,0,0,0,289,290,5,105,0,0,290,291,5,110,0,0,291,84,1,0,0,0,292,293,5,111,0,0,293,294,5,114,0,0,294,86,1,0,0,0,295,296,5,110,0,0,296,297,5,111,0,0,297,298,5,116,0,0,298,88,1,0,0,0,299,300,5,109,0,0,300,301,5,101,0,0,301,302,5,116,0,0,302,303,5,104,0,0,303,304,5,111,0,0,304,305,5,100,0,0,305,90,1,0,0,0,306,307,5,101,0,0,307,308,5,108,0,0,308,309,5,115,0,0,309,310,5,101,0,0,310,92,1,0,0,0,311,312,5,116,0,0,312,313,5,111,0,0,313,94,1,0,0,0,314,315,5,98,0,0,315,316,5,121,0,0,316,96,1,0,0,0,317,318,5,116,0,0,318,319,5,121,0,0,319,320,5,112,0,0,320,321,5,101,0,0,321,98,1,0,0,0,322,323,5,105,0,0,323,324,5,109,0,0,324,325,5,112,0,0,325,326,5,111,0,0,326,327,5,114,0,0,327,328,5,116,0,0,328,100,1,0,0,0,329,330,5,97,0,0,330,331,5,115,0,0,331,102,1,0,0,0,332,333,5,109,0,0,333,334,5,97,0,0,334,335,5,112,0,0,335,104,1,0,0,0,336,337,5,35,0,0,337,338,3,123,61,0,338,339,3,123,61,0,339,340,3,123,61,0,340,341,3,123,61,0,341,342,3,123,61,0,342,343,3,123,61,0,343,355,1,0,0,0,344,345,5,35,0,0,345,346,3,123,61,0,346,347,3,123,61,0,347,348,3,123,61,0,348,349,3,123,61,0,349,350,3,123,61,0,350,351,3,123,61,0,351,352,3,123,61,0,352,353,3,123,61,0,353,355,1,0,0,0,354,336,1,0,0,0,354,344,1,0,0,0,355,106,1,0,0,0,356,357,3,117,58,0,357,108,1,0,0,0,358,362,7,0,0,0,359,361,7,1,0,0,360,359,1,0,0,0,361,364,1,0,0,0,362,360,1,0,0,0,362,363,1,0,0,0,363,110,1,0,0,0,364,362,1,0,0,0,365,366,3,125,62,0,366,367,1,0,0,0,367,368,6,55,4,0,368,112,1,0,0,0,369,370,3,127,63,0,370,371,1,0,0,0,371,372,6,56,5,0,372,114,1,0,0,0,373,374,4,57,0,0,374,386,3,125,62,0,375,377,5,13,0,0,376,375,1,0,0,0,376,377,1,0,0,0,377,378,1,0,0,0,378,381,5,10,0,0,379,381,2,12,13,0,380,376,1,0,0,0,380,379,1,0,0,0,381,383,1,0,0,0,382,384,3,125,62,0,383,382,1,0,0,0,383,384,1,0,0,0,384,386,1,0,0,0,385,373,1,0,0,0,385,380,1,0,0,0,386,387,1,0,0,0,387,388,6,57,6,0,388,116,1,0,0,0,389,395,5,39,0,0,390,394,8,2,0,0,391,392,5,92,0,0,392,394,5,39,0,0,393,390,1,0,0,0,393,391,1,0,0,0,394,397,1,0,0,0,395,393,1,0,0,0,395,396,1,0,0,0,396,398,1,0,0,0,397,395,1,0,0,0,398,410,5,39,0,0,399,405,5,34,0,0,400,404,8,3,0,0,401,402,5,92,0,0,402,404,5,34,0,0,403,400,1,0,0,0,403,401,1,0,0,0,404,407,1,0,0,0,405,403,1,0,0,0,405,406,1,0,0,0,406,408,1,0,0,0,407,405,1,0,0,0,408,410,5,34,0,0,409,389,1,0,0,0,409,399,1,0,0,0,410,118,1,0,0,0,411,412,7,4,0,0,412,120,1,0,0,0,413,415,3,119,59,0,414,413,1,0,0,0,415,416,1,0,0,0,416,414,1,0,0,0,416,417,1,0,0,0,417,122,1,0,0,0,418,419,7,5,0,0,419,124,1,0,0,0,420,422,7,6,0,0,421,420,1,0,0,0,422,423,1,0,0,0,423,421,1,0,0,0,423,424,1,0,0,0,424,126,1,0,0,0,425,426,5,47,0,0,426,427,5,47,0,0,427,431,1,0,0,0,428,430,8,7,0,0,429,428,1,0,0,0,430,433,1,0,0,0,431,429,1,0,0,0,431,432,1,0,0,0,432,128,1,0,0,0,433,431,1,0,0,0,434,436,7,8,0,0,435,437,7,9,0,0,436,435,1,0,0,0,436,437,1,0,0,0,437,438,1,0,0,0,438,439,3,121,60,0,439,130,1,0,0,0,22,0,211,218,224,226,229,231,354,362,376,380,383,385,393,395,403,405,409,416,423,431,436,7,1,1,0,1,2,1,1,3,2,1,4,3,0,1,0,6,0,0,1,57,4]),w(Re,"__ATN"),w(Re,"DecisionsToDFA",Re._ATN.decisionToState.map((e,n)=>new ip(e,n)));let ml=Re;var W=(t=>(t.BOOL="bool",t.INT="int",t.FLOAT="float",t.ARRAY="array",t.BOX="box",t.CHART_POINT="chart.point",t.COLOR="color",t.CONST="const",t.LABEL="label",t.LINE="line",t.LINEFILL="linefill",t.MAP="map",t.MATRIX="matrix",t.POLYLINE="polyline",t.SERIES="series",t.SIMPLE="simple",t.STRING="string",t.TABLE="table",t.UNDETERMINED="undetermined type",t.INPUT="input",t.NA="na",t.VOID="void",t))(W||{}),Oe=(t=>(t.FlowStmt="FlowStmt",t.DeclareAssign="DeclareAssign",t.VarBlockStmt="VarBlockStmt",t.VarSingle="VarSingle",t.VarMultiple="VarMultiple",t.ParenthesizedExpression="ParenthesizedExpression",t.AdditiveExpression="AdditiveExpression",t.RelationalExpression="RelationalExpression",t.EqualityExpression="EqualityExpression",t.TernaryExpression="TernaryExpression",t.UnaryExpression="UnaryExpression",t.NotExpression="NotExpression",t.MemberIndexExpression="MemberIndexExpression",t.MethodExpression="MethodExpression",t.LogicalAndExpression="LogicalAndExpression",t.LogicalOrExpression="LogicalOrExpression",t.MultiplicativeExpression="MultiplicativeExpression",t.Brackethesized="Brackethesized",t.IfStatement="IfStatement",t.ForToStatement="ForToStatement",t.ForInStatement="ForInStatement",t.SwitchStatement="SwitchStatement",t.CaseClause="CaseClause",t.DefaultCaluse="DefaultCaluse",t.WhileStatement="WhileStatement",t.ImportElement="ImportElement",t.Literal="Literal",t.ArrowFunction="ArrowFunction",t.ArrowMethod="ArrowMethod",t.TypeStatement="TypeStatement",t.Name="Name",t.AgainAssign="AgainAssign",t))(Oe||{});const Pe={onlyInLoop:"'$text' is only allowed inside loops",invalidType:"Invalid argument 'expr$index' in 'operator SQBR' call",typeUseError:"Cannot specify a type form '$text' without also specifying the type.",notTypeKeyword:"'$text' is not a valid type keyword in variable declaration",undeclared:"Undeclared identifier '$name'",repeatVar:"'$name' is already defined",typeMismatch:"Cannot call '$operator' with argument '$index'. An argument of '$typeE' type was used but a '$typeR' is expected.",assignTypeMismatch:"Cannot assign a value of the `$typeE` type to the '$name' variable. The variable is declared with the `$typeR` type.",voidNotVar:"Void expression cannot be assigned to a variable",declareTypeErr:"Declared type '$type' is not compatible with assigned type '$valueType'",mapKeyValErr:"Cannot put <$typeA, $typeB> pairs into a map containing `$typeC` keys and `$typeD` values. The maps passed into the `$name()` function must have the same key types and value types.",inputSourceErr:"Invalid value for the '$name' parameter of the '$funcName' function. Possible values: [open, high, low, close, hl2, hlc3, ohlc4, hlcc4, volume].",buildInUseErr:"Cannot use '$name' as the default value of a type's field. The default value cannot be a function, variable or calculation.",argsLenErr:"Too many arguments passed into the `$name()` function call. Passed $lenA arguments but expected $lenB.",requiredParamErr:"No value assigned to the `$argName` parameter in $name()",argsSyntaxErr:"Syntax error after the argument for `$argName`. Arguments without their parameter name cannot be used after arguments with parameter names.",requestArgsErr:"Type $type cannot be used in $name '$argName' argument",mapKeyErr:"Incorrect `key` type `$type` in the variable. The `key` type must be one of the following: int, float, string, bool, color.",templateErr:"Incorrect number of arguments for the template: $countA expected, $countB passed.",templateNoSupportErr:"The '$name()' function does not support templates",ifOrSwitchTypeErr:"Return type of one of the '$keyword' blocks is not compatible with return type of other block(s) ($types)",argsNameErr:"The '$name' function does not have an argument with the name '$argName'",noFiledErr:"Object has no field $name",methodNotExistErr:"Could not find method or method reference '$methodName' for '$name'",tupleVarErr:"Syntax error: The quantities of tuple elements on each side of the assignment operator do not match. The right side has $indexA but the left side has $indexB.",tupleLeftVarErr:"Invalid assignment. Cannot assign a tuple to a variable '$name'.",tupleRightVarErr:"Cannot assign a variable to a tuple. The right side must be a function call or structure ('if', 'switch', 'for', 'while') returning a tuple with the same number of elements.",tempateTypeErr:"Syntax error: Only templates for arrays and matrices consist of a single type identifier enclosed in angle brackets.",qualifierErr:"'$name' is not a valid type qualifier. Possible values: 'const', 'simple', 'series'",notFindFuncErr:"Could not find function or function reference '$name'",naVarErr:"Value with NA type cannot be assigned to a variable that was defined without type keyword",notHistoryErr:"Variable '$name' doesn't have history values",defaultValueErr:"The default value cannot be a function, variable or calculation.",defaultValueTypeErr:"Default value of type $typeE can not be assigned to an argument of type $typeR",unaryErr:"Syntax error at input '$sign'",funcArgAssignErr:"Function arguments cannot be mutable ('$name')",declaredErr:"A variable declared with the '$prefix' keyword cannot accept values of the '$type' form. Assign a '$prefix' value to this variable or remove the '$prefix' keyword from its declaration.",globalFuncErr:"Cannot use '$name' in local scope",onlyStatementErr:"Scripts must contain one declaration statement: `indicator()`, `strategy()` or `library()`, Your script has $count.",modifyGlobalVarErr:"Cannot modify global variable '$name' in function",inputDefvalErr:"Arguments of input function must be of constant type, or 'source' builtin variables.",objectIsNaErr:"Cannot access the '$name' $type of an undefined object. The object is 'na'.",buidinAssignErr:"Cannot assign a new value to the built-in variable '$name'.",buidinVarErr:"Cannot shadow the built-in variable `$name` because it has already been used as a built-in."},Ri={repeatVar:"Shadowing variable '$name' which exists in parent scope. Did you want to use the ':=' operator instead of '=' ?",typeMismatch:"The `$index` parameter of the `$operator` function accepts a '$type' argument. To avoid potential unexpected results, pass a '$type' value or expression to this parameter.",moreSameArg:"More than one '$arg' arguments are supplied. Only the first one will be used.",localScopeGetHistory:"The variable '$name' is declared in local scope, which may not be executed at every update. So, obtaining its historical values may lead to unexpected results",localScopeWarning:"The function '$name' should be called on each calculation for consistency. It is recommended to extract the call from this scope"},wi=[W.SERIES,W.SIMPLE,W.INPUT,W.CONST],Sm=[W.INT,W.FLOAT,W.BOOL,W.COLOR,W.STRING],_l=["indicator","strategy","library"],Tm=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","indicator","alertcondition","barcolor","bgcolor","fill","library","strategy","strategy.risk.max_drawdown","strategy.risk.allow_entry_in","strategy.risk.max_cons_loss_days","max_intraday_filled_orders","strategy.risk.max_intraday_loss","strategy.risk.max_position_size"],Am=["strategy","input","table","color","line","linefill","label","box"],xp=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"];var Op=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xm={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Op,function(){var n=1e3,o=6e4,u=36e5,h="millisecond",m="second",_="minute",T="hour",x="day",P="week",A="month",F="quarter",$="year",V="date",b="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,D={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ye){var te=["th","st","nd","rd"],he=ye%100;return"["+ye+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(ye,te,he){var le=String(ye);return!le||le.length>=te?ye:""+Array(te+1-le.length).join(he)+ye},O={s:R,z:function(ye){var te=-ye.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),Ae=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(Ae,2,"0")},m:function ye(te,he){if(te.date()<he.date())return-ye(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),Ae=te.clone().add(le,A),Ne=he-Ae<0,_e=te.clone().add(le+(Ne?-1:1),A);return+(-(le+(he-Ae)/(Ne?Ae-_e:_e-Ae))||0)},a:function(ye){return ye<0?Math.ceil(ye)||0:Math.floor(ye)},p:function(ye){return{M:A,y:$,w:P,d:x,D:V,h:T,m:_,s:m,ms:h,Q:F}[ye]||String(ye||"").toLowerCase().replace(/s$/,"")},u:function(ye){return ye===void 0}},U="en",X={};X[U]=D;var ue="$isDayjsObject",K=function(ye){return ye instanceof Q||!(!ye||!ye[ue])},Y=function ye(te,he,le){var Ae;if(!te)return U;if(typeof te=="string"){var Ne=te.toLowerCase();X[Ne]&&(Ae=Ne),he&&(X[Ne]=he,Ae=Ne);var _e=te.split("-");if(!Ae&&_e.length>1)return ye(_e[0])}else{var Ue=te.name;X[Ue]=te,Ae=Ue}return!le&&Ae&&(U=Ae),Ae||!le&&U},G=function(ye,te){if(K(ye))return ye.clone();var he=typeof te=="object"?te:{};return he.date=ye,he.args=arguments,new Q(he)},ce=O;ce.l=Y,ce.i=K,ce.w=function(ye,te){return G(ye,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function ye(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[ue]=!0}var te=ye.prototype;return te.parse=function(he){this.$d=function(le){var Ae=le.date,Ne=le.utc;if(Ae===null)return new Date(NaN);if(ce.u(Ae))return new Date;if(Ae instanceof Date)return new Date(Ae);if(typeof Ae=="string"&&!/Z$/i.test(Ae)){var _e=Ae.match(y);if(_e){var Ue=_e[2]-1||0,J=(_e[7]||"0").substring(0,3);return Ne?new Date(Date.UTC(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)):new Date(_e[1],Ue,_e[3]||1,_e[4]||0,_e[5]||0,_e[6]||0,J)}}return new Date(Ae)}(he),this.init()},te.init=function(){var he=this.$d;this.$y=he.getFullYear(),this.$M=he.getMonth(),this.$D=he.getDate(),this.$W=he.getDay(),this.$H=he.getHours(),this.$m=he.getMinutes(),this.$s=he.getSeconds(),this.$ms=he.getMilliseconds()},te.$utils=function(){return ce},te.isValid=function(){return this.$d.toString()!==b},te.isSame=function(he,le){var Ae=G(he);return this.startOf(le)<=Ae&&Ae<=this.endOf(le)},te.isAfter=function(he,le){return G(he)<this.startOf(le)},te.isBefore=function(he,le){return this.endOf(le)<G(he)},te.$g=function(he,le,Ae){return ce.u(he)?this[le]:this.set(Ae,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var Ae=this,Ne=!!ce.u(le)||le,_e=ce.p(he),Ue=function(Et,Lt){var gt=ce.w(Ae.$u?Date.UTC(Ae.$y,Lt,Et):new Date(Ae.$y,Lt,Et),Ae);return Ne?gt:gt.endOf(x)},J=function(Et,Lt){return ce.w(Ae.toDate()[Et].apply(Ae.toDate("s"),(Ne?[0,0,0,0]:[23,59,59,999]).slice(Lt)),Ae)},ne=this.$W,ae=this.$M,Ee=this.$D,me="set"+(this.$u?"UTC":"");switch(_e){case $:return Ne?Ue(1,0):Ue(31,11);case A:return Ne?Ue(1,ae):Ue(0,ae+1);case P:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ne?Ee-jt:Ee+(6-jt),ae);case x:case V:return J(me+"Hours",0);case T:return J(me+"Minutes",1);case _:return J(me+"Seconds",2);case m:return J(me+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var Ae,Ne=ce.p(he),_e="set"+(this.$u?"UTC":""),Ue=(Ae={},Ae[x]=_e+"Date",Ae[V]=_e+"Date",Ae[A]=_e+"Month",Ae[$]=_e+"FullYear",Ae[T]=_e+"Hours",Ae[_]=_e+"Minutes",Ae[m]=_e+"Seconds",Ae[h]=_e+"Milliseconds",Ae)[Ne],J=Ne===x?this.$D+(le-this.$W):le;if(Ne===A||Ne===$){var ne=this.clone().set(V,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(V,Math.min(this.$D,ne.daysInMonth())).$d}else Ue&&this.$d[Ue](J);return this.init(),this},te.set=function(he,le){return this.clone().$set(he,le)},te.get=function(he){return this[ce.p(he)]()},te.add=function(he,le){var Ae,Ne=this;he=Number(he);var _e=ce.p(le),Ue=function(ae){var Ee=G(Ne);return ce.w(Ee.date(Ee.date()+Math.round(ae*he)),Ne)};if(_e===A)return this.set(A,this.$M+he);if(_e===$)return this.set($,this.$y+he);if(_e===x)return Ue(1);if(_e===P)return Ue(7);var J=(Ae={},Ae[_]=o,Ae[T]=u,Ae[m]=n,Ae)[_e]||1,ne=this.$d.getTime()+he*J;return ce.w(ne,this)},te.subtract=function(he,le){return this.add(-1*he,le)},te.format=function(he){var le=this,Ae=this.$locale();if(!this.isValid())return Ae.invalidDate||b;var Ne=he||"YYYY-MM-DDTHH:mm:ssZ",_e=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,ae=Ae.weekdays,Ee=Ae.months,me=Ae.meridiem,At=function(Lt,gt,Dt,Jt){return Lt&&(Lt[gt]||Lt(le,Ne))||Dt[gt].slice(0,Jt)},jt=function(Lt){return ce.s(Ue%12||12,Lt,"0")},Et=me||function(Lt,gt,Dt){var Jt=Lt<12?"AM":"PM";return Dt?Jt.toLowerCase():Jt};return Ne.replace(g,function(Lt,gt){return gt||function(Dt){switch(Dt){case"YY":return String(le.$y).slice(-2);case"YYYY":return ce.s(le.$y,4,"0");case"M":return ne+1;case"MM":return ce.s(ne+1,2,"0");case"MMM":return At(Ae.monthsShort,ne,Ee,3);case"MMMM":return At(Ee,ne);case"D":return le.$D;case"DD":return ce.s(le.$D,2,"0");case"d":return String(le.$W);case"dd":return At(Ae.weekdaysMin,le.$W,ae,2);case"ddd":return At(Ae.weekdaysShort,le.$W,ae,3);case"dddd":return ae[le.$W];case"H":return String(Ue);case"HH":return ce.s(Ue,2,"0");case"h":return jt(1);case"hh":return jt(2);case"a":return Et(Ue,J,!0);case"A":return Et(Ue,J,!1);case"m":return String(J);case"mm":return ce.s(J,2,"0");case"s":return String(le.$s);case"ss":return ce.s(le.$s,2,"0");case"SSS":return ce.s(le.$ms,3,"0");case"Z":return _e}return null}(Lt)||_e.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,Ae){var Ne,_e=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,ae=this-J,Ee=function(){return ce.m(_e,J)};switch(Ue){case $:Ne=Ee()/12;break;case A:Ne=Ee();break;case F:Ne=Ee()/3;break;case P:Ne=(ae-ne)/6048e5;break;case x:Ne=(ae-ne)/864e5;break;case T:Ne=ae/u;break;case _:Ne=ae/o;break;case m:Ne=ae/n;break;default:Ne=ae}return Ae?Ne:ce.a(Ne)},te.daysInMonth=function(){return this.endOf(A).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var Ae=this.clone(),Ne=Y(he,le,!0);return Ne&&(Ae.$L=Ne),Ae},te.clone=function(){return ce.w(this.$d,this)},te.toDate=function(){return new Date(this.valueOf())},te.toJSON=function(){return this.isValid()?this.toISOString():null},te.toISOString=function(){return this.$d.toISOString()},te.toString=function(){return this.$d.toUTCString()},ye}(),de=Q.prototype;return G.prototype=de,[["$ms",h],["$s",m],["$m",_],["$H",T],["$W",x],["$M",A],["$y",$],["$D",V]].forEach(function(ye){de[ye[1]]=function(te){return this.$g(te,ye[0],ye[1])}}),G.extend=function(ye,te){return ye.$i||(ye(te,Q,G),ye.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(ye){return G(1e3*ye)},G.en=X[U],G.Ls=X,G.p={},G})})(xm);function we(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class Om extends Yy{constructor(){super(...arguments);w(this,"visitProgram");w(this,"visitGlobalStmt");w(this,"visitBlockStmt");w(this,"visitStmt");w(this,"visitSimpleStmt");w(this,"visitFlowStmt");w(this,"visitBlock");w(this,"visitBlockLine");w(this,"visitVariableDeclarationStmt");w(this,"visitDeclareAssign");w(this,"visitAgainAssign");w(this,"visitVarModifier");w(this,"visitBlockSequence");w(this,"visitExpressionSequence");w(this,"visitExpressionBlockSequence");w(this,"visitVarBlockStmt");w(this,"visitVarSingle");w(this,"visitVarMultiple");w(this,"visitBlockExpression");w(this,"visitParenthesizedExpression");w(this,"visitAdditiveExpression");w(this,"visitRelationalExpression");w(this,"visitTernaryExpression");w(this,"visitLogicalAndExpression");w(this,"visitNameExpression");w(this,"visitLiteralExpression");w(this,"visitLogicalOrExpression");w(this,"visitUnaryExpression");w(this,"visitNotExpression");w(this,"visitMemberIndexExpression");w(this,"visitMethodExpression");w(this,"visitEqualityExpression");w(this,"visitMultiplicativeExpression");w(this,"visitBrackethesized");w(this,"visitArguments");w(this,"visitArgument");w(this,"visitIfStatement");w(this,"visitForToStatement");w(this,"visitForInStatement");w(this,"visitSwitchStatement");w(this,"visitCaseClause");w(this,"visitDefaultCaluse");w(this,"visitWhileStatement");w(this,"visitImportStmt");w(this,"visitImportElement");w(this,"visitLiteral");w(this,"visitMethodStmt");w(this,"visitMethodElement");w(this,"visitMethodName");w(this,"visitArrowFunction");w(this,"visitArrowFunctionParameters");w(this,"visitFormalParameterList");w(this,"visitFormalParameterArg");w(this,"visitArrowMethod");w(this,"visitArrowMethodParameters");w(this,"visitTypeStatement");w(this,"visitTypeElement");w(this,"visitAssignmentOperator");w(this,"visitTypeMap");w(this,"visitTypeSeries");w(this,"visitTypeArray");w(this,"visitTypeGather");w(this,"visitIdentifier");w(this,"visitTypeName");w(this,"visitName")}}class Dm extends Om{constructor(n){super();w(this,"_buildinVariables");w(this,"_buildinTypes");w(this,"_buildinConstants");w(this,"_buildinMethods");w(this,"_buildinFunctions");this._buildinVariables=new Map,this._buildinConstants=new Map,this._buildinFunctions=new Map,this._buildinTypes=new Map,this._buildinMethods=new Map,this._buildinHandle(n)}_buildinHandle(n){for(const o in n){const u=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=u;break;case"functions":this._buildinFunctions=u;break;case"methods":this._buildinMethods=u;break;case"types":this._buildinTypes=u;break;case"variables":this._buildinVariables=u;break}}}_typeHandle(n=[],o){if(!n.length)return W.UNDETERMINED;if(n=n.filter(m=>!m.endsWith(W.NA)),!n.length)return`${W.SIMPLE} ${W.NA}`;let u=100,h="";for(const m of n){if(m===W.UNDETERMINED)return W.UNDETERMINED;m.startsWith(W.SERIES)?u=0:m.startsWith(W.SIMPLE)&&u>0?u=1:m.startsWith(W.INPUT)&&u>1?u=2:m.startsWith(W.CONST)&&u>2&&(u=3);const _=this._removePrefix(m);(_!==W.INT||!h)&&(h=_)}return u===100?h:`${wi[u]} ${o||h}`}_returnTypesOtherHandle(n,o,u,h){if(!u.length||u[0].includes("<>")){const m=n.type;let _=m;if(!m||m===W.UNDETERMINED)return[W.UNDETERMINED];switch(o){case"series <type>":_=this._getArrayType(m),_||(_=this._removePrefix(m)),u=[this._typeAddSeries(_)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(m)){const T=this._getMapType(m)||[];h.includes("keys")?_=T[0]:_=T[1]}else _=this._getArrayType(m),_||(_=this._removePrefix(m));u=[this._typeReplace(o,_)];break;case"<matrix_type>":_=this._getArrayType(m),u=[this._typeAddSeries(_)];break;case"map<keyType, valueType>":u=[_];break;case"<value_type>":_=this._getMapType(m),u=[_[1]];break}}return u}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;o=this._removePrefix(o);const u=o.replace("int","float");return n.some(h=>h===o||u===h||h.endsWith(o))}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==W.INT;{const u=this._getPrefix(n),h=this._getPrefix(o);return u===h?!!n.endsWith(W.INT):!(wi.indexOf(u)<wi.indexOf(h))}}_compareType(n,o){if(n===W.UNDETERMINED||o===W.UNDETERMINED)return!0;const u=[W.FLOAT,W.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const h=this._getArrayType(n)||"",m=this._getArrayType(o)||"";return h===m||u.includes(h)&&u.includes(m)}else if(this._isMapType(n)){const h=this._getMapType(n)||[],m=this._getMapType(o)||[];return(h[0]===m[0]||u.includes(h[0])&&u.includes(m[0]))&&(h[1]===m[1]||u.includes(h[1])&&u.includes(m[1]))}else{const h=this._removePrefix(n),m=this._removePrefix(o);return h===W.NA||m===W.NA||h===m||u.includes(h)&&u.includes(m)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.SERIES} ${n}`:n}_typeAddConst(n){return this._buildinTypes.get(n)&&n!==W.CHART_POINT?`${W.CONST} ${n}`:n}_getOriginMethodName(n,o){let u="";return this._isArrayType(n)?u=`${W.ARRAY}.${o}`:this._isMatrixType(n)?u=`${W.MATRIX}.${o}`:this._isMapType(n)?u=`${W.MAP}.${o}`:u=`${this._removePrefix(n)}.${o}`,u}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(u=>u.trim()):n}_removePrefix(n=""){return n.replace(/(series|simple|const|input)\s+([\w\d.]+)/,"$2")}_getPrefix(n){if(!n)return"";const o=n.replace(/(series|simple|const|input).+/,"$1");return wi.includes(o)?o:""}_getArrayType(n){let o=/\w+<([\w\d.]+)>/.exec(n);return o||(o=/([\w\d.]+)\[\]/.exec(n)),o==null?void 0:o[1]}_getMapType(n){const o=/\w+<(\w+),\s*([\w\d.]+)>/.exec(n);return(o==null?void 0:o[1])&&(o==null?void 0:o[2])&&[o==null?void 0:o[1],o==null?void 0:o[2]]}_isMatrixType(n){return/^matrix<[\w\d.]+>$/.test(n)}_isArrayType(n){return/^array<[\w\d.]+>$/.test(n)||/^[\w\d.]+\[\]$/.test(n)}_isMapType(n){return/^map<\w+,\s*[\w\d.]+>$/.test(n)}_arrayTypeConvert(n){return!this._isArrayType(n)||!n.includes("<")?n:`${this._getArrayType(n)}[]`}_getMethodTypeName(n){return this._isArrayType(n)?W.ARRAY:this._isMapType(n)?W.MAP:this._isMatrixType(n)?W.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(W.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var Lr=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(Lr||{});class Cm extends Dm{constructor(n){super(n);w(this,"_loopCount");w(this,"_errors");w(this,"_variables");w(this,"_functions");w(this,"_methods");w(this,"_types");w(this,"_currentBlockVars");w(this,"_currentFuncParams");w(this,"_isNeedCalc");w(this,"_blockCount");w(this,"_isInFunc");w(this,"_onlyStatementsCount");w(this,"_blockRanges");w(this,"_overloadsFuncs");w(this,"_hasMemberIndex");w(this,"_isInLocalScop");w(this,"visitProgram",n=>{const{children:o}=n;let u=0;const h=[];for(this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_globalStmt&&h.push(this.visit(m))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:1,endLineNumber:1,message:we(Pe.onlyStatementErr,{count:this._onlyStatementsCount})}),h});w(this,"visitGlobalStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_methodStmt&&_l.includes(h.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),u)),h}return null});w(this,"visitBlockStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationStmt:h.push(...this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break}}return h});w(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitFlowStmt",n=>{const{children:o}=n,{column:u,line:h,text:m}=o[0].symbol;if(this._loopCount<=0){const _=u+1;this._errors.push({startColumn:_,endColumn:parseInt(_+m.length),startLineNumber:h,endLineNumber:h,message:we(Pe.onlyInLoop,{text:m})})}return{ruleType:Oe.FlowStmt,value:m}});w(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return u.ruleIndex===I.RULE_simpleStmt?this._inBlock(u):this.visit(u)}return null});w(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let u=0;const h=[];for(this._blockCount++,this._pushBlockRanges(n);u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_stmt&&h.push(this.visit(m))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),h});w(this,"visitDeclareAssign",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.DeclareAssign};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(m);break;case I.RULE_singleExpression:h.value=this.visit(m);break}}return this._variablesHandle(h,n),h});w(this,"visitAgainAssign",n=>{const{children:o}=n;if(o.length>=3){const u=this.visit(o[0]);this._verifyGloablVar(u,o[0]);const h=this.visit(o[2]),m=this.visit(o[1]);return u.type?this._againAssignHandle([u,h],[o[0],o[2]],m):null}return null});w(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});w(this,"visitExpressionSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_singleExpression){const _=this.visit(m);_&&(_.ctx=m,h.push(_))}}return h});w(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.push(this.visit(m));break;case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_blockExpression:h.push(this.visit(m));break;case I.RULE_varBlockStmt:h.push(this.visit(m));break}}return h});w(this,"visitBlockSequence",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_singleExpression:h.push(this.visit(m));break}}return h});w(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_variableDeclarationList:h.push(this.visit(m));break;case I.RULE_methodStmt:const _=this.visit(m);_l.includes(_.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1&&this._errorHandle(we(Pe.onlyStatementErr,{count:this._onlyStatementsCount}),m)),h.push(_);break}}return h});w(this,"visitVarBlockStmt",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.VarBlockStmt,ctx:n},m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_varArrayDeclaration:h.nameList=this.visit(_);break;case I.RULE_assignmentOperator:h.operator=this.visit(_);break;case I.RULE_name:m.push(_),h.name=this.visit(_);break;case I.RULE_blockExpression:this._isNeedCalc=!0,h.value=this.visit(_),m.push(_);const T=this._getBlockReturnTypes(h.value);T.length===1?h.value.type=T[0]:h.value.types=T,this._isNeedCalc=!1;break}}return h.name?this._againAssignHandle([h.name,h.value],m,h.operator):(this._variablesHandle(h,n),h)});w(this,"visitVarSingle",n=>{const{children:o}=n,u={ruleType:Oe.VarSingle};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h];switch(_.ruleIndex){case I.RULE_varModifier:u.declare=this.visit(_);break;case I.RULE_typeGather:const T=this.visit(_);u.prefix=this._getPrefix(T),u.type=T&&this._typeAddConst(T);break;case I.RULE_identifier:const x=this.visit(_);this._repeatVarJudge(x,_),m={lineNumber:_.start.line,column:_.start.column},u.name=x,u.pos=m;break}}return u});w(this,"visitVarMultiple",n=>{const{children:o}=n;let u=0;const h=[],m=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_identifier){const T=this.visit(_);this._repeatVarJudge(T,_),h.push(T),m.push({lineNumber:_.start.line,column:_.start.column})}}return{ruleType:Oe.VarMultiple,names:h,posList:m}});w(this,"visitBlockExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitParenthesizedExpression",n=>{const{children:o}=n,u=o[1],h=this.visit(u);return{ruleType:Oe.ParenthesizedExpression,type:h.type,ctx:n,exprs:h}});w(this,"visitAdditiveExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _={ruleType:Oe.AdditiveExpression,operator:h,ctx:n,exprs:m};if(["+","-"].includes(h)){const T=[W.UNDETERMINED,W.INT,W.FLOAT];h==="+"&&T.push(W.STRING);const x=this._sameTypeJudge(m,[o[0],o[2]],h,T);_.type=this._typeHandle(x)}else{const T=this._calcTypeJudge(m[0],o[0],h),x=this._calcTypeJudge(m[1],o[2],h,1);_.type=this._typeHandle([T,x])}return _});w(this,"visitRelationalExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.RelationalExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitEqualityExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression?m.push(this.visit(T)):h=T.symbol.text}const _=this._sameTypeJudge(m,[o[0],o[2]],h,[W.UNDETERMINED,W.COLOR,W.STRING,W.BOOL,W.INT,W.FLOAT]);return{ruleType:Oe.EqualityExpression,operator:h,ctx:n,type:this._typeHandle(_,W.BOOL),exprs:m}});w(this,"visitTernaryExpression",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_singleExpression){const T=this._isInLocalScop;u!==0&&(this._isInLocalScop=!0),h.push(this.visit(_)),this._isInLocalScop=T}}let m=W.UNDETERMINED;if(h.length>=3){this._boolTypeJudge(h[0],o[0],"?:");const _=this._sameTypeJudge(h.slice(1),[o[2],o[4]],"?:",[]),T=this._getPrefix(h[0].type);m=this._typeHandle(_),T&&this._getPrefix(m)&&(m=this._typeHandle([m,`${T} ${this._removePrefix(m)}`]))}return{ruleType:Oe.TernaryExpression,type:m,ctx:n,exprs:h}});w(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[u,h]=o,m=[this.visit(h)],_=u.symbol.text,T=this._calcTypeJudge(m[0],h,_);return((x=m[0])==null?void 0:x.ruleType)===Oe.UnaryExpression&&this._errors.push({message:we(Pe.unaryErr,{sign:_}),startColumn:u.symbol.column+1,startLineNumber:u.symbol.line,endColumn:u.symbol.column+2,endLineNumber:u.symbol.line}),{ruleType:Oe.UnaryExpression,operator:_,type:T,ctx:n,exprs:m}});w(this,"visitNotExpression",n=>{const{children:o}=n,u=o[1],h=[this.visit(u)],m=this._boolTypeJudge(h[0],u,"not");return{ruleType:Oe.NotExpression,ctx:n,type:this._typeHandle([m],W.BOOL),exprs:h}});w(this,"visitMemberIndexExpression",n=>{var m,_;const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_singleExpression&&h.push(this.visit(T))}if(this._memberIndexVerify(h[0],n),this._hasMemberIndex=!0,((m=h[0])==null?void 0:m.ruleType)===Oe.MemberIndexExpression){const T=o[1];this._errors.push({message:we(Pe.unaryErr,{sign:"["}),startColumn:T.symbol.column+1,startLineNumber:T.symbol.line,endColumn:T.symbol.column+2,endLineNumber:T.symbol.line}),this._hasMemberIndex=!1}return{ruleType:Oe.MemberIndexExpression,type:(_=h[0])==null?void 0:_.type,ctx:n,isInFunc:this._isInFunc,exprs:h}});w(this,"visitMethodStmt",n=>{const{children:o}=n;let u=0;const h=[],m=[];let _;for(;u<o.length;u++){const T=o[u];T.ruleIndex===I.RULE_methodElement&&(h.push(this.visit(T)),m.push(T))}return _=this._getMethodTypes(h,m)||[],{ruleType:Oe.MethodExpression,types:_.length>1||_.isBrackethesized||_.isUnknown?_:void 0,ctx:n,type:_.length===1?_[0]:void 0,exprs:h}});w(this,"visitMethodExpression",n=>{const{children:o}=n;if(o&&o.length){const u=o[0];return this.visit(u)}return null});w(this,"visitLogicalAndExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalAndExpression,type:this._typeHandle([_,T],W.BOOL),operator:h,ctx:n,exprs:m}});w(this,"visitLogicalOrExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._boolTypeJudge(m[0],o[0],h),T=this._boolTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.LogicalOrExpression,operator:h,ctx:n,type:this._typeHandle([_,T],W.BOOL),exprs:m}});w(this,"visitMultiplicativeExpression",n=>{const{children:o}=n;let u=0,h="";const m=[];for(;u<o.length;u++){const x=o[u];x.ruleIndex===I.RULE_singleExpression?m.push(this.visit(x)):h=x.symbol.text}const _=this._calcTypeJudge(m[0],o[0],h),T=this._calcTypeJudge(m[1],o[2],h,1);return{ruleType:Oe.MultiplicativeExpression,operator:h,ctx:n,type:this._typeHandle([_,T]),exprs:m}});w(this,"visitBrackethesized",n=>{const{children:o}=n,u=o[1];return{ruleType:Oe.Brackethesized,ctx:n,exprs:this.visit(u)}});w(this,"visitArguments",n=>{const{children:o}=n;let u=0;const h={params:[]};let m="";for(;u<o.length;u++){const _=o[u];if(_.ruleIndex===I.RULE_argument){const T=this.visit(_),x=T.paramKey;x?(m=x,h[x]?this._errorHandle(we(Ri.moreSameArg,{arg:x}),n.parentCtx,Lr.Warning):(h[x]=T.param,h[x].ctx=_)):m?this._errorHandle(we(Pe.argsSyntaxErr,{argName:m}),_):(T.ctx=_,h.params.push(T))}}return h});w(this,"visitArgument",n=>{const{children:o}=n;return o.length===1?this.visit(o[0]):{paramKey:this.visit(o[0]),param:this.visit(o[2])}});w(this,"visitIfStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.IfStatement,condition:[],block:[],ctx:n,typeList:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition.push(this.visit(m));break;case I.RULE_blockLine:const _=this._isInLocalScop;this._isInLocalScop=!0;const T=this.visit(m);h.typeList.push(this._getBlockReturnTypes(T)),h.block.push(T),this._isInLocalScop=_;break}}return h});w(this,"visitForToStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForToStatement,numerical:[],ctx:n,block:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_varModifier:h.declare=this.visit(m);break;case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m),this._repeatVarJudge(h.name,m);break;case I.RULE_singleExpression:h.numerical.push(this.visit(m));break;case I.RULE_blockLine:this._blockCount++,this._pushBlockRanges(n),h.name&&this._variablesHandle({nameList:{name:h.name,isForVar:!0,type:h.type},value:{type:h.type||`${W.SERIES} ${W.INT}`}},n),this._blockCount--,this._blockRanges.pop(),this._loopCount++;const T=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._loopCount--,this._isInLocalScop=T,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitForInStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ForInStatement,ctx:n,names:[]};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_identifier:const _=this.visit(m);this._repeatVarJudge(_,m),h.names.push(_);break;case I.RULE_singleExpression:h.array=this.visit(m);const T=h.array.type;this._isArrayType(T)||this._isMatrixType(T)||T===W.UNDETERMINED||this._errorHandle(we(Pe.typeMismatch,{operator:"foreach",index:"id",typeE:T,typeR:"array<fun_arg>"}),m);break;case I.RULE_blockLine:if(this._blockCount++,this._pushBlockRanges(n),h.names.length){let[P,A]=h.names;const F=h.array.type;A?this._variablesHandle({nameList:{name:P,isForVar:!0,type:`${W.SERIES} ${W.INT}`},value:{type:`${W.SERIES} ${W.INT}`}},n):A=P;const $=F===W.UNDETERMINED?F:this._isMatrixType(F)?`${this._getArrayType(F)}[]`:this._typeAddSeries(this._getArrayType(F));this._variablesHandle({nameList:{name:A,isForVar:!0,type:$},value:{type:$}},n)}this._blockCount--,this._blockRanges.pop(),this._loopCount++;const x=this._isInLocalScop;this._isInLocalScop=!0,h.block=this.visit(m),this._isInLocalScop=x,this._loopCount--,h.returnedTypes=this._getBlockReturnTypes(h.block);break}}return h});w(this,"visitSwitchStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.SwitchStatement,condition:!0,ctx:n,cases:[],defaultCase:void 0};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_singleExpression:h.condition=this.visit(m);break;case I.RULE_caseClause:h.cases.push(this.visit(m));break;case I.RULE_defaultCaluse:h.defaultCase=this.visit(m);break}}return h});w(this,"visitCaseClause",n=>{const{children:o}=n,u={ruleType:Oe.CaseClause},h=this._isInLocalScop;return this._isInLocalScop=!0,u.condition=this.visit(o[0]),u.block=this.visit(o[2]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitDefaultCaluse",n=>{const{children:o}=n,u={ruleType:Oe.DefaultCaluse},h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[1]),this._isInLocalScop=h,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitWhileStatement",n=>{const{children:o}=n,u={ruleType:Oe.WhileStatement,ctx:n};u.condition=this.visit(o[1]),this._loopCount++;const h=this._isInLocalScop;return this._isInLocalScop=!0,u.block=this.visit(o[2]),this._isInLocalScop=h,this._loopCount--,u.returnedTypes=this._getBlockReturnTypes(u.block),u});w(this,"visitImportStmt",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_importElement&&h.push(this.visit(m))}return h});w(this,"visitImportElement",n=>{const{children:o}=n;let u=0;const h=[],m={ruleType:Oe.ImportElement,ctx:n};for(;u<o.length;u++){const _=o[u];_.ruleIndex===I.RULE_identifier?h.push(this.visit(_)):_.symbol&&_.symbol.type===I.IntegerLiteral&&(m.libraryVersion=_.symbol.text)}return m.username=h[0],m.libraryName=h[1],m.name=h[2],m});w(this,"visitLiteral",n=>{const{children:o}=n,u=o[0],{type:h,text:m}=u.symbol,_={ruleType:Oe.Literal,ctx:n,type:"",value:m};switch(h){case I.ColorLiteral:_.type=W.COLOR;break;case I.BooleanLiteral:_.type=W.BOOL;break;case I.StringLiteral:_.type=W.STRING;break;case I.IntegerLiteral:_.type=W.INT;break;case I.DecimalLiteral:_.type=W.FLOAT;break}return _.type&&(_.type=`${W.CONST} ${_.type}`),_});w(this,"visitMethodElement",n=>{const{children:o}=n,[u,h]=o,[m,_,T]=this.visit(u),x=this.visit(h);return{name:m,type:_,args:x,expr:T}});w(this,"visitMethodName",n=>{const{children:o}=n,u=[],h=[];let m=0,_=null;for(;m<o.length;m++){const x=o[m],P=x.ruleIndex,A=x.symbol;switch(P){case I.RULE_identifier:u.push(this.visit(x));break;case I.RULE_singleExpression:_=this.visit(x);break;case I.RULE_typeName:const F=this.visit(x);h.push(F),this._typeCheck(F,I.RULE_typeName,x);break;default:A&&A.text==="."&&u.push(".")}}return[u.join(""),h,_]});w(this,"visitArrowFunction",n=>{const{children:o}=n,u={ruleType:Oe.ArrowFunction,returnedTypes:[]};let h=0,m={lineNumber:0,column:0};for(;h<o.length;h++){const _=o[h],T=_.ruleIndex,x=_.symbol;switch(T){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},u.name=this.visit(_);break;case I.RULE_arrowFunctionParameters:u.params=this.visit(_),this._setFuncParams(u);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,u.block=this.visit(_),u.hasMemberIndex=this._hasMemberIndex,u.returnedTypes=this._getBlockReturnTypes(u.block),this._isInFunc=!1;break;default:x&&x.type===I.Export&&(u.isExport=!0)}}return this._setFunc(u,m),this._currentFuncParams.clear(),u});w(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let u=0,h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterList&&(h=this.visit(m))}return h});w(this,"visitFormalParameterList",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_formalParameterArg&&h.push(this.visit(m))}return h});w(this,"visitFormalParameterArg",n=>{const{children:o}=n;let u=0;const h={};for(;u<o.length;u++){const m=o[u];switch(m.ruleIndex){case I.RULE_typeGather:const _=this.visit(m);h.type=_&&this._typeAddSeries(_);break;case I.RULE_identifier:h.name=this.visit(m);break;case I.RULE_singleExpression:h.defaultValue=this.visit(m)}}return h.type=h.type||W.UNDETERMINED,h});w(this,"visitArrowMethod",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.ArrowMethod,returnedTypes:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_arrowMethodParameters:h.params=this.visit(_),this._setFuncParams(h);break;case I.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,h.block=this.visit(_),h.hasMemberIndex=this._hasMemberIndex,h.returnedTypes=this._getBlockReturnTypes(h.block),this._isInFunc=!1;break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setFunc(h,m),this._setMethod(h,m),this._currentFuncParams.clear(),h});w(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let u=0;const h={};let m=[];for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_formalParameterList:m=this.visit(_);break}}return[h,...m]});w(this,"visitTypeStatement",n=>{const{children:o}=n;let u=0;const h={ruleType:Oe.TypeStatement,fields:[]};let m={lineNumber:0,column:0};for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_identifier:m={lineNumber:_.start.line,column:_.start.column},h.name=this.visit(_);break;case I.RULE_typeElement:h.fields.push(this.visit(_));break;default:_.symbol&&_.symbol.type===I.Export&&(h.isExport=!0);break}}return this._setUserType(h,m),this._setNewFunc(h,m),this._setCopyFunc(h,m),this._setCopyMethod(h,m),h});w(this,"visitTypeElement",n=>{const{children:o}=n;let u=0;const h={};let m=null;for(;u<o.length;u++){const _=o[u];switch(_.ruleIndex){case I.RULE_typeGather:const T=this.visit(_);if(_.children[0].ruleIndex===I.RULE_typeSeries){const{column:x,line:P,text:A}=_.start,F=x+1;this._errors.push({startColumn:F,endColumn:parseInt(F+A.length),startLineNumber:P,endLineNumber:P,message:we(this._buildinTypes.has(A)?Pe.typeUseError:Pe.notTypeKeyword,{text:A})}),h.type=W.UNDETERMINED}else h.type=T&&this._typeAddSeries(T);break;case I.RULE_identifier:h.name=this.visit(_);break;case I.RULE_singleExpression:m=_,h.value=this.visit(_);break;default:_.symbol&&_.symbol.type===I.Varip&&(h.isVarip=!0);break}}return this._typeElementVerify(h,m),h});w(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});w(this,"visitTypeMap",n=>{const{children:o}=n;let u=0;const h=[];for(;u<o.length;u++){const m=o[u];if(m.ruleIndex===I.RULE_typeName){const _=this.visit(m);h.push(_),this._typeCheck(_,I.RULE_typeName,m)}}return`map<${h[0]},${h[1]}>`});w(this,"visitTypeSeries",n=>{const{children:o}=n,[u,h]=o,m=this.visit(u),_=this.visit(h);return this._typeCheck(m,I.RULE_typeSeries,u),this._typeCheck(_,I.RULE_typeName,h),`${m} ${_}`});w(this,"visitTypeArray",n=>{const{children:o}=n,u=o[0];let h=this.visit(u),m=h;if(o.length===3)h=W.ARRAY;else{this._typeCheck(h,I.RULE_typeArray,u);let _=1;for(;_<o.length;_++){const T=o[_];T.ruleIndex===I.RULE_typeName&&(m=this.visit(T),this._typeCheck(m,I.RULE_typeName,T))}}return this._arrayTypeConvert(`${h}<${m}>`)});w(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const u=o[0],h=this.visit(u);return u.ruleIndex===I.RULE_typeName&&this._typeCheck(h,I.RULE_typeName,u),h}return null});w(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);w(this,"visitTypeName",n=>{const{children:o}=n;let u=0,h="";for(;u<o.length;u++){const m=o[u];m.ruleIndex===I.RULE_identifier?h=`${h}${this.visit(m)}`:h=`${h}.`}return h});w(this,"visitName",n=>{var x,P;const{children:o}=n;let u=0,h=!1;const m=[];let _=null;for(;u<o.length;u++){const A=o[u];switch(A.ruleIndex){case I.RULE_identifier:m.push(this.visit(A));break;case I.RULE_singleExpression:_=this.visit(A);break;case I.RULE_methodElement:h=!0,m.push(this.visit(A));break}}const T={ruleType:Oe.Name,hasMethod:h,exprs:m,expr:_};if(h){let A="";const F=[];for(const V of m)typeof V=="string"?A=A?`${A}.${V}`:V:(A&&(V.name=`${A}.${V.name}`),F.push(V),A="");T.exprs=[...F,A];const $=this._getMethodTypes(F,Array.from(F,()=>n));if($&&$.length){const V=we(Pe.noFiledErr,{name:A});$.length>1&&this._errorHandle(V,n),T.type=((P=this._nameCheck(this._getOriginMethodName($[0],A),n,V))==null?void 0:P.type)||W.UNDETERMINED}}else{let A=m.join(".");if(_&&_.type&&_.type===W.UNDETERMINED)T.type=W.UNDETERMINED,A=`expr0.${A}`;else{_&&_.type&&(A=`${this._getMethodTypeName(_.type)}.${A}`);const F=this._nameCheck(A,n)||{};(x=F.title)!=null&&x.startsWith("built-in")&&(T.isBuiltIn=!0,T.isConst=F.isConst),T.varPos=F.pos,T.declare=F.declare,T.type=(F==null?void 0:F.type)||W.UNDETERMINED,F!=null&&F.isArg&&(T.arg=F),T.scope=this._blockCount}T.name=A}return T});this._loopCount=0,this._errors=[],this._variables=new Map,this._functions=new Map,this._methods=new Map,this._currentFuncParams=new Map,this._types=new Map,this._currentBlockVars=[new Map],this._blockCount=0,this._isInFunc=!1,this._isNeedCalc=!1,this._blockRanges=[],this._overloadsFuncs=[],this._hasMemberIndex=!1,this._isInLocalScop=!1,this._onlyStatementsCount=0}get overloadsFuncs(){return this._overloadsFuncs}get errors(){return this._errors}get userTypes(){return this._types}get userFunctions(){return this._functions}get userVariables(){return this._variables}get userMethods(){return this._methods}_verifyGloablVar(n,o){const{name:u,varPos:h,isBuiltIn:m}=n;if(m&&this._errorHandle(we(Pe.buidinAssignErr,{name:u}),o),!h)return;const _=this._currentBlockVars[0].get(u);if(!_)return;const{column:T,lineNumber:x}=_.pos||{};this._isInFunc&&T===h.column&&x===h.lineNumber&&this._errorHandle(we(Pe.modifyGlobalVarErr,{name:u}),o)}_typeElementVerify(n,o){var _,T;const{type:u,value:h}=n;if(!h)return;if(![Oe.Literal,Oe.UnaryExpression].includes(h.ruleType)&&!h.isBuiltIn){this._errorHandle(Pe.defaultValueErr,o);return}else if(h.ruleType===Oe.UnaryExpression){const{exprs:x}=h;if(![Oe.Literal,Oe.UnaryExpression].includes((_=x[0])==null?void 0:_.ruleType)&&!((T=x[0])!=null&&T.isBuiltIn)){this._errorHandle(Pe.defaultValueErr,o);return}}(!this._compareType(u,h.type)||u.endsWith(W.INT)&&h.type.endsWith(W.FLOAT))&&this._errorHandle(we(Pe.defaultValueTypeErr,{typeE:h.type,typeR:u}),o)}_memberIndexVerify(n,o){if(n.ruleType===Oe.Name&&!n.hasMethod&&this._blockCount){const h=this._currentBlockVars[this._blockCount],m=h&&h.get(n.name);m&&(m.isForVar?this._errorHandle(we(Pe.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(we(Ri.localScopeGetHistory,{name:n.name}),o,Lr.Warning))}const u=n&&n.type;if(u){const h=this._removePrefix(u);!this._types.has(h)&&!this._buildinTypes.has(h)&&!this._isArrayType(h)&&!this._isMatrixType(h)&&!this._isMapType(h)&&h!==W.UNDETERMINED&&this._errorHandle(we(Pe.invalidType,{index:0}),o)}}_setFuncParams(n){var o;for(const u of n.params){const h=(o=this._types.get(u.type))==null?void 0:o[0];if(h&&h.fields)for(const m of h.fields){const _=`${u.name}.${m.name}`;this._currentFuncParams.set(_,{...m,originName:_})}this._setVariablesMap(u),this._currentFuncParams.set(u.name,u)}}_pushBlockRanges(n){!n||!n.start||!n.stop||this._blockRanges.push({startColumn:n.start.column,endColumn:n.stop.column,startLineNumber:n.start.line,endLineNumber:n.stop.line})}_setUserType(n,o){const{fields:u,name:h}=n;this._types.set(h,[{fields:u.map(m=>({name:m.name,type:m.type})),name:h,pos:o}]),this._addVarToMap(h,h,o,!1,!1)}_againAssignHandle(n,o,u){const h=u!==":="?u.replace("=",""):u,m=u!==":="?[W.UNDETERMINED,W.INT,W.FLOAT]:[];h==="+"&&m.push(W.STRING);const[_,T]=n;_.arg&&!_.name.includes(".")&&this._errorHandle(we(Pe.funcArgAssignErr,{name:_.name}),o[0]);const x=this._sameTypeJudge(n,o,h,m),P=this._typeHandle(x);return this._updateUserVar(_.name,P,T.type),_.type=P,{ruleType:Oe.AgainAssign,name:_,operator:u,type:P,value:T}}_typeCheck(n,o,u){const h=[W.SERIES,W.SIMPLE,W.CONST];switch(o){case I.RULE_typeName:const m=this._buildinTypes.get(n);m&&![...h,W.ARRAY,W.MATRIX,W.MAP].includes(m[0].name)||this._types.get(n)||this._errorHandle(we(Pe.notTypeKeyword,{text:n}),u);break;case I.RULE_typeArray:[W.ARRAY,W.MATRIX].includes(n)||this._errorHandle(Pe.tempateTypeErr,u);break;case I.RULE_typeSeries:h.includes(n)||this._errorHandle(we(Pe.qualifierErr,{name:n}),u);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const u=this._buildinConstants.get(n);if(u&&u[0])return Object.assign(u[0],{isConst:!0})}_verifyName(n,o){var h,m;const u=this._getBuildVar(n);if(u)return u;if(n.includes(".")){const _=n.split("."),T=_.pop(),x=_.join(".");let P=this._blockCount;for(;P>=0;){if(!this._currentBlockVars[P]){P--;continue}const A=this._currentBlockVars[P].get(x);if(o&&this._judgeGatherValue(T||"",o,A==null?void 0:A.valueType,!0),(A==null?void 0:A.type)==="chart.point"){const $=(((m=(h=this._buildinTypes.get(A.type))==null?void 0:h[0])==null?void 0:m.fields)||[]).find(V=>V.name===T);if($)return Object.assign($,{pos:A.pos})}P--}}return this._getUserVar(n)}_judgeGatherValue(n,o,u,h){u===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(we(Pe.objectIsNaErr,{name:n,type:h?"field":"method"}),o)}_nameCheck(n,o,u=we(Pe.undeclared,{name:n})){const h=this._verifyName(n,o);return h||this._errorHandle(u,o),h}_inBlock(n){this._blockCount++,this._pushBlockRanges(n);const o=this.visit(n);return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),o}_errorHandle(n,o,u=Lr.Error){this._errors.push({message:n,startColumn:o.start.column+1,startLineNumber:o.start.line,endColumn:o.start.column+2+o.stop.stop-o.start.start,endLineNumber:o.stop.line,type:u})}_boolTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,W.BOOL,[W.UNDETERMINED,W.INT,W.FLOAT,W.BOOL],h)}_calcTypeJudge(n,o,u,h=0){return this._typeJudge(n,o,u,"int/float",[W.UNDETERMINED,W.INT,W.FLOAT],h)}_typeJudge(n,o,u,h,m,_=0){const T=n&&n.type;if(T){const x=this._removePrefix(T);if(!m.includes(x)&&x!==W.NA)return this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,typeE:x,typeR:h}),o),W.UNDETERMINED;h===W.BOOL&&[W.INT,W.FLOAT].includes(x)&&this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${_}`,type:W.BOOL}),o,Lr.Warning)}return T||W.UNDETERMINED}_sameTypeJudge(n,o,u,h){let m="";const _=[],T=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(u)&&(h=h.concat(T));for(const[x,P]of n.entries()){let A=P&&P.type||W.UNDETERMINED;const F=this._removePrefix(A);if(m||(m=F),!h.includes(F)&&h.length&&F!==W.NA){this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:A,typeR:h.slice(1).join("/")}),o[x]),m=W.UNDETERMINED,_.push(m);continue}if(m===W.UNDETERMINED||F===W.UNDETERMINED)A=m=W.UNDETERMINED;else if(m!==F&&m!==W.NA&&F!==W.NA&&(![W.INT,W.FLOAT].includes(m)||![W.INT,W.FLOAT].includes(F)))if(u===":=")this._errorHandle(we(Pe.assignTypeMismatch,{typeE:F,name:n[0].name,typeR:m}),o[0]),A=m=W.UNDETERMINED;else if(["==","!=","?:"].includes(u)&&[W.INT,W.FLOAT,W.BOOL].includes(m)&&[W.INT,W.FLOAT,W.BOOL].includes(F))this._errorHandle(we(Ri.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,type:m}),o[x],Lr.Warning),A=m=W.UNDETERMINED;else if(T.includes(m)&&T.includes(F)){if(m!==F){const $=this._getPrefix(A);_[x-1]=`${this._getPrefix(_[x-1])} ${T[0]}`,A=m=`${$} ${T[0]}`}}else this._errorHandle(we(Pe.typeMismatch,{operator:`operator ${u}`,index:`expr${x}`,typeE:F,typeR:m}),o[x]),A=m=W.UNDETERMINED;_.push(A)}return _}_getUserVar(n,o=!1){for(let u=this._blockCount;u>=0;u--){const h=this._currentBlockVars[u];if(u<=0){const m=this._currentFuncParams.get(n);if(m)return m.isArg=!0,m}if(h){const m=h.get(n);if(m)return m}}if(n.includes(".")&&!o){let u=!1,h=null;if(n.split(".").reduce((m,_)=>{let T=m?`${m}.${_}`:_;const x=this._getUserVar(T,!0);return x!=null&&x.type?x.type===W.UNDETERMINED?u=!0:(T=x.type,h=x):h=null,T},""),u)return{name:n,type:W.UNDETERMINED};if(h)return h}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(we(Pe.buidinVarErr,{name:n}),o);for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m&&m.get(n)){if(this._blockCount===h)return this._errorHandle(we(Pe.repeatVar,{name:n}),o),!0;this._errorHandle(we(Ri.repeatVar,{name:n}),o,Lr.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const u=this._currentBlockVars[o];if(u&&u.get(n))return!0}return!1}_updateUserVar(n,o,u){for(let h=0;h<=this._blockCount;h++){const m=this._currentBlockVars[h];if(m){const _=m.get(n);if(_){_.type=o,_.valueType=u;return}}}}_variablesHandle(n,o){var m,_,T,x;if(!(n&&n.nameList))return;const u=n.nameList;if(u.name==="_")return;const h=n.value;if(u.ruleType===Oe.VarMultiple){u.types=[],this._checkVarMultiple(u.names,h,o);for(const[P,A]of u.names.entries()){const F=this._varTypeJudge("",((m=h==null?void 0:h.types)==null?void 0:m[P])||W.UNDETERMINED,o);u.types.push(F),this._addVarToMap(A,F,u.posList[P],!0)}}else{const P=(h==null?void 0:h.type)||((_=h==null?void 0:h.returnedTypes)==null?void 0:_[0]);((T=h==null?void 0:h.types)!=null&&T.isBrackethesized||(x=h==null?void 0:h.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(we(Pe.tupleLeftVarErr,{name:u.name}),o),!u.type&&P===`${W.SIMPLE} ${W.NA}`&&this._errorHandle(Pe.naVarErr,o),u.prefix&&wi.indexOf(u.prefix)>wi.indexOf(this._getPrefix(P))&&this._errorHandle(we(Pe.declaredErr,{prefix:u.prefix,type:P}),o);const A=this._varTypeJudge(u.type,P||W.UNDETERMINED,o);u.type=A,this._addVarToMap(u.name,A,u.pos,!0,u.isForVar,u.declare,h.type)}}_checkVarMultiple(n,o,u){var x,P,A,F;const h=n.length,m=(o.types||o.returnedTypes||[]).length,_=((x=o.types)==null?void 0:x.isBrackethesized)||((P=o.returnedTypes)==null?void 0:P.isBrackethesized);(A=o.types)!=null&&A.isUnknown||(F=o.returnedTypes)!=null&&F.isUnknown||(m===1&&!_||!m?this._errorHandle(Pe.tupleRightVarErr,u):h!==m&&this._errorHandle(we(Pe.tupleVarErr,{indexA:m,indexB:h}),u))}_addVarToMap(n,o,u,h=!0,m=!1,_,T){var F;const x=this._currentBlockVars[this._blockCount]||new Map,P=(F=this._types.get(o))==null?void 0:F[0];if(P&&P.fields)for(const $ of P.fields)x.set(`${n}.${$.name}`,$);const A={name:n,type:o,pos:u,valueType:T};h&&this._setVariablesMap(A),x.set(n,Object.assign(A,{isForVar:m,declare:_})),this._currentBlockVars[this._blockCount]=x}_setVariablesMap(n){const o=this._blockRanges[this._blockCount];n.range=o,n.scope=this._blockCount;const u=this._variables.get(n.name)||[];u.push(n),this._variables.set(n.name,u)}_varTypeJudge(n,o,u){if(o===W.VOID)return this._errorHandle(Pe.voidNotVar,u),W.UNDETERMINED;if(n&&o!==W.UNDETERMINED){const h=this._removePrefix(n),m=this._removePrefix(o);return m!==h&&m!==W.NA&&!(h===W.FLOAT&&m===W.INT)?(this._errorHandle(we(Pe.declareTypeErr,{type:n,valueType:o}),u),W.UNDETERMINED):this._typeHandle([n,o])}else if(o===W.UNDETERMINED)return W.UNDETERMINED;return n||o||W.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===W.UNDETERMINED)return o;const u=this._getPrefix(n);if(u){const h=this._removePrefix(n);let m=-1;for(const[_,T]of wi.entries())T===u&&(m=_),m>=0&&m<=_&&(h===W.FLOAT&&o.push(`${T} ${W.INT}`),o.push(`${T} ${h}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(W.FLOAT)&&o.push(n.replace(/float/,W.INT));return o}_setNewFunc(n,o){const u=`${n.name}.new`,h=[],m=[];for(const _ of n.fields)h.push({name:_.name,required:!1,allowedTypeIDs:this._getAllowTypes(_.type),displayType:_.type}),m.push(`${_.type} ${_.name}`);this._functions.set(u,[{name:u,args:h,returnedTypes:[n.name],isUser:!0,pos:o,syntax:[`${u}(${m.join(", ")}) → ${n.name}`]}])}_setCopyFunc(n,o){const u=n.name,h=`${u}.copy`;this._functions.set(h,[{name:h,args:[{name:"object",required:!0,allowedTypeIDs:[u],displayType:u}],returnedTypes:[u],isUser:!0,pos:o,info:"The identifier of the object to be copied.",syntax:[`${h}(${u} object) → ${u}`]}])}_setCopyMethod(n,o){const u=n.name,h=`${u}.copy`;this._methods.set(h,[{name:h,args:[],returnedTypes:[u],thisType:[u],isUser:!0,pos:o,syntax:[`${h}() → ${u}`]}])}_setFunc(n,o){const u=[],h=[];for(const x of n.params){const{type:P,name:A,defaultValue:F}=x;u.push({name:A,required:!F,allowedTypeIDs:this._getAllowTypes(P),displayType:P}),h.push(`${P===W.UNDETERMINED?"":`${P} `}${A}`)}const{returnedTypes:m=[]}=n,_=n.name,T=m.length>1?`[${m.join(", ")}]`:m.toString();this._functions.set(_,[{name:_,args:u,syntax:[`${_}(${h.join(", ")}) → ${T||"void"}`],isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,returnedTypes:m}])}_setMethod(n,o){const{name:u,returnedTypes:h,params:m}=n,_=m[0].type,T=[],x=[];for(const $ of m.slice(1)){const{type:V,name:b,defaultValue:y}=$;T.push({name:b,required:!y,allowedTypeIDs:this._getAllowTypes(V),displayType:V}),x.push(`${V} ${b}`)}const P=h.length>1?`[${h.join(", ")}]`:h.toString(),A=this._getMethodTypeName(_),F=`${A}.${u}`;n.typeName=A,this._methods.set(F,[{name:u,args:T,originalName:F,syntax:[`${u}(${x.join(", ")}) → ${P||"void"}`],returnedTypes:h,isUser:!0,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[_]}])}_getMethodTypes(n,o){let u;for(const[h,m]of n.entries()){const{type:_,expr:T,args:x}=m;let{name:P}=m;const A=o[h];if(T){if(T.type===W.UNDETERMINED)return[W.UNDETERMINED];P=`${this._getMethodTypeName(T.type)}${P}`,x.params.unshift(T)}if(u&&u.length>=1)if(u.length===1){const F=u[0];if(F===W.UNDETERMINED)return[W.UNDETERMINED];const $=this._getOriginMethodName(F,P);P.includes(".")?u=this._getOtherNamesMethodType($,u,A,x,m):u=this._expandMethodHandle($,A,x,{type:F},F,m)}else this._errorHandle(we(Pe.noFiledErr,{name:P}),A);else{const[F,$]=this._tempFuncNameHandle(P,A,_);P=$;const V=this._buildinFunctions.get(F);if(V)this._globalFuncVerify(V[0],A),this._hasMemberIndexVerify(V[0],A,m),m.isBuiltIn=!0,u=this._getBuildInReturnTypes(V,x,P,A,void 0,_);else{const b=this._functions.get(P);if(b){this._hasMemberIndexVerify(b[0],A,m),u=b[0].returnedTypes;const{hasErr:y}=this._checkArgs(x,b[0].args||[],P,A,u[0]);if(y)return[W.UNDETERMINED]}else u=this._getOtherNamesMethodType(P,u,A,x,m)}}m.returnTypes=u}return u===void 0&&this._errorHandle(we(Pe.notFindFuncErr,{name:n[0].name}),o[0]),u}_globalFuncVerify(n,o){this._blockCount!==0&&Tm.includes(n.name)&&this._errorHandle(we(Pe.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,u){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,u.hasMemberIndex=!0,u.position=o.start.tokenIndex,this._isInLocalScop&&this._errorHandle(we(Ri.localScopeWarning,{name:u.name}),o,Lr.Warning))}_tempFuncNameHandle(n,o,u){let h=n;if(u&&u.length>=1){const m=["array.new","matrix.new"].includes(n),_=n==="map.new";if(u.length===1)if(m)h=`${n}<type>`,n=`${n}<${u[0]}>`;else return _?this._errorHandle(we(Pe.templateErr,{countA:2,countB:1}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];else{if(!_)return m?this._errorHandle(we(Pe.templateErr,{countA:1,countB:2}),o):this._errorHandle(we(Pe.templateNoSupportErr,{name:n}),o),[W.UNDETERMINED];if(!Sm.includes(u[0]))return this._errorHandle(we(Pe.mapKeyErr,{type:this._typeAddSeries(u[0])}),o),[W.UNDETERMINED];h=`${n}<type,type>`,n=`${n}<${u[0]},${u[1]}>`}}return[h,n]}_getOtherNamesMethodType(n,o,u,h,m){const _=n.split("."),T=_.length-1,x=_.slice(0,T).join("."),P=this._getUserVar(x);this._judgeGatherValue(_[T],u,P==null?void 0:P.valueType);const A=P==null?void 0:P.type;if(A){if(A===W.UNDETERMINED)return o=[W.UNDETERMINED],o.isUnknown=!0,o;const F=this._getOriginMethodName(A,_[T]);o=this._expandMethodHandle(F,u,h,P,x,m)}else{let F="",$="",V="";for(const b of _.slice(0,T)){F?$=this._getOriginMethodName(F,b):$=$?`${$}.${b}`:b;const y=this._verifyName($);y!=null&&y.type?(F=y.type,V=""):this._buildinTypes.get($)?V=we(Pe.methodNotExistErr,{name:$,methodName:_[T]}):V=we(Pe.noFiledErr,{name:b})}V&&this._errorHandle(V,u)}return o}_expandMethodHandle(n,o,u,h,m,_){var P,A;let T;const x=this._buildinMethods.get(n);if(x)T=this._getBuildInReturnTypes(x,u,n,o,h);else{const F=this._methods.get(n);if(F&&F.length){const $=F[0],V=this._getMethodTypeName(((P=$.thisType)==null?void 0:P[0])||"");if(!this._types.get(V)){const g=this._functions.get($.name);g&&(_.selfArg=(A=g[0].args)==null?void 0:A[0])}this._hasMemberIndexVerify($,o,_),T=$.returnedTypes;const{hasErr:y}=this._checkArgs(u,$.args||[],n,o,(T==null?void 0:T[0])||"");if(y)return[W.UNDETERMINED]}else this._errorHandle(we(Pe.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:m}),o)}return T}_getBuildInReturnTypes(n,o,u,h,m,_){var x;let T;if(n.length===1){const{returnedTypes:P,syntax:A,args:F=[],thisType:$}=n[0],V=A[0].split("→")[1].trim(),b=m||o.params[0]||((x=F[0])==null?void 0:x.name)&&o[F[0].name];b&&!this._checkMethodThisType($,b.type)&&this._errorHandle(we(Pe.typeMismatch,{operator:u,index:b.name||"id",typeE:b.type,typeR:$[0]}),h);const{hasErr:y,types:g}=this._checkArgs(o,F,u,h,V,b);if(y)return[W.UNDETERMINED];if(T=g.length&&g||this._returnedTypesParse(P),T.length>1)return T;(_==null?void 0:_.length)===1?T=[this._typeReplace(V,_[0])]:(_==null?void 0:_.length)===2&&(T=[`${W.MAP}<${_[0]},${_[1]}>`]),T=this._returnTypesOtherHandle(b,V,T,u)}else{const P=this._overloadsFuncGetTypes(n,o,h,m);T=this._returnedTypesParse([P])}return T}_overloadsFuncGetTypes(n,o,u,h){var F,$;let m="",_=[],T=[],x=0;for(const[V,b]of n.entries()){const{args:y,returnedTypes:g,name:D,thisType:R}=b,O=h||o.params[0]||o[y[0].name],{errMsg:U,warnMsg:X}=this._overloadsCheckArgs(o,y,D,u,O);O&&!this._checkMethodThisType(R,O.type)&&U.unshift({msg:we(Pe.typeMismatch,{operator:D,index:O.name||"id",typeE:O.type,typeR:R[0]}),ctx:u}),V===0?(_=U,T=X,!U.length&&(m=g[0])):U.length?((F=_[0])!=null&&F.isLenErr&&!(($=U[0])!=null&&$.isLenErr)||_.length>U.length)&&(_=U,T=X,x=V):this._priorityComparison(m,g[0])||(g[0]===`${W.ARRAY}<>`?m=`${O.type}[]`:m=g[0],_=U,T=X,x=V)}for(const V of _)this._errorHandle(V.msg,V.ctx);for(const V of T)this._errorHandle(V.msg,V.ctx,Lr.Warning);const P=u.children[0],A=n[0].name;return P&&this._overloadsFuncs.push({name:A,index:x,line:P.start.line,startColumn:P.start.column+1,endColumn:P.start.column+A.length}),this._funcArgsAddOriginName(o,n[x].args,A),m||W.UNDETERMINED}_funcArgsAddOriginName(n,o,u){const h=n.params||[];for(const[m,_]of o.entries())m<h.length&&(h[m].originName=_.name);if(u==="input"){const m=h[0]||n.defval;Object.assign(n,{inputType:{name:`'${m!=null&&m.isSourceType?"source":this._removePrefix(m==null?void 0:m.type)}'`}})}}_overloadsCheckArgs(n,o,u,h,m){const _={...n},T=_.params;delete _.params;const x=Object.keys(_).length+T.length,P=o.length,A=[],F=[];if(x>P&&!o.some(V=>["arg0, arg1, ...","number0, number1, ..."].includes(V.name)))return A.push({msg:we(Pe.argsLenErr,{name:u,lenA:x,lenB:P}),isLenErr:!0,ctx:h}),{errMsg:A,warnMsg:F};for(const[$,V]of o.entries()){let b=_[V.name];if($<T.length&&(b&&F.push({msg:we(Ri.moreSameArg,{arg:V.name}),ctx:h}),b=T[$]),!b)V.required&&A.push({msg:we(Pe.requiredParamErr,{name:u,argName:V.name}),ctx:h});else{const y=b.type!==`${W.SIMPLE} na`?this._checkArg(b,V,u,m,b.ctx,!0):"";y&&A.push({msg:y,ctx:b.ctx}),delete _[V.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(V.name)&&T.length>$+1){const y=T.slice($+1);let g=T[$];for(const D of y){g.type===`${W.SIMPLE} ${W.NA}`&&(g=D);const R=D.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(D,V,u,g,D.ctx,!0):"";R&&A.push({msg:R,ctx:D.ctx})}}}if(Object.keys(_).length)for(const $ of Object.keys(_))A.push({msg:we(Pe.argsNameErr,{name:u,argName:$}),ctx:_[$].ctx});return{errMsg:A,warnMsg:F}}_checkArgs(n,o,u,h,m,_){var V;const T={...n},x=T.params;delete T.params;const P=Object.keys(T).length+x.length,A=o.length;let F=!1,$=[];if(P>A&&!o.some(y=>["arg0, arg1, ...","number0, number1, ..."].includes(y.name)))return this._errorHandle(we(Pe.argsLenErr,{name:u,lenA:P,lenB:A}),h),F=!0,{hasErr:F,types:$};for(const[b,y]of o.entries()){let g=T[y.name];if(b<x.length&&(g&&this._errorHandle(we(Ri.moreSameArg,{arg:y.name}),h,Lr.Warning),g=x[b],g.originName=y.name),!g)y.required&&(this._errorHandle(we(Pe.requiredParamErr,{name:u,argName:y.name}),h),F=!0);else{const D=g.type!==`${W.SIMPLE} ${W.NA}`?this._checkArg(g,y,u,_,g.ctx):"";if(D)this._errorHandle(D,g.ctx),F=!0;else if(D===!1)F=!0;else if(u.startsWith("request.")&&y.name==="expression")if(g.ruleType===Oe.Brackethesized)$=g.exprs.map(R=>this._typeReplace(m,R.type));else if((V=g.types||g.returnedTypes)!=null&&V.isBrackethesized)$=(g.types||g.returnedTypes).map(R=>this._typeReplace(m,R));else{const R=this._typeReplace(m,g.type);$.push(R)}delete T[y.name]}}if(Object.keys(T).length)for(const b of Object.keys(T))this._errorHandle(we(Pe.argsNameErr,{name:u,argName:b}),T[b].ctx),F=!0;return{hasErr:F,types:$}}_checkArg(n,o,u,h,m,_){const{ruleType:T,exprs:x,name:P}=n;let A=n.type;T===Oe.Brackethesized&&(A=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:F=[],displayType:$,name:V}=o;if(!(!A||A===W.UNDETERMINED||$===W.UNDETERMINED)&&!(this._checkMethodThisType(F,this._arrayTypeConvert(A))&&!(u==="input.source"&&V==="defval"))){if(V==="condition"&&($!=null&&$.endsWith(W.BOOL))&&(A.endsWith(W.INT)||A.endsWith(W.FLOAT))){m&&this._errorHandle(we(Ri.typeMismatch,{index:V,operator:u,type:W.BOOL}),m,Lr.Warning);return}switch($){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.STRING}`],u,A);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.FLOAT}`,`${W.CONST} ${W.INT}`],u,A);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${W.CONST} ${W.INT}`],u,A);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!P||!xp.includes(P))return we(Pe.inputSourceErr,{name:V,funcName:u});if(this._judgeVarBuildIn(P))return we(Pe.buildInUseErr,{name:P});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(u)||"";if(!A.endsWith(b)&&!(A.endsWith(W.INT)&&b===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(A)){if(V==="id2"){const O=this._getArrayType(h==null?void 0:h.type);if(!O)return;const U=this._getArrayType(A)||"";if(O!==U)return we(Pe.typeMismatch,{operator:u,index:V,typeE:U,typeR:O})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const y=this._getArrayType(h==null?void 0:h.type)||"";if(!A.endsWith(y)&&!(A.endsWith(W.INT)&&y===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(y)});break;case"any map type":if(this._isMapType(A)){if(V==="id2"){const O=this._getMapType(h==null?void 0:h.type);if(!O)return;const U=this._getMapType(A)||[];if(O[0]!==U[0]||O[1]!==U[1])return we(Pe.mapKeyValErr,{typeA:this._typeAddSeries(U[0]),typeB:this._typeAddSeries(U[1]),typeC:this._typeAddSeries(O[0]),typeD:this._typeAddSeries(O[1]),name:u})}}else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(h==null?void 0:h.type);if(!g)return;const D=V==="key"?0:1;if(!A.endsWith(g[D])&&!(A.endsWith(W.INT)&&g[D]===W.FLOAT))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:this._typeAddSeries(g[D])});break;case"<arg_expr_type>":if(T===Oe.Brackethesized)return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""});break;case"<arg_type>":case"variable, function, object, array or matrix of series int/float/bool/string/color, or a tuple of these":break;case"variable, object or function of series int/float/bool/string/color, or a tuple of these":if(T===Oe.Brackethesized){for(const O of x)if(!F.includes(O.type))return this._errorHandle(we(Pe.requestArgsErr,{name:u,argName:V,type:O.type}),O.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(xp.includes(n.name)&&F[0].endsWith(this._removePrefix(A)))n.isSourceType=!0;else return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(T===Oe.Brackethesized||this._isArrayType(A)||this._isMapType(A)||this._isMatrixType(A))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:`${W.SERIES} ${W.INT}`});if(A!==(h==null?void 0:h.type))return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:h==null?void 0:h.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!_){const O=F.find(U=>U.endsWith(R));if(O){n.type=O,n.arg.type=O;return}}if(F.length===1&&F[0].endsWith(R)){const O=this._getPrefix(n.type),U=this._getPrefix(F[0]);if(wi.indexOf(O)>=wi.indexOf(U))return}return we(Pe.typeMismatch,{operator:u,index:V,typeE:A,typeR:$||""})}}}_tupleToCheck(n,o,u,h,m){var _,T;if(u.push(`${W.SIMPLE} ${W.NA}`),n.ruleType===Oe.Brackethesized){const x=[];let P=!1;for(const A of n.exprs)x.push(A.type),u.includes(A.type)||(P=!0);if(P)return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((_=o.allowedTypeIDs)==null?void 0:_[0])||""})}else return we(Pe.typeMismatch,{operator:h,index:o.name,typeE:m,typeR:((T=o.allowedTypeIDs)==null?void 0:T[0])||""})}_getBlockReturnTypes(n){var F,$;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[W.UNDETERMINED];const{ruleType:u,type:h,types:m,returnedTypes:_,exprs:T,nameList:x,typeList:P,block:A}=o;if(m&&m.length)return m;if(_&&_.length)return _;if(h)return[h];switch(u){case Oe.Brackethesized:const V=T.map(ue=>ue.type);return V.isBrackethesized=!0,V;case Oe.VarBlockStmt:case Oe.DeclareAssign:return x?x.ruleType===Oe.VarMultiple?x.types:[x.type]:[((F=o.name)==null?void 0:F.type)||W.UNDETERMINED];case Oe.SwitchStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let y=(($=b[0])==null?void 0:$.returnedTypes)||[],g=y.length<=1?y[0]:`[${y.join(", ")}]`,D=null;for(const ue of b.slice(1)){const K=ue.returnedTypes||[W.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(ue.block)?ue.block.slice(-1)[0]:ue.block;if(K.length!==y.length)D=Y.ctx;else for(const[G,ce]of y.entries())if(this._compareType(K[G],ce))(K[G].includes(W.FLOAT)&&!ce.includes(W.FLOAT)||y[G]===`${W.SIMPLE} ${W.NA}`||y[G]===W.UNDETERMINED)&&(y[G]=K[G]);else{D=Y.ctx;break}}return D&&(this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"switch",types:g}),D),y=y.map(()=>W.UNDETERMINED)),o.returnedTypes=y,y;case Oe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[W.UNDETERMINED];if(!P.filter(ue=>ue&&ue.length).length)return[W.UNDETERMINED];let R=P[0]||[],O=R.length<=1?R[0]:`[${R.join(", ")}]`,U=0,X=0;for(const ue of P.slice(1))if(ue)if(U++,O+=ue.length<=1?`; ${ue[0]}`:`; [${ue.join(", ")}]`,ue.length!==R.length)X=U;else for(const[K,Y]of R.entries())if(this._compareType(ue[K],Y))(ue[K].includes(W.FLOAT)&&!Y.includes(W.FLOAT)||R[K]===`${W.SIMPLE} ${W.NA}`)&&(R[K]=ue[K]);else{X=U;break}if(X){const ue=A[X].slice(-1)[0],K=Array.isArray(ue)?ue.slice(-1)[0]:ue;this._errorHandle(we(Pe.ifOrSwitchTypeErr,{keyword:"if",types:O}),K.ctx),R=R.map(()=>W.UNDETERMINED)}return o.returnedTypes=R,R}return[W.UNDETERMINED]}}class km{constructor(e){w(this,"_nameMap");w(this,"_prefixNameVar");w(this,"_prefixNameFunc");w(this,"_prefixNameConst");w(this,"_userTypes");w(this,"_isInFunc");w(this,"_varlist");w(this,"_memberIndexList");w(this,"_blockCount");this._nameMap=new Map,this._prefixNameVar=`${e}_var`,this._prefixNameFunc=`${e}_func`,this._prefixNameConst=`${e}_const`,this._userTypes=[],this._isInFunc=!1,this._varlist=[{}],this._memberIndexList=[{}],this._blockCount=0}preParser(e){var o,u;const n=[];for(const h of e){if(!h)return;if(Array.isArray(h)){for(const m of h)if(n.push(this._parserStmt(m)),_l.includes((u=(o=m.exprs)==null?void 0:o[0])==null?void 0:u.name))return n.join(`;
12
12
  `).replace(/;+/g,";")}else n.push(this._parserStmt(h))}return""}parser(e){const n=[];for(const u of e){if(!u)return;if(Array.isArray(u))for(const h of u)n.push(this._parserStmt(h));else n.push(this._parserStmt(u))}const o=this._memberIndexList[this._blockCount]||{};return n.push(...Object.values(o)),n.join(`;
13
13
  `).replace(/;+/g,";")}_parserStmt(e,n=!1){switch(e==null?void 0:e.ruleType){case Oe.DeclareAssign:return this._parserDeclareAssign(e);case Oe.MethodExpression:return`${this._parserMethodExpression(e)}`;case Oe.ArrowFunction:return this._parserArrowFunction(e);case Oe.ArrowMethod:return this._parserArrowMethod(e);case Oe.IfStatement:return this._parserIfStatement(e,n);case Oe.WhileStatement:return this._parserWhileStatement(e,n);case Oe.SwitchStatement:return this._parserSwitchStatement(e,n);case Oe.ForInStatement:return this._parserForInStatement(e,n);case Oe.ForToStatement:return this._parserForToStatement(e,n);case Oe.AgainAssign:return this._parserAgainAssign(e);case Oe.ImportElement:break;case Oe.TypeStatement:return this._parserTypeStatement(e);case Oe.VarBlockStmt:return this._parserVarBlockStmt(e);case Oe.FlowStmt:return`${e.value};`;case Oe.Brackethesized:return this._parserBrackethesized(e);default:return this._parserSingleExpression(e)}return""}_parserTypeStatement(e){const n=[],o=[];for(const u of e.fields){const{name:h,value:m}=u;u.isVarip&&o.push(`"${h}"`),n.push(`${h}: ${m?this._parserSingleExpression(m):"undefined"}`)}return this._userTypes.push(e.name),`const ${e.name} = ${this._prefixNameVar}.getTypeInstance({${n.join(", ")}}, [${o.join()}])`}_parserVarBlockStmt(e){const{nameList:n,operator:o,name:u,value:h}=e,m=this._parserStmt(h,!0);return u?`${this._parserName(u)} ${o===":="?"=":o} ${m}`:`let ${this._parserDeclareAssignNames(n)} = ${m}`}_parserForToStatement(e,n=!1){const{numerical:o,block:u,name:h}=e,[m,_,T]=o,x=this._parserBlockLine(u,n),P=this._parserSingleExpression(m),A=this._parserSingleExpression(_),F=T?this._parserSingleExpression(T):"",$=`for (let ${h}=${P}; ${h}>=(${A}); ${h}+=(${F||"-1"})){
14
14
  ${x}
@@ -103,4 +103,4 @@ Input files:
103
103
  `+m(t)+`
104
104
  `)}function*i0(t,e,n){n&&typeof process=="object"&&process.env&&typeof process.env.TERSER_DEBUG_DIR=="string"&&r0(t,e,n,process.env.TERSER_DEBUG_DIR),e=pi(e,{compress:{},ecma:void 0,enclose:!1,ie8:!1,keep_classnames:void 0,keep_fnames:!1,mangle:{},module:!1,nameCache:null,output:null,format:null,parse:{},rename:void 0,safari10:!1,sourceMap:!1,spidermonkey:!1,timings:!1,toplevel:!1,warnings:!1,wrap:!1},!0);var o=e.timings&&{start:Date.now()};if(e.keep_classnames===void 0&&(e.keep_classnames=e.keep_fnames),e.rename===void 0&&(e.rename=e.compress&&e.mangle),e.output&&e.format)throw new Error("Please only specify either output or format option, preferrably format.");e.format=e.format||e.output||{},ao("ecma",e,["parse","compress","format"]),ao("ie8",e,["compress","mangle","format"]),ao("keep_classnames",e,["compress","mangle"]),ao("keep_fnames",e,["compress","mangle"]),ao("module",e,["parse","compress","mangle"]),ao("safari10",e,["mangle","format"]),ao("toplevel",e,["compress","mangle"]),ao("warnings",e,["compress"]);var u;e.mangle&&(e.mangle=pi(e.mangle,{cache:e.nameCache&&(e.nameCache.vars||{}),eval:!1,ie8:!1,keep_classnames:!1,keep_fnames:!1,module:!1,nth_identifier:ys,properties:!1,reserved:[],safari10:!1,toplevel:!1},!0),e.mangle.properties&&(typeof e.mangle.properties!="object"&&(e.mangle.properties={}),e.mangle.properties.keep_quoted&&(u=e.mangle.properties.reserved,Array.isArray(u)||(u=[]),e.mangle.properties.reserved=u),e.nameCache&&!("cache"in e.mangle.properties)&&(e.mangle.properties.cache=e.nameCache.props||{})),Ed(e.mangle.cache),Ed(e.mangle.properties.cache)),e.sourceMap&&(e.sourceMap=pi(e.sourceMap,{asObject:!1,content:null,filename:null,includeSources:!1,root:null,url:null},!0)),o&&(o.parse=Date.now());var h;if(t instanceof zt)h=t;else{if((typeof t=="string"||e.parse.spidermonkey&&!Array.isArray(t))&&(t=[t]),e.parse=e.parse||{},e.parse.toplevel=null,e.parse.spidermonkey)e.parse.toplevel=Te.from_mozilla_ast(Object.keys(t).reduce(function(F,$){return F?(F.body=F.body.concat(t[$].body),F):t[$]},null));else{delete e.parse.spidermonkey;for(var m in t)if(Zn(t,m)&&(e.parse.filename=m,e.parse.toplevel=ss(t[m],e.parse),e.sourceMap&&e.sourceMap.content=="inline")){if(Object.keys(t).length>1)throw new Error("inline source map only works with singular input");e.sourceMap.content=n0(t[m])}}if(e.parse.toplevel===null)throw new Error("no source file given");h=e.parse.toplevel}u&&e.mangle.properties.keep_quoted!=="strict"&&J_(h,u);var _;e.mangle&&e.mangle.properties&&(_=vd(h)),e.wrap&&(h=h.wrap_commonjs(e.wrap)),e.enclose&&(h=h.wrap_enclose(e.enclose)),o&&(o.rename=Date.now()),o&&(o.compress=Date.now()),e.compress&&(h=new yd(e.compress,{mangle_options:e.mangle}).compress(h)),o&&(o.scope=Date.now()),e.mangle&&h.figure_out_scope(e.mangle),o&&(o.mangle=Date.now()),e.mangle&&(h.compute_char_frequency(e.mangle),h.mangle_names(e.mangle),h=Z_(h,e.mangle)),o&&(o.properties=Date.now()),e.mangle&&e.mangle.properties&&(h=Q_(h,e.mangle.properties,_)),o&&(o.format=Date.now());var T={};e.format.ast&&(T.ast=h),e.format.spidermonkey&&(T.ast=h.to_mozilla_ast());let x;if(!Zn(e.format,"code")||e.format.code){if(x={...e.format},x.ast||(x._destroy_ast=!0,Nn(h,F=>{F instanceof qe&&(F.variables=void 0,F.enclosed=void 0,F.parent_scope=void 0),F.block_scope&&(F.block_scope.variables=void 0,F.block_scope.enclosed=void 0,F.parent_scope=void 0)})),e.sourceMap){if(e.sourceMap.includeSources&&t instanceof zt)throw new Error("original source content unavailable");x.source_map=yield*X_({file:e.sourceMap.filename,orig:e.sourceMap.content,root:e.sourceMap.root,files:e.sourceMap.includeSources?t:null})}delete x.ast,delete x.code,delete x.spidermonkey;var P=Nl(x);if(h.print(P),T.code=P.get(),e.sourceMap)if(Object.defineProperty(T,"map",{configurable:!0,enumerable:!0,get(){const F=x.source_map.getEncoded();return T.map=e.sourceMap.asObject?F:JSON.stringify(F)},set(F){Object.defineProperty(T,"map",{value:F,writable:!0})}}),T.decoded_map=x.source_map.getDecoded(),e.sourceMap.url=="inline"){var A=typeof T.map=="object"?JSON.stringify(T.map):T.map;T.code+=`
105
105
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,`+t0(A)}else e.sourceMap.url&&(T.code+=`
106
- //# sourceMappingURL=`+e.sourceMap.url)}return e.nameCache&&e.mangle&&(e.mangle.cache&&(e.nameCache.vars=Sd(e.mangle.cache)),e.mangle.properties&&e.mangle.properties.cache&&(e.nameCache.props=Sd(e.mangle.properties.cache))),x&&x.source_map&&x.source_map.destroy(),o&&(o.end=Date.now(),T.timings={parse:.001*(o.rename-o.parse),rename:.001*(o.compress-o.rename),compress:.001*(o.scope-o.compress),scope:.001*(o.mangle-o.scope),mangle:.001*(o.properties-o.mangle),properties:.001*(o.format-o.properties),format:.001*(o.end-o.format),total:.001*(o.end-o.start)}),T}async function o0(t,e,n){const o=i0(t,e,n);let u,h;do h=o.next(await u),u=h.value;while(!h.done);return h.value}function a0(t){const e=new Wy(t),n=new ml(e);n.removeErrorListeners();const o=new Ky(n),u=new I(o);u._interp.predictionMode=Qy.SLL,u.removeErrorListeners();const h=new u0;n.addErrorListener(h),u.addErrorListener(h),u.buildParseTrees=!0;const m=u.program();return{errors:h.errors,ast:m}}async function s0(t,e,n){const{errors:o,ast:u}=a0(t),h=new Cm(n),m=h.visit(u),_=h.errors.concat(o.splice(0,1));let T="";const x=new km("$"),P=x.preParser(m)||"";if(e&&!_.some(A=>A.type===8)){const A=x.parser(m)||"";console.log(A),T=(await o0(A,{compress:!0,mangle:!0})).code||""}return{errors:_,functions:Object.fromEntries(h.userFunctions),variables:Object.fromEntries(h.userVariables),types:Object.fromEntries(h.userTypes),methods:Object.fromEntries(h.userMethods),overloadsFuncs:h.overloadsFuncs,codeStr:T,preParserCode:P}}class u0 extends zy{constructor(){super(...arguments);w(this,"errors",[])}syntaxError(n,o,u,h,m){this.errors.push({message:`syntax error: ${m.replace(/expecting.+/,"")}`,type:Lr.Error,startColumn:h,startLineNumber:u,endColumn:h,endLineNumber:u})}}bl(s0)})();
106
+ //# sourceMappingURL=`+e.sourceMap.url)}return e.nameCache&&e.mangle&&(e.mangle.cache&&(e.nameCache.vars=Sd(e.mangle.cache)),e.mangle.properties&&e.mangle.properties.cache&&(e.nameCache.props=Sd(e.mangle.properties.cache))),x&&x.source_map&&x.source_map.destroy(),o&&(o.end=Date.now(),T.timings={parse:.001*(o.rename-o.parse),rename:.001*(o.compress-o.rename),compress:.001*(o.scope-o.compress),scope:.001*(o.mangle-o.scope),mangle:.001*(o.properties-o.mangle),properties:.001*(o.format-o.properties),format:.001*(o.end-o.format),total:.001*(o.end-o.start)}),T}async function o0(t,e,n){const o=i0(t,e,n);let u,h;do h=o.next(await u),u=h.value;while(!h.done);return h.value}function a0(t){const e=new Wy(t),n=new ml(e);n.removeErrorListeners();const o=new Ky(n),u=new I(o);u._interp.predictionMode=Qy.SLL,u.removeErrorListeners();const h=new u0;n.addErrorListener(h),u.addErrorListener(h),u.buildParseTrees=!0;const m=u.program();return{errors:h.errors,ast:m}}async function s0(t,e,n){const{errors:o,ast:u}=a0(t),h=new Cm(n),m=h.visit(u);let _=o.splice(0,1);_.length||(_=h.errors),console.log(_);let T="";const x=new km("$"),P=x.preParser(m)||"";if(e&&!_.some(A=>A.type===8)){const A=x.parser(m)||"";console.log(A),T=(await o0(A,{compress:!0,mangle:!0})).code||""}return{errors:_,functions:Object.fromEntries(h.userFunctions),variables:Object.fromEntries(h.userVariables),types:Object.fromEntries(h.userTypes),methods:Object.fromEntries(h.userMethods),overloadsFuncs:h.overloadsFuncs,codeStr:T,preParserCode:P}}class u0 extends zy{constructor(){super(...arguments);w(this,"errors",[])}syntaxError(n,o,u,h,m){this.errors.push({message:`syntax error: ${m.replace(/expecting.+/,"")}`,type:Lr.Error,startColumn:h,startLineNumber:u,endColumn:h,endLineNumber:u})}}bl(s0)})();