12 |
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vcat=t():e.vcat=t()}(this,(function(){return(()=>{var e={186:e=>{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:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Caso de teste $0 não executou com sucesso.</span></div>",test_case_failed_exception:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Caso de teste $0 falhou</span>: $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 <span class='ivprog-error-varname'>$3</span>.",invalid_read_type_array:"Erro na linha $0: A entrada \"$1\" não é do tipo $2, que é o tipo aceito pela variável <span class='ivprog-error-varname'>$3</span> 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 <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.",inform_valid_variable_duplicated:"Já existe uma variável com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.",inform_valid_function_duplicated:"Já existe uma função com o nome <span class='ivprog-error-varname'>$0</span>, você precisa de nomes distintos.",inform_valid_param_duplicated:"Já existe um parâmetro com o nome <span class='ivprog-error-varname'>$0</span> na função <span class='ivprog-error-varname'>$1</span>, você precisa de nomes distintos.",invalid_character:"O caractere $0 na linha $1 não pode ser utilizado neste contexto.",invalid_syntax:"O iVProg não reconhece o texto $0 na linha $1. Certifique-se que não há erro de digitação ou caractere inválido.",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:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Test case $0 did not executed successfully.</span></div>",test_case_failed_exception:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Test case $0 failed</span>: $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 <span class='ivprog-error-varname'>$3</span>.",invalid_read_type_array:"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable <span class='ivprog-error-varname'>$3</span> 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 <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.",inform_valid_variable_duplicated:"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.",inform_valid_function_duplicated:"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.",inform_valid_param_duplicated:"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.",invalid_character:"The character $0 at line $1 cannot be used in this context.",invalid_syntax:"iVProg does not recognize the text $0 at line $1. Check for typos or invalid character.",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:"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:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"> <span>Test case $0 did not executed successfully.</span></div>",test_case_failed_exception:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$2\"> <span>Test case $0 failed</span>: $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 <span class='ivprog-error-varname'>$3</span>.",invalid_read_type_array:"Error at line $0: The input \"$1\" is not of type $2 which is the type accepted by the variable <span class='ivprog-error-varname'>$3</span> 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 <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each gloval variable.",inform_valid_variable_duplicated:"A variable named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each variable.",inform_valid_function_duplicated:"A function named <span class='ivprog-error-varname'>$0</span> already exists, you need distinct names for each function.",inform_valid_param_duplicated:"A parameter named <span class='ivprog-error-varname'>$0</span> already exists in function <span class='ivprog-error-varname'>$1</span>, you need distinc names for each parameter.",invalid_character:"The character $0 at line $1 cannot be used in this context.",invalid_syntax:"iVProg does not recognize the text $0 at line $1. Check for typos or invalid character.",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."}}},597:e=>{e.exports={pt:{test_case_success:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Caso de teste $0</span>: OK</div>",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:"A solução submetida não lê todas entradas disponíveis no caso de teste 1",testcase_autogen_empty:"Sua solução não gerou qualquer saída para o caso de teste $0.",success_execution:"Execução do programa finalizada!",aborted_execution:"A execução do programa foi interrompida!",unexpected_execution_error:"Erro inesperado durante a execução do programa."},en:{test_case_success:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Test case $0</span>: OK</div>",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 submitted solution does not read all inputs available in the test case $0",testcase_autogen_empty:"Your solution did not generate any output for test case $0.",success_execution:"Program execution finished!",aborted_execution:"Program execution was aborted!",unexpected_execution_error:"Unexpected error during program execution."},es:{test_case_success:"<div class='assessment-div-detail' onClick='ivprogCore.openAssessmentDetail(event)' data-page=\"$1\"><span>Test case $0</span>: OK</div>",test_case_duration:"Tardó $0ms",test_suite_grade:"Su solución obtuvo $0% de la calificación.",awaiting_input_message:"Su programa se está ejecutando y esperando una entrada. Escriba algo y presione ENTER ...","assessment-empty-expected-tooltip":"The generated output was beyond the amount expected","assessment-empty-generated-tooltip":"El programa no generó suficientes resultados.",testcase_autogen_unused_input:"La solución presentada no lee todas las entradas disponibles en el caso de prueba 1",testcase_autogen_empty:"Su solución no generó ningún resultado para el caso de prueba de $ 0.",success_execution:"¡Ejecución del programa terminada!",aborted_execution:"¡La ejecución del programa fue abortada!",unexpected_execution_error:"Error inesperado durante la ejecución del programa."}}},548:e=>{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",btn_add_var:"Adicionar variável",btn_drag_and_drop_function:"Mover função",btn_delete_function:"Excluir função",expression_invalid:"Expressão inválida. Verifique a sintáxe antes de continuar.",expression_undelcared_variable:"Variáveis não declaradas:",expression_undeclared_function:"Funções não definidas:",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_lock_expression:"Bloquear expressão",text_unlock_expression:"Desbloquear expressão",text_edit_expression:"Editar expressão manualmente",text_edit_expression_confirm:"Confirmar edição",text_edit_expression_cancel:"Cancelar edição",text_add_function:"Adicionar uma nova função ao programa",text_move_command:"Mover comando",text_add_parameters:"Adicionar um novo parâmetro",text_parameter_reference:"Definir parâmetro como passagem por referência",text_parameter_copy:"Definir parâmetro como passagem por cópia",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 condição senão",text_message_error_activity_file:"Aconteceu um erro ao processar a atividade. <br> Recarregue a página para tentar novamente.",text_message_error_upload_file:"Não foi possível carregar o arquivo.<br>Verifique o conteúdo do arquivo e tente novamente.",text_message_error_upload_close:"Fechar",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",tooltip_menu_read:"Comando para receber dados pelo teclado",tooltip_menu_write:"Comando para apresentar conteúdo ao usuário",tooltip_menu_comments:"Bloco para comentários internos do programador",tooltip_menu_attribution:"Comando para atribuir uma expressão a uma variável",tooltip_menu_call_function:"Comando para realizar a chamada de uma função",tooltip_menu_if_else:"Estrutura para que os comandos só sejam executados de acordo com as condições estabelecidas",tooltip_menu_repeat_n_times:"Estrutura para executar um bloco de comandos repetidamente",tooltip_menu_repeat_whiletrue:"Estrutura para repetir um bloco de comandos enquanto a condição for verdadeira",tooltip_menu_repeat_dowhiletrue:"Estrutura que executa um bloco e o repete enquanto a condição for verdadeira",tooltip_menu_repeat_switch:"Estrutura de escolha do bloco a ser executado",tooltip_menu_repeat_return:"Comando para devolver o resultado e finalizar a função",tooltip_move_var:"Mover variável",tooltip_remove_var:"Excluir variável",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":"Correção","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",write_command_newline_on:"Quebra de linha ativada",write_command_newline_off:" Quebra de linha desativada",write_seprator_menu_text:"Espaço",initial_program_code:"programa {\\n\\n\\t\\tfuncao vazio inicio () {\\n\\t\\t\\t// Inicie seu codigo aqui!\\n\\t\\t}\\n}",type_char:"caractere",charvar_default_value:"A",write_seprator_menu_tooltip:"Separador para imprimir mais valores/variáveis"},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",btn_add_var:"Add a variable",btn_drag_and_drop_function:"Move function",btn_delete_function:"Delete function",expression_invalid:"Invalid expression. Check the syntax before proceeding.",expression_undelcared_variable:"Undeclared variables:",expression_undeclared_function:"Undefined functions:",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_lock_expression:"Block expression",text_unlock_expression:"Unlock expression",text_edit_expression:"Edit expression manually",text_edit_expression_confirm:"Confirm edition",text_edit_expression_cancel:"Cancel edition",text_add_function:"Add a new function to the program",text_move_command:"Move command",text_add_parameters:"Add a new parameter",text_parameter_reference:"Define parameter passed by reference",text_parameter_copy:"Define parameter passed by copy",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 condition else",text_message_error_activity_file:"There was an error processing the activity.<br> Reload the page to try again.",text_message_error_upload_file:"It was not possible upload the file.<br>Verify the file's content and try again.",text_message_error_upload_close:"Close",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",tooltip_menu_read:"Command to input data from keyboard",tooltip_menu_write:"Command to present content to user",tooltip_menu_comments:"Block to comments from developer",tooltip_menu_attribution:"Command to assign an expression to a variable",tooltip_menu_call_function:"Command to execute a function call",tooltip_menu_if_else:"Structure in which command only run when the conditions are satisfied",tooltip_menu_repeat_n_times:"Structure to execute a block of commands repeatedly",tooltip_menu_repeat_whiletrue:"Structure to execute a block repeatdly while condition is true",tooltip_menu_repeat_dowhiletrue:"Structure that executes a block and repeat while the condition is true",tooltip_menu_repeat_switch:"Structure that choices the block to be executed",tooltip_menu_repeat_return:"Command to return the result and finish the function",tooltip_move_var:"Move variable",tooltip_remove_var:"Delete variable",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":"Correction","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",write_command_newline_on:" Line break is on",write_command_newline_off:" Line break is off",write_seprator_menu_text:"Spacer",initial_program_code:"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}",type_char:"char",charvar_default_value:"A",write_seprator_menu_tooltip:"Separator used to print more values/variables"},es:{function:"function",btn_clear:"Limpiar",btn_function:"Funcíon",btn_arithmetic_plus:"Adición",btn_arithmetic_minus:"Sustracción",btn_arithmetic_multiplication:"Multiplicación",btn_arithmetic_division:"División",btn_arithmetic_module:"Resto",btn_break:"break",btn_case:"Caso",btn_add_var:"Add a variable",btn_drag_and_drop_function:"Mover función",btn_delete_function:"Borrar función",expression_invalid:"Expresión no válida. Verifique la sintaxis antes de continuar.",expression_undelcared_variable:"Variables no declaradas:",expression_undeclared_function:"Funcíon no declaradas:",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:"texto",type_boolean:"bool",logic_value_true:"true",logic_value_false:"false",variable:"Variable",command:"Comando",new_parameter:"parametro",new_variable:"variable",new_global:"global",new_function:"nueva_función",matrix:"matriz",vector:"vector",text_lock_expression:"Expresión de bloque",text_unlock_expression:"Desbloquear expresión",text_edit_expression:"Editar expresión manualmente",text_edit_expression_confirm:"Confirmar edición",text_edit_expression_cancel:"Cancelar edición",text_add_function:"Agregar una nueva función al programa",text_move_command:"Mover comando",text_add_parameters:"Agregar un nuevo parámetro",text_parameter_reference:"Define parameter passed by reference",text_parameter_copy:"Define parameter passed by copy",text_comment_start:"Comentario inicial de la función",text_comment_main:"Esta es la función principal",text_read_var:"Entrada/Lectura de dados",text_write_var:"Salida/Escribir datos",text_command_read:"read",text_command_write:"write",text_return:"return",text_btn_return:"Devolución",text_comment:"Comentario",string_join_or:"or",matrix_info_string:"matriz de $0",vector_info_string:"vector de $0",text_attribution:"Asignación",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:"Programación",text_config_programming_both:"Visual & Textual",text_config_programming_textual:"Textual",text_config_programming_visual:"Visual",text_logic_expression:"Lógicos",text_arithmetic_expression:"Aritmética",text_iftrue:"Si condicion sino",text_message_error_activity_file:"Se produjo un error al procesar la actividad.<br> Recargar la página para volver a intentarlo.",text_message_error_upload_file:"text_message_error_upload_file",text_message_error_upload_close:"Close",text_message_error_activity_reload:"Recargar",text_repeatNtimes:"Repetir N veces",text_receives:"receives",text_whiletrue:"Mientras verdad",text_dowhiletrue:"Repita hasta verdad",text_switch:"Switch",text_functioncall:"Llamada de función",text_value:"Valor",text_operator:"Operador",text_parentheses:"Paréntesis",text_change:"Modify",text_teacher_algorithm:"Algorithm",text_teacher_algorithm_include:"Incluir el algoritmo en la actividad.",text_teacher_test_case:"Test cases",text_teacher_config:"Configuraciones",text_teacher_data_types:"Data types",text_teacher_commands:"Commands",text_teacher_functions:"Funciones",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:"Antes de usar una variable, debe crearla",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:"Proporcionar algunos datos",inform_valid_expression:"Construct a logic expression",tooltip_terminal_clear:"Borra el terminal eliminando todo el texto escrito y pendiente.",tooltip_terminal_show:"Muestra el terminal si está oculto.",tooltip_terminal_hide:"Oculta el terminal si no está en exhibición",tooltip_menu_read:"Command to input data from keyboard",tooltip_menu_write:"Command to present content to user",tooltip_menu_comments:"Block to comments from developer",tooltip_menu_attribution:"Command to assign an expression to a variable",tooltip_menu_call_function:"Command to execute a function call",tooltip_menu_if_else:"Structure in which command only run when the conditions are satisfied",tooltip_menu_repeat_n_times:"Structure to execute a block of commands repeatedly",tooltip_menu_repeat_whiletrue:"Structure to execute a block repeatdly while condition is true",tooltip_menu_repeat_dowhiletrue:"Structure that executes a block and repeat while the condition is true",tooltip_menu_repeat_switch:"Structure that choices the block to be executed",tooltip_menu_repeat_return:"Command to return the result and finish the function",tooltip_move_var:"Move variable",tooltip_remove_var:"Delete variable",text_ivprog_version:"Version",text_teacher_filter:"Filter",text_teacher_filter_active:"Activated",text_teacher_filter_help:"Al activar el filtro, las modificaciones en iVProg serán bloqueadas",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":"Correction","assessment-detail-title":"Test Case $0",text_teacher_generate_outputs:"Generate outputs",text_teacher_generate_outputs_algorithm:"Antes de generar las salidas necesita crear un algoritmo",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",write_command_newline_on:"El salto de línea está activado",write_command_newline_off:"El salto de línea está desactivado",write_seprator_menu_text:"Spacer",initial_program_code:"program {\\n\\n\\t\\tfunction void main () {\\n\\t\\t\\t// Start your code here!\\n\\t\\t}\\n}",type_char:"char",charvar_default_value:"A",write_seprator_menu_tooltip:"Separator used to print more values/variables"}}},228:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}},858:e=>{e.exports=function(e){if(Array.isArray(e))return e}},646:(e,t,n)=>{var r=n(228);e.exports=function(e){if(Array.isArray(e))return r(e)}},506:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},926:e=>{function t(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}}},575:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},100:(e,t,n)=>{var r=n(489),i=n(67);function o(t,n,a){return i()?e.exports=o=Reflect.construct:e.exports=o=function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&r(o,n.prototype),o},o.apply(null,arguments)}e.exports=o},913:e=>{function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}},713:e=>{e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},525:(e,t,n)=>{var r=n(331);function i(t,n,o){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=i=Reflect.get:e.exports=i=function(e,t,n){var i=r(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(n):o.value}},i(t,n,o||t)}e.exports=i},754:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(n)}e.exports=t},205:(e,t,n)=>{var r=n(489);e.exports=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&&r(e,t)}},430:e=>{e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},67:e=>{e.exports=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}}},860:e=>{e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},884:e=>{e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},521:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},206:e=>{e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},585:(e,t,n)=>{var r=n(8),i=n(506);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?i(e):t}},489:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(n,r)}e.exports=t},38:(e,t,n)=>{var r=n(858),i=n(884),o=n(379),a=n(521);e.exports=function(e,t){return r(e)||i(e,t)||o(e,t)||a()}},331:(e,t,n)=>{var r=n(754);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},655:e=>{e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},319:(e,t,n)=>{var r=n(646),i=n(860),o=n(379),a=n(206);e.exports=function(e){return r(e)||i(e)||o(e)||a()}},8:e=>{function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=t=function(e){return typeof e}:e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(n)}e.exports=t},379:(e,t,n)=>{var r=n(228);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}},957:(e,t,n)=>{var r=n(754),i=n(489),o=n(430),a=n(100);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},s(t)}e.exports=s},757:(e,t,n)=>{e.exports=n(666)},776:function(e,t,n){var r;!function(i){"use strict";var o,a,s,u=9e15,c=1e9,l="0123456789abcdef",f="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",p="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",d={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-u,maxE:u,crypto:!1},h=!0,m="[DecimalError] ",_=m+"Invalid argument: ",v=m+"Precision limit exceeded",y=m+"crypto unavailable",g=Math.floor,x=Math.pow,b=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,E=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,$=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,R=1e7,k=f.length-1,T=p.length-1,N={name:"[object Decimal]"};function I(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(o+=B(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=B(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function S(e,t,n){if(e!==~~e||e<t||e>n)throw Error(_+e)}function A(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=x(10,7-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[i+1]/o/100|0)==x(10,t-2)-1||(s==o/2||0==s)&&0==(e[i+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==x(10,t-3)-1,a}function C(e,t,n){for(var r,i,o=[0],a=0,s=e.length;a<s;){for(i=o.length;i--;)o[i]*=t;for(o[0]+=l.indexOf(e.charAt(a++)),r=0;r<o.length;r++)o[r]>n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}N.absoluteValue=N.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)},N.ceil=function(){return O(new this.constructor(this),this.e+1,2)},N.comparedTo=N.cmp=function(e){var t,n,r,i,o=this,a=o.d,s=(e=new o.constructor(e)).d,u=o.s,c=e.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(t=0,n=(r=a.length)<(i=s.length)?r:i;t<n;++t)if(a[t]!==s[t])return a[t]>s[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},N.cosine=N.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i=t.d.length;i<32?r=(1/Z(4,n=Math.ceil(i/3))).toString():(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=W(e,1,t.times(r),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,Q(r,n)),r.precision=e,r.rounding=t,O(2==s||3==s?n.neg():n,e,t,!0)):new r(1):new r(NaN)},N.cubeRoot=N.cbrt=function(){var e,t,n,r,i,o,a,s,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(h=!1,(o=l.s*x(l.s*l,1/3))&&Math.abs(o)!=1/0?r=new f(o.toString()):(n=I(l.d),(o=((e=l.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=x(n,1/3),e=g((e+1)/3)-(e%3==(e<0?-1:2)),(r=new f(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=l.s),a=(e=f.precision)+3;;)if(c=(u=(s=r).times(s).times(s)).plus(l),r=L(c.plus(l).times(s),c.plus(u),a+2,1),I(s.d).slice(0,a)===(n=I(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(O(r,e+1,1),t=!r.times(r).times(r).eq(l));break}if(!i&&(O(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}a+=4,i=1}return h=!0,O(r,e,f.rounding,t)},N.decimalPlaces=N.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-g(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},N.dividedBy=N.div=function(e){return L(this,new this.constructor(e))},N.dividedToIntegerBy=N.divToInt=function(e){var t=this.constructor;return O(L(this,new t(e),0,1,1),t.precision,t.rounding)},N.equals=N.eq=function(e){return 0===this.cmp(e)},N.floor=function(){return O(new this.constructor(this),this.e+1,3)},N.greaterThan=N.gt=function(e){return this.cmp(e)>0},N.greaterThanOrEqualTo=N.gte=function(e){var t=this.cmp(e);return 1==t||0===t},N.hyperbolicCosine=N.cosh=function(){var e,t,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/Z(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=W(a,1,o.times(t),new a(1),!0);for(var u,c=e,l=new a(8);c--;)u=o.times(o),o=s.minus(u.times(l.minus(u.times(l))));return O(o,a.precision=n,a.rounding=r,!0)},N.hyperbolicSine=N.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=W(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=W(o,2,i=i.times(1/Z(5,e)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=t,o.rounding=n,O(i,t,n,!0)},N.hyperbolicTangent=N.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,L(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},N.inverseCosine=N.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,o=n.rounding;return-1!==r?0===r?t.isNeg()?P(n,i,o):new n(0):new n(NaN):t.isZero()?P(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=P(n,i+4,o).times(.5),n.precision=i,n.rounding=o,e.minus(t))},N.inverseHyperbolicCosine=N.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,h=!1,n=n.times(n).minus(1).sqrt().plus(n),h=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},N.inverseHyperbolicSine=N.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,h=!1,n=n.times(n).plus(1).sqrt().plus(n),h=!0,r.precision=e,r.rounding=t,n.ln())},N.inverseHyperbolicTangent=N.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?O(new o(i),e,t,!0):(o.precision=n=r-i.e,i=L(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},N.inverseSine=N.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=P(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},N.inverseTangent=N.atan=function(){var e,t,n,r,i,o,a,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=T)return(a=P(l,f+4,p).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=T)return(a=P(l,f+4,p).times(.5)).s=c.s,a}for(l.precision=s=f+10,l.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(h=!1,t=Math.ceil(s/7),r=1,u=c.times(c),a=new l(c),i=c;-1!==e;)if(i=i.times(u),o=a.minus(i.div(r+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<<n-1)),h=!0,O(a,l.precision=f,l.rounding=p,!0)},N.isFinite=function(){return!!this.d},N.isInteger=N.isInt=function(){return!!this.d&&g(this.e/7)>this.d.length-2},N.isNaN=function(){return!this.s},N.isNegative=N.isNeg=function(){return this.s<0},N.isPositive=N.isPos=function(){return this.s>0},N.isZero=function(){return!!this.d&&0===this.d[0]},N.lessThan=N.lt=function(e){return this.cmp(e)<0},N.lessThanOrEqualTo=N.lte=function(e){return this.cmp(e)<1},N.logarithm=N.log=function(e){var t,n,r,i,o,a,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(h=!1,a=q(c,s=f+5),r=t?F(l,s+10):q(e,s),A((u=L(a,r,s,1)).d,i=f,p))do{if(a=q(c,s+=10),r=t?F(l,s+10):q(e,s),u=L(a,r,s,1),!o){+I(u.d).slice(i+1,i+15)+1==1e14&&(u=O(u,f+1,0));break}}while(A(u.d,i+=10,p));return h=!0,O(u,f,p)},N.minus=N.sub=function(e){var t,n,r,i,o,a,s,u,c,l,f,p,d=this,m=d.constructor;if(e=new m(e),!d.d||!e.d)return d.s&&e.s?d.d?e.s=-e.s:e=new m(e.d||d.s!==e.s?d:NaN):e=new m(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(c=d.d,p=e.d,s=m.precision,u=m.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new m(3===u?-0:0);e=new m(d)}return h?O(e,s,u):e}if(n=g(e.e/7),l=g(d.e/7),c=c.slice(),o=l-n){for((f=o<0)?(t=c,o=-o,a=p.length):(t=p,n=l,a=c.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((f=(r=c.length)<(a=p.length))&&(a=r),r=0;r<a;r++)if(c[r]!=p[r]){f=c[r]<p[r];break}o=0}for(f&&(t=c,c=p,p=t,e.s=-e.s),a=c.length,r=p.length-a;r>0;--r)c[a++]=0;for(r=p.length;r>o;){if(c[--r]<p[r]){for(i=r;i&&0===c[--i];)c[i]=R-1;--c[i],c[r]+=R}c[r]-=p[r]}for(;0===c[--a];)c.pop();for(;0===c[0];c.shift())--n;return c[0]?(e.d=c,e.e=G(c,n),h?O(e,s,u):e):new m(3===u?-0:0)},N.modulo=N.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?O(new r(n),r.precision,r.rounding):(h=!1,9==r.modulo?(t=L(n,e.abs(),0,3,1)).s*=e.s:t=L(n,e,0,r.modulo,1),t=t.times(e),h=!0,n.minus(t))},N.naturalExponential=N.exp=function(){return V(this)},N.naturalLogarithm=N.ln=function(){return q(this)},N.negated=N.neg=function(){var e=new this.constructor(this);return e.s=-e.s,O(e)},N.plus=N.add=function(e){var t,n,r,i,o,a,s,u,c,l,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return f.s&&e.s?f.d||(e=new p(e.d||f.s===e.s?f:NaN)):e=new p(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,l=e.d,s=p.precision,u=p.rounding,!c[0]||!l[0])return l[0]||(e=new p(f)),h?O(e,s,u):e;if(o=g(f.e/7),r=g(e.e/7),c=c.slice(),i=o-r){for(i<0?(n=c,i=-i,a=l.length):(n=l,r=o,a=c.length),i>(a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,n=l,l=c,c=n),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/R|0,c[i]%=R;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=G(c,r),h?O(e,s,u):e},N.precision=N.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(_+e);return n.d?(t=M(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},N.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)},N.sine=N.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return W(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=W(e,2,t=t.times(1/Z(5,n)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,Q(r,n)),r.precision=e,r.rounding=t,O(s>2?n.neg():n,e,t,!0)):new r(NaN)},N.squareRoot=N.sqrt=function(){var e,t,n,r,i,o,a=this,s=a.d,u=a.e,c=a.s,l=a.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(h=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=I(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=g((u+1)/2)-(u<0||u%2),r=new l(t=c==1/0?"1e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new l(c.toString()),n=(u=l.precision)+3;;)if(r=(o=r).plus(L(a,o,n+2,1)).times(.5),I(o.d).slice(0,n)===(t=I(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(O(r,u+1,1),e=!r.times(r).eq(a));break}if(!i&&(O(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return h=!0,O(r,u,l.rounding,e)},N.tangent=N.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=L(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,O(2==s||4==s?n.neg():n,e,t,!0)):new r(NaN)},N.times=N.mul=function(e){var t,n,r,i,o,a,s,u,c,l=this,f=l.constructor,p=l.d,d=(e=new f(e)).d;if(e.s*=l.s,!(p&&p[0]&&d&&d[0]))return new f(!e.s||p&&!p[0]&&!d||d&&!d[0]&&!p?NaN:p&&d?0*e.s:e.s/0);for(n=g(l.e/7)+g(e.e/7),(u=p.length)<(c=d.length)&&(o=p,p=d,d=o,a=u,u=c,c=a),o=[],r=a=u+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=u+r;i>r;)s=o[i]+d[r]*p[i-r-1]+t,o[i--]=s%R|0,t=s/R|0;o[i]=(o[i]+t)%R|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=G(o,n),h?O(e,f.precision,f.rounding):e},N.toBinary=function(e,t){return J(this,2,e,t)},N.toDecimalPlaces=N.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(S(e,0,c),void 0===t?t=r.rounding:S(t,0,8),O(n,e+n.e+1,t))},N.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=D(r,!0):(S(e,0,c),void 0===t?t=i.rounding:S(t,0,8),n=D(r=O(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},N.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=D(i):(S(e,0,c),void 0===t?t=o.rounding:S(t,0,8),n=D(r=O(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},N.toFraction=function(e){var t,n,r,i,o,a,s,u,c,l,f,p,d=this,m=d.d,v=d.constructor;if(!m)return new v(d);if(c=n=new v(1),r=u=new v(0),a=(o=(t=new v(r)).e=M(m)-d.e-1)%7,t.d[0]=x(10,a<0?7+a:a),null==e)e=o>0?t:c;else{if(!(s=new v(e)).isInt()||s.lt(c))throw Error(_+s);e=s.gt(t)?o>0?t:c:s}for(h=!1,s=new v(I(m)),l=v.precision,v.precision=o=7*m.length*2;f=L(s,t,0,1,1),1!=(i=n.plus(f.times(r))).cmp(e);)n=r,r=i,i=c,c=u.plus(f.times(i)),u=i,i=t,t=s.minus(f.times(i)),s=i;return i=L(e.minus(n),r,0,1,1),u=u.plus(i.times(c)),n=n.plus(i.times(r)),u.s=c.s=d.s,p=L(c,r,o,1).minus(d).abs().cmp(L(u,n,o,1).minus(d).abs())<1?[c,r]:[u,n],v.precision=l,h=!0,p},N.toHexadecimal=N.toHex=function(e,t){return J(this,16,e,t)},N.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:S(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(h=!1,n=L(n,e,0,t,1).times(e),h=!0,O(n)):(e.s=n.s,n=e),n},N.toNumber=function(){return+this},N.toOctal=function(e,t){return J(this,8,e,t)},N.toPower=N.pow=function(e){var t,n,r,i,o,a,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(x(+s,c));if((s=new u(s)).eq(1))return s;if(r=u.precision,o=u.rounding,e.eq(1))return O(s,r,o);if((t=g(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=U(u,s,n,r),e.s<0?new u(1).div(i):O(i,r,o);if((a=s.s)<0){if(t<e.d.length-1)return new u(NaN);if(0==(1&e.d[t])&&(a=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=a,s}return(t=0!=(n=x(+s,c))&&isFinite(n)?new u(n+"").e:g(c*(Math.log("0."+I(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(t>0?a/0:0):(h=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=V(e.times(q(s,r+n)),r)).d&&A((i=O(i,r+5,1)).d,r,o)&&(t=r+10,+I((i=O(V(e.times(q(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=O(i,r+1,0))),i.s=a,h=!0,u.rounding=o,O(i,r,o))},N.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=D(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(S(e,1,c),void 0===t?t=i.rounding:S(t,0,8),n=D(r=O(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},N.toSignificantDigits=N.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(S(e,1,c),void 0===t?t=n.rounding:S(t,0,8)),O(new n(this),e,t)},N.toString=function(){var e=this,t=e.constructor,n=D(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},N.truncated=N.trunc=function(){return O(new this.constructor(this),this.e+1,1)},N.valueOf=N.toJSON=function(){var e=this,t=e.constructor,n=D(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var L=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;i<n;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s,u,c){var l,f,p,d,h,m,_,v,y,x,b,w,E,$,k,T,N,I,S,A,C=r.constructor,L=r.s==i.s?1:-1,D=r.d,G=i.d;if(!(D&&D[0]&&G&&G[0]))return new C(r.s&&i.s&&(D?!G||D[0]!=G[0]:G)?D&&0==D[0]||!G?0*L:L/0:NaN);for(c?(h=1,f=r.e-i.e):(c=R,h=7,f=g(r.e/h)-g(i.e/h)),S=G.length,N=D.length,x=(y=new C(L)).d=[],p=0;G[p]==(D[p]||0);p++);if(G[p]>(D[p]||0)&&f--,null==o?($=o=C.precision,s=C.rounding):$=u?o+(r.e-i.e)+1:o,$<0)x.push(1),m=!0;else{if($=$/h+2|0,p=0,1==S){for(d=0,G=G[0],$++;(p<N||d)&&$--;p++)k=d*c+(D[p]||0),x[p]=k/G|0,d=k%G|0;m=d||p<N}else{for((d=c/(G[0]+1)|0)>1&&(G=e(G,d,c),D=e(D,d,c),S=G.length,N=D.length),T=S,w=(b=D.slice(0,S)).length;w<S;)b[w++]=0;(A=G.slice()).unshift(0),I=G[0],G[1]>=c/2&&++I;do{d=0,(l=t(G,b,S,w))<0?(E=b[0],S!=w&&(E=E*c+(b[1]||0)),(d=E/I|0)>1?(d>=c&&(d=c-1),1==(l=t(_=e(G,d,c),b,v=_.length,w=b.length))&&(d--,n(_,S<v?A:G,v,c))):(0==d&&(l=d=1),_=G.slice()),(v=_.length)<w&&_.unshift(0),n(b,_,w,c),-1==l&&(l=t(G,b,S,w=b.length))<1&&(d++,n(b,S<w?A:G,w,c)),w=b.length):0===l&&(d++,b=[0]),x[p++]=d,l&&b[0]?b[w++]=D[T]||0:(b=[D[T]],w=1)}while((T++<N||void 0!==b[0])&&$--);m=void 0!==b[0]}x[0]||x.shift()}if(1==h)y.e=f,a=m;else{for(p=1,d=x[0];d>=10;d/=10)p++;y.e=p+f*h-1,O(y,u?o+y.e+1:o,s,m)}return y}}();function O(e,t,n,r){var i,o,a,s,u,c,l,f,p,d=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,u=(l=f[p=0])/x(10,i-a-1)%10|0;else if((p=Math.ceil((o+1)/7))>=(s=f.length)){if(!r)break e;for(;s++<=p;)f.push(0);l=u=0,i=1,a=(o%=7)-7+1}else{for(l=s=f[p],i=1;s>=10;s/=10)i++;u=(a=(o%=7)-7+i)<0?0:l/x(10,i-a-1)%10|0}if(r=r||t<0||void 0!==f[p+1]||(a<0?l:l%x(10,i-a-1)),c=n<4?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?a>0?l/x(10,i-a):0:f[p-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=x(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=p,s=1,p--):(f.length=p+1,s=x(10,7-o),f[p]=a>0?(l/x(10,i-a)%x(10,a)|0)*s:0),c)for(;;){if(0==p){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,f[0]==R&&(f[0]=1));break}if(f[p]+=s,f[p]!=R)break;f[p--]=0,s=1}for(o=f.length;0===f[--o];)f.pop()}return h&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e<d.minE&&(e.e=0,e.d=[0])),e}function D(e,t,n){if(!e.isFinite())return j(e);var r,i=e.e,o=I(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+B(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+B(-i-1)+o,n&&(r=n-a)>0&&(o+=B(r))):i>=a?(o+=B(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+B(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=B(r))),o}function G(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function F(e,t,n){if(t>k)throw h=!0,n&&(e.precision=n),Error(v);return O(new e(f),t,1,!0)}function P(e,t,n){if(t>T)throw Error(v);return O(new e(p),t,n,!0)}function M(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function B(e){for(var t="";e--;)t+="0";return t}function U(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(h=!1;;){if(n%2&&X((o=o.times(t)).d,a)&&(i=!0),0===(n=g(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}X((t=t.times(t)).d,a)}return h=!0,o}function K(e){return 1&e.d[e.d.length-1]}function z(e,t,n){for(var r,i=new e(t[0]),o=0;++o<t.length;){if(!(r=new e(t[o])).s){i=r;break}i[n](r)&&(i=r)}return i}function V(e,t){var n,r,i,o,a,s,u,c=0,l=0,f=0,p=e.constructor,d=p.rounding,m=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(h=!1,u=m):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=r=Math.log(x(2,f))/Math.LN10*2+5|0,n=o=a=new p(1),p.precision=u;;){if(o=O(o.times(e),u,1),n=n.times(++l),I((s=a.plus(L(o,n,u,1))).d).slice(0,u)===I(a.d).slice(0,u)){for(i=f;i--;)a=O(a.times(a),u,1);if(null!=t)return p.precision=m,a;if(!(c<3&&A(a.d,u-r,d,c)))return O(a,p.precision=m,d,h=!0);p.precision=u+=10,n=o=s=new p(1),l=0,c++}a=s}}function q(e,t){var n,r,i,o,a,s,u,c,l,f,p,d=1,m=e,_=m.d,v=m.constructor,y=v.rounding,g=v.precision;if(m.s<0||!_||!_[0]||!m.e&&1==_[0]&&1==_.length)return new v(_&&!_[0]?-1/0:1!=m.s?NaN:_?0:m);if(null==t?(h=!1,l=g):l=t,v.precision=l+=10,r=(n=I(_)).charAt(0),!(Math.abs(o=m.e)<15e14))return c=F(v,l+2,g).times(o+""),m=q(new v(r+"."+n.slice(1)),l-10).plus(c),v.precision=g,null==t?O(m,g,y,h=!0):m;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=I((m=m.times(e)).d)).charAt(0),d++;for(o=m.e,r>1?(m=new v("0."+n),o++):m=new v(r+"."+n.slice(1)),f=m,u=a=m=L(m.minus(1),m.plus(1),l,1),p=O(m.times(m),l,1),i=3;;){if(a=O(a.times(p),l,1),I((c=u.plus(L(a,new v(i),l,1))).d).slice(0,l)===I(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(F(v,l+2,g).times(o+""))),u=L(u,new v(d),l,1),null!=t)return v.precision=g,u;if(!A(u.d,l-10,y,s))return O(u,v.precision=g,y,h=!0);v.precision=l+=10,c=a=m=L(f.minus(1),f.plus(1),l,1),p=O(m.times(m),l,1),i=s=1}u=c,i+=2}}function j(e){return String(e.s*e.s/0)}function H(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),h&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Y(e,t){var n,r,i,a,s,u,c,l,f;if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(w.test(t))n=16,t=t.toLowerCase();else if(b.test(t))n=2;else{if(!E.test(t))throw Error(_+t);n=8}for((a=t.search(/p/i))>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),s=(a=t.indexOf("."))>=0,r=e.constructor,s&&(a=(u=(t=t.replace(".","")).length)-a,i=U(r,new r(n),a,2*a)),a=f=(l=C(t,n,R)).length-1;0===l[a];--a)l.pop();return a<0?new r(0*e.s):(e.e=G(l,f),e.d=l,h=!1,s&&(e=L(e,i,4*u)),c&&(e=e.times(Math.abs(c)<54?x(2,c):o.pow(2,c))),h=!0,e)}function W(e,t,n,r,i){var o,a,s,u,c=e.precision,l=Math.ceil(c/7);for(h=!1,u=n.times(n),s=new e(r);;){if(a=L(s.times(u),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=L(a.times(u),new e(t++*t++),c,1),void 0!==(a=s.plus(r)).d[l]){for(o=l;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return h=!0,a.d.length=l+1,a}function Z(e,t){for(var n=e;--t;)n*=e;return n}function Q(e,t){var n,r=t.s<0,i=P(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return s=r?4:1,t;if((n=t.divToInt(i)).isZero())s=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return s=K(n)?r?2:3:r?4:1,t;s=K(n)?r?1:4:r?3:2}return t.minus(i).abs()}function J(e,t,n,r){var i,o,s,u,f,p,d,h,m,_=e.constructor,v=void 0!==n;if(v?(S(n,1,c),void 0===r?r=_.rounding:S(r,0,8)):(n=_.precision,r=_.rounding),e.isFinite()){for(v?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(s=(d=D(e)).indexOf("."))>=0&&(d=d.replace(".",""),(m=new _(1)).e=d.length-s,m.d=C(D(m),10,i),m.e=m.d.length),o=f=(h=C(d,10,i)).length;0==h[--f];)h.pop();if(h[0]){if(s<0?o--:((e=new _(e)).d=h,e.e=o,h=(e=L(e,m,n,r,0,i)).d,o=e.e,p=a),s=h[n],u=i/2,p=p||void 0!==h[n+1],p=r<4?(void 0!==s||p)&&(0===r||r===(e.s<0?3:2)):s>u||s===u&&(4===r||p||6===r&&1&h[n-1]||r===(e.s<0?8:7)),h.length=n,p)for(;++h[--n]>i-1;)h[n]=0,n||(++o,h.unshift(1));for(f=h.length;!h[f-1];--f);for(s=0,d="";s<f;s++)d+=l.charAt(h[s]);if(v){if(f>1)if(16==t||8==t){for(s=16==t?4:3,--f;f%s;f++)d+="0";for(f=(h=C(d,i,t)).length;!h[f-1];--f);for(s=1,d="1.";s<f;s++)d+=l.charAt(h[s])}else d=d.charAt(0)+"."+d.slice(1);d=d+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)d="0"+d;d="0."+d}else if(++o>f)for(o-=f;o--;)d+="0";else o<f&&(d=d.slice(0,o)+"."+d.slice(o))}else d=v?"0p+0":"0";d=(16==t?"0x":2==t?"0b":8==t?"0o":"")+d}else d=j(e);return e.s<0?"-"+d:d}function X(e,t){if(e.length>t)return e.length=t,!0}function ee(e){return new this(e).abs()}function te(e){return new this(e).acos()}function ne(e){return new this(e).acosh()}function re(e,t){return new this(e).plus(t)}function ie(e){return new this(e).asin()}function oe(e){return new this(e).asinh()}function ae(e){return new this(e).atan()}function se(e){return new this(e).atanh()}function ue(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?P(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=P(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(L(e,t,o,1)),t=P(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(L(e,t,o,1)):(n=P(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function ce(e){return new this(e).cbrt()}function le(e){return O(e=new this(e),e.e+1,2)}function fe(e){if(!e||"object"!=typeof e)throw Error(m+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,c,"rounding",0,8,"toExpNeg",-u,0,"toExpPos",0,u,"maxE",0,u,"minE",-u,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=d[n]),void 0!==(r=e[n])){if(!(g(r)===r&&r>=o[t+1]&&r<=o[t+2]))throw Error(_+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=d[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(_+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(y);this[n]=!0}else this[n]=!1}return this}function pe(e){return new this(e).cos()}function de(e){return new this(e).cosh()}function he(e,t){return new this(e).div(t)}function me(e){return new this(e).exp()}function _e(e){return O(e=new this(e),e.e+1,3)}function ve(){var e,t,n=new this(0);for(h=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return h=!0,new this(1/0);n=t}return h=!0,n.sqrt()}function ye(e){return e instanceof o||e&&"[object Decimal]"===e.name||!1}function ge(e){return new this(e).ln()}function xe(e,t){return new this(e).log(t)}function be(e){return new this(e).log(2)}function we(e){return new this(e).log(10)}function Ee(){return z(this,arguments,"lt")}function $e(){return z(this,arguments,"gt")}function Re(e,t){return new this(e).mod(t)}function ke(e,t){return new this(e).mul(t)}function Te(e,t){return new this(e).pow(t)}function Ne(e){var t,n,r,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:S(e,1,c),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));o<r;)(i=t[o])>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(y);for(t=crypto.randomBytes(r*=4);o<r;)(i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((127&t[o+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o<r;)s[o++]=1e7*Math.random()|0;for(e%=7,(r=s[--o])&&e&&(i=x(10,7-e),s[o]=(r/i|0)*i);0===s[o];o--)s.pop();if(o<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function Ie(e){return O(e=new this(e),e.e+1,this.rounding)}function Se(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ae(e){return new this(e).sin()}function Ce(e){return new this(e).sinh()}function Le(e){return new this(e).sqrt()}function Oe(e,t){return new this(e).sub(t)}function De(e){return new this(e).tan()}function Ge(e){return new this(e).tanh()}function Fe(e){return O(e=new this(e),e.e+1,1)}(o=function e(t){var n,r,i;function o(e){var t,n,r,i=this;if(!(i instanceof o))return new o(e);if(i.constructor=o,e instanceof o)return i.s=e.s,void(h?!e.d||e.e>o.maxE?(i.e=NaN,i.d=null):e.e<o.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"==(r=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;return void(h?t>o.maxE?(i.e=NaN,i.d=null):t<o.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):H(i,e.toString())}if("string"!==r)throw Error(_+e);return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),$.test(e)?H(i,e):Y(i,e)}if(o.prototype=N,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.EUCLID=9,o.config=o.set=fe,o.clone=e,o.isDecimal=ye,o.abs=ee,o.acos=te,o.acosh=ne,o.add=re,o.asin=ie,o.asinh=oe,o.atan=ae,o.atanh=se,o.atan2=ue,o.cbrt=ce,o.ceil=le,o.cos=pe,o.cosh=de,o.div=he,o.exp=me,o.floor=_e,o.hypot=ve,o.ln=ge,o.log=xe,o.log10=we,o.log2=be,o.max=Ee,o.min=$e,o.mod=Re,o.mul=ke,o.pow=Te,o.random=Ne,o.round=Ie,o.sign=Se,o.sin=Ae,o.sinh=Ce,o.sqrt=Le,o.sub=Oe,o.tan=De,o.tanh=Ge,o.trunc=Fe,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return o.config(t),o}(d)).default=o.Decimal=o,f=new o(f),p=new o(p),void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},271:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n="boolean"==typeof(new RegExp).sticky;function r(e){return e&&"[object RegExp]"===t.call(e)}function i(e){return e&&"object"==typeof e&&!r(e)&&!Array.isArray(e)}function o(e){return"("+e+")"}function a(e){return e.length?"(?:"+e.map((function(e){return"(?:"+e+")"})).join("|")+")":"(?!)"}function s(e){if("string"==typeof e)return"(?:"+(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")");if(r(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function u(t,n){if(i(n)||(n={match:n}),n.include)throw new Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!n.error||!!n.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var a in n)e.call(n,a)&&(o[a]=n[a]);if("string"==typeof o.type&&t!==o.type)throw new Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort((function(e,t){return r(e)&&r(t)?0:r(t)?-1:r(e)?1:t.length-e.length})),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.include)for(var i=[].concat(r.include),o=0;o<i.length;o++)t.push({include:i[o]});else{if(!r.type)throw new Error("Rule has no type: "+JSON.stringify(r));t.push(u(r.type,r))}}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),n=[],r=0;r<t.length;r++){var o=t[r],a=e[o],s=[].concat(a);if("include"!==o){var c=[];s.forEach((function(e){i(e)?(c.length&&n.push(u(o,c)),n.push(u(o,e)),c=[]):c.push(e)})),c.length&&n.push(u(o,c))}else for(var l=0;l<s.length;l++)n.push({include:s[l]})}return n}(e)}var l=u("error",{lineBreaks:!0,shouldThrow:!0});function f(e,t){for(var i=null,u=Object.create(null),c=!0,f=null,p=[],d=[],h=0;h<e.length;h++)e[h].fallback&&(c=!1);for(h=0;h<e.length;h++){var m=e[h];if(m.include)throw new Error("Inheritance is not allowed in stateless lexers");if(m.error||m.fallback){if(i)throw!m.fallback==!i.fallback?new Error("Multiple "+(m.fallback?"fallback":"error")+" rules not allowed (for token '"+m.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+m.defaultType+"')");i=m}var _=m.match.slice();if(c)for(;_.length&&"string"==typeof _[0]&&1===_[0].length;)u[_.shift().charCodeAt(0)]=m;if(m.pop||m.push||m.next){if(!t)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+m.defaultType+"')");if(m.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+m.defaultType+"')")}if(0!==_.length){c=!1,p.push(m);for(var v=0;v<_.length;v++){var y=_[v];if(r(y))if(null===f)f=y.unicode;else if(f!==y.unicode&&!1===m.fallback)throw new Error("If one rule is /u then all must be")}var g=a(_.map(s)),x=new RegExp(g);if(x.test(""))throw new Error("RegExp matches empty string: "+x);if(new RegExp("|"+g).exec("").length-1>0)throw new Error("RegExp has capture groups: "+x+"\nUse (?: … ) instead");if(!m.lineBreaks&&x.test("\n"))throw new Error("Rule should declare lineBreaks: "+x);d.push(o(g))}}var b=i&&i.fallback,w=n&&!b?"ym":"gm",E=n||b?"":"|";return!0===f&&(w+="u"),{regexp:new RegExp(a(d)+E,w),groups:p,fast:u,error:i||l}}function p(e,t,n){var r=e&&(e.push||e.next);if(r&&!n[r])throw new Error("Missing state '"+r+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var d=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};d.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},d.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},d.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},d.prototype.popState=function(){this.setState(this.stack.pop())},d.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var h=n?function(e,t){return e.exec(t)}:function(e,t){var n=e.exec(t);return 0===n[0].length?null:n};function m(){return this.value}if(d.prototype._getGroup=function(e){for(var t=this.groups.length,n=0;n<t;n++)if(void 0!==e[n+1])return this.groups[n];throw new Error("Cannot find token type for matched text")},d.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var n=this.buffer;if(e!==n.length){if(a=this.fast[n.charCodeAt(e)])return this._token(a,n.charAt(e),e);var r=this.re;r.lastIndex=e;var i=h(r,n),o=this.error;if(null==i)return this._token(o,n.slice(e,n.length),e);var a=this._getGroup(i),s=i[0];return o.fallback&&i.index!==e?(this.queuedGroup=a,this.queuedText=s,this._token(o,n.slice(e,i.index),e)):this._token(a,s,e)}},d.prototype._token=function(e,t,n){var r=0;if(e.lineBreaks){var i=/\n/g,o=1;if("\n"===t)r=1;else for(;i.exec(t);)r++,o=i.lastIndex}var a={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:m,offset:n,lineBreaks:r,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=r,0!==r?this.col=s-o+1:this.col+=s,e.shouldThrow)throw new Error(this.formatError(a,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),a},"undefined"!=typeof Symbol&&Symbol.iterator){var _=function(e){this.lexer=e};_.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},_.prototype[Symbol.iterator]=function(){return this},d.prototype[Symbol.iterator]=function(){return new _(this)}}return d.prototype.formatError=function(e,t){if(null==e){var n=this.buffer.slice(this.index);e={text:n,offset:this.index,lineBreaks:-1===n.indexOf("\n")?0:1,line:this.line,col:this.col}}var r=Math.max(0,e.offset-e.col+1),i=e.lineBreaks?e.text.indexOf("\n"):e.text.length,o=this.buffer.substring(r,e.offset+i);return t+=" at line "+e.line+" col "+e.col+":\n\n",(t+=" "+o+"\n")+" "+Array(e.col).join(" ")+"^"},d.prototype.clone=function(){return new d(this.states,this.state)},d.prototype.has=function(e){return!0},{compile:function(e){var t=f(c(e));return new d({start:t},"start")},states:function(e,t){var n=e.$all?c(e.$all):[];delete e.$all;var r=Object.getOwnPropertyNames(e);t||(t=r[0]);for(var i=Object.create(null),o=0;o<r.length;o++)i[g=r[o]]=c(e[g]).concat(n);for(o=0;o<r.length;o++)for(var a=i[g=r[o]],s=Object.create(null),u=0;u<a.length;u++){var l=a[u];if(l.include){var h=[u,1];if(l.include!==g&&!s[l.include]){s[l.include]=!0;var m=i[l.include];if(!m)throw new Error("Cannot include nonexistent state '"+l.include+"' (in state '"+g+"')");for(var _=0;_<m.length;_++){var v=m[_];-1===a.indexOf(v)&&h.push(v)}}a.splice.apply(a,h),u--}}var y=Object.create(null);for(o=0;o<r.length;o++){var g;y[g=r[o]]=f(i[g],!0)}for(o=0;o<r.length;o++){var x=r[o],b=y[x],w=b.groups;for(u=0;u<w.length;u++)p(w[u],x,y);var E=Object.getOwnPropertyNames(b.fast);for(u=0;u<E.length;u++)p(b.fast[E[u]],x,y)}return new d(y,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t=Object.create(null),n=Object.create(null),r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var o=r[i],a=e[o];(Array.isArray(a)?a:[a]).forEach((function(e){if((n[e.length]=n[e.length]||[]).push(e),"string"!=typeof e)throw new Error("keyword must be string (in keyword '"+o+"')");t[e]=o}))}function s(e){return JSON.stringify(e)}var u="";for(var c in u+="switch (value.length) {\n",n){var l=n[c];u+="case "+c+":\n",u+="switch (value) {\n",l.forEach((function(e){var n=t[e];u+="case "+s(e)+": return "+s(n)+"\n"})),u+="}\n"}return u+="}\n",Function("value",u)}}})?n.apply(t,[]):n)||(e.exports=r)},666:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),a=new T(r||[]);return o._invoke=function(e,t,n){var r=l;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return I()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=$(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,t,n);if("normal"===u.type){if(r=n.done?d:f,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",p="executing",d="completed",h={};function m(){}function _(){}function v(){}var y={};y[o]=function(){return this};var g=Object.getPrototypeOf,x=g&&g(g(N([])));x&&x!==n&&r.call(x,o)&&(y=x);var b=v.prototype=m.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function E(e,t){function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function $(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,$(e,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,h;var o=i.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function N(e){if(e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:I}}function I(){return{value:t,done:!0}}return _.prototype=b.constructor=v,v.constructor=_,v[s]=_.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),E.prototype[a]=function(){return this},e.AsyncIterator=E,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new E(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),b[s]="Generator",b[o]=function(){return this},b.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=N,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),h}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{Config:()=>l,IVProgProcessor:()=>An,LocalizedStrings:()=>Pn,Location:()=>vn,Modes:()=>Se,SemanticAnalyser:()=>In,Settings:()=>Gn,autoGenerateTestCaseOutput:()=>On,i18n:()=>Fn,levenshteinDistance:()=>Ct,openAssessmentDetail:()=>Ot,parseCode:()=>nn,parseExpression:()=>tn,processData:()=>Mt});var e,t=n(575),i=n.n(t),o=n(913),a=n.n(o),s=n(713),u=n.n(s),c=function(){function e(){i()(this,e),u()(this,"decimalPlaces",void 0),u()(this,"intConvertRoundMode",void 0),u()(this,"default_lang",void 0),u()(this,"enable_type_casting",void 0),u()(this,"idle_input_interval",void 0),u()(this,"suspend_threshold",void 0),u()(this,"max_instruction_count",void 0),u()(this,"activity_programming_type",void 0),u()(this,"activity_functions",void 0),u()(this,"activity_datatypes",void 0),u()(this,"activity_commands",void 0),u()(this,"activity_filter",void 0),this.decimalPlaces=8,this.intConvertRoundMode=2,this.default_lang="pt",this.enable_type_casting=!0,this.idle_input_interval=5e3,this.suspend_threshold=1e3,this.max_instruction_count=Number.MAX_SAFE_INTEGER,this.activity_programming_type=new Map,this.activity_functions=new Map,this.activity_datatypes=new Map,this.activity_commands=new Map,this.activity_filter=new Map}return a()(e,[{key:"setConfig",value:function(e){var t=e;for(var n in t)Object.prototype.hasOwnProperty.call(this,n)&&(this[n]=t[n])}}]),e}(),l=new c,f=function(){function e(e,t){void 0===t&&(t="pt"),this.lsKey=e,this.defaultLang=t,this.listeners=[],this.document=document,this.setupListener()}return e.prototype.setupListener=function(){var e=this;null!==this.document&&this.document.addEventListener("storage",(function(t){t.key===e.lsKey&&e.listeners.forEach((function(e){return e()}))}))},e.prototype.getLang=function(){var e=localStorage.getItem(this.lsKey);return null==e?(console.warn("Internal Error: User language information has not been set. Returning default..."),this.getDefaultLang()):e},e.prototype.getDefaultLang=function(){return this.defaultLang},e.prototype.registerLanguageChangeListener=function(e){this.listeners.push(e)},e}();!function(e){e.ERROR="error",e.MESSAGE="message",e.UI="ui"}(e||(e={}));var p=function(){function t(e,t,n){var r=this;void 0===n&&(n=!1),this.service=e,this.i18nData=t,this.listenToChange=n,this.document=document,this.listenToChange&&e.registerLanguageChangeListener((function(){r.updateTagText()}))}return t.prototype.getString=function(e,t){var n=this.i18nData[this.service.getLang()];return n?n[t]&&n[t][e]?n[t][e]:this.getDefaultString(e,t):(console.warn("Internal Error. The language set at ivprog.lang is not valid: "+this.service.getLang()),this.getDefaultString(e,t))},t.prototype.getDefaultString=function(e,t){var n=this.i18nData[this.service.getDefaultLang()];return n[t]?n[t][e]?n[t][e]:"{MISSING_I18N_IDENTIFIER: "+e+"}":"{MISSING_I18N_TYPE_IDENTIFIER: "+t+"}"},t.prototype.getOR=function(){return this.getUI("string_join_or")},t.prototype.getError=function(t,n){void 0===n&&(n=[]);var r=this.getString(t,e.ERROR);return this.processString(r,n)},t.prototype.getMessage=function(t,n){void 0===n&&(n=[]);var r=this.getString(t,e.MESSAGE);return this.processString(r,n)},t.prototype.getUI=function(t,n){void 0===n&&(n=[]);var r=this.getString(t,e.UI);return this.processString(r,n)},t.prototype.processString=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e=e.replace("$"+n,r)}return e},t.prototype.updateTagText=function(e){var t=this;void 0===e&&(e=null),null!==this.document&&this.document.querySelectorAll("data.i18n").forEach((function(n){n.innerHTML=null===e?t.processTagTex(n.getAttribute("value")):e(n.getAttribute("value"))}))},t.prototype.processTagTex=function(t){if(null===t)return"<Invalid i18n identifier>";var n=t.split(":"),r=n[0].toLowerCase(),i=n[1];return e.ERROR===r?this.getError(i):e.MESSAGE===r?this.getMessage(i):e.UI===r?this.getUI(i):(console.warn(" A string has been passed to the i18n helper function that was not in the form type:id -> "+t),this.getString(i,r))},t}();const d={LanguageService:f,LanguageServiceNoLS:function(){function e(e){this.lang=e,this.listeners=[]}return e.prototype.setupListener=function(){},e.prototype.notifyChange=function(){this.listeners.forEach((function(e){return e()}))},e.prototype.setLang=function(e){this.lang=e,this.notifyChange()},e.prototype.getLang=function(){return this.lang},e.prototype.getDefaultLang=function(){return this.lang},e.prototype.registerLanguageChangeListener=function(e){this.listeners.push(e)},e}(),LocalizedStrings:p,StringTypes:e};var h=n(205),m=n.n(h),_=n(585),v=n.n(_),y=n(754),g=n.n(y),x=n(597),b=n(548),w=n(186),E={};for(var $ in b){var R={};R.error=w[$],R.message=x[$],R.ui=b[$],E[$]=R}const k=E;var T=n(38),N=n.n(T),I=n(655),S=n.n(I),A=n(271);function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new RegExp(e.raw.map((function(e,t){return e+(void 0===n[t]?"":"(?:"+n[t].source+")")})).join(""))}function L(){var e=S()(["'(?:","|[^'\\\\])'"],["'(?:","|[^'\\\\\\\\])'"]);return L=function(){return e},e}function O(){var e=S()(['"(?:',')*?"']);return O=function(){return e},e}function D(){var e=S()(["",'|[^"\\\\]'],["",'|[^"\\\\\\\\]']);return D=function(){return e},e}function G(){var e=S()(["","|","|",""]);return G=function(){return e},e}var F=function(){function e(t,n,r,o){i()(this,e),this.RKs=t,this.lexer=n,this.rules=r,this.i18nLexer=o}return a()(e,[{key:"getReservedKeys",value:function(){return this.RKs}},{key:"getRules",value:function(){return this.rules}},{key:"getTypeKeys",value:function(){return this.i18nLexer.types}},{key:"getLangLibs",value:function(){return this.i18nLexer.langLibs}},{key:"getLangFuncs",value:function(){return this.i18nLexer.langFuncs}}]),e}(),P="[0-9a-fA-F]",M="[0-7]",B=RegExp("\\\\[0-3]".concat(M).concat(M,"|\\\\").concat(M).concat(M,"|\\\\").concat(M)),U=RegExp("\\\\u".concat(P).concat(P).concat(P).concat(P)),K=C(G(),/\\[b,t,n,f,r,",',\\]|/,U,B),z=C(D(),K);function V(e){var t={},n={};Object.entries(e.types).forEach((function(e){var r=N()(e,2),i=r[0],o=r[1];t[i]=o,n[i]=i})),Object.entries(e.boolVal).forEach((function(e){var r=N()(e,2),i=r[0],o=r[1];t[i]=o,n[i]=i})),Object.entries(e.commands).forEach((function(e){var r=N()(e,2),i=r[0],o=r[1];t[i]=o,n[i]=i})),t.RK_LOGICAL_AND=e.logicOp.RK_LOGICAL_AND,t.RK_LOGICAL_OR=e.logicOp.RK_LOGICAL_OR,t.RK_LOGICAL_NOT=e.logicOp.RK_LOGICAL_NOT,n.RK_LOGICAL_AND="RK_LOGICAL_AND",n.RK_LOGICAL_OR="RK_LOGICAL_OR",n.RK_LOGICAL_NOT="RK_LOGICAL_NOT";var r=A.keywords(t),i={COMMENTS:{match:/\/\/[^$]*?$|\/\*[^$]*?\*\//,lineBreaks:!0},OPEN_BRACE:/\[/,CLOSE_BRACE:/\]/,OPEN_PARENTHESIS:/\(/,CLOSE_PARENTHESIS:/\)/,OPEN_CURLY:/\{/,CLOSE_CURLY:/\}/,COMMA:/,/,ASSIGNMENT:/<-|←/,REAL:/[0-9]+\.[0-9]*[eE][+-]?[0-9]+|[0-9]+\.[0-9]+/,INTEGER:RegExp("(?:0x|0X)".concat(P,"+|(?:0b|0B)[0-1]+|[0-9]+")),SUM_OP:/[+-]/,MULTI_OP:/[*/%]/,RELATIONAL_OPERATOR:/>=|==|<=|>|<|!=/,COLON:/:/,STRING:C(O(),z),CHARACTER:C(L(),K),EOS:{match:/;\r?\n?|[\r\n]+/,lineBreaks:!0},WHITESPACE:/(?: |\t)+/,RK_REFERENCE:RegExp(e.commands.RK_REFERENCE),ID:{match:RegExp("[a-zA-Z_][a-zA-Z0-9_]*"),type:r},DOT:/\./,ERROR:{match:/[\$?`]/,error:!0}};Object.entries(i).forEach((function(e){var t=N()(e,2),r=t[0];return t[1],n[r]=r}));var o=A.compile(i);return new F(t,o,n,e)}var q=V({commands:{RK_VOID:"vazio",RK_PROGRAM:"programa",RK_SWITCH:"escolha",RK_CASE:"caso",RK_DEFAULT:"contrario",RK_CONST:"const",RK_FUNCTION:"funcao",RK_RETURN:"devolva",RK_FOR:"para",RK_FOR_ALT:"repita_para",RK_FOR_FROM:"de",RK_FOR_TO:"ate",RK_FOR_PASS:"passo",RK_BREAK:"pare",RK_DO:"repita",RK_DO_UNTIL:"ate_que",RK_WHILE:"enquanto",RK_WHILE_ALT:"repita_enquanto",RK_IF:"se",RK_ELSE:"senao",RK_REFERENCE:"&"},boolVal:{RK_FALSE:"falso",RK_TRUE:"verdadeiro"},logicOp:{RK_LOGICAL_NOT:"nao",RK_LOGICAL_AND:"E",RK_LOGICAL_OR:"OU"},types:{RK_REAL:"real",RK_INTEGER:"inteiro",RK_BOOLEAN:"logico",RK_CHARACTER:"caractere",RK_STRING:"cadeia"},langLibs:{$mathLib:"Matematica",$ioLib:"ES",$strLib:"Texto",$arrayLib:"Arranjo",$langLib:"Conversao"},langFuncs:{main_function:"inicio",$read:"leia",$write:"escreva",$numElements:"total_de_elementos",$matrixLines:"total_de_linhas",$matrixColumns:"total_de_colunas",$substring:"subcadeia",$length:"comprimento",$uppercase:"caixa_alta",$lowercase:"caixa_baixa",$charAt:"caractere_na_posicao",$isReal:"e_real",$isInt:"e_inteiro",$isBool:"e_logico",$castReal:"como_real",$castInt:"como_inteiro",$castBool:"como_logico",$castString:"como_cadeia",$castChar:"como_caractere",$sin:"seno",$cos:"cosseno",$tan:"tangente",$sqrt:"raiz_quadrada",$pow:"potencia",$log:"logaritmo",$abs:"modulo",$negate:"trocar_sinal",$invert:"inverter_valor",$max:"maximo",$min:"minimo",$rand:"numero_aleatorio"}}),j=V({commands:{RK_VOID:"vazio",RK_PROGRAM:"program",RK_SWITCH:"switch",RK_CASE:"case",RK_DEFAULT:"otherwise",RK_CONST:"const",RK_FUNCTION:"function",RK_RETURN:"return",RK_FOR:"for",RK_FOR_ALT:"repeat_for",RK_FOR_FROM:"from",RK_FOR_TO:"to",RK_FOR_PASS:"pass",RK_BREAK:"break",RK_DO:"repeat",RK_DO_UNTIL:"until",RK_WHILE:"while",RK_WHILE_ALT:"repeat_while",RK_IF:"if",RK_ELSE:"else",RK_REFERENCE:"&"},boolVal:{RK_FALSE:"false",RK_TRUE:"true"},logicOp:{RK_LOGICAL_NOT:"not",RK_LOGICAL_AND:"AND",RK_LOGICAL_OR:"OR"},types:{RK_REAL:"real",RK_INTEGER:"int",RK_BOOLEAN:"bool",RK_CHARACTER:"char",RK_STRING:"string"},langLibs:{$mathLib:"Mathematics",$ioLib:"IO",$strLib:"Text",$arrayLib:"Array",$langLib:"Conversion"},langFuncs:{main_function:"main",$read:"read",$write:"write",$numElements:"total_of_elements",$matrixLines:"total_of_lines",$matrixColumns:"total_of_columns",$substring:"substring",$length:"length",$uppercase:"uppercase",$lowercase:"lowercase",$charAt:"char_at",$isReal:"is_real",$isInt:"is_integer",$isBool:"is_logic",$castReal:"to_real",$castInt:"to_integer",$castBool:"to_logic",$castString:"to_string",$castChar:"to_char",$sin:"sin",$cos:"cos",$tan:"tan",$sqrt:"sqrt",$pow:"pow",$log:"log",$abs:"abs",$negate:"negate",$invert:"invert",$max:"maximum",$min:"minimum",$rand:"random"}}),H={};H.pt=q,H.en=j;const Y=H;var W=new(function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(){return i()(this,o),r.call(this,"undefined"==typeof iLMparameters?l.default_lang:iLMparameters.lang)}return a()(o,[{key:"getDefaultLang",value:function(){return"en"}},{key:"getCurrentLexer",value:function(){var e=Y[this.getLang()];return null==e?Y[this.getDefaultLang()]:e}},{key:"getCurrentLangFuncs",value:function(){var e=Y[this.getLang()];return null==e?Y[this.getDefaultLang()].getLangFuncs():e.getLangFuncs()}},{key:"getCurrentLangLibs",value:function(){var e=Y[this.getLang()];return null==e?Y[this.getDefaultLang()].getLangLibs():e.getLangLibs()}}]),o}(d.LanguageServiceNoLS)),Z=n(757),Q=n.n(Z),J=n(926),X=n.n(J),ee=function(){function e(){i()(this,e),this._sourceInfo=null}return a()(e,[{key:"sourceInfo",set:function(e){this._sourceInfo=e},get:function(){return this._sourceInfo}}]),e}();var te=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(){return i()(this,o),r.call(this)}return o}(ee);var ne=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this)).expression=e,t}return o}(ee);var re=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this)).id=e,n.expression=t,n}return o}(ee);var ie=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n,a){var s;return i()(this,o),(s=r.call(this,e,a)).line=t,s.column=n,s}return o}(re);var oe=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n,a){var s;return i()(this,o),(s=r.call(this)).id=e,s.type=t,s.initial=n,s.isConst=a,s}return o}(ee);var ae=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n,a,s,u){var c;return i()(this,o),(c=r.call(this,e,t,s,u)).lines=n,c.columns=a,c}return a()(o,[{key:"isVector",get:function(){return null==this.columns}}]),o}(oe);var se=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this)).expression=e,n.commandBlock=t,n}return a()(o,[{key:"commands",get:function(){return this.commandBlock.commands}},{key:"testFirst",get:function(){return!0}}]),o}(ee);var ue=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n,a,s){var u;return i()(this,o),(u=r.call(this)).for_id=e,u.for_from=t,u.for_to=n,u.for_pass=a,u.commandBlock=s,u}return a()(o,[{key:"commands",get:function(){return this.commandBlock.commands}}]),o}(ee),ce=function(){function e(t,n){i()(this,e),u()(this,"value",void 0),u()(this,"ord",void 0),this.value=t,this.ord=n}return a()(e,[{key:"stringInfo",value:function(){return[{type:this.value,dim:0}]}},{key:"isCompatible",value:function(e){return this.value===e.value&&this.ord===e.ord}}]),e}(),le=function(){function e(t){i()(this,e),this.types=t}return a()(e,[{key:"stringInfo",value:function(){for(var e=[],t=0;t<this.types.length;t++){var n=this.types[t];e=e.concat(n.stringInfo())}return e}},{key:"isCompatible",value:function(e){for(var t=0;t<this.types.length;t++){var n=this.types[t];if(e.isCompatible(n))return!0}return!1}},{key:"value",get:function(){}},{key:"ord",get:function(){}}]),e}(),fe=new ce("integer",0),pe=new ce("real",1),de=new ce("text",2),he=new ce("boolean",3),me=new ce("char",4),_e=new ce("void",5),ve=new ce("undefined",6),ye=new le([fe,pe,de,me,he]),ge=Object.freeze({INTEGER:fe,REAL:pe,STRING:de,CHAR:me,BOOLEAN:he,VOID:_e,UNDEFINED:ve,ALL:ye}),xe=function(){function e(t,n,r,o){i()(this,e),this.name=t,this.returnType=n,this.formalParameters=r,this.commandBlock=o,this._sourceInfo=null}return a()(e,[{key:"hasVariadic",value:function(){return this.formalParameters.some((function(e){return e.variadic}))}},{key:"isMain",get:function(){return null===this.name&&this.returnType.isCompatible(ge.VOID)}},{key:"commands",get:function(){return this.commandBlock.commands}},{key:"variablesDeclarations",get:function(){return this.commandBlock.variables}},{key:"sourceInfo",set:function(e){this._sourceInfo=e},get:function(){return this._sourceInfo}}]),e}();var be=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n){var a;return i()(this,o),(a=r.call(this)).condition=e,a.ifTrue=t,a.ifFalse=n,a}return o}(ee),we=function(){function e(t,n){i()(this,e),this.variables=t,this.commands=n,this._sourceInfo=null}return a()(e,[{key:"sourceInfo",set:function(e){this._sourceInfo=e},get:function(){return this._sourceInfo}}]),e}();var Ee=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){return i()(this,o),r.call(this,e,t)}return a()(o,[{key:"testFirst",get:function(){return!1}}]),o}(se),$e=function(){function e(){i()(this,e),this._sourceInfo=null,this._parenthesis=!1}return a()(e,[{key:"sourceInfo",set:function(e){this._sourceInfo=e},get:function(){return this._sourceInfo}},{key:"parenthesis",set:function(e){this._parenthesis=e},get:function(){return this._parenthesis}}]),e}();var Re=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this)).expression=e,n.cases=t,n}return o}(ee);var ke=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this)).expression=e,t.commands=[],t}return a()(o,[{key:"setCommands",value:function(e){this.commands=e}},{key:"isDefault",get:function(){return null===this.expression}}]),o}(ee),Te=function e(t){i()(this,e),this.langFunc=t},Ne=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i()(this,e),this.type=t,this.id=n,this.byRef=r,this.variadic=o,this._sourceInfo=null}return a()(e,[{key:"sourceInfo",set:function(e){this._sourceInfo=e},get:function(){return this._sourceInfo}}]),e}();var Ie=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this)).id=e,n.actualParameters=t,n}return a()(o,[{key:"toString",value:function(){var e;e=this.isMainCall?Rt.getMainFunctionName():Rt.getLocalName(this.id);var t=null;return t=0==this.actualParameters.length?"()":"("+this.actualParameters.map((function(e){return e.toString()})).join(",")+")",this.parenthesis?"(".concat(e+t,")"):e+t}},{key:"isMainCall",get:function(){return null===this.id}},{key:"parametersSize",get:function(){return this.actualParameters.length}}]),o}($e),Se=Object.freeze({RETURN:Symbol("mode:return"),BREAK:Symbol("mode:break"),PAUSE:Symbol("mode:pause"),RUN:Symbol("mode:run"),ABORT:Symbol("mode:abort")}),Ae=n(776),Ce=n.n(Ae);function Le(e){return new(Ce())(e)}function Oe(e){var t=e.replace(/^"/,"");return(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 De(e){var t=e.replace(/^'/,"");return(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,"'"))[0]}function Ge(e){return new(Ce())(e)}function Fe(e){var t=e,n=W.getCurrentLexer();if(n.getReservedKeys()[n.getRules().RK_TRUE]===t)return!0;if(n.getReservedKeys()[n.getRules().RK_FALSE]===t)return!1;throw new Error(e+"not a valid boolean")}function Pe(e){var t=W.getCurrentLexer();return(e?t.getReservedKeys()[t.getRules().RK_TRUE]:t.getReservedKeys()[t.getRules().RK_FALSE]).replace(/'/g,"")}function Me(e,t){switch(t.ord){case ge.INTEGER.ord:return e.toString();case ge.REAL.ord:return e.dp()<=0?e.toFixed(1):e.toFixed(l.decimalPlaces);case ge.BOOLEAN.ord:return Pe(e);default:return e}}var Be=n(506),Ue=n.n(Be),Ke=n(957),ze=n.n(Ke);var Ve=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this,e)).id=t,n._context={},Error.captureStackTrace&&Error.captureStackTrace(Ue()(n),o),n}return a()(o,[{key:"context",get:function(){return this._context},set:function(e){this._context=e}}]),o}(ze()(Error));var qe=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this,e)).id=t,n._context={},Error.captureStackTrace&&Error.captureStackTrace(Ue()(n),o),n}return a()(o,[{key:"context",get:function(){return this._context},set:function(e){this._context=e}}]),o}(ze()(Error));function je(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=It();return new Ve(n.getError(e,t),e)}function He(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=It();return new qe(n.getError(e,t),e)}var Ye=Object.freeze({symbol_not_found_full:function(e,t){if(t){var n=He("symbol_not_found_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Ye.symbol_not_found(e)},symbol_not_found:function(e){return He("symbol_not_found",[e])},function_missing_full:function(e,t){if(t){var n=He("function_missing_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Ye.function_missing(e)},function_missing:function(e){return He("function_missing",[e])},main_missing:function(){return He("main_missing")},array_dimension_not_int_full:function(e){if(e){var t=He("array_dimension_not_int_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Ye.array_dimension_not_int()},array_dimension_not_int:function(){return He("array_dimension_not_int")},unknown_command_full:function(e){if(e){var t=je("unknown_command_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Ye.unknown_command()},unknown_command:function(){return je("unknown_command")},incompatible_types_full:function(e,t,n,r,i,o){var a=It();if(o){var s=He("incompatible_types_full",[a.translateType(e,t),i,o.line,a.translateType(n,r)]);return s.context={line:o.line,column:o.column},s}return Ye.incompatible_types(e,t,n,r,i)},incompatible_types:function(e,t,n,r,i){var o=It();return He("incompatible_types",[o.translateType(e,t),i,o.translateType(n,r)])},incompatible_types_array_full:function(e,t,n,r){var i=It();if(r){var o=He("incompatible_types_array_full",[e,i.translateType(t,n),r.line,r.column]);return o.context={line:r.line,column:r.column},o}return Ye.incompatible_types_array(e,t,n)},incompatible_types_array:function(e,t,n){return He("incompatible_types_array",[e,It().translateType(t,n)])},loop_condition_type_full:function(e,t){if(t){var n=He("loop_condition_type_full",[t.line,t.column,e]);return n.context={line:t.line,column:t.column},n}return Ye.loop_condition_type(e)},loop_condition_type:function(e){return He("loop_condition_type",[e])},endless_loop_full:function(e){if(e){var t=He("endless_loop_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Ye.endless_loop()},endless_loop:function(){return He("endless_loop")},if_condition_type_full:function(e,t){if(t){var n=He("if_condition_type_full",[t.line,t.column,e]);return n.context={line:t.line,column:t.column},n}return Ye.if_condition_type(e)},if_condition_type:function(e){return He("if_condition_type",[e])},invalid_global_var:function(){return je("invalid_global_var")},not_implemented:function(e){return je("not_implemented",[e])},invalid_case_type_full:function(e,t,n,r){var i=It();if(r){var o=He("invalid_case_type_full",[e,i.translateType(t,n),r.line,r.column]);return o.context={line:r.line,column:r.column},o}return Ye.invalid_case_type(e,t,n)},invalid_case_type:function(e,t,n){return He("invalid_case_type",[e,It().translateType(t,n)])},void_in_expression_full:function(e,t){if(t){var n=He("void_in_expression_full",[t.line,t.column,e]);return n.context={line:t.line,column:t.column},n}return Ye.void_in_expression(e)},void_in_expression:function(e){return He("void_in_expression",[e])},invalid_array_access_full:function(e,t){if(t){var n=He("invalid_array_access_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Ye.invalid_array_access(e)},invalid_array_access:function(e){return He("invalid_array_access",[e])},invalid_matrix_access_full:function(e,t){if(t){var n=He("invalid_matrix_access_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Ye.invalid_matrix_access(e)},invalid_matrix_access:function(e){return He("invalid_matrix_access",[e])},matrix_column_outbounds_full:function(e,t,n,r){if(r){var i=je("matrix_column_outbounds_full",[r.line,t,e,n]);return i.context={line:r.line,column:r.column},i}return Ye.matrix_column_outbounds(e,t,n)},matrix_column_outbounds:function(e,t,n){return je("matrix_column_outbounds",[t,e,n])},matrix_line_outbounds_full:function(e,t,n,r){if(r){var i=je("matrix_line_outbounds_full",[r.line,t,e,n]);return i.context={line:r.line,column:r.column},i}return Ye.matrix_line_outbounds(e,t,n)},matrix_line_outbounds:function(e,t,n){return je("matrix_line_outbounds",[t,e,n])},vector_line_outbounds_full:function(e,t,n,r){if(r){var i=je("vector_line_outbounds_full",[r.line,t,e,n]);return i.context={line:r.line,column:r.column},i}return Ye.vector_line_outbounds(e,t,n)},vector_line_outbounds:function(e,t,n){return je("vector_line_outbounds",[t,e,n])},vector_not_matrix_full:function(e,t){if(t){var n=je("vector_not_matrix_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Ye.vector_not_matrix(e)},vector_not_matrix:function(e){return je("vector_not_matrix",[e])},function_no_return:function(e){return He("function_no_return",[e])},invalid_void_return_full:function(e,t,n,r){var i=It();if(r){var o=He("invalid_void_return_full",[r.line,e,i.translateType(t,n)]);return o.context={line:r.line,column:r.column},o}return Ye.invalid_void_return(e,t,n)},invalid_void_return:function(e,t,n){return He("invalid_void_return_full",[e,It().translateType(t,n)])},invalid_return_type_full:function(e,t,n,r){var i=It();if(r){var o=He("invalid_return_type_full",[r.line,e,i.translateType(t,n)]);return o.context={line:r.line,column:r.column},o}return Ye.invalid_return_type(e,t,n)},invalid_return_type:function(e,t,n){return He("invalid_return_type",[e,It().translateType(t,n)])},invalid_parameters_size_full:function(e,t,n,r){if(r){var i=He("invalid_parameters_size_full",[r.line,e,t,n]);return i.context={line:r.line,column:r.column},i}return Ye.invalid_parameters_size(e,t,n)},invalid_parameters_size:function(e,t,n){return He("invalid_parameters_size",[e,t,n])},invalid_parameter_type_full:function(e,t,n){if(n){var r=He("invalid_parameter_type_full",[t,Rt.getLocalName(e),n.line]);return r.context={line:n.line,column:n.column},r}return Ye.invalid_parameter_type(e,t)},invalid_parameter_type:function(e,t){return He("invalid_parameter_type_full",[t,Rt.getLocalName(e)])},invalid_ref_full:function(e,t,n){if(n){var r=He("invalid_ref_full",[t,e,n.line]);return r.context={line:n.line,column:n.column},r}return Ye.invalid_ref(e,t)},invalid_ref:function(e,t){return He("invalid_ref",[t,e])},unexpected_break_command_full:function(e){if(e){var t=je("unexpected_break_command_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Ye.unexpected_break_command()},unexpected_break_command:function(){return je("unexpected_break_command")},invalid_array_literal_type_full:function(e,t){if(t){var n=je("invalid_array_literal_type_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Ye.invalid_array_literal_type(e)},invalid_array_literal_type:function(e){return je("invalid_array_literal_type",[e])},invalid_array_literal_line_full:function(e,t,n){if(n){var r=je("invalid_array_literal_line_full",[n.line,e,t]);return r.context={line:n.line,column:n.column},r}return Ye.invalid_array_literal_type(e,t)},invalid_array_literal_line:function(e,t){return je("invalid_array_literal_line",[e,t])},invalid_array_literal_column_full:function(e,t,n){if(n){var r=je("invalid_array_literal_column_full",[n.line,e,t]);return r.context={line:n.line,column:n.column},r}return Ye.invalid_array_literal_column(e,t)},invalid_array_literal_column:function(e,t){return je("invalid_array_literal_column",[e,t])},invalid_unary_op_full:function(e,t,n,r,i){var o=It();if(i){var a=je("invalid_unary_op_full",[i.line,e,o.translateOp(t),o.translateType(n,r)]);return a.context={line:i.line,column:i.column},a}return Ye.invalid_unary_op(t,n,r)},invalid_unary_op:function(e,t,n,r){var i=It();return je("invalid_unary_op",[e,i.translateOp(t),i.translateType(n,r)])},invalid_infix_op_full:function(e,t,n,r,i,o,a){var s=It();if(a){var u=je("invalid_infix_op_full",[a.line,e,s.translateOp(t),s.translateType(n,r),s.translateType(i,o)]);return u.context={line:a.line,column:a.column},u}return Ye.invalid_infix_op(t,n,r,i,o)},invalid_infix_op:function(e,t,n,r,i,o){var a=It();return je("invalid_infix_op",[e,a.translateOp(t),a.translateType(n,r),a.translateType(i,o)])},array_dimension_not_positive_full:function(e){if(e){var t=He("array_dimension_not_positive_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Ye.array_dimension_not_positive()},array_dimension_not_positive:function(){return He("array_dimension_not_positive")},invalid_type_conversion:function(e,t,n){return je("invalid_type_conversion",[e,It().translateType(t,n)])},invalid_read_type:function(e,t,n,r,i){var o=It(),a=je("invalid_read_type",[i.line,e,o.translateType(t,n),r]);return a.context={line:i.line,column:i.column},a},invalid_read_type_array:function(e,t,n,r,i,o,a){var s=It(),u=je("invalid_read_type_array",[a.line,e,s.translateType(t,n),r,s.translateType(i,o)]);return u.context={line:a.line,column:a.column},u},invalid_const_ref_full:function(e,t,n){if(n){var r=He("invalid_const_ref_full",[t,Rt.getLocalName(e),n.line]);return r.context={line:n.line,column:n.column},r}return Ye.invalid_const_ref(e,t)},invalid_const_ref:function(e,t){return He("invalid_const_ref",[t,Rt.getLocalName(e)])},invalid_const_assignment_full:function(e,t){if(t){var n=He("invalid_const_assignment_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Ye.invalid_const_assignment(e)},invalid_const_assignment:function(e){return He("invalid_const_assignment",[e])},invalid_vector_assignment_full:function(e,t,n,r,i){if(i){var o=je("invalid_vector_assignment_full",[i.line,e,t,n,r]);return o.context={line:i.line,column:i.column},o}return Ye.invalid_vector_assignment(e,t,n,r)},invalid_vector_assignment:function(e,t,n,r){return je("invalid_vector_assignment",[e,t,n,r])},invalid_matrix_assignment_full:function(e,t,n,r,i,o,a){if(a){var s=je("invalid_matrix_assignment_full",[a.line,e,t,n,r,i,o]);return s.context={line:a.line,column:a.column},s}return Ye.invalid_matrix_assignment(e,t,n,r,i,o)},invalid_matrix_assignment:function(e,t,n,r,i,o){return je("invalid_matrix_assignment",[e,t,n,r,i,o])},matrix_to_vector_attr:function(e,t,n){var r=He("matrix_to_vector_attr",[n.line,t,e]);return r.context={line:n.line,column:n.column},r},vector_to_matrix_attr:function(e,t,n){var r=He("vector_to_matrix_attr",[n.line,t,e]);return r.context={line:n.line,column:n.column},r},invalid_matrix_index_assign_full:function(e,t,n,r,i,o){if(o){var a=je("invalid_matrix_index_assign_full",[o.line,t,e,n,r,i]);return a.context={line:o.line,column:o.column},a}return Ye.invalid_matrix_index_assign(e,t,n,r,i)},invalid_matrix_index_assign:function(e,t,n,r,i){return je("invalid_matrix_index_assign",[t,e,n,r,i])},invalid_number_elements_vector:function(e,t,n,r){var i=je("invalid_number_elements_vector",[e,r.line,t,n]);return i.context={line:r.line,column:r.column},i},invalid_number_lines_matrix:function(e,t,n,r){var i=je("invalid_number_lines_matrix",[e,r.line,t,n]);return i.context={line:r.line,column:r.column},i},divsion_by_zero_full:function(e,t){if(t){var n=je("divsion_by_zero_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Ye.divsion_by_zero(e)},divsion_by_zero:function(e){return je("divsion_by_zero",[e])},undefined_tanget_value:function(e,t){var n=je("undefined_tanget_value",[t.line,e]);return n.context={line:t.line,column:t.column},n},negative_log_value:function(e){var t=je("negative_log_value",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_string_index:function(e,t,n){var r=Rt.getLocalName("$charAt"),i=je("invalid_string_index",[n.line,r,e,t,t.length-1]);return i.context={line:n.line,column:n.column},i},negative_sqrt_value:function(e){var t=je("negative_sqrt_value",[e.line]);return t.context={line:e.line,column:e.column},t},exceeded_recursive_calls:function(e){var t=je("exceeded_recursive_calls",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_for_variable:function(e,t){var n=He("invalid_for_variable",[t.line,e]);return n.context={line:t.line,column:t.column},n},invalid_for_from:function(e,t){var n=He("invalid_for_from",[t.line,e]);return n.context={line:t.line,column:t.column},n},invalid_for_to:function(e,t){var n=He("invalid_for_to",[t.line,e]);return n.context={line:t.line,column:t.column},n},invalid_for_pass:function(e,t){var n=He("invalid_for_pass",[t.line,e]);return n.context={line:t.line,column:t.column},n},exceed_max_instructions:function(){return je("exceed_max_instructions")}}),We=function(){function e(t,n,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i()(this,e),u()(this,"type",void 0),u()(this,"id",void 0),u()(this,"isConst",void 0),u()(this,"value",void 0),this.type=t,this.id=r,this.isConst=o,this.value=n}return a()(e,[{key:"get",value:function(){return this.value}},{key:"inStore",value:function(){return null!=this.id}}]),e}(),Ze=function(){function e(t,n){i()(this,e),this.dimensions=n,u()(this,"innerType",void 0),this.innerType=t}return a()(e,[{key:"isCompatible",value:function(t){return t instanceof e&&this.dimensions===t.dimensions&&this.innerType.isCompatible(t.innerType)}},{key:"stringInfo",value:function(){var e=this,t=this.innerType.stringInfo();return t.forEach((function(t){t.dim=e.dimensions})),t}},{key:"canAccept",value:function(t,n){var r=this.dimensions-n;return t instanceof e?r==t.dimensions&&this.innerType.isCompatible(t.innerType):0==r&&this.innerType.isCompatible(t)}},{key:"isVector",get:function(){return 1==this.dimensions}},{key:"value",get:function(){}},{key:"ord",get:function(){}}]),e}();var Qe=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n){var a;return i()(this,o),(a=r.call(this)).id=e,a.line=t,a.column=n,a}return a()(o,[{key:"toString",value:function(){var e=this.line.toString(),t=null;this.column&&(t=this.column.toString());var n;return n=t?"".concat(this.id,"[").concat(e,"][").concat(t,"]"):"".concat(this.id,"[").concat(e,"]"),this.parenthesis?"(".concat(n,")"):n}}]),o}($e);var Je=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this)).type=e,t}return o}($e);var Xe=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,ge.INTEGER)).value=e,t}return a()(o,[{key:"toString",value:function(){var e=Me(this.value,this.type);return this.parenthesis?"(".concat(e,")"):e}}]),o}(Je);var et=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,ge.REAL)).value=e,t}return a()(o,[{key:"toString",value:function(){var e=Me(this.value,this.type);return this.parenthesis?"(".concat(e,")"):e}}]),o}(Je);var tt=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,ge.BOOLEAN)).value=e,t}return a()(o,[{key:"toString",value:function(){var e=Pe(this.value);return this.parenthesis?"(".concat(e,")"):e}}]),o}(Je);var nt=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,ge.CHAR)).value=e,t}return a()(o,[{key:"toString",value:function(){var e="'".concat(this.value,"'");return this.parenthesis?"(".concat(e,")"):e}}]),o}(Je);var rt=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,ge.STRING)).value=e,t}return a()(o,[{key:"toString",value:function(){var e='"'+this.value+'"';return this.parenthesis?"(".concat(e,")"):e}}]),o}(Je);var it=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this,e)).value=t,n}return a()(o,[{key:"validateType",value:function(){return!0}},{key:"validateSize",value:function(){return!0}},{key:"toString",value:function(){var e="{"+this.value.map((function(e){return e.toString()})).join(",")+"}";return this.parenthesis?"(".concat(e,")"):e}},{key:"subtype",get:function(){var e=this.value[0];return e instanceof o?e.value[0].type:e.type}},{key:"lines",get:function(){return this.value.length}},{key:"columns",get:function(){var e=this.value[0];return e instanceof o?e.value.length:null}},{key:"isVector",get:function(){return null===this.columns}},{key:"isValid",get:function(){return this.validateSize()&&this.validateType()}}]),o}(Je);var ot=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this,ge.UNDEFINED)).id=e,t}return a()(o,[{key:"toString",value:function(){return this.parenthesis?"(".concat(this.id,")"):this.id}}]),o}(Je);var at=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n){var a;return i()(this,o),(a=r.call(this)).op=e,a.left=t,a.right=n,a}return a()(o,[{key:"toString",value:function(){var e=this.left.toString(),t=this.op.value,n=this.right.toString();return this.parenthesis?"(".concat(e+t+n,")"):e+t+n}}]),o}($e);var st=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){return i()(this,o),r.call(this,e,t,null)}return a()(o,[{key:"toString",value:function(){var e=this.left.toString(),t=this.op.value;return this.parenthesis?"(".concat(t+e,")"):t+e}}]),o}(at),ut=function(){function e(t,n,r,o){i()(this,e),this.line=t,this.column=n,this.text=r,this.size=o}return a()(e,null,[{key:"createSourceInfo",value:function(t){return new e(t.line,t.col,t.text,t.text.length)}},{key:"createSourceInfoFromList",value:function(t,n){return new e(t.line,t.col,"",n.offset+1-t.offset)}}]),e}(),ct=Object.freeze({ADD:{ord:0,value:"+"},SUB:{ord:1,value:"-"},MULT:{ord:2,value:"*"},DIV:{ord:3,value:"/"},MOD:{ord:4,value:"%"},GT:{ord:5,value:">"},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 lt(e){switch(e){case"+":return ct.ADD;case"-":return ct.SUB;case"*":return ct.MULT;case"/":return ct.DIV;case"%":return ct.MOD;case">":return ct.GT;case">=":return ct.GE;case"<":return ct.LT;case"<=":return ct.LE;case"==":return ct.EQ;case"!=":return ct.NEQ;case"and":return ct.AND;case"or":return ct.OR;case"not":return ct.NOT}return null}var ft=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n;return i()(this,o),(n=r.call(this,e)).id=t,n._context={},Error.captureStackTrace&&Error.captureStackTrace(Ue()(n),o),n}return a()(o,[{key:"context",get:function(){return this._context},set:function(e){this._context=e}}]),o}(ze()(Error)),pt=It();function dt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return new ft(pt.getError(e,t),e)}var ht=Object.freeze({extra_lines:function(){return new ft(pt.getError("extra_lines"))},token_missing_one:function(e,t){var n=dt("token_missing_one",[e,t.text,t.line,t.col]);return n.context={line:t.line,column:t.col},n},token_missing_list:function(e,t){var n=e.join(pt.getOR()),r=ht.token_missing_one(n,t);return r.context={line:t.line,column:t.col},r},id_missing:function(e){var t=dt("id_missing",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},eos_missing:function(e){var t=dt("eos_missing",[e.line,e.col]);return t.context={line:e.line,column:e.col},t},invalid_array_dimension:function(e,t){var n=dt("invalid_array_dimension",[t.line,t.col,e]);return n.context={line:t.line,column:t.col},n},invalid_array_size:function(e){var t=dt("invalid_array_size",[e.line]);return t.context={line:e.line,column:e.col},t},invalid_main_return:function(e,t,n){var r=dt("invalid_main_return",[e,t,n.line]);return r.context={line:n.line,column:n.col},r},invalid_var_declaration:function(e){var t=dt("invalid_var_declaration",[e.line]);return t.context={line:e.line,column:e.col},t},invalid_break_command:function(e,t){var n=dt("invalid_break_command",[t.line,e]);return n.context={line:t.line,column:t.col},n},invalid_terminal:function(e){var t=dt("invalid_terminal",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},invalid_type:function(e,t){var n=e.join(pt.getOR()),r=dt("invalid_type",[t.text,t.line,t.col,n]);return r.context={line:t.line,column:t.col},r},const_not_init:function(e){var t=dt("const_not_init",[e.line,e.col]);return t.context={line:e.line,column:e.col},t},invalid_id_format:function(e){var t=dt("invalid_id_format",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},duplicate_function:function(e){var t=dt("duplicate_function",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},main_parameters:function(){return dt("main_parameters")},duplicate_variable:function(e){var t=dt("duplicate_variable",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},invalid_character:function(e,t,n){var r=dt("invalid_character",[e,t]);return r.context={line:t,column:n},r},annonymous_array_literal:function(e){var t=dt("annonymous_array_literal",[e.line]);return t.context={line:e.line,column:e.col},t},invalid_matrix_literal_line:function(e,t){var n=dt("invalid_matrix_literal_line",[e,t.line]);return n.context={line:t.line,column:t.column},n},cannot_infer_matrix_line:function(e,t){var n=dt("cannot_infer_matrix_line",[e,t.line]);return n.context={line:t.line,column:t.column},n},cannot_infer_matrix_column:function(e,t){var n=dt("cannot_infer_matrix_column",[e,t.line]);return n.context={line:t.line,column:t.column},n},cannot_infer_vector_size:function(e,t){var n=dt("cannot_infer_vector_size",[e,t.line]);return n.context={line:t.line,column:t.column},n},matrix_to_vector_literal_attr:function(e,t,n){var r=dt("matrix_to_vector_literal_attr",[n.line,t,e]);return r.context={line:n.line,column:n.column},r},vector_to_matrix_literal_attr:function(e,t,n){var r=dt("vector_to_matrix_literal_attr",[n.line,t,e]);return r.context={line:n.line,column:n.column},r},array_init_not_literal:function(e){var t=dt("array_init_not_literal",[e.line]);return t.context={line:e.line,column:e.column},t},array_exceeds_2d:function(e){var t=dt("array_exceeds_2d",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_matrix_id_dimension:function(e){var t=dt("invalid_matrix_id_dimension",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_vector_init:function(e){var t=dt("invalid_vector_init",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_matrix_init:function(e){var t=dt("invalid_matrix_init",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_syntax:function(e,t,n){var r=dt("invalid_syntax",[e,t]);return r.context={line:t,column:n},r}}),mt=function(){function e(t,n){i()(this,e),this.ivprogLexer=n,this.inputStream=t,this.lexer=n.lexer,this.tokenStream=[],this.pos=0,this.ruleNames=n.getRules(),this.variableTypes=Object.entries(this.ivprogLexer.getTypeKeys()).map((function(e){var t=N()(e,2),n=t[0];return t[1],n})),this.functionTypes=this.variableTypes.concat(this.ruleNames.RK_VOID),this.parsingArrayDimension=0,this.scope=[],this.langFuncs=this.ivprogLexer.getLangFuncs(),this.definedFuncsNameList=[],this.definedVariablesStack=[]}return a()(e,null,[{key:"createParser",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=W.getCurrentLexer(),i=new e(t,r);return n&&i.fill(),i}},{key:"BASE",get:function(){return 0}},{key:"FUNCTION",get:function(){return 1}},{key:"COMMAND",get:function(){return 2}},{key:"BREAKABLE",get:function(){return 4}},{key:"EOF_TOKEN",get:function(){return{text:null,line:-1,col:-1,value:null,offset:-1,lineBreaks:!1,type:"EOF"}}}]),a()(e,[{key:"fill",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t?this.tokenStream=t:(this.tokenStream=Array.from(this.lexer.reset(this.inputStream)),this.tokenStream=this.tokenStream.filter((function(t){if(t.type===e.ruleNames.ERROR){var n=t.text,r=t.line,i=t.col;throw ht.invalid_syntax(n,r,i)}return t.type!==e.ruleNames.WHITESPACE&&t.type!==e.ruleNames.COMMENTS})))}},{key:"parseTree",value:function(){return this.parseProgram()}},{key:"getToken",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pos;return t>=this.tokenStream.length?e.EOF_TOKEN:this.tokenStream[t]}},{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).type===e.EOF_TOKEN.type}},{key:"parseProgram",value:function(){this.consumeNewLines();var e=this.getToken(),t=[],n=[];if(this.ruleNames.RK_PROGRAM===e.type){for(this.pos++,this.consumeNewLines(),this.checkOpenCurly(),this.pos++,this.pushVariableStack();;){this.consumeNewLines();var r=this.getToken();if(r.type===this.ruleNames.RK_CONST||this.isVariableType(r))t=t.concat(this.parseGlobalVariables());else{if(r.type!==this.ruleNames.RK_FUNCTION)break;this.pushVariableStack(),n=n.concat(this.parseFunction()),this.popVariableStack()}}if(this.consumeNewLines(),this.checkCloseCurly(),this.pos++,this.consumeNewLines(),!this.isEOF())throw console.log(this.getToken()),ht.extra_lines();return this.popVariableStack(),{global:t,functions:n}}throw ht.token_missing_one(this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_PROGRAM],e)}},{key:"checkOpenCurly",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getToken();if(this.ruleNames.OPEN_CURLY!==t.type){if(e)return!1;throw ht.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.ruleNames.CLOSE_CURLY!==t.type){if(e)return!1;throw ht.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.ruleNames.OPEN_BRACE!==t.type){if(e)return!1;throw ht.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.ruleNames.CLOSE_BRACE!==t.type){if(e)return!1;throw ht.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.ruleNames.OPEN_PARENTHESIS!==t.type){if(e)return!1;throw ht.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.ruleNames.CLOSE_PARENTHESIS!==t.type){if(e)return!1;throw ht.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.ruleNames.EOS){if(e)return!1;throw ht.eos_missing(t)}return!0}},{key:"checkFunctionDuplicate",value:function(e,t){var n=null===e?"$main":e;if(-1!==this.definedFuncsNameList.indexOf(n))throw ht.duplicate_function(t);this.definedFuncsNameList.push(n)}},{key:"checkVariableDuplicate",value:function(e,t){if(-1!==this.getCurrentVariableStack().indexOf(e))throw ht.duplicate_variable(t);this.getCurrentVariableStack().push(e)}},{key:"consumeForSemiColon",value:function(){var e=this.getToken();if(e.type!==this.ruleNames.EOS||!e.text.match("^;$"))throw ht.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.ruleNames.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 ht.token_missing_list([this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_CONST]].concat(this.getTypeArray()),e)}},{key:"parseDeclaration",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null,r=null,i=null,o=0,a=ut.createSourceInfo(this.getToken()),s=this.parseID();if(this.checkVariableDuplicate(s,a),this.checkOpenBrace(!0))return this.pos+=1,this.consumeNewLines(),r=this.parseArrayDimension(),this.consumeNewLines(),this.checkCloseBrace(),this.pos+=1,o+=1,this.checkOpenBrace(!0)&&(this.pos+=1,this.consumeNewLines(),i=this.parseArrayDimension(),this.consumeNewLines(),this.checkCloseBrace(),this.pos+=1,o+=1),this.parseArrayDeclaration(e,t,s,a,o,r,i);var u=this.getToken();if(t&&u.type!==this.ruleNames.ASSIGNMENT)throw ht.const_not_init(a);u.type===this.ruleNames.ASSIGNMENT&&(this.pos++,n=this.parseExpressionOR());var c=new oe(s,e,n,t);c.sourceInfo=a;var l=this.getToken();return l.type===this.ruleNames.COMMA?(this.pos++,this.consumeNewLines(),[c].concat(this.parseDeclaration(e,t))):[c]}},{key:"parseArrayDeclaration",value:function(e,t,n,r,i,o,a){var s=this.getToken(),u=o,c=a,l=null,f=!1;if((o instanceof ot||a instanceof ot)&&(f=!0,i>1&&(null==o||null==a)))throw ht.invalid_matrix_id_dimension(ut.createSourceInfo(s));if(t&&s.type!==this.ruleNames.ASSIGNMENT)throw ht.const_not_init(r);if(s.type===this.ruleNames.ASSIGNMENT){if(f)throw 1==i?ht.invalid_vector_init(ut.createSourceInfo(s)):ht.invalid_matrix_init(ut.createSourceInfo(s));this.pos+=1,l=this.parseArrayLiteral(e)}if(null==l&&null==o){if(i>1)throw ht.cannot_infer_matrix_line(n,r);throw ht.cannot_infer_vector_size(n,r)}if(i>1&&null==l&&null==a)throw ht.cannot_infer_matrix_column(n,r);if(1===i&&null!=l&&!l.isVector){var p=l.toString();throw ht.matrix_to_vector_literal_attr(n,p,l.sourceInfo)}if(i>1&&null!=l&&l.isVector){var d=l.toString();throw ht.vector_to_matrix_literal_attr(n,d,l.sourceInfo)}null==o&&((u=new Xe(Le(l.lines))).sourceInfo=r),i>1&&null==a&&((c=new Xe(Le(l.columns))).sourceInfo=r);var h=new ae(n,new Ze(e,i),u,c,l,t);return h.sourceInfo=r,this.getToken().type===this.ruleNames.COMMA?(this.pos++,this.consumeNewLines(),[h].concat(this.parseDeclaration(e,t))):[h]}},{key:"consumeNewLines",value:function(){for(var e=this.getToken();e&&e.type===this.ruleNames.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.ruleNames.INTEGER)return this.pos++,this.getIntLiteral(e);if(e.type===this.ruleNames.ID)return this.pos++,this.parseVariable(e);if(e.type===this.ruleNames.CLOSE_BRACE)return null;throw ht.invalid_array_dimension(this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_INTEGER],e)}},{key:"getIntLiteral",value:function(e){var t=e.text,n=ut.createSourceInfo(e),r=new Xe(Le(t));return r.sourceInfo=n,r}},{key:"getRealLiteral",value:function(e){var t=ut.createSourceInfo(e),n=new et(Ge(e.text));return n.sourceInfo=t,n}},{key:"getStringLiteral",value:function(e){var t=e.text,n=ut.createSourceInfo(e),r=new rt(Oe(t));return r.sourceInfo=n,r}},{key:"getCharLiteral",value:function(e){var t=e.text,n=new nt(De(t));return n.sourceInfo=ut.createSourceInfo(e),n}},{key:"getBoolLiteral",value:function(e){var t=Fe(e.text),n=new tt(t);return n.sourceInfo=ut.createSourceInfo(e),n}},{key:"parseArrayLiteral",value:function(e){if(!this.checkOpenCurly(!0)){var t=this.getToken();throw ht.array_init_not_literal(ut.createSourceInfo(t))}var n=this.getToken();if(this.parsingArrayDimension>=2)throw ht.array_exceeds_2d(ut.createSourceInfo(n));this.pos+=1,this.parsingArrayDimension+=1,this.consumeNewLines();var r;r=this.checkOpenCurly(!0)?this.parseVectorList(e):this.parseExpressionList(),this.consumeNewLines(),this.checkCloseCurly();var i=this.getToken();this.pos+=1,this.parsingArrayDimension-=1;var o=ut.createSourceInfoFromList(n,i),a=1;r[0]instanceof it?a+=1:1==r.length&&console.log("Talvez uma variável seja uma melhor opção");var s=new Ze(e,a),u=new it(s,r);return u.sourceInfo=o,u}},{key:"parseVectorList",value:function(e){for(var t=[],n=null;;){this.checkOpenCurly();var r=this.getToken();if(this.parsingArrayDimension>=2)throw ht.array_exceeds_2d(ut.createSourceInfo(r));this.pos+=1,this.parsingArrayDimension+=1,this.consumeNewLines();var i=this.parseExpressionList();this.consumeNewLines(),this.checkCloseCurly();var o=this.getToken();this.pos+=1,this.parsingArrayDimension-=1;var a=ut.createSourceInfoFromList(r,o);if(null==n)n=i.length;else if(n!==i.length){var s=this.inputStream.substring(r.offset,o.offset+o.text.length);throw ht.invalid_matrix_literal_line(s,a)}var u=new Ze(e,1),c=new it(u,i);if(c.sourceInfo=a,t.push(c),this.getToken().type!==this.ruleNames.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=ut.createSourceInfo(e),n=new ot(e.text);return n.sourceInfo=t,n}},{key:"parseFunction",value:function(){this.pushScope(e.FUNCTION);var t=[],n=this.getToken();if(n.type!==this.ruleNames.RK_FUNCTION)return null;this.pos++;var r=this.parseType(),i=0;this.checkOpenBrace(!0)&&(this.pos++,this.checkCloseBrace(),this.pos++,i++,this.checkOpenBrace(!0)&&(this.pos++,this.checkCloseBrace(),this.pos++,i++));var o=this.getToken(),a=this.parseID();this.checkFunctionDuplicate(a,o),this.checkOpenParenthesis(),this.pos++,this.consumeNewLines(),this.checkCloseParenthesis(!0)||(t=this.parseFormalParameters(),this.consumeNewLines(),this.checkCloseParenthesis()),this.pos++,this.consumeNewLines();var s=this.parseCommandBlock(),u=r;i>0&&(u=new Ze(r,i));var c=new xe(a,u,t,s);if(null===a&&!c.isMain)throw ht.invalid_main_return(Rt.getMainFunctionName(),this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_VOID],n.line);if(c.isMain&&0!==t.length)throw ht.main_parameters();return this.popScope(),c.sourceInfo=ut.createSourceInfo(o),c}},{key:"parseFormalParameters",value:function(){for(var e=[];;){var t=0,n=!1,r=this.parseType(),i=this.getToken();i.type===this.ruleNames.RK_REFERENCE&&(n=!0,this.pos+=1,i=this.getToken());var o=this.parseID();this.checkVariableDuplicate(o,i),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 a;a=t>0?new Ze(r,t):r;var s=new Ne(a,o,n);if(s.sourceInfo=ut.createSourceInfo(i),e.push(s),this.getToken().type!==this.ruleNames.COMMA)break;this.pos++,this.consumeNewLines()}return e}},{key:"parseID",value:function(){var t=this.getToken();if(t.type!==this.ruleNames.ID)throw ht.id_missing(t);return this.pos++,this.insideScope(e.FUNCTION)&&t.text===Rt.getMainFunctionName()?null:t.text}},{key:"parseMaybeLibID",value:function(){var e=this.getToken();if(e.type!==this.ruleNames.ID)throw ht.id_missing(e);if(this.getToken(this.pos+1).type===this.ruleNames.DOT){this.pos+=2;var t=this.getToken();if(t.type!==this.ruleNames.ID)throw ht.id_missing(t);return this.pos++,"".concat(e.text,".").concat(t.text)}return this.pos++,e.text}},{key:"parseType",value:function(){var t=this.getToken();if(t.type===this.ruleNames.ID&&this.insideScope(e.FUNCTION))return ge.VOID;if(t.type===this.ruleNames.RK_VOID&&this.insideScope(e.FUNCTION))return this.pos++,ge.VOID;if(this.isVariableType(t))switch(this.pos++,t.type){case this.ruleNames.RK_INTEGER:return ge.INTEGER;case this.ruleNames.RK_BOOLEAN:return ge.BOOLEAN;case this.ruleNames.RK_REAL:return ge.REAL;case this.ruleNames.RK_STRING:return ge.STRING;case this.ruleNames.RK_CHARACTER:return ge.CHAR}throw ht.invalid_type(this.getTypeArray(),t)}},{key:"parseCommandBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[],n=[],r=!1;this.checkOpenCurly(e)&&(this.pos++,r=!0),this.consumeNewLines();for(var i=!1;;){var o=this.parseCommand();if(null===o)break;if(-1!==o)if(o instanceof Array){if(i){var a=this.getToken(this.pos-1);throw ht.invalid_var_declaration(a)}t=t.concat(o)}else i=!0,n.push(o)}return this.consumeNewLines(),r&&(this.checkCloseCurly(),this.pos++,this.consumeNewLines()),new we(t,n)}},{key:"parseCommand",value:function(){var t=this.getToken();if(this.isVariableType(t)){if(!this.insideScope(e.FUNCTION))throw ht.invalid_var_declaration(t);this.pushScope(e.BASE);var n=this.parseType();this.popScope();var r=this.parseDeclaration(n);return this.checkEOS(),this.pos++,r}if(t.type===this.ruleNames.ID)return this.parseIDCommand();if(t.type===this.ruleNames.DOT)throw ht.invalid_syntax(t.text,t.line,t.col);if(t.type===this.ruleNames.RK_RETURN)return this.parseReturn();if(t.type===this.ruleNames.RK_WHILE||t.type===this.ruleNames.RK_WHILE_ALT)return this.parseWhile();if(t.type===this.ruleNames.RK_FOR||t.type===this.ruleNames.RK_FOR_ALT)return this.parseFor();if(t.type===this.ruleNames.RK_BREAK){if(!this.insideScope(e.BREAKABLE))throw ht.invalid_break_command(this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_BREAK],t);return this.parseBreak()}return t.type===this.ruleNames.RK_SWITCH?this.parseSwitchCase():t.type===this.ruleNames.RK_DO?this.parseRepeatUntil():t.type===this.ruleNames.RK_IF?this.parseIfThenElse():this.checkEOS(!0)?(this.pos++,-1):null}},{key:"parseSwitchCase",value:function(){var t=this.getToken();this.pushScope(e.BREAKABLE),this.pos++,this.checkOpenParenthesis(),this.pos++,this.consumeNewLines();var n=this.parseExpressionOR();this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,this.consumeNewLines(),this.checkOpenCurly(),this.pos++,this.consumeNewLines();var r=this.parseCases();this.consumeNewLines(),this.checkCloseCurly(),this.pos++,this.consumeNewLines(),this.popScope();var i=new Re(n,r);return i.sourceInfo=ut.createSourceInfo(t),i}},{key:"parseRepeatUntil",value:function(){var t=this.getToken();this.pos++,this.consumeNewLines(),this.pushScope(e.BREAKABLE);var n=this.parseCommandBlock();this.consumeNewLines();var r=this.getToken();if(r.type!==this.ruleNames.RK_DO_UNTIL)throw ht.token_missing_one(this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_DO_UNTIL],r);this.pos++,this.checkOpenParenthesis(),this.pos++,this.consumeNewLines();var i=this.parseExpressionOR();this.consumeNewLines(),this.checkCloseParenthesis(),this.pos++,this.checkEOS(),this.popScope();var o=new Ee(i,n);return o.sourceInfo=ut.createSourceInfo(t),o}},{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 r=this.parseCommandBlock();if(this.getToken().type===this.ruleNames.RK_ELSE){this.pos++,this.consumeNewLines();var i=this.getToken(),o=null;if(this.checkOpenCurly(!0))o=this.parseCommandBlock();else{if(i.type!==this.ruleNames.RK_IF)throw ht.token_missing_list([this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_IF],"{"],i);o=this.parseIfThenElse()}this.popScope();var a=new be(n,r,o);return a.sourceInfo=ut.createSourceInfo(t),a}this.popScope();var s=new be(n,r,null);return s.sourceInfo=ut.createSourceInfo(t),s}},{key:"parseFor",value:function(){this.pushScope(e.BREAKABLE);var t=this.getToken();this.pos+=1;var n=this.getToken(),r=this.parseID(),i=new ot(r);i.sourceInfo=ut.createSourceInfo(n);var o=this.parseForParameters(this.ruleNames.RK_FOR_FROM),a=this.parseForParameters(this.ruleNames.RK_FOR_TO),s=this.parseForParameters(this.ruleNames.RK_FOR_PASS);this.consumeNewLines();var u=this.parseCommandBlock();this.popScope();var c=new ue(i,o,a,s,u);return c.sourceInfo=ut.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 r=this.parseCommandBlock();this.popScope();var i=new se(n,r);return i.sourceInfo=ut.createSourceInfo(t),i}},{key:"parseBreak",value:function(){var e=this.getToken();this.pos++,this.checkEOS(),this.pos++;var t=new te;return t.sourceInfo=ut.createSourceInfo(e),t}},{key:"parseReturn",value:function(){var e=this.getToken();this.pos++;var t=null;this.checkEOS(!0)||(t=this.parseExpressionOR(),this.checkEOS()),this.pos++;var n=new ne(t);return n.sourceInfo=ut.createSourceInfo(e),n}},{key:"parseIDCommand",value:function(){var e=this.getToken(),t=this.parseMaybeLibID(),n=-1===t.indexOf(".");if(this.checkOpenBrace(!0)){this.pos++;var r,i=null;this.consumeNewLines(),r=this.parseExpression(),this.consumeNewLines(),this.checkCloseBrace(),this.pos++,this.checkOpenBrace(!0)&&(this.pos++,this.consumeNewLines(),i=this.parseExpression(),this.consumeNewLines(),this.checkCloseBrace(),this.pos++);var o=this.getToken();if(o.type!==this.ruleNames.ASSIGNMENT)throw ht.token_missing_one("<-",o);this.pos++;var a=this.parseExpressionOR();this.checkEOS(),this.pos++;var s=new ie(t,r,i,a);return s.sourceInfo=ut.createSourceInfo(o),s}var u=this.getToken();if(n&&u.type===this.ruleNames.ASSIGNMENT){this.pos++;var c=this.parseExpressionOR();this.checkEOS(),this.pos++;var l=new re(t,c);return l.sourceInfo=ut.createSourceInfo(u),l}if(u.type===this.ruleNames.OPEN_PARENTHESIS){var f=this.parseFunctionCallCommand(t);return this.checkEOS(),this.pos++,f}throw n?ht.token_missing_list(["<-","("],u):ht.invalid_id_format(e)}},{key:"parseForParameters",value:function(e){if(e===this.ruleNames.RK_FOR_PASS&&this.checkOpenCurly(!0))return null;var t=this.getToken();if(t.type!==e){var n=this.ivprogLexer.getReservedKeys()[e];throw new Error("Error de sintaxe no comando repita_para: esperava-se "+n+" mas encontrou "+t.text)}this.pos+=1;var r=this.getToken(),i=!1,o=null;r.type===this.ruleNames.SUM_OP&&(i=!0,o=r.text,this.pos+=1,r=this.getToken());var a=null;if(r.type===this.ruleNames.ID?(a=new ot(this.parseID())).sourceInfo=ut.createSourceInfo(r):r.type===this.ruleNames.INTEGER&&(this.pos+=1,a=this.getIntLiteral(r)),null==a){var s=this.ivprogLexer.getReservedKeys()[e];throw new Error("Error de sintaxe no comando repeita_para: "+r.text+" não é compativel com o esperado para o paramentro "+s+". O valor deve ser um inteiro ou variável.")}return i&&(a=new st(lt(o),a)),a}},{key:"parseCases",value:function(){var e=this.getToken();if(e.type!==this.ruleNames.RK_CASE)throw ht.token_missing_one(this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_CASE],e);if(this.pos++,this.getToken().type===this.ruleNames.RK_DEFAULT){this.pos++;var t=this.getToken();if(t.type!==this.ruleNames.COLON)throw ht.token_missing_one(":",t);this.pos++,this.consumeNewLines();var n=this.parseCommandBlock(!0),r=new ke(null);return r.sourceInfo=ut.createSourceInfo(e),r.setCommands(n.commands),[r]}var i=this.parseExpressionOR(),o=this.getToken();if(o.type!==this.ruleNames.COLON)throw ht.token_missing_one(":",o);this.pos++,this.consumeNewLines();var a=this.parseCommandBlock(!0),s=new ke(i);return s.sourceInfo=ut.createSourceInfo(e),s.setCommands(a.commands),this.getToken().type===this.ruleNames.RK_CASE?[s].concat(this.parseCases()):[s]}},{key:"parseExpressionOR",value:function(){for(var e=this.parseExpressionAND();this.getToken().type===this.ruleNames.RK_LOGICAL_OR;){var t=this.getToken();this.pos++;var n=lt("or");this.consumeNewLines();var r=this.parseExpressionAND(),i=new at(n,e,r);i.sourceInfo=ut.createSourceInfo(t),e=i}return e}},{key:"parseExpressionAND",value:function(){for(var e=this.parseExpressionNot();this.getToken().type===this.ruleNames.RK_LOGICAL_AND;){var t=this.getToken();this.pos++;var n=lt("and");this.consumeNewLines();var r=this.parseExpressionNot(),i=new at(n,e,r);i.sourceInfo=ut.createSourceInfo(t),e=i}return e}},{key:"parseExpressionNot",value:function(){if(this.getToken().type===this.ruleNames.RK_LOGICAL_NOT){var e=this.getToken();this.pos++;var t=lt("not"),n=this.parseExpressionRel(),r=new st(t,n);return r.sourceInfo=ut.createSourceInfo(e),r}return this.parseExpressionRel()}},{key:"parseExpressionRel",value:function(){for(var e=this.parseExpression();this.getToken().type===this.ruleNames.RELATIONAL_OPERATOR;){var t=this.getToken();this.pos++;var n=lt(t.text),r=this.parseExpression(),i=new at(n,e,r);i.sourceInfo=ut.createSourceInfo(t),e=i}return e}},{key:"parseExpression",value:function(){for(var e=this.parseFactor();this.getToken().type===this.ruleNames.SUM_OP;){var t=this.getToken();this.pos++;var n=lt(t.text),r=this.parseFactor(),i=new at(n,e,r);i.sourceInfo=ut.createSourceInfo(t),e=i}return e}},{key:"parseFactor",value:function(){for(var e=this.parseTerm();this.getToken().type===this.ruleNames.MULTI_OP;){var t=this.getToken();this.pos++;var n=lt(t.text),r=this.parseTerm(),i=new at(n,e,r);i.sourceInfo=ut.createSourceInfo(t),e=i}return e}},{key:"parseTerm",value:function(){var e=this.getToken(),t=null,n=null;switch(e.type){case this.ruleNames.SUM_OP:return this.pos++,t=ut.createSourceInfo(e),(n=new st(lt(e.text),this.parseTerm())).sourceInfo=t,n;case this.ruleNames.INTEGER:return this.pos++,this.getIntLiteral(e);case this.ruleNames.REAL:return this.pos++,this.getRealLiteral(e);case this.ruleNames.STRING:return this.pos++,this.getStringLiteral(e);case this.ruleNames.CHARACTER:return this.pos++,this.getCharLiteral(e);case this.ruleNames.RK_TRUE:case this.ruleNames.RK_FALSE:return this.pos++,this.getBoolLiteral(e);case this.ruleNames.OPEN_CURLY:throw ht.annonymous_array_literal(e);case this.ruleNames.ID:return this.parseIDTerm();case this.ruleNames.OPEN_PARENTHESIS:return this.parseParenthesisExp();default:throw ht.invalid_terminal(e)}}},{key:"parseIDTerm",value:function(){var e=this.getToken(),t=this.parseMaybeLibID(),n=-1===t.indexOf(".");if(n&&this.checkOpenBrace(!0)){var r=null;this.pos++;var i=this.parseExpression(),o=null;this.consumeNewLines(),this.checkCloseBrace(),r=this.getToken(),this.pos++,this.checkOpenBrace(!0)&&(this.pos++,o=this.parseExpression(),this.consumeNewLines(),this.checkCloseBrace(),r=this.getToken(),this.pos++);var a=ut.createSourceInfoFromList(e,r),s=new Qe(t,i,o);return s.sourceInfo=a,s}if(this.checkOpenParenthesis(!0))return this.parseFunctionCallExpression(t);if(n){var u=ut.createSourceInfo(e),c=new ot(t);return c.sourceInfo=u,c}throw ht.invalid_id_format(e)}},{key:"getFunctionName",value:function(e){var t=Rt.getInternalName(e);return null===t?e===Rt.getMainFunctionName()?null:e:t}},{key:"parseFunctionCallExpression",value:function(e){var t=-1===e.indexOf(".")?1:3,n=this.getToken(this.pos-t),r=this.parseActualParameters(),i=this.getToken(this.pos-1),o=this.getFunctionName(e),a=ut.createSourceInfoFromList(n,i),s=new Ie(o,r);return s.sourceInfo=a,s}},{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=ut.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.ruleNames.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}(),_t=n(319),vt=n.n(_t);function yt(e){return e.times(Ae.Decimal.acos(-1)).div(180)}var gt=Date.now();function xt(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e)return n;return null}var bt,wt,Et={$mathLib:{$sin:(bt=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().mod(360),null,o=i.eq(90)?new Ae.Decimal(1):i.eq(180)?new Ae.Decimal(0):i.eq(270)?new Ae.Decimal(-1):Ae.Decimal.sin(yt(i)),a=new We(ge.REAL,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),wt=new we([],[new Te(bt)]),new xe("$sin",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],wt)),$cos:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().mod(360),o=null,i.eq(90)?o=new Ae.Decimal(0):i.eq(180)?o=new Ae.Decimal(-1):i.eq(270)&&(o=new Ae.Decimal(0)),o=Ae.Decimal.cos(yt(i)),a=new We(ge.REAL,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$cos",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$tan:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.applyStore("x"),!(i=r.get().mod(360)).eq(90)&&!i.eq(270)){e.next=4;break}throw Ye.undefined_tanget_value(r.get().toNumber(),this.function_call_stack.pop());case 4:return o=Ae.Decimal.tan(yt(i)),a=new We(ge.REAL,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$tan",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$sqrt:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.applyStore("x")).get().isNeg()){e.next=3;break}return e.abrupt("return",Promise.reject(Ye.negative_sqrt_value(this.function_call_stack.pop())));case 3:return i=r.get().sqrt(),o=new We(ge.REAL,i),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$sqrt",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$pow:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=t.applyStore("y"),o=r.get().pow(i.get()),a=new We(ge.REAL,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$pow",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1),new Ne(new le([ge.INTEGER,ge.REAL]),"y",!1)],t)}(),$log:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.applyStore("x")).get().isNegative()){e.next=3;break}return e.abrupt("return",Promise.reject(Ye.negative_log_value(this.function_call_stack.pop())));case 3:return i=Ae.Decimal.log10(r.get()),o=new We(ge.REAL,i),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$log",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$abs:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().abs(),o=new We(r.type,i),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$abs",new le([ge.INTEGER,ge.REAL]),[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$negate:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().negated(),o=new We(r.type,i),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$negate",new le([ge.INTEGER,ge.REAL]),[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$invert:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=Ge(1).dividedBy(r.get()),o=new We(ge.REAL,i),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$invert",ge.REAL,[new Ne(new le([ge.INTEGER,ge.REAL]),"x",!1)],t)}(),$max:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().map((function(e){return e.get()})),o=Ae.Decimal.max.apply(Ae.Decimal,vt()(i)),a=new We(r.type.innerType,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new Ze(new le([ge.INTEGER,ge.REAL]),1),n=new we([],[new Te(e)]);return new xe("$max",new le([ge.INTEGER,ge.REAL]),[new Ne(t,"x",!1)],n)}(),$min:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().map((function(e){return e.get()})),o=Ae.Decimal.min.apply(Ae.Decimal,vt()(i)),a=new We(r.type.innerType,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new Ze(new le([ge.INTEGER,ge.REAL]),1),n=new we([],[new Te(e)]);return new xe("$min",new le([ge.INTEGER,ge.REAL]),[new Ne(t,"x",!1)],n)}(),$rand:function(){var e=2147483647,t=function(){var t=X()(Q().mark((function t(n,r){var i,o;return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=(gt=(16807*gt+12345)%e)/(e-1),o=new We(ge.REAL,new Ae.Decimal(i)),n.insertStore("$",o),n.mode=Se.RETURN,t.abrupt("return",n);case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),n=new we([],[new Te(t)]);return new xe("$rand",ge.REAL,[],n)}()},$ioLib:{$read:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,l,f;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.input.requestInput();case 2:if(r=e.sent,i=t.applyStore("p1").type,o=null,a=null,e.prev=6,!i.isCompatible(ge.INTEGER)){e.next=12;break}a=Le(r.trim()).trunc(),o=ge.INTEGER,e.next=33;break;case 12:if(!i.isCompatible(ge.REAL)){e.next=17;break}a=Ge(r.trim()),o=ge.REAL,e.next=33;break;case 17:if(!i.isCompatible(ge.BOOLEAN)){e.next=22;break}a=Fe(r.trim()),o=ge.BOOLEAN,e.next=33;break;case 22:if(!i.isCompatible(ge.STRING)){e.next=27;break}a=Oe(r),o=ge.STRING,e.next=33;break;case 27:if(!i.isCompatible(ge.CHAR)){e.next=32;break}a=De(r),o=ge.CHAR,e.next=33;break;case 32:throw new Error("!!!!Critical error: Unknown type in readFunction!!!!");case 33:e.next=47;break;case 35:if(e.prev=35,e.t0=e.catch(6),this.mode!=Se.ABORT){e.next=40;break}return t.mode=Se.RETURN,e.abrupt("return",t);case 40:if(s=i.stringInfo()[0],!((u=t.getStoreObject("p1")).getReferenceDimension()>0)){e.next=46;break}throw c=u.type.stringInfo()[0],l=u.getReferenceDimension(),Ye.invalid_read_type_array(r,s.type,s.dim,u.getRefObj(),c.type,l,this.function_call_stack.pop());case 46:throw Ye.invalid_read_type(r,s.type,s.dim,u.getRefObj(),this.function_call_stack.pop());case 47:return f=new We(o,a),t.updateStore("p1",f),t.mode=Se.RETURN,e.abrupt("return",t);case 51:case"end":return e.stop()}}),e,this,[[6,35]])})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$read",ge.VOID,[new Ne(ge.ALL,"p1",!0)],t)}(),$write:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=t.applyStore("p1.0"),i=r.get(),o=1;o<i;o+=1)a=t.applyStore("p1.".concat(o)),this.output.sendOutput(Me(a.get(),a.type));return t.mode=Se.RETURN,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$write",ge.VOID,[new Ne(ge.ALL,"p1",!1,!0)],t)}()},$strLib:{$substring:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a,s;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=t.applyStore("start"),o=t.applyStore("end"),a=r.get().substring(i.get(),o.get()),s=new We(ge.STRING,a),t.insertStore("$",s),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$substring",ge.STRING,[new Ne(ge.STRING,"str",!1),new Ne(ge.INTEGER,"start",!1),new Ne(ge.INTEGER,"end",!1)],t)}(),$length:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=new We(ge.INTEGER,Le(r.value.length)),t.insertStore("$",i),t.mode=Se.RETURN,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$length",ge.INTEGER,[new Ne(ge.STRING,"str",!1)],t)}(),$uppercase:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=new We(ge.STRING,r.get().toUpperCase()),t.insertStore("$",i),t.mode=Se.RETURN,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$uppercase",ge.STRING,[new Ne(ge.STRING,"str",!1)],t)}(),$lowercase:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=new We(ge.STRING,r.get().toLowerCase()),t.insertStore("$",i),t.mode=Se.RETURN,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$lowercase",ge.STRING,[new Ne(ge.STRING,"str",!1)],t)}(),$charAt:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.applyStore("str"),!((i=t.applyStore("index")).get().toNumber()<0||i.get().toNumber()>=r.get().length)){e.next=4;break}throw Ye.invalid_string_index(i.get().toNumber(),r.get(),this.function_call_stack.pop());case 4:return o=new We(ge.CHAR,r.get().charAt(i.get().toNumber())),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$charAt",ge.CHAR,[new Ne(ge.STRING,"str",!1),new Ne(ge.INTEGER,"index",!1)],t)}()},$arrayLib:{$numElements:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("vector"),i=new We(ge.INTEGER,Le(r.lines)),t.mode=Se.RETURN,t.insertStore("$",i),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$numElements",ge.INTEGER,[new Ne(new Ze(ge.ALL,1),"vector",!1)],t)}(),$matrixLines:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("matrix"),i=new We(ge.INTEGER,Le(r.lines)),t.mode=Se.RETURN,t.insertStore("$",i),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$matrixLines",ge.INTEGER,[new Ne(new Ze(ge.ALL,2),"matrix",!1)],t)}(),$matrixColumns:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("matrix"),i=new We(ge.INTEGER,Le(r.columns)),t.mode=Se.RETURN,t.insertStore("$",i),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$matrixColumns",ge.INTEGER,[new Ne(new Ze(ge.ALL,2),"matrix",!1)],t)}()},$langLib:{$isReal:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.applyStore("str"),i=mt.createParser(r.get()),o=!1;try{i.parseTerm()instanceof et&&(o=!0)}catch(e){}return a=new We(ge.BOOLEAN,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$isReal",ge.BOOLEAN,[new Ne(ge.STRING,"str",!1)],t)}(),$isInt:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.applyStore("str"),i=mt.createParser(r.get()),o=!1;try{i.parseTerm()instanceof Xe&&(o=!0)}catch(e){}return a=new We(ge.BOOLEAN,o),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$isInt",ge.BOOLEAN,[new Ne(ge.STRING,"str",!1)],t)}(),$isBool:function(){var e=new we([],[new Te((function(e,t){var n=e.applyStore("str"),r=mt.createParser(n.get()),i=!1;try{r.parseTerm()instanceof tt&&(i=!0)}catch(e){}var o=new We(ge.BOOLEAN,i);return e.insertStore("$",o),e.mode=Se.RETURN,e}))]);return new xe("$isBool",ge.BOOLEAN,[new Ne(ge.STRING,"str",!1)],e)}(),$castReal:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,l;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.applyStore("val"),i=r.get(),e.t0=r.type.ord,e.next=e.t0===ge.INTEGER.ord?5:e.t0===ge.STRING.ord?10:22;break;case 5:return i=i.toNumber(),o=new We(ge.REAL,Ge(i)),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 10:if(a=mt.createParser(i),e.prev=11,!((s=a.parseTerm())instanceof et)){e.next=18;break}return u=new We(ge.REAL,Ge(s.value)),t.insertStore("$",u),t.mode=Se.RETURN,e.abrupt("return",t);case 18:e.next=22;break;case 20:e.prev=20,e.t1=e.catch(11);case 22:throw c=ge.REAL.stringInfo(),l=c[0],Ye.invalid_type_conversion(i,l.type,l.dim);case 25:case"end":return e.stop()}}),e,null,[[11,20]])})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$castReal",ge.REAL,[new Ne(new le([ge.INTEGER,ge.STRING]),"val",!1)],t)}(),$castInt:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,l,f;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.applyStore("val"),i=r.get(),e.t0=r.type.ord,e.next=e.t0===ge.REAL.ord?5:e.t0===ge.CHAR.ord?10:e.t0===ge.STRING.ord?14:26;break;case 5:return i=i.toNumber(),o=new We(ge.INTEGER,Le(Math.floor(i))),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 10:return a=new We(ge.INTEGER,Le(i.charCodeAt(0))),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 14:if(s=mt.createParser(i),e.prev=15,!((u=s.parseTerm())instanceof Xe)){e.next=22;break}return c=new We(ge.INTEGER,Le(u.value)),t.insertStore("$",c),t.mode=Se.RETURN,e.abrupt("return",t);case 22:e.next=26;break;case 24:e.prev=24,e.t1=e.catch(15);case 26:throw l=ge.INTEGER.stringInfo(),f=l[0],Ye.invalid_type_conversion(i,f.type,f.dim);case 29:case"end":return e.stop()}}),e,null,[[15,24]])})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$castInt",ge.INTEGER,[new Ne(new le([ge.REAL,ge.STRING,ge.CHAR]),"val",!1)],t)}(),$castBool:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.applyStore("str"),i=r.get(),o=mt.createParser(i),e.prev=3,!((a=o.parseTerm())instanceof tt)){e.next=10;break}return s=new We(ge.BOOLEAN,a.value),t.insertStore("$",s),t.mode=Se.RETURN,e.abrupt("return",t);case 10:e.next=14;break;case 12:e.prev=12,e.t0=e.catch(3);case 14:throw u=ge.BOOLEAN.stringInfo(),c=u[0],Ye.invalid_type_conversion(i,c.type,c.dim);case 17:case"end":return e.stop()}}),e,null,[[3,12]])})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$castBool",ge.BOOLEAN,[new Ne(ge.STRING,"str",!1)],t)}(),$castString:function(){var e=function(){var e=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=Me(r.get(),r.type),o=new We(ge.STRING,i),t.insertStore("$",o),t.mode=Se.RETURN,e.abrupt("return",t);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),t=new we([],[new Te(e)]);return new xe("$castString",ge.STRING,[new Ne(ge.ALL,"str",!1)],t)}(),$castChar:function(){var e=new we([],[new Te((function(e,t){var n=255&e.applyStore("charCode").get().toNumber(),r=String.fromCharCode(n),i=new We(ge.CHAR,r);return e.insertStore("$",i),e.mode=Se.RETURN,e}))]);return new xe("$castChar",ge.CHAR,[new Ne(ge.INTEGER,"charCode",!1)],e)}()}},$t=function(){for(var e={},t=0;t<arguments.length;t++){var n=t<0||arguments.length<=t?void 0:arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}(Et.$ioLib,Et.$langLib,Et.$strLib,Et.$arrayLib),Rt=Object.freeze({getMainFunctionName:function(){return W.getCurrentLangFuncs().main_function},getInternalName:function(e){if(-1!==e.indexOf(".")){var t=e.split("."),n=xt(t[0],W.getCurrentLangLibs()),r=xt(t[1],W.getCurrentLangFuncs());return null===n||null===r?null:n+"."+r}var i=xt(e,W.getCurrentLangFuncs());return null!==i&&$t[i]?i:null},getFunction:function(e){if(-1!==e.indexOf(".")){var t=e.split("."),n=t[0],r=t[1];return Et[n][r]}return $t[e]},getLocalName:function(e){if(-1!==e.indexOf(".")){var t=e.split("."),n=W.getCurrentLangLibs()[t[0]],r=W.getCurrentLangFuncs()[t[1]];return"".concat(n,".").concat(r)}return W.getCurrentLangFuncs()[e]?W.getCurrentLangFuncs()[e]:e}});var kt=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i()(this,o),r.call(this,e,t,n)}return a()(o,[{key:"translateType",value:function(e,t){var n=this.getUI("type_".concat(e));return 0===t?n:t>1?this.getUI("matrix_info_string",[n]):this.getUI("vector_info_string",[n])}},{key:"translateOp",value:function(e){switch(e.ord){case ct.AND.ord:case ct.OR.ord:case ct.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?Rt.getLocalName(e):Rt.getLocalName("".concat(t,".").concat(e))}}]),o}(d.LocalizedStrings),Tt=Object.freeze(new kt(W,k)),Nt=new kt(W,k);function It(){return Nt}var St=d.StringTypes,At=Object.freeze({i18n:function(e){var t=e.split(":"),n=t[0].toLowerCase(),r=t[1];return St.ERROR===n?Tt.getError(r):St.MESSAGE===n?Tt.getMessage(r):St.UI===n?Tt.getUI(r):(console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> "+e),Tt.getString(e,n))}});function Ct(e,t){if(0==e.length)return t.length;if(0==t.length)return e.length;var n,r,i=[];for(n=0;n<=t.length;n++)i[n]=[n];for(r=0;r<=e.length;r++)i[0][r]=r;for(n=1;n<=t.length;n++)for(r=1;r<=e.length;r++)t.charCodeAt(n-1)==e.charCodeAt(r-1)?i[n][r]=i[n-1][r-1]:i[n][r]=Math.min(i[n-1][r-1]+1,Math.min(i[n][r-1]+1,i[n-1][r]+1));return i[t.length][e.length]}var Lt=null;function Ot(e){e.preventDefault();var t=e.currentTarget.dataset.page;null!=Lt&&Lt.close(),(Lt=window.open("","DetailWindow","width=550,height=600")).document.open(),Lt.document.write(t),Lt.document.close()}function Dt(e){return Gt.apply(this,arguments)}function Gt(){return(Gt=X()(Q().mark((function e(t){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){return setTimeout(e,t)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ft(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mt(){var e=document.querySelector("#folder"),t=["submissionid","file","filesize","timestamp","humandate","grade","userid","exerciseid"];function n(e){return window.program_obj.functions=JSON.parse(e).functions,window.program_obj.globals=JSON.parse(e).globals,window.ivprogCore.generateCode()}function r(e,t){if(!t)return e;var n=t.exerciseid,r=t.userid,i=null;return e.has(n)?i=e.get(n):(i=new Map,e.set(n,i)),i.has(r)?i.get(r).push(t):i.set(r,[t]),e}e.addEventListener("change",X()(Q().mark((function i(){var o,a,s,u,c,l,f,p,d,h,m,_;return Q().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return m=function(e){return["TES","DES","grade","D/T","timestamp"].reduce((function(t,n){return t+"".concat(e,"_").concat(n,",")}),"")},h=function(e,t){var n=document.createElement("a");n.setAttribute("href","data:text/plain,"+encodeURIComponent(t)),n.setAttribute("download",e),n.innerHTML=e,n.classList.add("ui","primary","button"),document.querySelector("#downloads").appendChild(n)},o=Array.from(e.files),a=o.find((function(e){return"index.csv"==e.name})),s=a.webkitRelativePath.replace(a.name,""),i.next=7,a.text();case 7:u=i.sent,c=u.split("\n").slice(1).filter((function(e){return e.length>0})).map((function(e){return e.split(",")})).map((function(e){var n={};return e.forEach((function(e,r){return n[t[r]]=e})),n})),l=c.reduce(r,new Map),f=function(){var e=X()(Q().mark((function e(t){var n,r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(s).concat(t.file),r=o.find((function(e){return e.webkitRelativePath==n})),e.next=4,r.text();case 4:return i=e.sent,e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),p={},d=0,l.forEach((function(e,t){var r=[];e.forEach(function(){var e=X()(Q().mark((function e(i,o){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=i.sort((function(e,t){return parseInt(e.timestamp)-parseInt(t.timestamp)})),d++,i.forEach(function(){var e=X()(Q().mark((function e(i,a,s){var u,c,l,p,h,m,_,v,y,g;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(d++,(u={}).grade=Math.max(0,parseFloat(i.grade)),u.timestamp=parseInt(i.timestamp),u.student_id=o,u.TES=0,u.DES=0,u["D/T"]=0,c="",!(a>0)){e.next=19;break}return u.TES=parseInt(i.timestamp)-parseInt(s[a-1].timestamp),e.next=13,f(s[a-1]);case 13:if(l=e.sent,1!=(p=window.ivprogCore.prepareActivityToStudentHelper(l).getOrElse(1))){e.next=18;break}return console.error("A submission from ".concat(o," to ").concat(t," is invalid")),e.abrupt("return");case 18:c=n(p.algorithmInIlm);case 19:return e.next=21,f(i);case 21:if(h=e.sent,2!=(m=window.ivprogCore.prepareActivityToStudentHelper(h).getOrElse(2))){e.next=26;break}return console.error("A submission from ".concat(o," to ").concat(t," is invalid")),e.abrupt("return");case 26:_=n(m.algorithmInIlm),""===c&&(v=JSON.parse(h.split("::logs::")[1]),null==(y=v[0])?u.TES=0:4===y.length?u.TES=parseInt(i.timestamp)-Math.floor(parseInt(y[2])/1e3):u.TES=parseInt(i.timestamp)-Math.floor(parseInt(y[1])/1e3)),u.DES=window.ivprogCore.levenshteinDistance(c,_),g=0===u.TES?0:u.DES/u.TES,u["D/T"]=isNaN(g)?0:g,r.push(u),d--;case 33:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),d--;case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),p[t]=r})),_=setInterval((function(){if(0==d)for(var e in clearInterval(_),p){var t="",n="student_id,";n+=m(e);var r,i=Ft(p[e]);try{for(i.s();!(r=i.n()).done;){var o=r.value;t+="".concat(o.student_id,","),t+="".concat(o.TES,","),t+="".concat(o.DES,","),t+="".concat(o.grade,","),t+="".concat(o["D/T"],","),t+="".concat(o.timestamp),t+="\n"}}catch(e){i.e(e)}finally{i.f()}h("".concat(e,".csv"),"".concat(n,"\n").concat(t))}}),1e3);case 15:case"end":return i.stop()}}),i)}))))}var Bt="var",Ut="const",Kt="relational",zt="logic",Vt="arithmetic";function qt(e,t){switch(e){case Vt:case Kt:return t.value;case zt:return 11===t.ord?"and":12===t.ord?"or":"not"}}function jt(e){switch(e.ord){case 0:case 1:case 2:case 3:case 4:return Vt;case 5:case 6:case 7:case 8:case 9:case 10:return Kt;default:return zt}}function Ht(e){var t=e.commands.map(Wt),n=e.isDefault?null:en(e.expression);return{type:"switchcase",line:e.sourceInfo.line,expression:n,commands:t}}function Yt(e){var t=en(e.condition),n=e.ifTrue.commands.map(Wt),r=[];return e.ifFalse&&(r=e.ifFalse instanceof we?e.ifFalse.commands.map(Wt):[Yt(e.ifFalse)]),{type:"iftrue",expression:t,ifTrue:n,ifFalse:r}}function Wt(e){var t,n,r,i,o,a=null;if(e instanceof Ie)a=function(e){var t=e.id;-1!==t.indexOf(".")&&(t=t.split(".")[1]);var n=e.actualParameters.map(en);if("$write"===t){var r=n[n.length-1][0],i=r.value&&null!==r.value.match(/^\n$/);return{type:"writer",newLine:i,content:i?n.slice(0,n.length-1):n}}return"$read"===t?{type:"reader",variable:n[0]}:{type:"functioncall",parameters_list:n,name:e.id}}(e);else if(e instanceof re)a=function(e){var t=null;if(e instanceof ie){var n=en(e.line),r="vector",i=null;e.column&&(r="matrix",i=en(e.column)),t=[{instance:"expression",type:Bt,class:r,column:i,line:n,value:e.id}]}else t=[{instance:"expression",type:Bt,value:e.id}];return{type:"attribution",variable:t,expression:en(e.expression)}}(e);else if(e instanceof be)a=Yt(e);else if(e instanceof se)i=en((r=e).expression),o=r.commands.map(Wt),a={type:r.testFirst?"whiletrue":"dowhiletrue",expression:i,commands:o};else if(e instanceof te)a={type:"break"};else if(e instanceof ne)a={type:"return",expression:en(e.expression)};else if(e instanceof Re)a={type:"switch",expression:en((n=e).expression),cases:n.cases.map(Ht)};else{if(!(e instanceof ue))throw new Error("not implemented");a={type:"repeatNtimes",var_attribution:en((t=e).for_id),var_initial:en(t.for_from),condition:en(t.for_to),step_expression:t.for_pass?en(t.for_pass):[],commands:t.commands.map(Wt)}}return a.line=e.sourceInfo.line,a}function Zt(e){var t={name:e.name,line:e.sourceInfo.line,return_type:"",return_dimensions:0,parameters_list:[],variables_list:[],commands:[]};return e.returnType instanceof Ze?(t.return_type=e.returnType.innerType.value,t.return_dimensions=e.returnType.dimensions):t.return_type=e.returnType.value,t.parameters_list=e.formalParameters.map(Qt),t.variables_list=e.variablesDeclarations.map(Jt),t.commands=e.commands.map(Wt),t}function Qt(e){var t={name:e.id,line:e.sourceInfo.line,type:"",rows:0,columns:0,dimension:0,value:0,is_const:!1,reference:e.byRef};return e.type instanceof Ze?(t.type=e.type.innerType.value,t.dimension=e.type.dimensions):t.type=e.type.value,t}function Jt(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={name:e.id,line:e.sourceInfo.line,type:"",rows:0,columns:0,dimension:0,value:0,is_const:!1};if(n.is_const=t&&e.isConst,e instanceof ae){var r=en(e.lines).pop();if(n.type=e.type.innerType.value,e.isVector){n.columns=r.value,n.dimension=1;var i=e.initial.value.map((function(e){return Xt(e)}));n.value=i}else{var o=en(e.columns).pop();n.dimension=2,n.rows=r.value,n.columns=o.value;var a=e.initial.value.map((function(e){return e.value.map((function(e){return Xt(e)}))}));n.value=a}}else n.type=e.type.value,n.value=Xt(e.initial);return n}function Xt(e){if(e instanceof st){var t=Xt(e.left);if(jt(e.op)!==Vt)throw new Error("invalid variable initial value: "+e.toString());return"".concat(e.op.value).concat(t)}if(e instanceof tt)return Pe(e.value);if(e instanceof Je){var n=e.value;return e.value.toNumber&&(n=ge.REAL.isCompatible(e.type)&&0==e.value.decimalPlaces()?Number(e.value.toFixed(2)):e.value.toNumber()),n}throw new Error("invalid variable initial value: "+e.toString())}function en(e){var t;if(e instanceof ot)t=[{instance:"expression",type:Bt,value:e.id}];else if(e instanceof Ie){var n={instance:"expression",type:"function",value:e.id},r=e.actualParameters.map((function(e){return en(e)}));n.params=r,t=[n]}else if(e instanceof st){var i=en(e.left),o=jt(e.op);t=[{instance:"operator",type:o,value:qt(o,e.op)}].concat(vt()(i))}else if(e instanceof at){var a=en(e.left),s=en(e.right),u=jt(e.op),c=qt(u,e.op);t=[].concat(vt()(a),[{instance:"operator",type:u,value:c}],vt()(s))}else if(e instanceof Qe){var l=en(e.line),f="vector",p=null;e.column&&(f="matrix",p=en(e.column)),t=[{instance:"expression",type:Bt,class:f,column:p,line:l,value:e.id}]}else if(e instanceof tt){var d=e.value;t=[{instance:"expression",class:"simple",type:Ut,value:Pe(d)}]}else{var h=e.value;e.value.toNumber&&(h=ge.REAL.isCompatible(e.type)&&0==e.value.decimalPlaces()?Number(e.value.toFixed(2)):e.value.toNumber()),t=[{instance:"expression",class:"simple",type:Ut,value:h}]}return e.parenthesis?["("].concat(vt()(t),[")"]):t}function tn(e){return en(mt.createParser(e).parseExpressionOR())}function nn(e){for(var t=mt.createParser(e,!1),n=new Map,r=[],i=0,o=Array.from(t.lexer.reset(e));i<o.length;i++){var a=o[i];if(a.type===t.ruleNames.ERROR)return null;if(a.type!==t.ruleNames.COMMENTS)a.type!==t.ruleNames.WHITESPACE&&r.push(a);else for(var s=0;s<=a.lineBreaks;s++)n.has(s+a.line)?n.get(s+a.line).push(a):n.set(s+a.line,[a])}t.fill(r);try{var u=t.parseTree();return{globals:u.global.map((function(e){return Jt(e,!0)})),functions:u.functions.map(Zt)}}catch(e){return console.error(e),null}}function rn(){var e=[[],[]];return e[ge.INTEGER.ord][ge.INTEGER.ord]=ge.INTEGER,e[ge.INTEGER.ord][ge.REAL.ord]=ge.REAL,e[ge.REAL.ord][ge.INTEGER.ord]=ge.REAL,e[ge.REAL.ord][ge.REAL.ord]=ge.REAL,e}function on(){var e=[[],[],[],[],[]];return e[ge.INTEGER.ord][ge.INTEGER.ord]=ge.BOOLEAN,e[ge.REAL.ord][ge.REAL.ord]=ge.BOOLEAN,e[ge.BOOLEAN.ord][ge.BOOLEAN.ord]=ge.BOOLEAN,e[ge.STRING.ord][ge.STRING.ord]=ge.BOOLEAN,e[ge.CHAR.ord][ge.CHAR.ord]=ge.BOOLEAN,e}function an(){var e=[[],[],[],[],[]];return e[ge.INTEGER.ord][ge.INTEGER.ord]=ge.BOOLEAN,e[ge.REAL.ord][ge.REAL.ord]=ge.BOOLEAN,e[ge.STRING.ord][ge.STRING.ord]=ge.BOOLEAN,e[ge.CHAR.ord][ge.CHAR.ord]=ge.BOOLEAN,e}function sn(){var e=[[],[],[],[]];return e[ge.BOOLEAN.ord][ge.BOOLEAN.ord]=ge.BOOLEAN,e}function un(){var e=[];return e[ge.INTEGER.ord]=ge.INTEGER,e[ge.REAL.ord]=ge.REAL,e}var cn,ln,fn=((ln=new WeakMap).set(ct.ADD,((cn=[[],[],[],[],[]])[ge.INTEGER.ord][ge.INTEGER.ord]=ge.INTEGER,cn[ge.INTEGER.ord][ge.REAL.ord]=ge.REAL,cn[ge.INTEGER.ord][ge.STRING.ord]=ge.STRING,cn[ge.REAL.ord][ge.INTEGER.ord]=ge.REAL,cn[ge.REAL.ord][ge.REAL.ord]=ge.REAL,cn[ge.REAL.ord][ge.STRING.ord]=ge.STRING,cn[ge.STRING.ord][ge.INTEGER.ord]=ge.STRING,cn[ge.STRING.ord][ge.REAL.ord]=ge.STRING,cn[ge.STRING.ord][ge.STRING.ord]=ge.STRING,cn[ge.STRING.ord][ge.BOOLEAN.ord]=ge.STRING,cn[ge.STRING.ord][ge.CHAR.ord]=ge.STRING,cn[ge.CHAR.ord][ge.CHAR.ord]=ge.STRING,cn[ge.CHAR.ord][ge.STRING.ord]=ge.STRING,cn)),ln.set(ct.SUB,rn()),ln.set(ct.MULT,rn()),ln.set(ct.DIV,rn()),ln.set(ct.EQ,on()),ln.set(ct.NEQ,on()),ln.set(ct.GE,an()),ln.set(ct.GT,an()),ln.set(ct.LE,an()),ln.set(ct.LT,an()),ln.set(ct.OR,sn()),ln.set(ct.AND,sn()),ln.set(ct.MOD,function(){var e=[[]];return e[ge.INTEGER.ord][ge.INTEGER.ord]=ge.INTEGER,e}()),ln),pn=function(){var e,t=new WeakMap;return t.set(ct.ADD,un()),t.set(ct.SUB,un()),t.set(ct.NOT,((e=[])[ge.BOOLEAN.ord]=ge.BOOLEAN,e)),t}();function dn(e,t,n){try{if(t instanceof le&&n instanceof le){for(var r=[],i=0;i<t.types.length;++i)for(var o=t.types[i];0<n.types.length;++i){var a=n.types[0];r.push(dn(e,o,a))}return(r=r.filter((function(e){return!e.isCompatible(ge.UNDEFINED)}))).length<=0?l.enable_type_casting&&(t.isCompatible(ge.INTEGER)||t.isCompatible(ge.REAL))&&(n.isCompatible(ge.INTEGER)||n.isCompatible(ge.REAL))?new le([ge.INTEGER,ge.REAL]):ge.UNDEFINED:new le(r)}if(t instanceof le)return t.isCompatible(n)?dn(e,n,n):l.enable_type_casting&&(t.isCompatible(ge.INTEGER)||t.isCompatible(ge.REAL))&&(n.isCompatible(ge.INTEGER)||n.isCompatible(ge.REAL))?n:ge.UNDEFINED;if(n instanceof le)return n.isCompatible(t)?dn(e,t,t):l.enable_type_casting&&(t.isCompatible(ge.INTEGER)||t.isCompatible(ge.REAL))&&(n.isCompatible(ge.INTEGER)||n.isCompatible(ge.REAL))?t:ge.UNDEFINED;var s=(fn.get(e)||[])[t.ord][n.ord];if(null==s){if(l.enable_type_casting&&(t.isCompatible(ge.INTEGER)||t.isCompatible(ge.REAL))&&(n.isCompatible(ge.INTEGER)||n.isCompatible(ge.REAL))){if(e===ct.MOD)return ge.INTEGER;if(e.ord>=5&&e.ord<=10)return ge.BOOLEAN}return ge.UNDEFINED}return s}catch(e){if(e instanceof TypeError)return ge.UNDEFINED;throw e}}function hn(e,t){try{if(t instanceof le){for(var n=[],r=0;r<t.types.length;++r){var i=t.types[r];n.push(hn(e,i))}return(n=n.filter((function(e){return!e.isCompatible(ge.UNDEFINED)}))).length<=0?ge.UNDEFINED:new le(n)}var o=(pn.get(e)||[])[t.ord];return null==o?ge.UNDEFINED:o}catch(e){if(e instanceof TypeError)return ge.UNDEFINED;throw e}}var mn=function e(t,n){i()(this,e),u()(this,"id",void 0),u()(this,"value",void 0),this.id=t,this.value=n},_n=new(function(){function e(){i()(this,e),u()(this,"data",void 0),u()(this,"address_id",void 0),this.data=[],this.address_id=0}return a()(e,[{key:"allocate",value:function(e){var t=this.address_id,n=new mn(t,e);return this.data.push(n),this.address_id+=1,t}},{key:"deallocate",value:function(e){var t=this.findIndex(e);return-1!==t&&(this.data.splice(t,1),!0)}},{key:"find",value:function(e){for(var t=0,n=this.data.length;t<n;){var r=Math.floor((t+n)/2),i=this.getAddressAt(r);if(i.id===e)return i;e>i.id?t=r:n=r}}},{key:"getAddressAt",value:function(e){return this.data[e]}},{key:"findIndex",value:function(e){for(var t=0,n=this.data.length;t<n;){var r=Math.floor((t+n)/2),i=this.getAddressAt(r);if(i.id===e)return r;e>i.id?t=r:n=r}return-1}},{key:"updateAddress",value:function(e,t){var n=this.findIndex(e);if(-1===n)throw new Error("Invalid address..."+e);this.data[n].value=t}},{key:"clear",value:function(){for(var e=0;e<this.data.length;e+=1)delete this.data[e];this.data=[],this.address_id=0}}]),e}()),vn=Object.freeze({allocate:_n.allocate.bind(_n),deallocate:_n.deallocate.bind(_n),find:_n.find.bind(_n),updateAddress:_n.updateAddress.bind(_n),clear:_n.clear.bind(_n),size:function(){return _n.data.length}}),yn=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];i()(this,e),u()(this,"_type",void 0),u()(this,"_loc_address",void 0),u()(this,"_readOnly",void 0),u()(this,"_id",void 0),this._loc_address=n,this._type=t,this._readOnly=r,this._id=void 0}return a()(e,[{key:"setID",value:function(e){this._id=e}},{key:"isCompatible",value:function(e){return this.type.isCompatible(e.type)}},{key:"destroy",value:function(){return vn.deallocate(this._loc_address)}},{key:"id",get:function(){return this._id}},{key:"inStore",get:function(){return null!==this.id}},{key:"type",get:function(){return this._type}},{key:"value",get:function(){var e=vn.find(this._loc_address);if(null!=e)return e.value;throw new Error("!!!Critical Error: variable "+this.id+" does not have a valid address. Loc-Address "+this.locAddress)}},{key:"number",get:function(){throw new Error("DOT NOT USE THIS PROPERTY!")}},{key:"readOnly",get:function(){return this._readOnly},set:function(e){this._readOnly=e}},{key:"locAddress",get:function(){return this._loc_address}}]),e}();var gn=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),t=r.call(this,e.type,e.getRefAddress(),!1),u()(Ue()(t),"refObj",void 0),u()(Ue()(t),"reference_dimension",void 0),t.refObj=e.id,t.reference_dimension=e.getReferenceDimension(),t}return a()(o,[{key:"getRefObj",value:function(){return this.refObj}},{key:"getReferenceDimension",value:function(){return this.reference_dimension}},{key:"destroy",value:function(){return!1}},{key:"isRef",get:function(){return!0}}]),o}(yn);var xn=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n,a,s){var u,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return i()(this,o),(u=r.call(this,e,t,s,c)).line=n,u.column=a,u}return o}(We),bn=function(){function e(t,n,r,o,a){var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];i()(this,e),u()(this,"type",void 0),u()(this,"id",void 0),u()(this,"isConst",void 0),u()(this,"lines",void 0),u()(this,"columns",void 0),u()(this,"values",void 0),this.type=t,this.id=a,this.isConst=s,this.values=n,this.lines=r,this.columns=o}return a()(e,[{key:"get",value:function(){return this.values}},{key:"getAt",value:function(t,n){if(console.log("Column ",n),this.isVector()){if(null!=n)throw new Error(this.id+" is not a matrix!");n=t,t=0}else if(null==n){for(var r=[],i=0;i<this.columns;i+=1){var o=t*this.lines+i;r.push(this.values[o])}var a=this.type;return new e(new Ze(a.innerType,a.dimensions-1),r,this.columns,0,this.id,this.isConst)}var s=t*this.lines+n;return console.log("Get at: ",s),this.values[s]}},{key:"setAt",value:function(t,n,r){var i=1;null!=r&&(i+=1);var o=n,a=r;if(!this.type.canAccept(t.type,i))throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array "+this.id);if(this.isVector()){if(null!=r)throw new Error(this.id+" is not a matrix!");a=o,o=0}else if(null==r){if(!(t instanceof e))throw new Error("Attempting to insert a single value as a line of matrix "+this.id);for(var s=t.get(),u=0;u<this.columns;u+=1){var c=o*this.columns+u,l=s[u];this.values[c]=new xn(t.type,l.get(),o,u,this.id,this.isConst)}}var f=o*(null==this.columns?0:this.columns)+a;this.values[f]=new xn(t.type,t.get(),n,r,this.id,this.isConst)}},{key:"inStore",value:function(){return null!=this.id}},{key:"isVector",value:function(){return 1==this.type.dimensions}}]),e}(),wn=n(525),En=n.n(wn);var $n=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n,a){var s,u=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return i()(this,o),(s=r.call(this,e,-1,u))._lines=t,s._columns=n,s.loc_addresses=a,s}return a()(o,[{key:"isCompatible",value:function(e){if(e instanceof bn){var t=null==e.columns?0:e.columns;if(this.lines===e.lines&&this.columns===t)return En()(g()(o.prototype),"isCompatible",this).call(this,e)}return!1}},{key:"destroy",value:function(){for(var e=!0,t=0;t<this.addresses.length;t+=1)e=e&&vn.deallocate(this.addresses[t]);return e}},{key:"getAt",value:function(e,t){if(this.isVector){if(null!=t)throw new Error(this.id+" is not a matrix!");t=e,e=0}else if(null==t){for(var n=[],r=0;r<this.columns;r+=1){var i=this.getIndexOf(e,r),o=vn.find(this.addresses[i]);n.push(o.value)}return n}var a=this.getIndexOf(e,t);return vn.find(this.addresses[a]).value}},{key:"setAt",value:function(e,t,n){var r=1;if(null!=n&&(r+=1),!this.type.canAccept(e.type,r))throw new Error("!!!Internal Error: Attempting to insert an invalid value inside array "+this.id);if(this.isVector){if(null!=n)throw new Error(this.id+" is not a matrix!");n=t,t=0}else if(null==n)throw new Error("!!!Internal Error: Attempting to insert a line into matrix "+this.id);var i=this.getIndexOf(t,n);vn.updateAddress(this.addresses[i],e.get())}},{key:"getIndexOf",value:function(e,t){return e*this.columns+t}},{key:"getLocAddressOf",value:function(e,t){if(this.isVector){if(null!=t)throw new Error(this.id+" is not a matrix!");t=e,e=0}else if(null==t){for(var n=[],r=0;r<this.columns;r+=1){var i=this.getIndexOf(e,r);n.push(this.addresses[i])}return n}var o=this.getIndexOf(e,t);return this.addresses[o]}},{key:"lines",get:function(){return this._lines}},{key:"columns",get:function(){return this._columns}},{key:"isVector",get:function(){return 1===this.type.dimensions}},{key:"value",get:function(){for(var e=[],t=0;t<this.addresses.length;t+=1){var n=vn.find(this.addresses[t]);if(null==n)throw new Error("!!!Critical Error: variable "+this.id+" does not have a valid address. Loc-Address "+this.locAddress);e.push(n.value)}return e}},{key:"locAddress",get:function(){throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray")}},{key:"addresses",get:function(){return this.loc_addresses}}]),o}(yn),Rn=function(){function e(t,n,r,o){i()(this,e),this.type=t,this.value=n,this.loc_address=r,this.id=o,u()(this,"isConst",!1),u()(this,"reference_dimesion",0)}return a()(e,[{key:"get",value:function(){return this.value}},{key:"getRefAddress",value:function(){return this.loc_address}},{key:"inStore",value:function(){return null!=this.id}},{key:"getReferenceDimension",value:function(){return this.reference_dimesion}},{key:"setReferenceDimension",value:function(e){this.reference_dimesion=e}}]),e}(),kn=function(){function e(t,n,r,o,a,s){i()(this,e),this.type=t,this.values=n,this.addresses=r,this.lines=o,this.columns=a,this.id=s,u()(this,"isConst",!1)}return a()(e,[{key:"get",value:function(){return this.values}},{key:"getAddresses",value:function(){return this.addresses}},{key:"inStore",value:function(){return null!=this.id}}]),e}();var Tn=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e,t,n){var a;return i()(this,o),a=r.call(this,e.type,t,n,e.getAddresses(),!1),u()(Ue()(a),"refObj",void 0),a.refObj=e.id,a}return a()(o,[{key:"getRefObj",value:function(){return this.refObj}},{key:"destroy",value:function(){return!1}},{key:"isRef",get:function(){return!0}}]),o}($n),Nn=function(){function e(t){i()(this,e),this.name=t,u()(this,"store",void 0),u()(this,"nextStore",void 0),u()(this,"mode",void 0),this.store=new Map,this.mode=Se.RUN}return a()(e,null,[{key:"canImplicitTypeCast",value:function(e,t){return!(!e.isCompatible(ge.INTEGER)&&!e.isCompatible(ge.REAL)||!t.isCompatible(ge.INTEGER)&&!t.isCompatible(ge.REAL))}},{key:"doImplicitCasting",value:function(t,n){if(!e.canImplicitTypeCast(t,n.type))throw new Error("!!!Critical error: attempted to type cast invalid types");return t.isCompatible(ge.INTEGER)?new We(ge.INTEGER,n.get().trunc()):new We(ge.REAL,n.get())}}]),a()(e,[{key:"extendStore",value:function(e){this.nextStore=e}},{key:"applyStore",value:function(e){if(!this.store.has(e)){if(null!=this.nextStore)return this.nextStore.applyStore(e);throw new Error("Variable ".concat(e," not found."))}var t=this.store.get(e),n=null;if(t.type instanceof Ze){var r=t,i=r.type,o=0,a=0,s=r.value.map((function(e){return r.isVector?new xn(i.innerType,e,o++,void 0,r.id,r.readOnly):(a>=r.columns&&(a=0,o+=1),new xn(i.innerType,e,o,a++,r.id,r.readOnly))}));n=new bn(i,s,r.lines,r.columns,t.id,t.readOnly)}else n=new We(t.type,t.value,t.id,t.readOnly);return n}},{key:"updateStore",value:function(e,t){if(this.store.has(e)){var n=this.store.get(e);if(n.readOnly)throw new Error("Cannot change value of a read only variable: "+e);if(n instanceof $n){var r=t;if(n.isCompatible(r)){if(n.isVector)r.get().forEach((function(e,t){n.setAt(e,t,void 0)}));else{var i=0,o=0;r.get().forEach((function(e){n.setAt(e,i,o),(o+=1)>=n.columns&&(i+=1,o=0)}))}return this}}else if(n.isCompatible(t)){var a=n.locAddress;return vn.updateAddress(a,t.get()),this}var s=n.type,u=t.type;throw new Error("".concat(s.value," is not compatible with type ").concat(u.value," given"))}if(null!=this.nextStore)return this.nextStore.updateStore(e,t),this;throw new Error("Variable ".concat(e," not found."))}},{key:"updateStoreArray",value:function(e,t,n,r){if(this.store.has(e)){var i=this.store.get(e);if(i.readOnly)throw new Error("Cannot change value of a read only variable: "+e);if(!(i instanceof $n))throw new Error("Cannot update a non-array variable using updateStoreArray");if(t instanceof bn){var o=t.get();if(i.isVector&&t.isVector())for(var a=0;a<t.lines;a+=1){var s=o[a];i.setAt(s,a,void 0)}else{if(i.isVector||null!=r||!t.isVector())throw new Error("Attempting to assign an invalid value to array ".concat(e));for(var u=0;u<i.columns;u+=1){var c=o[u];i.setAt(c,n,u)}}}else{if(!i.isVector&&null==r)throw new Error("Attempting to assign an invalid value to array ".concat(e));i.setAt(t,n,r)}return this}if(null!=this.nextStore)return this.nextStore.updateStoreArray(e,t,n,r),this;throw new Error("Variable ".concat(e," not found."))}},{key:"insertStore",value:function(e,t){if(this.store.has(e))throw new Error("".concat(e," is already defined"));var n;if(t instanceof Rn)n=new gn(t);else if(t instanceof kn)n=new Tn(t,t.lines,t.columns);else if(t instanceof bn){var r=t.isVector()?0:t.columns,i=[],o=t.get();if(o.length>0)for(var a=0;a<t.get().length;a+=1){var s=o[a].get();i.push(vn.allocate(s))}else{var u=t.lines;u=t.isVector()?u:u*r;for(var c=0;c<u;c+=1)i.push(vn.allocate(null))}n=new $n(t.type,t.lines,r,i,t.isConst)}else{var l=vn.allocate(t.get());n=new yn(t.type,l,t.isConst)}return n.setID(e),this.store.set(e,n),this}},{key:"getStoreObject",value:function(e){if(!this.store.has(e)){if(null!=this.nextStore)return this.nextStore.getStoreObject(e);throw new Error("Variable ".concat(e," not found."))}return this.store.get(e)}},{key:"destroy",value:function(){this.store.forEach((function(e){return e.destroy()}),this)}},{key:"isDefined",value:function(e){return!!this.store.has(e)||null!=this.nextStore&&this.nextStore.isDefined(e)}}]),e}(),In=function(){function e(t){i()(this,e),this.ast=t,this.symbolMap=null,this.currentFunction=null}return a()(e,null,[{key:"analyseFromSource",value:function(t){return new e(mt.createParser(t).parseTree()).analyseTree()}}]),a()(e,[{key:"pushMap",value:function(){if(null===this.symbolMap)this.symbolMap={map:{},next:null};else{var e={map:{},next:this.symbolMap};this.symbolMap=e}}},{key:"popMap",value:function(){null!==this.symbolMap&&(this.symbolMap=this.symbolMap.next)}},{key:"insertSymbol",value:function(e,t){this.symbolMap.map[e]=t}},{key:"findSymbol",value:function(e,t){return t.map[e]?t.map[e]:t.next?this.findSymbol(e,t.next):null}},{key:"getMainFunction",value:function(){return this.ast.functions.find((function(e){return e.isMain}))}},{key:"findFunction",value:function(e){if(e.match(/^\$.+$/)){var t=Rt.getFunction(e);if(!t)throw Ye.not_implemented(e);return t}return this.ast.functions.find((function(t){return t.name===e}))||null}},{key:"analyseTree",value:function(){var e=this.ast.global;this.pushMap(),this.assertDeclarations(e);var t=this.ast.functions;if(t.filter((function(e){return null===e.name})).length<=0)throw Ye.main_missing();for(var n=0;n<t.length;n++){var r=t[n];this.assertFunction(r)}return this.ast}},{key:"assertDeclarations",value:function(e){for(var t=0;t<e.length;t++)this.assertDeclaration(e[t])}},{key:"assertDeclaration",value:function(e){if(e instanceof ae)this.assertArrayDeclaration(e),this.insertSymbol(e.id,{id:e.id,lines:e.lines,columns:e.columns,type:e.type,isConst:e.isConst});else{if(null===e.initial)return void this.insertSymbol(e.id,{id:e.id,type:e.type,isConst:e.isConst});var t=this.evaluateExpressionType(e.initial);if(t instanceof le){if(!t.isCompatible(e.type)){var n=e.type.stringInfo()[0],r=t.stringInfo()[0],i=e.initial;throw Ye.incompatible_types_full(n.type,n.dim,r.type,r.dim,i.toString(),e.sourceInfo)}this.insertSymbol(e.id,{id:e.id,type:e.type,isConst:e.isConst})}else{if(!e.type.isCompatible(t)&&!l.enable_type_casting||!e.type.isCompatible(t)&&l.enable_type_casting&&!Nn.canImplicitTypeCast(e.type,t)){var o=e.type.stringInfo()[0],a=t.stringInfo()[0],s=e.initial;throw Ye.incompatible_types_full(o.type,o.dim,a.type,a.dim,s.toString(),e.sourceInfo)}this.insertSymbol(e.id,{id:e.id,type:e.type,isConst:e.isConst})}}}},{key:"assertArrayDeclaration",value:function(e){if(null===e.initial){if(!this.evaluateExpressionType(e.lines).isCompatible(ge.INTEGER))throw Ye.array_dimension_not_int_full(e.sourceInfo);if(null!==e.columns&&!this.evaluateExpressionType(e.columns).isCompatible(ge.INTEGER))throw Ye.array_dimension_not_int_full(e.sourceInfo)}else this.evaluateArrayLiteral(e);this.insertSymbol(e.id,{id:e.id,lines:e.lines,columns:e.columns,type:e.type})}},{key:"evaluateExpressionType",value:function(e){if(e instanceof st){var t=e.op,n=this.evaluateExpressionType(e.left),r=hn(t,n);if(ge.UNDEFINED.isCompatible(r)){var i=n.stringInfo()[0],o=e.toString();throw Ye.invalid_unary_op_full(o,t,i.type,i.dim,e.sourceInfo)}return r}if(e instanceof at){var a=e.op,s=this.evaluateExpressionType(e.left),u=this.evaluateExpressionType(e.right),c=dn(a,s,u);if(ge.UNDEFINED.isCompatible(c)){var l=s.stringInfo()[0],f=u.stringInfo()[0],p=e.toString();throw Ye.invalid_infix_op_full(p,a,l.type,l.dim,f.type,f.dim,e.sourceInfo)}return c}if(e instanceof Je)return this.evaluateLiteralType(e);if(e instanceof Ie){if(e.isMainCall)throw Ye.void_in_expression_full(Rt.getMainFunctionName(),e.sourceInfo);var d=this.findFunction(e.id);if(null===d)throw Ye.function_missing_full(e.id,e.sourceInfo);if(d.returnType.isCompatible(ge.VOID))throw Ye.void_in_expression_full(e.id,e.sourceInfo);return this.assertParameters(d,e.actualParameters),d.returnType}if(e instanceof Qe){var h=this.findSymbol(e.id,this.symbolMap);if(null===h)throw Ye.symbol_not_found_full(e.id,e.sourceInfo);if(!(h.type instanceof Ze))throw Ye.invalid_array_access_full(e.id,e.sourceInfo);if(!this.evaluateExpressionType(e.line).isCompatible(ge.INTEGER))throw Ye.array_dimension_not_int_full(e.sourceInfo);if(null!==e.column){if(null===h.columns)throw Ye.invalid_matrix_access_full(e.id,e.sourceInfo);if(!this.evaluateExpressionType(e.column).isCompatible(ge.INTEGER))throw Ye.array_dimension_not_int_full(e.sourceInfo)}var m=h.type;return null!==e.column||null===h.columns?m.innerType:new Ze(m.innerType,1)}}},{key:"evaluateLiteralType",value:function(e){if(e instanceof Xe)return e.type;if(e instanceof et)return e.type;if(e instanceof rt)return e.type;if(e instanceof tt)return e.type;if(e instanceof nt)return e.type;if(e instanceof ot){var t=this.findSymbol(e.id,this.symbolMap);if(null===t)throw Ye.symbol_not_found_full(e.id,e.sourceInfo);return t.type,t.type}var n=null;if(1===e.value.length)n=this.evaluateExpressionType(e.value[0]);else for(var r=0;r<e.value.length;r++){var i=this.evaluateExpressionType(e.value[r]);if(null===n)n=i;else if(!n.isCompatible(i)){var o=n.stringInfo()[0],a=e.toString();throw Ye.incompatible_types_array_full(a,o.type,o.dim,e.sourceInfo)}}return n instanceof Ze?new Ze(n.innerType,n.dimensions+1):new Ze(n,1)}},{key:"evaluateArrayLiteral",value:function(e){var t=e.type,n=e.initial;if(e.isVector)this.evaluateVectorLiteralType(n,t);else for(var r=0;r<n.lines;++r){var i=n.value[r];this.evaluateVectorLiteralType(i,new Ze(t.innerType,1))}return!0}},{key:"assertFunction",value:function(e){var t=this;this.pushMap(),this.currentFunction=e,e.formalParameters.forEach((function(e){e.type instanceof Ze?e.type.dimensions>1?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(ge.VOID);if(!this.assertReturn(e,n))throw Ye.function_no_return(e.name);this.popMap()}},{key:"assertReturn",value:function(e,t){var n=this;return e.commands.reduce((function(r,i){return n.checkCommand(e.returnType,i,t)||r}),t)}},{key:"checkCommand",value:function(e,t,n){if(t instanceof se){if(!this.evaluateExpressionType(t.expression).isCompatible(ge.BOOLEAN))throw Ye.loop_condition_type_full(t.expression.toString(),t.sourceInfo);return this.checkCommands(e,t.commands,n),!1}if(t instanceof ue){if(!this.evaluateExpressionType(t.for_id).isCompatible(ge.INTEGER))throw Ye.invalid_for_variable(t.for_id,t.sourceInfo);if(!this.evaluateExpressionType(t.for_from).isCompatible(ge.INTEGER))throw Ye.invalid_for_from(t.for_from,t.sourceInfo);if(!this.evaluateExpressionType(t.for_to).isCompatible(ge.INTEGER))throw Ye.invalid_for_to(t.for_to,t.sourceInfo);if(null!=t.for_pass&&!this.evaluateExpressionType(t.for_pass).isCompatible(ge.INTEGER))throw Ye.invalid_for_pass(t.for_pass,t.sourceInfo);return this.checkCommands(e,t.commands,n),!1}if(t instanceof Re){for(var r=this.evaluateExpressionType(t.expression),i=n,o=!1,a=0;a<t.cases.length;a++){var s=t.cases[a];if(null!==s.expression){var u=this.evaluateExpressionType(s.expression);if(!r.isCompatible(u)){var c=r.stringInfo()[0],f=s.expression.toString();throw Ye.invalid_case_type_full(f,c.type,c.dim,s.sourceInfo)}}else o=!0;i=i&&this.checkCommands(e,s.commands,i)}return i&&o}if(t instanceof ie){var p=0,d=this.findSymbol(t.id,this.symbolMap);if(null===d)throw Ye.symbol_not_found_full(t.id,t.sourceInfo);if(d.isConst)throw Ye.invalid_const_assignment_full(t.id,t.sourceInfo);if(!(d.type instanceof Ze))throw Ye.invalid_array_access_full(t.id,t.sourceInfo);var h=t.expression,m=t.line;if(!this.evaluateExpressionType(m).isCompatible(ge.INTEGER))throw Ye.array_dimension_not_int_full(t.sourceInfo);p+=1;var _=t.column;if(null===d.columns&&null!==_)throw Ye.invalid_matrix_access_full(t.id,t.sourceInfo);if(null!==_){if(!this.evaluateExpressionType(_).isCompatible(ge.INTEGER))throw Ye.array_dimension_not_int_full(t.sourceInfo);p+=1}var v=this.evaluateExpressionType(h),y=d.type,g=!1,x=y;if(v instanceof le?(x=y.dimensions-p==0?y.innerType:new Ze(y.innerType,Math.max(0,y.dimensions-p)),g=v.isCompatible(x)):g=y.canAccept(v,p),!g&&(0==y.dimensions-p&&(x=y.innerType),!l.enable_type_casting||!Nn.canImplicitTypeCast(x,v))){var b=y.stringInfo()[0],w=v.stringInfo()[0];throw Ye.incompatible_types_full(b.type,b.dim-p,w.type,w.dim,h.toString(),t.sourceInfo)}return n}if(t instanceof re){var E=this.findSymbol(t.id,this.symbolMap);if(null===E)throw Ye.symbol_not_found_full(t.id,t.sourceInfo);if(E.isConst)throw Ye.invalid_const_assignment_full(t.id,t.sourceInfo);var $=t.expression,R=this.evaluateExpressionType($);if(R instanceof Ze){if(!(E.type instanceof Ze))throw new Error("Cannot assign an array to a non-array variable ");if(!R.isCompatible(E.type))if(R.dimensions!==E.type.dimensions||R.innerType.isCompatible(E.type.innerType))switch(R.dimensions){case 1:throw Ye.vector_to_matrix_attr(t.id,$.toString(),t.sourceInfo);case 2:throw Ye.matrix_to_vector_attr(t.id,$.toString(),t.sourceInfo)}else if(!l.enable_type_casting||!Nn.canImplicitTypeCast(E.type.innerType,R.innerType)){var k=E.type.stringInfo()[0],T=R.stringInfo()[0];throw Ye.incompatible_types_full(k.type,k.dim,T.type,T.dim,$.toString(),t.sourceInfo)}}else if(!(R.isCompatible(E.type)||l.enable_type_casting&&Nn.canImplicitTypeCast(E.type,R))){var N=E.type.stringInfo()[0],I=R.stringInfo()[0];throw Ye.incompatible_types_full(N.type,N.dim,I.type,I.dim,$.toString(),t.sourceInfo)}return n}if(t instanceof te)return n;if(t instanceof be){if(!this.evaluateExpressionType(t.condition).isCompatible(ge.BOOLEAN))throw Ye.if_condition_type_full(t.condition.toString(),t.sourceInfo);return t.ifFalse instanceof be?this.checkCommands(e,t.ifTrue.commands,n)&&this.checkCommand(e,t.ifFalse,n):null!=t.ifFalse?this.checkCommands(e,t.ifTrue.commands,n)&&this.checkCommands(e,t.ifFalse.commands,n):this.checkCommands(e,t.ifTrue.commands,n)}if(t instanceof Ie){var S;if(null===(S=t.isMainCall?this.getMainFunction():this.findFunction(t.id)))throw Ye.function_missing_full(t.id,t.sourceInfo);return this.assertParameters(S,t.actualParameters),n}if(t instanceof ne){var A=this.currentFunction.isMain?Rt.getMainFunctionName():this.currentFunction.name;if(null!==t.expression||e.isCompatible(ge.VOID)){if(null!==t.expression){var C=this.evaluateExpressionType(t.expression);if(!(e.isCompatible(C)||l.enable_type_casting&&Nn.canImplicitTypeCast(e,C))){var L=e.stringInfo()[0];throw Ye.invalid_return_type_full(A,L.type,L.dim,t.sourceInfo)}return!0}return!0}var O=e.stringInfo()[0];throw Ye.invalid_void_return_full(A,O.type,O.dim,t.sourceInfo)}}},{key:"checkCommands",value:function(e,t,n){var r=this;return t.reduce((function(t,i){return r.checkCommand(e,i,n)||t}),n)}},{key:"assertParameters",value:function(e,t){var n=e.formalParameters;if(n.length>t.length||n.length!==t.length&&!e.hasVariadic())throw Ye.invalid_parameters_size_full(e.name,t.length,e.formalParameters.length,null);for(var r=0,i=0;r<n.length&&i<t.length;r+=1,i+=1){var o=n[r];if(o.variadic&&r+1!==n.length)throw"A function variadic parameter must be its last parameter!";if(o.variadic)i=this.assertVariadicParameter(e,o,i,t);else{var a=t[i];this.assertParameter(e,o,a)}}}},{key:"evaluateVectorLiteralType",value:function(e,t){for(var n=0;n<e.value.length;n+=1){var r=e.value[n],i=this.evaluateExpressionType(r);if(!((i instanceof le?i.isCompatible(t.innerType):t.canAccept(i,1))||l.enable_type_casting&&Nn.canImplicitTypeCast(t.innerType,i))){var o=t.stringInfo()[0],a=i.stringInfo()[0];throw Ye.incompatible_types_full(o.type,0,a.type,a.dim,r.toString(),e.sourceInfo)}}return t}},{key:"assertVariadicParameter",value:function(e,t,n,r){var i;for(i=n;i<r.length;i+=1)this.assertParameter(e,t,r[i]);return i-1}},{key:"assertParameter",value:function(e,t,n){if(t.byRef)if(n instanceof ot){if(this.findSymbol(n.id,this.symbolMap).isConst)throw Ye.invalid_const_ref_full(e.name,n.toString(),n.sourceInfo)}else if(!(n instanceof ot||n instanceof Qe))throw Ye.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo);var r=this.evaluateExpressionType(n);if(r instanceof le&&t.type instanceof le){for(var i=0,o=0;o<r.types.length;++o){var a=r.types[o];-1!==t.type.types.indexOf(a)&&(i+=1)}if(i<=0&&l.enable_type_casting&&!t.byRef&&(!r.isCompatible(ge.INTEGER)&&!r.isCompatible(ge.REAL)||t.type.isCompatible(ge.INTEGER)||t.type.isCompatible(ge.REAL)))throw Ye.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo)}else if(r instanceof le){if(!r.isCompatible(t.type)&&l.enable_type_casting&&!t.byRef&&(!r.isCompatible(ge.INTEGER)&&!r.isCompatible(ge.REAL)||t.type.isCompatible(ge.INTEGER)||t.type.isCompatible(ge.REAL)))throw Ye.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo)}else if(!t.type.isCompatible(r)&&l.enable_type_casting&&!t.byRef&&!Nn.canImplicitTypeCast(t.type,r))throw Ye.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo)}}]),e}(),Sn=Object.freeze({BASE:Symbol("context:base"),BREAKABLE:Symbol("context:breakable"),FUNCTION:Symbol("context:function")}),An=function(){function e(t){i()(this,e),this.ast=t,this.globalStore=new Nn("$global"),this.stores=[this.globalStore],this.context=[Sn.BASE],this.input=null,this.forceKill=!1,this.output=null,this.mode=Se.RUN,this.function_call_stack=[],this.instruction_count=0,this.function_call_count=0}var t,n,r,o,s,u,c,f,p,d,h,m,_,v,y,g,x,b,w,E,$,R,k,T,I,S,A,C,L,O,D;return a()(e,null,[{key:"MAIN_INTERNAL_ID",get:function(){return"$main"}}]),a()(e,[{key:"registerInput",value:function(e){null!==this.input&&(this.input=null),this.input=e}},{key:"registerOutput",value:function(e){null!==this.output&&(this.output=null),this.output=e}},{key:"checkContext",value:function(e){return this.context[this.context.length-1]===e}},{key:"ignoreSwitchCases",value:function(e){return e.mode===Se.RETURN||e.mode===Se.BREAK}},{key:"prepareState",value:function(){if(null!==this.stores){for(var e=0;e<this.stores.length;e++)delete this.stores[e];this.stores=null}null!==this.globalStore&&(this.globalStore=null),this.globalStore=new Nn("$global"),this.stores=[this.globalStore],this.context=[Sn.BASE],this.instruction_count=0,this.mode=Se.RUN}},{key:"interpretAST",value:(D=X()(Q().mark((function e(){var t;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.prepareState(),vn.clear(),e.next=4,this.initGlobal();case 4:if(null!==(t=this.findMainFunction())){e.next=7;break}throw Ye.main_missing();case 7:return e.abrupt("return",this.runFunction(t,[],this.globalStore));case 8:case"end":return e.stop()}}),e,this)}))),function(){return D.apply(this,arguments)})},{key:"initGlobal",value:(O=X()(Q().mark((function e(){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.checkContext(Sn.BASE)){e.next=2;break}return e.abrupt("return",Ye.invalid_global_var());case 2:return e.abrupt("return",this.executeCommands(this.globalStore,this.ast.global));case 3:case"end":return e.stop()}}),e,this)}))),function(){return O.apply(this,arguments)})},{key:"findMainFunction",value:function(){return this.ast.functions.find((function(e){return e.isMain}))}},{key:"findFunction",value:function(t){if(t.match(/^\$.+$/)){if(t===e.MAIN_INTERNAL_ID)return this.findMainFunction();var n=Rt.getFunction(t);if(!n)throw Ye.not_implemented(t);return n}var r=this.ast.functions.find((function(e){return e.name===t}));if(!r)throw Ye.function_missing(t);return r}},{key:"runFunction",value:(L=X()(Q().mark((function t(n,r,i){var o,a,s,u;return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.isMain?e.MAIN_INTERNAL_ID:n.name,(a=new Nn(o)).extendStore(this.globalStore),t.next=5,this.associateParameters(n.formalParameters,r,i,a);case 5:return this.context.push(Sn.FUNCTION),this.stores.push(a),t.next=9,this.executeCommands(a,n.variablesDeclarations);case 9:return s=t.sent,t.next=12,this.executeCommands(s,n.commands);case 12:return u=t.sent,this.stores.pop(),this.context.pop(),t.abrupt("return",u);case 16:case"end":return t.stop()}}),t,this)}))),function(e,t,n){return L.apply(this,arguments)})},{key:"associateParameters",value:(C=X()(Q().mark((function t(n,r,i,o){var a,s,u,c,l,f,p,d;return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.name===e.MAIN_INTERNAL_ID?Rt.getMainFunctionName():o.name,s=n.some((function(e){return e.variadic})),!(n.length!=r.length&&!s||n.length>r.length)){t.next=4;break}throw Ye.invalid_parameters_size(a,n.length,r.length);case 4:u=0,c=0;case 5:if(!(u<n.length&&c<r.length)){t.next=23;break}if(!(l=n[u]).variadic){t.next=16;break}return t.next=10,this.associateVariadicParameter(a,l,c,r,i,o);case 10:f=t.sent,p=N()(f,2),c=p[0],o=p[1],t.next=20;break;case 16:return d=r[u],t.next=19,this.associateParameter(a,l,d,i,o);case 19:o=t.sent;case 20:u+=1,c+=1,t.next=5;break;case 23:return t.abrupt("return",o);case 24:case"end":return t.stop()}}),t,this)}))),function(e,t,n,r){return C.apply(this,arguments)})},{key:"associateVariadicParameter",value:(A=X()(Q().mark((function e(t,n,r,i,o,a){var s,u,c,l;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:u=1,s=r;case 2:if(!(s<i.length)){e.next=11;break}return c=i[s],e.next=6,this.associateParameter(t,n,c,o,a,u);case 6:a=e.sent,u+=1;case 8:s+=1,e.next=2;break;case 11:return l=new We(ge.INTEGER,u,void 0,!0),a.insertStore("".concat(n.id,".0"),l),e.abrupt("return",[s-1,a]);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,o){return A.apply(this,arguments)})},{key:"associateParameter",value:(S=X()(Q().mark((function e(t,n,r,i,o){var a,s,u,c,f,p,d,h,m,_,v,y,g,x,b=arguments;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=b.length>5&&void 0!==b[5]?b[5]:0,e.next=3,this.evaluateExpression(i,r);case 3:if(s=e.sent,u=!1,n.type.isCompatible(s.type)){e.next=11;break}if(!l.enable_type_casting||n.byRef||!Nn.canImplicitTypeCast(n.type,s.type)){e.next=10;break}u=!0,e.next=11;break;case 10:throw Ye.invalid_parameter_type(t,r.toString());case 11:if(!n.byRef||s.inStore()){e.next=13;break}throw Ye.invalid_ref(t,r.toString());case 13:return n.byRef?(c=i.getStoreObject(s.id),f=null,s instanceof bn?(p=s.get(),d=s.type,h=p.map((function(e){return c.getLocAddressOf(e.line,e.column)})),m=s.isVector()?0:s.columns,f=new kn(d,p,h,s.lines,m,c.id)):s instanceof xn?(_=s.line,v=s.column,(f=new Rn(s.type,s.get(),c.getLocAddressOf(_,v),c.id)).setReferenceDimension(c.type.dimensions)):f=new Rn(s.type,s.get(),c.locAddress,c.id),y=n.id,n.variadic&&(y="".concat(y,".").concat(a)),o.insertStore(y,f)):(g=s,u&&(g=Nn.doImplicitCasting(n.type,g)),x=n.id,n.variadic&&(x="".concat(x,".").concat(a)),o.insertStore(x,g)),e.abrupt("return",o);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return S.apply(this,arguments)})},{key:"executeCommands",value:(I=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t,i=0;case 2:if(!(i<n.length)){e.next=9;break}return e.next=5,this.executeCommand(r,n[i]);case 5:r=e.sent;case 6:i+=1,e.next=2;break;case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"executeCommand",value:(T=X()(Q().mark((function e(t,n){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.instruction_count+=1,this.instruction_count%l.suspend_threshold!=0){e.next=4;break}return e.next=4,Dt(3);case 4:if(!(this.instruction_count>=l.max_instruction_count)){e.next=8;break}throw Ye.exceed_max_instructions();case 8:if(!this.forceKill){e.next=12;break}throw"FORCED_KILL!";case 12:if(t.mode!==Se.PAUSE){e.next=16;break}return e.abrupt("return",this.executeCommand(t,n));case 16:if(t.mode!==Se.RETURN){e.next=20;break}return e.abrupt("return",t);case 20:if(!this.checkContext(Sn.BREAKABLE)||t.mode!==Se.BREAK){e.next=24;break}return e.abrupt("return",t);case 24:if(this.mode!==Se.ABORT){e.next=26;break}throw Tt.getMessage("aborted_execution");case 26:if(!(n instanceof oe)){e.next=30;break}return e.abrupt("return",this.executeDeclaration(t,n));case 30:if(!(n instanceof ie)){e.next=34;break}return e.abrupt("return",this.executeArrayIndexAssign(t,n));case 34:if(!(n instanceof re)){e.next=38;break}return e.abrupt("return",this.executeAssign(t,n));case 38:if(!(n instanceof te)){e.next=42;break}return e.abrupt("return",this.executeBreak(t,n));case 42:if(!(n instanceof ne)){e.next=46;break}return e.abrupt("return",this.executeReturn(t,n));case 46:if(!(n instanceof be)){e.next=50;break}return e.abrupt("return",this.executeIfThenElse(t,n));case 50:if(!(n instanceof Ee)){e.next=54;break}return e.abrupt("return",this.executeRepeatUntil(t,n));case 54:if(!(n instanceof se)){e.next=58;break}return e.abrupt("return",this.executeWhile(t,n));case 58:if(!(n instanceof ue)){e.next=62;break}return e.abrupt("return",this.executeFor(t,n));case 62:if(!(n instanceof Re)){e.next=66;break}return e.abrupt("return",this.executeSwitch(t,n));case 66:if(!(n instanceof Ie)){e.next=70;break}return e.abrupt("return",this.executeFunctionCall(t,n));case 70:if(!(n instanceof Te)){e.next=74;break}return e.abrupt("return",this.executeSysCall(t,n));case 74:throw Ye.unknown_command(n.sourceInfo);case 75:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"executeSysCall",value:(k=X()(Q().mark((function e(t,n){var r;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.langFunc.bind(this),e.abrupt("return",r(t,n));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"executeFunctionCall",value:(R=X()(Q().mark((function t(n,r){var i,o,a;return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=null,i=r.isMainCall?this.findMainFunction():this.findFunction(r.id),this.function_call_stack.push(r.sourceInfo),t.next=5,this.runFunction(i,r.actualParameters,n);case 5:if((o=t.sent).destroy(),ge.VOID.isCompatible(i.returnType)||o.mode===Se.RETURN){t.next=12;break}throw a=i.name===e.MAIN_INTERNAL_ID?Rt.getMainFunctionName():i.name,Ye.function_no_return(a);case 12:return this.function_call_stack.pop(),t.abrupt("return",n);case 14:case"end":return t.stop()}}),t,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"executeSwitch",value:($=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.context.push(Sn.BREAKABLE),r=n.cases,i=t,o=!1,a=0;case 5:if(!(a<r.length)||this.ignoreSwitchCases(i)){e.next=26;break}if(s=r[a],!o&&!s.isDefault){e.next=13;break}return e.next=10,this.executeCommands(i,s.commands);case 10:i=e.sent,e.next=23;break;case 13:return(u=new at(ct.EQ,n.expression,s.expression)).sourceInfo=s.sourceInfo,e.next=17,this.evaluateExpression(i,u);case 17:if(!(c=e.sent).get()){e.next=22;break}return e.next=21,this.executeCommands(i,s.commands);case 21:i=e.sent;case 22:o=c.get();case 23:a+=1,e.next=5;break;case 26:return this.context.pop(),i.mode===Se.BREAK&&(i.mode=Se.RUN),e.abrupt("return",i);case 29:case"end":return e.stop()}}),e,this)}))),function(e,t){return $.apply(this,arguments)})},{key:"executeFor",value:(E=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=new re(n.for_id.id,n.for_from)).sourceInfo=n.sourceInfo,i=n.for_pass,o=new at(ct.LT,n.for_id,n.for_to),null!=n.for_pass){e.next=12;break}return i=new Xe(Le(1)),e.next=8,this.evaluateExpression(t,new at(ct.GE,n.for_to,n.for_from));case 8:e.sent.get()||(i=new Xe(Le(-1)),o=new at(ct.GT,n.for_id,n.for_to)),e.next=16;break;case 12:return e.next=14,this.evaluateExpression(t,new at(ct.GE,n.for_pass,new Xe(Le(0))));case 14:e.sent.get()||(o=new at(ct.GT,n.for_id,n.for_to));case 16:return o.sourceInfo=n.sourceInfo,(a=new re(n.for_id.id,new at(ct.ADD,n.for_id,i))).sourceInfo=n.sourceInfo,s=new we([],n.commands.concat(a)),(u=new se(o,s)).sourceInfo=n.sourceInfo,c=[r,u],e.abrupt("return",this.executeCommands(t,c));case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"executeRepeatUntil",value:(w=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.context.push(Sn.BREAKABLE),e.next=3,this.executeCommands(t,n.commands);case 3:if((r=e.sent).mode!==Se.BREAK){e.next=8;break}return this.context.pop(),r.mode=Se.RUN,e.abrupt("return",r);case 8:return e.next=10,this.evaluateExpression(r,n.expression);case 10:if((i=e.sent).type.isCompatible(ge.BOOLEAN)){e.next=13;break}throw Ye.loop_condition_type_full(n.sourceInfo);case 13:if(this.context.pop(),!i.get()){e.next=18;break}return e.abrupt("return",r);case 18:return e.abrupt("return",this.executeCommand(r,n));case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"executeWhile",value:(b=X()(Q().mark((function e(t,n){var r,i;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.context.push(Sn.BREAKABLE),e.next=3,this.evaluateExpression(t,n.expression);case 3:if((r=e.sent).type.isCompatible(ge.BOOLEAN)){e.next=6;break}throw Ye.loop_condition_type_full(n.expression.toString(),n.sourceInfo);case 6:if(!r.get()){e.next=17;break}return e.next=9,this.executeCommands(t,n.commands);case 9:if(i=e.sent,this.context.pop(),i.mode!==Se.BREAK){e.next=14;break}return i.mode=Se.RUN,e.abrupt("return",i);case 14:return e.abrupt("return",this.executeCommand(i,n));case 17:return this.context.pop(),e.abrupt("return",t);case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"executeIfThenElse",value:(x=X()(Q().mark((function e(t,n){var r;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.evaluateExpression(t,n.condition);case 2:if((r=e.sent).type.isCompatible(ge.BOOLEAN)){e.next=5;break}throw Ye.if_condition_type_full(n.condition.toString(),n.sourceInfo);case 5:if(!r.get()){e.next=9;break}return e.abrupt("return",this.executeCommands(t,n.ifTrue.commands));case 9:if(null===n.ifFalse){e.next=17;break}if(!(n.ifFalse instanceof be)){e.next=14;break}return e.abrupt("return",this.executeCommand(t,n.ifFalse));case 14:return e.abrupt("return",this.executeCommands(t,n.ifFalse.commands));case 15:e.next=18;break;case 17:return e.abrupt("return",t);case 18:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"executeReturn",value:(g=X()(Q().mark((function t(n,r){var i,o,a,s,u,c,f;return Q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.name===e.MAIN_INTERNAL_ID?Rt.getMainFunctionName():n.name,o=this.findFunction(n.name),a=o.returnType,t.next=5,this.evaluateExpression(n,r.expression);case 5:if(null!==(s=t.sent)||!a.isCompatible(ge.VOID)){t.next=9;break}return n.mode=Se.RETURN,t.abrupt("return",n);case 9:if(u=s,null!==s&&a.isCompatible(s.type)){t.next=16;break}if(l.enable_type_casting&&Nn.canImplicitTypeCast(a,s.type)){t.next=15;break}throw c=a.stringInfo(),f=c[0],Ye.invalid_return_type_full(i,f.type,f.dim,r.sourceInfo);case 15:u=Nn.doImplicitCasting(a,s);case 16:return n.insertStore("$",u),n.mode=Se.RETURN,t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"executeBreak",value:(y=X()(Q().mark((function e(t,n){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkContext(Sn.BREAKABLE)){e.next=5;break}return t.mode=Se.BREAK,e.abrupt("return",t);case 5:throw Ye.unexpected_break_command_full(n.sourceInfo);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"executeAssign",value:(v=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,f,p,d;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.applyStore(n.id)).isConst){e.next=3;break}throw Ye.invalid_const_assignment_full(n.id,n.sourceInfo);case 3:return e.next=5,this.evaluateExpression(t,n.expression);case 5:if(i=e.sent,o=i,r.type.isCompatible(o.type)){e.next=18;break}if(!l.enable_type_casting||!Nn.canImplicitTypeCast(r.type,i.type)){e.next=12;break}o=Nn.doImplicitCasting(r.type,o),e.next=18;break;case 12:throw a=r.type.stringInfo(),s=a[0],u=i.type.stringInfo(),c=u[0],f=n.expression.toString(),Ye.incompatible_types_full(s.type,s.dim,c.type,c.dim,f,n.sourceInfo);case 18:if(!(r instanceof bn)){e.next=27;break}if(p=null==o.columns?0:o.columns,r.lines===o.lines&&r.columns===p){e.next=27;break}if(d=n.expression.toString(),!r.isVector()){e.next=26;break}throw Ye.invalid_vector_assignment_full(n.id,r.lines,d,o.lines,n.sourceInfo);case 26:throw Ye.invalid_matrix_assignment_full(n.id,r.lines,r.columns,d,o.lines,o.columns,n.sourceInfo);case 27:return t.updateStore(n.id,o),e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"executeArrayIndexAssign",value:(_=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,f,p,d,h,m,_,v,y,g;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.applyStore(n.id),i=0,!r.isConst){e.next=4;break}throw Ye.invalid_const_assignment_full(n.id,n.sourceInfo);case 4:if(r.type instanceof Ze){e.next=6;break}throw Ye.invalid_array_access_full(n.id,n.sourceInfo);case 6:return e.next=8,this.evaluateExpression(t,n.line);case 8:if(o=e.sent,ge.INTEGER.isCompatible(o.type)){e.next=11;break}throw Ye.array_dimension_not_int_full(n.sourceInfo);case 11:return i+=1,a=o.get().toNumber(),e.next=15,this.evaluateExpression(t,n.column);case 15:if(s=e.sent,u=null,null==s){e.next=22;break}if(ge.INTEGER.isCompatible(s.type)){e.next=20;break}throw Ye.array_dimension_not_int_full(n.sourceInfo);case 20:u=s.get().toNumber(),i+=1;case 22:return e.next=24,this.evaluateExpression(t,n.expression);case 24:if(c=e.sent,f=c,!(a>=r.lines)){e.next=34;break}if(!r.isVector){e.next=31;break}throw Ye.vector_line_outbounds_full(n.id,a,r.lines,n.sourceInfo);case 31:throw Ye.matrix_line_outbounds_full(n.id,a,r.lines,n.sourceInfo);case 32:e.next=36;break;case 34:if(!(a<0)){e.next=36;break}throw Ye.array_dimension_not_positive_full(n.sourceInfo);case 36:if(null==u||0!==r.columns){e.next=38;break}throw Ye.vector_not_matrix_full(n.id,n.sourceInfo);case 38:if(null==u){e.next=45;break}if(!(u>=r.columns)){e.next=43;break}throw Ye.matrix_column_outbounds_full(n.id,u,r.columns,n.sourceInfo);case 43:if(!(u<0)){e.next=45;break}throw Ye.array_dimension_not_positive_full(n.sourceInfo);case 45:if(r.type.canAccept(c.type,i)){e.next=55;break}if(l.enable_type_casting&&Nn.canImplicitTypeCast(r.type.innerType,c.type)){e.next=54;break}throw p=r.type.innerType,d=p.stringInfo(),h=d[0],m=c.type.stringInfo(),_=m[0],v=n.expression.toString(),Ye.incompatible_types_full(h.type,h.dim,_.type,_.dim,v,n.sourceInfo);case 54:f=Nn.doImplicitCasting(r.type.innerType,c);case 55:if(!((y=r.getAt(a,u))instanceof bn)){e.next=60;break}if(y.lines===f.lines&&y.columns===f.columns){e.next=60;break}throw g=n.expression.toString(),Ye.invalid_matrix_index_assign_full(n.id,a,y.lines,g,f.lines,n.sourceInfo);case 60:return e.abrupt("return",t.updateStoreArray(n.id,f,a,u));case 61:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"executeDeclaration",value:(m=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,f;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n instanceof ae)){e.next=4;break}return e.abrupt("return",this.executeArrayDeclaration(t,n));case 4:if(r=new We(n.type,null,null,n.isConst),null===n.initial){e.next=22;break}return e.next=8,this.evaluateExpression(t,n.initial);case 8:if(i=e.sent,o=i,i.type.isCompatible(n.type)){e.next=21;break}if(!l.enable_type_casting||!Nn.canImplicitTypeCast(n.type,i.type)){e.next=15;break}o=Nn.doImplicitCasting(n.type,o),e.next=21;break;case 15:throw a=i.type.stringInfo(),s=a[0],u=i.type.stringInfo(),c=u[0],f=n.expression.toString(),Ye.incompatible_types_full(s.type,s.dim,c.type,c.dim,f,n.sourceInfo);case 21:r=new We(n.type,o.get(),null,n.isConst);case 22:return t.insertStore(n.id,r),e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"executeArrayDeclaration",value:(h=X()(Q().mark((function e(t,n){var r,i,o,a,s,u;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.evaluateExpression(t,n.lines);case 2:if(r=e.sent,ge.INTEGER.isCompatible(r.type)){e.next=5;break}throw Ye.array_dimension_not_int_full(n.sourceInfo);case 5:return i=r.get().toNumber(),e.next=8,this.evaluateExpression(t,n.columns);case 8:if(o=e.sent,a=null,null===o){e.next=16;break}if(ge.INTEGER.isCompatible(o.type)){e.next=13;break}throw Ye.array_dimension_not_int_full(n.sourceInfo);case 13:if(!((a=o.get().toNumber())<0)){e.next=16;break}throw Ye.array_dimension_not_positive_full(n.sourceInfo);case 16:if(s=new bn(n.type,[],i,a,null,n.isConst),null===n.initial){e.next=22;break}return e.next=20,this.evaluateArrayLiteral(t,n.initial,n.type,i,a);case 20:u=e.sent,s=new bn(n.type,u,i,a,null,n.isConst);case 22:return t.insertStore(n.id,s),e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"evaluateExpression",value:(d=X()(Q().mark((function e(t,n){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.instruction_count+=1,this.instruction_count%l.suspend_threshold!=0){e.next=4;break}return e.next=4,Dt(3);case 4:if(this.mode!==Se.ABORT){e.next=6;break}throw Tt.getMessage("aborted_execution");case 6:if(!(this.instruction_count>=l.max_instruction_count)){e.next=8;break}throw 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.");case 8:if(!(n instanceof st)){e.next=12;break}return e.abrupt("return",this.evaluateUnaryApp(t,n));case 12:if(!(n instanceof at)){e.next=16;break}return e.abrupt("return",this.evaluateInfixApp(t,n));case 16:if(!(n instanceof Qe)){e.next=20;break}return e.abrupt("return",this.evaluateArrayAccess(t,n));case 20:if(!(n instanceof ot)){e.next=24;break}return e.abrupt("return",this.evaluateVariableLiteral(t,n));case 24:if(!(n instanceof Xe)){e.next=28;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 28:if(!(n instanceof et)){e.next=32;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 32:if(!(n instanceof tt)){e.next=36;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 36:if(!(n instanceof rt)){e.next=40;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 40:if(!(n instanceof nt)){e.next=44;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 44:if(!(n instanceof it)){e.next=48;break}throw new Error("Internal Error: The system should not eval an array literal.");case 48:if(!(n instanceof Ie)){e.next=50;break}return e.abrupt("return",this.evaluateFunctionCall(t,n));case 50:return e.abrupt("return",null);case 51:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"evaluateFunctionCall",value:(p=X()(Q().mark((function e(t,n){var r,i,o;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.isMainCall){e.next=2;break}throw Ye.void_in_expression_full(Rt.getMainFunctionName(),n.sourceInfo);case 2:if(r=this.findFunction(n.id),!ge.VOID.isCompatible(r.returnType)){e.next=5;break}throw Ye.void_in_expression_full(n.id,n.sourceInfo);case 5:if(!(this.function_call_stack.length>=l.max_call_stack)){e.next=7;break}throw Ye.exceeded_recursive_calls(n.sourceInfo);case 7:return this.function_call_stack.push(n.sourceInfo),e.next=10,this.runFunction(r,n.actualParameters,t);case 10:if((i=e.sent).mode===Se.RETURN){e.next=13;break}throw new Error("!!!Internal error: the function that was called did not have a return command or did not set the store mode properly -> "+n.id);case 13:return o=i.applyStore("$"),i.destroy(),this.function_call_stack.pop(),e.abrupt("return",o);case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"evaluateArrayLiteral",value:(f=X()(Q().mark((function e(t,n,r,i,o){var a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isVector){e.next=9;break}if(null!=o){e.next=3;break}throw new Error("This should never happen: Vector cannot be initialized by a matrix");case 3:return e.next=5,this.evaluateMatrix(t,n,r,i,o);case 5:return a=e.sent,e.abrupt("return",a.reduce((function(e,t){return e.concat(t)}),[]));case 9:if(null==o){e.next=11;break}throw new Error("This should never happen: Matrix cannot be initialized by a vector");case 11:return e.abrupt("return",this.evaluateVector(t,n,r,i));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return f.apply(this,arguments)})},{key:"evaluateVector",value:(c=X()(Q().mark((function e(t,n,r,i){var o,a,s=this;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n.value,i===o.length){e.next=3;break}throw Ye.invalid_number_elements_vector(i,n.toString(),o.length,n.sourceInfo);case 3:return e.next=5,Promise.all(o.map((function(e){return s.evaluateExpression(t,e)})));case 5:return a=e.sent,e.abrupt("return",a.map((function(e,t){if(!r.canAccept(e.type,1)){if(!l.enable_type_casting||!Nn.canImplicitTypeCast(r.innerType,e.type)){var n=o[t].toString();throw Ye.invalid_array_literal_type_full(n,o[t].sourceInfo)}return Nn.doImplicitCasting(r.innerType,e)}return e})));case 7:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return c.apply(this,arguments)})},{key:"evaluateMatrix",value:(u=X()(Q().mark((function e(t,n,r,i,o){var a,s,u=this;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=n.value).length===i){e.next=3;break}throw Ye.invalid_number_lines_matrix(i,n.toString(),a.length,n.sourceInfo);case 3:return s=a.map((function(e){var n=new Ze(r.innerType,1);return u.evaluateVector(t,e,n,o)})),e.next=6,Promise.all(s);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),function(e,t,n,r,i){return u.apply(this,arguments)})},{key:"evaluateLiteral",value:(s=X()(Q().mark((function e(t,n){return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new We(n.type,n.value));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return s.apply(this,arguments)})},{key:"evaluateVariableLiteral",value:(o=X()(Q().mark((function e(t,n){var r;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore(n.id),e.abrupt("return",r);case 2:case"end":return e.stop()}}),e)}))),function(e,t){return o.apply(this,arguments)})},{key:"evaluateArrayAccess",value:(r=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,l;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.getStoreObject(n.id)).type instanceof Ze){e.next=3;break}throw Ye.invalid_array_access_full(n.id,n.sourceInfo);case 3:return e.next=5,this.evaluateExpression(t,n.line);case 5:if(i=e.sent,ge.INTEGER.isCompatible(i.type)){e.next=8;break}throw Ye.array_dimension_not_int_full(n.sourceInfo);case 8:return o=i.get().toNumber(),e.next=11,this.evaluateExpression(t,n.column);case 11:if(a=e.sent,s=null,null===a){e.next=17;break}if(ge.INTEGER.isCompatible(a.type)){e.next=16;break}throw Ye.array_dimension_not_int_full(n.sourceInfo);case 16:s=a.get().toNumber();case 17:if(!(o>=r.lines)){e.next=25;break}if(!r.isVector){e.next=22;break}throw Ye.vector_line_outbounds_full(n.id,o,r.lines,n.sourceInfo);case 22:throw Ye.matrix_line_outbounds_full(n.id,o,r.lines,n.sourceInfo);case 23:e.next=27;break;case 25:if(!(o<0)){e.next=27;break}throw Ye.array_dimension_not_positive_full(n.sourceInfo);case 27:if(null===s||0!==r.columns){e.next=29;break}throw Ye.vector_not_matrix_full(n.id,n.sourceInfo);case 29:if(null===s){e.next=36;break}if(!(s>=r.columns)){e.next=34;break}throw Ye.matrix_column_outbounds_full(n.id,s,r.columns,n.sourceInfo);case 34:if(!(s<0)){e.next=36;break}throw Ye.array_dimension_not_positive_full(n.sourceInfo);case 36:if(u=r.getAt(o,s),c=r.type.innerType,!Array.isArray(u)){e.next=43;break}return l=u.map((function(e,t){return new xn(c,e,o,t,r.id,r.readOnly)})),e.abrupt("return",new bn(new Ze(c,1),l,r.columns,null,r.id,r.readOnly));case 43:return e.abrupt("return",new xn(c,u,o,s,r.id,r.readOnly));case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"evaluateUnaryApp",value:(n=X()(Q().mark((function e(t,n){var r,i,o,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.evaluateExpression(t,n.left);case 2:if(r=e.sent,i=hn(n.op,r.type),!ge.UNDEFINED.isCompatible(i)){e.next=8;break}throw o=r.type.stringInfo(),a=o[0],Ye.invalid_unary_op_full(n.op,a.type,a.dim,n.sourceInfo);case 8:e.t0=n.op.ord,e.next=e.t0===ct.ADD.ord?11:e.t0===ct.SUB.ord?12:e.t0===ct.NOT.ord?13:14;break;case 11:return e.abrupt("return",new We(i,r.get()));case 12:return e.abrupt("return",new We(i,r.get().negated()));case 13:return e.abrupt("return",new We(i,!r.get()));case 14:throw new Ve("!!!Critical Invalid UnaryApp "+n.op);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"evaluateInfixApp",value:(t=X()(Q().mark((function e(t,n){var r,i,o,a,s,u,c,f,p,d,h,m,_,v,y,g,x,b,w,E,$,R,k,T,N,I,S;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.evaluateExpression(t,n.left);case 2:return r=e.sent,e.next=5,this.evaluateExpression(t,n.right);case 5:if(i=e.sent,o=!1,a=dn(n.op,r.type,i.type),!ge.UNDEFINED.isCompatible(a)){e.next=18;break}if(!l.enable_type_casting||!Nn.canImplicitTypeCast(r.type,i.type)){e.next=13;break}o=!0,e.next=18;break;case 13:throw s=r.type.stringInfo(),u=s[0],c=i.type.stringInfo(),f=c[0],Ye.invalid_infix_op_full(n.op,u.type,u.dim,f.type,f.dim,n.sourceInfo);case 18:p=null,e.t0=n.op.ord,e.next=e.t0===ct.ADD.ord?22:e.t0===ct.SUB.ord?39:e.t0===ct.MULT.ord?40:e.t0===ct.DIV.ord?42:e.t0===ct.MOD.ord?46:e.t0===ct.GT.ord?51:e.t0===ct.GE.ord?55:e.t0===ct.LT.ord?59:e.t0===ct.LE.ord?63:e.t0===ct.EQ.ord?67:e.t0===ct.NEQ.ord?71:e.t0===ct.AND.ord?75:e.t0===ct.OR.ord?76:77;break;case 22:if(!ge.STRING.isCompatible(r.type)){e.next=27;break}return d=Me(i.get(),i.type),e.abrupt("return",new We(a,r.get()+d));case 27:if(!ge.STRING.isCompatible(i.type)){e.next=32;break}return h=Me(r.get(),r.type),e.abrupt("return",new We(a,h+i.get()));case 32:if(!ge.CHAR.isCompatible(r.type)){e.next=38;break}return m=Me(r.get(),r.type),_=Me(i.get(),i.type),e.abrupt("return",new We(a,m+_));case 38:return e.abrupt("return",new We(a,r.get().plus(i.get())));case 39:return e.abrupt("return",new We(a,r.get().minus(i.get())));case 40:return p=r.get().times(i.get()),e.abrupt("return",new We(a,p));case 42:if(0!=i.get()){e.next=44;break}throw Ye.divsion_by_zero_full(n.toString(),n.sourceInfo);case 44:return p=ge.INTEGER.isCompatible(a)?r.get().divToInt(i.get()):r.get().div(i.get()),e.abrupt("return",new We(a,p));case 46:return v=r.get(),y=i.get(),o&&(a=ge.INTEGER,v=v.trunc(),y=y.trunc()),p=v.modulo(y),e.abrupt("return",new We(a,p));case 51:return g=r.get(),x=i.get(),ge.STRING.isCompatible(r.type)?p=g.length>x.length:ge.CHAR.isCompatible(r.type)?p=g.charCodeAt(0)>x.charCodeAt(0):(o&&(a=ge.BOOLEAN,g=g.trunc(),x=x.trunc()),p=g.gt(x)),e.abrupt("return",new We(a,p));case 55:return b=r.get(),w=i.get(),ge.STRING.isCompatible(r.type)?p=b.length>=w.length:ge.CHAR.isCompatible(r.type)?p=b.charCodeAt(0)>=w.charCodeAt(0):(o&&(a=ge.BOOLEAN,b=b.trunc(),w=w.trunc()),p=b.gte(w)),e.abrupt("return",new We(a,p));case 59:return E=r.get(),$=i.get(),ge.STRING.isCompatible(r.type)?p=E.length<$.length:ge.CHAR.isCompatible(r.type)?p=E.charCodeAt(0)<$.charCodeAt(0):(o&&(a=ge.BOOLEAN,E=E.trunc(),$=$.trunc()),p=E.lt($)),e.abrupt("return",new We(a,p));case 63:return R=r.get(),k=i.get(),ge.STRING.isCompatible(r.type)?p=R.length<=k.length:ge.CHAR.isCompatible(r.type)?p=R.charCodeAt(0)<=k.charCodeAt(0):(o&&(a=ge.BOOLEAN,R=R.trunc(),k=k.trunc()),p=R.lte(k)),e.abrupt("return",new We(a,p));case 67:return T=r.get(),N=i.get(),ge.INTEGER.isCompatible(r.type)||ge.REAL.isCompatible(r.type)?(o&&(a=ge.BOOLEAN,T=T.trunc(),N=N.trunc()),p=T.eq(N)):p=T===N,e.abrupt("return",new We(a,p));case 71:return I=r.get(),S=i.get(),ge.INTEGER.isCompatible(r.type)||ge.REAL.isCompatible(r.type)?(o&&(a=ge.BOOLEAN,I=I.trunc(),S=S.trunc()),p=!I.eq(S)):p=I!==S,e.abrupt("return",new We(a,p));case 75:return e.abrupt("return",new We(a,r.get()&&i.get()));case 76:return e.abrupt("return",new We(a,r.get()||i.get()));case 77:throw new Ve("!!!Critical Invalid InfixApp "+n.op);case 78:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}();var Cn=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(e){var t;return i()(this,o),(t=r.call(this)).index=0,t.inputList=e,t}return a()(o,[{key:"requestInput",value:function(){var e=this;return new Promise((function(t,n){e.index<e.inputList.length?(t(e.inputList[e.index]),e.index++):n(new Error(Tt.getError("exceeded_input_request")))}))}}]),o}(function(){function e(){i()(this,e)}return a()(e,[{key:"requestInput",value:function(){throw new Error("Must be implemented")}}]),e}());var Ln=function(e){m()(o,e);var t,n,r=(t=o,n=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}}(),function(){var e,r=g()(t);if(n){var i=g()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return v()(this,e)});function o(){var e;return i()(this,o),(e=r.call(this)).list=[],e.currentLine=null,e}return a()(o,[{key:"write",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null==this.currentLine&&(this.currentLine=this.list.push("")-1),this.list[this.currentLine]+=e,t&&(this.currentLine=null)}},{key:"sendOutput",value:function(e){var t=this,n=""+e;if(-1!==n.indexOf("\n")){var r=n.split("\n"),i=r.pop();r.forEach((function(e){0==e.length?t.currentLine=null:t.write(e,!0)})),0!=i.length&&this.write(i)}else this.write(n)}}]),o}(function(){function e(){i()(this,e)}return a()(e,[{key:"sendOutput",value:function(e){throw new Error("Must be implemented")}},{key:"writeRawHTML",value:function(e,t){throw new Error("Must be implemented")}},{key:"write",value:function(e){throw new Error("Must be implemented")}},{key:"info",value:function(e){throw new Error("Must be implemented")}},{key:"err",value:function(e){throw new Error("Must be implemented")}}],[{key:"USER",get:function(){return 0}},{key:"INFO",get:function(){return 1}},{key:"ERR",get:function(){return 2}},{key:"INPUT",get:function(){return 3}}]),e}());function On(e,t,n){return Dn.apply(this,arguments)}function Dn(){return Dn=X()(Q().mark((function e(t,n,r){var i,o,a,s,u,c,l,f;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.map((function(e){return Object.assign({},e)})),e.prev=1,o=In.analyseFromSource(t),a=n.map(function(){var e=X()(Q().mark((function e(t,n){var r,i,a;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new Cn(t.input),i=new Ln,(a=new An(o)).registerInput(r),a.registerOutput(i),e.next=7,a.interpretAST();case 7:return e.abrupt("return",{id:n,program:a});case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),e.next=6,Promise.all(a);case 6:s=e.sent,u=0;case 8:if(!(u<s.length)){e.next=20;break}if(c=s[u],l=c.program.output.list,(f=c.program.input).index==f.inputList.length){e.next=15;break}return window.showAlert(Tt.getMessage("testcase_autogen_unused_input",[c.id+1])),e.abrupt("return",!1);case 15:0==l.length&&window.showAlert(Tt.getMessage("testcase_autogen_empty",[c.id+1])),i[c.id].output=l;case 17:++u,e.next=8;break;case 20:return r(i),e.abrupt("return",!0);case 24:return e.prev=24,e.t0=e.catch(1),e.abrupt("return",Promise.reject(e.t0));case 27:case"end":return e.stop()}}),e,null,[[1,24]])}))),Dn.apply(this,arguments)}var Gn={programming:[],functions:[],datatypes:[],commands:[],filter:[]},Fn=At.i18n,Pn=It()})(),r})()}));
- //# sourceMappingURL=main.js.map
|