@guihz/trading-vue-editor-tes 0.0.69 → 0.0.70

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ var X0=Object.defineProperty;var q0=(ho,hi,Or)=>hi in ho?X0(ho,hi,{enumerable:!0
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,m=!0,i=!1;return{s:function(){d=d.call(l)},n:function(){var u=d.next();return m=u.done,u},e:function(u){i=!0,c=u},f:function(){try{m||d.return==null||d.return()}finally{if(i)throw c}}}}function zm(l,r){(r==null||r>l.length)&&(r=l.length);for(var d=0,a=new Array(r);d<r;d++)a[d]=l[d];return a}function ru(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function Wm(l,r){for(var d=0;d<r.length;d++){var a=r[d];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,Xm(a.key),a)}}function iu(l,r,d){return r&&Wm(l.prototype,r),d&&Wm(l,d),Object.defineProperty(l,"prototype",{writable:!1}),l}function Xm(l){var r=function(d,a){if(ts(d)!=="object"||d===null)return d;var h=d[Symbol.toPrimitive];if(h!==void 0){var c=h.call(d,"string");if(ts(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(l);return ts(r)==="symbol"?r:String(r)}Xi.EMPTY=new rp;var el,tl,sp,qm=function(){function l(r){ru(this,l),this.tokens=r,this.programs=new Map}return iu(l,[{key:"getTokenStream",value:function(){return this.tokens}},{key:"insertAfter",value:function(r,d){var a,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(h),m=new Jm(this.tokens,a,c.length,d);c.push(m)}},{key:"insertBefore",value:function(r,d){var a,h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;a=typeof r=="number"?r:r.tokenIndex;var c=this.getProgram(h),m=new rs(this.tokens,a,c.length,d);c.push(m)}},{key:"replaceSingle",value:function(r,d){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;this.replace(r,r,d,a)}},{key:"replace",value:function(r,d,a){var h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:l.DEFAULT_PROGRAM_NAME;if(typeof r!="number"&&(r=r.tokenIndex),typeof d!="number"&&(d=d.tokenIndex),r>d||r<0||d<0||d>=this.tokens.size)throw new RangeError("replace: range invalid: ".concat(r,"..").concat(d,"(size=").concat(this.tokens.size,")"));var c=this.getProgram(h),m=new nl(this.tokens,r,d,c.length,a);c.push(m)}},{key:"delete",value:function(r,d){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l.DEFAULT_PROGRAM_NAME;d===void 0&&(d=r),this.replace(r,d,null,a)}},{key:"getProgram",value:function(r){var d=this.programs.get(r);return d==null&&(d=this.initializeProgram(r)),d}},{key:"initializeProgram",value:function(r){var d=[];return this.programs.set(r,d),d}},{key:"getText",value:function(r){var d,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l.DEFAULT_PROGRAM_NAME;d=r instanceof ge?r:new ge(0,this.tokens.size-1),typeof r=="string"&&(a=r);var h=this.programs.get(a),c=d.start,m=d.stop;if(m>this.tokens.size-1&&(m=this.tokens.size-1),c<0&&(c=0),h==null||h.length===0)return this.tokens.getText(new ge(c,m));for(var i=[],u=this.reduceToSingleOperationPerIndex(h),v=c;v<=m&&v<this.tokens.size;){var A=u.get(v);u.delete(v);var S=this.tokens.get(v);A==null?(S.type!==n.EOF&&i.push(String(S.text)),v++):v=A.execute(i)}if(m===this.tokens.size-1){var N,ee=ns(u.values());try{for(ee.s();!(N=ee.n()).done;){var ke=N.value;ke.index>=this.tokens.size-1&&i.push(ke.text.toString())}}catch(Oe){ee.e(Oe)}finally{ee.f()}}return i.join("")}},{key:"reduceToSingleOperationPerIndex",value:function(r){for(var d=0;d<r.length;d++){var a=r[d];if(a!=null&&a instanceof nl){var h,c=a,m=ns(this.getKindOfOps(r,rs,d));try{for(m.s();!(h=m.n()).done;){var i=h.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(xr){m.e(xr)}finally{m.f()}var u,v=ns(this.getKindOfOps(r,nl,d));try{for(v.s();!(u=v.n()).done;){var A=u.value;if(A.index>=c.index&&A.lastIndex<=c.lastIndex)r[A.instructionIndex]=void 0;else{var S=A.lastIndex<c.index||A.index>c.lastIndex;if(A.text!=null||c.text!=null||S){if(!S)throw new Error("replace op boundaries of ".concat(c," overlap with previous ").concat(A))}else r[A.instructionIndex]=void 0,c.index=Math.min(A.index,c.index),c.lastIndex=Math.max(A.lastIndex,c.lastIndex)}}}catch(xr){v.e(xr)}finally{v.f()}}}for(var N=0;N<r.length;N++){var ee=r[N];if(ee!=null&&ee instanceof rs){var ke,Oe=ee,He=ns(this.getKindOfOps(r,rs,N));try{for(He.s();!(ke=He.n()).done;){var at=ke.value;at.index===Oe.index&&(at instanceof Jm?(Oe.text=this.catOpText(at.text,Oe.text),r[at.instructionIndex]=void 0):at instanceof rs&&(Oe.text=this.catOpText(Oe.text,at.text),r[at.instructionIndex]=void 0))}}catch(xr){He.e(xr)}finally{He.f()}var ze,mn=ns(this.getKindOfOps(r,nl,N));try{for(mn.s();!(ze=mn.n()).done;){var hn=ze.value;if(Oe.index!==hn.index){if(Oe.index>=hn.index&&Oe.index<=hn.lastIndex)throw new Error("insert op ".concat(Oe," within boundaries of previous ").concat(hn))}else hn.text=this.catOpText(Oe.text,hn.text),r[N]=void 0}}catch(xr){mn.e(xr)}finally{mn.f()}}}var Kn,Ur=new Map,ki=ns(r);try{for(ki.s();!(Kn=ki.n()).done;){var Ri=Kn.value;if(Ri!=null){if(Ur.get(Ri.index)!=null)throw new Error("should only be one op per index");Ur.set(Ri.index,Ri)}}}catch(xr){ki.e(xr)}finally{ki.f()}return Ur}},{key:"catOpText",value:function(r,d){var a="",h="";return r!=null&&(a=r.toString()),d!=null&&(h=d.toString()),a+h}},{key:"getKindOfOps",value:function(r,d,a){return r.slice(0,a).filter(function(h){return h&&h instanceof d})}}]),l}();el=qm,sp="default",(tl=Xm(tl="DEFAULT_PROGRAM_NAME"))in el?Object.defineProperty(el,tl,{value:sp,enumerable:!0,configurable:!0,writable:!0}):el[tl]=sp;var Ym=function(){function l(r,d,a,h){ru(this,l),this.tokens=r,this.instructionIndex=a,this.index=d,this.text=h===void 0?"":h}return iu(l,[{key:"toString",value:function(){var r=this.constructor.name,d=r.indexOf("$");return"<"+(r=r.substring(d+1,r.length))+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}]),l}(),rs=function(l){ip(d,l);var r=ap(d);function d(a,h,c,m){return ru(this,d),r.call(this,a,h,c,m)}return iu(d,[{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}}]),d}(Ym),Jm=function(l){ip(d,l);var r=ap(d);function d(a,h,c,m){return ru(this,d),r.call(this,a,h+1,c,m)}return iu(d)}(rs),nl=function(l){ip(d,l);var r=ap(d);function d(a,h,c,m,i){var u;return ru(this,d),(u=r.call(this,a,h,m,i)).lastIndex=c,u}return iu(d,[{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+'">'}}]),d}(Ym);const W0={atn:y0,dfa:E0,context:S0,misc:T0,tree:C0,error:P0,Token:n,CommonToken:Is,CharStreams:Vm,CharStream:tu,InputStream:tu,CommonTokenStream:Hm,Lexer:or,Parser:Qh,ParserRuleContext:rp,Interval:ge,IntervalSet:ne,LL1Analyzer:Mo,Utils:M0,TokenStreamRewriter:qm}})();var Cr=kt.dx,up=kt.q2;kt.FO,kt.xf,kt.Gy;var Zm=kt.s4,Qm=kt.c7,cp=kt._7;kt.gp;var e_=kt.cK,t_=kt.zs,n_=kt.AV;kt.Xp,kt.VS,kt.ul;var r_=kt.hW,i_=kt.x1,pi=kt.z5;kt.oN;var o_=kt.TB;kt.u1;var a_=kt._b,s_=kt.$F,Qe=kt._T,lp=kt.db,u_=kt.Zx,et=kt._x;kt.r8,kt.JI,kt.TP;var fp=kt.WU;kt.Nj,kt.ZP;const M=class M extends a_{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 t_(this,e,n)}constructor(e){super(e),this._interp=new s_(this,M._ATN,M.DecisionsToDFA,new lp)}program(){let e=new c_(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 pi(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 rl(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 hp(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!==Cr.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 pi(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 il(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 ol(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 pp(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 is(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 pi(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 po(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 ou(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!==Cr.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 wi(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 f_(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 l_(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 al(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 dp(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!==Cr.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 sl(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!==Cr.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 mp(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!==Cr.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 pi(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 ul(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 os(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 p_(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 h_(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 pi(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 au(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 pi(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,s=new Ve(this,this._ctx,o),f=s,p=34;this.enterRecursionRule(s,34,M.RULE_singleExpression,e);let y;try{let E;this.enterOuterAlt(s,1);{switch(this.state=278,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,29,this._ctx)){case 1:s=new x_(this,s),this._ctx=s,f=s,this.state=267,this.methodStmt();break;case 2:s=new S_(this,s),this._ctx=s,f=s,this.state=268,y=this._input.LA(1),y===12||y===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=269,this.singleExpression(12);break;case 3:s=new T_(this,s),this._ctx=s,f=s,this.state=270,this.match(M.Not),this.state=271,this.singleExpression(11);break;case 4:s=new b_(this,s),this._ctx=s,f=s,this.state=272,this.name();break;case 5:s=new v_(this,s),this._ctx=s,f=s,this.state=273,this.literal();break;case 6:s=new d_(this,s),this._ctx=s,f=s,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),E=this._interp.adaptivePredict(this._input,31,this._ctx);E!==2&&E!==Cr.INVALID_ALT_NUMBER;){if(E===1)switch(this._parseListeners!=null&&this.triggerExitRuleEvent(),f=s,this.state=309,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,30,this._ctx)){case 1:{if(s=new C_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=280,!this.precpred(this._ctx,10))throw this.createFailedPredicateException("this.precpred(this._ctx, 10)");this.state=281,y=this._input.LA(1),!(y&-32)&&1<<y&114688?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=282,this.singleExpression(11)}break;case 2:{if(s=new m_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=283,!this.precpred(this._ctx,9))throw this.createFailedPredicateException("this.precpred(this._ctx, 9)");this.state=284,y=this._input.LA(1),y===12||y===13?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=285,this.singleExpression(10)}break;case 3:{if(s=new __(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=286,!this.precpred(this._ctx,8))throw this.createFailedPredicateException("this.precpred(this._ctx, 8)");this.state=287,y=this._input.LA(1),!(y&-32)&&1<<y&3932160?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=288,this.singleExpression(9)}break;case 4:{if(s=new O_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,M.RULE_singleExpression),this.state=289,!this.precpred(this._ctx,7))throw this.createFailedPredicateException("this.precpred(this._ctx, 7)");this.state=290,y=this._input.LA(1),y===22||y===23?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=291,this.singleExpression(8)}break;case 5:{if(s=new g_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,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(s=new E_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,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(s=new y_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,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(s=new A_(this,new Ve(this,n,o)),this.pushNewRecursionContext(s,p,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),E=this._interp.adaptivePredict(this._input,31,this._ctx)}}}catch(E){if(E instanceof et)s.exception=E,this._errHandler.reportError(this,E),this._errHandler.recover(this,E);else throw E}finally{this.unrollRecursionContexts(n)}return s}brackethesized(){let e=new cl(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 _p(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!==Cr.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 ll(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 pi(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 yp(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!==Cr.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 su(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 D_(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 k_(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 pi(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 gp(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 fl(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 bp(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 vp(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 Ep(this,this._ctx,this.state);this.enterRule(e,54,M.RULE_importStmt);let n;try{let o;this.enterOuterAlt(e,1);{for(this.state=422,this.importElement(),this.state=427,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,47,this._ctx);o!==2&&o!==Cr.INVALID_ALT_NUMBER;)o===1&&(this.state=423,this.match(M.Comma),this.state=424,this.importElement()),this.state=429,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,47,this._ctx);this.state=431,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=430,this.match(M.Comma)),this.state=433,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 hl(this,this._ctx,this.state);this.enterRule(e,56,M.RULE_importElement);let n;try{this.enterOuterAlt(e,1),this.state=435,this.match(M.Import),this.state=436,this.identifier(),this.state=437,this.match(M.Divide),this.state=438,this.identifier(),this.state=439,this.match(M.Divide),this.state=440,this.match(M.IntegerLiteral),this.state=443,this._errHandler.sync(this),n=this._input.LA(1),n===53&&(this.state=441,this.match(M.As),this.state=442,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 Sp(this,this._ctx,this.state);this.enterRule(e,58,M.RULE_literal);let n;try{this.enterOuterAlt(e,1),this.state=445,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 uu(this,this._ctx,this.state);this.enterRule(e,60,M.RULE_methodStmt);try{let n;for(this.enterOuterAlt(e,1),this.state=447,this.methodElement(),this.state=452,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,50,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;)n===1&&(this.state=448,this.match(M.Point),this.state=449,this.methodElement()),this.state=454,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,50,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 as(this,this._ctx,this.state);this.enterRule(e,62,M.RULE_methodElement);try{this.enterOuterAlt(e,1),this.state=455,this.methodName(),this.state=456,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 Tp(this,this._ctx,this.state);this.enterRule(e,64,M.RULE_methodName);let n;try{let o;this.enterOuterAlt(e,1);{switch(this.state=471,this._errHandler.sync(this),this._input.LA(1)){case 51:case 54:case 57:for(this.state=463,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,51,this._ctx);o!==2&&o!==Cr.INVALID_ALT_NUMBER;)o===1&&(this.state=458,this.identifier(),this.state=459,this.match(M.Point)),this.state=465,this._errHandler.sync(this),o=this._interp.adaptivePredict(this._input,51,this._ctx);break;case 6:this.state=466,this.match(M.OpenParen),this.state=467,this.singleExpression(0),this.state=468,this.match(M.CloseParen),this.state=469,this.match(M.Point);break;default:throw new pi(this)}this.state=473,this.identifier(),this.state=482,this._errHandler.sync(this),n=this._input.LA(1),n===18&&(this.state=474,this.match(M.LessThan),this.state=475,this.typeName(),this.state=478,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=476,this.match(M.Comma),this.state=477,this.typeName()),this.state=480,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 Ap(this,this._ctx,this.state);this.enterRule(e,66,M.RULE_arrowFunction);let n;try{this.enterOuterAlt(e,1),this.state=485,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=484,this.match(M.Export)),this.state=487,this.identifier(),this.state=488,this.arrowFunctionParameters(),this.state=489,this.match(M.ARROW),this.state=490,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 xp(this,this._ctx,this.state);this.enterRule(e,68,M.RULE_arrowFunctionParameters);let n;try{this.enterOuterAlt(e,1),this.state=492,this.match(M.OpenParen),this.state=494,this._errHandler.sync(this),n=this._input.LA(1),!(n-51&-32)&&1<<n-51&73&&(this.state=493,this.formalParameterList()),this.state=496,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 pl(this,this._ctx,this.state);this.enterRule(e,70,M.RULE_formalParameterList);let n;try{for(this.enterOuterAlt(e,1),this.state=498,this.formalParameterArg(),this.state=503,this._errHandler.sync(this),n=this._input.LA(1);n===8;)this.state=499,this.match(M.Comma),this.state=500,this.formalParameterArg(),this.state=505,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 dl(this,this._ctx,this.state);this.enterRule(e,72,M.RULE_formalParameterArg);let n;try{this.enterOuterAlt(e,1);{switch(this.state=507,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,58,this._ctx)){case 1:this.state=506,this.typeGather();break}this.state=509,this.identifier(),this.state=512,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=510,this.match(M.Assign),this.state=511,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 Op(this,this._ctx,this.state);this.enterRule(e,74,M.RULE_arrowMethod);let n;try{this.enterOuterAlt(e,1),this.state=515,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=514,this.match(M.Export)),this.state=517,this.match(M.Method),this.state=518,this.identifier(),this.state=519,this.arrowMethodParameters(),this.state=520,this.match(M.ARROW),this.state=521,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 Cp(this,this._ctx,this.state);this.enterRule(e,76,M.RULE_arrowMethodParameters);let n;try{this.enterOuterAlt(e,1),this.state=523,this.match(M.OpenParen),this.state=524,this.typeGather(),this.state=525,this.identifier(),this.state=528,this._errHandler.sync(this),n=this._input.LA(1),n===8&&(this.state=526,this.match(M.Comma),this.state=527,this.formalParameterList()),this.state=530,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 Dp(this,this._ctx,this.state);this.enterRule(e,78,M.RULE_typeStatement);let n;try{this.enterOuterAlt(e,1);{this.state=533,this._errHandler.sync(this),n=this._input.LA(1),n===36&&(this.state=532,this.match(M.Export)),this.state=535,this.match(M.Type),this.state=536,this.identifier(),this.state=537,this.match(M.NEWLINE),this.state=538,this.match(M.INDENT),this.state=540,this._errHandler.sync(this),n=this._input.LA(1);do this.state=539,this.typeElement(),this.state=542,this._errHandler.sync(this),n=this._input.LA(1);while(!(n-40&-32)&&1<<n-40&149505);this.state=544,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 ml(this,this._ctx,this.state);this.enterRule(e,80,M.RULE_typeElement);let n;try{this.enterOuterAlt(e,1),this.state=547,this._errHandler.sync(this),n=this._input.LA(1),n===40&&(this.state=546,this.match(M.Varip)),this.state=549,this.typeGather(),this.state=550,this.identifier(),this.state=553,this._errHandler.sync(this),n=this._input.LA(1),n===9&&(this.state=551,this.match(M.Assign),this.state=552,this.singleExpression(0)),this.state=555,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 _l(this,this._ctx,this.state);this.enterRule(e,82,M.RULE_assignmentOperator);let n;try{this.enterOuterAlt(e,1),this.state=557,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 yl(this,this._ctx,this.state);this.enterRule(e,84,M.RULE_typeMap);try{this.enterOuterAlt(e,1),this.state=559,this.match(M.Map),this.state=560,this.match(M.LessThan),this.state=561,this.typeName(),this.state=562,this.match(M.Comma),this.state=563,this.typeName(),this.state=564,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 kp(this,this._ctx,this.state);this.enterRule(e,86,M.RULE_typeSeries);try{switch(this.enterOuterAlt(e,1),this.state=566,this.typeName(),this.state=570,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,66,this._ctx)){case 1:this.state=567,this.typeName();break;case 2:this.state=568,this.typeArray();break;case 3:this.state=569,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 gl(this,this._ctx,this.state);this.enterRule(e,88,M.RULE_typeArray);try{switch(this.state=581,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,67,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=572,this.typeName(),this.state=573,this.match(M.LessThan),this.state=574,this.typeName(),this.state=575,this.match(M.MoreThan);break;case 2:this.enterOuterAlt(e,2),this.state=577,this.typeName(),this.state=578,this.match(M.OpenBracket),this.state=579,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 jo(this,this._ctx,this.state);this.enterRule(e,90,M.RULE_typeGather);try{switch(this.state=587,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,68,this._ctx)){case 1:this.enterOuterAlt(e,1),this.state=583,this.typeName();break;case 2:this.enterOuterAlt(e,2),this.state=584,this.typeArray();break;case 3:this.enterOuterAlt(e,3),this.state=585,this.typeMap();break;case 4:this.enterOuterAlt(e,4),this.state=586,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=589,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 di(this,this._ctx,this.state);this.enterRule(e,94,M.RULE_typeName);let n;try{this.enterOuterAlt(e,1),this.state=591,this.identifier(),this.state=594,this._errHandler.sync(this),n=this._input.LA(1),n===3&&(this.state=592,this.match(M.Point),this.state=593,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 cu(this,this._ctx,this.state);this.enterRule(e,96,M.RULE_name);try{let n;switch(this.state=617,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,73,this._ctx)){case 1:this.enterOuterAlt(e,1);{for(this.state=604,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx);n!==2&&n!==Cr.INVALID_ALT_NUMBER;){if(n===1){switch(this.state=598,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,70,this._ctx)){case 1:this.state=596,this.identifier();break;case 2:this.state=597,this.methodElement();break}this.state=600,this.match(M.Point)}this.state=606,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,71,this._ctx)}this.state=607,this.identifier()}break;case 2:this.enterOuterAlt(e,2);{this.state=608,this.match(M.OpenParen),this.state=609,this.singleExpression(0),this.state=610,this.match(M.CloseParen),this.state=613,this._errHandler.sync(this),n=1;do{switch(n){case 1:this.state=611,this.match(M.Point),this.state=612,this.identifier();break;default:throw new pi(this)}this.state=615,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,72,this._ctx)}while(n!==2&&n!==Cr.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 up().deserialize(M._serializedATN)),M.__ATN}};k(M,"INDENT",1),k(M,"DEDENT",2),k(M,"Point",3),k(M,"OpenBracket",4),k(M,"CloseBracket",5),k(M,"OpenParen",6),k(M,"CloseParen",7),k(M,"Comma",8),k(M,"Assign",9),k(M,"QuestionMark",10),k(M,"Colon",11),k(M,"Plus",12),k(M,"Minus",13),k(M,"Multiply",14),k(M,"Divide",15),k(M,"Modulus",16),k(M,"Hashtag",17),k(M,"LessThan",18),k(M,"MoreThan",19),k(M,"LessThanEquals",20),k(M,"GreaterThanEquals",21),k(M,"Equals_",22),k(M,"NotEquals",23),k(M,"MultiplyAssign",24),k(M,"DivideAssign",25),k(M,"ModulusAssign",26),k(M,"PlusAssign",27),k(M,"MinusAssign",28),k(M,"ARROW",29),k(M,"ColonEquals",30),k(M,"BooleanLiteral",31),k(M,"IntegerLiteral",32),k(M,"DecimalLiteral",33),k(M,"Break",34),k(M,"And",35),k(M,"Export",36),k(M,"For",37),k(M,"Var",38),k(M,"Continue",39),k(M,"Varip",40),k(M,"Switch",41),k(M,"While",42),k(M,"If",43),k(M,"In",44),k(M,"Or",45),k(M,"Not",46),k(M,"Method",47),k(M,"Else",48),k(M,"To",49),k(M,"By",50),k(M,"Type",51),k(M,"Import",52),k(M,"As",53),k(M,"Map",54),k(M,"ColorLiteral",55),k(M,"StringLiteral",56),k(M,"Identifier",57),k(M,"HIDDEN_",58),k(M,"COMMENT_",59),k(M,"NEWLINE",60),k(M,"EOF",fp.EOF),k(M,"RULE_program",0),k(M,"RULE_globalStmt",1),k(M,"RULE_blockStmt",2),k(M,"RULE_stmt",3),k(M,"RULE_simpleStmt",4),k(M,"RULE_flowStmt",5),k(M,"RULE_block",6),k(M,"RULE_blockLine",7),k(M,"RULE_variableDeclarationStmt",8),k(M,"RULE_variableDeclarationList",9),k(M,"RULE_varModifier",10),k(M,"RULE_blockSequence",11),k(M,"RULE_expressionSequence",12),k(M,"RULE_expressionBlockSequence",13),k(M,"RULE_varBlockStmt",14),k(M,"RULE_varArrayDeclaration",15),k(M,"RULE_blockExpression",16),k(M,"RULE_singleExpression",17),k(M,"RULE_brackethesized",18),k(M,"RULE_arguments",19),k(M,"RULE_argument",20),k(M,"RULE_ifStatement",21),k(M,"RULE_forStatement",22),k(M,"RULE_switchStatement",23),k(M,"RULE_caseClause",24),k(M,"RULE_defaultCaluse",25),k(M,"RULE_whileStatement",26),k(M,"RULE_importStmt",27),k(M,"RULE_importElement",28),k(M,"RULE_literal",29),k(M,"RULE_methodStmt",30),k(M,"RULE_methodElement",31),k(M,"RULE_methodName",32),k(M,"RULE_arrowFunction",33),k(M,"RULE_arrowFunctionParameters",34),k(M,"RULE_formalParameterList",35),k(M,"RULE_formalParameterArg",36),k(M,"RULE_arrowMethod",37),k(M,"RULE_arrowMethodParameters",38),k(M,"RULE_typeStatement",39),k(M,"RULE_typeElement",40),k(M,"RULE_assignmentOperator",41),k(M,"RULE_typeMap",42),k(M,"RULE_typeSeries",43),k(M,"RULE_typeArray",44),k(M,"RULE_typeGather",45),k(M,"RULE_identifier",46),k(M,"RULE_typeName",47),k(M,"RULE_name",48),k(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'"]),k(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_","COMMENT_","NEWLINE"]),k(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"]),k(M,"_serializedATN",[4,1,60,620,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,3,27,432,8,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,28,1,28,3,28,444,8,28,1,29,1,29,1,30,1,30,1,30,5,30,451,8,30,10,30,12,30,454,9,30,1,31,1,31,1,31,1,32,1,32,1,32,5,32,462,8,32,10,32,12,32,465,9,32,1,32,1,32,1,32,1,32,1,32,3,32,472,8,32,1,32,1,32,1,32,1,32,1,32,3,32,479,8,32,1,32,1,32,3,32,483,8,32,1,33,3,33,486,8,33,1,33,1,33,1,33,1,33,1,33,1,34,1,34,3,34,495,8,34,1,34,1,34,1,35,1,35,1,35,5,35,502,8,35,10,35,12,35,505,9,35,1,36,3,36,508,8,36,1,36,1,36,1,36,3,36,513,8,36,1,37,3,37,516,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,529,8,38,1,38,1,38,1,39,3,39,534,8,39,1,39,1,39,1,39,1,39,1,39,4,39,541,8,39,11,39,12,39,542,1,39,1,39,1,40,3,40,548,8,40,1,40,1,40,1,40,1,40,3,40,554,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,571,8,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,582,8,44,1,45,1,45,1,45,1,45,3,45,588,8,45,1,46,1,46,1,47,1,47,1,47,3,47,595,8,47,1,48,1,48,3,48,599,8,48,1,48,1,48,5,48,603,8,48,10,48,12,48,606,9,48,1,48,1,48,1,48,1,48,1,48,1,48,4,48,614,8,48,11,48,12,48,615,3,48,618,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,665,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,435,1,0,0,0,58,445,1,0,0,0,60,447,1,0,0,0,62,455,1,0,0,0,64,471,1,0,0,0,66,485,1,0,0,0,68,492,1,0,0,0,70,498,1,0,0,0,72,507,1,0,0,0,74,515,1,0,0,0,76,523,1,0,0,0,78,533,1,0,0,0,80,547,1,0,0,0,82,557,1,0,0,0,84,559,1,0,0,0,86,566,1,0,0,0,88,581,1,0,0,0,90,587,1,0,0,0,92,589,1,0,0,0,94,591,1,0,0,0,96,617,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,431,1,0,0,0,429,427,1,0,0,0,430,432,5,8,0,0,431,430,1,0,0,0,431,432,1,0,0,0,432,433,1,0,0,0,433,434,5,60,0,0,434,55,1,0,0,0,435,436,5,52,0,0,436,437,3,92,46,0,437,438,5,15,0,0,438,439,3,92,46,0,439,440,5,15,0,0,440,443,5,32,0,0,441,442,5,53,0,0,442,444,3,92,46,0,443,441,1,0,0,0,443,444,1,0,0,0,444,57,1,0,0,0,445,446,7,6,0,0,446,59,1,0,0,0,447,452,3,62,31,0,448,449,5,3,0,0,449,451,3,62,31,0,450,448,1,0,0,0,451,454,1,0,0,0,452,450,1,0,0,0,452,453,1,0,0,0,453,61,1,0,0,0,454,452,1,0,0,0,455,456,3,64,32,0,456,457,3,38,19,0,457,63,1,0,0,0,458,459,3,92,46,0,459,460,5,3,0,0,460,462,1,0,0,0,461,458,1,0,0,0,462,465,1,0,0,0,463,461,1,0,0,0,463,464,1,0,0,0,464,472,1,0,0,0,465,463,1,0,0,0,466,467,5,6,0,0,467,468,3,34,17,0,468,469,5,7,0,0,469,470,5,3,0,0,470,472,1,0,0,0,471,463,1,0,0,0,471,466,1,0,0,0,472,473,1,0,0,0,473,482,3,92,46,0,474,475,5,18,0,0,475,478,3,94,47,0,476,477,5,8,0,0,477,479,3,94,47,0,478,476,1,0,0,0,478,479,1,0,0,0,479,480,1,0,0,0,480,481,5,19,0,0,481,483,1,0,0,0,482,474,1,0,0,0,482,483,1,0,0,0,483,65,1,0,0,0,484,486,5,36,0,0,485,484,1,0,0,0,485,486,1,0,0,0,486,487,1,0,0,0,487,488,3,92,46,0,488,489,3,68,34,0,489,490,5,29,0,0,490,491,3,12,6,0,491,67,1,0,0,0,492,494,5,6,0,0,493,495,3,70,35,0,494,493,1,0,0,0,494,495,1,0,0,0,495,496,1,0,0,0,496,497,5,7,0,0,497,69,1,0,0,0,498,503,3,72,36,0,499,500,5,8,0,0,500,502,3,72,36,0,501,499,1,0,0,0,502,505,1,0,0,0,503,501,1,0,0,0,503,504,1,0,0,0,504,71,1,0,0,0,505,503,1,0,0,0,506,508,3,90,45,0,507,506,1,0,0,0,507,508,1,0,0,0,508,509,1,0,0,0,509,512,3,92,46,0,510,511,5,9,0,0,511,513,3,34,17,0,512,510,1,0,0,0,512,513,1,0,0,0,513,73,1,0,0,0,514,516,5,36,0,0,515,514,1,0,0,0,515,516,1,0,0,0,516,517,1,0,0,0,517,518,5,47,0,0,518,519,3,92,46,0,519,520,3,76,38,0,520,521,5,29,0,0,521,522,3,12,6,0,522,75,1,0,0,0,523,524,5,6,0,0,524,525,3,90,45,0,525,528,3,92,46,0,526,527,5,8,0,0,527,529,3,70,35,0,528,526,1,0,0,0,528,529,1,0,0,0,529,530,1,0,0,0,530,531,5,7,0,0,531,77,1,0,0,0,532,534,5,36,0,0,533,532,1,0,0,0,533,534,1,0,0,0,534,535,1,0,0,0,535,536,5,51,0,0,536,537,3,92,46,0,537,538,5,60,0,0,538,540,5,1,0,0,539,541,3,80,40,0,540,539,1,0,0,0,541,542,1,0,0,0,542,540,1,0,0,0,542,543,1,0,0,0,543,544,1,0,0,0,544,545,5,2,0,0,545,79,1,0,0,0,546,548,5,40,0,0,547,546,1,0,0,0,547,548,1,0,0,0,548,549,1,0,0,0,549,550,3,90,45,0,550,553,3,92,46,0,551,552,5,9,0,0,552,554,3,34,17,0,553,551,1,0,0,0,553,554,1,0,0,0,554,555,1,0,0,0,555,556,5,60,0,0,556,81,1,0,0,0,557,558,7,7,0,0,558,83,1,0,0,0,559,560,5,54,0,0,560,561,5,18,0,0,561,562,3,94,47,0,562,563,5,8,0,0,563,564,3,94,47,0,564,565,5,19,0,0,565,85,1,0,0,0,566,570,3,94,47,0,567,571,3,94,47,0,568,571,3,88,44,0,569,571,3,84,42,0,570,567,1,0,0,0,570,568,1,0,0,0,570,569,1,0,0,0,571,87,1,0,0,0,572,573,3,94,47,0,573,574,5,18,0,0,574,575,3,94,47,0,575,576,5,19,0,0,576,582,1,0,0,0,577,578,3,94,47,0,578,579,5,4,0,0,579,580,5,5,0,0,580,582,1,0,0,0,581,572,1,0,0,0,581,577,1,0,0,0,582,89,1,0,0,0,583,588,3,94,47,0,584,588,3,88,44,0,585,588,3,84,42,0,586,588,3,86,43,0,587,583,1,0,0,0,587,584,1,0,0,0,587,585,1,0,0,0,587,586,1,0,0,0,588,91,1,0,0,0,589,590,7,8,0,0,590,93,1,0,0,0,591,594,3,92,46,0,592,593,5,3,0,0,593,595,3,92,46,0,594,592,1,0,0,0,594,595,1,0,0,0,595,95,1,0,0,0,596,599,3,92,46,0,597,599,3,62,31,0,598,596,1,0,0,0,598,597,1,0,0,0,599,600,1,0,0,0,600,601,5,3,0,0,601,603,1,0,0,0,602,598,1,0,0,0,603,606,1,0,0,0,604,602,1,0,0,0,604,605,1,0,0,0,605,607,1,0,0,0,606,604,1,0,0,0,607,618,3,92,46,0,608,609,5,6,0,0,609,610,3,34,17,0,610,613,5,7,0,0,611,612,5,3,0,0,612,614,3,92,46,0,613,611,1,0,0,0,614,615,1,0,0,0,615,613,1,0,0,0,615,616,1,0,0,0,616,618,1,0,0,0,617,604,1,0,0,0,617,608,1,0,0,0,618,97,1,0,0,0,74,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,431,443,452,463,471,478,482,485,494,503,507,512,515,528,533,542,547,553,570,581,587,594,598,604,615,617]),k(M,"__ATN"),k(M,"DecisionsToDFA",M._ATN.decisionToState.map((e,n)=>new cp(e,n)));let F=M;class c_ extends Qe{constructor(e,n,o){super(n,o),this.parser=e}EOF(){return this.getToken(F.EOF,0)}NEWLINE_list(){return this.getTokens(F.NEWLINE)}NEWLINE(e){return this.getToken(F.NEWLINE,e)}globalStmt_list(){return this.getTypedRuleContexts(rl)}globalStmt(e){return this.getTypedRuleContext(rl,e)}get ruleIndex(){return F.RULE_program}accept(e){return e.visitProgram?e.visitProgram(this):e.visitChildren(this)}}class rl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}variableDeclarationStmt(){return this.getTypedRuleContext(ou,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma(){return this.getToken(F.Comma,0)}blockStmt(){return this.getTypedRuleContext(hp,0)}importStmt(){return this.getTypedRuleContext(Ep,0)}arrowFunction(){return this.getTypedRuleContext(Ap,0)}arrowMethod(){return this.getTypedRuleContext(Op,0)}typeStatement(){return this.getTypedRuleContext(Dp,0)}get ruleIndex(){return F.RULE_globalStmt}accept(e){return e.visitGlobalStmt?e.visitGlobalStmt(this):e.visitChildren(this)}}class hp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ul,0)}blockExpression(){return this.getTypedRuleContext(au,0)}variableDeclarationStmt_list(){return this.getTypedRuleContexts(ou)}variableDeclarationStmt(e){return this.getTypedRuleContext(ou,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_blockStmt}accept(e){return e.visitBlockStmt?e.visitBlockStmt(this):e.visitChildren(this)}}class il extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(ol,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma(){return this.getToken(F.Comma,0)}expressionBlockSequence(){return this.getTypedRuleContext(mp,0)}get ruleIndex(){return F.RULE_stmt}accept(e){return e.visitStmt?e.visitStmt(this):e.visitChildren(this)}}class ol extends Qe{constructor(e,n,o){super(n,o),this.parser=e}expressionSequence(){return this.getTypedRuleContext(sl,0)}blockSequence(){return this.getTypedRuleContext(dp,0)}brackethesized(){return this.getTypedRuleContext(cl,0)}flowStmt(){return this.getTypedRuleContext(pp,0)}get ruleIndex(){return F.RULE_simpleStmt}accept(e){return e.visitSimpleStmt?e.visitSimpleStmt(this):e.visitChildren(this)}}class pp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Break(){return this.getToken(F.Break,0)}Continue(){return this.getToken(F.Continue,0)}get ruleIndex(){return F.RULE_flowStmt}accept(e){return e.visitFlowStmt?e.visitFlowStmt(this):e.visitChildren(this)}}class is extends Qe{constructor(e,n,o){super(n,o),this.parser=e}simpleStmt(){return this.getTypedRuleContext(ol,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma(){return this.getToken(F.Comma,0)}blockLine(){return this.getTypedRuleContext(po,0)}get ruleIndex(){return F.RULE_block}accept(e){return e.visitBlock?e.visitBlock(this):e.visitChildren(this)}}class po extends Qe{constructor(e,n,o){super(n,o),this.parser=e}NEWLINE(){return this.getToken(F.NEWLINE,0)}INDENT(){return this.getToken(F.INDENT,0)}DEDENT(){return this.getToken(F.DEDENT,0)}stmt_list(){return this.getTypedRuleContexts(il)}stmt(e){return this.getTypedRuleContext(il,e)}get ruleIndex(){return F.RULE_blockLine}accept(e){return e.visitBlockLine?e.visitBlockLine(this):e.visitChildren(this)}}class ou extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodStmt_list(){return this.getTypedRuleContexts(uu)}methodStmt(e){return this.getTypedRuleContext(uu,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(wi)}variableDeclarationList(e){return this.getTypedRuleContext(wi,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_variableDeclarationStmt}accept(e){return e.visitVariableDeclarationStmt?e.visitVariableDeclarationStmt(this):e.visitChildren(this)}}class wi extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_variableDeclarationList}copyFrom(e){super.copyFrom(e)}}class l_ extends wi{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(cu,0)}assignmentOperator(){return this.getTypedRuleContext(_l,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitAgainAssign?e.visitAgainAssign(this):e.visitChildren(this)}}class f_ extends wi{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}varArrayDeclaration(){return this.getTypedRuleContext(os,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitDeclareAssign?e.visitDeclareAssign(this):e.visitChildren(this)}}class al extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Var(){return this.getToken(F.Var,0)}Varip(){return this.getToken(F.Varip,0)}get ruleIndex(){return F.RULE_varModifier}accept(e){return e.visitVarModifier?e.visitVarModifier(this):e.visitChildren(this)}}class dp 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(wi)}variableDeclarationList(e){return this.getTypedRuleContext(wi,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_blockSequence}accept(e){return e.visitBlockSequence?e.visitBlockSequence(this):e.visitChildren(this)}}class sl 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(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_expressionSequence}accept(e){return e.visitExpressionSequence?e.visitExpressionSequence(this):e.visitChildren(this)}}class mp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}varBlockStmt(){return this.getTypedRuleContext(ul,0)}blockExpression(){return this.getTypedRuleContext(au,0)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}variableDeclarationList_list(){return this.getTypedRuleContexts(wi)}variableDeclarationList(e){return this.getTypedRuleContext(wi,e)}get ruleIndex(){return F.RULE_expressionBlockSequence}accept(e){return e.visitExpressionBlockSequence?e.visitExpressionBlockSequence(this):e.visitChildren(this)}}class ul extends Qe{constructor(e,n,o){super(n,o),this.parser=e}blockExpression(){return this.getTypedRuleContext(au,0)}varArrayDeclaration(){return this.getTypedRuleContext(os,0)}Assign(){return this.getToken(F.Assign,0)}name(){return this.getTypedRuleContext(cu,0)}assignmentOperator(){return this.getTypedRuleContext(_l,0)}get ruleIndex(){return F.RULE_varBlockStmt}accept(e){return e.visitVarBlockStmt?e.visitVarBlockStmt(this):e.visitChildren(this)}}class os extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_varArrayDeclaration}copyFrom(e){super.copyFrom(e)}}class h_ extends os{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenBracket(){return this.getToken(F.OpenBracket,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}CloseBracket(){return this.getToken(F.CloseBracket,0)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}accept(e){return e.visitVarMultiple?e.visitVarMultiple(this):e.visitChildren(this)}}class p_ extends os{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}identifier(){return this.getTypedRuleContext(xn,0)}varModifier(){return this.getTypedRuleContext(al,0)}typeGather(){return this.getTypedRuleContext(jo,0)}accept(e){return e.visitVarSingle?e.visitVarSingle(this):e.visitChildren(this)}}class au extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ifStatement(){return this.getTypedRuleContext(yp,0)}forStatement(){return this.getTypedRuleContext(su,0)}whileStatement(){return this.getTypedRuleContext(vp,0)}switchStatement(){return this.getTypedRuleContext(gp,0)}get ruleIndex(){return F.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 F.RULE_singleExpression}copyFrom(e){super.copyFrom(e)}}class d_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}OpenParen(){return this.getToken(F.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(F.CloseParen,0)}accept(e){return e.visitParenthesizedExpression?e.visitParenthesizedExpression(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)}Plus(){return this.getToken(F.Plus,0)}Minus(){return this.getToken(F.Minus,0)}accept(e){return e.visitAdditiveExpression?e.visitAdditiveExpression(this):e.visitChildren(this)}}class __ 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(F.LessThan,0)}MoreThan(){return this.getToken(F.MoreThan,0)}LessThanEquals(){return this.getToken(F.LessThanEquals,0)}GreaterThanEquals(){return this.getToken(F.GreaterThanEquals,0)}accept(e){return e.visitRelationalExpression?e.visitRelationalExpression(this):e.visitChildren(this)}}class y_ 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(F.QuestionMark,0)}Colon(){return this.getToken(F.Colon,0)}accept(e){return e.visitTernaryExpression?e.visitTernaryExpression(this):e.visitChildren(this)}}class g_ 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(F.And,0)}accept(e){return e.visitLogicalAndExpression?e.visitLogicalAndExpression(this):e.visitChildren(this)}}class b_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}name(){return this.getTypedRuleContext(cu,0)}accept(e){return e.visitNameExpression?e.visitNameExpression(this):e.visitChildren(this)}}class v_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}literal(){return this.getTypedRuleContext(Sp,0)}accept(e){return e.visitLiteralExpression?e.visitLiteralExpression(this):e.visitChildren(this)}}class E_ 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(F.Or,0)}accept(e){return e.visitLogicalOrExpression?e.visitLogicalOrExpression(this):e.visitChildren(this)}}class S_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}singleExpression(){return this.getTypedRuleContext(Ve,0)}Minus(){return this.getToken(F.Minus,0)}Plus(){return this.getToken(F.Plus,0)}accept(e){return e.visitUnaryExpression?e.visitUnaryExpression(this):e.visitChildren(this)}}class T_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}Not(){return this.getToken(F.Not,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}accept(e){return e.visitNotExpression?e.visitNotExpression(this):e.visitChildren(this)}}class A_ 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(F.OpenBracket,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}accept(e){return e.visitMemberIndexExpression?e.visitMemberIndexExpression(this):e.visitChildren(this)}}class x_ extends Ve{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}methodStmt(){return this.getTypedRuleContext(uu,0)}accept(e){return e.visitMethodExpression?e.visitMethodExpression(this):e.visitChildren(this)}}class O_ 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(F.Equals_,0)}NotEquals(){return this.getToken(F.NotEquals,0)}accept(e){return e.visitEqualityExpression?e.visitEqualityExpression(this):e.visitChildren(this)}}class C_ 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(F.Multiply,0)}Divide(){return this.getToken(F.Divide,0)}Modulus(){return this.getToken(F.Modulus,0)}accept(e){return e.visitMultiplicativeExpression?e.visitMultiplicativeExpression(this):e.visitChildren(this)}}class cl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenBracket(){return this.getToken(F.OpenBracket,0)}expressionSequence(){return this.getTypedRuleContext(sl,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}get ruleIndex(){return F.RULE_brackethesized}accept(e){return e.visitBrackethesized?e.visitBrackethesized(this):e.visitChildren(this)}}class _p extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(F.OpenParen,0)}CloseParen(){return this.getToken(F.CloseParen,0)}argument_list(){return this.getTypedRuleContexts(ll)}argument(e){return this.getTypedRuleContext(ll,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_arguments}accept(e){return e.visitArguments?e.visitArguments(this):e.visitChildren(this)}}class ll extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}brackethesized(){return this.getTypedRuleContext(cl,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(F.Assign,0)}get ruleIndex(){return F.RULE_argument}accept(e){return e.visitArgument?e.visitArgument(this):e.visitChildren(this)}}class yp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}If_list(){return this.getTokens(F.If)}If(e){return this.getToken(F.If,e)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}blockLine_list(){return this.getTypedRuleContexts(po)}blockLine(e){return this.getTypedRuleContext(po,e)}Else_list(){return this.getTokens(F.Else)}Else(e){return this.getToken(F.Else,e)}get ruleIndex(){return F.RULE_ifStatement}accept(e){return e.visitIfStatement?e.visitIfStatement(this):e.visitChildren(this)}}class su extends Qe{constructor(e,n,o){super(n,o),this.parser=e}get ruleIndex(){return F.RULE_forStatement}copyFrom(e){super.copyFrom(e)}}class D_ extends su{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(F.For,0)}identifier(){return this.getTypedRuleContext(xn,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression_list(){return this.getTypedRuleContexts(Ve)}singleExpression(e){return this.getTypedRuleContext(Ve,e)}To(){return this.getToken(F.To,0)}blockLine(){return this.getTypedRuleContext(po,0)}varModifier(){return this.getTypedRuleContext(al,0)}typeGather(){return this.getTypedRuleContext(jo,0)}By(){return this.getToken(F.By,0)}accept(e){return e.visitForToStatement?e.visitForToStatement(this):e.visitChildren(this)}}class k_ extends su{constructor(e,n){super(e,n.parentCtx,n.invokingState),super.copyFrom(n)}For(){return this.getToken(F.For,0)}In(){return this.getToken(F.In,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(po,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}OpenBracket(){return this.getToken(F.OpenBracket,0)}Comma(){return this.getToken(F.Comma,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}accept(e){return e.visitForInStatement?e.visitForInStatement(this):e.visitChildren(this)}}class gp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Switch(){return this.getToken(F.Switch,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}INDENT(){return this.getToken(F.INDENT,0)}DEDENT(){return this.getToken(F.DEDENT,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}caseClause_list(){return this.getTypedRuleContexts(fl)}caseClause(e){return this.getTypedRuleContext(fl,e)}defaultCaluse(){return this.getTypedRuleContext(bp,0)}get ruleIndex(){return F.RULE_switchStatement}accept(e){return e.visitSwitchStatement?e.visitSwitchStatement(this):e.visitChildren(this)}}class fl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}singleExpression(){return this.getTypedRuleContext(Ve,0)}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}get ruleIndex(){return F.RULE_caseClause}accept(e){return e.visitCaseClause?e.visitCaseClause(this):e.visitChildren(this)}}class bp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}get ruleIndex(){return F.RULE_defaultCaluse}accept(e){return e.visitDefaultCaluse?e.visitDefaultCaluse(this):e.visitChildren(this)}}class vp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}While(){return this.getToken(F.While,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}blockLine(){return this.getTypedRuleContext(po,0)}get ruleIndex(){return F.RULE_whileStatement}accept(e){return e.visitWhileStatement?e.visitWhileStatement(this):e.visitChildren(this)}}class Ep extends Qe{constructor(e,n,o){super(n,o),this.parser=e}importElement_list(){return this.getTypedRuleContexts(hl)}importElement(e){return this.getTypedRuleContext(hl,e)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_importStmt}accept(e){return e.visitImportStmt?e.visitImportStmt(this):e.visitChildren(this)}}class hl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Import(){return this.getToken(F.Import,0)}identifier_list(){return this.getTypedRuleContexts(xn)}identifier(e){return this.getTypedRuleContext(xn,e)}Divide_list(){return this.getTokens(F.Divide)}Divide(e){return this.getToken(F.Divide,e)}IntegerLiteral(){return this.getToken(F.IntegerLiteral,0)}As(){return this.getToken(F.As,0)}get ruleIndex(){return F.RULE_importElement}accept(e){return e.visitImportElement?e.visitImportElement(this):e.visitChildren(this)}}class Sp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}BooleanLiteral(){return this.getToken(F.BooleanLiteral,0)}ColorLiteral(){return this.getToken(F.ColorLiteral,0)}StringLiteral(){return this.getToken(F.StringLiteral,0)}IntegerLiteral(){return this.getToken(F.IntegerLiteral,0)}DecimalLiteral(){return this.getToken(F.DecimalLiteral,0)}get ruleIndex(){return F.RULE_literal}accept(e){return e.visitLiteral?e.visitLiteral(this):e.visitChildren(this)}}class uu extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodElement_list(){return this.getTypedRuleContexts(as)}methodElement(e){return this.getTypedRuleContext(as,e)}Point_list(){return this.getTokens(F.Point)}Point(e){return this.getToken(F.Point,e)}get ruleIndex(){return F.RULE_methodStmt}accept(e){return e.visitMethodStmt?e.visitMethodStmt(this):e.visitChildren(this)}}class as extends Qe{constructor(e,n,o){super(n,o),this.parser=e}methodName(){return this.getTypedRuleContext(Tp,0)}arguments(){return this.getTypedRuleContext(_p,0)}get ruleIndex(){return F.RULE_methodElement}accept(e){return e.visitMethodElement?e.visitMethodElement(this):e.visitChildren(this)}}class Tp 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(F.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(F.CloseParen,0)}Point_list(){return this.getTokens(F.Point)}Point(e){return this.getToken(F.Point,e)}LessThan(){return this.getToken(F.LessThan,0)}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}MoreThan(){return this.getToken(F.MoreThan,0)}Comma(){return this.getToken(F.Comma,0)}get ruleIndex(){return F.RULE_methodName}accept(e){return e.visitMethodName?e.visitMethodName(this):e.visitChildren(this)}}class Ap extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}arrowFunctionParameters(){return this.getTypedRuleContext(xp,0)}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}Export(){return this.getToken(F.Export,0)}get ruleIndex(){return F.RULE_arrowFunction}accept(e){return e.visitArrowFunction?e.visitArrowFunction(this):e.visitChildren(this)}}class xp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(F.OpenParen,0)}CloseParen(){return this.getToken(F.CloseParen,0)}formalParameterList(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return F.RULE_arrowFunctionParameters}accept(e){return e.visitArrowFunctionParameters?e.visitArrowFunctionParameters(this):e.visitChildren(this)}}class pl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}formalParameterArg_list(){return this.getTypedRuleContexts(dl)}formalParameterArg(e){return this.getTypedRuleContext(dl,e)}Comma_list(){return this.getTokens(F.Comma)}Comma(e){return this.getToken(F.Comma,e)}get ruleIndex(){return F.RULE_formalParameterList}accept(e){return e.visitFormalParameterList?e.visitFormalParameterList(this):e.visitChildren(this)}}class dl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}identifier(){return this.getTypedRuleContext(xn,0)}typeGather(){return this.getTypedRuleContext(jo,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return F.RULE_formalParameterArg}accept(e){return e.visitFormalParameterArg?e.visitFormalParameterArg(this):e.visitChildren(this)}}class Op extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Method(){return this.getToken(F.Method,0)}identifier(){return this.getTypedRuleContext(xn,0)}arrowMethodParameters(){return this.getTypedRuleContext(Cp,0)}ARROW(){return this.getToken(F.ARROW,0)}block(){return this.getTypedRuleContext(is,0)}Export(){return this.getToken(F.Export,0)}get ruleIndex(){return F.RULE_arrowMethod}accept(e){return e.visitArrowMethod?e.visitArrowMethod(this):e.visitChildren(this)}}class Cp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}OpenParen(){return this.getToken(F.OpenParen,0)}typeGather(){return this.getTypedRuleContext(jo,0)}identifier(){return this.getTypedRuleContext(xn,0)}CloseParen(){return this.getToken(F.CloseParen,0)}Comma(){return this.getToken(F.Comma,0)}formalParameterList(){return this.getTypedRuleContext(pl,0)}get ruleIndex(){return F.RULE_arrowMethodParameters}accept(e){return e.visitArrowMethodParameters?e.visitArrowMethodParameters(this):e.visitChildren(this)}}class Dp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Type(){return this.getToken(F.Type,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}INDENT(){return this.getToken(F.INDENT,0)}DEDENT(){return this.getToken(F.DEDENT,0)}Export(){return this.getToken(F.Export,0)}typeElement_list(){return this.getTypedRuleContexts(ml)}typeElement(e){return this.getTypedRuleContext(ml,e)}get ruleIndex(){return F.RULE_typeStatement}accept(e){return e.visitTypeStatement?e.visitTypeStatement(this):e.visitChildren(this)}}class ml extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeGather(){return this.getTypedRuleContext(jo,0)}identifier(){return this.getTypedRuleContext(xn,0)}NEWLINE(){return this.getToken(F.NEWLINE,0)}Varip(){return this.getToken(F.Varip,0)}Assign(){return this.getToken(F.Assign,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}get ruleIndex(){return F.RULE_typeElement}accept(e){return e.visitTypeElement?e.visitTypeElement(this):e.visitChildren(this)}}class _l extends Qe{constructor(e,n,o){super(n,o),this.parser=e}ColonEquals(){return this.getToken(F.ColonEquals,0)}MultiplyAssign(){return this.getToken(F.MultiplyAssign,0)}DivideAssign(){return this.getToken(F.DivideAssign,0)}ModulusAssign(){return this.getToken(F.ModulusAssign,0)}PlusAssign(){return this.getToken(F.PlusAssign,0)}MinusAssign(){return this.getToken(F.MinusAssign,0)}get ruleIndex(){return F.RULE_assignmentOperator}accept(e){return e.visitAssignmentOperator?e.visitAssignmentOperator(this):e.visitChildren(this)}}class yl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}Map(){return this.getToken(F.Map,0)}LessThan(){return this.getToken(F.LessThan,0)}Comma(){return this.getToken(F.Comma,0)}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}MoreThan(){return this.getToken(F.MoreThan,0)}get ruleIndex(){return F.RULE_typeMap}accept(e){return e.visitTypeMap?e.visitTypeMap(this):e.visitChildren(this)}}class kp extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}typeArray(){return this.getTypedRuleContext(gl,0)}typeMap(){return this.getTypedRuleContext(yl,0)}get ruleIndex(){return F.RULE_typeSeries}accept(e){return e.visitTypeSeries?e.visitTypeSeries(this):e.visitChildren(this)}}class gl extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName_list(){return this.getTypedRuleContexts(di)}typeName(e){return this.getTypedRuleContext(di,e)}LessThan(){return this.getToken(F.LessThan,0)}MoreThan(){return this.getToken(F.MoreThan,0)}OpenBracket(){return this.getToken(F.OpenBracket,0)}CloseBracket(){return this.getToken(F.CloseBracket,0)}get ruleIndex(){return F.RULE_typeArray}accept(e){return e.visitTypeArray?e.visitTypeArray(this):e.visitChildren(this)}}class jo extends Qe{constructor(e,n,o){super(n,o),this.parser=e}typeName(){return this.getTypedRuleContext(di,0)}typeArray(){return this.getTypedRuleContext(gl,0)}typeMap(){return this.getTypedRuleContext(yl,0)}typeSeries(){return this.getTypedRuleContext(kp,0)}get ruleIndex(){return F.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(F.Identifier,0)}Map(){return this.getToken(F.Map,0)}Type(){return this.getToken(F.Type,0)}get ruleIndex(){return F.RULE_identifier}accept(e){return e.visitIdentifier?e.visitIdentifier(this):e.visitChildren(this)}}class di 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(F.Point,0)}get ruleIndex(){return F.RULE_typeName}accept(e){return e.visitTypeName?e.visitTypeName(this):e.visitChildren(this)}}class cu 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(F.Point)}Point(e){return this.getToken(F.Point,e)}methodElement_list(){return this.getTypedRuleContexts(as)}methodElement(e){return this.getTypedRuleContext(as,e)}OpenParen(){return this.getToken(F.OpenParen,0)}singleExpression(){return this.getTypedRuleContext(Ve,0)}CloseParen(){return this.getToken(F.CloseParen,0)}get ruleIndex(){return F.RULE_name}accept(e){return e.visitName?e.visitName(this):e.visitChildren(this)}}class R_ extends r_{constructor(n){super(n);k(this,"tokens");k(this,"indents");k(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)===F.EOF&&this.indents.length){for(this.tokens=this.tokens.filter(function(o){return o.type!==F.EOF}),this.emitToken(this.commonToken(F.NEWLINE,`
11
11
  `));this.indents.length;)this.emitToken(this.createDedent()),this.indents.pop();this.emitToken(this.commonToken(F.EOF,"<EOF>"))}const n=super.nextToken();return this.tokens.length?this.tokens.shift():n}createDedent(){return this.commonToken(F.DEDENT,"")}getCharIndex(){return this._input.index}commonToken(n,o){const s=this.getCharIndex()-1,f=o.length?s-o.length+1:s;return new Zm([this,this._input],n,0,f,s)}getIndentationCount(n){let o=0;for(let s=0;s<n.length;s++)n[s]===" "?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,""),s=this._input.LA(1),f=this._input.LA(2),p=this.getIndentationCount(o);if(this.opened>0||f!=-1&&(s===13||s===10||s===47&&f===47||p%4))this.skip();else{this.emitToken(this.commonToken(F.NEWLINE,n));const y=this.indents.length?this.indents[this.indents.length-1]:0;if(p===y)this.skip();else if(p>y)this.indents.push(p),this.emitToken(this.commonToken(F.INDENT,o));else for(;this.indents.length&&this.indents[this.indents.length-1]>p;)this.emitToken(this.createDedent()),this.indents.pop()}}}const we=class we extends R_{constructor(e){super(e),this._interp=new i_(this,we._ATN,we.DecisionsToDFA,new lp)}get grammarFileName(){return"tccScriptLexer.g4"}get literalNames(){return we.literalNames}get symbolicNames(){return we.symbolicNames}get ruleNames(){return we.ruleNames}get serializedATN(){return we._serializedATN}get channelNames(){return we.channelNames}get modeNames(){return we.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 we.__ATN||(we.__ATN=new up().deserialize(we._serializedATN)),we.__ATN}};k(we,"INDENT",1),k(we,"DEDENT",2),k(we,"Point",3),k(we,"OpenBracket",4),k(we,"CloseBracket",5),k(we,"OpenParen",6),k(we,"CloseParen",7),k(we,"Comma",8),k(we,"Assign",9),k(we,"QuestionMark",10),k(we,"Colon",11),k(we,"Plus",12),k(we,"Minus",13),k(we,"Multiply",14),k(we,"Divide",15),k(we,"Modulus",16),k(we,"Hashtag",17),k(we,"LessThan",18),k(we,"MoreThan",19),k(we,"LessThanEquals",20),k(we,"GreaterThanEquals",21),k(we,"Equals_",22),k(we,"NotEquals",23),k(we,"MultiplyAssign",24),k(we,"DivideAssign",25),k(we,"ModulusAssign",26),k(we,"PlusAssign",27),k(we,"MinusAssign",28),k(we,"ARROW",29),k(we,"ColonEquals",30),k(we,"BooleanLiteral",31),k(we,"IntegerLiteral",32),k(we,"DecimalLiteral",33),k(we,"Break",34),k(we,"And",35),k(we,"Export",36),k(we,"For",37),k(we,"Var",38),k(we,"Continue",39),k(we,"Varip",40),k(we,"Switch",41),k(we,"While",42),k(we,"If",43),k(we,"In",44),k(we,"Or",45),k(we,"Not",46),k(we,"Method",47),k(we,"Else",48),k(we,"To",49),k(we,"By",50),k(we,"Type",51),k(we,"Import",52),k(we,"As",53),k(we,"Map",54),k(we,"ColorLiteral",55),k(we,"StringLiteral",56),k(we,"Identifier",57),k(we,"HIDDEN_",58),k(we,"COMMENT_",59),k(we,"NEWLINE",60),k(we,"EOF",fp.EOF),k(we,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),k(we,"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'"]),k(we,"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_","COMMENT_","NEWLINE"]),k(we,"modeNames",["DEFAULT_MODE"]),k(we,"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_","COMMENT_","NEWLINE","SHORT_STRING","DIGIT","DIGITS","HEX_DIGIT","SPACES","COMMENT","EXP"]),k(we,"_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,0,2,0,1,57,4]),k(we,"__ATN"),k(we,"DecisionsToDFA",we._ATN.decisionToState.map((e,n)=>new cp(e,n)));let bl=we;var z=(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))(z||{}),pe=(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))(pe||{}),On=(t=>(t.description="description",t.field="field",t.function="function",t.param="param",t.returns="returns",t.type="type",t.variable="variable",t))(On||{}),$o=(t=>(t.library="library",t.indicator="indicator",t.strategy="strategy",t))($o||{});const Ce={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",typeRepeatErr:"type '$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 na 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.",useNaErr:"Cannot use an `na` value of an unspecified type in the `$name` function.",libraryTitleErr:"Invalid argument 'title' in 'library' call. It cannot contain spaces, special characters or begin with a digit.",exportFuncArgErr:"All exported functions args should be typified",indiRunErr:"An indicator must contain at least one of the following: any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, `alertcondition()`, or any drawing (line, label, box, table, polyline).",libraryExportErr:"A library must contain at least one exported function, method, or type.",strategyRunErr:"A strategy must contain at least one of the following: any `strategy.*()` function that creates orders, any `plot*()` function, `barcolor()`, `bgcolor()`, `hline()`, or any drawing (line, label, box, table, polyline).",exportUseErr:"Only libraries can contain exported $type.",funcRepeatErr:"The '$name' function has overloads with the same parameters. The type of parameters must be different in overloaded versions of functions.",importMultipleErr:"Cannot import a library more than once",importNotExitErr:"The user '$username' does not have a published library titled '$libraryName'",importNameRepeatErr:"More than one import uses the same alias: $name. Previous usage at line: $line"},Qi={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"},Ni=[z.SERIES,z.SIMPLE,z.INPUT,z.CONST],Rp=[z.INT,z.FLOAT,z.BOOL,z.COLOR,z.STRING],vl=["indicator","strategy","library"],El=["plot","plotbar","plotchar","plotarrow","plotshape","plotcandle","hline","alertcondition","barcolor","bgcolor","fill"],w_=[...El,"indicator","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"],N_=[...El,"table.new","label.new","line.new","box.new","polyline.new","linefill.new"],I_=["strategy.entry","strategy.order","strategy.exit","strategy.close","strategy.cancel","strategy.close_all","strategy.cancel_all"],wp=["strategy","input","table","color","line","linefill","label","box"],Sl=["close","open","high","low","hl2","hlc3","hlcc4","ohlc4","volume"],P_=/^\/\/\s*@(description|field|function|param|returns|type|variable)/,Bn=["case","catch","default","delete","do","finally","function","instanceof","new","return","this","throw","try","typeof","void","with"];var Np=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F_={exports:{}};(function(t,e){(function(n,o){t.exports=o()})(Np,function(){var n=1e3,o=6e4,s=36e5,f="millisecond",p="second",y="minute",E="hour",x="day",D="week",T="month",I="quarter",B="year",L="date",b="Invalid Date",_=/^(\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,O={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(_e){var te=["th","st","nd","rd"],he=_e%100;return"["+_e+(te[(he-20)%10]||te[he]||te[0])+"]"}},R=function(_e,te,he){var le=String(_e);return!le||le.length>=te?_e:""+Array(te+1-le.length).join(he)+_e},C={s:R,z:function(_e){var te=-_e.utcOffset(),he=Math.abs(te),le=Math.floor(he/60),xe=he%60;return(te<=0?"+":"-")+R(le,2,"0")+":"+R(xe,2,"0")},m:function _e(te,he){if(te.date()<he.date())return-_e(he,te);var le=12*(he.year()-te.year())+(he.month()-te.month()),xe=te.clone().add(le,T),Ie=he-xe<0,ge=te.clone().add(le+(Ie?-1:1),T);return+(-(le+(he-xe)/(Ie?xe-ge:ge-xe))||0)},a:function(_e){return _e<0?Math.ceil(_e)||0:Math.floor(_e)},p:function(_e){return{M:T,y:B,w:D,d:x,D:L,h:E,m:y,s:p,ms:f,Q:I}[_e]||String(_e||"").toLowerCase().replace(/s$/,"")},u:function(_e){return _e===void 0}},j="en",X={};X[j]=O;var re="$isDayjsObject",K=function(_e){return _e instanceof Q||!(!_e||!_e[re])},Y=function _e(te,he,le){var xe;if(!te)return j;if(typeof te=="string"){var Ie=te.toLowerCase();X[Ie]&&(xe=Ie),he&&(X[Ie]=he,xe=Ie);var ge=te.split("-");if(!xe&&ge.length>1)return _e(ge[0])}else{var Ue=te.name;X[Ue]=te,xe=Ue}return!le&&xe&&(j=xe),xe||!le&&j},G=function(_e,te){if(K(_e))return _e.clone();var he=typeof te=="object"?te:{};return he.date=_e,he.args=arguments,new Q(he)},ce=C;ce.l=Y,ce.i=K,ce.w=function(_e,te){return G(_e,{locale:te.$L,utc:te.$u,x:te.$x,$offset:te.$offset})};var Q=function(){function _e(he){this.$L=Y(he.locale,null,!0),this.parse(he),this.$x=this.$x||he.x||{},this[re]=!0}var te=_e.prototype;return te.parse=function(he){this.$d=function(le){var xe=le.date,Ie=le.utc;if(xe===null)return new Date(NaN);if(ce.u(xe))return new Date;if(xe instanceof Date)return new Date(xe);if(typeof xe=="string"&&!/Z$/i.test(xe)){var ge=xe.match(_);if(ge){var Ue=ge[2]-1||0,J=(ge[7]||"0").substring(0,3);return Ie?new Date(Date.UTC(ge[1],Ue,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,J)):new Date(ge[1],Ue,ge[3]||1,ge[4]||0,ge[5]||0,ge[6]||0,J)}}return new Date(xe)}(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 xe=G(he);return this.startOf(le)<=xe&&xe<=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,xe){return ce.u(he)?this[le]:this.set(xe,he)},te.unix=function(){return Math.floor(this.valueOf()/1e3)},te.valueOf=function(){return this.$d.getTime()},te.startOf=function(he,le){var xe=this,Ie=!!ce.u(le)||le,ge=ce.p(he),Ue=function(Et,Mt){var gt=ce.w(xe.$u?Date.UTC(xe.$y,Mt,Et):new Date(xe.$y,Mt,Et),xe);return Ie?gt:gt.endOf(x)},J=function(Et,Mt){return ce.w(xe.toDate()[Et].apply(xe.toDate("s"),(Ie?[0,0,0,0]:[23,59,59,999]).slice(Mt)),xe)},ne=this.$W,se=this.$M,Se=this.$D,ye="set"+(this.$u?"UTC":"");switch(ge){case B:return Ie?Ue(1,0):Ue(31,11);case T:return Ie?Ue(1,se):Ue(0,se+1);case D:var At=this.$locale().weekStart||0,jt=(ne<At?ne+7:ne)-At;return Ue(Ie?Se-jt:Se+(6-jt),se);case x:case L:return J(ye+"Hours",0);case E:return J(ye+"Minutes",1);case y:return J(ye+"Seconds",2);case p:return J(ye+"Milliseconds",3);default:return this.clone()}},te.endOf=function(he){return this.startOf(he,!1)},te.$set=function(he,le){var xe,Ie=ce.p(he),ge="set"+(this.$u?"UTC":""),Ue=(xe={},xe[x]=ge+"Date",xe[L]=ge+"Date",xe[T]=ge+"Month",xe[B]=ge+"FullYear",xe[E]=ge+"Hours",xe[y]=ge+"Minutes",xe[p]=ge+"Seconds",xe[f]=ge+"Milliseconds",xe)[Ie],J=Ie===x?this.$D+(le-this.$W):le;if(Ie===T||Ie===B){var ne=this.clone().set(L,1);ne.$d[Ue](J),ne.init(),this.$d=ne.set(L,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 xe,Ie=this;he=Number(he);var ge=ce.p(le),Ue=function(se){var Se=G(Ie);return ce.w(Se.date(Se.date()+Math.round(se*he)),Ie)};if(ge===T)return this.set(T,this.$M+he);if(ge===B)return this.set(B,this.$y+he);if(ge===x)return Ue(1);if(ge===D)return Ue(7);var J=(xe={},xe[y]=o,xe[E]=s,xe[p]=n,xe)[ge]||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,xe=this.$locale();if(!this.isValid())return xe.invalidDate||b;var Ie=he||"YYYY-MM-DDTHH:mm:ssZ",ge=ce.z(this),Ue=this.$H,J=this.$m,ne=this.$M,se=xe.weekdays,Se=xe.months,ye=xe.meridiem,At=function(Mt,gt,Ct,Jt){return Mt&&(Mt[gt]||Mt(le,Ie))||Ct[gt].slice(0,Jt)},jt=function(Mt){return ce.s(Ue%12||12,Mt,"0")},Et=ye||function(Mt,gt,Ct){var Jt=Mt<12?"AM":"PM";return Ct?Jt.toLowerCase():Jt};return Ie.replace(g,function(Mt,gt){return gt||function(Ct){switch(Ct){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(xe.monthsShort,ne,Se,3);case"MMMM":return At(Se,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(xe.weekdaysMin,le.$W,se,2);case"ddd":return At(xe.weekdaysShort,le.$W,se,3);case"dddd":return se[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 ge}return null}(Mt)||ge.replace(":","")})},te.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},te.diff=function(he,le,xe){var Ie,ge=this,Ue=ce.p(le),J=G(he),ne=(J.utcOffset()-this.utcOffset())*o,se=this-J,Se=function(){return ce.m(ge,J)};switch(Ue){case B:Ie=Se()/12;break;case T:Ie=Se();break;case I:Ie=Se()/3;break;case D:Ie=(se-ne)/6048e5;break;case x:Ie=(se-ne)/864e5;break;case E:Ie=se/s;break;case y:Ie=se/o;break;case p:Ie=se/n;break;default:Ie=se}return xe?Ie:ce.a(Ie)},te.daysInMonth=function(){return this.endOf(T).$D},te.$locale=function(){return X[this.$L]},te.locale=function(he,le){if(!he)return this.$L;var xe=this.clone(),Ie=Y(he,le,!0);return Ie&&(xe.$L=Ie),xe},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()},_e}(),me=Q.prototype;return G.prototype=me,[["$ms",f],["$s",p],["$m",y],["$H",E],["$W",x],["$M",T],["$y",B],["$D",L]].forEach(function(_e){me[_e[1]]=function(te){return this.$g(te,_e[0],_e[1])}}),G.extend=function(_e,te){return _e.$i||(_e(te,Q,G),_e.$i=!0),G},G.locale=Y,G.isDayjs=K,G.unix=function(_e){return G(1e3*_e)},G.en=X[j],G.Ls=X,G.p={},G})})(F_);function Ne(t,e){return t.replace(/\$(\w+)/g,(n,o)=>String(e[o])||n)}class L_ extends o_{constructor(){super(...arguments);k(this,"visitProgram");k(this,"visitGlobalStmt");k(this,"visitBlockStmt");k(this,"visitStmt");k(this,"visitSimpleStmt");k(this,"visitFlowStmt");k(this,"visitBlock");k(this,"visitBlockLine");k(this,"visitVariableDeclarationStmt");k(this,"visitDeclareAssign");k(this,"visitAgainAssign");k(this,"visitVarModifier");k(this,"visitBlockSequence");k(this,"visitExpressionSequence");k(this,"visitExpressionBlockSequence");k(this,"visitVarBlockStmt");k(this,"visitVarSingle");k(this,"visitVarMultiple");k(this,"visitBlockExpression");k(this,"visitParenthesizedExpression");k(this,"visitAdditiveExpression");k(this,"visitRelationalExpression");k(this,"visitTernaryExpression");k(this,"visitLogicalAndExpression");k(this,"visitNameExpression");k(this,"visitLiteralExpression");k(this,"visitLogicalOrExpression");k(this,"visitUnaryExpression");k(this,"visitNotExpression");k(this,"visitMemberIndexExpression");k(this,"visitMethodExpression");k(this,"visitEqualityExpression");k(this,"visitMultiplicativeExpression");k(this,"visitBrackethesized");k(this,"visitArguments");k(this,"visitArgument");k(this,"visitIfStatement");k(this,"visitForToStatement");k(this,"visitForInStatement");k(this,"visitSwitchStatement");k(this,"visitCaseClause");k(this,"visitDefaultCaluse");k(this,"visitWhileStatement");k(this,"visitImportStmt");k(this,"visitImportElement");k(this,"visitLiteral");k(this,"visitMethodStmt");k(this,"visitMethodElement");k(this,"visitMethodName");k(this,"visitArrowFunction");k(this,"visitArrowFunctionParameters");k(this,"visitFormalParameterList");k(this,"visitFormalParameterArg");k(this,"visitArrowMethod");k(this,"visitArrowMethodParameters");k(this,"visitTypeStatement");k(this,"visitTypeElement");k(this,"visitAssignmentOperator");k(this,"visitTypeMap");k(this,"visitTypeSeries");k(this,"visitTypeArray");k(this,"visitTypeGather");k(this,"visitIdentifier");k(this,"visitTypeName");k(this,"visitName")}}class M_ extends L_{constructor(n){super();k(this,"_buildinVariables");k(this,"_buildinTypes");k(this,"_buildinConstants");k(this,"_buildinMethods");k(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 s=new Map(Object.entries(n[o]));switch(o){case"constants":this._buildinConstants=s;break;case"functions":this._buildinFunctions=s;break;case"methods":this._buildinMethods=s;break;case"types":this._buildinTypes=s;break;case"variables":this._buildinVariables=s;break}}}_typeHandle(n=[],o){if(!n.length)return z.UNDETERMINED;if(n=n.filter(p=>!p.endsWith(z.NA)),!n.length)return`${z.SIMPLE} ${z.NA}`;let s=100,f="";for(const p of n){if(p===z.UNDETERMINED)return z.UNDETERMINED;p.startsWith(z.SERIES)?s=0:p.startsWith(z.SIMPLE)&&s>0?s=1:p.startsWith(z.INPUT)&&s>1?s=2:p.startsWith(z.CONST)&&s>2&&(s=3);const y=this._removePrefix(p);(y!==z.INT||!f)&&(f=y)}return s===100?f:`${Ni[s]} ${o||f}`}_returnTypesOtherHandle(n,o,s,f){if(!s.length||s[0].includes("<>")){const p=n.type;let y=p;if(!p||p===z.UNDETERMINED)return[z.UNDETERMINED];switch(o){case"series <type>":y=this._getArrayType(p),y||(y=this._removePrefix(p)),s=[this._typeAddSeries(y)];break;case"array<type>":case"matrix<type>":case"type[]":if(this._isMapType(p)){const E=this._getMapType(p)||[];f.includes("keys")?y=E[0]:y=E[1]}else y=this._getArrayType(p),y||(y=this._removePrefix(p));s=[this._typeReplace(o,y)];break;case"<matrix_type>":y=this._getArrayType(p),s=[this._typeAddSeries(y)];break;case"map<keyType, valueType>":s=[y];break;case"<value_type>":y=this._getMapType(p),s=[y[1]];break}}return s}_checkMethodThisType(n,o){if(!n||!n.length||n[0].includes("<>"))return!0;const s=o.replace("int","float");return n.some(f=>f===o||s===f||f.endsWith(o))}_priorityComparison(n,o){if(!n)return!1;if(this._isArrayType(n)||this._isMatrixType(n))return this._getArrayType(o)!==z.INT;{const s=this._getPrefix(n),f=this._getPrefix(o);return s===f?!!n.endsWith(z.INT):!(Ni.indexOf(s)<Ni.indexOf(f))}}_compareType(n,o){if(n===z.UNDETERMINED||o===z.UNDETERMINED)return!0;const s=[z.FLOAT,z.INT];if(this._isArrayType(n)||this._isMatrixType(n)){const f=this._getArrayType(n)||"",p=this._getArrayType(o)||"";return f===p||s.includes(f)&&s.includes(p)}else if(this._isMapType(n)){const f=this._getMapType(n)||[],p=this._getMapType(o)||[];return(f[0]===p[0]||s.includes(f[0])&&s.includes(p[0]))&&(f[1]===p[1]||s.includes(f[1])&&s.includes(p[1]))}else{const f=this._removePrefix(n),p=this._removePrefix(o);return f===z.NA||p===z.NA||f===p||s.includes(f)&&s.includes(p)}}_typeAddSeries(n){return this._buildinTypes.get(n)&&n!==z.CHART_POINT?`${z.SERIES} ${n}`:n}_typeAddConst(n){return Rp.includes(n)?`${z.CONST} ${n}`:this._typeAddSeries(n)}_getOriginMethodName(n,o){let s="";return this._isArrayType(n)?s=`${z.ARRAY}.${o}`:this._isMatrixType(n)?s=`${z.MATRIX}.${o}`:this._isMapType(n)?s=`${z.MAP}.${o}`:s=`${this._removePrefix(n)}.${o}`,s}_returnedTypesParse(n){if(!n||!n.length)return[];const o=n[0];return/^\[.+\]$/.test(o)?o.replace(/[[\]]/g,"").split(",").map(s=>s.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 Ni.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)?z.ARRAY:this._isMapType(n)?z.MAP:this._isMatrixType(n)?z.MATRIX:this._removePrefix(n)}_typeReplace(n,o){return o=this._removePrefix(o),this._arrayTypeConvert(n.startsWith(z.SERIES)?n.replace("<type>",o):n.replace("type",o))}}var ar=(t=>(t[t.Hint=1]="Hint",t[t.Info=2]="Info",t[t.Warning=4]="Warning",t[t.Error=8]="Error",t))(ar||{});class Ip extends M_{constructor(n,o,s){super(n);k(this,"_loopCount");k(this,"_errors");k(this,"_variables");k(this,"_functions");k(this,"_methods");k(this,"_types");k(this,"_currentBlockVars");k(this,"_currentFuncParams");k(this,"_isNeedCalc");k(this,"_blockCount");k(this,"_isInFunc");k(this,"_onlyStatementsCount");k(this,"_blockRanges");k(this,"_overloadsFuncs");k(this,"_hasMemberIndex");k(this,"_isInLocalScop");k(this,"_comments");k(this,"_currentLine",0);k(this,"_hasDrawFunc",!1);k(this,"_hasCreateOrderFunc",!1);k(this,"_scriptType");k(this,"_exportFunctions");k(this,"_exportMethods");k(this,"_exportTypes");k(this,"_exportPositions");k(this,"_description","");k(this,"_endExport");k(this,"_importLibs");k(this,"_getImportLibraryFunc");k(this,"_isEndExpr");k(this,"_inputVarName");k(this,"visitProgram",async n=>{const{children:o}=n;let s=0;const f=[];for(this._pushBlockRanges(n);s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_globalStmt&&f.push(await this.visit(p))}return this._onlyStatementsCount<=0&&this._errors.push({startColumn:0,endColumn:0,startLineNumber:0,endLineNumber:0,type:ar.Error,message:Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount})}),f});k(this,"visitGlobalStmt",async n=>{const{children:o}=n;if(o&&o.length){const s=o[0],f=await this.visit(s);return s.ruleIndex===F.RULE_methodStmt&&vl.includes(f.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1?this._errorHandle(Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount}),s):this._scriptType=f.exprs[0].name),f}return null});k(this,"visitBlockStmt",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationStmt:f.push(...this.visit(p));break;case F.RULE_varBlockStmt:f.push(this.visit(p));break;case F.RULE_blockExpression:f.push(this.visit(p));break}}return f});k(this,"visitStmt",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitSimpleStmt",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitFlowStmt",n=>{const{children:o}=n,{column:s,line:f,text:p}=o[0].symbol;if(this._currentLine=f,this._loopCount<=0){const y=s+1;this._errors.push({startColumn:y,endColumn:parseInt(y+p.length),startLineNumber:f,endLineNumber:f,message:Ne(Ce.onlyInLoop,{text:p})})}return{ruleType:pe.FlowStmt,value:p}});k(this,"visitBlock",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return s.ruleIndex===F.RULE_simpleStmt?this._inBlock(s):this.visit(s)}return null});k(this,"visitBlockLine",n=>{const{children:o}=n;if(!o)return null;let s=0;const f=[];this._blockCount++,this._pushBlockRanges(n);const p=this._isEndExpr;for(;s<o.length;s++){const y=o[s];y.ruleIndex===F.RULE_stmt&&(this._isInFunc&&(this._isEndExpr=o.length-2===s&&p),f.push(this.visit(y)))}return this._blockCount--,this._blockRanges.pop(),this._currentBlockVars.splice(this._blockCount+1),f});k(this,"visitDeclareAssign",n=>{var p;const{children:o}=n;let s=0;const f={ruleType:pe.DeclareAssign};for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_varArrayDeclaration:f.nameList=this.visit(y),this._inputVarName=(p=f.nameList)==null?void 0:p.name;break;case F.RULE_singleExpression:f.value=this.visit(y),this._inputVarName=void 0;break}}return this._variablesHandle(f,n),f});k(this,"visitAgainAssign",n=>{const{children:o,start:s}=n;if(this._currentLine=s.line,o.length>=3){const f=this.visit(o[0]);this._verifyGloablVar(f,o[0]);const p=this.visit(o[2]),y=this.visit(o[1]);return f.type?this._againAssignHandle([f,p],[o[0],o[2]],y):null}return null});k(this,"visitVarModifier",n=>{const{children:o}=n;return o[0].symbol.text});k(this,"visitExpressionSequence",n=>{const{children:o,start:s}=n;let f=0;const p=[];for(this._currentLine=s.line;f<o.length;f++){const y=o[f];if(y.ruleIndex===F.RULE_singleExpression){const E=this.visit(y);E&&(E.ctx=y,p.push(E))}}return p});k(this,"visitExpressionBlockSequence",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.push(this.visit(p));break;case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_blockExpression:f.push(this.visit(p));break;case F.RULE_varBlockStmt:f.push(this.visit(p));break}}return f});k(this,"visitBlockSequence",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_singleExpression:f.push(this.visit(p));break}}return f});k(this,"visitVariableDeclarationStmt",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_variableDeclarationList:f.push(this.visit(p));break;case F.RULE_methodStmt:const y=this.visit(p);vl.includes(y.exprs[0].name)&&(this._onlyStatementsCount++,this._onlyStatementsCount>1?this._errorHandle(Ne(Ce.onlyStatementErr,{count:this._onlyStatementsCount}),p):this._scriptType=y.exprs[0].name),f.push(y);break}}return f});k(this,"visitVarBlockStmt",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.VarBlockStmt,ctx:n},p=[];for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_varArrayDeclaration:f.nameList=this.visit(y);break;case F.RULE_assignmentOperator:f.operator=this.visit(y);break;case F.RULE_name:p.push(y),f.name=this.visit(y);break;case F.RULE_blockExpression:this._isNeedCalc=!0,f.value=this.visit(y),p.push(y);const E=this._getBlockReturnTypes(f.value);E.length===1?f.value.type=E[0]:f.value.types=E,this._isNeedCalc=!1;break}}return f.name?this._againAssignHandle([f.name,f.value],p,f.operator):(this._variablesHandle(f,n),f)});k(this,"visitVarSingle",n=>{const{children:o,start:s}=n,f={ruleType:pe.VarSingle};let p=0;const y=this._commentsParser(s.line,[On.variable]);f.desc=y==null?void 0:y[On.variable],this._currentLine=s.line;let E={lineNumber:0,column:0};for(;p<o.length;p++){const x=o[p];switch(x.ruleIndex){case F.RULE_varModifier:f.declare=this.visit(x);break;case F.RULE_typeGather:const D=this.visit(x);f.prefix=this._getPrefix(D),f.type=D&&this._typeAddConst(D);break;case F.RULE_identifier:const T=this.visit(x);this._repeatVarJudge(T,x),E={lineNumber:x.start.line,column:x.start.column},f.name=T,f.pos=E;break}}return f});k(this,"_commentsParser",(n,o,s=!1)=>{var x;const f=this._comments.filter(D=>D.line<n&&D.line>=this._currentLine),p={},y={line:0,key:"",secKey:""},E=[On.field,On.param];for(const D of f){const[T,I]=P_.exec(D.text)||[];if(I&&o.includes(I)){const B=D.text.replace(T,"").trim();if(Object.assign(y,{line:D.line,key:I}),E.includes(I)){const[L,...b]=B.split(" ");L&&(Object.assign(y,{secKey:L}),p[I]=Object.assign(p[I]||{},{[L]:b.join(" ").trim()}))}else p[I]=[B]}else if(s&&y.key){const B=D.text.replace("//","").trim();E.includes(y.key)?p[y.key][y.secKey]+=` ${B}`:(x=p[y.key])==null||x.push(B)}}return p});k(this,"visitVarMultiple",n=>{const{children:o,start:s}=n;let f=0;const p=[],y=[];for(this._currentLine=s.line;f<o.length;f++){const E=o[f];if(E.ruleIndex===F.RULE_identifier){const x=this.visit(E);this._repeatVarJudge(x,E),p.push(x),y.push({lineNumber:E.start.line,column:E.start.column})}}return{ruleType:pe.VarMultiple,names:p,posList:y}});k(this,"visitBlockExpression",n=>{const{children:o,start:s}=n;if(this._currentLine=s.line,o&&o.length){const f=o[0];return this.visit(f)}return null});k(this,"visitParenthesizedExpression",n=>{const{children:o}=n,s=o[1],f=this.visit(s);return{ruleType:pe.ParenthesizedExpression,type:f.type,ctx:n,exprs:f}});k(this,"visitAdditiveExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression?p.push(this.visit(E)):f=E.symbol.text}const y={ruleType:pe.AdditiveExpression,operator:f,ctx:n,exprs:p};if(["+","-"].includes(f)){const E=[z.UNDETERMINED,z.INT,z.FLOAT];f==="+"&&E.push(z.STRING);const x=this._sameTypeJudge(p,[o[0],o[2]],f,E);y.type=this._typeHandle(x)}else{const E=this._calcTypeJudge(p[0],o[0],f),x=this._calcTypeJudge(p[1],o[2],f,1);y.type=this._typeHandle([E,x])}return y});k(this,"visitRelationalExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._calcTypeJudge(p[0],o[0],f),E=this._calcTypeJudge(p[1],o[2],f,1);return{ruleType:pe.RelationalExpression,operator:f,ctx:n,type:this._typeHandle([y,E],z.BOOL),exprs:p}});k(this,"visitEqualityExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression?p.push(this.visit(E)):f=E.symbol.text}const y=this._sameTypeJudge(p,[o[0],o[2]],f,[z.UNDETERMINED,z.COLOR,z.STRING,z.BOOL,z.INT,z.FLOAT]);return{ruleType:pe.EqualityExpression,operator:f,ctx:n,type:this._typeHandle(y,z.BOOL),exprs:p}});k(this,"visitTernaryExpression",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const y=o[s];if(y.ruleIndex===F.RULE_singleExpression){const E=this._isInLocalScop;s!==0&&(this._isInLocalScop=!0),f.push(this.visit(y)),this._isInLocalScop=E}}let p=z.UNDETERMINED;if(f.length>=3){this._boolTypeJudge(f[0],o[0],"?:");const y=this._sameTypeJudge(f.slice(1),[o[2],o[4]],"?:",[]),E=this._getPrefix(f[0].type);p=this._typeHandle(y),E&&this._getPrefix(p)&&(p=this._typeHandle([p,`${E} ${this._removePrefix(p)}`]))}return{ruleType:pe.TernaryExpression,type:p,ctx:n,exprs:f}});k(this,"visitNameExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitLiteralExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitUnaryExpression",n=>{var x;const{children:o}=n,[s,f]=o,p=[this.visit(f)],y=s.symbol.text,E=this._calcTypeJudge(p[0],f,y);return((x=p[0])==null?void 0:x.ruleType)===pe.UnaryExpression&&this._errors.push({message:Ne(Ce.unaryErr,{sign:y}),startColumn:s.symbol.column+1,startLineNumber:s.symbol.line,endColumn:s.symbol.column+2,endLineNumber:s.symbol.line}),{ruleType:pe.UnaryExpression,operator:y,type:E,ctx:n,exprs:p}});k(this,"visitNotExpression",n=>{const{children:o}=n,s=o[1],f=[this.visit(s)],p=this._boolTypeJudge(f[0],s,"not");return{ruleType:pe.NotExpression,ctx:n,type:this._typeHandle([p],z.BOOL),exprs:f}});k(this,"visitMemberIndexExpression",n=>{var p,y;const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const E=o[s];E.ruleIndex===F.RULE_singleExpression&&f.push(this.visit(E))}if(this._memberIndexVerify(f[0],n),this._hasMemberIndex=!0,((p=f[0])==null?void 0:p.ruleType)===pe.MemberIndexExpression){const E=o[1];this._errors.push({message:Ne(Ce.unaryErr,{sign:"["}),startColumn:E.symbol.column+1,startLineNumber:E.symbol.line,endColumn:E.symbol.column+2,endLineNumber:E.symbol.line}),this._hasMemberIndex=!1}return{ruleType:pe.MemberIndexExpression,type:(y=f[0])==null?void 0:y.type,ctx:n,isInFunc:this._isInFunc,exprs:f}});k(this,"visitMethodStmt",n=>{var D;const{children:o,start:s}=n;let f=0;const p=[],y=[],E=this._commentsParser(s.line,[On.description],!0);this._currentLine=s.line;let x;for(;f<o.length;f++){const T=o[f];T.ruleIndex===F.RULE_methodElement&&(p.push(this.visit(T)),y.push(T))}return((D=p[0])==null?void 0:D.name)===$o.library&&E.description&&(this._description=E.description.join(`
12
12
  `)),x=this._getMethodTypes(p,y)||[],this._inputFuncTitleVerify(p),{ruleType:pe.MethodExpression,types:x.length>1||x.isBrackethesized||x.isUnknown?x:void 0,ctx:n,type:x.length===1?x[0]:void 0,exprs:p}});k(this,"visitMethodExpression",n=>{const{children:o}=n;if(o&&o.length){const s=o[0];return this.visit(s)}return null});k(this,"visitLogicalAndExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._boolTypeJudge(p[0],o[0],f),E=this._boolTypeJudge(p[1],o[2],f,1);return{ruleType:pe.LogicalAndExpression,type:this._typeHandle([y,E],z.BOOL),operator:f,ctx:n,exprs:p}});k(this,"visitLogicalOrExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._boolTypeJudge(p[0],o[0],f),E=this._boolTypeJudge(p[1],o[2],f,1);return{ruleType:pe.LogicalOrExpression,operator:f,ctx:n,type:this._typeHandle([y,E],z.BOOL),exprs:p}});k(this,"visitMultiplicativeExpression",n=>{const{children:o}=n;let s=0,f="";const p=[];for(;s<o.length;s++){const x=o[s];x.ruleIndex===F.RULE_singleExpression?p.push(this.visit(x)):f=x.symbol.text}const y=this._calcTypeJudge(p[0],o[0],f),E=this._calcTypeJudge(p[1],o[2],f,1);return{ruleType:pe.MultiplicativeExpression,operator:f,ctx:n,type:this._typeHandle([y,E]),exprs:p}});k(this,"visitBrackethesized",n=>{const{children:o,start:s}=n,f=o[1];return this._currentLine=s.line,{ruleType:pe.Brackethesized,ctx:n,exprs:this.visit(f)}});k(this,"visitArguments",n=>{const{children:o}=n;let s=0;const f={params:[]};let p="";for(;s<o.length;s++){const y=o[s];if(y.ruleIndex===F.RULE_argument){const E=this.visit(y),x=E.paramKey;x?(p=x,f[x]?this._errorHandle(Ne(Qi.moreSameArg,{arg:x}),n.parentCtx,ar.Warning):(f[x]=E.param,f[x].ctx=y)):p?this._errorHandle(Ne(Ce.argsSyntaxErr,{argName:p}),y):(E.ctx=y,f.params.push(E))}}return f});k(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])}});k(this,"visitIfStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.IfStatement,condition:[],block:[],ctx:n,typeList:[]};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.condition.push(this.visit(p));break;case F.RULE_blockLine:const y=this._isInLocalScop;this._isInLocalScop=!0;const E=this.visit(p);f.typeList.push(this._getBlockReturnTypes(E)),f.block.push(E),this._isInLocalScop=y;break}}return f});k(this,"visitForToStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.ForToStatement,numerical:[],ctx:n,block:[]};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_varModifier:f.declare=this.visit(p);break;case F.RULE_typeGather:const y=this.visit(p);f.type=y&&this._typeAddSeries(y);break;case F.RULE_identifier:f.name=this.visit(p),this._repeatVarJudge(f.name,p);break;case F.RULE_singleExpression:f.numerical.push(this.visit(p));break;case F.RULE_blockLine:this._blockCount++,this._pushBlockRanges(n),f.name&&this._variablesHandle({nameList:{name:f.name,isForVar:!0,type:f.type},value:{type:f.type||`${z.SERIES} ${z.INT}`}},n),this._blockCount--,this._blockRanges.pop(),this._loopCount++;const E=this._isInLocalScop;this._isInLocalScop=!0,f.block=this.visit(p),this._loopCount--,this._isInLocalScop=E,f.returnedTypes=this._getBlockReturnTypes(f.block);break}}return f});k(this,"visitForInStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.ForInStatement,ctx:n,names:[]};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_identifier:const y=this.visit(p);this._repeatVarJudge(y,p),f.names.push(y);break;case F.RULE_singleExpression:f.array=this.visit(p);const E=f.array.type;this._isArrayType(E)||this._isMatrixType(E)||E===z.UNDETERMINED||this._errorHandle(Ne(Ce.typeMismatch,{operator:"foreach",index:"id",typeE:E,typeR:"array<fun_arg>"}),p);break;case F.RULE_blockLine:if(this._blockCount++,this._pushBlockRanges(n),f.names.length){let[D,T]=f.names;const I=f.array.type;T?this._variablesHandle({nameList:{name:D,isForVar:!0,type:`${z.SERIES} ${z.INT}`},value:{type:`${z.SERIES} ${z.INT}`}},n):T=D;const B=I===z.UNDETERMINED?I:this._isMatrixType(I)?`${this._getArrayType(I)}[]`:this._typeAddSeries(this._getArrayType(I));this._variablesHandle({nameList:{name:T,isForVar:!0,type:B},value:{type:B}},n)}this._blockCount--,this._blockRanges.pop(),this._loopCount++;const x=this._isInLocalScop;this._isInLocalScop=!0,f.block=this.visit(p),this._isInLocalScop=x,this._loopCount--,f.returnedTypes=this._getBlockReturnTypes(f.block);break}}return f});k(this,"visitSwitchStatement",n=>{const{children:o}=n;let s=0;const f={ruleType:pe.SwitchStatement,condition:!0,ctx:n,cases:[],defaultCase:void 0};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_singleExpression:f.condition=this.visit(p);break;case F.RULE_caseClause:f.cases.push(this.visit(p));break;case F.RULE_defaultCaluse:f.defaultCase=this.visit(p);break}}return f});k(this,"visitCaseClause",n=>{const{children:o}=n,s={ruleType:pe.CaseClause},f=this._isInLocalScop;return this._isInLocalScop=!0,s.condition=this.visit(o[0]),s.block=this.visit(o[2]),this._isInLocalScop=f,s.returnedTypes=this._getBlockReturnTypes(s.block),s});k(this,"visitDefaultCaluse",n=>{const{children:o}=n,s={ruleType:pe.DefaultCaluse},f=this._isInLocalScop;return this._isInLocalScop=!0,s.block=this.visit(o[1]),this._isInLocalScop=f,s.returnedTypes=this._getBlockReturnTypes(s.block),s});k(this,"visitWhileStatement",n=>{const{children:o}=n,s={ruleType:pe.WhileStatement,ctx:n};s.condition=this.visit(o[1]),this._loopCount++;const f=this._isInLocalScop;return this._isInLocalScop=!0,s.block=this.visit(o[2]),this._isInLocalScop=f,this._loopCount--,s.returnedTypes=this._getBlockReturnTypes(s.block),s});k(this,"visitImportStmt",async n=>{const{children:o,start:s}=n;let f=0;const p=[];for(this._currentLine=s.line;f<o.length;f++){const y=o[f];if(y.ruleIndex===F.RULE_importElement){const E=await this.visit(y);E&&p.push(E)}}return p});k(this,"visitImportElement",async n=>{const{children:o}=n;if(!o||!o.length)return;let s=0;const f=[],p={ruleType:pe.ImportElement,ctx:n};for(;s<o.length;s++){const y=o[s];y.ruleIndex===F.RULE_identifier?f.push(this.visit(y)):y.symbol&&y.symbol.type===F.IntegerLiteral&&(p.libraryVersion=y.symbol.text)}return p.username=f[0],p.libraryName=f[1],p.name=f[2],await this._importHandle(p,n),p});k(this,"visitLiteral",n=>{const{children:o}=n,s=o[0],{type:f,text:p}=s.symbol,y={ruleType:pe.Literal,ctx:n,type:"",value:p};switch(f){case F.ColorLiteral:y.type=z.COLOR;break;case F.BooleanLiteral:y.type=z.BOOL;break;case F.StringLiteral:if(y.type=z.STRING,p.includes(`
13
- `)){const E=p.replace(/\s*(\n|\r)\s*/g," ");y.value=`\`${E.substring(1,E.length-1)}\``}break;case F.IntegerLiteral:y.type=z.INT;break;case F.DecimalLiteral:y.type=z.FLOAT;break}return y.type&&(y.type=`${z.CONST} ${y.type}`),y});k(this,"visitMethodElement",n=>{const{children:o}=n,[s,f]=o,[p,y,E]=this.visit(s),x=this.visit(f);return{name:p,type:y,args:x,expr:E}});k(this,"visitMethodName",n=>{const{children:o}=n,s=[],f=[];let p=0,y=null;for(;p<o.length;p++){const x=o[p],D=x.ruleIndex,T=x.symbol;switch(D){case F.RULE_identifier:s.push(this.visit(x));break;case F.RULE_singleExpression:y=this.visit(x);break;case F.RULE_typeName:const I=this.visit(x);f.push(I),this._typeCheck(I,F.RULE_typeName,x);break;default:T&&T.text==="."&&s.push(".")}}const E=s.join("");return N_.includes(E)?this._hasDrawFunc=!0:I_.includes(E)&&(this._hasCreateOrderFunc=!0),[E,f,y]});k(this,"visitArrowFunction",n=>{const{children:o,start:s,stop:f}=n,p={ruleType:pe.ArrowFunction,returnedTypes:[]};let y=0,E={lineNumber:0,column:0};const x=this._commentsParser(s.line,[On.function,On.param,On.returns],!0);Object.assign(p,{desc:x[On.function],paramsDesc:x[On.param],returnsDesc:x[On.returns]}),this._currentLine=s.line;let D=null;for(;y<o.length;y++){const T=o[y],I=T.ruleIndex,B=T.symbol;switch(I){case F.RULE_identifier:E={lineNumber:T.start.line,column:T.start.column},p.name=this.visit(T);break;case F.RULE_arrowFunctionParameters:p.params=this.visit(T),p.isExport&&this._exportArgsTypeVerify(p.params),this._setFuncParams(p,{endColumn:f.column,endLineNumber:f.line-1,startColumn:s.column,startLineNumber:s.line}),D=T;break;case F.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,p.block=this.visit(T),p.hasMemberIndex=this._hasMemberIndex,p.returnedTypes=this._getBlockReturnTypes(p.block),this._isInFunc=!1;break;default:B&&B.type===F.Export&&(p.isExport=!0,this._addExportPos(B,"functions"))}}return this._setFunc(p,E,D,f.line-1),this._currentFuncParams.clear(),p});k(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let s=0,f=[];for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_formalParameterList&&(f=this.visit(p))}return f});k(this,"visitFormalParameterList",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_formalParameterArg&&f.push(this.visit(p))}return f});k(this,"visitFormalParameterArg",n=>{const{children:o}=n;let s=0;const f={};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_typeGather:const y=this.visit(p);f.type=y&&this._typeAddSeries(y);break;case F.RULE_identifier:f.name=this.visit(p);break;case F.RULE_singleExpression:f.defaultValue=this.visit(p),delete f.defaultValue.ctx}}return f.ctx=n,f.type=f.type||z.UNDETERMINED,f});k(this,"visitArrowMethod",n=>{const{children:o,start:s,stop:f}=n;let p=0;const y={ruleType:pe.ArrowMethod,returnedTypes:[]};let E={lineNumber:0,column:0};const x=this._commentsParser(s.line,[On.function,On.param,On.returns],!0);Object.assign(y,{desc:x[On.function],paramsDesc:x[On.param],returnsDesc:x[On.returns]}),this._currentLine=s.line;let D=null;for(;p<o.length;p++){const T=o[p];switch(T.ruleIndex){case F.RULE_identifier:E={lineNumber:T.start.line,column:T.start.column},y.name=this.visit(T);break;case F.RULE_arrowMethodParameters:y.params=this.visit(T),y.isExport&&this._exportArgsTypeVerify(y.params),this._setFuncParams(y,{endColumn:f.column,endLineNumber:f.line-1,startColumn:s.column,startLineNumber:s.line}),D=T;break;case F.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,y.block=this.visit(T),y.hasMemberIndex=this._hasMemberIndex,y.returnedTypes=this._getBlockReturnTypes(y.block),this._isInFunc=!1;break;default:T.symbol&&T.symbol.type===F.Export&&(y.isExport=!0,this._addExportPos(T.symbol,"methods"));break}}return this._setFunc(y,E,D,f.line-1),this._setMethod(y,E),this._currentFuncParams.clear(),y});k(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let s=0;const f={};let p=[];for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_typeGather:const E=this.visit(y);f.type=E&&this._typeAddSeries(E);break;case F.RULE_identifier:f.ctx=y,f.name=this.visit(y);break;case F.RULE_formalParameterList:p=this.visit(y);break}}return[f,...p]});k(this,"visitTypeStatement",n=>{const{children:o,start:s,stop:f}=n;let p=0;const y={ruleType:pe.TypeStatement,fields:[]},E=this._commentsParser(s.line,[On.type,On.field]);Object.assign(y,{desc:E[On.type],fieldsDesc:E[On.field]}),this._currentLine=s.line;let x={lineNumber:0,column:0},D=null;for(;p<o.length;p++){const T=o[p];switch(T.ruleIndex){case F.RULE_identifier:x={lineNumber:T.start.line,column:T.start.column},D=T,y.name=this.visit(T);break;case F.RULE_typeElement:y.fields.push(this.visit(T));break;default:T.symbol&&T.symbol.type===F.Export&&(y.isExport=!0,this._addExportPos(T.symbol,"types"));break}}if(y.isExport){const T=f.line-1,{line:I=0}=this._endExport;T>I&&(this._endExport={line:T,name:y.name})}return this._setUserType(y,x,D),this._setNewFunc(y,x),this._setCopyFunc(y,x),this._setCopyMethod(y,x),y});k(this,"visitTypeElement",n=>{const{children:o,start:s}=n;let f=0;const p={};let y=null;for(this._currentLine=s.line;f<o.length;f++){const E=o[f];switch(E.ruleIndex){case F.RULE_typeGather:const x=this.visit(E);if(E.children[0].ruleIndex===F.RULE_typeSeries){const{column:D,line:T,text:I}=E.start,B=D+1;this._errors.push({startColumn:B,endColumn:parseInt(B+I.length),startLineNumber:T,endLineNumber:T,message:Ne(this._buildinTypes.has(I)?Ce.typeUseError:Ce.notTypeKeyword,{text:I})}),p.type=z.UNDETERMINED}else p.type=x&&this._typeAddSeries(x);break;case F.RULE_identifier:p.name=this.visit(E);break;case F.RULE_singleExpression:y=E,p.value=this.visit(E);break;default:E.symbol&&E.symbol.type===F.Varip&&(p.isVarip=!0);break}}return this._typeElementVerify(p,y),p});k(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});k(this,"visitTypeMap",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];if(p.ruleIndex===F.RULE_typeName){const y=this.visit(p);f.push(y),this._typeCheck(y,F.RULE_typeName,p)}}return`map<${f[0]},${f[1]}>`});k(this,"visitTypeSeries",n=>{const{children:o}=n,[s,f]=o,p=this.visit(s),y=this.visit(f);return this._typeCheck(p,F.RULE_typeSeries,s),this._typeCheck(y,F.RULE_typeName,f),`${p} ${y}`});k(this,"visitTypeArray",n=>{const{children:o}=n,s=o[0];let f=this.visit(s),p=f;if(o.length===3)f=z.ARRAY;else{this._typeCheck(f,F.RULE_typeArray,s);let y=1;for(;y<o.length;y++){const E=o[y];E.ruleIndex===F.RULE_typeName&&(p=this.visit(E),this._typeCheck(p,F.RULE_typeName,E))}}return this._arrayTypeConvert(`${f}<${p}>`)});k(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const s=o[0],f=this.visit(s);return s.ruleIndex===F.RULE_typeName&&this._typeCheck(f,F.RULE_typeName,s),f}return null});k(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);k(this,"visitTypeName",n=>{const{children:o}=n;let s=0,f="";for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_identifier?f=`${f}${this.visit(p)}`:f=`${f}.`}return f});k(this,"visitName",n=>{var x,D;const{children:o}=n;let s=0,f=!1;const p=[];let y=null;for(;s<o.length;s++){const T=o[s];switch(T.ruleIndex){case F.RULE_identifier:p.push(this.visit(T));break;case F.RULE_singleExpression:y=this.visit(T);break;case F.RULE_methodElement:f=!0,p.push(this.visit(T));break}}const E={ruleType:pe.Name,hasMethod:f,exprs:p,expr:y};if(f){let T="";const I=[];for(const L of p)typeof L=="string"?T=T?`${T}.${L}`:L:(T&&(L.name=`${T}.${L.name}`),I.push(L),T="");E.exprs=[...I,T];const B=this._getMethodTypes(I,Array.from(I,()=>n));if(B&&B.length){const L=Ne(Ce.noFiledErr,{name:T});B.length>1&&this._errorHandle(L,n),E.type=((D=this._nameCheck(this._getOriginMethodName(B[0],T),n,L))==null?void 0:D.type)||z.UNDETERMINED}}else{let T=p.join(".");if(y&&y.type&&y.type===z.UNDETERMINED)E.type=z.UNDETERMINED,T=`expr0.${T}`;else{y&&y.type&&(T=`${this._getMethodTypeName(y.type)}.${T}`);const I=this._nameCheck(T,n)||{};(x=I.title)!=null&&x.startsWith("built-in")&&(E.isBuiltIn=!0,E.isConst=I.isConst),E.varPos=I.pos,E.declare=I.declare,E.type=(I==null?void 0:I.type)||z.UNDETERMINED,I!=null&&I.isArg&&(E.arg=I),E.scope=this._blockCount}E.name=T}return E});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,this._comments=o,this._exportFunctions=[],this._exportMethods=[],this._exportTypes=[],this._exportPositions=[],this._endExport={},this._importLibs=new Map,this._getImportLibraryFunc=s}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}get hasUseDrawFunc(){return this._hasDrawFunc}get hasUseCreateOrderFunc(){return this._hasCreateOrderFunc}get scriptType(){return this._scriptType}get exportLibs(){return{functions:[...this._exportFunctions],methods:[...this._exportMethods],types:[...this._exportTypes]}}get description(){return this._description}get exportPositions(){return this._exportPositions}get endExport(){return this._endExport}get imports(){return this._importLibs}_verifyGloablVar(n,o){const{name:s,varPos:f,isBuiltIn:p}=n;if(p&&this._errorHandle(Ne(Ce.buidinAssignErr,{name:s}),o),!f)return;const y=this._currentBlockVars[0].get(s);if(!y)return;const{column:E,lineNumber:x}=y.pos||{};this._isInFunc&&E===f.column&&x===f.lineNumber&&this._errorHandle(Ne(Ce.modifyGlobalVarErr,{name:s}),o)}_inputFuncTitleVerify(n){if(!(n!=null&&n.length)||n.length>1)return;const{name:o,args:s}=n[0];o===z.INPUT&&this._inputVarName&&!(s.params.some(f=>f.originName==="title")||s.title)&&(s.title={value:`"${this._inputVarName}"`,ruleType:pe.Literal,type:`${z.CONST} ${z.STRING}`})}async _importHandle(n,o){const{stop:s,start:f}=o,{username:p,libraryName:y,libraryVersion:E,name:x}=n,D=`${p}/${y}/${E}`;if(this._importLibs.has(D))return this._errorHandle(Ce.importMultipleErr,o),n;for(const[B,L]of this._importLibs)if(L.name&&L.name===x||!L.name&&!x&&L.libraryName===y)return this._errorHandle(Ne(Ce.importNameRepeatErr,{name:x,line:L.startLine}),o),n;let T=x||y;const I=await this._getImportLibraryFunc({...n,libraryId:D,ctx:void 0,startLine:f.line,endLine:s.line,startColumn:f.column,endColumn:s.column+s.text.length+1});if(I){const{codeStr:B,description:L}=I;this._importLibs.set(D,{...n,libraryId:D,startLine:f.line,endLine:s.line,ctx:void 0,desc:L}),this._importDataHandle(I,T),Bn.includes(T)&&(T=`$${T}`),n.code=B.replace("$name",T)}else this._errorHandle(Ne(Ce.importNotExitErr,{username:p,libraryName:y}),o)}_importDataHandle(n,o){const{functions:s,methods:f,types:p}=n;for(const y of s){const{name:E}=y,x=`${o}.${E}`,D=this._functions.get(x)||[];D.push({...this._importTypeUpdate(y,p,o),name:x,isUser:void 0,isImport:!0}),this._functions.set(x,D)}for(const y of f){const E=this._importTypeUpdate(y,p,o),x=E.originalName||E.name,D=this._methods.get(x)||[];D.push({...E,isImport:!0,isUser:void 0}),this._methods.set(x,D)}for(const y of p){const E=`${o}.${y.name}`,x=this._types.get(E)||[];x.push({...this._importTypeUpdate(y,p,o),name:E,isImport:!0}),this._types.set(E,x)}}_importTypeUpdate(n,o,s){var B;let{args:f,returnedTypes:p,thisType:y,fields:E,name:x,originalName:D}=n,T="";if(f&&f.length&&(f=f.map(L=>{const{allowedTypeIDs:b,displayType:_,name:g}=L,O=_&&this._replaceTypeName(_,o,s);return T=T?`${T}, ${O} ${g}`:`${O} ${g}`,{...L,allowedTypeIDs:b==null?void 0:b.map(R=>this._replaceTypeName(R,o,s)),displayType:O}})),p!=null&&p.length&&(p=[this._replaceTypeName(p[0],o,s)]),y!=null&&y.length){const L=this._replaceTypeName(y[0],o,s);L!==y[0]&&(D=`${s}.${D||x}`),y=[L]}E!=null&&E.length&&(E=E.map(L=>{const{type:b}=L;return{...L,type:b&&this._replaceTypeName(b,o,s)}}));const I={...n,args:f,returnedTypes:p,thisType:y,fields:E,originalName:D};return(B=I.syntax)!=null&&B.length&&(I.syntax=[`${D||`${s}.${x}`}(${T}) → ${(p==null?void 0:p[0])||"void"}`]),I}_replaceTypeName(n,o,s){const f=o.find(p=>n.includes(p.name));return f?n.replace(f.name,`${s}.${f.name}`):n}_exportArgsTypeVerify(n){for(const o of n)(o.type===z.UNDETERMINED||!o.type)&&this._errorHandle(Ce.exportFuncArgErr,o.ctx)}_addExportPos(n,o){const{line:s,column:f,text:p}=n;this._exportPositions.push({startLineNumber:s,startColumn:f,endLineNumber:s,endColumn:f+p.length+1,type:o})}_typeElementVerify(n,o){var y,E;const{type:s,value:f}=n;if(!f)return;if(![pe.Literal,pe.UnaryExpression].includes(f.ruleType)&&!f.isBuiltIn){this._errorHandle(Ce.defaultValueErr,o);return}else if(f.ruleType===pe.UnaryExpression){const{exprs:x}=f;if(![pe.Literal,pe.UnaryExpression].includes((y=x[0])==null?void 0:y.ruleType)&&!((E=x[0])!=null&&E.isBuiltIn)){this._errorHandle(Ce.defaultValueErr,o);return}}(!this._compareType(s,f.type)||s.endsWith(z.INT)&&f.type.endsWith(z.FLOAT))&&this._errorHandle(Ne(Ce.defaultValueTypeErr,{typeE:f.type,typeR:s}),o)}_memberIndexVerify(n,o){if(n.ruleType===pe.Name&&!n.hasMethod&&this._blockCount){const f=this._currentBlockVars[this._blockCount],p=f&&f.get(n.name);p&&(p.isForVar?this._errorHandle(Ne(Ce.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(Ne(Qi.localScopeGetHistory,{name:n.name}),o,ar.Warning))}const s=n&&n.type;if(s){const f=this._removePrefix(s);!this._types.has(f)&&!this._buildinTypes.has(f)&&!this._isArrayType(f)&&!this._isMatrixType(f)&&!this._isMapType(f)&&f!==z.UNDETERMINED&&this._errorHandle(Ne(Ce.invalidType,{index:0}),o)}}_setFuncParams(n,o){var s;for(const f of n.params){const p=(s=this._types.get(f.type))==null?void 0:s[0];if(p&&p.fields)for(const y of p.fields){const E=`${f.name}.${y.name}`;this._currentFuncParams.set(E,{...y,originName:E})}delete f.ctx,f.range=o,f.scope=this._blockCount+1,this._setVariablesMap(f,!0),this._currentFuncParams.set(f.name,f)}}_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,s){const{fields:f,name:p,desc:y,fieldsDesc:E}=n,x={fields:f.map(D=>({name:D.name,desc:E==null?void 0:E[D.name],type:D.type})),name:p,desc:y,pos:o};if(this._types.has(p)){this._errorHandle(Ne(Ce.typeRepeatErr,{name:p}),s);return}n.isExport&&this._exportTypes.push(x),this._types.set(p,[{...x}]),this._addVarToMap(p,p,o,!1,!1)}_againAssignHandle(n,o,s){const f=s!==":="?s.replace("=",""):s,p=s!==":="?[z.UNDETERMINED,z.INT,z.FLOAT]:[];f==="+"&&p.push(z.STRING);const[y,E]=n;y.arg&&!y.name.includes(".")&&this._errorHandle(Ne(Ce.funcArgAssignErr,{name:y.name}),o[0]);const x=this._sameTypeJudge(n,o,f,p),D=this._typeHandle(x);return this._updateUserVar(y.name,D,E.type),y.type=D,{ruleType:pe.AgainAssign,name:y,operator:s,type:D,value:E}}_typeCheck(n,o,s){const f=[z.SERIES,z.SIMPLE,z.CONST];switch(o){case F.RULE_typeName:const p=this._buildinTypes.get(n);p&&![...f,z.ARRAY,z.MATRIX,z.MAP].includes(p[0].name)||this._types.get(n)||this._errorHandle(Ne(Ce.notTypeKeyword,{text:n}),s);break;case F.RULE_typeArray:[z.ARRAY,z.MATRIX].includes(n)||this._errorHandle(Ce.tempateTypeErr,s);break;case F.RULE_typeSeries:f.includes(n)||this._errorHandle(Ne(Ce.qualifierErr,{name:n}),s);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const s=this._buildinConstants.get(n);return s&&s[0]?Object.assign(s[0],{isConst:!0}):this._specialTreatmentChartPoint(n)}_specialTreatmentChartPoint(n){var o,s;if(n.startsWith("chart.point")){const f=n.split("."),p=f.pop(),y=f.join(".");return(((s=(o=this._buildinTypes.get(y))==null?void 0:o[0])==null?void 0:s.fields)||[]).find(x=>x.name===p)}}_verifyName(n,o){var f,p;const s=this._getBuildVar(n);if(s)return s;if(n.includes(".")){const y=n.split("."),E=y.pop(),x=y.join(".");let D=this._blockCount;for(;D>=0;){if(!this._currentBlockVars[D]){D--;continue}const I=this._currentBlockVars[D].get(x);if(o&&this._judgeGatherValue(E||"",o,I==null?void 0:I.valueType,!0),(I==null?void 0:I.type)==="chart.point"){const L=(((p=(f=this._buildinTypes.get(I.type))==null?void 0:f[0])==null?void 0:p.fields)||[]).find(b=>b.name===E);if(L)return Object.assign(L,{pos:I.pos})}D--}const T=this._specialTreatmentChartPoint(n);if(T)return T}return this._getUserVar(n)}_judgeGatherValue(n,o,s,f){return s!==`${z.SIMPLE} ${z.NA}`?!0:(f&&this._errorHandle(Ne(Ce.objectIsNaErr,{name:n,type:"field"}),o),!1)}_nameCheck(n,o,s=Ne(Ce.undeclared,{name:n})){const f=this._verifyName(n,o);return f||this._errorHandle(s,o),f}_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,s=ar.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:s})}_boolTypeJudge(n,o,s,f=0){return this._typeJudge(n,o,s,z.BOOL,[z.UNDETERMINED,z.INT,z.FLOAT,z.BOOL],f)}_calcTypeJudge(n,o,s,f=0){return this._typeJudge(n,o,s,"int/float",[z.UNDETERMINED,z.INT,z.FLOAT],f)}_typeJudge(n,o,s,f,p,y=0){const E=n&&n.type;if(E){const x=this._removePrefix(E);if(!p.includes(x)&&x!==z.NA)return this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${y}`,typeE:x,typeR:f}),o),z.UNDETERMINED;f===z.BOOL&&[z.INT,z.FLOAT].includes(x)&&this._errorHandle(Ne(Qi.typeMismatch,{operator:`operator ${s}`,index:`expr${y}`,type:z.BOOL}),o,ar.Warning)}return E||z.UNDETERMINED}_sameTypeJudge(n,o,s,f){let p="";const y=[],E=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(s)&&(f=f.concat(E));for(const[x,D]of n.entries()){let T=D&&D.type||z.UNDETERMINED;const I=this._removePrefix(T);if(p||(p=I),!f.includes(I)&&f.length&&I!==z.NA){this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,typeE:T,typeR:f.slice(1).join("/")}),o[x]),p=z.UNDETERMINED,y.push(p);continue}if(p===z.UNDETERMINED||I===z.UNDETERMINED)T=p=z.UNDETERMINED;else if(p!==I&&p!==z.NA&&I!==z.NA&&(![z.INT,z.FLOAT].includes(p)||![z.INT,z.FLOAT].includes(I)))if(s===":=")this._errorHandle(Ne(Ce.assignTypeMismatch,{typeE:I,name:n[0].name,typeR:p}),o[0]),T=p=z.UNDETERMINED;else if(["==","!=","?:"].includes(s)&&[z.INT,z.FLOAT,z.BOOL].includes(p)&&[z.INT,z.FLOAT,z.BOOL].includes(I))this._errorHandle(Ne(Qi.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,type:p}),o[x],ar.Warning),T=p=z.UNDETERMINED;else if(E.includes(p)&&E.includes(I)){if(p!==I){const B=this._getPrefix(T);y[x-1]=`${this._getPrefix(y[x-1])} ${E[0]}`,T=p=`${B} ${E[0]}`}}else this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,typeE:I,typeR:p}),o[x]),T=p=z.UNDETERMINED;y.push(T)}return y}_getUserVar(n,o=!1){for(let s=this._blockCount;s>=0;s--){const f=this._currentBlockVars[s];if(s<=0){const p=this._currentFuncParams.get(n);if(p)return p.isArg=!0,p}if(f){const p=f.get(n);if(p)return p}}if(n.includes(".")&&!o){let s=!1,f=null;if(n.split(".").reduce((p,y)=>{let E=p?`${p}.${y}`:y;const x=this._getUserVar(E,!0);return x!=null&&x.type?x.type===z.UNDETERMINED?s=!0:(E=x.type,f=x):f=null,E},""),s)return{name:n,type:z.UNDETERMINED};if(f)return f}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(Ne(Ce.buidinVarErr,{name:n}),o);for(let f=0;f<=this._blockCount;f++){const p=this._currentBlockVars[f];if(p&&p.get(n)){if(this._blockCount===f)return this._errorHandle(Ne(Ce.repeatVar,{name:n}),o),!0;this._errorHandle(Ne(Qi.repeatVar,{name:n}),o,ar.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const s=this._currentBlockVars[o];if(s&&s.get(n))return!0}return!1}_updateUserVar(n,o,s){for(let f=0;f<=this._blockCount;f++){const p=this._currentBlockVars[f];if(p){const y=p.get(n);if(y){y.type=o,y.valueType=s;return}}}}_variablesHandle(n,o){var p,y,E,x;if(!(n&&n.nameList))return;const s=n.nameList;if(s.name==="_")return;const f=n.value;if(s.ruleType===pe.VarMultiple){s.types=[],this._checkVarMultiple(s.names,f,o);for(const[D,T]of s.names.entries()){const I=this._varTypeJudge("",((p=f==null?void 0:f.types)==null?void 0:p[D])||z.UNDETERMINED,o);s.types.push(I),this._addVarToMap(T,I,s.posList[D],!0)}}else{const D=(f==null?void 0:f.type)||((y=f==null?void 0:f.returnedTypes)==null?void 0:y[0]);((E=f==null?void 0:f.types)!=null&&E.isBrackethesized||(x=f==null?void 0:f.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(Ne(Ce.tupleLeftVarErr,{name:s.name}),o),!s.type&&D===`${z.SIMPLE} ${z.NA}`&&this._errorHandle(Ce.naVarErr,o),s.prefix&&Ni.indexOf(s.prefix)>Ni.indexOf(this._getPrefix(D))&&this._errorHandle(Ne(Ce.declaredErr,{prefix:s.prefix,type:D}),o);const T=this._varTypeJudge(s.type,D||z.UNDETERMINED,o);s.type=T,this._addVarToMap(s.name,T,s.pos,!0,s.isForVar,s.declare,f.type,s.desc)}}_checkVarMultiple(n,o,s){var x,D,T,I;const f=n.length,p=(o.types||o.returnedTypes||[]).length,y=((x=o.types)==null?void 0:x.isBrackethesized)||((D=o.returnedTypes)==null?void 0:D.isBrackethesized);(T=o.types)!=null&&T.isUnknown||(I=o.returnedTypes)!=null&&I.isUnknown||(p===1&&!y||!p?this._errorHandle(Ce.tupleRightVarErr,s):f!==p&&this._errorHandle(Ne(Ce.tupleVarErr,{indexA:p,indexB:f}),s))}_addVarToMap(n,o,s,f=!0,p=!1,y,E,x){var B;const D=this._currentBlockVars[this._blockCount]||new Map,T=(B=this._types.get(o))==null?void 0:B[0];if(T&&T.fields)for(const L of T.fields)D.set(`${n}.${L.name}`,L);const I={name:n,type:o,pos:s,valueType:E,desc:x};f&&this._setVariablesMap(I),D.set(n,Object.assign(I,{isForVar:p,declare:y})),this._currentBlockVars[this._blockCount]=D}_setVariablesMap(n,o=!1){const s=this._blockRanges[this._blockCount];o||(n.range=s,n.scope=this._blockCount);const f=this._variables.get(n.name)||[];f.push(n),this._variables.set(n.name,f)}_varTypeJudge(n,o,s){if(o===z.VOID)return this._errorHandle(Ce.voidNotVar,s),z.UNDETERMINED;if(n&&o!==z.UNDETERMINED){const f=this._removePrefix(n),p=this._removePrefix(o);return p!==f&&p!==z.NA&&!(f===z.FLOAT&&p===z.INT)?(this._errorHandle(Ne(Ce.declareTypeErr,{type:n,valueType:o}),s),z.UNDETERMINED):this._typeHandle([n,o])}else if(o===z.UNDETERMINED)return z.UNDETERMINED;return n||o||z.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===z.UNDETERMINED)return o;const s=this._getPrefix(n);if(s){const f=this._removePrefix(n);let p=-1;for(const[y,E]of Ni.entries())E===s&&(p=y),p>=0&&p<=y&&(f===z.FLOAT&&o.push(`${E} ${z.INT}`),o.push(`${E} ${f}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(z.FLOAT)&&o.push(n.replace(/float/,z.INT));return o}_setNewFunc(n,o){const s=`${n.name}.new`,f=[],p=[];for(const E of n.fields)f.push({name:E.name,required:!1,allowedTypeIDs:this._getAllowTypes(E.type),displayType:E.type}),p.push(`${E.type} ${E.name}`);const y={name:s,args:f,returnedTypes:[n.name],pos:o,syntax:[`${s}(${p.join(", ")}) → ${n.name}`]};n.isExport&&this._exportFunctions.push(y),this._functions.set(s,[{...y,isUser:!0}])}_setCopyFunc(n,o){const s=n.name,f=`${s}.copy`,p={name:f,args:[{name:"object",required:!0,allowedTypeIDs:[s],displayType:s}],returnedTypes:[s],pos:o,info:"The identifier of the object to be copied.",syntax:[`${f}(${s} object) → ${s}`]};n.isExport&&this._exportFunctions.push(p),this._functions.set(f,[{...p,isUser:!0}])}_setCopyMethod(n,o){const s=n.name,f=`${s}.copy`,p={name:f,originalName:f,args:[],returnedTypes:[s],thisType:[s],pos:o,syntax:[`${f}() → ${s}`]};n.isExport&&this._exportMethods.push(p),this._methods.set(f,[{...p,isUser:!0}])}_setFunc(n,o,s,f){const p=[],y=[],{desc:E,paramsDesc:x,returnsDesc:D,params:T,hasMemberIndex:I}=n;for(const O of T){const{type:R,name:C,defaultValue:j}=O;p.push({name:C,desc:x==null?void 0:x[C],required:!j,allowedTypeIDs:this._getAllowTypes(R),displayType:R}),y.push(`${R===z.UNDETERMINED?"":`${R} `}${C}`)}const{returnedTypes:B=[]}=n,L=n.name,b=B.length>1?`[${B.join(", ")}]`:B.toString(),_={name:L,desc:E,args:p,syntax:[`${L}(${y.join(", ")}) → ${b||"void"}`],hasMemberIndex:I,pos:o,isUser:!0,returnedTypes:B,returns:D};let g=this._functions.get(L);if(g){const O=g.length;_.index=O,n.index=O,this._verifyFuncRepeat(g,_,s),g.push(_),this._overloadsFuncs.push({name:L,index:O,line:o.lineNumber,startColumn:o.column+1,endColumn:o.column+L.length})}else g=[_];if(n.isExport){const{line:O=0}=this._endExport;f>O&&(this._endExport={line:f,name:L,index:_.index}),this._exportFunctions.push(_)}this._functions.set(L,g)}_setMethod(n,o){const{name:s,returnedTypes:f,params:p,desc:y,paramsDesc:E,returnsDesc:x}=n,D=p[0].type,T=[],I=[];for(const O of p.slice(1)){const{type:R,name:C,defaultValue:j}=O;T.push({name:C,desc:E==null?void 0:E[C],required:!j,allowedTypeIDs:this._getAllowTypes(R),displayType:R}),I.push(`${R} ${C}`)}const B=f.length>1?`[${f.join(", ")}]`:f.toString(),L=this._getMethodTypeName(D),b=`${L}.${s}`;n.typeName=L;const _={name:s,args:T,desc:y,originalName:b,syntax:[`${s}(${I.join(", ")}) → ${B||"void"}`],returnedTypes:f,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[D],returns:x};let g=this._methods.get(b);g?(_.index=g.length,n.index=g.length,g.push(_)):g=[_],n.isExport&&this._exportMethods.push(_),this._methods.set(b,g)}_verifyFuncRepeat(n,o,s){const{args:f}=o;n.some(y=>{const{args:E}=y;return(E==null?void 0:E.length)!=(f==null?void 0:f.length)?!1:!(E!=null&&E.length)&&!(f!=null&&f.length)?!0:E==null?void 0:E.every((x,D)=>{var T;return x.displayType===((T=f==null?void 0:f[D])==null?void 0:T.displayType)})})&&this._errorHandle(Ne(Ce.funcRepeatErr,{name:o.name}),s)}_getMethodTypes(n,o){let s;for(const[f,p]of n.entries()){const{type:y,expr:E,args:x}=p;let{name:D}=p;const T=o[f];if(E){if(E.type===z.UNDETERMINED)return[z.UNDETERMINED];D=`${this._getMethodTypeName(E.type)}${D}`,x.params.unshift(E)}if(s&&s.length>=1)if(s.length===1){const I=s[0];if(I===z.UNDETERMINED)return[z.UNDETERMINED];const B=this._getOriginMethodName(I,D);D.includes(".")?s=this._getOtherNamesMethodType(B,s,T,x,p):s=this._expandMethodHandle(B,T,x,{type:I},I,p)}else this._errorHandle(Ne(Ce.noFiledErr,{name:D}),T);else{const[I,B]=this._tempFuncNameHandle(D,T,y);D=B;const L=this._buildinFunctions.get(I);if(L)this._globalFuncVerify(L[0],T),this._hasMemberIndexVerify(L[0],T,p),p.isBuiltIn=!0,s=this._getBuildInReturnTypes(L,x,D,T,void 0,y);else{const b=this._functions.get(D);if(b)if(b.length<=1){this._hasMemberIndexVerify(b[0],T,p),s=b[0].returnedTypes;const{hasErr:_}=this._checkArgs(x,b[0].args||[],D,T,s[0]);if(_)return[z.UNDETERMINED]}else{const _=this._overloadsFuncGetTypes(b,x,T,void 0,p);s=this._returnedTypesParse([_])}else s=this._getOtherNamesMethodType(D,s,T,x,p)}}p.returnTypes=s}return s===void 0&&this._errorHandle(Ne(Ce.notFindFuncErr,{name:n[0].name}),o[0]),s}_globalFuncVerify(n,o){this._blockCount!==0&&w_.includes(n.name)&&this._errorHandle(Ne(Ce.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,s){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,s.hasMemberIndex=!0,s.position=o.start.tokenIndex)}_tempFuncNameHandle(n,o,s){let f=n;if(s&&s.length>=1){const p=["array.new","matrix.new"].includes(n),y=n==="map.new";if(s.length===1)if(p)f=`${n}<type>`,n=`${n}<${s[0]}>`;else return y?this._errorHandle(Ne(Ce.templateErr,{countA:2,countB:1}),o):this._errorHandle(Ne(Ce.templateNoSupportErr,{name:n}),o),[z.UNDETERMINED];else{if(!y)return p?this._errorHandle(Ne(Ce.templateErr,{countA:1,countB:2}),o):this._errorHandle(Ne(Ce.templateNoSupportErr,{name:n}),o),[z.UNDETERMINED];if(!Rp.includes(s[0]))return this._errorHandle(Ne(Ce.mapKeyErr,{type:this._typeAddSeries(s[0])}),o),[z.UNDETERMINED];f=`${n}<type,type>`,n=`${n}<${s[0]},${s[1]}>`}}return[f,n]}_getOtherNamesMethodType(n,o,s,f,p){const y=n.split("."),E=y.length-1,x=y.slice(0,E).join("."),D=this._getUserVar(x);this._judgeGatherValue(y[E],s,D==null?void 0:D.valueType)||(p.name=`${x}?.${y[E]}`);const I=D==null?void 0:D.type;if(I){if(I===z.UNDETERMINED)return o=[z.UNDETERMINED],o.isUnknown=!0,o;const B=this._getOriginMethodName(I,y[E]);o=this._expandMethodHandle(B,s,f,D,x,p)}else{let B="",L="",b="";for(const _ of y.slice(0,E)){B?L=this._getOriginMethodName(B,_):L=L?`${L}.${_}`:_;const g=this._verifyName(L);g!=null&&g.type?(B=g.type,b=""):this._buildinTypes.get(L)?b=Ne(Ce.methodNotExistErr,{name:L,methodName:y[E]}):b=Ne(Ce.noFiledErr,{name:_})}b&&this._errorHandle(b,s)}return o}_expandMethodHandle(n,o,s,f,p,y){var D,T;let E;const x=this._buildinMethods.get(n);if(x)E=this._getBuildInReturnTypes(x,s,n,o,f);else{const I=this._methods.get(n);if(I&&I.length)if(I.length<=1){const B=I[0],L=this._getMethodTypeName(((D=B.thisType)==null?void 0:D[0])||"");if(!this._types.get(L)){const g=this._functions.get(B.name);g&&(y.selfArg=(T=g[0].args)==null?void 0:T[0])}this._hasMemberIndexVerify(B,o,y),E=B.returnedTypes;const{hasErr:_}=this._checkArgs(s,B.args||[],n,o,(E==null?void 0:E[0])||"");if(_)return[z.UNDETERMINED]}else{const B=this._overloadsFuncGetTypes(I,s,o,f,y);E=this._returnedTypesParse([B])}else this._errorHandle(Ne(Ce.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:p}),o)}return E}_getBuildInReturnTypes(n,o,s,f,p,y){var x;let E;if(n.length===1){const{returnedTypes:D,syntax:T,args:I=[],thisType:B}=n[0],L=T[0].split("→")[1].trim(),b=p||o.params[0]||((x=I[0])==null?void 0:x.name)&&o[I[0].name];b&&!this._checkMethodThisType(B,b.type)&&this._errorHandle(Ne(Ce.typeMismatch,{operator:s,index:b.name||"id",typeE:b.type,typeR:B[0]}),f);const{hasErr:_,types:g}=this._checkArgs(o,I,s,f,L,b);if(_)return[z.UNDETERMINED];if(E=g.length&&g||this._returnedTypesParse(D),E.length>1)return E;(y==null?void 0:y.length)===1?E=[this._typeReplace(L,y[0])]:(y==null?void 0:y.length)===2&&(E=[`${z.MAP}<${y[0]},${y[1]}>`]),E=this._returnTypesOtherHandle(b,L,E,s)}else{const D=this._overloadsFuncGetTypes(n,o,f,p);E=this._returnedTypesParse([D])}return E}_overloadsFuncGetTypes(n,o,s,f,p){var B,L,b;let y="",E=[],x=[],D=0;for(const[_,g]of n.entries()){const{args:O,returnedTypes:R,name:C,thisType:j}=g,X=f||o.params[0]||o[O[0].name],{errMsg:re,warnMsg:K}=this._overloadsCheckArgs(o,O,C,s,X);X&&!this._checkMethodThisType(j,X.type)&&re.unshift({msg:Ne(Ce.typeMismatch,{operator:C,index:X.name||"id",typeE:X.type,typeR:j[0]}),ctx:s}),_===0?(E=re,x=K,!re.length&&(y=R[0])):re.length?((B=E[0])!=null&&B.isLenErr&&!((L=re[0])!=null&&L.isLenErr)||E.length>re.length)&&(E=re,x=K,D=_):this._priorityComparison(y,R[0])||(R[0]===`${z.ARRAY}<>`?y=`${X.type}[]`:y=R[0],E=re,x=K,D=_)}for(const _ of E)this._errorHandle(_.msg,_.ctx);for(const _ of x)this._errorHandle(_.msg,_.ctx,ar.Warning);const T=s.children[0],I=n[0].name;if(T&&this._overloadsFuncs.push({name:I,index:D,line:T.start.line,startColumn:T.start.column+1,endColumn:T.start.column+I.length}),p){const _=n[D],{thisType:g,name:O,index:R}=_;if(this._hasMemberIndexVerify(_,s,p),p.index=R||D,g){const C=this._getMethodTypeName((g==null?void 0:g[0])||"");if(!this._types.get(C)){const X=this._functions.get(O);X&&(p.selfArg=(b=X[0].args)==null?void 0:b[0])}}}return this._funcArgsAddOriginName(o,n[D].args,I),y||z.UNDETERMINED}_funcArgsAddOriginName(n,o,s){const f=n.params||[];for(const[p,y]of o.entries())p<f.length&&(f[p].originName=y.name);if(s==="input"){const p=f[0]||n.defval;Object.assign(n,{inputType:{name:`'${p!=null&&p.isSourceType?"source":this._removePrefix(p==null?void 0:p.type)}'`}})}}_overloadsCheckArgs(n,o,s,f,p){const y={...n},E=y.params;delete y.params;const x=Object.keys(y).length+E.length,D=o.length,T=[],I=[];if(x>D&&!o.some(L=>["arg0, arg1, ...","number0, number1, ..."].includes(L.name)))return T.push({msg:Ne(Ce.argsLenErr,{name:s,lenA:x,lenB:D}),isLenErr:!0,ctx:f}),{errMsg:T,warnMsg:I};for(const[B,L]of o.entries()){let b=y[L.name];if(B<E.length&&(b&&I.push({msg:Ne(Qi.moreSameArg,{arg:L.name}),ctx:f}),b=E[B]),!b)L.required&&T.push({msg:Ne(Ce.requiredParamErr,{name:s,argName:L.name}),ctx:f});else{const _=b.type!==`${z.SIMPLE} na`?this._checkArg(b,L,s,p,b.ctx,!0):"";_&&T.push({msg:_,ctx:b.ctx}),delete y[L.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(L.name)&&E.length>B+1){const _=E.slice(B+1);let g=E[B];for(const O of _){g.type===`${z.SIMPLE} ${z.NA}`&&(g=O);const R=O.type!==`${z.SIMPLE} ${z.NA}`?this._checkArg(O,L,s,g,O.ctx,!0):"";R&&T.push({msg:R,ctx:O.ctx})}}}if(Object.keys(y).length)for(const B of Object.keys(y))T.push({msg:Ne(Ce.argsNameErr,{name:s,argName:B}),ctx:y[B].ctx});return{errMsg:T,warnMsg:I}}_checkArgs(n,o,s,f,p,y){var L;const E={...n},x=E.params;delete E.params;const D=Object.keys(E).length+x.length,T=o.length;let I=!1,B=[];if(D>T&&!o.some(_=>["arg0, arg1, ...","number0, number1, ..."].includes(_.name)))return this._errorHandle(Ne(Ce.argsLenErr,{name:s,lenA:D,lenB:T}),f),I=!0,{hasErr:I,types:B};for(const[b,_]of o.entries()){let g=E[_.name];if(b<x.length&&(g&&this._errorHandle(Ne(Qi.moreSameArg,{arg:_.name}),f,ar.Warning),g=x[b],g.originName=_.name),!g)_.required&&(this._errorHandle(Ne(Ce.requiredParamErr,{name:s,argName:_.name}),f),I=!0);else{const O=g.type!==`${z.SIMPLE} ${z.NA}`?this._checkArg(g,_,s,y,g.ctx):"";if(O)this._errorHandle(O,g.ctx),I=!0;else if(O===!1)I=!0;else if(s.startsWith("request.")&&_.name==="expression")if(g.ruleType===pe.Brackethesized)B=g.exprs.map(R=>this._typeReplace(p,R.type));else if((L=g.types||g.returnedTypes)!=null&&L.isBrackethesized)B=(g.types||g.returnedTypes).map(R=>this._typeReplace(p,R));else{const R=this._typeReplace(p,g.type);B.push(R)}delete E[_.name]}}if(Object.keys(E).length)for(const b of Object.keys(E))this._errorHandle(Ne(Ce.argsNameErr,{name:s,argName:b}),E[b].ctx),I=!0;return{hasErr:I,types:B}}_checkArg(n,o,s,f,p,y){const{ruleType:E,exprs:x,name:D}=n;let T=n.type;E===pe.Brackethesized&&(T=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:I=[],displayType:B,name:L}=o;if(!(!T||T===z.UNDETERMINED||B===z.UNDETERMINED)){if(s==="input"&&L==="defval"&&!T.startsWith(z.CONST))if(Sl.includes(D))n.isSourceType=!0;else return Ce.inputDefvalErr;if(!(this._checkMethodThisType(I,this._arrayTypeConvert(T))&&!(s==="input.source"&&L==="defval"))){if(L==="condition"&&(B!=null&&B.endsWith(z.BOOL))&&(T.endsWith(z.INT)||T.endsWith(z.FLOAT))){p&&this._errorHandle(Ne(Qi.typeMismatch,{index:L,operator:s,type:z.BOOL}),p,ar.Warning);return}switch(B){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.STRING}`],s,T);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.FLOAT}`,`${z.CONST} ${z.INT}`],s,T);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.INT}`],s,T);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!D||!Sl.includes(D))return Ne(Ce.inputSourceErr,{name:L,funcName:s});if(this._judgeVarBuildIn(D))return Ne(Ce.buildInUseErr,{name:D});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(s)||"";if(!T.endsWith(b)&&!(T.endsWith(z.INT)&&b===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(T)){if(L==="id2"){const C=this._getArrayType(f==null?void 0:f.type);if(!C)return;const j=this._getArrayType(T)||"";if(C!==j)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:j,typeR:C})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(T)){if(L==="id2"){const C=this._getArrayType(f==null?void 0:f.type);if(!C)return;const j=this._getArrayType(T)||"";if(C!==j)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:j,typeR:C})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const _=this._getArrayType(f==null?void 0:f.type)||"";if(!T.endsWith(_)&&!(T.endsWith(z.INT)&&_===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(_)});break;case"any map type":if(this._isMapType(T)){if(L==="id2"){const C=this._getMapType(f==null?void 0:f.type);if(!C)return;const j=this._getMapType(T)||[];if(C[0]!==j[0]||C[1]!==j[1])return Ne(Ce.mapKeyValErr,{typeA:this._typeAddSeries(j[0]),typeB:this._typeAddSeries(j[1]),typeC:this._typeAddSeries(C[0]),typeD:this._typeAddSeries(C[1]),name:s})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(f==null?void 0:f.type);if(!g)return;const O=L==="key"?0:1;if(!T.endsWith(g[O])&&!(T.endsWith(z.INT)&&g[O]===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(g[O])});break;case"<arg_expr_type>":if(E===pe.Brackethesized)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:B||""});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(E===pe.Brackethesized){for(const C of x)if(!I.includes(C.type))return this._errorHandle(Ne(Ce.requestArgsErr,{name:s,argName:L,type:C.type}),C.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(Sl.includes(n.name)&&I[0].endsWith(this._removePrefix(T)))n.isSourceType=!0;else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(E===pe.Brackethesized||this._isArrayType(T)||this._isMapType(T)||this._isMatrixType(T))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:`${z.SERIES} ${z.INT}`});if(T!==(f==null?void 0:f.type))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:f==null?void 0:f.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!y){const C=I.find(j=>j.endsWith(R));if(C){n.type=C,n.arg.type=C;return}}if(I.length===1&&I[0].endsWith(R)){const C=this._getPrefix(n.type),j=this._getPrefix(I[0]);if(Ni.indexOf(C)>=Ni.indexOf(j))return}return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:B||""})}}}}_tupleToCheck(n,o,s,f,p){var y,E;if(s.push(`${z.SIMPLE} ${z.NA}`),n.ruleType===pe.Brackethesized){const x=[];let D=!1;for(const T of n.exprs)x.push(T.type),s.includes(T.type)||(D=!0);if(D)return Ne(Ce.typeMismatch,{operator:f,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((y=o.allowedTypeIDs)==null?void 0:y[0])||""})}else return Ne(Ce.typeMismatch,{operator:f,index:o.name,typeE:p,typeR:((E=o.allowedTypeIDs)==null?void 0:E[0])||""})}_getBlockReturnTypes(n){var I,B;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[z.UNDETERMINED];const{ruleType:s,type:f,types:p,returnedTypes:y,exprs:E,nameList:x,typeList:D,block:T}=o;if(p&&p.length)return p;if(y&&y.length)return y;if(f)return[f];switch(s){case pe.Brackethesized:const L=E.map(re=>re.type);return L.isBrackethesized=!0,L;case pe.VarBlockStmt:case pe.DeclareAssign:return x?x.ruleType===pe.VarMultiple?x.types:[x.type]:[((I=o.name)==null?void 0:I.type)||z.UNDETERMINED];case pe.SwitchStatement:if(!this._isNeedCalc&&this._isInFunc&&this._isEndExpr===!1)return[z.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let _=((B=b[0])==null?void 0:B.returnedTypes)||[],g=_.length<=1?_[0]:`[${_.join(", ")}]`,O=null;for(const re of b.slice(1)){const K=re.returnedTypes||[z.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(re.block)?re.block.slice(-1)[0]:re.block;if(K.length!==_.length)O=Y.ctx;else for(const[G,ce]of _.entries())if(this._compareType(K[G],ce))(K[G].includes(z.FLOAT)&&!ce.includes(z.FLOAT)||_[G]===`${z.SIMPLE} ${z.NA}`||_[G]===z.UNDETERMINED)&&(_[G]=K[G]);else{O=Y.ctx;break}}return O&&(this._errorHandle(Ne(Ce.ifOrSwitchTypeErr,{keyword:"switch",types:g}),O),_=_.map(()=>z.UNDETERMINED)),o.returnedTypes=_,_;case pe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[z.UNDETERMINED];if(!D.filter(re=>re&&re.length).length)return[z.UNDETERMINED];let R=D[0]||[],C=R.length<=1?R[0]:`[${R.join(", ")}]`,j=0,X=0;for(const re of D.slice(1))if(re)if(j++,C+=re.length<=1?`; ${re[0]}`:`; [${re.join(", ")}]`,re.length!==R.length)X=j;else for(const[K,Y]of R.entries())if(this._compareType(re[K],Y))(re[K].includes(z.FLOAT)&&!Y.includes(z.FLOAT)||R[K]===`${z.SIMPLE} ${z.NA}`)&&(R[K]=re[K]);else{X=j;break}if(X){const re=T[X].slice(-1)[0],K=Array.isArray(re)?re.slice(-1)[0]:re;this._errorHandle(Ne(Ce.ifOrSwitchTypeErr,{keyword:"if",types:C}),K.ctx),R=R.map(()=>z.UNDETERMINED)}return o.returnedTypes=R,R}return[z.UNDETERMINED]}}class B_{constructor(e){k(this,"_nameMap");k(this,"_prefixNameVar");k(this,"_prefixNameFunc");k(this,"_prefixNameConst");k(this,"_userTypes");k(this,"_isInFunc");k(this,"_varlist");k(this,"_memberIndexList");k(this,"_blockCount");k(this,"_inputCount");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,this._inputCount=0}preParser(e){var o,s;const n=[];for(const f of e){if(!f)return;if(Array.isArray(f)){for(const p of f)if(n.push(this._parserStmt(p)),vl.includes((s=(o=p.exprs)==null?void 0:o[0])==null?void 0:s.name))return n.join(`;
13
+ `)){const E=p.replace(/\s*(\n|\r)\s*/g," ");y.value=`\`${E.substring(1,E.length-1)}\``}break;case F.IntegerLiteral:y.type=z.INT;break;case F.DecimalLiteral:y.type=z.FLOAT;break}return y.type&&(y.type=`${z.CONST} ${y.type}`),y});k(this,"visitMethodElement",n=>{const{children:o}=n,[s,f]=o,[p,y,E]=this.visit(s),x=this.visit(f);return{name:p,type:y,args:x,expr:E}});k(this,"visitMethodName",n=>{const{children:o}=n,s=[],f=[];let p=0,y=null;for(;p<o.length;p++){const x=o[p],D=x.ruleIndex,T=x.symbol;switch(D){case F.RULE_identifier:s.push(this.visit(x));break;case F.RULE_singleExpression:y=this.visit(x);break;case F.RULE_typeName:const I=this.visit(x);f.push(I),this._typeCheck(I,F.RULE_typeName,x);break;default:T&&T.text==="."&&s.push(".")}}const E=s.join("");return N_.includes(E)?this._hasDrawFunc=!0:I_.includes(E)&&(this._hasCreateOrderFunc=!0),[E,f,y]});k(this,"visitArrowFunction",n=>{const{children:o,start:s,stop:f}=n,p={ruleType:pe.ArrowFunction,returnedTypes:[]};let y=0,E={lineNumber:0,column:0};const x=this._commentsParser(s.line,[On.function,On.param,On.returns],!0);Object.assign(p,{desc:x[On.function],paramsDesc:x[On.param],returnsDesc:x[On.returns]}),this._currentLine=s.line;let D=null;for(;y<o.length;y++){const T=o[y],I=T.ruleIndex,B=T.symbol;switch(I){case F.RULE_identifier:E={lineNumber:T.start.line,column:T.start.column},p.name=this.visit(T);break;case F.RULE_arrowFunctionParameters:p.params=this.visit(T),p.isExport&&this._exportArgsTypeVerify(p.params),this._setFuncParams(p,{endColumn:f.column,endLineNumber:f.line-1,startColumn:s.column,startLineNumber:s.line}),D=T;break;case F.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,p.block=this.visit(T),p.hasMemberIndex=this._hasMemberIndex,p.returnedTypes=this._getBlockReturnTypes(p.block),this._isInFunc=!1;break;default:B&&B.type===F.Export&&(p.isExport=!0,this._addExportPos(B,"functions"))}}return this._setFunc(p,E,D,f.line-1),this._currentFuncParams.clear(),p});k(this,"visitArrowFunctionParameters",n=>{const{children:o}=n;let s=0,f=[];for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_formalParameterList&&(f=this.visit(p))}return f});k(this,"visitFormalParameterList",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_formalParameterArg&&f.push(this.visit(p))}return f});k(this,"visitFormalParameterArg",n=>{const{children:o}=n;let s=0;const f={};for(;s<o.length;s++){const p=o[s];switch(p.ruleIndex){case F.RULE_typeGather:const y=this.visit(p);f.type=y&&this._typeAddSeries(y);break;case F.RULE_identifier:f.name=this.visit(p);break;case F.RULE_singleExpression:f.defaultValue=this.visit(p),delete f.defaultValue.ctx}}return f.ctx=n,f.type=f.type||z.UNDETERMINED,f});k(this,"visitArrowMethod",n=>{const{children:o,start:s,stop:f}=n;let p=0;const y={ruleType:pe.ArrowMethod,returnedTypes:[]};let E={lineNumber:0,column:0};const x=this._commentsParser(s.line,[On.function,On.param,On.returns],!0);Object.assign(y,{desc:x[On.function],paramsDesc:x[On.param],returnsDesc:x[On.returns]}),this._currentLine=s.line;let D=null;for(;p<o.length;p++){const T=o[p];switch(T.ruleIndex){case F.RULE_identifier:E={lineNumber:T.start.line,column:T.start.column},y.name=this.visit(T);break;case F.RULE_arrowMethodParameters:y.params=this.visit(T),y.isExport&&this._exportArgsTypeVerify(y.params),this._setFuncParams(y,{endColumn:f.column,endLineNumber:f.line-1,startColumn:s.column,startLineNumber:s.line}),D=T;break;case F.RULE_block:this._isInFunc=!0,this._hasMemberIndex=!1,y.block=this.visit(T),y.hasMemberIndex=this._hasMemberIndex,y.returnedTypes=this._getBlockReturnTypes(y.block),this._isInFunc=!1;break;default:T.symbol&&T.symbol.type===F.Export&&(y.isExport=!0,this._addExportPos(T.symbol,"methods"));break}}return this._setFunc(y,E,D,f.line-1),this._setMethod(y,E),this._currentFuncParams.clear(),y});k(this,"visitArrowMethodParameters",n=>{const{children:o}=n;let s=0;const f={};let p=[];for(;s<o.length;s++){const y=o[s];switch(y.ruleIndex){case F.RULE_typeGather:const E=this.visit(y);f.type=E&&this._typeAddSeries(E);break;case F.RULE_identifier:f.ctx=y,f.name=this.visit(y);break;case F.RULE_formalParameterList:p=this.visit(y);break}}return[f,...p]});k(this,"visitTypeStatement",n=>{const{children:o,start:s,stop:f}=n;let p=0;const y={ruleType:pe.TypeStatement,fields:[]},E=this._commentsParser(s.line,[On.type,On.field]);Object.assign(y,{desc:E[On.type],fieldsDesc:E[On.field]}),this._currentLine=s.line;let x={lineNumber:0,column:0},D=null;for(;p<o.length;p++){const T=o[p];switch(T.ruleIndex){case F.RULE_identifier:x={lineNumber:T.start.line,column:T.start.column},D=T,y.name=this.visit(T);break;case F.RULE_typeElement:y.fields.push(this.visit(T));break;default:T.symbol&&T.symbol.type===F.Export&&(y.isExport=!0,this._addExportPos(T.symbol,"types"));break}}if(y.isExport){const T=f.line-1,{line:I=0}=this._endExport;T>I&&(this._endExport={line:T,name:y.name})}return this._setUserType(y,x,D),this._setNewFunc(y,x),this._setCopyFunc(y,x),this._setCopyMethod(y,x),y});k(this,"visitTypeElement",n=>{const{children:o,start:s}=n;let f=0;const p={};let y=null;for(this._currentLine=s.line;f<o.length;f++){const E=o[f];switch(E.ruleIndex){case F.RULE_typeGather:const x=this.visit(E);if(E.children[0].ruleIndex===F.RULE_typeSeries){const{column:D,line:T,text:I}=E.start,B=D+1;this._errors.push({startColumn:B,endColumn:parseInt(B+I.length),startLineNumber:T,endLineNumber:T,message:Ne(this._buildinTypes.has(I)?Ce.typeUseError:Ce.notTypeKeyword,{text:I})}),p.type=z.UNDETERMINED}else p.type=x&&this._typeAddSeries(x);break;case F.RULE_identifier:p.name=this.visit(E);break;case F.RULE_singleExpression:y=E,p.value=this.visit(E);break;default:E.symbol&&E.symbol.type===F.Varip&&(p.isVarip=!0);break}}return this._typeElementVerify(p,y),p});k(this,"visitAssignmentOperator",n=>{const{children:o}=n;return o&&o[0].symbol.text});k(this,"visitTypeMap",n=>{const{children:o}=n;let s=0;const f=[];for(;s<o.length;s++){const p=o[s];if(p.ruleIndex===F.RULE_typeName){const y=this.visit(p);f.push(y),this._typeCheck(y,F.RULE_typeName,p)}}return`map<${f[0]},${f[1]}>`});k(this,"visitTypeSeries",n=>{const{children:o}=n,[s,f]=o,p=this.visit(s),y=this.visit(f);return this._typeCheck(p,F.RULE_typeSeries,s),this._typeCheck(y,F.RULE_typeName,f),`${p} ${y}`});k(this,"visitTypeArray",n=>{const{children:o}=n,s=o[0];let f=this.visit(s),p=f;if(o.length===3)f=z.ARRAY;else{this._typeCheck(f,F.RULE_typeArray,s);let y=1;for(;y<o.length;y++){const E=o[y];E.ruleIndex===F.RULE_typeName&&(p=this.visit(E),this._typeCheck(p,F.RULE_typeName,E))}}return this._arrayTypeConvert(`${f}<${p}>`)});k(this,"visitTypeGather",n=>{const{children:o}=n;if(o&&o.length){const s=o[0],f=this.visit(s);return s.ruleIndex===F.RULE_typeName&&this._typeCheck(f,F.RULE_typeName,s),f}return null});k(this,"visitIdentifier",n=>n.children&&n.children[0].symbol.text);k(this,"visitTypeName",n=>{const{children:o}=n;let s=0,f="";for(;s<o.length;s++){const p=o[s];p.ruleIndex===F.RULE_identifier?f=`${f}${this.visit(p)}`:f=`${f}.`}return f});k(this,"visitName",n=>{var x,D;const{children:o}=n;let s=0,f=!1;const p=[];let y=null;for(;s<o.length;s++){const T=o[s];switch(T.ruleIndex){case F.RULE_identifier:p.push(this.visit(T));break;case F.RULE_singleExpression:y=this.visit(T);break;case F.RULE_methodElement:f=!0,p.push(this.visit(T));break}}const E={ruleType:pe.Name,hasMethod:f,exprs:p,expr:y};if(f){let T="";const I=[];for(const L of p)typeof L=="string"?T=T?`${T}.${L}`:L:(T&&(L.name=`${T}.${L.name}`),I.push(L),T="");E.exprs=[...I,T];const B=this._getMethodTypes(I,Array.from(I,()=>n));if(B&&B.length){const L=Ne(Ce.noFiledErr,{name:T});B.length>1&&this._errorHandle(L,n),E.type=((D=this._nameCheck(this._getOriginMethodName(B[0],T),n,L))==null?void 0:D.type)||z.UNDETERMINED}}else{let T=p.join(".");if(y&&y.type&&y.type===z.UNDETERMINED)E.type=z.UNDETERMINED,T=`expr0.${T}`;else{y&&y.type&&(T=`${this._getMethodTypeName(y.type)}.${T}`);const I=this._nameCheck(T,n)||{};(x=I.title)!=null&&x.startsWith("built-in")&&(E.isBuiltIn=!0,E.isConst=I.isConst),E.varPos=I.pos,E.declare=I.declare,E.type=(I==null?void 0:I.type)||z.UNDETERMINED,I!=null&&I.isArg&&(E.arg=I),E.scope=this._blockCount}E.name=T}return E});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,this._comments=o,this._exportFunctions=[],this._exportMethods=[],this._exportTypes=[],this._exportPositions=[],this._endExport={},this._importLibs=new Map,this._getImportLibraryFunc=s}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}get hasUseDrawFunc(){return this._hasDrawFunc}get hasUseCreateOrderFunc(){return this._hasCreateOrderFunc}get scriptType(){return this._scriptType}get exportLibs(){return{functions:[...this._exportFunctions],methods:[...this._exportMethods],types:[...this._exportTypes]}}get description(){return this._description}get exportPositions(){return this._exportPositions}get endExport(){return this._endExport}get imports(){return this._importLibs}_verifyGloablVar(n,o){const{name:s,varPos:f,isBuiltIn:p}=n;if(p&&this._errorHandle(Ne(Ce.buidinAssignErr,{name:s}),o),!f)return;const y=this._currentBlockVars[0].get(s);if(!y)return;const{column:E,lineNumber:x}=y.pos||{};this._isInFunc&&E===f.column&&x===f.lineNumber&&this._errorHandle(Ne(Ce.modifyGlobalVarErr,{name:s}),o)}_inputFuncTitleVerify(n){if(!(n!=null&&n.length)||n.length>1)return;const{name:o,args:s}=n[0];o===z.INPUT&&this._inputVarName&&!(s.params.some(f=>f.originName==="title")||s.title)&&(s.title={value:`"${this._inputVarName}"`,ruleType:pe.Literal,type:`${z.CONST} ${z.STRING}`})}async _importHandle(n,o){const{stop:s,start:f}=o,{username:p,libraryName:y,libraryVersion:E,name:x}=n,D=`${p}/${y}/${E}`;if(this._importLibs.has(D))return this._errorHandle(Ce.importMultipleErr,o),n;for(const[B,L]of this._importLibs)if(L.name&&L.name===x||!L.name&&!x&&L.libraryName===y)return this._errorHandle(Ne(Ce.importNameRepeatErr,{name:x,line:L.startLine}),o),n;let T=x||y;const I=await this._getImportLibraryFunc({...n,libraryId:D,ctx:void 0,startLine:f.line,endLine:s.line,startColumn:f.column,endColumn:s.column+s.text.length+1});if(I){const{codeStr:B,description:L}=I;this._importLibs.set(D,{...n,libraryId:D,startLine:f.line,endLine:s.line,ctx:void 0,desc:L}),this._importDataHandle(I,T),Bn.includes(T)&&(T=`$${T}`),n.code=B.replace("$name",T)}else this._errorHandle(Ne(Ce.importNotExitErr,{username:p,libraryName:y}),o)}_importDataHandle(n,o){const{functions:s,methods:f,types:p}=n;for(const y of s){const{name:E}=y,x=`${o}.${E}`,D=this._functions.get(x)||[];D.push({...this._importTypeUpdate(y,p,o),name:x,isUser:void 0,isImport:!0}),this._functions.set(x,D)}for(const y of f){const E=this._importTypeUpdate(y,p,o),x=E.originalName||E.name,D=this._methods.get(x)||[];D.push({...E,isImport:!0,isUser:void 0}),this._methods.set(x,D)}for(const y of p){const E=`${o}.${y.name}`,x=this._types.get(E)||[];x.push({...this._importTypeUpdate(y,p,o),name:E,isImport:!0}),this._types.set(E,x)}}_importTypeUpdate(n,o,s){var B;let{args:f,returnedTypes:p,thisType:y,fields:E,name:x,originalName:D}=n,T="";if(f&&f.length&&(f=f.map(L=>{const{allowedTypeIDs:b,displayType:_,name:g}=L,O=_&&this._replaceTypeName(_,o,s);return T=T?`${T}, ${O} ${g}`:`${O} ${g}`,{...L,allowedTypeIDs:b==null?void 0:b.map(R=>this._replaceTypeName(R,o,s)),displayType:O}})),p!=null&&p.length&&(p=[this._replaceTypeName(p[0],o,s)]),y!=null&&y.length){const L=this._replaceTypeName(y[0],o,s);L!==y[0]&&(D=`${s}.${D||x}`),y=[L]}E!=null&&E.length&&(E=E.map(L=>{const{type:b}=L;return{...L,type:b&&this._replaceTypeName(b,o,s)}}));const I={...n,args:f,returnedTypes:p,thisType:y,fields:E,originalName:D};return(B=I.syntax)!=null&&B.length&&(I.syntax=[`${D||`${s}.${x}`}(${T}) → ${(p==null?void 0:p[0])||"void"}`]),I}_replaceTypeName(n,o,s){const f=o.find(p=>n.includes(p.name));return f?n.replace(f.name,`${s}.${f.name}`):n}_exportArgsTypeVerify(n){for(const o of n)(o.type===z.UNDETERMINED||!o.type)&&this._errorHandle(Ce.exportFuncArgErr,o.ctx)}_addExportPos(n,o){const{line:s,column:f,text:p}=n;this._exportPositions.push({startLineNumber:s,startColumn:f,endLineNumber:s,endColumn:f+p.length+1,type:o})}_typeElementVerify(n,o){var y,E;const{type:s,value:f}=n;if(!f)return;if(![pe.Literal,pe.UnaryExpression].includes(f.ruleType)&&!f.isBuiltIn){this._errorHandle(Ce.defaultValueErr,o);return}else if(f.ruleType===pe.UnaryExpression){const{exprs:x}=f;if(![pe.Literal,pe.UnaryExpression].includes((y=x[0])==null?void 0:y.ruleType)&&!((E=x[0])!=null&&E.isBuiltIn)){this._errorHandle(Ce.defaultValueErr,o);return}}(!this._compareType(s,f.type)||s.endsWith(z.INT)&&f.type.endsWith(z.FLOAT))&&this._errorHandle(Ne(Ce.defaultValueTypeErr,{typeE:f.type,typeR:s}),o)}_memberIndexVerify(n,o){if(n.ruleType===pe.Name&&!n.hasMethod&&this._blockCount){const f=this._currentBlockVars[this._blockCount],p=f&&f.get(n.name);p&&(p.isForVar?this._errorHandle(Ne(Ce.notHistoryErr,{name:n.name}),o):!(this._blockCount===1&&this._isInFunc)&&this._errorHandle(Ne(Qi.localScopeGetHistory,{name:n.name}),o,ar.Warning))}const s=n&&n.type;if(s){const f=this._removePrefix(s);!this._types.has(f)&&!this._buildinTypes.has(f)&&!this._isArrayType(f)&&!this._isMatrixType(f)&&!this._isMapType(f)&&f!==z.UNDETERMINED&&this._errorHandle(Ne(Ce.invalidType,{index:0}),o)}}_setFuncParams(n,o){var s;for(const f of n.params){const p=(s=this._types.get(f.type))==null?void 0:s[0];if(p&&p.fields)for(const y of p.fields){const E=`${f.name}.${y.name}`;this._currentFuncParams.set(E,{...y,originName:E})}delete f.ctx,f.range=o,f.scope=this._blockCount+1,this._setVariablesMap(f,!0),this._currentFuncParams.set(f.name,f)}}_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,s){const{fields:f,name:p,desc:y,fieldsDesc:E}=n,x={fields:f.map(D=>({name:D.name,desc:E==null?void 0:E[D.name],type:D.type})),name:p,desc:y,pos:o};if(this._types.has(p)){this._errorHandle(Ne(Ce.typeRepeatErr,{name:p}),s);return}n.isExport&&this._exportTypes.push(x),this._types.set(p,[{...x}]),this._addVarToMap(p,p,o,!1,!1)}_againAssignHandle(n,o,s){const f=s!==":="?s.replace("=",""):s,p=s!==":="?[z.UNDETERMINED,z.INT,z.FLOAT]:[];f==="+"&&p.push(z.STRING);const[y,E]=n;y.arg&&!y.name.includes(".")&&this._errorHandle(Ne(Ce.funcArgAssignErr,{name:y.name}),o[0]);const x=this._sameTypeJudge(n,o,f,p),D=this._typeHandle(x);return this._updateUserVar(y.name,D,E.type),y.type=D,{ruleType:pe.AgainAssign,name:y,operator:s,type:D,value:E}}_typeCheck(n,o,s){const f=[z.SERIES,z.SIMPLE,z.CONST];switch(o){case F.RULE_typeName:const p=this._buildinTypes.get(n);p&&![...f,z.ARRAY,z.MATRIX,z.MAP].includes(p[0].name)||this._types.get(n)||this._errorHandle(Ne(Ce.notTypeKeyword,{text:n}),s);break;case F.RULE_typeArray:[z.ARRAY,z.MATRIX].includes(n)||this._errorHandle(Ce.tempateTypeErr,s);break;case F.RULE_typeSeries:f.includes(n)||this._errorHandle(Ne(Ce.qualifierErr,{name:n}),s);break}}_getBuildVar(n){const o=this._buildinVariables.get(n);if(o&&o[0])return o[0];const s=this._buildinConstants.get(n);return s&&s[0]?Object.assign(s[0],{isConst:!0}):this._specialTreatmentChartPoint(n)}_specialTreatmentChartPoint(n){var o,s;if(n.startsWith("chart.point")){const f=n.split("."),p=f.pop(),y=f.join(".");return(((s=(o=this._buildinTypes.get(y))==null?void 0:o[0])==null?void 0:s.fields)||[]).find(x=>x.name===p)}}_verifyName(n,o){var f,p;const s=this._getBuildVar(n);if(s)return s;if(n.includes(".")){const y=n.split("."),E=y.pop(),x=y.join(".");let D=this._blockCount;for(;D>=0;){if(!this._currentBlockVars[D]){D--;continue}const I=this._currentBlockVars[D].get(x);if(o&&this._judgeGatherValue(E||"",o,I==null?void 0:I.valueType,!0),(I==null?void 0:I.type)==="chart.point"){const L=(((p=(f=this._buildinTypes.get(I.type))==null?void 0:f[0])==null?void 0:p.fields)||[]).find(b=>b.name===E);if(L)return Object.assign(L,{pos:I.pos})}D--}const T=this._specialTreatmentChartPoint(n);if(T)return T}return this._getUserVar(n)}_judgeGatherValue(n,o,s,f){return s!==`${z.SIMPLE} ${z.NA}`?!0:(f&&this._errorHandle(Ne(Ce.objectIsNaErr,{name:n,type:"field"}),o),!1)}_nameCheck(n,o,s=Ne(Ce.undeclared,{name:n})){const f=this._verifyName(n,o);return f||this._errorHandle(s,o),f}_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,s=ar.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:s})}_boolTypeJudge(n,o,s,f=0){return this._typeJudge(n,o,s,z.BOOL,[z.UNDETERMINED,z.INT,z.FLOAT,z.BOOL],f)}_calcTypeJudge(n,o,s,f=0){return this._typeJudge(n,o,s,"int/float",[z.UNDETERMINED,z.INT,z.FLOAT],f)}_typeJudge(n,o,s,f,p,y=0){const E=n&&n.type;if(E){const x=this._removePrefix(E);if(!p.includes(x)&&x!==z.NA)return this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${y}`,typeE:x,typeR:f}),o),z.UNDETERMINED;f===z.BOOL&&[z.INT,z.FLOAT].includes(x)&&this._errorHandle(Ne(Qi.typeMismatch,{operator:`operator ${s}`,index:`expr${y}`,type:z.BOOL}),o,ar.Warning)}return E||z.UNDETERMINED}_sameTypeJudge(n,o,s,f){let p="";const y=[],E=["plot_display","plot_simple_display"];["+","-","+=","-="].includes(s)&&(f=f.concat(E));for(const[x,D]of n.entries()){let T=D&&D.type||z.UNDETERMINED;const I=this._removePrefix(T);if(p||(p=I),!f.includes(I)&&f.length&&I!==z.NA){this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,typeE:T,typeR:f.slice(1).join("/")}),o[x]),p=z.UNDETERMINED,y.push(p);continue}if(p===z.UNDETERMINED||I===z.UNDETERMINED)T=p=z.UNDETERMINED;else if(p!==I&&p!==z.NA&&I!==z.NA&&(![z.INT,z.FLOAT].includes(p)||![z.INT,z.FLOAT].includes(I)))if(s===":=")this._errorHandle(Ne(Ce.assignTypeMismatch,{typeE:I,name:n[0].name,typeR:p}),o[0]),T=p=z.UNDETERMINED;else if(["==","!=","?:"].includes(s)&&[z.INT,z.FLOAT,z.BOOL].includes(p)&&[z.INT,z.FLOAT,z.BOOL].includes(I))this._errorHandle(Ne(Qi.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,type:p}),o[x],ar.Warning),T=p=z.UNDETERMINED;else if(E.includes(p)&&E.includes(I)){if(p!==I){const B=this._getPrefix(T);y[x-1]=`${this._getPrefix(y[x-1])} ${E[0]}`,T=p=`${B} ${E[0]}`}}else this._errorHandle(Ne(Ce.typeMismatch,{operator:`operator ${s}`,index:`expr${x}`,typeE:I,typeR:p}),o[x]),T=p=z.UNDETERMINED;y.push(T)}return y}_getUserVar(n,o=!1){for(let s=this._blockCount;s>=0;s--){const f=this._currentBlockVars[s];if(s<=0){const p=this._currentFuncParams.get(n);if(p)return p.isArg=!0,p}if(f){const p=f.get(n);if(p)return p}}if(n.includes(".")&&!o){let s=!1,f=null;if(n.split(".").reduce((p,y)=>{let E=p?`${p}.${y}`:y;const x=this._getUserVar(E,!0);return x!=null&&x.type?x.type===z.UNDETERMINED?s=!0:(E=x.type,f=x):f=null,E},""),s)return{name:n,type:z.UNDETERMINED};if(f)return f}return null}_repeatVarJudge(n,o){this._getBuildVar(n)&&this._errorHandle(Ne(Ce.buidinVarErr,{name:n}),o);for(let f=0;f<=this._blockCount;f++){const p=this._currentBlockVars[f];if(p&&p.get(n)){if(this._blockCount===f)return this._errorHandle(Ne(Ce.repeatVar,{name:n}),o),!0;this._errorHandle(Ne(Qi.repeatVar,{name:n}),o,ar.Warning)}}}_judgeVarBuildIn(n){for(let o=0;o<=this._blockCount;o++){const s=this._currentBlockVars[o];if(s&&s.get(n))return!0}return!1}_updateUserVar(n,o,s){for(let f=0;f<=this._blockCount;f++){const p=this._currentBlockVars[f];if(p){const y=p.get(n);if(y){y.type=o,y.valueType=s;return}}}}_variablesHandle(n,o){var p,y,E,x;if(!(n&&n.nameList))return;const s=n.nameList;if(s.name==="_")return;const f=n.value;if(s.ruleType===pe.VarMultiple){s.types=[],this._checkVarMultiple(s.names,f,o);for(const[D,T]of s.names.entries()){const I=this._varTypeJudge("",((p=f==null?void 0:f.types)==null?void 0:p[D])||z.UNDETERMINED,o);s.types.push(I),this._addVarToMap(T,I,s.posList[D],!0)}}else{const D=(f==null?void 0:f.type)||((y=f==null?void 0:f.returnedTypes)==null?void 0:y[0]);((E=f==null?void 0:f.types)!=null&&E.isBrackethesized||(x=f==null?void 0:f.returnedTypes)!=null&&x.isBrackethesized)&&this._errorHandle(Ne(Ce.tupleLeftVarErr,{name:s.name}),o),!s.type&&D===`${z.SIMPLE} ${z.NA}`&&this._errorHandle(Ce.naVarErr,o),s.prefix&&Ni.indexOf(s.prefix)>Ni.indexOf(this._getPrefix(D))&&this._errorHandle(Ne(Ce.declaredErr,{prefix:s.prefix,type:D}),o);const T=this._varTypeJudge(s.type,D||z.UNDETERMINED,o);s.type=T,this._addVarToMap(s.name,T,s.pos,!0,s.isForVar,s.declare,f.type,s.desc)}}_checkVarMultiple(n,o,s){var x,D,T,I;const f=n.length,p=(o.types||o.returnedTypes||[]).length,y=((x=o.types)==null?void 0:x.isBrackethesized)||((D=o.returnedTypes)==null?void 0:D.isBrackethesized);(T=o.types)!=null&&T.isUnknown||(I=o.returnedTypes)!=null&&I.isUnknown||(p===1&&!y||!p?this._errorHandle(Ce.tupleRightVarErr,s):f!==p&&this._errorHandle(Ne(Ce.tupleVarErr,{indexA:p,indexB:f}),s))}_addVarToMap(n,o,s,f=!0,p=!1,y,E,x){var B;const D=this._currentBlockVars[this._blockCount]||new Map,T=(B=this._types.get(o))==null?void 0:B[0];if(T&&T.fields)for(const L of T.fields)D.set(`${n}.${L.name}`,L);const I={name:n,type:o,pos:s,valueType:E,desc:x};f&&this._setVariablesMap(I),D.set(n,Object.assign(I,{isForVar:p,declare:y})),this._currentBlockVars[this._blockCount]=D}_setVariablesMap(n,o=!1){const s=this._blockRanges[this._blockCount];o||(n.range=s,n.scope=this._blockCount);const f=this._variables.get(n.name)||[];f.push(n),this._variables.set(n.name,f)}_varTypeJudge(n,o,s){if(o===z.VOID)return this._errorHandle(Ce.voidNotVar,s),z.UNDETERMINED;if(n&&o!==z.UNDETERMINED){const f=this._removePrefix(n),p=this._removePrefix(o);return p!==f&&p!==z.NA&&!(f===z.FLOAT&&p===z.INT)?(this._errorHandle(Ne(Ce.declareTypeErr,{type:n,valueType:o}),s),z.UNDETERMINED):this._typeHandle([n,o])}else if(o===z.UNDETERMINED)return z.UNDETERMINED;return n||o||z.UNDETERMINED}_getAllowTypes(n){const o=[];if(n===z.UNDETERMINED)return o;const s=this._getPrefix(n);if(s){const f=this._removePrefix(n);let p=-1;for(const[y,E]of Ni.entries())E===s&&(p=y),p>=0&&p<=y&&(f===z.FLOAT&&o.push(`${E} ${z.INT}`),o.push(`${E} ${f}`))}else n=this._arrayTypeConvert(n)||"",o.push(n),n.includes(z.FLOAT)&&o.push(n.replace(/float/,z.INT));return o}_setNewFunc(n,o){const s=`${n.name}.new`,f=[],p=[];for(const E of n.fields)f.push({name:E.name,required:!1,allowedTypeIDs:this._getAllowTypes(E.type),displayType:E.type}),p.push(`${E.type} ${E.name}`);const y={name:s,args:f,returnedTypes:[n.name],pos:o,syntax:[`${s}(${p.join(", ")}) → ${n.name}`]};n.isExport&&this._exportFunctions.push(y),this._functions.set(s,[{...y,isUser:!0}])}_setCopyFunc(n,o){const s=n.name,f=`${s}.copy`,p={name:f,args:[{name:"object",required:!0,allowedTypeIDs:[s],displayType:s}],returnedTypes:[s],pos:o,info:"The identifier of the object to be copied.",syntax:[`${f}(${s} object) → ${s}`]};n.isExport&&this._exportFunctions.push(p),this._functions.set(f,[{...p,isUser:!0}])}_setCopyMethod(n,o){const s=n.name,f=`${s}.copy`,p={name:f,originalName:f,args:[],returnedTypes:[s],thisType:[s],pos:o,syntax:[`${f}() → ${s}`]};n.isExport&&this._exportMethods.push(p),this._methods.set(f,[{...p,isUser:!0}])}_setFunc(n,o,s,f){const p=[],y=[],{desc:E,paramsDesc:x,returnsDesc:D,params:T,hasMemberIndex:I}=n;for(const O of T){const{type:R,name:C,defaultValue:j}=O;p.push({name:C,desc:x==null?void 0:x[C],required:!j,allowedTypeIDs:this._getAllowTypes(R),displayType:R}),y.push(`${R===z.UNDETERMINED?"":`${R} `}${C}`)}const{returnedTypes:B=[]}=n,L=n.name,b=B.length>1?`[${B.join(", ")}]`:B.toString(),_={name:L,desc:E,args:p,syntax:[`${L}(${y.join(", ")}) → ${b||"void"}`],hasMemberIndex:I,pos:o,isUser:!0,returnedTypes:B,returns:D};let g=this._functions.get(L);if(g){const O=g.length;_.index=O,n.index=O,this._verifyFuncRepeat(g,_,s),g.push(_),this._overloadsFuncs.push({name:L,index:O,line:o.lineNumber,startColumn:o.column+1,endColumn:o.column+L.length})}else g=[_];if(n.isExport){const{line:O=0}=this._endExport;f>O&&(this._endExport={line:f,name:L,index:_.index}),this._exportFunctions.push(_)}this._functions.set(L,g)}_setMethod(n,o){const{name:s,returnedTypes:f,params:p,desc:y,paramsDesc:E,returnsDesc:x}=n,D=p[0].type,T=[],I=[];for(const O of p.slice(1)){const{type:R,name:C,defaultValue:j}=O;T.push({name:C,desc:E==null?void 0:E[C],required:!j,allowedTypeIDs:this._getAllowTypes(R),displayType:R}),I.push(`${R} ${C}`)}const B=f.length>1?`[${f.join(", ")}]`:f.toString(),L=this._getMethodTypeName(D),b=`${L}.${s}`;n.typeName=L;const _={name:s,args:T,desc:y,originalName:b,syntax:[`${s}(${I.join(", ")}) → ${B||"void"}`],returnedTypes:f,hasMemberIndex:n.hasMemberIndex,pos:o,thisType:[D],returns:x};let g=this._methods.get(b);if(g){const O=g.filter(R=>!R.isImport);_.index=O.length,n.index=O.length,g.push(_)}else g=[_];n.isExport&&this._exportMethods.push(_),this._methods.set(b,g)}_verifyFuncRepeat(n,o,s){const{args:f}=o;n.some(y=>{const{args:E}=y;return(E==null?void 0:E.length)!=(f==null?void 0:f.length)?!1:!(E!=null&&E.length)&&!(f!=null&&f.length)?!0:E==null?void 0:E.every((x,D)=>{var T;return x.displayType===((T=f==null?void 0:f[D])==null?void 0:T.displayType)})})&&this._errorHandle(Ne(Ce.funcRepeatErr,{name:o.name}),s)}_getMethodTypes(n,o){let s;for(const[f,p]of n.entries()){const{type:y,expr:E,args:x}=p;let{name:D}=p;const T=o[f];if(E){if(E.type===z.UNDETERMINED)return[z.UNDETERMINED];D=`${this._getMethodTypeName(E.type)}${D}`,x.params.unshift(E)}if(s&&s.length>=1)if(s.length===1){const I=s[0];if(I===z.UNDETERMINED)return[z.UNDETERMINED];const B=this._getOriginMethodName(I,D);D.includes(".")?s=this._getOtherNamesMethodType(B,s,T,x,p):s=this._expandMethodHandle(B,T,x,{type:I},I,p)}else this._errorHandle(Ne(Ce.noFiledErr,{name:D}),T);else{const[I,B]=this._tempFuncNameHandle(D,T,y);D=B;const L=this._buildinFunctions.get(I);if(L)this._globalFuncVerify(L[0],T),this._hasMemberIndexVerify(L[0],T,p),p.isBuiltIn=!0,s=this._getBuildInReturnTypes(L,x,D,T,void 0,y);else{const b=this._functions.get(D);if(b)if(b.length<=1){this._hasMemberIndexVerify(b[0],T,p),s=b[0].returnedTypes;const{hasErr:_}=this._checkArgs(x,b[0].args||[],D,T,s[0]);if(_)return[z.UNDETERMINED]}else{const _=this._overloadsFuncGetTypes(b,x,T,void 0,p);s=this._returnedTypesParse([_])}else s=this._getOtherNamesMethodType(D,s,T,x,p)}}p.returnTypes=s}return s===void 0&&this._errorHandle(Ne(Ce.notFindFuncErr,{name:n[0].name}),o[0]),s}_globalFuncVerify(n,o){this._blockCount!==0&&w_.includes(n.name)&&this._errorHandle(Ne(Ce.globalFuncErr,{name:n.name}),o)}_hasMemberIndexVerify(n,o,s){(n.hasMemberIndex||n.name.startsWith("ta.")||n.name==="math.sum")&&(this._hasMemberIndex=this._isInFunc,s.hasMemberIndex=!0,s.position=o.start.tokenIndex)}_tempFuncNameHandle(n,o,s){let f=n;if(s&&s.length>=1){const p=["array.new","matrix.new"].includes(n),y=n==="map.new";if(s.length===1)if(p)f=`${n}<type>`,n=`${n}<${s[0]}>`;else return y?this._errorHandle(Ne(Ce.templateErr,{countA:2,countB:1}),o):this._errorHandle(Ne(Ce.templateNoSupportErr,{name:n}),o),[z.UNDETERMINED];else{if(!y)return p?this._errorHandle(Ne(Ce.templateErr,{countA:1,countB:2}),o):this._errorHandle(Ne(Ce.templateNoSupportErr,{name:n}),o),[z.UNDETERMINED];if(!Rp.includes(s[0]))return this._errorHandle(Ne(Ce.mapKeyErr,{type:this._typeAddSeries(s[0])}),o),[z.UNDETERMINED];f=`${n}<type,type>`,n=`${n}<${s[0]},${s[1]}>`}}return[f,n]}_getOtherNamesMethodType(n,o,s,f,p){const y=n.split("."),E=y.length-1,x=y.slice(0,E).join("."),D=this._getUserVar(x);this._judgeGatherValue(y[E],s,D==null?void 0:D.valueType)||(p.name=`${x}?.${y[E]}`);const I=D==null?void 0:D.type;if(I){if(I===z.UNDETERMINED)return o=[z.UNDETERMINED],o.isUnknown=!0,o;const B=this._getOriginMethodName(I,y[E]);o=this._expandMethodHandle(B,s,f,D,x,p)}else{let B="",L="",b="";for(const _ of y.slice(0,E)){B?L=this._getOriginMethodName(B,_):L=L?`${L}.${_}`:_;const g=this._verifyName(L);g!=null&&g.type?(B=g.type,b=""):this._buildinTypes.get(L)?b=Ne(Ce.methodNotExistErr,{name:L,methodName:y[E]}):b=Ne(Ce.noFiledErr,{name:_})}b&&this._errorHandle(b,s)}return o}_expandMethodHandle(n,o,s,f,p,y){var D,T;let E;const x=this._buildinMethods.get(n);if(x)E=this._getBuildInReturnTypes(x,s,n,o,f);else{const I=this._methods.get(n);if(I&&I.length)if(I.length<=1){const B=I[0],L=this._getMethodTypeName(((D=B.thisType)==null?void 0:D[0])||"");if(!this._types.get(L)){const g=this._functions.get(B.name);g&&(y.selfArg=(T=g[0].args)==null?void 0:T[0])}this._hasMemberIndexVerify(B,o,y),E=B.returnedTypes;const{hasErr:_}=this._checkArgs(s,B.args||[],n,o,(E==null?void 0:E[0])||"");if(_)return[z.UNDETERMINED]}else{const B=this._overloadsFuncGetTypes(I,s,o,f,y);E=this._returnedTypesParse([B])}else this._errorHandle(Ne(Ce.methodNotExistErr,{methodName:n.split(".").slice(-1)[0],name:p}),o)}return E}_getBuildInReturnTypes(n,o,s,f,p,y){var x;let E;if(n.length===1){const{returnedTypes:D,syntax:T,args:I=[],thisType:B}=n[0],L=T[0].split("→")[1].trim(),b=p||o.params[0]||((x=I[0])==null?void 0:x.name)&&o[I[0].name];b&&!this._checkMethodThisType(B,b.type)&&this._errorHandle(Ne(Ce.typeMismatch,{operator:s,index:b.name||"id",typeE:b.type,typeR:B[0]}),f);const{hasErr:_,types:g}=this._checkArgs(o,I,s,f,L,b);if(_)return[z.UNDETERMINED];if(E=g.length&&g||this._returnedTypesParse(D),E.length>1)return E;(y==null?void 0:y.length)===1?E=[this._typeReplace(L,y[0])]:(y==null?void 0:y.length)===2&&(E=[`${z.MAP}<${y[0]},${y[1]}>`]),E=this._returnTypesOtherHandle(b,L,E,s)}else{const D=this._overloadsFuncGetTypes(n,o,f,p);E=this._returnedTypesParse([D])}return E}_overloadsFuncGetTypes(n,o,s,f,p){var B,L,b;let y="",E=[],x=[],D=0;for(const[_,g]of n.entries()){const{args:O,returnedTypes:R,name:C,thisType:j}=g,X=f||o.params[0]||o[O[0].name],{errMsg:re,warnMsg:K}=this._overloadsCheckArgs(o,O,C,s,X);X&&!this._checkMethodThisType(j,X.type)&&re.unshift({msg:Ne(Ce.typeMismatch,{operator:C,index:X.name||"id",typeE:X.type,typeR:j[0]}),ctx:s}),_===0?(E=re,x=K,!re.length&&(y=R[0])):re.length?((B=E[0])!=null&&B.isLenErr&&!((L=re[0])!=null&&L.isLenErr)||E.length>re.length)&&(E=re,x=K,D=_):this._priorityComparison(y,R[0])||(R[0]===`${z.ARRAY}<>`?y=`${X.type}[]`:y=R[0],E=re,x=K,D=_)}for(const _ of E)this._errorHandle(_.msg,_.ctx);for(const _ of x)this._errorHandle(_.msg,_.ctx,ar.Warning);const T=s.children[0],I=n[0].name;if(T&&this._overloadsFuncs.push({name:I,index:D,line:T.start.line,startColumn:T.start.column+1,endColumn:T.start.column+I.length}),p){const _=n[D],{thisType:g,name:O,index:R}=_;if(this._hasMemberIndexVerify(_,s,p),p.index=R||D,g){const C=this._getMethodTypeName((g==null?void 0:g[0])||"");if(!this._types.get(C)){const X=this._functions.get(O);X&&(p.selfArg=(b=X[0].args)==null?void 0:b[0])}}}return this._funcArgsAddOriginName(o,n[D].args,I),y||z.UNDETERMINED}_funcArgsAddOriginName(n,o,s){const f=n.params||[];for(const[p,y]of o.entries())p<f.length&&(f[p].originName=y.name);if(s==="input"){const p=f[0]||n.defval;Object.assign(n,{inputType:{name:`'${p!=null&&p.isSourceType?"source":this._removePrefix(p==null?void 0:p.type)}'`}})}}_overloadsCheckArgs(n,o,s,f,p){const y={...n},E=y.params;delete y.params;const x=Object.keys(y).length+E.length,D=o.length,T=[],I=[];if(x>D&&!o.some(L=>["arg0, arg1, ...","number0, number1, ..."].includes(L.name)))return T.push({msg:Ne(Ce.argsLenErr,{name:s,lenA:x,lenB:D}),isLenErr:!0,ctx:f}),{errMsg:T,warnMsg:I};for(const[B,L]of o.entries()){let b=y[L.name];if(B<E.length&&(b&&I.push({msg:Ne(Qi.moreSameArg,{arg:L.name}),ctx:f}),b=E[B]),!b)L.required&&T.push({msg:Ne(Ce.requiredParamErr,{name:s,argName:L.name}),ctx:f});else{const _=b.type!==`${z.SIMPLE} na`?this._checkArg(b,L,s,p,b.ctx,!0):"";_&&T.push({msg:_,ctx:b.ctx}),delete y[L.name]}if(["arg0, arg1, ...","number0, number1, ..."].includes(L.name)&&E.length>B+1){const _=E.slice(B+1);let g=E[B];for(const O of _){g.type===`${z.SIMPLE} ${z.NA}`&&(g=O);const R=O.type!==`${z.SIMPLE} ${z.NA}`?this._checkArg(O,L,s,g,O.ctx,!0):"";R&&T.push({msg:R,ctx:O.ctx})}}}if(Object.keys(y).length)for(const B of Object.keys(y))T.push({msg:Ne(Ce.argsNameErr,{name:s,argName:B}),ctx:y[B].ctx});return{errMsg:T,warnMsg:I}}_checkArgs(n,o,s,f,p,y){var L;const E={...n},x=E.params;delete E.params;const D=Object.keys(E).length+x.length,T=o.length;let I=!1,B=[];if(D>T&&!o.some(_=>["arg0, arg1, ...","number0, number1, ..."].includes(_.name)))return this._errorHandle(Ne(Ce.argsLenErr,{name:s,lenA:D,lenB:T}),f),I=!0,{hasErr:I,types:B};for(const[b,_]of o.entries()){let g=E[_.name];if(b<x.length&&(g&&this._errorHandle(Ne(Qi.moreSameArg,{arg:_.name}),f,ar.Warning),g=x[b],g.originName=_.name),!g)_.required&&(this._errorHandle(Ne(Ce.requiredParamErr,{name:s,argName:_.name}),f),I=!0);else{const O=g.type!==`${z.SIMPLE} ${z.NA}`?this._checkArg(g,_,s,y,g.ctx):"";if(O)this._errorHandle(O,g.ctx),I=!0;else if(O===!1)I=!0;else if(s.startsWith("request.")&&_.name==="expression")if(g.ruleType===pe.Brackethesized)B=g.exprs.map(R=>this._typeReplace(p,R.type));else if((L=g.types||g.returnedTypes)!=null&&L.isBrackethesized)B=(g.types||g.returnedTypes).map(R=>this._typeReplace(p,R));else{const R=this._typeReplace(p,g.type);B.push(R)}delete E[_.name]}}if(Object.keys(E).length)for(const b of Object.keys(E))this._errorHandle(Ne(Ce.argsNameErr,{name:s,argName:b}),E[b].ctx),I=!0;return{hasErr:I,types:B}}_checkArg(n,o,s,f,p,y){const{ruleType:E,exprs:x,name:D}=n;let T=n.type;E===pe.Brackethesized&&(T=`[${x.map(b=>b.type).join(", ")}]`);const{allowedTypeIDs:I=[],displayType:B,name:L}=o;if(!(!T||T===z.UNDETERMINED||B===z.UNDETERMINED)){if(s==="input"&&L==="defval"&&!T.startsWith(z.CONST))if(Sl.includes(D))n.isSourceType=!0;else return Ce.inputDefvalErr;if(!(this._checkMethodThisType(I,this._arrayTypeConvert(T))&&!(s==="input.source"&&L==="defval"))){if(L==="condition"&&(B!=null&&B.endsWith(z.BOOL))&&(T.endsWith(z.INT)||T.endsWith(z.FLOAT))){p&&this._errorHandle(Ne(Qi.typeMismatch,{index:L,operator:s,type:z.BOOL}),p,ar.Warning);return}switch(B){case"tuple of const string values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.STRING}`],s,T);case"tuple of const int/float values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.FLOAT}`,`${z.CONST} ${z.INT}`],s,T);case"tuple of const int values: [val1, val2, ...]":return this._tupleToCheck(n,o,[`${z.CONST} ${z.INT}`],s,T);case"open/high/low/close/hl2/hlc3/ohlc4/hlcc4":if(!D||!Sl.includes(D))return Ne(Ce.inputSourceErr,{name:L,funcName:s});if(this._judgeVarBuildIn(D))return Ne(Ce.buildInUseErr,{name:D});n.isSourceType=!0;break;case"<matrix_type>":case"<array_type>":const b=this._getArrayType(s)||"";if(!T.endsWith(b)&&!(T.endsWith(z.INT)&&b===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(b)});break;case"any matrix type":if(this._isMatrixType(T)){if(L==="id2"){const C=this._getArrayType(f==null?void 0:f.type);if(!C)return;const j=this._getArrayType(T)||"";if(C!==j)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:j,typeR:C})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"matrix<fun_arg>"});break;case"any array type":if(this._isArrayType(T)){if(L==="id2"){const C=this._getArrayType(f==null?void 0:f.type);if(!C)return;const j=this._getArrayType(T)||"";if(C!==j)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:j,typeR:C})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"array<fun_arg>"});break;case"series <type of the matrix's elements>":case"series <type of the array's elements>":const _=this._getArrayType(f==null?void 0:f.type)||"";if(!T.endsWith(_)&&!(T.endsWith(z.INT)&&_===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(_)});break;case"any map type":if(this._isMapType(T)){if(L==="id2"){const C=this._getMapType(f==null?void 0:f.type);if(!C)return;const j=this._getMapType(T)||[];if(C[0]!==j[0]||C[1]!==j[1])return Ne(Ce.mapKeyValErr,{typeA:this._typeAddSeries(j[0]),typeB:this._typeAddSeries(j[1]),typeC:this._typeAddSeries(C[0]),typeD:this._typeAddSeries(C[1]),name:s})}}else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"map<type, type>"});break;case"series <type of the map's elements>":const g=this._getMapType(f==null?void 0:f.type);if(!g)return;const O=L==="key"?0:1;if(!T.endsWith(g[O])&&!(T.endsWith(z.INT)&&g[O]===z.FLOAT))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:this._typeAddSeries(g[O])});break;case"<arg_expr_type>":if(E===pe.Brackethesized)return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:B||""});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(E===pe.Brackethesized){for(const C of x)if(!I.includes(C.type))return this._errorHandle(Ne(Ce.requestArgsErr,{name:s,argName:L,type:C.type}),C.ctx),!1}break;case"const int/float/bool/string/color or source-type built-ins":if(Sl.includes(n.name)&&I[0].endsWith(this._removePrefix(T)))n.isSourceType=!0;else return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:"const int/float/bool/string/color"});break;case"<arg..._type>":if(E===pe.Brackethesized||this._isArrayType(T)||this._isMapType(T)||this._isMatrixType(T))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:`${z.SERIES} ${z.INT}`});if(T!==(f==null?void 0:f.type))return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:f==null?void 0:f.type});break;default:const R=this._removePrefix(n.type);if(n.arg&&n.arg.isArg&&!y){const C=I.find(j=>j.endsWith(R));if(C){n.type=C,n.arg.type=C;return}}if(I.length===1&&I[0].endsWith(R)){const C=this._getPrefix(n.type),j=this._getPrefix(I[0]);if(Ni.indexOf(C)>=Ni.indexOf(j))return}return Ne(Ce.typeMismatch,{operator:s,index:L,typeE:T,typeR:B||""})}}}}_tupleToCheck(n,o,s,f,p){var y,E;if(s.push(`${z.SIMPLE} ${z.NA}`),n.ruleType===pe.Brackethesized){const x=[];let D=!1;for(const T of n.exprs)x.push(T.type),s.includes(T.type)||(D=!0);if(D)return Ne(Ce.typeMismatch,{operator:f,index:o.name,typeE:`[${x.join(", ")}]`,typeR:((y=o.allowedTypeIDs)==null?void 0:y[0])||""})}else return Ne(Ce.typeMismatch,{operator:f,index:o.name,typeE:p,typeR:((E=o.allowedTypeIDs)==null?void 0:E[0])||""})}_getBlockReturnTypes(n){var I,B;let o=n;if(Array.isArray(n)&&(o=n.slice(-1)[0],Array.isArray(o)&&(o=o.slice(-1)[0])),!o)return[z.UNDETERMINED];const{ruleType:s,type:f,types:p,returnedTypes:y,exprs:E,nameList:x,typeList:D,block:T}=o;if(p&&p.length)return p;if(y&&y.length)return y;if(f)return[f];switch(s){case pe.Brackethesized:const L=E.map(re=>re.type);return L.isBrackethesized=!0,L;case pe.VarBlockStmt:case pe.DeclareAssign:return x?x.ruleType===pe.VarMultiple?x.types:[x.type]:[((I=o.name)==null?void 0:I.type)||z.UNDETERMINED];case pe.SwitchStatement:if(!this._isNeedCalc&&this._isInFunc&&this._isEndExpr===!1)return[z.UNDETERMINED];const b=[...o.cases];o.defaultCase&&b.push(o.defaultCase);let _=((B=b[0])==null?void 0:B.returnedTypes)||[],g=_.length<=1?_[0]:`[${_.join(", ")}]`,O=null;for(const re of b.slice(1)){const K=re.returnedTypes||[z.UNDETERMINED];g+=K.length<=1?`; ${K[0]}`:`; [${K.join(", ")}]`;const Y=Array.isArray(re.block)?re.block.slice(-1)[0]:re.block;if(K.length!==_.length)O=Y.ctx;else for(const[G,ce]of _.entries())if(this._compareType(K[G],ce))(K[G].includes(z.FLOAT)&&!ce.includes(z.FLOAT)||_[G]===`${z.SIMPLE} ${z.NA}`||_[G]===z.UNDETERMINED)&&(_[G]=K[G]);else{O=Y.ctx;break}}return O&&(this._errorHandle(Ne(Ce.ifOrSwitchTypeErr,{keyword:"switch",types:g}),O),_=_.map(()=>z.UNDETERMINED)),o.returnedTypes=_,_;case pe.IfStatement:if(!this._isNeedCalc&&!this._isInFunc)return[z.UNDETERMINED];if(!D.filter(re=>re&&re.length).length)return[z.UNDETERMINED];let R=D[0]||[],C=R.length<=1?R[0]:`[${R.join(", ")}]`,j=0,X=0;for(const re of D.slice(1))if(re)if(j++,C+=re.length<=1?`; ${re[0]}`:`; [${re.join(", ")}]`,re.length!==R.length)X=j;else for(const[K,Y]of R.entries())if(this._compareType(re[K],Y))(re[K].includes(z.FLOAT)&&!Y.includes(z.FLOAT)||R[K]===`${z.SIMPLE} ${z.NA}`)&&(R[K]=re[K]);else{X=j;break}if(X){const re=T[X].slice(-1)[0],K=Array.isArray(re)?re.slice(-1)[0]:re;this._errorHandle(Ne(Ce.ifOrSwitchTypeErr,{keyword:"if",types:C}),K.ctx),R=R.map(()=>z.UNDETERMINED)}return o.returnedTypes=R,R}return[z.UNDETERMINED]}}class B_{constructor(e){k(this,"_nameMap");k(this,"_prefixNameVar");k(this,"_prefixNameFunc");k(this,"_prefixNameConst");k(this,"_userTypes");k(this,"_isInFunc");k(this,"_varlist");k(this,"_memberIndexList");k(this,"_blockCount");k(this,"_inputCount");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,this._inputCount=0}preParser(e){var o,s;const n=[];for(const f of e){if(!f)return;if(Array.isArray(f)){for(const p of f)if(n.push(this._parserStmt(p)),vl.includes((s=(o=p.exprs)==null?void 0:o[0])==null?void 0:s.name))return n.join(`;
14
14
  `).replace(/;+/g,";")}else n.push(this._parserStmt(f))}return""}parser(e){const n=[];for(const s of e){if(!s)return;if(Array.isArray(s))for(const f of s)n.push(this._parserStmt(f));else n.push(this._parserStmt(s))}const o=this._memberIndexList[this._blockCount]||{};return n.push(...Object.values(o)),n.join(`;
15
15
  `).replace(/;+/g,";")}_parserStmt(e,n=!1){switch(e==null?void 0:e.ruleType){case pe.DeclareAssign:return this._parserDeclareAssign(e);case pe.MethodExpression:return`${this._parserMethodExpression(e)}`;case pe.ArrowFunction:return this._parserArrowFunction(e);case pe.ArrowMethod:return this._parserArrowMethod(e);case pe.IfStatement:return this._parserIfStatement(e,n);case pe.WhileStatement:return this._parserWhileStatement(e,n);case pe.SwitchStatement:return this._parserSwitchStatement(e,n);case pe.ForInStatement:return this._parserForInStatement(e,n);case pe.ForToStatement:return this._parserForToStatement(e,n);case pe.AgainAssign:return this._parserAgainAssign(e);case pe.ImportElement:return e.code||"";case pe.TypeStatement:return this._parserTypeStatement(e);case pe.VarBlockStmt:return this._parserVarBlockStmt(e);case pe.FlowStmt:return`${e.value};`;case pe.Brackethesized:return this._parserBrackethesized(e);default:return this._parserSingleExpression(e)}}_parserTypeStatement(e){const n=[],o=[];for(const f of e.fields){const{name:p,value:y}=f;f.isVarip&&o.push(`"${p}"`),n.push(`${p}: ${y?this._parserSingleExpression(y):"undefined"}`)}this._userTypes.push(e.name);let s=e.name;return Bn.includes(s)&&(s=`$${s}`),`const ${s} = ${this._prefixNameVar}.getTypeInstance({${n.join(", ")}}, [${o.join()}])`}_parserVarBlockStmt(e){const{nameList:n,operator:o,name:s,value:f}=e,p=this._parserStmt(f,!0);return s?`${this._parserName(s)} ${o===":="?"=":o} ${p}`:`let ${this._parserDeclareAssignNames(n)} = ${p}`}_parserForToStatement(e,n=!1){let{numerical:o,block:s,name:f}=e;const[p,y,E]=o,x=this._parserBlockLine(s,n),D=this._parserSingleExpression(p),T=this._parserSingleExpression(y),I=E?this._parserSingleExpression(E):"";Bn.includes(f)&&(f=`$${f}`);const B=`for (let ${f}=${D}; ${f}>=(${T}); ${f}+=(${I||"-1"})){
16
16
  ${x}
@@ -168,6 +168,6 @@ Input files:
168
168
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,`+fg(T)}else e.sourceMap.url&&(E.code+=`
169
169
  //# sourceMappingURL=`+e.sourceMap.url)}return e.nameCache&&e.mangle&&(e.mangle.cache&&(e.nameCache.vars=kd(e.mangle.cache)),e.mangle.properties&&e.mangle.properties.cache&&(e.nameCache.props=kd(e.mangle.properties.cache))),x&&x.source_map&&x.source_map.destroy(),o&&(o.end=Date.now(),E.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)}),E}async function Rd(t,e,n){const o=dg(t,e,n);let s,f;do f=o.next(await s),s=f.value;while(!f.done);return f.value}function wd(t){const e=new n_(t),n=new bl(e);n.removeErrorListeners();const o=new Qm(n),s=new F(o);s._interp.predictionMode=u_.SLL,s.removeErrorListeners();const f=new yg;n.addErrorListener(f),s.addErrorListener(f),s.buildParseTrees=!0;const p=s.program(),y=o.tokens.filter(E=>E.channel===2);return{errors:f.errors,ast:p,comments:y}}async function mg(t,e,n,o){const{errors:s,ast:f,comments:p}=wd(t+`
170
170
 
171
- `),y=new Ip(o,p,n),E=await y.visit(f);let x=s.splice(0,1);x.length||(x=y.errors);let D="";const T=new B_("$"),I=e?"":T.preParser(E);if(e&&!x.some(B=>B.type===ar.Error)){const B=T.parser(E)||"";D=(await Rd(B,{compress:!0,mangle:!0})).code||"";const b={message:Ce.indiRunErr,type:ar.Error,startColumn:0,startLineNumber:0,endColumn:0,endLineNumber:0};if(y.hasUseDrawFunc){if(y.scriptType===$o.library)y.exportPositions.length||(b.message=Ce.libraryExportErr,x.push(b));else if(y.exportPositions.length){const _=y.exportPositions.map(g=>{const{type:O,...R}=g;return{message:Ne(Ce.exportUseErr,{type:O}),type:ar.Error,...R}});x.push(..._)}}else switch(y.scriptType){case $o.indicator:x.push(b);break;case $o.strategy:y.hasUseCreateOrderFunc||(b.message=Ce.strategyRunErr,x.push(b));break}}return{errors:x,functions:Object.fromEntries(y.userFunctions),variables:Object.fromEntries(y.userVariables),types:Object.fromEntries(y.userTypes),methods:Object.fromEntries(y.userMethods),overloadsFuncs:y.overloadsFuncs,imports:Object.fromEntries(y.imports),codeStr:D,preParserCode:I}}async function _g(t,e,n,o){const{ast:s,comments:f}=wd(t+`
171
+ `),y=new Ip(o,p,n),E=await y.visit(f);let x=s.splice(0,1);x.length||(x=y.errors);let D="";const T=new B_("$"),I=e?"":T.preParser(E);if(e&&!x.some(B=>B.type===ar.Error)){const B=T.parser(E)||"";console.log(B),D=(await Rd(B,{compress:!0,mangle:!0})).code||"",console.log(D);const b={message:Ce.indiRunErr,type:ar.Error,startColumn:0,startLineNumber:0,endColumn:0,endLineNumber:0};if(y.hasUseDrawFunc){if(y.scriptType===$o.library)y.exportPositions.length||(b.message=Ce.libraryExportErr,x.push(b));else if(y.exportPositions.length){const _=y.exportPositions.map(g=>{const{type:O,...R}=g;return{message:Ne(Ce.exportUseErr,{type:O}),type:ar.Error,...R}});x.push(..._)}}else switch(y.scriptType){case $o.indicator:x.push(b);break;case $o.strategy:y.hasUseCreateOrderFunc||(b.message=Ce.strategyRunErr,x.push(b));break}}return{errors:x,functions:Object.fromEntries(y.userFunctions),variables:Object.fromEntries(y.userVariables),types:Object.fromEntries(y.userTypes),methods:Object.fromEntries(y.userMethods),overloadsFuncs:y.overloadsFuncs,imports:Object.fromEntries(y.imports),codeStr:D,preParserCode:I}}async function _g(t,e,n,o){const{ast:s,comments:f}=wd(t+`
172
172
 
173
173
  `),p=new Ip(o,f,n),y=await p.visit(s),{name:E,index:x}=p.endExport,D=y.findIndex(b=>b.name===E&&b.index===x),T=y.slice(0,D+1),B=new U_("$",e).parser(T)||"",L=await Rd(B,{compress:!0,mangle:!0});return{...p.exportLibs,description:p.description,codeStr:L.code||""}}class yg extends e_{constructor(){super(...arguments);k(this,"errors",[])}syntaxError(n,o,s,f,p){this.errors.push({message:`syntax error: ${p.replace(/expecting.+/,"")}`,type:ar.Error,startColumn:f,startLineNumber:s,endColumn:f,endLineNumber:s})}}Al({parseTcc:mg,parseLibraryCode:_g})})();
@@ -66172,7 +66172,6 @@ class zb {
66172
66172
  this._editor = n;
66173
66173
  }
66174
66174
  async setInlayHints(n) {
66175
- console.log("setInlayHints", n);
66176
66175
  const { endLine: r, endColumn: o, name: c, libraryId: l, libraryName: m } = n;
66177
66176
  if (this._importCompleteLibrary.has(l)) {
66178
66177
  const h = this._funcs.get(l);
@@ -66186,14 +66185,14 @@ class zb {
66186
66185
  },
66187
66186
  paddingLeft: !0
66188
66187
  }), this.triggerInlayHints(), this._updateFuncNames(c || m, l), setTimeout(() => {
66189
- this._inlayHintsHandle(n);
66188
+ this._inlayHints.has(l) && this._inlayHintsHandle(n);
66190
66189
  }, 2e3), ou;
66191
66190
  }
66192
66191
  deleteInlayHints(n) {
66193
66192
  this._inlayHints.delete(n);
66194
66193
  }
66195
66194
  clearInlayHints() {
66196
- this._inlayHints.clear(), this.triggerInlayHints();
66195
+ this._inlayHints.clear();
66197
66196
  }
66198
66197
  triggerInlayHints() {
66199
66198
  this._editor && this._editor.updateOptions({
@@ -66363,9 +66362,8 @@ function lu(a, n) {
66363
66362
  return a.map((r) => (r.range = n, r));
66364
66363
  }
66365
66364
  function jb() {
66366
- const a = Ja.inlayHints;
66367
- return console.log(a), {
66368
- hints: a,
66365
+ return {
66366
+ hints: Ja.inlayHints,
66369
66367
  dispose: () => {
66370
66368
  }
66371
66369
  };
@@ -67221,7 +67219,7 @@ Lu.onerror = (a) => {
67221
67219
  async function Mu(a) {
67222
67220
  return await Ja.setInlayHints(a);
67223
67221
  }
67224
- const Fu = Hi(Lu), ju = Hi(new Worker(new URL("" + new URL("assets/parserTccWorker-B1fH-Qn3.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
67222
+ const Fu = Hi(Lu), ju = Hi(new Worker(new URL("" + new URL("assets/parserTccWorker-Bews0bQ1.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
67225
67223
  async function lx(a, n = !1) {
67226
67224
  const { functions: r, types: o, constants: c, variables: l, methods: m } = _t;
67227
67225
  return await ju.parseTcc(a, n, $i(Mu), { functions: Object.fromEntries(r), methods: Object.fromEntries(m), types: Object.fromEntries(o), constants: Object.fromEntries(c), variables: Object.fromEntries(l) });
@@ -67299,9 +67297,7 @@ const dx = (a, n) => {
67299
67297
  }
67300
67298
  const Q = Wr(async (A) => {
67301
67299
  var J;
67302
- const D = Date.now();
67303
- Ja.clearInlayHints();
67304
- const { errors: F, functions: U, methods: ie, types: ae, variables: oe, overloadsFuncs: gt, imports: Ct, preParserCode: Re } = await lx(A), Le = new Map(Object.entries(U)), G = new Map(Object.entries(ie)), he = new Map(Object.entries(ae)), qe = new Map(Object.entries(oe)), Pe = new Map(Object.entries(Ct));
67300
+ const D = Date.now(), { errors: F, functions: U, methods: ie, types: ae, variables: oe, overloadsFuncs: gt, imports: Ct, preParserCode: Re } = await lx(A, !0), Le = new Map(Object.entries(U)), G = new Map(Object.entries(ie)), he = new Map(Object.entries(ae)), qe = new Map(Object.entries(oe)), Pe = new Map(Object.entries(Ct));
67305
67301
  ir.setUserDefined({
67306
67302
  functions: Le,
67307
67303
  methods: G,
@@ -67341,7 +67337,7 @@ const dx = (a, n) => {
67341
67337
  Q(A || "");
67342
67338
  return;
67343
67339
  }
67344
- (D = P.current) == null || D.setModelMarkers([]), A !== void 0 && (_ && _(A), $(A));
67340
+ Ja.clearInlayHints(), (D = P.current) == null || D.setModelMarkers([]), A !== void 0 && (_ && _(A), $(A));
67345
67341
  }
67346
67342
  return O.jsx(db, { height: r, width: o || "100%", defaultLanguage: ze, defaultValue: b || `indicator("我的脚本")
67347
67343
  plot(close)
@@ -130,12 +130,12 @@ function print() { __p += __j.call(arguments, '') }
130
130
  `)+N+`return __p
131
131
  }`;var ne=nu(function(){return be(p,V+"return "+N).apply(a,f)});if(ne.source=N,Ci(ne))throw ne;return ne}function ib(e){return we(e).toLowerCase()}function ob(e){return we(e).toUpperCase()}function lb(e,t,r){if(e=we(e),e&&(r||t===a))return fl(e);if(!e||!(t=mt(t)))return e;var i=Pt(e),u=Pt(t),p=yl(i,u),f=hl(i,u)+1;return yr(i,p,f).join("")}function cb(e,t,r){if(e=we(e),e&&(r||t===a))return e.slice(0,gl(e)+1);if(!e||!(t=mt(t)))return e;var i=Pt(e),u=hl(i,Pt(t))+1;return yr(i,0,u).join("")}function ub(e,t,r){if(e=we(e),e&&(r||t===a))return e.replace(ka,"");if(!e||!(t=mt(t)))return e;var i=Pt(e),u=yl(i,Pt(t));return yr(i,u).join("")}function db(e,t){var r=ce,i=_t;if(Se(t)){var u="separator"in t?t.separator:u;r="length"in t?se(t.length):r,i="omission"in t?mt(t.omission):i}e=we(e);var p=e.length;if($r(e)){var f=Pt(e);p=f.length}if(r>=p)return e;var g=r-Vr(i);if(g<1)return i;var v=f?yr(f,0,g).join(""):e.slice(0,g);if(u===a)return v+i;if(f&&(g+=v.length-g),Si(u)){if(e.slice(g).search(u)){var S,z=v;for(u.global||(u=Vn(u.source,we(xe.exec(u))+"g")),u.lastIndex=0;S=u.exec(z);)var N=S.index;v=v.slice(0,N===a?g:N)}}else if(e.indexOf(mt(u),g)!=g){var W=v.lastIndexOf(u);W>-1&&(v=v.slice(0,W))}return v+i}function pb(e){return e=we(e),e&&Ta.test(e)?e.replace(Xt,jm):e}var mb=Jr(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),Oi=ic("toUpperCase");function su(e,t,r){return e=we(e),t=r?a:t,t===a?Em(e)?Wm(e):Dm(e):e.match(t)||[]}var nu=oe(function(e,t){try{return dt(e,a,t)}catch(r){return Ci(r)?r:new re(r)}}),fb=Zt(function(e,t){return wt(t,function(r){r=Wt(r),Kt(e,r,Ai(e[r],e))}),e});function yb(e){var t=e==null?0:e.length,r=K();return e=t?qe(e,function(i){if(typeof i[1]!="function")throw new vt(m);return[r(i[0]),i[1]]}):[],oe(function(i){for(var u=-1;++u<t;){var p=e[u];if(dt(p[0],this,i))return dt(p[1],this,i)}})}function hb(e){return Bf(It(e,T))}function Pi(e){return function(){return e}}function _b(e,t){return e==null||e!==e?t:e}var gb=lc(),bb=lc(!0);function nt(e){return e}function Ei(e){return Ml(typeof e=="function"?e:It(e,T))}function xb(e){return jl(It(e,T))}function wb(e,t){return Bl(e,It(t,T))}var vb=oe(function(e,t){return function(r){return Pa(r,e,t)}}),Tb=oe(function(e,t){return function(r){return Pa(e,r,t)}});function Ri(e,t,r){var i=We(t),u=Ps(t,i);r==null&&!(Se(t)&&(u.length||!i.length))&&(r=t,t=e,e=this,u=Ps(t,We(t)));var p=!(Se(r)&&"chain"in r)||!!r.chain,f=er(e);return wt(u,function(g){var v=t[g];e[g]=v,f&&(e.prototype[g]=function(){var S=this.__chain__;if(p||S){var z=e(this.__wrapped__),N=z.__actions__=rt(this.__actions__);return N.push({func:v,args:arguments,thisArg:e}),z.__chain__=S,z}return v.apply(e,cr([this.value()],arguments))})}),e}function Ib(){return $e._===this&&($e._=Ym),this}function Li(){}function kb(e){return e=se(e),oe(function(t){return Ul(t,e)})}var Db=fi(qe),Ab=fi(cl),qb=fi(Fn);function iu(e){return wi(e)?jn(Wt(e)):sy(e)}function Cb(e){return function(t){return e==null?a:Ar(e,t)}}var Sb=uc(),zb=uc(!0);function Mi(){return[]}function Fi(){return!1}function Nb(){return{}}function Ob(){return""}function Pb(){return!0}function Eb(e,t){if(e=se(e),e<1||e>Le)return[];var r=te,i=Ge(e,te);t=K(t),e-=te;for(var u=Wn(i,t);++r<e;)t(r);return u}function Rb(e){return ae(e)?qe(e,Wt):ft(e)?[e]:rt(Dc(we(e)))}function Lb(e){var t=++Xm;return we(e)+t}var Mb=js(function(e,t){return e+t},0),Fb=yi("ceil"),jb=js(function(e,t){return e/t},1),Bb=yi("floor");function Ub(e){return e&&e.length?Os(e,nt,ei):a}function Wb(e,t){return e&&e.length?Os(e,K(t,2),ei):a}function Hb(e){return pl(e,nt)}function $b(e,t){return pl(e,K(t,2))}function Vb(e){return e&&e.length?Os(e,nt,si):a}function Xb(e,t){return e&&e.length?Os(e,K(t,2),si):a}var Gb=js(function(e,t){return e*t},1),Yb=yi("round"),Kb=js(function(e,t){return e-t},0);function Qb(e){return e&&e.length?Un(e,nt):0}function Zb(e,t){return e&&e.length?Un(e,K(t,2)):0}return d.after=x_,d.ary=Lc,d.assign=og,d.assignIn=Qc,d.assignInWith=Js,d.assignWith=lg,d.at=cg,d.before=Mc,d.bind=Ai,d.bindAll=fb,d.bindKey=Fc,d.castArray=N_,d.chain=Pc,d.chunk=By,d.compact=Uy,d.concat=Wy,d.cond=yb,d.conforms=hb,d.constant=Pi,d.countBy=Qh,d.create=ug,d.curry=jc,d.curryRight=Bc,d.debounce=Uc,d.defaults=dg,d.defaultsDeep=pg,d.defer=w_,d.delay=v_,d.difference=Hy,d.differenceBy=$y,d.differenceWith=Vy,d.drop=Xy,d.dropRight=Gy,d.dropRightWhile=Yy,d.dropWhile=Ky,d.fill=Qy,d.filter=Jh,d.flatMap=r_,d.flatMapDeep=a_,d.flatMapDepth=s_,d.flatten=Sc,d.flattenDeep=Zy,d.flattenDepth=Jy,d.flip=T_,d.flow=gb,d.flowRight=bb,d.fromPairs=eh,d.functions=bg,d.functionsIn=xg,d.groupBy=n_,d.initial=rh,d.intersection=ah,d.intersectionBy=sh,d.intersectionWith=nh,d.invert=vg,d.invertBy=Tg,d.invokeMap=o_,d.iteratee=Ei,d.keyBy=l_,d.keys=We,d.keysIn=st,d.map=Xs,d.mapKeys=kg,d.mapValues=Dg,d.matches=xb,d.matchesProperty=wb,d.memoize=Ys,d.merge=Ag,d.mergeWith=Zc,d.method=vb,d.methodOf=Tb,d.mixin=Ri,d.negate=Ks,d.nthArg=kb,d.omit=qg,d.omitBy=Cg,d.once=I_,d.orderBy=c_,d.over=Db,d.overArgs=k_,d.overEvery=Ab,d.overSome=qb,d.partial=qi,d.partialRight=Wc,d.partition=u_,d.pick=Sg,d.pickBy=Jc,d.property=iu,d.propertyOf=Cb,d.pull=ch,d.pullAll=Nc,d.pullAllBy=uh,d.pullAllWith=dh,d.pullAt=ph,d.range=Sb,d.rangeRight=zb,d.rearg=D_,d.reject=m_,d.remove=mh,d.rest=A_,d.reverse=ki,d.sampleSize=y_,d.set=Ng,d.setWith=Og,d.shuffle=h_,d.slice=fh,d.sortBy=b_,d.sortedUniq=wh,d.sortedUniqBy=vh,d.split=rb,d.spread=q_,d.tail=Th,d.take=Ih,d.takeRight=kh,d.takeRightWhile=Dh,d.takeWhile=Ah,d.tap=Uh,d.throttle=C_,d.thru=Vs,d.toArray=Gc,d.toPairs=eu,d.toPairsIn=tu,d.toPath=Rb,d.toPlainObject=Kc,d.transform=Pg,d.unary=S_,d.union=qh,d.unionBy=Ch,d.unionWith=Sh,d.uniq=zh,d.uniqBy=Nh,d.uniqWith=Oh,d.unset=Eg,d.unzip=Di,d.unzipWith=Oc,d.update=Rg,d.updateWith=Lg,d.values=ra,d.valuesIn=Mg,d.without=Ph,d.words=su,d.wrap=z_,d.xor=Eh,d.xorBy=Rh,d.xorWith=Lh,d.zip=Mh,d.zipObject=Fh,d.zipObjectDeep=jh,d.zipWith=Bh,d.entries=eu,d.entriesIn=tu,d.extend=Qc,d.extendWith=Js,Ri(d,d),d.add=Mb,d.attempt=nu,d.camelCase=Ug,d.capitalize=ru,d.ceil=Fb,d.clamp=Fg,d.clone=O_,d.cloneDeep=E_,d.cloneDeepWith=R_,d.cloneWith=P_,d.conformsTo=L_,d.deburr=au,d.defaultTo=_b,d.divide=jb,d.endsWith=Wg,d.eq=Rt,d.escape=Hg,d.escapeRegExp=$g,d.every=Zh,d.find=e_,d.findIndex=qc,d.findKey=mg,d.findLast=t_,d.findLastIndex=Cc,d.findLastKey=fg,d.floor=Bb,d.forEach=Ec,d.forEachRight=Rc,d.forIn=yg,d.forInRight=hg,d.forOwn=_g,d.forOwnRight=gg,d.get=zi,d.gt=M_,d.gte=F_,d.has=wg,d.hasIn=Ni,d.head=zc,d.identity=nt,d.includes=i_,d.indexOf=th,d.inRange=jg,d.invoke=Ig,d.isArguments=Sr,d.isArray=ae,d.isArrayBuffer=j_,d.isArrayLike=at,d.isArrayLikeObject=Ee,d.isBoolean=B_,d.isBuffer=hr,d.isDate=U_,d.isElement=W_,d.isEmpty=H_,d.isEqual=$_,d.isEqualWith=V_,d.isError=Ci,d.isFinite=X_,d.isFunction=er,d.isInteger=Hc,d.isLength=Qs,d.isMap=$c,d.isMatch=G_,d.isMatchWith=Y_,d.isNaN=K_,d.isNative=Q_,d.isNil=J_,d.isNull=Z_,d.isNumber=Vc,d.isObject=Se,d.isObjectLike=Pe,d.isPlainObject=ja,d.isRegExp=Si,d.isSafeInteger=eg,d.isSet=Xc,d.isString=Zs,d.isSymbol=ft,d.isTypedArray=ta,d.isUndefined=tg,d.isWeakMap=rg,d.isWeakSet=ag,d.join=ih,d.kebabCase=Vg,d.last=Dt,d.lastIndexOf=oh,d.lowerCase=Xg,d.lowerFirst=Gg,d.lt=sg,d.lte=ng,d.max=Ub,d.maxBy=Wb,d.mean=Hb,d.meanBy=$b,d.min=Vb,d.minBy=Xb,d.stubArray=Mi,d.stubFalse=Fi,d.stubObject=Nb,d.stubString=Ob,d.stubTrue=Pb,d.multiply=Gb,d.nth=lh,d.noConflict=Ib,d.noop=Li,d.now=Gs,d.pad=Yg,d.padEnd=Kg,d.padStart=Qg,d.parseInt=Zg,d.random=Bg,d.reduce=d_,d.reduceRight=p_,d.repeat=Jg,d.replace=eb,d.result=zg,d.round=Yb,d.runInContext=w,d.sample=f_,d.size=__,d.snakeCase=tb,d.some=g_,d.sortedIndex=yh,d.sortedIndexBy=hh,d.sortedIndexOf=_h,d.sortedLastIndex=gh,d.sortedLastIndexBy=bh,d.sortedLastIndexOf=xh,d.startCase=ab,d.startsWith=sb,d.subtract=Kb,d.sum=Qb,d.sumBy=Zb,d.template=nb,d.times=Eb,d.toFinite=tr,d.toInteger=se,d.toLength=Yc,d.toLower=ib,d.toNumber=At,d.toSafeInteger=ig,d.toString=we,d.toUpper=ob,d.trim=lb,d.trimEnd=cb,d.trimStart=ub,d.truncate=db,d.unescape=pb,d.uniqueId=Lb,d.upperCase=mb,d.upperFirst=Oi,d.each=Ec,d.eachRight=Rc,d.first=zc,Ri(d,function(){var e={};return Bt(d,function(t,r){Te.call(d.prototype,r)||(e[r]=t)}),e}(),{chain:!1}),d.VERSION=o,wt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){d[e].placeholder=d}),wt(["drop","take"],function(e,t){fe.prototype[e]=function(r){r=r===a?1:Be(se(r),0);var i=this.__filtered__&&!t?new fe(this):this.clone();return i.__filtered__?i.__takeCount__=Ge(r,i.__takeCount__):i.__views__.push({size:Ge(r,te),type:e+(i.__dir__<0?"Right":"")}),i},fe.prototype[e+"Right"]=function(r){return this.reverse()[e](r).reverse()}}),wt(["filter","map","takeWhile"],function(e,t){var r=t+1,i=r==Fe||r==ge;fe.prototype[e]=function(u){var p=this.clone();return p.__iteratees__.push({iteratee:K(u,3),type:r}),p.__filtered__=p.__filtered__||i,p}}),wt(["head","last"],function(e,t){var r="take"+(t?"Right":"");fe.prototype[e]=function(){return this[r](1).value()[0]}}),wt(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");fe.prototype[e]=function(){return this.__filtered__?new fe(this):this[r](1)}}),fe.prototype.compact=function(){return this.filter(nt)},fe.prototype.find=function(e){return this.filter(e).head()},fe.prototype.findLast=function(e){return this.reverse().find(e)},fe.prototype.invokeMap=oe(function(e,t){return typeof e=="function"?new fe(this):this.map(function(r){return Pa(r,e,t)})}),fe.prototype.reject=function(e){return this.filter(Ks(K(e)))},fe.prototype.slice=function(e,t){e=se(e);var r=this;return r.__filtered__&&(e>0||t<0)?new fe(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==a&&(t=se(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},fe.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},fe.prototype.toArray=function(){return this.take(te)},Bt(fe.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),u=d[i?"take"+(t=="last"?"Right":""):t],p=i||/^find/.test(t);u&&(d.prototype[t]=function(){var f=this.__wrapped__,g=i?[1]:arguments,v=f instanceof fe,S=g[0],z=v||ae(f),N=function(pe){var he=u.apply(d,cr([pe],g));return i&&W?he[0]:he};z&&r&&typeof S=="function"&&S.length!=1&&(v=z=!1);var W=this.__chain__,V=!!this.__actions__.length,Q=p&&!W,ne=v&&!V;if(!p&&z){f=ne?f:new fe(this);var Z=e.apply(f,g);return Z.__actions__.push({func:Vs,args:[N],thisArg:a}),new Tt(Z,W)}return Q&&ne?e.apply(this,g):(Z=this.thru(N),Q?i?Z.value()[0]:Z.value():Z)})}),wt(["pop","push","shift","sort","splice","unshift"],function(e){var t=gs[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);d.prototype[e]=function(){var u=arguments;if(i&&!this.__chain__){var p=this.value();return t.apply(ae(p)?p:[],u)}return this[r](function(f){return t.apply(ae(f)?f:[],u)})}}),Bt(fe.prototype,function(e,t){var r=d[t];if(r){var i=r.name+"";Te.call(Kr,i)||(Kr[i]=[]),Kr[i].push({name:t,func:r})}}),Kr[Fs(a,J).name]=[{name:"wrapper",func:a}],fe.prototype.clone=pf,fe.prototype.reverse=mf,fe.prototype.value=ff,d.prototype.at=Wh,d.prototype.chain=Hh,d.prototype.commit=$h,d.prototype.next=Vh,d.prototype.plant=Gh,d.prototype.reverse=Yh,d.prototype.toJSON=d.prototype.valueOf=d.prototype.value=Kh,d.prototype.first=d.prototype.head,Aa&&(d.prototype[Aa]=Xh),d},Xr=Hm();vr?((vr.exports=Xr)._=Xr,En._=Xr):$e._=Xr}).call(aa)}(Va,Va.exports);var io=Va.exports;const ze="tccScript",Or={builtinFunctions:/strategy\.closedtrades\.max_drawdown_percent|strategy\.opentrades\.max_drawdown_percent|strategy\.risk\.max_intraday_filled_orders|strategy\.closedtrades\.max_runup_percent|array\.percentile_linear_interpolation|strategy\.closedtrades\.entry_bar_index|strategy\.opentrades\.max_runup_percent|strategy\.closedtrades\.exit_bar_index|strategy\.closedtrades\.profit_percent|strategy\.closedtrades\.entry_comment|strategy\.opentrades\.entry_bar_index|strategy\.closedtrades\.exit_comment|strategy\.closedtrades\.max_drawdown|strategy\.opentrades\.profit_percent|ta\.percentile_linear_interpolation|strategy\.closedtrades\.entry_price|strategy\.opentrades\.entry_comment|strategy\.closedtrades\.commission|strategy\.closedtrades\.entry_time|strategy\.closedtrades\.exit_price|strategy\.opentrades\.max_drawdown|strategy\.risk\.max_cons_loss_days|strategy\.closedtrades\.exit_time|strategy\.closedtrades\.max_runup|strategy\.opentrades\.entry_price|strategy\.risk\.max_intraday_loss|strategy\.risk\.max_position_size|table\.cell_set_text_font_family|strategy\.closedtrades\.entry_id|strategy\.opentrades\.commission|strategy\.opentrades\.entry_time|array\.binary_search_rightmost|array\.percentile_nearest_rank|strategy\.closedtrades\.exit_id|strategy\.opentrades\.max_runup|array\.binary_search_leftmost|strategy\.closedtrades\.profit|strategy\.opentrades\.entry_id|strategy\.risk\.allow_entry_in|strategy\.convert_to_account|box\.set_bottom_right_point|label\.set_text_font_family|strategy\.closedtrades\.size|strategy\.convert_to_symbol|strategy\.default_entry_qty|strategy\.opentrades\.profit|strategy\.risk\.max_drawdown|ta\.percentile_nearest_rank|table\.cell_set_text_halign|table\.cell_set_text_valign|request\.security_lower_tf|table\.cell_set_text_color|box\.set_text_font_family|strategy\.opentrades\.size|table\.cell_set_text_size|matrix\.is_antisymmetric|box\.set_top_left_point|chart\.point\.from_index|matrix\.is_antidiagonal|table\.cell_set_bgcolor|table\.cell_set_tooltip|table\.set_border_color|table\.set_border_width|timeframe\.from_seconds|chart\.point\.from_time|line\.set_second_point|math\.round_to_mintick|matrix\.elements_count|request\.currency_rate|ta\.pivot_point_levels|table\.cell_set_height|table\.set_frame_color|table\.set_frame_width|box\.set_border_color|box\.set_border_style|box\.set_border_width|line\.set_first_point|matrix\.is_stochastic|matrix\.is_triangular|table\.cell_set_width|timeframe\.in_seconds|array\.binary_search|box\.set_rightbottom|box\.set_text_halign|box\.set_text_valign|color\.from_gradient|label\.set_textalign|label\.set_textcolor|matrix\.eigenvectors|matrix\.is_symmetric|matrix\.swap_columns|strategy\.cancel_all|table\.cell_set_text|array\.new_linefill|array\.sort_indices|box\.set_text_color|linefill\.get_line1|linefill\.get_line2|linefill\.set_color|matrix\.eigenvalues|matrix\.is_diagonal|matrix\.is_identity|strategy\.close_all|table\.set_position|ticker\.pointfigure|array\.lastindexof|array\.percentrank|array\.standardize|box\.set_text_size|box\.set_text_wrap|label\.set_tooltip|matrix\.remove_col|matrix\.remove_row|request\.dividends|request\.financial|table\.merge_cells|table\.set_bgcolor|ticker\.heikinashi|array\.covariance|array\.new_string|chart\.point\.copy|matrix\.is_binary|matrix\.is_square|matrix\.submatrix|matrix\.swap_rows|matrix\.transpose|request\.earnings|request\.economic|request\.security|ticker\.linebreak|timeframe\.change|array\.new_color|array\.new_float|array\.new_label|array\.new_table|box\.set_bgcolor|box\.set_lefttop|chart\.point\.new|chart\.point\.now|input\.text_area|input\.timeframe|label\.set_color|label\.set_point|label\.set_style|line\.set_extend|linefill\.delete|polyline\.delete|str\.format_time|str\.replace_all|strategy\.cancel|ticker\.standard|alertcondition|array\.includes|array\.new_bool|array\.new_line|array\.variance|box\.get_bottom|box\.set_bottom|box\.set_extend|label\.get_text|label\.set_size|label\.set_text|label\.set_xloc|label\.set_yloc|line\.get_price|line\.set_color|line\.set_style|line\.set_width|math\.todegrees|math\.toradians|matrix\.add_col|matrix\.add_row|matrix\.columns|matrix\.is_zero|matrix\.reshape|matrix\.reverse|request\.quandl|request\.splits|str\.startswith|strategy\.close|strategy\.entry|strategy\.order|syminfo\.prefix|syminfo\.ticker|ta\.correlation|ta\.highestbars|ta\.percentrank|ticker\.inherit|array\.indexof|array\.new_box|array\.new_int|array\.reverse|array\.unshift|box\.get_right|box\.set_right|input\.session|line\.set_xloc|matrix\.concat|matrix\.median|max_bars_back|runtime\.error|str\.substring|strategy\.exit|ta\.crossunder|ta\.lowestbars|ta\.supertrend|ticker\.modify|array\.concat|array\.insert|array\.median|array\.remove|box\.get_left|box\.set_left|box\.set_text|input\.source|input\.string|input\.symbol|label\.delete|label\.set_xy|line\.set_xy1|line\.set_xy2|linefill\.new|map\.contains|matrix\.trace|polyline\.new|request\.seed|str\.contains|str\.endswith|str\.tonumber|str\.tostring|ta\.barssince|ta\.crossover|ta\.pivothigh|ta\.valuewhen|table\.delete|ticker\.renko|array\.clear|array\.every|array\.first|array\.range|array\.shift|array\.slice|array\.stdev|box\.get_top|box\.set_top|input\.color|input\.float|input\.price|label\.get_x|label\.get_y|label\.set_x|label\.set_y|line\.delete|line\.get_x1|line\.get_x2|line\.get_y1|line\.get_y2|line\.set_x1|line\.set_x2|line\.set_y1|line\.set_y2|log\.warning|map\.put_all|math\.random|matrix\.copy|matrix\.diff|matrix\.fill|matrix\.kron|matrix\.mode|matrix\.mult|matrix\.pinv|matrix\.rank|matrix\.rows|matrix\.sort|str\.replace|ta\.pivotlow|ta\.variance|table\.clear|ticker\.kagi|array\.copy|array\.fill|array\.from|array\.join|array\.last|array\.mode|array\.push|array\.size|array\.some|array\.sort|box\.delete|dayofmonth|input\.bool|input\.time|label\.copy|map\.remove|map\.values|math\.floor|math\.log10|math\.round|matrix\.avg|matrix\.col|matrix\.det|matrix\.get|matrix\.inv|matrix\.max|matrix\.min|matrix\.new|matrix\.pow|matrix\.row|matrix\.set|matrix\.sum|plotcandle|str\.format|str\.length|ta\.falling|ta\.highest|table\.cell|ticker\.new|time_close|weekofyear|array\.abs|array\.avg|array\.get|array\.max|array\.min|array\.new|array\.pop|array\.set|array\.sum|color\.new|color\.rgb|dayofweek|indicator|input\.int|label\.new|line\.copy|log\.error|map\.clear|math\.acos|math\.asin|math\.atan|math\.ceil|math\.sign|math\.sqrt|plotarrow|plotshape|str\.lower|str\.match|str\.split|str\.upper|ta\.change|ta\.linreg|ta\.lowest|ta\.median|ta\.rising|table\.new|timestamp|barcolor|box\.copy|line\.new|linefill|log\.info|map\.copy|map\.keys|map\.size|math\.abs|math\.avg|math\.cos|math\.exp|math\.log|math\.max|math\.min|math\.pow|math\.sin|math\.sum|math\.tan|plotchar|strategy|ta\.cross|ta\.range|ta\.stdev|ta\.stoch|bgcolor|box\.new|color\.b|color\.g|color\.r|color\.t|library|map\.get|map\.new|map\.put|plotbar|str\.pos|ta\.alma|ta\.macd|ta\.mode|ta\.swma|ta\.vwap|ta\.vwma|fixnan|minute|second|string|ta\.atr|ta\.bbw|ta\.cci|ta\.cmo|ta\.cog|ta\.cum|ta\.dev|ta\.dmi|ta\.ema|ta\.hma|ta\.kcw|ta\.max|ta\.mfi|ta\.min|ta\.mom|ta\.rma|ta\.roc|ta\.rsi|ta\.sar|ta\.sma|ta\.tsi|ta\.wma|ta\.wpr|alert|color|float|hline|input|label|month|ta\.bb|ta\.kc|ta\.tr|table|bool|fill|hour|line|plot|time|year|box|int|na|nz/,keywords:/continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|and|for|not|var|as|by|if|in|or|to/,tokenizer:{root:[[/\/\/\s*(?=@)/,"comment","@comments"],[/\/\/.*(?!@).*/,"comment"],[/\'([^\'\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/\"/,{token:"string",bracket:"@open",next:"@stringDouble"}],[/type\s+[a-zA-Z]\w*/,"entity.name.type"],[/'/,{token:"string",bracket:"@open",next:"@stringSingle"}],[/(@builtinFunctions)(?=\s*\(|\s*<.*>)/,{token:"support.function",next:"@template"}],[/@punctuation/,{token:"punctuation.operator",next:"@property"}],[/(varip|var)\b(\s+)((?!(?:chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map|continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|and|for|not|var|as|by|if|in|or|to)\b)[\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|and|for|not|var|as|by|if|in|or|to)\b)[\w\d_$]+)/,[{token:"keyword"},{token:"source"},{token:"entity.name.type"},{token:"paren"},{token:"source"},{token:"variable.other"}]],[/\b(?:@builtinTypes)(?=(\s*)[\[|<|(]|(?=\s+(?=[^.=][\w\(]*))|\s*$)/,{token:"support.type",next:"@template"}],[/^(\s*)\b(?!(?:chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map|continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|and|for|not|var|as|by|if|in|or|to)\b)([\w.\d_$]+)(\[\]|)(\s+)((?!(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|and|for|not|var|as|by|if|in|or|to)\b)[\w\d_$]+)(\s+)(\=)/,[{token:"source"},{token:"entity.name.type"},{token:"paren"},{token:"source"},{token:"variable.other"},{token:"source"},{token:"keyword.equals"}]],[/(\((?:\s+))?((?!(?:chart\.point|linefill|polyline|continue|for\.\.\.in|matrix|series|simple|string|export|import|method|switch|array|color|const|float|label|table|break|varip|while|bool|line|else|type|box|int|map|and|for|not|var|as|by|if|in|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/,"entity.name.type"],[/import(?=\s+@importName)/,{token:"keyword",next:"@import"}],[/import(?=\s+[a-zA-Z\d\$_\-\.\u00a1-\uffff\/]+)/,"keyword"],[/[+-]?\d+\.\d*([eE][\-+]?\d+)?(?!\w+)/,"constant.numeric.float"],[/[+-]?\.\d+([eE][\-+]?\d+)?(?!\w+)/,"constant.numeric.float"],[/([+-]?(\d+))(?!\w+)(?!\w+)/,"constant.numeric.integer"],[/(?:true|false)\b/,"constant.other.boolean"],[/#[0-9a-fA-F]{6,8}\b/,"constant.other.color"],[/\+=|\-=|\*=|\/=|%=|[\/%*+\-]|==|!=|<=|>=|=>|<|>|\?|\:=|\:|\,/,"keyword.operator"],[/\b(?:continue|for\.\.\.in|export|import|method|switch|break|varip|while|else|type|and|for|not|var|as|by|if|in|or|to)\b/,"keyword"],[/^[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/,"entity.name.function"],[/[0-9]+\b/,"constant.numeric.integer"],[/=/,"keyword.equals"],[/\b(?:strategy\.commission\.cash_per_contract|strategy\.avg_winning_trade_percent|strategy\.avg_winning_trade|strategy\.avg_losing_trade_percent|strategy\.avg_losing_trade|syminfo\.recommendations_sell_strong|syminfo\.recommendations_buy_strong|strategy\.commission\.cash_per_order|strategy\.margin_liquidation_price|strategy\.max_contracts_held_short|strategy\.max_contracts_held_long|syminfo\.shares_outstanding_float|syminfo\.shares_outstanding_total|barstate\.islastconfirmedhistory|earnings\.future_period_end_time|strategy\.max_contracts_held_all|syminfo\.target_price_estimates|strategy\.max_drawdown_percent|syminfo\.recommendations_total|alert\.freq_once_per_bar_close|label\.style_label_lower_right|label\.style_label_upper_right|chart\.right_visible_bar_time|strategy\.grossprofit_percent|strategy\.position_entry_name|syminfo\.recommendations_date|syminfo\.recommendations_hold|syminfo\.recommendations_sell|syminfo\.target_price_average|label\.style_label_lower_left|label\.style_label_upper_left|chart\.left_visible_bar_time|strategy\.openprofit_percent|strategy\.position_avg_price|syminfo\.recommendations_buy|syminfo\.target_price_median|plot\.style_stepline_diamond|strategy\.commission\.percent|session\.isfirstbar_regular|strategy\.grossloss_percent|strategy\.max_runup_percent|strategy\.netprofit_percent|strategy\.percent_of_equity|session\.islastbar_regular|strategy\.account_currency|syminfo\.target_price_date|syminfo\.target_price_high|dividends\.future_pay_date|strategy\.initial_capital|syminfo\.target_price_low|dividends\.future_ex_date|label\.style_label_center|label\.style_text_outline|label\.style_triangledown|strategy\.direction\.short|earnings\.future_revenue|alert\.freq_once_per_bar|dividends\.future_amount|label\.style_label_right|strategy\.direction\.long|strategy\.position_size|barmerge\.lookahead_off|label\.style_label_down|label\.style_label_left|label\.style_triangleup|line\.style_arrow_right|position\.bottom_center|position\.middle_center|strategy\.direction\.all|strategy\.closedtrades|strategy\.max_drawdown|barmerge\.lookahead_on|earnings\.standardized|font\.family_monospace|label\.style_arrowdown|line\.style_arrow_both|line\.style_arrow_left|plot\.style_steplinebr|position\.bottom_right|position\.middle_right|barstate\.isconfirmed|earnings\.future_time|session\.ispostmarket|strategy\.grossprofit|syminfo\.basecurrency|syminfo\.shareholders|timeframe\.isintraday|timeframe\.multiplier|adjustment\.dividends|label\.style_label_up|plot\.style_histogram|position\.bottom_left|position\.middle_left|barstate\.isrealtime|chart\.is_heikinashi|earnings\.future_eps|session\.ispremarket|strategy\.eventrades|strategy\.losstrades|strategy\.openprofit|strategy\.opentrades\.capital_held|strategy\.opentrades|syminfo\.description|timeframe\.isminutes|timeframe\.ismonthly|timeframe\.isseconds|dayofweek\.wednesday|display\.data_window|display\.price_scale|display\.status_line|font\.family_default|label\.style_arrowup|label\.style_diamond|plot\.style_stepline|position\.top_center|strategy\.oca\.cancel|strategy\.oca\.reduce|barstate\.ishistory|chart\.is_linebreak|session\.isfirstbar|strategy\.grossloss|strategy\.max_runup|strategy\.netprofit|strategy\.wintrades|syminfo\.pointvalue|syminfo\.pricescale|syminfo\.volumetype|timeframe\.isweekly|dayofweek\.saturday|dayofweek\.thursday|hline\.style_dashed|hline\.style_dotted|label\.style_circle|label\.style_square|label\.style_xcross|plot\.style_circles|plot\.style_columns|position\.top_right|shape\.triangledown|splits\.denominator|chart\.is_standard|session\.islastbar|syminfo\.employees|timeframe\.isdaily|adjustment\.splits|barmerge\.gaps_off|dayofweek\.tuesday|earnings\.estimate|hline\.style_solid|label\.style_cross|line\.style_dashed|line\.style_dotted|location\.abovebar|location\.absolute|location\.belowbar|plot\.style_areabr|plot\.style_linebr|position\.top_left|strategy\.oca\.none|text\.align_bottom|text\.align_center|barstate\.isfirst|session\.ismarket|syminfo\.currency|syminfo\.industry|syminfo\.tickerid|syminfo\.timezone|timeframe\.period|barmerge\.gaps_on|dayofweek\.friday|dayofweek\.monday|dayofweek\.sunday|label\.style_flag|label\.style_none|line\.style_solid|order\.descending|plot\.style_cross|session\.extended|shape\.triangleup|splits\.numerator|text\.align_right|barstate\.islast|strategy\.equity|syminfo\.country|syminfo\.minmove|syminfo\.mintick|syminfo\.session|time_tradingday|timeframe\.isdwm|adjustment\.none|dividends\.gross|earnings\.actual|location\.bottom|order\.ascending|plot\.style_area|plot\.style_line|session\.regular|shape\.arrowdown|shape\.labeldown|text\.align_left|barstate\.isnew|chart\.bg_color|chart\.fg_color|chart\.is_range|chart\.is_renko|last_bar_index|strategy\.short|syminfo\.prefix|syminfo\.sector|syminfo\.ticker|alert\.freq_all|format\.inherit|format\.mintick|format\.percent|strategy\.fixed|text\.align_top|text\.wrap_auto|text\.wrap_none|xloc\.bar_index|chart\.is_kagi|last_bar_time|strategy\.long|color\.fuchsia|currency\.NONE|currency\.USDT|dividends\.net|format\.volume|shape\.arrowup|shape\.diamond|shape\.labelup|strategy\.cash|xloc\.bar_time|yloc\.abovebar|yloc\.belowbar|chart\.is_pnf|linefill\.all|polyline\.all|syminfo\.root|syminfo\.type|color\.maroon|color\.orange|color\.purple|color\.silver|color\.yellow|currency\.AUD|currency\.BTC|currency\.CAD|currency\.CHF|currency\.ETH|currency\.EUR|currency\.GBP|currency\.HKD|currency\.INR|currency\.JPY|currency\.KRW|currency\.MYR|currency\.NOK|currency\.NZD|currency\.RUB|currency\.SEK|currency\.SGD|currency\.TRY|currency\.USD|currency\.ZAR|display\.none|display\.pane|extend\.right|format\.price|location\.top|shape\.circle|shape\.square|shape\.xcross|color\.black|color\.green|color\.olive|color\.white|display\.all|extend\.both|extend\.left|extend\.none|scale\.right|shape\.cross|size\.normal|dayofmonth|ta\.accdist|time_close|weekofyear|color\.aqua|color\.blue|color\.gray|color\.lime|color\.navy|color\.teal|scale\.left|scale\.none|shape\.flag|size\.large|size\.small|yloc\.price|bar_index|dayofweek|label\.all|table\.all|color\.red|math\.rphi|size\.auto|size\.huge|size\.tiny|line\.all|math\.phi|box\.all|ta\.vwap|ta\.wvad|timenow|math\.pi|minute|second|ta\.iii|ta\.nvi|ta\.obv|ta\.pvi|ta\.pvt|ta\.wad|volume|math\.e|close|hlcc4|month|ohlc4|ta\.tr|false|high|hlc3|hour|open|time|year|true|hl2|low|na)\b(?!\s*=\s*\w+)/,"support.variable"],[/[(|)|\[|\]]/,"paren"],[/[a-zA-Z_][a-zA-Z_0-9]*(?=\s*\()/,{token:"entity.name.method"}],[/\w+\b/,"variable.other"]],comments:[[/@[A-Za-z]+(\s*=\s*)?$/,{token:"comment.annotation",next:"@pop"}],[/@[A-Za-z]+(\s*=\s*)?/,{token:"comment.annotation"}],[/(?!\s*@[A-Za-z]+).+$/,{token:"comment",next:"@pop"}]],stringDouble:[[/[^\\\"]+/,"string"],[/\\./,"string.invalid"],[/\"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],stringSingle:[[/[^\\']+/,"string"],[/\\./,"string.invalid"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],template:[[/(@builtinTypes)/,{token:"support.type"}],[/(\((?:\s+))?((?!(?:chart\.point|linefill|polyline|continue|for\.\.\.in|matrix|series|simple|string|export|import|method|switch|array|color|const|float|label|table|break|varip|while|bool|line|else|type|box|int|map|and|for|not|var|as|by|if|in|or|to)\b)\b[\w.\d_$]+(?=[\[\]]*(?:\s+)(?:[\w\d_$]+\s*(?:\,|\))+\s*).+(?:\=\>|\→)))/,"entity.name.type"],[/\(|\)|\[|\]|\=|\>/,{token:"paren",next:"@pop"}],[/(\,)(\s+)/,["keyword.operator","source"]],[/(\,)/,{token:"keyword.operator"}],[/([\w.\d$]+)/,{token:"entity.name.type"}],[/(<|>)/,{token:"paren"}],[/\s(?=\w)|$/,{token:"source",next:"@pop"}]],property:[[/@punctuation/,{token:"punctuation.operator"}],[/(@builtinTypes)(?=\s*[(])/,{token:"support.method",next:"@pop"}],[/[a-zA-Z_][a-zA-Z_0-9]+(?=\s*\()/,{token:"entity.name.method",next:"@pop"}],[/[a-zA-Z0-9_]+/,{token:"variable.other.property",next:"@pop"}],[/@empty/,{token:"source",next:"@pop"}]],import:[[/\s+/,{token:"source"}],[/(@importName)(\s+)(as\b)(\s+)(@importAlias)/,[{token:"entity.name.module"},{token:"source"},{token:"keyword"},{token:"source"},{token:"entity.name.module.name",next:"@pop"}]],[/@importName/,{token:"entity.name.module",next:"@pop"}]]},builtinTypes:/chart\.point|linefill|polyline|matrix|series|simple|string|array|color|const|float|label|table|bool|line|box|int|map/,punctuation:/[.](?![.])/,importName:/[a-zA-Z\d\$_\-\.\u00a1-\uffff\/]+/,importAlias:/[a-zA-Z\d\_\u00a1\uffff\/]+/,empty:/^$/};var Ct;(function(s){s[s.None=0]="None",s[s.Indent=1]="Indent",s[s.IndentOutdent=2]="IndentOutdent",s[s.Outdent=3]="Outdent"})(Ct||(Ct={}));const on={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["(",")"],["[","]"]],folding:{markers:{start:/(\/\/#region)|(\/\/.*{($|\s))/,end:/(\/\/#endregion)|(\/\/.*}($|\s))/}},autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],onEnterRules:[{beforeText:/\)\s*=>\s*$/,action:{indentAction:Ct.Indent}},{beforeText:/if\s+.*\s*$/,action:{indentAction:Ct.Indent}},{beforeText:/else/,action:{indentAction:Ct.Indent}},{beforeText:/for\s+\S+\s*=\s*\S+\s+to\s+\S+(?:\s+by\s+\S+)?\s*$/,action:{indentAction:Ct.Indent}},{beforeText:/for\s+(?:\[\S+\s+\S+]|\S+)\s+in\s+\S+\s*$/,action:{indentAction:Ct.Indent}},{beforeText:/switch\s+.*\s*$/,action:{indentAction:Ct.Indent}},{beforeText:/while\s+.*\s*$/,action:{indentAction:Ct.Indent}},{beforeText:/type\s+\w+/,action:{indentAction:Ct.Indent}},{beforeText:/^\s*$/,action:{indentAction:Ct.Outdent}}]},D={"color-white":"#ffffff","color-black":"#000000","color-transparent":"#00000000","color-cold-gray-50":"#F8F9FD","color-cold-gray-100":"#F0F3FA","color-cold-gray-150":"#E0E3EB","color-cold-gray-200":"#D1D4DC","color-cold-gray-250":"#C1C4CD","color-cold-gray-300":"#B2B5BE","color-cold-gray-350":"#A3A6AF","color-cold-gray-400":"#9598A1","color-cold-gray-450":"#868993","color-cold-gray-500":"#787B86","color-cold-gray-550":"#6A6D78","color-cold-gray-600":"#5D606B","color-cold-gray-650":"#50535E","color-cold-gray-700":"#434651","color-cold-gray-750":"#363A45","color-cold-gray-800":"#2A2E39","color-cold-gray-850":"#1E222D","color-cold-gray-900":"#131722","color-cold-gray-950":"#0C0E15","color-ripe-red-50":"#FFEBEC","color-ripe-red-100":"#FCCBCD","color-ripe-red-200":"#FAA1A4","color-ripe-red-300":"#F77C80","color-ripe-red-400":"#F7525F","color-ripe-red-500":"#F23645","color-ripe-red-600":"#CC2F3C","color-ripe-red-700":"#B22833","color-ripe-red-800":"#991F29","color-ripe-red-900":"#801922","color-ripe-red-a100":"#FF8080","color-ripe-red-a200":"#FF5252","color-ripe-red-a400":"#FF3333","color-ripe-red-a600":"#CC2929","color-ripe-red-a700":"#802028","color-ripe-red-a800":"#4D191D","color-ripe-red-a900":"#331F20","color-tan-orange-50":"#FFF3E0","color-tan-orange-100":"#FFE0B2","color-tan-orange-200":"#FFCC80","color-tan-orange-300":"#ffb74d","color-tan-orange-400":"#FFA726","color-tan-orange-500":"#FF9800","color-tan-orange-600":"#FB8C00","color-tan-orange-700":"#F57C00","color-tan-orange-800":"#EF6C00","color-tan-orange-900":"#e65100","color-tan-orange-a200":"#ffab40","color-tan-orange-a400":"#FF9100","color-tan-orange-a600":"#CC7014","color-tan-orange-a700":"#8C541C","color-tan-orange-a800":"#593A1B","color-tan-orange-a900":"#33261A","color-iguana-green-100":"#C8E6C9","color-iguana-green-200":"#A5D6A7","color-iguana-green-300":"#81c784","color-iguana-green-400":"#66BB6A","color-iguana-green-500":"#4caf50","color-iguana-green-600":"#43a047","color-iguana-green-700":"#388e3c","color-iguana-green-800":"#2E7D32","color-iguana-green-900":"#1B5E20","color-iguana-green-a700":"#00c853","color-banana-yellow-100":"#FFF9C4","color-banana-yellow-200":"#FFF59D","color-banana-yellow-300":"#FFF176","color-banana-yellow-400":"#ffee58","color-banana-yellow-500":"#ffeb3b","color-banana-yellow-600":"#fdd835","color-banana-yellow-700":"#fbc02d","color-banana-yellow-800":"#f9a825","color-banana-yellow-900":"#F57F17","color-banana-yellow-a400":"#ffea00","color-banana-yellow-a700":"#EEDA01","color-tv-blue-50":"#E3EFFD","color-tv-blue-100":"#BBD9FB","color-tv-blue-200":"#90BFF9","color-tv-blue-300":"#5B9CF6","color-tv-blue-400":"#3179F5","color-tv-blue-500":"#2962FF","color-tv-blue-600":"#1E53E5","color-tv-blue-700":"#1848CC","color-tv-blue-800":"#143EB3","color-tv-blue-900":"#0C3299","color-tv-blue-a100":"#82b1ff","color-tv-blue-a200":"#448aff","color-tv-blue-a400":"#2979ff","color-tv-blue-a600":"#2962FF","color-tv-blue-a700":"#143A87","color-tv-blue-a800":"#142E61","color-tv-blue-a900":"#132042","color-deep-blue-50":"#EDE7F6","color-deep-blue-100":"#D1C4E9","color-deep-blue-200":"#B39DDB","color-deep-blue-300":"#9575cd","color-deep-blue-400":"#7e57c2","color-deep-blue-500":"#673ab7","color-deep-blue-700":"#512da8","color-deep-blue-800":"#4527A0","color-deep-blue-900":"#311B92","color-deep-blue-a100":"#b388ff","color-deep-blue-a200":"#7C4DFF","color-deep-blue-a400":"#651FFF","color-deep-blue-a700":"#6200EA","color-minty-green-50":"#DAF2EE","color-minty-green-100":"#ACE5DC","color-minty-green-200":"#70CCBD","color-minty-green-300":"#42BDA8","color-minty-green-400":"#22AB94","color-minty-green-500":"#089981","color-minty-green-600":"#06806B","color-minty-green-700":"#056656","color-minty-green-800":"#004D40","color-minty-green-900":"#00332A","color-minty-green-a400":"#2BD9BC","color-minty-green-a600":"#24B29B","color-minty-green-a700":"#1B7667","color-minty-green-a800":"#10443B","color-minty-green-a900":"#082621","color-grapes-purple-50":"#F3E5F5","color-grapes-purple-100":"#E1BEE7","color-grapes-purple-200":"#CE93D8","color-grapes-purple-300":"#ba68c8","color-grapes-purple-400":"#ab47bc","color-grapes-purple-500":"#9c27b0","color-grapes-purple-600":"#8e24aa","color-grapes-purple-700":"#7b1fa2","color-grapes-purple-800":"#6A1B9A","color-grapes-purple-900":"#4A148C","color-grapes-purple-a100":"#EA80FC","color-grapes-purple-a200":"#E040FB","color-grapes-purple-a400":"#D500F9","color-grapes-purple-a700":"#aa00ff","color-berry-pink-100":"#F8BBD0","color-berry-pink-200":"#f48fb1","color-berry-pink-300":"#f06292","color-berry-pink-400":"#ec407a","color-berry-pink-500":"#e91e63","color-berry-pink-600":"#D81B60","color-berry-pink-700":"#C2185B","color-berry-pink-800":"#AD1457","color-berry-pink-900":"#880E4F","color-berry-pink-a100":"#ff80ab","color-berry-pink-a200":"#ff4081","color-berry-pink-a400":"#f50057","color-sky-blue-100":"#B2EBF2","color-sky-blue-200":"#80DEEA","color-sky-blue-300":"#4dd0e1","color-sky-blue-400":"#26c6da","color-sky-blue-500":"#00bcd4","color-sky-blue-600":"#00acc1","color-sky-blue-700":"#0097A7","color-sky-blue-800":"#00838F","color-sky-blue-900":"#006064","color-sky-blue-a400":"#00e5ff","color-sky-blue-a700":"#00B8D4","color-deep-blue-600":"#5E35B1","color-forest-green-50":"#DAF2E6","color-forest-green-100":"#ACE5C9","color-forest-green-200":"#70CC9E","color-forest-green-300":"#42BD7F","color-forest-green-400":"#22AB67","color-forest-green-500":"#089950","color-forest-green-600":"#068043","color-forest-green-700":"#056636","color-forest-green-800":"#004D27","color-forest-green-900":"#1A3326","color-facebook":"#1877F2","color-deep-facebook":"#1564CA","color-twitter":"#1DA1F2","color-deep-twitter":"#188CD3","color-youtube":"#FF0000","color-linkedin":"#007BB5","color-seeking-alpha-brand":"#ff7200"};function Mt(s,n=1){return s+Math.round(255*Math.min(Math.max(n,0),1)).toString(16).toUpperCase().padStart(2,"0")}const ln={base:"vs",inherit:!0,rules:[{token:"comment",foreground:D["color-cold-gray-400"]},{token:"comment.annotation",fontStyle:"bold"},{token:"text",foreground:D["color-cold-gray-900"]},{token:"string",foreground:D["color-iguana-green-700"]},{token:"constant.numeric",foreground:D["color-banana-yellow-900"]},{token:"constant.language",foreground:D["color-ripe-red-a600"]},{token:"constant.other.color",foreground:D["color-ripe-red-a600"]},{token:"constant.other",foreground:D["color-ripe-red-a600"]},{token:"support.variable",foreground:D["color-ripe-red-a600"]},{token:"support.function",foreground:D["color-tv-blue-a600"]},{token:"support.type",foreground:D["color-minty-green-400"],fontStyle:"bold"},{token:"entity.name.type",foreground:D["color-minty-green-400"],fontStyle:"bold"},{token:"support.method",foreground:D["color-tv-blue-a600"]},{token:"keyword.equals",foreground:D["color-minty-green-400"]},{token:"keyword.operator",foreground:D["color-minty-green-400"]},{token:"keyword.other",foreground:D["color-minty-green-400"]},{token:"keyword",foreground:D["color-minty-green-400"]},{token:"variable.other",foreground:D["color-cold-gray-800"]},{token:"variable.other.property",foreground:D["color-cold-gray-800"]},{token:"paren",foreground:D["color-black"]},{token:"entity.name.function",foreground:D["color-tv-blue-900"]},{token:"entity.name.method",foreground:D["color-tv-blue-900"]},{token:"meta.function-call",foreground:D["color-grapes-purple-600"]},{token:"entity.name.module.name",foreground:D["color-grapes-purple-600"]},{token:"entity.name.module",foreground:D["color-tv-blue-a600"]},{token:"",background:D["color-white"]}],colors:{"editor.foreground":D["color-cold-gray-900"],"editor.background":"#00000000","editorLineNumber.foreground":D["color-cold-gray-400"],"editorLineNumber.activeForeground":D["color-cold-gray-700"],"editorHoverWidget.background":D["color-white"],"editorHoverWidget.statusBarBackground":D["color-cold-gray-150"],"editorHoverWidget.foreground":D["color-cold-gray-900"],"editorWidget.background":D["color-white"],"editorWidget.foreground":D["color-cold-gray-900"],"editorGutter.background":"#00000000","editor.foldBackground":Mt(D["color-cold-gray-200"],.5),"editor.lineHighlightBackground":D["color-tv-blue-50"],"editor.lineHighlightBorder":D["color-tv-blue-50"],"editor.rangeHighlightBackground":D["color-tv-blue-a800"],"editorBracketMatch.background":D["color-cold-gray-150"],"editor.selectionBackground":D["color-tv-blue-100"],"editor.selectionHighlightBackground":D["color-tv-blue-50"],"editor.findMatchBackground":D["color-tan-orange-100"],"editor.findMatchHighlightBackground":D["color-tan-orange-100"],"editor.findMatchBorder":D["color-tan-orange-500"],"list.foreground":D["color-cold-gray-900"],"list.hoverForeground":D["color-cold-gray-900"],"list.activeSelectionBackground":D["color-tv-blue-500"],"list.hoverBackground":D["color-tv-blue-50"],"list.focusHighlightForeground":D["color-tv-blue-100"],"list.inactiveSelectionBackground":D["color-tv-blue-500"],"keybindingLabel.background":D["color-white"],"keybindingLabel.foreground":D["color-cold-gray-900"],"keybindingLabel.border":D["color-cold-gray-150"],"input.foreground":D["color-cold-gray-900"],"textLink.foreground":D["color-tv-blue-500"],"textLink.activeForeground":D["color-tv-blue-600"],"peekViewEditor.matchHighlightBackground":D["color-tan-orange-100"],"peekViewResult.lineForeground":D["color-cold-gray-900"],"editorMarkerNavigationWarning.background":D["color-banana-yellow-800"],"inputValidation.warningBackground":D["color-banana-yellow-800"],"diffEditor.insertedTextBackground":Mt(D["color-forest-green-500"],.3),"diffEditor.insertedLineBackground":Mt(D["color-forest-green-500"],.15),"diffEditor.removedTextBackground":Mt(D["color-ripe-red-500"],.3),"diffEditor.removedLineBackground":Mt(D["color-ripe-red-500"],.15),"editorInlayHint.background":D["color-cold-gray-150"],"editorInlayHint.foreground":D["color-cold-gray-550"],"editorError.foreground":D["color-ripe-red-500"],"editorWarning.foreground":D["color-tan-orange-500"]}},cn={base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:D["color-cold-gray-500"]},{token:"comment.annotation",fontStyle:"bold"},{token:"text",foreground:D["color-white"]},{token:"string",foreground:D["color-iguana-green-700"]},{token:"constant.numeric",foreground:D["color-banana-yellow-900"]},{token:"constant.language",foreground:D["color-ripe-red-300"]},{token:"constant.other.color",foreground:D["color-ripe-red-300"]},{token:"constant.other",foreground:D["color-ripe-red-300"]},{token:"support.variable",foreground:D["color-ripe-red-300"]},{token:"support.function",foreground:D["color-tv-blue-300"]},{token:"support.method",foreground:D["color-tv-blue-300"]},{token:"support.type",foreground:D["color-minty-green-300"],fontStyle:"bold"},{token:"entity.name.type",foreground:D["color-minty-green-300"],fontStyle:"bold"},{token:"keyword.equals",foreground:D["color-minty-green-300"]},{token:"keyword.operator",foreground:D["color-minty-green-300"]},{token:"keyword.other",foreground:D["color-minty-green-300"]},{token:"keyword",foreground:D["color-minty-green-300"]},{token:"variable.other",foreground:D["color-cold-gray-200"]},{token:"variable.other.property",foreground:D["color-cold-gray-200"]},{token:"paren",foreground:D["color-white"]},{token:"entity.name.function",foreground:D["color-tv-blue-400"]},{token:"entity.name.method",foreground:D["color-tv-blue-400"]},{token:"meta.function-call",foreground:D["color-grapes-purple-300"]},{token:"entity.name.module.name",foreground:D["color-grapes-purple-300"]},{token:"entity.name.module",foreground:D["color-tv-blue-300"]},{token:"",background:D["color-cold-gray-900"]}],colors:{"editor.foreground":D["color-white"],"editor.background":D["color-cold-gray-900"],"editorLineNumber.foreground":D["color-cold-gray-500"],"editorLineNumber.activeForeground":D["color-cold-gray-300"],"editorWidget.background":D["color-cold-gray-850"],"editorHoverWidget.background":D["color-cold-gray-850"],"editorHoverWidget.foreground":D["color-cold-gray-300"],"editorHoverWidget.statusBarBackground":D["color-cold-gray-900"],"editorWidget.foreground":D["color-cold-gray-300"],"editorGutter.background":D["color-cold-gray-900"],"editor.foldBackground":Mt(D["color-cold-gray-700"],.5),"editor.lineHighlightBackground":D["color-tv-blue-a900"],"editor.lineHighlightBorder":D["color-tv-blue-a900"],"editor.rangeHighlightBackground":D["color-tv-blue-a800"],"editorBracketMatch.background":D["color-cold-gray-750"],"editor.selectionBackground":D["color-tv-blue-a800"],"editor.selectionHighlightBackground":D["color-cold-gray-800"],"list.foreground":D["color-cold-gray-350"],"list.hoverForeground":D["color-cold-gray-350"],"list.activeSelectionBackground":D["color-tv-blue-500"],"list.hoverBackground":D["color-tv-blue-900"],"list.focusHighlightForeground":D["color-tv-blue-300"],"list.inactiveSelectionBackground":D["color-tv-blue-500"],"keybindingLabel.background":D["color-cold-gray-800"],"keybindingLabel.foreground":D["color-cold-gray-300"],"keybindingLabel.border":D["color-cold-gray-700"],"input.foreground":D["color-cold-gray-350"],"textLink.foreground":D["color-tv-blue-500"],"textLink.activeForeground":D["color-tv-blue-600"],"peekViewEditor.matchHighlightBackground":D["color-tan-orange-a800"],"peekViewResult.lineForeground":D["color-cold-gray-350"],"diffEditor.insertedTextBackground":Mt(D["color-iguana-green-a700"],.3),"diffEditor.insertedLineBackground":Mt(D["color-iguana-green-a700"],.15),"diffEditor.removedTextBackground":Mt(D["color-ripe-red-a400"],.3),"diffEditor.removedLineBackground":Mt(D["color-ripe-red-a400"],.15),"editorInlayHint.background":D["color-cold-gray-800"],"editorInlayHint.foreground":D["color-cold-gray-400"],"editorError.foreground":D["color-ripe-red-500"],"editorWarning.foreground":D["color-tan-orange-700"]}},Od=/(\\(?:[\\'"]))|(\\$)|("|$)|($)/g,Pd=/(\\(?:[\\'"]))|(\\$)|('|$)|($)/g,oo={"color.aqua":"#00BCD4","color.black":"#363A45","color.blue":"#2196F3","color.fuchsia":"#E040FB","color.gray":"#787B86","color.green":"#4CAF50","color.lime":"#00E676","color.maroon":"#880E4F","color.navy":"#311B92","color.olive":"#808000","color.orange":"#FF9800","color.purple":"#9C27B0","color.red":"#FF5252","color.silver":"#B2B5BE","color.teal":"#00897B","color.white":"#FFFFFF","color.yellow":"#FFEB3B"};class Ed{constructor(n){Object.defineProperty(this,"_formatter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isMac",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getSignatureParams",{enumerable:!0,configurable:!0,writable:!0,value:(a=[],o)=>{const c=new Map,l=o.indexOf("(");for(let m=l+1,h=l;m<o.length;m++)o[m]!==","&&o[m]!==")"||(h++,c.set(o.slice(h,m),h),h=m+1);return a.map(({name:m,displayType:h,desc:b})=>{const _=[],x=c.get(m),T=x+m.length;return _.push(this._formatter.paragraph(this._formatter.bold(m),this._formatter.italic(h||""))),b&&_.push(Array.isArray(b)?b.join(this._formatter.lineBreak):b),{label:[x,T],documentation:{value:_.join(this._formatter.lineBreak)}}})}}),this._formatter=ye,this._isMac=/(Mac|iPhone|iPod|iPad)/i.test(n)}getSignatureHelpValues(n,a){const o=this._getFuncItems(n);if(!(o!=null&&o.length))return null;const c=this._getSequentialSignatures(n,o),l=this._getActiveIndex(o,a);return{signatures:c,...l}}_getActiveIndex(n,a=[]){let o=0,c=-1;a.some(m=>!!m)||(c=a.length-1);const l=a.pop();if(l)for(const[m,h]of n.entries()){const{args:b}=h;if(b&&b.length){const _=b.findIndex(x=>x.name===l);if(_!=-1){c=_,o=m;break}}}return{activeParameter:c,activeSignature:o}}_getFuncItems(n){return lt.functions.get(n)||qt.userFuncs.get(n)||qt.methodFuncs.get(n)}_getSequentialSignatures(n,a){return a.map(o=>{const c=this._getSignatureLabel(n,o);return{label:c,documentation:this._getFormattedSignatureDocumentation(o),parameters:this._getSignatureParams(o.args,c)}})}_getSignatureLabel(n,a,o=!1){const c=[n];return o&&c.push("<type>"),a.args&&(c.push("("),c.push(a.args.map(({name:l})=>l).join(", ")),c.push(")")),c.join("")}_getFormattedSignatureDocumentation(n){const{desc:a}=n,o=[];a&&o.push(Array.isArray(a)?a.join(this._formatter.lineBreak):a);const c=`${this._formatter.code(this._isMac?"⌘":"Ctrl")} +
132
132
  ${this._formatter.code("Shift")} +
133
- ${this._formatter.code("Space")}`;return o.push(this._formatter.lineBreak),o.push(this._formatter.italic(`${c} ${ve.toTriggerParameterHints}`)),{value:this._formatter.paragraph(...o)}}}const Rd=new Ed(window.navigator.userAgent);class Ld{constructor(){Object.defineProperty(this,"_colors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._colors=oo}getDocumentColors(n){const a=[];return n.forEach(o=>{const{range:c}=o;let{matches:l}=o;l=l||[];const m=l[0]||"";let h=null;this._isHexToken(m)?h=this._hexToColor(m):this._isRgbColor(m)?h=this._rgbToColor(m):this._colors[m]?h=this._hexToColor(this._colors[m]):this._isColorExpression(m)&&l[1]&&l[6]&&(h=this._extractNewExpression(l[1],Number(l[6]))),h&&a.push({color:h,range:c})}),a}get _defultColorsRegStr(){return Object.keys(oo).reduce((n,a)=>`${n}|${a}`,"")}get colorMatchesRegStr(){const n=`#[0-9a-fA-F]{6,8}|(\\b(color.rgb\\s*\\((\\s*\\d+\\s*,\\s*){2}(\\s*\\d+\\s*,{0,1}){1,2}\\s*\\)${this._defultColorsRegStr}))`;return`color.new\\s*\\(\\s*(${n})\\s*,\\s*(\\d+)\\s*\\)|${n}`}getDocumentColorPresentations(n,{color:a,range:o}){const c=n.getValueInRange(o);if(this._isHexToken(c)||this._colors[c])return[{label:this._colorRgbRepresentation(a)},{label:this._colorHexRepresentation(a)}];if(this._isColorExpression(c)||this._isRgbColor(c)){const l=this._isColorExpression(c)?this._colorNewRepresentation(a):this._colorRgbRepresentation(a);if(!l)return[];const m=this._colorHexRepresentation(a);return[{label:l,textEdit:{text:l,range:o}},{label:m,textEdit:{text:m,range:o}}]}return null}_hexFromNumber(n){const a=this._denormalize(n).toString(16);return a.length===1?`0${a}`:a}_normalize(n){return n/255}_denormalize(n){return Math.round(255*n)}_normalizeAlpha(n){return(100-n)/100}_denormalizeAlpha(n){return 100-Math.round(100*n)}_extractNewExpression(n,a){let o=null;return this._isHexToken(n)?o=this._hexToColor(n):this._isRgbColor(n)?o=this._rgbToColor(n):this._colors[n]&&(o=this._hexToColor(this._colors[n])),o&&!Number.isNaN(a)?{...o,alpha:this._normalizeAlpha(a)}:null}_colorHexRepresentation(n){const a=this._hexFromNumber(n.red),o=this._hexFromNumber(n.green),c=this._hexFromNumber(n.blue),l=this._hexFromNumber(n.alpha);return`#${a}${o}${c}${n.alpha===1?"":l}`}_colorRgbRepresentation(n){const a=this._denormalize(n.red),o=this._denormalize(n.green),c=this._denormalize(n.blue),l=this._denormalizeAlpha(n.alpha),m=[a,o,c];return l>0&&m.push(l),`color.rgb(${m.join(", ")})`}_colorNewRepresentation(n){const a={...n,alpha:1};return`color.new(${this._colorHexRepresentation(a)}, ${this._denormalizeAlpha(n.alpha)})`}_hexToColor(n){const a=(n=this._isHexToken(n)?n.slice(1):n).length===3||n.length===4,o=a?`${n.slice(0,1)}${n.slice(0,1)}`:n.slice(0,2),c=a?`${n.slice(1,2)}${n.slice(1,2)}`:n.slice(2,4),l=a?`${n.slice(2,3)}${n.slice(2,3)}`:n.slice(4,6),m=(a?`${n.slice(3,4)}${n.slice(3,4)}`:n.slice(6,8))||"ff";return{red:this._normalize(parseInt(o,16)),green:this._normalize(parseInt(c,16)),blue:this._normalize(parseInt(l,16)),alpha:this._normalize(parseInt(m,16))}}_rgbToColor(n){const a=n.replace(/[^\d,]/g,"").split(","),o=this._normalize(Number(a[0])),c=this._normalize(Number(a[1])),l=this._normalize(Number(a[2])),m=this._normalizeAlpha(Number(a[3]))||1;return isNaN(o)||isNaN(c)||isNaN(l)?null:{red:o,green:c,blue:l,alpha:m}}_isHexToken(n){return n.charAt(0)==="#"}_isRgbColor(n){return n.startsWith("color.rgb")}_isColorExpression(n){return n.startsWith("color.new")}}const un=new Ld;C.VType=void 0,function(s){s.BOOL="bool",s.INT="int",s.FLOAT="float",s.ARRAY="array",s.BOX="box",s.CHART_POINT="chart.point",s.COLOR="color",s.CONST="const",s.LABEL="label",s.LINE="line",s.LINEFILL="linefill",s.MAP="map",s.MATRIX="matrix",s.POLYLINE="polyline",s.SERIES="series",s.SIMPLE="simple",s.STRING="string",s.TABLE="table",s.UNDETERMINED="undetermined type",s.INPUT="input",s.NA="na",s.VOID="void"}(C.VType||(C.VType={})),C.VRuleType=void 0,function(s){s.FlowStmt="FlowStmt",s.DeclareAssign="DeclareAssign",s.VarBlockStmt="VarBlockStmt",s.VarSingle="VarSingle",s.VarMultiple="VarMultiple",s.ParenthesizedExpression="ParenthesizedExpression",s.AdditiveExpression="AdditiveExpression",s.RelationalExpression="RelationalExpression",s.EqualityExpression="EqualityExpression",s.TernaryExpression="TernaryExpression",s.UnaryExpression="UnaryExpression",s.NotExpression="NotExpression",s.MemberIndexExpression="MemberIndexExpression",s.MethodExpression="MethodExpression",s.LogicalAndExpression="LogicalAndExpression",s.LogicalOrExpression="LogicalOrExpression",s.MultiplicativeExpression="MultiplicativeExpression",s.Brackethesized="Brackethesized",s.IfStatement="IfStatement",s.ForToStatement="ForToStatement",s.ForInStatement="ForInStatement",s.SwitchStatement="SwitchStatement",s.CaseClause="CaseClause",s.DefaultCaluse="DefaultCaluse",s.WhileStatement="WhileStatement",s.ImportElement="ImportElement",s.Literal="Literal",s.ArrowFunction="ArrowFunction",s.ArrowMethod="ArrowMethod",s.TypeStatement="TypeStatement",s.Name="Name",s.AgainAssign="AgainAssign"}(C.VRuleType||(C.VRuleType={})),C.VAdjustment=void 0,function(s){s.dividends="dividends",s.none="none",s.splits="splits"}(C.VAdjustment||(C.VAdjustment={})),C.VAlert=void 0,function(s){s.freqAll="freq_all",s.freqOncePerBar="freq_once_per_bar",s.freqOncePerBarClose="freq_once_per_bar_close"}(C.VAlert||(C.VAlert={})),C.VBarmergeGaps=void 0,function(s){s.gapsOff="gaps_off",s.gapsOn="gaps_on",s.lookaheadOff="lookahead_off",s.lookaheadOn="lookahead_on"}(C.VBarmergeGaps||(C.VBarmergeGaps={})),C.VPlotDisplay=void 0,function(s){s.all="all",s.dataWindow="data_window",s.none="none",s.pane="pane",s.priceScale="price_scale",s.statusLine="status_line"}(C.VPlotDisplay||(C.VPlotDisplay={})),C.VExtend=void 0,function(s){s.both="both",s.left="left",s.none="none",s.right="right"}(C.VExtend||(C.VExtend={})),C.VFormatType=void 0,function(s){s.inherit="inherit",s.mintick="mintick",s.percent="percent",s.price="price",s.volume="volume"}(C.VFormatType||(C.VFormatType={})),C.VHlineStyle=void 0,function(s){s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(C.VHlineStyle||(C.VHlineStyle={})),C.VLabelStyle=void 0,function(s){s.styleArrowdown="style_arrowdown",s.styleArrowup="style_arrowup",s.styleCircle="style_circle",s.styleCross="style_cross",s.styleDiamond="style_diamond",s.styleFlag="style_flag",s.styleLabelCenter="style_label_center",s.styleLabelDown="style_label_down",s.styleLabelLeft="style_label_left",s.styleLabelLowerLeft="style_label_lower_left",s.styleLabelLowerRight="style_label_lower_right",s.styleLabelRight="style_label_right",s.styleLabelUp="style_label_up",s.styleLabelUpperLeft="style_label_upper_left",s.styleLabelUpperRight="style_label_upper_right",s.styleNone="style_none",s.styleSquare="style_square",s.styleTextOutline="style_text_outline",s.styleTriangledown="style_triangledown",s.styleTriangleup="style_triangleup",s.styleXcross="style_xcross"}(C.VLabelStyle||(C.VLabelStyle={})),C.VLineStyle=void 0,function(s){s.styleArrowBoth="style_arrow_both",s.styleArrowLeft="style_arrow_left",s.styleArrowRight="style_arrow_right",s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(C.VLineStyle||(C.VLineStyle={})),C.VLocation=void 0,function(s){s.abovebar="abovebar",s.absolute="absolute",s.belowbar="belowbar",s.bottom="bottom",s.top="top"}(C.VLocation||(C.VLocation={})),C.VSortOrder=void 0,function(s){s.ascending="ascending",s.descending="descending"}(C.VSortOrder||(C.VSortOrder={})),C.VPlotStyle=void 0,function(s){s.styleArea="Area",s.styleAreabr="Area With Breaks",s.styleCircles="Circles",s.styleColumns="Columns",s.styleCross="Cross",s.styleHistogram="Histogram",s.styleLine="Line",s.styleLinebr="Line With Breaks",s.styleStepline="Step Line",s.styleSteplineDiamond="Step Line With Diamonds",s.styleSteplinebr="Step line with Breaks"}(C.VPlotStyle||(C.VPlotStyle={})),C.VPosition=void 0,function(s){s.bottomCenter="bottom_center",s.bottomLeft="bottom_left",s.bottomRight="bottom_right",s.middleCenter="middle_center",s.middleLeft="middle_left",s.middleRight="middle_right",s.topCenter="top_center",s.topLeft="top_left",s.topRight="top_right"}(C.VPosition||(C.VPosition={})),C.VScale=void 0,function(s){s.left="left",s.none="none",s.right="right"}(C.VScale||(C.VScale={})),C.VSession=void 0,function(s){s.extended="extended",s.regular="regular"}(C.VSession||(C.VSession={})),C.VShape=void 0,function(s){s.arrowdown="arrowdown",s.arrowup="arrowup",s.circle="circle",s.cross="cross",s.diamond="diamond",s.flag="flag",s.labeldown="labeldown",s.labelup="labelup",s.square="square",s.triangledown="triangledown",s.triangleup="triangleup",s.xcross="xcross"}(C.VShape||(C.VShape={})),C.VSize=void 0,function(s){s.auto="auto",s.huge="huge",s.large="large",s.normal="normal",s.small="small",s.tiny="tiny"}(C.VSize||(C.VSize={})),C.VStrategy=void 0,function(s){s.cash="cash",s.fixed="fixed",s.percentOfEquity="percent_of_equity"}(C.VStrategy||(C.VStrategy={})),C.VCommission=void 0,function(s){s.cashPerContract="cash_per_contract",s.cashPerOrder="cash_per_order",s.percent="percent"}(C.VCommission||(C.VCommission={})),C.VDirection=void 0,function(s){s.all="all",s.long="long",s.short="short"}(C.VDirection||(C.VDirection={})),C.VOca=void 0,function(s){s.cancel="cancel",s.none="none",s.reduce="reduce"}(C.VOca||(C.VOca={})),C.VText=void 0,function(s){s.alignBottom="align_bottom",s.alignCenter="align_center",s.alignLeft="align_left",s.alignRight="align_right",s.alignTop="align_top",s.wrapAuto="wrap_auto",s.wrapNone="wrap_none"}(C.VText||(C.VText={})),C.VXloc=void 0,function(s){s.bar_index="bar_index",s.bar_time="bar_time"}(C.VXloc||(C.VXloc={})),C.VYloc=void 0,function(s){s.abovebar="abovebar",s.belowbar="belowbar",s.price="price"}(C.VYloc||(C.VYloc={})),C.VEarnings=void 0,function(s){s.actual="actual",s.estimate="estimate",s.standardized="standardized"}(C.VEarnings||(C.VEarnings={})),C.VPivotType=void 0,function(s){s.traditional="Traditional",s.fibonacci="Fibonacci",s.woodie="Woodie",s.classic="Classic",s.dm="DM",s.camarilla="Camarilla"}(C.VPivotType||(C.VPivotType={})),C.VInputType=void 0,function(s){s.INT="int",s.BOOL="bool",s.TIME="time",s.COLOR="color",s.FLOAT="float",s.PRICE="price",s.SOURCE="source",s.STRING="string",s.SYMBOL="symbol",s.SESSION="session",s.TEXT_AREA="text_area",s.TIMEFRAME="timeframe"}(C.VInputType||(C.VInputType={}));var lo;(function(s){s.description="description",s.field="field",s.function="function",s.param="param",s.returns="returns",s.type="type",s.variable="variable"})(lo||(lo={})),C.VScriptType=void 0,function(s){s.library="library",s.indicator="indicator",s.strategy="strategy"}(C.VScriptType||(C.VScriptType={})),C.VType.SERIES,C.VType.SIMPLE,C.VType.INPUT,C.VType.CONST,C.VType.INT,C.VType.FLOAT,C.VType.BOOL,C.VType.COLOR,C.VType.STRING;const Md={domReadOnly:!0,scrollBeyondLastLine:!1,readOnly:!0,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1},contextmenu:!1},co={functions:[{name:"calcBB",desc:["Computes Bollinger Band values from an array of data."],args:[{name:"srcArray",desc:"(array<float>) The array where the queue is maintained.",required:!0,allowedTypeIDs:["float[]","int[]"],displayType:"float[]"},{name:"mult",required:!0,allowedTypeIDs:["series int","series float","simple int","simple float","input int","input float","const int","const float"],displayType:"series float"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],syntax:["calcBB(float[] srcArray, series float mult, series bool calculate) → [series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:10,column:14},isUser:!0,returnedTypes:["[series float, series float, series float]"],returns:["A tuple containing the basis, upper band, and lower band respectively."]},{name:"calcBB",args:[{name:"srcArray",required:!0,allowedTypeIDs:["float[]","int[]"],displayType:"float[]"},{name:"mult",required:!0,allowedTypeIDs:["series int","simple int","input int","const int"],displayType:"series int"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],syntax:["calcBB(float[] srcArray, series int mult, series bool calculate) → [series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:19,column:14},isUser:!0,returnedTypes:["[series float, series float, series float]"],index:1},{name:"Scanner.new",args:[{name:"enabled",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"},{name:"ticker",required:!1,allowedTypeIDs:["series string","simple string","input string","const string"],displayType:"series string"},{name:"timeframe",required:!1,allowedTypeIDs:["series string","simple string","input string","const string"],displayType:"series string"}],returnedTypes:["Scanner"],pos:{lineNumber:30,column:12},syntax:["Scanner.new(series bool enabled, series string ticker, series string timeframe) → Scanner"]},{name:"Scanner.copy",args:[{name:"object",required:!0,allowedTypeIDs:["Scanner"],displayType:"Scanner"}],returnedTypes:["Scanner"],pos:{lineNumber:30,column:12},info:"The identifier of the object to be copied.",syntax:["Scanner.copy(Scanner object) → Scanner"]}],methods:[{name:"calcBB",args:[{name:"mult",required:!0,allowedTypeIDs:["series int","series float","simple int","simple float","input int","input float","const int","const float"],displayType:"series float"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],desc:["Computes Bollinger Band values from an array of data."],originalName:"array.calcBB",syntax:["calcBB(series float mult, series bool calculate) → [series float, series float, series float]"],returnedTypes:["[series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:10,column:14},thisType:["float[]"],returns:["A tuple containing the basis, upper band, and lower band respectively."]},{name:"calcBB",args:[{name:"mult",required:!0,allowedTypeIDs:["series int","simple int","input int","const int"],displayType:"series int"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],originalName:"array.calcBB",syntax:["calcBB(series int mult, series bool calculate) → [series float, series float, series float]"],returnedTypes:["[series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:19,column:14},thisType:["float[]"],index:1},{name:"Scanner.copy",args:[],returnedTypes:["Scanner"],thisType:["Scanner"],pos:{lineNumber:30,column:12},syntax:["Scanner.copy() → Scanner"]}],types:[{fields:[{name:"enabled",type:"series bool"},{name:"ticker",type:"series string"},{name:"timeframe",type:"series string"}],name:"Scanner",pos:{lineNumber:30,column:12}}],description:"Provides a tool to quickly output a label on the chart.",codeStr:'const $name={calcBB:({srcArray:a,mult:r,calculate:_=!0},e)=>{let v=$_var.getVarValue("mean",e+"_14_12","var")||$_var.setVarValue("mean",e+"_14_12",$_var.na,"var"),s=$_var.getVarValue("dev",e+"_14_13","var")||$_var.setVarValue("dev",e+"_14_13",$_var.na,"var");return _&&($_var.againAssignParse(v,a.avg(e+"_16_16")),v=a.avg(e+"_16_16"),$_var.setVarValue("mean",e+"_14_12",v,"var"),$_var.againAssignParse(s,a.stdev(e+"_17_16")*r),s=a.stdev(e+"_17_16")*r,$_var.setVarValue("dev",e+"_14_13",s,"var")),[v,$_var.add(v,s),$_var.sub(v,s)]},calcBB$1:({srcArray:a,mult:r,calculate:_=!0},e)=>{let v=$_var.getVarValue("mean",e+"_14_21","var")||$_var.setVarValue("mean",e+"_14_21",$_var.na,"var"),s=$_var.getVarValue("dev",e+"_14_22","var")||$_var.setVarValue("dev",e+"_14_22",$_var.na,"var");return _&&($_var.againAssignParse(v,a.avg(e+"_25_16")),v=a.avg(e+"_25_16"),$_var.setVarValue("mean",e+"_14_21",v,"var"),$_var.againAssignParse(s,a.stdev(e+"_26_16")*r),s=a.stdev(e+"_26_16")*r,$_var.setVarValue("dev",e+"_14_22",s,"var")),[v,$_var.add(v,s),$_var.sub(v,s)]},Scanner:$_var.getTypeInstance({enabled:void 0,ticker:void 0,timeframe:void 0},[])};'};class Fd{constructor(){Object.defineProperty(this,"_inlayHints",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_importCompleteLibrary",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_funcs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._inlayHints=new Map,this._importCompleteLibrary=new Map,this._funcs=new Map}get inlayHints(){return[...this._inlayHints.values()]}setEditor(n){this._editor=n}async setInlayHints(n){console.log("setInlayHints",n);const{endLine:a,endColumn:o,name:c,libraryId:l,libraryName:m}=n;if(this._importCompleteLibrary.has(l)){const h=this._funcs.get(l);return((h==null?void 0:h.name)!==c||!c&&!this._inlayHints.has(l))&&(this._updateFuncNames(c||m,l),this._inlayHintsHandle(n)),this._importCompleteLibrary.get(l)}return this._importCompleteLibrary.set(l,co),this._inlayHints.set(l,{label:"载入中...",position:{column:o,lineNumber:a},paddingLeft:!0}),this.triggerInlayHints(),this._updateFuncNames(c||m,l),setTimeout(()=>{this._inlayHintsHandle(n)},2e3),co}deleteInlayHints(n){this._inlayHints.delete(n)}clearInlayHints(){this._inlayHints.clear(),this.triggerInlayHints()}triggerInlayHints(){this._editor&&this._editor.updateOptions({inlayHints:{fontFamily:String(Date.now())}})}_updateFuncNames(n,a){const o=this._importCompleteLibrary.get(a);if(!o)return;const c=o.functions.map(l=>`${n}.${l.name}`);this._funcs.set(a,{name:n,funcs:c}),this._updateMonarchTokens()}_setNoNameInlayHints(n){const{endLine:a,endColumn:o,libraryId:c,libraryName:l}=n;this._inlayHints.set(c,{label:`as ${l}`,position:{column:o,lineNumber:a},paddingLeft:!0})}_inlayHintsHandle(n){const{name:a,libraryId:o}=n;a?this._inlayHints.delete(o):this._setNoNameInlayHints(n),this.triggerInlayHints()}_updateMonarchTokens(){const n=[...this._funcs.values()].map(c=>c.funcs.join("|")),a=new RegExp("\\b("+n.join("|")+")(?=\\s*\\()"),o=[...Or.tokenizer.root];o.splice(15,0,[a,"meta.function-call"]),Ae.languages.setMonarchTokensProvider(ze,{...Or,tokenizer:{...Or.tokenizer,root:o}})}}const Xa=new Fd;function jd(s,n,a){var L;const o={startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column},c=s.getValueInRange(o);if(/^\/\/\s*@/.test(c))return{suggestions:qt.annotationSuggestions};if(a.triggerCharacter==="@")return{suggestions:[]};const l=c.match(/([\w.]+)$/)||[];if(!l.length)return{suggestions:[]};const m=(L=l[0])==null?void 0:L.match(/.*[^\w.]+([\w.]+)(?=\.)|([\w.]+)(?=\.)/),h=m?m[1]?m[1]:m[2]?m[2]:void 0:void 0,b=s.getWordUntilPosition(n),_=Nr.parseCurrentInputFunc(c),x={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:b.startColumn,endColumn:b.endColumn},T=s.getValueInRange({...x,startColumn:b.endColumn,endColumn:b.endColumn+1});qt.nextIsBracket=T==="(";let R=uo(qt.getSuggestions(h)||[],x);if(l[0]==="."&&(R=[]),_&&!h&&!/=\s*\w+$/.test(c)){const j=uo(qt.getArgSuggestions(_.funcName)||[],x);R=R.concat(j)}return{suggestions:R||[],dispose:()=>{}}}function Bd(s){if(s.kind!==1)return s;const{originInsertText:n}=s;return qt.nextIsBracket?s.insertText=n:s.insertText=n+qt.bracketsPostfix,s}function Ud(s,n){var o;const a=Nr.parseLineContentFuncVar(n.column,n.lineNumber,s,n);if(a!=null&&a.libraryId)return{contents:[{value:Dd(a)}]};if((o=a==null?void 0:a.docValue)!=null&&o.length){const c=Ad(a.docValue,a.index,a.isBuildIn);if(c)return{contents:[{value:c}]}}return{contents:[]}}function Wd(s,n){var T,R;const a={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:1,endColumn:n.column},o=s.getValueInRange(a),c=s.findMatches(String(Od),a,!0,!1,null,!0),l=s.findMatches(String(Pd),a,!0,!1,null,!0),m=(T=c.pop())==null?void 0:T.matches,h=(R=l.pop())==null?void 0:R.matches;let b=!1;c.length%2===0?m&&m[0]==='"'&&(b=!0):m&&!m[0]&&(b=!0);let _=!1;l.length%2===0?h&&h[0]==="'"&&(_=!0):h&&!h[0]&&(_=!0);const x=Nr.parseCurrentInputFuncAndArg(o,_,b);if(x){const{funcName:L,args:j}=x,E=Rd.getSignatureHelpValues(L,j);if(E)return{value:E,dispose:()=>{}}}return null}function Hd(s){let n=s.findMatches(un.colorMatchesRegStr,!0,!0,!1,null,!0);return n=n.filter(o=>{const c=s.getValueInRange({...o.range,startColumn:0});return c.indexOf("//")===-1||c.indexOf("//")>o.range.endColumn}),un.getDocumentColors(n)}function $d(s,n){return un.getDocumentColorPresentations(s,n)||[]}function Vd(s,n){const a=s.getModel(),o=Nr.parseLineContentFuncVar(n.startColumn+1,n.startLineNumber,a);if(!o||o.isBuildIn||!o.docValue||!o.docValue[0].pos)return o!=null&&o.isBuildIn?o:void 0;const{lineNumber:c,column:l}=o.docValue[0].pos,m={startLineNumber:c,endLineNumber:c,startColumn:l,endColumn:l};s.revealRangeInCenterIfOutsideViewport(m),s.setSelection(m)}function Xd(s,n){return Nr.parseLineContentFuncVar(n.column,n.lineNumber,s,n)?{uri:s.uri,range:{startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:n.column-1,endColumn:n.column-1}}:null}function uo(s,n){return s.map(a=>(a.range=n,a))}function Gd(){const s=Xa.inlayHints;return console.log(s),{hints:s,dispose:()=>{}}}var da={},pa=lu;if(process.env.NODE_ENV==="production")da.createRoot=pa.createRoot,da.hydrateRoot=pa.hydrateRoot;else{var Ga=pa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;da.createRoot=function(s,n){Ga.usingClientEntryPoint=!0;try{return pa.createRoot(s,n)}finally{Ga.usingClientEntryPoint=!1}},da.hydrateRoot=function(s,n,a){Ga.usingClientEntryPoint=!0;try{return pa.hydrateRoot(s,n,a)}finally{Ga.usingClientEntryPoint=!1}}}var Xe;(function(s){s.added="added",s.removed="removed",s.modified="modified"})(Xe||(Xe={}));const Yd=(s,n)=>{const{close:a,retracement:o}=s,[c,l]=M.useState("modified");return M.useImperativeHandle(n,()=>({updateType(m){l(m)}})),P.jsxs("div",{className:`content-popup content-${c}-popup`,children:[P.jsx("div",{className:`triangle-popup triangle-${c}-popup`}),P.jsxs("div",{className:`header-popup header-${c}-popup`,children:[P.jsx("div",{className:"title-popup",children:"Local working changes"}),P.jsx("div",{className:"actions-popup",children:P.jsx("div",{onClick:a,"data-role":"button",className:"button-popup","data-name":"button-close-diff",children:P.jsx("span",{className:"icon-popup",role:"img",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",width:"12",height:"12",children:P.jsx("path",{stroke:"currentColor",strokeWidth:"1.2",d:"m1.5 1.5 9 9m0-9-9 9"})})})})})]}),P.jsx("div",{id:"diffEditorContainer",style:{height:"100%"}})]})},Kd=M.forwardRef(Yd);class Qd{constructor(n,a,o=!0){Object.defineProperty(this,"_domNode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_top",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._id=n,this._domNode=document.createElement("div"),this._domNode.style.display="none",this._domNode.style.width=o?"calc(100% - 134px)":"calc(100% - 14px)",this._domNode.style.height="200px",a==null||a.onDidScrollChange(this.scrollChangeHandler.bind(this)),da.createRoot(this._domNode).render(P.jsx(Kd,{ref:c=>this._content=c,close:()=>this._close(),retracement:this._retracement})),this._top=0}_close(){this._domNode.style.display="none"}_retracement(){}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}show(n,a,o){var c;this._top=a,(c=this._content)==null||c.updateType(o),this._domNode.style.top=`${n}px`,this._domNode.style.display="block"}hide(){this._domNode.style.display="none"}scrollChangeHandler(n){const a=n.scrollTop;this._domNode.style.top=`${this._top-a}px`}}function sr(){}sr.prototype={diff:function(n,a){var o,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=c.callback;typeof c=="function"&&(l=c,c={}),this.options=c;var m=this;function h(A){return l?(setTimeout(function(){l(void 0,A)},0),!0):A}n=this.castInput(n),a=this.castInput(a),n=this.removeEmpty(this.tokenize(n)),a=this.removeEmpty(this.tokenize(a));var b=a.length,_=n.length,x=1,T=b+_;c.maxEditLength&&(T=Math.min(T,c.maxEditLength));var R=(o=c.timeout)!==null&&o!==void 0?o:1/0,L=Date.now()+R,j=[{oldPos:-1,lastComponent:void 0}],E=this.extractCommon(j[0],a,n,0);if(j[0].oldPos+1>=_&&E+1>=b)return h([{value:this.join(a),count:a.length}]);var G=-1/0,J=1/0;function X(){for(var A=Math.max(G,-x);A<=Math.min(J,x);A+=2){var k=void 0,B=j[A-1],H=j[A+1];B&&(j[A-1]=void 0);var le=!1;if(H){var ie=H.oldPos-A;le=H&&0<=ie&&ie<b}var ce=B&&B.oldPos+1<_;if(!le&&!ce){j[A]=void 0;continue}if(!ce||le&&B.oldPos+1<H.oldPos?k=m.addToPath(H,!0,void 0,0):k=m.addToPath(B,void 0,!0,1),E=m.extractCommon(k,a,n,A),k.oldPos+1>=_&&E+1>=b)return h(Zd(m,k.lastComponent,a,n,m.useLongestToken));j[A]=k,k.oldPos+1>=_&&(J=Math.min(J,A-1)),E+1>=b&&(G=Math.max(G,A+1))}x++}if(l)(function A(){setTimeout(function(){if(x>T||Date.now()>L)return l();X()||A()},0)})();else for(;x<=T&&Date.now()<=L;){var F=X();if(F)return F}},addToPath:function(n,a,o,c){var l=n.lastComponent;return l&&l.added===a&&l.removed===o?{oldPos:n.oldPos+c,lastComponent:{count:l.count+1,added:a,removed:o,previousComponent:l.previousComponent}}:{oldPos:n.oldPos+c,lastComponent:{count:1,added:a,removed:o,previousComponent:l}}},extractCommon:function(n,a,o,c){for(var l=a.length,m=o.length,h=n.oldPos,b=h-c,_=0;b+1<l&&h+1<m&&this.equals(a[b+1],o[h+1]);)b++,h++,_++;return _&&(n.lastComponent={count:_,previousComponent:n.lastComponent}),n.oldPos=h,b},equals:function(n,a){return this.options.comparator?this.options.comparator(n,a):n===a||this.options.ignoreCase&&n.toLowerCase()===a.toLowerCase()},removeEmpty:function(n){for(var a=[],o=0;o<n.length;o++)n[o]&&a.push(n[o]);return a},castInput:function(n){return n},tokenize:function(n){return n.split("")},join:function(n){return n.join("")}};function Zd(s,n,a,o,c){for(var l=[],m;n;)l.push(n),m=n.previousComponent,delete n.previousComponent,n=m;l.reverse();for(var h=0,b=l.length,_=0,x=0;h<b;h++){var T=l[h];if(T.removed){if(T.value=s.join(o.slice(x,x+T.count)),x+=T.count,h&&l[h-1].added){var L=l[h-1];l[h-1]=l[h],l[h]=L}}else{if(!T.added&&c){var R=a.slice(_,_+T.count);R=R.map(function(E,G){var J=o[x+G];return J.length>E.length?J:E}),T.value=s.join(R)}else T.value=s.join(a.slice(_,_+T.count));_+=T.count,T.added||(x+=T.count)}}var j=l[b-1];return b>1&&typeof j.value=="string"&&(j.added||j.removed)&&s.equals("",j.value)&&(l[b-2].value+=j.value,l.pop()),l}var po=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,mo=/\S/,fo=new sr;fo.equals=function(s,n){return this.options.ignoreCase&&(s=s.toLowerCase(),n=n.toLowerCase()),s===n||this.options.ignoreWhitespace&&!mo.test(s)&&!mo.test(n)},fo.tokenize=function(s){for(var n=s.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),a=0;a<n.length-1;a++)!n[a+1]&&n[a+2]&&po.test(n[a])&&po.test(n[a+2])&&(n[a]+=n[a+2],n.splice(a+1,2),a--);return n};var dn=new sr;dn.tokenize=function(s){this.options.stripTrailingCr&&(s=s.replace(/\r\n/g,`
133
+ ${this._formatter.code("Space")}`;return o.push(this._formatter.lineBreak),o.push(this._formatter.italic(`${c} ${ve.toTriggerParameterHints}`)),{value:this._formatter.paragraph(...o)}}}const Rd=new Ed(window.navigator.userAgent);class Ld{constructor(){Object.defineProperty(this,"_colors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._colors=oo}getDocumentColors(n){const a=[];return n.forEach(o=>{const{range:c}=o;let{matches:l}=o;l=l||[];const m=l[0]||"";let h=null;this._isHexToken(m)?h=this._hexToColor(m):this._isRgbColor(m)?h=this._rgbToColor(m):this._colors[m]?h=this._hexToColor(this._colors[m]):this._isColorExpression(m)&&l[1]&&l[6]&&(h=this._extractNewExpression(l[1],Number(l[6]))),h&&a.push({color:h,range:c})}),a}get _defultColorsRegStr(){return Object.keys(oo).reduce((n,a)=>`${n}|${a}`,"")}get colorMatchesRegStr(){const n=`#[0-9a-fA-F]{6,8}|(\\b(color.rgb\\s*\\((\\s*\\d+\\s*,\\s*){2}(\\s*\\d+\\s*,{0,1}){1,2}\\s*\\)${this._defultColorsRegStr}))`;return`color.new\\s*\\(\\s*(${n})\\s*,\\s*(\\d+)\\s*\\)|${n}`}getDocumentColorPresentations(n,{color:a,range:o}){const c=n.getValueInRange(o);if(this._isHexToken(c)||this._colors[c])return[{label:this._colorRgbRepresentation(a)},{label:this._colorHexRepresentation(a)}];if(this._isColorExpression(c)||this._isRgbColor(c)){const l=this._isColorExpression(c)?this._colorNewRepresentation(a):this._colorRgbRepresentation(a);if(!l)return[];const m=this._colorHexRepresentation(a);return[{label:l,textEdit:{text:l,range:o}},{label:m,textEdit:{text:m,range:o}}]}return null}_hexFromNumber(n){const a=this._denormalize(n).toString(16);return a.length===1?`0${a}`:a}_normalize(n){return n/255}_denormalize(n){return Math.round(255*n)}_normalizeAlpha(n){return(100-n)/100}_denormalizeAlpha(n){return 100-Math.round(100*n)}_extractNewExpression(n,a){let o=null;return this._isHexToken(n)?o=this._hexToColor(n):this._isRgbColor(n)?o=this._rgbToColor(n):this._colors[n]&&(o=this._hexToColor(this._colors[n])),o&&!Number.isNaN(a)?{...o,alpha:this._normalizeAlpha(a)}:null}_colorHexRepresentation(n){const a=this._hexFromNumber(n.red),o=this._hexFromNumber(n.green),c=this._hexFromNumber(n.blue),l=this._hexFromNumber(n.alpha);return`#${a}${o}${c}${n.alpha===1?"":l}`}_colorRgbRepresentation(n){const a=this._denormalize(n.red),o=this._denormalize(n.green),c=this._denormalize(n.blue),l=this._denormalizeAlpha(n.alpha),m=[a,o,c];return l>0&&m.push(l),`color.rgb(${m.join(", ")})`}_colorNewRepresentation(n){const a={...n,alpha:1};return`color.new(${this._colorHexRepresentation(a)}, ${this._denormalizeAlpha(n.alpha)})`}_hexToColor(n){const a=(n=this._isHexToken(n)?n.slice(1):n).length===3||n.length===4,o=a?`${n.slice(0,1)}${n.slice(0,1)}`:n.slice(0,2),c=a?`${n.slice(1,2)}${n.slice(1,2)}`:n.slice(2,4),l=a?`${n.slice(2,3)}${n.slice(2,3)}`:n.slice(4,6),m=(a?`${n.slice(3,4)}${n.slice(3,4)}`:n.slice(6,8))||"ff";return{red:this._normalize(parseInt(o,16)),green:this._normalize(parseInt(c,16)),blue:this._normalize(parseInt(l,16)),alpha:this._normalize(parseInt(m,16))}}_rgbToColor(n){const a=n.replace(/[^\d,]/g,"").split(","),o=this._normalize(Number(a[0])),c=this._normalize(Number(a[1])),l=this._normalize(Number(a[2])),m=this._normalizeAlpha(Number(a[3]))||1;return isNaN(o)||isNaN(c)||isNaN(l)?null:{red:o,green:c,blue:l,alpha:m}}_isHexToken(n){return n.charAt(0)==="#"}_isRgbColor(n){return n.startsWith("color.rgb")}_isColorExpression(n){return n.startsWith("color.new")}}const un=new Ld;C.VType=void 0,function(s){s.BOOL="bool",s.INT="int",s.FLOAT="float",s.ARRAY="array",s.BOX="box",s.CHART_POINT="chart.point",s.COLOR="color",s.CONST="const",s.LABEL="label",s.LINE="line",s.LINEFILL="linefill",s.MAP="map",s.MATRIX="matrix",s.POLYLINE="polyline",s.SERIES="series",s.SIMPLE="simple",s.STRING="string",s.TABLE="table",s.UNDETERMINED="undetermined type",s.INPUT="input",s.NA="na",s.VOID="void"}(C.VType||(C.VType={})),C.VRuleType=void 0,function(s){s.FlowStmt="FlowStmt",s.DeclareAssign="DeclareAssign",s.VarBlockStmt="VarBlockStmt",s.VarSingle="VarSingle",s.VarMultiple="VarMultiple",s.ParenthesizedExpression="ParenthesizedExpression",s.AdditiveExpression="AdditiveExpression",s.RelationalExpression="RelationalExpression",s.EqualityExpression="EqualityExpression",s.TernaryExpression="TernaryExpression",s.UnaryExpression="UnaryExpression",s.NotExpression="NotExpression",s.MemberIndexExpression="MemberIndexExpression",s.MethodExpression="MethodExpression",s.LogicalAndExpression="LogicalAndExpression",s.LogicalOrExpression="LogicalOrExpression",s.MultiplicativeExpression="MultiplicativeExpression",s.Brackethesized="Brackethesized",s.IfStatement="IfStatement",s.ForToStatement="ForToStatement",s.ForInStatement="ForInStatement",s.SwitchStatement="SwitchStatement",s.CaseClause="CaseClause",s.DefaultCaluse="DefaultCaluse",s.WhileStatement="WhileStatement",s.ImportElement="ImportElement",s.Literal="Literal",s.ArrowFunction="ArrowFunction",s.ArrowMethod="ArrowMethod",s.TypeStatement="TypeStatement",s.Name="Name",s.AgainAssign="AgainAssign"}(C.VRuleType||(C.VRuleType={})),C.VAdjustment=void 0,function(s){s.dividends="dividends",s.none="none",s.splits="splits"}(C.VAdjustment||(C.VAdjustment={})),C.VAlert=void 0,function(s){s.freqAll="freq_all",s.freqOncePerBar="freq_once_per_bar",s.freqOncePerBarClose="freq_once_per_bar_close"}(C.VAlert||(C.VAlert={})),C.VBarmergeGaps=void 0,function(s){s.gapsOff="gaps_off",s.gapsOn="gaps_on",s.lookaheadOff="lookahead_off",s.lookaheadOn="lookahead_on"}(C.VBarmergeGaps||(C.VBarmergeGaps={})),C.VPlotDisplay=void 0,function(s){s.all="all",s.dataWindow="data_window",s.none="none",s.pane="pane",s.priceScale="price_scale",s.statusLine="status_line"}(C.VPlotDisplay||(C.VPlotDisplay={})),C.VExtend=void 0,function(s){s.both="both",s.left="left",s.none="none",s.right="right"}(C.VExtend||(C.VExtend={})),C.VFormatType=void 0,function(s){s.inherit="inherit",s.mintick="mintick",s.percent="percent",s.price="price",s.volume="volume"}(C.VFormatType||(C.VFormatType={})),C.VHlineStyle=void 0,function(s){s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(C.VHlineStyle||(C.VHlineStyle={})),C.VLabelStyle=void 0,function(s){s.styleArrowdown="style_arrowdown",s.styleArrowup="style_arrowup",s.styleCircle="style_circle",s.styleCross="style_cross",s.styleDiamond="style_diamond",s.styleFlag="style_flag",s.styleLabelCenter="style_label_center",s.styleLabelDown="style_label_down",s.styleLabelLeft="style_label_left",s.styleLabelLowerLeft="style_label_lower_left",s.styleLabelLowerRight="style_label_lower_right",s.styleLabelRight="style_label_right",s.styleLabelUp="style_label_up",s.styleLabelUpperLeft="style_label_upper_left",s.styleLabelUpperRight="style_label_upper_right",s.styleNone="style_none",s.styleSquare="style_square",s.styleTextOutline="style_text_outline",s.styleTriangledown="style_triangledown",s.styleTriangleup="style_triangleup",s.styleXcross="style_xcross"}(C.VLabelStyle||(C.VLabelStyle={})),C.VLineStyle=void 0,function(s){s.styleArrowBoth="style_arrow_both",s.styleArrowLeft="style_arrow_left",s.styleArrowRight="style_arrow_right",s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(C.VLineStyle||(C.VLineStyle={})),C.VLocation=void 0,function(s){s.abovebar="abovebar",s.absolute="absolute",s.belowbar="belowbar",s.bottom="bottom",s.top="top"}(C.VLocation||(C.VLocation={})),C.VSortOrder=void 0,function(s){s.ascending="ascending",s.descending="descending"}(C.VSortOrder||(C.VSortOrder={})),C.VPlotStyle=void 0,function(s){s.styleArea="Area",s.styleAreabr="Area With Breaks",s.styleCircles="Circles",s.styleColumns="Columns",s.styleCross="Cross",s.styleHistogram="Histogram",s.styleLine="Line",s.styleLinebr="Line With Breaks",s.styleStepline="Step Line",s.styleSteplineDiamond="Step Line With Diamonds",s.styleSteplinebr="Step line with Breaks"}(C.VPlotStyle||(C.VPlotStyle={})),C.VPosition=void 0,function(s){s.bottomCenter="bottom_center",s.bottomLeft="bottom_left",s.bottomRight="bottom_right",s.middleCenter="middle_center",s.middleLeft="middle_left",s.middleRight="middle_right",s.topCenter="top_center",s.topLeft="top_left",s.topRight="top_right"}(C.VPosition||(C.VPosition={})),C.VScale=void 0,function(s){s.left="left",s.none="none",s.right="right"}(C.VScale||(C.VScale={})),C.VSession=void 0,function(s){s.extended="extended",s.regular="regular"}(C.VSession||(C.VSession={})),C.VShape=void 0,function(s){s.arrowdown="arrowdown",s.arrowup="arrowup",s.circle="circle",s.cross="cross",s.diamond="diamond",s.flag="flag",s.labeldown="labeldown",s.labelup="labelup",s.square="square",s.triangledown="triangledown",s.triangleup="triangleup",s.xcross="xcross"}(C.VShape||(C.VShape={})),C.VSize=void 0,function(s){s.auto="auto",s.huge="huge",s.large="large",s.normal="normal",s.small="small",s.tiny="tiny"}(C.VSize||(C.VSize={})),C.VStrategy=void 0,function(s){s.cash="cash",s.fixed="fixed",s.percentOfEquity="percent_of_equity"}(C.VStrategy||(C.VStrategy={})),C.VCommission=void 0,function(s){s.cashPerContract="cash_per_contract",s.cashPerOrder="cash_per_order",s.percent="percent"}(C.VCommission||(C.VCommission={})),C.VDirection=void 0,function(s){s.all="all",s.long="long",s.short="short"}(C.VDirection||(C.VDirection={})),C.VOca=void 0,function(s){s.cancel="cancel",s.none="none",s.reduce="reduce"}(C.VOca||(C.VOca={})),C.VText=void 0,function(s){s.alignBottom="align_bottom",s.alignCenter="align_center",s.alignLeft="align_left",s.alignRight="align_right",s.alignTop="align_top",s.wrapAuto="wrap_auto",s.wrapNone="wrap_none"}(C.VText||(C.VText={})),C.VXloc=void 0,function(s){s.bar_index="bar_index",s.bar_time="bar_time"}(C.VXloc||(C.VXloc={})),C.VYloc=void 0,function(s){s.abovebar="abovebar",s.belowbar="belowbar",s.price="price"}(C.VYloc||(C.VYloc={})),C.VEarnings=void 0,function(s){s.actual="actual",s.estimate="estimate",s.standardized="standardized"}(C.VEarnings||(C.VEarnings={})),C.VPivotType=void 0,function(s){s.traditional="Traditional",s.fibonacci="Fibonacci",s.woodie="Woodie",s.classic="Classic",s.dm="DM",s.camarilla="Camarilla"}(C.VPivotType||(C.VPivotType={})),C.VInputType=void 0,function(s){s.INT="int",s.BOOL="bool",s.TIME="time",s.COLOR="color",s.FLOAT="float",s.PRICE="price",s.SOURCE="source",s.STRING="string",s.SYMBOL="symbol",s.SESSION="session",s.TEXT_AREA="text_area",s.TIMEFRAME="timeframe"}(C.VInputType||(C.VInputType={}));var lo;(function(s){s.description="description",s.field="field",s.function="function",s.param="param",s.returns="returns",s.type="type",s.variable="variable"})(lo||(lo={})),C.VScriptType=void 0,function(s){s.library="library",s.indicator="indicator",s.strategy="strategy"}(C.VScriptType||(C.VScriptType={})),C.VType.SERIES,C.VType.SIMPLE,C.VType.INPUT,C.VType.CONST,C.VType.INT,C.VType.FLOAT,C.VType.BOOL,C.VType.COLOR,C.VType.STRING;const Md={domReadOnly:!0,scrollBeyondLastLine:!1,readOnly:!0,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1},contextmenu:!1},co={functions:[{name:"calcBB",desc:["Computes Bollinger Band values from an array of data."],args:[{name:"srcArray",desc:"(array<float>) The array where the queue is maintained.",required:!0,allowedTypeIDs:["float[]","int[]"],displayType:"float[]"},{name:"mult",required:!0,allowedTypeIDs:["series int","series float","simple int","simple float","input int","input float","const int","const float"],displayType:"series float"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],syntax:["calcBB(float[] srcArray, series float mult, series bool calculate) → [series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:10,column:14},isUser:!0,returnedTypes:["[series float, series float, series float]"],returns:["A tuple containing the basis, upper band, and lower band respectively."]},{name:"calcBB",args:[{name:"srcArray",required:!0,allowedTypeIDs:["float[]","int[]"],displayType:"float[]"},{name:"mult",required:!0,allowedTypeIDs:["series int","simple int","input int","const int"],displayType:"series int"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],syntax:["calcBB(float[] srcArray, series int mult, series bool calculate) → [series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:19,column:14},isUser:!0,returnedTypes:["[series float, series float, series float]"],index:1},{name:"Scanner.new",args:[{name:"enabled",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"},{name:"ticker",required:!1,allowedTypeIDs:["series string","simple string","input string","const string"],displayType:"series string"},{name:"timeframe",required:!1,allowedTypeIDs:["series string","simple string","input string","const string"],displayType:"series string"}],returnedTypes:["Scanner"],pos:{lineNumber:30,column:12},syntax:["Scanner.new(series bool enabled, series string ticker, series string timeframe) → Scanner"]},{name:"Scanner.copy",args:[{name:"object",required:!0,allowedTypeIDs:["Scanner"],displayType:"Scanner"}],returnedTypes:["Scanner"],pos:{lineNumber:30,column:12},info:"The identifier of the object to be copied.",syntax:["Scanner.copy(Scanner object) → Scanner"]}],methods:[{name:"calcBB",args:[{name:"mult",required:!0,allowedTypeIDs:["series int","series float","simple int","simple float","input int","input float","const int","const float"],displayType:"series float"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],desc:["Computes Bollinger Band values from an array of data."],originalName:"array.calcBB",syntax:["calcBB(series float mult, series bool calculate) → [series float, series float, series float]"],returnedTypes:["[series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:10,column:14},thisType:["float[]"],returns:["A tuple containing the basis, upper band, and lower band respectively."]},{name:"calcBB",args:[{name:"mult",required:!0,allowedTypeIDs:["series int","simple int","input int","const int"],displayType:"series int"},{name:"calculate",required:!1,allowedTypeIDs:["series bool","simple bool","input bool","const bool"],displayType:"series bool"}],originalName:"array.calcBB",syntax:["calcBB(series int mult, series bool calculate) → [series float, series float, series float]"],returnedTypes:["[series float, series float, series float]"],hasMemberIndex:!1,pos:{lineNumber:19,column:14},thisType:["float[]"],index:1},{name:"Scanner.copy",args:[],returnedTypes:["Scanner"],thisType:["Scanner"],pos:{lineNumber:30,column:12},syntax:["Scanner.copy() → Scanner"]}],types:[{fields:[{name:"enabled",type:"series bool"},{name:"ticker",type:"series string"},{name:"timeframe",type:"series string"}],name:"Scanner",pos:{lineNumber:30,column:12}}],description:"Provides a tool to quickly output a label on the chart.",codeStr:'const $name={calcBB:({srcArray:a,mult:r,calculate:_=!0},e)=>{let v=$_var.getVarValue("mean",e+"_14_12","var")||$_var.setVarValue("mean",e+"_14_12",$_var.na,"var"),s=$_var.getVarValue("dev",e+"_14_13","var")||$_var.setVarValue("dev",e+"_14_13",$_var.na,"var");return _&&($_var.againAssignParse(v,a.avg(e+"_16_16")),v=a.avg(e+"_16_16"),$_var.setVarValue("mean",e+"_14_12",v,"var"),$_var.againAssignParse(s,a.stdev(e+"_17_16")*r),s=a.stdev(e+"_17_16")*r,$_var.setVarValue("dev",e+"_14_13",s,"var")),[v,$_var.add(v,s),$_var.sub(v,s)]},calcBB$1:({srcArray:a,mult:r,calculate:_=!0},e)=>{let v=$_var.getVarValue("mean",e+"_14_21","var")||$_var.setVarValue("mean",e+"_14_21",$_var.na,"var"),s=$_var.getVarValue("dev",e+"_14_22","var")||$_var.setVarValue("dev",e+"_14_22",$_var.na,"var");return _&&($_var.againAssignParse(v,a.avg(e+"_25_16")),v=a.avg(e+"_25_16"),$_var.setVarValue("mean",e+"_14_21",v,"var"),$_var.againAssignParse(s,a.stdev(e+"_26_16")*r),s=a.stdev(e+"_26_16")*r,$_var.setVarValue("dev",e+"_14_22",s,"var")),[v,$_var.add(v,s),$_var.sub(v,s)]},Scanner:$_var.getTypeInstance({enabled:void 0,ticker:void 0,timeframe:void 0},[])};'};class Fd{constructor(){Object.defineProperty(this,"_inlayHints",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_importCompleteLibrary",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_funcs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._inlayHints=new Map,this._importCompleteLibrary=new Map,this._funcs=new Map}get inlayHints(){return[...this._inlayHints.values()]}setEditor(n){this._editor=n}async setInlayHints(n){const{endLine:a,endColumn:o,name:c,libraryId:l,libraryName:m}=n;if(this._importCompleteLibrary.has(l)){const h=this._funcs.get(l);return((h==null?void 0:h.name)!==c||!c&&!this._inlayHints.has(l))&&(this._updateFuncNames(c||m,l),this._inlayHintsHandle(n)),this._importCompleteLibrary.get(l)}return this._importCompleteLibrary.set(l,co),this._inlayHints.set(l,{label:"载入中...",position:{column:o,lineNumber:a},paddingLeft:!0}),this.triggerInlayHints(),this._updateFuncNames(c||m,l),setTimeout(()=>{this._inlayHints.has(l)&&this._inlayHintsHandle(n)},2e3),co}deleteInlayHints(n){this._inlayHints.delete(n)}clearInlayHints(){this._inlayHints.clear()}triggerInlayHints(){this._editor&&this._editor.updateOptions({inlayHints:{fontFamily:String(Date.now())}})}_updateFuncNames(n,a){const o=this._importCompleteLibrary.get(a);if(!o)return;const c=o.functions.map(l=>`${n}.${l.name}`);this._funcs.set(a,{name:n,funcs:c}),this._updateMonarchTokens()}_setNoNameInlayHints(n){const{endLine:a,endColumn:o,libraryId:c,libraryName:l}=n;this._inlayHints.set(c,{label:`as ${l}`,position:{column:o,lineNumber:a},paddingLeft:!0})}_inlayHintsHandle(n){const{name:a,libraryId:o}=n;a?this._inlayHints.delete(o):this._setNoNameInlayHints(n),this.triggerInlayHints()}_updateMonarchTokens(){const n=[...this._funcs.values()].map(c=>c.funcs.join("|")),a=new RegExp("\\b("+n.join("|")+")(?=\\s*\\()"),o=[...Or.tokenizer.root];o.splice(15,0,[a,"meta.function-call"]),Ae.languages.setMonarchTokensProvider(ze,{...Or,tokenizer:{...Or.tokenizer,root:o}})}}const Xa=new Fd;function jd(s,n,a){var L;const o={startLineNumber:n.lineNumber,startColumn:1,endLineNumber:n.lineNumber,endColumn:n.column},c=s.getValueInRange(o);if(/^\/\/\s*@/.test(c))return{suggestions:qt.annotationSuggestions};if(a.triggerCharacter==="@")return{suggestions:[]};const l=c.match(/([\w.]+)$/)||[];if(!l.length)return{suggestions:[]};const m=(L=l[0])==null?void 0:L.match(/.*[^\w.]+([\w.]+)(?=\.)|([\w.]+)(?=\.)/),h=m?m[1]?m[1]:m[2]?m[2]:void 0:void 0,b=s.getWordUntilPosition(n),_=Nr.parseCurrentInputFunc(c),x={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:b.startColumn,endColumn:b.endColumn},T=s.getValueInRange({...x,startColumn:b.endColumn,endColumn:b.endColumn+1});qt.nextIsBracket=T==="(";let R=uo(qt.getSuggestions(h)||[],x);if(l[0]==="."&&(R=[]),_&&!h&&!/=\s*\w+$/.test(c)){const j=uo(qt.getArgSuggestions(_.funcName)||[],x);R=R.concat(j)}return{suggestions:R||[],dispose:()=>{}}}function Bd(s){if(s.kind!==1)return s;const{originInsertText:n}=s;return qt.nextIsBracket?s.insertText=n:s.insertText=n+qt.bracketsPostfix,s}function Ud(s,n){var o;const a=Nr.parseLineContentFuncVar(n.column,n.lineNumber,s,n);if(a!=null&&a.libraryId)return{contents:[{value:Dd(a)}]};if((o=a==null?void 0:a.docValue)!=null&&o.length){const c=Ad(a.docValue,a.index,a.isBuildIn);if(c)return{contents:[{value:c}]}}return{contents:[]}}function Wd(s,n){var T,R;const a={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:1,endColumn:n.column},o=s.getValueInRange(a),c=s.findMatches(String(Od),a,!0,!1,null,!0),l=s.findMatches(String(Pd),a,!0,!1,null,!0),m=(T=c.pop())==null?void 0:T.matches,h=(R=l.pop())==null?void 0:R.matches;let b=!1;c.length%2===0?m&&m[0]==='"'&&(b=!0):m&&!m[0]&&(b=!0);let _=!1;l.length%2===0?h&&h[0]==="'"&&(_=!0):h&&!h[0]&&(_=!0);const x=Nr.parseCurrentInputFuncAndArg(o,_,b);if(x){const{funcName:L,args:j}=x,E=Rd.getSignatureHelpValues(L,j);if(E)return{value:E,dispose:()=>{}}}return null}function Hd(s){let n=s.findMatches(un.colorMatchesRegStr,!0,!0,!1,null,!0);return n=n.filter(o=>{const c=s.getValueInRange({...o.range,startColumn:0});return c.indexOf("//")===-1||c.indexOf("//")>o.range.endColumn}),un.getDocumentColors(n)}function $d(s,n){return un.getDocumentColorPresentations(s,n)||[]}function Vd(s,n){const a=s.getModel(),o=Nr.parseLineContentFuncVar(n.startColumn+1,n.startLineNumber,a);if(!o||o.isBuildIn||!o.docValue||!o.docValue[0].pos)return o!=null&&o.isBuildIn?o:void 0;const{lineNumber:c,column:l}=o.docValue[0].pos,m={startLineNumber:c,endLineNumber:c,startColumn:l,endColumn:l};s.revealRangeInCenterIfOutsideViewport(m),s.setSelection(m)}function Xd(s,n){return Nr.parseLineContentFuncVar(n.column,n.lineNumber,s,n)?{uri:s.uri,range:{startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:n.column-1,endColumn:n.column-1}}:null}function uo(s,n){return s.map(a=>(a.range=n,a))}function Gd(){return{hints:Xa.inlayHints,dispose:()=>{}}}var da={},pa=lu;if(process.env.NODE_ENV==="production")da.createRoot=pa.createRoot,da.hydrateRoot=pa.hydrateRoot;else{var Ga=pa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;da.createRoot=function(s,n){Ga.usingClientEntryPoint=!0;try{return pa.createRoot(s,n)}finally{Ga.usingClientEntryPoint=!1}},da.hydrateRoot=function(s,n,a){Ga.usingClientEntryPoint=!0;try{return pa.hydrateRoot(s,n,a)}finally{Ga.usingClientEntryPoint=!1}}}var Xe;(function(s){s.added="added",s.removed="removed",s.modified="modified"})(Xe||(Xe={}));const Yd=(s,n)=>{const{close:a,retracement:o}=s,[c,l]=M.useState("modified");return M.useImperativeHandle(n,()=>({updateType(m){l(m)}})),P.jsxs("div",{className:`content-popup content-${c}-popup`,children:[P.jsx("div",{className:`triangle-popup triangle-${c}-popup`}),P.jsxs("div",{className:`header-popup header-${c}-popup`,children:[P.jsx("div",{className:"title-popup",children:"Local working changes"}),P.jsx("div",{className:"actions-popup",children:P.jsx("div",{onClick:a,"data-role":"button",className:"button-popup","data-name":"button-close-diff",children:P.jsx("span",{className:"icon-popup",role:"img",children:P.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",width:"12",height:"12",children:P.jsx("path",{stroke:"currentColor",strokeWidth:"1.2",d:"m1.5 1.5 9 9m0-9-9 9"})})})})})]}),P.jsx("div",{id:"diffEditorContainer",style:{height:"100%"}})]})},Kd=M.forwardRef(Yd);class Qd{constructor(n,a,o=!0){Object.defineProperty(this,"_domNode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_top",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._id=n,this._domNode=document.createElement("div"),this._domNode.style.display="none",this._domNode.style.width=o?"calc(100% - 134px)":"calc(100% - 14px)",this._domNode.style.height="200px",a==null||a.onDidScrollChange(this.scrollChangeHandler.bind(this)),da.createRoot(this._domNode).render(P.jsx(Kd,{ref:c=>this._content=c,close:()=>this._close(),retracement:this._retracement})),this._top=0}_close(){this._domNode.style.display="none"}_retracement(){}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}show(n,a,o){var c;this._top=a,(c=this._content)==null||c.updateType(o),this._domNode.style.top=`${n}px`,this._domNode.style.display="block"}hide(){this._domNode.style.display="none"}scrollChangeHandler(n){const a=n.scrollTop;this._domNode.style.top=`${this._top-a}px`}}function sr(){}sr.prototype={diff:function(n,a){var o,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=c.callback;typeof c=="function"&&(l=c,c={}),this.options=c;var m=this;function h(A){return l?(setTimeout(function(){l(void 0,A)},0),!0):A}n=this.castInput(n),a=this.castInput(a),n=this.removeEmpty(this.tokenize(n)),a=this.removeEmpty(this.tokenize(a));var b=a.length,_=n.length,x=1,T=b+_;c.maxEditLength&&(T=Math.min(T,c.maxEditLength));var R=(o=c.timeout)!==null&&o!==void 0?o:1/0,L=Date.now()+R,j=[{oldPos:-1,lastComponent:void 0}],E=this.extractCommon(j[0],a,n,0);if(j[0].oldPos+1>=_&&E+1>=b)return h([{value:this.join(a),count:a.length}]);var G=-1/0,J=1/0;function X(){for(var A=Math.max(G,-x);A<=Math.min(J,x);A+=2){var k=void 0,B=j[A-1],H=j[A+1];B&&(j[A-1]=void 0);var le=!1;if(H){var ie=H.oldPos-A;le=H&&0<=ie&&ie<b}var ce=B&&B.oldPos+1<_;if(!le&&!ce){j[A]=void 0;continue}if(!ce||le&&B.oldPos+1<H.oldPos?k=m.addToPath(H,!0,void 0,0):k=m.addToPath(B,void 0,!0,1),E=m.extractCommon(k,a,n,A),k.oldPos+1>=_&&E+1>=b)return h(Zd(m,k.lastComponent,a,n,m.useLongestToken));j[A]=k,k.oldPos+1>=_&&(J=Math.min(J,A-1)),E+1>=b&&(G=Math.max(G,A+1))}x++}if(l)(function A(){setTimeout(function(){if(x>T||Date.now()>L)return l();X()||A()},0)})();else for(;x<=T&&Date.now()<=L;){var F=X();if(F)return F}},addToPath:function(n,a,o,c){var l=n.lastComponent;return l&&l.added===a&&l.removed===o?{oldPos:n.oldPos+c,lastComponent:{count:l.count+1,added:a,removed:o,previousComponent:l.previousComponent}}:{oldPos:n.oldPos+c,lastComponent:{count:1,added:a,removed:o,previousComponent:l}}},extractCommon:function(n,a,o,c){for(var l=a.length,m=o.length,h=n.oldPos,b=h-c,_=0;b+1<l&&h+1<m&&this.equals(a[b+1],o[h+1]);)b++,h++,_++;return _&&(n.lastComponent={count:_,previousComponent:n.lastComponent}),n.oldPos=h,b},equals:function(n,a){return this.options.comparator?this.options.comparator(n,a):n===a||this.options.ignoreCase&&n.toLowerCase()===a.toLowerCase()},removeEmpty:function(n){for(var a=[],o=0;o<n.length;o++)n[o]&&a.push(n[o]);return a},castInput:function(n){return n},tokenize:function(n){return n.split("")},join:function(n){return n.join("")}};function Zd(s,n,a,o,c){for(var l=[],m;n;)l.push(n),m=n.previousComponent,delete n.previousComponent,n=m;l.reverse();for(var h=0,b=l.length,_=0,x=0;h<b;h++){var T=l[h];if(T.removed){if(T.value=s.join(o.slice(x,x+T.count)),x+=T.count,h&&l[h-1].added){var L=l[h-1];l[h-1]=l[h],l[h]=L}}else{if(!T.added&&c){var R=a.slice(_,_+T.count);R=R.map(function(E,G){var J=o[x+G];return J.length>E.length?J:E}),T.value=s.join(R)}else T.value=s.join(a.slice(_,_+T.count));_+=T.count,T.added||(x+=T.count)}}var j=l[b-1];return b>1&&typeof j.value=="string"&&(j.added||j.removed)&&s.equals("",j.value)&&(l[b-2].value+=j.value,l.pop()),l}var po=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,mo=/\S/,fo=new sr;fo.equals=function(s,n){return this.options.ignoreCase&&(s=s.toLowerCase(),n=n.toLowerCase()),s===n||this.options.ignoreWhitespace&&!mo.test(s)&&!mo.test(n)},fo.tokenize=function(s){for(var n=s.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),a=0;a<n.length-1;a++)!n[a+1]&&n[a+2]&&po.test(n[a])&&po.test(n[a+2])&&(n[a]+=n[a+2],n.splice(a+1,2),a--);return n};var dn=new sr;dn.tokenize=function(s){this.options.stripTrailingCr&&(s=s.replace(/\r\n/g,`
134
134
  `));var n=[],a=s.split(/(\n|\r\n)/);a[a.length-1]||a.pop();for(var o=0;o<a.length;o++){var c=a[o];o%2&&!this.options.newlineIsToken?n[n.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),n.push(c))}return n};function Jd(s,n,a){return dn.diff(s,n,a)}var ep=new sr;ep.tokenize=function(s){return s.split(/(\S.+?[.!?])(?=\s+|$)/)};var tp=new sr;tp.tokenize=function(s){return s.split(/([{}:;,]|\s+)/)};function Ya(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ya=function(n){return typeof n}:Ya=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ya(s)}var rp=Object.prototype.toString,ma=new sr;ma.useLongestToken=!0,ma.tokenize=dn.tokenize,ma.castInput=function(s){var n=this.options,a=n.undefinedReplacement,o=n.stringifyReplacer,c=o===void 0?function(l,m){return typeof m>"u"?a:m}:o;return typeof s=="string"?s:JSON.stringify(pn(s,null,null,c),c," ")},ma.equals=function(s,n){return sr.prototype.equals.call(ma,s.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"))};function pn(s,n,a,o,c){n=n||[],a=a||[],o&&(s=o(c,s));var l;for(l=0;l<n.length;l+=1)if(n[l]===s)return a[l];var m;if(rp.call(s)==="[object Array]"){for(n.push(s),m=new Array(s.length),a.push(m),l=0;l<s.length;l+=1)m[l]=pn(s[l],n,a,o,c);return n.pop(),a.pop(),m}if(s&&s.toJSON&&(s=s.toJSON()),Ya(s)==="object"&&s!==null){n.push(s),m={},a.push(m);var h=[],b;for(b in s)s.hasOwnProperty(b)&&h.push(b);for(h.sort(),l=0;l<h.length;l+=1)b=h[l],m[b]=pn(s[b],n,a,o,b);n.pop(),a.pop()}else m=s;return m}var mn=new sr;mn.tokenize=function(s){return s.slice()},mn.join=mn.removeEmpty=function(s){return s};class ap{constructor(n,a,o=""){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldDecorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffEditor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffPopupWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_didChangeListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onMouseDownListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._editor=n,this._monaco=a,this._originalModel=this._monaco.editor.createModel(o,ze),this._oldDecorations=[],this._init(),this._eventListening()}_init(){var n;this._changeEvent(),this._didChangeListener=(n=this._editor.getModel())==null?void 0:n.onDidChangeContent(()=>this._changeEvent())}update(n){var a,o;if(this._originalModel=this._monaco.editor.createModel(n,ze),n!==((a=this._editor.getModel())==null?void 0:a.getValue())){this._changeEvent();return}(o=this._editor.getModel())==null||o.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[]}dispose(){var n,a,o,c;this._diffPopupWidget&&(this._diffPopupWidget.hide(),this._editor.removeOverlayWidget(this._diffPopupWidget)),(n=this._didChangeListener)==null||n.dispose(),(a=this._onMouseDownListener)==null||a.dispose(),(o=this._editor.getModel())==null||o.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[],(c=this._diffEditor)==null||c.dispose(),this._diffEditor=void 0}_changesHandle(n){let a=0,o;const c=[];let l=0;for(const m of n){const{added:h,removed:b,count:_=1,value:x}=m;h?o&&o.removed?(a=this._changeHandle(c,a,l,_,Xe.modified),l=0,o=void 0):(o&&o.added&&(a=this._changeHandle(c,a,l,o.count||1,Xe.added),l=0),o=m):b?o&&o.added?(a=this._changeHandle(c,a,l,o.count||1,Xe.modified),l=0,o=void 0):(o&&o.removed&&this._addDecorationList(c,a,Xe.removed),o=m):/^\n+$/.test(x)?o&&(o.added||o.removed)?l=_:a+=_:(o&&o.added?(a=this._changeHandle(c,a,l,o.count||1,Xe.added),l=0,o=void 0):o&&o.removed&&(this._addDecorationList(c,a,Xe.removed),o=void 0),a+=_)}return o&&o.added?a=this._changeHandle(c,a,l,o.count||1,Xe.added):o&&o.removed&&this._addDecorationList(c,a,Xe.removed),c}_changeHandle(n,a,o,c,l){for(let m=1;m<=c;m++)this._addDecorationList(n,a+m,l);return a+=c+o,a}_addDecorationList(n,a,o){n.push({range:new this._monaco.Range(a,1,a,1),options:{isWholeLine:!0,linesDecorationsClassName:`line-${o} line-decoration_${o}`}})}_changeEvent(){var c,l;const n=Jd(this._originalModel.getValue(),((c=this._editor.getModel())==null?void 0:c.getValue())||""),a=this._changesHandle(n),o=((l=this._editor.getModel())==null?void 0:l.deltaDecorations(this._oldDecorations,a))||[];this._oldDecorations=o}_eventListening(){const n=new Qd("diff.popup.widget",this._editor);this._editor.addOverlayWidget(n),this._onMouseDownListener=this._editor.onMouseDown(a=>this._onMouseDownHandle(a)),this._diffPopupWidget=n}_onMouseDownHandle(n){var m,h,b,_,x,T;const a=(m=n.target.element)==null?void 0:m.classList,o=a==null?void 0:a.contains(`line-${Xe.added}`),c=a==null?void 0:a.contains(`line-${Xe.modified}`),l=a==null?void 0:a.contains(`line-${Xe.removed}`);if(o||c||l){const R=((b=(h=n==null?void 0:n.target)==null?void 0:h.position)==null?void 0:b.lineNumber)||0,L=((_=this._editor)==null?void 0:_.getTopForLineNumber(R+1))||0,j=((x=this._editor)==null?void 0:x.getScrollTop())||0,E=o?Xe.added:c?Xe.modified:Xe.removed;(T=this._diffPopupWidget)==null||T.show(L-j,L,E),this._diffEditor||(this._diffEditor=this._createDiffEditor()),this._diffEditor.setModel({original:this._originalModel,modified:this._editor.getModel()}),this._diffEditor.revealLineInCenter(R+1)}}_createDiffEditor(){return this._monaco.editor.createDiffEditor(document.getElementById("diffEditorContainer"),{renderSideBySide:!1,quickSuggestions:!1,suggestOnTriggerCharacters:!1,hover:{enabled:!1},parameterHints:{enabled:!1}})}}class sp{constructor(n,a,o){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_decorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_changPositionListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScript",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onActionTrigger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onLinkOpen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._editor=n,this._monaco=a,this._onActionTrigger=o,this._init()}addLinkOpenFunc(n){this._onLinkOpen=n}updateActionTrigger(n){this._onActionTrigger=n}setModelMarkers(n){this._monaco.editor.setModelMarkers(this._editor.getModel(),"owner",n)}addDiffDecorations(){this._decorations||(this._decorations=new ap(this._editor,this._monaco,this._originalScript))}removeDiffDecorations(){var n;(n=this._decorations)==null||n.dispose(),this._decorations=void 0}setValue(n){this._editor.setValue(n)}setPosition(n){var a,o,c;(a=this._editor)==null||a.setPosition(n),(o=this._editor)==null||o.revealPositionInCenter(n),(c=this._editor)==null||c.focus()}setOriginalScript(n){var a;this._originalScript=n,(a=this._decorations)==null||a.update(n)}getEditorLayout(){var o;const n=this._editor.getContentHeight(),a=(o=this._editor.getModel())==null?void 0:o.getLineCount();return{contentHeight:n,lineCount:a}}setEditorLayout(n){var a,o;(o=this._editor)==null||o.layout({height:n,width:(a=this._editor)==null?void 0:a.getContainerDomNode().clientWidth})}_init(){this._register(),this._setOptions(),this._addCommands(),this._addActions(),this._setCursorPosition()}_setCursorPosition(){const n=localStorage.getItem(nn);this._editor.setPosition(n?JSON.parse(n):{lineNumber:1,column:1}),this._editor.focus()}_register(){this._monaco.languages.register({id:ze}),this._monaco.languages.registerCompletionItemProvider(ze,{triggerCharacters:[".","@"],provideCompletionItems:jd,resolveCompletionItem:Bd}),this._monaco.languages.registerHoverProvider(ze,{provideHover:Ud}),this._monaco.languages.registerSignatureHelpProvider(ze,{signatureHelpTriggerCharacters:["(",","],provideSignatureHelp:Wd}),this._monaco.languages.registerColorProvider(ze,{provideColorPresentations:$d,provideDocumentColors:Hd}),this._monaco.editor.registerEditorOpener({openCodeEditor:(n,a,o)=>{const c=Vd(n,o);if(c){const{index:l,docValue:m}=c,{title:h,name:b}=m[l];let _="";switch(h){case ve.keywords:_="kw";break;case ve.functions:_="fun";break;case ve.variables:_="var";break;case ve.types:_="type";break;case ve.constants:_="const";break}this._onLinkOpen&&this._onLinkOpen(`${_}_${b}`,l)}return!0}}),this._monaco.editor.registerLinkOpener({open:n=>(this._onLinkOpen&&this._onLinkOpen(n.fragment),!0)}),this._monaco.languages.registerDefinitionProvider(ze,{provideDefinition:Xd}),this._monaco.languages.registerInlayHintsProvider(ze,{provideInlayHints:Gd})}_setOptions(){this._monaco.editor.defineTheme("vs-dark",cn),this._monaco.editor.defineTheme("vs",ln),this._monaco.languages.setMonarchTokensProvider(ze,Or),this._monaco.languages.setLanguageConfiguration(ze,on)}_addCommands(){this._monaco.editor.addCommand({id:"tcc.editor.function",run:(n,a)=>{var o;if(qt.nextIsBracket){const c=this._editor.getPosition();c&&this._editor.setPosition(Object.assign(c,{column:c.column+1}))}(o=this._editor.getAction(a))==null||o.run()}})}_addActions(){this._editor.addAction({id:"tcc-save-script",label:"保存脚本",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS],contextMenuGroupId:"9_modification",contextMenuOrder:1,run:()=>{this._onActionTrigger&&this._onActionTrigger(C.Actions.Save)}}),this._editor.addAction({id:"tcc-find-replace-line",label:"寻找/替换",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyF],contextMenuGroupId:"9_cutcopypaste",contextMenuOrder:5,run:()=>{this.openFind(),this._onActionTrigger&&this._onActionTrigger(C.Actions.Find)}}),this._editor.addAction({id:"tcc-trigger-console-script",label:"切换控制台",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Backquote],contextMenuGroupId:"9_modification-c",contextMenuOrder:2,run:()=>{this._onActionTrigger&&this._onActionTrigger(C.Actions.TriggerConsole)}})}openFind(){this._editor.focus(),this._editor.trigger("click","actions.find",null)}gotoLine(){this._editor.focus(),this._editor.trigger("click","editor.action.gotoLine",null)}onChangeCursorPosition(n){this._changPositionListener&&this._changPositionListener.dispose();const a=localStorage.getItem(nn);n&&n(a?JSON.parse(a):{lineNumber:1,column:1}),this._changPositionListener=this._editor.onDidChangeCursorPosition(o=>{localStorage.setItem(nn,JSON.stringify(o.position)),n&&n(o.position)})}}/**
135
135
  * @license
136
136
  * Copyright 2019 Google LLC
137
137
  * SPDX-License-Identifier: Apache-2.0
138
- */const yo=Symbol("Comlink.proxy"),np=Symbol("Comlink.endpoint"),ip=Symbol("Comlink.releaseProxy"),fn=Symbol("Comlink.finalizer"),Ka=Symbol("Comlink.thrown"),ho=s=>typeof s=="object"&&s!==null||typeof s=="function",op={canHandle:s=>ho(s)&&s[yo],serialize(s){const{port1:n,port2:a}=new MessageChannel;return go(s,n),[a,[a]]},deserialize(s){return s.start(),yn(s)}},lp={canHandle:s=>ho(s)&&Ka in s,serialize({value:s}){let n;return s instanceof Error?n={isError:!0,value:{message:s.message,name:s.name,stack:s.stack}}:n={isError:!1,value:s},[n,[]]},deserialize(s){throw s.isError?Object.assign(new Error(s.value.message),s.value):s.value}},_o=new Map([["proxy",op],["throw",lp]]);function cp(s,n){for(const a of s)if(n===a||a==="*"||a instanceof RegExp&&a.test(n))return!0;return!1}function go(s,n=globalThis,a=["*"]){n.addEventListener("message",function o(c){if(!c||!c.data)return;if(!cp(a,c.origin)){console.warn(`Invalid origin '${c.origin}' for comlink proxy`);return}const{id:l,type:m,path:h}=Object.assign({path:[]},c.data),b=(c.data.argumentList||[]).map(_r);let _;try{const x=h.slice(0,-1).reduce((R,L)=>R[L],s),T=h.reduce((R,L)=>R[L],s);switch(m){case"GET":_=T;break;case"SET":x[h.slice(-1)[0]]=_r(c.data.value),_=!0;break;case"APPLY":_=T.apply(x,b);break;case"CONSTRUCT":{const R=new T(...b);_=_n(R)}break;case"ENDPOINT":{const{port1:R,port2:L}=new MessageChannel;go(s,L),_=fp(R,[R])}break;case"RELEASE":_=void 0;break;default:return}}catch(x){_={value:x,[Ka]:0}}Promise.resolve(_).catch(x=>({value:x,[Ka]:0})).then(x=>{const[T,R]=es(x);n.postMessage(Object.assign(Object.assign({},T),{id:l}),R),m==="RELEASE"&&(n.removeEventListener("message",o),bo(n),fn in s&&typeof s[fn]=="function"&&s[fn]())}).catch(x=>{const[T,R]=es({value:new TypeError("Unserializable return value"),[Ka]:0});n.postMessage(Object.assign(Object.assign({},T),{id:l}),R)})}),n.start&&n.start()}function up(s){return s.constructor.name==="MessagePort"}function bo(s){up(s)&&s.close()}function yn(s,n){return hn(s,[],n)}function Qa(s){if(s)throw new Error("Proxy has been released and is not useable")}function xo(s){return Pr(s,{type:"RELEASE"}).then(()=>{bo(s)})}const Za=new WeakMap,Ja="FinalizationRegistry"in globalThis&&new FinalizationRegistry(s=>{const n=(Za.get(s)||0)-1;Za.set(s,n),n===0&&xo(s)});function dp(s,n){const a=(Za.get(n)||0)+1;Za.set(n,a),Ja&&Ja.register(s,n,s)}function pp(s){Ja&&Ja.unregister(s)}function hn(s,n=[],a=function(){}){let o=!1;const c=new Proxy(a,{get(l,m){if(Qa(o),m===ip)return()=>{pp(c),xo(s),o=!0};if(m==="then"){if(n.length===0)return{then:()=>c};const h=Pr(s,{type:"GET",path:n.map(b=>b.toString())}).then(_r);return h.then.bind(h)}return hn(s,[...n,m])},set(l,m,h){Qa(o);const[b,_]=es(h);return Pr(s,{type:"SET",path:[...n,m].map(x=>x.toString()),value:b},_).then(_r)},apply(l,m,h){Qa(o);const b=n[n.length-1];if(b===np)return Pr(s,{type:"ENDPOINT"}).then(_r);if(b==="bind")return hn(s,n.slice(0,-1));const[_,x]=wo(h);return Pr(s,{type:"APPLY",path:n.map(T=>T.toString()),argumentList:_},x).then(_r)},construct(l,m){Qa(o);const[h,b]=wo(m);return Pr(s,{type:"CONSTRUCT",path:n.map(_=>_.toString()),argumentList:h},b).then(_r)}});return dp(c,s),c}function mp(s){return Array.prototype.concat.apply([],s)}function wo(s){const n=s.map(es);return[n.map(a=>a[0]),mp(n.map(a=>a[1]))]}const vo=new WeakMap;function fp(s,n){return vo.set(s,n),s}function _n(s){return Object.assign(s,{[yo]:!0})}function es(s){for(const[n,a]of _o)if(a.canHandle(s)){const[o,c]=a.serialize(s);return[{type:"HANDLER",name:n,value:o},c]}return[{type:"RAW",value:s},vo.get(s)||[]]}function _r(s){switch(s.type){case"HANDLER":return _o.get(s.name).deserialize(s.value);case"RAW":return s.value}}function Pr(s,n,a){return new Promise(o=>{const c=yp();s.addEventListener("message",function l(m){!m.data||!m.data.id||m.data.id!==c||(s.removeEventListener("message",l),o(m.data))}),s.start&&s.start(),s.postMessage(Object.assign({id:c},n),a)})}function yp(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const To=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-BPrQC8D-.js").href:new URL("assets/scriptsRunWorker-BPrQC8D-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ba&&Ba.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});To.onerror=s=>{console.error(s)};async function Io(s){return await Xa.setInlayHints(s)}const ko=yn(To),Do=yn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-B1fH-Qn3.js").href:new URL("assets/parserTccWorker-B1fH-Qn3.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ba&&Ba.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function Ao(s,n=!1){const{functions:a,types:o,constants:c,variables:l,methods:m}=lt;return await Do.parseTcc(s,n,_n(Io),{functions:Object.fromEntries(a),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function hp(s,n){const{functions:a,types:o,constants:c,variables:l,methods:m}=lt;return await Do.parseLibraryCode(s,n,_n(Io),{functions:Object.fromEntries(a),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function qo(s,n,a=!0){return await ko.runScript(s,n,a)}async function _p(s){return await ko.removeScript(s)}function gp(s){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:s==null?void 0:s.name})}self.MonacoEnvironment={getWorker(){return new gp({name:"Editor Worker"})}},an.config({monaco:uu});let Co={};const bp=(s,n)=>{const{height:a,width:o,theme:c,options:l,hasDiff:m,readOnly:h,defaultValue:b,onChange:_,onLinkOpen:x,onDeclareConfigChange:T,onCursorPositionChange:R,onActionTrigger:L,onEditorDidMount:j}=s,E=M.useRef(null);M.useImperativeHandle(n,()=>({setOriginalScript(A){var k;(k=E.current)==null||k.setOriginalScript(A)},setScript(A){var k;(k=E.current)==null||k.setValue(A)},gotoLine(){var A;(A=E.current)==null||A.gotoLine()},getEditorLayout(){var A;return(A=E.current)==null?void 0:A.getEditorLayout()},setPosition(A,k){var B;(B=E.current)==null||B.setPosition({column:A,lineNumber:k})},setModelMarkers(A){var k;(k=E.current)==null||k.setModelMarkers(A)}})),M.useEffect(()=>{var A,k;m?(k=E.current)==null||k.addDiffDecorations():(A=E.current)==null||A.removeDiffDecorations()},[m]),M.useEffect(()=>{var A;(A=E.current)==null||A.updateActionTrigger(L)},[L]),M.useEffect(()=>{var A;x&&((A=E.current)==null||A.addLinkOpenFunc(x))},[x]),M.useEffect(()=>{var A;a&&((A=E.current)==null||A.setEditorLayout(Number(a)))},[a,E.current]);function G(A,k){var H,le,ie;qt.initBuiltinsTrees(),Xa.setEditor(A),E.current=new sp(A,k,L),x&&((H=E.current)==null||H.addLinkOpenFunc(x)),m&&((le=E.current)==null||le.addDiffDecorations()),Sd(A),(ie=E.current)==null||ie.setEditorLayout(Number(a));const B=A.getValue();E.current.onChangeCursorPosition(R),_&&_(B),!h&&J(B),j&&j()}const J=M.useCallback(async A=>{var te;const k=Date.now();Xa.clearInlayHints();const{errors:B,functions:H,methods:le,types:ie,variables:ce,overloadsFuncs:_t,imports:St,preParserCode:Me}=await Ao(A),Fe=new Map(Object.entries(H)),Y=new Map(Object.entries(le)),ge=new Map(Object.entries(ie)),Ne=new Map(Object.entries(ce)),Le=new Map(Object.entries(St));Nr.setUserDefined({functions:Fe,methods:Y,types:ge,variables:Ne,imports:Le},_t),qt.setUserDefind(Fe,ge,Ne,Y);const gt=B.map(de=>({...de,severity:de.type||Ae.MarkerSeverity.Error}));if(h)return;try{if(!B.length&&Me){const de=await qo(Me,{isPreParser:!0});io.isEqual(de,Co)||(Co=de,T&&T(de))}}catch(de){B.push({message:`Runtime Error: ${de.message}`,startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0})}(te=E.current)==null||te.setModelMarkers(gt);const zt=Date.now();console.log((zt-k)/1e3)},[T,h]),X=M.useMemo(()=>io.debounce(J,1500),[J]);function F(A){var k;if(h){J(A||"");return}(k=E.current)==null||k.setModelMarkers([]),A!==void 0&&(_&&_(A),X(A))}return P.jsx(bd,{height:a,width:o||"100%",defaultLanguage:ze,defaultValue:b||`indicator("我的脚本")
138
+ */const yo=Symbol("Comlink.proxy"),np=Symbol("Comlink.endpoint"),ip=Symbol("Comlink.releaseProxy"),fn=Symbol("Comlink.finalizer"),Ka=Symbol("Comlink.thrown"),ho=s=>typeof s=="object"&&s!==null||typeof s=="function",op={canHandle:s=>ho(s)&&s[yo],serialize(s){const{port1:n,port2:a}=new MessageChannel;return go(s,n),[a,[a]]},deserialize(s){return s.start(),yn(s)}},lp={canHandle:s=>ho(s)&&Ka in s,serialize({value:s}){let n;return s instanceof Error?n={isError:!0,value:{message:s.message,name:s.name,stack:s.stack}}:n={isError:!1,value:s},[n,[]]},deserialize(s){throw s.isError?Object.assign(new Error(s.value.message),s.value):s.value}},_o=new Map([["proxy",op],["throw",lp]]);function cp(s,n){for(const a of s)if(n===a||a==="*"||a instanceof RegExp&&a.test(n))return!0;return!1}function go(s,n=globalThis,a=["*"]){n.addEventListener("message",function o(c){if(!c||!c.data)return;if(!cp(a,c.origin)){console.warn(`Invalid origin '${c.origin}' for comlink proxy`);return}const{id:l,type:m,path:h}=Object.assign({path:[]},c.data),b=(c.data.argumentList||[]).map(_r);let _;try{const x=h.slice(0,-1).reduce((R,L)=>R[L],s),T=h.reduce((R,L)=>R[L],s);switch(m){case"GET":_=T;break;case"SET":x[h.slice(-1)[0]]=_r(c.data.value),_=!0;break;case"APPLY":_=T.apply(x,b);break;case"CONSTRUCT":{const R=new T(...b);_=_n(R)}break;case"ENDPOINT":{const{port1:R,port2:L}=new MessageChannel;go(s,L),_=fp(R,[R])}break;case"RELEASE":_=void 0;break;default:return}}catch(x){_={value:x,[Ka]:0}}Promise.resolve(_).catch(x=>({value:x,[Ka]:0})).then(x=>{const[T,R]=es(x);n.postMessage(Object.assign(Object.assign({},T),{id:l}),R),m==="RELEASE"&&(n.removeEventListener("message",o),bo(n),fn in s&&typeof s[fn]=="function"&&s[fn]())}).catch(x=>{const[T,R]=es({value:new TypeError("Unserializable return value"),[Ka]:0});n.postMessage(Object.assign(Object.assign({},T),{id:l}),R)})}),n.start&&n.start()}function up(s){return s.constructor.name==="MessagePort"}function bo(s){up(s)&&s.close()}function yn(s,n){return hn(s,[],n)}function Qa(s){if(s)throw new Error("Proxy has been released and is not useable")}function xo(s){return Pr(s,{type:"RELEASE"}).then(()=>{bo(s)})}const Za=new WeakMap,Ja="FinalizationRegistry"in globalThis&&new FinalizationRegistry(s=>{const n=(Za.get(s)||0)-1;Za.set(s,n),n===0&&xo(s)});function dp(s,n){const a=(Za.get(n)||0)+1;Za.set(n,a),Ja&&Ja.register(s,n,s)}function pp(s){Ja&&Ja.unregister(s)}function hn(s,n=[],a=function(){}){let o=!1;const c=new Proxy(a,{get(l,m){if(Qa(o),m===ip)return()=>{pp(c),xo(s),o=!0};if(m==="then"){if(n.length===0)return{then:()=>c};const h=Pr(s,{type:"GET",path:n.map(b=>b.toString())}).then(_r);return h.then.bind(h)}return hn(s,[...n,m])},set(l,m,h){Qa(o);const[b,_]=es(h);return Pr(s,{type:"SET",path:[...n,m].map(x=>x.toString()),value:b},_).then(_r)},apply(l,m,h){Qa(o);const b=n[n.length-1];if(b===np)return Pr(s,{type:"ENDPOINT"}).then(_r);if(b==="bind")return hn(s,n.slice(0,-1));const[_,x]=wo(h);return Pr(s,{type:"APPLY",path:n.map(T=>T.toString()),argumentList:_},x).then(_r)},construct(l,m){Qa(o);const[h,b]=wo(m);return Pr(s,{type:"CONSTRUCT",path:n.map(_=>_.toString()),argumentList:h},b).then(_r)}});return dp(c,s),c}function mp(s){return Array.prototype.concat.apply([],s)}function wo(s){const n=s.map(es);return[n.map(a=>a[0]),mp(n.map(a=>a[1]))]}const vo=new WeakMap;function fp(s,n){return vo.set(s,n),s}function _n(s){return Object.assign(s,{[yo]:!0})}function es(s){for(const[n,a]of _o)if(a.canHandle(s)){const[o,c]=a.serialize(s);return[{type:"HANDLER",name:n,value:o},c]}return[{type:"RAW",value:s},vo.get(s)||[]]}function _r(s){switch(s.type){case"HANDLER":return _o.get(s.name).deserialize(s.value);case"RAW":return s.value}}function Pr(s,n,a){return new Promise(o=>{const c=yp();s.addEventListener("message",function l(m){!m.data||!m.data.id||m.data.id!==c||(s.removeEventListener("message",l),o(m.data))}),s.start&&s.start(),s.postMessage(Object.assign({id:c},n),a)})}function yp(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const To=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-BPrQC8D-.js").href:new URL("assets/scriptsRunWorker-BPrQC8D-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ba&&Ba.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});To.onerror=s=>{console.error(s)};async function Io(s){return await Xa.setInlayHints(s)}const ko=yn(To),Do=yn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-Bews0bQ1.js").href:new URL("assets/parserTccWorker-Bews0bQ1.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ba&&Ba.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function Ao(s,n=!1){const{functions:a,types:o,constants:c,variables:l,methods:m}=lt;return await Do.parseTcc(s,n,_n(Io),{functions:Object.fromEntries(a),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function hp(s,n){const{functions:a,types:o,constants:c,variables:l,methods:m}=lt;return await Do.parseLibraryCode(s,n,_n(Io),{functions:Object.fromEntries(a),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(c),variables:Object.fromEntries(l)})}async function qo(s,n,a=!0){return await ko.runScript(s,n,a)}async function _p(s){return await ko.removeScript(s)}function gp(s){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:s==null?void 0:s.name})}self.MonacoEnvironment={getWorker(){return new gp({name:"Editor Worker"})}},an.config({monaco:uu});let Co={};const bp=(s,n)=>{const{height:a,width:o,theme:c,options:l,hasDiff:m,readOnly:h,defaultValue:b,onChange:_,onLinkOpen:x,onDeclareConfigChange:T,onCursorPositionChange:R,onActionTrigger:L,onEditorDidMount:j}=s,E=M.useRef(null);M.useImperativeHandle(n,()=>({setOriginalScript(A){var k;(k=E.current)==null||k.setOriginalScript(A)},setScript(A){var k;(k=E.current)==null||k.setValue(A)},gotoLine(){var A;(A=E.current)==null||A.gotoLine()},getEditorLayout(){var A;return(A=E.current)==null?void 0:A.getEditorLayout()},setPosition(A,k){var B;(B=E.current)==null||B.setPosition({column:A,lineNumber:k})},setModelMarkers(A){var k;(k=E.current)==null||k.setModelMarkers(A)}})),M.useEffect(()=>{var A,k;m?(k=E.current)==null||k.addDiffDecorations():(A=E.current)==null||A.removeDiffDecorations()},[m]),M.useEffect(()=>{var A;(A=E.current)==null||A.updateActionTrigger(L)},[L]),M.useEffect(()=>{var A;x&&((A=E.current)==null||A.addLinkOpenFunc(x))},[x]),M.useEffect(()=>{var A;a&&((A=E.current)==null||A.setEditorLayout(Number(a)))},[a,E.current]);function G(A,k){var H,le,ie;qt.initBuiltinsTrees(),Xa.setEditor(A),E.current=new sp(A,k,L),x&&((H=E.current)==null||H.addLinkOpenFunc(x)),m&&((le=E.current)==null||le.addDiffDecorations()),Sd(A),(ie=E.current)==null||ie.setEditorLayout(Number(a));const B=A.getValue();E.current.onChangeCursorPosition(R),_&&_(B),!h&&J(B),j&&j()}const J=M.useCallback(async A=>{var te;const k=Date.now(),{errors:B,functions:H,methods:le,types:ie,variables:ce,overloadsFuncs:_t,imports:St,preParserCode:Me}=await Ao(A,!0),Fe=new Map(Object.entries(H)),Y=new Map(Object.entries(le)),ge=new Map(Object.entries(ie)),Ne=new Map(Object.entries(ce)),Le=new Map(Object.entries(St));Nr.setUserDefined({functions:Fe,methods:Y,types:ge,variables:Ne,imports:Le},_t),qt.setUserDefind(Fe,ge,Ne,Y);const gt=B.map(de=>({...de,severity:de.type||Ae.MarkerSeverity.Error}));if(h)return;try{if(!B.length&&Me){const de=await qo(Me,{isPreParser:!0});io.isEqual(de,Co)||(Co=de,T&&T(de))}}catch(de){B.push({message:`Runtime Error: ${de.message}`,startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0})}(te=E.current)==null||te.setModelMarkers(gt);const zt=Date.now();console.log((zt-k)/1e3)},[T,h]),X=M.useMemo(()=>io.debounce(J,1500),[J]);function F(A){var k;if(h){J(A||"");return}Xa.clearInlayHints(),(k=E.current)==null||k.setModelMarkers([]),A!==void 0&&(_&&_(A),X(A))}return P.jsx(bd,{height:a,width:o||"100%",defaultLanguage:ze,defaultValue:b||`indicator("我的脚本")
139
139
  plot(close)
140
140
  `,theme:c||"vs-dark",className:`tvue-script ${c||"vs-dark"}`,options:{colorDecorators:!0,useShadowDOM:!1,matchOnWordStartOnly:!0,suggest:{filterGraceful:!0},fontSize:13,...h?Md:{},readOnlyMessage:{value:"该脚本是只读的。它无法被编辑。"},...l},onMount:G,onChange:F})},xp=M.forwardRef(bp),wp=s=>{const{theme:n,modified:a,original:o,height:c,width:l,renderSideBySide:m=!0}=s,h=M.useCallback((b,_)=>{_.languages.register({id:ze}),_.editor.defineTheme("vs-dark",cn),_.editor.defineTheme("vs",ln),_.languages.setMonarchTokensProvider(ze,Or),_.languages.setLanguageConfiguration(ze,on)},[]);return P.jsx(fd,{height:c||"90vh",width:l||"100%",theme:n||"vs-dark",options:{readOnly:!0,renderSideBySide:m,scrollBeyondLastLine:!1},language:ze,modified:a,original:o,onMount:h})};C.VMarkerSeverity=void 0,function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"}(C.VMarkerSeverity||(C.VMarkerSeverity={}));var ts={},vp=function(){var s=document.getSelection();if(!s.rangeCount)return function(){};for(var n=document.activeElement,a=[],o=0;o<s.rangeCount;o++)a.push(s.getRangeAt(o));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null;break}return s.removeAllRanges(),function(){s.type==="Caret"&&s.removeAllRanges(),s.rangeCount||a.forEach(function(c){s.addRange(c)}),n&&n.focus()}},Tp=vp,So={"text/plain":"Text","text/html":"Url",default:"Text"},Ip="Copy to clipboard: #{key}, Enter";function kp(s){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,n)}function Dp(s,n){var a,o,c,l,m,h,b=!1;n||(n={}),a=n.debug||!1;try{c=Tp(),l=document.createRange(),m=document.getSelection(),h=document.createElement("span"),h.textContent=s,h.ariaHidden="true",h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(x){if(x.stopPropagation(),n.format)if(x.preventDefault(),typeof x.clipboardData>"u"){a&&console.warn("unable to use e.clipboardData"),a&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var T=So[n.format]||So.default;window.clipboardData.setData(T,s)}else x.clipboardData.clearData(),x.clipboardData.setData(n.format,s);n.onCopy&&(x.preventDefault(),n.onCopy(x.clipboardData))}),document.body.appendChild(h),l.selectNodeContents(h),m.addRange(l);var _=document.execCommand("copy");if(!_)throw new Error("copy command was unsuccessful");b=!0}catch(x){a&&console.error("unable to copy using execCommand: ",x),a&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",s),n.onCopy&&n.onCopy(window.clipboardData),b=!0}catch(T){a&&console.error("unable to copy using clipboardData: ",T),a&&console.error("falling back to prompt"),o=kp("message"in n?n.message:Ip),window.prompt(o,s)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(l):m.removeAllRanges()),h&&document.body.removeChild(h),c()}return b}var Ap=Dp;function gn(s){"@babel/helpers - typeof";return gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},gn(s)}Object.defineProperty(ts,"__esModule",{value:!0}),ts.CopyToClipboard=void 0;var rs=zo(M),qp=zo(Ap),Cp=["text","onCopy","options","children"];function zo(s){return s&&s.__esModule?s:{default:s}}function No(s,n){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);n&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(s,c).enumerable})),a.push.apply(a,o)}return a}function Oo(s){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?No(Object(a),!0).forEach(function(o){xn(s,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):No(Object(a)).forEach(function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(a,o))})}return s}function Sp(s,n){if(s==null)return{};var a=zp(s,n),o,c;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);for(c=0;c<l.length;c++)o=l[c],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(s,o)&&(a[o]=s[o])}return a}function zp(s,n){if(s==null)return{};var a={},o=Object.keys(s),c,l;for(l=0;l<o.length;l++)c=o[l],!(n.indexOf(c)>=0)&&(a[c]=s[c]);return a}function Np(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")}function Po(s,n){for(var a=0;a<n.length;a++){var o=n[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}function Op(s,n,a){return n&&Po(s.prototype,n),a&&Po(s,a),Object.defineProperty(s,"prototype",{writable:!1}),s}function Pp(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(n&&n.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),n&&bn(s,n)}function bn(s,n){return bn=Object.setPrototypeOf||function(o,c){return o.__proto__=c,o},bn(s,n)}function Ep(s){var n=Lp();return function(){var o=as(s),c;if(n){var l=as(this).constructor;c=Reflect.construct(o,arguments,l)}else c=o.apply(this,arguments);return Rp(this,c)}}function Rp(s,n){if(n&&(gn(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eo(s)}function Eo(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Lp(){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 as(s){return as=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},as(s)}function xn(s,n,a){return n in s?Object.defineProperty(s,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[n]=a,s}var Ro=function(s){Pp(a,s);var n=Ep(a);function a(){var o;Np(this,a);for(var c=arguments.length,l=new Array(c),m=0;m<c;m++)l[m]=arguments[m];return o=n.call.apply(n,[this].concat(l)),xn(Eo(o),"onClick",function(h){var b=o.props,_=b.text,x=b.onCopy,T=b.children,R=b.options,L=rs.default.Children.only(T),j=(0,qp.default)(_,R);x&&x(_,j),L&&L.props&&typeof L.props.onClick=="function"&&L.props.onClick(h)}),o}return Op(a,[{key:"render",value:function(){var c=this.props;c.text,c.onCopy,c.options;var l=c.children,m=Sp(c,Cp),h=rs.default.Children.only(l);return rs.default.cloneElement(h,Oo(Oo({},m),{},{onClick:this.onClick}))}}]),a}(rs.default.PureComponent);ts.CopyToClipboard=Ro,xn(Ro,"defaultProps",{onCopy:void 0,options:void 0});var Mp=ts,wn=Mp.CopyToClipboard;wn.CopyToClipboard=wn;var Fp=wn;const vn=du(Fp);async function jp(s,n=0){const a=s[n];if(!a)return;const{name:o,args:c,type:l,desc:m,examples:h,remarks:b,seeAlso:_,syntax:x,detailedDesc:T,fields:R,returns:L}=a,j={name:o};if(s.length>1&&(j.overloads=`${s.length} overloads`),l&&(j.type=l),c&&(j.name=`${o}()`,j.args=c.map(E=>{const{name:G,desc:J,displayType:X}=E;return{label:`${G} (${X})`,desc:J&&gr(J)}})),m&&(j.desc=m.map(E=>gr(E))),h&&(j.originalExample=h.join(`
141
141
  `),j.examples=await Ae.editor.colorize(j.originalExample,ze,{tabSize:4})),T){j.detailedDesc=[];for(const E of T){const{desc:G,examples:J}=E;let X=G.map(k=>gr(k)),F,A;J&&(A=J.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.0.69",
3
+ "version": "0.0.70",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"