!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ivprogCore=t():e.ivprogCore=t()}(window,(function(){return function(e){function t(t){for(var i,r,s=t[0],l=t[1],c=t[2],d=0,p=[];d{e.dim=this.dimensions}),e}get value(){}get ord(){}canAccept(e,t){const n=this.dimensions-t;return e instanceof i?n==e.dimensions&&this.innerType.isCompatible(e.innerType):0==n&&this.innerType.isCompatible(e)}}t.ArrayType=i},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(1),o=n(0),a=n(36),r=n(77),s=n(4),l=n(17),c=n(16),u=n(50),d=n(2),p=n(26),_=n(33),f=n(37),m=n(78);class v{constructor(e){this.name=e,this.store=new Map,this.mode=i.Modes.RUN}static canImplicitTypeCast(e,t){return!(!e.isCompatible(o.Types.INTEGER)&&!e.isCompatible(o.Types.REAL)||!t.isCompatible(o.Types.INTEGER)&&!t.isCompatible(o.Types.REAL))}static doImplicitCasting(e,t){if(!v.canImplicitTypeCast(e,t.type))throw new Error("!!!Critical error: attempted to type cast invalid types");return e.isCompatible(o.Types.INTEGER)?new d.StoreValue(o.Types.INTEGER,t.get().trunc()):new d.StoreValue(o.Types.REAL,t.get())}extendStore(e){this.nextStore=e}applyStore(e){if(!this.store.has(e)){if(null!=this.nextStore)return this.nextStore.applyStore(e);throw new Error(`Variable ${e} not found.`)}const t=this.store.get(e);let n=null;if(t.type instanceof s.ArrayType){const e=t,i=e.type;let o=0,a=0;const r=e.value.map(t=>e.isVector?new p.StoreValueAddress(i.innerType,t,o++,void 0,e.id,e.readOnly):(a>=e.columns&&(a=0,o+=1),new p.StoreValueAddress(i.innerType,t,o,a++,e.id,e.readOnly)));n=new l.ArrayStoreValue(i,r,e.lines,e.columns,t.id,t.readOnly)}else n=new d.StoreValue(t.type,t.value,t.id,t.readOnly);return n}updateStore(e,t){if(this.store.has(e)){const n=this.store.get(e);if(n.readOnly)throw new Error("Cannot change value of a read only variable: "+e);if(n instanceof u.StoreObjectArray){const e=t;if(n.isCompatible(e)){if(n.isVector)e.get().forEach((e,t)=>{n.setAt(e,t,void 0)});else{let t=0,i=0;e.get().forEach(e=>{n.setAt(e,t,i),(i+=1)>=n.columns&&(t+=1,i=0)})}return this}}else if(n.isCompatible(t)){const e=n.locAddress;return c.Location.updateAddress(e,t.get()),this}const i=n.type,o=t.type;throw new Error(`${i.value} is not compatible with type ${o.value} given`)}if(null!=this.nextStore)return this.nextStore.updateStore(e,t),this;throw new Error(`Variable ${e} not found.`)}updateStoreArray(e,t,n,i){if(this.store.has(e)){const o=this.store.get(e);if(o.readOnly)throw new Error("Cannot change value of a read only variable: "+e);if(!(o instanceof u.StoreObjectArray))throw new Error("Cannot update a non-array variable using updateStoreArray");if(t instanceof l.ArrayStoreValue){const a=t.get();if(o.isVector&&t.isVector())for(let e=0;e0)for(let e=0;ee.destroy(),this)}}t.Store=v},,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=Object.freeze({BASE:Symbol("context:base"),BREAKABLE:Symbol("context:breakable"),FUNCTION:Symbol("context:function")})},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(76);const o=new class{constructor(){this.data=[],this.address_id=0}allocate(e){const t=this.address_id,n=new i.Address(t,e);return this.data.push(n),this.address_id+=1,t}deallocate(e){const t=this.findIndex(e);return-1!==t&&(this.data.splice(t,1),!0)}find(e){let t=0,n=this.data.length;for(;to.id?t=i:n=i}}getAddressAt(e){return this.data[e]}findIndex(e){let t=0,n=this.data.length;for(;to.id?t=i:n=i}return-1}updateAddress(e,t){const n=this.findIndex(e);if(-1===n)throw new Error("Invalid address..."+e);this.data[n].value=t}clear(){for(let e=0;eo.data.length})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(4),o=n(26);class a{constructor(e,t,n,i,o,a=!1){this.type=e,this.id=o,this.isConst=a,this.values=t,this.lines=n,this.columns=i}get(){return this.values}getAt(e,t){if(console.log("Column ",t),this.isVector()){if(null!=t)throw new Error(this.id+" is not a matrix!");t=e,e=0}else if(null==t){const t=[];for(let n=0;n\t>","?\t?@\t@","","","","","","","\b\b\b\b\b\b","\b\b\b\b\t\t\t\t\t","\t\t\t\n\n\n\n\n\v","\v\v\v\v\v\v","\v\v\v\f\f\f\f","\f\f\r\r\r\r\r\r","\r","","","","","","","","","","","","","","","","","",""," ",' !!""##$$%',"%&&''(((((","(ť\n())**++,,","----------Ÿ","\n-..//000ƀ\n0\f0","0ƃ\v0111122Ɗ\n2\r","22Ƌ22222ƒ\n22","2ƕ\n2\r22Ɩ22222Ɲ","\n222Ơ\n2\r22ơ2Ƥ\n23","3Ƨ\n3\r33ƨ333ƭ\n3\r33Ʈ","33Ʋ\n3\r33Ƴ333Ƹ\n","3\f33ƻ\v333ƾ\n344","4ǂ\n444Dž\n4\r44dž55","5Nj\n5\f55ǎ\v55566","6ǔ\n67777Ǚ\n777","888899::Ǥ\n:\r:",":ǥ::ǩ\n:;;<<=","====dz\n=>>>>>",">>>>>>>Ȁ\n>??","?????@@@@@ȍ","\n@\f@@Ȑ\v@@@ȓ\n@@@","@@@@Ț\n@\f@@ȝ\v@@","@@ȡ\n@@@țA","\t\v\r\b\t\n\v","\f\r!","#%')+-/135","79;=?AC E!G\"I#K$M%O&Q'S(U)W*Y","+[,]-_.a/c0e1gi2km3o4qs5uwy{","}6--//'',,1","1>>@@C\\aac|2;C\\aac|","2;23GGgg\f\f$$^^",'\f\f))^^\v\v""\f',"\f2;CHch29\n$$))^^ddhhppt","tvv25ȹ","","\t\v","\r","","","","","!#%","')","+-","/1","35","7?A","CE","GI","KM","OQ","SUW","Y[","]_","ac","ei","mos","","Š","\t•\vœ","\r£«","µ½","ÂÌ","ÒÙ","áæ","!ò#õ","%ù'ÿ",")Ą+ċ","-ē/Ĝ1Ĭ","3į5ĵ","7Ļ9ņ",";Ŋ=Ō","?ŏAő","CœEŕGŗ","IřKś","MŝOŤ","QŦSŨ","UŪWŬ","Yŷ[Ź]Ż","_ŽaƄ","cƣeƽ","gƿiLj","kǓmǕ","oǜqǠsǨ","uǪwǬ","yDz{ǿ","}ȁȠ","‚r‚ƒt","ƒ„q„…i","…†t†‡c‡","ˆoˆ‰c‰","Š‹t‹Œ","gŒcŽ","nŽ","x‘c‘’|","’“k“”q","”\b•–n–","—q—˜i˜™","k™šeš›","q›\nœe","žcžŸf","Ÿ g ¡k¡","¢c¢\f£¤","k¤¥p¥¦","v¦§g§¨k","¨©t©ªq","ª«¬e","¬­c­®t®","¯c¯°e°±","v±²g²³","t³´g´","µ¶g¶·u","·¸e¸¹q","¹ºnº»j»","¼c¼½","¾e¾¿c¿À","uÀÁqÁ","ÂÃeÃÄ","qÄÅpÅÆv","ÆÇtÇÈc","ÈÉtÉÊkÊ","ËqËÌ","ÍeÍÎqÎÏ","pÏÐuÐÑ","vÑÒÓ","hÓÔwÔÕp","ÕÖeÖ×c","×ØqØ","ÙÚfÚÛgÛ","ÜxÜÝqÝÞ","nÞßxßà","càáâ","râãcãät","äåcå","æçtçèg","èéréêkê","ëvëìcìí","aíîrîï","cïðtðñc","ñ òóf",'óôgô"õ',"öcö÷v÷ø","gø$ùú","rúûcûüu","üýuýþq","þ&ÿĀrĀ","ācāĂtĂă","gă(Ąą","tąĆgĆćr","ćĈkĈĉv","ĉĊcĊ*ċ","ČcČčvčĎ","gĎďaďĐ","sĐđwđĒg","Ē,ēĔg","ĔĕpĕĖsĖ","ėwėĘcĘę","pęĚvĚě","qě.Ĝĝt","ĝĞgĞğr","ğĠkĠġvġ","ĢcĢģaģĤ","gĤĥpĥĦ","sĦħwħĨc","ĨĩpĩĪv","Īīqī0Ĭ","ĭuĭĮgĮ2","įİuİı","gıIJpIJijc","ijĴqĴ4","ĵĶhĶķcķ","ĸnĸĹuĹĺ","qĺ6Ļļ","xļĽgĽľt","ľĿfĿŀc","ŀŁfŁłgł","ŃkŃńtńŅ","qŅ8ņŇ","pŇňcňʼnq","ʼn:ŊŋG","ŋ<ŌōQō","ŎWŎ>ŏŐ","(Ő@őŒ","*ŒBœŔ+","ŔDŕŖ]","ŖFŗŘ_Ř","HřŚ}ŚJ","śŜŜL","ŝŞ.ŞN","şŠ>Šť/","šŢ￿Ţţ￿","ţť￿Ťş","ŤšťP","Ŧŧ\tŧR","Ũũ\tũTŪ","ū;ūVŬŭ","=ŭXŮů","@ůŸ?Űű?","űŸ?Ųų>","ųŸ?ŴŸ\tŵ","Ŷ#ŶŸ?ŷŮ","ŷŰŷŲ","ŷŴŷŵ","ŸZŹź","<ź\\Żż","9ż^ŽƁ\t","žƀ\tſž","ƀƃƁſ","ƁƂƂ`","ƃƁƄƅ_0","ƅƆ0ƆƇ_0Ƈb","ƈƊ\tƉƈ","ƊƋƋƉ","ƋƌƌƤ","ƍƎ2Ǝƒ","zƏƐ2ƐƒZ","ƑƍƑƏ","ƒƔƓƕu;","ƔƓƕƖ","ƖƔƖƗ","ƗƤƘƙ2","ƙƝdƚƛ2ƛ","ƝDƜƘƜ","ƚƝƟƞ","Ơ\t\bƟƞƠơ","ơƟơƢ","ƢƤƣƉ","ƣƑƣƜ","ƤdƥƧ","\tƦƥƧƨ","ƨƦƨƩ","ƩƪƪƬ","0ƫƭ\tƬƫ","ƭƮƮƬ","ƮƯƯƾ","ưƲ\tƱư","ƲƳƳƱ","ƳƴƴƵ","Ƶƹ0ƶƸ\t","ƷƶƸƻ","ƹƷƹƺ","ƺƼƻƹ","Ƽƾg4ƽƦ","ƽƱƾf","ƿǁ\t\tǀǂ\tǁ","ǀǁǂǂ","DŽǃDž\tDŽ","ǃDždždž","DŽdžLJLJ","hLjnj$ljNj","k6NJljNjǎ","njNJnjǍ","ǍǏǎnj","Ǐǐ$ǐj","Ǒǔ\n\nǒǔy=Ǔ","ǑǓǒǔ","lǕǘ)ǖǙ","y=ǗǙ\n\vǘǖ","ǘǗǙǚ","ǚǛ)Ǜn","ǜǝ\t\fǝǞ","Ǟǟ\b8ǟpǠǡ","=ǡrǢǤ\t\r","ǣǢǤǥ","ǥǣǥǦ","Ǧǩǧǩq9","ǨǣǨǧ","ǩtǪǫ\tǫ","vǬǭ\tǭx","Ǯǯ^ǯdz\t","ǰdz}?DZdz{>Dz","ǮDzǰDz","DZdzzǴ","ǵ^ǵǶ\tǶǷ","w<ǷǸw<ǸȀ","ǹǺ^Ǻǻw<ǻ","Ǽw<ǼȀǽǾ","^ǾȀw<ǿǴ","ǿǹǿǽ","Ȁ|ȁȂ^","ȂȃwȃȄu;Ȅ","ȅu;ȅȆu;Ȇȇu;","ȇ~Ȉȉ1ȉ","Ȋ1ȊȎȋ","ȍ\n\rȌȋȍȐ","ȎȌȎȏ","ȏȒȐȎ","ȑȓȒȑ","ȒȓȓȔ","Ȕȡ\fȕȖ","1Ȗȗ,ȗț","ȘȚ\vșȘ","ȚȝțȜ","țșȜȞ","ȝțȞȟ",",ȟȡ1ȠȈ","ȠȕȡȢ","Ȣȣ\b@ȣ€","ŤŷƁƋƑƖƜơƣ","ƨƮƳƹƽǁdžnjǓǘǥǨ","DzǿȎȒțȠ\b",""].join(""),a=(new i.atn.ATNDeserializer).deserialize(o),r=a.decisionToState.map((function(e,t){return new i.dfa.DFA(e,t)}));function s(e){return i.Lexer.call(this,e),this._interp=new i.atn.LexerATNSimulator(this,a,r,new i.PredictionContextCache),this}s.prototype=Object.create(i.Lexer.prototype),s.prototype.constructor=s,s.EOF=i.Token.EOF,s.RK_PROGRAM=1,s.RK_REAL=2,s.RK_VOID=3,s.RK_BOOLEAN=4,s.RK_STRING=5,s.RK_INTEGER=6,s.RK_CHARACTER=7,s.RK_SWITCH=8,s.RK_CASE=9,s.RK_DEFAULT=10,s.RK_CONST=11,s.RK_FUNCTION=12,s.RK_RETURN=13,s.RK_FOR=14,s.RK_FOR_ALT=15,s.RK_FOR_FROM=16,s.RK_FOR_TO=17,s.RK_FOR_PASS=18,s.RK_BREAK=19,s.RK_DO=20,s.RK_DO_UNTIL=21,s.RK_WHILE=22,s.RK_WHILE_ALT=23,s.RK_IF=24,s.RK_ELSE=25,s.RK_FALSE=26,s.RK_TRUE=27,s.RK_REFERENCE=28,s.OPEN_PARENTHESIS=29,s.CLOSE_PARENTHESIS=30,s.OPEN_BRACE=31,s.CLOSE_BRACE=32,s.OPEN_CURLY=33,s.CLOSE_CURLY=34,s.COMMA=35,s.EQUAL=36,s.SUM_OP=37,s.MULTI_OP=38,s.AND_OPERATOR=39,s.OR_OPERATOR=40,s.RELATIONAL_OPERATOR=41,s.COLON=42,s.NOT_OPERATOR=43,s.ID=44,s.LIB_ID=45,s.INTEGER=46,s.REAL=47,s.STRING=48,s.CHARACTER=49,s.WHITESPACE=50,s.EOS=51,s.COMMENTS=52,s.prototype.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],s.prototype.modeNames=["DEFAULT_MODE"],s.prototype.literalNames=[null,"'programa'","'real'","'vazio'","'logico'","'cadeia'","'inteiro'","'caractere'","'escolha'","'caso'","'contrario'","'const'","'funcao'","'devolva'","'para'","'repita_para'","'de'","'ate'","'passo'","'pare'","'repita'","'ate_que'","'enquanto'","'repita_enquanto'","'se'","'senao'","'falso'","'verdadeiro'","'&'","'('","')'","'['","']'","'{'","'}'","','",null,null,null,null,null,null,"':'"],s.prototype.symbolicNames=[null,"RK_PROGRAM","RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER","RK_CHARACTER","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_FOR_ALT","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS","RK_BREAK","RK_DO","RK_DO_UNTIL","RK_WHILE","RK_WHILE_ALT","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_REFERENCE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_BRACE","CLOSE_BRACE","OPEN_CURLY","CLOSE_CURLY","COMMA","EQUAL","SUM_OP","MULTI_OP","AND_OPERATOR","OR_OPERATOR","RELATIONAL_OPERATOR","COLON","NOT_OPERATOR","ID","LIB_ID","INTEGER","REAL","STRING","CHARACTER","WHITESPACE","EOS","COMMENTS"],s.prototype.ruleNames=["RK_PROGRAM","RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER","RK_CHARACTER","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_FOR_ALT","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS","RK_BREAK","RK_DO","RK_DO_UNTIL","RK_WHILE","RK_WHILE_ALT","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_LOGICAL_NOT","RK_LOGICAL_AND","RK_LOGICAL_OR","RK_REFERENCE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_BRACE","CLOSE_BRACE","OPEN_CURLY","CLOSE_CURLY","COMMA","EQUAL","SUM_OP","MULTI_OP","AND_OPERATOR","OR_OPERATOR","RELATIONAL_OPERATOR","COLON","NOT_OPERATOR","ID","LIB_ID","INTEGER","REAL","ExponentPart","STRING","STRING_CHARACTER","CHARACTER","WHITESPACE","SEMICOLON","EOS","HEX_DIGIT","OCTAL_DIGIT","ESC_SEQ","ESC_OCTAL","ESC_UNICODE","COMMENTS"],s.prototype.grammarFileName="ivprog.g4",t.ivprog=s},function(e,t,n){e.exports={ivprog:n(0).ivprog}},function(e,t){e.exports=n(24)}])},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){var i=n(2),o=["悋Ꜫ脳맭䅼㯧瞆奤","6ȉ\b\t\t","\t\t\t\t","\b\t\b\t\t\t\n\t\n\v\t\v","\f\t\f\r\t\r\t\t","\t\t\t\t","\t\t\t","\t\t\t\t","\t\t\t",'\t\t \t !\t!"\t"#',"\t#$\t$%\t%&\t&'\t'(\t()\t)","*\t*+\t+,\t,-\t-.\t./\t/0\t0","1\t12\t23\t34\t45\t56\t67\t7","8\t89\t9:\t:;\t;<\t<=\t=>\t>","?\t?@\t@","","","","","","\b\b\b\b\b\t\t\t\t","\t\t\t\n\n\n\n\n\v","\v\v\v\v\v\v","\v\v\v\f\f\f\f","\f\f\r\r\r\r\r\r","\r\r\r","","","","","","","","","","","","","","","","",'  !!"',"\"##$$%%&&'","'((((((Ŋ\n())","**++,,---","-------ŝ\n-..","//000ť\n0\f00Ũ\v0","111122ů\n2\r22Ű","22222ŷ\n222ź\n2\r2","2Ż22222Ƃ\n222ƅ","\n2\r22Ɔ2Ɖ\n233ƌ\n3\r3","3ƍ333ƒ\n3\r33Ɠ33","Ɨ\n3\r33Ƙ333Ɲ\n3\f33Ơ","\v333ƣ\n3444Ƨ\n44","4ƪ\n4\r44ƫ555ư\n5\f5","5Ƴ\v555666ƹ\n67","777ƾ\n7778888","99::lj\n:\r::NJ::ǎ","\n:;;<<=====ǘ","\n=>>>>>>>>>",">>>ǥ\n>??????","?@@@@@Dz\n@\f@@ǵ\v","@@@Ǹ\n@@@@@@@ǿ","\n@\f@@Ȃ\v@@@@Ȇ\n@@","@ȀA\t\v","\r\b\t\n\v\f\r","!#%')+","-/13579;=","?AC E!G\"I#K$M%O&Q'S(U)W*Y+[,]-_.a/c0e1gi2k","m3o4qs5uwy{}6","--//'',,11>>@@","C\\aac|2;C\\aac|2;23","GGgg\f\f$$^^\f\f))^",'^\v\v""\f\f',"2;CHch29\n$$))^^ddhhppttvv25Ȟ","","\t","\v\r","","","","","!","#%","')+","-/","13","57","?A","CEG","IK","MO","QS","UW","Y[]","_a","ce","im","os","","‰Ž\t","“\v˜\r","Ÿ£","¨¯","´¾","ÄÍ","ÔØ!","ã#è%ë","'ð)ö","+ý-ă","/ĉ1Ė","3ę5Ğ","7Ĥ9ĩ;ĭ","=ı?Ĵ","AĶCĸ","EĺGļ","IľKŀ","MłOʼnQŋ","SōUŏ","WőYŜ","[Ş]Š","_Ţaũ","cƈeƢgƤ","iƭkƸ","mƺoǁ","qDžsǍ","uǏwǑ","yǗ{Ǥ}Ǧ","ȅ‚","r‚ƒtƒ„","q„…i…†t","†‡c‡ˆo","ˆ‰Št","Š‹g‹ŒcŒ","nŽ","xq‘","k‘’f’\b","“”d”•q","•–q–—n","—\n˜™u™","švš›t›œ","kœpž","iž\fŸ k"," ¡p¡¢v","¢£¤e","¤¥j¥¦c¦","§t§¨","©u©ªyª«","k«¬v¬­","e­®j®","¯°e°±c","±²u²³g","³´µq","µ¶v¶·j·","¸g¸¹t¹º","yº»k»¼","u¼½g½","¾¿e¿Àq","ÀÁpÁÂu","ÂÃvÃ","ÄÅhÅÆwÆ","ÇpÇÈeÈÉ","vÉÊkÊË","qËÌpÌ","ÍÎtÎÏg","ÏÐvÐÑw","ÑÒtÒÓpÓ","ÔÕhÕ","ÖqÖ×t×","ØÙtÙÚ","gÚÛrÛÜ","gÜÝcÝÞv","Þßaßàh","àáqáâtâ"," ãähäå","tåæqæç",'oç"èév',"éêqê$","ëìrìící","îuîïuï&","ðñdñò","tòógóôc","ôõmõ(","ö÷t÷øgø","ùrùúgúû","cûüvü*","ýþwþÿp","ÿĀvĀāk","āĂnĂ,ă","ĄyĄąjąĆ","kĆćnćĈ","gĈ.ĉĊt","ĊċgċČr","ČčgčĎcĎ","ďvďĐaĐđ","yđĒjĒē","kēĔnĔĕg","ĕ0Ėėk","ėĘhĘ2ę","ĚgĚěněĜ","uĜĝgĝ4","ĞğhğĠc","ĠġnġĢu","Ģģgģ6Ĥ","ĥvĥĦtĦħ","wħĨgĨ8","ĩĪpĪīq","īĬvĬ:","ĭĮCĮįPį","İFİ<ıIJ","QIJijTij>","Ĵĵ(ĵ@","Ķķ*ķB","ĸĹ+ĹDĺ","Ļ]ĻFļĽ","_ĽHľĿ","}ĿJŀŁ","ŁLłŃ.","ŃNńŅ>","ŅŊ/ņŇ￿","Ňň￿ňŊ￿","ʼnńʼnņ","ŊPŋŌ\tŌ","RōŎ\tŎT","ŏŐ;ŐV","őŒ=ŒX","œŔ@Ŕŝ?","ŕŖ?Ŗŝ?ŗ","Ř>Řŝ?řŝ","\tŚś#śŝ","?ŜœŜŕ","ŜŗŜř","ŜŚŝZ","Şş<ş\\","Šš9š^","ŢŦ\tţť\t","ŤţťŨ","ŦŤŦŧ","ŧ`ŨŦ","ũŪ_0Ūū0ūŬ","_0Ŭbŭů\t","ŮŭůŰ","ŰŮŰű","űƉŲų2","ųŷzŴŵ2","ŵŷZŶŲ","ŶŴŷŹ","Ÿźu;ŹŸź","ŻŻŹŻ","żżƉŽ","ž2žƂdſƀ","2ƀƂDƁŽ","ƁſƂƄ","ƃƅ\t\bƄƃ","ƅƆƆƄ","ƆƇƇƉ","ƈŮƈŶ","ƈƁƉd","Ɗƌ\tƋƊ","ƌƍƍƋ","ƍƎƎƏ","ƏƑ0Ɛƒ\t","ƑƐƒƓ","ƓƑƓƔ","ƔƣƕƗ\t","ƖƕƗƘ","ƘƖƘƙ","ƙƚƚƞ0","ƛƝ\tƜƛ","ƝƠƞƜ","ƞƟƟơ","Ơƞơƣg4","ƢƋƢƖ","ƣfƤƦ\t\tƥƧ","\tƦƥƦƧ","ƧƩƨƪ","\tƩƨƪƫ","ƫƩƫƬ","ƬhƭƱ","$Ʈưk6ƯƮ","ưƳƱƯ","ƱƲƲƴ","ƳƱƴƵ$","Ƶjƶƹ\n\n","Ʒƹy=ƸƶƸ","Ʒƹlƺ","ƽ)ƻƾy=Ƽƾ\n\v","ƽƻƽƼ","ƾƿƿǀ)","ǀnǁǂ\t\f","ǂǃǃDŽ\b8DŽ","pDždž=džr","LJlj\t\rLjLJ","ljNJNJLj","NJNjNjǎ","njǎq9ǍLj","Ǎnjǎt","Ǐǐ\tǐv","Ǒǒ\tǒxǓ","ǔ^ǔǘ\tǕǘ","}?ǖǘ{>ǗǓ","ǗǕǗǖ","ǘzǙǚ^","ǚǛ\tǛǜw<ǜǝ","w<ǝǥǞǟ","^ǟǠw<Ǡǡw<ǡ","ǥǢǣ^ǣ","ǥw<ǤǙǤǞ","ǤǢǥ|","Ǧǧ^ǧǨ","wǨǩu;ǩǪu;","Ǫǫu;ǫǬu;Ǭ~","ǭǮ1Ǯǯ1","ǯdzǰDz\n\r","DZǰDzǵ","dzDZdzǴ","ǴǷǵdz","ǶǸǷǶ","ǷǸǸǹ","ǹȆ\fǺǻ1ǻ","Ǽ,ǼȀǽ","ǿ\vǾǽǿ","ȂȀȁȀ","ǾȁȃȂ","ȀȃȄ,Ȅ","Ȇ1ȅǭȅ","ǺȆȇȇ","Ȉ\b@Ȉ€","ʼnŜŦŰŶŻƁƆƈƍƓƘ","ƞƢƦƫƱƸƽNJǍǗǤdz","ǷȀȅ\b"].join(""),a=(new i.atn.ATNDeserializer).deserialize(o),r=a.decisionToState.map((function(e,t){return new i.dfa.DFA(e,t)}));function s(e){return i.Lexer.call(this,e),this._interp=new i.atn.LexerATNSimulator(this,a,r,new i.PredictionContextCache),this}s.prototype=Object.create(i.Lexer.prototype),s.prototype.constructor=s,s.EOF=i.Token.EOF,s.RK_PROGRAM=1,s.RK_REAL=2,s.RK_VOID=3,s.RK_BOOLEAN=4,s.RK_STRING=5,s.RK_INTEGER=6,s.RK_CHARACTER=7,s.RK_SWITCH=8,s.RK_CASE=9,s.RK_DEFAULT=10,s.RK_CONST=11,s.RK_FUNCTION=12,s.RK_RETURN=13,s.RK_FOR=14,s.RK_FOR_ALT=15,s.RK_FOR_FROM=16,s.RK_FOR_TO=17,s.RK_FOR_PASS=18,s.RK_BREAK=19,s.RK_DO=20,s.RK_DO_UNTIL=21,s.RK_WHILE=22,s.RK_WHILE_ALT=23,s.RK_IF=24,s.RK_ELSE=25,s.RK_FALSE=26,s.RK_TRUE=27,s.RK_REFERENCE=28,s.OPEN_PARENTHESIS=29,s.CLOSE_PARENTHESIS=30,s.OPEN_BRACE=31,s.CLOSE_BRACE=32,s.OPEN_CURLY=33,s.CLOSE_CURLY=34,s.COMMA=35,s.EQUAL=36,s.SUM_OP=37,s.MULTI_OP=38,s.AND_OPERATOR=39,s.OR_OPERATOR=40,s.RELATIONAL_OPERATOR=41,s.COLON=42,s.NOT_OPERATOR=43,s.ID=44,s.LIB_ID=45,s.INTEGER=46,s.REAL=47,s.STRING=48,s.CHARACTER=49,s.WHITESPACE=50,s.EOS=51,s.COMMENTS=52,s.prototype.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],s.prototype.modeNames=["DEFAULT_MODE"],s.prototype.literalNames=[null,"'program'","'real'","'void'","'bool'","'string'","'int'","'char'","'switch'","'case'","'otherwise'","'const'","'function'","'return'","'for'","'repeat_for'","'from'","'to'","'pass'","'break'","'repeat'","'until'","'while'","'repeat_while'","'if'","'else'","'false'","'true'","'&'","'('","')'","'['","']'","'{'","'}'","','",null,null,null,null,null,null,"':'"],s.prototype.symbolicNames=[null,"RK_PROGRAM","RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER","RK_CHARACTER","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_FOR_ALT","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS","RK_BREAK","RK_DO","RK_DO_UNTIL","RK_WHILE","RK_WHILE_ALT","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_REFERENCE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_BRACE","CLOSE_BRACE","OPEN_CURLY","CLOSE_CURLY","COMMA","EQUAL","SUM_OP","MULTI_OP","AND_OPERATOR","OR_OPERATOR","RELATIONAL_OPERATOR","COLON","NOT_OPERATOR","ID","LIB_ID","INTEGER","REAL","STRING","CHARACTER","WHITESPACE","EOS","COMMENTS"],s.prototype.ruleNames=["RK_PROGRAM","RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER","RK_CHARACTER","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_FOR_ALT","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS","RK_BREAK","RK_DO","RK_DO_UNTIL","RK_WHILE","RK_WHILE_ALT","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_LOGICAL_NOT","RK_LOGICAL_AND","RK_LOGICAL_OR","RK_REFERENCE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_BRACE","CLOSE_BRACE","OPEN_CURLY","CLOSE_CURLY","COMMA","EQUAL","SUM_OP","MULTI_OP","AND_OPERATOR","OR_OPERATOR","RELATIONAL_OPERATOR","COLON","NOT_OPERATOR","ID","LIB_ID","INTEGER","REAL","ExponentPart","STRING","STRING_CHARACTER","CHARACTER","WHITESPACE","SEMICOLON","EOS","HEX_DIGIT","OCTAL_DIGIT","ESC_SEQ","ESC_OCTAL","ESC_UNICODE","COMMENTS"],s.prototype.grammarFileName="ivprog.g4",t.ivprog=s},function(e,t,n){e.exports={ivprog:n(0).ivprog}},function(e,t){e.exports=n(24)}])},function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t,n){var i=n(2),o=["悋Ꜫ脳맭䅼㯧瞆奤","0ǥ\b\t\t","\t\t\t\t","\b\t\b\t\t\t\n\t\n\v\t\v","\f\t\f\r\t\r\t\t","\t\t\t\t","\t\t\t","\t\t\t\t","\t\t\t",'\t\t \t !\t!"\t"#',"\t#$\t$%\t%&\t&'\t'(\t()\t)","*\t*+\t+,\t,-\t-.\t./\t/0\t0","1\t12\t23\t34\t45\t56\t67\t7","8\t89\t9:\t:","","","","","","","\b\b\b\b\b","\b\b\b\b\b\t\t\t\t","\t\t\t\t\n\n\n\n\n","\v\v\v\v\v\v","\v\v\v\v\f\f\f","\f\f\f\r\r\r\r\r\r","\r","","","","","","","","","","","","",'  !!""','""""Ħ\n"##$$',"%%&&'''''","'''''Ĺ\n'(()",")***Ł\n*\f**ń\v*+","+++,,ŋ\n,\r,,Ō,",",,,,œ\n,,,Ŗ\n,\r,,ŗ",",,,,,Ş\n,,,š\n,","\r,,Ţ,ť\n,--Ũ\n-\r--ũ","---Ů\n-\r--ů--ų\n","-\r--Ŵ---Ź\n-\f--ż\v","---ſ\n-...ƃ\n..",".Ɔ\n.\r..Ƈ///ƌ\n/\f//Ə","\v///000ƕ\n011","11ƚ\n11122223","344ƥ\n4\r44Ʀ44ƪ\n4","556677777ƴ\n7","8888888888","88ǁ\n89999999",":::::ǎ\n:\f::Ǒ\v:","::ǔ\n:::::::Ǜ\n",":\f::Ǟ\v::::Ǣ\n::",":ǜ;\t\v","\r\b\t\n\v\f\r","!#%')+","-/13579;=","?AC E!G\"I#K$M%O&Q'S(U)W*Y+[],_a-c.e","g/ikmoqs0","--//'',,11>>@@C\\aac|","2;C\\aac|2;23GGgg\f","\f$$^^\f\f))^^\v",'\v""\f\f2;CHch',"29\n$$))^^ddhhppttvv25Ǻ","","\t\v","\r","","","","","!#","%'",")+","35","79;","=?","AC","EG","IK","MOQ","SU","WY","]a","cg","su~","ƒ\t‰","\v\r—","Ÿ©","±¶","ÀÆ","ÍÕ","Ú!ß","#ä%í","'ð)ö","+ü-ć","/ċ1č3Đ","5Ē7Ĕ","9Ė;Ę","=Ě?Ĝ","AĞCĥ","EħGĩIī","KĭMĸ","OĺQļ","SľUŅ","WŤYž","[ƀ]Ɖ_Ɣ","aƖcƝ","eơgƩ","iƫkƭ","mƳoǀ","qǂsǡuv","rvwtwxqxyi","yztz{c{|o","|}c}~t","€g€c","‚n‚","ƒ„x„…c…","†|†‡k‡ˆ","qˆ\b‰Š","nŠ‹q‹Œi","ŒkŽe","Žq\n","‘e‘’c’“","f“”g”•","k•–c–\f","—˜k˜™p","™švš›g›","œkœtž","qžŸ ","e ¡c¡¢","t¢£c£¤e","¤¥v¥¦g","¦§t§¨g¨","©ªgª","«u«¬e¬­","q­®n®¯","j¯°c°","±²e²³c","³´u´µq","µ¶·e","·¸q¸¹p¹","ºvº»t»¼","c¼½t½¾","k¾¿q¿","ÀÁeÁÂq","ÂÃpÃÄu","ÄÅvÅ","ÆÇhÇÈwÈ","ÉpÉÊeÊË","cËÌqÌ","ÍÎtÎÏ","gÏÐvÐÑq","ÑÒtÒÓp","ÓÔgÔ","ÕÖrÖ×c×","ØtØÙcÙ","ÚÛrÛÜ","cÜÝtÝÞ","gÞ ßàh","àácáâe",'âãcã"ä',"ågåæpæç","sçèwèé","céêpêëv","ëìqì$","íîuîïgï","&ðñuñò","gòópóô","côõqõ(","ö÷h÷øc","øùnùúuú","ûqû*üý","xýþgþÿ","tÿĀfĀāc","āĂfĂăg","ăĄkĄątą","ĆqĆ,ćĈ","pĈĉcĉĊ","qĊ.ċČG","Č0čĎQ","ĎďWď2Đ","đ(đ4Ēē","*ē6Ĕĕ","+ĕ8Ėė]","ė:Ęę_","ę<Ěě}ě",">Ĝĝĝ","@Ğğ.ğB","Ġġ>ġĦ","/Ģģ￿ģĤ","￿ĤĦ￿ĥĠ","ĥĢĦD","ħĨ\tĨF","ĩĪ\tĪH","īĬ/ĬJ","ĭĮ1ĮLį","İ@İĹ?ıIJ","?IJĹ?ijĴ",">ĴĹ?ĵĹ\t","Ķķ#ķĹ?","ĸįĸı","ĸijĸĵ","ĸĶĹN","ĺĻ<ĻPļ","Ľ-ĽRľł","\tĿŁ\tŀĿ","Łńłŀ","łŃŃT","ńłŅņ","S*ņŇ0ŇňS*ň","Vʼnŋ\tŊʼn","ŋŌŌŊ","Ōōōť","Ŏŏ2ŏœ","zŐő2őœ","ZŒŎŒŐ","œŕŔŖ","i5ŕŔŖŗ","ŗŕŗŘ","ŘťřŚ2","ŚŞdśŜ2","ŜŞDŝř","ŝśŞŠ","şš\t\bŠş","šŢŢŠ","Ţţţť","ŤŊŤŒ","ŤŝťX","ŦŨ\tŧŦ","Ũũũŧ","ũŪŪū","ūŭ0ŬŮ\tŭ","ŬŮůů","ŭůŰŰ","ſűų\tŲ","űųŴŴ","ŲŴŵŵ","ŶŶź0ŷ","Ź\tŸŷŹ","żźŸź","ŻŻŽż","źŽſ[.žŧ","žŲſZ","ƀƂ\t\tƁƃ\t","ƂƁƂƃ","ƃƅƄƆ\t","ƅƄƆƇ","ƇƅƇƈ","ƈ\\Ɖƍ$","Ɗƌ_0ƋƊ","ƌƏƍƋ","ƍƎƎƐ","ƏƍƐƑ$","Ƒ^ƒƕ\n\nƓƕ","m7ƔƒƔƓ","ƕ`Ɩƙ",")Ɨƚm7Ƙƚ\n\v","ƙƗƙƘ","ƚƛƛƜ)","ƜbƝƞ\t\fƞƟ","ƟƠ\b2Ơd","ơƢ=Ƣf","ƣƥ\t\rƤƣ","ƥƦƦƤ","ƦƧƧƪ","ƨƪe3ƩƤƩ","ƨƪhƫ","Ƭ\tƬjƭƮ","\tƮlƯư","^ưƴ\tƱƴq9","Ʋƴo8ƳƯƳ","ƱƳƲƴ","nƵƶ^ƶƷ","\tƷƸk6Ƹƹk6","ƹǁƺƻ^","ƻƼk6Ƽƽk6ƽǁ","ƾƿ^ƿǁ","k6ǀƵǀƺ","ǀƾǁp","ǂǃ^ǃDŽw","DŽDži5Dždži5džLJ","i5LJLji5Ljr","ljNJ1NJNj1Nj","Ǐnjǎ\n\rǍnj","ǎǑǏǍ","ǏǐǐǓ","ǑǏǒǔ","ǓǒǓǔ","ǔǕǕǢ","\fǖǗ1Ǘǘ",",ǘǜǙǛ\v","ǚǙǛǞ","ǜǝǜǚ","ǝǟǞǜ","ǟǠ,ǠǢ","1ǡljǡǖ","ǢǣǣǤ\b",":Ǥtĥĸ","łŌŒŗŝŢŤũůŴźž","ƂƇƍƔƙƦƩƳǀǏǓǜ","ǡ\b"].join(""),a=(new i.atn.ATNDeserializer).deserialize(o),r=a.decisionToState.map((function(e,t){return new i.dfa.DFA(e,t)}));function s(e){return i.Lexer.call(this,e),this._interp=new i.atn.LexerATNSimulator(this,a,r,new i.PredictionContextCache),this}s.prototype=Object.create(i.Lexer.prototype),s.prototype.constructor=s,s.EOF=i.Token.EOF,s.RK_PROGRAM=1,s.RK_REAL=2,s.RK_VOID=3,s.RK_BOOLEAN=4,s.RK_STRING=5,s.RK_INTEGER=6,s.RK_CHARACTER=7,s.RK_SWITCH=8,s.RK_CASE=9,s.RK_DEFAULT=10,s.RK_CONST=11,s.RK_FUNCTION=12,s.RK_RETURN=13,s.RK_FOR=14,s.RK_BREAK=15,s.RK_DO=16,s.RK_WHILE=17,s.RK_IF=18,s.RK_ELSE=19,s.RK_FALSE=20,s.RK_TRUE=21,s.RK_REFERENCE=22,s.OPEN_PARENTHESIS=23,s.CLOSE_PARENTHESIS=24,s.OPEN_BRACE=25,s.CLOSE_BRACE=26,s.OPEN_CURLY=27,s.CLOSE_CURLY=28,s.COMMA=29,s.EQUAL=30,s.SUM_OP=31,s.MULTI_OP=32,s.AND_OPERATOR=33,s.OR_OPERATOR=34,s.RELATIONAL_OPERATOR=35,s.COLON=36,s.NOT_OPERATOR=37,s.ID=38,s.LIB_ID=39,s.INTEGER=40,s.REAL=41,s.STRING=42,s.CHARACTER=43,s.WHITESPACE=44,s.EOS=45,s.COMMENTS=46,s.prototype.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],s.prototype.modeNames=["DEFAULT_MODE"],s.prototype.literalNames=[null,"'programa'","'real'","'vazio'","'logico'","'cadeia'","'inteiro'","'caractere'","'escolha'","'caso'","'contrario'","'const'","'funcao'","'retorne'","'para'","'pare'","'faca'","'enquanto'","'se'","'senao'","'falso'","'verdadeiro'","'&'","'('","')'","'['","']'","'{'","'}'","','",null,null,null,null,null,null,"':'"],s.prototype.symbolicNames=[null,"RK_PROGRAM","RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER","RK_CHARACTER","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_BREAK","RK_DO","RK_WHILE","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_REFERENCE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_BRACE","CLOSE_BRACE","OPEN_CURLY","CLOSE_CURLY","COMMA","EQUAL","SUM_OP","MULTI_OP","AND_OPERATOR","OR_OPERATOR","RELATIONAL_OPERATOR","COLON","NOT_OPERATOR","ID","LIB_ID","INTEGER","REAL","STRING","CHARACTER","WHITESPACE","EOS","COMMENTS"],s.prototype.ruleNames=["RK_PROGRAM","RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER","RK_CHARACTER","RK_SWITCH","RK_CASE","RK_DEFAULT","RK_CONST","RK_FUNCTION","RK_RETURN","RK_FOR","RK_BREAK","RK_DO","RK_WHILE","RK_IF","RK_ELSE","RK_FALSE","RK_TRUE","RK_LOGICAL_NOT","RK_LOGICAL_AND","RK_LOGICAL_OR","RK_REFERENCE","OPEN_PARENTHESIS","CLOSE_PARENTHESIS","OPEN_BRACE","CLOSE_BRACE","OPEN_CURLY","CLOSE_CURLY","COMMA","EQUAL","SUM_OP","MULTI_OP","AND_OPERATOR","OR_OPERATOR","RELATIONAL_OPERATOR","COLON","NOT_OPERATOR","ID","LIB_ID","INTEGER","REAL","ExponentPart","STRING","STRING_CHARACTER","CHARACTER","WHITESPACE","SEMICOLON","EOS","HEX_DIGIT","OCTAL_DIGIT","ESC_SEQ","ESC_OCTAL","ESC_UNICODE","COMMENTS"],s.prototype.grammarFileName="ivprog.g4",t.ivprog=s},function(e,t,n){e.exports={ivprog:n(0).ivprog}},function(e,t){e.exports=n(24)}])},function(e){e.exports=JSON.parse('{"version":"2020_01_21 15_00"}')},,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Type=class{constructor(e,t){this.value=e,this.ord=t}stringInfo(){return[{type:this.value,dim:0}]}isCompatible(e){return this.value===e.value&&this.ord===e.ord}}},function(e,t){e.exports={pt:{test_case_success:"
Caso de teste $0: OK
",test_case_duration:"Levou $0ms",test_suite_grade:"A sua solução alcançou $0% da nota.",awaiting_input_message:"O seu programa está em execução e aguardando uma entrada! Digite algo e pressione ENTER...","assessment-empty-expected-tooltip":"A saída gerada foi além do esperado","assessment-empty-generated-tooltip":"O programa não gerou saídas suficientes",testcase_autogen_unused_input:"O caso de teste $0 possui mais entradas do que as leituras feitas no programa.",testcase_autogen_empty:"O caso de teste $0 não gerou qualquer saída.",success_execution:"Programa executado com sucesso!",aborted_execution:"A execução do programa foi interrompida!",unexpected_execution_error:"Erro inesperado durante a execução do programa."},en:{test_case_success:"
Test case $0: OK
",test_case_duration:"Took $0ms",test_suite_grade:"Your solution scored $0% of the grade.",awaiting_input_message:"Your program is running and awaiting for an input. Type something and press ENTER…","assessment-empty-expected-tooltip":"The generated output was beyond the amount expected","assessment-empty-generated-tooltip":"The program did not generate enough outputs",testcase_autogen_unused_input:"The test case $0 has more inputs than output than the number of reads present in the algorithm.",testcase_autogen_empty:"The test case $0 did not generate any output.",success_execution:"Program executed successfully!",aborted_execution:"Program execution was aborted!",unexpected_execution_error:"Unexpected error during program execution."},es:{test_case_success:" ",test_case_duration:" ",test_suite_grade:" ",awaiting_input_message:" ","assessment-empty-expected-tooltip":" ","assessment-empty-generated-tooltip":" ",testcase_autogen_unused_input:" ",testcase_autogen_empty:" ",success_execution:"",aborted_execution:"",unexpected_execution_error:""}}},function(e,t){e.exports={pt:{function:"funcao",btn_clear:"Limpar",btn_function:"Função",btn_arithmetic_plus:"Adição",btn_arithmetic_minus:"Subtração",btn_arithmetic_multiplication:"Multiplicação",btn_arithmetic_division:"Divisão",btn_arithmetic_module:"Módulo",btn_break:"Pare",btn_case:"Caso",start:"inicio",type_void:"vazio",type_integer:"inteiro",logic_operator_and:"E",logic_operator_or:"OU",logic_operator_not:"nao",type_real:"real",program:"programa",type_text:"cadeia",textvar_default_value:"texto",type_boolean:"logico",logic_value_true:"verdadeiro",logic_value_false:"falso",variable:"Variável",command:"Comando",new_parameter:"parametro",new_variable:"variavel",new_global:"global",new_function:"nova_funcao",matrix:"matriz",vector:"vetor",text_comment_start:"Comentário inicial da função...",text_comment_main:"Esta é a função principal...",text_read_var:"Entrada/Leitura de dados",text_write_var:"Saída/Escrita de dados",text_command_read:"leia",text_command_write:"escreva",text_return:"devolva",text_btn_return:"Devolver",text_comment:"Comentário",string_join_or:"ou",matrix_info_string:"matriz de $0",vector_info_string:"vetor de $0",text_attribution:"Atribuição",text_if:"se",text_break:"pare",text_else:"senao",text_for:"repita_para",text_code_while:"repita_enquanto",text_code_do:"repita",text_code_do_until:"ate_que",text_command_do:"repita",text_command_while:"repita enquanto",text_command_do_until:"até que",text_code_switch:"escolha",text_code_case:"caso",text_config_programming:"Programação",text_config_programming_both:"Visual e textual",text_config_programming_textual:"Textual",text_config_programming_visual:"Visual",text_logic_expression:"Lógicos",text_arithmetic_expression:"Aritméticos",text_iftrue:"Se verdadeiro então",text_message_error_activity_file:"Aconteceu um erro ao processar a atividade.
Recarregue a página para tentar novamente.",text_message_error_activity_reload:"Recarregar",text_repeatNtimes:"Repita N vezes",text_receives:"recebe",text_whiletrue:"Enquanto verdadeiro",text_dowhiletrue:"Repita até que verdadeiro",text_switch:"Escolha",text_functioncall:"Chamada de função",text_value:"Valor",text_operator:"Operador",text_parentheses:"Parênteses",text_change:"Alterar",text_teacher_algorithm:"Algoritmo",text_teacher_algorithm_include:"Incluir o algoritmo abaixo no exercício",text_teacher_test_case:"Casos de teste",text_teacher_config:"Configurações",text_teacher_data_types:"Tipos de dados",text_teacher_commands:"Comandos",text_teacher_functions:"Funções",text_teacher_create_functions:"Criar novas funções",text_teacher_create_movement_functions:"Movimentar funções",text_teacher_test_case_input:"Entrada",text_teacher_test_case_output:"Saída",text_teacher_test_case_actions:"Ações",text_teacher_test_case_add:"Adicionar caso de teste",text_header_ivprog_functions:"Funções do iVProg",text_menu_functions_math:"Matemática",text_menu_functions_text:"Texto",text_menu_functions_array:"Arranjo",text_menu_functions_conversion:"Conversão",text_no_variable:"Nenhuma variável declarada",text_no_variable_instruction:"Antes de utilizar uma variável, é necessário criá-la",text_ivprog_description:"Programação Visual interativa na Internet",tooltip_visual:"Programação visual",tooltip_textual:"Programação textual",tooltip_upload:"Upload de código fonte",tooltip_download:"Download do código fonte",tooltip_undo:"Desfazer",tooltip_redo:"Refazer",tooltip_run:"Executar o programa",tooltip_evaluate:"Avaliar o programa",tooltip_help:"Ajuda",tooltip_add_global:"Adicionar variável global",tooltip_hide_function:"Ocultar os elementos da função",var_menu_select_var:"Selecione uma variável",var_menu_select_all:"Selecione",var_menu_select_function:"Selecione uma função",expression_menu_select:"Construir uma expressão lógica",inform_valid_content:"Informe o conteúdo!",inform_valid_expression:"Construa uma expressão lógica!",tooltip_terminal_clear:"Limpa o terminal removendo todos os textos já escritos e os pendentes.",tooltip_terminal_show:"Exibe o terminal caso esteja escondido",tooltip_terminal_hide:"Esconde o terminal caso não esteja escondido",text_ivprog_version:"Versão",text_teacher_filter:"Filtro",text_teacher_filter_active:"Ativado",text_teacher_filter_help:"Ao ativar o filtro, as modificações do iVProg estarão bloqueadas.",text_join_assessment_outputs:" ; ","assessment-detail-time-label":"Duração","assessment-detail-grade-label":"Nota","assessment-detail-input-label":"Entradas","assessment-detail-output-label":"Saídas","assessment-detail-expected-label":"Esperava","assessment-detail-generated-label":"Gerou","assessment-detail-result-label":"Resultado","assessment-detail-title":"Caso de Teste $0",text_teacher_generate_outputs:"Gerar saídas",text_teacher_generate_outputs_algorithm:"Antes de gerar as saídas, elabore um algoritmo!",text_code_for_from:"de",text_code_for_to:"ate",text_code_for_pass:"passo",text_for_from:"de",text_for_to:"até",text_for_pass:"passo",text_relational_expression:"Relacionais",initial_program_code:"programa {\\n\\n\\t\\tfuncao vazio inicio () {\\n\\t\\t\\t// Inicie seu codigo aqui!\\n\\t\\t}\\n}"},en:{function:"function",btn_clear:"Clean",btn_function:"Function",btn_arithmetic_plus:"Addition",btn_arithmetic_minus:"Subtraction",btn_arithmetic_multiplication:"Multiplication",btn_arithmetic_division:"Division",btn_arithmetic_module:"Remainder",btn_break:"break",btn_case:"Case",start:"main",type_void:"void",type_integer:"int",logic_operator_and:"AND",logic_operator_or:"OR",logic_operator_not:"not",type_real:"real",program:"program",type_text:"string",textvar_default_value:"text",type_boolean:"bool",logic_value_true:"true",logic_value_false:"false",variable:"Variable",command:"Command",new_parameter:"parameter",new_variable:"variable",new_global:"global",new_function:"new_function",matrix:"matrix",vector:"vector",text_comment_start:"Function initial comment",text_comment_main:"This is the main funcion",text_read_var:"Input/Read data",text_write_var:"Output/Write data",text_command_read:"read",text_command_write:"write",text_return:"return",text_btn_return:"Return",text_comment:"Comment",string_join_or:"or",matrix_info_string:"matrix of $0",vector_info_string:"vector of $0",text_attribution:"Assignment",text_if:"if",text_break:"break",text_else:"else",text_for:"repeat_for",text_code_while:"repeat_while",text_code_do:"repeat",text_code_do_until:"until",text_command_do:"repeat",text_command_while:"repeat while",text_command_do_until:"until",text_code_switch:"switch",text_code_case:"case",text_config_programming:"Programming",text_config_programming_both:"Visual & Textual",text_config_programming_textual:"Textual",text_config_programming_visual:"Visual",text_logic_expression:"Logic",text_arithmetic_expression:"Arithmetics",text_iftrue:"If true then",text_message_error_activity_file:"There was an error processing the activity.
Reload the page to try again.",text_message_error_activity_reload:"Reload",text_repeatNtimes:"Repeat N times",text_receives:"receives",text_whiletrue:"While true",text_dowhiletrue:"Repeat until true",text_switch:"Switch",text_functioncall:"Function call",text_value:"Value",text_operator:"Operator",text_parentheses:"Parentheses",text_change:"Modify",text_teacher_algorithm:"Algorithm",text_teacher_algorithm_include:"Include the algorithm below in the activity",text_teacher_test_case:"Test cases",text_teacher_config:"Configurations",text_teacher_data_types:"Data types",text_teacher_commands:"Commands",text_teacher_functions:"Functions",text_teacher_create_functions:"Create new functions",text_teacher_create_movement_functions:"Move functions",text_teacher_test_case_input:"Input",text_teacher_test_case_output:"Output",text_teacher_test_case_actions:"Actions",text_teacher_test_case_add:"Add test case",text_header_ivprog_functions:"iVProg Functions",text_menu_functions_math:"Math",text_menu_functions_text:"Text",text_menu_functions_array:"Array",text_menu_functions_conversion:"Conversion",text_no_variable:"No variable declared",text_no_variable_instruction:"Before using a variable, you need to create it",text_ivprog_description:"Interactive and Visual Programming on the Internet",tooltip_visual:"Visual programming",tooltip_textual:"Textual programming",tooltip_upload:"Upload source code",tooltip_download:"Download source code",tooltip_undo:"Undo",tooltip_redo:"Redo",tooltip_run:"Run the program",tooltip_evaluate:"Evaluate the program",tooltip_help:"Help",tooltip_add_global:"Add a global variable",tooltip_hide_function:"Hide function elements",var_menu_select_var:"Select a variable",var_menu_select_all:"Select",var_menu_select_function:"Select a function",expression_menu_select:"Construct a logic expression",inform_valid_content:"Provide some data",inform_valid_expression:"Construct a logic expression",tooltip_terminal_clear:"Clears the terminal by removing all wrriten and pending text.",tooltip_terminal_show:"Shows the terminal if it is hidden",tooltip_terminal_hide:"Hides the terminal if it is not on display",text_ivprog_version:"Version",text_teacher_filter:"Filter",text_teacher_filter_active:"Activated",text_teacher_filter_help:"By activating the filter modifications in iVProg will be blocked",text_join_assessment_outputs:" ; ","assessment-detail-time-label":"Duration","assessment-detail-grade-label":"Grade","assessment-detail-input-label":"Inputs","assessment-detail-output-label":"Outputs","assessment-detail-expected-label":"Expected","assessment-detail-generated-label":"Generated","assessment-detail-result-label":"Result","assessment-detail-title":"Test Case $0",text_teacher_generate_outputs:"Generate outputs",text_teacher_generate_outputs_algorithm:"Before generating the outputs you need to create an algorithm",text_code_for_from:"from",text_code_for_to:"to",text_code_for_pass:"pass",text_for_from:"from",text_for_to:"to",text_for_pass:"pass",text_relational_expression:"Relational",initial_program_code:"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}"},es:{function:"funccion",btn_clear:"",btn_function:"",btn_arithmetic_plus:"",btn_arithmetic_minus:"",btn_arithmetic_multiplication:"",btn_arithmetic_division:"",btn_arithmetic_module:"",btn_break:"",btn_case:"",start:"",type_void:"",type_integer:"",logic_operator_and:"",logic_operator_or:"",logic_operator_not:"",type_real:"",program:"",type_text:"",textvar_default_value:"",type_boolean:"",logic_value_true:"",logic_value_false:"",variable:"",command:"",new_parameter:"",new_variable:"",new_global:"",new_function:"",matrix:"",vector:"",text_comment_start:"",text_comment_main:"",text_read_var:"",text_write_var:"",text_command_read:"",text_command_write:"",text_return:"",text_btn_return:"",text_comment:"",string_join_or:"",matrix_info_string:"",vector_info_string:"",text_attribution:"",text_if:"",text_break:"",text_else:"",text_for:"",text_code_while:"",text_code_do:"",text_code_do_until:"",text_command_do:"",text_command_while:"",text_command_do_until:"",text_code_switch:"",text_code_case:"",text_config_programming:"",text_config_programming_both:"",text_config_programming_textual:"",text_config_programming_visual:"",text_logic_expression:"",text_arithmetic_expression:"",text_iftrue:"",text_message_error_activity_file:"",text_message_error_activity_reload:"",text_repeatNtimes:"",text_receives:"",text_whiletrue:"",text_dowhiletrue:"",text_switch:"",text_functioncall:"",text_value:"",text_operator:"",text_parentheses:"",text_change:"",text_teacher_algorithm:"",text_teacher_algorithm_include:"",text_teacher_test_case:"",text_teacher_config:"",text_teacher_data_types:"",text_teacher_commands:"",text_teacher_functions:"",text_teacher_create_functions:"",text_teacher_create_movement_functions:"",text_teacher_test_case_input:"",text_teacher_test_case_output:"",text_teacher_test_case_actions:"",text_teacher_test_case_add:"",text_header_ivprog_functions:"",text_menu_functions_math:"",text_menu_functions_text:"",text_menu_functions_array:"",text_menu_functions_conversion:"",text_no_variable:"",text_no_variable_instruction:"",text_ivprog_description:"",tooltip_visual:"",tooltip_textual:"",tooltip_upload:"",tooltip_download:"",tooltip_undo:"",tooltip_redo:"",tooltip_run:"",tooltip_evaluate:"",tooltip_help:"",tooltip_add_global:"",tooltip_hide_function:"",var_menu_select_var:"",var_menu_select_all:"",var_menu_select_function:"",expression_menu_select:"",inform_valid_content:"",inform_valid_expression:"",tooltip_terminal_clear:"",tooltip_terminal_show:"",tooltip_terminal_hide:"",text_ivprog_version:"",text_teacher_filter:"",text_teacher_filter_active:"",text_teacher_filter_help:"",text_join_assessment_outputs:"","assessment-detail-time-label":"","assessment-detail-grade-label":"","assessment-detail-input-label":"","assessment-detail-output-label":"","assessment-detail-expected-label":"","assessment-detail-generated-label":"","assessment-detail-result-label":"","assessment-detail-title":"",text_teacher_generate_outputs:"",text_teacher_generate_outputs_algorithm:"",text_code_for_from:"",text_code_for_to:"",text_code_for_pass:"",text_for_from:"",text_for_to:"",text_for_pass:"",text_relational_expression:"",initial_program_code:""}}},function(e,t){e.exports={pt:{token_missing_one:"Erro de sintaxe: Espera-se $0, mas encontrou-se $1 na linha:$2, coluna:$3",token_missing_two:"Erro de sintaxe: Esperava-se $0 ou $1 mas encontrou-se $2 na liha:$3, coluna: $4",eos_missing:"Falta uma nova linha ou ; na linha: $0, coluna: $1",invalid_type:"$0 na linha: $1, coluna: $2 é um tipo inválido. Os tipos válidos são: $3",invalid_array_dimension:"A dimensão inválida na linha: $0, coluna: $1. Insira um $2 ou identificador válido do mesmo tipo.",invalid_array_size:"O tamnho do vetor/matriz excede o máximo de 2 na linha $0",extra_lines:"Nenhum texto é permitido após '}' em 'programa {...}'",invalid_main_return:"A função $0 declarada na linha $2 deve retornar $1.",invalid_var_declaration:"Erro na linha $0: variáveis só podem ser declaradas no corpo principal da função e nas primeiras linhas, antes de qualquer comando.",invalid_break_command:"Erro na linha $0. O comando $1 não pode ser usado fora de uma estrutura de repetição ou 'escolha...caso'",invalid_terminal:"Não é possível utilizar $0 na expressão da linha: $1, coluna: $2. Tente um valor númerico, variável ou chamada de função.",const_not_init:"Erro na linha: $0, coluna: $1. Uma variável declarada como const deve ser inicializada",id_missing:"Esperava-se um identificador, mas encontrou-se $0 na linha: $1, coluna: $2",invalid_id_format:"$0 na linha: $1, coluna: $2 não é um identificador válido. O símbolo '.' não é permitido neste contexto.",main_missing:"A função principal não foi encontrada",invalid_global_var:"Erro crítico: Chamada inválida da função initGlobal fora do contexto BASE",not_implemented:"Erro interno crítico: A função definida pelo sistema $0 não foi implementada.",function_missing:"A função $0 não foi encontrada",function_missing_full:"A função $0 na linha: $1, coluna: $2 não foi encontrada",invalid_parameters_size_full:"Erro na linha $0: a quantidade de parâmetros fornecidos à função $1 está incorreta. Esperava-se $2, encontrou-se $3.",invalid_parameters_size:"A quantidade de parâmetros fornecidos à função $0 está incorreta. Esperava-se $1, encontrou-se $2",invalid_ref_full:"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é válida para esta função. Use uma variável ou posição de vetor.",invalid_ref:"A expressão $0 fornecida como parâmetro para a função $1 não é válida para esta função. Use uma variável ou posição de vetor.",invalid_parameter_type_full:"A expressão $0 fornecida como parâmetro para a função $1 na linha $2 não é compatível com o tipo esperado.",invalid_parameter_type:"A expressão $0 fornecida como parâmetro para a função $1 não é compatível com o tipo esperado.",unknown_command_full:"Erro interno crítico: comando desconhecido encontrado na linha $0",unknown_command:"Erro interno crítico: comando desconhecido encontrado!",loop_condition_type_full:"Erro na linha: $0, coluna $1: a condição $2 do laço de repetição deve ser do tipo lógico",loop_condition_type:"A condição $0 do laço de repetição deve ser do tipo lógico",endless_loop_full:"Possível laço infinito detectado no seu código. Verifique a linha $0",endless_loop:"Possível laço infinito detectado no seu código.",for_condition_type_full:"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico",for_condition_type:"A condição de parada $0 do comando para(...) deve ser do tipo lógico",if_condition_type_full:"Erro na linha: $0, coluna $1: a condição $2 do comando se...senao deve ser do tipo lógico",if_condition_type:"A condição $0 do comando se...senao deve ser do tipo lógico",invalid_return_type_full:"Erro na linha $0: a expressão não produz um tipo compatível com a função $1. Tipo esperado: $2.",invalid_return_type:"A expressão não produz um tipo compatível com a função $0. Tipo esperado: $1.",invalid_void_return_full:"Erro na linha $0: a função $1 não pode retornar uma expressão vazia, use uma espressão do tipo $2",invalid_void_return:"A função $0 não pode retornar uma expressão vazia, use uma espressão do tipo $1",unexpected_break_command_full:"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso na linha $0",unexpected_break_command:"Erro interno crítico: comando pare encontrado fora do contexto de um laço/escolha..caso",invalid_dimension:"As dimensões de um vetor/matriz devem ser do tipo inteiro",void_in_expression_full:"Erro na linha: $0, coluna: $1: a função $2 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio",void_in_expression:"A função $0 não pode ser utilizada em uma expressão pois seu tipo de retorno é vazio",invalid_array_access_full:"Identificador $0 na linha: $1, coluna: $2 não se refere a um vetor/matriz válido",invalid_array_access:"Identificador $0 não se refere a um vetor/matriz válido",invalid_matrix_access_full:"Identificador $0 na linha: $1, coluna: $2 não se refere a uma matriz válida",invalid_matrix_access:"Identificador $0 não se refere a uma matriz válida",matrix_column_outbounds_full:"Erro na linha $0: número de colunas $1 é inválido para a matriz $2 que possui $3 colunas",matrix_column_outbounds:"Número de colunas $0 é inválido para a matriz $1 que possui $2 colunas",matrix_line_outbounds_full:"Erro na linha $0: número de linhas $1 é inválido para a matriz $2 que possui $3 linhas",matrix_line_outbounds:"Número de linhas $0 é inválido para a matriz $1 que possui $2 linhas",vector_line_outbounds_full:"Erro na linha $0: O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.",vector_line_outbounds:"O número de elementos $1 é inválido para a vetor $2 que possui $3 elementos.",vector_not_matrix_full:"Erro na linha $0: $1 não é uma matriz",vector_not_matrix:"$0 não é uma matriz",invalid_infix_op_full:"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado aos tipos $3 e $4",invalid_infix_op:"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado aos tipos $2 e $3",invalid_unary_op_full:"Erro na linha $0: a expressão $1 é inválida, pois o operador $2 não pode ser aplicado ao tipo $3",invalid_unary_op:"A expressão $0 é inválida, pois o operador $1 não pode ser aplicado ao tipo $2",unknown_op:"Erro interno crítico: Operação $0 desconhecida",duplicate_function:"A função $0 na linha: $1, coluna: $2 já foi definida anteriormente.",duplicate_variable:"A variável $0 na linha: $1, coluna: $2 já foi declarada anteriormente.",main_parameters:"A função inicio não pode ter parâmetros.",symbol_not_found_full:"A variável $0 na linha: $1, coluna: $2 não foi declarada",symbol_not_found:"A variável $0 não foi declarada",array_dimension_not_int_full:"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser do tipo inteiro.",array_dimension_not_int:"As dimensões de um arranjo (vetor ou matriz) devem ser do tipo inteiro.",array_dimension_not_positive_full:"As dimensões do arranjo (vetor ou matriz) na linha $0 devem ser valores positivos.",array_dimension_not_positive:"As dimensões de um arranjo (vetor ou matriz) devem ser valores positivos.",incompatible_types_full:"Era esperado um $0 mas a expressão $1 na linha $2 resulta em $3.",incompatible_types:"Era esperado um $0 mas a expressão $1 resulta em $2.",incompatible_types_array_full:"A expressão $0 na linha $2 é incompatível com o tipo $1.",incompatible_types_array:"A expressão $0 é incompatível com o tipo $1.",invalid_case_type_full:"O caso $0 na linha $1 é incompatível com o tipo $2.",invalid_case_type:"O caso $0 é incompatível com o tipo $1.",function_no_return:"A função $0 não possui um comando de devolução acessível. Toda função deve ter ao menos um comando 'devolva' no seu corpo principal.",invalid_array_literal_type_full:"Erro na linha $0: a expressão $1 não resulta em um tipo compatível.",invalid_array_literal_type:"A expressão $0 não resulta em um tipo compatível.",invalid_array_literal_line_full:"Erro na linha $0: esperava-se $1 linhas mas encontrou $2.",invalid_array_literal_line:"Esperava-se $0 linhas mas encontrou $1.",invalid_array_literal_column_full:"Erro na linha $0: esperava-se $1 colunas mas encontrou $2.",invalid_array_literal_column:"Esperava-se $0 colunas mas encontrou $1.",exceeded_input_request:"A quantidade de leituras requisitadas execedeu a quantidade de entradas disponíveis.",test_case_few_reads:"Caso de teste $0 falhou: ainda restam entradas!",test_case_failed:"
Caso de teste $0 não executou com sucesso.
",test_case_failed_exception:"
Caso de teste $0 falhou: $1",test_case_exception:"Ocorreu uma exceção no caso de teste $0: $1",invalid_type_conversion:"O valor $0 não pode ser convertido para o tipo $1",invalid_read_type:"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo da variável $3.",invalid_read_type_array:"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo aceito pela variável $3 que é um $4.",inform_valid_identifier:"Informe um nome válido! O nome não pode ser uma palavra reservadas e deve começar com letras ou _ e conter apenas letras, números e _.",inform_valid_global_duplicated:"Já existe uma variável global com o nome $0, você precisa de nomes distintos.",inform_valid_variable_duplicated:"Já existe uma variável com o nome $0 na função $1, você precisa de nomes distintos.",inform_valid_function_duplicated:"Já existe uma função com o nome $0, você precisa de nomes distintos.",inform_valid_param_duplicated:"Já existe um parâmetro com o nome $0 na função $1, você precisa de nomes distintos.",invalid_character:"O caractere $0 na linha $1 não pode ser utilizado neste contexto.",annonymous_array_literal:"Erro na linha $0: a notação de vetor/matriz só permitida durante a inicialização de uma variável desse tipo. Ex: inteiro vec[3] ← {1,2,3}.",invalid_matrix_literal_line:"A expressão $0 na linha $1 não possui um número de elementos igual a linha anterior. Todas as linhas de uma matriz devem ter a mesma quantidade de elementos.",cannot_infer_matrix_line:"Não é possível inferir o número de linhas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.",cannot_infer_matrix_column:"Não é possível inferir o número de colunas da matriz $0 na linha $1. É necessário que ela seja inicializada ou que o valor seja informado de forma explícita.",cannot_infer_vector_size:"Não é possível inferir o número de elementos do vetor $0 na linha $1. É necessário que ele seja inicializado ou que o valor seja informado de forma explícita",matrix_to_vector_literal_attr:"Erro na linha $0: A expressão $1 representa uma matriz e não pode ser atribuída ao vetor $2.",vector_to_matrix_literal_attr:"Erro na linha $0: A expressão $1 representa um vetor e não pode ser atribuído a matriz $2.",invalid_const_ref_full:"A variável $0 fornecida como parâmetro para a função $1 na linha $2 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.",invalid_const_ref:"A variável $0 fornecida como parâmetro para a função $1 é uma constante e não pode ser usada neste contexto. Use uma variável ou posição de vetor.",invalid_const_assignment_full:"Erro na linha $0: $1 é uma constante e portanto não pode ter seu valor alterado",invalid_const_assignment:"$0 é uma constante e portanto não pode ter seu valor alterado",array_init_not_literal:"Erro na linha $0: Vetor/Matriz só pode ser inicializado por literal. Ex: real vetor[] <- {1,2,3}",array_exceeds_2d:"Erro na linha $0: O número máximo de dimensões que um arranjo pode ter é 2. Elemento de 3 ou mais dimensões encontrado!",invalid_matrix_id_dimension:"Erro na linha $0: Você deve definir todas as dimensões da matriz quando uma delas é definida por uma variável! Ex: real mat1[var][5], mat2[5][var]",invalid_vector_init:"Erro na linha $0: Não se pode inicializar um vetor que teve seu tamanho declarado utilizando uma variável! Utilize uma atribuição de vetores ou use um laço de repetição.",invalid_matrix_init:"Erro na linha $0: Não se pode inicializar uma matrix que teve ao menos uma das suas dimensões declaradas utilizando uma variável! Utilize uma atribuição de matrizes ou use um laço de repetição.",invalid_vector_assignment_full:"Erro na linha $0: Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $1 comporta $2 e $3 comporta $4!",invalid_vector_assignment:"Só se pode atribuir um vetor a outro desde que eles comportem o mesmo número de elementos. $0 comporta $1 e $2 comporta $3!",invalid_matrix_assignment_full:"Erro na linha $0: Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $1 tem $2 linhas e $3 colunas, enquanto $4 possui $5 linhas e $6 colunas!",invalid_matrix_assignment:"Só se pode atribuir uma matriz a outra desde que ambas possuam dimensões de mesmo tamanho. $0 tem $1 linhas e $2 colunas, enquanto $3 possui $4 linhas e $5 colunas!",matrix_to_vector_attr:"Erro na linha $0: $1 representa uma matriz e não pode ser atribuída ao vetor $2.",vector_to_matrix_attr:"Erro na linha $0: $1 representa um vetor e não pode ser atribuído a matriz $2.",invalid_matrix_index_assign_full:"Erro na linha $0: A posição $1 da matriz $2 aceita apenas vetores de tamanho $3, mas $4 tem tamanho $5",invalid_matrix_index_assign:"A linha $0 da matriz $1 aceita apenas vetores de tamanho $2, mas $3 tem tamanho $4",invalid_number_elements_vector:"Esperava-se por $0 elementos na linha $1 mas a expressão $2 possui $3 elementos.",invalid_number_lines_matrix:"Esperava-se por uma matriz com $0 linhas na linha $1 mas a expressão $2 possui $3 linhas",divsion_by_zero_full:"Erro na linha $0: A expressão $1 resulta em uma divisão por 0.",divsion_by_zero:"A expressão $0 resulta em uma divisão por 0.",undefined_tanget_value:"Erro na linha $0: A tangente de $1° não é indefinida.",negative_log_value:"Erro na linha $0: Não se pode calcular o log de um valor negativo.",invalid_string_index:"Erro na linha $0 durante a execução da função $1: $2 é um índice inválido para a cadeia de texto $3. Os valores válidos vão de 0 à $4",negative_sqrt_value:"Erro na linha $0: Não é permitido calcular a raiz quadrada de um número negativo.",exceeded_recursive_calls:"Erro na execução da linha $0: Número de chamadas recursivas execedeu o limite máximo definido!",invalid_for_variable:"Erro na linha $0: A variavel $1 utilizada no comando repita_para deve ser do tipo inteiro.",invalid_for_from:"Erro na linha $0: O valor $1 passado para o parâmetro 'de' do comando repita_para deve ser do tipo inteiro.",invalid_for_to:"Erro na linha $0: O valor $1 passado para o parâmetro 'para' do comando repita_para deve ser do tipo inteiro.",invalid_for_pass:"Erro na linha $0: O valor $1 passado para o parâmetro 'passo' do comando repita_para deve ser do tipo inteiro.",exceed_max_instructions:"Número de instruções excedeu o limite definido. Certifique-se que seu código não possui laços infinitos ou muitas chamadas de funções recursivas."},en:{token_missing_one:"Syntax error: Expected $0 but found $1 at line:$2, column:$3",token_missing_two:"Syntax error: Expected $0 or $1 but found $2 at line:$3, column: $4",eos_missing:"A new line or a ‘;’ is missing at line: $0, column: $1",invalid_type:"$0 at line: $1, column: $2 is a invalid type. The valid types are: $3",invalid_array_dimension:"Invalid dimension at line: $0, column: $1. Insert a $2 or a valid identifier of the same type.",invalid_array_size:"The array at line $0 exceeds the maximum size of 2.",extra_lines:"No text is allowed after '}' in 'program { … }'",invalid_main_return:"The function $0 declared at line $2 must return $1.",invalid_var_declaration:"Error at line $0: Variables can only be declared in the main body of a function and at the first lines, before any command.",invalid_break_command:"Error at line $0. The command $1 cannot be used outside a loop command or ‘switch ...case’ structure.",invalid_terminal:"It is not possible to use $0 in the expression at line: $1, column: $2. Try a numeric value, variable or function call.",const_not_init:"Error at line: $0, column: $1. A variable declared as const must be initialized.",id_missing:"Expected an identifier but found $0 at line: $1, column: $2.",invalid_id_format:"$0 at line: $1, column: $2 is not a valid identifier. The symbol '.' is not permitted in this context.",main_missing:"The main function was not found. You need to declare a function of return type void named main.",invalid_global_var:"Critical Error: Invalid call of the function IVProgProcessor.initGlobal outside the BASE context.",not_implemented:"Critial internal error: The system defined function $0 was not found.",function_missing:"The function $0 was not found.",function_missing_full:"The function $0 at line: $1, column: $2 was not found.",invalid_parameters_size_full:"Error at line $0: The number of parameters provided to the function $1 is incorrect. It expected $2 but found $3.",invalid_parameters_size:"The number of parameters provided to the function $0 is incorrect. It expected $1 but found $2.",invalid_ref_full:"The expression $0 provided as a parameter to the function $1 at line $2 is not valid in this context. Use a variable or a position of a vector.",invalid_ref:"The expression $0 provided as a parameter to the function $1 is not valid in this context. Use a variable or a position of a vector.",invalid_parameter_type_full:"The expression $0 provided as a parameter to the function $1 at line $2 is not of the expected type.",invalid_parameter_type:"The expression $0 provided as a parameter to the function $1 is not of the expected type.",unknown_command_full:"Internal error: an unknown command found at line $0.",unknown_command:"Internal error: an unknown command found.",loop_condition_type_full:"Error at line: $0, column $1: the condition $2 of the loop must be of type bool (true or false).",loop_condition_type:"The condition $0 of the loop must be of type bool (true or false).",endless_loop_full:"Possible infinite loop detected in your code. Check line $0.",endless_loop:"Possible infinite loop detected in your code.",for_condition_type_full:"Erro na linha: $0, coluna $1: a condição de parada $2 do comando para(...) deve ser do tipo lógico",for_condition_type:"A condição de parada $0 do comando para(...) deve ser do tipo lógico",if_condition_type_full:"Error at line: $0, column $1: the condition $2 in the if … else command must result in a bool (true or false).",if_condition_type:"The condition $0 in the if … else command must result in a bool (true or false).",invalid_return_type_full:"Error at line $0: The expression doest not result in a type compatible with the function $1. Expected type: $2.",invalid_return_type:"The expression doest not result in a type compatible with the function $0. Expected type: $1.",invalid_void_return_full:"Error at line $0: The function $1 cannot return an empty expression, use an expression that results in a $2",invalid_void_return:"The function $0 cannot return an empty expression, use an expression that results in a $1",unexpected_break_command_full:"Critical error at line $0: a break command was found outside a valid context: loop or switch … case structure.",unexpected_break_command:"Critical error: a break command was found outside a valid context: loop or switch … case structure.",invalid_dimension:"Array (vector or matrix) dimensions must be of type int.",void_in_expression_full:"Error at line: $0, column: $1: The function $2 cannot be used inside an expression since its return type is void.",void_in_expression:"The function $0 cannot be used inside an expression since its return type is void.",invalid_array_access_full:"Identifier $0 at line: $1, column: $2 does not identify a valid vector or matrix.",invalid_array_access:"Identifier $0 does not identify a valid vector or matrix.",invalid_matrix_access_full:"Identifier $0 at line: $1, column: $2 does not identify a valid matrix.",invalid_matrix_access:"Identifier $0 does not identify a valid matrix.",matrix_column_outbounds_full:"Error at line $0: The number of columns $1 is invalid for the matrix $2 which has $3 columns.",matrix_column_outbounds:"The number of columns $0 is invalid for the matrix $1 which has $2 columns.",matrix_line_outbounds_full:"Error at line $0: The number of lines $1 is invalid for matrix $2 which has $3 lines.",matrix_line_outbounds:"The number of lines $0 is invalid for matrix $1 which has $2 lines.",vector_line_outbounds_full:"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.",vector_line_outbounds:"Error at line $0: The number of elements $1 is invalid for vector $2 which has $3 elements.",vector_not_matrix_full:"Error at line $0: $1 is not a matrix.",vector_not_matrix:"$0 is not a matrix.",invalid_infix_op_full:"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the types $3 and $4.",invalid_infix_op:"The expression $0 is not valid because the operator $1 cannot be applied to the types $2 and $3.",invalid_unary_op_full:"Error at line $0: The expression $1 is not valid because the operator $2 cannot be applied to the type $3.",invalid_unary_op:"The expression $0 is not valid because the operator $1 cannot be applied to the type $2.",unknown_op:"Critical error: Unknown operator $0.",duplicate_function:"The function $0 at line: $1, column: $2 has already been declared.",duplicate_variable:"The variable $0 at line: $1, column: $2 has already been declared.",main_parameters:"The main function cannot have parameters.",symbol_not_found_full:"The variable $0 at line: $1, column: $2 has not been declared.",symbol_not_found:"The variable $0 has not been declared.",array_dimension_not_int_full:"The array (vector or matrix) dimensions at line $0 must be of type int.",array_dimension_not_int:"An array (vector or matrix) dimensions must be of type int.",array_dimension_not_positive_full:"The array (vector or matrix) dimensions at line $0 must be positive.",array_dimension_not_positive:"An array (vector or matrix) dimensions must be positive.",incompatible_types_full:"It expected $0 but the expression $1 at line $2 results in $3.",incompatible_types:"It expected $0 but the expression $1 results in $2.",incompatible_types_array_full:"The expression $0 at line $2 is not compatible with type $1.",incompatible_types_array:"The expression $0 is not compatible with type $1.",invalid_case_type_full:"The case expression $0 at line $1 is not compatible with type $2.",invalid_case_type:"The case expression $0 is not compatible with type $1.",function_no_return:"The function $0 does not have a reacheable return command. Every function must have at least one return command in its main body.",invalid_array_literal_type_full:"Error at line $0: the expression $1 does not result in a compatible type.",invalid_array_literal_type:"The expression $0 does not result in a compatible type.",invalid_array_literal_line_full:"Error at line $0: it expected $1 lines but found $2.",invalid_array_literal_line:"It expected $0 lines but found $1.",invalid_array_literal_column_full:"Error at line $0: it expected $1 column but found $2.",invalid_array_literal_column:"It expected $0 column but found $1.",exceeded_input_request:"The amount of reads requested exceeded the amount of inputs available.",test_case_few_reads:"Teste case $0 failed: there are available inputs remaining.",test_case_failed:"
Test case $0 did not executed successfully.
",test_case_failed_exception:"
Test case $0 failed: $1",test_case_exception:"An exception has ocurred during the execution of test case $0: $1",invalid_type_conversion:"The value $0 cannot be converted to type $1.",invalid_read_type:"Error at line $0: The input \"$1\" is not of type $2 which is the type of the variable $3.",invalid_read_type_array:"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable $3 of type $4.",inform_valid_identifier:"Enter a valid identifier! The identifier cannot be a reserved word and it must begin with a letter or _, followed by numbers, letters and _ only.",inform_valid_global_duplicated:"A global variable named $0 already exists, you need distinct names for each gloval variable.",inform_valid_variable_duplicated:"A variable named $0 already exists, you need distinct names for each variable.",inform_valid_function_duplicated:"A function named $0 already exists, you need distinct names for each function.",inform_valid_param_duplicated:"A parameter named $0 already exists in function $1, you need distinc names for each parameter.",invalid_character:"The character $0 at line $1 cannot be used in this context.",annonymous_array_literal:"Error at line $0: the array notation is only permitted during initialization of an array variable. i. e.: int vec[3] ← {1, 2, 3}.",invalid_matrix_literal_line:"The expression $0 at line $1 does not have the same number of elements as the last line. All lines of a matrix must have the same number of elements.",cannot_infer_matrix_line:"It is not possible to infer the number of lines of matrix $0 at line $1. It must be initialized or have its lines explicitly declared.",cannot_infer_matrix_column:"It is not possible to infer the number of columns of matrix $0 at line $1. It must be initialized or have its columns explicitly declared.",cannot_infer_vector_size:"It is not possible to infer the number of elements of vector $0 at line $1. It must be initialized or have its size explicitly declard.",matrix_to_vector_literal_attr:"Error at line $0: The expression $1 represents a matrix and cannot be assigned to the vector $2.",vector_to_matrix_literal_attr:"Error at line $0: The expression $1 represents a vector and cannot be assigned to the matrix $2.",invalid_const_ref_full:"The variable $0 provided as a parameter to the function $1 at line $2 is a constant and cannot be used in this context. Use a non-constant variable or vector position.",invalid_const_ref:"The variable $0 provided as a parameter to the function $1 is a constant and cannot be used in this context. Use a non-constant variable or vector position.",invalid_const_assignment_full:"Error at line $0: $1 is a constant e therefore cannot have its value changed.",invalid_const_assignment:"$0 is a constant e therefore cannot have its value changed.",array_init_not_literal:"Error at line $0: An array (vector or matrix) can only be initialized by an array literal. i.e : real vector[] <- {1,2,3}",array_exceeds_2d:"Error at line $0: The maximum number of dimensions an array can have is 2. An element of 3 or dimensions was found.",invalid_matrix_id_dimension:"Error at line $0: You must define all dimensions of the matrix when one of them is defined by a variable! i.e: real mat1[var][5], mat2[5][var]",invalid_vector_init:"Error at line $0: You cannot initialize a vector when its size is defined by a variable. Use a vector assignment or loop command.",invalid_matrix_init:"Error at line $0: You cannot initialize a matrix when one of its dimensions is defined by a variable. Use a matrix assignment or loop command.",invalid_vector_assignment_full:"Error at line $0: You can only assign a vector to another when both have the same number of elements. $1 has $2 and $3 has $4 elements!",invalid_vector_assignment:"You can only assign a vector to another when both have the same number of elements. $0 has $1 and $2 has $3 elements!",invalid_matrix_assignment_full:"Error at line $0: You can only assign a matrix to another when both have dimensions of the same size. $1 has $2 lines e $3 columns while $4 has $5 lines and $6 columns!",invalid_matrix_assignment:"You can only assign a matrix to another when both have dimensions of the same size. $0 has $1 lines e $2 columns while $3 has $4 lines and $5 columns!",matrix_to_vector_attr:"Error at line $0: $1 represents a matrix and cannot be assigned to the vector $2.",vector_to_matrix_attr:"Error at line $0: $1 represents a vector and cannot be assigned to the matrix $2.",invalid_matrix_index_assign_full:"Error at line $0: The position $1 of the matrix $2 only accepts vectors of size $3 but $4 has size $5.",invalid_matrix_index_assign:"The position $0 of the matrix $1 only accepts vectors of size $2 but $3 has size $4.",invalid_number_elements_vector:"It expected $0 elements at line $1 but the expression $2 has $3 elements.",invalid_number_lines_matrix:"It expected a matrix with $0 lines at line $1 but the expression $2 has $3 lines.",divsion_by_zero_full:"Error at line $0: The expression $1 resuts in a division by zero.",divsion_by_zero:"The expression $0 resuts in a division by zero.",undefined_tanget_value:"Error at line $0: The tangent of $1° is undefined.",negative_log_value:"Error at line $0: You cannot calculate the logarithm of a negative value.",invalid_string_index:"Error at line $0 during the execution of the function $1: $2 is an invalid index for the text string $3. The valid indexes go from 0 to $4.",negative_sqrt_value:"Error at line $0: It is not allowd to calculate the square root of a negative number.",exceeded_recursive_calls:"Error during the execution of line $0: The number of recursive calls exceeded the allowed number of calls.",invalid_for_variable:"Error at line $0: The variable $1 used in the repeat_for command must be of type int.",invalid_for_from:"Error at line $0: The value $1 passed to the parameter 'from' of the repeat_for command must be of type int.",invalid_for_to:"Error at line $0: The value $1 passed to the parameter 'to' of the repeat_for command must be of type int.",invalid_for_pass:"Error at line $0: The value $1 passed to the parameter 'pass' of the repeat_for command must be of type int.",exceed_max_instructions:"The number of instructions executed by your program exceed the defined limit. Check your code for infinite loops or excessive recursive functions calls."},es:{token_missing_one:" ",token_missing_two:" ",eos_missing:" ",invalid_type:" ",invalid_array_dimension:" ",invalid_array_size:" ",extra_lines:" ",invalid_main_return:" ",invalid_var_declaration:" ",invalid_break_command:" ",invalid_terminal:" ",const_not_init:" ",id_missing:" ",invalid_id_format:" ",main_missing:" ",invalid_global_var:" ",not_implemented:" ",function_missing:" ",function_missing_full:" ",invalid_parameters_size_full:" ",invalid_parameters_size:" ",invalid_ref_full:" ",invalid_ref:" ",invalid_parameter_type_full:" ",invalid_parameter_type:" ",unknown_command_full:" ",unknown_command:" ",loop_condition_type_full:" ",loop_condition_type:" ",endless_loop_full:" ",endless_loop:" ",for_condition_type_full:" ",for_condition_type:" ",if_condition_type_full:" ",if_condition_type:" ",invalid_return_type_full:" ",invalid_return_type:" ",invalid_void_return_full:" ",invalid_void_return:" ",unexpected_break_command_full:" ",unexpected_break_command:" ",invalid_dimension:" ",void_in_expression_full:" ",void_in_expression:" ",invalid_array_access_full:" ",invalid_array_access:" ",invalid_matrix_access_full:" ",invalid_matrix_access:" ",matrix_column_outbounds_full:" ",matrix_column_outbounds:" ",matrix_line_outbounds_full:" ",matrix_line_outbounds:" ",vector_line_outbounds_full:" ",vector_line_outbounds:" ",vector_not_matrix_full:" ",vector_not_matrix:" ",invalid_infix_op_full:" ",invalid_infix_op:" ",invalid_unary_op_full:" ",invalid_unary_op:" ",unknown_op:" ",duplicate_function:" ",duplicate_variable:" ",main_parameters:" ",symbol_not_found_full:" ",symbol_not_found:" ",array_dimension_not_int_full:" ",array_dimension_not_int:" ",array_dimension_not_positive_full:" ",array_dimension_not_positive:" ",incompatible_types_full:" ",incompatible_types:" ",incompatible_types_array_full:" ",incompatible_types_array:" ",invalid_case_type_full:" ",invalid_case_type:" ",function_no_return:" ",invalid_array_literal_type_full:" ",invalid_array_literal_type:" ",invalid_array_literal_line_full:" ",invalid_array_literal_line:" ",invalid_array_literal_column_full:" ",invalid_array_literal_column:" ",exceeded_input_request:" ",test_case_few_reads:" ",test_case_failed:" ",test_case_failed_exception:" ",test_case_exception:" ",invalid_type_conversion:" ",invalid_read_type:" ",invalid_read_type_array:" ",inform_valid_identifier:" ",inform_valid_global_duplicated:" ",inform_valid_variable_duplicated:" ",inform_valid_function_duplicated:" ",inform_valid_param_duplicated:" ",invalid_character:" ",annonymous_array_literal:" ",invalid_matrix_literal_line:" ",cannot_infer_matrix_line:" ",cannot_infer_matrix_column:" ",cannot_infer_vector_size:" ",matrix_to_vector_literal_attr:" ",vector_to_matrix_literal_attr:" ",invalid_const_ref_full:" ",invalid_const_ref:" ",invalid_const_assignment_full:" ",invalid_const_assignment:" ",array_init_not_literal:" ",array_exceeds_2d:" ",invalid_matrix_id_dimension:" ",invalid_vector_init:" ",invalid_matrix_init:" ",invalid_vector_assignment_full:" ",invalid_vector_assignment:" ",invalid_matrix_assignment_full:" ",invalid_matrix_assignment:" ",matrix_to_vector_attr:" ",vector_to_matrix_attr:" ",invalid_matrix_index_assign_full:" ",invalid_matrix_index_assign:" ",invalid_number_elements_vector:" ",invalid_number_lines_matrix:" ",divsion_by_zero_full:" ",divsion_by_zero:" ",undefined_tanget_value:" ",negative_log_value:" ",invalid_string_index:" ",negative_sqrt_value:" ",exceeded_recursive_calls:" ",invalid_for_variable:"",invalid_for_from:"",invalid_for_to:"",invalid_for_pass:"",exceed_max_instructions:""}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Address=class{constructor(e,t){this.id=e,this.value=t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(36);class o extends i.StoreObject{constructor(e){super(e.type,e.getRefAddress(),!1),this.refObj=e.id,this.reference_dimension=e.getReferenceDimension()}get isRef(){return!0}getRefObj(){return this.refObj}getReferenceDimension(){return this.reference_dimension}destroy(){return!1}}t.StoreObjectRef=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(50);class o extends i.StoreObjectArray{constructor(e,t,n){super(e.type,t,n,e.getAddresses(),!1),this.refObj=e.id}get isRef(){return!0}getRefObj(){return this.refObj}destroy(){return!1}}t.StoreObjectArrayRef=o},,,,function(e,t,n){"use strict";n.r(t);var i=n(24);function o(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=t,this.id=n,this.byRef=i,this._sourceInfo=null}var t,n,i;return t=e,(n=[{key:"sourceInfo",set:function(e){this._sourceInfo=e},get:function(){return this._sourceInfo}}])&&qe(t.prototype,n),i&&qe(t,i),e}(),ze=n(1),Xe=n(5),We=n.n(Xe);function Qe(e){return new We.a(e)}function Ye(e){var t=e.replace(/^"/,"");return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/"$/,"")).replace(/\\b/g,"\b")).replace(/\\t/g,"\t")).replace(/\\n/g,"\n")).replace(/\\r/g,"\r")).replace(/\\"/g,'"')).replace(/\\'/g,"'")).replace(/\\\\/g,"\\")}function Je(e){return new We.a(e)}function Ze(e){var t="'"+e+"'",n=T.getCurrentLexer(),i=new n(null);if(i.literalNames[n.RK_TRUE]===t)return!0;if(i.literalNames[n.RK_FALSE]===t)return!1;throw new Error(e+"not a valid boolean")}function et(e){var t=T.getCurrentLexer(),n=new t(null);return(e?n.literalNames[t.RK_TRUE]:n.literalNames[t.RK_FALSE]).replace(/'/g,"")}function tt(e,t){switch(t.ord){case he.Types.INTEGER.ord:return e.toString();case he.Types.REAL.ord:return e.dp()<=0?e.toFixed(1):e.toFixed(y.decimalPlaces);case he.Types.BOOLEAN.ord:return et(e);default:return e}}function nt(e){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function it(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ot(e){var t="function"==typeof Map?new Map:void 0;return(ot=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return at(e,arguments,st(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),rt(i,e)})(e)}function at(e,t,n){return(at=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&rt(o,n.prototype),o}).apply(null,arguments)}function rt(e,t){return(rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function st(e){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lt=function(e){function t(){var e,n,i,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var a=arguments.length,r=new Array(a),s=0;s"},GE:{ord:6,value:">="},LT:{ord:7,value:"<"},LE:{ord:8,value:"<="},EQ:{ord:9,value:"=="},NEQ:{ord:10,value:"!="},AND:{ord:11,value:"and"},OR:{ord:12,value:"or"},NOT:{ord:13,value:"not"}});function gt(e){switch(e){case"+":return yt.ADD;case"-":return yt.SUB;case"*":return yt.MULT;case"/":return yt.DIV;case"%":return yt.MOD;case">":return yt.GT;case">=":return yt.GE;case"<":return yt.LT;case"<=":return yt.LE;case"==":return yt.EQ;case"!=":return yt.NEQ;case"and":return yt.AND;case"or":return yt.OR;case"not":return yt.NOT}}function bt(e){return(bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wt(e,t){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2];return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xt(this,Et(t).call(this,e,n,i))}var n,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Tt(e,t)}(t,e),n=t,(i=[{key:"translateType",value:function(e,t){var n=this.getUI("type_".concat(e));switch(t){case 0:return n;default:return t>1?this.getUI("matrix_info_string",[n]):this.getUI("vector_info_string",[n])}}},{key:"translateOp",value:function(e){switch(e.ord){case yt.AND.ord:case yt.OR.ord:case yt.NOT.ord:return this.getUI("logic_operator_".concat(e.value));default:return e.value}}},{key:"translateInternalFunction",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null==t?Gt.getLocalName(e):Gt.getLocalName("".concat(t,".").concat(e))}}])&&wt(n.prototype,i),o&&wt(n,o),t}(v.a.LocalizedStrings),At=Object.freeze(new Rt(T,ht.a,!0)),Ot=null;function It(){return null==Ot&&(Ot=new Rt(T,ht.a)),Ot}var Ct=It();function Nt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new lt(Ct.getError(e,t))}function St(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new mt(Ct.getError(e,t))}var kt=Object.freeze({symbol_not_found_full:function(e,t){return t?St("symbol_not_found_full",[e,t.line,t.column]):kt.symbol_not_found(e)},symbol_not_found:function(e){return St("symbol_not_found",[e])},function_missing_full:function(e,t){return t?St("function_missing_full",[e,t.line,t.column]):kt.function_missing(e)},function_missing:function(e){return St("function_missing",[e])},main_missing:function(){return St("main_missing")},array_dimension_not_int_full:function(e){return e?St("array_dimension_not_int_full",[e.line]):kt.array_dimension_not_int()},array_dimension_not_int:function(){return St("array_dimension_not_int")},unknown_command_full:function(e){return e?Nt("unknown_command_full",[e.line]):kt.unknown_command()},unknown_command:function(){return Nt("unknown_command")},incompatible_types_full:function(e,t,n,i,o,a){return a?St("incompatible_types_full",[Ct.translateType(e,t),o,a.line,Ct.translateType(n,i)]):kt.incompatible_types(e,t,n,i,o)},incompatible_types:function(e,t,n,i,o){return St("incompatible_types",[Ct.translateType(e,t),o,Ct.translateType(n,i)])},incompatible_types_array_full:function(e,t,n,i){return i?St("incompatible_types_array_full",[e,Ct.translateType(t,n),i.line,i.column]):kt.incompatible_types_array(e,t,n)},incompatible_types_array:function(e,t,n){return St("incompatible_types_array",[e,Ct.translateType(t,n)])},loop_condition_type_full:function(e,t){return t?St("loop_condition_type_full",[t.line,t.column,e]):kt.loop_condition_type(e)},loop_condition_type:function(e){return St("loop_condition_type",[e])},endless_loop_full:function(e){return e?St("endless_loop_full",[e.line]):kt.endless_loop()},endless_loop:function(){return St("endless_loop")},if_condition_type_full:function(e,t){return t?St("if_condition_type_full",[t.line,t.column,e]):kt.if_condition_type(e)},if_condition_type:function(e){return St("if_condition_type",[e])},invalid_global_var:function(){return Nt("invalid_global_var")},not_implemented:function(e){return Nt("not_implemented",[e])},invalid_case_type_full:function(e,t,n,i){return i?St("invalid_case_type_full",[e,Ct.translateType(t,n),i.line,i.column]):kt.invalid_case_type(e,t,n)},invalid_case_type:function(e,t,n){return St("invalid_case_type",[e,Ct.translateType(t,n)])},void_in_expression_full:function(e,t){return t?St("void_in_expression_full",[t.line,t.column,e]):kt.void_in_expression(e)},void_in_expression:function(e){return St("void_in_expression",[e])},invalid_array_access_full:function(e,t){return t?St("invalid_array_access_full",[e,t.line,t.column]):kt.invalid_array_access(e)},invalid_array_access:function(e){return St("invalid_array_access",[e])},invalid_matrix_access_full:function(e,t){return t?St("invalid_matrix_access_full",[e,t.line,t.column]):kt.invalid_matrix_access(e)},invalid_matrix_access:function(e){return St("invalid_matrix_access",[e])},matrix_column_outbounds_full:function(e,t,n,i){return i?Nt("matrix_column_outbounds_full",[i.line,t,e,n]):kt.matrix_column_outbounds(e,t,n)},matrix_column_outbounds:function(e,t,n){return Nt("matrix_column_outbounds",[t,e,n])},matrix_line_outbounds_full:function(e,t,n,i){return i?Nt("matrix_line_outbounds_full",[i.line,t,e,n]):kt.matrix_line_outbounds(e,t,n)},matrix_line_outbounds:function(e,t,n){return Nt("matrix_line_outbounds",[t,e,n])},vector_line_outbounds_full:function(e,t,n,i){return i?Nt("vector_line_outbounds_full",[i.line,t,e,n]):kt.vector_line_outbounds(e,t,n)},vector_line_outbounds:function(e,t,n){return Nt("vector_line_outbounds",[t,e,n])},vector_not_matrix_full:function(e,t){return t?Nt("vector_not_matrix_full",[t.line,e]):kt.vector_not_matrix(e)},vector_not_matrix:function(e){return Nt("vector_not_matrix",[e])},function_no_return:function(e){return St("function_no_return",[e])},invalid_void_return_full:function(e,t,n,i){return i?St("invalid_void_return_full",[i.line,e,Ct.translateType(t,n)]):kt.invalid_void_return(e,t,n)},invalid_void_return:function(e,t,n){return St("invalid_void_return_full",[e,Ct.translateType(t,n)])},invalid_return_type_full:function(e,t,n,i){return i?St("invalid_return_type_full",[i.line,e,Ct.translateType(t,n)]):kt.invalid_return_type(e,t,n)},invalid_return_type:function(e,t,n){return St("invalid_return_type",[e,Ct.translateType(t,n)])},invalid_parameters_size_full:function(e,t,n,i){return i?St("invalid_parameters_size_full",[i.line,e,t,n]):kt.invalid_parameters_size(e,t,n)},invalid_parameters_size:function(e,t,n){return St("invalid_parameters_size",[e,t,n])},invalid_parameter_type_full:function(e,t,n){return n?St("invalid_parameter_type_full",[t,Gt.getLocalName(e),n.line]):kt.invalid_parameter_type(e,t)},invalid_parameter_type:function(e,t){return St("invalid_parameter_type_full",[t,Gt.getLocalName(e)])},invalid_ref_full:function(e,t,n){return n?St("invalid_ref_full",[t,e,n.line]):kt.invalid_ref(e,t)},invalid_ref:function(e,t){return St("invalid_ref",[t,e])},unexpected_break_command_full:function(e){return e?Nt("unexpected_break_command_full",[e.line]):kt.unexpected_break_command()},unexpected_break_command:function(){return Nt("unexpected_break_command")},invalid_array_literal_type_full:function(e,t){return t?Nt("invalid_array_literal_type_full",[t.line,e]):kt.invalid_array_literal_type(e)},invalid_array_literal_type:function(e){return Nt("invalid_array_literal_type",[e])},invalid_array_literal_line_full:function(e,t,n){return n?Nt("invalid_array_literal_line_full",[n.line,e,t]):kt.invalid_array_literal_type(e,t)},invalid_array_literal_line:function(e,t){return Nt("invalid_array_literal_line",[e,t])},invalid_array_literal_column_full:function(e,t,n){return n?Nt("invalid_array_literal_column_full",[n.line,e,t]):kt.invalid_array_literal_column(e,t)},invalid_array_literal_column:function(e,t){return Nt("invalid_array_literal_column",[e,t])},invalid_unary_op_full:function(e,t,n,i,o){return o?Nt("invalid_unary_op_full",[o.line,e,Ct.translateOp(t),Ct.translateType(n,i)]):kt.invalid_unary_op(t,n,i)},invalid_unary_op:function(e,t,n,i){return Nt("invalid_unary_op",[e,Ct.translateOp(t),Ct.translateType(n,i)])},invalid_infix_op_full:function(e,t,n,i,o,a,r){return r?Nt("invalid_infix_op_full",[r.line,e,Ct.translateOp(t),Ct.translateType(n,i),Ct.translateType(o,a)]):kt.invalid_infix_op(t,n,i,o,a)},invalid_infix_op:function(e,t,n,i,o,a){return Nt("invalid_infix_op",[e,Ct.translateOp(t),Ct.translateType(n,i),Ct.translateType(o,a)])},array_dimension_not_positive_full:function(e){return e?St("array_dimension_not_positive_full",[e.line]):kt.array_dimension_not_positive()},array_dimension_not_positive:function(){return St("array_dimension_not_positive")},invalid_type_conversion:function(e,t,n){return Nt("invalid_type_conversion",[e,Ct.translateType(t,n)])},invalid_read_type:function(e,t,n,i,o){return Nt("invalid_read_type",[o.line,e,Ct.translateType(t,n),i])},invalid_read_type_array:function(e,t,n,i,o,a,r){return Nt("invalid_read_type_array",[r.line,e,Ct.translateType(t,n),i,Ct.translateType(o,a)])},invalid_const_ref_full:function(e,t,n){return n?St("invalid_const_ref_full",[t,Gt.getLocalName(e),n.line]):kt.invalid_const_ref(e,t)},invalid_const_ref:function(e,t){return St("invalid_const_ref",[t,Gt.getLocalName(e)])},invalid_const_assignment_full:function(e,t){return t?St("invalid_const_assignment_full",[t.line,e]):kt.invalid_const_assignment(e)},invalid_const_assignment:function(e){return St("invalid_const_assignment",[e])},invalid_vector_assignment_full:function(e,t,n,i,o){return o?Nt("invalid_vector_assignment_full",[o.line,e,t,n,i]):kt.invalid_vector_assignment(e,t,n,i)},invalid_vector_assignment:function(e,t,n,i){return Nt("invalid_vector_assignment",[e,t,n,i])},invalid_matrix_assignment_full:function(e,t,n,i,o,a,r){return r?Nt("invalid_matrix_assignment_full",[r.line,e,t,n,i,o,a]):kt.invalid_matrix_assignment(e,t,n,i,o,a)},invalid_matrix_assignment:function(e,t,n,i,o,a){return Nt("invalid_matrix_assignment",[e,t,n,i,o,a])},matrix_to_vector_attr:function(e,t,n){return St("matrix_to_vector_attr",[n.line,t,e])},vector_to_matrix_attr:function(e,t,n){return St("vector_to_matrix_attr",[n.line,t,e])},invalid_matrix_index_assign_full:function(e,t,n,i,o,a){return a?Nt("invalid_matrix_index_assign_full",[a.line,t,e,n,i,o]):kt.invalid_matrix_index_assign(e,t,n,i,o)},invalid_matrix_index_assign:function(e,t,n,i,o){return Nt("invalid_matrix_index_assign",[t,e,n,i,o])},invalid_number_elements_vector:function(e,t,n,i){return Nt("invalid_number_elements_vector",[e,i.line,t,n])},invalid_number_lines_matrix:function(e,t,n,i){return Nt("invalid_number_lines_matrix",[e,i.line,t,n])},divsion_by_zero_full:function(e,t){return t?Nt("divsion_by_zero_full",[t.line,e]):kt.divsion_by_zero(e)},divsion_by_zero:function(e){return Nt("divsion_by_zero",[e])},undefined_tanget_value:function(e,t){return Nt("undefined_tanget_value",[t.line,e])},negative_log_value:function(e){return Nt("negative_log_value",[e.line])},invalid_string_index:function(e,t,n){var i=Gt.getLocalName("$charAt");return Nt("invalid_string_index",[n.line,i,e,t,t.length-1])},negative_sqrt_value:function(e){return Nt("negative_sqrt_value",[e.line])},exceeded_recursive_calls:function(e){return Nt("exceeded_recursive_calls",[e.line])},invalid_for_variable:function(e,t){return St("invalid_for_variable",[t.line,e])},invalid_for_from:function(e,t){return St("invalid_for_from",[t.line,e])},invalid_for_to:function(e,t){return St("invalid_for_to",[t.line,e])},invalid_for_pass:function(e,t){return St("invalid_for_pass",[t.line,e])},exceed_max_instructions:function(){return Nt("exceed_max_instructions")}}),Lt=n(2);var $t=n(4);var Ut=n(3);function Pt(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0){var l=s.type.stringInfo()[0],c=s.getReferenceDimension(),u=kt.invalid_read_type_array(t,r.type,r.dim,s.getRefObj(),l.type,c,n.function_call_stack.pop());return Promise.reject(u)}var d=kt.invalid_read_type(t,r.type,r.dim,s.getRefObj(),n.function_call_stack.pop());return Promise.reject(d)}var p=new Lt.StoreValue(o,a);return e.updateStore("p1",p),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))}))]);return new ge("$read",he.Types.VOID,[new He(he.Types.ALL,"p1",!0)],e)}(),$write:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("p1");return this.output.sendOutput(tt(n.get(),n.type)),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$write",he.Types.VOID,[new He(he.Types.ALL,"p1",!1)],e)}()},$strLib:{$substring:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=e.applyStore("start"),o=e.applyStore("end"),a=n.get().substring(i.get(),o.get()),r=new Lt.StoreValue(he.Types.STRING,a);return e.insertStore("$",r),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$substring",he.Types.STRING,[new He(he.Types.STRING,"str",!1),new He(he.Types.INTEGER,"start",!1),new He(he.Types.INTEGER,"end",!1)],e)}(),$length:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=new Lt.StoreValue(he.Types.INTEGER,Qe(n.value.length));return e.insertStore("$",i),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$length",he.Types.INTEGER,[new He(he.Types.STRING,"str",!1)],e)}(),$uppercase:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=new Lt.StoreValue(he.Types.STRING,n.get().toUpperCase());return e.insertStore("$",i),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$uppercase",he.Types.STRING,[new He(he.Types.STRING,"str",!1)],e)}(),$lowercase:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=new Lt.StoreValue(he.Types.STRING,n.get().toLowerCase());return e.insertStore("$",i),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$lowercase",he.Types.STRING,[new He(he.Types.STRING,"str",!1)],e)}(),$charAt:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=e.applyStore("index");if(i.get().toNumber()<0||i.get().toNumber()>=n.get().length)return Promise.reject(kt.invalid_string_index(i.get().toNumber(),n.get(),this.function_call_stack.pop()));var o=new Lt.StoreValue(he.Types.STRING,n.get().charAt(i.get().toNumber()));return e.insertStore("$",o),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$charAt",he.Types.STRING,[new He(he.Types.STRING,"str",!1),new He(he.Types.INTEGER,"index",!1)],e)}()},$arrayLib:{$numElements:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("vector"),i=new Lt.StoreValue(he.Types.INTEGER,Qe(n.lines));return e.mode=ze.Modes.RETURN,e.insertStore("$",i),Promise.resolve(e)}))]);return new ge("$numElements",he.Types.INTEGER,[new He(new $t.ArrayType(he.Types.ALL,1),"vector",!1)],e)}(),$matrixLines:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("matrix"),i=new Lt.StoreValue(he.Types.INTEGER,Qe(n.lines));return e.mode=ze.Modes.RETURN,e.insertStore("$",i),Promise.resolve(e)}))]);return new ge("$matrixLines",he.Types.INTEGER,[new He(new $t.ArrayType(he.Types.ALL,2),"matrix",!1)],e)}(),$matrixColumns:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("matrix"),i=new Lt.StoreValue(he.Types.INTEGER,Qe(n.columns));return e.mode=ze.Modes.RETURN,e.insertStore("$",i),Promise.resolve(e)}))]);return new ge("$matrixColumns",he.Types.INTEGER,[new He(new $t.ArrayType(he.Types.ALL,2),"matrix",!1)],e)}()},$langLib:{$isReal:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=ui.createParser(n.get()),o=!1;try{i.parseTerm()instanceof pn&&(o=!0)}catch(e){}var a=new Lt.StoreValue(he.Types.BOOLEAN,o);return e.insertStore("$",a),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$isReal",he.Types.BOOLEAN,[new He(he.Types.STRING,"str",!1)],e)}(),$isInt:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=ui.createParser(n.get()),o=!1;try{i.parseTerm()instanceof rn&&(o=!0)}catch(e){}var a=new Lt.StoreValue(he.Types.BOOLEAN,o);return e.insertStore("$",a),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$isInt",he.Types.BOOLEAN,[new He(he.Types.STRING,"str",!1)],e)}(),$isBool:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=ui.createParser(n.get()),o=!1;try{i.parseTerm()instanceof yn&&(o=!0)}catch(e){}var a=new Lt.StoreValue(he.Types.BOOLEAN,o);return e.insertStore("$",a),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$isBool",he.Types.BOOLEAN,[new He(he.Types.STRING,"str",!1)],e)}(),$castReal:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("val"),i=n.get();switch(n.type.ord){case he.Types.INTEGER.ord:i=i.toNumber();var o=new Lt.StoreValue(he.Types.REAL,Je(i));return e.insertStore("$",o),e.mode=ze.Modes.RETURN,Promise.resolve(e);case he.Types.STRING.ord:var a=ui.createParser(i);try{var r=a.parseTerm();if(r instanceof pn){var s=new Lt.StoreValue(he.Types.REAL,r.value);return e.insertStore("$",s),e.mode=ze.Modes.RETURN,Promise.resolve(e)}}catch(e){}}var l=he.Types.REAL.stringInfo()[0];return Promise.reject(kt.invalid_type_conversion(i,l.type,l.dim))}))]);return new ge("$castReal",he.Types.REAL,[new He(new Ut.MultiType([he.Types.INTEGER,he.Types.STRING]),"val",!1)],e)}(),$castInt:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("val"),i=n.get();switch(n.type.ord){case he.Types.REAL.ord:i=i.toNumber();var o=new Lt.StoreValue(he.Types.INTEGER,Math.floor(i));return e.insertStore("$",o),e.mode=ze.Modes.RETURN,Promise.resolve(e);case he.Types.STRING.ord:var a=ui.createParser(i);try{var r=a.parseTerm();if(r instanceof rn){var s=new Lt.StoreValue(he.Types.INTEGER,r.value);return e.insertStore("$",s),e.mode=ze.Modes.RETURN,Promise.resolve(e)}}catch(e){}}var l=he.Types.INTEGER.stringInfo()[0];return Promise.reject(kt.invalid_type_conversion(i,l.type,l.dim))}))]);return new ge("$castInt",he.Types.INTEGER,[new He(new Ut.MultiType([he.Types.REAL,he.Types.STRING]),"val",!1)],e)}(),$castBool:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str").get(),i=ui.createParser(n);try{var o=i.parseTerm();if(o instanceof yn){var a=new Lt.StoreValue(he.Types.BOOLEAN,o.value);return e.insertStore("$",a),e.mode=ze.Modes.RETURN,Promise.resolve(e)}}catch(e){}var r=he.Types.BOOLEAN.stringInfo()[0];return Promise.reject(kt.invalid_type_conversion(n,r.type,r.dim))}))]);return new ge("$castBool",he.Types.BOOLEAN,[new He(he.Types.STRING,"str",!1)],e)}(),$castString:function(){var e=new Ae([],[new Ve((function(e,t){var n=e.applyStore("str"),i=tt(n.get(),n.type),o=new Lt.StoreValue(he.Types.STRING,i);return e.insertStore("$",o),e.mode=ze.Modes.RETURN,Promise.resolve(e)}))]);return new ge("$castString",he.Types.STRING,[new He(he.Types.ALL,"str",!1)],e)}()}},Bt=function(){for(var e={},t=0;t1&&void 0!==arguments[1]?arguments[1]:[];return new ti(ni.getError(e,t))}var oi=Object.freeze({extra_lines:function(){return new ti(ni.getError("extra_lines"))},token_missing_one:function(e,t){return ii("token_missing_one",[e,t.text,t.line,t.column])},token_missing_list:function(e,t){var n=e.join(ni.getOR());return oi.token_missing_one(n,t)},id_missing:function(e){return ii("id_missing",[e.text,e.line,e.column])},eos_missing:function(e){return ii("eos_missing",[e.line,e.column])},invalid_array_dimension:function(e,t){return ii("invalid_array_dimension",[t.line,t.column,e])},invalid_array_size:function(e){return ii("invalid_array_size",[e.line])},invalid_main_return:function(e,t,n){return ii("invalid_main_return",[e,t,n.line])},invalid_var_declaration:function(e){return ii("invalid_var_declaration",[e.line])},invalid_break_command:function(e,t){return ii("invalid_break_command",[t.line,e])},invalid_terminal:function(e){return ii("invalid_terminal",[e.text,e.line,e.column])},invalid_type:function(e,t){var n=e.join(ni.getOR());return ii("invalid_type",[t.text,t.line,t.column,n])},const_not_init:function(e){return ii("const_not_init",[e.line,e.column])},invalid_id_format:function(e){return ii("invalid_id_format",[e.text,e.line,e.column])},duplicate_function:function(e){return ii("duplicate_function",[e.text,e.line,e.column])},main_parameters:function(){return ii("main_parameters")},duplicate_variable:function(e){return ii("duplicate_variable",[e.text,e.line,e.column])},invalid_character:function(e,t,n){return ii("invalid_character",[e,t])},annonymous_array_literal:function(e){return ii("annonymous_array_literal",[e.line])},invalid_matrix_literal_line:function(e,t){return ii("invalid_matrix_literal_line",[e,t.line])},cannot_infer_matrix_line:function(e,t){return ii("cannot_infer_matrix_line",[e,t.line])},cannot_infer_matrix_column:function(e,t){return ii("cannot_infer_matrix_column",[e,t.line])},cannot_infer_vector_size:function(e,t){return ii("cannot_infer_vector_size",[e,t.line])},matrix_to_vector_literal_attr:function(e,t,n){return ii("matrix_to_vector_literal_attr",[n.line,t,e])},vector_to_matrix_literal_attr:function(e,t,n){return ii("vector_to_matrix_literal_attr",[n.line,t,e])},array_init_not_literal:function(e){return ii("array_init_not_literal",[e.line])},array_exceeds_2d:function(e){return ii("array_exceeds_2d",[e.line])},invalid_matrix_id_dimension:function(e){return ii("invalid_matrix_id_dimension",[e.line])},invalid_vector_init:function(e){return ii("invalid_vector_init",[e.line])},invalid_matrix_init:function(e){return ii("invalid_matrix_init",[e.line])}});function ai(e){var t=this._tokenStartCharIndex,n=this._input.index,i=this._input.getText(t,n);i=this.getErrorDisplay(i);var o=this._tokenStartLine,a=this._tokenStartColumn;throw oi.invalid_character(i,o,a)}function ri(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.pos;return this.tokenStream.LT(e)}},{key:"insideScope",value:function(t){return this.scope.length<=0?e.BASE===t:this.scope[this.scope.length-1]===t}},{key:"pushScope",value:function(e){this.scope.push(e)}},{key:"pushVariableStack",value:function(){this.definedVariablesStack.push([])}},{key:"popScope",value:function(){return this.scope.pop()}},{key:"popVariableStack",value:function(){return this.definedVariablesStack.pop()}},{key:"getCurrentVariableStack",value:function(){return this.definedVariablesStack[this.definedVariablesStack.length-1]}},{key:"isEOF",value:function(){return this.getToken(this.pos),this.tokenStream.fetchedEOF}},{key:"parseProgram",value:function(){this.consumeNewLines();var e=this.getToken(),t=[],n=[];if(this.lexerClass.RK_PROGRAM===e.type){for(this.pos++,this.consumeNewLines(),this.checkOpenCurly(),this.pos++,this.pushVariableStack();;){this.consumeNewLines();var i=this.getToken();if(i.type===this.lexerClass.RK_CONST||this.isVariableType(i))t=t.concat(this.parseGlobalVariables());else{if(i.type!==this.lexerClass.RK_FUNCTION)break;this.pushVariableStack(),n=n.concat(this.parseFunction()),this.popVariableStack()}}if(this.consumeNewLines(),this.checkCloseCurly(),this.pos++,this.consumeNewLines(),!this.isEOF())throw oi.extra_lines();return this.popVariableStack(),{global:t,functions:n}}throw oi.token_missing_one(this.lexer.literalNames[this.lexerClass.RK_PROGRAM],e)}},{key:"checkOpenCurly",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.lexerClass.OPEN_CURLY!==t.type){if(e)return!1;throw oi.token_missing_one("{",t)}return!0}},{key:"checkCloseCurly",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.lexerClass.CLOSE_CURLY!==t.type){if(e)return!1;throw oi.token_missing_one("}",t)}return!0}},{key:"checkOpenBrace",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.lexerClass.OPEN_BRACE!==t.type){if(e)return!1;throw oi.token_missing_one("[",t)}return!0}},{key:"checkCloseBrace",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.lexerClass.CLOSE_BRACE!==t.type){if(e)return!1;throw oi.token_missing_one("]",t)}return!0}},{key:"checkOpenParenthesis",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.lexerClass.OPEN_PARENTHESIS!==t.type){if(e)return!1;throw oi.token_missing_one("(",t)}return!0}},{key:"checkCloseParenthesis",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.lexerClass.CLOSE_PARENTHESIS!==t.type){if(e)return!1;throw oi.token_missing_one(")",t)}return!0}},{key:"checkEOS",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(t.type!==this.lexerClass.EOS){if(e)return!1;throw oi.eos_missing(t)}return!0}},{key:"checkFunctionDuplicate",value:function(e,t){var n=null===e?"$main":e;if(-1!==this.definedFuncsNameList.indexOf(n))throw oi.duplicate_function(t);this.definedFuncsNameList.push(n)}},{key:"checkVariableDuplicate",value:function(e,t){if(-1!==this.getCurrentVariableStack().indexOf(e))throw oi.duplicate_variable(t);this.getCurrentVariableStack().push(e)}},{key:"consumeForSemiColon",value:function(){var e=this.getToken();if(e.type!==this.lexerClass.EOS||!e.text.match(";"))throw oi.token_missing_one(";",e);this.pos++}},{key:"parseGlobalVariables",value:function(){var e=this.parseMaybeConst();return this.checkEOS(),this.pos++,e}},{key:"parseMaybeConst",value:function(){var e=this.getToken();if(e.type===this.lexerClass.RK_CONST){this.pos++;var t=this.parseType();return this.parseDeclaration(t,!0)}if(this.isVariableType(e)){var n=this.parseType();return this.parseDeclaration(n)}throw oi.token_missing_list([this.lexer.literalNames[this.lexerClass.RK_CONST]].concat(this.getTypeArray()),e)}},{key:"parseDeclaration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null,i=null,o=null,a=0,r=si.createSourceInfo(this.getToken()),s=this.parseID();if(this.checkVariableDuplicate(s,r),this.checkOpenBrace(!0))return this.pos+=1,this.consumeNewLines(),i=this.parseArrayDimension(),this.consumeNewLines(),this.checkCloseBrace(),this.pos+=1,a+=1,this.checkOpenBrace(!0)&&(this.pos+=1,this.consumeNewLines(),o=this.parseArrayDimension(),this.consumeNewLines(),this.checkCloseBrace(),this.pos+=1,a+=1),this.parseArrayDeclaration(e,t,s,r,a,i,o);var l=this.getToken();if(t&&l.type!==this.lexerClass.EQUAL)throw oi.const_not_init(r);l.type===this.lexerClass.EQUAL&&(this.pos++,n=this.parseExpressionOR());var c=new J(s,e,n,t);c.sourceInfo=r;var u=this.getToken();return u.type===this.lexerClass.COMMA?(this.pos++,this.consumeNewLines(),[c].concat(this.parseDeclaration(e,t))):[c]}},{key:"parseArrayDeclaration",value:function(e,t,n,i,o,a,r){var s=this.getToken(),l=a,c=r,u=null,d=!1;if((a instanceof Pn||r instanceof Pn)&&(d=!0,o>1&&(null==a||null==r)))throw oi.invalid_matrix_id_dimension(si.createSourceInfo(s));if(t&&s.type!==this.lexerClass.EQUAL)throw oi.const_not_init(i);if(s.type===this.lexerClass.EQUAL){if(d)throw 1==o?oi.invalid_vector_init(si.createSourceInfo(s)):oi.invalid_matrix_init(si.createSourceInfo(s));this.pos+=1,u=this.parseArrayLiteral(e)}if(null==u&&null==a){if(o>1)throw oi.cannot_infer_matrix_line(n,i);throw oi.cannot_infer_vector_size(n,i)}if(o>1&&null==u&&null==r)throw oi.cannot_infer_matrix_column(n,i);if(1===o&&null!=u&&!u.isVector){var p=u.toString();throw oi.matrix_to_vector_literal_attr(n,p,u.sourceInfo)}if(o>1&&null!=u&&u.isVector){var _=u.toString();throw oi.vector_to_matrix_literal_attr(n,_,u.sourceInfo)}null==a&&((l=new rn(Qe(u.lines))).sourceInfo=i),o>1&&null==r&&((c=new rn(Qe(u.columns))).sourceInfo=i);var f=new oe(n,new $t.ArrayType(e,o),l,c,u,t);return f.sourceInfo=i,this.getToken().type===this.lexerClass.COMMA?(this.pos++,this.consumeNewLines(),[f].concat(this.parseDeclaration(e,t))):[f]}},{key:"consumeNewLines",value:function(){for(var e=this.getToken();e.type===this.lexerClass.EOS&&e.text.match("[\r\n]+");)this.pos++,e=this.getToken()}},{key:"isVariableType",value:function(e){return this.variableTypes.find((function(t){return t===e.type}))}},{key:"parseArrayDimension",value:function(){var e=this.getToken();if(e.type===this.lexerClass.INTEGER)return this.pos++,this.getIntLiteral(e);if(e.type===this.lexerClass.ID)return this.pos++,this.parseVariable(e);if(e.type===this.lexerClass.CLOSE_BRACE)return null;throw oi.invalid_array_dimension(this.lexer.literalNames[this.lexerClass.RK_INTEGER],e)}},{key:"getIntLiteral",value:function(e){var t=e.text,n=si.createSourceInfo(e),i=new rn(Qe(t));return i.sourceInfo=n,i}},{key:"getRealLiteral",value:function(e){var t=si.createSourceInfo(e),n=new pn(Je(e.text));return n.sourceInfo=t,n}},{key:"getStringLiteral",value:function(e){var t=e.text,n=si.createSourceInfo(e),i=new Tn(Ye(t));return i.sourceInfo=n,i}},{key:"getBoolLiteral",value:function(e){var t=Ze(e.text),n=new yn(t);return n.sourceInfo=si.createSourceInfo(e),n}},{key:"parseArrayLiteral",value:function(e){if(!this.checkOpenCurly(!0)){var t=this.getToken();throw oi.array_init_not_literal(si.createSourceInfo(t))}var n=this.getToken();if(this.parsingArrayDimension>=2)throw oi.array_exceeds_2d(si.createSourceInfo(n));this.pos+=1,this.parsingArrayDimension+=1,this.consumeNewLines();var i=null;i=this.checkOpenCurly(!0)?this.parseVectorList(e):this.parseExpressionList(),this.consumeNewLines(),this.checkCloseCurly();var o=this.getToken();this.pos+=1,this.parsingArrayDimension-=1;var a=si.createSourceInfoFromList(n,o),r=1;i[0]instanceof Nn?r+=1:1==i.length&&console.log("Talvez uma variável seja uma melhor opção");var s=new $t.ArrayType(e,r),l=new Nn(s,i);return l.sourceInfo=a,l}},{key:"parseVectorList",value:function(e){for(var t=[],n=null;;){this.checkOpenCurly();var i=this.getToken();if(this.parsingArrayDimension>=2)throw oi.array_exceeds_2d(si.createSourceInfo(i));this.pos+=1,this.parsingArrayDimension+=1,this.consumeNewLines();var o=this.parseExpressionList();this.consumeNewLines(),this.checkCloseCurly();var a=this.getToken();this.pos+=1,this.parsingArrayDimension-=1;var r=si.createSourceInfoFromList(i,a);if(null==n)n=o.length;else if(n!==o.length){var s=this.inputStream.getText(i.start,a.stop);throw oi.invalid_matrix_literal_line(s,r)}var l=new $t.ArrayType(e,1),c=new Nn(l,o);if(c.sourceInfo=r,t.push(c),this.getToken().type!==this.lexerClass.COMMA)break;this.pos+=1,this.consumeNewLines()}return 1==t.length&&console.log("Talvez um vetor seja uma melhor opção"),t}},{key:"parseVariable",value:function(e){var t=si.createSourceInfo(e),n=new Pn(e.text);return n.sourceInfo=t,n}},{key:"parseFunction",value:function(){this.pushScope(e.FUNCTION);var t=[],n=this.getToken();if(n.type!==this.lexerClass.RK_FUNCTION)return null;this.pos++;var i=this.parseType(),o=0;this.checkOpenBrace(!0)&&(this.pos++,this.checkCloseBrace(),this.pos++,o++,this.checkOpenBrace(!0)&&(this.pos++,this.checkCloseBrace(),this.pos++,o++));var a=this.getToken(),r=this.parseID();this.checkFunctionDuplicate(r,a),this.checkOpenParenthesis(),this.pos++,this.consumeNewLines(),this.checkCloseParenthesis(!0)?this.pos++:(t=this.parseFormalParameters(),this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++),this.consumeNewLines();var s=this.parseCommandBlock(),l=i;o>0&&(l=new $t.ArrayType(i,o));var c=new ge(r,l,t,s);if(null===r&&!c.isMain)throw oi.invalid_main_return(Gt.getMainFunctionName(),this.lexer.literalNames[this.lexerClass.RK_VOID],n.line);if(c.isMain&&0!==t.length)throw oi.main_parameters();return this.popScope(),c}},{key:"parseFormalParameters",value:function(){for(var e=[];;){var t=0,n=!1,i=this.parseType(),o=this.getToken();o.type===this.lexerClass.RK_REFERENCE&&(n=!0,this.pos+=1,o=this.getToken());var a=this.parseID();this.checkVariableDuplicate(a,o),this.checkOpenBrace(!0)&&(this.pos+=1,t+=1,this.checkCloseBrace(),this.pos+=1,this.checkOpenBrace(!0)&&(this.pos+=1,t+=1,this.checkCloseBrace(),this.pos+=1));var r=null;r=t>0?new $t.ArrayType(i,t):i;var s=new He(r,a,n);if(s.sourceInfo=si.createSourceInfo(o),e.push(s),this.getToken().type!==this.lexerClass.COMMA)break;this.pos++,this.consumeNewLines()}return e}},{key:"parseID",value:function(){var t=this.getToken();if(t.type!==this.lexerClass.ID)throw oi.id_missing(t);return this.pos++,this.insideScope(e.FUNCTION)&&t.text===Gt.getMainFunctionName()?null:t.text}},{key:"parseMaybeLibID",value:function(){var e=this.getToken();if(e.type!==this.lexerClass.ID&&e.type!==this.lexerClass.LIB_ID)throw oi.id_missing(e);return this.pos++,e.text}},{key:"parseType",value:function(){var t=this.getToken();if(t.type===this.lexerClass.ID&&this.insideScope(e.FUNCTION))return he.Types.VOID;if(t.type===this.lexerClass.RK_VOID&&this.insideScope(e.FUNCTION))return this.pos++,he.Types.VOID;if(this.isVariableType(t))switch(this.pos++,t.type){case this.lexerClass.RK_INTEGER:return he.Types.INTEGER;case this.lexerClass.RK_BOOLEAN:return he.Types.BOOLEAN;case this.lexerClass.RK_REAL:return he.Types.REAL;case this.lexerClass.RK_STRING:return he.Types.STRING}throw oi.invalid_type(this.getTypeArray(),t)}},{key:"parseCommandBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[],n=[],i=!1;this.checkOpenCurly(e)&&(this.pos++,i=!0),this.consumeNewLines();for(var o=!1;;){var a=this.parseCommand();if(null===a)break;if(-1!==a)if(a instanceof Array){if(o){var r=this.getToken(this.pos-1);throw oi.invalid_var_declaration(r)}t=t.concat(a)}else o=!0,n.push(a)}return this.consumeNewLines(),i&&(this.checkCloseCurly(),this.pos++,this.consumeNewLines()),new Ae(t,n)}},{key:"parseCommand",value:function(){var t=this.getToken();if(this.isVariableType(t)){if(!this.insideScope(e.FUNCTION))throw oi.invalid_var_declaration(t);this.pushScope(e.BASE);var n=this.parseType();this.popScope();var i=this.parseDeclaration(n);return this.checkEOS(),this.pos++,i}if(t.type===this.lexerClass.ID)return this.parseIDCommand();if(t.type===this.lexerClass.LIB_ID)return this.parseIDCommand();if(t.type===this.lexerClass.RK_RETURN)return this.parseReturn();if(t.type===this.lexerClass.RK_WHILE||t.type===this.lexerClass.RK_WHILE_ALT)return this.parseWhile();if(t.type===this.lexerClass.RK_FOR||t.type===this.lexerClass.RK_FOR_ALT)return this.parseFor();if(t.type===this.lexerClass.RK_BREAK){if(!this.insideScope(e.BREAKABLE))throw oi.invalid_break_command(this.lexer.literalNames[this.lexerClass.RK_BREAK],t);return this.parseBreak()}return t.type===this.lexerClass.RK_SWITCH?this.parseSwitchCase():t.type===this.lexerClass.RK_DO?this.parseRepeatUntil():t.type===this.lexerClass.RK_IF?this.parseIfThenElse():this.checkEOS(!0)?(this.pos++,-1):null}},{key:"parseSwitchCase",value:function(){this.pushScope(e.BREAKABLE),this.pos++,this.checkOpenParenthesis(),this.pos++,this.consumeNewLines();var t=this.parseExpressionOR();this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,this.consumeNewLines(),this.checkOpenCurly(),this.pos++,this.consumeNewLines();var n=this.parseCases();return this.consumeNewLines(),this.checkCloseCurly(),this.pos++,this.consumeNewLines(),this.popScope(),new Me(t,n)}},{key:"parseRepeatUntil",value:function(){this.pos++,this.consumeNewLines(),this.pushScope(e.BREAKABLE);var t=this.parseCommandBlock();this.consumeNewLines();var n=this.getToken();if(n.type!==this.lexerClass.RK_DO_UNTIL)throw oi.token_missing_one(this.lexer.literalNames[this.lexerClass.RK_DO_UNTIL],n);this.pos++,this.checkOpenParenthesis(),this.pos++,this.consumeNewLines();var i=this.parseExpressionOR();return this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,this.checkEOS(),this.popScope(),new ke(i,t)}},{key:"parseIfThenElse",value:function(){this.insideScope(e.BREAKABLE)?this.pushScope(e.BREAKABLE):this.pushScope(e.COMMAND);var t=this.getToken();this.pos++,this.checkOpenParenthesis(),this.pos++,this.consumeNewLines();var n=this.parseExpressionOR();this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,this.consumeNewLines();var i=this.parseCommandBlock();if(this.getToken().type===this.lexerClass.RK_ELSE){this.pos++,this.consumeNewLines();var o=this.getToken(),a=null;if(this.checkOpenCurly(!0))a=this.parseCommandBlock();else{if(o.type!==this.lexerClass.RK_IF)throw oi.token_missing_list([this.lexer.literalNames[this.lexerClass.RK_IF],"{"],o);a=this.parseIfThenElse()}this.popScope();var r=new Te(n,i,a);return r.sourceInfo=si.createSourceInfo(t),r}this.popScope();var s=new Te(n,i,null);return s.sourceInfo=si.createSourceInfo(t),s}},{key:"parseFor",value:function(){this.pushScope(e.BREAKABLE);var t=this.getToken();this.pos+=1;var n=this.getToken(),i=this.parseID(),o=new Pn(i);o.sourceInfo=si.createSourceInfo(n);var a=this.parseForParameters(this.lexerClass.RK_FOR_FROM),r=this.parseForParameters(this.lexerClass.RK_FOR_TO),s=this.parseForParameters(this.lexerClass.RK_FOR_PASS);this.consumeNewLines();var l=this.parseCommandBlock();this.popScope();var c=new ve(o,a,r,s,l);return c.sourceInfo=si.createSourceInfo(t),c}},{key:"parseWhile",value:function(){this.pushScope(e.BREAKABLE);var t=this.getToken();this.pos++,this.checkOpenParenthesis(),this.pos++,this.consumeNewLines();var n=this.parseExpressionOR();this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,this.consumeNewLines();var i=this.parseCommandBlock();this.popScope();var o=new ue(n,i);return o.sourceInfo=si.createSourceInfo(t),o}},{key:"parseBreak",value:function(){return this.pos++,this.checkEOS(),this.pos++,new S}},{key:"parseReturn",value:function(){this.pos++;var e=null;return this.checkEOS(!0)||(e=this.parseExpressionOR(),this.checkEOS()),this.pos++,new M(e)}},{key:"parseIDCommand",value:function(){var e=this.getToken(),t=e.type===this.lexerClass.ID,n=this.parseMaybeLibID();if(this.checkOpenBrace(!0)){this.pos++;var i,o=null;this.consumeNewLines(),i=this.parseExpression(),this.consumeNewLines(),this.checkCloseBrace(),this.pos++,this.checkOpenBrace(!0)&&(this.pos++,this.consumeNewLines(),o=this.parseExpression(),this.consumeNewLines(),this.checkCloseBrace(),this.pos++);var a=this.getToken();if(a.type!==this.lexerClass.EQUAL)throw oi.token_missing_one("=",a);this.pos++;var r=this.parseExpressionOR();this.checkEOS(),this.pos++;var s=new z(n,i,o,r);return s.sourceInfo=si.createSourceInfo(a),s}var l=this.getToken();if(t&&l.type===this.lexerClass.EQUAL){this.pos++;var c=this.parseExpressionOR();this.checkEOS(),this.pos++;var u=new G(n,c);return u.sourceInfo=si.createSourceInfo(l),u}if(l.type===this.lexerClass.OPEN_PARENTHESIS){var d=this.parseFunctionCallCommand(n);return this.checkEOS(),this.pos++,d}throw t?oi.token_missing_list(["=","("],l):oi.invalid_id_format(e)}},{key:"parseForParameters",value:function(e){if(e===this.lexerClass.RK_FOR_PASS&&this.checkOpenCurly(!0))return null;var t=this.getToken();if(t.type!==e){var n=this.lexer.literalNames[e];throw new Error("Error de sintaxe no comando repita_para: esperava-se "+n+" mas encontrou "+t.text)}this.pos+=1;var i=this.getToken(),o=!1,a=null;i.type===this.lexerClass.SUM_OP&&(o=!0,a=i.text,this.pos+=1,i=this.getToken());var r=null;if(i.type===this.lexerClass.ID?(r=new Pn(this.parseID())).sourceInfo=si.createSourceInfo(i):i.type===this.lexerClass.INTEGER&&(this.pos+=1,r=this.getIntLiteral(i)),null==r){var s=this.lexer.literalNames[e];throw new Error("Error de sintaxe no comando repeita_para: "+i.text+" não é compativel com o esperado para o paramentro "+s+". O valor deve ser um inteiro ou variável.")}return o&&(r=new Xn(gt(a),r)),r}},{key:"parseCases",value:function(){var e=this.getToken();if(e.type!==this.lexerClass.RK_CASE)throw oi.token_missing_one(this.lexer.literalNames[this.lexerClass.RK_CASE],e);if(this.pos++,this.getToken().type===this.lexerClass.RK_DEFAULT){this.pos++;var t=this.getToken();if(t.type!==this.lexerClass.COLON)throw oi.token_missing_one(":",t);this.pos++,this.consumeNewLines();var n=this.parseCommandBlock(!0),i=new De(null);return i.setCommands(n.commands),[i]}var o=this.parseExpressionOR(),a=this.getToken();if(a.type!==this.lexerClass.COLON)throw oi.token_missing_one(":",a);this.pos++,this.consumeNewLines();var r=this.parseCommandBlock(!0),s=new De(o);return s.setCommands(r.commands),this.getToken().type===this.lexerClass.RK_CASE?[s].concat(this.parseCases()):[s]}},{key:"parseExpressionOR",value:function(){for(var e=this.parseExpressionAND();this.getToken().type===this.lexerClass.OR_OPERATOR;){var t=this.getToken();this.pos++;var n=gt("or");this.consumeNewLines();var i=this.parseExpressionAND(),o=new Gn(n,e,i);o.sourceInfo=si.createSourceInfo(t),e=o}return e}},{key:"parseExpressionAND",value:function(){for(var e=this.parseExpressionNot();this.getToken().type===this.lexerClass.AND_OPERATOR;){var t=this.getToken();this.pos++;var n=gt("and");this.consumeNewLines();var i=this.parseExpressionNot(),o=new Gn(n,e,i);o.sourceInfo=si.createSourceInfo(t),e=o}return e}},{key:"parseExpressionNot",value:function(){if(this.getToken().type===this.lexerClass.NOT_OPERATOR){var e=this.getToken();this.pos++;var t=gt("not"),n=this.parseExpressionRel(),i=new Xn(t,n);return i.sourceInfo=si.createSourceInfo(e),i}return this.parseExpressionRel()}},{key:"parseExpressionRel",value:function(){for(var e=this.parseExpression();this.getToken().type===this.lexerClass.RELATIONAL_OPERATOR;){var t=this.getToken();this.pos++;var n=gt(t.text),i=this.parseExpression(),o=new Gn(n,e,i);o.sourceInfo=si.createSourceInfo(t),e=o}return e}},{key:"parseExpression",value:function(){for(var e=this.parseFactor();this.getToken().type===this.lexerClass.SUM_OP;){var t=this.getToken();this.pos++;var n=gt(t.text),i=this.parseFactor(),o=new Gn(n,e,i);o.sourceInfo=si.createSourceInfo(t),e=o}return e}},{key:"parseFactor",value:function(){for(var e=this.parseTerm();this.getToken().type===this.lexerClass.MULTI_OP;){var t=this.getToken();this.pos++;var n=gt(t.text),i=this.parseTerm(),o=new Gn(n,e,i);o.sourceInfo=si.createSourceInfo(t),e=o}return e}},{key:"parseTerm",value:function(){var e=this.getToken(),t=null,n=null;switch(e.type){case this.lexerClass.SUM_OP:return this.pos++,t=si.createSourceInfo(e),(n=new Xn(gt(e.text),this.parseTerm())).sourceInfo=t,n;case this.lexerClass.INTEGER:return this.pos++,this.getIntLiteral(e);case this.lexerClass.REAL:return this.pos++,this.getRealLiteral(e);case this.lexerClass.STRING:return this.pos++,this.getStringLiteral(e);case this.lexerClass.RK_TRUE:case this.lexerClass.RK_FALSE:return this.pos++,this.getBoolLiteral(e);case this.lexerClass.OPEN_CURLY:throw oi.annonymous_array_literal(e);case this.lexerClass.ID:case this.lexerClass.LIB_ID:return this.parseIDTerm();case this.lexerClass.OPEN_PARENTHESIS:return this.parseParenthesisExp();default:throw oi.invalid_terminal(e)}}},{key:"parseIDTerm",value:function(){var e=this.getToken(),t=this.parseMaybeLibID(),n=e.type===this.lexerClass.ID;if(n&&this.checkOpenBrace(!0)){var i=null;this.pos++;var o=this.parseExpression(),a=null;this.consumeNewLines(),this.checkCloseBrace(),i=this.getToken(),this.pos++,this.checkOpenBrace(!0)&&(this.pos++,a=this.parseExpression(),this.consumeNewLines(),this.checkCloseBrace(),i=this.getToken(),this.pos++);var r=si.createSourceInfoFromList(e,i),s=new d(t,o,a);return s.sourceInfo=r,s}if(this.checkOpenParenthesis(!0))return this.parseFunctionCallExpression(t);if(n){var l=si.createSourceInfo(e),c=new Pn(t);return c.sourceInfo=l,c}throw oi.invalid_id_format(e)}},{key:"getFunctionName",value:function(e){var t=Gt.getInternalName(e);return null===t?e===Gt.getMainFunctionName()?null:e:t}},{key:"parseFunctionCallExpression",value:function(e){var t=this.getToken(this.pos-1),n=this.parseActualParameters(),i=this.getToken(this.pos-1),o=this.getFunctionName(e),a=si.createSourceInfoFromList(t,i),r=new Xt(o,n);return r.sourceInfo=a,r}},{key:"parseFunctionCallCommand",value:function(e){return this.parseFunctionCallExpression(e)}},{key:"parseParenthesisExp",value:function(){this.checkOpenParenthesis();var e=this.getToken();this.pos+=1,this.consumeNewLines();var t=this.parseExpressionOR();this.consumeNewLines(),this.checkCloseParenthesis();var n=this.getToken();return this.pos+=1,t.sourceInfo=si.createSourceInfoFromList(e,n),t.parenthesis=!0,t}},{key:"parseActualParameters",value:function(){if(this.checkOpenParenthesis(),this.pos++,this.checkCloseParenthesis(!0))return this.pos++,[];this.consumeNewLines();var e=this.parseExpressionList();return this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,e}},{key:"parseExpressionList",value:function(){for(var e=[];;){var t=this.parseExpressionOR();if(e.push(t),this.getToken().type!==this.lexerClass.COMMA)break;this.pos++,this.consumeNewLines()}return e}},{key:"getTypeArray",value:function(){var t=this;return(this.insideScope(e.FUNCTION)?this.functionTypes:this.variableTypes).map((function(e){return t.lexer.literalNames[e]}))}}]),e}(),di=n(6),pi=n(14);function _i(){var e=[[],[],[],[]];return e[he.Types.INTEGER.ord][he.Types.INTEGER.ord]=he.Types.INTEGER,e[he.Types.INTEGER.ord][he.Types.REAL.ord]=he.Types.REAL,e[he.Types.REAL.ord][he.Types.INTEGER.ord]=he.Types.REAL,e[he.Types.REAL.ord][he.Types.REAL.ord]=he.Types.REAL,e}function fi(){var e=[[],[],[],[]];return e[he.Types.INTEGER.ord][he.Types.INTEGER.ord]=he.Types.BOOLEAN,e[he.Types.REAL.ord][he.Types.REAL.ord]=he.Types.BOOLEAN,e[he.Types.BOOLEAN.ord][he.Types.BOOLEAN.ord]=he.Types.BOOLEAN,e[he.Types.STRING.ord][he.Types.STRING.ord]=he.Types.BOOLEAN,e}function mi(){var e=[[],[],[],[]];return e[he.Types.INTEGER.ord][he.Types.INTEGER.ord]=he.Types.BOOLEAN,e[he.Types.REAL.ord][he.Types.REAL.ord]=he.Types.BOOLEAN,e[he.Types.STRING.ord][he.Types.STRING.ord]=he.Types.BOOLEAN,e}function vi(){var e=[[],[],[],[]];return e[he.Types.BOOLEAN.ord][he.Types.BOOLEAN.ord]=he.Types.BOOLEAN,e}function hi(){var e=[];return e[he.Types.INTEGER.ord]=he.Types.INTEGER,e[he.Types.REAL.ord]=he.Types.REAL,e}var yi,gi,bi=((gi=new WeakMap).set(yt.ADD,((yi=[[],[],[],[]])[he.Types.INTEGER.ord][he.Types.INTEGER.ord]=he.Types.INTEGER,yi[he.Types.INTEGER.ord][he.Types.REAL.ord]=he.Types.REAL,yi[he.Types.INTEGER.ord][he.Types.STRING.ord]=he.Types.STRING,yi[he.Types.REAL.ord][he.Types.INTEGER.ord]=he.Types.REAL,yi[he.Types.REAL.ord][he.Types.REAL.ord]=he.Types.REAL,yi[he.Types.REAL.ord][he.Types.STRING.ord]=he.Types.STRING,yi[he.Types.STRING.ord][he.Types.INTEGER.ord]=he.Types.STRING,yi[he.Types.STRING.ord][he.Types.REAL.ord]=he.Types.STRING,yi[he.Types.STRING.ord][he.Types.STRING.ord]=he.Types.STRING,yi[he.Types.STRING.ord][he.Types.BOOLEAN.ord]=he.Types.STRING,yi)),gi.set(yt.SUB,_i()),gi.set(yt.MULT,_i()),gi.set(yt.DIV,_i()),gi.set(yt.EQ,fi()),gi.set(yt.NEQ,fi()),gi.set(yt.GE,mi()),gi.set(yt.GT,mi()),gi.set(yt.LE,mi()),gi.set(yt.LT,mi()),gi.set(yt.OR,vi()),gi.set(yt.AND,vi()),gi.set(yt.MOD,function(){var e=[[],[],[],[]];return e[he.Types.INTEGER.ord][he.Types.INTEGER.ord]=he.Types.INTEGER,e}()),gi),wi=function(){var e,t=new WeakMap;return t.set(yt.ADD,hi()),t.set(yt.SUB,hi()),t.set(yt.NOT,((e=[])[he.Types.BOOLEAN.ord]=he.Types.BOOLEAN,e)),t}();function xi(e,t,n){try{if(t instanceof Ut.MultiType&&n instanceof Ut.MultiType){for(var i=[],o=0;o=5&&e.ord<=10)return he.Types.BOOLEAN}return he.Types.UNDEFINED}return s}catch(e){if(e instanceof TypeError)return he.Types.UNDEFINED;throw e}}function Ei(e,t){try{if(t instanceof Ut.MultiType)return t;var n=wi.get(e)[t.ord];return null==n?he.Types.UNDEFINED:n}catch(e){if(e instanceof TypeError)return he.Types.UNDEFINED;throw e}}var Ti=n(16),Ri=n(33),Ai=n(17),Oi=n(37),Ii=n(26);function Ci(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],i=!0,o=!1,a=void 0;try{for(var r,s=e[Symbol.iterator]();!(i=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Ni(e,t){for(var n=0;n=y.max_instruction_count?o(kt.exceed_max_instructions()):n.forceKill?o("FORCED_KILL!"):e.mode===ze.Modes.PAUSE?i(n.executeCommand(e,t)):e.mode===ze.Modes.RETURN?i(e):n.checkContext(pi.Context.BREAKABLE)&&e.mode===ze.Modes.BREAK?i(e):n.mode===ze.Modes.ABORT?o(At.getMessage("aborted_execution")):t instanceof J?i(n.executeDeclaration(e,t)):t instanceof z?i(n.executeArrayIndexAssign(e,t)):t instanceof G?i(n.executeAssign(e,t)):t instanceof S?i(n.executeBreak(e,t)):t instanceof M?i(n.executeReturn(e,t)):t instanceof Te?i(n.executeIfThenElse(e,t)):t instanceof ke?i(n.executeRepeatUntil(e,t)):t instanceof ue?i(n.executeWhile(e,t)):t instanceof ve?i(n.executeFor(e,t)):t instanceof Me?i(n.executeSwitch(e,t)):t instanceof Xt?i(n.executeFunctionCall(e,t)):t instanceof Ve?i(n.executeSysCall(e,t)):o(kt.unknown_command(t.sourceInfo))};n.instruction_count%y.suspend_threshold==0?setTimeout(a,5):a()}))}},{key:"executeSysCall",value:function(e,t){return t.langFunc.bind(this)(e,t)}},{key:"executeFunctionCall",value:function(t,n){var i=this,o=null;return o=n.isMainCall?this.findMainFunction():this.findFunction(n.id),this.function_call_stack.push(n.sourceInfo),this.runFunction(o,n.actualParameters,t).then((function(n){if(n.destroy(),he.Types.VOID.isCompatible(o.returnType)||n.mode===ze.Modes.RETURN)return i.function_call_stack.pop(),t;var a=o.name===e.MAIN_INTERNAL_ID?Gt.getMainFunctionName():o.name;return Promise.reject(kt.function_no_return(a))}))}},{key:"executeSwitch",value:function(e,t){var n=this;return this.context.push(pi.Context.BREAKABLE),t.cases.reduce((function(e,i){return e.then((function(e){if(n.ignoreSwitchCases(e[1]))return Promise.resolve(e);if(e[0]||i.isDefault)return n.executeCommands(e[1],i.commands).then((function(e){return Promise.resolve([!0,e])}));var o=new Gn(yt.EQ,t.expression,i.expression);return o.sourceInfo=i.sourceInfo,n.evaluateExpression(e[1],o).then((function(e){return e.get()})).then((function(t){return t?n.executeCommands(e[1],i.commands).then((function(e){return Promise.resolve([!0,e])})):Promise.resolve(e)}))}))}),Promise.resolve([!1,e])).then((function(e){n.context.pop();var t=e[1];return t.mode===ze.Modes.BREAK&&(t.mode=ze.Modes.RUN),t}))}},{key:"executeFor",value:function(e,t){var n=this,i=new G(t.for_id.id,t.for_from);i.sourceInfo=t.sourceInfo;var o=[];return null==t.for_pass?(o.push(Promise.resolve(null)),o.push(this.evaluateExpression(e,new Gn(yt.GE,t.for_to,t.for_from)))):(o.push(this.evaluateExpression(e,new Gn(yt.GE,t.for_pass,new rn(Qe(0))))),o.push(Promise.resolve(null))),Promise.all(o).then((function(o){var a=!0,r=void 0,s=null,l=t.for_pass;null==o[0]?r=o[1].value:a=o[0].value,null==r?s=new Gn(a?yt.LE:yt.GE,t.for_id,t.for_to):r?(l=new rn(Qe(1)),s=new Gn(yt.LE,t.for_id,t.for_to)):(l=new rn(Qe(-1)),s=new Gn(yt.GE,t.for_id,t.for_to)),s.sourceInfo=t.sourceInfo;var c=new G(t.for_id.id,new Gn(yt.ADD,t.for_id,l));c.sourceInfo=t.sourceInfo;var u=new Ae([],t.commands.concat(c)),d=new ue(s,u);d.sourceInfo=t.sourceInfo;var p=[i,d];return n.executeCommands(e,p)})).catch((function(e){return Promise.reject(e)}))}},{key:"executeRepeatUntil",value:function(e,t){var n=this;try{return this.context.push(pi.Context.BREAKABLE),this.executeCommands(e,t.commands).then((function(e){return e.mode===ze.Modes.BREAK?(n.context.pop(),e.mode=ze.Modes.RUN,e):n.evaluateExpression(e,t.expression).then((function(i){return i.type.isCompatible(he.Types.BOOLEAN)?i.get()?(n.context.pop(),e):(n.context.pop(),n.executeCommand(e,t)):Promise.reject(kt.loop_condition_type_full(t.sourceInfo))}))}))}catch(e){return Promise.reject(e)}}},{key:"executeWhile",value:function(e,t){var n=this;try{return this.context.push(pi.Context.BREAKABLE),this.evaluateExpression(e,t.expression).then((function(i){return i.type.isCompatible(he.Types.BOOLEAN)?i.get()?n.executeCommands(e,t.commands).then((function(e){return n.context.pop(),e.mode===ze.Modes.BREAK?(e.mode=ze.Modes.RUN,e):n.executeCommand(e,t)})):(n.context.pop(),e):Promise.reject(kt.loop_condition_type_full(t.expression.toString(),t.sourceInfo))}))}catch(e){return Promise.reject(e)}}},{key:"executeIfThenElse",value:function(e,t){var n=this;try{return this.evaluateExpression(e,t.condition).then((function(i){return i.type.isCompatible(he.Types.BOOLEAN)?i.get()?n.executeCommands(e,t.ifTrue.commands):null!==t.ifFalse?t.ifFalse instanceof Te?n.executeCommand(e,t.ifFalse):n.executeCommands(e,t.ifFalse.commands):Promise.resolve(e):Promise.reject(kt.if_condition_type_full(t.condition.toString(),t.sourceInfo))}))}catch(e){return Promise.reject(e)}}},{key:"executeReturn",value:function(t,n){try{var i=t.name===e.MAIN_INTERNAL_ID?Gt.getMainFunctionName():t.name,o=this.findFunction(t.name).returnType;return this.evaluateExpression(t,n.expression).then((function(e){var a=e;if(null===e&&o.isCompatible(he.Types.VOID))return t.mode=ze.Modes.RETURN,Promise.resolve(t);if(null!==e&&o.isCompatible(e.type))return t.insertStore("$",a),t.mode=ze.Modes.RETURN,Promise.resolve(t);if(!y.enable_type_casting||!di.Store.canImplicitTypeCast(o,e.type)){var r=o.stringInfo()[0];return Promise.reject(kt.invalid_return_type_full(i,r.type,r.dim,n.sourceInfo))}a=di.Store.doImplicitCasting(o,e)}))}catch(e){return Promise.reject(e)}}},{key:"executeBreak",value:function(e,t){return this.checkContext(pi.Context.BREAKABLE)?(e.mode=ze.Modes.BREAK,Promise.resolve(e)):Promise.reject(kt.unexpected_break_command_full(t.sourceInfo))}},{key:"executeAssign",value:function(e,t){try{var n=e.applyStore(t.id);return n.isConst?Promise.reject(kt.invalid_const_assignment_full(t.id,t.sourceInfo)):this.evaluateExpression(e,t.expression).then((function(i){var o=i;if(!n.type.isCompatible(o.type)){if(!y.enable_type_casting||!di.Store.canImplicitTypeCast(n.type,i.type)){var a=n.type.stringInfo()[0],r=i.type.stringInfo()[0],s=t.expression.toString();return Promise.reject(kt.incompatible_types_full(a.type,a.dim,r.type,r.dim,s,t.sourceInfo))}o=di.Store.doImplicitCasting(n.type,o)}if(n instanceof Ai.ArrayStoreValue){var l=null==o.columns?0:o.columns;if(n.lines!==o.lines||n.columns!==l){var c=t.expression.toString();return n.isVector()?Promise.reject(kt.invalid_vector_assignment_full(t.id,n.lines,c,o.lines,t.sourceInfo)):Promise.reject(kt.invalid_matrix_assignment_full(t.id,n.lines,n.columns,c,o.lines,o.columns,t.sourceInfo))}}return e.updateStore(t.id,o),e}))}catch(e){return Promise.reject(e)}}},{key:"executeArrayIndexAssign",value:function(e,t){var n=e.applyStore(t.id),i=0;if(n.isConst)return Promise.reject(kt.invalid_const_assignment_full(t.id,t.sourceInfo));if(!(n.type instanceof $t.ArrayType))return Promise.reject(kt.invalid_array_access_full(t.id,t.sourceInfo));var o=this.evaluateExpression(e,t.line),a=this.evaluateExpression(e,t.column),r=this.evaluateExpression(e,t.expression);return Promise.all([o,a,r]).then((function(o){var a=Ci(o,3),r=a[0],s=a[1],l=a[2];if(!he.Types.INTEGER.isCompatible(r.type))return Promise.reject(kt.array_dimension_not_int_full(t.sourceInfo));var c=r.get().toNumber();i+=1;var u=void 0;if(null!=s){if(!he.Types.INTEGER.isCompatible(s.type))return Promise.reject(kt.array_dimension_not_int_full(t.sourceInfo));u=s.get().toNumber(),i+=1}var d=l;if(c>=n.lines)return n.isVector?Promise.reject(kt.vector_line_outbounds_full(t.id,c,n.lines,t.sourceInfo)):Promise.reject(kt.matrix_line_outbounds_full(t.id,c,n.lines,t.sourceInfo));if(c<0)return Promise.reject(kt.array_dimension_not_positive_full(t.sourceInfo));if(null!=u&&0===n.columns)return Promise.reject(kt.vector_not_matrix_full(t.id,t.sourceInfo));if(null!=u){if(u>=n.columns)return Promise.reject(kt.matrix_column_outbounds_full(t.id,u,n.columns,t.sourceInfo));if(u<0)return Promise.reject(kt.array_dimension_not_positive_full(t.sourceInfo))}if(!n.type.canAccept(l.type,i)){if(!y.enable_type_casting||!di.Store.canImplicitTypeCast(n.type.innerType,l.type)){var p=n.type.innerType.stringInfo()[0],_=l.type.stringInfo()[0],f=t.expression.toString();return Promise.reject(kt.incompatible_types_full(p.type,p.dim,_.type,_.dim,f,t.sourceInfo))}d=di.Store.doImplicitCasting(n.type.innerType,l)}var m=n.getAt(c,u);if(m instanceof Ai.ArrayStoreValue&&(m.lines!==d.lines||m.columns!==d.columns)){var v=t.expression.toString();return Promise.reject(kt.invalid_matrix_index_assign_full(t.id,c,m.lines,v,d.lines,t.sourceInfo))}return e.updateStoreArray(t.id,d,c,u)}))}},{key:"executeDeclaration",value:function(e,t){try{var n=Promise.resolve(null);return t instanceof oe?this.executeArrayDeclaration(e,t):(null!==t.initial&&(n=this.evaluateExpression(e,t.initial)),n.then((function(n){var i=n,o=null;if(null!==n){if(!n.type.isCompatible(t.type)){if(!y.enable_type_casting||!di.Store.canImplicitTypeCast(t.type,n.type)){var a=n.type.stringInfo()[0],r=n.type.stringInfo()[0],s=t.expression.toString();return Promise.reject(kt.incompatible_types_full(a.type,a.dim,r.type,r.dim,s,t.sourceInfo))}i=di.Store.doImplicitCasting(t.type,i)}o=new Lt.StoreValue(t.type,i.get(),null,t.isConst)}else o=new Lt.StoreValue(t.type,null,null,t.isConst);return e.insertStore(t.id,o),e})))}catch(e){return Promise.reject(e)}}},{key:"executeArrayDeclaration",value:function(e,t){var n=this,i=this.evaluateExpression(e,t.lines),o=null===t.columns?null:this.evaluateExpression(e,t.columns);return Promise.all([i,o]).then((function(i){var o=Ci(i,2),a=o[0],r=o[1];if(!he.Types.INTEGER.isCompatible(a.type))return Promise.reject(kt.array_dimension_not_int_full(t.sourceInfo));var s=a.get().toNumber();if(s<0)return Promise.reject(kt.array_dimension_not_positive_full(t.sourceInfo));var l=null;if(null!==r){if(!he.Types.INTEGER.isCompatible(r.type))return Promise.reject(kt.array_dimension_not_int_full(t.sourceInfo));if((l=r.get().toNumber())<0)return Promise.reject(kt.array_dimension_not_positive_full(t.sourceInfo))}var c=Promise.resolve(null);return null!==t.initial&&(c=n.evaluateArrayLiteral(e,t.initial,t.type,s,l)),c.then((function(n){var i=null;return i=null!==n?new Ai.ArrayStoreValue(t.type,n,s,l,null,t.isConst):new Ai.ArrayStoreValue(t.type,[],s,l,null,t.isConst),e.insertStore(t.id,i),e}))}))}},{key:"evaluateExpression",value:function(e,t){var n=this;return this.instruction_count+=1,new Promise((function(i,o){var a=function(){return n.mode===ze.Modes.ABORT?o(At.getMessage("aborted_execution")):n.instruction_count>=y.max_instruction_count?o(new Error("Número de instruções excedeu o limite definido. Verifique se seu código não possui laços infinitos ou muitas chamadas de funções recursivas.")):t instanceof Xn?i(n.evaluateUnaryApp(e,t)):t instanceof Gn?i(n.evaluateInfixApp(e,t)):t instanceof d?i(n.evaluateArrayAccess(e,t)):t instanceof Pn?i(n.evaluateVariableLiteral(e,t)):t instanceof rn?i(n.evaluateLiteral(e,t)):t instanceof pn?i(n.evaluateLiteral(e,t)):t instanceof yn?i(n.evaluateLiteral(e,t)):t instanceof Tn?i(n.evaluateLiteral(e,t)):t instanceof Nn?o(new Error("Internal Error: The system should not eval an array literal.")):i(t instanceof Xt?n.evaluateFunctionCall(e,t):null)};n.instruction_count%y.suspend_threshold==0?setTimeout(a,5):a()}))}},{key:"evaluateFunctionCall",value:function(e,t){var n=this;if(t.isMainCall)return Promise.reject(kt.void_in_expression_full(Gt.getMainFunctionName(),t.sourceInfo));var i=this.findFunction(t.id);return he.Types.VOID.isCompatible(i.returnType)?Promise.reject(kt.void_in_expression_full(t.id,t.sourceInfo)):this.function_call_stack.length>=y.max_call_stack?Promise.reject(kt.exceeded_recursive_calls(t.sourceInfo)):(this.function_call_stack.push(t.sourceInfo),this.runFunction(i,t.actualParameters,e).then((function(e){if(e.mode!==ze.Modes.RETURN)return Promise.reject(new Error("!!!Internal error: the function that was called did not have a return command or did not set the store mode properly -> "+t.id));var i=e.applyStore("$");return e.destroy(),n.function_call_stack.pop(),Promise.resolve(i)})))}},{key:"evaluateArrayLiteral",value:function(e,t,n,i,o){if(t.isVector)return null!=o?Promise.reject(new Error("This should never happen: Matrix cannot be initialized by a vector")):this.evaluateVector(e,t,n,i).then((function(e){return Promise.resolve(e)}));if(null==o)return Promise.reject(new Error("This should never happen: Vector cannot be initialized by a matrix"));var a=this.evaluateMatrix(e,t,n,i,o);return Promise.all(a).then((function(e){var t=e.reduce((function(e,t){return e.concat(t)}),[]);return Promise.resolve(t)}))}},{key:"evaluateVector",value:function(e,t,n,i){var o=this,a=t.value;return i!==a.length?Promise.reject(kt.invalid_number_elements_vector(i,t.toString(),a.length,t.sourceInfo)):Promise.all(a.map((function(t){return o.evaluateExpression(e,t)}))).then((function(e){return e.map((function(t,i){if(!n.canAccept(t.type,1)){if(!y.enable_type_casting||!di.Store.canImplicitTypeCast(n.innerType,t.type)){var o=e[i].toString();return Promise.reject(kt.invalid_array_literal_type_full(o,e[i].sourceInfo))}return di.Store.doImplicitCasting(n.innerType,t)}return t}))}))}},{key:"evaluateMatrix",value:function(e,t,n,i,o){var a=this,r=t.value;return r.length!==i?Promise.reject(kt.invalid_number_lines_matrix(i,t.toString(),r.length,t.sourceInfo)):r.map((function(t){var i=new $t.ArrayType(n.innerType,1);return a.evaluateVector(e,t,i,o)}))}},{key:"evaluateLiteral",value:function(e,t){return Promise.resolve(new Lt.StoreValue(t.type,t.value))}},{key:"evaluateVariableLiteral",value:function(e,t){try{var n=e.applyStore(t.id);return Promise.resolve(n)}catch(e){return Promise.reject(e)}}},{key:"evaluateArrayAccess",value:function(e,t){var n=e.getStoreObject(t.id);if(!(n.type instanceof $t.ArrayType))return Promise.reject(kt.invalid_array_access_full(t.id,t.sourceInfo));var i=this.evaluateExpression(e,t.line),o=this.evaluateExpression(e,t.column);return Promise.all([i,o]).then((function(e){var i=Ci(e,2),o=i[0],a=i[1];if(!he.Types.INTEGER.isCompatible(o.type))return Promise.reject(kt.array_dimension_not_int_full(t.sourceInfo));var r=o.get().toNumber(),s=null;if(null!==a){if(!he.Types.INTEGER.isCompatible(a.type))return Promise.reject(kt.array_dimension_not_int_full(t.sourceInfo));s=a.get().toNumber()}if(r>=n.lines)return n.isVector?Promise.reject(kt.vector_line_outbounds_full(t.id,r,n.lines,t.sourceInfo)):Promise.reject(kt.matrix_line_outbounds_full(t.id,r,n.lines,t.sourceInfo));if(r<0)return Promise.reject(kt.array_dimension_not_positive_full(t.sourceInfo));if(null!==s&&0===n.columns)return Promise.reject(kt.vector_not_matrix_full(t.id,t.sourceInfo));if(null!==s){if(s>=n.columns)return Promise.reject(kt.matrix_column_outbounds_full(t.id,s,n.columns,t.sourceInfo));if(s<0)return Promise.reject(kt.array_dimension_not_positive_full(t.sourceInfo))}var l=n.getAt(r,s),c=n.type.innerType;if(Array.isArray(l)){var u=l.map((function(e,t){return new Ii.StoreValueAddress(c,e,r,t,n.id,n.readOnly)}));return Promise.resolve(new Ai.ArrayStoreValue(new $t.ArrayType(c,1),u,n.columns,null,n.id,n.readOnly))}return Promise.resolve(new Ii.StoreValueAddress(c,l,r,s,n.id,n.readOnly))}))}},{key:"evaluateUnaryApp",value:function(e,t){return this.evaluateExpression(e,t.left).then((function(e){var n=Ei(t.op,e.type);if(he.Types.UNDEFINED.isCompatible(n)){var i=e.type.stringInfo()[0];return Promise.reject(kt.invalid_unary_op_full(t.op,i.type,i.dim,t.sourceInfo))}switch(t.op.ord){case yt.ADD.ord:return new Lt.StoreValue(n,e.get());case yt.SUB.ord:return new Lt.StoreValue(n,e.get().negated());case yt.NOT.ord:return new Lt.StoreValue(n,!e.get());default:return Promise.reject(new lt("!!!Critical Invalid UnaryApp "+t.op))}}))}},{key:"evaluateInfixApp",value:function(e,t){var n=this.evaluateExpression(e,t.left),i=this.evaluateExpression(e,t.right);return Promise.all([n,i]).then((function(e){var n=!1,i=e[0],o=e[1],a=xi(t.op,i.type,o.type);if(he.Types.UNDEFINED.isCompatible(a)){if(!y.enable_type_casting||!di.Store.canImplicitTypeCast(i.type,o.type)){var r=i.type.stringInfo()[0],s=o.type.stringInfo()[0];return Promise.reject(kt.invalid_infix_op_full(t.op,r.type,r.dim,s.type,s.dim,t.sourceInfo))}n=!0}var l=null;switch(t.op.ord){case yt.ADD.ord:if(he.Types.STRING.isCompatible(i.type)){var c=tt(o.get(),o.type);return new Lt.StoreValue(a,i.get()+c)}if(he.Types.STRING.isCompatible(o.type)){var u=tt(i.get(),i.type);return new Lt.StoreValue(a,u+o.get())}return new Lt.StoreValue(a,i.get().plus(o.get()));case yt.SUB.ord:return new Lt.StoreValue(a,i.get().minus(o.get()));case yt.MULT.ord:return l=i.get().times(o.get()),new Lt.StoreValue(a,l);case yt.DIV.ord:return 0==o.get()?Promise.reject(kt.divsion_by_zero_full(t.toString(),t.sourceInfo)):(l=he.Types.INTEGER.isCompatible(a)?i.get().divToInt(o.get()):i.get().div(o.get()),new Lt.StoreValue(a,l));case yt.MOD.ord:var d=i.get(),p=o.get();return n&&(a=he.Types.INTEGER,d=d.trunc(),p=p.trunc()),l=d.modulo(p),new Lt.StoreValue(a,l);case yt.GT.ord:var _=i.get(),f=o.get();return he.Types.STRING.isCompatible(i.type)?l=_.length>f.length:(n&&(a=he.Types.BOOLEAN,_=_.trunc(),f=f.trunc()),l=_.gt(f)),new Lt.StoreValue(a,l);case yt.GE.ord:var m=i.get(),v=o.get();return he.Types.STRING.isCompatible(i.type)?l=m.length>=v.length:(n&&(a=he.Types.BOOLEAN,m=m.trunc(),v=v.trunc()),l=m.gte(v)),new Lt.StoreValue(a,l);case yt.LT.ord:var h=i.get(),g=o.get();return he.Types.STRING.isCompatible(i.type)?l=h.length1&&void 0!==arguments[1]&&arguments[1];!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.disableMarginTop=n,this.input=null,this.cursorInterval=null,this.idleInterval=null,this.inputDiv=null,this.inputCMD=null,this.inputSpan=null,this.cursorRef=null,this.needInput=!1,this.clearBtn=null,this.hideBtn=null,this.showBtn=null,this.termDiv=null,this.anyKey=!1;var i=t;"#"===t[0]&&(i=t.substring(1)),this.parent=document.getElementById(i),this.setup(),this.inputListeners=[],this.hideInput(),this.pending_writes=[],this.last_clear=-1}return Ki(e,null,[{key:"BASH_TEMPLATE",get:function(){return'\n
\n \n Terminal\n \n \n
\n
'}},{key:"INPUT_CARET_TEMPLATE",get:function(){return'\n
\n \n
\n
'}},{key:"USER",get:function(){return 0}},{key:"INFO",get:function(){return 1}},{key:"ERR",get:function(){return 2}},{key:"INPUT",get:function(){return 3}}]),Ki(e,[{key:"setup",value:function(){this._setupDom(),this._setupEvents()}},{key:"_setupEvents",value:function(){this.input.addEventListener("keydown",this.registerInput.bind(this)),this.clearBtn.addEventListener("click",this.clearBtnClick.bind(this)),this.hideBtn.addEventListener("click",this.hideBtnClick.bind(this)),this.showBtn.addEventListener("click",this.showBtnClick.bind(this))}},{key:"registerInput",value:function(e){if(this.needInput&&(13===e.which||this.anyKey)){null!=this.idleInterval&&(clearInterval(this.idleInterval),this.idleInterval=null);var t=this.input.value;t=t.replace("[\n\r]+",""),this.notifyListeners(t),this._appendUserInput(t),this.input.value="",this.inputSpan.innerHTML=""}}},{key:"_setupDom",value:function(){var t=document.createElement("div");t.classList.add("bash"),t.innerHTML=e.BASH_TEMPLATE,this.termDiv=t.querySelector("#ivprog-term"),this.termDiv.classList.add("ivprog-term-div"),this.inputDiv=document.createElement("div"),this.inputDiv.id="ivprog-terminal-inputdiv",this.inputDiv.innerHTML=e.INPUT_CARET_TEMPLATE,this.input=document.createElement("input"),this.input.setAttribute("name","command"),this.input.setAttribute("value",""),this.input.setAttribute("type","text"),this.inputDiv.append(this.input),this.termDiv.append(this.inputDiv),t.append(this.termDiv),this.parent.append(t),this.inputCMD=this.inputDiv.querySelector("#cmd"),this.cursorRef=this.inputCMD.querySelector("#cursor"),this.inputSpan=this.inputCMD.querySelector("span"),this.clearBtn=t.querySelector("#ivprog-console-clearbtn"),this.hideBtn=t.querySelector("#ivprog-console-hidebtn"),this.showBtn=t.querySelector("#ivprog-console-showbtn"),this._setupCursor(),window.$(this.clearBtn).popup({content:At.getUI("tooltip_terminal_clear")}),window.$(this.showBtn).popup({content:At.getUI("tooltip_terminal_show")}),window.$(this.hideBtn).popup({content:At.getUI("tooltip_terminal_hide")})}},{key:"_setupCursor",value:function(){this.inputCMD.addEventListener("click",this.blinkCaretAndFocus.bind(this)),this.input.addEventListener("keyup",this.updateSpanText.bind(this)),this.input.addEventListener("blur",this.stopBlinkCaret.bind(this))}},{key:"blinkCaretAndFocus",value:function(){var e=this;null==this.cursorInterval&&(this.input.focus(),this.cursorInterval=window.setInterval((function(){"visible"===e.cursorRef.style.visibility?e.cursorRef.style.visibility="hidden":e.cursorRef.style.visibility="visible"}),500))}},{key:"updateSpanText",value:function(){this.inputSpan.innerHTML=this.input.value,null!=this.idleInterval&&window.clearInterval(this.idleInterval),this.scheduleNotify()}},{key:"stopBlinkCaret",value:function(){clearInterval(this.cursorInterval),this.cursorInterval=null,this.cursorRef.style.visibility="visible"}},{key:"notifyListeners",value:function(e){this.inputListeners.forEach((function(t){return t(e)})),this.inputListeners.splice(0,this.inputListeners.length),this.hideInput(),this.anyKey=!1}},{key:"write",value:function(t){this._appendText(t,e.USER)}},{key:"info",value:function(t){this._appendText(t,e.INFO)}},{key:"err",value:function(t){this._appendText(t,e.ERR)}},{key:"_appendText",value:function(e,t){var n=this,i=Date.now(),o=setTimeout((function(){if(n.pending_writes.shift(),!(n.last_clear>=i)){var o=n.getClassForType(t),a=document.createElement("div");a.classList.add(o),a.innerHTML=n.getOutputText(e),n.termDiv.insertBefore(a,n.inputDiv),n.scrollTerm()}}),5);this.pending_writes.push(o)}},{key:"_appendUserInput",value:function(t){var n=this,i=Date.now(),o=setTimeout((function(){if(n.pending_writes.shift(),!(n.last_clear>=i)){var o=n.getClassForType(e.INPUT),a=document.createElement("div");a.innerHTML=n.getUserInputText(t),a.classList.add(o),n.termDiv.insertBefore(a,n.inputDiv),n.scrollTerm()}}),5);this.pending_writes.push(o)}},{key:"getOutputText",value:function(e){return e=e.replace(/\s/g," "),"".concat(e,"")}},{key:"getUserInputText",value:function(e){return 0==e.trim().length&&(e=" "),''.concat(e,"")}},{key:"scrollTerm",value:function(){this.termDiv.scrollTop=this.termDiv.scrollHeight}},{key:"focus",value:function(){var e,t;this.termDiv.style.display="block",this.disableMarginTop||0!=this.parent.style.top.length||(this.parent.style.marginTop="-160px"),this.needInput&&(this.showInput(),this.scheduleNotify()),e=this.termDiv,(t=e.getBoundingClientRect()).bottom>0&&t.right>0&&t.left<(window.innerWidth||document.documentElement.clientWidth)&&t.top<(window.innerHeight||document.documentElement.clientHeight)||this.termDiv.scrollIntoView(!1),this.scrollTerm()}},{key:"hide",value:function(){this.needInput&&(clearInterval(this.idleInterval),this.hideInput(),this.needInput=!0),this.disableMarginTop||0!=this.parent.style.top.length||(this.parent.style.marginTop="0"),this.termDiv.style.display="none"}},{key:"getClassForType",value:function(t){switch(t){case e.INPUT:return"ivprog-term-userInput";case e.USER:return"ivprog-term-userText";case e.INFO:return"ivprog-term-info";case e.ERR:return"ivprog-term-error"}}},{key:"dispose",value:function(){this.input.removeEventListener("keyup",this.updateSpanText.bind(this)),this.input.removeEventListener("blur",this.stopBlinkCaret.bind(this)),this.input.removeEventListener("keydown",this.registerInput.bind(this)),this.inputCMD.removeEventListener("click",this.blinkCaretAndFocus.bind(this)),this.clearBtn.removeEventListener("click",this.clearBtnClick.bind(this)),this.hideBtn.removeEventListener("click",this.hideBtnClick.bind(this)),this.showBtn.removeEventListener("click",this.showBtnClick.bind(this)),this.input=null,this.inputCMD=null,this.inputDiv=null,this.termDiv=null,this.inputSpan=null,this.cursorRef=null,this.clearBtn=null,this.hideBtn=null,this.showBtn=null;var e=this.parent.cloneNode(!1);this.parent.parentNode.replaceChild(e,this.parent),null!=this.cursorInterval&&clearInterval(this.cursorInterval),null!=this.idleInterval&&clearInterval(this.idleInterval)}},{key:"showInput",value:function(){this.needInput=!0,this.inputDiv.style.display="block",this.inputCMD.click(),this.scrollTerm()}},{key:"hideInput",value:function(){this.needInput=!1,this.inputDiv.style.display=" none",clearInterval(this.cursorInterval),this.cursorInterval=null}},{key:"requestInput",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.inputListeners.push(e),this.anyKey=t,null==this.idleInterval&&this.scheduleNotify(),this.showInput()}},{key:"sendOutput",value:function(e){var t=this;(""+e).split("\n").forEach((function(e){e=(e=e.replace(/\t/g," ")).replace(/\s/g," "),t.write(e)}))}},{key:"clearPendingWrites",value:function(){for(var e in this.last_clear=Date.now(),this.pending_writes)clearTimeout(e)}},{key:"clear",value:function(){for(this.clearPendingWrites(),this.pending_writes=[];this.inputDiv.parentElement.childNodes.length>1;)this.inputDiv.parentElement.removeChild(this.inputDiv.parentElement.firstChild);this.input.value="",this.inputSpan.innerHTML=""}},{key:"clearBtnClick",value:function(){this.clear()}},{key:"showBtnClick",value:function(){this.focus()}},{key:"hideBtnClick",value:function(){this.hide()}},{key:"notifyIdle",value:function(){this.info(At.getMessage("awaiting_input_message")),this.inputCMD.click()}},{key:"scheduleNotify",value:function(){this.idleInterval=window.setInterval(this.notifyIdle.bind(this),y.idle_input_interval)}},{key:"cancelPendingInputRequests",value:function(){this.inputListeners.forEach((function(e){return e("")})),this.inputListeners.splice(0,this.inputListeners.length),null!=this.idleInterval&&(clearInterval(this.idleInterval),this.idleInterval=null),this.input.value="",this.inputSpan.innerHTML="",this.hideInput(),this.anyKey=!1}}]),e}();function Gi(e,t){for(var n=0;n1?t.insertSymbol(e.id,{id:e.id,lines:-1,columns:-1,type:e.type}):t.insertSymbol(e.id,{id:e.id,lines:-1,columns:null,type:e.type}):t.insertSymbol(e.id,{id:e.id,type:e.type})})),this.assertDeclarations(e.variablesDeclarations);var n=e.returnType.isCompatible(he.Types.VOID);if(!this.assertReturn(e,n))throw kt.function_no_return(e.name);this.popMap()}},{key:"assertReturn",value:function(e,t){var n=this;return e.commands.reduce((function(i,o){return n.checkCommand(e.returnType,o,t)||i}),t)}},{key:"checkCommand",value:function(e,t,n){if(t instanceof ue){if(!this.evaluateExpressionType(t.expression).isCompatible(he.Types.BOOLEAN))throw kt.loop_condition_type_full(t.expression.toString(),t.sourceInfo);return this.checkCommands(e,t.commands,n),!1}if(t instanceof ve){if(!this.evaluateExpressionType(t.for_id).isCompatible(he.Types.INTEGER))throw kt.invalid_for_variable(t.for_id,t.sourceInfo);if(!this.evaluateExpressionType(t.for_from).isCompatible(he.Types.INTEGER))throw kt.invalid_for_from(t.for_from,t.sourceInfo);if(!this.evaluateExpressionType(t.for_to).isCompatible(he.Types.INTEGER))throw kt.invalid_for_to(t.for_to,t.sourceInfo);if(null!=t.for_pass)if(!this.evaluateExpressionType(t.for_pass).isCompatible(he.Types.INTEGER))throw kt.invalid_for_pass(t.for_pass,t.sourceInfo);return this.checkCommands(e,t.commands,n),!1}if(t instanceof Me){for(var i=this.evaluateExpressionType(t.expression),o=n,a=!1,r=0;r'+t,transition:"fade up",on:"click",closable:!0,movePopup:!0,boundary:window,preserve:!1,target:!1,className:{popup:"ui popup invalid-identifier"},onHidden:function(t){e.popup("destroy")}}).popup("toggle")}var Qi=[],Yi=!1,Ji=Object.freeze({INSERT_FUNCTION:"INSERT_FUNCTION",REMOVE_FUNCTION:"REMOVE_FUNCTION",INSERT_GLOBAL_VAR:"INSERT_GLOBAL_VAR",REMOVE_GLOBAL_VAR:"REMOVE_GLOBAL_VAR",RENAME_FUNCTION:"RENAME_FUNCTION",RENAME_GLOBAL_VAR:"RENAME_GLOBAL_VAR",SET_GLOBAL_CONST:"SET_GLOBAL_CONST",CHANGE_FUNCTION_RETURN:"CHANGE_FUNCTION_RETURN",CHANGE_GLOBAL_TYPE:"CHANGE_GLOBAL_TYPE",CHANGE_GLOBAL_VALUE:"CHANGE_GLOBAL_VALUE",INSERT_FUNCTION_PARAM:"INSERT_FUNCTION_PARAM",REMOVE_FUNCTION_PARAM:"REMOVE_FUNCTION_PARAM",CHANGE_PARAM_TYPE:"CHANGE_PARAM_TYPE",RENAME_FUNCTION_PARAM:"RENAME_FUNCTION_PARAM",INSERT_FUNCTION_VAR:"INSERT_FUCNTION_VAR",REMOVE_FUNCTION_VAR:"REMOVE_FUNCTION_VAR",RENAME_FUNCTION_VAR:"RENAME_FUNCTION_VAR",CHANGE_VAR_TYPE:"CHANGE_VAR_TYPE",CHANGE_VAR_VALUE:"CHANGE_VAR_VALUE",INSERT_COMMAND:"INSERT_COMMAND",REMOVE_COMMAND:"REMOVE_COMMAND",CHANGE_COMMAND_EXP:"CHANGE_COMMAND_EXP",CHANGE_ATTRIB_EXP:"CHANGE_ATTRIB_EXP",CHANGE_ATTRIB_VAR:"CHANGE_ATTRIB_VAR",MOVE_COMMAND:"MOVE_COMMAND",ENTER_CHANGE_VAR_NAME:"ENTER_CHANGE_VAR_NAME",ENTER_CHANGE_VAR_VALUE:"ENTER_CHANGE_VAR_VALUE",ENTER_CHANGE_GLOBAL_NAME:"ENTER_CHANGE_GLOBAL_NAME",ENTER_CHANGE_GLOBAL_VALUE:"ENTER_CHANGE_GLOBAL_VALUE",ENTER_CHANGE_PARAM_NAME:"ENTER_CHANGE_PARAM_NAME"});function Zi(e,t,n){Yi||Qi.push([e,t,Date.now(),n])}function eo(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o2?n-2:0),o=2;o2&&void 0!==arguments[2]?arguments[2]:0;e.type=t,e.dimensions=n,n>0&&(e.rows=n,e.columns=2),eo(e.name,Ji.CHANGE_VAR_TYPE,t,n,e.rows,e.columns),function(e){e.type==Hi.INTEGER&&(0==e.dimensions&&(e.value=0),1==e.dimensions&&(e.value=[0,0]),2==e.dimensions&&(e.value=[[0,0],[0,0]]));e.type==Hi.REAL&&(0==e.dimensions&&(e.value=0),1==e.dimensions&&(e.value=[0,0]),2==e.dimensions&&(e.value=[[0,0],[0,0]]));e.type==Hi.TEXT&&(0==e.dimensions&&(e.value=At.getUI("textvar_default_value")),1==e.dimensions&&(e.value=[At.getUI("textvar_default_value"),At.getUI("textvar_default_value")]),2==e.dimensions&&(e.value=[[At.getUI("textvar_default_value"),At.getUI("textvar_default_value")],[At.getUI("textvar_default_value"),At.getUI("textvar_default_value")]]));e.type==Hi.BOOLEAN&&(0==e.dimensions&&(e.value=!0),1==e.dimensions&&(e.value=[!0,!0]),2==e.dimensions&&(e.value=[[!0,!0],[!0,!0]]));to(function_name,Ji.CHANGE_GLOBAL_VALUE,e.name,e.value)}(e)}function co(e,t){var n="";if(0==e.dimensions)e.type==Hi.REAL?n+='
'+e.value.toFixed(1)+"
":e.type==Hi.BOOLEAN?n+='
'+At.getUI("logic_value_".concat(e.value))+"
":n+='
'+e.value+"
";else{if(n+='',1==e.dimensions){if(n+="",e.type==Hi.REAL)for(var i=0;i'+e.value[i].toFixed(1)+"";else for(i=0;i'+At.getUI("logic_value_".concat(e.value[i]))+"":n+='";n+="",n+="
'+e.value[i]+"
",n+='
'}if(2==e.dimensions){if(e.type==Hi.REAL)for(var o=0;o";for(i=0;i'+e.value[o][i].toFixed(1)+"";n+=""}else for(o=0;o";for(i=0;i'+At.getUI("logic_value_".concat(e.value[o][i]))+"":n+=''+e.value[o][i]+"";n+=""}0==e.rows&&(n+=""),n+=' ',n+="",n+='
'}}t.find(".div_valor_var").html(""),(n=$(n)).find(".span_value_variable").data("associatedOject",e),n.find(".boolean_simple_type").on("click",(function(t){!function(e,t){e.value=!e.value,$(t).find(".span_value_variable").text(At.getUI("logic_value_".concat(e.value)))}(e,this.parentNode),eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value)})),n.find(".simple_var").on("click",(function(t){eo(e.name,Ji.ENTER_CHANGE_GLOBAL_VALUE),function(e,t){if(mo)return void vo.focus();var n;t=$(t),mo=!0,t.find(".span_value_variable").text(""),e.type==Hi.REAL?(n=$("")).insertBefore(t.find(".span_value_variable")):(n=$("")).insertBefore(t.find(".span_value_variable"));n.on("input",(function(){var e=n.textWidth()+10;vo=n,n.focus();var t=n.val();n.val(""),n.val(t),n.css({width:e})})).trigger("input"),n.focusout((function(){var i=!1;n.val().trim()?(e.type==Hi.REAL?(e.value=parseFloat(n.val().trim()),t.find(".span_value_variable").text(e.value.toFixed(1))):(e.type==Hi.INTEGER?e.value=parseInt(n.val().trim()):e.value=n.val().trim(),t.find(".span_value_variable").text(e.value)),i=!0):e.type==Hi.REAL?t.find(".span_value_variable").text(e.value.toFixed(1)):t.find(".span_value_variable").text(e.value),e.type==Hi.TEXT&&(e.value=n.val(),i=!0,t.find(".span_value_variable").text(e.value)),i&&eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),n.off(),n.remove(),mo=!1,vo=!1})),n.on("keydown",(function(i){var o=i.keyCode||i.which,a=!0;13==o&&(n.val().trim()?(e.type==Hi.REAL?(e.value=parseFloat(n.val().trim()),t.find(".span_value_variable").text(e.value.toFixed(1))):(e.type==Hi.INTEGER?e.value=parseInt(n.val().trim()):e.value=n.val().trim(),t.find(".span_value_variable").text(e.value)),a=!0):e.type==Hi.REAL?t.find(".span_value_variable").text(e.value.toFixed(1)):t.find(".span_value_variable").text(e.value),e.type==Hi.TEXT&&(e.value=n.val(),a=!0,t.find(".span_value_variable").text(e.value)),a&&eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),n.off(),n.remove(),mo=!1,vo=!1),27==o&&(e.type==Hi.REAL?t.find(".span_value_variable").text(e.value.toFixed(1)):t.find(".span_value_variable").text(e.value),n.off(),n.remove(),mo=!1,vo=!1)})),n.select()}(e,this.parentNode)})),n.find(".boolean_vector_var").on("click",(function(t){!function(e,t,n){e.value[t]=!e.value[t],$(n).find(".span_value_variable").text(At.getUI("logic_value_".concat(e.value[t])))}(e,$(this).data("index"),this.parentNode),eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value)})),n.find(".vector_var").on("click",(function(t){eo(e.name,Ji.ENTER_CHANGE_GLOBAL_VALUE),function(e,t,n){if(go)return void bo.focus();var i;n=$(n),go=!0,n.find(".span_value_variable").text(""),e.type==Hi.REAL?(i=$("")).insertBefore(n.find(".span_value_variable")):(i=$("")).insertBefore(n.find(".span_value_variable"));i.on("input",(function(){var e=i.textWidth()+10;bo=i,i.focus();var t=i.val();i.val(""),i.val(t),i.css({width:e})})).trigger("input"),i.focusout((function(){var o=!1;i.val().trim()?(e.type==Hi.REAL?(e.value[t]=parseFloat(i.val().trim()),n.find(".span_value_variable").text(e.value[t].toFixed(1))):(e.type==Hi.INTEGER?e.value[t]=parseInt(i.val().trim()):e.value[t]=i.val().trim(),n.find(".span_value_variable").text(e.value[t])),o=!0):e.type==Hi.REAL?n.find(".span_value_variable").text(e.value[t].toFixed(1)):n.find(".span_value_variable").text(e.value[t]),e.type==Hi.TEXT&&(e.value[t]=i.val(),o=!0,n.find(".span_value_variable").text(e.value[t])),o&&eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),i.off(),i.remove(),go=!1,bo=!1})),i.on("keydown",(function(o){var a=o.keyCode||o.which,r=!1;13==a&&(i.val().trim()?(e.type==Hi.REAL?(e.value[t]=parseFloat(i.val().trim()),n.find(".span_value_variable").text(e.value[t].toFixed(1))):(e.type==Hi.INTEGER?e.value[t]=parseInt(i.val().trim()):e.value[t]=i.val().trim(),n.find(".span_value_variable").text(e.value[t])),r=!0):e.type==Hi.REAL?n.find(".span_value_variable").text(e.value[t].toFixed(1)):n.find(".span_value_variable").text(e.value[t]),e.type==Hi.TEXT&&(e.value[t]=i.val(),r=!0,n.find(".span_value_variable").text(e.value[t])),r&&eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),i.off(),i.remove(),go=!1,bo=!1),27==a&&(e.type==Hi.REAL?n.find(".span_value_variable").text(e.value[t].toFixed(1)):n.find(".span_value_variable").text(e.value[t]),i.off(),i.remove(),go=!1,bo=!1)})),i.select()}(e,$(this).data("index"),this.parentNode)})),n.find(".remove_global_vector_column").on("click",(function(n){!function(e){0!=e.columns&&(e.columns--,e.value.splice(e.value.length-1,1))}(e),t.find(".div_valor_var").html(""),eo(e.name,Ji.CHANGE_GLOBAL_TYPE,e.type,e.dimensions,e.rows,e.columns),to(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),co(e,t)})),n.find(".add_global_vector_column").on("click",(function(n){!function(e){e.columns++,e.type==Hi.INTEGER&&e.value.push(0),e.type==Hi.REAL&&e.value.push(0),e.type==Hi.TEXT&&e.value.push(At.getUI("textvar_default_value")),e.type==Hi.BOOLEAN&&e.value.push(!0)}(e),eo(e.name,Ji.CHANGE_GLOBAL_TYPE,e.type,e.dimensions,e.rows,e.columns),to(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),t.find(".div_valor_var").html(""),co(e,t)})),n.find(".remove_global_matrix_column").on("click",(function(n){!function(e){if(0!=e.columns){e.columns--;for(var t=0;t")).insertBefore(i.find(".span_value_variable")):(o=$("")).insertBefore(i.find(".span_value_variable"));o.on("input",(function(){var e=o.textWidth()+10;fo=o,o.focus();var t=o.val();o.val(""),o.val(t),o.css({width:e})})).trigger("input"),o.focusout((function(){o.val().trim()?(e.type==Hi.REAL?(e.value[t][n]=parseFloat(o.val().trim()),i.find(".span_value_variable").text(e.value[t][n].toFixed(1))):(e.type==Hi.INTEGER?e.value[t][n]=parseInt(o.val().trim()):e.value[t][n]=o.val().trim(),i.find(".span_value_variable").text(e.value[t][n])),eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value)):e.type==Hi.REAL?i.find(".span_value_variable").text(e.value[t][n].toFixed(1)):i.find(".span_value_variable").text(e.value[t][n]),e.type==Hi.TEXT&&(e.value[t][n]=o.val(),i.find(".span_value_variable").text(e.value[t][n])),o.off(),o.remove(),_o=!1,fo=!1})),o.on("keydown",(function(a){var r=a.keyCode||a.which;13==r&&(o.val().trim()?(e.type==Hi.REAL?(e.value[t][n]=parseFloat(o.val().trim()),i.find(".span_value_variable").text(e.value[t][n].toFixed(1))):(e.type==Hi.INTEGER?e.value[t][n]=parseInt(o.val().trim()):e.value[t][n]=o.val().trim(),i.find(".span_value_variable").text(e.value[t][n])),eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value)):e.type==Hi.REAL?i.find(".span_value_variable").text(e.value[t][n].toFixed(1)):i.find(".span_value_variable").text(e.value[t][n]),e.type==Hi.TEXT&&(e.value[t][n]=o.val(),eo(e.name,Ji.CHANGE_GLOBAL_VALUE,e.value),i.find(".span_value_variable").text(e.value[t][n])),o.off(),o.remove(),_o=!1,fo=!1),27==r&&(e.type==Hi.REAL?i.find(".span_value_variable").text(e.value[t][n].toFixed(1)):i.find(".span_value_variable").text(e.value[t][n]),o.off(),o.remove(),_o=!1,fo=!1)})),o.select()}(e,$(this).data("row"),$(this).data("index"),this.parentNode)})),t.find(".div_valor_var").append(n),function(e,t){var n=e.find(".text").text().split("[");if(2==n.length){var i=n[0]+"[ "+t.columns+" ] ";e.find(".text").empty(),e.find(".text").text(i)}if(3==n.length){i=n[0]+"[ "+t.columns+" ] [ "+t.rows+" ] ";e.find(".text").empty(),e.find(".text").text(i)}}(t,e)}function uo(e){var t=e.data("associatedOject");e.find(".alternate_constant").on("click",(function(e){!function(e){e.is_constant=!e.is_constant,eo(e.name,Ji.SET_GLOBAL_CONST)}(t),$(this).removeClass("on off"),t.is_constant?$(this).addClass("on"):$(this).addClass("off")})),e.find(".editing_name_var").on("click",(function(n){eo(t.name,Ji.ENTER_CHANGE_GLOBAL_NAME),function(e){var t=e.data("associatedOject");if(ho)return void yo.focus();ho=!0,e.find(".span_name_variable").text("");var n=$("");n.insertBefore(e.find(".span_name_variable")),n.on("input",(function(){var e=n.textWidth()+10;(yo=n).focus(),yo.css({width:e})})).trigger("input"),n.focusout((function(){n.val().trim().length>0?(so(t,n.val().trim(),e),e.find(".span_name_variable").text(t.name)):e.find(".span_name_variable").text(t.name),n.off(),n.remove(),ho=!1,yo=!1})),n.on("keydown",(function(i){var o=i.keyCode||i.which;13==o&&(n.val().trim()?(so(t,n.val().trim(),e),e.find(".span_name_variable").text(t.name)):e.find(".span_name_variable").text(t.name),n.off(),n.remove(),ho=!1,yo=!1),27==o&&(e.find(".span_name_variable").text(t.name),n.off(),n.remove(),ho=!1,yo=!1)})),n.select()}(e)})),e.find(".ui.dropdown.global_type").dropdown({onChange:function(n,i,o){o.data("dimensions")?lo(t,Hi[o.data("type")],o.data("dimensions")):lo(t,Hi[o.data("type")]),co(t,e)},selectOnKeydown:!1}),e.find(".remove_global").on("click",(function(n){!function(e,t){var n=window.program_obj.globals.indexOf(e);n>-1&&(window.insertContext=!0,window.program_obj.globals.splice(n,1)),eo(e.name,Ji.REMOVE_GLOBAL_VAR),t.children().off(),t.off(),t.fadeOut()}(t,e)}))}function po(e){var t='
const: ';for(var n in t+='
',t+='
'+e.name+'
<— ',t+='
'+e.value+"
",t+='
';var i=$(t);return i.data("associatedOject",e),$(".list_globals").append(i),uo(i),co(e,i),1==e.dimensions&&i.find(".dimensions_0").text(e.columns),2==e.dimensions&&(i.find(".dimensions_0").text(e.columns),i.find(".dimensions_1").text(e.rows)),i}var _o=!1,fo=null;var mo=!1,vo=null;var ho=!1,yo=null;var go=!1,bo=null;function wo(){if(!window.block_render&&!window.draging){window.block_render=!0,console.log("rendering algorithm"),$(".all_functions").children().off(),$(".all_functions").empty(),$(".list_globals").children().off(),$(".list_globals").empty();for(var e=0;e").hide().appendTo(document.body)),$.fn.textWidth.fakeEl.text(e||this.val()||this.text()||this.attr("placeholder")).css("font",t||this.css("font")),$.fn.textWidth.fakeEl.width()},window.block_render=!1;var To=Object.freeze({function:"function",comment:"comment",reader:"reader",writer:"writer",attribution:"attribution",iftrue:"iftrue",repeatNtimes:"repeatNtimes",whiletrue:"whiletrue",dowhiletrue:"dowhiletrue",switch:"switch",switchcase:"switchcase",functioncall:"functioncall",break:"break",return:"return"}),Ro=Object.freeze({plus:"plus",minus:"minus",multiplication:"multiplication",division:"division",module:"module",none:"none"}),Ao=Object.freeze({exp_op_exp:"exp_op_exp",op_exp:"op_exp",par_exp_par:"par_exp_par",start_point:"start_point"}),Oo=Object.freeze({exp_conditional:"exp_conditional",exp_logic:"exp_logic",exp_arithmetic:"exp_arithmetic"}),Io=Object.freeze({greater_than:"greater_than",less_than:"less_than",equals_to:"equals_to",not_equals_to:"not_equals_to",greater_than_or_equals_to:"greater_than_or_equals_to",less_than_or_equals_to:"less_than_or_equals_to"}),Co=Object.freeze({equals_to:"equals_to",not_equals_to:"not_equals_to",and:"and",or:"or",not:"not"}),No=Object.freeze({math:"$mathLib",text:"$strLib",arrangement:"$arrayLib",conversion:"$langLib"}),So=function e(t,n,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;Eo(this,e),this.type=t,this.name=n,this.value=i,this.dimensions=o,this.is_constant=a,this.rows=r,this.columns=s},ko=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hi.VOID,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[],l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[];Eo(this,e),this.type=To.function,this.name=t,this.return_type=n,this.return_dimensions=i,this.parameters_list=o,this.is_main=a,this.is_hidden=r,this.variables_list=s,this.function_comment=l,this.commands=c},Lo=function e(t,n,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=arguments.length>5?arguments[5]:void 0;Eo(this,e),this.type=To.function,this.identifier=t,this.return_type=n,this.return_dimensions=i,this.parameters_list=o,this.function_comment=a,this.category=r},$o=function e(t){Eo(this,e),this.type=To.comment,this.comment_text=t},Uo=function e(){Eo(this,e),this.type=To.break},Po=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Qo;Eo(this,e),this.type=To.reader,this.variable_value_menu=t},Mo=function e(t){Eo(this,e),this.type=To.writer,this.content=t},Fo=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Eo(this,e),this.type=To.attribution,this.variable=t,this.expression=n},jo=function e(t,n){Eo(this,e),this.type_op=t,this.item=n},Ko=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Eo(this,e),this.type_exp=t,this.itens=n},Bo=function e(t,n,i){Eo(this,e),this.type=Oo.exp_arithmetic,this.first_operand=t,this.second_operand=n,this.operator=i},Go=function e(t,n,i){Eo(this,e),this.type=To.iftrue,this.expression=t,this.commands_block=n,this.commands_else=i},Do=function e(t,n,i,o,a,r){Eo(this,e),this.type=To.repeatNtimes,this.var_attribution=t,this.var_incrementation=n,this.expression1=i,this.expression2=o,this.expression3=a,this.commands_block=r},Vo=function e(t,n){Eo(this,e),this.type=To.whiletrue,this.expression=t,this.commands_block=n},qo=function e(t,n){Eo(this,e),this.type=To.dowhiletrue,this.expression=t,this.commands_block=n},Ho=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Eo(this,e),this.type=To.switch,this.variable=t,this.cases=n},zo=function e(t){Eo(this,e),this.type=To.return,this.variable_value_menu=t},Xo=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Eo(this,e),this.type=To.switchcase,this.variable_value_menu=t,this.commands_block=n},Wo=function e(t,n){Eo(this,e),this.type=To.functioncall,this.function_called=t,this.parameters_list=n},Qo=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;Eo(this,e),this.type="var_value",this.variable_and_value=t,this.content=n,this.row=i,this.column=o,this.include_constant=a,this.dimensions=r},Yo=function(){function e(){Eo(this,e),this.functions=[],this.globals=[]}var t,n,i;return t=e,(n=[{key:"addFunction",value:function(e){Xi.a.watch(e.parameters_list,(function(){window.insertContext?(setTimeout((function(){wo()}),300),window.insertContext=!1):wo()}),1),Xi.a.watch(e.variables_list,(function(){window.insertContext?(setTimeout((function(){wo()}),300),window.insertContext=!1):wo()}),1),this.functions.push(e)}},{key:"addVariable",value:function(e,t){null===this.functions[e].variable&&(this.functions[e].variables_list=[]),this.functions[e].variables_list.push(t)}},{key:"addGlobal",value:function(e){this.globals.push(e)}}])&&xo(t.prototype,n),i&&xo(t,i),e}(),Jo=0;function Zo(e,t,n,i){e.name!=t&&(Pi(t)?!function(e,t){if(t.parameters_list)for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:0;e.type=t,e.dimensions=i,i>0&&(e.rows=i,e.columns=2),eo(n,Ji.CHANGE_VAR_TYPE,e.name,t,i,e.rows,e.columns),function(e,t){e.type==Hi.INTEGER&&(0==e.dimensions&&(e.value=0),1==e.dimensions&&(e.value=[0,0]),2==e.dimensions&&(e.value=[[0,0],[0,0]]));e.type==Hi.REAL&&(0==e.dimensions&&(e.value=0),1==e.dimensions&&(e.value=[0,0]),2==e.dimensions&&(e.value=[[0,0],[0,0]]));e.type==Hi.TEXT&&(0==e.dimensions&&(e.value=At.getUI("textvar_default_value")),1==e.dimensions&&(e.value=[At.getUI("textvar_default_value"),At.getUI("textvar_default_value")]),2==e.dimensions&&(e.value=[[At.getUI("textvar_default_value"),At.getUI("textvar_default_value")],[At.getUI("textvar_default_value"),At.getUI("textvar_default_value")]]));e.type==Hi.BOOLEAN&&(0==e.dimensions&&(e.value=!0),1==e.dimensions&&(e.value=[!0,!0]),2==e.dimensions&&(e.value=[[!0,!0],[!0,!0]]));to(t,Ji.CHANGE_VAR_VALUE,e.name,e.value)}(e,n)}function ta(e,t,n){t.find(".editing_name_var").on("click",(function(i){eo(n.name,Ji.ENTER_CHANGE_VAR_NAME,e.name),function(e,t,n){if(la)return void ca.focus();var i;la=!0,t.find(".span_name_variable").text(""),(i=$("")).insertBefore(t.find(".span_name_variable")),i.on("input",(function(){var e=i.textWidth()+10;ca=i,i.focus();var t=i.val();i.val(""),i.val(t),i.css({width:e})})).trigger("input"),i.focusout((function(){i.val().trim().length>0?(Zo(e,i.val().trim(),t,n),t.find(".span_name_variable").text(e.name)):t.find(".span_name_variable").text(e.name),i.off(),i.remove(),la=!1,ca=!1})),i.on("keydown",(function(o){var a=o.keyCode||o.which;13==a&&(i.val().trim().length>0?(Zo(e,i.val().trim(),t,n),t.find(".span_name_variable").text(e.name)):t.find(".span_name_variable").text(e.name),i.off(),i.remove(),la=!1,ca=!1),27==a&&(t.find(".span_name_variable").text(e.name),i.off(),i.remove(),la=!1,ca=!1)})),i.select()}(e,t,n)})),t.find(".ui.dropdown.variable_type").dropdown({onChange:function(i,o,a){a.data("dimensions")?ea(e,Hi[a.data("type")],n.name,a.data("dimensions")):ea(e,Hi[a.data("type")],n.name),ia(e,t,n.name)},selectOnKeydown:!1}),t.find(".remove_variable").on("click",(function(i){!function(e,t,n){var i=t.data("associatedFunction");eo(n,Ji.REMOVE_FUNCTION_VAR,e.name);var o=i.variables_list.indexOf(e);o>-1&&(window.insertContext=!0,delete i.variables_list[o],i.variables_list.splice(o,1)),t.children().off(),t.off(),t.fadeOut()}(e,t,n.name)}))}function na(e,t,n){var i='
';for(var o in i+=' ",i+='
'+t.name+"
",i+=' <—
'+t.value+"
",i+='
',(i=$(i)).data("associatedFunction",n),e.find(".variables_list_div").append(i),ta(t,i,n),ia(t,i,n.name),i}function ia(e,t,n){var i="";if(0==e.dimensions)e.type==Hi.REAL?i+='
'+e.value.toFixed(1)+"
":e.type==Hi.BOOLEAN?i+='
'+At.getUI("logic_value_".concat(e.value))+"
":i+='
'+e.value+"
";else{if(i+='',1==e.dimensions){if(i+="",e.type==Hi.REAL)for(var o=0;o'+e.value[o].toFixed(1)+"";else for(o=0;o'+At.getUI("logic_value_".concat(e.value[o]))+"":i+='";i+="",i+="
'+e.value[o]+"
",i+='
'}if(2==e.dimensions){if(e.type==Hi.REAL)for(var a=0;a";for(o=0;o'+e.value[a][o].toFixed(1)+"";i+=""}else for(a=0;a";for(o=0;o'+At.getUI("logic_value_".concat(e.value[a][o]))+"":i+=''+e.value[a][o]+"";i+=""}0==e.rows&&(i+=""),i+=' ',i+="",i+='
'}}$(t).find(".div_valor_var").html(""),i=$(i),$(i).find(".span_value_variable").data("associatedOject",e),$(i).find(".boolean_simple_type").on("click",(function(t){var i,o;eo(n,Ji.CHANGE_VAR_VALUE,e.name,e.value),i=e,o=this.parentNode,i.value=!i.value,$(o).find(".span_value_variable").text(At.getUI("logic_value_".concat(i.value)))})),$(i).find(".simple_var").on("click",(function(t){eo(n,Ji.ENTER_CHANGE_VAR_VALUE,e.name),function(e,t,n){if(ra)return void sa.focus();var i;t=$(t),ra=!0,t.find(".span_value_variable").text(""),e.type==Hi.REAL?(i=$("")).insertBefore(t.find(".span_value_variable")):(i=$("")).insertBefore(t.find(".span_value_variable"));i.on("input",(function(){var e=i.textWidth()+10;sa=i,i.focus();var t=i.val();i.val(""),i.val(t),i.css({width:e})})).trigger("input"),i.focusout((function(){var o=!1;i.val().trim()?(e.type==Hi.REAL?(e.value=parseFloat(i.val().trim()),t.find(".span_value_variable").text(e.value.toFixed(1))):(e.type==Hi.INTEGER?e.value=parseInt(i.val().trim()):e.value=i.val().trim(),t.find(".span_value_variable").text(e.value)),o=!0):e.type==Hi.REAL?t.find(".span_value_variable").text(e.value.toFixed(1)):t.find(".span_value_variable").text(e.value),e.type==Hi.TEXT&&(e.value=i.val(),o=!0,t.find(".span_value_variable").text(e.value)),o&&eo(n,Ji.CHANGE_VAR_VALUE,e.name,e.value),i.off(),i.remove(),ra=!1,sa=!1})),i.on("keydown",(function(o){var a=o.keyCode||o.which,r=!1;13==a&&(i.val().trim()?(e.type==Hi.REAL?(e.value=parseFloat(i.val().trim()),t.find(".span_value_variable").text(e.value.toFixed(1))):(e.type==Hi.INTEGER?e.value=parseInt(i.val().trim()):e.value=i.val().trim(),t.find(".span_value_variable").text(e.value)),r=!0):e.type==Hi.REAL?t.find(".span_value_variable").text(e.value.toFixed(1)):t.find(".span_value_variable").text(e.value),e.type==Hi.TEXT&&(e.value=i.val(),r=!0,t.find(".span_value_variable").text(e.value)),r&&eo(n,Ji.CHANGE_VAR_VALUE,e.name,e.value),i.off(),i.remove(),ra=!1,sa=!1),27==a&&(e.type==Hi.REAL?t.find(".span_value_variable").text(e.value.toFixed(1)):t.find(".span_value_variable").text(e.value),i.off(),i.remove(),ra=!1,sa=!1)})),i.select()}(e,this.parentNode,n)})),$(i).find(".boolean_vector_var").on("click",(function(t){var i,o,a;i=e,o=$(this).data("index"),a=this.parentNode,i.value[o]=!i.value[o],$(a).find(".span_value_variable").text(At.getUI("logic_value_".concat(i.value[o]))),eo(n,Ji.CHANGE_VAR_VALUE,e.name,e.value)})),$(i).find(".vector_var").on("click",(function(t){!function(e,t,n,i){if(oa)return void aa.focus();var o;n=$(n),oa=!0,n.find(".span_value_variable").text(""),e.type==Hi.REAL?(o=$("")).insertBefore(n.find(".span_value_variable")):(o=$("")).insertBefore(n.find(".span_value_variable"));o.on("input",(function(){var e=o.textWidth()+10;aa=o,o.focus();var t=o.val();o.val(""),o.val(t),o.css({width:e})})).trigger("input"),o.focusout((function(){var a=!1;o.val().trim()?(e.type==Hi.REAL?(e.value[t]=parseFloat(o.val().trim()),n.find(".span_value_variable").text(e.value[t].toFixed(1))):(e.type==Hi.INTEGER?e.value[t]=parseInt(o.val().trim()):e.value[t]=o.val().trim(),n.find(".span_value_variable").text(e.value[t])),a=!0):e.type==Hi.REAL?n.find(".span_value_variable").text(e.value[t].toFixed(1)):n.find(".span_value_variable").text(e.value[t]),e.type==Hi.TEXT&&(e.value[t]=o.val(),a=!0,n.find(".span_value_variable").text(e.value[t])),a&&eo(i,Ji.CHANGE_VAR_VALUE,e.name,e.value),o.off(),o.remove(),oa=!1,aa=!1})),o.on("keydown",(function(a){var r=a.keyCode||a.which,s=!1;13==r&&(o.val().trim()?(e.type==Hi.REAL?(e.value[t]=parseFloat(o.val().trim()),n.find(".span_value_variable").text(e.value[t].toFixed(1))):(e.type==Hi.INTEGER?e.value[t]=parseInt(o.val().trim()):e.value[t]=o.val().trim(),n.find(".span_value_variable").text(e.value[t])),s=!0):e.type==Hi.REAL?n.find(".span_value_variable").text(e.value[t].toFixed(1)):n.find(".span_value_variable").text(e.value[t]),e.type==Hi.TEXT&&(e.value[t]=o.val(),s=!0,n.find(".span_value_variable").text(e.value[t])),s&&eo(i,Ji.CHANGE_VAR_VALUE,e.name,e.value),o.off(),o.remove(),oa=!1,aa=!1),27==r&&(e.type==Hi.REAL?n.find(".span_value_variable").text(e.value[t].toFixed(1)):n.find(".span_value_variable").text(e.value[t]),o.off(),o.remove(),oa=!1,aa=!1)})),o.select()}(e,$(this).data("index"),this.parentNode,n)})),$(i).find(".remove_global_vector_column").on("click",(function(i){!function(e){if(0==e.columns)return;e.columns--,e.value.splice(e.value.length-1,1)}(e),eo(n,Ji.CHANGE_VAR_TYPE,e.name,e.type,e.dimensions,e.rows,e.columns),to(n,Ji.CHANGE_VAR_VALUE,e.name,e.value),$(t).find(".div_valor_var").html(""),ia(e,t,n)})),$(i).find(".add_global_vector_column").on("click",(function(i){!function(e){e.columns++,e.type==Hi.INTEGER&&e.value.push(0);e.type==Hi.REAL&&e.value.push(0);e.type==Hi.TEXT&&e.value.push(At.getUI("textvar_default_value"));e.type==Hi.BOOLEAN&&e.value.push(!0)}(e),eo(n,Ji.CHANGE_VAR_TYPE,e.name,e.type,e.dimensions,e.rows,e.columns),to(n,Ji.CHANGE_VAR_VALUE,e.name,e.value),$(t).find(".div_valor_var").html(""),ia(e,t,n)})),$(i).find(".remove_global_matrix_column").on("click",(function(i){!function(e){if(0==e.columns)return;e.columns--;for(var t=0;t")).insertBefore(i.find(".span_value_variable")):(a=$("")).insertBefore(i.find(".span_value_variable"));a.on("input",(function(){var e=a.textWidth()+10;da=a,a.focus();var t=a.val();a.val(""),a.val(t),a.css({width:e})})).trigger("input"),a.focusout((function(){var r=!1;a.val().trim()?(e.type==Hi.REAL?(e.value[t][n]=parseFloat(a.val().trim()),i.find(".span_value_variable").text(e.value[t][n].toFixed(1))):(e.type==Hi.INTEGER?e.value[t][n]=parseInt(a.val().trim()):e.value[t][n]=a.val().trim(),i.find(".span_value_variable").text(e.value[t][n])),r=!0):e.type==Hi.REAL?i.find(".span_value_variable").text(e.value[t][n].toFixed(1)):i.find(".span_value_variable").text(e.value[t][n]),e.type==Hi.TEXT&&(e.value[t][n]=a.val(),r=!0,i.find(".span_value_variable").text(e.value[t][n])),r&&eo(o,Ji.CHANGE_VAR_VALUE,e.name,e.value),a.off(),a.remove(),ua=!1,da=!1})),a.on("keydown",(function(r){var s=r.keyCode||r.which,l=!1;13==s&&(a.val().trim()?(e.type==Hi.REAL?(e.value[t][n]=parseFloat(a.val().trim()),i.find(".span_value_variable").text(e.value[t][n].toFixed(1))):(e.type==Hi.INTEGER?e.value[t][n]=parseInt(a.val().trim()):e.value[t][n]=a.val().trim(),i.find(".span_value_variable").text(e.value[t][n])),l=!0):e.type==Hi.REAL?i.find(".span_value_variable").text(e.value[t][n].toFixed(1)):i.find(".span_value_variable").text(e.value[t][n]),e.type==Hi.TEXT&&(e.value[t][n]=a.val(),l=!0,i.find(".span_value_variable").text(e.value[t][n])),l&&eo(o,Ji.CHANGE_VAR_VALUE,e.name,e.value),a.off(),a.remove(),ua=!1,da=!1),27==s&&(e.type==Hi.REAL?i.find(".span_value_variable").text(e.value[t][n].toFixed(1)):i.find(".span_value_variable").text(e.value[t][n]),a.off(),a.remove(),ua=!1,da=!1)})),a.select()}(e,$(this).data("row"),$(this).data("index"),this.parentNode,n)})),$(t).find(".div_valor_var").append(i),function(e,t){var n=e.find(".text").text().split("[");if(2==n.length){var i=n[0]+"[ "+t.columns+" ] ";e.find(".text").empty(),e.find(".text").text(i)}if(3==n.length){i=n[0]+"[ "+t.columns+" ] [ "+t.rows+" ] ";e.find(".text").empty(),e.find(".text").text(i)}}(t,e)}var oa=!1,aa=null;var ra=!1,sa=null;var la=!1,ca=null;var ua=!1,da=null;function pa(e,t,n,i){if(n.empty(),Xi.a.unwatch(e,"expression"),Xi.a.watch(e,"expression",(function(){if(!window.timer){var i=n.find(".single_element_expression").not(".mouse_distance").not(".add_parentheses"),o="";i.each((function(e){$(this).hasClass("parentheses_in_expression")?o+=$(this).text()+" ":(o+=$(this).find(".text").text(),o+=$(this).find(".var_name").text(),o+=$(this).find(".parameters_function_called").text(),o+=$(this).find(".value_rendered").text(),o+=" ")})),o&&(window.timer=!0,eo(t.name,Ji.CHANGE_COMMAND_EXP,e.type,"/",o),setTimeout((function(){window.timer=!1}),200))}}),20,!0),e.type===To.attribution)if(Xi.a.unwatch(e.variable),Xi.a.watch(e.variable,(function(){pa(e,t,n,i)}),0),e.variable.content){var o=[];e.variable.content.type==Hi.INTEGER||e.variable.content.type==Hi.REAL?o.push(Oo.exp_arithmetic):e.variable.content.type==Hi.BOOLEAN?(o.push(Oo.exp_conditional),o.push(Oo.exp_logic),o.push(Oo.exp_arithmetic)):e.variable.content.type==Hi.TEXT?(o.push(Oo.exp_conditional),o.push(Oo.exp_logic),o.push(Oo.exp_arithmetic)):console.log("NÃO RECONHECI! VEJA: ",e.variable.content.type),_a(e,t,n,i,o)}else n.text(At.getUI("var_menu_select_var").toLowerCase());else(o=[]).push(Oo.exp_conditional),o.push(Oo.exp_logic),o.push(Oo.exp_arithmetic),_a(e,t,n,i,o);n.children(".mouse_distance").addClass("mouse_distance_hidden"),n.children(".higher_element").on("mousemove",(function(e){window.open_or_close||($(this).css("position","relative","!important"),$(this).children(".mouse_distance").css("opacity","1"))})),n.children(".higher_element").on("mouseout",(function(e){window.open_or_close||($(this).css("position","absolute","!important"),$(this).children(".mouse_distance").css("opacity","0"))}));var a=$('
');n.find(".single_element_expression").on("mousedown",(function(e){window.posX=e.clientX,window.posY=e.clientY})),Sortable.create(n[0],{animation:100,ghostClass:"ghost",group:{name:"shared",put:!1},draggable:".single_element_expression",sort:!1,filter:".not_allowed",onStart:function(){$("body").append(a),a.css("display","block"),a.css("top",window.posY+70,"!important"),a.css("left",window.posX-20,"!important")},onMove:function(){a.addClass("color_test")},onEnd:function(){a.remove(),n.find(".ghost").removeClass("ghost")}}),new Sortable(a[0],{group:"shared",animation:150,onAdd:function(o){a.css("display","none"),a.find(".single_element_expression").remove(),a.css("background-color",""),a.remove(),function(e,t){var n=$(e.item).data("index"),i=t[0];if(console.log("indice: ",n),t[n].type)1==t.length?t.splice(0,1):t.length>1&&(n>0&&t[n-1].type_op?(n=0&&n-30&&"("==t[n-1]&&")"==t[n+1]&&(n>1&&t[n-2].type_op?(t.splice(n+1,1),t.splice(n,1),t.splice(n-1,1),t.splice(n-2,1)):(n=0;r--)if("("==t[r]){o=r;break}}t[o+1].type_op?(t.splice(a,1),t.splice(o+1,1),t.splice(o,1)):(t.splice(a,1),t.splice(o,1))}0==t.length&&t.push(new Qo(ka.all,null,null,null,!0));i!=t[0]&&t[0].type_op&&t.splice(0,1)}(o,i),pa(e,t,n,i)}})}function _a(e,t,n,i,o){var a=0;for(a=0;a
');0==a&&i.length>0&&i[0].type_op,La(e,i[a],r,t),n.append(r)}else"("==i[a]||")"==i[a]?")"==i[a]?(va(n,o,i,e,t,a),fa(n,i[a],e,t,a,i)):"("!=i[a]||i[a+1].type_op?fa(n,i[a],e,t,a,i):(fa(n,i[a],e,t,a,i),ma(n,o,i,e,t,a+1)):(0==a?console.log("NEGAÇÃO NO PRIMEIRO ELEMENTO"):"("==i[a-1]&&console.log("NEGAÇÃO APÓS O PARÊNTESES"),ha(e,t,n,i[a],o,a,i));va(n,o,i,e,t,a,!0),function(e,t,n,i,o){var a=$('
');n.append(a),a.popup({content:"Adicionar parênteses",delay:{show:750,hide:0}}),a.on("click",(function(o){if(!window.parentheses_activate){n.find(".usepointer").off("click"),window.parentheses_activate=!0,window.open_or_close="open",n.find(".dropdown").addClass("disabled"),n.find(".ghost_element").addClass("temp_class"),n.find(".ghost_element").removeClass("ghost_element");var a,r=$('
(
');r.draggable().appendTo("body"),r.css("position","absolute"),o.type="mousedown.draggable",o.target=r[0],r.css("left",o.pageX+10),r.css("top",o.pageY+10),r.trigger(o),n.on("mousemove",(function(e){var t=null;t=$(e.target).hasClass("single_element_expression")?$(e.target):$(e.target).closest(".single_element_expression"),$(e.target).hasClass("temp_class")||t.length<1||t.hasClass("add_parentheses")||t.hasClass("rendered_parentheses")||$(e.target).hasClass("expression_elements")||function(e,t,n,i,o){var a=e.data("index");if("("==o[a]||")"==o[a])return;if("close"==window.open_or_close&&a0){"close"==window.open_or_close&&(window.close_parentheses.insertAfter(i.find('.single_element_expression[data-index="'+l+'"]')),window.inserir_close=l+2);break}if("var_value"==o[l].type){"close"==window.open_or_close&&(window.close_parentheses.insertAfter(i.find('.single_element_expression[data-index="'+l+'"]')),window.inserir_close=l+2);break}}}else if(o[a].type_op){"open"==window.open_or_close&&(window.open_parentheses.insertBefore(e),window.inserir_open=a);for(r=0,s=0,l=1;l0){"var_value"==o[l].type&&(window.close_parentheses.insertAfter(i.find('.single_element_expression[data-index="'+l+'"]')),window.inserir_close=l+2);break}if("var_value"==o[l].type){"var_value"==o[l].type&&(window.close_parentheses.insertAfter(i.find('.single_element_expression[data-index="'+l+'"]')),window.inserir_close=l+2);break}}}return}if("var_value"==o[a].type)return"open"==window.open_or_close&&(window.open_parentheses.insertBefore(e),window.inserir_open=a),void("close"==window.open_or_close&&(window.close_parentheses.insertAfter(e),window.inserir_close=a+2));if(o[a].type_op){if("("==o[a-1])"open"==window.open_or_close&&(window.open_parentheses.insertBefore(e),window.inserir_open=a);else if(")"==o[a-1]){r=0,s=0;for(var c=a-1;c>=0;c--)if("("==o[c]&&r++,")"==o[c]&&s++,r!=s);else if(s>0){"open"==window.open_or_close&&(window.open_parentheses.insertBefore(i.find('.single_element_expression[data-index="'+c+'"]')),window.inserir_open=c);break}}else"var_value"==o[a-1].type&&"open"==window.open_or_close&&(window.open_parentheses.insertBefore(i.find('.single_element_expression[data-index="'+(a-1)+'"]')),window.inserir_open=a-1);if("("==o[a+1]){for(r=0,s=0,c=a+1;c0){"close"==window.open_or_close&&(window.close_parentheses.insertAfter(i.find('.single_element_expression[data-index="'+c+'"]')),window.inserir_close=c+2);break}}else"var_value"==o[a+1].type&&"close"==window.open_or_close&&(window.close_parentheses.insertAfter(i.find('.single_element_expression[data-index="'+(a+1)+'"]')),window.inserir_close=a+3)}}(t,0,0,n,i)})),n.on("mouseleave",(function(){})),$("body").on("mouseup",(function(o){if("open"==window.open_or_close){window.open_or_close="close",r.remove();var s=$(o.target).closest(".command_container"),l=n.closest(".command_container");if(!s.is(l))return window.parentheses_activate=!1,n.find(".temp_class").addClass("ghost_element"),n.find(".temp_class").removeClass("temp_class"),n.off("mousemove"),n.off("mouseleave"),$("body").off("mouseup"),window.open_parentheses.remove(),window.close_parentheses.remove(),window.inserir_open=-1,window.inserir_close=-1,window.open_or_close=null,void pa(e,t,n,i);window.open_parentheses.addClass("parentheses_fixed"),(a=$('
)
')).draggable().appendTo("body"),a.css("position","absolute"),a.css("left",o.pageX+10),a.css("top",o.pageY+10),$("body").on("mousemove",(function(e){a.css("left",e.pageX+10),a.css("top",e.pageY+10)}))}else{a.remove(),window.open_parentheses.removeClass("parentheses_fixed"),n.off("mousemove"),n.off("mouseleave"),$("body").off("mouseup"),setTimeout((function(){window.parentheses_activate=!1}),50);s=$(o.target).closest(".command_container"),l=n.closest(".command_container");var c=!1;s.is(l)&&(c=!0),c&&(i.splice(window.inserir_open,0,"("),i.splice(window.inserir_close,0,")")),window.inserir_open=-1,window.inserir_close=-1,window.open_or_close=null,pa(e,t,n,i)}}))}}))}(e,t,n,i)}function fa(e,t,n,i,o,a){var r=$('
'+t+"
");e.append(r)}function ma(e,t,n,i,o,a){var r='",r=$(r);var s=$('
');s.append(r);var l=$('
');l.append(s),e.append(l),r.dropdown("set selected",Ro.minus),s.on("click",(function(){if(!window.open_or_close){var r=a;t.indexOf(Oo.exp_arithmetic)>=0?(console.log("p1"),n.splice(r,0,new jo(Oo.exp_arithmetic,Ro.minus))):t.indexOf(Oo.exp_logic)>=0?(console.log("p2"),n.splice(r,0,new jo(Oo.exp_logic,Co.equals_to))):t.indexOf(Oo.exp_conditional)>=0&&(console.log("p3"),n.splice(r,0,new jo(Oo.exp_conditional,Io.greater_than))),pa(i,o,e,n)}}))}function va(e,t,n,i,o,a){var r=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s='",s=$(s);var l=$('
'),c=$('
'),u=$('');l.append(u),r?(l.removeClass("mouse_distance"),l.css("opacity","1","!important"),e.append(l)):(c.append(l),e.append(c),l.css("opacity","0","!important")),s.dropdown("set selected",Ro.plus),l.on("click",(function(){var r=a;if(")"==n[r]&&"("==n[r-1])return n.splice(r,0,new Qo(ka.all,null,null,null,!0)),void pa(i,o,e,n);t.indexOf(Oo.exp_arithmetic)>=0?(n.splice(r,0,new jo(Oo.exp_arithmetic,Ro.plus)),n.splice(r+1,0,new Qo(ka.all,null,null,null,!0))):t.indexOf(Oo.exp_logic)>=0?(n.splice(r,0,new jo(Oo.exp_logic,Co.equals_to)),n.splice(r+1,0,new Qo(ka.all,null,null,null,!0))):t.indexOf(Oo.exp_conditional)>=0&&(n.splice(r,0,new jo(Oo.exp_conditional,Io.greater_than)),n.splice(r+1,0,new Qo(ka.all,null,null,null,!0))),pa(i,o,e,n)}))}function ha(e,t,n,i,o,a,r){var s='",s=$(s);var l=$('
');l.append(s),n.append(l),s.dropdown({onChange:function(e,t,n){i.item=n.data("value"),i.type_op=n.data("type")}}),s.dropdown("set selected",i.item)}function ya(){var e;return e='
+
',e+='
-
',e+='
*
',e+='
/
',e+='
%
'}function ga(){var e;return e='
==
',e+='
!=
',e+='
'+At.getUI("logic_operator_and")+"
",e+='
'+At.getUI("logic_operator_or")+"
",e+='
'+At.getUI("logic_operator_not")+"
"}function ba(){var e;return e='
>
',e+='
<
',e+='
==
',e+='
!=
',e+='
>=
',e+='
<=
'}function wa(e,t){var n=$('
'+At.getUI("text_receives")+'
');if(n.data("command",e),La(e,e.variable,n.find(".var_attributed"),t),!e.expression||e.expression.length<1){var i=new Qo(ka.all,null,null,null,!0);e.expression.push(i)}return function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))})),n.find(".button_refresh_attribution").on("click",(function(){Ea(e,t,n)}))}(e,t,n),pa(e,t,n.find(".expression_elements"),e.expression),n}function xa(e,t,n,i,o,a,r){var s=r.itens.indexOf(t);switch(a.data("exp")){case Ao.exp_op_exp:var l=new Ko(Ao.exp_op_exp,[r.itens[s],Ro.plus,new Qo(ka.all,null,null,null,!0)]);r.itens[s]=l;break;case Ao.op_exp:l=new Ko(Ao.op_exp,[Ro.plus,r.itens[s]]);r.itens[s]=l;break;case Ao.par_exp_par:l=new Ko(Ao.par_exp_par,[r.itens[s]]);r.itens[s]=l}Ea(e,o,n)}function Ea(e,t,n){var i,o=n.find(".expression_elements");if(0==n.hasClass("command_container"))for(var a=n.parentsUntil(".command_container"),r=0;r
');s.data("ref_element",e.expression[r]),s.data("ref_index",r),o.append(s),Ra(e,t,s,e.expression[r])}}function Ta(e,t,n,i,o){var a='",a=$(a),n.append(a),a.dropdown({onChange:function(e,t,n){i.itens[o]=e}})}function Ra(e,t,n,i){switch(i.type_exp){case Ao.exp_op_exp:var o=$('
'),a=$('
'),r=$('
');n.append(a),n.append(o),n.append(r),i.itens[0].type?La(e,i.itens[0],a,t,2,i):Ra(e,t,a,i.itens[0]),Ta(0,0,o,i,1),i.itens[2].type?La(e,i.itens[2],r,t,2,i):Ra(e,t,r,i.itens[2]);break;case Ao.op_exp:o=$('
');var s=$('
');n.append(o),n.append(s),Ta(0,0,o,i,0),i.itens[1].type?La(e,i.itens[1],s,t,2,i):Ra(e,t,s,i.itens[1]);break;case Ao.par_exp_par:var l=$('
(
'),c=(s=$('
'),$('
)
'));n.append(l),n.append(s);for(var u=0;u )
',n+="";var i=$(n);if(i.data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,i),Ia(e,i.find(".context_menu"),t,i),La(e,e.variable,i.find(".variable_to_switch"),t),e.cases)for(var o=0;o'+At.getUI("text_code_case")+'
:
');if(La(t,e.variable_value_menu,o.find(".variable_case"),n),o.data("switchcase",e),o.find(".case_commands_block").data("switchcase",e),i.append(o),e.commands_block)for(var a=0;a '+At.getUI("btn_break")+" ":(o+=' '+At.getUI("btn_break")+" ",o+=' '+At.getUI("btn_case")+" "),o+="",o=$(o),t.append(o),function(e,t,n,i){t.find(".menu_commands").dropdown({on:"hover"}),t.find(".menu_commands a").on("click",(function(t){if(e.type==To.repeatNtimes||e.type==To.whiletrue||e.type==To.dowhiletrue)if(null==e.commands_block||0==e.commands_block.length){e.commands_block=[];var o=tr($(this).data("command"));e.commands_block.push(o),er(o,i.find(".block_commands"),3,n)}else Wa(n,i.find(".block_commands"),$(this).data("command"),t);else switch($(this).data("command")){case To.break:Wa(n,i.find(".block_commands"),$(this).data("command"),t);break;case To.switchcase:!function(e,t,n,i){null==e.cases&&(e.cases=[]);var o=new Xo(new Qo(ka.all,null,null,null,!0));e.cases.push(o),Oa(o,e,n,i.find(".all_cases_div"))}(e,0,n,i)}}))}(e,t,n,i)}function Ca(e,t){var n='
\n\t\t\n\t\t\n\t\t
'.concat(At.getUI("text_for"),'\n\t\t
\n\t\t
\n\t\t\n\t\t
\n\t\t
\n\t\t\n\t\t').concat(At.getUI("text_for_to"),' \n\t\t
\n\t\t
\n\t\t
\n\t\t
\'');n+='
',n+="
",n+=" ",n+="
";var i=$(n);if(i.data("command",e),i.find(".block_commands").data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,i),Ia(e,i.find(".context_menu"),t,i),La(e,e.var_attribution,i.find(".variable_attribution"),t),La(e,e.expression2,i.find(".conditional_expression"),t),e.expression1||(e.expression1=new Qo(ka.all,"0",null,null,!0)),i.find(".text_receives").text(At.getUI("text_for_from")),La(e,e.expression1,i.find(".var_value_expression"),t),e.expression3?(i.find(".pass_button").html(''),i.find(".pass_button").find("button").on("click",(function(){Na(e)})),Sa(e,t,i.find(".operator"),e.expression3,1),La(e,e.expression3.itens[2],i.find(".second_operand"),t)):(i.find(".pass_button").html(''),i.find(".pass_button").find("button").on("click",(function(){Na(e)}))),e.commands_block)for(var o=0;o
');a.dropdown({values:[{name:"+",value:Ro.plus,selected:i.itens[o]==Ro.plus},{name:"-",value:Ro.minus,selected:i.itens[o]==Ro.minus}],onChange:function(e,t,n){i.itens[o]=e}}),n.append(a)}window.timer=!1,window.parentheses_activate=!1,window.open_or_close=null,window.open_parentheses=$('
(
'),window.close_parentheses=$('
)
'),window.inserir_open=-1,window.inserir_close=-1;var ka=Object.freeze({only_variable:1,only_value:2,only_function:3,variable_and_function:4,variable_and_value_opt:5,value_and_function:6,all:7});function La(e,t,n,i){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2,a=arguments.length>5?arguments[5]:void 0;if(t.function_called&&t.function_called.parameters_list)for(;t.function_called.parameters_list.length!=t.parameters_list.length;)t.parameters_list.length>t.function_called.parameters_list.length?t.parameters_list.pop():t.parameters_list.push(new Qo(ka.all,null,null,null,!0));var r='")).data("variable_reference",e.parameters_list[r]),o.append(s),a=!0}if(e.variables_list)for(r=0;r'+e.variables_list[r].name+" ")).data("variable_reference",e.variables_list[r]),o.append(s),a=!0}a||(o.append($('
'+At.getUI("text_no_variable")+"
")),o.append($('
'+At.getUI("text_no_variable_instruction")+"
")))}(i,r,t),function(e,t,n,i){var o=t.find(".menu_only_functions");o.text("");for(var a=0;a'+window.program_obj.functions[a].name+" ");r.data("function_reference",window.program_obj.functions[a]),o.append(r)}}(0,r),function(e,t,n,i){var o=t.find(".menu_only_functions");o.append('
'+At.getUI("text_header_ivprog_functions")+"
"),o.append('
'+At.getUI("text_menu_functions_math")+'
'),o.append('
'+At.getUI("text_menu_functions_text")+'
'),o.append('
'+At.getUI("text_menu_functions_array")+'
'),o.append('
'+At.getUI("text_menu_functions_conversion")+'
');for(var a=0;a');switch(r.data("function_reference",window.system_functions[a]),r.data("option",ka.only_function),r.text(At.translateInternalFunction(window.system_functions[a].identifier)),window.system_functions[a].category){case No.math:o.find(".menu_math_functions").append(r);break;case No.text:o.find(".menu_text_functions").append(r);break;case No.arrangement:o.find(".menu_arrangement_functions").append(r);break;case No.conversion:o.find(".menu_conversion_functions").append(r)}}}(0,r),t.content||t.function_called){if(t.content){var s=Ua(t.content,i);s?(t.content=s,Pa(i,r,t,n,e,a)):t.content&&t.content.type?(t.content=null,$a(t,r)):Pa(i,r,t,n,e,a)}else if(t.function_called){var l=function(e){if(e.name){if(window.program_obj.functions){for(var t=0;t"+At.getUI("var_menu_select_var")+"");break;case ka.all:case ka.variable_and_function:t.find(".text").append(""+At.getUI("var_menu_select_all")+"");break;case ka.only_function:t.find(".text").append(""+At.getUI("var_menu_select_function")+"")}}function Ua(e,t){if(t.variables_list)for(var n=0;n '+t.function_called.name+" ( ":'
'+At.translateInternalFunction(t.function_called.identifier,t.function_called.category)+" ( ",l+=" )
",l=$(l),n.append(l);var s='",(s=$(s)).insertAfter(n.find(".parameters_function_called")),s.dropdown({onChange:function(o,r,s){console.log("S1"),s.data("clear")&&(console.log("PP1"),n.text(""),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,La(e,t,n,i,2,a)),s.data("exp")&&xa(e,t,n,0,i,s,a)},selectOnKeydown:!1})}else{var l;o.find(".text").text(" "),n.find(".menu_var_or_value_dom").remove(),l=t.function_called.name?'
'+t.function_called.name+" ( ":'
'+At.translateInternalFunction(t.function_called.identifier,t.function_called.category)+" ( ";for(var c=0;c
',c+1!=t.function_called.parameters_list.length&&(l+=" , ");l+=" )
",l=$(l),n.append(l);for(c=0;c
",(s=$(s)).insertAfter(l),s.dropdown({onChange:function(o,r,s){console.log("S2"),s.data("clear")&&(console.log("PP2"),n.text(""),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,La(e,t,n,i,2,a)),s.data("exp")&&xa(e,t,n,0,i,s,a)},selectOnKeydown:!1})}else if(t.content.type){var u="";if(1==t.content.dimensions&&1!=t.dimensions){u='
'+t.content.name+"",u+=' [
]',u+="
",u=$(u),n.append(u);s='",s=$(s),u.append(s),s.dropdown({onChange:function(o,r,s){console.log("S3"),s.data("clear")&&(console.log("PP3"),n.text(""),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,La(e,t,n,i,2,a)),s.data("exp")&&xa(e,t,n,0,i,s,a)},selectOnKeydown:!1}),t.column||(t.column=new Qo(ka.all,null,null,null,!0)),Ma(e,t.column,$(u.find(".column_container")),i,o,a)}else if(2==t.content.dimensions&&2!=t.dimensions){u='
'+t.content.name+"",u+=' [
]',u+=' [
] ',u+="
",u=$(u),n.append(u);s='",s=$(s),u.append(s),s.dropdown({onChange:function(o,r,s){console.log("S4"),s.data("clear")&&(console.log("PP4"),n.text(""),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,La(e,t,n,i,2,a)),s.data("exp")&&xa(e,t,n,0,i,s,a)},selectOnKeydown:!1}),t.column||(t.column=new Qo(ka.all,null,null,null,!0)),t.row||(t.row=new Qo(ka.all,null,null,null,!0)),Ma(e,t.row,$(u.find(".row_container")),i,o,a),Ma(e,t.column,$(u.find(".column_container")),i,o,a)}else{u='
'+t.content.name+"",u+="
",u=$(u),n.append(u);s='",s=$(s),u.append(s),s.dropdown({onChange:function(o,r,s){console.log("S5"),s.data("clear")&&(console.log("PP5"),n.text(""),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,La(e,t,n,i,2,a)),s.data("exp")&&xa(e,t,n,0,i,s,a)},selectOnKeydown:!1})}}else{u='
'+t.content+"";u+="
",u=$(u),n.append(u);s='",s=$(s),t.variable_and_value!=ka.only_value&&s.insertAfter(u),s.dropdown({onChange:function(o,r,s){console.log("S6"),s.data("clear")&&(console.log("PP6"),n.text(""),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,n.find(".value_rendered").remove(),n.find(".context_menu_clear").remove(),n.find(".width-dynamic-minus").remove(),La(e,t,n,i,2,a)),s.data("exp")&&xa(e,t,n,0,i,s,a)},selectOnKeydown:!1}),u.on("click",(function(r){u.remove(),u.empty(),u.remove(),n.empty(),n.append(' '),Fa(e,t,n,o,i,a)}))}}else La(e,t,n,i,2,a)}function Fa(e,t,n,i,o,a){null==t.content&&(t.content=""),i.find(".text").text(" ");var r=$('');r.insertBefore(n.find(".menu_var_or_value_dom"));var s=$('
');s.insertBefore(r),r.focus(),r.val(t.content);var l='",l=$(l),n.find(".menu_var_or_value_dom").remove(),t.variable_and_value!=ka.only_value&&l.insertAfter(r),l.dropdown({onChange:function(i,r,s){console.log("S11"),s.data("clear")&&(console.log("PP10"),n.text(""),n.find(".value_rendered").remove(),n.find(".context_menu_clear").remove(),n.find(".width-dynamic-minus").remove(),t.content=null,t.row=null,t.column=null,delete t.function_called,delete t.parameters_list,La(e,t,n,o,2,a)),s.data("exp")&&xa(e,t,n,0,o,s,a)},selectOnKeydown:!1}),n.find(".width-dynamic-minus").focusout((function(){$(this).val().trim()&&(t.content=$(this).val().trim()),s.text(t.content),$(this).remove()})),n.find(".width-dynamic-minus").on("keydown",(function(e){var n=e.keyCode||e.which;13==n&&($(this).val().trim()&&(t.content=$(this).val().trim()),s.text(t.content),$(this).remove()),27==n&&(s.text(t.content),$(this).remove())})),e.type,To.comment,s.on("click",(function(r){console.log("TTT2"),s.remove(),s.empty(),s.remove(),n.empty(),n.append(' '),Fa(e,t,n,i,o,a)}))}function ja(e,t){var n=$('
');return n.data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,n),function(e,t,n){La(e,e.comment_text,n.find(".var_value_menu_div"),t,20)}(e,t,n),n}function Ka(e,t){var n='
'+At.getUI("text_command_read")+' (
)
';return(n=$(n)).data("command",e),La(e,e.variable_value_menu,n.find(".var_value_menu_div"),t),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,n),n}function Ba(e,t){var n="";n+='
'+At.getUI("text_command_write")+' (
)
';var i=$(n);return i.data("command",e),pa(e,t,i.find(".all_elements_write"),e.content),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))})),Sortable.create(n.find(".all_elements_write")[0],{handle:".ellipsis",animation:100,ghostClass:"ghost",group:"writer_"+Math.floor(1e7*Math.random()),draggable:".div_parent_handler",onEnd:function(i){e.content.splice(i.newIndex,0,e.content.splice(i.oldIndex,1)[0]),n.empty(),n.replaceWith(Ba(e,t))}})}(e,t,i),i}function Ga(e,t){var n="";n+='
',n+=' '+At.getUI("text_if")+"",n+=' (
) ',n+=" ",n+='
',n+="
",n+='
'+At.getUI("text_else")+" ",n+='
',n+="
",n+="
",n+="
";var i=$(n);if(i.data("command",e),i.find(".block_commands").data("command",e),i.find(".data_block_if").data("command",e),i.find(".data_block_else").data("command",e),i.find(".commands_if").data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,i),pa(e,t,i.find(".conditional_expression"),e.expression),e.commands_block)for(var o=0;o",n+=' (
) ',n+=" ",n+='
',n+="
",n+=" ",n+="";var i=$(n);if(i.data("command",e),i.find(".block_commands").data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,i),Ia(e,i.find(".context_menu"),t,i),pa(e,t,i.find(".conditional_expression"),e.expression),e.commands_block)for(var o=0;o",n+='
',n+="
",n+=' '+At.getUI("text_command_do_until")+' (
) ',n+="";var i=$(n);if(i.data("command",e),i.find(".block_commands").data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,i),Ia(e,i.find(".context_menu"),t,i),e.expression&&pa(e,t,i.find(".conditional_expression"),e.expression),e.commands_block)for(var o=0;o
');return n.data("command",e),La(e,e.function_called,n.find(".var_value_menu_div"),t),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,n),n}function Ha(e,t){var n=$('
'+At.getUI("text_break")+"
");return n.data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,n),n}function za(e,t){var n=$('
'+At.getUI("text_return")+'
');return n.data("command",e),function(e,t,n){n.find(".button_remove_command").on("click",(function(){Xa(e,t,n)&&n.fadeOut(400,(function(){n.remove()}))}))}(e,t,n),t.return_type!=Hi.VOID?(e.variable_value_menu||(e.variable_value_menu=[new Qo(ka.all,null,null,null,!0)]),pa(e,t,n.find(".expression_elements"),e.variable_value_menu)):(n.find(".expression_elements").remove(),e.variable_value_menu=null),n}function Xa(e,t,n){if(eo(t.name,Ji.REMOVE_COMMAND,e.type,"/",0),t.commands.indexOf(e)>-1)return t.commands.splice(t.commands.indexOf(e),1),!0;try{if(n.parent().parent().data("command").commands_block.indexOf(e)>-1)return n.parent().parent().data("command").commands_block.splice(n.parent().parent().data("command").commands_block.indexOf(e),1),!0}catch(e){}try{if(n.parent().parent().data("command").type==To.iftrue&&n.parent().parent().data("command").commands_else.indexOf(e)>-1)return n.parent().parent().data("command").commands_else.splice(n.parent().parent().data("command").commands_else.indexOf(e),1),!0}catch(e){}return!!n.parent().data("switchcase")&&(console.log("o que encontrei: "),console.log(n.parent().data("switchcase")),n.parent().data("switchcase").commands_block.splice(n.parent().data("switchcase").commands_block.indexOf(e),1),!0)}function Wa(e,t,n,i){var o;switch(n){case To.break:o=$('
'+At.getUI("text_break")+"
");break;case To.comment:o=$('
'+At.getUI("text_comment")+"
");break;case To.reader:o=$('
'+At.getUI("text_command_read")+" var
");break;case To.writer:o=$('
'+At.getUI("text_command_write")+" var
");break;case To.attribution:o=$('
x <— 1 + 1
');break;case To.iftrue:o=$('
if (x < 1) { }
');break;case To.repeatNtimes:o=$('
repita_para i de 0 ate 10 passo 1
');break;case To.whiletrue:o=$('
'+At.getUI("text_command_while")+" ( x < 10 )
");break;case To.dowhiletrue:o=$('
'+At.getUI("text_command_do")+"
"+At.getUI("text_command_do_until")+"(x < 10)
");break;case To.switch:o=$('
'+At.getUI("text_code_switch")+" ( x ) {
"+At.getUI("text_code_case")+" 1:
"+At.getUI("text_code_case")+" 2:
}
");break;case To.functioncall:o=$('
funcao()
');break;case To.return:o=$('
'+At.getUI("text_return")+"
")}o.draggable().appendTo("body"),$("body").mouseup((function(i){!function(e,t,n,i){$(".created_element").each((function(e){$(this).remove()}));var o=$(document.elementFromPoint(n.clientX,n.clientY));o.hasClass("ghost_div")&&o.closest(".command_container").length<1&&(console.log("\n\nvou tentar!!!!"),console.log(o.closest(".commands_list_div"),"\n\n"),o.closest(".commands_list_div").css("height",o.closest(".commands_list_div").css("height")+30),o=o.closest(".commands_list_div"));console.log("soltou no: "),console.log(o),console.log(o.data("fun"));var a=o.parentsUntil(".all_functions"),r=!1,s=!1;o.hasClass("commands_list_div")&&(s=!0);for(var l=0;l-1&&i.commands.splice(d,0,u),er(u,l,1,i),eo(i.name,Ji.INSERT_COMMAND,o,"/",d)}}(0,n,$(t).find(".commands_list_div"),e,i);else{console.log("soltou em um comando");var p=o.parentsUntil(".commands_list_div");u=[],void 0!==o.data("command")&&u.push(o.data("command"));for(l=0;l3&&void 0!==arguments[3]&&arguments[3],arguments.length>4&&void 0!==arguments[4]&&arguments[4];for(var i="",o=0;o<=t.length;o++)console.log("\n\n:: ",o,":\n",t[o]),i+=ir(t[o],t[o+1])+"-";return i}(m,u,e);eo(e.name,Ji.INSERT_COMMAND,i,"/",v),console.log("\n\nfull path: \n\n",v),console.log("fim dos índices")}renderAlgorithm()}(e,t,i,n),$("body").off("mouseup"),$("body").off("mouseover")})),(!t.hasClass("function_div")||t.length<1)&&(window.mouse_event=i,t=$(i.originalEvent.srcElement.closest(".function_div"))),console.log("function_container",t),function_container_active=t,t.find(".commands_list_div").on("mousemove",(function(e){Za(e)})),t.find(".commands_list_div").find("*").on("mousemove",(function(e){Za(e)})),t.on("mouseout",(function(e){$(document.elementFromPoint(e.clientX,e.clientY)).closest(".commands_list_div").length<1&&window.ghostDiv.remove()})),o.css("position","absolute"),i.type="mousedown.draggable",i.target=o[0],o.css("left",i.pageX-window.divx),o.css("top",i.pageY),o.trigger(i)}function Qa(e,t){$(".ghost_div").remove();var n=e.closest(".command_container");if(n.hasClass("switch")&&(n=$(t.target).closest(".case_div")),n.hasClass("dowhiletrue")||n.hasClass("iftrue")||n.hasClass("repeatNtimes")||n.hasClass("case_div")||n.hasClass("whiletrue"))if(null!=window.active_container&&(window.active_container.is(n)?console.log("é o mesmo, não mudou!"):n.length<1?(n=e.closest(".commands_list_div"),window.active_container.is(n)?console.log("é o mesmo command list"):(console.log("mudou para um command list"),window.active_container=n)):console.log("mudou para um outro container?")),window.active_container=n,n.hasClass("iftrue")){var i=n.find(".commands_if").get(0),o=n.find(".commands_else").get(0),a=Math.abs(t.clientY-i.getBoundingClientRect().top),r=(Math.abs(i.getBoundingClientRect().top+i.getBoundingClientRect().height-t.clientY),Math.abs(t.clientY-o.getBoundingClientRect().top)),s=Math.abs(o.getBoundingClientRect().top+o.getBoundingClientRect().height-t.clientY);a0)n=i.find(".commands_if").children(".command_container");else if($(t.target).closest(".data_block_else").length>0)n=i.find(".commands_else").children(".command_container");else{var o=i.find(".commands_if").get(0),a=i.find(".commands_else").get(0),r=Math.abs(t.clientY-o.getBoundingClientRect().top),s=(Math.abs(o.getBoundingClientRect().top+o.getBoundingClientRect().height-t.clientY),Math.abs(t.clientY-a.getBoundingClientRect().top)),l=Math.abs(a.getBoundingClientRect().top+a.getBoundingClientRect().height-t.clientY);n=r0?Ya(t,e):Qa(t,e):t.hasClass("case_div")?t.find(".case_commands_block").find(".command_container").length>0?Ya(t,e):Qa(t,e):Ya(t,e))}function er(e,t,n,i){var o;switch(e.type){case To.comment:o=ja(e,i);break;case To.break:o=Ha(e,i);break;case To.reader:o=Ka(e,i);break;case To.writer:o=Ba(e,i);break;case To.attribution:o=wa(e,i);break;case To.functioncall:o=qa(e,i);break;case To.iftrue:o=Ga(e,i);break;case To.repeatNtimes:o=Ca(e,i);break;case To.whiletrue:o=Da(e,i);break;case To.dowhiletrue:o=Va(e,i);break;case To.switch:o=Aa(e,i);break;case To.return:o=za(e,i)}switch(n){case 1:o.insertBefore(t);break;case 2:o.insertAfter(t);break;case 3:t.append(o)}}function tr(e){switch(e){case To.break:return new Uo;case To.comment:return new $o(new Qo(ka.only_value,At.getUI("text_comment"),null,null,!1));case To.reader:return new Po(new Qo(ka.only_variable,null,null,null,!1));case To.writer:return new Mo([new Qo(ka.all,null,null,null,!0)]);case To.attribution:return new Fo(new Qo(ka.only_variable,null,null,null,!1),[]);case To.functioncall:return new Wo(new Qo(ka.only_function,null,null,null,!1),null);case To.iftrue:return new Go([new Qo(ka.all,null,null,null,!0)]);case To.repeatNtimes:return new Do(new Qo(ka.only_variable,null,null,null,!1),new Qo(ka.only_variable,null,null,null,!1),null,new Qo(ka.all,null,null,null,!0),null,null);case To.whiletrue:return new Vo([new Qo(ka.all,null,null,null,!0)],null);case To.dowhiletrue:return new qo([new Qo(ka.all,null,null,null,!0)],null);case To.switch:var t=[new Xo(new Qo(ka.all,null,null,null,!0))];return new Ho(new Qo(ka.variable_and_function,null,null,null,!0),t);case To.return:return new zo([new Qo(ka.all,null,null,null,!0)])}}function nr(e){$(".ghost_div").remove();var t=$('');$("body").append(t),t.css("position","absolute"),t.css("top",e.clientY),t.css("left",e.clientX-20),t.css("font-size","3em"),t.css("display","none"),function_container_active.find(".commands_list_div").off("mousemove"),function_container_active.find(".commands_list_div").find("*").off("mousemove"),t.fadeIn(200,(function(){t.fadeOut(200,(function(){t.remove()}))}))}function ir(e,t){if(!e||!t)return"";if(e.type==To.repeatNtimes||e.type==To.whiletrue||e.type==To.dowhiletrue)return e.commands_block?""+e.commands_block.indexOf(t):"0";if(e.type==To.iftrue)return null==e.commands_block&&(e.commands_block=[]),null==e.commands_else&&(e.commands_else=[]),console.log("\n\nveja onde: ",e.commands_block," \n\nquery: ",t),e.commands_block.indexOf(t)>=0?"if["+e.commands_block.indexOf(t)+"]":"else["+e.commands_else.indexOf(t)+"]";if(e.type==To.switch)for(var n=0;n=0)return"case["+e.cases[n].commands_block.indexOf(t)+"]"}function or(e,t,n,i,o,a){var r=$(e),s=r.data("command");if(r.data("command").type==To.repeatNtimes||r.data("command").type==To.whiletrue||r.data("command").type==To.dowhiletrue||r.data("command").type==To.switch)if(console.log("QQ17"),r.data("command").type==To.repeatNtimes||r.data("command").type==To.whiletrue||r.data("command").type==To.dowhiletrue)if(console.log("QQ18"),null==s.commands_block||0==s.commands_block.length){s.commands_block=[];var l=tr(i);s.commands_block.push(l),eo(n.name,Ji.INSERT_COMMAND,i,"/"+r.data("command").type,0),er(l,r.find(".block_commands"),3,n)}else!function(e,t,n,i,o,a){console.log("\n\n\n::COMANDOS:\n\n",e,t,n,i,o,a);for(var r,s=$(n).find("div.command_container"),l=999999999,c=null,u=0;u-1&&a.commands_block.splice(p,0,d),er(d,c,1,i)}}(e,t,e,n,i,s);else ar(t,n,i);else console.log("QQ19"),function(e,t,n,i){var o=$(e),a=$(e.parentNode.parentNode).data("command"),r=o.data("command"),s=$(e.parentNode.parentNode),l=!1;if(!a){a=o.data("command"),s=o;for(var c=o.parentsUntil(".command_container"),u=0;u-1&&a.commands_else.splice(h,0,v),er(v,e,1,n)}else{if(console.log("MMM4"),a==r){if(console.log("Nxxxx5"),null==a.commands_block||0==a.commands_block.length){a.commands_block=[],console.log("SSS4");v=tr(i);a.commands_block.push(v),er(v,o,3,n)}else console.log("SSS5"),rr(o,t,n,i);return}console.log("MMM6"),(h=a.commands_block.indexOf(r))>-1&&a.commands_block.splice(h,0,v),er(v,e,1,n)}}else{console.log("XXX1");v=tr(i);if(l){if(a==r){if(console.log("MMM3"),null==a.commands_else||0==a.commands_else.length){a.commands_else=[],console.log("SSS1");v=tr(i);a.commands_else.push(v),er(v,o,3,n)}else console.log("SSS2"),rr(o,t,n,i,!0);return}console.log("XXX2"),(h=a.commands_else.indexOf(r))>-1&&a.commands_else.splice(h+1,0,v),er(v,e,2,n)}else{if(a==r){if(console.log("Nxxxx78"),null==a.commands_block||0==a.commands_block.length){a.commands_block=[];v=tr(i);a.commands_block.push(v),console.log("SSS6"),er(v,o,3,n)}else console.log("SSS7"),rr(o,t,n,i);return}var h;console.log("XXX3"),(h=a.commands_block.indexOf(r))>-1&&a.commands_block.splice(h+1,0,v),er(v,e,2,n)}}}(e,t,n,i)}function ar(e,t,n){var i=$(document.elementFromPoint(e.clientX,e.clientY)),o=i.data("switchcase"),a=i;if(!o)for(var r=i.parentsUntil(".all_cases_div"),s=0;s-1&&(e.commands_block.splice(d,0,u),er(u,l,1,i))}}(o,a,e,t,n)}function rr(e,t,n,i){for(var o,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=$(e),s=r.find("div.command_container"),l=999999999,c=null,u=0;u-1&&(_.commands_else.splice(f,0,p),er(p,c,1,n));else(f=_.commands_block.indexOf($(c).data("command")))>-1&&(_.commands_block.splice(f,0,p),er(p,c,1,n))}}function sr(e,t,n,i){switch($(e).data("command").type){case To.iftrue:case To.switch:case To.repeatNtimes:case To.whiletrue:case To.dowhiletrue:return void function(e,t,n,i){var o=$(e),a=o.data("command");if(o.data("command").type==To.repeatNtimes||o.data("command").type==To.whiletrue||o.data("command").type==To.dowhiletrue)if(null==a.commands_block||0==a.commands_block.length){a.commands_block=[];var r=tr(i);a.commands_block.push(r),er(r,o.find(".block_commands"),3,n)}else rr(e,t,n,i);else if(o.data("command").type==To.iftrue){console.log("QQ9");var s=$(document.elementFromPoint(t.pageX,t.pageY)),l=!0;if(s.data("if"))l=!0;else if(s.data("else"))l=!1;else for(var c=s.parentsUntil(".command_container"),u=0;u-1&&n.commands.splice(s,0,r),er(r,e,1,n),eo(n.name,Ji.INSERT_COMMAND,i,"/",s)}else{var s;r=tr(i);(s=n.commands.indexOf($(e).data("command")))>-1&&n.commands.splice(s+1,0,r),er(r,e,2,n),eo(n.name,Ji.INSERT_COMMAND,i,"/",s)}}function lr(){$(".ivprog_visual_panel").find(".error_icon").remove();var e=At.getUI("program")+" { ";e+=function(){var e="";if(window.program_obj.globals)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:2;switch(e.type){case To.break:return function(e,t){for(var n="\n",i=0;i1&&void 0!==arguments[1]&&arguments[1],n="";try{if(e.function_called){if(e.function_called.name?n+=e.function_called.name+" ( ":n+=At.translateInternalFunction(e.function_called.identifier,e.function_called.category)+" ( ",e.parameters_list)for(var i=0;i").hide().appendTo(document.body)),$.fn.textWidth.fakeEl.text(e||this.val()||this.text()||this.attr("placeholder")).css("font",t||this.css("font")),$.fn.textWidth.fakeEl.width()},window.function_container_active=null,window.divx=100,window.ghostDiv=$('
'),window.active_container=null;var hr=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"requestInput",value:function(e){throw new Error("Must be implemented")}},{key:"cancelPendingInputRequests",value:function(){throw new Error("Must be implemented")}}])&&vr(t.prototype,n),i&&vr(t,i),e}();function yr(e){return(yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gr(e,t){for(var n=0;nr)){var p=t.slice(0,d);if(t.slice(d)===c){var _=Math.min(s,d),f=l.slice(0,_),m=p.slice(0,_);if(f===m){var v=l.slice(_),h=p.slice(_);return Gr(f,v,h,c)}}}if(null===u||u===s){var y=s,g=t.slice(0,y),b=t.slice(y);if(g===l){var w=Math.min(a-y,r-y),x=c.slice(c.length-w),E=b.slice(b.length-w);if(x===E){var T=c.slice(0,c.length-w),R=b.slice(0,b.length-w);return Gr(l,T,R,x)}}}}if(i.length>0&&o&&0===o.length){var A=e.slice(0,i.index),O=e.slice(i.index+i.length),I=A.length,C=O.length;if(!(rt.length?e:t,o=e.length>t.length?t:e,a=i.indexOf(o);if(-1!==a)return n=[[kr,i.substring(0,a)],[Lr,o],[kr,i.substring(a+o.length)]],e.length>t.length&&(n[0][0]=n[2][0]=Sr),n;if(1===o.length)return[[Sr,e],[kr,t]];var r=function(e,t){var n=e.length>t.length?e:t,i=e.length>t.length?t:e;if(n.length<4||2*i.length=e.length?[i,o,a,r,c]:null}var a,r,s,l,c,u=o(n,i,Math.ceil(n.length/4)),d=o(n,i,Math.ceil(n.length/2));if(!u&&!d)return null;a=d?u&&u[4].length>d[4].length?u:d:u;e.length>t.length?(r=a[0],s=a[1],l=a[2],c=a[3]):(l=a[0],c=a[1],r=a[2],s=a[3]);var p=a[4];return[r,s,l,c,p]}(e,t);if(r){var s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],p=$r(s,c),_=$r(l,u);return p.concat([[Lr,d]],_)}return function(e,t){for(var n=e.length,i=t.length,o=Math.ceil((n+i)/2),a=o,r=2*o,s=new Array(r),l=new Array(r),c=0;cn)_+=2;else if(b>i)p+=2;else if(d){var w=a+u-h;if(w>=0&&w=x)return Ur(e,t,g,b)}}}for(var E=-v+f;E<=v-m;E+=2){for(var T=a+E,R=void 0,A=(R=E===-v||E!==v&&l[T-1]n)m+=2;else if(A>i)f+=2;else if(!d){var O=a+u-E;if(O>=0&&O=(R=n-R))return Ur(e,t,I,C)}}}}return[[Sr,e],[kr,t]]}(e,t)}(e=e.substring(0,e.length-a),t=t.substring(0,t.length-a));return r&&l.unshift([Lr,r]),s&&l.push([Lr,s]),function e(t,n){t.push([Lr,""]);var i=0;var o=0;var a=0;var r="";var s="";var l;var c;for(;i=0&&Br(t[c][1])){var u=t[c][1].slice(-1);if(t[c][1]=t[c][1].slice(0,-1),r=u+r,s=u+s,!t[c][1]){t.splice(c,1),i--;var d=c-1;t[d]&&t[d][0]===kr&&(a++,s=t[d][1]+s,d--),t[d]&&t[d][0]===Sr&&(o++,r=t[d][1]+r,d--),c=d}}if(Kr(t[i][1])){var p=t[i][1].charAt(0);t[i][1]=t[i][1].slice(1),r+=p,s+=p}}if(i0||s.length>0){r.length>0&&s.length>0&&(0!==(l=Pr(s,r))&&(c>=0?t[c][1]+=s.substring(0,l):(t.splice(0,0,[Lr,s.substring(0,l)]),i++),s=s.substring(l),r=r.substring(l)),0!==(l=Mr(s,r))&&(t[i][1]=s.substring(s.length-l)+t[i][1],s=s.substring(0,s.length-l),r=r.substring(0,r.length-l)));var _=a+o;0===r.length&&0===s.length?(t.splice(i-_,_),i-=_):0===r.length?(t.splice(i-_,_,[kr,s]),i=i-_+1):0===s.length?(t.splice(i-_,_,[Sr,r]),i=i-_+1):(t.splice(i-_,_,[Sr,r],[kr,s]),i=i-_+2)}0!==i&&t[i-1][0]===Lr?(t[i-1][1]+=t[i][1],t.splice(i,1)):i++,a=0,o=0,r="",s=""}""===t[t.length-1][1]&&t.pop();var f=!1;i=1;for(;i=55296&&e<=56319}function jr(e){return e>=56320&&e<=57343}function Kr(e){return jr(e.charCodeAt(0))}function Br(e){return Fr(e.charCodeAt(e.length-1))}function Gr(e,t,n,i){return Br(e)||Kr(i)?null:function(e){for(var t=[],n=0;n0&&t.push(e[n]);return t}([[Lr,e],[Sr,t],[kr,n],[Lr,i]])}function Dr(e,t,n){return $r(e,t,n,!0)}Dr.INSERT=kr,Dr.DELETE=Sr,Dr.EQUAL=Lr;var Vr=Dr;function qr(e,t){for(var n=0;n6&&void 0!==arguments[6]?arguments[6]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.status=n,this.inputs=i,this.results=o,this.store=a,this.time=r,this.error_msg=s}return Hr(e,null,[{key:"PAGE_TEMPLATE",get:function(){return"\n \n \n \n \n \n \n :assessment-result:\n \n "}},{key:"DETAIL_TEMPLATE",get:function(){return"
\n
\n

:test-name:

\n

:time-label:: :time:ms

\n

:grade-label:: :grade:%

\n
\n
\n

:input-label:

\n
    \n
  • :input-list:
  • \n
\n
\n
\n

:output-label:

\n :output-result:\n
\n
"}},{key:"OUPUT_TABLE_TEMPLATE",get:function(){return"
\n \n \n \n \n \n \n :results:\n
:expected-label::generated-label::result-label:
\n
"}},{key:"OUTPUT_TEMPLATE",get:function(){return"$0\n $1\n $2"}},{key:"EMPTY_OUTPUT_TEMPLATE",get:function(){return"
\n $0
"}},{key:"FAILED_TEMPLATE",get:function(){return"

$0

"}},{key:"INPUT_INFO_TEMPLATE",get:function(){return"$1"}}]),Hr(e,[{key:"prepareResults",value:function(){var t=this,n=e.DETAIL_TEMPLATE,i=(100*this.grade).toFixed(2),o=this.time||"-";n=(n=(n=(n=(n=n.replace(":test-name:",At.getUI("assessment-detail-title",[this.name+1]))).replace(":time-label:",At.getUI("assessment-detail-time-label"))).replace(":time:",o)).replace(":grade-label:",At.getUI("assessment-detail-grade-label"))).replace(":grade:",i);var a=this.prepareInputList(this.inputs);if(n=(n=(n=n.replace(":input-label:",At.getUI("assessment-detail-input-label"))).replace(":input-list:",a)).replace(":output-label:",At.getUI("assessment-detail-output-label")),0==this.status){var r=this.results.map((function(e){return"string"==e.type?t.formatString(e):"number"==e.type?t.formatNumber(e):t.formatBool(e)}),this);n=n.replace(":output-result:",this.prepareOutputTable(r))}else{var s=e.FAILED_TEMPLATE;s=s.replace("$0",this.error_msg),n=n.replace(":output-result:",s)}return n}},{key:"prepareInputList",value:function(t){return t.map((function(t){var n=e.INPUT_INFO_TEMPLATE;return n=n.replace("$1",t.value),n=t.read?n.replace("$0","assessment-input-read"):n.replace("$0","assessment-input-unread")}),this).join(At.getUI("text_join_assessment_outputs"))}},{key:"prepareOutputTable",value:function(t){var n=e.OUPUT_TABLE_TEMPLATE;return n=(n=(n=(n=n.replace(":expected-label:",At.getUI("assessment-detail-expected-label"))).replace(":generated-label:",At.getUI("assessment-detail-generated-label"))).replace(":result-label:",At.getUI("assessment-detail-result-label"))).replace(":results:",t.join(""))}},{key:"generateOutput",value:function(){var t=this.prepareResults(),n=e.PAGE_TEMPLATE;return n=(n=n.replace(":assessment-result:",t)).replace(/(\r|\n|\t)/gm,"").replace(/> *<")}},{key:"formatNumber",value:function(e){var t=1==e.grade?"assessment-number-result":"assessment-number-result-failed";return this.formatOutput("assessment-number-expected","assessment-number-generated",t,e)}},{key:"formatBool",value:function(e){var t=1==e.grade?"assessment-bool-result":"assessment-bool-result-failed";return this.formatOutput("assessment-bool-expected","assessment-bool-generated",t,e)}},{key:"formatOutput",value:function(t,n,i,o){var a=e.OUTPUT_TEMPLATE;a=(a=(a=a.replace(":class-expected:",t)).replace(":class-generated:",n)).replace(":class-result:",i);var r=o.expected,s=o.generated;null==r?r=e.EMPTY_OUTPUT_TEMPLATE.replace("$0",At.getMessage("assessment-empty-expected-tooltip")):null==s&&(s=e.EMPTY_OUTPUT_TEMPLATE.replace("$0",At.getMessage("assessment-empty-generated-tooltip"))),a=(a=a.replace("$0",r)).replace("$1",s);var l=1==o.grade?"✓":"✗";return a=a.replace("$2",l)}},{key:"formatString",value:function(t){var n=this,i=e.OUTPUT_TEMPLATE;i=(i=i.replace(":class-expected:","assessment-string-expected")).replace(":class-generated:","assessment-string-generated");var o=t.generated||"",a=t.expected||"",r=o,s=a;if(null==t.generated?r=e.EMPTY_OUTPUT_TEMPLATE.replace("$0",At.getMessage("assessment-empty-generated-tooltip")):null==t.expected&&(s=e.EMPTY_OUTPUT_TEMPLATE.replace("$0",At.getMessage("assessment-empty-expected-tooltip"))),i=(i=i.replace("$0",s)).replace("$1",r),1==t.grade)i=(i=i.replace("$2","✓")).replace(":class-result:","assessment-string-result");else{var l=Vr(o,a).map((function(e){return n.getDiffStringStyle(e[1],e[0])}),this).reduce((function(e,t){return e+t}),"");i=(i=i.replace("$2",""+l)).replace(":class-result:","assessment-string-diff")}return i}},{key:"getDiffStringStyle",value:function(e,t){var n="$1";switch(e=e.replace(/\s/g," "),t){case Vr.INSERT:return n.replace("$0","stringdiff-insert").replace("$1",e);case Vr.DELETE:return n.replace("$0","stringdiff-delete").replace("$1",e);case Vr.EQUAL:return n.replace("$0","stringdiff-equal").replace("$1",e)}}},{key:"grade",get:function(){return null==this.results?0:this.results.reduce((function(e,t){return e+t.grade}),0)/this.results.length}}]),e}();function Xr(e,t,n){return new Qr(e,t,n,"number")}function Wr(e,t,n){return new Qr(e,t,n,"bool")}var Qr=function e(t,n,i,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.expected=t,this.generated=n,this.grade=i,this.type=o};function Yr(e,t){for(var n=0;n=e.expected_output.length?new Qr(null,t,0,e.getPotentialOutputType(t)):e.outputMatch(t,e.expected_output[n])}),e);if(e.expected_output.length>i.list.length){console.log("Saída insuficientes!",e.expected_output.length,i.list.length);for(var l=i.list.length;l=s.length)return Xr(null,e,0);var n=new Xe.Decimal(e),o=new Xe.Decimal(s[t]);return i.checkNumbers(n,o)}),this);if(s.length>l.length)for(var u=l.length;u=p.length)return Wr(null,e,0);var n=Ze(e),o=Ze(p[t]);return i.checkBoolean(n,o)}),this);if(p.length>_.length)for(var m=_.length;m1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i3?o-3:0),r=3;r|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function a(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function r(e,t){return"function"==typeof e?e(t):Object.propertyIsEnumerable.call(e,t)}function s(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=null;break}i="*"==n}return"comment"}function l(e){for(var t={},n=e.split(" "),i=0;i!/&]/,k=/[a-zA-Z0-9_]/,L=c.isReservedIdentifier||!1,$=function(){};function U(e,t){var n=e.next();if(R[n]){var i=R[n](e,t);if(!1!==i)return i}if('"'==n)return t.tokenize=$(n),t.tokenize(e,t);if(I.test(n))return u=n,null;if(C.test(n)){if(e.backUp(1),e.match(N))return"number";e.next()}if("/"==n){if(e.eat("*"))return t.tokenize=s,s(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(S.test(n)){for(;!e.match(/^\/[/*]/,!1)&&e.eat(S););return"operator"}if(e.eatWhile(k),O)for(;e.match(O);)e.eatWhile(k);var o=e.current();return r(m,o)?(r(x,o)&&(u="newstatement"),r(E,o)&&(d=!0),"keyword"):r(b,o)?"type":r(w,o)||L&&L(o)?(r(x,o)&&(u="newstatement"),"builtin"):r(T,o)?"atom":"variable"}function P(e,t){c.typeFirstDefinitions&&e.eol()&&a(t.context)&&(t.typeAtEndOfLine=o(e,t,e.pos))}return $=function(e){return function(t,n){for(var i,o=!1,a=!1;null!=(i=t.next());){if(i==e&&!o){a=!0;break}o=!o&&"\\"==i}return(a||!o&&!A)&&(n.tokenize=null),"string"}},{startState:function(e){return{tokenize:null,context:new t((e||0)-p,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var r=t.context;if(e.sol()&&(null==r.align&&(r.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return P(e,t),null;u=d=null;var s=(t.tokenize||U)(e,t);if("comment"==s||"meta"==s)return s;if(null==r.align&&(r.align=!0),";"==u||":"==u||","==u&&e.match(/^\s*(?:\/\/.*)?$/,!1))for(;"statement"==t.context.type;)i(t);else if("{"==u)n(t,e.column(),"}");else if("["==u)n(t,e.column(),"]");else if("("==u)n(t,e.column(),")");else if("}"==u){for(;"statement"==r.type;)r=i(t);for("}"==r.type&&(r=i(t));"statement"==r.type;)r=i(t)}else u==r.type&&i(t);if("variable"==s&&("def"==t.prevToken||c.typeFirstDefinitions&&o(e,t,e.start)&&a(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),R.token){var l=R.token(e,t,s);void 0!==l&&(s=l)}return"def"==s&&!1===c.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=d?"def":s||u,P(e,t),s},indent:function(t,n){if(t.tokenize!=U&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var i=t.context,o=n&&n.charAt(0),a=o==i.type;if("statement"==i.type&&"}"==o&&(i=i.prev),c.dontIndentStatements)for(;"statement"==i.type&&c.dontIndentStatements.test(i.info);)i=i.prev;if(R.indent){var r=R.indent(t,i,n,p);if("number"==typeof r)return r}var s=i.prev&&i.prev.info==v;if(c.allmanIndentation&&/[{(]/.test(o)){for(;"top"!=i.type&&"}"!=i.type;)i=i.prev;return i.indented}if("statement"==i.type)return i.indented+("{"==o?0:_);if(i.align&&(!f||")"!=i.type))return i.column+(a?0:1);if(")"==i.type&&!a)return i.indented+_;var l=new RegExp("^(?:".concat(h,"|").concat(y,")\b"));return i.indented+(a?0:p)+(a||!s||l.test(n)?0:p)},electricInput:g,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var c=function(){var e=[],t=[],n=[],i=[],o=[],a="";Li=[];var r=T.getCurrentLexer(),s=new r;["RK_SWITCH","RK_PROGRAM","RK_CASE","RK_DEFAULT","RK_FOR","RK_FOR_ALT","RK_FUNCTION","RK_DO","RK_WHILE","RK_WHILE_ALT","RK_IF","RK_ELSE"].forEach((function(i){var o=s.literalNames[r[i]],l=o.substring(1,o.length-1);Li.push(l),n.push(l),t.push(l),"RK_SWITCH"==i?a=l:"RK_CASE"!=i&&"RK_DEFAULT"!=i||e.push(l)})),["RK_CONST","RK_RETURN","RK_BREAK","RK_FOR_FROM","RK_FOR_TO","RK_FOR_PASS","RK_DO_UNTIL"].forEach((function(e){var t=s.literalNames[r[e]],i=t.substring(1,t.length-1);Li.push(i),n.push(i)})),["RK_REAL","RK_VOID","RK_BOOLEAN","RK_STRING","RK_INTEGER"].forEach((function(e){var t=s.literalNames[r[e]],n=t.substring(1,t.length-1);Li.push(n),i.push(n)})),["RK_FALSE","RK_TRUE"].forEach((function(e){var t=s.literalNames[r[e]],n=t.substring(1,t.length-1);Li.push(n),o.push(n)})),$i=[];for(var l=[yt.AND.value,yt.OR.value,yt.NOT.value],c=0;c2&&void 0!==arguments[2]?arguments[2]:0;eo(e.name,Ji.CHANGE_FUNCTION_RETURN,t,n),e.return_type=t,e.return_dimensions=n}function Ts(e,t){t.find(".ui.dropdown.function_return").dropdown({onChange:function(t,n,i){i.data("dimensions")?Es(e,Hi[i.data("type")],i.data("dimensions")):Es(e,Hi[i.data("type")])},selectOnKeydown:!1}),t.find(".name_function_updated").on("click",(function(n){!function(e,t){if(js)return void Ks.focus();var n;(t=$(t)).find(".span_name_function").text(""),Bs||(Bs=t.find(".span_name_function").css("padding-left"));t.find(".span_name_function").css("padding-left","0"),t.find(".span_name_function").css("padding-right","0"),(n=$("")).insertBefore(t.find(".span_name_function")),n.on("input",(function(){var e=n.textWidth()+10;Ks=n,n.focus();var t=n.val();n.val(""),n.val(t),n.css({width:e})})).trigger("input"),n.focusout((function(){n.val().trim()&&Ps(e,n.val().trim(),t),n.off(),n.remove(),t.find(".span_name_function").css("padding-left",Bs),t.find(".span_name_function").css("padding-right",Bs),t.find(".span_name_function").text(e.name),js=!1,Ks=!1})),n.on("keydown",(function(i){var o=i.keyCode||i.which;13==o&&(n.val().trim()&&Ps(e,n.val().trim(),t),n.off(),n.remove(),t.find(".span_name_function").css("padding-left",Bs),t.find(".span_name_function").css("padding-right",Bs),t.find(".span_name_function").text(e.name),js=!1,Ks=!1),27==o&&(n.off(),n.remove(),t.find(".span_name_function").css("padding-left",Bs),t.find(".span_name_function").css("padding-right",Bs),t.find(".span_name_function").text(e.name),js=!1,Ks=!1)})),n.select()}(e,t)})),t.find(".add_parameter_button").on("click",(function(n){window.insertContext=!0,function(e,t){null==e.parameters_list&&(e.parameters_list=[]);var n=new So(Hi.INTEGER,At.getUI("new_parameter")+"_"+_s);e.parameters_list.push(n),_s++,eo(e.name,Ji.INSERT_FUNCTION_PARAM,n.name,Hi.INTEGER,0),$s(e,n,t)}(e,t)})),t.find(".menu_commands").dropdown({on:"hover"}),t.find(".menu_commands a").on("click",(function(n){if(null==e.commands||0==e.commands.length){e.commands=[];var i=tr($(this).data("command"));e.commands.push(i),er(i,t.find(".commands_list_div"),3,e),eo(e.name,Ji.INSERT_COMMAND,$(this).data("command"),"/",0)}else Wa(e,t,$(this).data("command"),n)})),t.find(".add_var_button_function").on("click",(function(n){window.insertContext=!0,function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new So(Hi.INTEGER,At.getUI("new_variable")+"_"+Jo,0);null==e.variables_list&&(e.variables_list=[]),e.variables_list.push(i),Jo++,eo(e.name,Ji.INSERT_FUNCTION_VAR,i.name,Hi.INTEGER,0);var o=na(t,i,e);n&&(o.css("display","none"),o.fadeIn())}(e,t,!0)})),t.find(".remove_function_button").on("click",(function(n){!function(e){var t=ws.functions.indexOf(e);t>-1&&(eo(e.name,Ji.REMOVE_FUNCTION),ws.functions.splice(t,1))}(e),t.fadeOut()})),t.find(".minimize_function_button").on("click",(function(n){!function(e){e.is_hidden=!e.is_hidden}(e),e.is_hidden?(t.find(".add_var_button_function").toggle(),t.find(".inline_add_command").toggle(),t.find(".function_area").slideToggle()):t.find(".function_area").slideToggle((function(){t.find(".add_var_button_function").toggle(),t.find(".inline_add_command").toggle()}))}))}xs.function_comment=new $o(At.getUI("text_comment_main")),ws.addFunction(xs),window.program_obj=ws,window.generator=lr,window.runCodeAssessment=Ss,window.renderAlgorithm=wo,window.insertContext=!1,window.watchW=Xi.a,Xi.a.watch(window.program_obj.globals,(function(){window.insertContext?(setTimeout((function(){wo(),ms.forEach((function(e){return e()}))}),300),window.insertContext=!1):(wo(),ms.forEach((function(e){return e()})))}),1),Xi.a.watch(window.program_obj.functions,(function(){window.insertContext?(setTimeout((function(){wo(),vs.forEach((function(e){return e()}))}),300),window.insertContext=!1):(wo(),vs.forEach((function(e){return e()})))}),1);var Rs,As=0;function Os(e){var t='
';e.function_comment,t+='',t+=(e.is_main?'
':'')+'',t+='
'+At.getUI("function")+" ",e.is_main?t+='
      '+At.getUI("type_void")+'       '+e.name+'
(
':(t+='
',t+='
'+e.name+'
(
'),t+='
)
'+(e.is_hidden?' ",t=$(t),$(".all_functions").append(t),t.data("fun",e),t.find(".commands_list_div").data("fun",e),function(e,t){var n='",n=$(n),t.find(".function_return").append(n)}(e,t),Ts(e,t);for(var n=0;n=0;r--)if(console.log("da vez",$(i[r+1])),r==i.length-1){var s=t.find(".command_container").index(i[r]);console.log("índice na raiz: ",s)}else $(i[r+1]).hasClass("iftrue")?$(i[r]).parent().hasClass("commands_if")?(a.push("if"),o.push($(i[r]).parent().find(".command_container").index(i[r]))):(a.push("else"),o.push($(i[r]).parent().find(".command_container").index(i[r]))):$(i[r+1]).hasClass("dowhiletrue")?(a.push("dowhiletrue"),o.push($(i[r+1]).find(".command_container").index(i[r]))):$(i[r+1]).hasClass("repeatNtimes")?(a.push("repeatNtimes"),o.push($(i[r+1]).find(".command_container").index(i[r]))):$(i[r+1]).hasClass("whiletrue")?(a.push("whiletrue"),o.push($(i[r+1]).find(".command_container").index(i[r]))):$(i[r+1]).hasClass("switch")&&a.push("switch");var l=$(evento_drag.item).parent().hasClass("commands_else"),c=$(evento_drag.item).parent().hasClass("case_commands_block"),u=window.program_obj.functions[e].commands[s];for(r=0;r-1&&n.commands.splice(n.commands.indexOf(Rs),1):$(e.item).parent().hasClass("commands_else")?$(e.item).parent().data("command").commands_else.indexOf(Rs)>-1&&$(e.item).parent().data("command").commands_else.splice($(e.item).parent().data("command").commands_else.indexOf(Rs),1):$(e.item).parent().hasClass("case_commands_block")||$(e.item).parent().data("command").commands_block.indexOf(Rs)>-1&&$(e.item).parent().data("command").commands_block.splice($(e.item).parent().data("command").commands_block.indexOf(Rs),1)}(e)}catch(e){window.draging=!1}}});t=$(t);t.find(".iftrue").each((function(t){e($(this).find(".block_commands")[0],n),e($(this).find(".block_commands")[1],n)}));t.find(".repeatNtimes").each((function(t){e($(this).find(".block_commands")[0],n)}));t.find(".dowhiletrue").each((function(t){e($(this).find(".block_commands")[0],n)}));t.find(".whiletrue").each((function(t){e($(this).find(".block_commands")[0],n)}));t.find(".switch").each((function(t){$(this).find(".case_div").each((function(t){e($(this).find(".case_commands_block")[0],n)}))}))}(t.find(".commands_list_div")[0],i),e.is_main||Sortable.create(t.find(".container_parameters_list")[0],{handle:".ellipsis",animation:100,ghostClass:"ghost",group:"parameters_drag_"+ws.functions.indexOf(e),onEnd:function(t){!function(e,t,n){n.parameters_list.splice(t,0,n.parameters_list.splice(e,1)[0])}(t.oldIndex,t.newIndex,e)}}),e.commands.length>0){var o=".ui.sticky.sticky_cont_"+As;$(o).sticky({context:".ui.bottom.attached.segment.commands_list_div.commands_cont_"+As,scrollContext:".ivprog_visual_panel",observeChanges:!0,offset:40,onStick:function(e){$(o).css("top","20px","important")},onBottom:function(e){$(o).css("top","20px","important")},onUnstick:function(e){$(o).css("top","20px","important")},onReposition:function(e){$(o).css("top","20px","important")},onScroll:function(e){var t,n,i,a,r,s;$(o).css("top","20px","important"),t=$(o),n=$(o).parent(),i=$(t).offset().top,a=$(t).height(),r=$(n).offset().top,s=$(n).height()-30,i-r+a>0&&i-r1&&void 0!==arguments[1]&&arguments[1],n=new So(Hi.INTEGER,At.getUI("new_global")+"_"+ro,0);ro++,e.addGlobal(n),eo(n.name,Ji.INSERT_GLOBAL_VAR);var i=po(n);t&&(i.css("display","none"),i.fadeIn())}(ws,!0)})),$("#run_button").on("click",(function(){document.getElementById("run_button").style.display="none",document.getElementById("stop_button").style.display="inline",function(){if(bs)return;var e=null;e="textual"==settingsProgrammingTypes?ds():lr();if(null==e)return;ks(!0);try{var t=Vi.analyseFromSource(e);(hs=new ki(t)).registerInput(ys),hs.registerOutput(ys),$("#ivprog-term").addClass("ivprog-term-active"),bs=!0,hs.interpretAST().then((function(e){Hs((function(){return 0==ys.pending_writes.length&&(hs.mode===ze.Modes.ABORT?ys.info(At.getMessage("aborted_execution")):ys.info(At.getMessage("success_execution")),$("#ivprog-term").removeClass("ivprog-term-active"),bs=!1,hs=null,zs(),!0)}),100)})).catch((function(e){Hs((function(){return 0==ys.pending_writes.length&&(e instanceof Error?ys.err(e.message):ys.err(e),$("#ivprog-term").removeClass("ivprog-term-active"),bs=!1,hs=null,zs(),!0)}),100)}))}catch(e){Hs((function(){return 0==ys.pending_writes.length&&(bs=!1,hs=null,zs(),ys.err(e.message),console.log(e),!0)}),100)}}()})),$("#stop_button").on("click",(function(){zs(),function(){if(ys.clearPendingWrites(),ys.cancelPendingInputRequests(),!bs)return;hs.mode=ze.Modes.ABORT}()})),$(".visual_coding_button").on("click",(function(){$(".ivprog_textual_panel").addClass("loading"),$(".ivprog_textual_panel").css("display","none"),$(".ivprog_visual_panel").css("display","block"),$(".textual_coding_button").removeClass("active"),$(".visual_coding_button").addClass("active")})),$(".textual_coding_button").on("click",(function(){!function(){var e=null;if("textual"!=settingsProgrammingTypes&&null==(e=lr()))return;$(".ivprog_visual_panel").css("display","none"),$(".ivprog_textual_panel").css("display","block"),$(".ivprog_textual_panel").removeClass("loading"),cs(),null!=e&&us(e);$(".visual_coding_button").removeClass("active"),$(".textual_coding_button").addClass("active")}()})),$(".assessment").on("click",(function(){Ns=!0,Ss()})),$(".div_toggle_console").on("click",(function(){ks()})),$(".expand_button").on("click",(function(){full_screen()})),$(".help_button").on("click",(function(){window.open("https://www.usp.br/line/ivprog/","_blank")})),$(".main_title h2").prop("title",At.getUI("text_ivprog_description"));$(".visual_coding_button").popup({content:At.getUI("tooltip_visual"),delay:{show:750,hide:0}}),$(".textual_coding_button").popup({content:At.getUI("tooltip_textual"),delay:{show:750,hide:0}}),$(".upload_file_button").popup({content:At.getUI("tooltip_upload"),delay:{show:750,hide:0}}),$(".download_file_button").popup({content:At.getUI("tooltip_download"),delay:{show:750,hide:0}}),$(".undo_button").popup({content:At.getUI("tooltip_undo"),delay:{show:750,hide:0}}),$(".redo_button").popup({content:At.getUI("tooltip_redo"),delay:{show:750,hide:0}}),$(".run_button").popup({content:At.getUI("tooltip_run"),delay:{show:750,hide:0}}),$(".assessment_button").popup({content:At.getUI("tooltip_evaluate"),delay:{show:750,hide:0}}),$(".help_button").popup({content:At.getUI("tooltip_help")+" - "+At.getUI("text_ivprog_version")+" "+fs,delay:{show:750,hide:0}}),$(".add_global_button").popup({content:At.getUI("tooltip_add_global"),delay:{show:750,hide:0}}),$(".div_toggle_console").popup({content:At.getUI("tooltip_console"),delay:{show:750,hide:0}}),Sortable.create(listWithHandle,{handle:".glyphicon-move",animation:100,ghostClass:"ghost",group:"functions_divs_drag",onEnd:function(e){var t,n;t=e.oldIndex,n=e.newIndex,program_obj.functions.splice(n,0,program_obj.functions.splice(t,1)[0])}});var e=document.getElementById("listGlobalsHandle");Sortable.create(e,{handle:".ellipsis",animation:100,ghostClass:"ghost",group:"globals_divs_drag",onEnd:function(e){var t,n;t=e.oldIndex,n=e.newIndex,program_obj.globals.splice(n,0,program_obj.globals.splice(t,1)[0])}})}function Cs(){return JSON.parse(JSON.stringify(gs))}window.evento_drag;var Ns=!1;function Ss(){if(bs)return-1;var e=null;if(window.studentGrade=null,null==(e="textual"==settingsProgrammingTypes?ds():lr()))return-1;ks(!0);try{var t=Vi.analyseFromSource(e);bs=!0,new as(t,gs,ys).runTest().then((function(e){Ns?Ns=!1:parent.getEvaluationCallback(e),bs=!1})).catch((function(e){console.log(e),bs=!1}))}catch(e){bs=!1,ys.err(e.message),console.log(e),Ns?Ns=!1:parent.getEvaluationCallback(0)}return 0}function ks(e){return e?($(".ivprog-term-div").css("display","block"),$("#ivprog-term").css("min-height","160px"),void(null!=ys&&ys.focus())):void ys.hide()}function Ls(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;eo(e.name,Ji.CHANGE_PARAM_TYPE,n,t,i),e.type=t,e.dimensions=i,i>0&&(e.rows=i,e.columns=2)}function $s(e,t,n){var i="";for(var o in i+='
',i+='",i+='
'+t.name+"
",i+='
',i=$(i),n.find(".container_parameters_list").append(i),i.find(".remove_parameter").on("click",(function(n){!function(e,t,n){eo(t.name,Ji.REMOVE_FUNCTION_PARAM,e.name);var i=e.parameters_list.indexOf(t);i>-1&&(window.insertContext=!0,e.parameters_list.splice(i,1)),$(n).fadeOut()}(e,t,i)})),i.find(".ui.dropdown.parameter_type").dropdown({onChange:function(n,i,o){o.data("dimensions")?Ls(t,Hi[o.data("type")],e.name,o.data("dimensions")):Ls(t,Hi[o.data("type")],e.name)},selectOnKeydown:!1}),i.find(".parameter_div_edit").on("click",(function(n){eo(e.name,Ji.ENTER_CHANGE_PARAM_NAME,t.name),function(e,t,n){if(Ms)return void Fs.focus();var i;Ms=!0,(t=$(t)).find(".span_name_parameter").text(""),(i=$("")).insertBefore(t.find(".span_name_parameter")),i.on("input",(function(){var e=i.textWidth()+10;Fs=i,i.focus();var t=i.val();i.val(""),i.val(t),i.css({width:e})})).trigger("input"),i.focusout((function(){i.val().trim()&&(Us(e,i.val().trim(),t,n),t.find(".span_name_parameter").text(e.name)),i.off(),i.remove(),Ms=!1,Fs=!1})),i.on("keydown",(function(o){var a=o.keyCode||o.which;13==a&&(i.val().trim()&&(Us(e,i.val().trim(),t,n),t.find(".span_name_parameter").text(e.name)),i.off(),i.remove(),Ms=!1,Fs=!1),27==a&&(t.find(".span_name_parameter").text(e.name),i.off(),i.remove(),Ms=!1,Fs=!1)})),i.select()}(t,i,e)})),i}function Us(e,t,n,i){e.name!=t&&(Pi(t)?!function(e,t){if(t.parameters_list)for(var n=0;n "+e),At.getString(e,n))}});function Qs(e,t){for(var n=0;n