123 |
- /*! For license information please see main.js.LICENSE.txt */
- !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,(()=>(()=>{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"}}},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(e,t){return e.length>t?e:Array(t-e.length+1).join(" ")+e}function c(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 l(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(c(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 u=[];s.forEach((function(e){i(e)?(u.length&&n.push(c(o,u)),n.push(c(o,e)),u=[]):u.push(e)})),u.length&&n.push(c(o,u))}else for(var l=0;l<s.length;l++)n.push({include:s[l]})}return n}(e)}var f=c("error",{lineBreaks:!0,shouldThrow:!0});function p(e,t){for(var i=null,u=Object.create(null),c=!0,l=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===l)l=y.unicode;else if(l!==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===l&&(w+="u"),{regexp:new RegExp(a(d)+E,w),groups:p,fast:u,error:i||f}}function d(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 h=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};h.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.queuedText=t?t.queuedText:"",this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},h.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},h.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}},h.prototype.popState=function(){this.setState(this.stack.pop())},h.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var m=n?function(e,t){return e.exec(t)}:function(e,t){var n=e.exec(t);return 0===n[0].length?null:n};function _(){return this.value}if(h.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")},h.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=m(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)}},h.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:_,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 v=function(e){this.lexer=e};v.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},v.prototype[Symbol.iterator]=function(){return this},h.prototype[Symbol.iterator]=function(){return new v(this)}}return h.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(e.line-2,1),i=e.line+2,o=String(i).length,a=function(e,t){for(var n=e.length,r=0;;){var i=e.lastIndexOf("\n",n-1);if(-1===i)break;if(n=i,++r===t)break;if(0===n)break}var o=r<t?0:n+1;return e.substring(o).split("\n")}(this.buffer,this.line-e.line+2+1).slice(0,5),s=[];s.push(t+" at line "+e.line+" col "+e.col+":"),s.push("");for(var c=0;c<a.length;c++){var l=a[c],f=r+c;s.push(u(String(f),o)+" "+l),f===e.line&&s.push(u("",o+e.col+1)+"^")}return s.join("\n")},h.prototype.clone=function(){return new h(this.states,this.state)},h.prototype.has=function(e){return!0},{compile:function(e){var t=p(l(e));return new h({start:t},"start")},states:function(e,t){var n=e.$all?l(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]]=l(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 c=a[u];if(c.include){var f=[u,1];if(c.include!==g&&!s[c.include]){s[c.include]=!0;var m=i[c.include];if(!m)throw new Error("Cannot include nonexistent state '"+c.include+"' (in state '"+g+"')");for(var _=0;_<m.length;_++){var v=m[_];-1===a.indexOf(v)&&f.push(v)}}a.splice.apply(a,f),u--}}var y=Object.create(null);for(o=0;o<r.length;o++){var g;y[g=r[o]]=p(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++)d(w[u],x,y);var E=Object.getOwnPropertyNames(b.fast);for(u=0;u<E.length;u++)d(b.fast[E[u]],x,y)}return new h(y,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t="undefined"!=typeof Map,n=t?new Map: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("string"!=typeof e)throw new Error("keyword must be string (in keyword '"+o+"')");t?n.set(e,o):n[e]=o}))}return function(e){return t?n.get(e):n[e]}}}})?n.apply(t,[]):n)||(e.exports=r)},61:(e,t,n)=>{var r=n(698).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function p(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),s=new N(r||[]);return a(o,"_invoke",{value:$(e,n,s)}),o}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h={};function m(){}function _(){}function v(){}var y={};f(y,u,(function(){return this}));var g=Object.getPrototypeOf,x=g&&g(g(I([])));x&&x!==n&&o.call(x,u)&&(y=x);var b=v.prototype=m.prototype=Object.create(y);function w(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function n(i,a,s,u){var c=d(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value: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,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=R(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("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=d(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function R(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=d(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function k(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 T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function I(e){if(e){var t=e[u];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return _.prototype=v,a(b,"constructor",{value:v,configurable:!0}),a(v,"constructor",{value:_,configurable:!0}),_.displayName=f(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,f(e,l,"GeneratorFunction")),e.prototype=Object.create(b),e},t.awrap=function(e){return{__await:e}},w(E.prototype),f(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new E(p(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),f(b,l,"Generator"),f(b,u,(function(){return this})),f(b,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.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),T(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;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:I(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},698:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},687:(e,t,n)=>{var r=n(61)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}},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";function e(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)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}}n.r(r),n.d(r,{Config:()=>q,IVProgProcessor:()=>ri,LanguageService:()=>j,LocalizedStrings:()=>ir,Location:()=>zr,Modes:()=>Se,SemanticAnalyser:()=>ti,Settings:()=>li,autoGenerateTestCaseOutput:()=>ai,i18n:()=>fi,levenshteinDistance:()=>or,openAssessmentDetail:()=>sr,parseCode:()=>Ir,parseExpression:()=>Nr,processData:()=>pr});var i=n(687),o=n.n(i);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function u(e){var t=function(e,t){if("object"!==s(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===s(t)?t:String(t)}function c(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,u(r.key),r)}}function l(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function p(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}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}function v(e,t){if(e){if("string"==typeof e)return _(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)?_(e,t):void 0}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||v(e,t)||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.")}()}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var x,b,w,E,$=n(271);function R(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(""))}var k=function(){function e(t,n,r,i){a(this,e),this.RKs=t,this.lexer=n,this.rules=r,this.i18nLexer=i}return l(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}(),T="[0-9a-fA-F]",N="[0-7]",I=RegExp("\\\\[0-3]".concat(N).concat(N,"|\\\\").concat(N).concat(N,"|\\\\").concat(N)),A=RegExp("\\\\u".concat(T).concat(T).concat(T).concat(T)),S=R(x||(x=g(["","|","|",""])),/\\[b,t,n,f,r,",',\\]|/,A,I),C=R(b||(b=g(["",'|[^"\\\\]'],["",'|[^"\\\\\\\\]'])),S);function O(e){var t={},n={};Object.entries(e.types).forEach((function(e){var r=y(e,2),i=r[0],o=r[1];t[i]=o,n[i]=i})),Object.entries(e.boolVal).forEach((function(e){var r=y(e,2),i=r[0],o=r[1];t[i]=o,n[i]=i})),Object.entries(e.commands).forEach((function(e){var r=y(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=$.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(T,"+|(?:0b|0B)[0-1]+|[0-9]+")),SUM_OP:/[+-]/,MULTI_OP:/[*/%]/,RELATIONAL_OPERATOR:/>=|==|<=|>|<|!=/,COLON:/:/,STRING:R(w||(w=g(['"(?:',')*?"'])),C),CHARACTER:R(E||(E=g(["'(?:","|[^'\\\\])'"],["'(?:","|[^'\\\\\\\\])'"])),S),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=y(e,2),r=t[0];return t[1],n[r]=r}));var o=$.compile(i);return new k(t,o,n,e)}var L=O({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"}}),D=O({commands:{RK_VOID:"void",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"}}),B={};B.pt=L,B.en=D;const P=B;var G,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"}(G||(G={}));var M=function(){function e(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 e.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))},e.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+"}"},e.prototype.getOR=function(){return this.getUI("string_join_or")},e.prototype.getError=function(e,t){void 0===t&&(t=[]);var n=this.getString(e,G.ERROR);return this.processString(n,t)},e.prototype.getMessage=function(e,t){void 0===t&&(t=[]);var n=this.getString(e,G.MESSAGE);return this.processString(n,t)},e.prototype.getUI=function(e,t){void 0===t&&(t=[]);var n=this.getString(e,G.UI);return this.processString(n,t)},e.prototype.processString=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e=e.replace("$"+n,r)}return e},e.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"))}))},e.prototype.processTagTex=function(e){if(null===e)return"<Invalid i18n identifier>";var t=e.split(":"),n=t[0].toLowerCase(),r=t[1];return G.ERROR===n?this.getError(r):G.MESSAGE===n?this.getMessage(r):G.UI===n?this.getUI(r):(console.warn(" A string has been passed to the i18n helper function that was not in the form type:id -> "+e),this.getString(r,n))},e}();const U={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:M,StringTypes:G};function K(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var z=function(){function e(){a(this,e),K(this,"decimalPlaces",void 0),K(this,"intConvertRoundMode",void 0),K(this,"default_lang",void 0),K(this,"enable_type_casting",void 0),K(this,"idle_input_interval",void 0),K(this,"suspend_threshold",void 0),K(this,"max_instruction_count",void 0),K(this,"activity_programming_type",void 0),K(this,"activity_functions",void 0),K(this,"activity_datatypes",void 0),K(this,"activity_commands",void 0),K(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 l(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}(),q=new z;var j=new(function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(){return a(this,i),r.call(this,"undefined"==typeof iLMparameters?q.default_lang:iLMparameters.lang)}return l(i,[{key:"getDefaultLang",value:function(){return"en"}},{key:"getCurrentLexer",value:function(){var e=P[this.getLang()];return null==e?P[this.getDefaultLang()]:e}},{key:"getCurrentLangFuncs",value:function(){var e=P[this.getLang()];return null==e?P[this.getDefaultLang()].getLangFuncs():e.getLangFuncs()}},{key:"getCurrentLangLibs",value:function(){var e=P[this.getLang()];return null==e?P[this.getDefaultLang()].getLangLibs():e.getLangLibs()}}]),i}(U.LanguageServiceNoLS)),V=n(597),H=n(548),Y=n(186),W={};for(var Z in H){var Q={};Q.error=Y[Z],Q.message=V[Z],Q.ui=H[Z],W[Z]=Q}const J=W;var X=function(){function e(){a(this,e),this._sourceInfo=null}return l(e,[{key:"sourceInfo",get:function(){return this._sourceInfo},set:function(e){this._sourceInfo=e}}]),e}();var ee=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(){return a(this,i),r.call(this)}return l(i)}(X);var te=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this)).expression=e,t}return l(i)}(X);var ne=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this)).id=e,n.expression=t,n}return l(i)}(X);var re=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n,o){var s;return a(this,i),(s=r.call(this,e,o)).line=t,s.column=n,s}return l(i)}(ne);var ie=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n,o){var s;return a(this,i),(s=r.call(this)).id=e,s.type=t,s.initial=n,s.isConst=o,s}return l(i)}(X);var oe=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n,o,s,u){var c;return a(this,i),(c=r.call(this,e,t,s,u)).lines=n,c.columns=o,c}return l(i,[{key:"isVector",get:function(){return null==this.columns}}]),i}(ie);var ae=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this)).expression=e,n.commandBlock=t,n}return l(i,[{key:"commands",get:function(){return this.commandBlock.commands}},{key:"testFirst",get:function(){return!0}}]),i}(X);var se=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n,o,s){var u;return a(this,i),(u=r.call(this)).for_id=e,u.for_from=t,u.for_to=n,u.for_pass=o,u.commandBlock=s,u}return l(i,[{key:"commands",get:function(){return this.commandBlock.commands}}]),i}(X),ue=function(){function e(t,n){a(this,e),K(this,"value",void 0),K(this,"ord",void 0),this.value=t,this.ord=n}return l(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}(),ce=function(){function e(t){a(this,e),this.types=t}return l(e,[{key:"value",get:function(){}},{key:"ord",get:function(){}},{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}}]),e}(),le=new ue("integer",0),fe=new ue("real",1),pe=new ue("text",2),de=new ue("boolean",3),he=new ue("char",4),me=new ue("void",5),_e=new ue("undefined",6),ve=new ce([le,fe,pe,he,de]),ye=Object.freeze({INTEGER:le,REAL:fe,STRING:pe,CHAR:he,BOOLEAN:de,VOID:me,UNDEFINED:_e,ALL:ve}),ge=function(){function e(t,n,r,i){a(this,e),this.name=t,this.returnType=n,this.formalParameters=r,this.commandBlock=i,this._sourceInfo=null}return l(e,[{key:"isMain",get:function(){return null===this.name&&this.returnType.isCompatible(ye.VOID)}},{key:"commands",get:function(){return this.commandBlock.commands}},{key:"variablesDeclarations",get:function(){return this.commandBlock.variables}},{key:"sourceInfo",get:function(){return this._sourceInfo},set:function(e){this._sourceInfo=e}},{key:"hasVariadic",value:function(){return this.formalParameters.some((function(e){return e.variadic}))}}]),e}();var xe=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n){var o;return a(this,i),(o=r.call(this)).condition=e,o.ifTrue=t,o.ifFalse=n,o}return l(i)}(X),be=function(){function e(t,n){a(this,e),this.variables=t,this.commands=n,this._sourceInfo=null}return l(e,[{key:"sourceInfo",get:function(){return this._sourceInfo},set:function(e){this._sourceInfo=e}}]),e}();var we=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){return a(this,i),r.call(this,e,t)}return l(i,[{key:"testFirst",get:function(){return!1}}]),i}(ae);var Ee=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this)).expression=e,n.cases=t,n}return l(i)}(X);var $e=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this)).expression=e,t.commands=[],t}return l(i,[{key:"setCommands",value:function(e){this.commands=e}},{key:"isDefault",get:function(){return null===this.expression}}]),i}(X),Re=l((function e(t){a(this,e),this.langFunc=t})),ke=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a(this,e),this.type=t,this.id=n,this.byRef=r,this.variadic=i,this._sourceInfo=null}return l(e,[{key:"sourceInfo",get:function(){return this._sourceInfo},set:function(e){this._sourceInfo=e}}]),e}(),Te=function(){function e(){a(this,e),this._sourceInfo=null,this._parenthesis=!1}return l(e,[{key:"sourceInfo",get:function(){return this._sourceInfo},set:function(e){this._sourceInfo=e}},{key:"parenthesis",get:function(){return this._parenthesis},set:function(e){this._parenthesis=e}}]),e}();var Ne,Ie,Ae=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this)).id=e,n.actualParameters=t,n}return l(i,[{key:"isMainCall",get:function(){return null===this.id}},{key:"parametersSize",get:function(){return this.actualParameters.length}},{key:"toString",value:function(){var e;e=this.isMainCall?nr.getMainFunctionName():nr.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}}]),i}(Te),Se=Object.freeze({RETURN:Symbol("mode:return"),BREAK:Symbol("mode:break"),PAUSE:Symbol("mode:pause"),RUN:Symbol("mode:run"),ABORT:Symbol("mode:abort")}),Ce=9e15,Oe=1e9,Le="0123456789abcdef",De="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Be="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pe={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ce,maxE:Ce,crypto:!1},Ge=!0,Fe="[DecimalError] ",Me=Fe+"Invalid argument: ",Ue=Fe+"Precision limit exceeded",Ke=Fe+"crypto unavailable",ze="[object Decimal]",qe=Math.floor,je=Math.pow,Ve=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,He=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ye=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,We=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ze=1e7,Qe=De.length-1,Je=Be.length-1,Xe={toStringTag:ze};function et(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+=ft(n)),o+=r;(n=7-(r=(a=e[t])+"").length)&&(o+=ft(n))}else if(0===a)return"0";for(;a%10==0;)a/=10;return o+a}function tt(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Me+e)}function nt(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=je(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)==je(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)==je(10,t-3)-1,a}function rt(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]+=Le.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()}Xe.absoluteValue=Xe.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),ot(e)},Xe.ceil=function(){return ot(new this.constructor(this),this.e+1,2)},Xe.clampedTo=Xe.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(Me+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},Xe.comparedTo=Xe.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},Xe.cosine=Xe.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;if(t.isZero())return t;(r=t.d.length)<32?i=(1/bt(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=xt(e,1,t.times(i),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,wt(r,n)),r.precision=e,r.rounding=t,ot(2==Ie||3==Ie?n.neg():n,e,t,!0)):new r(1):new r(NaN)},Xe.cubeRoot=Xe.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(Ge=!1,(o=l.s*je(l.s*l,1/3))&&Math.abs(o)!=1/0?r=new f(o.toString()):(n=et(l.d),(o=((e=l.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=je(n,1/3),e=qe((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=it(c.plus(l).times(s),c.plus(u),a+2,1),et(s.d).slice(0,a)===(n=et(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))||(ot(r,e+1,1),t=!r.times(r).times(r).eq(l));break}if(!i&&(ot(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}a+=4,i=1}return Ge=!0,ot(r,e,f.rounding,t)},Xe.decimalPlaces=Xe.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-qe(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},Xe.dividedBy=Xe.div=function(e){return it(this,new this.constructor(e))},Xe.dividedToIntegerBy=Xe.divToInt=function(e){var t=this.constructor;return ot(it(this,new t(e),0,1,1),t.precision,t.rounding)},Xe.equals=Xe.eq=function(e){return 0===this.cmp(e)},Xe.floor=function(){return ot(new this.constructor(this),this.e+1,3)},Xe.greaterThan=Xe.gt=function(e){return this.cmp(e)>0},Xe.greaterThanOrEqualTo=Xe.gte=function(e){var t=this.cmp(e);return 1==t||0===t},Xe.hyperbolicCosine=Xe.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/bt(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=xt(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 ot(o,a.precision=n,a.rounding=r,!0)},Xe.hyperbolicSine=Xe.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=xt(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=xt(o,2,i=i.times(1/bt(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,ot(i,t,n,!0)},Xe.hyperbolicTangent=Xe.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,it(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},Xe.inverseCosine=Xe.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()?ct(n,i,o):new n(0):new n(NaN):t.isZero()?ct(n,i+4,o).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=ct(n,i+4,o).times(.5),n.precision=i,n.rounding=o,e.minus(t))},Xe.inverseHyperbolicCosine=Xe.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,Ge=!1,n=n.times(n).minus(1).sqrt().plus(n),Ge=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},Xe.inverseHyperbolicSine=Xe.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,Ge=!1,n=n.times(n).plus(1).sqrt().plus(n),Ge=!0,r.precision=e,r.rounding=t,n.ln())},Xe.inverseHyperbolicTangent=Xe.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?ot(new o(i),e,t,!0):(o.precision=n=r-i.e,i=it(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)},Xe.inverseSine=Xe.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=ct(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)))},Xe.inverseTangent=Xe.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<=Je)return(a=ct(l,f+4,p).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=Je)return(a=ct(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(Ge=!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)),Ge=!0,ot(a,l.precision=f,l.rounding=p,!0)},Xe.isFinite=function(){return!!this.d},Xe.isInteger=Xe.isInt=function(){return!!this.d&&qe(this.e/7)>this.d.length-2},Xe.isNaN=function(){return!this.s},Xe.isNegative=Xe.isNeg=function(){return this.s<0},Xe.isPositive=Xe.isPos=function(){return this.s>0},Xe.isZero=function(){return!!this.d&&0===this.d[0]},Xe.lessThan=Xe.lt=function(e){return this.cmp(e)<0},Xe.lessThanOrEqualTo=Xe.lte=function(e){return this.cmp(e)<1},Xe.logarithm=Xe.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(Ge=!1,a=_t(c,s=f+5),r=t?ut(l,s+10):_t(e,s),nt((u=it(a,r,s,1)).d,i=f,p))do{if(a=_t(c,s+=10),r=t?ut(l,s+10):_t(e,s),u=it(a,r,s,1),!o){+et(u.d).slice(i+1,i+15)+1==1e14&&(u=ot(u,f+1,0));break}}while(nt(u.d,i+=10,p));return Ge=!0,ot(u,f,p)},Xe.minus=Xe.sub=function(e){var t,n,r,i,o,a,s,u,c,l,f,p,d=this,h=d.constructor;if(e=new h(e),!d.d||!e.d)return d.s&&e.s?d.d?e.s=-e.s:e=new h(e.d||d.s!==e.s?d:NaN):e=new h(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(c=d.d,p=e.d,s=h.precision,u=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===u?-0:0);e=new h(d)}return Ge?ot(e,s,u):e}if(n=qe(e.e/7),l=qe(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]=Ze-1;--c[i],c[r]+=Ze}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=st(c,n),Ge?ot(e,s,u):e):new h(3===u?-0:0)},Xe.modulo=Xe.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]?ot(new r(n),r.precision,r.rounding):(Ge=!1,9==r.modulo?(t=it(n,e.abs(),0,3,1)).s*=e.s:t=it(n,e,0,r.modulo,1),t=t.times(e),Ge=!0,n.minus(t))},Xe.naturalExponential=Xe.exp=function(){return mt(this)},Xe.naturalLogarithm=Xe.ln=function(){return _t(this)},Xe.negated=Xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s,ot(e)},Xe.plus=Xe.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)),Ge?ot(e,s,u):e;if(o=qe(f.e/7),r=qe(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)/Ze|0,c[i]%=Ze;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=st(c,r),Ge?ot(e,s,u):e},Xe.precision=Xe.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(Me+e);return n.d?(t=lt(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},Xe.round=function(){var e=this,t=e.constructor;return ot(new t(e),e.e+1,t.rounding)},Xe.sine=Xe.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 t.isZero()?t:xt(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=xt(e,2,t=t.times(1/bt(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,wt(r,n)),r.precision=e,r.rounding=t,ot(Ie>2?n.neg():n,e,t,!0)):new r(NaN)},Xe.squareRoot=Xe.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(Ge=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=et(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=qe((u+1)/2)-(u<0||u%2),r=new l(t=c==1/0?"5e"+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(it(a,o,n+2,1)).times(.5),et(o.d).slice(0,n)===(t=et(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))||(ot(r,u+1,1),e=!r.times(r).eq(a));break}if(!i&&(ot(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return Ge=!0,ot(r,u,l.rounding,e)},Xe.tangent=Xe.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=it(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,ot(2==Ie||4==Ie?n.neg():n,e,t,!0)):new r(NaN)},Xe.times=Xe.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=qe(l.e/7)+qe(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%Ze|0,t=s/Ze|0;o[i]=(o[i]+t)%Ze|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=st(o,n),Ge?ot(e,f.precision,f.rounding):e},Xe.toBinary=function(e,t){return Et(this,2,e,t)},Xe.toDecimalPlaces=Xe.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(tt(e,0,Oe),void 0===t?t=r.rounding:tt(t,0,8),ot(n,e+n.e+1,t))},Xe.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=at(r,!0):(tt(e,0,Oe),void 0===t?t=i.rounding:tt(t,0,8),n=at(r=ot(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},Xe.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=at(i):(tt(e,0,Oe),void 0===t?t=o.rounding:tt(t,0,8),n=at(r=ot(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},Xe.toFraction=function(e){var t,n,r,i,o,a,s,u,c,l,f,p,d=this,h=d.d,m=d.constructor;if(!h)return new m(d);if(c=n=new m(1),r=u=new m(0),a=(o=(t=new m(r)).e=lt(h)-d.e-1)%7,t.d[0]=je(10,a<0?7+a:a),null==e)e=o>0?t:c;else{if(!(s=new m(e)).isInt()||s.lt(c))throw Error(Me+s);e=s.gt(t)?o>0?t:c:s}for(Ge=!1,s=new m(et(h)),l=m.precision,m.precision=o=7*h.length*2;f=it(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=it(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=it(c,r,o,1).minus(d).abs().cmp(it(u,n,o,1).minus(d).abs())<1?[c,r]:[u,n],m.precision=l,Ge=!0,p},Xe.toHexadecimal=Xe.toHex=function(e,t){return Et(this,16,e,t)},Xe.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:tt(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]?(Ge=!1,n=it(n,e,0,t,1).times(e),Ge=!0,ot(n)):(e.s=n.s,n=e),n},Xe.toNumber=function(){return+this},Xe.toOctal=function(e,t){return Et(this,8,e,t)},Xe.toPower=Xe.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(je(+s,c));if((s=new u(s)).eq(1))return s;if(r=u.precision,o=u.rounding,e.eq(1))return ot(s,r,o);if((t=qe(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=pt(u,s,n,r),e.s<0?new u(1).div(i):ot(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=je(+s,c))&&isFinite(n)?new u(n+"").e:qe(c*(Math.log("0."+et(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(t>0?a/0:0):(Ge=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=mt(e.times(_t(s,r+n)),r)).d&&nt((i=ot(i,r+5,1)).d,r,o)&&(t=r+10,+et((i=ot(mt(e.times(_t(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=ot(i,r+1,0))),i.s=a,Ge=!0,u.rounding=o,ot(i,r,o))},Xe.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=at(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(tt(e,1,Oe),void 0===t?t=i.rounding:tt(t,0,8),n=at(r=ot(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},Xe.toSignificantDigits=Xe.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(tt(e,1,Oe),void 0===t?t=n.rounding:tt(t,0,8)),ot(new n(this),e,t)},Xe.toString=function(){var e=this,t=e.constructor,n=at(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},Xe.truncated=Xe.trunc=function(){return ot(new this.constructor(this),this.e+1,1)},Xe.valueOf=Xe.toJSON=function(){var e=this,t=e.constructor,n=at(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var it=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,a,s,u){var c,l,f,p,d,h,m,_,v,y,g,x,b,w,E,$,R,k,T,N,I=r.constructor,A=r.s==i.s?1:-1,S=r.d,C=i.d;if(!(S&&S[0]&&C&&C[0]))return new I(r.s&&i.s&&(S?!C||S[0]!=C[0]:C)?S&&0==S[0]||!C?0*A:A/0:NaN);for(u?(d=1,l=r.e-i.e):(u=Ze,d=7,l=qe(r.e/d)-qe(i.e/d)),T=C.length,R=S.length,y=(v=new I(A)).d=[],f=0;C[f]==(S[f]||0);f++);if(C[f]>(S[f]||0)&&l--,null==o?(w=o=I.precision,a=I.rounding):w=s?o+(r.e-i.e)+1:o,w<0)y.push(1),h=!0;else{if(w=w/d+2|0,f=0,1==T){for(p=0,C=C[0],w++;(f<R||p)&&w--;f++)E=p*u+(S[f]||0),y[f]=E/C|0,p=E%C|0;h=p||f<R}else{for((p=u/(C[0]+1)|0)>1&&(C=e(C,p,u),S=e(S,p,u),T=C.length,R=S.length),$=T,x=(g=S.slice(0,T)).length;x<T;)g[x++]=0;(N=C.slice()).unshift(0),k=C[0],C[1]>=u/2&&++k;do{p=0,(c=t(C,g,T,x))<0?(b=g[0],T!=x&&(b=b*u+(g[1]||0)),(p=b/k|0)>1?(p>=u&&(p=u-1),1==(c=t(m=e(C,p,u),g,_=m.length,x=g.length))&&(p--,n(m,T<_?N:C,_,u))):(0==p&&(c=p=1),m=C.slice()),(_=m.length)<x&&m.unshift(0),n(g,m,x,u),-1==c&&(c=t(C,g,T,x=g.length))<1&&(p++,n(g,T<x?N:C,x,u)),x=g.length):0===c&&(p++,g=[0]),y[f++]=p,c&&g[0]?g[x++]=S[$]||0:(g=[S[$]],x=1)}while(($++<R||void 0!==g[0])&&w--);h=void 0!==g[0]}y[0]||y.shift()}if(1==d)v.e=l,Ne=h;else{for(f=1,p=y[0];p>=10;p/=10)f++;v.e=f+l*d-1,ot(v,s?o+v.e+1:o,a,h)}return v}}();function ot(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])/je(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/je(10,i-a-1)%10|0}if(r=r||t<0||void 0!==f[p+1]||(a<0?l:l%je(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/je(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]=je(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=je(10,7-o),f[p]=a>0?(l/je(10,i-a)%je(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]==Ze&&(f[0]=1));break}if(f[p]+=s,f[p]!=Ze)break;f[p--]=0,s=1}for(o=f.length;0===f[--o];)f.pop()}return Ge&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e<d.minE&&(e.e=0,e.d=[0])),e}function at(e,t,n){if(!e.isFinite())return vt(e);var r,i=e.e,o=et(e.d),a=o.length;return t?(n&&(r=n-a)>0?o=o.charAt(0)+"."+o.slice(1)+ft(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+ft(-i-1)+o,n&&(r=n-a)>0&&(o+=ft(r))):i>=a?(o+=ft(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+ft(r))):((r=i+1)<a&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(o+="."),o+=ft(r))),o}function st(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function ut(e,t,n){if(t>Qe)throw Ge=!0,n&&(e.precision=n),Error(Ue);return ot(new e(De),t,1,!0)}function ct(e,t,n){if(t>Je)throw Error(Ue);return ot(new e(Be),t,n,!0)}function lt(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 ft(e){for(var t="";e--;)t+="0";return t}function pt(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(Ge=!1;;){if(n%2&&$t((o=o.times(t)).d,a)&&(i=!0),0===(n=qe(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}$t((t=t.times(t)).d,a)}return Ge=!0,o}function dt(e){return 1&e.d[e.d.length-1]}function ht(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 mt(e,t){var n,r,i,o,a,s,u,c=0,l=0,f=0,p=e.constructor,d=p.rounding,h=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?(Ge=!1,u=h):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=r=Math.log(je(2,f))/Math.LN10*2+5|0,n=o=a=new p(1),p.precision=u;;){if(o=ot(o.times(e),u,1),n=n.times(++l),et((s=a.plus(it(o,n,u,1))).d).slice(0,u)===et(a.d).slice(0,u)){for(i=f;i--;)a=ot(a.times(a),u,1);if(null!=t)return p.precision=h,a;if(!(c<3&&nt(a.d,u-r,d,c)))return ot(a,p.precision=h,d,Ge=!0);p.precision=u+=10,n=o=s=new p(1),l=0,c++}a=s}}function _t(e,t){var n,r,i,o,a,s,u,c,l,f,p,d=1,h=e,m=h.d,_=h.constructor,v=_.rounding,y=_.precision;if(h.s<0||!m||!m[0]||!h.e&&1==m[0]&&1==m.length)return new _(m&&!m[0]?-1/0:1!=h.s?NaN:m?0:h);if(null==t?(Ge=!1,l=y):l=t,_.precision=l+=10,r=(n=et(m)).charAt(0),!(Math.abs(o=h.e)<15e14))return c=ut(_,l+2,y).times(o+""),h=_t(new _(r+"."+n.slice(1)),l-10).plus(c),_.precision=y,null==t?ot(h,y,v,Ge=!0):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=et((h=h.times(e)).d)).charAt(0),d++;for(o=h.e,r>1?(h=new _("0."+n),o++):h=new _(r+"."+n.slice(1)),f=h,u=a=h=it(h.minus(1),h.plus(1),l,1),p=ot(h.times(h),l,1),i=3;;){if(a=ot(a.times(p),l,1),et((c=u.plus(it(a,new _(i),l,1))).d).slice(0,l)===et(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(ut(_,l+2,y).times(o+""))),u=it(u,new _(d),l,1),null!=t)return _.precision=y,u;if(!nt(u.d,l-10,v,s))return ot(u,_.precision=y,v,Ge=!0);_.precision=l+=10,c=a=h=it(f.minus(1),f.plus(1),l,1),p=ot(h.times(h),l,1),i=s=1}u=c,i+=2}}function vt(e){return String(e.s*e.s/0)}function yt(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),Ge&&(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 gt(e,t){var n,r,i,o,a,s,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),We.test(t))return yt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(He.test(t))n=16,t=t.toLowerCase();else if(Ve.test(t))n=2;else{if(!Ye.test(t))throw Error(Me+t);n=8}for((o=t.search(/p/i))>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=pt(r,new r(n),o,2*o)),o=l=(c=rt(t,n,Ze)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=st(c,l),e.d=c,Ge=!1,a&&(e=it(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?je(2,u):pn.pow(2,u))),Ge=!0,e)}function xt(e,t,n,r,i){var o,a,s,u,c=e.precision,l=Math.ceil(c/7);for(Ge=!1,u=n.times(n),s=new e(r);;){if(a=it(s.times(u),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=it(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 Ge=!0,a.d.length=l+1,a}function bt(e,t){for(var n=e;--t;)n*=e;return n}function wt(e,t){var n,r=t.s<0,i=ct(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return Ie=r?4:1,t;if((n=t.divToInt(i)).isZero())Ie=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return Ie=dt(n)?r?2:3:r?4:1,t;Ie=dt(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Et(e,t,n,r){var i,o,a,s,u,c,l,f,p,d=e.constructor,h=void 0!==n;if(h?(tt(n,1,Oe),void 0===r?r=d.rounding:tt(r,0,8)):(n=d.precision,r=d.rounding),e.isFinite()){for(h?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(a=(l=at(e)).indexOf("."))>=0&&(l=l.replace(".",""),(p=new d(1)).e=l.length-a,p.d=rt(at(p),10,i),p.e=p.d.length),o=u=(f=rt(l,10,i)).length;0==f[--u];)f.pop();if(f[0]){if(a<0?o--:((e=new d(e)).d=f,e.e=o,f=(e=it(e,p,n,r,0,i)).d,o=e.e,c=Ne),a=f[n],s=i/2,c=c||void 0!==f[n+1],c=r<4?(void 0!==a||c)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||c||6===r&&1&f[n-1]||r===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(u=f.length;!f[u-1];--u);for(a=0,l="";a<u;a++)l+=Le.charAt(f[a]);if(h){if(u>1)if(16==t||8==t){for(a=16==t?4:3,--u;u%a;u++)l+="0";for(u=(f=rt(l,i,t)).length;!f[u-1];--u);for(a=1,l="1.";a<u;a++)l+=Le.charAt(f[a])}else l=l.charAt(0)+"."+l.slice(1);l=l+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)l="0"+l;l="0."+l}else if(++o>u)for(o-=u;o--;)l+="0";else o<u&&(l=l.slice(0,o)+"."+l.slice(o))}else l=h?"0p+0":"0";l=(16==t?"0x":2==t?"0b":8==t?"0o":"")+l}else l=vt(e);return e.s<0?"-"+l:l}function $t(e,t){if(e.length>t)return e.length=t,!0}function Rt(e){return new this(e).abs()}function kt(e){return new this(e).acos()}function Tt(e){return new this(e).acosh()}function Nt(e,t){return new this(e).plus(t)}function It(e){return new this(e).asin()}function At(e){return new this(e).asinh()}function St(e){return new this(e).atan()}function Ct(e){return new this(e).atanh()}function Ot(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?ct(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=ct(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(it(e,t,o,1)),t=ct(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(it(e,t,o,1)):(n=ct(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Lt(e){return new this(e).cbrt()}function Dt(e){return ot(e=new this(e),e.e+1,2)}function Bt(e,t,n){return new this(e).clamp(t,n)}function Pt(e){if(!e||"object"!=typeof e)throw Error(Fe+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,Oe,"rounding",0,8,"toExpNeg",-Ce,0,"toExpPos",0,Ce,"maxE",0,Ce,"minE",-Ce,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(n=o[t],i&&(this[n]=Pe[n]),void 0!==(r=e[n])){if(!(qe(r)===r&&r>=o[t+1]&&r<=o[t+2]))throw Error(Me+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=Pe[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(Me+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(Ke);this[n]=!0}else this[n]=!1}return this}function Gt(e){return new this(e).cos()}function Ft(e){return new this(e).cosh()}function Mt(e,t){return new this(e).div(t)}function Ut(e){return new this(e).exp()}function Kt(e){return ot(e=new this(e),e.e+1,3)}function zt(){var e,t,n=new this(0);for(Ge=!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 Ge=!0,new this(1/0);n=t}return Ge=!0,n.sqrt()}function qt(e){return e instanceof pn||e&&e.toStringTag===ze||!1}function jt(e){return new this(e).ln()}function Vt(e,t){return new this(e).log(t)}function Ht(e){return new this(e).log(2)}function Yt(e){return new this(e).log(10)}function Wt(){return ht(this,arguments,"lt")}function Zt(){return ht(this,arguments,"gt")}function Qt(e,t){return new this(e).mod(t)}function Jt(e,t){return new this(e).mul(t)}function Xt(e,t){return new this(e).pow(t)}function en(e){var t,n,r,i,o=0,a=new this(1),s=[];if(void 0===e?e=this.precision:tt(e,1,Oe),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(Ke);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=je(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 tn(e){return ot(e=new this(e),e.e+1,this.rounding)}function nn(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function rn(e){return new this(e).sin()}function on(e){return new this(e).sinh()}function an(e){return new this(e).sqrt()}function sn(e,t){return new this(e).sub(t)}function un(){var e=0,t=arguments,n=new this(t[e]);for(Ge=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Ge=!0,ot(n,this.precision,this.rounding)}function cn(e){return new this(e).tan()}function ln(e){return new this(e).tanh()}function fn(e){return ot(e=new this(e),e.e+1,1)}Xe[Symbol.for("nodejs.util.inspect.custom")]=Xe.toString,Xe[Symbol.toStringTag]="Decimal";var pn=Xe.constructor=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,qt(e))return i.s=e.s,void(Ge?!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(Ge?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)):yt(i,e.toString())}if("string"!==r)throw Error(Me+e);return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),We.test(e)?yt(i,e):gt(i,e)}if(o.prototype=Xe,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=Pt,o.clone=e,o.isDecimal=qt,o.abs=Rt,o.acos=kt,o.acosh=Tt,o.add=Nt,o.asin=It,o.asinh=At,o.atan=St,o.atanh=Ct,o.atan2=Ot,o.cbrt=Lt,o.ceil=Dt,o.clamp=Bt,o.cos=Gt,o.cosh=Ft,o.div=Mt,o.exp=Ut,o.floor=Kt,o.hypot=zt,o.ln=jt,o.log=Vt,o.log10=Yt,o.log2=Ht,o.max=Wt,o.min=Zt,o.mod=Qt,o.mul=Jt,o.pow=Xt,o.random=en,o.round=tn,o.sign=nn,o.sin=rn,o.sinh=on,o.sqrt=an,o.sub=sn,o.sum=un,o.tan=cn,o.tanh=ln,o.trunc=fn,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}(Pe);De=new pn(De),Be=new pn(Be);const dn=pn;function hn(e){return new dn(e)}function mn(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 _n(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 vn(e){return new dn(e)}function yn(e){var t=e,n=j.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 gn(e){var t=j.getCurrentLexer();return(e?t.getReservedKeys()[t.getRules().RK_TRUE]:t.getReservedKeys()[t.getRules().RK_FALSE]).replace(/'/g,"")}function xn(e,t){switch(t.ord){case ye.INTEGER.ord:return e.toString();case ye.REAL.ord:return e.dp()<=0?e.toFixed(1):e.toFixed(q.decimalPlaces);case ye.BOOLEAN.ord:return gn(e);default:return e}}function bn(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function wn(e,t,n){return wn=bn()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&f(i,n.prototype),i},wn.apply(null,arguments)}function En(e){var t="function"==typeof Map?new Map:void 0;return En=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return wn(e,arguments,m(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)},En(e)}var $n=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this,e)).id=t,n._context={},Error.captureStackTrace&&Error.captureStackTrace(d(n),i),n}return l(i,[{key:"context",get:function(){return this._context},set:function(e){this._context=e}}]),i}(En(Error));var Rn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this,e)).id=t,n._context={},Error.captureStackTrace&&Error.captureStackTrace(d(n),i),n}return l(i,[{key:"context",get:function(){return this._context},set:function(e){this._context=e}}]),i}(En(Error));function kn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=ir();return new $n(n.getError(e,t),e)}function Tn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=ir();return new Rn(n.getError(e,t),e)}var Nn=Object.freeze({symbol_not_found_full:function(e,t){if(t){var n=Tn("symbol_not_found_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Nn.symbol_not_found(e)},symbol_not_found:function(e){return Tn("symbol_not_found",[e])},function_missing_full:function(e,t){if(t){var n=Tn("function_missing_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Nn.function_missing(e)},function_missing:function(e){return Tn("function_missing",[e])},main_missing:function(){return Tn("main_missing")},array_dimension_not_int_full:function(e){if(e){var t=Tn("array_dimension_not_int_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Nn.array_dimension_not_int()},array_dimension_not_int:function(){return Tn("array_dimension_not_int")},unknown_command_full:function(e){if(e){var t=kn("unknown_command_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Nn.unknown_command()},unknown_command:function(){return kn("unknown_command")},incompatible_types_full:function(e,t,n,r,i,o){var a=ir();if(o){var s=Tn("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 Nn.incompatible_types(e,t,n,r,i)},incompatible_types:function(e,t,n,r,i){var o=ir();return Tn("incompatible_types",[o.translateType(e,t),i,o.translateType(n,r)])},incompatible_types_array_full:function(e,t,n,r){var i=ir();if(r){var o=Tn("incompatible_types_array_full",[e,i.translateType(t,n),r.line,r.column]);return o.context={line:r.line,column:r.column},o}return Nn.incompatible_types_array(e,t,n)},incompatible_types_array:function(e,t,n){return Tn("incompatible_types_array",[e,ir().translateType(t,n)])},loop_condition_type_full:function(e,t){if(t){var n=Tn("loop_condition_type_full",[t.line,t.column,e]);return n.context={line:t.line,column:t.column},n}return Nn.loop_condition_type(e)},loop_condition_type:function(e){return Tn("loop_condition_type",[e])},endless_loop_full:function(e){if(e){var t=Tn("endless_loop_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Nn.endless_loop()},endless_loop:function(){return Tn("endless_loop")},if_condition_type_full:function(e,t){if(t){var n=Tn("if_condition_type_full",[t.line,t.column,e]);return n.context={line:t.line,column:t.column},n}return Nn.if_condition_type(e)},if_condition_type:function(e){return Tn("if_condition_type",[e])},invalid_global_var:function(){return kn("invalid_global_var")},not_implemented:function(e){return kn("not_implemented",[e])},invalid_case_type_full:function(e,t,n,r){var i=ir();if(r){var o=Tn("invalid_case_type_full",[e,i.translateType(t,n),r.line,r.column]);return o.context={line:r.line,column:r.column},o}return Nn.invalid_case_type(e,t,n)},invalid_case_type:function(e,t,n){return Tn("invalid_case_type",[e,ir().translateType(t,n)])},void_in_expression_full:function(e,t){if(t){var n=Tn("void_in_expression_full",[t.line,t.column,e]);return n.context={line:t.line,column:t.column},n}return Nn.void_in_expression(e)},void_in_expression:function(e){return Tn("void_in_expression",[e])},invalid_array_access_full:function(e,t){if(t){var n=Tn("invalid_array_access_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Nn.invalid_array_access(e)},invalid_array_access:function(e){return Tn("invalid_array_access",[e])},invalid_matrix_access_full:function(e,t){if(t){var n=Tn("invalid_matrix_access_full",[e,t.line,t.column]);return n.context={line:t.line,column:t.column},n}return Nn.invalid_matrix_access(e)},invalid_matrix_access:function(e){return Tn("invalid_matrix_access",[e])},matrix_column_outbounds_full:function(e,t,n,r){if(r){var i=kn("matrix_column_outbounds_full",[r.line,t,e,n]);return i.context={line:r.line,column:r.column},i}return Nn.matrix_column_outbounds(e,t,n)},matrix_column_outbounds:function(e,t,n){return kn("matrix_column_outbounds",[t,e,n])},matrix_line_outbounds_full:function(e,t,n,r){if(r){var i=kn("matrix_line_outbounds_full",[r.line,t,e,n]);return i.context={line:r.line,column:r.column},i}return Nn.matrix_line_outbounds(e,t,n)},matrix_line_outbounds:function(e,t,n){return kn("matrix_line_outbounds",[t,e,n])},vector_line_outbounds_full:function(e,t,n,r){if(r){var i=kn("vector_line_outbounds_full",[r.line,t,e,n]);return i.context={line:r.line,column:r.column},i}return Nn.vector_line_outbounds(e,t,n)},vector_line_outbounds:function(e,t,n){return kn("vector_line_outbounds",[t,e,n])},vector_not_matrix_full:function(e,t){if(t){var n=kn("vector_not_matrix_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Nn.vector_not_matrix(e)},vector_not_matrix:function(e){return kn("vector_not_matrix",[e])},function_no_return:function(e){return Tn("function_no_return",[e])},invalid_void_return_full:function(e,t,n,r){var i=ir();if(r){var o=Tn("invalid_void_return_full",[r.line,e,i.translateType(t,n)]);return o.context={line:r.line,column:r.column},o}return Nn.invalid_void_return(e,t,n)},invalid_void_return:function(e,t,n){return Tn("invalid_void_return_full",[e,ir().translateType(t,n)])},invalid_return_type_full:function(e,t,n,r){var i=ir();if(r){var o=Tn("invalid_return_type_full",[r.line,e,i.translateType(t,n)]);return o.context={line:r.line,column:r.column},o}return Nn.invalid_return_type(e,t,n)},invalid_return_type:function(e,t,n){return Tn("invalid_return_type",[e,ir().translateType(t,n)])},invalid_parameters_size_full:function(e,t,n,r){if(r){var i=Tn("invalid_parameters_size_full",[r.line,e,t,n]);return i.context={line:r.line,column:r.column},i}return Nn.invalid_parameters_size(e,t,n)},invalid_parameters_size:function(e,t,n){return Tn("invalid_parameters_size",[e,t,n])},invalid_parameter_type_full:function(e,t,n){if(n){var r=Tn("invalid_parameter_type_full",[t,nr.getLocalName(e),n.line]);return r.context={line:n.line,column:n.column},r}return Nn.invalid_parameter_type(e,t)},invalid_parameter_type:function(e,t){return Tn("invalid_parameter_type_full",[t,nr.getLocalName(e)])},invalid_ref_full:function(e,t,n){if(n){var r=Tn("invalid_ref_full",[t,e,n.line]);return r.context={line:n.line,column:n.column},r}return Nn.invalid_ref(e,t)},invalid_ref:function(e,t){return Tn("invalid_ref",[t,e])},unexpected_break_command_full:function(e){if(e){var t=kn("unexpected_break_command_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Nn.unexpected_break_command()},unexpected_break_command:function(){return kn("unexpected_break_command")},invalid_array_literal_type_full:function(e,t){if(t){var n=kn("invalid_array_literal_type_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Nn.invalid_array_literal_type(e)},invalid_array_literal_type:function(e){return kn("invalid_array_literal_type",[e])},invalid_array_literal_line_full:function(e,t,n){if(n){var r=kn("invalid_array_literal_line_full",[n.line,e,t]);return r.context={line:n.line,column:n.column},r}return Nn.invalid_array_literal_type(e,t)},invalid_array_literal_line:function(e,t){return kn("invalid_array_literal_line",[e,t])},invalid_array_literal_column_full:function(e,t,n){if(n){var r=kn("invalid_array_literal_column_full",[n.line,e,t]);return r.context={line:n.line,column:n.column},r}return Nn.invalid_array_literal_column(e,t)},invalid_array_literal_column:function(e,t){return kn("invalid_array_literal_column",[e,t])},invalid_unary_op_full:function(e,t,n,r,i){var o=ir();if(i){var a=kn("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 Nn.invalid_unary_op(t,n,r)},invalid_unary_op:function(e,t,n,r){var i=ir();return kn("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=ir();if(a){var u=kn("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 Nn.invalid_infix_op(t,n,r,i,o)},invalid_infix_op:function(e,t,n,r,i,o){var a=ir();return kn("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=Tn("array_dimension_not_positive_full",[e.line]);return t.context={line:e.line,column:e.column},t}return Nn.array_dimension_not_positive()},array_dimension_not_positive:function(){return Tn("array_dimension_not_positive")},invalid_type_conversion:function(e,t,n){return kn("invalid_type_conversion",[e,ir().translateType(t,n)])},invalid_read_type:function(e,t,n,r,i){var o=ir(),a=kn("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=ir(),u=kn("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=Tn("invalid_const_ref_full",[t,nr.getLocalName(e),n.line]);return r.context={line:n.line,column:n.column},r}return Nn.invalid_const_ref(e,t)},invalid_const_ref:function(e,t){return Tn("invalid_const_ref",[t,nr.getLocalName(e)])},invalid_const_assignment_full:function(e,t){if(t){var n=Tn("invalid_const_assignment_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Nn.invalid_const_assignment(e)},invalid_const_assignment:function(e){return Tn("invalid_const_assignment",[e])},invalid_vector_assignment_full:function(e,t,n,r,i){if(i){var o=kn("invalid_vector_assignment_full",[i.line,e,t,n,r]);return o.context={line:i.line,column:i.column},o}return Nn.invalid_vector_assignment(e,t,n,r)},invalid_vector_assignment:function(e,t,n,r){return kn("invalid_vector_assignment",[e,t,n,r])},invalid_matrix_assignment_full:function(e,t,n,r,i,o,a){if(a){var s=kn("invalid_matrix_assignment_full",[a.line,e,t,n,r,i,o]);return s.context={line:a.line,column:a.column},s}return Nn.invalid_matrix_assignment(e,t,n,r,i,o)},invalid_matrix_assignment:function(e,t,n,r,i,o){return kn("invalid_matrix_assignment",[e,t,n,r,i,o])},matrix_to_vector_attr:function(e,t,n){var r=Tn("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=Tn("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=kn("invalid_matrix_index_assign_full",[o.line,t,e,n,r,i]);return a.context={line:o.line,column:o.column},a}return Nn.invalid_matrix_index_assign(e,t,n,r,i)},invalid_matrix_index_assign:function(e,t,n,r,i){return kn("invalid_matrix_index_assign",[t,e,n,r,i])},invalid_number_elements_vector:function(e,t,n,r){var i=kn("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=kn("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=kn("divsion_by_zero_full",[t.line,e]);return n.context={line:t.line,column:t.column},n}return Nn.divsion_by_zero(e)},divsion_by_zero:function(e){return kn("divsion_by_zero",[e])},undefined_tanget_value:function(e,t){var n=kn("undefined_tanget_value",[t.line,e]);return n.context={line:t.line,column:t.column},n},negative_log_value:function(e){var t=kn("negative_log_value",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_string_index:function(e,t,n){var r=nr.getLocalName("$charAt"),i=kn("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=kn("negative_sqrt_value",[e.line]);return t.context={line:e.line,column:e.column},t},exceeded_recursive_calls:function(e){var t=kn("exceeded_recursive_calls",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_for_variable:function(e,t){var n=Tn("invalid_for_variable",[t.line,e]);return n.context={line:t.line,column:t.column},n},invalid_for_from:function(e,t){var n=Tn("invalid_for_from",[t.line,e]);return n.context={line:t.line,column:t.column},n},invalid_for_to:function(e,t){var n=Tn("invalid_for_to",[t.line,e]);return n.context={line:t.line,column:t.column},n},invalid_for_pass:function(e,t){var n=Tn("invalid_for_pass",[t.line,e]);return n.context={line:t.line,column:t.column},n},exceed_max_instructions:function(){return kn("exceed_max_instructions")}}),In=function(){function e(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a(this,e),K(this,"type",void 0),K(this,"id",void 0),K(this,"isConst",void 0),K(this,"value",void 0),this.type=t,this.id=r,this.isConst=i,this.value=n}return l(e,[{key:"get",value:function(){return this.value}},{key:"inStore",value:function(){return null!=this.id}}]),e}(),An=function(){function e(t,n){a(this,e),this.dimensions=n,K(this,"innerType",void 0),this.innerType=t}return l(e,[{key:"isVector",get:function(){return 1==this.dimensions}},{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:"value",get:function(){}},{key:"ord",get:function(){}},{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)}}]),e}();var Sn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n){var o;return a(this,i),(o=r.call(this)).id=e,o.line=t,o.column=n,o}return l(i,[{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}}]),i}(Te);var Cn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this)).type=e,t}return l(i)}(Te);var On=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this,ye.INTEGER)).value=e,t}return l(i,[{key:"toString",value:function(){var e=xn(this.value,this.type);return this.parenthesis?"(".concat(e,")"):e}}]),i}(Cn);var Ln=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this,ye.REAL)).value=e,t}return l(i,[{key:"toString",value:function(){var e=xn(this.value,this.type);return this.parenthesis?"(".concat(e,")"):e}}]),i}(Cn);var Dn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this,ye.BOOLEAN)).value=e,t}return l(i,[{key:"toString",value:function(){var e=gn(this.value);return this.parenthesis?"(".concat(e,")"):e}}]),i}(Cn);var Bn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this,ye.CHAR)).value=e,t}return l(i,[{key:"toString",value:function(){var e="'".concat(this.value,"'");return this.parenthesis?"(".concat(e,")"):e}}]),i}(Cn);var Pn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this,ye.STRING)).value=e,t}return l(i,[{key:"toString",value:function(){var e='"'+this.value+'"';return this.parenthesis?"(".concat(e,")"):e}}]),i}(Cn);var Gn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this,e)).value=t,n}return l(i,[{key:"subtype",get:function(){var e=this.value[0];return e instanceof i?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 i?e.value.length:null}},{key:"isVector",get:function(){return null===this.columns}},{key:"isValid",get:function(){return this.validateSize()&&this.validateType()}},{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}}]),i}(Cn);var Fn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this,ye.UNDEFINED)).id=e,t}return l(i,[{key:"toString",value:function(){return this.parenthesis?"(".concat(this.id,")"):this.id}}]),i}(Cn);var Mn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n){var o;return a(this,i),(o=r.call(this)).op=e,o.left=t,o.right=n,o}return l(i,[{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}}]),i}(Te);var Un=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){return a(this,i),r.call(this,e,t,null)}return l(i,[{key:"toString",value:function(){var e=this.left.toString(),t=this.op.value;return this.parenthesis?"(".concat(t+e,")"):t+e}}]),i}(Mn),Kn=function(){function e(t,n,r,i){a(this,e),this.line=t,this.column=n,this.text=r,this.size=i}return l(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}(),zn=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 qn(e){switch(e){case"+":return zn.ADD;case"-":return zn.SUB;case"*":return zn.MULT;case"/":return zn.DIV;case"%":return zn.MOD;case">":return zn.GT;case">=":return zn.GE;case"<":return zn.LT;case"<=":return zn.LE;case"==":return zn.EQ;case"!=":return zn.NEQ;case"and":return zn.AND;case"or":return zn.OR;case"not":return zn.NOT}return null}var jn=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n;return a(this,i),(n=r.call(this,e)).id=t,n._context={},Error.captureStackTrace&&Error.captureStackTrace(d(n),i),n}return l(i,[{key:"context",get:function(){return this._context},set:function(e){this._context=e}}]),i}(En(Error));function Vn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=ir().getError(e,t);return new jn(n,e)}var Hn=Object.freeze({extra_lines:function(){return new jn(ir().getError("extra_lines"))},token_missing_one:function(e,t){var n=Vn("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(ir().getOR()),r=Hn.token_missing_one(n,t);return r.context={line:t.line,column:t.col},r},id_missing:function(e){var t=Vn("id_missing",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},eos_missing:function(e){var t=Vn("eos_missing",[e.line,e.col]);return t.context={line:e.line,column:e.col},t},invalid_array_dimension:function(e,t){var n=Vn("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=Vn("invalid_array_size",[e.line]);return t.context={line:e.line,column:e.col},t},invalid_main_return:function(e,t,n){var r=Vn("invalid_main_return",[e,t,n.line]);return r.context={line:n.line,column:n.col},r},invalid_var_declaration:function(e){var t=Vn("invalid_var_declaration",[e.line]);return t.context={line:e.line,column:e.col},t},invalid_break_command:function(e,t){var n=Vn("invalid_break_command",[t.line,e]);return n.context={line:t.line,column:t.col},n},invalid_terminal:function(e){var t=Vn("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(ir().getOR()),r=Vn("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=Vn("const_not_init",[e.line,e.col]);return t.context={line:e.line,column:e.col},t},invalid_id_format:function(e){var t=Vn("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=Vn("duplicate_function",[e.text,e.line,e.col]);return t.context={line:e.line,column:e.col},t},main_parameters:function(){return Vn("main_parameters")},duplicate_variable:function(e){var t=Vn("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=Vn("invalid_character",[e,t]);return r.context={line:t,column:n},r},annonymous_array_literal:function(e){var t=Vn("annonymous_array_literal",[e.line]);return t.context={line:e.line,column:e.col},t},invalid_matrix_literal_line:function(e,t){var n=Vn("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=Vn("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=Vn("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=Vn("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=Vn("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=Vn("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=Vn("array_init_not_literal",[e.line]);return t.context={line:e.line,column:e.column},t},array_exceeds_2d:function(e){var t=Vn("array_exceeds_2d",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_matrix_id_dimension:function(e){var t=Vn("invalid_matrix_id_dimension",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_vector_init:function(e){var t=Vn("invalid_vector_init",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_matrix_init:function(e){var t=Vn("invalid_matrix_init",[e.line]);return t.context={line:e.line,column:e.column},t},invalid_syntax:function(e,t,n){var r=Vn("invalid_syntax",[e,t]);return r.context={line:t,column:n},r}}),Yn=function(){function e(t,n){a(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=y(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 l(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 Hn.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()),Hn.extra_lines();return this.popVariableStack(),{global:t,functions:n}}throw Hn.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 Hn.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 Hn.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 Hn.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 Hn.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 Hn.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 Hn.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 Hn.eos_missing(t)}return!0}},{key:"checkFunctionDuplicate",value:function(e,t){var n=null===e?"$main":e;if(-1!==this.definedFuncsNameList.indexOf(n))throw Hn.duplicate_function(t);this.definedFuncsNameList.push(n)}},{key:"checkVariableDuplicate",value:function(e,t){if(-1!==this.getCurrentVariableStack().indexOf(e))throw Hn.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 Hn.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 Hn.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=Kn.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 Hn.const_not_init(a);u.type===this.ruleNames.ASSIGNMENT&&(this.pos++,n=this.parseExpressionOR());var c=new ie(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 Fn||a instanceof Fn)&&(f=!0,i>1&&(null==o||null==a)))throw Hn.invalid_matrix_id_dimension(Kn.createSourceInfo(s));if(t&&s.type!==this.ruleNames.ASSIGNMENT)throw Hn.const_not_init(r);if(s.type===this.ruleNames.ASSIGNMENT){if(f)throw 1==i?Hn.invalid_vector_init(Kn.createSourceInfo(s)):Hn.invalid_matrix_init(Kn.createSourceInfo(s));this.pos+=1,l=this.parseArrayLiteral(e)}if(null==l&&null==o){if(i>1)throw Hn.cannot_infer_matrix_line(n,r);throw Hn.cannot_infer_vector_size(n,r)}if(i>1&&null==l&&null==a)throw Hn.cannot_infer_matrix_column(n,r);if(1===i&&null!=l&&!l.isVector){var p=l.toString();throw Hn.matrix_to_vector_literal_attr(n,p,l.sourceInfo)}if(i>1&&null!=l&&l.isVector){var d=l.toString();throw Hn.vector_to_matrix_literal_attr(n,d,l.sourceInfo)}null==o&&((u=new On(hn(l.lines))).sourceInfo=r),i>1&&null==a&&((c=new On(hn(l.columns))).sourceInfo=r);var h=new oe(n,new An(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 Hn.invalid_array_dimension(this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_INTEGER],e)}},{key:"getIntLiteral",value:function(e){var t=e.text,n=Kn.createSourceInfo(e),r=new On(hn(t));return r.sourceInfo=n,r}},{key:"getRealLiteral",value:function(e){var t=Kn.createSourceInfo(e),n=new Ln(vn(e.text));return n.sourceInfo=t,n}},{key:"getStringLiteral",value:function(e){var t=e.text,n=Kn.createSourceInfo(e),r=new Pn(mn(t));return r.sourceInfo=n,r}},{key:"getCharLiteral",value:function(e){var t=e.text,n=new Bn(_n(t));return n.sourceInfo=Kn.createSourceInfo(e),n}},{key:"getBoolLiteral",value:function(e){var t=yn(e.text),n=new Dn(t);return n.sourceInfo=Kn.createSourceInfo(e),n}},{key:"parseArrayLiteral",value:function(e){if(!this.checkOpenCurly(!0)){var t=this.getToken();throw Hn.array_init_not_literal(Kn.createSourceInfo(t))}var n=this.getToken();if(this.parsingArrayDimension>=2)throw Hn.array_exceeds_2d(Kn.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=Kn.createSourceInfoFromList(n,i),a=1;r[0]instanceof Gn?a+=1:1==r.length&&console.log("Talvez uma variável seja uma melhor opção");var s=new An(e,a),u=new Gn(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 Hn.array_exceeds_2d(Kn.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=Kn.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 Hn.invalid_matrix_literal_line(s,a)}var u=new An(e,1),c=new Gn(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=Kn.createSourceInfo(e),n=new Fn(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 An(r,i));var c=new ge(a,u,t,s);if(null===a&&!c.isMain)throw Hn.invalid_main_return(nr.getMainFunctionName(),this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_VOID],n.line);if(c.isMain&&0!==t.length)throw Hn.main_parameters();return this.popScope(),c.sourceInfo=Kn.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 An(r,t):r;var s=new ke(a,o,n);if(s.sourceInfo=Kn.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 Hn.id_missing(t);return this.pos++,this.insideScope(e.FUNCTION)&&t.text===nr.getMainFunctionName()?null:t.text}},{key:"parseMaybeLibID",value:function(){var e=this.getToken();if(e.type!==this.ruleNames.ID)throw Hn.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 Hn.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 ye.VOID;if(t.type===this.ruleNames.RK_VOID&&this.insideScope(e.FUNCTION))return this.pos++,ye.VOID;if(this.isVariableType(t))switch(this.pos++,t.type){case this.ruleNames.RK_INTEGER:return ye.INTEGER;case this.ruleNames.RK_BOOLEAN:return ye.BOOLEAN;case this.ruleNames.RK_REAL:return ye.REAL;case this.ruleNames.RK_STRING:return ye.STRING;case this.ruleNames.RK_CHARACTER:return ye.CHAR}throw Hn.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 Hn.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 be(t,n)}},{key:"parseCommand",value:function(){var t=this.getToken();if(this.isVariableType(t)){if(!this.insideScope(e.FUNCTION))throw Hn.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 Hn.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 Hn.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 Ee(n,r);return i.sourceInfo=Kn.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 Hn.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 we(i,n);return o.sourceInfo=Kn.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 Hn.token_missing_list([this.ivprogLexer.getReservedKeys()[this.ruleNames.RK_IF],"{"],i);o=this.parseIfThenElse()}this.popScope();var a=new xe(n,r,o);return a.sourceInfo=Kn.createSourceInfo(t),a}this.popScope();var s=new xe(n,r,null);return s.sourceInfo=Kn.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 Fn(r);i.sourceInfo=Kn.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 se(i,o,a,s,u);return c.sourceInfo=Kn.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 ae(n,r);return i.sourceInfo=Kn.createSourceInfo(t),i}},{key:"parseBreak",value:function(){var e=this.getToken();this.pos++,this.checkEOS(),this.pos++;var t=new ee;return t.sourceInfo=Kn.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 te(t);return n.sourceInfo=Kn.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 Hn.token_missing_one("<-",o);this.pos++;var a=this.parseExpressionOR();this.checkEOS(),this.pos++;var s=new re(t,r,i,a);return s.sourceInfo=Kn.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 ne(t,c);return l.sourceInfo=Kn.createSourceInfo(u),l}if(u.type===this.ruleNames.OPEN_PARENTHESIS){var f=this.parseFunctionCallCommand(t);return this.checkEOS(),this.pos++,f}throw n?Hn.token_missing_list(["<-","("],u):Hn.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 Fn(this.parseID())).sourceInfo=Kn.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 Un(qn(o),a)),a}},{key:"parseCases",value:function(){var e=this.getToken();if(e.type!==this.ruleNames.RK_CASE)throw Hn.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 Hn.token_missing_one(":",t);this.pos++,this.consumeNewLines();var n=this.parseCommandBlock(!0),r=new $e(null);return r.sourceInfo=Kn.createSourceInfo(e),r.setCommands(n.commands),[r]}var i=this.parseExpressionOR(),o=this.getToken();if(o.type!==this.ruleNames.COLON)throw Hn.token_missing_one(":",o);this.pos++,this.consumeNewLines();var a=this.parseCommandBlock(!0),s=new $e(i);return s.sourceInfo=Kn.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=qn("or");this.consumeNewLines();var r=this.parseExpressionAND(),i=new Mn(n,e,r);i.sourceInfo=Kn.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=qn("and");this.consumeNewLines();var r=this.parseExpressionNot(),i=new Mn(n,e,r);i.sourceInfo=Kn.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=qn("not"),n=this.parseExpressionRel(),r=new Un(t,n);return r.sourceInfo=Kn.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=qn(t.text),r=this.parseExpression(),i=new Mn(n,e,r);i.sourceInfo=Kn.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=qn(t.text),r=this.parseFactor(),i=new Mn(n,e,r);i.sourceInfo=Kn.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=qn(t.text),r=this.parseTerm(),i=new Mn(n,e,r);i.sourceInfo=Kn.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=Kn.createSourceInfo(e),(n=new Un(qn(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 Hn.annonymous_array_literal(e);case this.ruleNames.ID:return this.parseIDTerm();case this.ruleNames.OPEN_PARENTHESIS:return this.parseParenthesisExp();default:throw Hn.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=Kn.createSourceInfoFromList(e,r),s=new Sn(t,i,o);return s.sourceInfo=a,s}if(this.checkOpenParenthesis(!0))return this.parseFunctionCallExpression(t);if(n){var u=Kn.createSourceInfo(e),c=new Fn(t);return c.sourceInfo=u,c}throw Hn.invalid_id_format(e)}},{key:"getFunctionName",value:function(e){var t=nr.getInternalName(e);return null===t?e===nr.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=Kn.createSourceInfoFromList(n,i),s=new Ae(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=Kn.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]}))}}],[{key:"createParser",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=j.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"}}}]),e}();function Wn(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||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.")}()}function Zn(e){return e.times(pn.acos(-1)).div(180)}var Qn=Date.now();function Jn(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===e)return n;return null}var Xn,er={$mathLib:{$sin:(Xn=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().mod(360),null,a=i.eq(90)?new pn(1):i.eq(180)?new pn(0):i.eq(270)?new pn(-1):pn.sin(Zn(i)),s=new In(ye.REAL,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)}}())]),new ge("$sin",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],Xn)),$cos:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().mod(360),a=null,i.eq(90)?a=new pn(0):i.eq(180)?a=new pn(-1):i.eq(270)&&(a=new pn(0)),a=pn.cos(Zn(i)),s=new In(ye.REAL,a),t.insertStore("$",s),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)}}())]);return new ge("$cos",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$tan:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().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 Nn.undefined_tanget_value(r.get().toNumber(),this.function_call_stack.pop());case 4:return a=pn.tan(Zn(i)),s=new In(ye.REAL,a),t.insertStore("$",s),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)}}())]);return new ge("$tan",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$sqrt:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().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(Nn.negative_sqrt_value(this.function_call_stack.pop())));case 3:return i=r.get().sqrt(),a=new In(ye.REAL,i),t.insertStore("$",a),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)}}())]);return new ge("$sqrt",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$pow:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=t.applyStore("y"),a=r.get().pow(i.get()),s=new In(ye.REAL,a),t.insertStore("$",s),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)}}())]);return new ge("$pow",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1),new ke(new ce([ye.INTEGER,ye.REAL]),"y",!1)],e)}(),$log:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().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(Nn.negative_log_value(this.function_call_stack.pop())));case 3:return i=pn.log10(r.get()),a=new In(ye.REAL,i),t.insertStore("$",a),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)}}())]);return new ge("$log",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$abs:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().abs(),a=new In(r.type,i),t.insertStore("$",a),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)}}())]);return new ge("$abs",new ce([ye.INTEGER,ye.REAL]),[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$negate:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=r.get().negated(),a=new In(r.type,i),t.insertStore("$",a),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)}}())]);return new ge("$negate",new ce([ye.INTEGER,ye.REAL]),[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$invert:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("x"),i=vn(1).dividedBy(r.get()),a=new In(ye.REAL,i),t.insertStore("$",a),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)}}())]);return new ge("$invert",ye.REAL,[new ke(new ce([ye.INTEGER,ye.REAL]),"x",!1)],e)}(),$max:function(){var e=function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().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()})),a=pn.max.apply(pn,Wn(i)),s=new In(r.type.innerType,a),t.insertStore("$",s),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)}}(),n=new An(new ce([ye.INTEGER,ye.REAL]),1),r=new be([],[new Re(e)]);return new ge("$max",new ce([ye.INTEGER,ye.REAL]),[new ke(n,"x",!1)],r)}(),$min:function(){var e=function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().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()})),a=pn.min.apply(pn,Wn(i)),s=new In(r.type.innerType,a),t.insertStore("$",s),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)}}(),n=new An(new ce([ye.INTEGER,ye.REAL]),1),r=new be([],[new Re(e)]);return new ge("$min",new ce([ye.INTEGER,ye.REAL]),[new ke(n,"x",!1)],r)}(),$rand:function(){var e=2147483647,n=new be([],[new Re(function(){var n=t(o().mark((function t(n,r){var i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=(Qn=(16807*Qn+12345)%e)/(e-1),a=new In(ye.REAL,new pn(i)),n.insertStore("$",a),n.mode=Se.RETURN,t.abrupt("return",n);case 6:case"end":return t.stop()}}),t)})));return function(e,t){return n.apply(this,arguments)}}())]);return new ge("$rand",ye.REAL,[],n)}()},$ioLib:{$read:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f,p;return o().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,a=null,s=null,e.prev=6,!i.isCompatible(ye.INTEGER)){e.next=12;break}s=hn(r.trim()).trunc(),a=ye.INTEGER,e.next=33;break;case 12:if(!i.isCompatible(ye.REAL)){e.next=17;break}s=vn(r.trim()),a=ye.REAL,e.next=33;break;case 17:if(!i.isCompatible(ye.BOOLEAN)){e.next=22;break}s=yn(r.trim()),a=ye.BOOLEAN,e.next=33;break;case 22:if(!i.isCompatible(ye.STRING)){e.next=27;break}s=mn(r),a=ye.STRING,e.next=33;break;case 27:if(!i.isCompatible(ye.CHAR)){e.next=32;break}s=_n(r),a=ye.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(u=i.stringInfo()[0],!((c=t.getStoreObject("p1")).getReferenceDimension()>0)){e.next=46;break}throw l=c.type.stringInfo()[0],f=c.getReferenceDimension(),Nn.invalid_read_type_array(r,u.type,u.dim,c.getRefObj(),l.type,f,this.function_call_stack.pop());case 46:throw Nn.invalid_read_type(r,u.type,u.dim,c.getRefObj(),this.function_call_stack.pop());case 47:return p=new In(a,s),t.updateStore("p1",p),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)}}())]);return new ge("$read",ye.VOID,[new ke(ye.ALL,"p1",!0)],e)}(),$write:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=t.applyStore("p1.0"),i=r.get(),a=1;a<i;a+=1)s=t.applyStore("p1.".concat(a)),this.output.sendOutput(xn(s.get(),s.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)}}())]);return new ge("$write",ye.VOID,[new ke(ye.ALL,"p1",!1,!0)],e)}()},$strLib:{$substring:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=t.applyStore("start"),a=t.applyStore("end"),s=r.get().substring(i.get(),a.get()),u=new In(ye.STRING,s),t.insertStore("$",u),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)}}())]);return new ge("$substring",ye.STRING,[new ke(ye.STRING,"str",!1),new ke(ye.INTEGER,"start",!1),new ke(ye.INTEGER,"end",!1)],e)}(),$length:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=new In(ye.INTEGER,hn(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)}}())]);return new ge("$length",ye.INTEGER,[new ke(ye.STRING,"str",!1)],e)}(),$uppercase:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=new In(ye.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)}}())]);return new ge("$uppercase",ye.STRING,[new ke(ye.STRING,"str",!1)],e)}(),$lowercase:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=new In(ye.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)}}())]);return new ge("$lowercase",ye.STRING,[new ke(ye.STRING,"str",!1)],e)}(),$charAt:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().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 Nn.invalid_string_index(i.get().toNumber(),r.get(),this.function_call_stack.pop());case 4:return a=new In(ye.CHAR,r.get().charAt(i.get().toNumber())),t.insertStore("$",a),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)}}())]);return new ge("$charAt",ye.CHAR,[new ke(ye.STRING,"str",!1),new ke(ye.INTEGER,"index",!1)],e)}()},$arrayLib:{$numElements:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("vector"),i=new In(ye.INTEGER,hn(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)}}())]);return new ge("$numElements",ye.INTEGER,[new ke(new An(ye.ALL,1),"vector",!1)],e)}(),$matrixLines:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("matrix"),i=new In(ye.INTEGER,hn(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)}}())]);return new ge("$matrixLines",ye.INTEGER,[new ke(new An(ye.ALL,2),"matrix",!1)],e)}(),$matrixColumns:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("matrix"),i=new In(ye.INTEGER,hn(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)}}())]);return new ge("$matrixColumns",ye.INTEGER,[new ke(new An(ye.ALL,2),"matrix",!1)],e)}()},$langLib:{$isReal:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.applyStore("str"),i=Yn.createParser(r.get()),a=!1;try{i.parseTerm()instanceof Ln&&(a=!0)}catch(e){}return s=new In(ye.BOOLEAN,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)}}())]);return new ge("$isReal",ye.BOOLEAN,[new ke(ye.STRING,"str",!1)],e)}(),$isInt:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.applyStore("str"),i=Yn.createParser(r.get()),a=!1;try{i.parseTerm()instanceof On&&(a=!0)}catch(e){}return s=new In(ye.BOOLEAN,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)}}())]);return new ge("$isInt",ye.BOOLEAN,[new ke(ye.STRING,"str",!1)],e)}(),$isBool:function(){var e=new be([],[new Re((function(e,t){var n=e.applyStore("str"),r=Yn.createParser(n.get()),i=!1;try{r.parseTerm()instanceof Dn&&(i=!0)}catch(e){}var o=new In(ye.BOOLEAN,i);return e.insertStore("$",o),e.mode=Se.RETURN,e}))]);return new ge("$isBool",ye.BOOLEAN,[new ke(ye.STRING,"str",!1)],e)}(),$castReal:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f;return o().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===ye.INTEGER.ord?5:e.t0===ye.STRING.ord?10:22;break;case 5:return i=i.toNumber(),a=new In(ye.REAL,vn(i)),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 10:if(s=Yn.createParser(i),e.prev=11,!((u=s.parseTerm())instanceof Ln)){e.next=18;break}return c=new In(ye.REAL,vn(u.value)),t.insertStore("$",c),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 l=ye.REAL.stringInfo(),f=l[0],Nn.invalid_type_conversion(i,f.type,f.dim);case 25:case"end":return e.stop()}}),e,null,[[11,20]])})));return function(t,n){return e.apply(this,arguments)}}())]);return new ge("$castReal",ye.REAL,[new ke(new ce([ye.INTEGER,ye.STRING]),"val",!1)],e)}(),$castInt:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f,p;return o().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===ye.REAL.ord?5:e.t0===ye.CHAR.ord?10:e.t0===ye.STRING.ord?14:26;break;case 5:return i=i.toNumber(),a=new In(ye.INTEGER,hn(Math.floor(i))),t.insertStore("$",a),t.mode=Se.RETURN,e.abrupt("return",t);case 10:return s=new In(ye.INTEGER,hn(i.charCodeAt(0))),t.insertStore("$",s),t.mode=Se.RETURN,e.abrupt("return",t);case 14:if(u=Yn.createParser(i),e.prev=15,!((c=u.parseTerm())instanceof On)){e.next=22;break}return l=new In(ye.INTEGER,hn(c.value)),t.insertStore("$",l),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 f=ye.INTEGER.stringInfo(),p=f[0],Nn.invalid_type_conversion(i,p.type,p.dim);case 29:case"end":return e.stop()}}),e,null,[[15,24]])})));return function(t,n){return e.apply(this,arguments)}}())]);return new ge("$castInt",ye.INTEGER,[new ke(new ce([ye.REAL,ye.STRING,ye.CHAR]),"val",!1)],e)}(),$castBool:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a,s,u,c,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.applyStore("str"),i=r.get(),a=Yn.createParser(i),e.prev=3,!((s=a.parseTerm())instanceof Dn)){e.next=10;break}return u=new In(ye.BOOLEAN,s.value),t.insertStore("$",u),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 c=ye.BOOLEAN.stringInfo(),l=c[0],Nn.invalid_type_conversion(i,l.type,l.dim);case 17:case"end":return e.stop()}}),e,null,[[3,12]])})));return function(t,n){return e.apply(this,arguments)}}())]);return new ge("$castBool",ye.BOOLEAN,[new ke(ye.STRING,"str",!1)],e)}(),$castString:function(){var e=new be([],[new Re(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.applyStore("str"),i=xn(r.get(),r.type),a=new In(ye.STRING,i),t.insertStore("$",a),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)}}())]);return new ge("$castString",ye.STRING,[new ke(ye.ALL,"str",!1)],e)}(),$castChar:function(){var e=new be([],[new Re((function(e,t){var n=255&e.applyStore("charCode").get().toNumber(),r=String.fromCharCode(n),i=new In(ye.CHAR,r);return e.insertStore("$",i),e.mode=Se.RETURN,e}))]);return new ge("$castChar",ye.CHAR,[new ke(ye.INTEGER,"charCode",!1)],e)}()}},tr=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}(er.$ioLib,er.$langLib,er.$strLib,er.$arrayLib),nr=Object.freeze({getMainFunctionName:function(){return j.getCurrentLangFuncs().main_function},getInternalName:function(e){if(-1!==e.indexOf(".")){var t=e.split("."),n=Jn(t[0],j.getCurrentLangLibs()),r=Jn(t[1],j.getCurrentLangFuncs());return null===n||null===r?null:n+"."+r}var i=Jn(e,j.getCurrentLangFuncs());return null!==i&&tr[i]?i:null},getFunction:function(e){if(-1!==e.indexOf(".")){var t=e.split("."),n=t[0],r=t[1];return er[n][r]}return tr[e]},getLocalName:function(e){if(-1!==e.indexOf(".")){var t=e.split("."),n=j.getCurrentLangLibs()[t[0]],r=j.getCurrentLangFuncs()[t[1]];return"".concat(n,".").concat(r)}return j.getCurrentLangFuncs()[e]?j.getCurrentLangFuncs()[e]:e}});var rr=new(function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a(this,i),r.call(this,e,t,n)}return l(i,[{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 zn.AND.ord:case zn.OR.ord:case zn.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?nr.getLocalName(e):nr.getLocalName("".concat(t,".").concat(e))}}]),i}(U.LocalizedStrings))(j,J),ir=function(){return rr};function or(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 ar=null;function sr(e){e.preventDefault();var t=e.currentTarget.dataset.page;null!=ar&&ar.close(),(ar=window.open("","DetailWindow","width=550,height=600")).document.open(),ar.document.write(t),ar.document.close()}function ur(e){return cr.apply(this,arguments)}function cr(){return(cr=t(o().mark((function e(t){return o().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 lr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return fr(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)?fr(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=n.call(e)},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 fr(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 pr(){var e=document.querySelector("#folder"),n=["submissionid","file","filesize","timestamp","humandate","grade","userid","exerciseid"];function r(e){return window.program_obj.functions=JSON.parse(e).functions,window.program_obj.globals=JSON.parse(e).globals,window.ivprogCore.generateCode()}function i(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",t(o().mark((function a(){var s,u,c,l,f,p,d,h,m,_,v,y;return o().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return v=function(e){return["TES","DES","grade","D/T","timestamp"].reduce((function(t,n){return t+"".concat(e,"_").concat(n,",")}),"")},_=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)},s=Array.from(e.files),u=s.find((function(e){return"index.csv"==e.name})),c=u.webkitRelativePath.replace(u.name,""),a.next=7,u.text();case 7:l=a.sent,f=l.split("\n").slice(1).filter((function(e){return e.length>0})).map((function(e){return e.split(",")})).map((function(e){var t={};return e.forEach((function(e,r){return t[n[r]]=e})),t})),p=f.reduce(i,new Map),d=function(){var e=t(o().mark((function e(t){var n,r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(c).concat(t.file),r=s.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)}}(),h={},m=0,p.forEach((function(e,n){var i=[];e.forEach(function(){var e=t(o().mark((function e(a,s){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=a.sort((function(e,t){return parseInt(e.timestamp)-parseInt(t.timestamp)})),m++,a.forEach(function(){var e=t(o().mark((function e(t,a,u){var c,l,f,p,h,_,v,y,g,x;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m++,(c={}).grade=Math.max(0,parseFloat(t.grade)),c.timestamp=parseInt(t.timestamp),c.student_id=s,c.TES=0,c.DES=0,c["D/T"]=0,l="",!(a>0)){e.next=19;break}return c.TES=parseInt(t.timestamp)-parseInt(u[a-1].timestamp),e.next=13,d(u[a-1]);case 13:if(f=e.sent,1!=(p=window.ivprogCore.prepareActivityToStudentHelper(f).getOrElse(1))){e.next=18;break}return console.error("A submission from ".concat(s," to ").concat(n," is invalid")),e.abrupt("return");case 18:l=r(p.algorithmInIlm);case 19:return e.next=21,d(t);case 21:if(h=e.sent,2!=(_=window.ivprogCore.prepareActivityToStudentHelper(h).getOrElse(2))){e.next=26;break}return console.error("A submission from ".concat(s," to ").concat(n," is invalid")),e.abrupt("return");case 26:v=r(_.algorithmInIlm),""===l&&(y=JSON.parse(h.split("::logs::")[1]),null==(g=y[0])?c.TES=0:4===g.length?c.TES=parseInt(t.timestamp)-Math.floor(parseInt(g[2])/1e3):c.TES=parseInt(t.timestamp)-Math.floor(parseInt(g[1])/1e3)),c.DES=window.ivprogCore.levenshteinDistance(l,v),x=0===c.TES?0:c.DES/c.TES,c["D/T"]=isNaN(x)?0:x,i.push(c),m--;case 33:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()),m--;case 4:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),h[n]=i})),y=setInterval((function(){if(0==m)for(var e in clearInterval(y),h){var t="",n="student_id,";n+=v(e);var r,i=lr(h[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()}_("".concat(e,".csv"),"".concat(n,"\n").concat(t))}}),1e3);case 15:case"end":return a.stop()}}),a)}))))}var dr="var",hr="const",mr="relational",_r="logic",vr="arithmetic";function yr(e,t){switch(e){case vr:case mr:return t.value;case _r:return 11===t.ord?"and":12===t.ord?"or":"not"}}function gr(e){switch(e.ord){case 0:case 1:case 2:case 3:case 4:return vr;case 5:case 6:case 7:case 8:case 9:case 10:return mr;default:return _r}}function xr(e){var t=e.commands.map(wr),n=e.isDefault?null:Tr(e.expression);return{type:"switchcase",line:e.sourceInfo.line,expression:n,commands:t}}function br(e){var t=Tr(e.condition),n=e.ifTrue.commands.map(wr),r=[];return e.ifFalse&&(r=e.ifFalse instanceof be?e.ifFalse.commands.map(wr):[br(e.ifFalse)]),{type:"iftrue",expression:t,ifTrue:n,ifFalse:r}}function wr(e){var t,n,r,i,o,a=null;if(e instanceof Ae)a=function(e){var t=e.id;-1!==t.indexOf(".")&&(t=t.split(".")[1]);var n=e.actualParameters.map(Tr);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 ne)a=function(e){var t=null;if(e instanceof re){var n=Tr(e.line),r="vector",i=null;e.column&&(r="matrix",i=Tr(e.column)),t=[{instance:"expression",type:dr,class:r,column:i,line:n,value:e.id}]}else t=[{instance:"expression",type:dr,value:e.id}];return{type:"attribution",variable:t,expression:Tr(e.expression)}}(e);else if(e instanceof xe)a=br(e);else if(e instanceof ae)i=Tr((r=e).expression),o=r.commands.map(wr),a={type:r.testFirst?"whiletrue":"dowhiletrue",expression:i,commands:o};else if(e instanceof ee)a={type:"break"};else if(e instanceof te)a={type:"return",expression:Tr(e.expression)};else if(e instanceof Ee)a={type:"switch",expression:Tr((n=e).expression),cases:n.cases.map(xr)};else{if(!(e instanceof se))throw new Error("not implemented");a={type:"repeatNtimes",var_attribution:Tr((t=e).for_id),var_initial:Tr(t.for_from),condition:Tr(t.for_to),step_expression:t.for_pass?Tr(t.for_pass):[],commands:t.commands.map(wr)}}return a.line=e.sourceInfo.line,a}function Er(e){var t={name:e.name,line:e.sourceInfo.line,return_type:"",return_dimensions:0,parameters_list:[],variables_list:[],commands:[]};return e.returnType instanceof An?(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($r),t.variables_list=e.variablesDeclarations.map(Rr),t.commands=e.commands.map(wr),t}function $r(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 An?(t.type=e.type.innerType.value,t.dimension=e.type.dimensions):t.type=e.type.value,t}function Rr(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 oe){var r=Tr(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 kr(e)}));n.value=i}else{var o=Tr(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 kr(e)}))}));n.value=a}}else n.type=e.type.value,n.value=kr(e.initial);return n}function kr(e){if(e instanceof Un){var t=kr(e.left);if(gr(e.op)!==vr)throw new Error("invalid variable initial value: "+e.toString());return"".concat(e.op.value).concat(t)}if(e instanceof Dn)return gn(e.value);if(e instanceof Cn){var n=e.value;return e.value.toNumber&&(n=ye.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 Tr(e){var t;if(e instanceof Fn)t=[{instance:"expression",type:dr,value:e.id}];else if(e instanceof Ae){var n={instance:"expression",type:"function",value:e.id},r=e.actualParameters.map((function(e){return Tr(e)}));n.params=r,t=[n]}else if(e instanceof Un){var i=Tr(e.left),o=gr(e.op);t=[{instance:"operator",type:o,value:yr(o,e.op)}].concat(Wn(i))}else if(e instanceof Mn){var a=Tr(e.left),s=Tr(e.right),u=gr(e.op),c=yr(u,e.op);t=[].concat(Wn(a),[{instance:"operator",type:u,value:c}],Wn(s))}else if(e instanceof Sn){var l=Tr(e.line),f="vector",p=null;e.column&&(f="matrix",p=Tr(e.column)),t=[{instance:"expression",type:dr,class:f,column:p,line:l,value:e.id}]}else if(e instanceof Dn){var d=e.value;t=[{instance:"expression",class:"simple",type:hr,value:gn(d)}]}else{var h=e.value;e.value.toNumber&&(h=ye.REAL.isCompatible(e.type)&&0==e.value.decimalPlaces()?Number(e.value.toFixed(2)):e.value.toNumber()),t=[{instance:"expression",class:"simple",type:hr,value:h}]}return e.parenthesis?["("].concat(Wn(t),[")"]):t}function Nr(e){return Tr(Yn.createParser(e).parseExpressionOR())}function Ir(e){for(var t=Yn.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 Rr(e,!0)})),functions:u.functions.map(Er)}}catch(e){return console.error(e),null}}function Ar(){var e=[[],[]];return e[ye.INTEGER.ord][ye.INTEGER.ord]=ye.INTEGER,e[ye.INTEGER.ord][ye.REAL.ord]=ye.REAL,e[ye.REAL.ord][ye.INTEGER.ord]=ye.REAL,e[ye.REAL.ord][ye.REAL.ord]=ye.REAL,e}function Sr(){var e=[[],[],[],[],[]];return e[ye.INTEGER.ord][ye.INTEGER.ord]=ye.BOOLEAN,e[ye.REAL.ord][ye.REAL.ord]=ye.BOOLEAN,e[ye.BOOLEAN.ord][ye.BOOLEAN.ord]=ye.BOOLEAN,e[ye.STRING.ord][ye.STRING.ord]=ye.BOOLEAN,e[ye.CHAR.ord][ye.CHAR.ord]=ye.BOOLEAN,e}function Cr(){var e=[[],[],[],[],[]];return e[ye.INTEGER.ord][ye.INTEGER.ord]=ye.BOOLEAN,e[ye.REAL.ord][ye.REAL.ord]=ye.BOOLEAN,e[ye.STRING.ord][ye.STRING.ord]=ye.BOOLEAN,e[ye.CHAR.ord][ye.CHAR.ord]=ye.BOOLEAN,e}function Or(){var e=[[],[],[],[]];return e[ye.BOOLEAN.ord][ye.BOOLEAN.ord]=ye.BOOLEAN,e}function Lr(){var e=[];return e[ye.INTEGER.ord]=ye.INTEGER,e[ye.REAL.ord]=ye.REAL,e}var Dr,Br,Pr=((Br=new WeakMap).set(zn.ADD,((Dr=[[],[],[],[],[]])[ye.INTEGER.ord][ye.INTEGER.ord]=ye.INTEGER,Dr[ye.INTEGER.ord][ye.REAL.ord]=ye.REAL,Dr[ye.INTEGER.ord][ye.STRING.ord]=ye.STRING,Dr[ye.REAL.ord][ye.INTEGER.ord]=ye.REAL,Dr[ye.REAL.ord][ye.REAL.ord]=ye.REAL,Dr[ye.REAL.ord][ye.STRING.ord]=ye.STRING,Dr[ye.STRING.ord][ye.INTEGER.ord]=ye.STRING,Dr[ye.STRING.ord][ye.REAL.ord]=ye.STRING,Dr[ye.STRING.ord][ye.STRING.ord]=ye.STRING,Dr[ye.STRING.ord][ye.BOOLEAN.ord]=ye.STRING,Dr[ye.STRING.ord][ye.CHAR.ord]=ye.STRING,Dr[ye.CHAR.ord][ye.CHAR.ord]=ye.STRING,Dr[ye.CHAR.ord][ye.STRING.ord]=ye.STRING,Dr)),Br.set(zn.SUB,Ar()),Br.set(zn.MULT,Ar()),Br.set(zn.DIV,Ar()),Br.set(zn.EQ,Sr()),Br.set(zn.NEQ,Sr()),Br.set(zn.GE,Cr()),Br.set(zn.GT,Cr()),Br.set(zn.LE,Cr()),Br.set(zn.LT,Cr()),Br.set(zn.OR,Or()),Br.set(zn.AND,Or()),Br.set(zn.MOD,function(){var e=[[]];return e[ye.INTEGER.ord][ye.INTEGER.ord]=ye.INTEGER,e}()),Br),Gr=function(){var e,t=new WeakMap;return t.set(zn.ADD,Lr()),t.set(zn.SUB,Lr()),t.set(zn.NOT,((e=[])[ye.BOOLEAN.ord]=ye.BOOLEAN,e)),t}();function Fr(e,t,n){try{if(t instanceof ce&&n instanceof ce){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(Fr(e,o,a))}return(r=r.filter((function(e){return!e.isCompatible(ye.UNDEFINED)}))).length<=0?q.enable_type_casting&&(t.isCompatible(ye.INTEGER)||t.isCompatible(ye.REAL))&&(n.isCompatible(ye.INTEGER)||n.isCompatible(ye.REAL))?new ce([ye.INTEGER,ye.REAL]):ye.UNDEFINED:new ce(r)}if(t instanceof ce)return t.isCompatible(n)?Fr(e,n,n):q.enable_type_casting&&(t.isCompatible(ye.INTEGER)||t.isCompatible(ye.REAL))&&(n.isCompatible(ye.INTEGER)||n.isCompatible(ye.REAL))?n:ye.UNDEFINED;if(n instanceof ce)return n.isCompatible(t)?Fr(e,t,t):q.enable_type_casting&&(t.isCompatible(ye.INTEGER)||t.isCompatible(ye.REAL))&&(n.isCompatible(ye.INTEGER)||n.isCompatible(ye.REAL))?t:ye.UNDEFINED;var s=(Pr.get(e)||[])[t.ord][n.ord];if(null==s){if(q.enable_type_casting&&(t.isCompatible(ye.INTEGER)||t.isCompatible(ye.REAL))&&(n.isCompatible(ye.INTEGER)||n.isCompatible(ye.REAL))){if(e===zn.MOD)return ye.INTEGER;if(e.ord>=5&&e.ord<=10)return ye.BOOLEAN}return ye.UNDEFINED}return s}catch(e){if(e instanceof TypeError)return ye.UNDEFINED;throw e}}function Mr(e,t){try{if(t instanceof ce){for(var n=[],r=0;r<t.types.length;++r){var i=t.types[r];n.push(Mr(e,i))}return(n=n.filter((function(e){return!e.isCompatible(ye.UNDEFINED)}))).length<=0?ye.UNDEFINED:new ce(n)}var o=(Gr.get(e)||[])[t.ord];return null==o?ye.UNDEFINED:o}catch(e){if(e instanceof TypeError)return ye.UNDEFINED;throw e}}var Ur=l((function e(t,n){a(this,e),K(this,"id",void 0),K(this,"value",void 0),this.id=t,this.value=n})),Kr=new(function(){function e(){a(this,e),K(this,"data",void 0),K(this,"address_id",void 0),this.data=[],this.address_id=0}return l(e,[{key:"allocate",value:function(e){var t=this.address_id,n=new Ur(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}()),zr=Object.freeze({allocate:Kr.allocate.bind(Kr),deallocate:Kr.deallocate.bind(Kr),find:Kr.find.bind(Kr),updateAddress:Kr.updateAddress.bind(Kr),clear:Kr.clear.bind(Kr),size:function(){return Kr.data.length}}),qr=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,e),K(this,"_type",void 0),K(this,"_loc_address",void 0),K(this,"_readOnly",void 0),K(this,"_id",void 0),this._loc_address=n,this._type=t,this._readOnly=r,this._id=void 0}return l(e,[{key:"setID",value:function(e){this._id=e}},{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=zr.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:"isCompatible",value:function(e){return this.type.isCompatible(e.type)}},{key:"destroy",value:function(){return zr.deallocate(this._loc_address)}},{key:"locAddress",get:function(){return this._loc_address}}]),e}();var jr=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),K(d(t=r.call(this,e.type,e.getRefAddress(),!1)),"refObj",void 0),K(d(t),"reference_dimension",void 0),t.refObj=e.id,t.reference_dimension=e.getReferenceDimension(),t}return l(i,[{key:"isRef",get:function(){return!0}},{key:"getRefObj",value:function(){return this.refObj}},{key:"getReferenceDimension",value:function(){return this.reference_dimension}},{key:"destroy",value:function(){return!1}}]),i}(qr);var Vr=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n,o,s){var u,c=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return a(this,i),(u=r.call(this,e,t,s,c)).line=n,u.column=o,u}return l(i)}(In),Hr=function(){function e(t,n,r,i,o){var s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];a(this,e),K(this,"type",void 0),K(this,"id",void 0),K(this,"isConst",void 0),K(this,"lines",void 0),K(this,"columns",void 0),K(this,"values",void 0),this.type=t,this.id=o,this.isConst=s,this.values=n,this.lines=r,this.columns=i}return l(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 An(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 Vr(t.type,l.get(),o,u,this.id,this.isConst)}}var f=o*(null==this.columns?0:this.columns)+a;this.values[f]=new Vr(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}();function Yr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=m(e)););return e}function Wr(){return Wr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=Yr(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},Wr.apply(this,arguments)}var Zr=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n,o){var s,u=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return a(this,i),(s=r.call(this,e,-1,u))._lines=t,s._columns=n,s.loc_addresses=o,s}return l(i,[{key:"lines",get:function(){return this._lines}},{key:"columns",get:function(){return this._columns}},{key:"isCompatible",value:function(e){if(e instanceof Hr){var t=null==e.columns?0:e.columns;if(this.lines===e.lines&&this.columns===t)return Wr(m(i.prototype),"isCompatible",this).call(this,e)}return!1}},{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=zr.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:"destroy",value:function(){for(var e=!0,t=0;t<this.addresses.length;t+=1)e=e&&zr.deallocate(this.addresses[t]);return e}},{key:"locAddress",get:function(){throw new Error("!!!Internal Error: Cannot invoke locAddress on StoreObjectArray")}},{key:"addresses",get:function(){return this.loc_addresses}},{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=zr.find(this.addresses[i]);n.push(o.value)}return n}var a=this.getIndexOf(e,t);return zr.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);zr.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]}}]),i}(qr),Qr=function(){function e(t,n,r,i){a(this,e),this.type=t,this.value=n,this.loc_address=r,this.id=i,K(this,"isConst",!1),K(this,"reference_dimesion",0)}return l(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}(),Jr=function(){function e(t,n,r,i,o,s){a(this,e),this.type=t,this.values=n,this.addresses=r,this.lines=i,this.columns=o,this.id=s,K(this,"isConst",!1)}return l(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 Xr=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e,t,n){var o;return a(this,i),K(d(o=r.call(this,e.type,t,n,e.getAddresses(),!1)),"refObj",void 0),o.refObj=e.id,o}return l(i,[{key:"isRef",get:function(){return!0}},{key:"getRefObj",value:function(){return this.refObj}},{key:"destroy",value:function(){return!1}}]),i}(Zr),ei=function(){function e(t){a(this,e),this.name=t,K(this,"store",void 0),K(this,"nextStore",void 0),K(this,"mode",void 0),this.store=new Map,this.mode=Se.RUN}return l(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 An){var r=t,i=r.type,o=0,a=0,s=r.value.map((function(e){return r.isVector?new Vr(i.innerType,e,o++,void 0,r.id,r.readOnly):(a>=r.columns&&(a=0,o+=1),new Vr(i.innerType,e,o,a++,r.id,r.readOnly))}));n=new Hr(i,s,r.lines,r.columns,t.id,t.readOnly)}else n=new In(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 Zr){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 zr.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 Zr))throw new Error("Cannot update a non-array variable using updateStoreArray");if(t instanceof Hr){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 Qr)n=new jr(t);else if(t instanceof Jr)n=new Xr(t,t.lines,t.columns);else if(t instanceof Hr){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(zr.allocate(s))}else{var u=t.lines;u=t.isVector()?u:u*r;for(var c=0;c<u;c+=1)i.push(zr.allocate(null))}n=new Zr(t.type,t.lines,r,i,t.isConst)}else{var l=zr.allocate(t.get());n=new qr(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)}}],[{key:"canImplicitTypeCast",value:function(e,t){return!(!e.isCompatible(ye.INTEGER)&&!e.isCompatible(ye.REAL)||!t.isCompatible(ye.INTEGER)&&!t.isCompatible(ye.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(ye.INTEGER)?new In(ye.INTEGER,n.get().trunc()):new In(ye.REAL,n.get())}}]),e}(),ti=function(){function e(t){a(this,e),this.ast=t,this.symbolMap=null,this.currentFunction=null}return l(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=nr.getFunction(e);if(!t)throw Nn.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 Nn.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 oe)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 ce){if(!t.isCompatible(e.type)){var n=e.type.stringInfo()[0],r=t.stringInfo()[0],i=e.initial;throw Nn.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)&&!q.enable_type_casting||!e.type.isCompatible(t)&&q.enable_type_casting&&!ei.canImplicitTypeCast(e.type,t)){var o=e.type.stringInfo()[0],a=t.stringInfo()[0],s=e.initial;throw Nn.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(ye.INTEGER))throw Nn.array_dimension_not_int_full(e.sourceInfo);if(null!==e.columns&&!this.evaluateExpressionType(e.columns).isCompatible(ye.INTEGER))throw Nn.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 Un){var t=e.op,n=this.evaluateExpressionType(e.left),r=Mr(t,n);if(ye.UNDEFINED.isCompatible(r)){var i=n.stringInfo()[0],o=e.toString();throw Nn.invalid_unary_op_full(o,t,i.type,i.dim,e.sourceInfo)}return r}if(e instanceof Mn){var a=e.op,s=this.evaluateExpressionType(e.left),u=this.evaluateExpressionType(e.right),c=Fr(a,s,u);if(ye.UNDEFINED.isCompatible(c)){var l=s.stringInfo()[0],f=u.stringInfo()[0],p=e.toString();throw Nn.invalid_infix_op_full(p,a,l.type,l.dim,f.type,f.dim,e.sourceInfo)}return c}if(e instanceof Cn)return this.evaluateLiteralType(e);if(e instanceof Ae){if(e.isMainCall)throw Nn.void_in_expression_full(nr.getMainFunctionName(),e.sourceInfo);var d=this.findFunction(e.id);if(null===d)throw Nn.function_missing_full(e.id,e.sourceInfo);if(d.returnType.isCompatible(ye.VOID))throw Nn.void_in_expression_full(e.id,e.sourceInfo);return this.assertParameters(d,e.actualParameters),d.returnType}if(e instanceof Sn){var h=this.findSymbol(e.id,this.symbolMap);if(null===h)throw Nn.symbol_not_found_full(e.id,e.sourceInfo);if(!(h.type instanceof An))throw Nn.invalid_array_access_full(e.id,e.sourceInfo);if(!this.evaluateExpressionType(e.line).isCompatible(ye.INTEGER))throw Nn.array_dimension_not_int_full(e.sourceInfo);if(null!==e.column){if(null===h.columns)throw Nn.invalid_matrix_access_full(e.id,e.sourceInfo);if(!this.evaluateExpressionType(e.column).isCompatible(ye.INTEGER))throw Nn.array_dimension_not_int_full(e.sourceInfo)}var m=h.type;return null!==e.column||null===h.columns?m.innerType:new An(m.innerType,1)}}},{key:"evaluateLiteralType",value:function(e){if(e instanceof On)return e.type;if(e instanceof Ln)return e.type;if(e instanceof Pn)return e.type;if(e instanceof Dn)return e.type;if(e instanceof Bn)return e.type;if(e instanceof Fn){var t=this.findSymbol(e.id,this.symbolMap);if(null===t)throw Nn.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 Nn.incompatible_types_array_full(a,o.type,o.dim,e.sourceInfo)}}return n instanceof An?new An(n.innerType,n.dimensions+1):new An(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 An(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 An?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(ye.VOID);if(!this.assertReturn(e,n))throw Nn.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 ae){if(!this.evaluateExpressionType(t.expression).isCompatible(ye.BOOLEAN))throw Nn.loop_condition_type_full(t.expression.toString(),t.sourceInfo);return this.checkCommands(e,t.commands,n),!1}if(t instanceof se){if(!this.evaluateExpressionType(t.for_id).isCompatible(ye.INTEGER))throw Nn.invalid_for_variable(t.for_id,t.sourceInfo);if(!this.evaluateExpressionType(t.for_from).isCompatible(ye.INTEGER))throw Nn.invalid_for_from(t.for_from,t.sourceInfo);if(!this.evaluateExpressionType(t.for_to).isCompatible(ye.INTEGER))throw Nn.invalid_for_to(t.for_to,t.sourceInfo);if(null!=t.for_pass&&!this.evaluateExpressionType(t.for_pass).isCompatible(ye.INTEGER))throw Nn.invalid_for_pass(t.for_pass,t.sourceInfo);return this.checkCommands(e,t.commands,n),!1}if(t instanceof Ee){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],l=s.expression.toString();throw Nn.invalid_case_type_full(l,c.type,c.dim,s.sourceInfo)}}else o=!0;i=i&&this.checkCommands(e,s.commands,i)}return i&&o}if(t instanceof re){var f=0,p=this.findSymbol(t.id,this.symbolMap);if(null===p)throw Nn.symbol_not_found_full(t.id,t.sourceInfo);if(p.isConst)throw Nn.invalid_const_assignment_full(t.id,t.sourceInfo);if(!(p.type instanceof An))throw Nn.invalid_array_access_full(t.id,t.sourceInfo);var d=t.expression,h=t.line;if(!this.evaluateExpressionType(h).isCompatible(ye.INTEGER))throw Nn.array_dimension_not_int_full(t.sourceInfo);f+=1;var m=t.column;if(null===p.columns&&null!==m)throw Nn.invalid_matrix_access_full(t.id,t.sourceInfo);if(null!==m){if(!this.evaluateExpressionType(m).isCompatible(ye.INTEGER))throw Nn.array_dimension_not_int_full(t.sourceInfo);f+=1}var _=this.evaluateExpressionType(d),v=p.type,y=!1,g=v;if(_ instanceof ce?(g=v.dimensions-f==0?v.innerType:new An(v.innerType,Math.max(0,v.dimensions-f)),y=_.isCompatible(g)):y=v.canAccept(_,f),!y&&(0==v.dimensions-f&&(g=v.innerType),!q.enable_type_casting||!ei.canImplicitTypeCast(g,_))){var x=v.stringInfo()[0],b=_.stringInfo()[0];throw Nn.incompatible_types_full(x.type,x.dim-f,b.type,b.dim,d.toString(),t.sourceInfo)}return n}if(t instanceof ne){var w=this.findSymbol(t.id,this.symbolMap);if(null===w)throw Nn.symbol_not_found_full(t.id,t.sourceInfo);if(w.isConst)throw Nn.invalid_const_assignment_full(t.id,t.sourceInfo);var E=t.expression,$=this.evaluateExpressionType(E);if($ instanceof An){if(!(w.type instanceof An))throw new Error("Cannot assign an array to a non-array variable ");if(!$.isCompatible(w.type))if($.dimensions!==w.type.dimensions||$.innerType.isCompatible(w.type.innerType))switch($.dimensions){case 1:throw Nn.vector_to_matrix_attr(t.id,E.toString(),t.sourceInfo);case 2:throw Nn.matrix_to_vector_attr(t.id,E.toString(),t.sourceInfo)}else if(!q.enable_type_casting||!ei.canImplicitTypeCast(w.type.innerType,$.innerType)){var R=w.type.stringInfo()[0],k=$.stringInfo()[0];throw Nn.incompatible_types_full(R.type,R.dim,k.type,k.dim,E.toString(),t.sourceInfo)}}else if(!($.isCompatible(w.type)||q.enable_type_casting&&ei.canImplicitTypeCast(w.type,$))){var T=w.type.stringInfo()[0],N=$.stringInfo()[0];throw Nn.incompatible_types_full(T.type,T.dim,N.type,N.dim,E.toString(),t.sourceInfo)}return n}if(t instanceof ee)return n;if(t instanceof xe){if(!this.evaluateExpressionType(t.condition).isCompatible(ye.BOOLEAN))throw Nn.if_condition_type_full(t.condition.toString(),t.sourceInfo);return t.ifFalse instanceof xe?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 Ae){var I;if(null===(I=t.isMainCall?this.getMainFunction():this.findFunction(t.id)))throw Nn.function_missing_full(t.id,t.sourceInfo);return this.assertParameters(I,t.actualParameters),n}if(t instanceof te){var A=this.currentFunction.isMain?nr.getMainFunctionName():this.currentFunction.name;if(null!==t.expression||e.isCompatible(ye.VOID)){if(null!==t.expression){var S=this.evaluateExpressionType(t.expression);if(!(e.isCompatible(S)||q.enable_type_casting&&ei.canImplicitTypeCast(e,S))){var C=e.stringInfo()[0];throw Nn.invalid_return_type_full(A,C.type,C.dim,t.sourceInfo)}return!0}return!0}var O=e.stringInfo()[0];throw Nn.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 Nn.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 ce?i.isCompatible(t.innerType):t.canAccept(i,1))||q.enable_type_casting&&ei.canImplicitTypeCast(t.innerType,i))){var o=t.stringInfo()[0],a=i.stringInfo()[0];throw Nn.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 Fn){if(this.findSymbol(n.id,this.symbolMap).isConst)throw Nn.invalid_const_ref_full(e.name,n.toString(),n.sourceInfo)}else if(!(n instanceof Fn||n instanceof Sn))throw Nn.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo);var r=this.evaluateExpressionType(n);if(r instanceof ce&&t.type instanceof ce){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&&q.enable_type_casting&&!t.byRef&&(!r.isCompatible(ye.INTEGER)&&!r.isCompatible(ye.REAL)||t.type.isCompatible(ye.INTEGER)||t.type.isCompatible(ye.REAL)))throw Nn.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo)}else if(r instanceof ce){if(!r.isCompatible(t.type)&&q.enable_type_casting&&!t.byRef&&(!r.isCompatible(ye.INTEGER)&&!r.isCompatible(ye.REAL)||t.type.isCompatible(ye.INTEGER)||t.type.isCompatible(ye.REAL)))throw Nn.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo)}else if(!t.type.isCompatible(r)&&q.enable_type_casting&&!t.byRef&&!ei.canImplicitTypeCast(t.type,r))throw Nn.invalid_parameter_type_full(e.name,n.toString(),n.sourceInfo)}}],[{key:"analyseFromSource",value:function(t){return new e(Yn.createParser(t).parseTree()).analyseTree()}}]),e}(),ni=Object.freeze({BASE:Symbol("context:base"),BREAKABLE:Symbol("context:breakable"),FUNCTION:Symbol("context:function")}),ri=function(){function e(t){a(this,e),this.ast=t,this.globalStore=new ei("$global"),this.stores=[this.globalStore],this.context=[ni.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 n,r,i,s,u,c,f,p,d,h,m,_,v,g,x,b,w,E,$,R,k,T,N,I,A,S,C,O,L,D,B;return l(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 ei("$global"),this.stores=[this.globalStore],this.context=[ni.BASE],this.instruction_count=0,this.mode=Se.RUN}},{key:"interpretAST",value:(B=t(o().mark((function e(){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.prepareState(),zr.clear(),e.next=4,this.initGlobal();case 4:if(null!==(t=this.findMainFunction())){e.next=7;break}throw Nn.main_missing();case 7:return e.abrupt("return",this.runFunction(t,[],this.globalStore));case 8:case"end":return e.stop()}}),e,this)}))),function(){return B.apply(this,arguments)})},{key:"initGlobal",value:(D=t(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.checkContext(ni.BASE)){e.next=2;break}return e.abrupt("return",Nn.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 D.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=nr.getFunction(t);if(!n)throw Nn.not_implemented(t);return n}var r=this.ast.functions.find((function(e){return e.name===t}));if(!r)throw Nn.function_missing(t);return r}},{key:"runFunction",value:(L=t(o().mark((function t(n,r,i){var a,s,u,c;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=n.isMain?e.MAIN_INTERNAL_ID:n.name,(s=new ei(a)).extendStore(this.globalStore),t.next=5,this.associateParameters(n.formalParameters,r,i,s);case 5:return this.context.push(ni.FUNCTION),this.stores.push(s),t.next=9,this.executeCommands(s,n.variablesDeclarations);case 9:return u=t.sent,t.next=12,this.executeCommands(u,n.commands);case 12:return c=t.sent,this.stores.pop(),this.context.pop(),t.abrupt("return",c);case 16:case"end":return t.stop()}}),t,this)}))),function(e,t,n){return L.apply(this,arguments)})},{key:"associateParameters",value:(O=t(o().mark((function t(n,r,i,a){var s,u,c,l,f,p,d,h;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=a.name===e.MAIN_INTERNAL_ID?nr.getMainFunctionName():a.name,u=n.some((function(e){return e.variadic})),!(n.length!=r.length&&!u||n.length>r.length)){t.next=4;break}throw Nn.invalid_parameters_size(s,n.length,r.length);case 4:c=0,l=0;case 5:if(!(c<n.length&&l<r.length)){t.next=23;break}if(!(f=n[c]).variadic){t.next=16;break}return t.next=10,this.associateVariadicParameter(s,f,l,r,i,a);case 10:p=t.sent,d=y(p,2),l=d[0],a=d[1],t.next=20;break;case 16:return h=r[c],t.next=19,this.associateParameter(s,f,h,i,a);case 19:a=t.sent;case 20:c+=1,l+=1,t.next=5;break;case 23:return t.abrupt("return",a);case 24:case"end":return t.stop()}}),t,this)}))),function(e,t,n,r){return O.apply(this,arguments)})},{key:"associateVariadicParameter",value:(C=t(o().mark((function e(t,n,r,i,a,s){var u,c,l,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c=1,u=r;case 2:if(!(u<i.length)){e.next=11;break}return l=i[u],e.next=6,this.associateParameter(t,n,l,a,s,c);case 6:s=e.sent,c+=1;case 8:u+=1,e.next=2;break;case 11:return f=new In(ye.INTEGER,c,void 0,!0),s.insertStore("".concat(n.id,".0"),f),e.abrupt("return",[u-1,s]);case 14:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,o){return C.apply(this,arguments)})},{key:"associateParameter",value:(S=t(o().mark((function e(t,n,r,i,a){var s,u,c,l,f,p,d,h,m,_,v,y,g,x,b=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=b.length>5&&void 0!==b[5]?b[5]:0,e.next=3,this.evaluateExpression(i,r);case 3:if(u=e.sent,c=!1,n.type.isCompatible(u.type)){e.next=11;break}if(!q.enable_type_casting||n.byRef||!ei.canImplicitTypeCast(n.type,u.type)){e.next=10;break}c=!0,e.next=11;break;case 10:throw Nn.invalid_parameter_type(t,r.toString());case 11:if(!n.byRef||u.inStore()){e.next=13;break}throw Nn.invalid_ref(t,r.toString());case 13:return n.byRef?(l=i.getStoreObject(u.id),f=null,u instanceof Hr?(p=u.get(),d=u.type,h=p.map((function(e){return l.getLocAddressOf(e.line,e.column)})),m=u.isVector()?0:u.columns,f=new Jr(d,p,h,u.lines,m,l.id)):u instanceof Vr?(_=u.line,v=u.column,(f=new Qr(u.type,u.get(),l.getLocAddressOf(_,v),l.id)).setReferenceDimension(l.type.dimensions)):f=new Qr(u.type,u.get(),l.locAddress,l.id),y=n.id,n.variadic&&(y="".concat(y,".").concat(s)),a.insertStore(y,f)):(g=u,c&&(g=ei.doImplicitCasting(n.type,g)),x=n.id,n.variadic&&(x="".concat(x,".").concat(s)),a.insertStore(x,g)),e.abrupt("return",a);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return S.apply(this,arguments)})},{key:"executeCommands",value:(A=t(o().mark((function e(t,n){var r,i;return o().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 A.apply(this,arguments)})},{key:"executeCommand",value:(I=t(o().mark((function e(t,n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.instruction_count+=1,this.instruction_count%q.suspend_threshold!=0){e.next=4;break}return e.next=4,ur(3);case 4:if(!(this.instruction_count>=q.max_instruction_count)){e.next=8;break}throw Nn.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(ni.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 ir().getMessage("aborted_execution");case 26:if(!(n instanceof ie)){e.next=30;break}return e.abrupt("return",this.executeDeclaration(t,n));case 30:if(!(n instanceof re)){e.next=34;break}return e.abrupt("return",this.executeArrayIndexAssign(t,n));case 34:if(!(n instanceof ne)){e.next=38;break}return e.abrupt("return",this.executeAssign(t,n));case 38:if(!(n instanceof ee)){e.next=42;break}return e.abrupt("return",this.executeBreak(t,n));case 42:if(!(n instanceof te)){e.next=46;break}return e.abrupt("return",this.executeReturn(t,n));case 46:if(!(n instanceof xe)){e.next=50;break}return e.abrupt("return",this.executeIfThenElse(t,n));case 50:if(!(n instanceof we)){e.next=54;break}return e.abrupt("return",this.executeRepeatUntil(t,n));case 54:if(!(n instanceof ae)){e.next=58;break}return e.abrupt("return",this.executeWhile(t,n));case 58:if(!(n instanceof se)){e.next=62;break}return e.abrupt("return",this.executeFor(t,n));case 62:if(!(n instanceof Ee)){e.next=66;break}return e.abrupt("return",this.executeSwitch(t,n));case 66:if(!(n instanceof Ae)){e.next=70;break}return e.abrupt("return",this.executeFunctionCall(t,n));case 70:if(!(n instanceof Re)){e.next=74;break}return e.abrupt("return",this.executeSysCall(t,n));case 74:throw Nn.unknown_command(n.sourceInfo);case 75:case"end":return e.stop()}}),e,this)}))),function(e,t){return I.apply(this,arguments)})},{key:"executeSysCall",value:(N=t(o().mark((function e(t,n){var r;return o().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 N.apply(this,arguments)})},{key:"executeFunctionCall",value:(T=t(o().mark((function t(n,r){var i,a,s;return o().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((a=t.sent).destroy(),ye.VOID.isCompatible(i.returnType)||a.mode===Se.RETURN){t.next=12;break}throw s=i.name===e.MAIN_INTERNAL_ID?nr.getMainFunctionName():i.name,Nn.function_no_return(s);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 T.apply(this,arguments)})},{key:"executeSwitch",value:(k=t(o().mark((function e(t,n){var r,i,a,s,u,c,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.context.push(ni.BREAKABLE),r=n.cases,i=t,a=!1,s=0;case 5:if(!(s<r.length)||this.ignoreSwitchCases(i)){e.next=26;break}if(u=r[s],!a&&!u.isDefault){e.next=13;break}return e.next=10,this.executeCommands(i,u.commands);case 10:i=e.sent,e.next=23;break;case 13:return(c=new Mn(zn.EQ,n.expression,u.expression)).sourceInfo=u.sourceInfo,e.next=17,this.evaluateExpression(i,c);case 17:if(!(l=e.sent).get()){e.next=22;break}return e.next=21,this.executeCommands(i,u.commands);case 21:i=e.sent;case 22:a=l.get();case 23:s+=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 k.apply(this,arguments)})},{key:"executeFor",value:(R=t(o().mark((function e(t,n){var r,i,a,s,u,c,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=new ne(n.for_id.id,n.for_from)).sourceInfo=n.sourceInfo,i=n.for_pass,a=new Mn(zn.LT,n.for_id,n.for_to),null!=n.for_pass){e.next=12;break}return i=new On(hn(1)),e.next=8,this.evaluateExpression(t,new Mn(zn.GE,n.for_to,n.for_from));case 8:e.sent.get()||(i=new On(hn(-1)),a=new Mn(zn.GT,n.for_id,n.for_to)),e.next=16;break;case 12:return e.next=14,this.evaluateExpression(t,new Mn(zn.GE,n.for_pass,new On(hn(0))));case 14:e.sent.get()||(a=new Mn(zn.GT,n.for_id,n.for_to));case 16:return a.sourceInfo=n.sourceInfo,(s=new ne(n.for_id.id,new Mn(zn.ADD,n.for_id,i))).sourceInfo=n.sourceInfo,u=new be([],n.commands.concat(s)),(c=new ae(a,u)).sourceInfo=n.sourceInfo,l=[r,c],e.abrupt("return",this.executeCommands(t,l));case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"executeRepeatUntil",value:($=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.context.push(ni.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(ye.BOOLEAN)){e.next=13;break}throw Nn.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 $.apply(this,arguments)})},{key:"executeWhile",value:(E=t(o().mark((function e(t,n){var r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.context.push(ni.BREAKABLE),e.next=3,this.evaluateExpression(t,n.expression);case 3:if((r=e.sent).type.isCompatible(ye.BOOLEAN)){e.next=6;break}throw Nn.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 E.apply(this,arguments)})},{key:"executeIfThenElse",value:(w=t(o().mark((function e(t,n){var r;return o().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(ye.BOOLEAN)){e.next=5;break}throw Nn.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 xe)){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 w.apply(this,arguments)})},{key:"executeReturn",value:(b=t(o().mark((function t(n,r){var i,a,s,u,c,l,f;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=n.name===e.MAIN_INTERNAL_ID?nr.getMainFunctionName():n.name,a=this.findFunction(n.name),s=a.returnType,t.next=5,this.evaluateExpression(n,r.expression);case 5:if(null!==(u=t.sent)||!s.isCompatible(ye.VOID)){t.next=9;break}return n.mode=Se.RETURN,t.abrupt("return",n);case 9:if(c=u,null!==u&&s.isCompatible(u.type)){t.next=16;break}if(q.enable_type_casting&&ei.canImplicitTypeCast(s,u.type)){t.next=15;break}throw l=s.stringInfo(),f=l[0],Nn.invalid_return_type_full(i,f.type,f.dim,r.sourceInfo);case 15:c=ei.doImplicitCasting(s,u);case 16:return n.insertStore("$",c),n.mode=Se.RETURN,t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"executeBreak",value:(x=t(o().mark((function e(t,n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.checkContext(ni.BREAKABLE)){e.next=5;break}return t.mode=Se.BREAK,e.abrupt("return",t);case 5:throw Nn.unexpected_break_command_full(n.sourceInfo);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return x.apply(this,arguments)})},{key:"executeAssign",value:(g=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f,p,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=t.applyStore(n.id)).isConst){e.next=3;break}throw Nn.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,a=i,r.type.isCompatible(a.type)){e.next=18;break}if(!q.enable_type_casting||!ei.canImplicitTypeCast(r.type,i.type)){e.next=12;break}a=ei.doImplicitCasting(r.type,a),e.next=18;break;case 12:throw s=r.type.stringInfo(),u=s[0],c=i.type.stringInfo(),l=c[0],f=n.expression.toString(),Nn.incompatible_types_full(u.type,u.dim,l.type,l.dim,f,n.sourceInfo);case 18:if(!(r instanceof Hr)){e.next=27;break}if(p=null==a.columns?0:a.columns,r.lines===a.lines&&r.columns===p){e.next=27;break}if(d=n.expression.toString(),!r.isVector()){e.next=26;break}throw Nn.invalid_vector_assignment_full(n.id,r.lines,d,a.lines,n.sourceInfo);case 26:throw Nn.invalid_matrix_assignment_full(n.id,r.lines,r.columns,d,a.lines,a.columns,n.sourceInfo);case 27:return t.updateStore(n.id,a),e.abrupt("return",t);case 29:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"executeArrayIndexAssign",value:(v=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f,p,d,h,m,_,v,y,g;return o().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 Nn.invalid_const_assignment_full(n.id,n.sourceInfo);case 4:if(r.type instanceof An){e.next=6;break}throw Nn.invalid_array_access_full(n.id,n.sourceInfo);case 6:return e.next=8,this.evaluateExpression(t,n.line);case 8:if(a=e.sent,ye.INTEGER.isCompatible(a.type)){e.next=11;break}throw Nn.array_dimension_not_int_full(n.sourceInfo);case 11:return i+=1,s=a.get().toNumber(),e.next=15,this.evaluateExpression(t,n.column);case 15:if(u=e.sent,c=null,null==u){e.next=22;break}if(ye.INTEGER.isCompatible(u.type)){e.next=20;break}throw Nn.array_dimension_not_int_full(n.sourceInfo);case 20:c=u.get().toNumber(),i+=1;case 22:return e.next=24,this.evaluateExpression(t,n.expression);case 24:if(l=e.sent,f=l,!(s>=r.lines)){e.next=34;break}if(!r.isVector){e.next=31;break}throw Nn.vector_line_outbounds_full(n.id,s,r.lines,n.sourceInfo);case 31:throw Nn.matrix_line_outbounds_full(n.id,s,r.lines,n.sourceInfo);case 32:e.next=36;break;case 34:if(!(s<0)){e.next=36;break}throw Nn.array_dimension_not_positive_full(n.sourceInfo);case 36:if(null==c||0!==r.columns){e.next=38;break}throw Nn.vector_not_matrix_full(n.id,n.sourceInfo);case 38:if(null==c){e.next=45;break}if(!(c>=r.columns)){e.next=43;break}throw Nn.matrix_column_outbounds_full(n.id,c,r.columns,n.sourceInfo);case 43:if(!(c<0)){e.next=45;break}throw Nn.array_dimension_not_positive_full(n.sourceInfo);case 45:if(r.type.canAccept(l.type,i)){e.next=55;break}if(q.enable_type_casting&&ei.canImplicitTypeCast(r.type.innerType,l.type)){e.next=54;break}throw p=r.type.innerType,d=p.stringInfo(),h=d[0],m=l.type.stringInfo(),_=m[0],v=n.expression.toString(),Nn.incompatible_types_full(h.type,h.dim,_.type,_.dim,v,n.sourceInfo);case 54:f=ei.doImplicitCasting(r.type.innerType,l);case 55:if(!((y=r.getAt(s,c))instanceof Hr)){e.next=60;break}if(y.lines===f.lines&&y.columns===f.columns){e.next=60;break}throw g=n.expression.toString(),Nn.invalid_matrix_index_assign_full(n.id,s,y.lines,g,f.lines,n.sourceInfo);case 60:return e.abrupt("return",t.updateStoreArray(n.id,f,s,c));case 61:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"executeDeclaration",value:(_=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n instanceof oe)){e.next=4;break}return e.abrupt("return",this.executeArrayDeclaration(t,n));case 4:if(r=new In(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,a=i,i.type.isCompatible(n.type)){e.next=21;break}if(!q.enable_type_casting||!ei.canImplicitTypeCast(n.type,i.type)){e.next=15;break}a=ei.doImplicitCasting(n.type,a),e.next=21;break;case 15:throw s=i.type.stringInfo(),u=s[0],c=i.type.stringInfo(),l=c[0],f=n.expression.toString(),Nn.incompatible_types_full(u.type,u.dim,l.type,l.dim,f,n.sourceInfo);case 21:r=new In(n.type,a.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 _.apply(this,arguments)})},{key:"executeArrayDeclaration",value:(m=t(o().mark((function e(t,n){var r,i,a,s,u,c;return o().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,ye.INTEGER.isCompatible(r.type)){e.next=5;break}throw Nn.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(a=e.sent,s=null,null===a){e.next=16;break}if(ye.INTEGER.isCompatible(a.type)){e.next=13;break}throw Nn.array_dimension_not_int_full(n.sourceInfo);case 13:if(!((s=a.get().toNumber())<0)){e.next=16;break}throw Nn.array_dimension_not_positive_full(n.sourceInfo);case 16:if(u=new Hr(n.type,[],i,s,null,n.isConst),null===n.initial){e.next=22;break}return e.next=20,this.evaluateArrayLiteral(t,n.initial,n.type,i,s);case 20:c=e.sent,u=new Hr(n.type,c,i,s,null,n.isConst);case 22:return t.insertStore(n.id,u),e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"evaluateExpression",value:(h=t(o().mark((function e(t,n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.instruction_count+=1,this.instruction_count%q.suspend_threshold!=0){e.next=4;break}return e.next=4,ur(3);case 4:if(this.mode!==Se.ABORT){e.next=6;break}throw ir().getMessage("aborted_execution");case 6:if(!(this.instruction_count>=q.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 Un)){e.next=12;break}return e.abrupt("return",this.evaluateUnaryApp(t,n));case 12:if(!(n instanceof Mn)){e.next=16;break}return e.abrupt("return",this.evaluateInfixApp(t,n));case 16:if(!(n instanceof Sn)){e.next=20;break}return e.abrupt("return",this.evaluateArrayAccess(t,n));case 20:if(!(n instanceof Fn)){e.next=24;break}return e.abrupt("return",this.evaluateVariableLiteral(t,n));case 24:if(!(n instanceof On)){e.next=28;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 28:if(!(n instanceof Ln)){e.next=32;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 32:if(!(n instanceof Dn)){e.next=36;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 36:if(!(n instanceof Pn)){e.next=40;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 40:if(!(n instanceof Bn)){e.next=44;break}return e.abrupt("return",this.evaluateLiteral(t,n));case 44:if(!(n instanceof Gn)){e.next=48;break}throw new Error("Internal Error: The system should not eval an array literal.");case 48:if(!(n instanceof Ae)){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 h.apply(this,arguments)})},{key:"evaluateFunctionCall",value:(d=t(o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.isMainCall){e.next=2;break}throw Nn.void_in_expression_full(nr.getMainFunctionName(),n.sourceInfo);case 2:if(r=this.findFunction(n.id),!ye.VOID.isCompatible(r.returnType)){e.next=5;break}throw Nn.void_in_expression_full(n.id,n.sourceInfo);case 5:if(!(this.function_call_stack.length>=q.max_call_stack)){e.next=7;break}throw Nn.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 a=i.applyStore("$"),i.destroy(),this.function_call_stack.pop(),e.abrupt("return",a);case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"evaluateArrayLiteral",value:(p=t(o().mark((function e(t,n,r,i,a){var s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isVector){e.next=9;break}if(null!=a){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,a);case 5:return s=e.sent,e.abrupt("return",s.reduce((function(e,t){return e.concat(t)}),[]));case 9:if(null==a){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 p.apply(this,arguments)})},{key:"evaluateVector",value:(f=t(o().mark((function e(t,n,r,i){var a,s,u=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.value,i===a.length){e.next=3;break}throw Nn.invalid_number_elements_vector(i,n.toString(),a.length,n.sourceInfo);case 3:return e.next=5,Promise.all(a.map((function(e){return u.evaluateExpression(t,e)})));case 5:return s=e.sent,e.abrupt("return",s.map((function(e,t){if(!r.canAccept(e.type,1)){if(!q.enable_type_casting||!ei.canImplicitTypeCast(r.innerType,e.type)){var n=a[t].toString();throw Nn.invalid_array_literal_type_full(n,a[t].sourceInfo)}return ei.doImplicitCasting(r.innerType,e)}return e})));case 7:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return f.apply(this,arguments)})},{key:"evaluateMatrix",value:(c=t(o().mark((function e(t,n,r,i,a){var s,u,c=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=n.value).length===i){e.next=3;break}throw Nn.invalid_number_lines_matrix(i,n.toString(),s.length,n.sourceInfo);case 3:return u=s.map((function(e){var n=new An(r.innerType,1);return c.evaluateVector(t,e,n,a)})),e.next=6,Promise.all(u);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),function(e,t,n,r,i){return c.apply(this,arguments)})},{key:"evaluateLiteral",value:(u=t(o().mark((function e(t,n){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new In(n.type,n.value));case 1:case"end":return e.stop()}}),e)}))),function(e,t){return u.apply(this,arguments)})},{key:"evaluateVariableLiteral",value:(s=t(o().mark((function e(t,n){var r;return o().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 s.apply(this,arguments)})},{key:"evaluateArrayAccess",value:(i=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=t.getStoreObject(n.id)).type instanceof An){e.next=3;break}throw Nn.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,ye.INTEGER.isCompatible(i.type)){e.next=8;break}throw Nn.array_dimension_not_int_full(n.sourceInfo);case 8:return a=i.get().toNumber(),e.next=11,this.evaluateExpression(t,n.column);case 11:if(s=e.sent,u=null,null===s){e.next=17;break}if(ye.INTEGER.isCompatible(s.type)){e.next=16;break}throw Nn.array_dimension_not_int_full(n.sourceInfo);case 16:u=s.get().toNumber();case 17:if(!(a>=r.lines)){e.next=25;break}if(!r.isVector){e.next=22;break}throw Nn.vector_line_outbounds_full(n.id,a,r.lines,n.sourceInfo);case 22:throw Nn.matrix_line_outbounds_full(n.id,a,r.lines,n.sourceInfo);case 23:e.next=27;break;case 25:if(!(a<0)){e.next=27;break}throw Nn.array_dimension_not_positive_full(n.sourceInfo);case 27:if(null===u||0!==r.columns){e.next=29;break}throw Nn.vector_not_matrix_full(n.id,n.sourceInfo);case 29:if(null===u){e.next=36;break}if(!(u>=r.columns)){e.next=34;break}throw Nn.matrix_column_outbounds_full(n.id,u,r.columns,n.sourceInfo);case 34:if(!(u<0)){e.next=36;break}throw Nn.array_dimension_not_positive_full(n.sourceInfo);case 36:if(c=r.getAt(a,u),l=r.type.innerType,!Array.isArray(c)){e.next=43;break}return f=c.map((function(e,t){return new Vr(l,e,a,t,r.id,r.readOnly)})),e.abrupt("return",new Hr(new An(l,1),f,r.columns,null,r.id,r.readOnly));case 43:return e.abrupt("return",new Vr(l,c,a,u,r.id,r.readOnly));case 44:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"evaluateUnaryApp",value:(r=t(o().mark((function e(t,n){var r,i,a,s;return o().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=Mr(n.op,r.type),!ye.UNDEFINED.isCompatible(i)){e.next=8;break}throw a=r.type.stringInfo(),s=a[0],Nn.invalid_unary_op_full(n.op,s.type,s.dim,n.sourceInfo);case 8:e.t0=n.op.ord,e.next=e.t0===zn.ADD.ord?11:e.t0===zn.SUB.ord?12:e.t0===zn.NOT.ord?13:14;break;case 11:return e.abrupt("return",new In(i,r.get()));case 12:return e.abrupt("return",new In(i,r.get().negated()));case 13:return e.abrupt("return",new In(i,!r.get()));case 14:throw new $n("!!!Critical Invalid UnaryApp "+n.op);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"evaluateInfixApp",value:(n=t(o().mark((function e(t,n){var r,i,a,s,u,c,l,f,p,d,h,m,_,v,y,g,x,b,w,E,$,R,k,T,N,I,A;return o().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,a=!1,s=Fr(n.op,r.type,i.type),!ye.UNDEFINED.isCompatible(s)){e.next=18;break}if(!q.enable_type_casting||!ei.canImplicitTypeCast(r.type,i.type)){e.next=13;break}a=!0,e.next=18;break;case 13:throw u=r.type.stringInfo(),c=u[0],l=i.type.stringInfo(),f=l[0],Nn.invalid_infix_op_full(n.op,c.type,c.dim,f.type,f.dim,n.sourceInfo);case 18:p=null,e.t0=n.op.ord,e.next=e.t0===zn.ADD.ord?22:e.t0===zn.SUB.ord?39:e.t0===zn.MULT.ord?40:e.t0===zn.DIV.ord?42:e.t0===zn.MOD.ord?46:e.t0===zn.GT.ord?51:e.t0===zn.GE.ord?55:e.t0===zn.LT.ord?59:e.t0===zn.LE.ord?63:e.t0===zn.EQ.ord?67:e.t0===zn.NEQ.ord?71:e.t0===zn.AND.ord?75:e.t0===zn.OR.ord?76:77;break;case 22:if(!ye.STRING.isCompatible(r.type)){e.next=27;break}return d=xn(i.get(),i.type),e.abrupt("return",new In(s,r.get()+d));case 27:if(!ye.STRING.isCompatible(i.type)){e.next=32;break}return h=xn(r.get(),r.type),e.abrupt("return",new In(s,h+i.get()));case 32:if(!ye.CHAR.isCompatible(r.type)){e.next=38;break}return m=xn(r.get(),r.type),_=xn(i.get(),i.type),e.abrupt("return",new In(s,m+_));case 38:return e.abrupt("return",new In(s,r.get().plus(i.get())));case 39:return e.abrupt("return",new In(s,r.get().minus(i.get())));case 40:return p=r.get().times(i.get()),e.abrupt("return",new In(s,p));case 42:if(0!=i.get()){e.next=44;break}throw Nn.divsion_by_zero_full(n.toString(),n.sourceInfo);case 44:return p=ye.INTEGER.isCompatible(s)?r.get().divToInt(i.get()):r.get().div(i.get()),e.abrupt("return",new In(s,p));case 46:return v=r.get(),y=i.get(),a&&(s=ye.INTEGER,v=v.trunc(),y=y.trunc()),p=v.modulo(y),e.abrupt("return",new In(s,p));case 51:return g=r.get(),x=i.get(),ye.STRING.isCompatible(r.type)?p=g.length>x.length:ye.CHAR.isCompatible(r.type)?p=g.charCodeAt(0)>x.charCodeAt(0):(a&&(s=ye.BOOLEAN,g=g.trunc(),x=x.trunc()),p=g.gt(x)),e.abrupt("return",new In(s,p));case 55:return b=r.get(),w=i.get(),ye.STRING.isCompatible(r.type)?p=b.length>=w.length:ye.CHAR.isCompatible(r.type)?p=b.charCodeAt(0)>=w.charCodeAt(0):(a&&(s=ye.BOOLEAN,b=b.trunc(),w=w.trunc()),p=b.gte(w)),e.abrupt("return",new In(s,p));case 59:return E=r.get(),$=i.get(),ye.STRING.isCompatible(r.type)?p=E.length<$.length:ye.CHAR.isCompatible(r.type)?p=E.charCodeAt(0)<$.charCodeAt(0):(a&&(s=ye.BOOLEAN,E=E.trunc(),$=$.trunc()),p=E.lt($)),e.abrupt("return",new In(s,p));case 63:return R=r.get(),k=i.get(),ye.STRING.isCompatible(r.type)?p=R.length<=k.length:ye.CHAR.isCompatible(r.type)?p=R.charCodeAt(0)<=k.charCodeAt(0):(a&&(s=ye.BOOLEAN,R=R.trunc(),k=k.trunc()),p=R.lte(k)),e.abrupt("return",new In(s,p));case 67:return T=r.get(),N=i.get(),ye.INTEGER.isCompatible(r.type)||ye.REAL.isCompatible(r.type)?(a&&(s=ye.BOOLEAN,T=T.trunc(),N=N.trunc()),p=T.eq(N)):p=T===N,e.abrupt("return",new In(s,p));case 71:return I=r.get(),A=i.get(),ye.INTEGER.isCompatible(r.type)||ye.REAL.isCompatible(r.type)?(a&&(s=ye.BOOLEAN,I=I.trunc(),A=A.trunc()),p=!I.eq(A)):p=I!==A,e.abrupt("return",new In(s,p));case 75:return e.abrupt("return",new In(s,r.get()&&i.get()));case 76:return e.abrupt("return",new In(s,r.get()||i.get()));case 77:throw new $n("!!!Critical Invalid InfixApp "+n.op);case 78:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})}],[{key:"MAIN_INTERNAL_ID",get:function(){return"$main"}}]),e}();var ii=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(e){var t;return a(this,i),(t=r.call(this)).index=0,t.inputList=e,t}return l(i,[{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(ir().getError("exceeded_input_request")))}))}}]),i}(function(){function e(){a(this,e)}return l(e,[{key:"requestInput",value:function(){throw new Error("Must be implemented")}}]),e}());var oi=function(e){p(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function i(){var e;return a(this,i),(e=r.call(this)).list=[],e.currentLine=null,e}return l(i,[{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)}}]),i}(function(){function e(){a(this,e)}return l(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 ai(e,t,n){return si.apply(this,arguments)}function si(){return si=t(o().mark((function e(n,r,i){var a,s,u,c,l,f,p,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.map((function(e){return Object.assign({},e)})),e.prev=1,s=ti.analyseFromSource(n),u=r.map(function(){var e=t(o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new ii(t.input),i=new oi,(a=new ri(s)).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(u);case 6:c=e.sent,l=0;case 8:if(!(l<c.length)){e.next=20;break}if(f=c[l],p=f.program.output.list,(d=f.program.input).index==d.inputList.length){e.next=15;break}return window.showAlert(ir().getMessage("testcase_autogen_unused_input",[f.id+1])),e.abrupt("return",!1);case 15:0==p.length&&window.showAlert(ir().getMessage("testcase_autogen_empty",[f.id+1])),a[f.id].output=p;case 17:++l,e.next=8;break;case 20:return i(a),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]])}))),si.apply(this,arguments)}var ui=U.StringTypes,ci=Object.freeze({i18n:function(e){var t=e.split(":"),n=t[0].toLowerCase(),r=t[1];return ui.ERROR===n?ir().getError(r):ui.MESSAGE===n?ir().getMessage(r):ui.UI===n?ir().getUI(r):(console.warn("A string has been passed to the i18n helper function that was not in the form type:id -> "+e),ir().getString(e,n))}}),li={programming:[],functions:[],datatypes:[],commands:[],filter:[]},fi=ci.i18n})(),r})()));
- //# sourceMappingURL=main.js.map
|