From: support
Date: Wed, 11 May 2022 11:17:17 +0000 (+0000)
Subject: Built motion from commit ff233442.|2.6.10
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%201101license.mail?a=commitdiff_plain;h=8d68e39db0a69e39f485d72ece06a4ddde54c771;p=motion2.git
Built motion from commit ff233442.|2.6.10
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1cd9de3..c2fa397 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-05-10T16:25:28.557Z",
+ "time": "2022-05-11T11:09:04.852Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 3a20596..04fc534 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-05-10T16:25:28.557Z",
+ "time": "2022-05-11T11:09:04.852Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/public/app/main/apps/analytics/i18n/pt-BR.json b/public/app/main/apps/analytics/i18n/pt-BR.json
index 4a4f088..90c2dff 100644
--- a/public/app/main/apps/analytics/i18n/pt-BR.json
+++ b/public/app/main/apps/analytics/i18n/pt-BR.json
@@ -1,7 +1,7 @@
{
"ANALYTICS": {
"SEND_IF_EMPTY": "Enviar se vazio",
- "REPORTNAME": "Nome do relatório",
+ "REPORTNAME": "Nome do Relatório",
"DELETE": "Excluir",
"NAME": "Nome",
"ANALYTICS": "Relatórios",
@@ -19,39 +19,39 @@
"CUSTOM_METRIC_REQUIRED": "Campo obrigatório",
"ALIAS_REQUIRED": "Campo obrigatório"
},
- "NEW_METRIC": "Nova métrica",
- "ADD_METRIC": "Adicionar métrica",
- "EDIT_METRIC": "Editar métrica",
- "DELETE_METRIC": "Excluir métrica",
+ "NEW_METRIC": "Nova Métrica",
+ "ADD_METRIC": "Adicionar Métrica",
+ "EDIT_METRIC": "Editar Métrica",
+ "DELETE_METRIC": "Excluir Métrica",
"SAVE": "Salvar",
"BACK": "Voltar",
"SELECTED": "Selecionado",
- "SELECT_ALL": "Selecionar todos",
- "SELECT_NONE": "Selecione nenhum",
+ "SELECT_ALL": "Selecionar Todos",
+ "SELECT_NONE": "Selecione Nenhum",
"TYPE": "Tipo",
- "EXTRACTEDREPORTS": "Relatórios extraÃdos",
- "DATE_RANGE_FROM": "Intervalo de datas de",
- "DATE_RANGE_TO": "Intervalo de datas para",
+ "EXTRACTEDREPORTS": "Relatórios ExtraÃdos",
+ "DATE_RANGE_FROM": "Intervalo de Datas de",
+ "DATE_RANGE_TO": "Intervalo de Datas para",
"GENERATED_AT": "Gerado em",
"STATUS": "Status",
"OUTPUT": "SaÃda",
"REPORTS": "Relatórios",
- "SEARCH_FOR_FOLDER": "Procurar por pasta",
+ "SEARCH_FOR_FOLDER": "Procurar por Pasta",
"CREATED_AT": "Criado em",
- "NEW_REPORT": "Novo relatório",
- "ADD_REPORT": "Adicionar relatório",
- "COPY_REPORT": "Copiar relatório",
- "PREVIEW_REPORT": "Relatório de pré-visualização",
- "RUN_REPORT": "Executar relatório",
- "DOWNLOAD_JSON_REPORT": "Exportar relatório JSON",
- "EDIT_REPORT": "Editar relatório",
- "DELETE_REPORT": "Excluir relatório",
- "CREATE": "Criar pasta",
- "RENAME": "Renomear pasta",
- "REMOVE": "Remover pasta",
- "SELECT_NODE": "Selecione a pasta",
+ "NEW_REPORT": "Novo Relatório",
+ "ADD_REPORT": "Adicionar Relatório",
+ "COPY_REPORT": "Copiar Relatório",
+ "PREVIEW_REPORT": "Pré-visualizar Relatório",
+ "RUN_REPORT": "Executar Relatório",
+ "DOWNLOAD_JSON_REPORT": "Exportar Relatório JSON",
+ "EDIT_REPORT": "Editar Relatório",
+ "DELETE_REPORT": "Excluir Relatório",
+ "CREATE": "Criar Pasta",
+ "RENAME": "Renomear Pasta",
+ "REMOVE": "Remover Pasta",
+ "SELECT_NODE": "Selecione a Pasta",
"ERROR": "Erro",
- "QUERY_ERROR": "Erro de consulta",
+ "QUERY_ERROR": "Erro de Consulta",
"MESSAGE": "Mensagem",
"CLOSE": "Fechar",
"FORMAT": "Formato",
@@ -63,27 +63,27 @@
"GROUP": "Grupo",
"COLUMN": "Coluna",
"VALUE": "Valor",
- "PREVIEW": "Visualizar",
- "LIMITED_RESULT": "* Resultados limitados",
+ "PREVIEW": "Pré-visualizar",
+ "LIMITED_RESULT": "*Resultados limitados",
"NO_DATA": "Nenhum resultado de dados",
"CONDITIONS": "Condições",
"ALIAS": "Alias",
"FUNCTION": "Função",
"GROUP_BY": "Agrupar por",
"ORDER_BY": "Ordenar por",
- "ADD_REPORTFIELD": "Adicionar campo",
- "EDIT_REPORTFIELD": "Editar campo",
- "DELETE_REPORTFIELD": "Excluir campo",
- "METRIC_NAME": "Nome métrica",
- "NO_METRIC_FOUND": "Nenhuma métrica encontrada",
- "NO_AVAILABLE_INFO": "Nenhuma informação disponÃvel",
- "CUSTOM_METRIC": "Métrica personalizada",
- "DELETE_EXTRACTEDREPORT": "Excluir relatório extraÃdo",
- "EDIT_EXTRACTEDREPORT": "Editar relatório extraÃdo",
- "DOWNLOAD_EXTRACTEDREPORT": "Download do relatório extraÃdo",
+ "ADD_REPORTFIELD": "Adicionar Campo",
+ "EDIT_REPORTFIELD": "Editar Campo",
+ "DELETE_REPORTFIELD": "Excluir Campo",
+ "METRIC_NAME": "Nome Métrica",
+ "NO_METRIC_FOUND": "Nenhuma Métrica Encontrada",
+ "NO_AVAILABLE_INFO": "Nenhuma Informação DisponÃvel",
+ "CUSTOM_METRIC": "Métrica Personalizada",
+ "DELETE_EXTRACTEDREPORT": "Excluir Relatório ExtraÃdo",
+ "EDIT_EXTRACTEDREPORT": "Editar Relatório ExtraÃdo",
+ "DOWNLOAD_EXTRACTEDREPORT": "Download do Relatório ExtraÃdo",
"PAGE": "Página",
- "ROWSPERPAGE": "Linhas por página",
+ "ROWSPERPAGE": "Linhas por Página",
"OF": "do",
- "WEB_REPORT": "Relatório da web"
+ "WEB_REPORT": "Relatório Web"
}
}
diff --git a/public/app/main/apps/callysquare/i18n/pt-BR.json b/public/app/main/apps/callysquare/i18n/pt-BR.json
index 65af7ca..43ccb77 100644
--- a/public/app/main/apps/callysquare/i18n/pt-BR.json
+++ b/public/app/main/apps/callysquare/i18n/pt-BR.json
@@ -1,73 +1,73 @@
{
"CALLYSQUARE": {
"ACCOUNT_ID": "Conta",
- "ADDUSER_PROJECTS": "Adicionar usuários ao projeto",
+ "ADDUSER_PROJECTS": "Adicionar Usuários ao Projeto",
"ADD_ODBC": "Adicionar ODBC",
"ADD_PROJECT": "Adicionar Projeto",
"ADD_VARIABLE": "Adicionar Variável",
"AGENTS": "Agentes",
"AGI": "AGI",
- "ALL_USERS": "Todos os usuários",
+ "ALL_USERS": "Todos Usuários",
"ANSWER": "Responda",
"APIKEY": "Chave API",
- "APPID": "ID do aplicativo",
+ "APPID": "ID do Aplicativo",
"APPLICATION": "Aplicação",
- "APPSECRET": "App Secret",
+ "APPSECRET": "Senha do Aplicativo",
"ARGS": "Argumentos",
"ATTACHMENT_NAME": "Nome do Anexo",
- "ATTACHMENT_PATH": "Caminho de Anexos",
+ "ATTACHMENT_PATH": "Caminho do Anexo",
"ATTACHMENT_TYPE": "Tipo de Anexo",
- "AUDIO": "Audio",
- "AUDIOENCODING": "Codificação de áudio",
+ "AUDIO": "Ãudio",
+ "AUDIOENCODING": "Codificação de Ãudio",
"AWSLEX": "Amazon Lex",
"AWSPOLLY": "AWS Polly",
- "AWS_ACCESS_KEY_ID": "Access Key ID",
- "AWS_BOT_NAME": "Nome BOT",
+ "AWS_ACCESS_KEY_ID": "ID Chave de Acesso",
+ "AWS_BOT_NAME": "Nome Bot",
"AWS_LEX_REGION": "Região",
"AWS_POLLY_REGION": "Região",
"AWS_POLLY_VOICE": "Voz",
- "AWS_SECRET_ACCESS_KEY": "Secret Access Key",
+ "AWS_SECRET_ACCESS_KEY": "Senha da Chave de Acesso",
"AWS_TEXT_TYPE": "Tipo de texto",
"BACK": "Voltar",
"BCC": "BCC",
"BEEP": "Beep",
- "BODY": "Corpo",
+ "BODY": "Body",
"CALLBACK": "Callback",
"CALLBACK_PRIORITY": "Prioridade",
"CALLYSQUARE": "Cally Square",
"CC": "CC",
- "CHOOSE_ATTACHMENT": "Escolha o anexo",
+ "CHOOSE_ATTACHMENT": "Escolha o Anexo",
"CLOSE": "Fechar",
"COMMAND": "Comando",
"COMPUTEDVARIABLES": "Caminho do script de variáveis computadas",
"CONDITION": "Condição",
"CONTEXT": "Contexto",
"COPY": "Copiar",
- "COPY_PROJECT": "Copiar projeto",
+ "COPY_PROJECT": "Copiar Projeto",
"CREATED_AT": "Criado em",
"CUSTOM_ACTION": "Ação Personalizada",
- "CUSTOM_ACTION_DATA": "Dados de ação personalizada",
+ "CUSTOM_ACTION_DATA": "Dados de Ação Personalizada",
"CUSTOM_APP": "Aplicativo Personalizado",
- "DATABASE": "Base de dados",
+ "DATABASE": "Database",
"DELAY": "delay [min]",
"DELETE": "Excluir",
"DELETE_ODBC": "Deletar ODBC",
"DELETE_PROJECT": "Deletar Projeto",
- "DELETE_SQUARERECORDING": "Excluir gravação",
+ "DELETE_SQUARERECORDING": "Excluir Gravação Cally Square",
"DESCRIPTION": "Descrição",
"DIAL": "Discar",
"DIALOGFLOW": "Dialogflow",
"DIALOGFLOW_LANGUAGE": "Idioma",
"DIGIT": "Max DÃgitos",
"DIGITS": "DÃgitos",
- "DOWNLOAD_SQUARERECORDING": "Download Gravação",
- "DROP_TO_UPLOAD": "DROP TO UPLOAD",
+ "DOWNLOAD_SQUARERECORDING": "Download Gravação Cally Square",
+ "DROP_TO_UPLOAD": "SOLTAR AQUI PARA CARREGAR",
"DROP_TO_UPLOAD_MESSAGE": "Você também pode soltar arquivos aqui para fazer o upload. Apenas XML - Máx. 5MB",
"DSN": "DSN",
"EDIT": "Editar",
"EDIT_ODBC": "Editar ODBC",
"EDIT_PROJECT": "Editar Projeto",
- "EDIT_SQUARERECORDING": "Editar gravação",
+ "EDIT_SQUARERECORDING": "Editar Gravação Cally Square",
"EDIT_XML": "Editar XML",
"END": "Fim",
"ERRORS": {
@@ -77,23 +77,23 @@
"PROJECT_REQUIRED": "Campo obrigatório",
"URL_REQUIRED": "Campo obrigatório"
},
- "ESCAPE_DIGITS": "DÃgitos de Escape",
+ "ESCAPE_DIGITS": "Escape Digits",
"EXTEN": "Exten",
"EXTENSION": "Extensão",
"EXT_DIAL": "Discagem Externa",
"FILE": "Nome do arquivo",
- "FILENAME": "Nome do arquivo",
- "FILE_ID": "Audio",
+ "FILENAME": "Nome do Arquivo",
+ "FILE_ID": "Ãudio",
"FINALLY": "Finalmente",
"FINDBY": "Encontrar por",
"GETDIGITS": "Obter dÃgitos",
- "GETSECRETDIGITS": "Obter dÃgitos secretos",
+ "GETSECRETDIGITS": "Obter DÃgitos Secretos",
"GOAL": "Objetivo",
- "GOALNAME": "Nome do objetivo",
+ "GOALNAME": "Nome do Objetivo",
"GOOGLEASR": "GoogleASR",
"GOOGLE_ASR_LANGUAGE": "Idioma",
"GOOGLE_CLOUD_TTS": "Google Cloud TTS",
- "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Tipo de texto",
+ "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Tipo de Texto",
"GOOGLE_TTS_LANGUAGE": "Idioma",
"GOSUB": "GoSub",
"GOTOC": "GoTo",
@@ -104,15 +104,15 @@
"HANGUP": "Desligar",
"HEADERS": "Cabeçalhos",
"HELP": {
- "BCC": "Você pode adicionar vários endereços separados por vÃrgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)",
- "CC": "Você pode adicionar vários endereços separados por vÃrgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)",
- "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion",
+ "BCC": "Você pode adicionar vários endereços separados por vÃrgulas (exemplo: john.doe@xcally.com, jane.miller@xcally.com)",
+ "CC": "Você pode adicionar vários endereços separados por vÃrgulas (exemplo: john.doe@xcally.com, jane.miller@xcally.com)",
+ "DSN": "Exemplo: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion",
"MAILBOX": "mailbox@context",
"MAX_TEXT_TTS": "O número máximo de caracteres suportados é 200",
- "TO": "Você pode adicionar vários endereços separados por vÃrgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)"
+ "TO": "Você pode adicionar vários endereços separados por vÃrgulas (exemplo: john.doe@xcally.com, jane.miller@xcally.com)"
},
- "HIDDENDIGITSNUM": "Número de dÃgitos ocultos",
- "HIDDENDIGITSPOS": "Posição dos DÃgitos ocultos",
+ "HIDDENDIGITSNUM": "Número de DÃgitos Ocultos",
+ "HIDDENDIGITSPOS": "Posição dos DÃgitos Ocultos",
"ID": "Id",
"IMPORT": "Importar",
"IMPORT_XML": "Importar XML",
@@ -124,15 +124,15 @@
"ISPEECH_TTS_LANGUAGE": "Idioma",
"KEY": "Key",
"LABEL": "Label",
- "LANGUAGECODE": "Código do idioma",
- "LASTNAME": "Ãltimo nome",
+ "LANGUAGECODE": "Código do Idioma",
+ "LASTNAME": "Sobrenome",
"LIST_ID": "Lista",
"LOGIN": "Login",
"LOGOUT": "Logout",
"LUMENVOXASR": "Lumenvox ASR",
"LUMENVOXTTS": "Lumenvox Text-To-Speech",
"MACRO": "Macro",
- "MAILBOX": "Caixa de correio",
+ "MAILBOX": "Caixa de Correio",
"MATH": "Math",
"MAXDIGIT": "DÃgitos Máximos",
"MENU": "Menu",
@@ -142,16 +142,16 @@
"MRCPRECOG": "MRCPRecog",
"MRCPSYNTH": "MRCPSynth",
"NAME": "Nome",
- "NDAACTIVITY_TYPE": "Tipo de atividade",
- "NDAGENERATE_AUDIO": "Gerar arquivo de áudio",
- "NDASSISTANT_URL": "URL NDASSISTANT",
- "NDAUTH_URL": "URL do NDAUTH",
+ "NDAACTIVITY_TYPE": "Tipo de Atividade",
+ "NDAGENERATE_AUDIO": "Gerar Arquivo de Ãudio",
+ "NDASSISTANT_URL": "NDASSISTANT Url",
+ "NDAUTH_URL": "NNDAUTH Url",
"NEW": "Novo",
"NEW_ODBC": "Nova conexão ODBC",
- "NEW_PROJECT": "Novo projeto",
+ "NEW_PROJECT": "Novo Projeto",
"NEW_VARIABLE": "Nova Variável",
"NOOP": "NoOp",
- "NOTES": "Notas",
+ "NOTES": "Anotações",
"NO_AVAILABLE_INFO": "Nenhuma informação disponÃvel",
"NUMBER": "Número",
"ODBC": "ODBC",
@@ -159,7 +159,7 @@
"OF": "do",
"OPEN": "Abrir",
"OPEN_NEW_WINDOW": "Abra em uma nova janela",
- "OPEN_PROJECT": "Projeto aberto",
+ "OPEN_PROJECT": "Projeto Aberto",
"OPERATION": "Operação",
"OPTIONS": "Opções",
"OPTS": "Opções",
@@ -168,7 +168,7 @@
"PASSWORD": "Senha",
"PAUSE": "Pausa",
"PAUSE_ID": "Tipo de pausa",
- "PERMISSIONADD_PROJECTS": "Adicionar usuários ao projeto",
+ "PERMISSIONADD_PROJECTS": "Adicionar Usuários ao Projeto",
"PHONE": "Telefone",
"PLAYBACK": "Reprodução",
"POSITION": "Posição",
@@ -182,20 +182,20 @@
"RAWBODY": "Corpo",
"RAWHEADERS": "Cabeçalhos",
"RECORD": "Gravação",
- "RECORDINGFORMAT": "Formato de gravação",
- "RESPONSE": "Tempo limite de resposta",
+ "RECORDINGFORMAT": "Formato de Gravação",
+ "RESPONSE": "Tempo Limite de Resposta",
"RESTAPI": "API Rest",
"RETRY": "Repetições",
"ROWSPERPAGE": "Linhas por página",
"SAVE": "Salvar",
- "SAYDIGITS": "Say Digits",
- "SAYNUMBER": "Say number",
+ "SAYDIGITS": "Falar DÃgitos",
+ "SAYNUMBER": "Falar Numero",
"SAYPHONETIC": "Say Phonetics",
"SEARCH_FOR_ANYONE": "Procurar",
"SELECTED": "Selecionado",
"SELECTED_USERS": "Usuários Selecionados",
- "SELECT_ALL": "Selecionar tudo",
- "SELECT_NONE": "Selecione nenhum",
+ "SELECT_ALL": "Selecionar Tudo",
+ "SELECT_NONE": "Selecione Nenhum",
"SENDFAX": "Enviar Fax",
"SENDMAIL": "Enviar Email",
"SENDSMS": "Enviar SMS",
@@ -224,21 +224,21 @@
"TTS": "Google Text-To-Speech",
"UNIQUEID": "Unique ID",
"UNPAUSE": "Fim da Pausa",
- "UPDATE_DESCRIPTION": "Atualizar descrição",
- "UPDATE_INFO": "Informação de atualização",
+ "UPDATE_DESCRIPTION": "Atualizar Descrição",
+ "UPDATE_INFO": "Update Info",
"URI": "URI",
"URL": "URL",
- "USERNAME": "Nome de usuário",
+ "USERNAME": "Nome de Usuário",
"USERS": "Usuários",
"VARIABLE_ID": "Variável",
"VARIABLE_VALUE": "Valor",
- "VOICEMAIL": "Correio de voz",
+ "VOICEMAIL": "Correio de Voz",
"VSWITCH": "Variable Switch",
- "CLIENT_EMAIL": "Email do cliente",
+ "CLIENT_EMAIL": "Email do Cliente",
"DIALOGFLOWV2": "DialogflowV2",
- "DIALOGFLOWV2_LANGUAGE": "LÃngua",
- "DIALOGFLOWV2_PROJECT_ID": "ID do projeto",
- "PRIVATE_KEY": "Chave privada",
+ "DIALOGFLOWV2_LANGUAGE": "Idioma",
+ "DIALOGFLOWV2_PROJECT_ID": "ID do Projeto",
+ "PRIVATE_KEY": "Chave Privada",
"DIALTIMEZONE": "Fuso horário de discagem"
}
}
diff --git a/public/app/main/apps/contactmanager/i18n/pt-BR.json b/public/app/main/apps/contactmanager/i18n/pt-BR.json
index b84d6b8..df501db 100644
--- a/public/app/main/apps/contactmanager/i18n/pt-BR.json
+++ b/public/app/main/apps/contactmanager/i18n/pt-BR.json
@@ -1,25 +1,25 @@
{
"CONTACTMANAGER": {
- "SELECT_TAG": "Selecione tags",
+ "SELECT_TAG": "Selecione Tags",
"CUSTOMER_JOURNEY": "Jornada do Cliente",
- "USERID": "Lembrar ID do agente",
+ "USERID": "Lembrar ID do Agente",
"PRIORITY": "Prioridade",
"MOTIONDIALER": "Motion Bull",
"IMPORT_CONTACTS": "Importar Contatos",
- "PREFIX": "Prefixo de discagem",
- "VOICEQUEUEID": "ID da Fila de Voz",
- "CAMPAIGNID": "ID da campanha",
+ "PREFIX": "Prefixo de Discagem",
+ "VOICEQUEUEID": "ID Fila de Voz",
+ "CAMPAIGNID": "ID Campanha",
"STATE": "Estado",
"NAME": "Nome",
"LISTS": "Listas",
- "UNIQUEID": "ID unico",
+ "UNIQUEID": "ID Ãnico",
"STATUS": "Status",
"STARTTIME": "InÃcio",
"ENDTIME": "Fim",
"MOTION_BULL": "Motion Bull",
"HOPPER": "Funil",
- "FINAL": "Final do funil",
- "HISTORY": "História do funil",
+ "FINAL": "Final do Funil",
+ "HISTORY": "Histórico do Funil",
"SCHEDULEDAT": "Agendado em",
"SEARCH_FOR_ANYONE": "Procurar",
"EDIT_LIST": "Editar Lista",
@@ -27,8 +27,8 @@
"DELETE_LIST": "Excluir Lista",
"DELETE_HOPPER": "Excluir Funil",
"RELOAD": "Recarregar",
- "NO_COMPANIES": "Nenhuma empresa",
- "NO_AVAILABLE_ITEMS": "Nenhum item disponÃvel",
+ "NO_COMPANIES": "Nenhuma Empresa",
+ "NO_AVAILABLE_ITEMS": "Nenhum Item DisponÃvel",
"ADD": "Adicionar",
"ERRORS": {
"NAME_REQUIRED": "Campo obrigatório",
@@ -42,15 +42,15 @@
"CLICKTOACTION_REQUIRED": "Campo obrigatório"
},
"DESCRIPTION": "Descrição",
- "DISPOSITION": "Descrição",
- "DISPOSITIONS": "Descrição",
- "VOICEDISPOSITIONS": "Disposições de voz",
- "NEW_VOICEDISPOSITION": "Nova disposição de voz",
- "CUSTOM_FIELDS": "Os campos personalizados",
+ "DISPOSITION": "Qualificação",
+ "DISPOSITIONS": "Qualificações",
+ "VOICEDISPOSITIONS": "Qualificações de Voz",
+ "NEW_VOICEDISPOSITION": "Nova Qualificação de Voz",
+ "CUSTOM_FIELDS": "Os Campos Personalizados",
"ADD_LIST": "Adicionar Lista",
"BACK": "Voltar",
"SELECTED": "Selecionado",
- "SELECT_ALL": "Selecionar todos",
+ "SELECT_ALL": "Selecionar Todos",
"SELECT_NONE": "Selecionar Nenhum",
"COMPANIES": "Empresas",
"EDIT_COMPANY": "Editar Empresa",
@@ -76,28 +76,28 @@
"MOBILE": "Celular",
"FAX": "Fax",
"TAGS": "Tags",
- "SHOW_ALL_FIELDS": "Mostrar todos os campos",
- "FEWER_FIELDS": "Mostrar menos campos",
+ "SHOW_ALL_FIELDS": "Mostrar Todos Campos",
+ "FEWER_FIELDS": "Reduzir Campos",
"COUNTRY": "PaÃs",
"CITY": "Cidade",
"STREET": "Rua",
"POSTALCODE": "CEP",
"DELETE": "Excluir",
- "DELETE_ALL": "Excluir tudo",
- "CONTACTMANAGER": "Gerente de contatos",
+ "DELETE_ALL": "Excluir Tudo",
+ "CONTACTMANAGER": "Mailing",
"ID": "Id",
"SETTINGS": "Configurações",
"GENERAL": "Geral",
- "CUSTOMFIELDS": "Os campos personalizados",
- "NO_CUSTOMFIELD_AVAILABLE": "Nenhum campo personalizado disponÃvel",
+ "CUSTOMFIELDS": "Campos Personalizados",
+ "NO_CUSTOMFIELD_AVAILABLE": "Nenhum Campo Personalizado DisponÃvel",
"ADD_TAG": "Adicionar Tag",
"NO_TAG": "Sem Tags",
- "ALIAS": "Apelido",
+ "ALIAS": "Alias",
"TYPE": "Tipo",
"VALUE": "Valor",
- "ADD_CUSTOMFIELD": "Adicionar campo personalizado",
- "EDIT_CUSTOMFIELD": "Editar campo personalizado",
- "DELETE_CUSTOMFIELD": "Excluir campo personalizado",
+ "ADD_CUSTOMFIELD": "Adicionar Campo Personalizado",
+ "EDIT_CUSTOMFIELD": "Editar Campo Personalizado",
+ "DELETE_CUSTOMFIELD": "Excluir Campo Personalizado",
"NEW_COMPANY": "Nova Empresa",
"NEW_CONTACT": "Novo Contato",
"NEW_TAG": "Nova Tag",
@@ -106,68 +106,68 @@
"SUCCESS": "Sucesso",
"FAILURE": "Falha",
"ALL_CONTACTS": "Todos os Contatos",
- "NEW_CUSTOMFIELD": "Novo campo personalizado",
- "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma disposição de voz disponÃvel",
- "ADD_VOICEDISPOSITION": "Adicionar disposição de voz",
- "EDIT_VOICEDISPOSITION": "Editar disposição de voz",
- "DELETE_VOICEDISPOSITION": "Excluir disposição de voz",
+ "NEW_CUSTOMFIELD": "Novo campo Personalizado",
+ "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma Disposição de Voz DisponÃvel",
+ "ADD_VOICEDISPOSITION": "Adicionar Disposição de Voz",
+ "EDIT_VOICEDISPOSITION": "Editar Disposição de Voz",
+ "DELETE_VOICEDISPOSITION": "Excluir Disposição de Voz",
"VAT": "VAT",
"COMPANYID": "ID Empresa",
"WEBSITE": "Website",
- "EMAIL_DOMAIN": "DomÃnio de email",
+ "EMAIL_DOMAIN": "DomÃnio de Email",
"ADDRESS": "Endereço",
"POSTAL_CODE": "CEP",
"SHIPMENTADDRESS": "Endereço de Envio",
- "COPY_CONTACT": "Copiar contato",
- "GOTOCONTACTS_LIST": "Mostrar contatos",
- "GOTOCONTACTS_COMPANY": "Mostrar contatos",
- "ADD_AGENT_TO_LIST": "Adicionar agente à lista",
- "AGENTADD_LIST": "Adicionar agentes à lista",
- "NO_AVAILABLE_INFO": "Nenhuma informação disponÃvel",
+ "COPY_CONTACT": "Copiar Contato",
+ "GOTOCONTACTS_LIST": "Ir para Lista de Contatos",
+ "GOTOCONTACTS_COMPANY": "Ir para Empresas",
+ "ADD_AGENT_TO_LIST": "Adicionar Agente à Lista",
+ "AGENTADD_LIST": "Adicionar Agentes à Lista",
+ "NO_AVAILABLE_INFO": "Nenhuma Informação DisponÃvel",
"NONE": "Nenhum",
- "FULLNAME": "Nome COmpleto",
- "CHECK_DUPLICATES": "Verificar duplicados",
- "DUPLICATES": "Duplicatas",
+ "FULLNAME": "Nome Completo",
+ "CHECK_DUPLICATES": "Verificar Duplicados",
+ "DUPLICATES": "Duplicados",
"UPLOAD_CSV": "Envio CSV",
"TAG": "Tag",
"UPLOAD": "Envio",
- "ALL_AGENTS": "Todos os agentes",
+ "ALL_AGENTS": "Todos os Agentes",
"SELECTED_AGENTS": "Agentes Selecionados",
- "DATE_OF_BIRTH": "Data de nascimento",
- "DATEOFBIRTH": "Data de nascimento",
+ "DATE_OF_BIRTH": "Data de Nascimento",
+ "DATEOFBIRTH": "Data de Nascimento",
"NOTES": "Notas",
"EXPORTCSVCONTACTS_LIST": "Exportar para CSV",
- "GOTO_LIST": "Mostrar contatos",
- "GOTO_COMPANY": "Mostrar contatos",
- "REQUIRED": "Requeridos",
- "GLOBALCUSTOMFIELDS": "Campos personalizados globais",
- "NEW_GLOBALCUSTOMFIELD": "Novos campos personalizados",
- "ADD_GLOBALCUSTOMFIELD": "Adicionar campo personalizado",
- "EDIT_GLOBALCUSTOMFIELD": "Editar campo personalizado",
- "DELETE_GLOBALCUSTOMFIELD": "Excluir campo personalizado",
+ "GOTO_LIST": "Ir para Listas",
+ "GOTO_COMPANY": "Ir para Empresas",
+ "REQUIRED": "Obrigatório",
+ "GLOBALCUSTOMFIELDS": "Campos Personalizados Globais",
+ "NEW_GLOBALCUSTOMFIELD": "Novo Campo Personalizado Global",
+ "ADD_GLOBALCUSTOMFIELD": "Adicionar Campo Personalizado Global",
+ "EDIT_GLOBALCUSTOMFIELD": "Editar Campo Personalizado Global",
+ "DELETE_GLOBALCUSTOMFIELD": "Excluir Campo Personalizado Global",
"JSCRIPTY": "Jscripty",
"SESSIONS": "Sessões",
"AGENT": "Agente",
"PROJECT": "Projeto",
- "SELECT_LIST": "Selecione uma lista",
- "SELECT_COMPANY": "Selecione uma empresa",
- "SELECT_TAGS": "Selecione uma ou mais tags",
+ "SELECT_LIST": "Selecione Lista",
+ "SELECT_COMPANY": "Selecione Empresa",
+ "SELECT_TAGS": "Selecione uma ou mais Tags",
"HELP": {
"PHONEBAR_API_MESSAGE": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada",
"PHONEBAR_API": "Para ativar o recurso clique para ligar, insira um número de telefone e verifique se a chave de controle remoto do agente está ativada"
},
"PAGE": "Página",
- "ROWSPERPAGE": "Linhas por página",
+ "ROWSPERPAGE": "Linhas por Página",
"OF": "do",
"SOCIAL": "Social",
"ROW": "Linha",
- "EXPORT_ERRORS": "Exportar erros",
- "UPLOAD_COMPLETED": "Upload concluÃdo",
+ "EXPORT_ERRORS": "Exportar Erros",
+ "UPLOAD_COMPLETED": "Upload ConcluÃdo",
"STOP": "Pare",
- "SELECT_FILE": "Selecione o arquivo",
+ "SELECT_FILE": "Selecione o Arquivo",
"ALL": "Tudo",
"BILLINGINFORMATION": "Informações de pagamento",
- "COMPANY_FISCAL_TYPE": "Tipo fiscal da empresa",
+ "COMPANY_FISCAL_TYPE": "Tipo Fiscal da Empresa",
"CREATE": "Crio",
"EUROPE": "Europa",
"EXPIREDAY": "Dias de Vencimento",
diff --git a/public/app/main/apps/dashboards/i18n/sv.json b/public/app/main/apps/dashboards/i18n/sv.json
index a7727f7..cdc4504 100644
--- a/public/app/main/apps/dashboards/i18n/sv.json
+++ b/public/app/main/apps/dashboards/i18n/sv.json
@@ -252,7 +252,7 @@
"TODAY": "I dag",
"SELECT_DATE": "Välj Startdatum",
"SELECT_DATE_RANGE": "Välj datumintervall",
- "CLEAR": "Rensa",
+ "CLEAR": "Klar",
"CALL_NUMBER": "Ring upp",
"TRANSFER_NUMBER": "Ãverföra",
"CALL_SAVED": "Ring korrekt sparad",
diff --git a/public/app/main/apps/motiondialer/i18n/pt-BR.json b/public/app/main/apps/motiondialer/i18n/pt-BR.json
index 6f70beb..ee8630a 100644
--- a/public/app/main/apps/motiondialer/i18n/pt-BR.json
+++ b/public/app/main/apps/motiondialer/i18n/pt-BR.json
@@ -1,21 +1,21 @@
{
"MOTIONDIALER": {
- "LOGIN_TIME": "Tempo de login",
- "PAUSE_TIME": "Tempo de pausa",
- "CUTDIGIT": "Cut Digits",
+ "LOGIN_TIME": "Tempo de Login",
+ "PAUSE_TIME": "Tempo de Pausa",
+ "CUTDIGIT": "Cortar DÃgitos",
"RANDOMLASTDIGITCALLERIDNUMBER": "Número de Chamada de SaÃda Aleatória",
"CLONE_IVRCAMPAIGN": "Clonar Campanha",
"CLONE_QUEUECAMPAIGN": "Clonar Fila de Campanha",
"ABANDONEDCALLS": "Chamadas Abandonadas em Filas",
- "HOPPERWIDGET": "Resumo",
- "RESETLIST_IVRCAMPAIGN": "Redefinir listas",
- "RESETLIST_QUEUECAMPAIGN": "Redefinir listas",
- "RESET": "Reset",
- "RESETLIST": "Reset Listas",
- "SELECTALL": "Selecionar tudo",
- "UNSELECTALL": "Desmarque todos",
- "NO_AVAILABLE_INFO": "Nenhuma informação disponÃvel",
- "TIMEOUT": "Tempo esgotado",
+ "HOPPERWIDGET": "Sumário",
+ "RESETLIST_IVRCAMPAIGN": "Redefinir Listas",
+ "RESETLIST_QUEUECAMPAIGN": "Redefinir Listas",
+ "RESET": "Redefinir",
+ "RESETLIST": "Redefinir Listas",
+ "SELECTALL": "Selecionar Tudo",
+ "UNSELECTALL": "Desmarcar Todos",
+ "NO_AVAILABLE_INFO": "Nenhuma Informação DisponÃvel",
+ "TIMEOUT": "Tempo Esgotado",
"CALLYSQUAREPROJECTPREVIEW": "Visualização do Projeto Cally Square",
"CALLYSQUAREPROJECTPREVIEW2": "Pós Visualização do Projeto Cally Square",
"RUNIFHANGUPAGENT": "Executar o Projeto Cally Square Depois mesmo que o agente desligue a chamada",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index bca62d1..e900abd 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x843b=['jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','STRING','integration','motionbar'];(function(_0xa8691c,_0x5d7a58){var _0x2d2817=function(_0x4725bd){while(--_0x4725bd){_0xa8691c['push'](_0xa8691c['shift']());}};_0x2d2817(++_0x5d7a58);}(_0x843b,0x91));var _0xb843=function(_0x4570b1,_0x3d6165){_0x4570b1=_0x4570b1-0x0;var _0x47f29a=_0x843b[_0x4570b1];return _0x47f29a;};'use strict';var Sequelize=require(_0xb843('0x0'));module[_0xb843('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4d2352){return this[_0xb843('0x2')](_0xb843('0x3'));}},'action':{'type':Sequelize[_0xb843('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xb843('0x5'),_0xb843('0x6'),_0xb843('0x7'),_0xb843('0x8'),'browser',_0xb843('0x9'),_0xb843('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xb843('0xb')},'data1':{'type':Sequelize[_0xb843('0x4')](0x1000),'comment':_0xb843('0xc')},'data2':{'type':Sequelize[_0xb843('0x4')](0x1000),'comment':_0xb843('0xd')},'data3':{'type':Sequelize[_0xb843('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xb843('0xe')},'data5':{'type':Sequelize[_0xb843('0x4')](0x1000),'comments':_0xb843('0xf')},'data6':{'type':Sequelize[_0xb843('0x4')],'comments':_0xb843('0x10')},'data7':{'type':Sequelize[_0xb843('0x11')],'comments':_0xb843('0x12')}};
\ No newline at end of file
+var _0xeb2e=['urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x1f3dcc,_0x39e9f9){var _0xf990ba=function(_0x4ba656){while(--_0x4ba656){_0x1f3dcc['push'](_0x1f3dcc['shift']());}};_0xf990ba(++_0x39e9f9);}(_0xeb2e,0xba));var _0xeeb2=function(_0x285970,_0x59adb9){_0x285970=_0x285970-0x0;var _0x1dda06=_0xeb2e[_0x285970];return _0x1dda06;};'use strict';var Sequelize=require('sequelize');module[_0xeeb2('0x0')]={'name':{'type':Sequelize[_0xeeb2('0x1')],'get':function(_0x4c2e11){return this[_0xeeb2('0x2')](_0xeeb2('0x3'));}},'action':{'type':Sequelize[_0xeeb2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xeeb2('0x5'),'integration','motionbar','jscripty',_0xeeb2('0x6'),_0xeeb2('0x7'),_0xeeb2('0x8'),_0xeeb2('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xeeb2('0xa')},'data1':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comment':_0xeeb2('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xeeb2('0xc')},'data3':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comment':_0xeeb2('0xd')},'data4':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xeeb2('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0xeeb2('0x4')],'comments':_0xeeb2('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0xeeb2('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 415bb09..ef3623f 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x214e=['update','then','stack','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0x214e,0x86));var _0xe214=function(_0x29891a,_0x25cfbe){_0x29891a=_0x29891a-0x0;var _0x2f55e2=_0x214e[_0x29891a];return _0x2f55e2;};'use strict';var emlformat=require(_0xe214('0x0'));var rimraf=require(_0xe214('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe214('0x2'));var rp=require(_0xe214('0x3'));var moment=require('moment');var BPromise=require(_0xe214('0x4'));var Mustache=require(_0xe214('0x5'));var util=require(_0xe214('0x6'));var path=require(_0xe214('0x7'));var sox=require(_0xe214('0x8'));var csv=require(_0xe214('0x9'));var ejs=require(_0xe214('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe214('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe214('0xc'));var deskjs=require(_0xe214('0xd'));var toCsv=require(_0xe214('0x9'));var querystring=require(_0xe214('0xe'));var Papa=require(_0xe214('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe214('0x10'));var hardwareService=require(_0xe214('0x11'));var logger=require(_0xe214('0x12'))(_0xe214('0x13'));var utils=require(_0xe214('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe214('0x15'));var db=require(_0xe214('0x16'))['db'];function respondWithStatusCode(_0x53fc6e,_0x41c823){_0x41c823=_0x41c823||0xcc;return function(_0xef08f0){if(_0xef08f0){return _0x53fc6e[_0xe214('0x17')](_0x41c823);}return _0x53fc6e[_0xe214('0x18')](_0x41c823)[_0xe214('0x19')]();};}function respondWithResult(_0x4e840e,_0x28948e){_0x28948e=_0x28948e||0xc8;return function(_0x42223f){if(_0x42223f){return _0x4e840e[_0xe214('0x18')](_0x28948e)[_0xe214('0x1a')](_0x42223f);}};}function respondWithFilteredResult(_0x3949bb,_0x42c301){return function(_0x14c05d){if(_0x14c05d){var _0x379126=typeof _0x42c301[_0xe214('0x1b')]===_0xe214('0x1c')&&typeof _0x42c301[_0xe214('0x1d')]===_0xe214('0x1c');var _0x302639=_0x14c05d['count'];var _0x3c36df=_0x379126?0x0:_0x42c301[_0xe214('0x1b')];var _0x41e946=_0x379126?_0x14c05d[_0xe214('0x1e')]:_0x42c301[_0xe214('0x1b')]+_0x42c301[_0xe214('0x1d')];var _0x30a16c;if(_0x41e946>=_0x302639){_0x41e946=_0x302639;_0x30a16c=0xc8;}else{_0x30a16c=0xce;}_0x3949bb['status'](_0x30a16c);return _0x3949bb[_0xe214('0x1f')]('Content-Range',_0x3c36df+'-'+_0x41e946+'/'+_0x302639)['json'](_0x14c05d);}return null;};}function patchUpdates(_0x44ae2a){return function(_0x51a18c){try{jsonpatch['apply'](_0x51a18c,_0x44ae2a,!![]);}catch(_0x32e675){return BPromise[_0xe214('0x20')](_0x32e675);}return _0x51a18c[_0xe214('0x21')]();};}function saveUpdates(_0x4d3362,_0x357f72){return function(_0x13eb62){if(_0x13eb62){return _0x13eb62[_0xe214('0x22')](_0x4d3362)[_0xe214('0x23')](function(_0x375ab4){return _0x375ab4;});}return null;};}function removeEntity(_0xa55f98,_0x30db4b){return function(_0x4b13c0){if(_0x4b13c0){return _0x4b13c0['destroy']()['then'](function(){_0xa55f98[_0xe214('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x333f9d,_0x13aaea){return function(_0x589058){if(!_0x589058){_0x333f9d['sendStatus'](0x194);}return _0x589058;};}function handleError(_0x18b9f3,_0xf213ca){_0xf213ca=_0xf213ca||0x1f4;return function(_0x43a19f){logger['error'](_0x43a19f[_0xe214('0x24')]);if(_0x43a19f['name']){delete _0x43a19f['name'];}_0x18b9f3[_0xe214('0x18')](_0xf213ca)['send'](_0x43a19f);};}exports[_0xe214('0x22')]=function(_0x25ab69,_0x1ebed9){if(_0x25ab69[_0xe214('0x25')]['id']){delete _0x25ab69[_0xe214('0x25')]['id'];}return db[_0xe214('0x26')][_0xe214('0x27')]({'where':{'id':_0x25ab69[_0xe214('0x28')]['id']}})[_0xe214('0x23')](handleEntityNotFound(_0x1ebed9,null))[_0xe214('0x23')](saveUpdates(_0x25ab69[_0xe214('0x25')],null))['then'](respondWithResult(_0x1ebed9,null))[_0xe214('0x29')](handleError(_0x1ebed9,null));};exports['destroy']=function(_0x41c62e,_0xef313d){return db[_0xe214('0x26')]['find']({'where':{'id':_0x41c62e[_0xe214('0x28')]['id']}})[_0xe214('0x23')](handleEntityNotFound(_0xef313d,null))['then'](removeEntity(_0xef313d,null))['catch'](handleError(_0xef313d,null));};
\ No newline at end of file
+var _0x8545=['moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','body','Action','find','catch','params','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5f531a,_0x41ac7c){var _0x1da06f=function(_0x33eb39){while(--_0x33eb39){_0x5f531a['push'](_0x5f531a['shift']());}};_0x1da06f(++_0x41ac7c);}(_0x8545,0x86));var _0x5854=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x8545[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5854('0x0'));var zipdir=require(_0x5854('0x1'));var jsonpatch=require(_0x5854('0x2'));var rp=require(_0x5854('0x3'));var moment=require(_0x5854('0x4'));var BPromise=require(_0x5854('0x5'));var Mustache=require(_0x5854('0x6'));var util=require(_0x5854('0x7'));var path=require(_0x5854('0x8'));var sox=require(_0x5854('0x9'));var csv=require('to-csv');var ejs=require(_0x5854('0xa'));var fs=require('fs');var fs_extra=require(_0x5854('0xb'));var _=require(_0x5854('0xc'));var squel=require(_0x5854('0xd'));var crypto=require(_0x5854('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5854('0xf'));var toCsv=require(_0x5854('0x10'));var querystring=require(_0x5854('0x11'));var Papa=require(_0x5854('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5854('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5854('0x14'));var config=require(_0x5854('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5854('0x16'))['db'];function respondWithStatusCode(_0x374b54,_0x1b3aa7){_0x1b3aa7=_0x1b3aa7||0xcc;return function(_0x1f7ecd){if(_0x1f7ecd){return _0x374b54[_0x5854('0x17')](_0x1b3aa7);}return _0x374b54[_0x5854('0x18')](_0x1b3aa7)['end']();};}function respondWithResult(_0x3a15de,_0x32efe6){_0x32efe6=_0x32efe6||0xc8;return function(_0x31d5ea){if(_0x31d5ea){return _0x3a15de[_0x5854('0x18')](_0x32efe6)[_0x5854('0x19')](_0x31d5ea);}};}function respondWithFilteredResult(_0x52d215,_0x454031){return function(_0x266040){if(_0x266040){var _0x4afea0=typeof _0x454031[_0x5854('0x1a')]===_0x5854('0x1b')&&typeof _0x454031[_0x5854('0x1c')]===_0x5854('0x1b');var _0x8530b=_0x266040[_0x5854('0x1d')];var _0x30d928=_0x4afea0?0x0:_0x454031[_0x5854('0x1a')];var _0xc207bd=_0x4afea0?_0x266040[_0x5854('0x1d')]:_0x454031[_0x5854('0x1a')]+_0x454031[_0x5854('0x1c')];var _0x5bc253;if(_0xc207bd>=_0x8530b){_0xc207bd=_0x8530b;_0x5bc253=0xc8;}else{_0x5bc253=0xce;}_0x52d215[_0x5854('0x18')](_0x5bc253);return _0x52d215[_0x5854('0x1e')](_0x5854('0x1f'),_0x30d928+'-'+_0xc207bd+'/'+_0x8530b)['json'](_0x266040);}return null;};}function patchUpdates(_0x22f621){return function(_0x2a4435){try{jsonpatch[_0x5854('0x20')](_0x2a4435,_0x22f621,!![]);}catch(_0x44bbb5){return BPromise['reject'](_0x44bbb5);}return _0x2a4435[_0x5854('0x21')]();};}function saveUpdates(_0x5e07a0,_0x21e8d9){return function(_0x330d40){if(_0x330d40){return _0x330d40[_0x5854('0x22')](_0x5e07a0)['then'](function(_0x2b5920){return _0x2b5920;});}return null;};}function removeEntity(_0x51f379,_0x2e2bfc){return function(_0x5659b0){if(_0x5659b0){return _0x5659b0[_0x5854('0x23')]()[_0x5854('0x24')](function(){_0x51f379[_0x5854('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386405,_0x51134a){return function(_0xe02fec){if(!_0xe02fec){_0x386405[_0x5854('0x17')](0x194);}return _0xe02fec;};}function handleError(_0x804f32,_0xb08536){_0xb08536=_0xb08536||0x1f4;return function(_0x4683df){logger[_0x5854('0x25')](_0x4683df[_0x5854('0x26')]);if(_0x4683df[_0x5854('0x27')]){delete _0x4683df[_0x5854('0x27')];}_0x804f32['status'](_0xb08536)[_0x5854('0x28')](_0x4683df);};}exports[_0x5854('0x22')]=function(_0x31c85a,_0x442a95){if(_0x31c85a['body']['id']){delete _0x31c85a[_0x5854('0x29')]['id'];}return db[_0x5854('0x2a')][_0x5854('0x2b')]({'where':{'id':_0x31c85a['params']['id']}})[_0x5854('0x24')](handleEntityNotFound(_0x442a95,null))[_0x5854('0x24')](saveUpdates(_0x31c85a[_0x5854('0x29')],null))[_0x5854('0x24')](respondWithResult(_0x442a95,null))[_0x5854('0x2c')](handleError(_0x442a95,null));};exports[_0x5854('0x23')]=function(_0x1f38eb,_0x37deb2){return db[_0x5854('0x2a')]['find']({'where':{'id':_0x1f38eb[_0x5854('0x2d')]['id']}})[_0x5854('0x24')](handleEntityNotFound(_0x37deb2,null))[_0x5854('0x24')](removeEntity(_0x37deb2,null))[_0x5854('0x2c')](handleError(_0x37deb2,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 82d0269..908c5d2 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecda=['tools_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes','exports','define'];(function(_0x5f1e8e,_0x2774f2){var _0x517bc4=function(_0x4c92eb){while(--_0x4c92eb){_0x5f1e8e['push'](_0x5f1e8e['shift']());}};_0x517bc4(++_0x2774f2);}(_0xecda,0x175));var _0xaecd=function(_0x47ec13,_0x9b1429){_0x47ec13=_0x47ec13-0x0;var _0x3aed32=_0xecda[_0x47ec13];return _0x3aed32;};'use strict';var _=require(_0xaecd('0x0'));var util=require(_0xaecd('0x1'));var logger=require(_0xaecd('0x2'))(_0xaecd('0x3'));var moment=require('moment');var BPromise=require(_0xaecd('0x4'));var rp=require(_0xaecd('0x5'));var fs=require('fs');var path=require(_0xaecd('0x6'));var rimraf=require(_0xaecd('0x7'));var config=require('../../config/environment');var attributes=require(_0xaecd('0x8'));module[_0xaecd('0x9')]=function(_0x284d8c,_0xe61c53){return _0x284d8c[_0xaecd('0xa')]('Action',attributes,{'tableName':_0xaecd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc25d=['request-promise','rimraf','./action.attributes','define','Action','tools_actions','api','moment'];(function(_0x121434,_0x5b85ca){var _0x15acb2=function(_0x4854f8){while(--_0x4854f8){_0x121434['push'](_0x121434['shift']());}};_0x15acb2(++_0x5b85ca);}(_0xc25d,0x1ee));var _0xdc25=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xc25d[_0x7275e9];return _0x17b99d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdc25('0x0'));var moment=require(_0xdc25('0x1'));var BPromise=require('bluebird');var rp=require(_0xdc25('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc25('0x3'));var config=require('../../config/environment');var attributes=require(_0xdc25('0x4'));module['exports']=function(_0x3a2376,_0xb06b60){return _0x3a2376[_0xdc25('0x5')](_0xdc25('0x6'),attributes,{'tableName':_0xdc25('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index bfe31d5..33717f4 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x59d581,_0x4a6a97){var _0x47c61b=function(_0x12b3d8){while(--_0x12b3d8){_0x59d581['push'](_0x59d581['shift']());}};_0x47c61b(++_0x4a6a97);}(_0x1261,0x144));var _0x1126=function(_0x26a810,_0x247776){_0x26a810=_0x26a810-0x0;var _0x4758a3=_0x1261[_0x26a810];return _0x4758a3;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('Action,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4c1a85,_0x5c761d){var _0x51650a=function(_0x12c941){while(--_0x12c941){_0x4c1a85['push'](_0x4c1a85['shift']());}};_0x51650a(++_0x5c761d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x190d7b,_0x548785){_0x190d7b=_0x190d7b-0x0;var _0x33370b=_0x7fbe[_0x190d7b];return _0x33370b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index d822659..f819738 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9135=['isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id'];(function(_0x355f82,_0xf41ed){var _0x4c18a1=function(_0x405b12){while(--_0x405b12){_0x355f82['push'](_0x355f82['shift']());}};_0x4c18a1(++_0xf41ed);}(_0x9135,0xd5));var _0x5913=function(_0x345ad9,_0x28da02){_0x345ad9=_0x345ad9-0x0;var _0x5cb6a4=_0x9135[_0x345ad9];return _0x5cb6a4;};'use strict';var multer=require(_0x5913('0x0'));var util=require(_0x5913('0x1'));var path=require(_0x5913('0x2'));var timeout=require(_0x5913('0x3'));var express=require(_0x5913('0x4'));var router=express['Router']();var fs_extra=require(_0x5913('0x5'));var auth=require(_0x5913('0x6'));var interaction=require(_0x5913('0x7'));var config=require(_0x5913('0x8'));var controller=require(_0x5913('0x9'));router['put'](_0x5913('0xa'),auth[_0x5913('0xb')](),controller[_0x5913('0xc')]);router[_0x5913('0xd')](_0x5913('0xa'),auth[_0x5913('0xb')](),controller[_0x5913('0xe')]);module[_0x5913('0xf')]=router;
\ No newline at end of file
+var _0x3005=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','exports'];(function(_0x487177,_0x1ddcd6){var _0x147202=function(_0xa5105){while(--_0xa5105){_0x487177['push'](_0x487177['shift']());}};_0x147202(++_0x1ddcd6);}(_0x3005,0x170));var _0x5300=function(_0x29571e,_0x5a548e){_0x29571e=_0x29571e-0x0;var _0x395ab0=_0x3005[_0x29571e];return _0x395ab0;};'use strict';var multer=require(_0x5300('0x0'));var util=require(_0x5300('0x1'));var path=require(_0x5300('0x2'));var timeout=require(_0x5300('0x3'));var express=require(_0x5300('0x4'));var router=express[_0x5300('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5300('0x6'));var interaction=require(_0x5300('0x7'));var config=require(_0x5300('0x8'));var controller=require(_0x5300('0x9'));router[_0x5300('0xa')](_0x5300('0xb'),auth[_0x5300('0xc')](),controller['update']);router[_0x5300('0xd')](_0x5300('0xb'),auth[_0x5300('0xc')](),controller[_0x5300('0xe')]);module[_0x5300('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 1f3e982..bb39278 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2675=['sequelize','STRING','TEXT'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0x2675,0x75));var _0x5267=function(_0x2379d9,_0x146e8e){_0x2379d9=_0x2379d9-0x0;var _0x4413f8=_0x2675[_0x2379d9];return _0x4413f8;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
+var _0x6f47=['TEXT','exports','STRING'];(function(_0x31dcd5,_0x27ff54){var _0x5db7ea=function(_0xaa0541){while(--_0xaa0541){_0x31dcd5['push'](_0x31dcd5['shift']());}};_0x5db7ea(++_0x27ff54);}(_0x6f47,0xc7));var _0x76f4=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x6f47[_0x55abd9];return _0x3e5669;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 2b25302..f6528f7 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb53e=['IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','COUNT(%s)','IS\x20NOT\x20NULL','getFields','ValidationErrorItem','from','groupBy','order','alias','clone','web','fullPath','%s-%s.%s','randomstring','output','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','cross_join','HOUR(%s)','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','dbH','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','map','query','keys','intersection','attributes','fields','model','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL'];(function(_0x28ba95,_0x4381eb){var _0x10194b=function(_0x18f0e5){while(--_0x18f0e5){_0x28ba95['push'](_0x28ba95['shift']());}};_0x10194b(++_0x4381eb);}(_0xb53e,0xde));var _0xeb53=function(_0x38c35b,_0x277e1c){_0x38c35b=_0x38c35b-0x0;var _0x1a1907=_0xb53e[_0x38c35b];return _0x1a1907;};'use strict';var emlformat=require(_0xeb53('0x0'));var rimraf=require(_0xeb53('0x1'));var zipdir=require(_0xeb53('0x2'));var jsonpatch=require(_0xeb53('0x3'));var rp=require(_0xeb53('0x4'));var moment=require(_0xeb53('0x5'));var BPromise=require(_0xeb53('0x6'));var Mustache=require(_0xeb53('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xeb53('0x8'));var ejs=require(_0xeb53('0x9'));var fs=require('fs');var fs_extra=require(_0xeb53('0xa'));var _=require('lodash');var squel=require(_0xeb53('0xb'));var crypto=require(_0xeb53('0xc'));var jsforce=require(_0xeb53('0xd'));var deskjs=require(_0xeb53('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb53('0xf'));var Papa=require('papaparse');var Redis=require(_0xeb53('0x10'));var authService=require(_0xeb53('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeb53('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb53('0x13'))('api');var utils=require(_0xeb53('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xeb53('0x15')];function respondWithStatusCode(_0x54296b,_0x5945ba){_0x5945ba=_0x5945ba||0xcc;return function(_0x1ba745){if(_0x1ba745){return _0x54296b['sendStatus'](_0x5945ba);}return _0x54296b[_0xeb53('0x16')](_0x5945ba)['end']();};}function respondWithResult(_0x4a47a2,_0x1f232c){_0x1f232c=_0x1f232c||0xc8;return function(_0x17a73e){if(_0x17a73e){return _0x4a47a2[_0xeb53('0x16')](_0x1f232c)[_0xeb53('0x17')](_0x17a73e);}};}function respondWithFilteredResult(_0x5d3223,_0x36475a){return function(_0x5e1925){if(_0x5e1925){var _0x4eaf80=typeof _0x36475a[_0xeb53('0x18')]===_0xeb53('0x19')&&typeof _0x36475a['limit']===_0xeb53('0x19');var _0x4039b7=_0x5e1925[_0xeb53('0x1a')];var _0x1e57f7=_0x4eaf80?0x0:_0x36475a[_0xeb53('0x18')];var _0x2a8303=_0x4eaf80?_0x5e1925[_0xeb53('0x1a')]:_0x36475a['offset']+_0x36475a[_0xeb53('0x1b')];var _0x254c54;if(_0x2a8303>=_0x4039b7){_0x2a8303=_0x4039b7;_0x254c54=0xc8;}else{_0x254c54=0xce;}_0x5d3223[_0xeb53('0x16')](_0x254c54);return _0x5d3223['set'](_0xeb53('0x1c'),_0x1e57f7+'-'+_0x2a8303+'/'+_0x4039b7)[_0xeb53('0x17')](_0x5e1925);}return null;};}function patchUpdates(_0x1215e9){return function(_0x3bab5e){try{jsonpatch[_0xeb53('0x1d')](_0x3bab5e,_0x1215e9,!![]);}catch(_0x1dd8be){return BPromise['reject'](_0x1dd8be);}return _0x3bab5e[_0xeb53('0x1e')]();};}function saveUpdates(_0x3d106a,_0x15c287){return function(_0x8bd169){if(_0x8bd169){return _0x8bd169[_0xeb53('0x1f')](_0x3d106a)[_0xeb53('0x20')](function(_0x140ef0){return _0x140ef0;});}return null;};}function removeEntity(_0x58ef26,_0xfc10b1){return function(_0xcb6700){if(_0xcb6700){return _0xcb6700[_0xeb53('0x21')]()[_0xeb53('0x20')](function(){var _0x5b8ecd=_0xcb6700[_0xeb53('0x22')]({'plain':!![]});var _0x3cc015='CustomReports';return db[_0xeb53('0x23')][_0xeb53('0x21')]({'where':{'type':_0x3cc015,'resourceId':_0x5b8ecd['id']}})[_0xeb53('0x20')](function(){return _0xcb6700;});})[_0xeb53('0x20')](function(){_0x58ef26[_0xeb53('0x16')](0xcc)[_0xeb53('0x24')]();});}};}function handleEntityNotFound(_0x348049,_0x500e4a){return function(_0x241d3c){if(!_0x241d3c){_0x348049[_0xeb53('0x25')](0x194);}return _0x241d3c;};}function handleError(_0x4f9081,_0x5ce4f3){_0x5ce4f3=_0x5ce4f3||0x1f4;return function(_0x919a21){logger[_0xeb53('0x26')](_0x919a21['stack']);if(_0x919a21[_0xeb53('0x27')]){delete _0x919a21[_0xeb53('0x27')];}_0x4f9081['status'](_0x5ce4f3)[_0xeb53('0x28')](_0x919a21);};}exports[_0xeb53('0x29')]=function(_0x58cdc0,_0x11f25b){var _0x251593={},_0x1d8b66={},_0x4447ed={'count':0x0,'rows':[]};var _0x2fb53e=_['map'](db[_0xeb53('0x2a')][_0xeb53('0x2b')],function(_0x214281){return{'name':_0x214281[_0xeb53('0x2c')],'type':_0x214281[_0xeb53('0x2d')]['key']};});_0x1d8b66['model']=_[_0xeb53('0x2e')](_0x2fb53e,_0xeb53('0x27'));_0x1d8b66[_0xeb53('0x2f')]=_[_0xeb53('0x30')](_0x58cdc0[_0xeb53('0x2f')]);_0x1d8b66['filters']=_[_0xeb53('0x31')](_0x1d8b66['model'],_0x1d8b66['query']);_0x251593[_0xeb53('0x32')]=_[_0xeb53('0x31')](_0x1d8b66['model'],qs[_0xeb53('0x33')](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x33')]));_0x251593[_0xeb53('0x32')]=_0x251593[_0xeb53('0x32')]['length']?_0x251593[_0xeb53('0x32')]:_0x1d8b66[_0xeb53('0x34')];if(!_0x58cdc0[_0xeb53('0x2f')]['hasOwnProperty'](_0xeb53('0x35'))){_0x251593['limit']=qs['limit'](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x1b')]);_0x251593[_0xeb53('0x18')]=qs[_0xeb53('0x18')](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x18')]);}_0x251593['order']=qs[_0xeb53('0x36')](_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x36')]);_0x251593[_0xeb53('0x37')]=qs[_0xeb53('0x38')](_[_0xeb53('0x39')](_0x58cdc0[_0xeb53('0x2f')],_0x1d8b66[_0xeb53('0x38')]),_0x2fb53e);if(_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x3a')]){_0x251593[_0xeb53('0x37')]=_[_0xeb53('0x3b')](_0x251593[_0xeb53('0x37')],{'$or':_['map'](_0x2fb53e,function(_0xdad72e){if(_0xdad72e['type']!=='VIRTUAL'){var _0x5457d={};_0x5457d[_0xdad72e[_0xeb53('0x27')]]={'$like':'%'+_0x58cdc0['query']['filter']+'%'};return _0x5457d;}})});}_0x251593=_['merge']({},_0x251593,_0x58cdc0[_0xeb53('0x3c')]);var _0x43359f={'where':_0x251593[_0xeb53('0x37')]};return db[_0xeb53('0x2a')][_0xeb53('0x1a')](_0x43359f)[_0xeb53('0x20')](function(_0xe2be6e){_0x4447ed[_0xeb53('0x1a')]=_0xe2be6e;if(_0x58cdc0[_0xeb53('0x2f')][_0xeb53('0x3d')]){_0x251593['include']=[{'all':!![]}];}return db[_0xeb53('0x2a')][_0xeb53('0x3e')](_0x251593);})[_0xeb53('0x20')](function(_0x21e936){_0x4447ed['rows']=_0x21e936;return _0x4447ed;})[_0xeb53('0x20')](respondWithFilteredResult(_0x11f25b,_0x251593))[_0xeb53('0x3f')](handleError(_0x11f25b,null));};exports[_0xeb53('0x40')]=function(_0x1221e1,_0x1158ab){var _0x305769={'raw':![],'where':{'id':_0x1221e1['params']['id']}},_0x552dc6={};_0x552dc6[_0xeb53('0x34')]=_[_0xeb53('0x30')](db[_0xeb53('0x2a')][_0xeb53('0x2b')]);_0x552dc6[_0xeb53('0x2f')]=_['keys'](_0x1221e1[_0xeb53('0x2f')]);_0x552dc6[_0xeb53('0x38')]=_[_0xeb53('0x31')](_0x552dc6[_0xeb53('0x34')],_0x552dc6[_0xeb53('0x2f')]);_0x305769['attributes']=_['intersection'](_0x552dc6[_0xeb53('0x34')],qs['fields'](_0x1221e1[_0xeb53('0x2f')][_0xeb53('0x33')]));_0x305769[_0xeb53('0x32')]=_0x305769[_0xeb53('0x32')][_0xeb53('0x41')]?_0x305769[_0xeb53('0x32')]:_0x552dc6[_0xeb53('0x34')];if(_0x1221e1[_0xeb53('0x2f')][_0xeb53('0x3d')]){_0x305769['include']=[{'all':!![]}];}_0x305769=_[_0xeb53('0x3b')]({},_0x305769,_0x1221e1['options']);return db[_0xeb53('0x2a')][_0xeb53('0x42')](_0x305769)[_0xeb53('0x20')](handleEntityNotFound(_0x1158ab,null))['then'](respondWithResult(_0x1158ab,null))[_0xeb53('0x3f')](handleError(_0x1158ab,null));};exports[_0xeb53('0x43')]=function(_0x1554e4,_0x43a968){return db[_0xeb53('0x2a')][_0xeb53('0x43')](_0x1554e4[_0xeb53('0x44')],{})['then'](function(_0x563825){var _0x556588=_0x1554e4[_0xeb53('0x45')][_0xeb53('0x22')]({'plain':!![]});if(!_0x556588)throw new Error(_0xeb53('0x46'));if(_0x556588[_0xeb53('0x47')]===_0xeb53('0x45')){var _0x40609e=_0x563825['get']({'plain':!![]});var _0x27a97d='Reports';return db['UserProfileSection'][_0xeb53('0x42')]({'where':{'name':_0x27a97d,'userProfileId':_0x556588[_0xeb53('0x48')]},'raw':!![]})[_0xeb53('0x20')](function(_0xc4fbfa){if(_0xc4fbfa&&_0xc4fbfa[_0xeb53('0x49')]===0x0){return db[_0xeb53('0x23')][_0xeb53('0x43')]({'name':_0x40609e[_0xeb53('0x27')],'resourceId':_0x40609e['id'],'type':_0xeb53('0x4a'),'sectionId':_0xc4fbfa['id']},{})[_0xeb53('0x20')](function(){return _0x563825;});}else{return _0x563825;}})[_0xeb53('0x3f')](function(_0x44dbe1){logger[_0xeb53('0x26')](_0xeb53('0x4b'),_0x44dbe1);throw _0x44dbe1;});}return _0x563825;})[_0xeb53('0x20')](respondWithResult(_0x43a968,0xc9))[_0xeb53('0x3f')](handleError(_0x43a968,null));};exports[_0xeb53('0x1f')]=function(_0x5c8e62,_0x3a38c4){if(_0x5c8e62[_0xeb53('0x44')]['id']){delete _0x5c8e62[_0xeb53('0x44')]['id'];}return db['AnalyticCustomReport'][_0xeb53('0x42')]({'where':{'id':_0x5c8e62['params']['id']}})['then'](handleEntityNotFound(_0x3a38c4,null))['then'](saveUpdates(_0x5c8e62[_0xeb53('0x44')],null))[_0xeb53('0x20')](respondWithResult(_0x3a38c4,null))[_0xeb53('0x3f')](handleError(_0x3a38c4,null));};exports['destroy']=function(_0x14210f,_0x29649d){return db[_0xeb53('0x2a')][_0xeb53('0x42')]({'where':{'id':_0x14210f[_0xeb53('0x4c')]['id']}})[_0xeb53('0x20')](handleEntityNotFound(_0x29649d,null))[_0xeb53('0x20')](removeEntity(_0x29649d,null))[_0xeb53('0x3f')](handleError(_0x29649d,null));};exports[_0xeb53('0x4d')]=function(_0x3cfa06,_0x7d8821){var _0x15680b=0xa;var _0x2e212e=[_0xeb53('0x4e'),_0xeb53('0x4f'),_0xeb53('0x50'),'cross_join'];var _0x1032c1={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xeb53('0x51'),'MAX':_0xeb53('0x52'),'MIN':_0xeb53('0x53'),'AVG':_0xeb53('0x54'),'GROUP_CONCAT':_0xeb53('0x55'),'GROUP_CONCAT ASC':_0xeb53('0x56'),'GROUP_CONCAT DESC':_0xeb53('0x57')};var _0x10e542={'SEC_TO_TIME':_0xeb53('0x58'),'DATE':_0xeb53('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xeb53('0x5a'),'UNIX_TIMESTAMP':_0xeb53('0x5b')};var _0x381693=function(_0x549dfc){return!_[_0xeb53('0x5c')]([_0xeb53('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeb53('0x5e')],_0x549dfc);};var _0x35b2da=function(_0x29ee37){if(!_0x29ee37||!_0x29ee37[_0xeb53('0x5f')]['length']){return'';}for(var _0x470d70='(',_0x239129=0x0;_0x239129<_0x29ee37['rules']['length'];_0x239129+=0x1){_0x239129>0x0&&(_0x470d70+='\x20'+_0x29ee37['operator']+'\x20');_0x470d70+=_0x29ee37[_0xeb53('0x5f')][_0x239129][_0xeb53('0x60')]?_0x35b2da(_0x29ee37[_0xeb53('0x5f')][_0x239129][_0xeb53('0x60')]):_0x29ee37[_0xeb53('0x5f')][_0x239129]['field']+'\x20'+_0x29ee37[_0xeb53('0x5f')][_0x239129]['condition']+(_0x381693(_0x29ee37['rules'][_0x239129][_0xeb53('0x61')])?'\x20'+_0x29ee37[_0xeb53('0x5f')][_0x239129][_0xeb53('0x62')]:'');}return _0x470d70+')';};var _0x7595ff={'where':{'id':_0x3cfa06[_0xeb53('0x4c')]['id']}},_0x266a6a,_0x55c565,_0x157158,_0x20009f,_0x31223a;_0x7595ff=_[_0xeb53('0x3b')]({},_0x7595ff,_0x3cfa06[_0xeb53('0x3c')]);return db[_0xeb53('0x2a')][_0xeb53('0x42')](_0x7595ff)[_0xeb53('0x20')](function(_0x163121){if(_0x163121){_0x266a6a=_0x163121;return _0x163121['getFields']();}return null;})[_0xeb53('0x20')](function(_0x3270db){if(_0x3270db){if(!_0x3270db[_0xeb53('0x41')]){throw new db[(_0xeb53('0x63'))]['ValidationErrorItem'](_0xeb53('0x64'),0x193);}_0x55c565=_0x3270db;return db[_0xeb53('0x65')][_0xeb53('0x3e')]({'raw':!![]});}return null;})[_0xeb53('0x20')](function(_0x557631){if(_0x557631){_0x157158=_[_0xeb53('0x66')](_0x557631,'id');var _0x533be5;var _0x25b6dd=squel[_0xeb53('0x67')]();_0x25b6dd['from'](_0x266a6a[_0xeb53('0x68')]);for(var _0x11ed68=0x0;_0x11ed68<_0x55c565['length'];_0x11ed68+=0x1){_0x533be5=_0x55c565[_0x11ed68]['MetricId']?_0x157158[_0x55c565[_0x11ed68][_0xeb53('0x69')]][_0xeb53('0x6a')]:_0x55c565[_0x11ed68][_0xeb53('0x6b')];_0x533be5=_0x55c565[_0x11ed68][_0xeb53('0x6c')]?_['replace'](_0x1032c1[_0x55c565[_0x11ed68]['function']],'%s',_0x533be5):_0x533be5;_0x533be5=_0x55c565[_0x11ed68]['format']?_[_0xeb53('0x6d')](_0x10e542[_0x55c565[_0x11ed68][_0xeb53('0x6e')]],'%s',_0x533be5):_0x533be5;if(_0x55c565[_0x11ed68]['groupBy']){_0x25b6dd[_0xeb53('0x60')](_0x533be5);}_0x55c565[_0x11ed68][_0xeb53('0x6f')]&&_0x25b6dd['order'](_0x533be5,_0x55c565[_0x11ed68]['orderBy']===_0xeb53('0x70')?![]:!![]);_0x25b6dd[_0xeb53('0x6b')](_0x533be5,_0x55c565[_0x11ed68]['alias']||_0x533be5);}if(_0x266a6a[_0xeb53('0x71')]){_0x266a6a[_0xeb53('0x71')]=JSON[_0xeb53('0x72')](_0x266a6a[_0xeb53('0x71')]);for(var _0x39e335=0x0;_0x39e335<_0x266a6a[_0xeb53('0x71')]['length'];_0x39e335+=0x1){if(_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x2d')]&&_[_0xeb53('0x5c')](_0x2e212e,_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x2d')])&&_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x73')]&&_0x266a6a['joins'][_0x39e335][_0xeb53('0x74')]&&_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x75')]){_0x25b6dd[_0x266a6a['joins'][_0x39e335][_0xeb53('0x2d')]](_0x266a6a[_0xeb53('0x71')][_0x39e335][_0xeb53('0x74')],null,util[_0xeb53('0x6e')](_0xeb53('0x76'),_0x266a6a[_0xeb53('0x68')],_0x266a6a[_0xeb53('0x71')][_0x39e335]['parentKey'],_0x266a6a[_0xeb53('0x71')][_0x39e335]['foreignTable'],_0x266a6a['joins'][_0x39e335]['foreignKey']));}}}if(_0x266a6a['conditions']){_0x266a6a[_0xeb53('0x77')]=JSON[_0xeb53('0x72')](_0x266a6a[_0xeb53('0x77')]);_0x25b6dd[_0xeb53('0x37')](_0x35b2da(_0x266a6a[_0xeb53('0x77')]['group']));}_0x31223a=_0x25b6dd['clone']();_0x25b6dd['limit'](_0x15680b);_0x25b6dd[_0xeb53('0x18')](0x0);logger[_0xeb53('0x78')](_0xeb53('0x79'),_0x25b6dd[_0xeb53('0x7a')]());return dbH[_0xeb53('0x7b')][_0xeb53('0x2f')](_0x25b6dd[_0xeb53('0x7a')](),{'type':dbH[_0xeb53('0x7b')][_0xeb53('0x7c')]['SELECT']});}})[_0xeb53('0x20')](respondWithResult(_0x7d8821,null))[_0xeb53('0x3f')](handleError(_0x7d8821,null));};function runReport(_0x1be1c3,_0x15b480,_0x5706f7){var _0x3f0da3=_0x15b480[_0xeb53('0x27')];var _0x4e9355=0xa;var _0x14e9d3=[_0xeb53('0x4e'),'left_join',_0xeb53('0x50'),'cross_join'];var _0x3a4c5f={'SUM':_0xeb53('0x7d'),'COUNT':_0xeb53('0x7e'),'COUNT DISTINCT':_0xeb53('0x51'),'MAX':'MAX(%s)','MIN':_0xeb53('0x53'),'AVG':_0xeb53('0x54'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48ebce={'SEC_TO_TIME':_0xeb53('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xeb53('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28cfc3=function(_0x46c4d5){return!_[_0xeb53('0x5c')]([_0xeb53('0x5d'),_0xeb53('0x7f'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x46c4d5);};var _0x2b0c4c=function(_0x157c47){if(!_0x157c47||!_0x157c47[_0xeb53('0x5f')][_0xeb53('0x41')]){return'';}for(var _0x2617fb='(',_0x54fc76=0x0;_0x54fc76<_0x157c47[_0xeb53('0x5f')][_0xeb53('0x41')];_0x54fc76+=0x1){_0x54fc76>0x0&&(_0x2617fb+='\x20'+_0x157c47['operator']+'\x20');_0x2617fb+=_0x157c47['rules'][_0x54fc76][_0xeb53('0x60')]?_0x2b0c4c(_0x157c47[_0xeb53('0x5f')][_0x54fc76]['group']):_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x6b')]+'\x20'+_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x61')]+(_0x28cfc3(_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x61')])?'\x20'+_0x157c47[_0xeb53('0x5f')][_0x54fc76][_0xeb53('0x62')]:'');}return _0x2617fb+')';};var _0x6fc12f={'where':{'id':_0x1be1c3['id']}},_0x3ec279,_0x504ba6,_0xdfd11a,_0x29027f,_0x5bed3e;_0x6fc12f=_[_0xeb53('0x3b')]({},_0x6fc12f,_0x5706f7);return db['AnalyticCustomReport']['find'](_0x6fc12f)[_0xeb53('0x20')](function(_0x132542){if(_0x132542){_0x3ec279=_0x132542;return _0x132542[_0xeb53('0x80')]();}return null;})['then'](function(_0x4acc91){if(_0x4acc91){if(!_0x4acc91[_0xeb53('0x41')]){throw new db['Sequelize'][(_0xeb53('0x81'))](_0xeb53('0x64'),0x193);}_0x504ba6=_0x4acc91;return db[_0xeb53('0x65')][_0xeb53('0x3e')]({'raw':!![]});}return null;})[_0xeb53('0x20')](function(_0x515809){if(_0x515809){_0xdfd11a=_[_0xeb53('0x66')](_0x515809,'id');var _0x49a78c;var _0x52dbe9=squel['select']();_0x52dbe9[_0xeb53('0x82')](_0x3ec279[_0xeb53('0x68')]);for(var _0x113ff0=0x0;_0x113ff0<_0x504ba6['length'];_0x113ff0+=0x1){_0x49a78c=_0x504ba6[_0x113ff0]['MetricId']?_0xdfd11a[_0x504ba6[_0x113ff0]['MetricId']][_0xeb53('0x6a')]:_0x504ba6[_0x113ff0][_0xeb53('0x6b')];_0x49a78c=_0x504ba6[_0x113ff0]['function']?_[_0xeb53('0x6d')](_0x3a4c5f[_0x504ba6[_0x113ff0][_0xeb53('0x6c')]],'%s',_0x49a78c):_0x49a78c;_0x49a78c=_0x504ba6[_0x113ff0][_0xeb53('0x6e')]?_[_0xeb53('0x6d')](_0x48ebce[_0x504ba6[_0x113ff0][_0xeb53('0x6e')]],'%s',_0x49a78c):_0x49a78c;if(_0x504ba6[_0x113ff0][_0xeb53('0x83')]){_0x52dbe9[_0xeb53('0x60')](_0x49a78c);}_0x504ba6[_0x113ff0][_0xeb53('0x6f')]&&_0x52dbe9[_0xeb53('0x84')](_0x49a78c,_0x504ba6[_0x113ff0][_0xeb53('0x6f')]===_0xeb53('0x70')?![]:!![]);_0x52dbe9[_0xeb53('0x6b')](_0x49a78c,_0x504ba6[_0x113ff0][_0xeb53('0x85')]||_0x49a78c);}if(_0x3ec279['joins']){_0x3ec279[_0xeb53('0x71')]=JSON[_0xeb53('0x72')](_0x3ec279[_0xeb53('0x71')]);for(var _0x1cedfd=0x0;_0x1cedfd<_0x3ec279['joins']['length'];_0x1cedfd+=0x1){if(_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x2d')]&&_[_0xeb53('0x5c')](_0x14e9d3,_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x2d')])&&_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x73')]&&_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x74')]&&_0x3ec279[_0xeb53('0x71')][_0x1cedfd]['foreignKey']){_0x52dbe9[_0x3ec279['joins'][_0x1cedfd]['type']](_0x3ec279['joins'][_0x1cedfd][_0xeb53('0x74')],null,util[_0xeb53('0x6e')](_0xeb53('0x76'),_0x3ec279[_0xeb53('0x68')],_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x73')],_0x3ec279[_0xeb53('0x71')][_0x1cedfd][_0xeb53('0x74')],_0x3ec279['joins'][_0x1cedfd]['foreignKey']));}}}if(_0x3ec279['conditions']){_0x3ec279[_0xeb53('0x77')]=JSON['parse'](_0x3ec279[_0xeb53('0x77')]);_0x52dbe9[_0xeb53('0x37')](_0x2b0c4c(_0x3ec279[_0xeb53('0x77')]['group']));}_0x5bed3e=_0x52dbe9[_0xeb53('0x86')]();_0x52dbe9[_0xeb53('0x1b')](_0x4e9355);_0x52dbe9[_0xeb53('0x18')](0x0);return;}})['then'](function(){if(_0x15b480['output']===_0xeb53('0x87')){return null;}var _0x5e4257=_['merge'](_0x15b480,{'name':_0x15b480[_0xeb53('0x88')]||_0x15b480[_0xeb53('0x27')]||_0x3ec279[_0xeb53('0x27')],'basename':_0x3f0da3,'savename':util[_0xeb53('0x6e')](_0xeb53('0x89'),_0x15b480[_0xeb53('0x27')]||_0x3ec279['name'],require(_0xeb53('0x8a'))['generate'](0x4),_0x15b480[_0xeb53('0x8b')]||'csv'),'reportId':_0x3ec279['id'],'reportType':_0xeb53('0x8c')});return db[_0xeb53('0x8d')][_0xeb53('0x43')](_0x5e4257,{'raw':!![]});})[_0xeb53('0x20')](function(_0x5bb617){if(_0x3ec279[_0xeb53('0x68')]==='cdr'){_0x5bed3e['where'](_0x3ec279[_0xeb53('0x68')]+_0xeb53('0x8e'),_0x15b480['startDate'],_0x15b480[_0xeb53('0x8f')]);}else{_0x5bed3e['where'](_0x3ec279[_0xeb53('0x68')]+_0xeb53('0x90'),_0x15b480[_0xeb53('0x91')],_0x15b480[_0xeb53('0x8f')]);}if(_0x5bb617){logger['info']('Run\x20Query:',_0x5bed3e[_0xeb53('0x7a')]());require(_0xeb53('0x92'))[_0xeb53('0x93')](path[_0xeb53('0x4e')](__dirname,_0xeb53('0x94'),_0x5bb617[_0xeb53('0x8b')]),[_0x5bb617['id'],_0x5bed3e[_0xeb53('0x7a')](),path['join'](__dirname,_0xeb53('0x95'),_0x5bb617[_0xeb53('0x96')]),_0x3f0da3]);return _0x5bb617;}else{var _0x26ce09=squel[_0xeb53('0x67')]();_0x26ce09[_0xeb53('0x82')]('('+_0x5bed3e[_0xeb53('0x7a')]()+')',_0xeb53('0x97'));_0x26ce09[_0xeb53('0x6b')](_0xeb53('0x98'),_0xeb53('0x1a'));_0x5bed3e[_0xeb53('0x1b')](_0x15b480[_0xeb53('0x1b')]||_0x4e9355);_0x5bed3e[_0xeb53('0x18')](_0x15b480[_0xeb53('0x18')]||0x0);return dbH[_0xeb53('0x7b')][_0xeb53('0x2f')](_0x26ce09['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeb53('0x99')]})['then'](function(_0x12e50){if(!_0x12e50['length']){_0x29027f=0x0;}else{_0x29027f=_0x12e50[0x0][_0xeb53('0x1a')]||0x0;}return dbH[_0xeb53('0x7b')]['query'](_0x5bed3e[_0xeb53('0x7a')](),{'type':dbH[_0xeb53('0x7b')][_0xeb53('0x7c')][_0xeb53('0x99')]});})[_0xeb53('0x20')](function(_0x1e5db1){return{'rows':_0x1e5db1||[],'count':_0x29027f};});}});}exports[_0xeb53('0x9a')]=function(_0x361a06,_0x2a9cb3){return runReport(_0x361a06['params'],_0x361a06[_0xeb53('0x2f')],_0x361a06[_0xeb53('0x3c')])[_0xeb53('0x20')](respondWithResult(_0x2a9cb3,null))[_0xeb53('0x3f')](handleError(_0x2a9cb3,null));};exports['runReport']=runReport;exports['query']=function(_0xc66d30,_0x923fa5){var _0x137952=0xa;var _0x1931eb=[_0xeb53('0x4e'),_0xeb53('0x4f'),'right_join',_0xeb53('0x9b')];var _0x30810d={'SUM':_0xeb53('0x7d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xeb53('0x52'),'MIN':_0xeb53('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xeb53('0x55'),'GROUP_CONCAT ASC':_0xeb53('0x56'),'GROUP_CONCAT DESC':_0xeb53('0x57')};var _0x34b3e8={'SEC_TO_TIME':_0xeb53('0x58'),'DATE':_0xeb53('0x59'),'HOUR':_0xeb53('0x9c'),'ROUND':_0xeb53('0x5a'),'UNIX_TIMESTAMP':_0xeb53('0x5b')};var _0x2d3c8c=function(_0x65ffdc){return!_[_0xeb53('0x5c')]([_0xeb53('0x5d'),_0xeb53('0x7f'),_0xeb53('0x9d'),_0xeb53('0x5e')],_0x65ffdc);};var _0x3705ff=function(_0x4372f3){if(!_0x4372f3||!_0x4372f3[_0xeb53('0x5f')][_0xeb53('0x41')]){return'';}for(var _0x407926='(',_0x5f965f=0x0;_0x5f965f<_0x4372f3[_0xeb53('0x5f')][_0xeb53('0x41')];_0x5f965f+=0x1){_0x5f965f>0x0&&(_0x407926+='\x20'+_0x4372f3['operator']+'\x20');_0x407926+=_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x60')]?_0x3705ff(_0x4372f3['rules'][_0x5f965f]['group']):_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x6b')]+'\x20'+_0x4372f3[_0xeb53('0x5f')][_0x5f965f]['condition']+(_0x2d3c8c(_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x61')])?'\x20'+_0x4372f3[_0xeb53('0x5f')][_0x5f965f][_0xeb53('0x62')]:'');}return _0x407926+')';};var _0x5bb542={'where':{'id':_0xc66d30['params']['id']}},_0x4edc46,_0x346d68,_0x524223,_0x10afe8,_0x5c6281;_0x5bb542=_[_0xeb53('0x3b')]({},_0x5bb542,_0xc66d30[_0xeb53('0x3c')]);return db[_0xeb53('0x2a')][_0xeb53('0x42')](_0x5bb542)[_0xeb53('0x20')](function(_0x54732c){if(_0x54732c){_0x4edc46=_0x54732c;return _0x54732c['getFields']();}return null;})[_0xeb53('0x20')](function(_0x2e437d){if(_0x2e437d){if(!_0x2e437d[_0xeb53('0x41')]){throw new db[(_0xeb53('0x63'))]['ValidationErrorItem'](_0xeb53('0x64'),0x193);}_0x346d68=_0x2e437d;return db[_0xeb53('0x65')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xaf0a4f){if(_0xaf0a4f){_0x524223=_[_0xeb53('0x66')](_0xaf0a4f,'id');var _0x1a6f6f;var _0x8b7eed=squel['select']();_0x8b7eed[_0xeb53('0x82')](_0x4edc46['table']);for(var _0x2b3cb8=0x0;_0x2b3cb8<_0x346d68[_0xeb53('0x41')];_0x2b3cb8+=0x1){_0x1a6f6f=_0x346d68[_0x2b3cb8][_0xeb53('0x69')]?_0x524223[_0x346d68[_0x2b3cb8][_0xeb53('0x69')]][_0xeb53('0x6a')]:_0x346d68[_0x2b3cb8]['field'];_0x1a6f6f=_0x346d68[_0x2b3cb8][_0xeb53('0x6c')]?_['replace'](_0x30810d[_0x346d68[_0x2b3cb8][_0xeb53('0x6c')]],'%s',_0x1a6f6f):_0x1a6f6f;_0x1a6f6f=_0x346d68[_0x2b3cb8]['format']?_[_0xeb53('0x6d')](_0x34b3e8[_0x346d68[_0x2b3cb8]['format']],'%s',_0x1a6f6f):_0x1a6f6f;if(_0x346d68[_0x2b3cb8]['groupBy']){_0x8b7eed[_0xeb53('0x60')](_0x1a6f6f);}_0x346d68[_0x2b3cb8][_0xeb53('0x6f')]&&_0x8b7eed[_0xeb53('0x84')](_0x1a6f6f,_0x346d68[_0x2b3cb8][_0xeb53('0x6f')]===_0xeb53('0x70')?![]:!![]);_0x8b7eed['field'](_0x1a6f6f,_0x346d68[_0x2b3cb8][_0xeb53('0x85')]||_0x1a6f6f);}if(_0x4edc46[_0xeb53('0x71')]){_0x4edc46['joins']=JSON['parse'](_0x4edc46[_0xeb53('0x71')]);for(var _0xb83f1=0x0;_0xb83f1<_0x4edc46[_0xeb53('0x71')][_0xeb53('0x41')];_0xb83f1+=0x1){if(_0x4edc46['joins'][_0xb83f1][_0xeb53('0x2d')]&&_['includes'](_0x1931eb,_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x2d')])&&_0x4edc46['joins'][_0xb83f1][_0xeb53('0x73')]&&_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x74')]&&_0x4edc46['joins'][_0xb83f1][_0xeb53('0x75')]){_0x8b7eed[_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x2d')]](_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x74')],null,util[_0xeb53('0x6e')](_0xeb53('0x76'),_0x4edc46[_0xeb53('0x68')],_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x73')],_0x4edc46[_0xeb53('0x71')][_0xb83f1][_0xeb53('0x74')],_0x4edc46[_0xeb53('0x71')][_0xb83f1]['foreignKey']));}}}if(_0x4edc46['conditions']){_0x4edc46[_0xeb53('0x77')]=JSON[_0xeb53('0x72')](_0x4edc46[_0xeb53('0x77')]);_0x8b7eed[_0xeb53('0x37')](_0x3705ff(_0x4edc46['conditions'][_0xeb53('0x60')]));}_0x5c6281=_0x8b7eed[_0xeb53('0x86')]();_0x8b7eed[_0xeb53('0x1b')](_0x137952);_0x8b7eed['offset'](0x0);logger['debug'](_0xeb53('0x79'),_0x8b7eed['toString']());return dbH[_0xeb53('0x7b')][_0xeb53('0x2f')](_0x8b7eed['toString'](),{'type':dbH['sequelize'][_0xeb53('0x7c')][_0xeb53('0x99')]});}})[_0xeb53('0x20')](function(){return{'sql':_0x5c6281['toString']()};})[_0xeb53('0x20')](respondWithResult(_0x923fa5,null))[_0xeb53('0x3f')](handleError(_0x923fa5,null));};
\ No newline at end of file
+var _0x6e84=['%s-%s.%s','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','savename','COUNT(*)','sequelize','runReport','metric','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','intersection','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','catch','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','IS\x20NULL','value','DESC','web','fullPath'];(function(_0x4a4aef,_0x57a949){var _0x3a7b5f=function(_0x345ca1){while(--_0x345ca1){_0x4a4aef['push'](_0x4a4aef['shift']());}};_0x3a7b5f(++_0x57a949);}(_0x6e84,0x159));var _0x46e8=function(_0x5d7c98,_0x2a7d74){_0x5d7c98=_0x5d7c98-0x0;var _0x35b62e=_0x6e84[_0x5d7c98];return _0x35b62e;};'use strict';var emlformat=require(_0x46e8('0x0'));var rimraf=require(_0x46e8('0x1'));var zipdir=require(_0x46e8('0x2'));var jsonpatch=require(_0x46e8('0x3'));var rp=require(_0x46e8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x46e8('0x5'));var path=require(_0x46e8('0x6'));var sox=require('sox');var csv=require(_0x46e8('0x7'));var ejs=require(_0x46e8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46e8('0x9'));var squel=require(_0x46e8('0xa'));var crypto=require(_0x46e8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x46e8('0x7'));var querystring=require(_0x46e8('0xc'));var Papa=require(_0x46e8('0xd'));var Redis=require(_0x46e8('0xe'));var authService=require(_0x46e8('0xf'));var qs=require(_0x46e8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x46e8('0x11'));var logger=require('../../config/logger')(_0x46e8('0x12'));var utils=require('../../config/utils');var config=require(_0x46e8('0x13'));var licenseUtil=require(_0x46e8('0x14'));var db=require(_0x46e8('0x15'))['db'];var dbH=require(_0x46e8('0x15'))[_0x46e8('0x16')];function respondWithStatusCode(_0x20bbd8,_0x335d1b){_0x335d1b=_0x335d1b||0xcc;return function(_0x4d8b5a){if(_0x4d8b5a){return _0x20bbd8[_0x46e8('0x17')](_0x335d1b);}return _0x20bbd8[_0x46e8('0x18')](_0x335d1b)[_0x46e8('0x19')]();};}function respondWithResult(_0xf22b16,_0x236ab9){_0x236ab9=_0x236ab9||0xc8;return function(_0x2c85c9){if(_0x2c85c9){return _0xf22b16['status'](_0x236ab9)[_0x46e8('0x1a')](_0x2c85c9);}};}function respondWithFilteredResult(_0x293d7a,_0x3a05e9){return function(_0x8d146b){if(_0x8d146b){var _0xa3b93e=typeof _0x3a05e9[_0x46e8('0x1b')]===_0x46e8('0x1c')&&typeof _0x3a05e9['limit']==='undefined';var _0xe25d8a=_0x8d146b[_0x46e8('0x1d')];var _0x45ff4b=_0xa3b93e?0x0:_0x3a05e9['offset'];var _0x1bc322=_0xa3b93e?_0x8d146b[_0x46e8('0x1d')]:_0x3a05e9[_0x46e8('0x1b')]+_0x3a05e9['limit'];var _0x451369;if(_0x1bc322>=_0xe25d8a){_0x1bc322=_0xe25d8a;_0x451369=0xc8;}else{_0x451369=0xce;}_0x293d7a[_0x46e8('0x18')](_0x451369);return _0x293d7a[_0x46e8('0x1e')]('Content-Range',_0x45ff4b+'-'+_0x1bc322+'/'+_0xe25d8a)[_0x46e8('0x1a')](_0x8d146b);}return null;};}function patchUpdates(_0x5198c1){return function(_0x5353f5){try{jsonpatch[_0x46e8('0x1f')](_0x5353f5,_0x5198c1,!![]);}catch(_0x4d016b){return BPromise['reject'](_0x4d016b);}return _0x5353f5[_0x46e8('0x20')]();};}function saveUpdates(_0x5cf4ca,_0x311182){return function(_0x196440){if(_0x196440){return _0x196440[_0x46e8('0x21')](_0x5cf4ca)[_0x46e8('0x22')](function(_0x1de868){return _0x1de868;});}return null;};}function removeEntity(_0x201b43,_0x287456){return function(_0x1ba1e2){if(_0x1ba1e2){return _0x1ba1e2[_0x46e8('0x23')]()[_0x46e8('0x22')](function(){var _0x3870c8=_0x1ba1e2[_0x46e8('0x24')]({'plain':!![]});var _0x2d6ec9=_0x46e8('0x25');return db[_0x46e8('0x26')][_0x46e8('0x23')]({'where':{'type':_0x2d6ec9,'resourceId':_0x3870c8['id']}})[_0x46e8('0x22')](function(){return _0x1ba1e2;});})[_0x46e8('0x22')](function(){_0x201b43[_0x46e8('0x18')](0xcc)[_0x46e8('0x19')]();});}};}function handleEntityNotFound(_0x3218b1,_0x40971a){return function(_0x8430b4){if(!_0x8430b4){_0x3218b1[_0x46e8('0x17')](0x194);}return _0x8430b4;};}function handleError(_0x4786db,_0x564ad2){_0x564ad2=_0x564ad2||0x1f4;return function(_0x390f2b){logger[_0x46e8('0x27')](_0x390f2b[_0x46e8('0x28')]);if(_0x390f2b['name']){delete _0x390f2b[_0x46e8('0x29')];}_0x4786db['status'](_0x564ad2)[_0x46e8('0x2a')](_0x390f2b);};}exports[_0x46e8('0x2b')]=function(_0x383ba2,_0x586a43){var _0x367c21={},_0x2629d5={},_0x180800={'count':0x0,'rows':[]};var _0x48a1be=_[_0x46e8('0x2c')](db[_0x46e8('0x2d')][_0x46e8('0x2e')],function(_0x6e71d9){return{'name':_0x6e71d9[_0x46e8('0x2f')],'type':_0x6e71d9[_0x46e8('0x30')][_0x46e8('0x31')]};});_0x2629d5[_0x46e8('0x32')]=_[_0x46e8('0x2c')](_0x48a1be,'name');_0x2629d5[_0x46e8('0x33')]=_[_0x46e8('0x34')](_0x383ba2['query']);_0x2629d5[_0x46e8('0x35')]=_['intersection'](_0x2629d5[_0x46e8('0x32')],_0x2629d5[_0x46e8('0x33')]);_0x367c21[_0x46e8('0x36')]=_['intersection'](_0x2629d5['model'],qs[_0x46e8('0x37')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x37')]));_0x367c21['attributes']=_0x367c21[_0x46e8('0x36')][_0x46e8('0x38')]?_0x367c21[_0x46e8('0x36')]:_0x2629d5[_0x46e8('0x32')];if(!_0x383ba2[_0x46e8('0x33')]['hasOwnProperty'](_0x46e8('0x39'))){_0x367c21['limit']=qs[_0x46e8('0x3a')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3a')]);_0x367c21[_0x46e8('0x1b')]=qs[_0x46e8('0x1b')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x1b')]);}_0x367c21[_0x46e8('0x3b')]=qs[_0x46e8('0x3c')](_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3c')]);_0x367c21[_0x46e8('0x3d')]=qs['filters'](_[_0x46e8('0x3e')](_0x383ba2[_0x46e8('0x33')],_0x2629d5[_0x46e8('0x35')]),_0x48a1be);if(_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3f')]){_0x367c21['where']=_[_0x46e8('0x40')](_0x367c21[_0x46e8('0x3d')],{'$or':_[_0x46e8('0x2c')](_0x48a1be,function(_0x4785ea){if(_0x4785ea['type']!=='VIRTUAL'){var _0x2845d7={};_0x2845d7[_0x4785ea[_0x46e8('0x29')]]={'$like':'%'+_0x383ba2[_0x46e8('0x33')][_0x46e8('0x3f')]+'%'};return _0x2845d7;}})});}_0x367c21=_[_0x46e8('0x40')]({},_0x367c21,_0x383ba2[_0x46e8('0x41')]);var _0x2dafe8={'where':_0x367c21[_0x46e8('0x3d')]};return db[_0x46e8('0x2d')][_0x46e8('0x1d')](_0x2dafe8)[_0x46e8('0x22')](function(_0x2f77d6){_0x180800[_0x46e8('0x1d')]=_0x2f77d6;if(_0x383ba2[_0x46e8('0x33')][_0x46e8('0x42')]){_0x367c21[_0x46e8('0x43')]=[{'all':!![]}];}return db[_0x46e8('0x2d')][_0x46e8('0x44')](_0x367c21);})[_0x46e8('0x22')](function(_0x5ef47f){_0x180800['rows']=_0x5ef47f;return _0x180800;})[_0x46e8('0x22')](respondWithFilteredResult(_0x586a43,_0x367c21))['catch'](handleError(_0x586a43,null));};exports[_0x46e8('0x45')]=function(_0xfaa9a5,_0x415d45){var _0x1ee532={'raw':![],'where':{'id':_0xfaa9a5['params']['id']}},_0x9c8ed9={};_0x9c8ed9[_0x46e8('0x32')]=_[_0x46e8('0x34')](db[_0x46e8('0x2d')][_0x46e8('0x2e')]);_0x9c8ed9['query']=_[_0x46e8('0x34')](_0xfaa9a5['query']);_0x9c8ed9[_0x46e8('0x35')]=_['intersection'](_0x9c8ed9['model'],_0x9c8ed9[_0x46e8('0x33')]);_0x1ee532[_0x46e8('0x36')]=_[_0x46e8('0x46')](_0x9c8ed9[_0x46e8('0x32')],qs[_0x46e8('0x37')](_0xfaa9a5[_0x46e8('0x33')][_0x46e8('0x37')]));_0x1ee532[_0x46e8('0x36')]=_0x1ee532['attributes'][_0x46e8('0x38')]?_0x1ee532['attributes']:_0x9c8ed9[_0x46e8('0x32')];if(_0xfaa9a5['query'][_0x46e8('0x42')]){_0x1ee532[_0x46e8('0x43')]=[{'all':!![]}];}_0x1ee532=_[_0x46e8('0x40')]({},_0x1ee532,_0xfaa9a5[_0x46e8('0x41')]);return db['AnalyticCustomReport']['find'](_0x1ee532)[_0x46e8('0x22')](handleEntityNotFound(_0x415d45,null))[_0x46e8('0x22')](respondWithResult(_0x415d45,null))['catch'](handleError(_0x415d45,null));};exports[_0x46e8('0x47')]=function(_0x5ed6d9,_0x477fc8){return db[_0x46e8('0x2d')][_0x46e8('0x47')](_0x5ed6d9[_0x46e8('0x48')],{})[_0x46e8('0x22')](function(_0x17f4fb){var _0x20af85=_0x5ed6d9['user'][_0x46e8('0x24')]({'plain':!![]});if(!_0x20af85)throw new Error(_0x46e8('0x49'));if(_0x20af85[_0x46e8('0x4a')]===_0x46e8('0x4b')){var _0x2b8719=_0x17f4fb[_0x46e8('0x24')]({'plain':!![]});var _0x2305e4='Reports';return db[_0x46e8('0x4c')][_0x46e8('0x4d')]({'where':{'name':_0x2305e4,'userProfileId':_0x20af85[_0x46e8('0x4e')]},'raw':!![]})['then'](function(_0x41102d){if(_0x41102d&&_0x41102d[_0x46e8('0x4f')]===0x0){return db[_0x46e8('0x26')][_0x46e8('0x47')]({'name':_0x2b8719[_0x46e8('0x29')],'resourceId':_0x2b8719['id'],'type':_0x46e8('0x25'),'sectionId':_0x41102d['id']},{})[_0x46e8('0x22')](function(){return _0x17f4fb;});}else{return _0x17f4fb;}})['catch'](function(_0x26fbaf){logger[_0x46e8('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26fbaf);throw _0x26fbaf;});}return _0x17f4fb;})[_0x46e8('0x22')](respondWithResult(_0x477fc8,0xc9))[_0x46e8('0x50')](handleError(_0x477fc8,null));};exports['update']=function(_0x55b675,_0x154150){if(_0x55b675[_0x46e8('0x48')]['id']){delete _0x55b675['body']['id'];}return db[_0x46e8('0x2d')][_0x46e8('0x4d')]({'where':{'id':_0x55b675[_0x46e8('0x51')]['id']}})['then'](handleEntityNotFound(_0x154150,null))['then'](saveUpdates(_0x55b675['body'],null))[_0x46e8('0x22')](respondWithResult(_0x154150,null))[_0x46e8('0x50')](handleError(_0x154150,null));};exports['destroy']=function(_0x888360,_0x18fc0d){return db[_0x46e8('0x2d')]['find']({'where':{'id':_0x888360[_0x46e8('0x51')]['id']}})[_0x46e8('0x22')](handleEntityNotFound(_0x18fc0d,null))['then'](removeEntity(_0x18fc0d,null))[_0x46e8('0x50')](handleError(_0x18fc0d,null));};exports[_0x46e8('0x52')]=function(_0x1669c8,_0x5cddac){var _0x288d6e=0xa;var _0x5495ee=['join',_0x46e8('0x53'),_0x46e8('0x54'),_0x46e8('0x55')];var _0x292973={'SUM':_0x46e8('0x56'),'COUNT':_0x46e8('0x57'),'COUNT DISTINCT':_0x46e8('0x58'),'MAX':_0x46e8('0x59'),'MIN':_0x46e8('0x5a'),'AVG':_0x46e8('0x5b'),'GROUP_CONCAT':_0x46e8('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x46e8('0x5d')};var _0x2c7721={'SEC_TO_TIME':_0x46e8('0x5e'),'DATE':'DATE(%s)','HOUR':_0x46e8('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x46e8('0x60')};var _0x6bdd00=function(_0x15430a){return!_[_0x46e8('0x61')](['IS\x20NULL',_0x46e8('0x62'),_0x46e8('0x63'),_0x46e8('0x64')],_0x15430a);};var _0x504bc4=function(_0x1ca0d7){if(!_0x1ca0d7||!_0x1ca0d7[_0x46e8('0x65')][_0x46e8('0x38')]){return'';}for(var _0x57fc9b='(',_0x2ce9ef=0x0;_0x2ce9ef<_0x1ca0d7[_0x46e8('0x65')][_0x46e8('0x38')];_0x2ce9ef+=0x1){_0x2ce9ef>0x0&&(_0x57fc9b+='\x20'+_0x1ca0d7[_0x46e8('0x66')]+'\x20');_0x57fc9b+=_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x67')]?_0x504bc4(_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x67')]):_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x68')]+'\x20'+_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef]['condition']+(_0x6bdd00(_0x1ca0d7[_0x46e8('0x65')][_0x2ce9ef][_0x46e8('0x69')])?'\x20'+_0x1ca0d7['rules'][_0x2ce9ef]['value']:'');}return _0x57fc9b+')';};var _0x1fddeb={'where':{'id':_0x1669c8[_0x46e8('0x51')]['id']}},_0x3901aa,_0x26d87c,_0x4864c3,_0x2f7040,_0x24d9f3;_0x1fddeb=_[_0x46e8('0x40')]({},_0x1fddeb,_0x1669c8[_0x46e8('0x41')]);return db[_0x46e8('0x2d')][_0x46e8('0x4d')](_0x1fddeb)[_0x46e8('0x22')](function(_0x304b32){if(_0x304b32){_0x3901aa=_0x304b32;return _0x304b32[_0x46e8('0x6a')]();}return null;})[_0x46e8('0x22')](function(_0x8d4361){if(_0x8d4361){if(!_0x8d4361['length']){throw new db[(_0x46e8('0x6b'))][(_0x46e8('0x6c'))](_0x46e8('0x6d'),0x193);}_0x26d87c=_0x8d4361;return db[_0x46e8('0x6e')][_0x46e8('0x44')]({'raw':!![]});}return null;})['then'](function(_0x470ff6){if(_0x470ff6){_0x4864c3=_[_0x46e8('0x6f')](_0x470ff6,'id');var _0x56f2d8;var _0x396f09=squel[_0x46e8('0x70')]();_0x396f09[_0x46e8('0x71')](_0x3901aa[_0x46e8('0x72')]);for(var _0x1b1674=0x0;_0x1b1674<_0x26d87c['length'];_0x1b1674+=0x1){_0x56f2d8=_0x26d87c[_0x1b1674][_0x46e8('0x73')]?_0x4864c3[_0x26d87c[_0x1b1674][_0x46e8('0x73')]]['metric']:_0x26d87c[_0x1b1674][_0x46e8('0x68')];_0x56f2d8=_0x26d87c[_0x1b1674][_0x46e8('0x74')]?_[_0x46e8('0x75')](_0x292973[_0x26d87c[_0x1b1674]['function']],'%s',_0x56f2d8):_0x56f2d8;_0x56f2d8=_0x26d87c[_0x1b1674][_0x46e8('0x76')]?_['replace'](_0x2c7721[_0x26d87c[_0x1b1674]['format']],'%s',_0x56f2d8):_0x56f2d8;if(_0x26d87c[_0x1b1674][_0x46e8('0x77')]){_0x396f09['group'](_0x56f2d8);}_0x26d87c[_0x1b1674][_0x46e8('0x78')]&&_0x396f09['order'](_0x56f2d8,_0x26d87c[_0x1b1674][_0x46e8('0x78')]==='DESC'?![]:!![]);_0x396f09['field'](_0x56f2d8,_0x26d87c[_0x1b1674][_0x46e8('0x79')]||_0x56f2d8);}if(_0x3901aa[_0x46e8('0x7a')]){_0x3901aa['joins']=JSON['parse'](_0x3901aa[_0x46e8('0x7a')]);for(var _0x19da93=0x0;_0x19da93<_0x3901aa[_0x46e8('0x7a')][_0x46e8('0x38')];_0x19da93+=0x1){if(_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x30')]&&_[_0x46e8('0x61')](_0x5495ee,_0x3901aa['joins'][_0x19da93][_0x46e8('0x30')])&&_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7b')]&&_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7c')]&&_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7d')]){_0x396f09[_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x30')]](_0x3901aa[_0x46e8('0x7a')][_0x19da93]['foreignTable'],null,util['format'](_0x46e8('0x7e'),_0x3901aa[_0x46e8('0x72')],_0x3901aa['joins'][_0x19da93][_0x46e8('0x7b')],_0x3901aa[_0x46e8('0x7a')][_0x19da93]['foreignTable'],_0x3901aa[_0x46e8('0x7a')][_0x19da93][_0x46e8('0x7d')]));}}}if(_0x3901aa[_0x46e8('0x7f')]){_0x3901aa[_0x46e8('0x7f')]=JSON[_0x46e8('0x80')](_0x3901aa[_0x46e8('0x7f')]);_0x396f09[_0x46e8('0x3d')](_0x504bc4(_0x3901aa[_0x46e8('0x7f')][_0x46e8('0x67')]));}_0x24d9f3=_0x396f09[_0x46e8('0x81')]();_0x396f09['limit'](_0x288d6e);_0x396f09['offset'](0x0);logger[_0x46e8('0x82')](_0x46e8('0x83'),_0x396f09['toString']());return dbH['sequelize'][_0x46e8('0x33')](_0x396f09[_0x46e8('0x84')](),{'type':dbH['sequelize'][_0x46e8('0x85')][_0x46e8('0x86')]});}})[_0x46e8('0x22')](respondWithResult(_0x5cddac,null))[_0x46e8('0x50')](handleError(_0x5cddac,null));};function runReport(_0x417ab2,_0x15a89e,_0x492a3a){var _0x222969=_0x15a89e['name'];var _0x27e648=0xa;var _0x3f3065=[_0x46e8('0x87'),_0x46e8('0x53'),_0x46e8('0x54'),_0x46e8('0x55')];var _0x428285={'SUM':_0x46e8('0x56'),'COUNT':_0x46e8('0x57'),'COUNT DISTINCT':_0x46e8('0x58'),'MAX':_0x46e8('0x59'),'MIN':_0x46e8('0x5a'),'AVG':_0x46e8('0x5b'),'GROUP_CONCAT':_0x46e8('0x5c'),'GROUP_CONCAT ASC':_0x46e8('0x88'),'GROUP_CONCAT DESC':_0x46e8('0x5d')};var _0x49c072={'SEC_TO_TIME':_0x46e8('0x5e'),'DATE':_0x46e8('0x89'),'HOUR':_0x46e8('0x5f'),'ROUND':_0x46e8('0x8a'),'UNIX_TIMESTAMP':_0x46e8('0x60')};var _0x5d7ad0=function(_0x84161){return!_['includes']([_0x46e8('0x8b'),_0x46e8('0x62'),_0x46e8('0x63'),_0x46e8('0x64')],_0x84161);};var _0x13c509=function(_0xf9ccc1){if(!_0xf9ccc1||!_0xf9ccc1[_0x46e8('0x65')][_0x46e8('0x38')]){return'';}for(var _0x3adae4='(',_0x4129c0=0x0;_0x4129c0<_0xf9ccc1[_0x46e8('0x65')][_0x46e8('0x38')];_0x4129c0+=0x1){_0x4129c0>0x0&&(_0x3adae4+='\x20'+_0xf9ccc1['operator']+'\x20');_0x3adae4+=_0xf9ccc1[_0x46e8('0x65')][_0x4129c0]['group']?_0x13c509(_0xf9ccc1[_0x46e8('0x65')][_0x4129c0]['group']):_0xf9ccc1[_0x46e8('0x65')][_0x4129c0]['field']+'\x20'+_0xf9ccc1[_0x46e8('0x65')][_0x4129c0][_0x46e8('0x69')]+(_0x5d7ad0(_0xf9ccc1['rules'][_0x4129c0][_0x46e8('0x69')])?'\x20'+_0xf9ccc1['rules'][_0x4129c0][_0x46e8('0x8c')]:'');}return _0x3adae4+')';};var _0x2e27fa={'where':{'id':_0x417ab2['id']}},_0x5b42e6,_0x4128f7,_0xee1492,_0x3c3051,_0x30060a;_0x2e27fa=_[_0x46e8('0x40')]({},_0x2e27fa,_0x492a3a);return db[_0x46e8('0x2d')][_0x46e8('0x4d')](_0x2e27fa)['then'](function(_0x378534){if(_0x378534){_0x5b42e6=_0x378534;return _0x378534[_0x46e8('0x6a')]();}return null;})['then'](function(_0x168e30){if(_0x168e30){if(!_0x168e30[_0x46e8('0x38')]){throw new db['Sequelize'][(_0x46e8('0x6c'))](_0x46e8('0x6d'),0x193);}_0x4128f7=_0x168e30;return db[_0x46e8('0x6e')][_0x46e8('0x44')]({'raw':!![]});}return null;})[_0x46e8('0x22')](function(_0x5cccf8){if(_0x5cccf8){_0xee1492=_[_0x46e8('0x6f')](_0x5cccf8,'id');var _0x412061;var _0x2cfa04=squel[_0x46e8('0x70')]();_0x2cfa04[_0x46e8('0x71')](_0x5b42e6[_0x46e8('0x72')]);for(var _0x12bb7f=0x0;_0x12bb7f<_0x4128f7[_0x46e8('0x38')];_0x12bb7f+=0x1){_0x412061=_0x4128f7[_0x12bb7f]['MetricId']?_0xee1492[_0x4128f7[_0x12bb7f][_0x46e8('0x73')]]['metric']:_0x4128f7[_0x12bb7f]['field'];_0x412061=_0x4128f7[_0x12bb7f]['function']?_[_0x46e8('0x75')](_0x428285[_0x4128f7[_0x12bb7f]['function']],'%s',_0x412061):_0x412061;_0x412061=_0x4128f7[_0x12bb7f][_0x46e8('0x76')]?_[_0x46e8('0x75')](_0x49c072[_0x4128f7[_0x12bb7f]['format']],'%s',_0x412061):_0x412061;if(_0x4128f7[_0x12bb7f]['groupBy']){_0x2cfa04[_0x46e8('0x67')](_0x412061);}_0x4128f7[_0x12bb7f]['orderBy']&&_0x2cfa04[_0x46e8('0x3b')](_0x412061,_0x4128f7[_0x12bb7f][_0x46e8('0x78')]===_0x46e8('0x8d')?![]:!![]);_0x2cfa04[_0x46e8('0x68')](_0x412061,_0x4128f7[_0x12bb7f][_0x46e8('0x79')]||_0x412061);}if(_0x5b42e6['joins']){_0x5b42e6[_0x46e8('0x7a')]=JSON[_0x46e8('0x80')](_0x5b42e6[_0x46e8('0x7a')]);for(var _0x135baf=0x0;_0x135baf<_0x5b42e6[_0x46e8('0x7a')][_0x46e8('0x38')];_0x135baf+=0x1){if(_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x30')]&&_['includes'](_0x3f3065,_0x5b42e6['joins'][_0x135baf]['type'])&&_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7b')]&&_0x5b42e6[_0x46e8('0x7a')][_0x135baf]['foreignTable']&&_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7d')]){_0x2cfa04[_0x5b42e6['joins'][_0x135baf][_0x46e8('0x30')]](_0x5b42e6[_0x46e8('0x7a')][_0x135baf]['foreignTable'],null,util[_0x46e8('0x76')](_0x46e8('0x7e'),_0x5b42e6[_0x46e8('0x72')],_0x5b42e6[_0x46e8('0x7a')][_0x135baf]['parentKey'],_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7c')],_0x5b42e6[_0x46e8('0x7a')][_0x135baf][_0x46e8('0x7d')]));}}}if(_0x5b42e6[_0x46e8('0x7f')]){_0x5b42e6[_0x46e8('0x7f')]=JSON[_0x46e8('0x80')](_0x5b42e6[_0x46e8('0x7f')]);_0x2cfa04['where'](_0x13c509(_0x5b42e6[_0x46e8('0x7f')][_0x46e8('0x67')]));}_0x30060a=_0x2cfa04['clone']();_0x2cfa04[_0x46e8('0x3a')](_0x27e648);_0x2cfa04[_0x46e8('0x1b')](0x0);return;}})['then'](function(){if(_0x15a89e['output']===_0x46e8('0x8e')){return null;}var _0x13c82d=_[_0x46e8('0x40')](_0x15a89e,{'name':_0x15a89e[_0x46e8('0x8f')]||_0x15a89e[_0x46e8('0x29')]||_0x5b42e6[_0x46e8('0x29')],'basename':_0x222969,'savename':util[_0x46e8('0x76')](_0x46e8('0x90'),_0x15a89e[_0x46e8('0x29')]||_0x5b42e6[_0x46e8('0x29')],require('randomstring')[_0x46e8('0x91')](0x4),_0x15a89e[_0x46e8('0x92')]||'csv'),'reportId':_0x5b42e6['id'],'reportType':_0x46e8('0x93')});return db[_0x46e8('0x94')][_0x46e8('0x47')](_0x13c82d,{'raw':!![]});})['then'](function(_0x39536e){if(_0x5b42e6[_0x46e8('0x72')]===_0x46e8('0x95')){_0x30060a[_0x46e8('0x3d')](_0x5b42e6[_0x46e8('0x72')]+_0x46e8('0x96'),_0x15a89e[_0x46e8('0x97')],_0x15a89e[_0x46e8('0x98')]);}else{_0x30060a['where'](_0x5b42e6[_0x46e8('0x72')]+_0x46e8('0x99'),_0x15a89e[_0x46e8('0x97')],_0x15a89e[_0x46e8('0x98')]);}if(_0x39536e){logger[_0x46e8('0x9a')](_0x46e8('0x9b'),_0x30060a[_0x46e8('0x84')]());require(_0x46e8('0x9c'))[_0x46e8('0x9d')](path['join'](__dirname,'../../components/export/',_0x39536e[_0x46e8('0x92')]),[_0x39536e['id'],_0x30060a[_0x46e8('0x84')](),path[_0x46e8('0x87')](__dirname,'../../files/reports',_0x39536e[_0x46e8('0x9e')]),_0x222969]);return _0x39536e;}else{var _0x223d4b=squel['select']();_0x223d4b[_0x46e8('0x71')]('('+_0x30060a[_0x46e8('0x84')]()+')','countTable');_0x223d4b[_0x46e8('0x68')](_0x46e8('0x9f'),'count');_0x30060a[_0x46e8('0x3a')](_0x15a89e[_0x46e8('0x3a')]||_0x27e648);_0x30060a[_0x46e8('0x1b')](_0x15a89e[_0x46e8('0x1b')]||0x0);return dbH[_0x46e8('0xa0')][_0x46e8('0x33')](_0x223d4b['toString'](),{'type':dbH[_0x46e8('0xa0')][_0x46e8('0x85')][_0x46e8('0x86')]})['then'](function(_0x3d5fe5){if(!_0x3d5fe5[_0x46e8('0x38')]){_0x3c3051=0x0;}else{_0x3c3051=_0x3d5fe5[0x0][_0x46e8('0x1d')]||0x0;}return dbH['sequelize'][_0x46e8('0x33')](_0x30060a[_0x46e8('0x84')](),{'type':dbH[_0x46e8('0xa0')][_0x46e8('0x85')][_0x46e8('0x86')]});})[_0x46e8('0x22')](function(_0x308176){return{'rows':_0x308176||[],'count':_0x3c3051};});}});}exports['run']=function(_0xc72529,_0x14aef0){return runReport(_0xc72529[_0x46e8('0x51')],_0xc72529[_0x46e8('0x33')],_0xc72529[_0x46e8('0x41')])[_0x46e8('0x22')](respondWithResult(_0x14aef0,null))[_0x46e8('0x50')](handleError(_0x14aef0,null));};exports[_0x46e8('0xa1')]=runReport;exports[_0x46e8('0x33')]=function(_0x522dd4,_0xa7b963){var _0x26d2dc=0xa;var _0x3b85a2=[_0x46e8('0x87'),_0x46e8('0x53'),_0x46e8('0x54'),'cross_join'];var _0x5e2373={'SUM':_0x46e8('0x56'),'COUNT':_0x46e8('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x46e8('0x59'),'MIN':_0x46e8('0x5a'),'AVG':_0x46e8('0x5b'),'GROUP_CONCAT':_0x46e8('0x5c'),'GROUP_CONCAT ASC':_0x46e8('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x28cd3f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x46e8('0x89'),'HOUR':_0x46e8('0x5f'),'ROUND':_0x46e8('0x8a'),'UNIX_TIMESTAMP':_0x46e8('0x60')};var _0x41f666=function(_0x3d9cc5){return!_[_0x46e8('0x61')](['IS\x20NULL',_0x46e8('0x62'),_0x46e8('0x63'),_0x46e8('0x64')],_0x3d9cc5);};var _0x52d5c0=function(_0x12556f){if(!_0x12556f||!_0x12556f['rules']['length']){return'';}for(var _0x505ea1='(',_0x11a5fc=0x0;_0x11a5fc<_0x12556f[_0x46e8('0x65')][_0x46e8('0x38')];_0x11a5fc+=0x1){_0x11a5fc>0x0&&(_0x505ea1+='\x20'+_0x12556f['operator']+'\x20');_0x505ea1+=_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x67')]?_0x52d5c0(_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x67')]):_0x12556f['rules'][_0x11a5fc]['field']+'\x20'+_0x12556f['rules'][_0x11a5fc][_0x46e8('0x69')]+(_0x41f666(_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x69')])?'\x20'+_0x12556f[_0x46e8('0x65')][_0x11a5fc][_0x46e8('0x8c')]:'');}return _0x505ea1+')';};var _0x34be26={'where':{'id':_0x522dd4[_0x46e8('0x51')]['id']}},_0x43a361,_0x32c9da,_0x419c45,_0x1ca266,_0x62606;_0x34be26=_[_0x46e8('0x40')]({},_0x34be26,_0x522dd4['options']);return db[_0x46e8('0x2d')][_0x46e8('0x4d')](_0x34be26)['then'](function(_0xdebd54){if(_0xdebd54){_0x43a361=_0xdebd54;return _0xdebd54['getFields']();}return null;})[_0x46e8('0x22')](function(_0x4b0cbb){if(_0x4b0cbb){if(!_0x4b0cbb[_0x46e8('0x38')]){throw new db[(_0x46e8('0x6b'))][(_0x46e8('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x32c9da=_0x4b0cbb;return db[_0x46e8('0x6e')][_0x46e8('0x44')]({'raw':!![]});}return null;})['then'](function(_0x38b032){if(_0x38b032){_0x419c45=_[_0x46e8('0x6f')](_0x38b032,'id');var _0x1a0780;var _0x5ba44f=squel[_0x46e8('0x70')]();_0x5ba44f[_0x46e8('0x71')](_0x43a361['table']);for(var _0x445ace=0x0;_0x445ace<_0x32c9da['length'];_0x445ace+=0x1){_0x1a0780=_0x32c9da[_0x445ace][_0x46e8('0x73')]?_0x419c45[_0x32c9da[_0x445ace][_0x46e8('0x73')]][_0x46e8('0xa2')]:_0x32c9da[_0x445ace]['field'];_0x1a0780=_0x32c9da[_0x445ace][_0x46e8('0x74')]?_[_0x46e8('0x75')](_0x5e2373[_0x32c9da[_0x445ace][_0x46e8('0x74')]],'%s',_0x1a0780):_0x1a0780;_0x1a0780=_0x32c9da[_0x445ace][_0x46e8('0x76')]?_[_0x46e8('0x75')](_0x28cd3f[_0x32c9da[_0x445ace][_0x46e8('0x76')]],'%s',_0x1a0780):_0x1a0780;if(_0x32c9da[_0x445ace][_0x46e8('0x77')]){_0x5ba44f[_0x46e8('0x67')](_0x1a0780);}_0x32c9da[_0x445ace]['orderBy']&&_0x5ba44f[_0x46e8('0x3b')](_0x1a0780,_0x32c9da[_0x445ace][_0x46e8('0x78')]===_0x46e8('0x8d')?![]:!![]);_0x5ba44f[_0x46e8('0x68')](_0x1a0780,_0x32c9da[_0x445ace][_0x46e8('0x79')]||_0x1a0780);}if(_0x43a361[_0x46e8('0x7a')]){_0x43a361[_0x46e8('0x7a')]=JSON[_0x46e8('0x80')](_0x43a361[_0x46e8('0x7a')]);for(var _0x559b05=0x0;_0x559b05<_0x43a361[_0x46e8('0x7a')][_0x46e8('0x38')];_0x559b05+=0x1){if(_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x30')]&&_[_0x46e8('0x61')](_0x3b85a2,_0x43a361['joins'][_0x559b05][_0x46e8('0x30')])&&_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x7b')]&&_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x7c')]&&_0x43a361['joins'][_0x559b05]['foreignKey']){_0x5ba44f[_0x43a361['joins'][_0x559b05][_0x46e8('0x30')]](_0x43a361[_0x46e8('0x7a')][_0x559b05]['foreignTable'],null,util[_0x46e8('0x76')](_0x46e8('0x7e'),_0x43a361['table'],_0x43a361['joins'][_0x559b05][_0x46e8('0x7b')],_0x43a361[_0x46e8('0x7a')][_0x559b05][_0x46e8('0x7c')],_0x43a361['joins'][_0x559b05][_0x46e8('0x7d')]));}}}if(_0x43a361[_0x46e8('0x7f')]){_0x43a361['conditions']=JSON[_0x46e8('0x80')](_0x43a361[_0x46e8('0x7f')]);_0x5ba44f['where'](_0x52d5c0(_0x43a361[_0x46e8('0x7f')][_0x46e8('0x67')]));}_0x62606=_0x5ba44f['clone']();_0x5ba44f[_0x46e8('0x3a')](_0x26d2dc);_0x5ba44f[_0x46e8('0x1b')](0x0);logger['debug'](_0x46e8('0x83'),_0x5ba44f['toString']());return dbH['sequelize'][_0x46e8('0x33')](_0x5ba44f[_0x46e8('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x46e8('0x86')]});}})['then'](function(){return{'sql':_0x62606['toString']()};})['then'](respondWithResult(_0xa7b963,null))[_0x46e8('0x50')](handleError(_0xa7b963,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 590819c..f43cbf2 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf73=['bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','util','../../config/logger','api','moment'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0xcf73,0x193));var _0x3cf7=function(_0x1f13d5,_0x210639){_0x1f13d5=_0x1f13d5-0x0;var _0x4fda7a=_0xcf73[_0x1f13d5];return _0x4fda7a;};'use strict';var _=require('lodash');var util=require(_0x3cf7('0x0'));var logger=require(_0x3cf7('0x1'))(_0x3cf7('0x2'));var moment=require(_0x3cf7('0x3'));var BPromise=require(_0x3cf7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cf7('0x5'));var rimraf=require(_0x3cf7('0x6'));var config=require(_0x3cf7('0x7'));var attributes=require(_0x3cf7('0x8'));module['exports']=function(_0x46ec83,_0x17a20a){return _0x46ec83[_0x3cf7('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x3cf7('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x56d4=['bluebird','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','moment'];(function(_0x242ce6,_0x297d12){var _0x13f70a=function(_0x370ccf){while(--_0x370ccf){_0x242ce6['push'](_0x242ce6['shift']());}};_0x13f70a(++_0x297d12);}(_0x56d4,0x164));var _0x456d=function(_0xce854e,_0x579729){_0xce854e=_0xce854e-0x0;var _0x2246a9=_0x56d4[_0xce854e];return _0x2246a9;};'use strict';var _=require('lodash');var util=require(_0x456d('0x0'));var logger=require(_0x456d('0x1'))(_0x456d('0x2'));var moment=require(_0x456d('0x3'));var BPromise=require(_0x456d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x456d('0x5'));var rimraf=require('rimraf');var config=require(_0x456d('0x6'));var attributes=require(_0x456d('0x7'));module[_0x456d('0x8')]=function(_0x325ef3,_0x4bcb7b){return _0x325ef3[_0x456d('0x9')](_0x456d('0xa'),attributes,{'tableName':_0x456d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 98d2f29..a642321 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc2c7=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x9dd37c,_0x3e255e){var _0x2a522c=function(_0x2ce2ca){while(--_0x2ce2ca){_0x9dd37c['push'](_0x9dd37c['shift']());}};_0x2a522c(++_0x3e255e);}(_0xc2c7,0x179));var _0x7c2c=function(_0x203991,_0x5e2e25){_0x203991=_0x203991-0x0;var _0x216414=_0xc2c7[_0x203991];return _0x216414;};'use strict';var _=require(_0x7c2c('0x0'));var util=require(_0x7c2c('0x1'));var moment=require(_0x7c2c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c2c('0x3'));var db=require(_0x7c2c('0x4'))['db'];var utils=require(_0x7c2c('0x5'));var logger=require(_0x7c2c('0x6'))(_0x7c2c('0x7'));var config=require(_0x7c2c('0x8'));var jayson=require(_0x7c2c('0x9'));var client=jayson[_0x7c2c('0xa')][_0x7c2c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b873b,_0x459812,_0x2ad0ac){return new BPromise(function(_0x1c33b3,_0x4e222e){return client[_0x7c2c('0xc')](_0x1b873b,_0x2ad0ac)[_0x7c2c('0xd')](function(_0x3e38fe){logger[_0x7c2c('0xe')](_0x7c2c('0xf'),_0x459812,_0x7c2c('0x10'));logger['debug'](_0x7c2c('0x11'),_0x459812,_0x7c2c('0x10'),JSON[_0x7c2c('0x12')](_0x3e38fe));if(_0x3e38fe[_0x7c2c('0x13')]){if(_0x3e38fe[_0x7c2c('0x13')]['code']===0x1f4){logger['error'](_0x7c2c('0xf'),_0x459812,_0x3e38fe['error']['message']);return _0x4e222e(_0x3e38fe[_0x7c2c('0x13')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x13')](_0x7c2c('0xf'),_0x459812,_0x3e38fe[_0x7c2c('0x13')][_0x7c2c('0x14')]);return _0x1c33b3(_0x3e38fe[_0x7c2c('0x13')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xf'),_0x459812,_0x7c2c('0x10'));_0x1c33b3(_0x3e38fe[_0x7c2c('0x15')][_0x7c2c('0x14')]);}})[_0x7c2c('0x16')](function(_0x414b47){logger[_0x7c2c('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x459812,_0x414b47);_0x4e222e(_0x414b47);});});}
\ No newline at end of file
+var _0x724b=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x724b,0x66));var _0xb724=function(_0x408338,_0x4cd8e7){_0x408338=_0x408338-0x0;var _0x313eca=_0x724b[_0x408338];return _0x313eca;};'use strict';var _=require(_0xb724('0x0'));var util=require(_0xb724('0x1'));var moment=require(_0xb724('0x2'));var BPromise=require(_0xb724('0x3'));var rs=require(_0xb724('0x4'));var fs=require('fs');var Redis=require(_0xb724('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb724('0x6'))(_0xb724('0x7'));var config=require(_0xb724('0x8'));var jayson=require(_0xb724('0x9'));var client=jayson[_0xb724('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12ef4f,_0xdc06b3,_0x3e73a6){return new BPromise(function(_0x146a9f,_0x305998){return client[_0xb724('0xb')](_0x12ef4f,_0x3e73a6)[_0xb724('0xc')](function(_0x238143){logger[_0xb724('0xd')](_0xb724('0xe'),_0xdc06b3,'request\x20sent');logger[_0xb724('0xf')](_0xb724('0x10'),_0xdc06b3,_0xb724('0x11'),JSON['stringify'](_0x238143));if(_0x238143[_0xb724('0x12')]){if(_0x238143[_0xb724('0x12')]['code']===0x1f4){logger[_0xb724('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xdc06b3,_0x238143[_0xb724('0x12')]['message']);return _0x305998(_0x238143['error'][_0xb724('0x13')]);}logger[_0xb724('0x12')](_0xb724('0xe'),_0xdc06b3,_0x238143[_0xb724('0x12')][_0xb724('0x13')]);return _0x146a9f(_0x238143[_0xb724('0x12')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0xdc06b3,'request\x20sent');_0x146a9f(_0x238143['result'][_0xb724('0x13')]);}})['catch'](function(_0x5535f8){logger['error'](_0xb724('0xe'),_0xdc06b3,_0x5535f8);_0x305998(_0x5535f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 30d2dd3..8d0bc20 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ea7=['express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','run','query','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x5eebc9,_0x104871){var _0x17c047=function(_0x1b4b6f){while(--_0x1b4b6f){_0x5eebc9['push'](_0x5eebc9['shift']());}};_0x17c047(++_0x104871);}(_0x2ea7,0x16d));var _0x72ea=function(_0x3a340f,_0x18653e){_0x3a340f=_0x3a340f-0x0;var _0x14ca55=_0x2ea7[_0x3a340f];return _0x14ca55;};'use strict';var multer=require('multer');var util=require(_0x72ea('0x0'));var path=require(_0x72ea('0x1'));var timeout=require(_0x72ea('0x2'));var express=require(_0x72ea('0x3'));var router=express[_0x72ea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x72ea('0x5'));var config=require(_0x72ea('0x6'));var controller=require(_0x72ea('0x7'));router[_0x72ea('0x8')]('/',auth[_0x72ea('0x9')](),controller['index']);router[_0x72ea('0x8')](_0x72ea('0xa'),auth[_0x72ea('0x9')](),controller['show']);router[_0x72ea('0x8')](_0x72ea('0xb'),auth[_0x72ea('0x9')](),controller[_0x72ea('0xc')]);router[_0x72ea('0x8')](_0x72ea('0xd'),auth[_0x72ea('0x9')](),controller[_0x72ea('0xe')]);router[_0x72ea('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0x72ea('0xf')]);router[_0x72ea('0x10')]('/',auth[_0x72ea('0x9')](),controller[_0x72ea('0x11')]);router[_0x72ea('0x12')](_0x72ea('0xa'),auth[_0x72ea('0x9')](),controller[_0x72ea('0x13')]);router[_0x72ea('0x14')](_0x72ea('0xa'),auth[_0x72ea('0x9')](),controller[_0x72ea('0x15')]);module[_0x72ea('0x16')]=router;
\ No newline at end of file
+var _0xa918=['isAuthenticated','index','get','/:id','show','preview','/:id/query','query','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticCustomReport.controller'];(function(_0x3a288d,_0x1891cb){var _0x126b2c=function(_0x518959){while(--_0x518959){_0x3a288d['push'](_0x3a288d['shift']());}};_0x126b2c(++_0x1891cb);}(_0xa918,0x172));var _0x8a91=function(_0x12a754,_0x5ae799){_0x12a754=_0x12a754-0x0;var _0x1cb480=_0xa918[_0x12a754];return _0x1cb480;};'use strict';var multer=require(_0x8a91('0x0'));var util=require('util');var path=require(_0x8a91('0x1'));var timeout=require(_0x8a91('0x2'));var express=require(_0x8a91('0x3'));var router=express[_0x8a91('0x4')]();var fs_extra=require(_0x8a91('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8a91('0x6'));var controller=require(_0x8a91('0x7'));router['get']('/',auth[_0x8a91('0x8')](),controller[_0x8a91('0x9')]);router[_0x8a91('0xa')](_0x8a91('0xb'),auth[_0x8a91('0x8')](),controller[_0x8a91('0xc')]);router[_0x8a91('0xa')]('/:id/preview',auth[_0x8a91('0x8')](),controller[_0x8a91('0xd')]);router['get']('/:id/run',auth[_0x8a91('0x8')](),controller['run']);router[_0x8a91('0xa')](_0x8a91('0xe'),auth[_0x8a91('0x8')](),controller[_0x8a91('0xf')]);router[_0x8a91('0x10')]('/',auth[_0x8a91('0x8')](),controller['create']);router[_0x8a91('0x11')](_0x8a91('0xb'),auth[_0x8a91('0x8')](),controller[_0x8a91('0x12')]);router[_0x8a91('0x13')](_0x8a91('0xb'),auth[_0x8a91('0x8')](),controller['destroy']);module[_0x8a91('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 64860a2..2cdbac8 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x038b=['exports','STRING','TEXT'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x038b,0x114));var _0xb038=function(_0x163b94,_0x3cc020){_0x163b94=_0x163b94-0x0;var _0x2d1f28=_0x038b[_0x163b94];return _0x2d1f28;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}};
\ No newline at end of file
+var _0xeda8=['sequelize','exports','STRING','TEXT'];(function(_0x5e2219,_0x1384ba){var _0x419dfa=function(_0x2d6533){while(--_0x2d6533){_0x5e2219['push'](_0x5e2219['shift']());}};_0x419dfa(++_0x1384ba);}(_0xeda8,0x104));var _0x8eda=function(_0xb83270,_0x59549f){_0xb83270=_0xb83270-0x0;var _0xa31dec=_0xeda8[_0xb83270];return _0xa31dec;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eda('0x2')]},'parent':{'type':Sequelize[_0x8eda('0x2')]},'table':{'type':Sequelize[_0x8eda('0x2')]},'conditions':{'type':Sequelize[_0x8eda('0x3')]},'joins':{'type':Sequelize[_0x8eda('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index e1d8d50..0ca7d81 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x230f43,_0x57edaf){var _0x1063a0=function(_0x38d08f){while(--_0x38d08f){_0x230f43['push'](_0x230f43['shift']());}};_0x1063a0(++_0x57edaf);}(_0x1cb9,0x14e));var _0x91cb=function(_0x448e5e,_0x57a63b){_0x448e5e=_0x448e5e-0x0;var _0x594eec=_0x1cb9[_0x448e5e];return _0x594eec;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x5aca66,_0x46b000){var _0x54a64d=function(_0x54045c){while(--_0x54045c){_0x5aca66['push'](_0x5aca66['shift']());}};_0x54a64d(++_0x46b000);}(_0x4975,0x86));var _0x5497=function(_0x43e17c,_0x14fac8){_0x43e17c=_0x43e17c-0x0;var _0xdc9229=_0x4975[_0x43e17c];return _0xdc9229;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index e31de23..c22799a 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd2bb=['AnalyticDefaultReport','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0xfefdb1,_0xc4308e){var _0x928ad0=function(_0x2f3a29){while(--_0x2f3a29){_0xfefdb1['push'](_0xfefdb1['shift']());}};_0x928ad0(++_0xc4308e);}(_0xd2bb,0x146));var _0xbd2b=function(_0x3fa0c4,_0xcfcd1e){_0x3fa0c4=_0x3fa0c4-0x0;var _0x3e0df2=_0xd2bb[_0x3fa0c4];return _0x3e0df2;};'use strict';var _=require(_0xbd2b('0x0'));var util=require(_0xbd2b('0x1'));var logger=require(_0xbd2b('0x2'))('api');var moment=require(_0xbd2b('0x3'));var BPromise=require(_0xbd2b('0x4'));var rp=require(_0xbd2b('0x5'));var fs=require('fs');var path=require(_0xbd2b('0x6'));var rimraf=require(_0xbd2b('0x7'));var config=require(_0xbd2b('0x8'));var attributes=require(_0xbd2b('0x9'));module[_0xbd2b('0xa')]=function(_0x3ff2f1,_0x6b2209){return _0x3ff2f1[_0xbd2b('0xb')](_0xbd2b('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcecf=['analytics_default_reports','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x192a5b,_0x3640a8){var _0x15fdd5=function(_0x5ecc30){while(--_0x5ecc30){_0x192a5b['push'](_0x192a5b['shift']());}};_0x15fdd5(++_0x3640a8);}(_0xcecf,0xeb));var _0xfcec=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xcecf[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xfcec('0x0'));var util=require(_0xfcec('0x1'));var logger=require('../../config/logger')(_0xfcec('0x2'));var moment=require(_0xfcec('0x3'));var BPromise=require(_0xfcec('0x4'));var rp=require(_0xfcec('0x5'));var fs=require('fs');var path=require(_0xfcec('0x6'));var rimraf=require(_0xfcec('0x7'));var config=require(_0xfcec('0x8'));var attributes=require(_0xfcec('0x9'));module['exports']=function(_0xa426ed,_0x7cd8db){return _0xa426ed[_0xfcec('0xa')](_0xfcec('0xb'),attributes,{'tableName':_0xfcec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 7bbb760..8d29975 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe7db=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xe7db,0x156));var _0xbe7d=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xe7db[_0x1ac6ec];return _0x48a489;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe7d('0x0'));var BPromise=require(_0xbe7d('0x1'));var rs=require(_0xbe7d('0x2'));var fs=require('fs');var Redis=require(_0xbe7d('0x3'));var db=require(_0xbe7d('0x4'))['db'];var utils=require(_0xbe7d('0x5'));var logger=require(_0xbe7d('0x6'))(_0xbe7d('0x7'));var config=require(_0xbe7d('0x8'));var jayson=require(_0xbe7d('0x9'));var client=jayson[_0xbe7d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x130751,_0xa7f2fe,_0x226b0f){return new BPromise(function(_0x557d0f,_0x21a5c0){return client[_0xbe7d('0xb')](_0x130751,_0x226b0f)['then'](function(_0x43e4cb){logger['info'](_0xbe7d('0xc'),_0xa7f2fe,_0xbe7d('0xd'));logger[_0xbe7d('0xe')](_0xbe7d('0xf'),_0xa7f2fe,_0xbe7d('0xd'),JSON[_0xbe7d('0x10')](_0x43e4cb));if(_0x43e4cb[_0xbe7d('0x11')]){if(_0x43e4cb['error']['code']===0x1f4){logger[_0xbe7d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xa7f2fe,_0x43e4cb['error'][_0xbe7d('0x12')]);return _0x21a5c0(_0x43e4cb[_0xbe7d('0x11')]['message']);}logger['error'](_0xbe7d('0xc'),_0xa7f2fe,_0x43e4cb[_0xbe7d('0x11')][_0xbe7d('0x12')]);return _0x557d0f(_0x43e4cb[_0xbe7d('0x11')]['message']);}else{logger[_0xbe7d('0x13')](_0xbe7d('0xc'),_0xa7f2fe,_0xbe7d('0xd'));_0x557d0f(_0x43e4cb[_0xbe7d('0x14')][_0xbe7d('0x12')]);}})['catch'](function(_0x354376){logger[_0xbe7d('0x11')](_0xbe7d('0xc'),_0xa7f2fe,_0x354376);_0x21a5c0(_0x354376);});});}
\ No newline at end of file
+var _0x79e8=['rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0xfa1e02,_0x3dad97){var _0x2f71af=function(_0x359a28){while(--_0x359a28){_0xfa1e02['push'](_0xfa1e02['shift']());}};_0x2f71af(++_0x3dad97);}(_0x79e8,0x1dd));var _0x879e=function(_0x43d702,_0x26b620){_0x43d702=_0x43d702-0x0;var _0x2e5709=_0x79e8[_0x43d702];return _0x2e5709;};'use strict';var _=require(_0x879e('0x0'));var util=require(_0x879e('0x1'));var moment=require(_0x879e('0x2'));var BPromise=require(_0x879e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x879e('0x4'))['db'];var utils=require(_0x879e('0x5'));var logger=require('../../config/logger')(_0x879e('0x6'));var config=require('../../config/environment');var jayson=require(_0x879e('0x7'));var client=jayson[_0x879e('0x8')][_0x879e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e651d,_0x265627,_0x580e89){return new BPromise(function(_0x258dd1,_0x5c81ef){return client[_0x879e('0xa')](_0x4e651d,_0x580e89)[_0x879e('0xb')](function(_0x7ca991){logger[_0x879e('0xc')](_0x879e('0xd'),_0x265627,_0x879e('0xe'));logger[_0x879e('0xf')](_0x879e('0x10'),_0x265627,'request\x20sent',JSON[_0x879e('0x11')](_0x7ca991));if(_0x7ca991[_0x879e('0x12')]){if(_0x7ca991['error'][_0x879e('0x13')]===0x1f4){logger[_0x879e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x265627,_0x7ca991[_0x879e('0x12')][_0x879e('0x14')]);return _0x5c81ef(_0x7ca991['error'][_0x879e('0x14')]);}logger[_0x879e('0x12')](_0x879e('0xd'),_0x265627,_0x7ca991[_0x879e('0x12')][_0x879e('0x14')]);return _0x258dd1(_0x7ca991['error'][_0x879e('0x14')]);}else{logger[_0x879e('0xc')](_0x879e('0xd'),_0x265627,'request\x20sent');_0x258dd1(_0x7ca991[_0x879e('0x15')]['message']);}})[_0x879e('0x16')](function(_0x2a941d){logger[_0x879e('0x12')](_0x879e('0xd'),_0x265627,_0x2a941d);_0x5c81ef(_0x2a941d);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 298eb1a..1823b7f 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6e82=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/preview','preview','/:id/query','post','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3428b3,_0x4396cc){var _0x4474ad=function(_0x5df2bc){while(--_0x5df2bc){_0x3428b3['push'](_0x3428b3['shift']());}};_0x4474ad(++_0x4396cc);}(_0x6e82,0x1c6));var _0x26e8=function(_0x27221f,_0x3f0125){_0x27221f=_0x27221f-0x0;var _0x1946d4=_0x6e82[_0x27221f];return _0x1946d4;};'use strict';var multer=require(_0x26e8('0x0'));var util=require(_0x26e8('0x1'));var path=require(_0x26e8('0x2'));var timeout=require(_0x26e8('0x3'));var express=require(_0x26e8('0x4'));var router=express[_0x26e8('0x5')]();var fs_extra=require(_0x26e8('0x6'));var auth=require(_0x26e8('0x7'));var interaction=require(_0x26e8('0x8'));var config=require(_0x26e8('0x9'));var controller=require('./analyticDefaultReport.controller');router[_0x26e8('0xa')]('/',auth[_0x26e8('0xb')](),controller[_0x26e8('0xc')]);router[_0x26e8('0xa')]('/:id',auth[_0x26e8('0xb')](),controller[_0x26e8('0xd')]);router[_0x26e8('0xa')](_0x26e8('0xe'),auth['isAuthenticated'](),controller[_0x26e8('0xf')]);router[_0x26e8('0xa')]('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x26e8('0xa')](_0x26e8('0x10'),auth[_0x26e8('0xb')](),controller['query']);router[_0x26e8('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x26e8('0x12')](_0x26e8('0x13'),auth['isAuthenticated'](),controller[_0x26e8('0x14')]);router['delete'](_0x26e8('0x13'),auth[_0x26e8('0xb')](),controller[_0x26e8('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x2b07=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','update','delete','destroy','multer'];(function(_0x6c3725,_0x2cfa35){var _0x37f89d=function(_0x3a661e){while(--_0x3a661e){_0x6c3725['push'](_0x6c3725['shift']());}};_0x37f89d(++_0x2cfa35);}(_0x2b07,0x7c));var _0x72b0=function(_0x2e914,_0x1c7566){_0x2e914=_0x2e914-0x0;var _0x936e45=_0x2b07[_0x2e914];return _0x936e45;};'use strict';var multer=require(_0x72b0('0x0'));var util=require(_0x72b0('0x1'));var path=require('path');var timeout=require(_0x72b0('0x2'));var express=require('express');var router=express[_0x72b0('0x3')]();var fs_extra=require(_0x72b0('0x4'));var auth=require(_0x72b0('0x5'));var interaction=require(_0x72b0('0x6'));var config=require(_0x72b0('0x7'));var controller=require(_0x72b0('0x8'));router[_0x72b0('0x9')]('/',auth[_0x72b0('0xa')](),controller[_0x72b0('0xb')]);router[_0x72b0('0x9')](_0x72b0('0xc'),auth[_0x72b0('0xa')](),controller[_0x72b0('0xd')]);router[_0x72b0('0x9')](_0x72b0('0xe'),auth['isAuthenticated'](),controller[_0x72b0('0xf')]);router[_0x72b0('0x9')](_0x72b0('0x10'),auth[_0x72b0('0xa')](),controller[_0x72b0('0x11')]);router[_0x72b0('0x9')](_0x72b0('0x12'),auth['isAuthenticated'](),controller[_0x72b0('0x13')]);router[_0x72b0('0x14')]('/',auth[_0x72b0('0xa')](),controller['create']);router[_0x72b0('0x15')](_0x72b0('0xc'),auth['isAuthenticated'](),controller[_0x72b0('0x16')]);router[_0x72b0('0x17')](_0x72b0('0xc'),auth[_0x72b0('0xa')](),controller[_0x72b0('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 1e6da4f..5f9228c 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1bd0=['csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM'];(function(_0x341145,_0x43b1a0){var _0x4ae522=function(_0x7dd16b){while(--_0x7dd16b){_0x341145['push'](_0x341145['shift']());}};_0x4ae522(++_0x43b1a0);}(_0x1bd0,0x14d));var _0x01bd=function(_0x2353b8,_0x5704fa){_0x2353b8=_0x2353b8-0x0;var _0x2147cd=_0x1bd0[_0x2353b8];return _0x2147cd;};'use strict';var Sequelize=require(_0x01bd('0x0'));var moment=require(_0x01bd('0x1'));module[_0x01bd('0x2')]={'name':{'type':Sequelize[_0x01bd('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x01bd('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x01bd('0x4')](_0x01bd('0x5'),_0x01bd('0x6'),_0x01bd('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x01bd('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x01bd('0x8')]},'endDate':{'type':Sequelize[_0x01bd('0x8')]},'status':{'type':Sequelize[_0x01bd('0x3')],'defaultValue':_0x01bd('0x9')},'type':{'type':Sequelize[_0x01bd('0x4')](_0x01bd('0xa'),_0x01bd('0xb')),'allowNull':![],'defaultValue':_0x01bd('0xa')},'reportId':{'type':Sequelize[_0x01bd('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x01bd('0x3')]}};
\ No newline at end of file
+var _0xbe1f=['exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled','manual','INTEGER','moment'];(function(_0x5ca5f0,_0x271351){var _0x124306=function(_0x282526){while(--_0x282526){_0x5ca5f0['push'](_0x5ca5f0['shift']());}};_0x124306(++_0x271351);}(_0xbe1f,0x17f));var _0xfbe1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbe1f[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfbe1('0x0'));module[_0xfbe1('0x1')]={'name':{'type':Sequelize[_0xfbe1('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xfbe1('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xfbe1('0x3')](_0xfbe1('0x4'),_0xfbe1('0x5'),_0xfbe1('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xfbe1('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfbe1('0x7')]},'endDate':{'type':Sequelize[_0xfbe1('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xfbe1('0x8')},'type':{'type':Sequelize[_0xfbe1('0x3')]('manual',_0xfbe1('0x9')),'allowNull':![],'defaultValue':_0xfbe1('0xa')},'reportId':{'type':Sequelize[_0xfbe1('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xfbe1('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 9fd4b1b..dfb1841 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x56f7=['includeAll','include','findAll','rows','catch','show','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','apply','reject','update','then','get','ExtractedReports','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticExtractedReport'];(function(_0x118f83,_0x31f530){var _0x2d5e54=function(_0x43b8be){while(--_0x43b8be){_0x118f83['push'](_0x118f83['shift']());}};_0x2d5e54(++_0x31f530);}(_0x56f7,0x1e1));var _0x756f=function(_0x41e5d7,_0x373699){_0x41e5d7=_0x41e5d7-0x0;var _0x3a3d01=_0x56f7[_0x41e5d7];return _0x3a3d01;};'use strict';var emlformat=require(_0x756f('0x0'));var rimraf=require(_0x756f('0x1'));var zipdir=require(_0x756f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x756f('0x3'));var moment=require('moment');var BPromise=require(_0x756f('0x4'));var Mustache=require(_0x756f('0x5'));var util=require(_0x756f('0x6'));var path=require(_0x756f('0x7'));var sox=require(_0x756f('0x8'));var csv=require(_0x756f('0x9'));var ejs=require(_0x756f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x756f('0xb'));var squel=require('squel');var crypto=require(_0x756f('0xc'));var jsforce=require(_0x756f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x756f('0xe'));var Papa=require(_0x756f('0xf'));var Redis=require(_0x756f('0x10'));var authService=require(_0x756f('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x756f('0x12'))(_0x756f('0x13'));var utils=require('../../config/utils');var config=require(_0x756f('0x14'));var licenseUtil=require(_0x756f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58805f,_0x3f0c20){_0x3f0c20=_0x3f0c20||0xcc;return function(_0xd3457d){if(_0xd3457d){return _0x58805f[_0x756f('0x16')](_0x3f0c20);}return _0x58805f['status'](_0x3f0c20)[_0x756f('0x17')]();};}function respondWithResult(_0x4bc0b2,_0x4abc38){_0x4abc38=_0x4abc38||0xc8;return function(_0x1e1c46){if(_0x1e1c46){return _0x4bc0b2['status'](_0x4abc38)[_0x756f('0x18')](_0x1e1c46);}};}function respondWithFilteredResult(_0x9cc6bd,_0x311431){return function(_0x46fdd2){if(_0x46fdd2){var _0x2e47e8=typeof _0x311431[_0x756f('0x19')]==='undefined'&&typeof _0x311431[_0x756f('0x1a')]===_0x756f('0x1b');var _0x12cfc5=_0x46fdd2[_0x756f('0x1c')];var _0x3103cd=_0x2e47e8?0x0:_0x311431['offset'];var _0x28325c=_0x2e47e8?_0x46fdd2[_0x756f('0x1c')]:_0x311431[_0x756f('0x19')]+_0x311431[_0x756f('0x1a')];var _0x5eb028;if(_0x28325c>=_0x12cfc5){_0x28325c=_0x12cfc5;_0x5eb028=0xc8;}else{_0x5eb028=0xce;}_0x9cc6bd[_0x756f('0x1d')](_0x5eb028);return _0x9cc6bd[_0x756f('0x1e')]('Content-Range',_0x3103cd+'-'+_0x28325c+'/'+_0x12cfc5)[_0x756f('0x18')](_0x46fdd2);}return null;};}function patchUpdates(_0x92b203){return function(_0x4d4ae8){try{jsonpatch[_0x756f('0x1f')](_0x4d4ae8,_0x92b203,!![]);}catch(_0x8faff6){return BPromise[_0x756f('0x20')](_0x8faff6);}return _0x4d4ae8['save']();};}function saveUpdates(_0x3e88b6,_0x49d715){return function(_0x6fe1b8){if(_0x6fe1b8){return _0x6fe1b8[_0x756f('0x21')](_0x3e88b6)['then'](function(_0x4773e6){return _0x4773e6;});}return null;};}function removeEntity(_0x3f3934,_0xd97cee){return function(_0x3147c2){if(_0x3147c2){return _0x3147c2['destroy']()[_0x756f('0x22')](function(){var _0x49aa9b=_0x3147c2[_0x756f('0x23')]({'plain':!![]});var _0x837d5=_0x756f('0x24');return db[_0x756f('0x25')][_0x756f('0x26')]({'where':{'type':_0x837d5,'resourceId':_0x49aa9b['id']}})[_0x756f('0x22')](function(){return _0x3147c2;});})[_0x756f('0x22')](function(){_0x3f3934[_0x756f('0x1d')](0xcc)[_0x756f('0x17')]();});}};}function handleEntityNotFound(_0x3f011c,_0x302fc8){return function(_0x1ea7c1){if(!_0x1ea7c1){_0x3f011c[_0x756f('0x16')](0x194);}return _0x1ea7c1;};}function handleError(_0x35828a,_0x11b65b){_0x11b65b=_0x11b65b||0x1f4;return function(_0x16a2cf){logger[_0x756f('0x27')](_0x16a2cf['stack']);if(_0x16a2cf[_0x756f('0x28')]){delete _0x16a2cf['name'];}_0x35828a[_0x756f('0x1d')](_0x11b65b)[_0x756f('0x29')](_0x16a2cf);};}exports[_0x756f('0x2a')]=function(_0x533d0a,_0x318bd8){var _0x531eb7={},_0x146b2c={},_0xf5ad37={'count':0x0,'rows':[]};var _0x29834=_[_0x756f('0x2b')](db['AnalyticExtractedReport'][_0x756f('0x2c')],function(_0x3e78f3){return{'name':_0x3e78f3['fieldName'],'type':_0x3e78f3['type'][_0x756f('0x2d')]};});_0x146b2c[_0x756f('0x2e')]=_[_0x756f('0x2b')](_0x29834,_0x756f('0x28'));_0x146b2c[_0x756f('0x2f')]=_[_0x756f('0x30')](_0x533d0a['query']);_0x146b2c[_0x756f('0x31')]=_[_0x756f('0x32')](_0x146b2c[_0x756f('0x2e')],_0x146b2c[_0x756f('0x2f')]);_0x531eb7['attributes']=_[_0x756f('0x32')](_0x146b2c[_0x756f('0x2e')],qs[_0x756f('0x33')](_0x533d0a[_0x756f('0x2f')]['fields']));_0x531eb7[_0x756f('0x34')]=_0x531eb7[_0x756f('0x34')][_0x756f('0x35')]?_0x531eb7[_0x756f('0x34')]:_0x146b2c[_0x756f('0x2e')];if(!_0x533d0a[_0x756f('0x2f')][_0x756f('0x36')](_0x756f('0x37'))){_0x531eb7['limit']=qs[_0x756f('0x1a')](_0x533d0a['query'][_0x756f('0x1a')]);_0x531eb7['offset']=qs[_0x756f('0x19')](_0x533d0a[_0x756f('0x2f')][_0x756f('0x19')]);}_0x531eb7[_0x756f('0x38')]=qs['sort'](_0x533d0a[_0x756f('0x2f')][_0x756f('0x39')]);_0x531eb7[_0x756f('0x3a')]=qs['filters'](_[_0x756f('0x3b')](_0x533d0a['query'],_0x146b2c[_0x756f('0x31')]),_0x29834);if(_0x533d0a[_0x756f('0x2f')][_0x756f('0x3c')]){_0x531eb7['where']=_[_0x756f('0x3d')](_0x531eb7['where'],{'$or':_[_0x756f('0x2b')](_0x29834,function(_0x1da649){if(_0x1da649[_0x756f('0x3e')]!=='VIRTUAL'){var _0x4d1d55={};_0x4d1d55[_0x1da649[_0x756f('0x28')]]={'$like':'%'+_0x533d0a[_0x756f('0x2f')]['filter']+'%'};return _0x4d1d55;}})});}_0x531eb7=_[_0x756f('0x3d')]({},_0x531eb7,_0x533d0a[_0x756f('0x3f')]);var _0x11a387={'where':_0x531eb7[_0x756f('0x3a')]};return db[_0x756f('0x40')][_0x756f('0x1c')](_0x11a387)['then'](function(_0x37cbe3){_0xf5ad37[_0x756f('0x1c')]=_0x37cbe3;if(_0x533d0a[_0x756f('0x2f')][_0x756f('0x41')]){_0x531eb7[_0x756f('0x42')]=[{'all':!![]}];}return db[_0x756f('0x40')][_0x756f('0x43')](_0x531eb7);})[_0x756f('0x22')](function(_0x47253b){_0xf5ad37[_0x756f('0x44')]=_0x47253b;return _0xf5ad37;})['then'](respondWithFilteredResult(_0x318bd8,_0x531eb7))[_0x756f('0x45')](handleError(_0x318bd8,null));};exports[_0x756f('0x46')]=function(_0x1c8eb6,_0x5ca733){var _0x20fdd9={'raw':!![],'where':{'id':_0x1c8eb6['params']['id']}},_0x2c2438={};_0x2c2438[_0x756f('0x2e')]=_['keys'](db['AnalyticExtractedReport'][_0x756f('0x2c')]);_0x2c2438[_0x756f('0x2f')]=_[_0x756f('0x30')](_0x1c8eb6[_0x756f('0x2f')]);_0x2c2438[_0x756f('0x31')]=_[_0x756f('0x32')](_0x2c2438['model'],_0x2c2438['query']);_0x20fdd9['attributes']=_[_0x756f('0x32')](_0x2c2438[_0x756f('0x2e')],qs[_0x756f('0x33')](_0x1c8eb6[_0x756f('0x2f')][_0x756f('0x33')]));_0x20fdd9[_0x756f('0x34')]=_0x20fdd9[_0x756f('0x34')][_0x756f('0x35')]?_0x20fdd9['attributes']:_0x2c2438[_0x756f('0x2e')];if(_0x1c8eb6['query'][_0x756f('0x41')]){_0x20fdd9[_0x756f('0x42')]=[{'all':!![]}];}_0x20fdd9=_[_0x756f('0x3d')]({},_0x20fdd9,_0x1c8eb6[_0x756f('0x3f')]);return db[_0x756f('0x40')]['find'](_0x20fdd9)['then'](handleEntityNotFound(_0x5ca733,null))[_0x756f('0x22')](respondWithResult(_0x5ca733,null))[_0x756f('0x45')](handleError(_0x5ca733,null));};exports['create']=function(_0x27cfca,_0x55d779){return db['AnalyticExtractedReport']['create'](_0x27cfca[_0x756f('0x47')],{})['then'](function(_0x2bafe7){var _0x5a0951=_0x27cfca[_0x756f('0x48')][_0x756f('0x23')]({'plain':!![]});if(!_0x5a0951)throw new Error(_0x756f('0x49'));if(_0x5a0951[_0x756f('0x4a')]===_0x756f('0x48')){var _0x1bc475=_0x2bafe7[_0x756f('0x23')]({'plain':!![]});var _0x7cd9fe=_0x756f('0x24');return db['UserProfileSection'][_0x756f('0x4b')]({'where':{'name':_0x7cd9fe,'userProfileId':_0x5a0951['userProfileId']},'raw':!![]})[_0x756f('0x22')](function(_0x2ef36b){if(_0x2ef36b&&_0x2ef36b[_0x756f('0x4c')]===0x0){return db[_0x756f('0x25')]['create']({'name':_0x1bc475[_0x756f('0x28')],'resourceId':_0x1bc475['id'],'type':_0x2ef36b[_0x756f('0x28')],'sectionId':_0x2ef36b['id']},{})[_0x756f('0x22')](function(){return _0x2bafe7;});}else{return _0x2bafe7;}})[_0x756f('0x45')](function(_0x27ac30){logger[_0x756f('0x27')](_0x756f('0x4d'),_0x27ac30);throw _0x27ac30;});}return _0x2bafe7;})[_0x756f('0x22')](respondWithResult(_0x55d779,0xc9))['catch'](handleError(_0x55d779,null));};exports['update']=function(_0x4ec44b,_0x121f60){if(_0x4ec44b[_0x756f('0x47')]['id']){delete _0x4ec44b[_0x756f('0x47')]['id'];}return db['AnalyticExtractedReport'][_0x756f('0x4b')]({'where':{'id':_0x4ec44b['params']['id']}})[_0x756f('0x22')](handleEntityNotFound(_0x121f60,null))[_0x756f('0x22')](saveUpdates(_0x4ec44b['body'],null))[_0x756f('0x22')](respondWithResult(_0x121f60,null))['catch'](handleError(_0x121f60,null));};exports[_0x756f('0x26')]=function(_0x5a7441,_0x4b5900){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5a7441['params']['id']}})[_0x756f('0x22')](handleEntityNotFound(_0x4b5900,null))[_0x756f('0x22')](removeEntity(_0x4b5900,null))[_0x756f('0x45')](handleError(_0x4b5900,null));};exports[_0x756f('0x4e')]=function(_0x52276b,_0x5d35a4,_0x41ac0e){return db[_0x756f('0x40')][_0x756f('0x4b')]({'where':{'id':_0x52276b['params']['id']},'attributes':[_0x756f('0x28'),_0x756f('0x4f'),'savename',_0x756f('0x50')],'raw':!![]})[_0x756f('0x22')](handleEntityNotFound(_0x5d35a4,null))[_0x756f('0x22')](function(_0x34cb26){if(_0x34cb26){if(!fs[_0x756f('0x51')](path[_0x756f('0x52')](config[_0x756f('0x53')],_0x756f('0x54'),_0x34cb26[_0x756f('0x55')]))){throw new db['Sequelize'][(_0x756f('0x56'))](_0x756f('0x57'));}if(_0x52276b['query'][_0x756f('0x58')]){return _0x5d35a4['sendStatus'](0xc8);}return _0x5d35a4[_0x756f('0x4e')](path[_0x756f('0x52')](config[_0x756f('0x53')],'server/files/reports',_0x34cb26['savename']),util[_0x756f('0x59')](_0x756f('0x5a'),_0x34cb26[_0x756f('0x4f')]||_0x34cb26[_0x756f('0x28')],_0x34cb26['output']['toLowerCase']()));}})[_0x756f('0x45')](handleError(_0x5d35a4,null));};
\ No newline at end of file
+var _0x890e=['apply','save','destroy','then','get','ExtractedReports','UserProfileResource','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','download','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x890e,0xfe));var _0xe890=function(_0x1fb452,_0x1dfc93){_0x1fb452=_0x1fb452-0x0;var _0x201fb9=_0x890e[_0x1fb452];return _0x201fb9;};'use strict';var emlformat=require(_0xe890('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe890('0x1'));var jsonpatch=require(_0xe890('0x2'));var rp=require('request-promise');var moment=require(_0xe890('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe890('0x4'));var util=require('util');var path=require(_0xe890('0x5'));var sox=require(_0xe890('0x6'));var csv=require('to-csv');var ejs=require(_0xe890('0x7'));var fs=require('fs');var fs_extra=require(_0xe890('0x8'));var _=require(_0xe890('0x9'));var squel=require('squel');var crypto=require(_0xe890('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe890('0xb'));var toCsv=require(_0xe890('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe890('0xd'));var authService=require(_0xe890('0xe'));var qs=require(_0xe890('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe890('0x10'));var logger=require('../../config/logger')(_0xe890('0x11'));var utils=require(_0xe890('0x12'));var config=require(_0xe890('0x13'));var licenseUtil=require(_0xe890('0x14'));var db=require(_0xe890('0x15'))['db'];function respondWithStatusCode(_0x33dfa8,_0x5b70fc){_0x5b70fc=_0x5b70fc||0xcc;return function(_0x25a401){if(_0x25a401){return _0x33dfa8[_0xe890('0x16')](_0x5b70fc);}return _0x33dfa8[_0xe890('0x17')](_0x5b70fc)[_0xe890('0x18')]();};}function respondWithResult(_0x2b00e3,_0x2187e6){_0x2187e6=_0x2187e6||0xc8;return function(_0xa08cd2){if(_0xa08cd2){return _0x2b00e3[_0xe890('0x17')](_0x2187e6)['json'](_0xa08cd2);}};}function respondWithFilteredResult(_0x26ca8b,_0xf33949){return function(_0x4e2054){if(_0x4e2054){var _0x46d654=typeof _0xf33949[_0xe890('0x19')]===_0xe890('0x1a')&&typeof _0xf33949[_0xe890('0x1b')]===_0xe890('0x1a');var _0x101728=_0x4e2054['count'];var _0x2d9d9e=_0x46d654?0x0:_0xf33949[_0xe890('0x19')];var _0x3bd629=_0x46d654?_0x4e2054[_0xe890('0x1c')]:_0xf33949['offset']+_0xf33949[_0xe890('0x1b')];var _0x46d4a6;if(_0x3bd629>=_0x101728){_0x3bd629=_0x101728;_0x46d4a6=0xc8;}else{_0x46d4a6=0xce;}_0x26ca8b[_0xe890('0x17')](_0x46d4a6);return _0x26ca8b[_0xe890('0x1d')](_0xe890('0x1e'),_0x2d9d9e+'-'+_0x3bd629+'/'+_0x101728)['json'](_0x4e2054);}return null;};}function patchUpdates(_0x23781f){return function(_0x599636){try{jsonpatch[_0xe890('0x1f')](_0x599636,_0x23781f,!![]);}catch(_0x35dc2a){return BPromise['reject'](_0x35dc2a);}return _0x599636[_0xe890('0x20')]();};}function saveUpdates(_0x15ff51,_0x435de2){return function(_0x52a46c){if(_0x52a46c){return _0x52a46c['update'](_0x15ff51)['then'](function(_0x581a3d){return _0x581a3d;});}return null;};}function removeEntity(_0x431a97,_0xc3a0bd){return function(_0x5f47a1){if(_0x5f47a1){return _0x5f47a1[_0xe890('0x21')]()[_0xe890('0x22')](function(){var _0x53d419=_0x5f47a1[_0xe890('0x23')]({'plain':!![]});var _0x41eb61=_0xe890('0x24');return db[_0xe890('0x25')][_0xe890('0x21')]({'where':{'type':_0x41eb61,'resourceId':_0x53d419['id']}})[_0xe890('0x22')](function(){return _0x5f47a1;});})[_0xe890('0x22')](function(){_0x431a97[_0xe890('0x17')](0xcc)[_0xe890('0x18')]();});}};}function handleEntityNotFound(_0x557b71,_0x437f5e){return function(_0x4de19b){if(!_0x4de19b){_0x557b71['sendStatus'](0x194);}return _0x4de19b;};}function handleError(_0x37a613,_0x2de0e3){_0x2de0e3=_0x2de0e3||0x1f4;return function(_0x3c3302){logger[_0xe890('0x26')](_0x3c3302[_0xe890('0x27')]);if(_0x3c3302[_0xe890('0x28')]){delete _0x3c3302[_0xe890('0x28')];}_0x37a613[_0xe890('0x17')](_0x2de0e3)['send'](_0x3c3302);};}exports[_0xe890('0x29')]=function(_0x11d222,_0x2a24b9){var _0x48fd91={},_0x365278={},_0x5f0c0c={'count':0x0,'rows':[]};var _0xdf4611=_[_0xe890('0x2a')](db[_0xe890('0x2b')]['rawAttributes'],function(_0x414783){return{'name':_0x414783[_0xe890('0x2c')],'type':_0x414783[_0xe890('0x2d')]['key']};});_0x365278[_0xe890('0x2e')]=_[_0xe890('0x2a')](_0xdf4611,_0xe890('0x28'));_0x365278['query']=_[_0xe890('0x2f')](_0x11d222[_0xe890('0x30')]);_0x365278['filters']=_[_0xe890('0x31')](_0x365278[_0xe890('0x2e')],_0x365278[_0xe890('0x30')]);_0x48fd91[_0xe890('0x32')]=_[_0xe890('0x31')](_0x365278['model'],qs[_0xe890('0x33')](_0x11d222['query'][_0xe890('0x33')]));_0x48fd91['attributes']=_0x48fd91[_0xe890('0x32')][_0xe890('0x34')]?_0x48fd91[_0xe890('0x32')]:_0x365278[_0xe890('0x2e')];if(!_0x11d222[_0xe890('0x30')][_0xe890('0x35')](_0xe890('0x36'))){_0x48fd91[_0xe890('0x1b')]=qs['limit'](_0x11d222[_0xe890('0x30')][_0xe890('0x1b')]);_0x48fd91['offset']=qs['offset'](_0x11d222[_0xe890('0x30')][_0xe890('0x19')]);}_0x48fd91[_0xe890('0x37')]=qs['sort'](_0x11d222[_0xe890('0x30')][_0xe890('0x38')]);_0x48fd91[_0xe890('0x39')]=qs[_0xe890('0x3a')](_['pick'](_0x11d222['query'],_0x365278['filters']),_0xdf4611);if(_0x11d222[_0xe890('0x30')][_0xe890('0x3b')]){_0x48fd91[_0xe890('0x39')]=_[_0xe890('0x3c')](_0x48fd91['where'],{'$or':_[_0xe890('0x2a')](_0xdf4611,function(_0x4d51cc){if(_0x4d51cc[_0xe890('0x2d')]!==_0xe890('0x3d')){var _0x2316e9={};_0x2316e9[_0x4d51cc[_0xe890('0x28')]]={'$like':'%'+_0x11d222['query'][_0xe890('0x3b')]+'%'};return _0x2316e9;}})});}_0x48fd91=_[_0xe890('0x3c')]({},_0x48fd91,_0x11d222[_0xe890('0x3e')]);var _0x2093dc={'where':_0x48fd91[_0xe890('0x39')]};return db[_0xe890('0x2b')][_0xe890('0x1c')](_0x2093dc)[_0xe890('0x22')](function(_0x1cea1c){_0x5f0c0c['count']=_0x1cea1c;if(_0x11d222[_0xe890('0x30')][_0xe890('0x3f')]){_0x48fd91[_0xe890('0x40')]=[{'all':!![]}];}return db[_0xe890('0x2b')][_0xe890('0x41')](_0x48fd91);})[_0xe890('0x22')](function(_0x5171d1){_0x5f0c0c[_0xe890('0x42')]=_0x5171d1;return _0x5f0c0c;})[_0xe890('0x22')](respondWithFilteredResult(_0x2a24b9,_0x48fd91))[_0xe890('0x43')](handleError(_0x2a24b9,null));};exports[_0xe890('0x44')]=function(_0x19ede4,_0x77b46e){var _0x13d8ff={'raw':!![],'where':{'id':_0x19ede4[_0xe890('0x45')]['id']}},_0x37be7e={};_0x37be7e[_0xe890('0x2e')]=_[_0xe890('0x2f')](db[_0xe890('0x2b')]['rawAttributes']);_0x37be7e[_0xe890('0x30')]=_[_0xe890('0x2f')](_0x19ede4[_0xe890('0x30')]);_0x37be7e[_0xe890('0x3a')]=_[_0xe890('0x31')](_0x37be7e[_0xe890('0x2e')],_0x37be7e[_0xe890('0x30')]);_0x13d8ff[_0xe890('0x32')]=_['intersection'](_0x37be7e[_0xe890('0x2e')],qs[_0xe890('0x33')](_0x19ede4[_0xe890('0x30')][_0xe890('0x33')]));_0x13d8ff[_0xe890('0x32')]=_0x13d8ff['attributes'][_0xe890('0x34')]?_0x13d8ff[_0xe890('0x32')]:_0x37be7e[_0xe890('0x2e')];if(_0x19ede4[_0xe890('0x30')]['includeAll']){_0x13d8ff['include']=[{'all':!![]}];}_0x13d8ff=_['merge']({},_0x13d8ff,_0x19ede4[_0xe890('0x3e')]);return db[_0xe890('0x2b')]['find'](_0x13d8ff)[_0xe890('0x22')](handleEntityNotFound(_0x77b46e,null))[_0xe890('0x22')](respondWithResult(_0x77b46e,null))['catch'](handleError(_0x77b46e,null));};exports[_0xe890('0x46')]=function(_0x51d638,_0x10b855){return db[_0xe890('0x2b')][_0xe890('0x46')](_0x51d638['body'],{})[_0xe890('0x22')](function(_0x689366){var _0x329b77=_0x51d638[_0xe890('0x47')]['get']({'plain':!![]});if(!_0x329b77)throw new Error(_0xe890('0x48'));if(_0x329b77[_0xe890('0x49')]===_0xe890('0x47')){var _0x5dfa6c=_0x689366[_0xe890('0x23')]({'plain':!![]});var _0x4a43c6=_0xe890('0x24');return db[_0xe890('0x4a')]['find']({'where':{'name':_0x4a43c6,'userProfileId':_0x329b77['userProfileId']},'raw':!![]})[_0xe890('0x22')](function(_0x1bb682){if(_0x1bb682&&_0x1bb682[_0xe890('0x4b')]===0x0){return db[_0xe890('0x25')][_0xe890('0x46')]({'name':_0x5dfa6c['name'],'resourceId':_0x5dfa6c['id'],'type':_0x1bb682[_0xe890('0x28')],'sectionId':_0x1bb682['id']},{})[_0xe890('0x22')](function(){return _0x689366;});}else{return _0x689366;}})['catch'](function(_0x2faaf7){logger[_0xe890('0x26')](_0xe890('0x4c'),_0x2faaf7);throw _0x2faaf7;});}return _0x689366;})[_0xe890('0x22')](respondWithResult(_0x10b855,0xc9))[_0xe890('0x43')](handleError(_0x10b855,null));};exports[_0xe890('0x4d')]=function(_0x1aade2,_0xb86731){if(_0x1aade2[_0xe890('0x4e')]['id']){delete _0x1aade2[_0xe890('0x4e')]['id'];}return db[_0xe890('0x2b')][_0xe890('0x4f')]({'where':{'id':_0x1aade2[_0xe890('0x45')]['id']}})[_0xe890('0x22')](handleEntityNotFound(_0xb86731,null))['then'](saveUpdates(_0x1aade2[_0xe890('0x4e')],null))[_0xe890('0x22')](respondWithResult(_0xb86731,null))[_0xe890('0x43')](handleError(_0xb86731,null));};exports[_0xe890('0x21')]=function(_0x2a9e4b,_0x4e9e52){return db[_0xe890('0x2b')][_0xe890('0x4f')]({'where':{'id':_0x2a9e4b[_0xe890('0x45')]['id']}})[_0xe890('0x22')](handleEntityNotFound(_0x4e9e52,null))[_0xe890('0x22')](removeEntity(_0x4e9e52,null))[_0xe890('0x43')](handleError(_0x4e9e52,null));};exports[_0xe890('0x50')]=function(_0x43e708,_0x2571ed,_0x17ffcc){return db[_0xe890('0x2b')][_0xe890('0x4f')]({'where':{'id':_0x43e708['params']['id']},'attributes':[_0xe890('0x28'),_0xe890('0x51'),_0xe890('0x52'),'output'],'raw':!![]})[_0xe890('0x22')](handleEntityNotFound(_0x2571ed,null))[_0xe890('0x22')](function(_0xd04d8c){if(_0xd04d8c){if(!fs[_0xe890('0x53')](path[_0xe890('0x54')](config[_0xe890('0x55')],_0xe890('0x56'),_0xd04d8c[_0xe890('0x52')]))){throw new db[(_0xe890('0x57'))][(_0xe890('0x58'))](_0xe890('0x59'));}if(_0x43e708[_0xe890('0x30')][_0xe890('0x5a')]){return _0x2571ed[_0xe890('0x16')](0xc8);}return _0x2571ed['download'](path[_0xe890('0x54')](config[_0xe890('0x55')],_0xe890('0x56'),_0xd04d8c[_0xe890('0x52')]),util[_0xe890('0x5b')](_0xe890('0x5c'),_0xd04d8c['basename']||_0xd04d8c[_0xe890('0x28')],_0xd04d8c[_0xe890('0x5d')][_0xe890('0x5e')]()));}})['catch'](handleError(_0x2571ed,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index e1882b3..fce57fc 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2920=['define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x5e0f1d,_0x5e7e6a){var _0xb801aa=function(_0x2f8cfc){while(--_0x2f8cfc){_0x5e0f1d['push'](_0x5e0f1d['shift']());}};_0xb801aa(++_0x5e7e6a);}(_0x2920,0x12e));var _0x0292=function(_0x34fda6,_0xb63d1e){_0x34fda6=_0x34fda6-0x0;var _0x119320=_0x2920[_0x34fda6];return _0x119320;};'use strict';var _=require(_0x0292('0x0'));var util=require(_0x0292('0x1'));var logger=require(_0x0292('0x2'))(_0x0292('0x3'));var moment=require(_0x0292('0x4'));var BPromise=require('bluebird');var rp=require(_0x0292('0x5'));var fs=require('fs');var path=require(_0x0292('0x6'));var rimraf=require('rimraf');var config=require(_0x0292('0x7'));var attributes=require(_0x0292('0x8'));module[_0x0292('0x9')]=function(_0x18295b,_0x39c3d9){return _0x18295b[_0x0292('0xa')](_0x0292('0xb'),attributes,{'tableName':_0x0292('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3dec=['path','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x358017,_0x2d7184){var _0x4ca484=function(_0x5a853e){while(--_0x5a853e){_0x358017['push'](_0x358017['shift']());}};_0x4ca484(++_0x2d7184);}(_0x3dec,0xaf));var _0xc3de=function(_0x199b1f,_0x4ed849){_0x199b1f=_0x199b1f-0x0;var _0x267ac9=_0x3dec[_0x199b1f];return _0x267ac9;};'use strict';var _=require(_0xc3de('0x0'));var util=require(_0xc3de('0x1'));var logger=require(_0xc3de('0x2'))(_0xc3de('0x3'));var moment=require(_0xc3de('0x4'));var BPromise=require(_0xc3de('0x5'));var rp=require(_0xc3de('0x6'));var fs=require('fs');var path=require(_0xc3de('0x7'));var rimraf=require('rimraf');var config=require(_0xc3de('0x8'));var attributes=require('./analyticExtractedReport.attributes');module[_0xc3de('0x9')]=function(_0x58ef1e,_0x3f14ef){return _0x58ef1e[_0xc3de('0xa')](_0xc3de('0xb'),attributes,{'tableName':_0xc3de('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index 4d87b48..1f5c9d4 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6bfa=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash'];(function(_0x14d513,_0x9f84a6){var _0x160f64=function(_0x27a899){while(--_0x27a899){_0x14d513['push'](_0x14d513['shift']());}};_0x160f64(++_0x9f84a6);}(_0x6bfa,0x175));var _0xa6bf=function(_0x4b0342,_0x5b071c){_0x4b0342=_0x4b0342-0x0;var _0xc62aa3=_0x6bfa[_0x4b0342];return _0xc62aa3;};'use strict';var _=require(_0xa6bf('0x0'));var util=require(_0xa6bf('0x1'));var moment=require(_0xa6bf('0x2'));var BPromise=require(_0xa6bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6bf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6bf('0x5'));var logger=require(_0xa6bf('0x6'))(_0xa6bf('0x7'));var config=require(_0xa6bf('0x8'));var jayson=require(_0xa6bf('0x9'));var client=jayson['client'][_0xa6bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x226fc1,_0x4eca6b,_0x41cc80){return new BPromise(function(_0x13ce3d,_0x5eb307){return client['request'](_0x226fc1,_0x41cc80)[_0xa6bf('0xb')](function(_0x5c08d0){logger['info'](_0xa6bf('0xc'),_0x4eca6b,_0xa6bf('0xd'));logger[_0xa6bf('0xe')](_0xa6bf('0xf'),_0x4eca6b,_0xa6bf('0xd'),JSON[_0xa6bf('0x10')](_0x5c08d0));if(_0x5c08d0[_0xa6bf('0x11')]){if(_0x5c08d0[_0xa6bf('0x11')]['code']===0x1f4){logger[_0xa6bf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4eca6b,_0x5c08d0[_0xa6bf('0x11')][_0xa6bf('0x12')]);return _0x5eb307(_0x5c08d0[_0xa6bf('0x11')]['message']);}logger[_0xa6bf('0x11')](_0xa6bf('0xc'),_0x4eca6b,_0x5c08d0['error']['message']);return _0x13ce3d(_0x5c08d0[_0xa6bf('0x11')][_0xa6bf('0x12')]);}else{logger[_0xa6bf('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4eca6b,'request\x20sent');_0x13ce3d(_0x5c08d0[_0xa6bf('0x14')][_0xa6bf('0x12')]);}})[_0xa6bf('0x15')](function(_0x33f45d){logger[_0xa6bf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4eca6b,_0x33f45d);_0x5eb307(_0x33f45d);});});}
\ No newline at end of file
+var _0x98d2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2cbc82,_0x30d15a){var _0x222f31=function(_0x51bc14){while(--_0x51bc14){_0x2cbc82['push'](_0x2cbc82['shift']());}};_0x222f31(++_0x30d15a);}(_0x98d2,0xb3));var _0x298d=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x98d2[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x298d('0x0'));var util=require(_0x298d('0x1'));var moment=require(_0x298d('0x2'));var BPromise=require(_0x298d('0x3'));var rs=require(_0x298d('0x4'));var fs=require('fs');var Redis=require(_0x298d('0x5'));var db=require(_0x298d('0x6'))['db'];var utils=require(_0x298d('0x7'));var logger=require(_0x298d('0x8'))('rpc');var config=require(_0x298d('0x9'));var jayson=require(_0x298d('0xa'));var client=jayson['client'][_0x298d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27720a,_0x94eb90,_0x49cff2){return new BPromise(function(_0x2e00cd,_0x4bc06c){return client['request'](_0x27720a,_0x49cff2)[_0x298d('0xc')](function(_0x47f0c9){logger[_0x298d('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x94eb90,_0x298d('0xe'));logger[_0x298d('0xf')](_0x298d('0x10'),_0x94eb90,_0x298d('0xe'),JSON[_0x298d('0x11')](_0x47f0c9));if(_0x47f0c9[_0x298d('0x12')]){if(_0x47f0c9[_0x298d('0x12')][_0x298d('0x13')]===0x1f4){logger[_0x298d('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x94eb90,_0x47f0c9[_0x298d('0x12')]['message']);return _0x4bc06c(_0x47f0c9['error'][_0x298d('0x14')]);}logger[_0x298d('0x12')](_0x298d('0x15'),_0x94eb90,_0x47f0c9[_0x298d('0x12')][_0x298d('0x14')]);return _0x2e00cd(_0x47f0c9[_0x298d('0x12')]['message']);}else{logger['info'](_0x298d('0x15'),_0x94eb90,'request\x20sent');_0x2e00cd(_0x47f0c9['result'][_0x298d('0x14')]);}})[_0x298d('0x16')](function(_0x52fb00){logger[_0x298d('0x12')](_0x298d('0x15'),_0x94eb90,_0x52fb00);_0x4bc06c(_0x52fb00);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 68c3389..2ba2d5f 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xec07=['isAuthenticated','show','/:id/download','post','create','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','index','get','/:id'];(function(_0x18bf17,_0x32626e){var _0x7c4e02=function(_0x4afbbe){while(--_0x4afbbe){_0x18bf17['push'](_0x18bf17['shift']());}};_0x7c4e02(++_0x32626e);}(_0xec07,0xfa));var _0x7ec0=function(_0x5431f0,_0x35b145){_0x5431f0=_0x5431f0-0x0;var _0x16b8b2=_0xec07[_0x5431f0];return _0x16b8b2;};'use strict';var multer=require(_0x7ec0('0x0'));var util=require('util');var path=require(_0x7ec0('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ec0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7ec0('0x3'));var interaction=require(_0x7ec0('0x4'));var config=require(_0x7ec0('0x5'));var controller=require(_0x7ec0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7ec0('0x7')]);router[_0x7ec0('0x8')](_0x7ec0('0x9'),auth[_0x7ec0('0xa')](),controller[_0x7ec0('0xb')]);router['get'](_0x7ec0('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x7ec0('0xd')]('/',auth[_0x7ec0('0xa')](),controller[_0x7ec0('0xe')]);router[_0x7ec0('0xf')](_0x7ec0('0x9'),auth[_0x7ec0('0xa')](),controller[_0x7ec0('0x10')]);router[_0x7ec0('0x11')]('/:id',auth[_0x7ec0('0xa')](),controller[_0x7ec0('0x12')]);module[_0x7ec0('0x13')]=router;
\ No newline at end of file
+var _0xdd06=['path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get','/:id','show','download','post','create','put','update','delete'];(function(_0x5749eb,_0x2e8fa7){var _0x429528=function(_0x59e5e5){while(--_0x59e5e5){_0x5749eb['push'](_0x5749eb['shift']());}};_0x429528(++_0x2e8fa7);}(_0xdd06,0x80));var _0x6dd0=function(_0x338b4c,_0x48f49e){_0x338b4c=_0x338b4c-0x0;var _0x3442f8=_0xdd06[_0x338b4c];return _0x3442f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6dd0('0x0'));var timeout=require('connect-timeout');var express=require(_0x6dd0('0x1'));var router=express['Router']();var fs_extra=require(_0x6dd0('0x2'));var auth=require(_0x6dd0('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6dd0('0x4'));var controller=require(_0x6dd0('0x5'));router['get']('/',auth[_0x6dd0('0x6')](),controller['index']);router[_0x6dd0('0x7')](_0x6dd0('0x8'),auth['isAuthenticated'](),controller[_0x6dd0('0x9')]);router[_0x6dd0('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x6dd0('0xa')]);router[_0x6dd0('0xb')]('/',auth[_0x6dd0('0x6')](),controller[_0x6dd0('0xc')]);router[_0x6dd0('0xd')]('/:id',auth[_0x6dd0('0x6')](),controller[_0x6dd0('0xe')]);router[_0x6dd0('0xf')](_0x6dd0('0x8'),auth[_0x6dd0('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 4b2ccf3..2c35a42 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x45bd=['BOOLEAN','TEXT','STRING'];(function(_0x17479b,_0x4483f6){var _0x162432=function(_0x4f890e){while(--_0x4f890e){_0x17479b['push'](_0x17479b['shift']());}};_0x162432(++_0x4483f6);}(_0x45bd,0x199));var _0xd45b=function(_0x404475,_0x25aa04){_0x404475=_0x404475-0x0;var _0x728609=_0x45bd[_0x404475];return _0x728609;};'use strict';var Sequelize=require('sequelize');module['exports']={'field':{'type':Sequelize[_0xd45b('0x0')]},'alias':{'type':Sequelize[_0xd45b('0x1')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xd45b('0x1')]},'groupBy':{'type':Sequelize[_0xd45b('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb093=['BOOLEAN','exports','TEXT','STRING'];(function(_0xa74a76,_0x526cd0){var _0x4da7b6=function(_0x1e103d){while(--_0x1e103d){_0xa74a76['push'](_0xa74a76['shift']());}};_0x4da7b6(++_0x526cd0);}(_0xb093,0xe9));var _0x3b09=function(_0x12a833,_0x587a49){_0x12a833=_0x12a833-0x0;var _0x55ba34=_0xb093[_0x12a833];return _0x55ba34;};'use strict';var Sequelize=require('sequelize');module[_0x3b09('0x0')]={'field':{'type':Sequelize[_0x3b09('0x1')]},'alias':{'type':Sequelize[_0x3b09('0x2')]},'function':{'type':Sequelize[_0x3b09('0x2')]},'format':{'type':Sequelize[_0x3b09('0x2')]},'groupBy':{'type':Sequelize[_0x3b09('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3b09('0x2')]},'custom':{'type':Sequelize[_0x3b09('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index c602806..a782be8 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa30b=['params','rawAttributes','intersection','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','send','index','map','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','AnalyticFieldReport','include','findAll','catch','show'];(function(_0x30b34a,_0x50fcfe){var _0x1277e0=function(_0x134f73){while(--_0x134f73){_0x30b34a['push'](_0x30b34a['shift']());}};_0x1277e0(++_0x50fcfe);}(_0xa30b,0x1a3));var _0xba30=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa30b[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xba30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba30('0x1'));var jsonpatch=require(_0xba30('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xba30('0x3'));var Mustache=require(_0xba30('0x4'));var util=require(_0xba30('0x5'));var path=require(_0xba30('0x6'));var sox=require(_0xba30('0x7'));var csv=require(_0xba30('0x8'));var ejs=require(_0xba30('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba30('0xa'));var squel=require(_0xba30('0xb'));var crypto=require(_0xba30('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba30('0x8'));var querystring=require('querystring');var Papa=require(_0xba30('0xd'));var Redis=require('ioredis');var authService=require(_0xba30('0xe'));var qs=require(_0xba30('0xf'));var as=require(_0xba30('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba30('0x11'))(_0xba30('0x12'));var utils=require(_0xba30('0x13'));var config=require(_0xba30('0x14'));var licenseUtil=require(_0xba30('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x138ffe,_0x41a734){_0x41a734=_0x41a734||0xcc;return function(_0x44ee0e){if(_0x44ee0e){return _0x138ffe[_0xba30('0x16')](_0x41a734);}return _0x138ffe[_0xba30('0x17')](_0x41a734)['end']();};}function respondWithResult(_0x5994be,_0x502ea2){_0x502ea2=_0x502ea2||0xc8;return function(_0x5bfbc1){if(_0x5bfbc1){return _0x5994be[_0xba30('0x17')](_0x502ea2)[_0xba30('0x18')](_0x5bfbc1);}};}function respondWithFilteredResult(_0xda524e,_0x369ef2){return function(_0x29aa2c){if(_0x29aa2c){var _0x1cddd1=typeof _0x369ef2[_0xba30('0x19')]===_0xba30('0x1a')&&typeof _0x369ef2['limit']===_0xba30('0x1a');var _0x3e06fe=_0x29aa2c['count'];var _0x412036=_0x1cddd1?0x0:_0x369ef2[_0xba30('0x19')];var _0x57ce1f=_0x1cddd1?_0x29aa2c[_0xba30('0x1b')]:_0x369ef2['offset']+_0x369ef2[_0xba30('0x1c')];var _0x457c42;if(_0x57ce1f>=_0x3e06fe){_0x57ce1f=_0x3e06fe;_0x457c42=0xc8;}else{_0x457c42=0xce;}_0xda524e[_0xba30('0x17')](_0x457c42);return _0xda524e[_0xba30('0x1d')](_0xba30('0x1e'),_0x412036+'-'+_0x57ce1f+'/'+_0x3e06fe)[_0xba30('0x18')](_0x29aa2c);}return null;};}function patchUpdates(_0x3dde44){return function(_0x1563ab){try{jsonpatch[_0xba30('0x1f')](_0x1563ab,_0x3dde44,!![]);}catch(_0x421dc8){return BPromise[_0xba30('0x20')](_0x421dc8);}return _0x1563ab[_0xba30('0x21')]();};}function saveUpdates(_0x43c563,_0x68b6de){return function(_0x4cb6f9){if(_0x4cb6f9){return _0x4cb6f9[_0xba30('0x22')](_0x43c563)[_0xba30('0x23')](function(_0x514b5e){return _0x514b5e;});}return null;};}function removeEntity(_0x16dd47,_0x318513){return function(_0x3ecfe2){if(_0x3ecfe2){return _0x3ecfe2[_0xba30('0x24')]()['then'](function(){_0x16dd47['status'](0xcc)[_0xba30('0x25')]();});}};}function handleEntityNotFound(_0x5adeca,_0x269e18){return function(_0xc140ff){if(!_0xc140ff){_0x5adeca[_0xba30('0x16')](0x194);}return _0xc140ff;};}function handleError(_0x55304f,_0x1d84d9){_0x1d84d9=_0x1d84d9||0x1f4;return function(_0x319305){logger[_0xba30('0x26')](_0x319305[_0xba30('0x27')]);if(_0x319305['name']){delete _0x319305['name'];}_0x55304f[_0xba30('0x17')](_0x1d84d9)[_0xba30('0x28')](_0x319305);};}exports[_0xba30('0x29')]=function(_0x53235a,_0x23f2e6){var _0x31e181={},_0x5d31e9={},_0x46c668={'count':0x0,'rows':[]};var _0x357306=_[_0xba30('0x2a')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2a150b){return{'name':_0x2a150b[_0xba30('0x2b')],'type':_0x2a150b[_0xba30('0x2c')][_0xba30('0x2d')]};});_0x5d31e9[_0xba30('0x2e')]=_[_0xba30('0x2a')](_0x357306,'name');_0x5d31e9['query']=_[_0xba30('0x2f')](_0x53235a[_0xba30('0x30')]);_0x5d31e9[_0xba30('0x31')]=_['intersection'](_0x5d31e9[_0xba30('0x2e')],_0x5d31e9['query']);_0x31e181[_0xba30('0x32')]=_['intersection'](_0x5d31e9['model'],qs[_0xba30('0x33')](_0x53235a[_0xba30('0x30')][_0xba30('0x33')]));_0x31e181[_0xba30('0x32')]=_0x31e181[_0xba30('0x32')][_0xba30('0x34')]?_0x31e181[_0xba30('0x32')]:_0x5d31e9[_0xba30('0x2e')];if(!_0x53235a['query'][_0xba30('0x35')]('nolimit')){_0x31e181[_0xba30('0x1c')]=qs[_0xba30('0x1c')](_0x53235a[_0xba30('0x30')][_0xba30('0x1c')]);_0x31e181[_0xba30('0x19')]=qs['offset'](_0x53235a[_0xba30('0x30')][_0xba30('0x19')]);}_0x31e181[_0xba30('0x36')]=qs[_0xba30('0x37')](_0x53235a[_0xba30('0x30')][_0xba30('0x37')]);_0x31e181[_0xba30('0x38')]=qs['filters'](_[_0xba30('0x39')](_0x53235a[_0xba30('0x30')],_0x5d31e9[_0xba30('0x31')]),_0x357306);if(_0x53235a[_0xba30('0x30')][_0xba30('0x3a')]){_0x31e181[_0xba30('0x38')]=_[_0xba30('0x3b')](_0x31e181[_0xba30('0x38')],{'$or':_['map'](_0x357306,function(_0x1d36a8){if(_0x1d36a8[_0xba30('0x2c')]!==_0xba30('0x3c')){var _0x3a03f2={};_0x3a03f2[_0x1d36a8[_0xba30('0x3d')]]={'$like':'%'+_0x53235a['query'][_0xba30('0x3a')]+'%'};return _0x3a03f2;}})});}_0x31e181=_[_0xba30('0x3b')]({},_0x31e181,_0x53235a['options']);var _0x24fc5d={'where':_0x31e181[_0xba30('0x38')]};return db[_0xba30('0x3e')][_0xba30('0x1b')](_0x24fc5d)[_0xba30('0x23')](function(_0x387777){_0x46c668[_0xba30('0x1b')]=_0x387777;if(_0x53235a[_0xba30('0x30')]['includeAll']){_0x31e181[_0xba30('0x3f')]=[{'all':!![]}];}return db[_0xba30('0x3e')][_0xba30('0x40')](_0x31e181);})[_0xba30('0x23')](function(_0x19f5bb){_0x46c668['rows']=_0x19f5bb;return _0x46c668;})['then'](respondWithFilteredResult(_0x23f2e6,_0x31e181))[_0xba30('0x41')](handleError(_0x23f2e6,null));};exports[_0xba30('0x42')]=function(_0x32f61e,_0x183fa2){var _0xc633f5={'raw':![],'where':{'id':_0x32f61e[_0xba30('0x43')]['id']}},_0x5dcf83={};_0x5dcf83[_0xba30('0x2e')]=_['keys'](db[_0xba30('0x3e')][_0xba30('0x44')]);_0x5dcf83[_0xba30('0x30')]=_[_0xba30('0x2f')](_0x32f61e[_0xba30('0x30')]);_0x5dcf83[_0xba30('0x31')]=_[_0xba30('0x45')](_0x5dcf83[_0xba30('0x2e')],_0x5dcf83[_0xba30('0x30')]);_0xc633f5[_0xba30('0x32')]=_[_0xba30('0x45')](_0x5dcf83[_0xba30('0x2e')],qs['fields'](_0x32f61e[_0xba30('0x30')][_0xba30('0x33')]));_0xc633f5[_0xba30('0x32')]=_0xc633f5['attributes'][_0xba30('0x34')]?_0xc633f5['attributes']:_0x5dcf83[_0xba30('0x2e')];if(_0x32f61e['query'][_0xba30('0x46')]){_0xc633f5[_0xba30('0x3f')]=[{'all':!![]}];}_0xc633f5=_[_0xba30('0x3b')]({},_0xc633f5,_0x32f61e['options']);return db[_0xba30('0x3e')][_0xba30('0x47')](_0xc633f5)['then'](handleEntityNotFound(_0x183fa2,null))[_0xba30('0x23')](respondWithResult(_0x183fa2,null))['catch'](handleError(_0x183fa2,null));};exports[_0xba30('0x48')]=function(_0x22de4,_0x521bf4){return db[_0xba30('0x3e')][_0xba30('0x48')](_0x22de4[_0xba30('0x49')],{})[_0xba30('0x23')](respondWithResult(_0x521bf4,0xc9))['catch'](handleError(_0x521bf4,null));};exports[_0xba30('0x4a')]=function(_0x535787,_0x2393e5){return db['AnalyticFieldReport'][_0xba30('0x4a')](_0x535787['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2393e5,0xc9))[_0xba30('0x41')](handleError(_0x2393e5,null));};exports[_0xba30('0x22')]=function(_0x3e7cf1,_0x582f57){if(_0x3e7cf1[_0xba30('0x49')]['id']){delete _0x3e7cf1['body']['id'];}return db['AnalyticFieldReport'][_0xba30('0x47')]({'where':{'id':_0x3e7cf1[_0xba30('0x43')]['id']}})[_0xba30('0x23')](handleEntityNotFound(_0x582f57,null))[_0xba30('0x23')](saveUpdates(_0x3e7cf1[_0xba30('0x49')],null))['then'](respondWithResult(_0x582f57,null))[_0xba30('0x41')](handleError(_0x582f57,null));};exports[_0xba30('0x24')]=function(_0x3d6539,_0x5d38a3){return db[_0xba30('0x3e')][_0xba30('0x47')]({'where':{'id':_0x3d6539[_0xba30('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d38a3,null))[_0xba30('0x23')](removeEntity(_0x5d38a3,null))[_0xba30('0x41')](handleError(_0x5d38a3,null));};exports[_0xba30('0x4b')]=function(_0x3d6d5b,_0x5d64ae){return db[_0xba30('0x3e')]['destroy']({'where':{'id':_0x3d6d5b[_0xba30('0x30')][_0xba30('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5d64ae,0xcc))['catch'](handleError(_0x5d64ae,null));};exports[_0xba30('0x4d')]=function(_0x1298d4,_0xba744b,_0x2d2bdc){return db[_0xba30('0x4e')]['findOne']({'where':{'id':_0x1298d4[_0xba30('0x43')]['id']}})[_0xba30('0x23')](handleEntityNotFound(_0xba744b,null))[_0xba30('0x23')](function(_0x2f853c){if(_0x2f853c){return db[_0xba30('0x4f')][_0xba30('0x50')](function(_0x5a3a08){return db[_0xba30('0x3e')][_0xba30('0x24')]({'where':{'CustomReportId':_0x1298d4['params']['id']},'transaction':_0x5a3a08})[_0xba30('0x23')](function(_0x3df829){var _0x4ac278=_[_0xba30('0x2a')](_0x1298d4[_0xba30('0x49')],function(_0x3b491d){delete _0x3b491d['id'];_0x3b491d['CustomReportId']=_0x1298d4[_0xba30('0x43')]['id'];return _0x3b491d;});return db[_0xba30('0x3e')][_0xba30('0x4a')](_0x4ac278,{'transaction':_0x5a3a08});});})['then'](function(){return db[_0xba30('0x3e')]['findAll']({'where':{'CustomReportId':_0x1298d4[_0xba30('0x43')]['id']}});});}})['then'](respondWithResult(_0xba744b,null))['catch'](handleError(_0xba744b,null));};
\ No newline at end of file
+var _0x831c=['AnalyticFieldReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','bulkCreate','destroy','ids','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','map'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x831c,0x1b8));var _0xc831=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x831c[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require(_0xc831('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc831('0x1'));var jsonpatch=require(_0xc831('0x2'));var rp=require(_0xc831('0x3'));var moment=require(_0xc831('0x4'));var BPromise=require(_0xc831('0x5'));var Mustache=require(_0xc831('0x6'));var util=require(_0xc831('0x7'));var path=require(_0xc831('0x8'));var sox=require('sox');var csv=require(_0xc831('0x9'));var ejs=require(_0xc831('0xa'));var fs=require('fs');var fs_extra=require(_0xc831('0xb'));var _=require(_0xc831('0xc'));var squel=require(_0xc831('0xd'));var crypto=require(_0xc831('0xe'));var jsforce=require(_0xc831('0xf'));var deskjs=require(_0xc831('0x10'));var toCsv=require(_0xc831('0x9'));var querystring=require('querystring');var Papa=require(_0xc831('0x11'));var Redis=require(_0xc831('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc831('0x13'));var as=require(_0xc831('0x14'));var hardwareService=require(_0xc831('0x15'));var logger=require(_0xc831('0x16'))(_0xc831('0x17'));var utils=require(_0xc831('0x18'));var config=require(_0xc831('0x19'));var licenseUtil=require(_0xc831('0x1a'));var db=require(_0xc831('0x1b'))['db'];function respondWithStatusCode(_0x15fa2f,_0x400374){_0x400374=_0x400374||0xcc;return function(_0x38e772){if(_0x38e772){return _0x15fa2f[_0xc831('0x1c')](_0x400374);}return _0x15fa2f[_0xc831('0x1d')](_0x400374)[_0xc831('0x1e')]();};}function respondWithResult(_0x3abe4a,_0x2c1665){_0x2c1665=_0x2c1665||0xc8;return function(_0x2b0eda){if(_0x2b0eda){return _0x3abe4a[_0xc831('0x1d')](_0x2c1665)['json'](_0x2b0eda);}};}function respondWithFilteredResult(_0x2d096a,_0x16c574){return function(_0x297883){if(_0x297883){var _0x45f1c0=typeof _0x16c574[_0xc831('0x1f')]===_0xc831('0x20')&&typeof _0x16c574[_0xc831('0x21')]===_0xc831('0x20');var _0x1aaf6e=_0x297883[_0xc831('0x22')];var _0x2e6add=_0x45f1c0?0x0:_0x16c574[_0xc831('0x1f')];var _0x3ef63e=_0x45f1c0?_0x297883[_0xc831('0x22')]:_0x16c574['offset']+_0x16c574['limit'];var _0x7172c8;if(_0x3ef63e>=_0x1aaf6e){_0x3ef63e=_0x1aaf6e;_0x7172c8=0xc8;}else{_0x7172c8=0xce;}_0x2d096a[_0xc831('0x1d')](_0x7172c8);return _0x2d096a['set'](_0xc831('0x23'),_0x2e6add+'-'+_0x3ef63e+'/'+_0x1aaf6e)['json'](_0x297883);}return null;};}function patchUpdates(_0x156ba9){return function(_0x30fd9c){try{jsonpatch[_0xc831('0x24')](_0x30fd9c,_0x156ba9,!![]);}catch(_0x5b08a9){return BPromise[_0xc831('0x25')](_0x5b08a9);}return _0x30fd9c[_0xc831('0x26')]();};}function saveUpdates(_0x437621,_0x48be44){return function(_0x5afc8b){if(_0x5afc8b){return _0x5afc8b[_0xc831('0x27')](_0x437621)[_0xc831('0x28')](function(_0x5e16d3){return _0x5e16d3;});}return null;};}function removeEntity(_0xbf7cd2,_0x138023){return function(_0x3d83e1){if(_0x3d83e1){return _0x3d83e1['destroy']()[_0xc831('0x28')](function(){_0xbf7cd2[_0xc831('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x292e46,_0x169286){return function(_0x57076c){if(!_0x57076c){_0x292e46[_0xc831('0x1c')](0x194);}return _0x57076c;};}function handleError(_0x166e04,_0x5a624d){_0x5a624d=_0x5a624d||0x1f4;return function(_0x48b97b){logger[_0xc831('0x29')](_0x48b97b['stack']);if(_0x48b97b[_0xc831('0x2a')]){delete _0x48b97b[_0xc831('0x2a')];}_0x166e04[_0xc831('0x1d')](_0x5a624d)[_0xc831('0x2b')](_0x48b97b);};}exports[_0xc831('0x2c')]=function(_0x275bb9,_0x4930f5){var _0x2f4768={},_0x5c9566={},_0x4793e3={'count':0x0,'rows':[]};var _0x431e5f=_[_0xc831('0x2d')](db[_0xc831('0x2e')][_0xc831('0x2f')],function(_0x465f47){return{'name':_0x465f47[_0xc831('0x30')],'type':_0x465f47['type']['key']};});_0x5c9566[_0xc831('0x31')]=_[_0xc831('0x2d')](_0x431e5f,'name');_0x5c9566[_0xc831('0x32')]=_[_0xc831('0x33')](_0x275bb9[_0xc831('0x32')]);_0x5c9566['filters']=_[_0xc831('0x34')](_0x5c9566[_0xc831('0x31')],_0x5c9566[_0xc831('0x32')]);_0x2f4768['attributes']=_['intersection'](_0x5c9566[_0xc831('0x31')],qs[_0xc831('0x35')](_0x275bb9['query'][_0xc831('0x35')]));_0x2f4768[_0xc831('0x36')]=_0x2f4768[_0xc831('0x36')][_0xc831('0x37')]?_0x2f4768[_0xc831('0x36')]:_0x5c9566[_0xc831('0x31')];if(!_0x275bb9[_0xc831('0x32')]['hasOwnProperty'](_0xc831('0x38'))){_0x2f4768[_0xc831('0x21')]=qs[_0xc831('0x21')](_0x275bb9[_0xc831('0x32')][_0xc831('0x21')]);_0x2f4768[_0xc831('0x1f')]=qs[_0xc831('0x1f')](_0x275bb9['query'][_0xc831('0x1f')]);}_0x2f4768[_0xc831('0x39')]=qs[_0xc831('0x3a')](_0x275bb9[_0xc831('0x32')][_0xc831('0x3a')]);_0x2f4768[_0xc831('0x3b')]=qs[_0xc831('0x3c')](_['pick'](_0x275bb9[_0xc831('0x32')],_0x5c9566[_0xc831('0x3c')]),_0x431e5f);if(_0x275bb9[_0xc831('0x32')][_0xc831('0x3d')]){_0x2f4768['where']=_[_0xc831('0x3e')](_0x2f4768[_0xc831('0x3b')],{'$or':_[_0xc831('0x2d')](_0x431e5f,function(_0x44d85d){if(_0x44d85d[_0xc831('0x3f')]!==_0xc831('0x40')){var _0x4bb927={};_0x4bb927[_0x44d85d['name']]={'$like':'%'+_0x275bb9[_0xc831('0x32')][_0xc831('0x3d')]+'%'};return _0x4bb927;}})});}_0x2f4768=_[_0xc831('0x3e')]({},_0x2f4768,_0x275bb9[_0xc831('0x41')]);var _0x1be16b={'where':_0x2f4768['where']};return db[_0xc831('0x2e')][_0xc831('0x22')](_0x1be16b)['then'](function(_0x57f5f9){_0x4793e3[_0xc831('0x22')]=_0x57f5f9;if(_0x275bb9[_0xc831('0x32')][_0xc831('0x42')]){_0x2f4768[_0xc831('0x43')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc831('0x44')](_0x2f4768);})[_0xc831('0x28')](function(_0x43d0a9){_0x4793e3['rows']=_0x43d0a9;return _0x4793e3;})[_0xc831('0x28')](respondWithFilteredResult(_0x4930f5,_0x2f4768))[_0xc831('0x45')](handleError(_0x4930f5,null));};exports['show']=function(_0xb689ff,_0x3e34fd){var _0x2c8d8d={'raw':![],'where':{'id':_0xb689ff[_0xc831('0x46')]['id']}},_0x270918={};_0x270918[_0xc831('0x31')]=_[_0xc831('0x33')](db[_0xc831('0x2e')][_0xc831('0x2f')]);_0x270918[_0xc831('0x32')]=_[_0xc831('0x33')](_0xb689ff['query']);_0x270918['filters']=_['intersection'](_0x270918[_0xc831('0x31')],_0x270918[_0xc831('0x32')]);_0x2c8d8d['attributes']=_[_0xc831('0x34')](_0x270918[_0xc831('0x31')],qs[_0xc831('0x35')](_0xb689ff[_0xc831('0x32')][_0xc831('0x35')]));_0x2c8d8d[_0xc831('0x36')]=_0x2c8d8d[_0xc831('0x36')][_0xc831('0x37')]?_0x2c8d8d[_0xc831('0x36')]:_0x270918[_0xc831('0x31')];if(_0xb689ff[_0xc831('0x32')]['includeAll']){_0x2c8d8d[_0xc831('0x43')]=[{'all':!![]}];}_0x2c8d8d=_[_0xc831('0x3e')]({},_0x2c8d8d,_0xb689ff[_0xc831('0x41')]);return db[_0xc831('0x2e')][_0xc831('0x47')](_0x2c8d8d)[_0xc831('0x28')](handleEntityNotFound(_0x3e34fd,null))[_0xc831('0x28')](respondWithResult(_0x3e34fd,null))['catch'](handleError(_0x3e34fd,null));};exports[_0xc831('0x48')]=function(_0x10c6fc,_0x2f0045){return db[_0xc831('0x2e')][_0xc831('0x48')](_0x10c6fc[_0xc831('0x49')],{})[_0xc831('0x28')](respondWithResult(_0x2f0045,0xc9))['catch'](handleError(_0x2f0045,null));};exports[_0xc831('0x4a')]=function(_0x2bb208,_0x22ba33){return db[_0xc831('0x2e')]['bulkCreate'](_0x2bb208['body'],{'raw':![],'individualHooks':!![]})[_0xc831('0x28')](respondWithResult(_0x22ba33,0xc9))['catch'](handleError(_0x22ba33,null));};exports[_0xc831('0x27')]=function(_0x5f649d,_0x31c1db){if(_0x5f649d[_0xc831('0x49')]['id']){delete _0x5f649d[_0xc831('0x49')]['id'];}return db[_0xc831('0x2e')]['find']({'where':{'id':_0x5f649d[_0xc831('0x46')]['id']}})[_0xc831('0x28')](handleEntityNotFound(_0x31c1db,null))[_0xc831('0x28')](saveUpdates(_0x5f649d[_0xc831('0x49')],null))[_0xc831('0x28')](respondWithResult(_0x31c1db,null))[_0xc831('0x45')](handleError(_0x31c1db,null));};exports['destroy']=function(_0x1793ed,_0x4a0277){return db[_0xc831('0x2e')][_0xc831('0x47')]({'where':{'id':_0x1793ed[_0xc831('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a0277,null))['then'](removeEntity(_0x4a0277,null))[_0xc831('0x45')](handleError(_0x4a0277,null));};exports['bulkDestroy']=function(_0x247345,_0x1dff73){return db['AnalyticFieldReport'][_0xc831('0x4b')]({'where':{'id':_0x247345[_0xc831('0x32')][_0xc831('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc831('0x28')](respondWithResult(_0x1dff73,0xcc))[_0xc831('0x45')](handleError(_0x1dff73,null));};exports['addFields']=function(_0x2e0b89,_0x31f43c,_0x5613a4){return db[_0xc831('0x4d')][_0xc831('0x4e')]({'where':{'id':_0x2e0b89[_0xc831('0x46')]['id']}})['then'](handleEntityNotFound(_0x31f43c,null))[_0xc831('0x28')](function(_0x51411b){if(_0x51411b){return db[_0xc831('0x4f')]['transaction'](function(_0x451977){return db['AnalyticFieldReport'][_0xc831('0x4b')]({'where':{'CustomReportId':_0x2e0b89[_0xc831('0x46')]['id']},'transaction':_0x451977})[_0xc831('0x28')](function(_0xc40288){var _0x4edd61=_['map'](_0x2e0b89[_0xc831('0x49')],function(_0xca00f1){delete _0xca00f1['id'];_0xca00f1[_0xc831('0x50')]=_0x2e0b89[_0xc831('0x46')]['id'];return _0xca00f1;});return db[_0xc831('0x2e')]['bulkCreate'](_0x4edd61,{'transaction':_0x451977});});})['then'](function(){return db[_0xc831('0x2e')][_0xc831('0x44')]({'where':{'CustomReportId':_0x2e0b89[_0xc831('0x46')]['id']}});});}})['then'](respondWithResult(_0x31f43c,null))[_0xc831('0x45')](handleError(_0x31f43c,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ce5b605..924db98 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x809c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x4a47b6,_0x3a7779){var _0xe2aa47=function(_0x12d80b){while(--_0x12d80b){_0x4a47b6['push'](_0x4a47b6['shift']());}};_0xe2aa47(++_0x3a7779);}(_0x809c,0x11b));var _0xc809=function(_0x8d0c43,_0x18620c){_0x8d0c43=_0x8d0c43-0x0;var _0x52cda7=_0x809c[_0x8d0c43];return _0x52cda7;};'use strict';var _=require(_0xc809('0x0'));var util=require(_0xc809('0x1'));var logger=require(_0xc809('0x2'))('api');var moment=require(_0xc809('0x3'));var BPromise=require(_0xc809('0x4'));var rp=require(_0xc809('0x5'));var fs=require('fs');var path=require(_0xc809('0x6'));var rimraf=require(_0xc809('0x7'));var config=require(_0xc809('0x8'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x2534a2,_0x2f9b0b){return _0x2534a2[_0xc809('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xc809('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x07f7=['../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x165840,_0x58df6d){var _0x5a4f8b=function(_0x2d501e){while(--_0x2d501e){_0x165840['push'](_0x165840['shift']());}};_0x5a4f8b(++_0x58df6d);}(_0x07f7,0x1b5));var _0x707f=function(_0x1ffff7,_0x2f9ff6){_0x1ffff7=_0x1ffff7-0x0;var _0x49d017=_0x07f7[_0x1ffff7];return _0x49d017;};'use strict';var _=require(_0x707f('0x0'));var util=require('util');var logger=require(_0x707f('0x1'))(_0x707f('0x2'));var moment=require('moment');var BPromise=require(_0x707f('0x3'));var rp=require(_0x707f('0x4'));var fs=require('fs');var path=require(_0x707f('0x5'));var rimraf=require(_0x707f('0x6'));var config=require(_0x707f('0x7'));var attributes=require(_0x707f('0x8'));module[_0x707f('0x9')]=function(_0x2bf3d3,_0x5461af){return _0x2bf3d3['define'](_0x707f('0xa'),attributes,{'tableName':_0x707f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index a69db75..3b40437 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x20f8=['request','then','info','debug','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f12c9,_0x50be38){var _0x5a8e3e=function(_0x18a14a){while(--_0x18a14a){_0x3f12c9['push'](_0x3f12c9['shift']());}};_0x5a8e3e(++_0x50be38);}(_0x20f8,0x1ea));var _0x820f=function(_0x331a9f,_0x2c23fe){_0x331a9f=_0x331a9f-0x0;var _0x4e51d7=_0x20f8[_0x331a9f];return _0x4e51d7;};'use strict';var _=require(_0x820f('0x0'));var util=require(_0x820f('0x1'));var moment=require(_0x820f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x820f('0x3'))['db'];var utils=require(_0x820f('0x4'));var logger=require(_0x820f('0x5'))(_0x820f('0x6'));var config=require(_0x820f('0x7'));var jayson=require(_0x820f('0x8'));var client=jayson[_0x820f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5734a0,_0x62a04,_0xa562eb){return new BPromise(function(_0x11e6ae,_0x22b1dd){return client[_0x820f('0xa')](_0x5734a0,_0xa562eb)[_0x820f('0xb')](function(_0x23bd44){logger[_0x820f('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x62a04,'request\x20sent');logger[_0x820f('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x62a04,_0x820f('0xe'),JSON[_0x820f('0xf')](_0x23bd44));if(_0x23bd44[_0x820f('0x10')]){if(_0x23bd44['error'][_0x820f('0x11')]===0x1f4){logger[_0x820f('0x10')](_0x820f('0x12'),_0x62a04,_0x23bd44[_0x820f('0x10')]['message']);return _0x22b1dd(_0x23bd44[_0x820f('0x10')][_0x820f('0x13')]);}logger[_0x820f('0x10')](_0x820f('0x12'),_0x62a04,_0x23bd44[_0x820f('0x10')][_0x820f('0x13')]);return _0x11e6ae(_0x23bd44[_0x820f('0x10')][_0x820f('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x62a04,_0x820f('0xe'));_0x11e6ae(_0x23bd44['result'][_0x820f('0x13')]);}})['catch'](function(_0x3ad7b6){logger[_0x820f('0x10')](_0x820f('0x12'),_0x62a04,_0x3ad7b6);_0x22b1dd(_0x3ad7b6);});});}
\ No newline at end of file
+var _0xe725=['jayson/promise','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x26dcd4,_0x58f255){var _0x292987=function(_0x1da8b1){while(--_0x1da8b1){_0x26dcd4['push'](_0x26dcd4['shift']());}};_0x292987(++_0x58f255);}(_0xe725,0x189));var _0x5e72=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe725[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x5e72('0x0'));var moment=require('moment');var BPromise=require(_0x5e72('0x1'));var rs=require(_0x5e72('0x2'));var fs=require('fs');var Redis=require(_0x5e72('0x3'));var db=require(_0x5e72('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5e72('0x5'));var config=require(_0x5e72('0x6'));var jayson=require(_0x5e72('0x7'));var client=jayson['client'][_0x5e72('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25dd6f,_0x53dada,_0xd54de2){return new BPromise(function(_0x149897,_0x3541ff){return client['request'](_0x25dd6f,_0xd54de2)[_0x5e72('0x9')](function(_0x49f6e5){logger['info'](_0x5e72('0xa'),_0x53dada,_0x5e72('0xb'));logger[_0x5e72('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x53dada,_0x5e72('0xb'),JSON[_0x5e72('0xd')](_0x49f6e5));if(_0x49f6e5[_0x5e72('0xe')]){if(_0x49f6e5[_0x5e72('0xe')][_0x5e72('0xf')]===0x1f4){logger['error'](_0x5e72('0xa'),_0x53dada,_0x49f6e5[_0x5e72('0xe')][_0x5e72('0x10')]);return _0x3541ff(_0x49f6e5[_0x5e72('0xe')][_0x5e72('0x10')]);}logger[_0x5e72('0xe')](_0x5e72('0xa'),_0x53dada,_0x49f6e5[_0x5e72('0xe')][_0x5e72('0x10')]);return _0x149897(_0x49f6e5[_0x5e72('0xe')]['message']);}else{logger[_0x5e72('0x11')](_0x5e72('0xa'),_0x53dada,_0x5e72('0xb'));_0x149897(_0x49f6e5[_0x5e72('0x12')][_0x5e72('0x10')]);}})[_0x5e72('0x13')](function(_0x1fac90){logger[_0x5e72('0xe')](_0x5e72('0xa'),_0x53dada,_0x1fac90);_0x3541ff(_0x1fac90);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index aef2484..30c0142 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x1b33e2,_0x54b613){var _0x5c100a=function(_0x196ca9){while(--_0x196ca9){_0x1b33e2['push'](_0x1b33e2['shift']());}};_0x5c100a(++_0x54b613);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x3dba5d,_0x49807d){var _0x458442=function(_0x1bb8db){while(--_0x1bb8db){_0x3dba5d['push'](_0x3dba5d['shift']());}};_0x458442(++_0x49807d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index f88cac6..249b629 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x75e3=['STRING','TEXT','exports'];(function(_0x5da01e,_0x1efb11){var _0x3c0bb3=function(_0x345d38){while(--_0x345d38){_0x5da01e['push'](_0x5da01e['shift']());}};_0x3c0bb3(++_0x1efb11);}(_0x75e3,0x104));var _0x375e=function(_0x643205,_0x9ce956){_0x643205=_0x643205-0x0;var _0x585ccc=_0x75e3[_0x643205];return _0x585ccc;};'use strict';var Sequelize=require('sequelize');module[_0x375e('0x0')]={'name':{'type':Sequelize[_0x375e('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x375e('0x1')]},'metric':{'type':Sequelize[_0x375e('0x2')]},'description':{'type':Sequelize[_0x375e('0x1')]}};
\ No newline at end of file
+var _0xa45c=['STRING','sequelize','exports'];(function(_0x1980e7,_0x24ef67){var _0xb8b59a=function(_0x4d88d3){while(--_0x4d88d3){_0x1980e7['push'](_0x1980e7['shift']());}};_0xb8b59a(++_0x24ef67);}(_0xa45c,0x6d));var _0xca45=function(_0x57eb84,_0x12c92e){_0x57eb84=_0x57eb84-0x0;var _0x201247=_0xa45c[_0x57eb84];return _0x201247;};'use strict';var Sequelize=require(_0xca45('0x0'));module[_0xca45('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xca45('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xca45('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index df3b845..1fc2865 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x57326c,_0x701840){var _0x442323=function(_0x529315){while(--_0x529315){_0x57326c['push'](_0x57326c['shift']());}};_0x442323(++_0x701840);}(_0x9a19,0x114));var _0x99a1=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x9a19[_0x3b3cc6];return _0x1161e4;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
+var _0x4b84=['status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','mustache','util','path','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4d9c3b,_0x3c4663){var _0x35c391=function(_0x22ac2e){while(--_0x22ac2e){_0x4d9c3b['push'](_0x4d9c3b['shift']());}};_0x35c391(++_0x3c4663);}(_0x4b84,0x1cc));var _0x44b8=function(_0xa98302,_0x844f27){_0xa98302=_0xa98302-0x0;var _0x1ad8e3=_0x4b84[_0xa98302];return _0x1ad8e3;};'use strict';var emlformat=require(_0x44b8('0x0'));var rimraf=require(_0x44b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44b8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44b8('0x3'));var util=require(_0x44b8('0x4'));var path=require(_0x44b8('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44b8('0x6'));var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x44b8('0x13'))['db'];function respondWithStatusCode(_0x4301a6,_0x4bcc43){_0x4bcc43=_0x4bcc43||0xcc;return function(_0x194230){if(_0x194230){return _0x4301a6['sendStatus'](_0x4bcc43);}return _0x4301a6[_0x44b8('0x14')](_0x4bcc43)[_0x44b8('0x15')]();};}function respondWithResult(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xc8;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['status'](_0x63e8f6)[_0x44b8('0x16')](_0x4be54c);}};}function respondWithFilteredResult(_0x2af0ad,_0x1722da){return function(_0x41ab46){if(_0x41ab46){var _0x5e52f2=typeof _0x1722da['offset']==='undefined'&&typeof _0x1722da[_0x44b8('0x17')]==='undefined';var _0x28ef36=_0x41ab46[_0x44b8('0x18')];var _0x55e258=_0x5e52f2?0x0:_0x1722da[_0x44b8('0x19')];var _0xe3de8f=_0x5e52f2?_0x41ab46['count']:_0x1722da[_0x44b8('0x19')]+_0x1722da[_0x44b8('0x17')];var _0x4b600f;if(_0xe3de8f>=_0x28ef36){_0xe3de8f=_0x28ef36;_0x4b600f=0xc8;}else{_0x4b600f=0xce;}_0x2af0ad[_0x44b8('0x14')](_0x4b600f);return _0x2af0ad[_0x44b8('0x1a')](_0x44b8('0x1b'),_0x55e258+'-'+_0xe3de8f+'/'+_0x28ef36)[_0x44b8('0x16')](_0x41ab46);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1c')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1d')](_0x9b0536);}return _0x369c09[_0x44b8('0x1e')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x1f')](_0x1d642b)[_0x44b8('0x20')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x21')]()['then'](function(){var _0x41a922=_0x51a34a[_0x44b8('0x22')]({'plain':!![]});var _0x25a0c1=_0x44b8('0x23');return db[_0x44b8('0x24')]['destroy']({'where':{'type':_0x25a0c1,'resourceId':_0x41a922['id']}})[_0x44b8('0x20')](function(){return _0x51a34a;});})['then'](function(){_0x1418db[_0x44b8('0x14')](0xcc)[_0x44b8('0x15')]();});}};}function handleEntityNotFound(_0x549a26,_0x17ac44){return function(_0x470f49){if(!_0x470f49){_0x549a26[_0x44b8('0x25')](0x194);}return _0x470f49;};}function handleError(_0x59c1bf,_0xb22107){_0xb22107=_0xb22107||0x1f4;return function(_0x242342){logger['error'](_0x242342[_0x44b8('0x26')]);if(_0x242342['name']){delete _0x242342[_0x44b8('0x27')];}_0x59c1bf['status'](_0xb22107)['send'](_0x242342);};}exports['index']=function(_0x387293,_0x29b18d){var _0x44ce5a={},_0x1bd1be={},_0x38cd17={'count':0x0,'rows':[]};var _0xc3f667=_[_0x44b8('0x28')](db[_0x44b8('0x29')][_0x44b8('0x2a')],function(_0x28f918){return{'name':_0x28f918[_0x44b8('0x2b')],'type':_0x28f918[_0x44b8('0x2c')][_0x44b8('0x2d')]};});_0x1bd1be['model']=_[_0x44b8('0x28')](_0xc3f667,'name');_0x1bd1be[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x387293[_0x44b8('0x2e')]);_0x1bd1be[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x1bd1be['model'],_0x1bd1be[_0x44b8('0x2e')]);_0x44ce5a[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x1bd1be[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x387293['query'][_0x44b8('0x34')]));_0x44ce5a[_0x44b8('0x32')]=_0x44ce5a[_0x44b8('0x32')][_0x44b8('0x35')]?_0x44ce5a[_0x44b8('0x32')]:_0x1bd1be[_0x44b8('0x33')];if(!_0x387293[_0x44b8('0x2e')][_0x44b8('0x36')](_0x44b8('0x37'))){_0x44ce5a[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x17')]);_0x44ce5a[_0x44b8('0x19')]=qs[_0x44b8('0x19')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x19')]);}_0x44ce5a[_0x44b8('0x38')]=qs[_0x44b8('0x39')](_0x387293[_0x44b8('0x2e')][_0x44b8('0x39')]);_0x44ce5a[_0x44b8('0x3a')]=qs['filters'](_[_0x44b8('0x3b')](_0x387293[_0x44b8('0x2e')],_0x1bd1be['filters']),_0xc3f667);if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]){_0x44ce5a[_0x44b8('0x3a')]=_[_0x44b8('0x3d')](_0x44ce5a['where'],{'$or':_[_0x44b8('0x28')](_0xc3f667,function(_0x11e4e3){if(_0x11e4e3[_0x44b8('0x2c')]!==_0x44b8('0x3e')){var _0x9cb2a={};_0x9cb2a[_0x11e4e3[_0x44b8('0x27')]]={'$like':'%'+_0x387293[_0x44b8('0x2e')][_0x44b8('0x3c')]+'%'};return _0x9cb2a;}})});}_0x44ce5a=_[_0x44b8('0x3d')]({},_0x44ce5a,_0x387293[_0x44b8('0x3f')]);var _0x1c9983={'where':_0x44ce5a[_0x44b8('0x3a')]};return db[_0x44b8('0x29')][_0x44b8('0x18')](_0x1c9983)[_0x44b8('0x20')](function(_0x29b43f){_0x38cd17['count']=_0x29b43f;if(_0x387293[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x44ce5a[_0x44b8('0x41')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x44b8('0x42')](_0x44ce5a);})[_0x44b8('0x20')](function(_0x229cc9){_0x38cd17['rows']=_0x229cc9;return _0x38cd17;})[_0x44b8('0x20')](respondWithFilteredResult(_0x29b18d,_0x44ce5a))[_0x44b8('0x43')](handleError(_0x29b18d,null));};exports[_0x44b8('0x44')]=function(_0x334f86,_0xfd590a){var _0x499a3e={'raw':!![],'where':{'id':_0x334f86[_0x44b8('0x45')]['id']}},_0x5ae5f9={};_0x5ae5f9[_0x44b8('0x33')]=_[_0x44b8('0x2f')](db[_0x44b8('0x29')][_0x44b8('0x2a')]);_0x5ae5f9[_0x44b8('0x2e')]=_[_0x44b8('0x2f')](_0x334f86[_0x44b8('0x2e')]);_0x5ae5f9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],_0x5ae5f9[_0x44b8('0x2e')]);_0x499a3e[_0x44b8('0x32')]=_[_0x44b8('0x31')](_0x5ae5f9[_0x44b8('0x33')],qs[_0x44b8('0x34')](_0x334f86[_0x44b8('0x2e')][_0x44b8('0x34')]));_0x499a3e[_0x44b8('0x32')]=_0x499a3e['attributes']['length']?_0x499a3e[_0x44b8('0x32')]:_0x5ae5f9[_0x44b8('0x33')];if(_0x334f86[_0x44b8('0x2e')][_0x44b8('0x40')]){_0x499a3e[_0x44b8('0x41')]=[{'all':!![]}];}_0x499a3e=_[_0x44b8('0x3d')]({},_0x499a3e,_0x334f86[_0x44b8('0x3f')]);return db['AnalyticMetric'][_0x44b8('0x46')](_0x499a3e)['then'](handleEntityNotFound(_0xfd590a,null))[_0x44b8('0x20')](respondWithResult(_0xfd590a,null))[_0x44b8('0x43')](handleError(_0xfd590a,null));};exports[_0x44b8('0x47')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x29')]['create'](_0x9207bf[_0x44b8('0x48')],{})[_0x44b8('0x20')](function(_0x10602c){var _0x25d266=_0x9207bf['user'][_0x44b8('0x22')]({'plain':!![]});if(!_0x25d266)throw new Error(_0x44b8('0x49'));if(_0x25d266[_0x44b8('0x4a')]===_0x44b8('0x4b')){var _0x44ec23=_0x10602c[_0x44b8('0x22')]({'plain':!![]});var _0x500bad=_0x44b8('0x23');return db[_0x44b8('0x4c')][_0x44b8('0x46')]({'where':{'name':_0x500bad,'userProfileId':_0x25d266[_0x44b8('0x4d')]},'raw':!![]})[_0x44b8('0x20')](function(_0x57d0e2){if(_0x57d0e2&&_0x57d0e2['autoAssociation']===0x0){return db[_0x44b8('0x24')]['create']({'name':_0x44ec23[_0x44b8('0x27')],'resourceId':_0x44ec23['id'],'type':_0x57d0e2['name'],'sectionId':_0x57d0e2['id']},{})[_0x44b8('0x20')](function(){return _0x10602c;});}else{return _0x10602c;}})[_0x44b8('0x43')](function(_0x1a29f6){logger[_0x44b8('0x4e')](_0x44b8('0x4f'),_0x1a29f6);throw _0x1a29f6;});}return _0x10602c;})[_0x44b8('0x20')](respondWithResult(_0x103d57,0xc9))[_0x44b8('0x43')](handleError(_0x103d57,null));};exports['update']=function(_0x3ad278,_0x37b2c2){if(_0x3ad278[_0x44b8('0x48')]['id']){delete _0x3ad278['body']['id'];}return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x3ad278[_0x44b8('0x45')]['id']}})[_0x44b8('0x20')](handleEntityNotFound(_0x37b2c2,null))['then'](saveUpdates(_0x3ad278[_0x44b8('0x48')],null))[_0x44b8('0x20')](respondWithResult(_0x37b2c2,null))['catch'](handleError(_0x37b2c2,null));};exports[_0x44b8('0x21')]=function(_0x19f22b,_0x35136e){return db[_0x44b8('0x29')][_0x44b8('0x46')]({'where':{'id':_0x19f22b['params']['id']}})['then'](handleEntityNotFound(_0x35136e,null))[_0x44b8('0x20')](removeEntity(_0x35136e,null))[_0x44b8('0x43')](handleError(_0x35136e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 3f16812..6ee95df 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f1c=['AnalyticMetric','analytics_metrics','lodash','api','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3f1c,0xd4));var _0xc3f1=function(_0x5e52f3,_0x28bbd1){_0x5e52f3=_0x5e52f3-0x0;var _0xe3edf6=_0x3f1c[_0x5e52f3];return _0xe3edf6;};'use strict';var _=require(_0xc3f1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3f1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc3f1('0x2'));var fs=require('fs');var path=require(_0xc3f1('0x3'));var rimraf=require(_0xc3f1('0x4'));var config=require(_0xc3f1('0x5'));var attributes=require(_0xc3f1('0x6'));module['exports']=function(_0x12e78a,_0x4ebd4c){return _0x12e78a[_0xc3f1('0x7')](_0xc3f1('0x8'),attributes,{'tableName':_0xc3f1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc61d=['exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticMetric.attributes'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xc61d,0xfb));var _0xdc61=function(_0x1e0561,_0x370016){_0x1e0561=_0x1e0561-0x0;var _0x20313d=_0xc61d[_0x1e0561];return _0x20313d;};'use strict';var _=require(_0xdc61('0x0'));var util=require(_0xdc61('0x1'));var logger=require(_0xdc61('0x2'))(_0xdc61('0x3'));var moment=require(_0xdc61('0x4'));var BPromise=require(_0xdc61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc61('0x6'));var rimraf=require(_0xdc61('0x7'));var config=require('../../config/environment');var attributes=require(_0xdc61('0x8'));module[_0xdc61('0x9')]=function(_0xf7834c,_0x20eef5){return _0xf7834c[_0xdc61('0xa')](_0xdc61('0xb'),attributes,{'tableName':_0xdc61('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index b435377..75bb177 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x97ef=['../../config/environment','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x97ef,0x141));var _0xf97e=function(_0x3777b8,_0x26abd2){_0x3777b8=_0x3777b8-0x0;var _0x14817b=_0x97ef[_0x3777b8];return _0x14817b;};'use strict';var _=require(_0xf97e('0x0'));var util=require(_0xf97e('0x1'));var moment=require(_0xf97e('0x2'));var BPromise=require(_0xf97e('0x3'));var rs=require(_0xf97e('0x4'));var fs=require('fs');var Redis=require(_0xf97e('0x5'));var db=require(_0xf97e('0x6'))['db'];var utils=require(_0xf97e('0x7'));var logger=require(_0xf97e('0x8'))('rpc');var config=require(_0xf97e('0x9'));var jayson=require(_0xf97e('0xa'));var client=jayson[_0xf97e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fb869,_0x3a692a,_0x2411f3){return new BPromise(function(_0x24f7d7,_0x47ce08){return client[_0xf97e('0xc')](_0x2fb869,_0x2411f3)[_0xf97e('0xd')](function(_0x1c3f78){logger[_0xf97e('0xe')](_0xf97e('0xf'),_0x3a692a,_0xf97e('0x10'));logger[_0xf97e('0x11')](_0xf97e('0x12'),_0x3a692a,_0xf97e('0x10'),JSON['stringify'](_0x1c3f78));if(_0x1c3f78[_0xf97e('0x13')]){if(_0x1c3f78['error']['code']===0x1f4){logger[_0xf97e('0x13')](_0xf97e('0xf'),_0x3a692a,_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);return _0x47ce08(_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);}logger[_0xf97e('0x13')](_0xf97e('0xf'),_0x3a692a,_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);return _0x24f7d7(_0x1c3f78[_0xf97e('0x13')][_0xf97e('0x14')]);}else{logger['info'](_0xf97e('0xf'),_0x3a692a,_0xf97e('0x10'));_0x24f7d7(_0x1c3f78[_0xf97e('0x15')]['message']);}})['catch'](function(_0x11a212){logger[_0xf97e('0x13')](_0xf97e('0xf'),_0x3a692a,_0x11a212);_0x47ce08(_0x11a212);});});}
\ No newline at end of file
+var _0x6e99=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x453d84,_0x4ab33e){var _0x3bf201=function(_0x1486d3){while(--_0x1486d3){_0x453d84['push'](_0x453d84['shift']());}};_0x3bf201(++_0x4ab33e);}(_0x6e99,0x106));var _0x96e9=function(_0x23dc59,_0x519e23){_0x23dc59=_0x23dc59-0x0;var _0x4f8034=_0x6e99[_0x23dc59];return _0x4f8034;};'use strict';var _=require(_0x96e9('0x0'));var util=require(_0x96e9('0x1'));var moment=require(_0x96e9('0x2'));var BPromise=require('bluebird');var rs=require(_0x96e9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96e9('0x4'))['db'];var utils=require(_0x96e9('0x5'));var logger=require(_0x96e9('0x6'))(_0x96e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x96e9('0x8'));var client=jayson[_0x96e9('0x9')][_0x96e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37fc80,_0x3e7a5c,_0x5bb81d){return new BPromise(function(_0x3424a6,_0x5aede3){return client[_0x96e9('0xb')](_0x37fc80,_0x5bb81d)[_0x96e9('0xc')](function(_0x563843){logger[_0x96e9('0xd')](_0x96e9('0xe'),_0x3e7a5c,_0x96e9('0xf'));logger['debug'](_0x96e9('0x10'),_0x3e7a5c,_0x96e9('0xf'),JSON[_0x96e9('0x11')](_0x563843));if(_0x563843[_0x96e9('0x12')]){if(_0x563843[_0x96e9('0x12')][_0x96e9('0x13')]===0x1f4){logger['error'](_0x96e9('0xe'),_0x3e7a5c,_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);return _0x5aede3(_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);}logger[_0x96e9('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3e7a5c,_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);return _0x3424a6(_0x563843[_0x96e9('0x12')][_0x96e9('0x14')]);}else{logger[_0x96e9('0xd')](_0x96e9('0xe'),_0x3e7a5c,_0x96e9('0xf'));_0x3424a6(_0x563843[_0x96e9('0x15')]['message']);}})[_0x96e9('0x16')](function(_0x2f324f){logger[_0x96e9('0x12')](_0x96e9('0xe'),_0x3e7a5c,_0x2f324f);_0x5aede3(_0x2f324f);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index e2af5c0..200d52c 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf2e0=['../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x5752ca,_0x10247e){var _0x3826de=function(_0x5027f8){while(--_0x5027f8){_0x5752ca['push'](_0x5752ca['shift']());}};_0x3826de(++_0x10247e);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xf2e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0f2e('0x0'));var util=require(_0x0f2e('0x1'));var path=require('path');var timeout=require(_0x0f2e('0x2'));var express=require(_0x0f2e('0x3'));var router=express['Router']();var fs_extra=require(_0x0f2e('0x4'));var auth=require(_0x0f2e('0x5'));var interaction=require(_0x0f2e('0x6'));var config=require('../../config/environment');var controller=require(_0x0f2e('0x7'));router[_0x0f2e('0x8')]('/',auth[_0x0f2e('0x9')](),controller['index']);router['get'](_0x0f2e('0xa'),auth['isAuthenticated'](),controller[_0x0f2e('0xb')]);router[_0x0f2e('0xc')]('/',auth[_0x0f2e('0x9')](),controller['create']);router[_0x0f2e('0xd')](_0x0f2e('0xa'),auth[_0x0f2e('0x9')](),controller['update']);router[_0x0f2e('0xe')](_0x0f2e('0xa'),auth['isAuthenticated'](),controller[_0x0f2e('0xf')]);module[_0x0f2e('0x10')]=router;
\ No newline at end of file
+var _0xb6f1=['multer','path','express','Router','fs-extra','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','/:id','show','create','update','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f1,0x118));var _0x1b6f=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xb6f1[_0x4ba380];return _0x4b111b;};'use strict';var multer=require(_0x1b6f('0x0'));var util=require('util');var path=require(_0x1b6f('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6f('0x2'));var router=express[_0x1b6f('0x3')]();var fs_extra=require(_0x1b6f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1b6f('0x5'));var config=require('../../config/environment');var controller=require(_0x1b6f('0x6'));router[_0x1b6f('0x7')]('/',auth[_0x1b6f('0x8')](),controller['index']);router['get'](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xa')]);router['post']('/',auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xb')]);router['put'](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller[_0x1b6f('0xc')]);router[_0x1b6f('0xd')](_0x1b6f('0x9'),auth[_0x1b6f('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a8e52fc..16aaaf7 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb894=['sequelize','TEXT'];(function(_0x1b4002,_0x5b4094){var _0x1716f3=function(_0x47cfd1){while(--_0x47cfd1){_0x1b4002['push'](_0x1b4002['shift']());}};_0x1716f3(++_0x5b4094);}(_0xb894,0xf0));var _0x4b89=function(_0x562653,_0x54a310){_0x562653=_0x562653-0x0;var _0x119cef=_0xb894[_0x562653];return _0x119cef;};'use strict';var Sequelize=require(_0x4b89('0x0'));module['exports']={'tree':{'type':Sequelize[_0x4b89('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xfb92=['TEXT','sequelize'];(function(_0x19e094,_0x5a6b1d){var _0x114744=function(_0x115632){while(--_0x115632){_0x19e094['push'](_0x19e094['shift']());}};_0x114744(++_0x5a6b1d);}(_0xfb92,0x1e3));var _0x2fb9=function(_0x2ad3c8,_0xeb9896){_0x2ad3c8=_0x2ad3c8-0x0;var _0x316a84=_0xfb92[_0x2ad3c8];return _0x316a84;};'use strict';var Sequelize=require(_0x2fb9('0x0'));module['exports']={'tree':{'type':Sequelize[_0x2fb9('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index bc8b4b0..ba6279f 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7ecf=['save','update','destroy','sendStatus','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','AnalyticTreeReport','then','includeAll','findAll','rows','params','include','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x7ecf,0x6e));var _0xf7ec=function(_0x55d17e,_0x5a2b81){_0x55d17e=_0x55d17e-0x0;var _0x32f505=_0x7ecf[_0x55d17e];return _0x32f505;};'use strict';var emlformat=require(_0xf7ec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7ec('0x1'));var jsonpatch=require(_0xf7ec('0x2'));var rp=require(_0xf7ec('0x3'));var moment=require('moment');var BPromise=require(_0xf7ec('0x4'));var Mustache=require('mustache');var util=require(_0xf7ec('0x5'));var path=require(_0xf7ec('0x6'));var sox=require(_0xf7ec('0x7'));var csv=require(_0xf7ec('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7ec('0x9'));var _=require(_0xf7ec('0xa'));var squel=require(_0xf7ec('0xb'));var crypto=require(_0xf7ec('0xc'));var jsforce=require(_0xf7ec('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7ec('0x8'));var querystring=require(_0xf7ec('0xe'));var Papa=require(_0xf7ec('0xf'));var Redis=require('ioredis');var authService=require(_0xf7ec('0x10'));var qs=require(_0xf7ec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7ec('0x12'));var logger=require(_0xf7ec('0x13'))(_0xf7ec('0x14'));var utils=require(_0xf7ec('0x15'));var config=require(_0xf7ec('0x16'));var licenseUtil=require(_0xf7ec('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcc8179,_0x1573fa){_0x1573fa=_0x1573fa||0xcc;return function(_0x41e5d7){if(_0x41e5d7){return _0xcc8179['sendStatus'](_0x1573fa);}return _0xcc8179[_0xf7ec('0x18')](_0x1573fa)[_0xf7ec('0x19')]();};}function respondWithResult(_0x5ac48b,_0x5df32f){_0x5df32f=_0x5df32f||0xc8;return function(_0x3ee664){if(_0x3ee664){return _0x5ac48b[_0xf7ec('0x18')](_0x5df32f)['json'](_0x3ee664);}};}function respondWithFilteredResult(_0x2f8f5c,_0x537017){return function(_0x4b5ae2){if(_0x4b5ae2){var _0x4fdf01=typeof _0x537017[_0xf7ec('0x1a')]===_0xf7ec('0x1b')&&typeof _0x537017[_0xf7ec('0x1c')]==='undefined';var _0x2cfd07=_0x4b5ae2['count'];var _0x29a494=_0x4fdf01?0x0:_0x537017[_0xf7ec('0x1a')];var _0x50f2ea=_0x4fdf01?_0x4b5ae2[_0xf7ec('0x1d')]:_0x537017[_0xf7ec('0x1a')]+_0x537017[_0xf7ec('0x1c')];var _0x1ea77e;if(_0x50f2ea>=_0x2cfd07){_0x50f2ea=_0x2cfd07;_0x1ea77e=0xc8;}else{_0x1ea77e=0xce;}_0x2f8f5c['status'](_0x1ea77e);return _0x2f8f5c[_0xf7ec('0x1e')]('Content-Range',_0x29a494+'-'+_0x50f2ea+'/'+_0x2cfd07)[_0xf7ec('0x1f')](_0x4b5ae2);}return null;};}function patchUpdates(_0x16bfdc){return function(_0x54552e){try{jsonpatch[_0xf7ec('0x20')](_0x54552e,_0x16bfdc,!![]);}catch(_0x4c98f1){return BPromise[_0xf7ec('0x21')](_0x4c98f1);}return _0x54552e[_0xf7ec('0x22')]();};}function saveUpdates(_0x320e3c,_0x30fc17){return function(_0x43aa1b){if(_0x43aa1b){return _0x43aa1b[_0xf7ec('0x23')](_0x320e3c)['then'](function(_0x2795a9){return _0x2795a9;});}return null;};}function removeEntity(_0xfc3723,_0x23ad02){return function(_0x1d79c8){if(_0x1d79c8){return _0x1d79c8[_0xf7ec('0x24')]()['then'](function(){_0xfc3723[_0xf7ec('0x18')](0xcc)[_0xf7ec('0x19')]();});}};}function handleEntityNotFound(_0x3afb02,_0x54a082){return function(_0x5b590e){if(!_0x5b590e){_0x3afb02[_0xf7ec('0x25')](0x194);}return _0x5b590e;};}function handleError(_0x5ec615,_0x35efe1){_0x35efe1=_0x35efe1||0x1f4;return function(_0x182224){logger['error'](_0x182224['stack']);if(_0x182224[_0xf7ec('0x26')]){delete _0x182224[_0xf7ec('0x26')];}_0x5ec615[_0xf7ec('0x18')](_0x35efe1)[_0xf7ec('0x27')](_0x182224);};}exports[_0xf7ec('0x28')]=function(_0x5aa8e6,_0x38cd4e){var _0x3a0684={},_0x1e4517={},_0x4930c0={'count':0x0,'rows':[]};var _0x1cd47c=_[_0xf7ec('0x29')](db['AnalyticTreeReport'][_0xf7ec('0x2a')],function(_0x257344){return{'name':_0x257344['fieldName'],'type':_0x257344[_0xf7ec('0x2b')][_0xf7ec('0x2c')]};});_0x1e4517[_0xf7ec('0x2d')]=_[_0xf7ec('0x29')](_0x1cd47c,'name');_0x1e4517[_0xf7ec('0x2e')]=_[_0xf7ec('0x2f')](_0x5aa8e6[_0xf7ec('0x2e')]);_0x1e4517[_0xf7ec('0x30')]=_[_0xf7ec('0x31')](_0x1e4517[_0xf7ec('0x2d')],_0x1e4517[_0xf7ec('0x2e')]);_0x3a0684[_0xf7ec('0x32')]=_[_0xf7ec('0x31')](_0x1e4517['model'],qs[_0xf7ec('0x33')](_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x33')]));_0x3a0684['attributes']=_0x3a0684[_0xf7ec('0x32')][_0xf7ec('0x34')]?_0x3a0684[_0xf7ec('0x32')]:_0x1e4517[_0xf7ec('0x2d')];if(!_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x35')](_0xf7ec('0x36'))){_0x3a0684[_0xf7ec('0x1c')]=qs[_0xf7ec('0x1c')](_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x1c')]);_0x3a0684[_0xf7ec('0x1a')]=qs[_0xf7ec('0x1a')](_0x5aa8e6['query']['offset']);}_0x3a0684[_0xf7ec('0x37')]=qs[_0xf7ec('0x38')](_0x5aa8e6[_0xf7ec('0x2e')]['sort']);_0x3a0684[_0xf7ec('0x39')]=qs[_0xf7ec('0x30')](_[_0xf7ec('0x3a')](_0x5aa8e6[_0xf7ec('0x2e')],_0x1e4517[_0xf7ec('0x30')]),_0x1cd47c);if(_0x5aa8e6['query'][_0xf7ec('0x3b')]){_0x3a0684[_0xf7ec('0x39')]=_[_0xf7ec('0x3c')](_0x3a0684['where'],{'$or':_['map'](_0x1cd47c,function(_0x4373da){if(_0x4373da[_0xf7ec('0x2b')]!=='VIRTUAL'){var _0x2534a3={};_0x2534a3[_0x4373da[_0xf7ec('0x26')]]={'$like':'%'+_0x5aa8e6[_0xf7ec('0x2e')][_0xf7ec('0x3b')]+'%'};return _0x2534a3;}})});}_0x3a0684=_[_0xf7ec('0x3c')]({},_0x3a0684,_0x5aa8e6['options']);var _0x280bf9={'where':_0x3a0684[_0xf7ec('0x39')]};return db[_0xf7ec('0x3d')][_0xf7ec('0x1d')](_0x280bf9)[_0xf7ec('0x3e')](function(_0x42dd88){_0x4930c0[_0xf7ec('0x1d')]=_0x42dd88;if(_0x5aa8e6['query'][_0xf7ec('0x3f')]){_0x3a0684['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xf7ec('0x40')](_0x3a0684);})[_0xf7ec('0x3e')](function(_0xc96f26){_0x4930c0[_0xf7ec('0x41')]=_0xc96f26;return _0x4930c0;})['then'](respondWithFilteredResult(_0x38cd4e,_0x3a0684))['catch'](handleError(_0x38cd4e,null));};exports['show']=function(_0x5ecdb6,_0x11ea74){var _0x149570={'raw':!![],'where':{'id':_0x5ecdb6[_0xf7ec('0x42')]['id']}},_0x45f86a={};_0x45f86a[_0xf7ec('0x2d')]=_[_0xf7ec('0x2f')](db[_0xf7ec('0x3d')][_0xf7ec('0x2a')]);_0x45f86a[_0xf7ec('0x2e')]=_[_0xf7ec('0x2f')](_0x5ecdb6['query']);_0x45f86a[_0xf7ec('0x30')]=_[_0xf7ec('0x31')](_0x45f86a[_0xf7ec('0x2d')],_0x45f86a[_0xf7ec('0x2e')]);_0x149570['attributes']=_[_0xf7ec('0x31')](_0x45f86a['model'],qs['fields'](_0x5ecdb6['query'][_0xf7ec('0x33')]));_0x149570['attributes']=_0x149570[_0xf7ec('0x32')][_0xf7ec('0x34')]?_0x149570[_0xf7ec('0x32')]:_0x45f86a['model'];if(_0x5ecdb6[_0xf7ec('0x2e')][_0xf7ec('0x3f')]){_0x149570[_0xf7ec('0x43')]=[{'all':!![]}];}_0x149570=_[_0xf7ec('0x3c')]({},_0x149570,_0x5ecdb6['options']);return db[_0xf7ec('0x3d')][_0xf7ec('0x44')](_0x149570)[_0xf7ec('0x3e')](handleEntityNotFound(_0x11ea74,null))[_0xf7ec('0x3e')](respondWithResult(_0x11ea74,null))[_0xf7ec('0x45')](handleError(_0x11ea74,null));};exports[_0xf7ec('0x46')]=function(_0x4bf0fa,_0x5d6104){return db[_0xf7ec('0x3d')]['create'](_0x4bf0fa[_0xf7ec('0x47')],{})[_0xf7ec('0x3e')](respondWithResult(_0x5d6104,0xc9))['catch'](handleError(_0x5d6104,null));};exports['update']=function(_0x61a290,_0x358076){if(_0x61a290[_0xf7ec('0x47')]['id']){delete _0x61a290[_0xf7ec('0x47')]['id'];}return db[_0xf7ec('0x3d')][_0xf7ec('0x44')]({'where':{'id':_0x61a290['params']['id']}})[_0xf7ec('0x3e')](handleEntityNotFound(_0x358076,null))['then'](saveUpdates(_0x61a290[_0xf7ec('0x47')],null))[_0xf7ec('0x3e')](respondWithResult(_0x358076,null))[_0xf7ec('0x45')](handleError(_0x358076,null));};exports[_0xf7ec('0x24')]=function(_0x2fb930,_0x5ba60f){return db[_0xf7ec('0x3d')][_0xf7ec('0x44')]({'where':{'id':_0x2fb930[_0xf7ec('0x42')]['id']}})[_0xf7ec('0x3e')](handleEntityNotFound(_0x5ba60f,null))[_0xf7ec('0x3e')](removeEntity(_0x5ba60f,null))['catch'](handleError(_0x5ba60f,null));};
\ No newline at end of file
+var _0x6aff=['Content-Range','update','destroy','then','stack','name','send','map','AnalyticTreeReport','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','length','includeAll','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x10df5c,_0x14c714){var _0x9fcba6=function(_0x4d4554){while(--_0x4d4554){_0x10df5c['push'](_0x10df5c['shift']());}};_0x9fcba6(++_0x14c714);}(_0x6aff,0x6a));var _0xf6af=function(_0x2c3238,_0x57f237){_0x2c3238=_0x2c3238-0x0;var _0x4380a3=_0x6aff[_0x2c3238];return _0x4380a3;};'use strict';var emlformat=require(_0xf6af('0x0'));var rimraf=require(_0xf6af('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6af('0x2'));var rp=require(_0xf6af('0x3'));var moment=require(_0xf6af('0x4'));var BPromise=require(_0xf6af('0x5'));var Mustache=require('mustache');var util=require(_0xf6af('0x6'));var path=require('path');var sox=require(_0xf6af('0x7'));var csv=require(_0xf6af('0x8'));var ejs=require(_0xf6af('0x9'));var fs=require('fs');var fs_extra=require(_0xf6af('0xa'));var _=require('lodash');var squel=require(_0xf6af('0xb'));var crypto=require(_0xf6af('0xc'));var jsforce=require(_0xf6af('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf6af('0x8'));var querystring=require(_0xf6af('0xe'));var Papa=require('papaparse');var Redis=require(_0xf6af('0xf'));var authService=require(_0xf6af('0x10'));var qs=require(_0xf6af('0x11'));var as=require(_0xf6af('0x12'));var hardwareService=require(_0xf6af('0x13'));var logger=require('../../config/logger')(_0xf6af('0x14'));var utils=require(_0xf6af('0x15'));var config=require(_0xf6af('0x16'));var licenseUtil=require(_0xf6af('0x17'));var db=require(_0xf6af('0x18'))['db'];function respondWithStatusCode(_0x254a70,_0x47e184){_0x47e184=_0x47e184||0xcc;return function(_0x4fc4ed){if(_0x4fc4ed){return _0x254a70[_0xf6af('0x19')](_0x47e184);}return _0x254a70[_0xf6af('0x1a')](_0x47e184)[_0xf6af('0x1b')]();};}function respondWithResult(_0x340ea9,_0x3bc722){_0x3bc722=_0x3bc722||0xc8;return function(_0x1287e6){if(_0x1287e6){return _0x340ea9[_0xf6af('0x1a')](_0x3bc722)[_0xf6af('0x1c')](_0x1287e6);}};}function respondWithFilteredResult(_0x25d86e,_0x429b6e){return function(_0x2e164d){if(_0x2e164d){var _0x552ddb=typeof _0x429b6e[_0xf6af('0x1d')]===_0xf6af('0x1e')&&typeof _0x429b6e[_0xf6af('0x1f')]==='undefined';var _0x1bf765=_0x2e164d[_0xf6af('0x20')];var _0x30bfd8=_0x552ddb?0x0:_0x429b6e[_0xf6af('0x1d')];var _0x4b2eb1=_0x552ddb?_0x2e164d[_0xf6af('0x20')]:_0x429b6e[_0xf6af('0x1d')]+_0x429b6e['limit'];var _0x4b2825;if(_0x4b2eb1>=_0x1bf765){_0x4b2eb1=_0x1bf765;_0x4b2825=0xc8;}else{_0x4b2825=0xce;}_0x25d86e[_0xf6af('0x1a')](_0x4b2825);return _0x25d86e[_0xf6af('0x21')](_0xf6af('0x22'),_0x30bfd8+'-'+_0x4b2eb1+'/'+_0x1bf765)[_0xf6af('0x1c')](_0x2e164d);}return null;};}function patchUpdates(_0x5e2cb){return function(_0x362a2c){try{jsonpatch['apply'](_0x362a2c,_0x5e2cb,!![]);}catch(_0x380e8d){return BPromise['reject'](_0x380e8d);}return _0x362a2c['save']();};}function saveUpdates(_0x551ad9,_0x5b5eed){return function(_0x8f6ca4){if(_0x8f6ca4){return _0x8f6ca4[_0xf6af('0x23')](_0x551ad9)['then'](function(_0x209aa8){return _0x209aa8;});}return null;};}function removeEntity(_0x53718b,_0x1c139a){return function(_0x470e4a){if(_0x470e4a){return _0x470e4a[_0xf6af('0x24')]()[_0xf6af('0x25')](function(){_0x53718b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x571f32,_0xaa4846){return function(_0x27c9cc){if(!_0x27c9cc){_0x571f32['sendStatus'](0x194);}return _0x27c9cc;};}function handleError(_0x54da90,_0x4db5a7){_0x4db5a7=_0x4db5a7||0x1f4;return function(_0x3fe9de){logger['error'](_0x3fe9de[_0xf6af('0x26')]);if(_0x3fe9de[_0xf6af('0x27')]){delete _0x3fe9de['name'];}_0x54da90[_0xf6af('0x1a')](_0x4db5a7)[_0xf6af('0x28')](_0x3fe9de);};}exports['index']=function(_0xf103d0,_0x401167){var _0x14b163={},_0x315c8f={},_0x509261={'count':0x0,'rows':[]};var _0x544e09=_[_0xf6af('0x29')](db[_0xf6af('0x2a')]['rawAttributes'],function(_0x47eaa1){return{'name':_0x47eaa1['fieldName'],'type':_0x47eaa1[_0xf6af('0x2b')]['key']};});_0x315c8f[_0xf6af('0x2c')]=_['map'](_0x544e09,_0xf6af('0x27'));_0x315c8f[_0xf6af('0x2d')]=_[_0xf6af('0x2e')](_0xf103d0[_0xf6af('0x2d')]);_0x315c8f[_0xf6af('0x2f')]=_[_0xf6af('0x30')](_0x315c8f[_0xf6af('0x2c')],_0x315c8f[_0xf6af('0x2d')]);_0x14b163[_0xf6af('0x31')]=_[_0xf6af('0x30')](_0x315c8f[_0xf6af('0x2c')],qs[_0xf6af('0x32')](_0xf103d0['query'][_0xf6af('0x32')]));_0x14b163[_0xf6af('0x31')]=_0x14b163['attributes']['length']?_0x14b163[_0xf6af('0x31')]:_0x315c8f[_0xf6af('0x2c')];if(!_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x33')](_0xf6af('0x34'))){_0x14b163[_0xf6af('0x1f')]=qs[_0xf6af('0x1f')](_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x1f')]);_0x14b163[_0xf6af('0x1d')]=qs[_0xf6af('0x1d')](_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x1d')]);}_0x14b163['order']=qs[_0xf6af('0x35')](_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x35')]);_0x14b163['where']=qs[_0xf6af('0x2f')](_[_0xf6af('0x36')](_0xf103d0[_0xf6af('0x2d')],_0x315c8f[_0xf6af('0x2f')]),_0x544e09);if(_0xf103d0[_0xf6af('0x2d')][_0xf6af('0x37')]){_0x14b163[_0xf6af('0x38')]=_['merge'](_0x14b163['where'],{'$or':_[_0xf6af('0x29')](_0x544e09,function(_0x92eddf){if(_0x92eddf[_0xf6af('0x2b')]!==_0xf6af('0x39')){var _0x51e13b={};_0x51e13b[_0x92eddf[_0xf6af('0x27')]]={'$like':'%'+_0xf103d0['query'][_0xf6af('0x37')]+'%'};return _0x51e13b;}})});}_0x14b163=_[_0xf6af('0x3a')]({},_0x14b163,_0xf103d0[_0xf6af('0x3b')]);var _0x4188b1={'where':_0x14b163[_0xf6af('0x38')]};return db[_0xf6af('0x2a')][_0xf6af('0x20')](_0x4188b1)['then'](function(_0x1b66a7){_0x509261['count']=_0x1b66a7;if(_0xf103d0[_0xf6af('0x2d')]['includeAll']){_0x14b163[_0xf6af('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xf6af('0x3d')](_0x14b163);})[_0xf6af('0x25')](function(_0x11a7cc){_0x509261[_0xf6af('0x3e')]=_0x11a7cc;return _0x509261;})[_0xf6af('0x25')](respondWithFilteredResult(_0x401167,_0x14b163))[_0xf6af('0x3f')](handleError(_0x401167,null));};exports['show']=function(_0x1f900f,_0x454e7d){var _0x219732={'raw':!![],'where':{'id':_0x1f900f[_0xf6af('0x40')]['id']}},_0x2d9dbb={};_0x2d9dbb[_0xf6af('0x2c')]=_[_0xf6af('0x2e')](db[_0xf6af('0x2a')]['rawAttributes']);_0x2d9dbb['query']=_[_0xf6af('0x2e')](_0x1f900f['query']);_0x2d9dbb[_0xf6af('0x2f')]=_[_0xf6af('0x30')](_0x2d9dbb[_0xf6af('0x2c')],_0x2d9dbb[_0xf6af('0x2d')]);_0x219732[_0xf6af('0x31')]=_['intersection'](_0x2d9dbb[_0xf6af('0x2c')],qs['fields'](_0x1f900f[_0xf6af('0x2d')]['fields']));_0x219732[_0xf6af('0x31')]=_0x219732[_0xf6af('0x31')][_0xf6af('0x41')]?_0x219732[_0xf6af('0x31')]:_0x2d9dbb[_0xf6af('0x2c')];if(_0x1f900f[_0xf6af('0x2d')][_0xf6af('0x42')]){_0x219732[_0xf6af('0x3c')]=[{'all':!![]}];}_0x219732=_[_0xf6af('0x3a')]({},_0x219732,_0x1f900f[_0xf6af('0x3b')]);return db[_0xf6af('0x2a')]['find'](_0x219732)[_0xf6af('0x25')](handleEntityNotFound(_0x454e7d,null))[_0xf6af('0x25')](respondWithResult(_0x454e7d,null))[_0xf6af('0x3f')](handleError(_0x454e7d,null));};exports[_0xf6af('0x43')]=function(_0x5bb1e6,_0x2b0607){return db['AnalyticTreeReport'][_0xf6af('0x43')](_0x5bb1e6[_0xf6af('0x44')],{})[_0xf6af('0x25')](respondWithResult(_0x2b0607,0xc9))[_0xf6af('0x3f')](handleError(_0x2b0607,null));};exports[_0xf6af('0x23')]=function(_0x3887ec,_0x1a2d9b){if(_0x3887ec[_0xf6af('0x44')]['id']){delete _0x3887ec[_0xf6af('0x44')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x3887ec[_0xf6af('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a2d9b,null))['then'](saveUpdates(_0x3887ec[_0xf6af('0x44')],null))[_0xf6af('0x25')](respondWithResult(_0x1a2d9b,null))['catch'](handleError(_0x1a2d9b,null));};exports[_0xf6af('0x24')]=function(_0x155f5d,_0x4b51c4){return db['AnalyticTreeReport'][_0xf6af('0x45')]({'where':{'id':_0x155f5d[_0xf6af('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b51c4,null))[_0xf6af('0x25')](removeEntity(_0x4b51c4,null))[_0xf6af('0x3f')](handleError(_0x4b51c4,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index d496018..37c6ddc 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x000c=['request-promise','rimraf','./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x000c,0x72));var _0xc000=function(_0x4d46c1,_0x1eccf0){_0x4d46c1=_0x4d46c1-0x0;var _0x34a33b=_0x000c[_0x4d46c1];return _0x34a33b;};'use strict';var _=require(_0xc000('0x0'));var util=require(_0xc000('0x1'));var logger=require(_0xc000('0x2'))(_0xc000('0x3'));var moment=require(_0xc000('0x4'));var BPromise=require(_0xc000('0x5'));var rp=require(_0xc000('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc000('0x7'));var config=require('../../config/environment');var attributes=require(_0xc000('0x8'));module[_0xc000('0x9')]=function(_0x17cf87,_0x9880f4){return _0x17cf87[_0xc000('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xc000('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7633=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','util','bluebird','path','rimraf'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x7633,0x195));var _0x3763=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7633[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x3763('0x0'));var util=require(_0x3763('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3763('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3763('0x3'));var rimraf=require(_0x3763('0x4'));var config=require(_0x3763('0x5'));var attributes=require(_0x3763('0x6'));module[_0x3763('0x7')]=function(_0x4a70e3,_0x113467){return _0x4a70e3['define'](_0x3763('0x8'),attributes,{'tableName':_0x3763('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index e7a989e..5d4ea15 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3317d5,_0x5068b7){var _0x4471ed=function(_0x28a066){while(--_0x28a066){_0x3317d5['push'](_0x3317d5['shift']());}};_0x4471ed(++_0x5068b7);}(_0x1261,0x144));var _0x1126=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x1261[_0x138d06];return _0x1a01eb;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x58800b,_0x2f6bba){var _0x53d0d8=function(_0x35f999){while(--_0x35f999){_0x58800b['push'](_0x58800b['shift']());}};_0x53d0d8(++_0x2f6bba);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37ca3b,_0x116dad){_0x37ca3b=_0x37ca3b-0x0;var _0x5c2cf1=_0x5f2f[_0x37ca3b];return _0x5c2cf1;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d401b3c..94a20fc 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4864=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4090cd,_0x55a2f0){var _0x522fbe=function(_0x2e1c6c){while(--_0x2e1c6c){_0x4090cd['push'](_0x4090cd['shift']());}};_0x522fbe(++_0x55a2f0);}(_0x4864,0x188));var _0x4486=function(_0x27c248,_0x384dff){_0x27c248=_0x27c248-0x0;var _0x1b2fc2=_0x4864[_0x27c248];return _0x1b2fc2;};'use strict';var multer=require(_0x4486('0x0'));var util=require(_0x4486('0x1'));var path=require(_0x4486('0x2'));var timeout=require(_0x4486('0x3'));var express=require(_0x4486('0x4'));var router=express[_0x4486('0x5')]();var fs_extra=require(_0x4486('0x6'));var auth=require(_0x4486('0x7'));var interaction=require(_0x4486('0x8'));var config=require(_0x4486('0x9'));var controller=require(_0x4486('0xa'));router[_0x4486('0xb')]('/',auth[_0x4486('0xc')](),controller['index']);router[_0x4486('0xb')](_0x4486('0xd'),auth[_0x4486('0xc')](),controller[_0x4486('0xe')]);router[_0x4486('0xf')]('/',auth[_0x4486('0xc')](),controller['create']);router['put'](_0x4486('0xd'),auth[_0x4486('0xc')](),controller[_0x4486('0x10')]);router['delete'](_0x4486('0xd'),auth[_0x4486('0xc')](),controller[_0x4486('0x11')]);module[_0x4486('0x12')]=router;
\ No newline at end of file
+var _0xcc40=['show','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get'];(function(_0x2e3107,_0x25f970){var _0x833d69=function(_0x420e78){while(--_0x420e78){_0x2e3107['push'](_0x2e3107['shift']());}};_0x833d69(++_0x25f970);}(_0xcc40,0x15d));var _0x0cc4=function(_0x3ce6f5,_0x29c4ae){_0x3ce6f5=_0x3ce6f5-0x0;var _0x2844a6=_0xcc40[_0x3ce6f5];return _0x2844a6;};'use strict';var multer=require(_0x0cc4('0x0'));var util=require('util');var path=require(_0x0cc4('0x1'));var timeout=require(_0x0cc4('0x2'));var express=require(_0x0cc4('0x3'));var router=express[_0x0cc4('0x4')]();var fs_extra=require(_0x0cc4('0x5'));var auth=require(_0x0cc4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0cc4('0x7'));var controller=require(_0x0cc4('0x8'));router['get']('/',auth[_0x0cc4('0x9')](),controller[_0x0cc4('0xa')]);router[_0x0cc4('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0cc4('0xc')]);router['post']('/',auth[_0x0cc4('0x9')](),controller['create']);router[_0x0cc4('0xd')]('/:id',auth[_0x0cc4('0x9')](),controller[_0x0cc4('0xe')]);router[_0x0cc4('0xf')](_0x0cc4('0x10'),auth['isAuthenticated'](),controller[_0x0cc4('0x11')]);module[_0x0cc4('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index d16f0b2..6091e0a 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb32d=['sequelize','exports','STRING'];(function(_0x4667ec,_0x593a64){var _0x2126c8=function(_0x414d0a){while(--_0x414d0a){_0x4667ec['push'](_0x4667ec['shift']());}};_0x2126c8(++_0x593a64);}(_0xb32d,0x1da));var _0xdb32=function(_0x48845d,_0x4338c2){_0x48845d=_0x48845d-0x0;var _0x5bad7d=_0xb32d[_0x48845d];return _0x5bad7d;};'use strict';var Sequelize=require(_0xdb32('0x0'));module[_0xdb32('0x1')]={'name':{'type':Sequelize[_0xdb32('0x2')]},'basename':{'type':Sequelize[_0xdb32('0x2')]},'type':{'type':Sequelize[_0xdb32('0x2')]}};
\ No newline at end of file
+var _0xff96=['exports','STRING','sequelize'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xff96,0x179));var _0x6ff9=function(_0x41f882,_0x360760){_0x41f882=_0x41f882-0x0;var _0x402761=_0xff96[_0x41f882];return _0x402761;};'use strict';var Sequelize=require(_0x6ff9('0x0'));module[_0x6ff9('0x1')]={'name':{'type':Sequelize[_0x6ff9('0x2')]},'basename':{'type':Sequelize[_0x6ff9('0x2')]},'type':{'type':Sequelize[_0x6ff9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 09f32e3..a1ddd54 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa95d=['error','stack','name','send','map','Attachment','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','length','options','find','catch','get','omit','body','createdAt','updatedAt','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','update','then'];(function(_0x4b9000,_0x4b9d03){var _0x1c8f5d=function(_0xba2b0c){while(--_0xba2b0c){_0x4b9000['push'](_0x4b9000['shift']());}};_0x1c8f5d(++_0x4b9d03);}(_0xa95d,0x88));var _0xda95=function(_0x27af80,_0x396b70){_0x27af80=_0x27af80-0x0;var _0x855bc7=_0xa95d[_0x27af80];return _0x855bc7;};'use strict';var emlformat=require(_0xda95('0x0'));var rimraf=require(_0xda95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xda95('0x2'));var moment=require(_0xda95('0x3'));var BPromise=require(_0xda95('0x4'));var Mustache=require('mustache');var util=require(_0xda95('0x5'));var path=require(_0xda95('0x6'));var sox=require(_0xda95('0x7'));var csv=require('to-csv');var ejs=require(_0xda95('0x8'));var fs=require('fs');var fs_extra=require(_0xda95('0x9'));var _=require('lodash');var squel=require(_0xda95('0xa'));var crypto=require('crypto');var jsforce=require(_0xda95('0xb'));var deskjs=require(_0xda95('0xc'));var toCsv=require('to-csv');var querystring=require(_0xda95('0xd'));var Papa=require(_0xda95('0xe'));var Redis=require(_0xda95('0xf'));var authService=require(_0xda95('0x10'));var qs=require(_0xda95('0x11'));var as=require(_0xda95('0x12'));var hardwareService=require(_0xda95('0x13'));var logger=require(_0xda95('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xda95('0x15'))['db'];function respondWithStatusCode(_0x22d2dd,_0x362c10){_0x362c10=_0x362c10||0xcc;return function(_0x3dba47){if(_0x3dba47){return _0x22d2dd[_0xda95('0x16')](_0x362c10);}return _0x22d2dd[_0xda95('0x17')](_0x362c10)[_0xda95('0x18')]();};}function respondWithResult(_0xb1b803,_0x462de7){_0x462de7=_0x462de7||0xc8;return function(_0x40aba4){if(_0x40aba4){return _0xb1b803[_0xda95('0x17')](_0x462de7)[_0xda95('0x19')](_0x40aba4);}};}function respondWithFilteredResult(_0x826162,_0x32d45d){return function(_0x7da6e0){if(_0x7da6e0){var _0x415e9c=typeof _0x32d45d[_0xda95('0x1a')]==='undefined'&&typeof _0x32d45d[_0xda95('0x1b')]==='undefined';var _0x1fdd05=_0x7da6e0[_0xda95('0x1c')];var _0x43a32a=_0x415e9c?0x0:_0x32d45d[_0xda95('0x1a')];var _0x1f918c=_0x415e9c?_0x7da6e0['count']:_0x32d45d[_0xda95('0x1a')]+_0x32d45d[_0xda95('0x1b')];var _0x27cf7c;if(_0x1f918c>=_0x1fdd05){_0x1f918c=_0x1fdd05;_0x27cf7c=0xc8;}else{_0x27cf7c=0xce;}_0x826162[_0xda95('0x17')](_0x27cf7c);return _0x826162[_0xda95('0x1d')]('Content-Range',_0x43a32a+'-'+_0x1f918c+'/'+_0x1fdd05)[_0xda95('0x19')](_0x7da6e0);}return null;};}function patchUpdates(_0x1c0d3e){return function(_0x22fd9d){try{jsonpatch[_0xda95('0x1e')](_0x22fd9d,_0x1c0d3e,!![]);}catch(_0x426103){return BPromise[_0xda95('0x1f')](_0x426103);}return _0x22fd9d['save']();};}function saveUpdates(_0x226a49,_0x305f97){return function(_0x1ff26b){if(_0x1ff26b){return _0x1ff26b[_0xda95('0x20')](_0x226a49)['then'](function(_0x2497af){return _0x2497af;});}return null;};}function removeEntity(_0x1b58b8,_0x479a6a){return function(_0x41a649){if(_0x41a649){return _0x41a649['destroy']()[_0xda95('0x21')](function(){_0x1b58b8[_0xda95('0x17')](0xcc)[_0xda95('0x18')]();});}};}function handleEntityNotFound(_0xae20a6,_0x182ee7){return function(_0x4f78c5){if(!_0x4f78c5){_0xae20a6[_0xda95('0x16')](0x194);}return _0x4f78c5;};}function handleError(_0x3522db,_0x10b39d){_0x10b39d=_0x10b39d||0x1f4;return function(_0x1e662f){logger[_0xda95('0x22')](_0x1e662f[_0xda95('0x23')]);if(_0x1e662f[_0xda95('0x24')]){delete _0x1e662f[_0xda95('0x24')];}_0x3522db[_0xda95('0x17')](_0x10b39d)[_0xda95('0x25')](_0x1e662f);};}exports['index']=function(_0x2b9acb,_0x3d26e7){var _0x589afd={},_0x5195a7={},_0x9099e5={'count':0x0,'rows':[]};var _0x2d87d0=_[_0xda95('0x26')](db[_0xda95('0x27')][_0xda95('0x28')],function(_0x2b9a86){return{'name':_0x2b9a86[_0xda95('0x29')],'type':_0x2b9a86['type']['key']};});_0x5195a7[_0xda95('0x2a')]=_[_0xda95('0x26')](_0x2d87d0,_0xda95('0x24'));_0x5195a7[_0xda95('0x2b')]=_[_0xda95('0x2c')](_0x2b9acb['query']);_0x5195a7[_0xda95('0x2d')]=_[_0xda95('0x2e')](_0x5195a7[_0xda95('0x2a')],_0x5195a7[_0xda95('0x2b')]);_0x589afd[_0xda95('0x2f')]=_['intersection'](_0x5195a7[_0xda95('0x2a')],qs[_0xda95('0x30')](_0x2b9acb[_0xda95('0x2b')][_0xda95('0x30')]));_0x589afd['attributes']=_0x589afd['attributes']['length']?_0x589afd[_0xda95('0x2f')]:_0x5195a7['model'];if(!_0x2b9acb['query'][_0xda95('0x31')](_0xda95('0x32'))){_0x589afd[_0xda95('0x1b')]=qs[_0xda95('0x1b')](_0x2b9acb['query'][_0xda95('0x1b')]);_0x589afd[_0xda95('0x1a')]=qs[_0xda95('0x1a')](_0x2b9acb['query']['offset']);}_0x589afd[_0xda95('0x33')]=qs[_0xda95('0x34')](_0x2b9acb[_0xda95('0x2b')]['sort']);_0x589afd['where']=qs[_0xda95('0x2d')](_[_0xda95('0x35')](_0x2b9acb[_0xda95('0x2b')],_0x5195a7[_0xda95('0x2d')]),_0x2d87d0);if(_0x2b9acb[_0xda95('0x2b')][_0xda95('0x36')]){_0x589afd[_0xda95('0x37')]=_['merge'](_0x589afd[_0xda95('0x37')],{'$or':_['map'](_0x2d87d0,function(_0x1b0cfc){if(_0x1b0cfc[_0xda95('0x38')]!==_0xda95('0x39')){var _0x4bef8c={};_0x4bef8c[_0x1b0cfc[_0xda95('0x24')]]={'$like':'%'+_0x2b9acb['query'][_0xda95('0x36')]+'%'};return _0x4bef8c;}})});}_0x589afd=_[_0xda95('0x3a')]({},_0x589afd,_0x2b9acb['options']);var _0x1810bd={'where':_0x589afd[_0xda95('0x37')]};return db[_0xda95('0x27')]['count'](_0x1810bd)[_0xda95('0x21')](function(_0x28931e){_0x9099e5[_0xda95('0x1c')]=_0x28931e;if(_0x2b9acb[_0xda95('0x2b')][_0xda95('0x3b')]){_0x589afd[_0xda95('0x3c')]=[{'all':!![]}];}return db[_0xda95('0x27')][_0xda95('0x3d')](_0x589afd);})[_0xda95('0x21')](function(_0x51ba70){_0x9099e5[_0xda95('0x3e')]=_0x51ba70;return _0x9099e5;})[_0xda95('0x21')](respondWithFilteredResult(_0x3d26e7,_0x589afd))['catch'](handleError(_0x3d26e7,null));};exports[_0xda95('0x3f')]=function(_0x2ef8da,_0x498216){var _0x581841={'raw':!![],'where':{'id':_0x2ef8da[_0xda95('0x40')]['id']}},_0x7e096c={};_0x7e096c[_0xda95('0x2a')]=_[_0xda95('0x2c')](db[_0xda95('0x27')]['rawAttributes']);_0x7e096c[_0xda95('0x2b')]=_[_0xda95('0x2c')](_0x2ef8da[_0xda95('0x2b')]);_0x7e096c[_0xda95('0x2d')]=_[_0xda95('0x2e')](_0x7e096c[_0xda95('0x2a')],_0x7e096c[_0xda95('0x2b')]);_0x581841[_0xda95('0x2f')]=_['intersection'](_0x7e096c[_0xda95('0x2a')],qs['fields'](_0x2ef8da[_0xda95('0x2b')][_0xda95('0x30')]));_0x581841[_0xda95('0x2f')]=_0x581841[_0xda95('0x2f')][_0xda95('0x41')]?_0x581841['attributes']:_0x7e096c[_0xda95('0x2a')];if(_0x2ef8da[_0xda95('0x2b')][_0xda95('0x3b')]){_0x581841['include']=[{'all':!![]}];}_0x581841=_[_0xda95('0x3a')]({},_0x581841,_0x2ef8da[_0xda95('0x42')]);return db['Attachment'][_0xda95('0x43')](_0x581841)[_0xda95('0x21')](handleEntityNotFound(_0x498216,null))[_0xda95('0x21')](respondWithResult(_0x498216,null))[_0xda95('0x44')](handleError(_0x498216,null));};exports['clone']=function(_0x740c15,_0x38fd1d){var _0x250750={'where':{'id':_0x740c15[_0xda95('0x40')]['id']}},_0x5bca2={};_0x5bca2[_0xda95('0x2a')]=_[_0xda95('0x2c')](db['Attachment'][_0xda95('0x28')]);_0x250750[_0xda95('0x2f')]=_['intersection'](_0x5bca2['model'],qs[_0xda95('0x30')](_0x740c15[_0xda95('0x2b')][_0xda95('0x30')]));_0x250750[_0xda95('0x2f')]=_0x250750[_0xda95('0x2f')][_0xda95('0x41')]?_0x250750[_0xda95('0x2f')]:_0x5bca2[_0xda95('0x2a')];if(_0x740c15['query'][_0xda95('0x3b')]){_0x250750[_0xda95('0x3c')]=[{'all':!![]}];}_0x250750=_[_0xda95('0x3a')]({},_0x250750,_0x740c15['options']);return db[_0xda95('0x27')]['find'](_0x250750)[_0xda95('0x21')](handleEntityNotFound(_0x38fd1d,null))[_0xda95('0x21')](function(_0x32dfe0){if(_0x32dfe0){var _0x1477f1=_0x32dfe0[_0xda95('0x45')]({'plain':!![]});_0x1477f1=qs[_0xda95('0x46')](_0x1477f1,['id','createdAt','updatedAt']);_0x740c15['body']=_[_0xda95('0x46')](_0x740c15[_0xda95('0x47')],['id',_0xda95('0x48'),_0xda95('0x49')]);return db[_0xda95('0x27')][_0xda95('0x4a')](_[_0xda95('0x3a')](_0x1477f1,_0x740c15['body']),{'include':_0x740c15['query'][_0xda95('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x38fd1d,0xc9))[_0xda95('0x44')](handleError(_0x38fd1d,null));};exports[_0xda95('0x20')]=function(_0x4aa1fd,_0x281a1b){if(_0x4aa1fd[_0xda95('0x47')]['id']){delete _0x4aa1fd[_0xda95('0x47')]['id'];}return db[_0xda95('0x27')][_0xda95('0x43')]({'where':{'id':_0x4aa1fd['params']['id']}})['then'](handleEntityNotFound(_0x281a1b,null))[_0xda95('0x21')](saveUpdates(_0x4aa1fd[_0xda95('0x47')],null))[_0xda95('0x21')](respondWithResult(_0x281a1b,null))[_0xda95('0x44')](handleError(_0x281a1b,null));};exports['destroy']=function(_0x48df00,_0x3e7e8a){return db[_0xda95('0x27')]['find']({'where':{'id':_0x48df00[_0xda95('0x40')]['id']}})[_0xda95('0x21')](handleEntityNotFound(_0x3e7e8a,null))[_0xda95('0x21')](removeEntity(_0x3e7e8a,null))['catch'](handleError(_0x3e7e8a,null));};exports[_0xda95('0x4a')]=function(_0x229378,_0x531cd5,_0x20bba7){_0x229378['body'][_0xda95('0x24')]=_0x229378[_0xda95('0x4b')]['originalname'];_0x229378[_0xda95('0x47')][_0xda95('0x4c')]=_0x229378[_0xda95('0x4b')][_0xda95('0x4d')];_0x229378[_0xda95('0x47')][_0xda95('0x38')]=_0x229378[_0xda95('0x4b')][_0xda95('0x4e')];return db[_0xda95('0x27')][_0xda95('0x4a')](_0x229378['body'])[_0xda95('0x21')](respondWithResult(_0x531cd5,0xc9))[_0xda95('0x44')](handleError(_0x531cd5,null));};exports[_0xda95('0x4f')]=function(_0x5d8fc6,_0x3135b0,_0x303dca){return db[_0xda95('0x27')][_0xda95('0x50')]({'where':{'id':_0x5d8fc6[_0xda95('0x40')]['id']},'raw':!![]})[_0xda95('0x21')](handleEntityNotFound(_0x3135b0,null))[_0xda95('0x21')](function(_0x368f8c){if(_0x368f8c){var _0x221e62=_0x368f8c[_0xda95('0x51')]!==null;var _0x745391=path[_0xda95('0x52')](config['root'],_0xda95('0x53'));if(_0x221e62){_0x745391=path[_0xda95('0x52')](_0x745391,_0xda95('0x54'));}var _0xb3319e=path[_0xda95('0x52')](_0x745391,_0x368f8c[_0xda95('0x4c')]);return _0x3135b0[_0xda95('0x4f')](_0xb3319e);}})['catch'](handleError(_0x3135b0,null));};
\ No newline at end of file
+var _0x10a9=['includeAll','get','omit','createdAt','updatedAt','body','create','params','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','length','options','find','clone'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x10a9,0xc3));var _0x910a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x10a9[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x910a('0x0'));var rimraf=require(_0x910a('0x1'));var zipdir=require(_0x910a('0x2'));var jsonpatch=require(_0x910a('0x3'));var rp=require(_0x910a('0x4'));var moment=require('moment');var BPromise=require(_0x910a('0x5'));var Mustache=require(_0x910a('0x6'));var util=require(_0x910a('0x7'));var path=require(_0x910a('0x8'));var sox=require(_0x910a('0x9'));var csv=require(_0x910a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x910a('0xb'));var squel=require(_0x910a('0xc'));var crypto=require(_0x910a('0xd'));var jsforce=require(_0x910a('0xe'));var deskjs=require(_0x910a('0xf'));var toCsv=require(_0x910a('0xa'));var querystring=require(_0x910a('0x10'));var Papa=require('papaparse');var Redis=require(_0x910a('0x11'));var authService=require(_0x910a('0x12'));var qs=require(_0x910a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x910a('0x14'));var logger=require(_0x910a('0x15'))(_0x910a('0x16'));var utils=require(_0x910a('0x17'));var config=require(_0x910a('0x18'));var licenseUtil=require(_0x910a('0x19'));var db=require(_0x910a('0x1a'))['db'];function respondWithStatusCode(_0x2279de,_0x22f6e8){_0x22f6e8=_0x22f6e8||0xcc;return function(_0x1381ad){if(_0x1381ad){return _0x2279de[_0x910a('0x1b')](_0x22f6e8);}return _0x2279de[_0x910a('0x1c')](_0x22f6e8)[_0x910a('0x1d')]();};}function respondWithResult(_0xc8003a,_0xe1610a){_0xe1610a=_0xe1610a||0xc8;return function(_0x5b0ff3){if(_0x5b0ff3){return _0xc8003a[_0x910a('0x1c')](_0xe1610a)[_0x910a('0x1e')](_0x5b0ff3);}};}function respondWithFilteredResult(_0x4483a2,_0x10693e){return function(_0x3a3cd8){if(_0x3a3cd8){var _0x8816a9=typeof _0x10693e[_0x910a('0x1f')]===_0x910a('0x20')&&typeof _0x10693e['limit']===_0x910a('0x20');var _0x5720c2=_0x3a3cd8[_0x910a('0x21')];var _0x5f251e=_0x8816a9?0x0:_0x10693e['offset'];var _0x31bb81=_0x8816a9?_0x3a3cd8[_0x910a('0x21')]:_0x10693e[_0x910a('0x1f')]+_0x10693e[_0x910a('0x22')];var _0x5b9a7d;if(_0x31bb81>=_0x5720c2){_0x31bb81=_0x5720c2;_0x5b9a7d=0xc8;}else{_0x5b9a7d=0xce;}_0x4483a2['status'](_0x5b9a7d);return _0x4483a2[_0x910a('0x23')](_0x910a('0x24'),_0x5f251e+'-'+_0x31bb81+'/'+_0x5720c2)[_0x910a('0x1e')](_0x3a3cd8);}return null;};}function patchUpdates(_0x5bb212){return function(_0x38e97b){try{jsonpatch[_0x910a('0x25')](_0x38e97b,_0x5bb212,!![]);}catch(_0x155365){return BPromise['reject'](_0x155365);}return _0x38e97b['save']();};}function saveUpdates(_0x5456d4,_0xa981c6){return function(_0x20174c){if(_0x20174c){return _0x20174c[_0x910a('0x26')](_0x5456d4)['then'](function(_0x6ac274){return _0x6ac274;});}return null;};}function removeEntity(_0x5cffef,_0x5da5ab){return function(_0x297e85){if(_0x297e85){return _0x297e85['destroy']()[_0x910a('0x27')](function(){_0x5cffef['status'](0xcc)[_0x910a('0x1d')]();});}};}function handleEntityNotFound(_0x5b6c9f,_0x45d71b){return function(_0x158a60){if(!_0x158a60){_0x5b6c9f[_0x910a('0x1b')](0x194);}return _0x158a60;};}function handleError(_0x18d74f,_0x50180f){_0x50180f=_0x50180f||0x1f4;return function(_0x4b61cd){logger[_0x910a('0x28')](_0x4b61cd[_0x910a('0x29')]);if(_0x4b61cd[_0x910a('0x2a')]){delete _0x4b61cd['name'];}_0x18d74f[_0x910a('0x1c')](_0x50180f)['send'](_0x4b61cd);};}exports[_0x910a('0x2b')]=function(_0x35eb86,_0xde77b0){var _0x20d1d1={},_0x1f7642={},_0x44623f={'count':0x0,'rows':[]};var _0x33762d=_[_0x910a('0x2c')](db[_0x910a('0x2d')][_0x910a('0x2e')],function(_0x248298){return{'name':_0x248298[_0x910a('0x2f')],'type':_0x248298[_0x910a('0x30')]['key']};});_0x1f7642[_0x910a('0x31')]=_[_0x910a('0x2c')](_0x33762d,'name');_0x1f7642['query']=_[_0x910a('0x32')](_0x35eb86[_0x910a('0x33')]);_0x1f7642[_0x910a('0x34')]=_[_0x910a('0x35')](_0x1f7642[_0x910a('0x31')],_0x1f7642[_0x910a('0x33')]);_0x20d1d1[_0x910a('0x36')]=_[_0x910a('0x35')](_0x1f7642[_0x910a('0x31')],qs[_0x910a('0x37')](_0x35eb86[_0x910a('0x33')][_0x910a('0x37')]));_0x20d1d1[_0x910a('0x36')]=_0x20d1d1[_0x910a('0x36')]['length']?_0x20d1d1[_0x910a('0x36')]:_0x1f7642[_0x910a('0x31')];if(!_0x35eb86['query']['hasOwnProperty'](_0x910a('0x38'))){_0x20d1d1['limit']=qs[_0x910a('0x22')](_0x35eb86[_0x910a('0x33')][_0x910a('0x22')]);_0x20d1d1['offset']=qs[_0x910a('0x1f')](_0x35eb86[_0x910a('0x33')]['offset']);}_0x20d1d1[_0x910a('0x39')]=qs[_0x910a('0x3a')](_0x35eb86[_0x910a('0x33')][_0x910a('0x3a')]);_0x20d1d1[_0x910a('0x3b')]=qs[_0x910a('0x34')](_[_0x910a('0x3c')](_0x35eb86[_0x910a('0x33')],_0x1f7642[_0x910a('0x34')]),_0x33762d);if(_0x35eb86[_0x910a('0x33')]['filter']){_0x20d1d1[_0x910a('0x3b')]=_[_0x910a('0x3d')](_0x20d1d1['where'],{'$or':_[_0x910a('0x2c')](_0x33762d,function(_0x2c76e5){if(_0x2c76e5[_0x910a('0x30')]!==_0x910a('0x3e')){var _0x10e476={};_0x10e476[_0x2c76e5[_0x910a('0x2a')]]={'$like':'%'+_0x35eb86[_0x910a('0x33')]['filter']+'%'};return _0x10e476;}})});}_0x20d1d1=_['merge']({},_0x20d1d1,_0x35eb86['options']);var _0x39e691={'where':_0x20d1d1[_0x910a('0x3b')]};return db[_0x910a('0x2d')][_0x910a('0x21')](_0x39e691)[_0x910a('0x27')](function(_0x562ae1){_0x44623f['count']=_0x562ae1;if(_0x35eb86[_0x910a('0x33')]['includeAll']){_0x20d1d1[_0x910a('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0x910a('0x40')](_0x20d1d1);})['then'](function(_0x24126e){_0x44623f[_0x910a('0x41')]=_0x24126e;return _0x44623f;})['then'](respondWithFilteredResult(_0xde77b0,_0x20d1d1))[_0x910a('0x42')](handleError(_0xde77b0,null));};exports[_0x910a('0x43')]=function(_0x324d33,_0x14013d){var _0x45e865={'raw':!![],'where':{'id':_0x324d33['params']['id']}},_0x47f9d9={};_0x47f9d9[_0x910a('0x31')]=_[_0x910a('0x32')](db[_0x910a('0x2d')][_0x910a('0x2e')]);_0x47f9d9[_0x910a('0x33')]=_[_0x910a('0x32')](_0x324d33[_0x910a('0x33')]);_0x47f9d9['filters']=_[_0x910a('0x35')](_0x47f9d9['model'],_0x47f9d9[_0x910a('0x33')]);_0x45e865[_0x910a('0x36')]=_[_0x910a('0x35')](_0x47f9d9[_0x910a('0x31')],qs[_0x910a('0x37')](_0x324d33[_0x910a('0x33')]['fields']));_0x45e865[_0x910a('0x36')]=_0x45e865[_0x910a('0x36')][_0x910a('0x44')]?_0x45e865[_0x910a('0x36')]:_0x47f9d9[_0x910a('0x31')];if(_0x324d33[_0x910a('0x33')]['includeAll']){_0x45e865['include']=[{'all':!![]}];}_0x45e865=_[_0x910a('0x3d')]({},_0x45e865,_0x324d33[_0x910a('0x45')]);return db[_0x910a('0x2d')][_0x910a('0x46')](_0x45e865)[_0x910a('0x27')](handleEntityNotFound(_0x14013d,null))[_0x910a('0x27')](respondWithResult(_0x14013d,null))[_0x910a('0x42')](handleError(_0x14013d,null));};exports[_0x910a('0x47')]=function(_0x1495bf,_0x187f1d){var _0x162f35={'where':{'id':_0x1495bf['params']['id']}},_0x5d80aa={};_0x5d80aa[_0x910a('0x31')]=_[_0x910a('0x32')](db[_0x910a('0x2d')][_0x910a('0x2e')]);_0x162f35[_0x910a('0x36')]=_[_0x910a('0x35')](_0x5d80aa[_0x910a('0x31')],qs[_0x910a('0x37')](_0x1495bf[_0x910a('0x33')][_0x910a('0x37')]));_0x162f35[_0x910a('0x36')]=_0x162f35[_0x910a('0x36')][_0x910a('0x44')]?_0x162f35[_0x910a('0x36')]:_0x5d80aa['model'];if(_0x1495bf[_0x910a('0x33')][_0x910a('0x48')]){_0x162f35[_0x910a('0x3f')]=[{'all':!![]}];}_0x162f35=_['merge']({},_0x162f35,_0x1495bf[_0x910a('0x45')]);return db[_0x910a('0x2d')]['find'](_0x162f35)[_0x910a('0x27')](handleEntityNotFound(_0x187f1d,null))[_0x910a('0x27')](function(_0x45b570){if(_0x45b570){var _0x13c887=_0x45b570[_0x910a('0x49')]({'plain':!![]});_0x13c887=qs[_0x910a('0x4a')](_0x13c887,['id',_0x910a('0x4b'),_0x910a('0x4c')]);_0x1495bf[_0x910a('0x4d')]=_[_0x910a('0x4a')](_0x1495bf[_0x910a('0x4d')],['id',_0x910a('0x4b'),'updatedAt']);return db[_0x910a('0x2d')][_0x910a('0x4e')](_['merge'](_0x13c887,_0x1495bf[_0x910a('0x4d')]),{'include':_0x1495bf[_0x910a('0x33')][_0x910a('0x48')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x187f1d,0xc9))[_0x910a('0x42')](handleError(_0x187f1d,null));};exports[_0x910a('0x26')]=function(_0x49e820,_0x2221f5){if(_0x49e820[_0x910a('0x4d')]['id']){delete _0x49e820[_0x910a('0x4d')]['id'];}return db[_0x910a('0x2d')][_0x910a('0x46')]({'where':{'id':_0x49e820['params']['id']}})['then'](handleEntityNotFound(_0x2221f5,null))['then'](saveUpdates(_0x49e820[_0x910a('0x4d')],null))[_0x910a('0x27')](respondWithResult(_0x2221f5,null))[_0x910a('0x42')](handleError(_0x2221f5,null));};exports['destroy']=function(_0x4a349d,_0x217393){return db[_0x910a('0x2d')]['find']({'where':{'id':_0x4a349d[_0x910a('0x4f')]['id']}})[_0x910a('0x27')](handleEntityNotFound(_0x217393,null))[_0x910a('0x27')](removeEntity(_0x217393,null))[_0x910a('0x42')](handleError(_0x217393,null));};exports[_0x910a('0x4e')]=function(_0x27343c,_0x2af8f9,_0x38f002){_0x27343c[_0x910a('0x4d')][_0x910a('0x2a')]=_0x27343c[_0x910a('0x50')][_0x910a('0x51')];_0x27343c['body'][_0x910a('0x52')]=_0x27343c['file']['filename'];_0x27343c[_0x910a('0x4d')][_0x910a('0x30')]=_0x27343c[_0x910a('0x50')][_0x910a('0x53')];return db[_0x910a('0x2d')][_0x910a('0x4e')](_0x27343c[_0x910a('0x4d')])[_0x910a('0x27')](respondWithResult(_0x2af8f9,0xc9))[_0x910a('0x42')](handleError(_0x2af8f9,null));};exports[_0x910a('0x54')]=function(_0x5cccca,_0x4241d2,_0x205f17){return db['Attachment'][_0x910a('0x55')]({'where':{'id':_0x5cccca[_0x910a('0x4f')]['id']},'raw':!![]})[_0x910a('0x27')](handleEntityNotFound(_0x4241d2,null))['then'](function(_0x3f9efb){if(_0x3f9efb){var _0x2abced=_0x3f9efb[_0x910a('0x56')]!==null;var _0x4219a7=path[_0x910a('0x57')](config['root'],_0x910a('0x58'));if(_0x2abced){_0x4219a7=path['join'](_0x4219a7,'offline-chat/');}var _0x4b2ad6=path[_0x910a('0x57')](_0x4219a7,_0x3f9efb[_0x910a('0x52')]);return _0x4241d2['download'](_0x4b2ad6);}})['catch'](handleError(_0x4241d2,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index eca2f4f..98fc776 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdecb=['Attachment','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x4e74d5,_0x26d7c3){var _0x4893d0=function(_0x213d8c){while(--_0x213d8c){_0x4e74d5['push'](_0x4e74d5['shift']());}};_0x4893d0(++_0x26d7c3);}(_0xdecb,0x1da));var _0xbdec=function(_0x5f5659,_0x374c36){_0x5f5659=_0x5f5659-0x0;var _0x3a53a5=_0xdecb[_0x5f5659];return _0x3a53a5;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var logger=require(_0xbdec('0x1'))(_0xbdec('0x2'));var moment=require('moment');var BPromise=require(_0xbdec('0x3'));var rp=require(_0xbdec('0x4'));var fs=require('fs');var path=require(_0xbdec('0x5'));var rimraf=require(_0xbdec('0x6'));var config=require(_0xbdec('0x7'));var attributes=require(_0xbdec('0x8'));module['exports']=function(_0x2afe87,_0x2f5bb6){return _0x2afe87[_0xbdec('0x9')](_0xbdec('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdced=['rimraf','../../config/environment','./attachment.attributes','define','Attachment','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x56ef59,_0x2d1bc9){var _0x2432a6=function(_0x44430f){while(--_0x44430f){_0x56ef59['push'](_0x56ef59['shift']());}};_0x2432a6(++_0x2d1bc9);}(_0xdced,0x131));var _0xddce=function(_0x2383ef,_0x48dbad){_0x2383ef=_0x2383ef-0x0;var _0x3d6395=_0xdced[_0x2383ef];return _0x3d6395;};'use strict';var _=require(_0xddce('0x0'));var util=require('util');var logger=require(_0xddce('0x1'))(_0xddce('0x2'));var moment=require(_0xddce('0x3'));var BPromise=require(_0xddce('0x4'));var rp=require(_0xddce('0x5'));var fs=require('fs');var path=require(_0xddce('0x6'));var rimraf=require(_0xddce('0x7'));var config=require(_0xddce('0x8'));var attributes=require(_0xddce('0x9'));module['exports']=function(_0x3acc22,_0x396b1f){return _0x3acc22[_0xddce('0xa')](_0xddce('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 4509133..39f73c1 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4522=['code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','body','options','raw','info','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error'];(function(_0x15ee0c,_0x300496){var _0x23d328=function(_0x124ce5){while(--_0x124ce5){_0x15ee0c['push'](_0x15ee0c['shift']());}};_0x23d328(++_0x300496);}(_0x4522,0x1a0));var _0x2452=function(_0x116e47,_0x2ee4d4){_0x116e47=_0x116e47-0x0;var _0xfcfb2a=_0x4522[_0x116e47];return _0xfcfb2a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2452('0x0'));var BPromise=require(_0x2452('0x1'));var rs=require(_0x2452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2452('0x3'))['db'];var utils=require(_0x2452('0x4'));var logger=require(_0x2452('0x5'))(_0x2452('0x6'));var config=require(_0x2452('0x7'));var jayson=require(_0x2452('0x8'));var client=jayson[_0x2452('0x9')][_0x2452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0139,_0x149807,_0x3bc193){return new BPromise(function(_0x33b935,_0x24073f){return client[_0x2452('0xb')](_0x2f0139,_0x3bc193)[_0x2452('0xc')](function(_0x2995b5){logger['info']('Attachment,\x20%s,\x20%s',_0x149807,_0x2452('0xd'));logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x149807,_0x2452('0xd'),JSON[_0x2452('0xe')](_0x2995b5));if(_0x2995b5[_0x2452('0xf')]){if(_0x2995b5[_0x2452('0xf')][_0x2452('0x10')]===0x1f4){logger[_0x2452('0xf')](_0x2452('0x11'),_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x24073f(_0x2995b5['error']['message']);}logger[_0x2452('0xf')]('Attachment,\x20%s,\x20%s',_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x33b935(_0x2995b5[_0x2452('0xf')][_0x2452('0x12')]);}else{logger['info'](_0x2452('0x11'),_0x149807,'request\x20sent');_0x33b935(_0x2995b5[_0x2452('0x13')][_0x2452('0x12')]);}})[_0x2452('0x14')](function(_0xdede20){logger['error'](_0x2452('0x11'),_0x149807,_0xdede20);_0x24073f(_0xdede20);});});}exports[_0x2452('0x15')]=function(_0x59d89a){var _0x4802ad=this;return new Promise(function(_0x1bfb44,_0x37c6a6){return db[_0x2452('0x16')]['create'](_0x59d89a[_0x2452('0x17')],{'raw':_0x59d89a[_0x2452('0x18')]?_0x59d89a[_0x2452('0x18')][_0x2452('0x19')]===undefined?!![]:![]:!![]})[_0x2452('0xc')](function(_0x1c70cb){logger[_0x2452('0x1a')](_0x2452('0x15'),_0x59d89a);logger['debug']('CreateAttachment',_0x59d89a,JSON[_0x2452('0xe')](_0x1c70cb));_0x1bfb44(_0x1c70cb);})[_0x2452('0x14')](function(_0x4bb3ff){logger[_0x2452('0xf')](_0x2452('0x15'),_0x4bb3ff[_0x2452('0x12')],_0x59d89a);_0x37c6a6(_0x4802ad[_0x2452('0xf')](0x1f4,_0x4bb3ff[_0x2452('0x12')]));});});};
\ No newline at end of file
+var _0x4746=['request','request\x20sent','debug','error','code','message','Attachment,\x20%s,\x20%s','info','catch','Attachment','create','body','options','raw','CreateAttachment','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x27a0bd,_0x41e831){var _0xa68da6=function(_0x5abb69){while(--_0x5abb69){_0x27a0bd['push'](_0x27a0bd['shift']());}};_0xa68da6(++_0x41e831);}(_0x4746,0xc6));var _0x6474=function(_0x7dee2e,_0x3ce93b){_0x7dee2e=_0x7dee2e-0x0;var _0x344a84=_0x4746[_0x7dee2e];return _0x344a84;};'use strict';var _=require(_0x6474('0x0'));var util=require(_0x6474('0x1'));var moment=require('moment');var BPromise=require(_0x6474('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6474('0x3'));var db=require(_0x6474('0x4'))['db'];var utils=require(_0x6474('0x5'));var logger=require(_0x6474('0x6'))(_0x6474('0x7'));var config=require('../../config/environment');var jayson=require(_0x6474('0x8'));var client=jayson[_0x6474('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x433af9,_0x427f79,_0xcd065e){return new BPromise(function(_0xec3cda,_0x15d4c2){return client[_0x6474('0xa')](_0x433af9,_0xcd065e)['then'](function(_0x1bc38b){logger['info']('Attachment,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'));logger[_0x6474('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x427f79,_0x6474('0xb'),JSON['stringify'](_0x1bc38b));if(_0x1bc38b[_0x6474('0xd')]){if(_0x1bc38b['error'][_0x6474('0xe')]===0x1f4){logger[_0x6474('0xd')]('Attachment,\x20%s,\x20%s',_0x427f79,_0x1bc38b['error']['message']);return _0x15d4c2(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);return _0xec3cda(_0x1bc38b[_0x6474('0xd')][_0x6474('0xf')]);}else{logger[_0x6474('0x11')]('Attachment,\x20%s,\x20%s',_0x427f79,'request\x20sent');_0xec3cda(_0x1bc38b['result'][_0x6474('0xf')]);}})[_0x6474('0x12')](function(_0x29c19b){logger[_0x6474('0xd')](_0x6474('0x10'),_0x427f79,_0x29c19b);_0x15d4c2(_0x29c19b);});});}exports['CreateAttachment']=function(_0x1505fc){var _0x7585ed=this;return new Promise(function(_0xb6ecb6,_0xc3448d){return db[_0x6474('0x13')][_0x6474('0x14')](_0x1505fc[_0x6474('0x15')],{'raw':_0x1505fc[_0x6474('0x16')]?_0x1505fc['options'][_0x6474('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0xd23b18){logger[_0x6474('0x11')](_0x6474('0x18'),_0x1505fc);logger[_0x6474('0xc')](_0x6474('0x18'),_0x1505fc,JSON[_0x6474('0x19')](_0xd23b18));_0xb6ecb6(_0xd23b18);})[_0x6474('0x12')](function(_0x5d0e5c){logger[_0x6474('0xd')]('CreateAttachment',_0x5d0e5c[_0x6474('0xf')],_0x1505fc);_0xc3448d(_0x7585ed['error'](0x1f4,_0x5d0e5c['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index ae0ec0c..7f0fa4a 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x4d6ca0,_0x1755d1){var _0x5f4034=function(_0x1a2e9a){while(--_0x1a2e9a){_0x4d6ca0['push'](_0x4d6ca0['shift']());}};_0x5f4034(++_0x1755d1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x26f36f,_0xf90e9b){_0x26f36f=_0x26f36f-0x0;var _0x23104d=_0x5f2f[_0x26f36f];return _0x23104d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0xcbbc2b,_0x1f2311){var _0x526d21=function(_0x576678){while(--_0x576678){_0xcbbc2b['push'](_0xcbbc2b['shift']());}};_0x526d21(++_0x1f2311);}(_0xb10b,0x12a));var _0xbb10=function(_0x54cfa4,_0x2d41ac){_0x54cfa4=_0x54cfa4-0x0;var _0x26ecf5=_0xb10b[_0x54cfa4];return _0x26ecf5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 7840ee5..1329a23 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f4f=['disabled','blockedAt','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','signToken','json','online','password','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','role','blocked','user','agent'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1f4f,0x6b));var _0xf1f4=function(_0x3781c7,_0x5ea182){_0x3781c7=_0x3781c7-0x0;var _0x2f7189=_0x1f4f[_0x3781c7];return _0x2f7189;};'use strict';var passport=require(_0xf1f4('0x0'));var LocalStrategy=require(_0xf1f4('0x1'))[_0xf1f4('0x2')];var moment=require(_0xf1f4('0x3'));var ActiveDirectory=require(_0xf1f4('0x4'));var BPromise=require('bluebird');var util=require(_0xf1f4('0x5'));var db=require(_0xf1f4('0x6'))['db'];var authService=require(_0xf1f4('0x7'));var utils=require('../../config/utils');var config=require(_0xf1f4('0x8'));var logger=require(_0xf1f4('0x9'))(_0xf1f4('0xa'));function isActiveDirectoryConfigured(_0x1b8fd8){var _0x308ec0=![];if(typeof _0x1b8fd8[_0xf1f4('0xb')]!==_0xf1f4('0xc')){_0x308ec0=_0x1b8fd8[_0xf1f4('0xb')]['baseDN']&&_0x1b8fd8[_0xf1f4('0xb')][_0xf1f4('0xd')]&&_0x1b8fd8['activedirectory'][_0xf1f4('0xe')];}return _0x308ec0;}function adAuthenticate(_0x3efdea,_0x3baac8,_0x49ba8b){return new BPromise(function(_0x2ae02d,_0x29c63b){try{var _0x4d4e0d=new ActiveDirectory(_0x3efdea);_0x4d4e0d[_0xf1f4('0xf')](_0x3baac8,_0x49ba8b,function(_0xd753da,_0x4b7ddc){if(_0xd753da){logger['error'](_0xf1f4('0x10'),_0x3baac8,util['inspect'](_0xd753da,{'showHidden':![],'depth':null}));_0x29c63b(_0xf1f4('0x11'));}else if(!_0x4b7ddc){logger[_0xf1f4('0x12')](_0xf1f4('0x13'),_0x3baac8);_0x29c63b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2ae02d(_0x4b7ddc);}});}catch(_0xe0507f){_0x29c63b(_0xe0507f);}});}function ActiveDirectoryAuthenticate(_0x16f9cf,_0x47f124,_0xb4bcda,_0x34de48){var _0x577407,_0x267a8f;if(!isActiveDirectoryConfigured(config)){logger[_0xf1f4('0x12')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x47f124);return _0x34de48(null,![],{'message':_0xf1f4('0x11')});}return db[_0xf1f4('0x14')][_0xf1f4('0x15')]({'where':{'id':0x1},'attributes':[_0xf1f4('0x16'),_0xf1f4('0x17')],'raw':!![]})[_0xf1f4('0x18')](function(_0x40afec){_0x577407=_0x40afec;if(!_0x577407[_0xf1f4('0x16')]){logger[_0xf1f4('0x12')](_0xf1f4('0x19'),_0x47f124);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x16f9cf[_0xf1f4('0x15')]({'attributes':['id',_0xf1f4('0x1a'),'password','salt',_0xf1f4('0x1b'),'disabled',_0xf1f4('0x1c'),'blockedAt','online'],'where':{'name':_0x47f124,'role':{'$or':['admin',_0xf1f4('0x1d'),_0xf1f4('0x1e')]},'adSsoEnabled':!![]}});})[_0xf1f4('0x18')](function(_0x2db3d3){if(!_0x2db3d3||_0x2db3d3&&_0x2db3d3[_0xf1f4('0x1a')]!==_0x47f124){throw new Error(_0xf1f4('0x11'));}_0x267a8f=_0x2db3d3;var _0x23d266=_0x267a8f[_0xf1f4('0x1a')]+'@'+config[_0xf1f4('0xb')][_0xf1f4('0xe')];return adAuthenticate(config[_0xf1f4('0xb')],_0x23d266,_0xb4bcda);})[_0xf1f4('0x18')](function(_0x6f7e75){if(_0x267a8f[_0xf1f4('0x1f')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x577407[_0xf1f4('0x17')]>0x0){if(_0x267a8f['blocked']){if(moment(_0x267a8f[_0xf1f4('0x20')])['add'](_0x577407[_0xf1f4('0x17')],_0xf1f4('0x21'))>moment()){throw new Error(_0xf1f4('0x11'));}return utils[_0xf1f4('0x22')](_0x267a8f,0x0,![],null)[_0xf1f4('0x18')](function(){return utils['getLicense'](_0x267a8f);})[_0xf1f4('0x18')](function(){return _0x34de48(null,_0x267a8f);});}else{return utils[_0xf1f4('0x23')](_0x267a8f)[_0xf1f4('0x18')](function(){return _0x34de48(null,_0x267a8f);});}}else{return utils[_0xf1f4('0x23')](_0x267a8f)[_0xf1f4('0x18')](function(){return _0x34de48(null,_0x267a8f);});}})[_0xf1f4('0x24')](function(_0x12aa4f){return _0x34de48(null,![],_0x12aa4f);});}function handleError(_0x561a2a,_0x16d2f0,_0x4f3160){return _0x561a2a[_0xf1f4('0x25')](_0x16d2f0||0x1f4)[_0xf1f4('0x26')]({'message':_0x4f3160?_0x4f3160['message']||_0x4f3160:''});}exports[_0xf1f4('0x27')]=function(_0x3706ba,_0x164971,_0x16c668){passport[_0xf1f4('0xf')](_0xf1f4('0x28'),function(_0x5ea3e5,_0x5ae3a5,_0x45227d){var _0x3f2260=_0x5ea3e5||_0x45227d;if(_0x3f2260){return handleError(_0x164971,0x191,_0x3f2260);}if(!_0x5ae3a5){return handleError(_0x164971,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x4034bd={'payload':{'id':_0x5ae3a5['id'],'role':_0x5ae3a5[_0xf1f4('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0xf1f4('0x29')](_0x4034bd)['then'](function(_0x10aeb7){_0x164971[_0xf1f4('0x2a')]({'id':_0x5ae3a5['id'],'token':_0x10aeb7,'statusCall':'','isAlreadyLogged':_0x5ae3a5[_0xf1f4('0x2b')]});});}})(_0x3706ba,_0x164971,_0x16c668);};passport['use'](_0xf1f4('0x28'),new LocalStrategy({'usernameField':_0xf1f4('0x1a'),'passwordField':_0xf1f4('0x2c')},function(_0x2020b5,_0x385555,_0x3ebb40){return ActiveDirectoryAuthenticate(db[_0xf1f4('0x2d')],_0x2020b5,_0x385555,_0x3ebb40);}));
\ No newline at end of file
+var _0x3cc7=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','admin','user','agent','domain','blocked','add','getLicense','catch','status','login','authenticate','ad-login'];(function(_0x8b746f,_0x30b7a1){var _0x50094c=function(_0x2ab809){while(--_0x2ab809){_0x8b746f['push'](_0x8b746f['shift']());}};_0x50094c(++_0x30b7a1);}(_0x3cc7,0x11f));var _0x73cc=function(_0x3e8cae,_0x4cb96a){_0x3e8cae=_0x3e8cae-0x0;var _0x45c4d6=_0x3cc7[_0x3e8cae];return _0x45c4d6;};'use strict';var passport=require(_0x73cc('0x0'));var LocalStrategy=require(_0x73cc('0x1'))[_0x73cc('0x2')];var moment=require(_0x73cc('0x3'));var ActiveDirectory=require(_0x73cc('0x4'));var BPromise=require('bluebird');var util=require(_0x73cc('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x73cc('0x6'));var utils=require('../../config/utils');var config=require(_0x73cc('0x7'));var logger=require(_0x73cc('0x8'))(_0x73cc('0x9'));function isActiveDirectoryConfigured(_0x5daec4){var _0x1b2eab=![];if(typeof _0x5daec4[_0x73cc('0xa')]!==_0x73cc('0xb')){_0x1b2eab=_0x5daec4['activedirectory']['baseDN']&&_0x5daec4['activedirectory'][_0x73cc('0xc')]&&_0x5daec4[_0x73cc('0xa')]['domain'];}return _0x1b2eab;}function adAuthenticate(_0x594eae,_0x338da6,_0x459e0f){return new BPromise(function(_0x4e9141,_0x1d3eff){try{var _0x4d99bf=new ActiveDirectory(_0x594eae);_0x4d99bf['authenticate'](_0x338da6,_0x459e0f,function(_0x5d8526,_0x1f675b){if(_0x5d8526){logger[_0x73cc('0xd')](_0x73cc('0xe'),_0x338da6,util[_0x73cc('0xf')](_0x5d8526,{'showHidden':![],'depth':null}));_0x1d3eff('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1f675b){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x338da6);_0x1d3eff(_0x73cc('0x10'));}else{_0x4e9141(_0x1f675b);}});}catch(_0x372863){_0x1d3eff(_0x372863);}});}function ActiveDirectoryAuthenticate(_0x532111,_0x153ad7,_0x515d8e,_0xa3ba4b){var _0x1f8b47,_0x35e596;if(!isActiveDirectoryConfigured(config)){logger[_0x73cc('0xd')](_0x73cc('0x11'),_0x153ad7);return _0xa3ba4b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x73cc('0x12')][_0x73cc('0x13')]({'where':{'id':0x1},'attributes':[_0x73cc('0x14'),_0x73cc('0x15')],'raw':!![]})[_0x73cc('0x16')](function(_0x10b0e8){_0x1f8b47=_0x10b0e8;if(!_0x1f8b47[_0x73cc('0x14')]){logger[_0x73cc('0xd')](_0x73cc('0x17'),_0x153ad7);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x532111[_0x73cc('0x13')]({'attributes':['id',_0x73cc('0x18'),_0x73cc('0x19'),_0x73cc('0x1a'),_0x73cc('0x1b'),_0x73cc('0x1c'),'blocked',_0x73cc('0x1d'),'online'],'where':{'name':_0x153ad7,'role':{'$or':[_0x73cc('0x1e'),_0x73cc('0x1f'),_0x73cc('0x20')]},'adSsoEnabled':!![]}});})[_0x73cc('0x16')](function(_0x12c604){if(!_0x12c604||_0x12c604&&_0x12c604[_0x73cc('0x18')]!==_0x153ad7){throw new Error(_0x73cc('0x10'));}_0x35e596=_0x12c604;var _0x13f64f=_0x35e596['name']+'@'+config[_0x73cc('0xa')][_0x73cc('0x21')];return adAuthenticate(config['activedirectory'],_0x13f64f,_0x515d8e);})[_0x73cc('0x16')](function(_0x43b118){if(_0x35e596[_0x73cc('0x1c')]){throw new Error(_0x73cc('0x10'));}if(_0x1f8b47[_0x73cc('0x15')]>0x0){if(_0x35e596[_0x73cc('0x22')]){if(moment(_0x35e596[_0x73cc('0x1d')])[_0x73cc('0x23')](_0x1f8b47['blockDuration'],'minutes')>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x35e596,0x0,![],null)[_0x73cc('0x16')](function(){return utils[_0x73cc('0x24')](_0x35e596);})[_0x73cc('0x16')](function(){return _0xa3ba4b(null,_0x35e596);});}else{return utils[_0x73cc('0x24')](_0x35e596)['then'](function(){return _0xa3ba4b(null,_0x35e596);});}}else{return utils[_0x73cc('0x24')](_0x35e596)[_0x73cc('0x16')](function(){return _0xa3ba4b(null,_0x35e596);});}})[_0x73cc('0x25')](function(_0x52ddc3){return _0xa3ba4b(null,![],_0x52ddc3);});}function handleError(_0x5eff50,_0x202e8e,_0x144c83){return _0x5eff50[_0x73cc('0x26')](_0x202e8e||0x1f4)['send']({'message':_0x144c83?_0x144c83['message']||_0x144c83:''});}exports[_0x73cc('0x27')]=function(_0x1cc649,_0x171e5e,_0x130993){passport[_0x73cc('0x28')](_0x73cc('0x29'),function(_0x2e0158,_0x41381a,_0x22f28a){var _0xb1adfe=_0x2e0158||_0x22f28a;if(_0xb1adfe){return handleError(_0x171e5e,0x191,_0xb1adfe);}if(!_0x41381a){return handleError(_0x171e5e,0x194,{'message':_0x73cc('0x2a')});}else{var _0xc61f27={'payload':{'id':_0x41381a['id'],'role':_0x41381a[_0x73cc('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x73cc('0x2b')](_0xc61f27)[_0x73cc('0x16')](function(_0x31ae30){_0x171e5e['json']({'id':_0x41381a['id'],'token':_0x31ae30,'statusCall':'','isAlreadyLogged':_0x41381a[_0x73cc('0x2c')]});});}})(_0x1cc649,_0x171e5e,_0x130993);};passport[_0x73cc('0x2d')](_0x73cc('0x29'),new LocalStrategy({'usernameField':_0x73cc('0x18'),'passwordField':_0x73cc('0x19')},function(_0x2184af,_0x32c97d,_0x284537){return ActiveDirectoryAuthenticate(db[_0x73cc('0x2e')],_0x2184af,_0x32c97d,_0x284537);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 5e8e5bf..be5b1aa 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5c4b=['./authActiveDirectory.controller','post','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c4b,0x1d0));var _0xb5c4=function(_0x26f634,_0x3fe684){_0x26f634=_0x26f634-0x0;var _0x3d4324=_0x5c4b[_0x26f634];return _0x3d4324;};'use strict';var express=require('express');var router=express[_0xb5c4('0x0')]();var controller=require(_0xb5c4('0x1'));router[_0xb5c4('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x55eb=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0xcabec1,_0x437067){var _0x46aa04=function(_0x595ff3){while(--_0x595ff3){_0xcabec1['push'](_0xcabec1['shift']());}};_0x46aa04(++_0x437067);}(_0x55eb,0x1c5));var _0xb55e=function(_0x2712b6,_0x58a79e){_0x2712b6=_0x2712b6-0x0;var _0x3f1036=_0x55eb[_0x2712b6];return _0x3f1036;};'use strict';var express=require(_0xb55e('0x0'));var router=express[_0xb55e('0x1')]();var controller=require(_0xb55e('0x2'));router[_0xb55e('0x3')]('/',controller[_0xb55e('0x4')]);module[_0xb55e('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 899d00c..b619065 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x7a54,0x106));var _0x47a5=function(_0x5a2ba1,_0x8341e1){_0x5a2ba1=_0x5a2ba1-0x0;var _0xeaca75=_0x7a54[_0x5a2ba1];return _0xeaca75;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x625fa0,_0x1b8d3f){var _0x2e9377=function(_0x7bf110){while(--_0x7bf110){_0x625fa0['push'](_0x625fa0['shift']());}};_0x2e9377(++_0x1b8d3f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 1d4dba9..65f3d4a 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x169c=['../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x25ccb6,_0x429ba4){var _0x3c8292=function(_0x15a7cf){while(--_0x15a7cf){_0x25ccb6['push'](_0x25ccb6['shift']());}};_0x3c8292(++_0x429ba4);}(_0x169c,0x1dc));var _0xc169=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0x169c[_0x5f150e];return _0x2f6957;};'use strict';var express=require(_0xc169('0x0'));var passport=require(_0xc169('0x1'));var router=express['Router']();var controller=require(_0xc169('0x2'));var userController=require(_0xc169('0x3'));var authService=require(_0xc169('0x4'));router[_0xc169('0x5')]('/',controller['login']);router[_0xc169('0x5')](_0xc169('0x6'),controller[_0xc169('0x7')],authService[_0xc169('0x8')],userController[_0xc169('0x9')],authService[_0xc169('0xa')]);module[_0xc169('0xb')]=router;
\ No newline at end of file
+var _0x9d86=['login','callback','isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9d86,0x1f1));var _0x69d8=function(_0x55de4f,_0x399b5e){_0x55de4f=_0x55de4f-0x0;var _0x785e3c=_0x9d86[_0x55de4f];return _0x785e3c;};'use strict';var express=require(_0x69d8('0x0'));var passport=require(_0x69d8('0x1'));var router=express[_0x69d8('0x2')]();var controller=require(_0x69d8('0x3'));var userController=require(_0x69d8('0x4'));var authService=require(_0x69d8('0x5'));router[_0x69d8('0x6')]('/',controller[_0x69d8('0x7')]);router[_0x69d8('0x6')]('/callback',controller[_0x69d8('0x8')],authService[_0x69d8('0x9')],userController[_0x69d8('0x7')],authService[_0x69d8('0xa')]);module[_0x69d8('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 328d01e..f2f8ad8 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8091=['getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','email','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','password','previousPasswords','validatePasswordHistory','Password\x20reset!','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','role','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','disabled','add','minutes','clearBlockUser','then'];(function(_0x3c0731,_0x5181dc){var _0x2e7420=function(_0x22d72e){while(--_0x22d72e){_0x3c0731['push'](_0x3c0731['shift']());}};_0x2e7420(++_0x5181dc);}(_0x8091,0xcd));var _0x1809=function(_0x573931,_0x472f97){_0x573931=_0x573931-0x0;var _0x2fdbe7=_0x8091[_0x573931];return _0x2fdbe7;};'use strict';var util=require('util');var passport=require(_0x1809('0x0'));var LocalStrategy=require(_0x1809('0x1'))[_0x1809('0x2')];var jayson=require(_0x1809('0x3'));var _=require(_0x1809('0x4'));var rs=require(_0x1809('0x5'));var moment=require('moment');var db=require(_0x1809('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x1809('0x7'));var client=jayson[_0x1809('0x8')]['http']({'port':0x232b});function localAuthenticate(_0x3f8fdf,_0x1ba7e8,_0x2ad50f,_0x415f0b){var _0x3844ee,_0x5c8db4;return db[_0x1809('0x9')][_0x1809('0xa')]({'where':{'id':0x1},'attributes':[_0x1809('0xb'),_0x1809('0xc')],'raw':!![]})['then'](function(_0x4d9873){_0x3844ee=_0x4d9873;return _0x3f8fdf[_0x1809('0xa')]({'attributes':['id',_0x1809('0xd'),'password','salt',_0x1809('0xe'),'disabled',_0x1809('0xf'),_0x1809('0x10'),_0x1809('0x11')],'where':{'name':_0x1ba7e8,'role':{'$or':[_0x1809('0x12'),'user',_0x1809('0x13')]}}});})['then'](function(_0x37b5e0){if(!_0x37b5e0||_0x37b5e0&&_0x37b5e0[_0x1809('0xd')]!==_0x1ba7e8){throw new Error(_0x1809('0x14'));}else{_0x5c8db4=_0x37b5e0;return _0x5c8db4;}})['then'](function(){_0x5c8db4['authenticate'](_0x2ad50f,function(_0x1333fa,_0x1c1748){var _0x555d77=_0x5c8db4[_0x1809('0x11')]+0x1;if(_0x1333fa){return _0x415f0b(_0x1333fa);}else if(!_0x1c1748){if(_0x5c8db4[_0x1809('0x15')]){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else if(_0x3844ee[_0x1809('0xb')]>0x0){if(_0x5c8db4[_0x1809('0xf')]){if(_0x3844ee[_0x1809('0xc')]>0x0){if(moment(_0x5c8db4[_0x1809('0x10')])[_0x1809('0x16')](_0x3844ee[_0x1809('0xc')],_0x1809('0x17'))>moment()){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else{return utils[_0x1809('0x18')](_0x5c8db4,_0x555d77,![],null)['then'](function(){return _0x415f0b(null,![],{'message':_0x1809('0x14')});});}}else{return _0x415f0b(null,![],{'message':_0x1809('0x14')});}}else{if(_0x555d77>=_0x3844ee[_0x1809('0xb')]){return utils[_0x1809('0x18')](_0x5c8db4,0x0,!![],moment())[_0x1809('0x19')](function(){return _0x415f0b(null,![],{'message':_0x1809('0x14')});});}else{return utils[_0x1809('0x18')](_0x5c8db4,_0x555d77,![],null)[_0x1809('0x19')](function(){return _0x415f0b(null,![],{'message':_0x1809('0x14')});});}}}else{return _0x415f0b(null,![],{'message':_0x1809('0x14')});}}else{if(_0x5c8db4[_0x1809('0x15')]){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else if(_0x3844ee[_0x1809('0xb')]>0x0){if(_0x5c8db4[_0x1809('0xf')]){if(_0x3844ee[_0x1809('0xc')]>0x0){if(moment(_0x5c8db4[_0x1809('0x10')])[_0x1809('0x16')](_0x3844ee[_0x1809('0xc')],'minutes')>moment()){return _0x415f0b(null,![],{'message':_0x1809('0x14')});}else{return utils['clearBlockUser'](_0x5c8db4,0x0,![],null)[_0x1809('0x19')](function(){return utils[_0x1809('0x1a')](_0x5c8db4);})[_0x1809('0x19')](function(){return _0x415f0b(null,_0x5c8db4);});}}else{return _0x415f0b(null,![],{'message':_0x1809('0x14')});}}else{return utils[_0x1809('0x18')](_0x5c8db4,0x0,![],null)['then'](function(){return utils[_0x1809('0x1a')](_0x5c8db4);})['then'](function(){return _0x415f0b(null,_0x5c8db4);})[_0x1809('0x1b')](function(_0x315028){return _0x415f0b(null,![],_0x315028);});}}else{if(_0x5c8db4[_0x1809('0xf')]){return _0x415f0b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x1809('0x1a')](_0x5c8db4)[_0x1809('0x19')](function(){return _0x415f0b(null,_0x5c8db4);});}}}});})['catch'](function(_0x557469){return _0x415f0b(null,![],_0x557469);});}function sendServiceMail(_0x58fb8d){return db[_0x1809('0x1c')][_0x1809('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x1809('0xd'),'email'],'include':[{'model':db[_0x1809('0x1e')],'as':_0x1809('0x1f'),'include':[{'model':db[_0x1809('0x20')],'as':_0x1809('0x20')}]}]})[_0x1809('0x19')](function(_0x59e2d1){if(!_0x59e2d1){throw new Error(_0x1809('0x21'));}var _0xdd9b59=_0x59e2d1[_0x1809('0x22')]();var _0x1a67a6={'account':_0xdd9b59,'message':_[_0x1809('0x23')]({'from':util[_0x1809('0x24')]('\x22%s\x22\x20<%s>',_0x59e2d1[_0x1809('0xd')],_0x59e2d1[_0x1809('0x25')]||_0x59e2d1[_0x1809('0x1f')][_0x1809('0x26')])},_0x58fb8d)};return client[_0x1809('0x27')]('SendMail',_0x1a67a6);})[_0x1809('0x19')](function(_0x4db7a5){if(_0x4db7a5[_0x1809('0x28')]){throw new Error(util[_0x1809('0x24')](_0x1809('0x29'),_0x4db7a5['error'][_0x1809('0x2a')]||JSON['stringify'](_0x4db7a5['error'])));}return!![];});}function handleError(_0x24b043,_0x4cd2ee,_0x5a5aa0){return _0x24b043[_0x1809('0x2b')](_0x4cd2ee||0x1f4)[_0x1809('0x2c')]({'message':_0x5a5aa0?_0x5a5aa0[_0x1809('0x2a')]||_0x5a5aa0:''});}exports[_0x1809('0x2d')]=function(_0x31a3bd,_0x42b30f,_0x123c38){passport['authenticate'](_0x1809('0x2e'),function(_0xcf6e51,_0x35441b,_0x522d2c){var _0x1ce223=_0xcf6e51||_0x522d2c;if(_0x1ce223){return handleError(_0x42b30f,0x191,_0x1ce223);}if(!_0x35441b){return handleError(_0x42b30f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x95d79c={'payload':{'id':_0x35441b['id'],'role':_0x35441b[_0x1809('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x1809('0x2f')](_0x95d79c)[_0x1809('0x19')](function(_0x2ea1ce){_0x42b30f[_0x1809('0x30')]({'id':_0x35441b['id'],'token':_0x2ea1ce,'statusCall':'','isAlreadyLogged':_0x35441b[_0x1809('0x31')]});});}})(_0x31a3bd,_0x42b30f,_0x123c38);};exports['forgot']=function(_0x32027c,_0x1075c3){if(!_0x32027c[_0x1809('0x32')][_0x1809('0x25')]){return handleError(_0x1075c3,0x1f4,{'message':_0x1809('0x33')});}var _0x42dc52=rs[_0x1809('0x34')]();_0x32027c[_0x1809('0x32')]['email']=_0x32027c[_0x1809('0x32')][_0x1809('0x25')][_0x1809('0x35')]()[_0x1809('0x36')]();var _0x44c344;return db[_0x1809('0x9')][_0x1809('0xa')]({'where':{'id':0x1},'attributes':[_0x1809('0xb'),_0x1809('0xc')],'raw':!![]})[_0x1809('0x19')](function(_0x329ed3){_0x44c344=_0x329ed3;return db[_0x1809('0x37')][_0x1809('0x1d')]({'where':{'email':_0x32027c[_0x1809('0x32')][_0x1809('0x25')]}});})[_0x1809('0x19')](function(_0x2f8e69){if(!_0x2f8e69){throw new Error(_0x1809('0x38'));}if(_0x2f8e69['disabled']){throw new Error(_0x1809('0x39'));}if(_0x2f8e69[_0x1809('0xf')]){if(moment(_0x2f8e69[_0x1809('0x10')])[_0x1809('0x16')](_0x44c344['blockDuration'],_0x1809('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2f8e69[_0x1809('0xf')]=![];_0x2f8e69[_0x1809('0x10')]=null;}}_0x2f8e69[_0x1809('0x3a')]=_0x42dc52;_0x2f8e69[_0x1809('0x3b')]=Date[_0x1809('0x3c')]()+0x36ee80;return _0x2f8e69[_0x1809('0x3d')]();})[_0x1809('0x19')](function(){return sendServiceMail({'to':_0x32027c['body'][_0x1809('0x25')],'subject':_0x1809('0x3e'),'text':_0x1809('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x1809('0x40')+_0x32027c[_0x1809('0x41')][_0x1809('0x42')]+'/reset/'+_0x42dc52+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x1809('0x19')](function(){_0x1075c3[_0x1809('0x2b')](0xc8)[_0x1809('0x2c')]({'message':_0x1809('0x43')});})[_0x1809('0x1b')](function(_0x210a9a){return handleError(_0x1075c3,0x1f4,_0x210a9a);});};exports[_0x1809('0x44')]=function(_0x6a6918,_0x1d535b){return db[_0x1809('0x37')]['find']({'where':{'resetPasswordToken':_0x6a6918['params'][_0x1809('0x45')],'resetPasswordExpires':{'$gt':Date[_0x1809('0x3c')]()}}})[_0x1809('0x19')](function(_0x4a68f4){if(!_0x4a68f4){throw new Error(_0x1809('0x46'));}return db[_0x1809('0x9')][_0x1809('0xa')]({'attributes':['id',_0x1809('0x47'),'enforcePasswordHistory',_0x1809('0x48')]})[_0x1809('0x19')](function(_0x4a058a){if(_0x4a058a[_0x1809('0x47')])authService['validatePasswordPattern'](_0x6a6918[_0x1809('0x32')][_0x1809('0x49')]);if(!_0x4a058a['enforcePasswordHistory']||!_0x4a68f4[_0x1809('0x4a')])return _0x4a68f4;authService[_0x1809('0x4b')](_0x6a6918['body'][_0x1809('0x49')],_0x4a68f4[_0x1809('0x4a')],_0x4a058a['passwordHistoryLimit']);return _0x4a68f4;})[_0x1809('0x19')](function(){_0x4a68f4[_0x1809('0x49')]=_0x6a6918[_0x1809('0x32')][_0x1809('0x49')];_0x4a68f4[_0x1809('0x3a')]=null;_0x4a68f4['resetPasswordExpires']=null;return _0x4a68f4[_0x1809('0x3d')]();});})[_0x1809('0x19')](function(){_0x1d535b['status'](0xc8)['send']({'message':_0x1809('0x4c')});})[_0x1809('0x1b')](function(_0x4971fe){return handleError(_0x1d535b,0x1f4,_0x4971fe);});};passport['use']('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x3a1156,_0x37539a,_0x5430b2){return localAuthenticate(db[_0x1809('0x37')],_0x3a1156,_0x37539a,_0x5430b2);}));
\ No newline at end of file
+var _0xc278=['You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','resetPasswordExpires','Password\x20reset!','use','util','passport','lodash','moment','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','catch','getLicense','MailAccount','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x4b72b8,_0x15d0f7){var _0x27fcbf=function(_0x8d8af1){while(--_0x8d8af1){_0x4b72b8['push'](_0x4b72b8['shift']());}};_0x27fcbf(++_0x15d0f7);}(_0xc278,0x1f4));var _0x8c27=function(_0x3ccd4f,_0x434f7b){_0x3ccd4f=_0x3ccd4f-0x0;var _0x3761cc=_0xc278[_0x3ccd4f];return _0x3761cc;};'use strict';var util=require(_0x8c27('0x0'));var passport=require(_0x8c27('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0x8c27('0x2'));var rs=require('randomstring');var moment=require(_0x8c27('0x3'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x8c27('0x4'));var client=jayson[_0x8c27('0x5')][_0x8c27('0x6')]({'port':0x232b});function localAuthenticate(_0x35b5a4,_0x436e12,_0x4c677e,_0x4cebe4){var _0x14e232,_0x32f687;return db[_0x8c27('0x7')][_0x8c27('0x8')]({'where':{'id':0x1},'attributes':[_0x8c27('0x9'),_0x8c27('0xa')],'raw':!![]})[_0x8c27('0xb')](function(_0x4e2b47){_0x14e232=_0x4e2b47;return _0x35b5a4[_0x8c27('0x8')]({'attributes':['id',_0x8c27('0xc'),_0x8c27('0xd'),_0x8c27('0xe'),_0x8c27('0xf'),_0x8c27('0x10'),_0x8c27('0x11'),_0x8c27('0x12'),'loginAttempts'],'where':{'name':_0x436e12,'role':{'$or':[_0x8c27('0x13'),_0x8c27('0x14'),'agent']}}});})[_0x8c27('0xb')](function(_0x50cb8e){if(!_0x50cb8e||_0x50cb8e&&_0x50cb8e[_0x8c27('0xc')]!==_0x436e12){throw new Error(_0x8c27('0x15'));}else{_0x32f687=_0x50cb8e;return _0x32f687;}})[_0x8c27('0xb')](function(){_0x32f687[_0x8c27('0x16')](_0x4c677e,function(_0x336deb,_0x59e502){var _0x1230e0=_0x32f687['loginAttempts']+0x1;if(_0x336deb){return _0x4cebe4(_0x336deb);}else if(!_0x59e502){if(_0x32f687['disabled']){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});}else if(_0x14e232['allowedLoginAttempts']>0x0){if(_0x32f687[_0x8c27('0x11')]){if(_0x14e232[_0x8c27('0xa')]>0x0){if(moment(_0x32f687[_0x8c27('0x12')])[_0x8c27('0x17')](_0x14e232[_0x8c27('0xa')],_0x8c27('0x18'))>moment()){return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x8c27('0x19')](_0x32f687,_0x1230e0,![],null)['then'](function(){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});});}}else{return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1230e0>=_0x14e232[_0x8c27('0x9')]){return utils[_0x8c27('0x19')](_0x32f687,0x0,!![],moment())['then'](function(){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});});}else{return utils['clearBlockUser'](_0x32f687,_0x1230e0,![],null)[_0x8c27('0xb')](function(){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});});}}}else{return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x32f687[_0x8c27('0x10')]){return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x14e232['allowedLoginAttempts']>0x0){if(_0x32f687[_0x8c27('0x11')]){if(_0x14e232[_0x8c27('0xa')]>0x0){if(moment(_0x32f687[_0x8c27('0x12')])[_0x8c27('0x17')](_0x14e232[_0x8c27('0xa')],'minutes')>moment()){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});}else{return utils[_0x8c27('0x19')](_0x32f687,0x0,![],null)[_0x8c27('0xb')](function(){return utils['getLicense'](_0x32f687);})[_0x8c27('0xb')](function(){return _0x4cebe4(null,_0x32f687);});}}else{return _0x4cebe4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8c27('0x19')](_0x32f687,0x0,![],null)['then'](function(){return utils['getLicense'](_0x32f687);})[_0x8c27('0xb')](function(){return _0x4cebe4(null,_0x32f687);})[_0x8c27('0x1a')](function(_0x48bc40){return _0x4cebe4(null,![],_0x48bc40);});}}else{if(_0x32f687[_0x8c27('0x11')]){return _0x4cebe4(null,![],{'message':_0x8c27('0x15')});}else{return utils[_0x8c27('0x1b')](_0x32f687)[_0x8c27('0xb')](function(){return _0x4cebe4(null,_0x32f687);});}}}});})[_0x8c27('0x1a')](function(_0x48d951){return _0x4cebe4(null,![],_0x48d951);});}function sendServiceMail(_0x2d9875){return db[_0x8c27('0x1c')][_0x8c27('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x8c27('0xc'),_0x8c27('0x1e')],'include':[{'model':db[_0x8c27('0x1f')],'as':'Smtp','include':[{'model':db[_0x8c27('0x20')],'as':_0x8c27('0x20')}]}]})[_0x8c27('0xb')](function(_0x1becd5){if(!_0x1becd5){throw new Error(_0x8c27('0x21'));}var _0x4bd2db=_0x1becd5[_0x8c27('0x22')]();var _0x168575={'account':_0x4bd2db,'message':_[_0x8c27('0x23')]({'from':util[_0x8c27('0x24')](_0x8c27('0x25'),_0x1becd5[_0x8c27('0xc')],_0x1becd5[_0x8c27('0x1e')]||_0x1becd5[_0x8c27('0x26')]['user'])},_0x2d9875)};return client[_0x8c27('0x27')](_0x8c27('0x28'),_0x168575);})['then'](function(_0x3f63b6){if(_0x3f63b6[_0x8c27('0x29')]){throw new Error(util[_0x8c27('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3f63b6[_0x8c27('0x29')][_0x8c27('0x2a')]||JSON['stringify'](_0x3f63b6[_0x8c27('0x29')])));}return!![];});}function handleError(_0x4b6f25,_0x117309,_0x4ba1ba){return _0x4b6f25[_0x8c27('0x2b')](_0x117309||0x1f4)[_0x8c27('0x2c')]({'message':_0x4ba1ba?_0x4ba1ba[_0x8c27('0x2a')]||_0x4ba1ba:''});}exports[_0x8c27('0x2d')]=function(_0x38fa1a,_0xcdaf3f,_0x55387f){passport[_0x8c27('0x16')](_0x8c27('0x2e'),function(_0x500335,_0xbcba2c,_0x93636d){var _0x1411e0=_0x500335||_0x93636d;if(_0x1411e0){return handleError(_0xcdaf3f,0x191,_0x1411e0);}if(!_0xbcba2c){return handleError(_0xcdaf3f,0x194,{'message':_0x8c27('0x2f')});}else{var _0x2fc018={'payload':{'id':_0xbcba2c['id'],'role':_0xbcba2c[_0x8c27('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x8c27('0x30')](_0x2fc018)[_0x8c27('0xb')](function(_0x3d33ce){_0xcdaf3f[_0x8c27('0x31')]({'id':_0xbcba2c['id'],'token':_0x3d33ce,'statusCall':'','isAlreadyLogged':_0xbcba2c[_0x8c27('0x32')]});});}})(_0x38fa1a,_0xcdaf3f,_0x55387f);};exports[_0x8c27('0x33')]=function(_0x395578,_0x284b58){if(!_0x395578[_0x8c27('0x34')][_0x8c27('0x1e')]){return handleError(_0x284b58,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xa2e2f9=rs[_0x8c27('0x35')]();_0x395578['body'][_0x8c27('0x1e')]=_0x395578['body'][_0x8c27('0x1e')][_0x8c27('0x36')]()['toLowerCase']();var _0x1650b1;return db[_0x8c27('0x7')][_0x8c27('0x8')]({'where':{'id':0x1},'attributes':[_0x8c27('0x9'),_0x8c27('0xa')],'raw':!![]})[_0x8c27('0xb')](function(_0x44ef46){_0x1650b1=_0x44ef46;return db[_0x8c27('0x37')][_0x8c27('0x1d')]({'where':{'email':_0x395578[_0x8c27('0x34')]['email']}});})['then'](function(_0xe41564){if(!_0xe41564){throw new Error(_0x8c27('0x38'));}if(_0xe41564[_0x8c27('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0xe41564['blocked']){if(moment(_0xe41564[_0x8c27('0x12')])['add'](_0x1650b1['blockDuration'],_0x8c27('0x18'))>moment()){throw new Error(_0x8c27('0x39'));}else{_0xe41564[_0x8c27('0x11')]=![];_0xe41564[_0x8c27('0x12')]=null;}}_0xe41564['resetPasswordToken']=_0xa2e2f9;_0xe41564['resetPasswordExpires']=Date['now']()+0x36ee80;return _0xe41564[_0x8c27('0x3a')]();})[_0x8c27('0xb')](function(){return sendServiceMail({'to':_0x395578[_0x8c27('0x34')][_0x8c27('0x1e')],'subject':_0x8c27('0x3b'),'text':_0x8c27('0x3c')+_0x8c27('0x3d')+_0x8c27('0x3e')+_0x395578[_0x8c27('0x3f')][_0x8c27('0x40')]+_0x8c27('0x41')+_0xa2e2f9+'\x0a\x0a'+_0x8c27('0x42')});})[_0x8c27('0xb')](function(){_0x284b58[_0x8c27('0x2b')](0xc8)[_0x8c27('0x2c')]({'message':'Reset\x20Email\x20sent!'});})[_0x8c27('0x1a')](function(_0x4a762a){return handleError(_0x284b58,0x1f4,_0x4a762a);});};exports['reset']=function(_0x59fe35,_0x301c4f){return db[_0x8c27('0x37')][_0x8c27('0x1d')]({'where':{'resetPasswordToken':_0x59fe35[_0x8c27('0x43')][_0x8c27('0x44')],'resetPasswordExpires':{'$gt':Date[_0x8c27('0x45')]()}}})[_0x8c27('0xb')](function(_0x5e11d3){if(!_0x5e11d3){throw new Error(_0x8c27('0x46'));}return db[_0x8c27('0x7')][_0x8c27('0x8')]({'attributes':['id',_0x8c27('0x47'),_0x8c27('0x48'),'passwordHistoryLimit']})[_0x8c27('0xb')](function(_0x571dc1){if(_0x571dc1[_0x8c27('0x47')])authService['validatePasswordPattern'](_0x59fe35['body'][_0x8c27('0xd')]);if(!_0x571dc1[_0x8c27('0x48')]||!_0x5e11d3[_0x8c27('0x49')])return _0x5e11d3;authService[_0x8c27('0x4a')](_0x59fe35[_0x8c27('0x34')][_0x8c27('0xd')],_0x5e11d3[_0x8c27('0x49')],_0x571dc1[_0x8c27('0x4b')]);return _0x5e11d3;})['then'](function(){_0x5e11d3['password']=_0x59fe35[_0x8c27('0x34')][_0x8c27('0xd')];_0x5e11d3[_0x8c27('0x4c')]=null;_0x5e11d3[_0x8c27('0x4d')]=null;return _0x5e11d3[_0x8c27('0x3a')]();});})[_0x8c27('0xb')](function(){_0x301c4f[_0x8c27('0x2b')](0xc8)[_0x8c27('0x2c')]({'message':_0x8c27('0x4e')});})[_0x8c27('0x1a')](function(_0x5ba874){return handleError(_0x301c4f,0x1f4,_0x5ba874);});};passport[_0x8c27('0x4f')](_0x8c27('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x5eaa8c,_0x45c5e6,_0x41ae9a){return localAuthenticate(db[_0x8c27('0x37')],_0x5eaa8c,_0x45c5e6,_0x41ae9a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index ba1be3f..61b1786 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9ac1=['reset','exports','post','/forgot','forgot','/reset/:token'];(function(_0x154cb5,_0x1a8d5a){var _0x3f574f=function(_0x597a52){while(--_0x597a52){_0x154cb5['push'](_0x154cb5['shift']());}};_0x3f574f(++_0x1a8d5a);}(_0x9ac1,0x146));var _0x19ac=function(_0x915aab,_0x47ca95){_0x915aab=_0x915aab-0x0;var _0x300a7d=_0x9ac1[_0x915aab];return _0x300a7d;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x19ac('0x0')]('/',controller['login']);router[_0x19ac('0x0')](_0x19ac('0x1'),controller[_0x19ac('0x2')]);router[_0x19ac('0x0')](_0x19ac('0x3'),controller[_0x19ac('0x4')]);module[_0x19ac('0x5')]=router;
\ No newline at end of file
+var _0x59fd=['forgot','/reset/:token','reset','exports','Router','post','login','/forgot'];(function(_0x2fbaa4,_0x1f5e49){var _0x1a50d6=function(_0x5290a0){while(--_0x5290a0){_0x2fbaa4['push'](_0x2fbaa4['shift']());}};_0x1a50d6(++_0x1f5e49);}(_0x59fd,0x1dc));var _0xd59f=function(_0x26ab88,_0x4ef1bf){_0x26ab88=_0x26ab88-0x0;var _0x276b1c=_0x59fd[_0x26ab88];return _0x276b1c;};'use strict';var express=require('express');var router=express[_0xd59f('0x0')]();var controller=require('./authLocal.controller');router[_0xd59f('0x1')]('/',controller[_0xd59f('0x2')]);router[_0xd59f('0x1')](_0xd59f('0x3'),controller[_0xd59f('0x4')]);router[_0xd59f('0x1')](_0xd59f('0x5'),controller[_0xd59f('0x6')]);module[_0xd59f('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index a6ad497..0888a93 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5867=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x5867,0x150));var _0x7586=function(_0x1a0e25,_0x4d3c1f){_0x1a0e25=_0x1a0e25-0x0;var _0x33d1e4=_0x5867[_0x1a0e25];return _0x33d1e4;};'use strict';var Sequelize=require(_0x7586('0x0'));module[_0x7586('0x1')]={'name':{'type':Sequelize[_0x7586('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x7586('0x2')]},'description':{'type':Sequelize[_0x7586('0x2')]},'status':{'type':Sequelize[_0x7586('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x7586('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x382c=['STRING','BOOLEAN','INTEGER','exports'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0x382c,0xcb));var _0xc382=function(_0x117643,_0x2b3351){_0x117643=_0x117643-0x0;var _0x4f9ce1=_0x382c[_0x117643];return _0x4f9ce1;};'use strict';var Sequelize=require('sequelize');module[_0xc382('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc382('0x1')]},'status':{'type':Sequelize[_0xc382('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xc382('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index b062cb2..bb634c4 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf676=['end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','update','destroy','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x2e2cae,_0x20132a){var _0x43fa43=function(_0xc32b80){while(--_0xc32b80){_0x2e2cae['push'](_0x2e2cae['shift']());}};_0x43fa43(++_0x20132a);}(_0xf676,0xe9));var _0x6f67=function(_0x56984b,_0x4bd909){_0x56984b=_0x56984b-0x0;var _0x42024b=_0xf676[_0x56984b];return _0x42024b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f67('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f67('0x1'));var rp=require(_0x6f67('0x2'));var moment=require(_0x6f67('0x3'));var BPromise=require(_0x6f67('0x4'));var Mustache=require(_0x6f67('0x5'));var util=require(_0x6f67('0x6'));var path=require(_0x6f67('0x7'));var sox=require(_0x6f67('0x8'));var csv=require(_0x6f67('0x9'));var ejs=require(_0x6f67('0xa'));var fs=require('fs');var fs_extra=require(_0x6f67('0xb'));var _=require(_0x6f67('0xc'));var squel=require(_0x6f67('0xd'));var crypto=require('crypto');var jsforce=require(_0x6f67('0xe'));var deskjs=require(_0x6f67('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6f67('0x10'));var Papa=require(_0x6f67('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f67('0x12'));var as=require(_0x6f67('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f67('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6f67('0x15'));var licenseUtil=require(_0x6f67('0x16'));var db=require(_0x6f67('0x17'))['db'];function respondWithStatusCode(_0x407b9c,_0x342d2f){_0x342d2f=_0x342d2f||0xcc;return function(_0x774cb7){if(_0x774cb7){return _0x407b9c[_0x6f67('0x18')](_0x342d2f);}return _0x407b9c['status'](_0x342d2f)[_0x6f67('0x19')]();};}function respondWithResult(_0xd02d46,_0x49abe1){_0x49abe1=_0x49abe1||0xc8;return function(_0x4edfec){if(_0x4edfec){return _0xd02d46['status'](_0x49abe1)[_0x6f67('0x1a')](_0x4edfec);}};}function respondWithFilteredResult(_0x471e5a,_0x37b084){return function(_0x279b9e){if(_0x279b9e){var _0x583ff9=typeof _0x37b084['offset']===_0x6f67('0x1b')&&typeof _0x37b084['limit']===_0x6f67('0x1b');var _0xb8b58=_0x279b9e[_0x6f67('0x1c')];var _0x104565=_0x583ff9?0x0:_0x37b084['offset'];var _0x253f61=_0x583ff9?_0x279b9e['count']:_0x37b084[_0x6f67('0x1d')]+_0x37b084[_0x6f67('0x1e')];var _0x5380f6;if(_0x253f61>=_0xb8b58){_0x253f61=_0xb8b58;_0x5380f6=0xc8;}else{_0x5380f6=0xce;}_0x471e5a[_0x6f67('0x1f')](_0x5380f6);return _0x471e5a[_0x6f67('0x20')](_0x6f67('0x21'),_0x104565+'-'+_0x253f61+'/'+_0xb8b58)[_0x6f67('0x1a')](_0x279b9e);}return null;};}function patchUpdates(_0x51b0e4){return function(_0x27cf4d){try{jsonpatch[_0x6f67('0x22')](_0x27cf4d,_0x51b0e4,!![]);}catch(_0x46e32b){return BPromise[_0x6f67('0x23')](_0x46e32b);}return _0x27cf4d[_0x6f67('0x24')]();};}function saveUpdates(_0x1ccf68,_0x24b5ef){return function(_0x222f62){if(_0x222f62){return _0x222f62['update'](_0x1ccf68)['then'](function(_0x516f62){return _0x516f62;});}return null;};}function removeEntity(_0x729104,_0x481584){return function(_0x588db5){if(_0x588db5){return _0x588db5['destroy']()[_0x6f67('0x25')](function(){_0x729104[_0x6f67('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x429eac,_0x35f84b){return function(_0x5c3615){if(!_0x5c3615){_0x429eac['sendStatus'](0x194);}return _0x5c3615;};}function handleError(_0xa1da90,_0x17aaa6){_0x17aaa6=_0x17aaa6||0x1f4;return function(_0x134fcc){logger[_0x6f67('0x26')](_0x134fcc[_0x6f67('0x27')]);if(_0x134fcc[_0x6f67('0x28')]){delete _0x134fcc[_0x6f67('0x28')];}_0xa1da90[_0x6f67('0x1f')](_0x17aaa6)[_0x6f67('0x29')](_0x134fcc);};}exports[_0x6f67('0x2a')]=function(_0x28e545,_0x8aeef8){var _0x41f871={},_0x2fc627={},_0x6041f4={'count':0x0,'rows':[]};var _0x3f976d=_['map'](db[_0x6f67('0x2b')][_0x6f67('0x2c')],function(_0x19c3d2){return{'name':_0x19c3d2[_0x6f67('0x2d')],'type':_0x19c3d2[_0x6f67('0x2e')]['key']};});_0x2fc627[_0x6f67('0x2f')]=_[_0x6f67('0x30')](_0x3f976d,'name');_0x2fc627[_0x6f67('0x31')]=_[_0x6f67('0x32')](_0x28e545['query']);_0x2fc627[_0x6f67('0x33')]=_[_0x6f67('0x34')](_0x2fc627[_0x6f67('0x2f')],_0x2fc627[_0x6f67('0x31')]);_0x41f871[_0x6f67('0x35')]=_[_0x6f67('0x34')](_0x2fc627[_0x6f67('0x2f')],qs[_0x6f67('0x36')](_0x28e545['query'][_0x6f67('0x36')]));_0x41f871[_0x6f67('0x35')]=_0x41f871[_0x6f67('0x35')][_0x6f67('0x37')]?_0x41f871['attributes']:_0x2fc627['model'];if(!_0x28e545[_0x6f67('0x31')][_0x6f67('0x38')](_0x6f67('0x39'))){_0x41f871[_0x6f67('0x1e')]=qs[_0x6f67('0x1e')](_0x28e545[_0x6f67('0x31')][_0x6f67('0x1e')]);_0x41f871['offset']=qs[_0x6f67('0x1d')](_0x28e545[_0x6f67('0x31')]['offset']);}_0x41f871[_0x6f67('0x3a')]=qs[_0x6f67('0x3b')](_0x28e545['query']['sort']);_0x41f871[_0x6f67('0x3c')]=qs[_0x6f67('0x33')](_[_0x6f67('0x3d')](_0x28e545['query'],_0x2fc627[_0x6f67('0x33')]),_0x3f976d);if(_0x28e545['query'][_0x6f67('0x3e')]){_0x41f871[_0x6f67('0x3c')]=_[_0x6f67('0x3f')](_0x41f871[_0x6f67('0x3c')],{'$or':_['map'](_0x3f976d,function(_0x5b07e0){if(_0x5b07e0[_0x6f67('0x2e')]!==_0x6f67('0x40')){var _0x331c5c={};_0x331c5c[_0x5b07e0[_0x6f67('0x28')]]={'$like':'%'+_0x28e545['query'][_0x6f67('0x3e')]+'%'};return _0x331c5c;}})});}_0x41f871=_[_0x6f67('0x3f')]({},_0x41f871,_0x28e545[_0x6f67('0x41')]);var _0x5374d2={'where':_0x41f871['where']};return db[_0x6f67('0x2b')]['count'](_0x5374d2)[_0x6f67('0x25')](function(_0x18d9ad){_0x6041f4[_0x6f67('0x1c')]=_0x18d9ad;if(_0x28e545[_0x6f67('0x31')]['includeAll']){_0x41f871['include']=[{'all':!![]}];}return db[_0x6f67('0x2b')][_0x6f67('0x42')](_0x41f871);})[_0x6f67('0x25')](function(_0x8a0b6e){_0x6041f4['rows']=_0x8a0b6e;return _0x6041f4;})['then'](respondWithFilteredResult(_0x8aeef8,_0x41f871))[_0x6f67('0x43')](handleError(_0x8aeef8,null));};exports[_0x6f67('0x44')]=function(_0x5b1d1e,_0x119bc6){var _0x3a2653={'raw':![],'where':{'id':_0x5b1d1e[_0x6f67('0x45')]['id']}},_0x296bad={};_0x296bad[_0x6f67('0x2f')]=_[_0x6f67('0x32')](db[_0x6f67('0x2b')][_0x6f67('0x2c')]);_0x296bad[_0x6f67('0x31')]=_['keys'](_0x5b1d1e[_0x6f67('0x31')]);_0x296bad['filters']=_[_0x6f67('0x34')](_0x296bad[_0x6f67('0x2f')],_0x296bad[_0x6f67('0x31')]);_0x3a2653['attributes']=_['intersection'](_0x296bad['model'],qs[_0x6f67('0x36')](_0x5b1d1e[_0x6f67('0x31')][_0x6f67('0x36')]));_0x3a2653[_0x6f67('0x35')]=_0x3a2653['attributes']['length']?_0x3a2653[_0x6f67('0x35')]:_0x296bad['model'];if(_0x5b1d1e['query'][_0x6f67('0x46')]){_0x3a2653[_0x6f67('0x47')]=[{'all':!![]}];}_0x3a2653=_[_0x6f67('0x3f')]({},_0x3a2653,_0x5b1d1e[_0x6f67('0x41')]);return db[_0x6f67('0x2b')][_0x6f67('0x48')](_0x3a2653)[_0x6f67('0x25')](handleEntityNotFound(_0x119bc6,null))[_0x6f67('0x25')](respondWithResult(_0x119bc6,null))[_0x6f67('0x43')](handleError(_0x119bc6,null));};exports[_0x6f67('0x49')]=function(_0x4be24a,_0x472fab){return db['Automation']['create'](_0x4be24a[_0x6f67('0x4a')],{})[_0x6f67('0x25')](respondWithResult(_0x472fab,0xc9))[_0x6f67('0x43')](handleError(_0x472fab,null));};exports[_0x6f67('0x4b')]=function(_0x5aec68,_0x596306){if(_0x5aec68['body']['id']){delete _0x5aec68[_0x6f67('0x4a')]['id'];}return db[_0x6f67('0x2b')][_0x6f67('0x48')]({'where':{'id':_0x5aec68[_0x6f67('0x45')]['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x596306,null))['then'](saveUpdates(_0x5aec68[_0x6f67('0x4a')],null))[_0x6f67('0x25')](respondWithResult(_0x596306,null))['catch'](handleError(_0x596306,null));};exports[_0x6f67('0x4c')]=function(_0x2880c7,_0x381096){return db[_0x6f67('0x2b')]['find']({'where':{'id':_0x2880c7[_0x6f67('0x45')]['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x381096,null))['then'](removeEntity(_0x381096,null))[_0x6f67('0x43')](handleError(_0x381096,null));};exports[_0x6f67('0x4d')]=function(_0x56ddfd,_0x867604,_0x33cf57){return db['Condition'][_0x6f67('0x48')]({'where':{'id':_0x56ddfd['params']['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x867604,null))[_0x6f67('0x25')](function(_0x2cff79){if(_0x2cff79){return _0x2cff79[_0x6f67('0x4d')](_0x56ddfd['body'][_0x6f67('0x4e')],_[_0x6f67('0x4f')](_0x56ddfd[_0x6f67('0x4a')],[_0x6f67('0x4e'),'id'])||{});}})[_0x6f67('0x25')](respondWithResult(_0x867604,null))[_0x6f67('0x43')](handleError(_0x867604,null));};exports[_0x6f67('0x50')]=function(_0x2c5f37,_0x4117cc,_0x64fc3a){var _0x12c918={};var _0x231fe6={};var _0x42adf3;var _0x2057eb;return db[_0x6f67('0x2b')][_0x6f67('0x51')]({'where':{'id':_0x2c5f37['params']['id']}})['then'](handleEntityNotFound(_0x4117cc,null))['then'](function(_0xe9e5d4){if(_0xe9e5d4){_0x42adf3=_0xe9e5d4;_0x231fe6[_0x6f67('0x2f')]=_[_0x6f67('0x32')](db[_0x6f67('0x52')][_0x6f67('0x2c')]);_0x231fe6[_0x6f67('0x31')]=_[_0x6f67('0x32')](_0x2c5f37[_0x6f67('0x31')]);_0x231fe6[_0x6f67('0x33')]=_[_0x6f67('0x34')](_0x231fe6[_0x6f67('0x2f')],_0x231fe6['query']);_0x12c918['attributes']=_[_0x6f67('0x34')](_0x231fe6[_0x6f67('0x2f')],qs[_0x6f67('0x36')](_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x36')]));_0x12c918['attributes']=_0x12c918['attributes']['length']?_0x12c918['attributes']:_0x231fe6[_0x6f67('0x2f')];_0x12c918[_0x6f67('0x3a')]=qs[_0x6f67('0x3b')](_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x3b')]);_0x12c918[_0x6f67('0x3c')]=qs[_0x6f67('0x33')](_[_0x6f67('0x3d')](_0x2c5f37[_0x6f67('0x31')],_0x231fe6['filters']));if(_0x2c5f37['query'][_0x6f67('0x3e')]){_0x12c918['where']=_[_0x6f67('0x3f')](_0x12c918[_0x6f67('0x3c')],{'$or':_[_0x6f67('0x30')](_0x12c918[_0x6f67('0x35')],function(_0x5c26b0){var _0x5c42b4={};_0x5c42b4[_0x5c26b0]={'$like':'%'+_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x3e')]+'%'};return _0x5c42b4;})});}_0x12c918=_[_0x6f67('0x3f')]({},_0x12c918,_0x2c5f37[_0x6f67('0x41')]);return _0x42adf3['getConditions'](_0x12c918);}})[_0x6f67('0x25')](function(_0x546dff){if(_0x546dff){_0x2057eb=_0x546dff[_0x6f67('0x37')];if(!_0x2c5f37[_0x6f67('0x31')][_0x6f67('0x38')](_0x6f67('0x39'))){_0x12c918[_0x6f67('0x1e')]=qs[_0x6f67('0x1e')](_0x2c5f37['query'][_0x6f67('0x1e')]);_0x12c918[_0x6f67('0x1d')]=qs[_0x6f67('0x1d')](_0x2c5f37['query'][_0x6f67('0x1d')]);}return _0x42adf3[_0x6f67('0x50')](_0x12c918);}})['then'](function(_0x40d6da){if(_0x40d6da){return _0x40d6da?{'count':_0x2057eb,'rows':_0x40d6da}:null;}})['then'](respondWithResult(_0x4117cc,null))[_0x6f67('0x43')](handleError(_0x4117cc,null));};exports[_0x6f67('0x53')]=function(_0x4816dd,_0x505b75,_0x509f57){return db[_0x6f67('0x54')]['find']({'where':{'id':_0x4816dd[_0x6f67('0x45')]['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x505b75,null))[_0x6f67('0x25')](function(_0x5430cf){if(_0x5430cf){return _0x5430cf[_0x6f67('0x53')](_0x4816dd[_0x6f67('0x4a')][_0x6f67('0x4e')],_['omit'](_0x4816dd[_0x6f67('0x4a')],[_0x6f67('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x505b75,null))[_0x6f67('0x43')](handleError(_0x505b75,null));};exports[_0x6f67('0x55')]=function(_0x556744,_0x447f4e,_0x2d3e05){var _0x1165ac={};var _0x3e4dcf={};var _0x2457fe;var _0x185e74;return db[_0x6f67('0x2b')]['findOne']({'where':{'id':_0x556744['params']['id']}})[_0x6f67('0x25')](handleEntityNotFound(_0x447f4e,null))[_0x6f67('0x25')](function(_0x441eae){if(_0x441eae){_0x2457fe=_0x441eae;_0x3e4dcf[_0x6f67('0x2f')]=_[_0x6f67('0x32')](db[_0x6f67('0x54')][_0x6f67('0x2c')]);_0x3e4dcf[_0x6f67('0x31')]=_[_0x6f67('0x32')](_0x556744['query']);_0x3e4dcf[_0x6f67('0x33')]=_['intersection'](_0x3e4dcf[_0x6f67('0x2f')],_0x3e4dcf['query']);_0x1165ac['attributes']=_[_0x6f67('0x34')](_0x3e4dcf[_0x6f67('0x2f')],qs['fields'](_0x556744[_0x6f67('0x31')][_0x6f67('0x36')]));_0x1165ac[_0x6f67('0x35')]=_0x1165ac['attributes']['length']?_0x1165ac['attributes']:_0x3e4dcf[_0x6f67('0x2f')];_0x1165ac[_0x6f67('0x3a')]=qs[_0x6f67('0x3b')](_0x556744[_0x6f67('0x31')][_0x6f67('0x3b')]);_0x1165ac[_0x6f67('0x3c')]=qs[_0x6f67('0x33')](_[_0x6f67('0x3d')](_0x556744['query'],_0x3e4dcf[_0x6f67('0x33')]));if(_0x556744[_0x6f67('0x31')][_0x6f67('0x3e')]){_0x1165ac[_0x6f67('0x3c')]=_[_0x6f67('0x3f')](_0x1165ac[_0x6f67('0x3c')],{'$or':_[_0x6f67('0x30')](_0x1165ac['attributes'],function(_0x244c4d){var _0x5d14af={};_0x5d14af[_0x244c4d]={'$like':'%'+_0x556744[_0x6f67('0x31')][_0x6f67('0x3e')]+'%'};return _0x5d14af;})});}_0x1165ac=_[_0x6f67('0x3f')]({},_0x1165ac,_0x556744['options']);return _0x2457fe['getActions'](_0x1165ac);}})[_0x6f67('0x25')](function(_0x4618f){if(_0x4618f){_0x185e74=_0x4618f[_0x6f67('0x37')];if(!_0x556744[_0x6f67('0x31')][_0x6f67('0x38')]('nolimit')){_0x1165ac[_0x6f67('0x1e')]=qs[_0x6f67('0x1e')](_0x556744['query'][_0x6f67('0x1e')]);_0x1165ac[_0x6f67('0x1d')]=qs[_0x6f67('0x1d')](_0x556744[_0x6f67('0x31')]['offset']);}return _0x2457fe[_0x6f67('0x55')](_0x1165ac);}})[_0x6f67('0x25')](function(_0x431024){if(_0x431024){return _0x431024?{'count':_0x185e74,'rows':_0x431024}:null;}})[_0x6f67('0x25')](respondWithResult(_0x447f4e,null))[_0x6f67('0x43')](handleError(_0x447f4e,null));};
\ No newline at end of file
+var _0xf88b=['keys','find','create','body','params','Condition','omit','ids','findOne','sort','pick','options','getConditions','addActions','Action','getActions','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','where','filter','merge','includeAll','include','findAll','catch','show'];(function(_0x2335e6,_0x1bade8){var _0x370a50=function(_0x12d7cf){while(--_0x12d7cf){_0x2335e6['push'](_0x2335e6['shift']());}};_0x370a50(++_0x1bade8);}(_0xf88b,0x1b0));var _0xbf88=function(_0x3f7d36,_0x1b1474){_0x3f7d36=_0x3f7d36-0x0;var _0x1d5259=_0xf88b[_0x3f7d36];return _0x1d5259;};'use strict';var emlformat=require(_0xbf88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf88('0x1'));var jsonpatch=require(_0xbf88('0x2'));var rp=require(_0xbf88('0x3'));var moment=require(_0xbf88('0x4'));var BPromise=require(_0xbf88('0x5'));var Mustache=require(_0xbf88('0x6'));var util=require(_0xbf88('0x7'));var path=require(_0xbf88('0x8'));var sox=require('sox');var csv=require(_0xbf88('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbf88('0xa'));var squel=require(_0xbf88('0xb'));var crypto=require('crypto');var jsforce=require(_0xbf88('0xc'));var deskjs=require(_0xbf88('0xd'));var toCsv=require(_0xbf88('0x9'));var querystring=require(_0xbf88('0xe'));var Papa=require(_0xbf88('0xf'));var Redis=require(_0xbf88('0x10'));var authService=require(_0xbf88('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf88('0x12'));var logger=require(_0xbf88('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbf88('0x14'));var licenseUtil=require(_0xbf88('0x15'));var db=require(_0xbf88('0x16'))['db'];function respondWithStatusCode(_0x42bf91,_0x30787e){_0x30787e=_0x30787e||0xcc;return function(_0x3c928c){if(_0x3c928c){return _0x42bf91[_0xbf88('0x17')](_0x30787e);}return _0x42bf91[_0xbf88('0x18')](_0x30787e)[_0xbf88('0x19')]();};}function respondWithResult(_0xacf284,_0x5e2b5f){_0x5e2b5f=_0x5e2b5f||0xc8;return function(_0x383ddc){if(_0x383ddc){return _0xacf284[_0xbf88('0x18')](_0x5e2b5f)[_0xbf88('0x1a')](_0x383ddc);}};}function respondWithFilteredResult(_0x1e215d,_0x492aa5){return function(_0xb245aa){if(_0xb245aa){var _0x5459d2=typeof _0x492aa5[_0xbf88('0x1b')]===_0xbf88('0x1c')&&typeof _0x492aa5[_0xbf88('0x1d')]===_0xbf88('0x1c');var _0x16e0f6=_0xb245aa['count'];var _0xba4277=_0x5459d2?0x0:_0x492aa5[_0xbf88('0x1b')];var _0x2e64af=_0x5459d2?_0xb245aa[_0xbf88('0x1e')]:_0x492aa5[_0xbf88('0x1b')]+_0x492aa5[_0xbf88('0x1d')];var _0x43bad7;if(_0x2e64af>=_0x16e0f6){_0x2e64af=_0x16e0f6;_0x43bad7=0xc8;}else{_0x43bad7=0xce;}_0x1e215d[_0xbf88('0x18')](_0x43bad7);return _0x1e215d[_0xbf88('0x1f')](_0xbf88('0x20'),_0xba4277+'-'+_0x2e64af+'/'+_0x16e0f6)[_0xbf88('0x1a')](_0xb245aa);}return null;};}function patchUpdates(_0x5a4dd3){return function(_0x3b803a){try{jsonpatch[_0xbf88('0x21')](_0x3b803a,_0x5a4dd3,!![]);}catch(_0x2af36c){return BPromise[_0xbf88('0x22')](_0x2af36c);}return _0x3b803a[_0xbf88('0x23')]();};}function saveUpdates(_0x282553,_0x26ef00){return function(_0x4bdb1d){if(_0x4bdb1d){return _0x4bdb1d[_0xbf88('0x24')](_0x282553)[_0xbf88('0x25')](function(_0x2e1b5a){return _0x2e1b5a;});}return null;};}function removeEntity(_0x4b89ca,_0xc15bc6){return function(_0x24bd77){if(_0x24bd77){return _0x24bd77[_0xbf88('0x26')]()[_0xbf88('0x25')](function(){_0x4b89ca[_0xbf88('0x18')](0xcc)[_0xbf88('0x19')]();});}};}function handleEntityNotFound(_0x183e03,_0x186c4c){return function(_0x4773f7){if(!_0x4773f7){_0x183e03[_0xbf88('0x17')](0x194);}return _0x4773f7;};}function handleError(_0x14529f,_0x171e39){_0x171e39=_0x171e39||0x1f4;return function(_0x580f0d){logger[_0xbf88('0x27')](_0x580f0d[_0xbf88('0x28')]);if(_0x580f0d[_0xbf88('0x29')]){delete _0x580f0d[_0xbf88('0x29')];}_0x14529f['status'](_0x171e39)[_0xbf88('0x2a')](_0x580f0d);};}exports[_0xbf88('0x2b')]=function(_0x1404c6,_0xb307dd){var _0x4fa1dd={},_0xd0adfb={},_0x115c9a={'count':0x0,'rows':[]};var _0x3a9aca=_[_0xbf88('0x2c')](db[_0xbf88('0x2d')][_0xbf88('0x2e')],function(_0x454006){return{'name':_0x454006['fieldName'],'type':_0x454006[_0xbf88('0x2f')][_0xbf88('0x30')]};});_0xd0adfb['model']=_[_0xbf88('0x2c')](_0x3a9aca,_0xbf88('0x29'));_0xd0adfb['query']=_['keys'](_0x1404c6[_0xbf88('0x31')]);_0xd0adfb[_0xbf88('0x32')]=_['intersection'](_0xd0adfb[_0xbf88('0x33')],_0xd0adfb[_0xbf88('0x31')]);_0x4fa1dd[_0xbf88('0x34')]=_[_0xbf88('0x35')](_0xd0adfb[_0xbf88('0x33')],qs[_0xbf88('0x36')](_0x1404c6[_0xbf88('0x31')][_0xbf88('0x36')]));_0x4fa1dd[_0xbf88('0x34')]=_0x4fa1dd[_0xbf88('0x34')][_0xbf88('0x37')]?_0x4fa1dd[_0xbf88('0x34')]:_0xd0adfb[_0xbf88('0x33')];if(!_0x1404c6[_0xbf88('0x31')]['hasOwnProperty'](_0xbf88('0x38'))){_0x4fa1dd[_0xbf88('0x1d')]=qs['limit'](_0x1404c6[_0xbf88('0x31')][_0xbf88('0x1d')]);_0x4fa1dd[_0xbf88('0x1b')]=qs[_0xbf88('0x1b')](_0x1404c6[_0xbf88('0x31')][_0xbf88('0x1b')]);}_0x4fa1dd[_0xbf88('0x39')]=qs['sort'](_0x1404c6[_0xbf88('0x31')]['sort']);_0x4fa1dd[_0xbf88('0x3a')]=qs[_0xbf88('0x32')](_['pick'](_0x1404c6[_0xbf88('0x31')],_0xd0adfb[_0xbf88('0x32')]),_0x3a9aca);if(_0x1404c6[_0xbf88('0x31')][_0xbf88('0x3b')]){_0x4fa1dd[_0xbf88('0x3a')]=_[_0xbf88('0x3c')](_0x4fa1dd['where'],{'$or':_[_0xbf88('0x2c')](_0x3a9aca,function(_0x36e820){if(_0x36e820[_0xbf88('0x2f')]!=='VIRTUAL'){var _0x3c9223={};_0x3c9223[_0x36e820[_0xbf88('0x29')]]={'$like':'%'+_0x1404c6['query'][_0xbf88('0x3b')]+'%'};return _0x3c9223;}})});}_0x4fa1dd=_[_0xbf88('0x3c')]({},_0x4fa1dd,_0x1404c6['options']);var _0x3e6b8b={'where':_0x4fa1dd[_0xbf88('0x3a')]};return db[_0xbf88('0x2d')][_0xbf88('0x1e')](_0x3e6b8b)[_0xbf88('0x25')](function(_0x579071){_0x115c9a[_0xbf88('0x1e')]=_0x579071;if(_0x1404c6['query'][_0xbf88('0x3d')]){_0x4fa1dd[_0xbf88('0x3e')]=[{'all':!![]}];}return db[_0xbf88('0x2d')][_0xbf88('0x3f')](_0x4fa1dd);})[_0xbf88('0x25')](function(_0x12098f){_0x115c9a['rows']=_0x12098f;return _0x115c9a;})[_0xbf88('0x25')](respondWithFilteredResult(_0xb307dd,_0x4fa1dd))[_0xbf88('0x40')](handleError(_0xb307dd,null));};exports[_0xbf88('0x41')]=function(_0x5de0e4,_0x6f5193){var _0x4fa182={'raw':![],'where':{'id':_0x5de0e4['params']['id']}},_0x493671={};_0x493671[_0xbf88('0x33')]=_['keys'](db[_0xbf88('0x2d')][_0xbf88('0x2e')]);_0x493671[_0xbf88('0x31')]=_[_0xbf88('0x42')](_0x5de0e4[_0xbf88('0x31')]);_0x493671[_0xbf88('0x32')]=_[_0xbf88('0x35')](_0x493671[_0xbf88('0x33')],_0x493671[_0xbf88('0x31')]);_0x4fa182[_0xbf88('0x34')]=_['intersection'](_0x493671[_0xbf88('0x33')],qs[_0xbf88('0x36')](_0x5de0e4[_0xbf88('0x31')][_0xbf88('0x36')]));_0x4fa182[_0xbf88('0x34')]=_0x4fa182[_0xbf88('0x34')]['length']?_0x4fa182[_0xbf88('0x34')]:_0x493671[_0xbf88('0x33')];if(_0x5de0e4[_0xbf88('0x31')][_0xbf88('0x3d')]){_0x4fa182[_0xbf88('0x3e')]=[{'all':!![]}];}_0x4fa182=_[_0xbf88('0x3c')]({},_0x4fa182,_0x5de0e4['options']);return db[_0xbf88('0x2d')][_0xbf88('0x43')](_0x4fa182)[_0xbf88('0x25')](handleEntityNotFound(_0x6f5193,null))[_0xbf88('0x25')](respondWithResult(_0x6f5193,null))[_0xbf88('0x40')](handleError(_0x6f5193,null));};exports[_0xbf88('0x44')]=function(_0x2872bc,_0x47d1fe){return db[_0xbf88('0x2d')]['create'](_0x2872bc[_0xbf88('0x45')],{})[_0xbf88('0x25')](respondWithResult(_0x47d1fe,0xc9))['catch'](handleError(_0x47d1fe,null));};exports['update']=function(_0x4c5fce,_0x429894){if(_0x4c5fce[_0xbf88('0x45')]['id']){delete _0x4c5fce[_0xbf88('0x45')]['id'];}return db[_0xbf88('0x2d')][_0xbf88('0x43')]({'where':{'id':_0x4c5fce[_0xbf88('0x46')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x429894,null))[_0xbf88('0x25')](saveUpdates(_0x4c5fce[_0xbf88('0x45')],null))[_0xbf88('0x25')](respondWithResult(_0x429894,null))[_0xbf88('0x40')](handleError(_0x429894,null));};exports[_0xbf88('0x26')]=function(_0x251ede,_0x5a7594){return db['Automation'][_0xbf88('0x43')]({'where':{'id':_0x251ede[_0xbf88('0x46')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x5a7594,null))[_0xbf88('0x25')](removeEntity(_0x5a7594,null))['catch'](handleError(_0x5a7594,null));};exports['addConditions']=function(_0x495138,_0x52d2e6,_0x5b6b66){return db[_0xbf88('0x47')]['find']({'where':{'id':_0x495138[_0xbf88('0x46')]['id']}})[_0xbf88('0x25')](handleEntityNotFound(_0x52d2e6,null))[_0xbf88('0x25')](function(_0x568db1){if(_0x568db1){return _0x568db1['addConditions'](_0x495138[_0xbf88('0x45')]['ids'],_[_0xbf88('0x48')](_0x495138[_0xbf88('0x45')],[_0xbf88('0x49'),'id'])||{});}})[_0xbf88('0x25')](respondWithResult(_0x52d2e6,null))['catch'](handleError(_0x52d2e6,null));};exports['getConditions']=function(_0x4e6ad2,_0x4f8082,_0x592906){var _0x5920f9={};var _0x5c414c={};var _0x55a429;var _0x199f2b;return db[_0xbf88('0x2d')][_0xbf88('0x4a')]({'where':{'id':_0x4e6ad2['params']['id']}})['then'](handleEntityNotFound(_0x4f8082,null))[_0xbf88('0x25')](function(_0x521b9a){if(_0x521b9a){_0x55a429=_0x521b9a;_0x5c414c[_0xbf88('0x33')]=_['keys'](db['Condition'][_0xbf88('0x2e')]);_0x5c414c[_0xbf88('0x31')]=_[_0xbf88('0x42')](_0x4e6ad2[_0xbf88('0x31')]);_0x5c414c[_0xbf88('0x32')]=_['intersection'](_0x5c414c['model'],_0x5c414c[_0xbf88('0x31')]);_0x5920f9[_0xbf88('0x34')]=_[_0xbf88('0x35')](_0x5c414c[_0xbf88('0x33')],qs[_0xbf88('0x36')](_0x4e6ad2['query']['fields']));_0x5920f9[_0xbf88('0x34')]=_0x5920f9[_0xbf88('0x34')]['length']?_0x5920f9[_0xbf88('0x34')]:_0x5c414c[_0xbf88('0x33')];_0x5920f9['order']=qs[_0xbf88('0x4b')](_0x4e6ad2['query']['sort']);_0x5920f9[_0xbf88('0x3a')]=qs[_0xbf88('0x32')](_[_0xbf88('0x4c')](_0x4e6ad2[_0xbf88('0x31')],_0x5c414c['filters']));if(_0x4e6ad2[_0xbf88('0x31')][_0xbf88('0x3b')]){_0x5920f9[_0xbf88('0x3a')]=_[_0xbf88('0x3c')](_0x5920f9[_0xbf88('0x3a')],{'$or':_[_0xbf88('0x2c')](_0x5920f9[_0xbf88('0x34')],function(_0x33b987){var _0x1e10bd={};_0x1e10bd[_0x33b987]={'$like':'%'+_0x4e6ad2[_0xbf88('0x31')]['filter']+'%'};return _0x1e10bd;})});}_0x5920f9=_['merge']({},_0x5920f9,_0x4e6ad2[_0xbf88('0x4d')]);return _0x55a429[_0xbf88('0x4e')](_0x5920f9);}})[_0xbf88('0x25')](function(_0x9477c){if(_0x9477c){_0x199f2b=_0x9477c[_0xbf88('0x37')];if(!_0x4e6ad2['query']['hasOwnProperty'](_0xbf88('0x38'))){_0x5920f9['limit']=qs[_0xbf88('0x1d')](_0x4e6ad2[_0xbf88('0x31')][_0xbf88('0x1d')]);_0x5920f9[_0xbf88('0x1b')]=qs[_0xbf88('0x1b')](_0x4e6ad2['query'][_0xbf88('0x1b')]);}return _0x55a429[_0xbf88('0x4e')](_0x5920f9);}})[_0xbf88('0x25')](function(_0x1b2ca1){if(_0x1b2ca1){return _0x1b2ca1?{'count':_0x199f2b,'rows':_0x1b2ca1}:null;}})[_0xbf88('0x25')](respondWithResult(_0x4f8082,null))[_0xbf88('0x40')](handleError(_0x4f8082,null));};exports[_0xbf88('0x4f')]=function(_0x2d62ff,_0x13038c,_0x2aa64a){return db[_0xbf88('0x50')][_0xbf88('0x43')]({'where':{'id':_0x2d62ff['params']['id']}})['then'](handleEntityNotFound(_0x13038c,null))[_0xbf88('0x25')](function(_0x1db398){if(_0x1db398){return _0x1db398[_0xbf88('0x4f')](_0x2d62ff[_0xbf88('0x45')][_0xbf88('0x49')],_[_0xbf88('0x48')](_0x2d62ff[_0xbf88('0x45')],[_0xbf88('0x49'),'id'])||{});}})[_0xbf88('0x25')](respondWithResult(_0x13038c,null))[_0xbf88('0x40')](handleError(_0x13038c,null));};exports[_0xbf88('0x51')]=function(_0x5f1abd,_0xa43462,_0x190b47){var _0x4ad4fa={};var _0x2461b3={};var _0x313b57;var _0x4c155e;return db[_0xbf88('0x2d')][_0xbf88('0x4a')]({'where':{'id':_0x5f1abd[_0xbf88('0x46')]['id']}})['then'](handleEntityNotFound(_0xa43462,null))[_0xbf88('0x25')](function(_0x3a0c3f){if(_0x3a0c3f){_0x313b57=_0x3a0c3f;_0x2461b3[_0xbf88('0x33')]=_['keys'](db[_0xbf88('0x50')]['rawAttributes']);_0x2461b3['query']=_[_0xbf88('0x42')](_0x5f1abd[_0xbf88('0x31')]);_0x2461b3[_0xbf88('0x32')]=_[_0xbf88('0x35')](_0x2461b3[_0xbf88('0x33')],_0x2461b3[_0xbf88('0x31')]);_0x4ad4fa[_0xbf88('0x34')]=_[_0xbf88('0x35')](_0x2461b3['model'],qs[_0xbf88('0x36')](_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x36')]));_0x4ad4fa[_0xbf88('0x34')]=_0x4ad4fa['attributes'][_0xbf88('0x37')]?_0x4ad4fa[_0xbf88('0x34')]:_0x2461b3[_0xbf88('0x33')];_0x4ad4fa['order']=qs['sort'](_0x5f1abd['query'][_0xbf88('0x4b')]);_0x4ad4fa[_0xbf88('0x3a')]=qs[_0xbf88('0x32')](_[_0xbf88('0x4c')](_0x5f1abd[_0xbf88('0x31')],_0x2461b3['filters']));if(_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x3b')]){_0x4ad4fa[_0xbf88('0x3a')]=_[_0xbf88('0x3c')](_0x4ad4fa[_0xbf88('0x3a')],{'$or':_['map'](_0x4ad4fa[_0xbf88('0x34')],function(_0x2934bc){var _0x35f9af={};_0x35f9af[_0x2934bc]={'$like':'%'+_0x5f1abd[_0xbf88('0x31')]['filter']+'%'};return _0x35f9af;})});}_0x4ad4fa=_[_0xbf88('0x3c')]({},_0x4ad4fa,_0x5f1abd[_0xbf88('0x4d')]);return _0x313b57[_0xbf88('0x51')](_0x4ad4fa);}})[_0xbf88('0x25')](function(_0x31ac8c){if(_0x31ac8c){_0x4c155e=_0x31ac8c[_0xbf88('0x37')];if(!_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x52')]('nolimit')){_0x4ad4fa[_0xbf88('0x1d')]=qs['limit'](_0x5f1abd[_0xbf88('0x31')][_0xbf88('0x1d')]);_0x4ad4fa[_0xbf88('0x1b')]=qs['offset'](_0x5f1abd[_0xbf88('0x31')]['offset']);}return _0x313b57[_0xbf88('0x51')](_0x4ad4fa);}})[_0xbf88('0x25')](function(_0x2f89e0){if(_0x2f89e0){return _0x2f89e0?{'count':_0x4c155e,'rows':_0x2f89e0}:null;}})[_0xbf88('0x25')](respondWithResult(_0xa43462,null))[_0xbf88('0x40')](handleError(_0xa43462,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index e5a50b6..3804be2 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x197e=['../../config/environment','exports','Automation','tools_automations','util','request-promise'];(function(_0x16d23f,_0x471ced){var _0x17b9d3=function(_0x3853a8){while(--_0x3853a8){_0x16d23f['push'](_0x16d23f['shift']());}};_0x17b9d3(++_0x471ced);}(_0x197e,0xd0));var _0xe197=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x197e[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xe197('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe197('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe197('0x2'));var attributes=require('./automation.attributes');module[_0xe197('0x3')]=function(_0x59102e,_0x1cb115){return _0x59102e['define'](_0xe197('0x4'),attributes,{'tableName':_0xe197('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80e7=['moment','path','rimraf','../../config/environment','./automation.attributes','tools_automations','util','../../config/logger','api'];(function(_0xca8113,_0x251b63){var _0x202f8d=function(_0x527a56){while(--_0x527a56){_0xca8113['push'](_0xca8113['shift']());}};_0x202f8d(++_0x251b63);}(_0x80e7,0x84));var _0x780e=function(_0x4b8c60,_0x8b2ebe){_0x4b8c60=_0x4b8c60-0x0;var _0x26a15d=_0x80e7[_0x4b8c60];return _0x26a15d;};'use strict';var _=require('lodash');var util=require(_0x780e('0x0'));var logger=require(_0x780e('0x1'))(_0x780e('0x2'));var moment=require(_0x780e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x780e('0x4'));var rimraf=require(_0x780e('0x5'));var config=require(_0x780e('0x6'));var attributes=require(_0x780e('0x7'));module['exports']=function(_0x423157,_0x449ba6){return _0x423157['define']('Automation',attributes,{'tableName':_0x780e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index c646016..5017af7 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5d0a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x29be28,_0x1d71e5){var _0x5bcc73=function(_0x4bfef0){while(--_0x4bfef0){_0x29be28['push'](_0x29be28['shift']());}};_0x5bcc73(++_0x1d71e5);}(_0x5d0a,0x175));var _0xa5d0=function(_0x29ae49,_0x2c9636){_0x29ae49=_0x29ae49-0x0;var _0x359826=_0x5d0a[_0x29ae49];return _0x359826;};'use strict';var _=require(_0xa5d0('0x0'));var util=require('util');var moment=require(_0xa5d0('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d0('0x2'));var fs=require('fs');var Redis=require(_0xa5d0('0x3'));var db=require(_0xa5d0('0x4'))['db'];var utils=require(_0xa5d0('0x5'));var logger=require('../../config/logger')(_0xa5d0('0x6'));var config=require(_0xa5d0('0x7'));var jayson=require(_0xa5d0('0x8'));var client=jayson[_0xa5d0('0x9')][_0xa5d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16af3f,_0x19d26f,_0x1841a1){return new BPromise(function(_0x295165,_0x27fe5a){return client[_0xa5d0('0xb')](_0x16af3f,_0x1841a1)['then'](function(_0x43698e){logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));logger[_0xa5d0('0xf')](_0xa5d0('0x10'),_0x19d26f,_0xa5d0('0xe'),JSON[_0xa5d0('0x11')](_0x43698e));if(_0x43698e[_0xa5d0('0x12')]){if(_0x43698e[_0xa5d0('0x12')]['code']===0x1f4){logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x27fe5a(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}logger[_0xa5d0('0x12')]('Automation,\x20%s,\x20%s',_0x19d26f,_0x43698e['error'][_0xa5d0('0x13')]);return _0x295165(_0x43698e[_0xa5d0('0x12')][_0xa5d0('0x13')]);}else{logger[_0xa5d0('0xc')](_0xa5d0('0xd'),_0x19d26f,_0xa5d0('0xe'));_0x295165(_0x43698e[_0xa5d0('0x14')]['message']);}})[_0xa5d0('0x15')](function(_0x5bfe18){logger[_0xa5d0('0x12')](_0xa5d0('0xd'),_0x19d26f,_0x5bfe18);_0x27fe5a(_0x5bfe18);});});}
\ No newline at end of file
+var _0xcdc2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x22f164,_0xaa4f80){var _0x51ab95=function(_0x190b68){while(--_0x190b68){_0x22f164['push'](_0x22f164['shift']());}};_0x51ab95(++_0xaa4f80);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x19e0e1,_0x35bd91){_0x19e0e1=_0x19e0e1-0x0;var _0x3b9e6e=_0xcdc2[_0x19e0e1];return _0x3b9e6e;};'use strict';var _=require(_0x2cdc('0x0'));var util=require(_0x2cdc('0x1'));var moment=require(_0x2cdc('0x2'));var BPromise=require(_0x2cdc('0x3'));var rs=require(_0x2cdc('0x4'));var fs=require('fs');var Redis=require(_0x2cdc('0x5'));var db=require(_0x2cdc('0x6'))['db'];var utils=require(_0x2cdc('0x7'));var logger=require(_0x2cdc('0x8'))(_0x2cdc('0x9'));var config=require(_0x2cdc('0xa'));var jayson=require(_0x2cdc('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10b817,_0x54e717,_0x17f9f4){return new BPromise(function(_0x35a1d0,_0x393327){return client['request'](_0x10b817,_0x17f9f4)[_0x2cdc('0xc')](function(_0x51e6e7){logger['info'](_0x2cdc('0xd'),_0x54e717,'request\x20sent');logger['debug'](_0x2cdc('0xe'),_0x54e717,'request\x20sent',JSON[_0x2cdc('0xf')](_0x51e6e7));if(_0x51e6e7[_0x2cdc('0x10')]){if(_0x51e6e7[_0x2cdc('0x10')]['code']===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x54e717,_0x51e6e7['error']['message']);return _0x393327(_0x51e6e7[_0x2cdc('0x10')][_0x2cdc('0x11')]);}logger[_0x2cdc('0x10')](_0x2cdc('0xd'),_0x54e717,_0x51e6e7['error']['message']);return _0x35a1d0(_0x51e6e7[_0x2cdc('0x10')][_0x2cdc('0x11')]);}else{logger[_0x2cdc('0x12')](_0x2cdc('0xd'),_0x54e717,'request\x20sent');_0x35a1d0(_0x51e6e7['result'][_0x2cdc('0x11')]);}})[_0x2cdc('0x13')](function(_0x2a60d2){logger[_0x2cdc('0x10')](_0x2cdc('0xd'),_0x54e717,_0x2a60d2);_0x393327(_0x2a60d2);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 2f4340c..f4100eb 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x23fe=['../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2ce40e,_0x40a409){var _0x4d614d=function(_0x5c09d9){while(--_0x5c09d9){_0x2ce40e['push'](_0x2ce40e['shift']());}};_0x4d614d(++_0x40a409);}(_0x23fe,0x102));var _0xe23f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x23fe[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var path=require('path');var timeout=require(_0xe23f('0x2'));var express=require(_0xe23f('0x3'));var router=express[_0xe23f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe23f('0x5'));var interaction=require(_0xe23f('0x6'));var config=require(_0xe23f('0x7'));var controller=require(_0xe23f('0x8'));router[_0xe23f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0xb')]);router[_0xe23f('0x9')](_0xe23f('0xc'),auth[_0xe23f('0xd')](),controller['getConditions']);router[_0xe23f('0x9')](_0xe23f('0xe'),auth[_0xe23f('0xd')](),controller[_0xe23f('0xf')]);router[_0xe23f('0x10')]('/',auth[_0xe23f('0xd')](),controller[_0xe23f('0x11')]);router['post']('/:id/conditions',auth[_0xe23f('0xd')](),controller[_0xe23f('0x12')]);router[_0xe23f('0x10')]('/:id/actions',auth[_0xe23f('0xd')](),controller[_0xe23f('0x13')]);router[_0xe23f('0x14')](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0x15')]);router[_0xe23f('0x16')](_0xe23f('0xa'),auth['isAuthenticated'](),controller[_0xe23f('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x8e0f=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./automation.controller','get','index','/:id','isAuthenticated','/:id/conditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x9cd6d7,_0x453050){var _0x48e5d2=function(_0x532699){while(--_0x532699){_0x9cd6d7['push'](_0x9cd6d7['shift']());}};_0x48e5d2(++_0x453050);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x59a981,_0x629eb6){_0x59a981=_0x59a981-0x0;var _0x464f06=_0x8e0f[_0x59a981];return _0x464f06;};'use strict';var multer=require(_0xf8e0('0x0'));var util=require(_0xf8e0('0x1'));var path=require(_0xf8e0('0x2'));var timeout=require(_0xf8e0('0x3'));var express=require(_0xf8e0('0x4'));var router=express[_0xf8e0('0x5')]();var fs_extra=require(_0xf8e0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf8e0('0x7'));var config=require('../../config/environment');var controller=require(_0xf8e0('0x8'));router[_0xf8e0('0x9')]('/',auth['isAuthenticated'](),controller[_0xf8e0('0xa')]);router[_0xf8e0('0x9')](_0xf8e0('0xb'),auth[_0xf8e0('0xc')](),controller['show']);router[_0xf8e0('0x9')](_0xf8e0('0xd'),auth['isAuthenticated'](),controller['getConditions']);router[_0xf8e0('0x9')](_0xf8e0('0xe'),auth[_0xf8e0('0xc')](),controller[_0xf8e0('0xf')]);router[_0xf8e0('0x10')]('/',auth[_0xf8e0('0xc')](),controller[_0xf8e0('0x11')]);router[_0xf8e0('0x10')](_0xf8e0('0xd'),auth['isAuthenticated'](),controller[_0xf8e0('0x12')]);router[_0xf8e0('0x10')](_0xf8e0('0xe'),auth[_0xf8e0('0xc')](),controller['addActions']);router[_0xf8e0('0x13')]('/:id',auth[_0xf8e0('0xc')](),controller[_0xf8e0('0x14')]);router[_0xf8e0('0x15')]('/:id',auth[_0xf8e0('0xc')](),controller['destroy']);module[_0xf8e0('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 7593a56..814fd5f 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb640=['never','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x23aa34,_0x2ec822){var _0xfa8ee6=function(_0x3c0706){while(--_0x3c0706){_0x23aa34['push'](_0x23aa34['shift']());}};_0xfa8ee6(++_0x2ec822);}(_0xb640,0xc7));var _0x0b64=function(_0x55f34a,_0x4c8897){_0x55f34a=_0x55f34a-0x0;var _0x56efe4=_0xb640[_0x55f34a];return _0x56efe4;};'use strict';var Sequelize=require(_0x0b64('0x0'));module[_0x0b64('0x1')]={'name':{'type':Sequelize[_0x0b64('0x2')],'unique':_0x0b64('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b64('0x4')](_0x0b64('0x5')),'allowNull':![],'defaultValue':_0x0b64('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0b64('0x6')],'defaultValue':0x0,'comment':_0x0b64('0x7')},'limitCalls':{'type':Sequelize[_0x0b64('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0b64('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0b64('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'comment':_0x0b64('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b64('0xf')},'dialTimezone':{'type':Sequelize[_0x0b64('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b64('0x2')],'defaultValue':_0x0b64('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x0b64('0x11'),'onlyIfOpen'),'defaultValue':_0x0b64('0x12')},'dialAMDActive':{'type':Sequelize[_0x0b64('0x6')],'defaultValue':0x0,'comment':_0x0b64('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0b64('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b64('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b64('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b64('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b64('0x17')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0b64('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b64('0x8')](0x9)[_0x0b64('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0b64('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0b64('0x19')),'defaultValue':_0x0b64('0x1a')},'dialPrefix':{'type':Sequelize[_0x0b64('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b64('0x1b')},'dialCutDigit':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b64('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b64('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b64('0x8')](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b64('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b64('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b64('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b64('0x23')}};
\ No newline at end of file
+var _0x2724=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','name','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x50b250,_0x50cc42){var _0x36ce05=function(_0xd9a043){while(--_0xd9a043){_0x50b250['push'](_0x50b250['shift']());}};_0x36ce05(++_0x50cc42);}(_0x2724,0xa8));var _0x4272=function(_0x444f8e,_0x503ade){_0x444f8e=_0x444f8e-0x0;var _0x46af5f=_0x2724[_0x444f8e];return _0x46af5f;};'use strict';var Sequelize=require('sequelize');module[_0x4272('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4272('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x4272('0x2')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x4272('0x3')]},'active':{'type':Sequelize[_0x4272('0x4')],'defaultValue':0x0,'comment':_0x4272('0x5')},'limitCalls':{'type':Sequelize[_0x4272('0x6')](0x4)[_0x4272('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4272('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4272('0x3')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4272('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4272('0xc')},'dialTimezone':{'type':Sequelize[_0x4272('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4272('0x3')],'defaultValue':_0x4272('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x4272('0xe')](_0x4272('0xf'),'never',_0x4272('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x4272('0x4')],'defaultValue':0x0,'comment':_0x4272('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4272('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x4272('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4272('0x13')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4272('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4272('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4272('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4272('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4272('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4272('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4272('0x6')](0x9)[_0x4272('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4272('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x4272('0x19'),_0x4272('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x4272('0x3')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4272('0x1b')},'dialCutDigit':{'type':Sequelize[_0x4272('0x6')](0x3)[_0x4272('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4272('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4272('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4272('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4272('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4272('0x6')](0x5)[_0x4272('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 2919692..6a9a7f7 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7582=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','select','field','ContactId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','scheduledAt','NOW()','CampaignId\x20=\x20?','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Campaign','findAll','rows','catch','show','includeAll','include','find','create'];(function(_0x127b3d,_0x141ce0){var _0x553381=function(_0x417820){while(--_0x417820){_0x127b3d['push'](_0x127b3d['shift']());}};_0x553381(++_0x141ce0);}(_0x7582,0x167));var _0x2758=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0x7582[_0x1e2321];return _0x1d346d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2758('0x0'));var zipdir=require(_0x2758('0x1'));var jsonpatch=require(_0x2758('0x2'));var rp=require('request-promise');var moment=require(_0x2758('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2758('0x4'));var util=require(_0x2758('0x5'));var path=require(_0x2758('0x6'));var sox=require(_0x2758('0x7'));var csv=require('to-csv');var ejs=require(_0x2758('0x8'));var fs=require('fs');var fs_extra=require(_0x2758('0x9'));var _=require('lodash');var squel=require(_0x2758('0xa'));var crypto=require(_0x2758('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2758('0xc'));var toCsv=require(_0x2758('0xd'));var querystring=require(_0x2758('0xe'));var Papa=require('papaparse');var Redis=require(_0x2758('0xf'));var authService=require(_0x2758('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2758('0x11'));var logger=require(_0x2758('0x12'))(_0x2758('0x13'));var utils=require(_0x2758('0x14'));var config=require(_0x2758('0x15'));var licenseUtil=require(_0x2758('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x493357,_0x4caa8b){_0x4caa8b=_0x4caa8b||0xcc;return function(_0x1846cd){if(_0x1846cd){return _0x493357[_0x2758('0x17')](_0x4caa8b);}return _0x493357[_0x2758('0x18')](_0x4caa8b)[_0x2758('0x19')]();};}function respondWithResult(_0x3233af,_0x9db637){_0x9db637=_0x9db637||0xc8;return function(_0x3e1a7e){if(_0x3e1a7e){return _0x3233af[_0x2758('0x18')](_0x9db637)[_0x2758('0x1a')](_0x3e1a7e);}};}function respondWithFilteredResult(_0xad4346,_0x414a0b){return function(_0x361f14){if(_0x361f14){var _0x280ccc=typeof _0x414a0b[_0x2758('0x1b')]==='undefined'&&typeof _0x414a0b['limit']==='undefined';var _0x2b0ce0=_0x361f14[_0x2758('0x1c')];var _0x358358=_0x280ccc?0x0:_0x414a0b[_0x2758('0x1b')];var _0x1bccd9=_0x280ccc?_0x361f14[_0x2758('0x1c')]:_0x414a0b['offset']+_0x414a0b[_0x2758('0x1d')];var _0x4202e5;if(_0x1bccd9>=_0x2b0ce0){_0x1bccd9=_0x2b0ce0;_0x4202e5=0xc8;}else{_0x4202e5=0xce;}_0xad4346['status'](_0x4202e5);return _0xad4346[_0x2758('0x1e')](_0x2758('0x1f'),_0x358358+'-'+_0x1bccd9+'/'+_0x2b0ce0)[_0x2758('0x1a')](_0x361f14);}return null;};}function patchUpdates(_0x4100a0){return function(_0x50526b){try{jsonpatch[_0x2758('0x20')](_0x50526b,_0x4100a0,!![]);}catch(_0x4fa215){return BPromise[_0x2758('0x21')](_0x4fa215);}return _0x50526b[_0x2758('0x22')]();};}function saveUpdates(_0x27a887,_0x2797fe){return function(_0x4699c4){if(_0x4699c4){return _0x4699c4[_0x2758('0x23')](_0x27a887)[_0x2758('0x24')](function(_0x222601){return _0x222601;});}return null;};}function removeEntity(_0x38c483,_0x2ef395){return function(_0x1f645d){if(_0x1f645d){return _0x1f645d[_0x2758('0x25')]()['then'](function(){var _0x4f92f2=_0x1f645d[_0x2758('0x26')]({'plain':!![]});var _0x277f69=_0x2758('0x27');return db[_0x2758('0x28')][_0x2758('0x25')]({'where':{'type':_0x277f69,'resourceId':_0x4f92f2['id']}})[_0x2758('0x24')](function(){return _0x1f645d;});})['then'](function(){_0x38c483['status'](0xcc)[_0x2758('0x19')]();});}};}function handleEntityNotFound(_0x28c1f2,_0xee59e6){return function(_0x1d56cd){if(!_0x1d56cd){_0x28c1f2['sendStatus'](0x194);}return _0x1d56cd;};}function handleError(_0x47c969,_0x3e4cd7){_0x3e4cd7=_0x3e4cd7||0x1f4;return function(_0x230f28){logger[_0x2758('0x29')](_0x230f28['stack']);if(_0x230f28[_0x2758('0x2a')]){delete _0x230f28['name'];}_0x47c969[_0x2758('0x18')](_0x3e4cd7)[_0x2758('0x2b')](_0x230f28);};}exports[_0x2758('0x2c')]=function(_0x348d0d,_0x2e0613){var _0x2000de={},_0x2d44e4={},_0x11efa6={'count':0x0,'rows':[]};var _0x225f6f=_[_0x2758('0x2d')](db['Campaign'][_0x2758('0x2e')],function(_0x89c340){return{'name':_0x89c340[_0x2758('0x2f')],'type':_0x89c340[_0x2758('0x30')]['key']};});_0x2d44e4['model']=_[_0x2758('0x2d')](_0x225f6f,_0x2758('0x2a'));_0x2d44e4['query']=_[_0x2758('0x31')](_0x348d0d['query']);_0x2d44e4[_0x2758('0x32')]=_['intersection'](_0x2d44e4[_0x2758('0x33')],_0x2d44e4[_0x2758('0x34')]);_0x2000de['attributes']=_[_0x2758('0x35')](_0x2d44e4[_0x2758('0x33')],qs[_0x2758('0x36')](_0x348d0d[_0x2758('0x34')][_0x2758('0x36')]));_0x2000de[_0x2758('0x37')]=_0x2000de[_0x2758('0x37')][_0x2758('0x38')]?_0x2000de['attributes']:_0x2d44e4[_0x2758('0x33')];if(!_0x348d0d[_0x2758('0x34')][_0x2758('0x39')](_0x2758('0x3a'))){_0x2000de[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x348d0d[_0x2758('0x34')][_0x2758('0x1d')]);_0x2000de[_0x2758('0x1b')]=qs['offset'](_0x348d0d['query'][_0x2758('0x1b')]);}_0x2000de[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x348d0d[_0x2758('0x34')][_0x2758('0x3c')]);_0x2000de[_0x2758('0x3d')]=qs['filters'](_[_0x2758('0x3e')](_0x348d0d[_0x2758('0x34')],_0x2d44e4['filters']),_0x225f6f);if(_0x348d0d['query']['filter']){_0x2000de[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x2000de[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x225f6f,function(_0x564462){if(_0x564462[_0x2758('0x30')]!==_0x2758('0x40')){var _0x276ca0={};_0x276ca0[_0x564462[_0x2758('0x2a')]]={'$like':'%'+_0x348d0d[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x276ca0;}})});}_0x2000de=_['merge']({},_0x2000de,_0x348d0d[_0x2758('0x42')]);var _0x3ceab5={'where':_0x2000de[_0x2758('0x3d')]};return db[_0x2758('0x43')][_0x2758('0x1c')](_0x3ceab5)[_0x2758('0x24')](function(_0xf0df8e){_0x11efa6[_0x2758('0x1c')]=_0xf0df8e;if(_0x348d0d[_0x2758('0x34')]['includeAll']){_0x2000de['include']=[{'all':!![]}];}return db[_0x2758('0x43')][_0x2758('0x44')](_0x2000de);})['then'](function(_0x2d19d8){_0x11efa6[_0x2758('0x45')]=_0x2d19d8;return _0x11efa6;})['then'](respondWithFilteredResult(_0x2e0613,_0x2000de))[_0x2758('0x46')](handleError(_0x2e0613,null));};exports[_0x2758('0x47')]=function(_0x1a5d64,_0x372862){var _0x291344={'raw':![],'where':{'id':_0x1a5d64['params']['id']}},_0x5a98d5={};_0x5a98d5['model']=_[_0x2758('0x31')](db[_0x2758('0x43')][_0x2758('0x2e')]);_0x5a98d5[_0x2758('0x34')]=_[_0x2758('0x31')](_0x1a5d64[_0x2758('0x34')]);_0x5a98d5[_0x2758('0x32')]=_[_0x2758('0x35')](_0x5a98d5['model'],_0x5a98d5['query']);_0x291344[_0x2758('0x37')]=_[_0x2758('0x35')](_0x5a98d5[_0x2758('0x33')],qs['fields'](_0x1a5d64['query'][_0x2758('0x36')]));_0x291344[_0x2758('0x37')]=_0x291344['attributes'][_0x2758('0x38')]?_0x291344[_0x2758('0x37')]:_0x5a98d5[_0x2758('0x33')];if(_0x1a5d64[_0x2758('0x34')][_0x2758('0x48')]){_0x291344[_0x2758('0x49')]=[{'all':!![]}];}_0x291344=_[_0x2758('0x3f')]({},_0x291344,_0x1a5d64[_0x2758('0x42')]);return db[_0x2758('0x43')][_0x2758('0x4a')](_0x291344)['then'](handleEntityNotFound(_0x372862,null))['then'](respondWithResult(_0x372862,null))[_0x2758('0x46')](handleError(_0x372862,null));};exports[_0x2758('0x4b')]=function(_0x43af2b,_0x2121df){return db[_0x2758('0x43')]['create'](_0x43af2b[_0x2758('0x4c')],{})['then'](function(_0x451458){var _0x264a11=_0x43af2b[_0x2758('0x4d')][_0x2758('0x26')]({'plain':!![]});if(!_0x264a11)throw new Error(_0x2758('0x4e'));if(_0x264a11['role']===_0x2758('0x4d')){var _0x5704c6=_0x451458[_0x2758('0x26')]({'plain':!![]});var _0x2e5c51='IvrCampaigns';return db[_0x2758('0x4f')][_0x2758('0x4a')]({'where':{'name':_0x2e5c51,'userProfileId':_0x264a11[_0x2758('0x50')]},'raw':!![]})[_0x2758('0x24')](function(_0x20649c){if(_0x20649c&&_0x20649c[_0x2758('0x51')]===0x0){return db[_0x2758('0x28')]['create']({'name':_0x5704c6[_0x2758('0x2a')],'resourceId':_0x5704c6['id'],'type':_0x20649c[_0x2758('0x2a')],'sectionId':_0x20649c['id']},{})[_0x2758('0x24')](function(){return _0x451458;});}else{return _0x451458;}})['catch'](function(_0x5b1b01){logger[_0x2758('0x29')](_0x2758('0x52'),_0x5b1b01);throw _0x5b1b01;});}return _0x451458;})[_0x2758('0x24')](respondWithResult(_0x2121df,0xc9))['catch'](handleError(_0x2121df,null));};exports[_0x2758('0x53')]=function(_0x191b3f,_0x52a01d){var _0x850f9b={'where':{'id':_0x191b3f[_0x2758('0x54')]['id']}},_0x3ee3ad={};_0x3ee3ad['model']=_[_0x2758('0x31')](db[_0x2758('0x43')][_0x2758('0x2e')]);_0x850f9b[_0x2758('0x37')]=_['intersection'](_0x3ee3ad['model'],qs[_0x2758('0x36')](_0x191b3f[_0x2758('0x34')][_0x2758('0x36')]));_0x850f9b[_0x2758('0x37')]=_0x850f9b[_0x2758('0x37')][_0x2758('0x38')]?_0x850f9b[_0x2758('0x37')]:_0x3ee3ad['model'];if(_0x191b3f[_0x2758('0x34')][_0x2758('0x48')]){_0x850f9b[_0x2758('0x49')]=[{'all':!![]}];}_0x850f9b=_[_0x2758('0x3f')]({},_0x850f9b,_0x191b3f[_0x2758('0x42')]);return db['Campaign']['find'](_0x850f9b)['then'](handleEntityNotFound(_0x52a01d,null))['then'](function(_0x5396c3){if(_0x5396c3){var _0x43d0cb=_0x5396c3[_0x2758('0x26')]({'plain':!![]});_0x43d0cb=qs['omit'](_0x43d0cb,['id',_0x2758('0x55'),_0x2758('0x56')]);_0x191b3f[_0x2758('0x4c')]=_['omit'](_0x191b3f[_0x2758('0x4c')],['id',_0x2758('0x55'),_0x2758('0x56')]);return db[_0x2758('0x43')]['create'](_['merge'](_0x43d0cb,_0x191b3f['body']),{'include':_0x191b3f[_0x2758('0x34')][_0x2758('0x48')]?[{'all':!![]}]:undefined})[_0x2758('0x24')](function(_0x3a7b43){var _0x49eb53=_0x191b3f[_0x2758('0x4d')][_0x2758('0x26')]({'plain':!![]});if(!_0x49eb53)throw new Error(_0x2758('0x4e'));if(_0x49eb53['role']===_0x2758('0x4d')){var _0x22e389=_0x3a7b43[_0x2758('0x26')]({'plain':!![]});var _0x2f7591='IvrCampaigns';return db[_0x2758('0x4f')][_0x2758('0x4a')]({'where':{'name':_0x2f7591,'userProfileId':_0x49eb53[_0x2758('0x50')]},'raw':!![]})[_0x2758('0x24')](function(_0x45302b){if(_0x45302b&&_0x45302b[_0x2758('0x51')]===0x0){return db[_0x2758('0x28')][_0x2758('0x4b')]({'name':_0x22e389[_0x2758('0x2a')],'resourceId':_0x22e389['id'],'type':_0x45302b[_0x2758('0x2a')],'sectionId':_0x45302b['id']},{})[_0x2758('0x24')](function(){return _0x3a7b43;});}else{return _0x3a7b43;}})[_0x2758('0x46')](function(_0x37ef08){logger[_0x2758('0x29')](_0x2758('0x52'),_0x37ef08);throw _0x37ef08;});}return _0x3a7b43;});}})['then'](respondWithResult(_0x52a01d,0xc9))[_0x2758('0x46')](handleError(_0x52a01d,null));};exports[_0x2758('0x23')]=function(_0x1e7853,_0x1e3ce5){if(_0x1e7853[_0x2758('0x4c')]['id']){delete _0x1e7853['body']['id'];}return db[_0x2758('0x43')][_0x2758('0x4a')]({'where':{'id':_0x1e7853[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x1e3ce5,null))[_0x2758('0x24')](saveUpdates(_0x1e7853[_0x2758('0x4c')],null))[_0x2758('0x24')](respondWithResult(_0x1e3ce5,null))['catch'](handleError(_0x1e3ce5,null));};exports[_0x2758('0x25')]=function(_0x2e4db4,_0x2e1128){return db[_0x2758('0x43')][_0x2758('0x4a')]({'where':{'id':_0x2e4db4[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x2e1128,null))[_0x2758('0x24')](removeEntity(_0x2e1128,null))['catch'](handleError(_0x2e1128,null));};exports[_0x2758('0x57')]=function(_0x228829,_0x475748,_0x41d3ff){var _0x47ddb5={'raw':!![],'where':{}};var _0x3ae88e={};var _0x3aebb0={'count':0x0,'rows':[]};return db['Campaign'][_0x2758('0x58')]({'where':{'id':_0x228829[_0x2758('0x54')]['id']}})['then'](handleEntityNotFound(_0x475748,null))[_0x2758('0x24')](function(_0x111e49){if(_0x111e49){_0x3ae88e[_0x2758('0x33')]=_[_0x2758('0x31')](db['CmHopper'][_0x2758('0x2e')]);_0x3ae88e['query']=_['keys'](_0x228829[_0x2758('0x34')]);_0x3ae88e[_0x2758('0x32')]=_[_0x2758('0x35')](_0x3ae88e[_0x2758('0x33')],_0x3ae88e[_0x2758('0x34')]);_0x47ddb5['attributes']=_[_0x2758('0x35')](_0x3ae88e['model'],qs[_0x2758('0x36')](_0x228829[_0x2758('0x34')][_0x2758('0x36')]));_0x47ddb5[_0x2758('0x37')]=_0x47ddb5[_0x2758('0x37')][_0x2758('0x38')]?_0x47ddb5[_0x2758('0x37')]:_0x3ae88e[_0x2758('0x33')];if(!_0x228829['query']['hasOwnProperty']('nolimit')){_0x47ddb5['limit']=qs['limit'](_0x228829[_0x2758('0x34')][_0x2758('0x1d')]);_0x47ddb5[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x228829[_0x2758('0x34')][_0x2758('0x1b')]);}_0x47ddb5[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x228829['query'][_0x2758('0x3c')]);_0x47ddb5[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x228829[_0x2758('0x34')],_0x3ae88e[_0x2758('0x32')]));_0x47ddb5[_0x2758('0x3d')][_0x2758('0x59')]=_0x111e49['id'];if(_0x228829[_0x2758('0x34')][_0x2758('0x41')]){_0x47ddb5[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x47ddb5[_0x2758('0x3d')],{'$or':_['map'](_0x47ddb5[_0x2758('0x37')],function(_0x1b5aff){var _0x2e8cec={};_0x2e8cec[_0x1b5aff]={'$like':'%'+_0x228829['query'][_0x2758('0x41')]+'%'};return _0x2e8cec;})});}_0x47ddb5=_[_0x2758('0x3f')]({},_0x47ddb5,_0x228829[_0x2758('0x42')]);return db[_0x2758('0x5a')][_0x2758('0x1c')]({'where':_0x47ddb5[_0x2758('0x3d')]})[_0x2758('0x24')](function(_0x3932c3){_0x3aebb0[_0x2758('0x1c')]=_0x3932c3;if(_0x228829[_0x2758('0x34')][_0x2758('0x48')]){_0x47ddb5[_0x2758('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x2758('0x44')](_0x47ddb5);})[_0x2758('0x24')](function(_0x31292c){_0x3aebb0[_0x2758('0x45')]=_0x31292c;return _0x3aebb0;});}})['then'](respondWithFilteredResult(_0x475748,_0x47ddb5))[_0x2758('0x46')](handleError(_0x475748,null));};exports[_0x2758('0x5b')]=function(_0x515eae,_0xcda34b,_0x26fb03){var _0x398cab={'raw':!![],'where':{}};var _0x301fe5={};var _0x3a92d4={'count':0x0,'rows':[]};return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x515eae[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0xcda34b,null))[_0x2758('0x24')](function(_0x4c816d){if(_0x4c816d){_0x301fe5[_0x2758('0x33')]=_[_0x2758('0x31')](db['CmHopperHistory'][_0x2758('0x2e')]);_0x301fe5[_0x2758('0x34')]=_['keys'](_0x515eae[_0x2758('0x34')]);_0x301fe5[_0x2758('0x32')]=_[_0x2758('0x35')](_0x301fe5[_0x2758('0x33')],_0x301fe5[_0x2758('0x34')]);_0x398cab[_0x2758('0x37')]=_[_0x2758('0x35')](_0x301fe5[_0x2758('0x33')],qs[_0x2758('0x36')](_0x515eae[_0x2758('0x34')][_0x2758('0x36')]));_0x398cab[_0x2758('0x37')]=_0x398cab[_0x2758('0x37')][_0x2758('0x38')]?_0x398cab[_0x2758('0x37')]:_0x301fe5['model'];if(!_0x515eae[_0x2758('0x34')][_0x2758('0x39')](_0x2758('0x3a'))){_0x398cab[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x515eae[_0x2758('0x34')][_0x2758('0x1d')]);_0x398cab['offset']=qs['offset'](_0x515eae[_0x2758('0x34')][_0x2758('0x1b')]);}_0x398cab[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x515eae[_0x2758('0x34')]['sort']);_0x398cab[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x515eae['query'],_0x301fe5[_0x2758('0x32')]));_0x398cab['where'][_0x2758('0x59')]=_0x4c816d['id'];if(_0x515eae[_0x2758('0x34')][_0x2758('0x41')]){_0x398cab[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x398cab[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x398cab['attributes'],function(_0xa63291){var _0x247fa0={};_0x247fa0[_0xa63291]={'$like':'%'+_0x515eae[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x247fa0;})});}_0x398cab=_['merge']({},_0x398cab,_0x515eae[_0x2758('0x42')]);return db[_0x2758('0x5c')][_0x2758('0x1c')]({'where':_0x398cab[_0x2758('0x3d')]})[_0x2758('0x24')](function(_0x222c8e){_0x3a92d4['count']=_0x222c8e;if(_0x515eae[_0x2758('0x34')][_0x2758('0x48')]){_0x398cab['include']=[{'all':!![]}];}return db[_0x2758('0x5c')][_0x2758('0x44')](_0x398cab);})[_0x2758('0x24')](function(_0x36c849){_0x3a92d4['rows']=_0x36c849;return _0x3a92d4;});}})[_0x2758('0x24')](respondWithFilteredResult(_0xcda34b,_0x398cab))[_0x2758('0x46')](handleError(_0xcda34b,null));};exports['getHopperFinals']=function(_0x1301a2,_0x5f08cb,_0x3edb50){var _0x530303={'raw':!![],'where':{}};var _0x253473={};var _0x5c88e3={'count':0x0,'rows':[]};return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x1301a2[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x5f08cb,null))[_0x2758('0x24')](function(_0x43e530){if(_0x43e530){_0x253473[_0x2758('0x33')]=_[_0x2758('0x31')](db[_0x2758('0x5d')][_0x2758('0x2e')]);_0x253473[_0x2758('0x34')]=_[_0x2758('0x31')](_0x1301a2[_0x2758('0x34')]);_0x253473['filters']=_[_0x2758('0x35')](_0x253473[_0x2758('0x33')],_0x253473[_0x2758('0x34')]);_0x530303[_0x2758('0x37')]=_['intersection'](_0x253473[_0x2758('0x33')],qs[_0x2758('0x36')](_0x1301a2['query']['fields']));_0x530303[_0x2758('0x37')]=_0x530303[_0x2758('0x37')][_0x2758('0x38')]?_0x530303[_0x2758('0x37')]:_0x253473[_0x2758('0x33')];if(!_0x1301a2[_0x2758('0x34')][_0x2758('0x39')](_0x2758('0x3a'))){_0x530303[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x1301a2['query'][_0x2758('0x1d')]);_0x530303[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x1301a2[_0x2758('0x34')][_0x2758('0x1b')]);}_0x530303[_0x2758('0x3b')]=qs['sort'](_0x1301a2['query'][_0x2758('0x3c')]);_0x530303[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x1301a2[_0x2758('0x34')],_0x253473['filters']));_0x530303[_0x2758('0x3d')][_0x2758('0x59')]=_0x43e530['id'];if(_0x1301a2[_0x2758('0x34')][_0x2758('0x41')]){_0x530303[_0x2758('0x3d')]=_['merge'](_0x530303[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x530303[_0x2758('0x37')],function(_0x19f67f){var _0x57e40c={};_0x57e40c[_0x19f67f]={'$like':'%'+_0x1301a2[_0x2758('0x34')]['filter']+'%'};return _0x57e40c;})});}_0x530303=_[_0x2758('0x3f')]({},_0x530303,_0x1301a2[_0x2758('0x42')]);return db[_0x2758('0x5d')][_0x2758('0x1c')]({'where':_0x530303[_0x2758('0x3d')]})[_0x2758('0x24')](function(_0x2d9282){_0x5c88e3[_0x2758('0x1c')]=_0x2d9282;if(_0x1301a2[_0x2758('0x34')]['includeAll']){_0x530303[_0x2758('0x49')]=[{'all':!![]}];}return db[_0x2758('0x5d')]['findAll'](_0x530303);})[_0x2758('0x24')](function(_0xcc8980){_0x5c88e3[_0x2758('0x45')]=_0xcc8980;return _0x5c88e3;});}})[_0x2758('0x24')](respondWithFilteredResult(_0x5f08cb,_0x530303))['catch'](handleError(_0x5f08cb,null));};exports[_0x2758('0x5e')]=function(_0x1eb580,_0x2ac44d,_0x5d0357){var _0x30f170={'raw':!![],'where':{}};var _0x7d8fae={};var _0x365192={'count':0x0,'rows':[]};return db['Campaign'][_0x2758('0x58')]({'where':{'id':_0x1eb580[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x2ac44d,null))[_0x2758('0x24')](function(_0xca22e8){if(_0xca22e8){_0x7d8fae[_0x2758('0x33')]=_[_0x2758('0x31')](db[_0x2758('0x5f')][_0x2758('0x2e')]);_0x7d8fae[_0x2758('0x34')]=_[_0x2758('0x31')](_0x1eb580[_0x2758('0x34')]);_0x7d8fae[_0x2758('0x32')]=_[_0x2758('0x35')](_0x7d8fae[_0x2758('0x33')],_0x7d8fae[_0x2758('0x34')]);_0x30f170[_0x2758('0x37')]=_['intersection'](_0x7d8fae[_0x2758('0x33')],qs[_0x2758('0x36')](_0x1eb580[_0x2758('0x34')]['fields']));_0x30f170[_0x2758('0x37')]=_0x30f170[_0x2758('0x37')][_0x2758('0x38')]?_0x30f170[_0x2758('0x37')]:_0x7d8fae['model'];if(!_0x1eb580[_0x2758('0x34')][_0x2758('0x39')]('nolimit')){_0x30f170[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x1eb580[_0x2758('0x34')][_0x2758('0x1d')]);_0x30f170[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x1eb580[_0x2758('0x34')]['offset']);}_0x30f170[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x1eb580['query'][_0x2758('0x3c')]);_0x30f170[_0x2758('0x3d')]=qs[_0x2758('0x32')](_[_0x2758('0x3e')](_0x1eb580[_0x2758('0x34')],_0x7d8fae[_0x2758('0x32')]));_0x30f170[_0x2758('0x3d')][_0x2758('0x59')]=_0xca22e8['id'];if(_0x1eb580[_0x2758('0x34')][_0x2758('0x41')]){_0x30f170[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0x30f170[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x30f170[_0x2758('0x37')],function(_0x1467d2){var _0x575a59={};_0x575a59[_0x1467d2]={'$like':'%'+_0x1eb580[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x575a59;})});}_0x30f170=_[_0x2758('0x3f')]({},_0x30f170,_0x1eb580[_0x2758('0x42')]);return db[_0x2758('0x5f')]['count']({'where':_0x30f170[_0x2758('0x3d')]})['then'](function(_0x483d11){_0x365192[_0x2758('0x1c')]=_0x483d11;if(_0x1eb580[_0x2758('0x34')][_0x2758('0x48')]){_0x30f170['include']=[{'all':!![]}];}return db[_0x2758('0x5f')]['findAll'](_0x30f170);})[_0x2758('0x24')](function(_0x5eda32){_0x365192[_0x2758('0x45')]=_0x5eda32;return _0x365192;});}})['then'](respondWithFilteredResult(_0x2ac44d,_0x30f170))[_0x2758('0x46')](handleError(_0x2ac44d,null));};exports[_0x2758('0x60')]=function(_0x307b9a,_0x3896c6,_0x1d3ed2){var _0xe6425e={};var _0x1fcef1={};var _0x3ab0e6;var _0x490999;return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x307b9a[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x3896c6,null))['then'](function(_0x5b0fe0){if(_0x5b0fe0){_0x3ab0e6=_0x5b0fe0;_0x1fcef1[_0x2758('0x33')]=_['keys'](db['CmList'][_0x2758('0x2e')]);_0x1fcef1[_0x2758('0x34')]=_[_0x2758('0x31')](_0x307b9a[_0x2758('0x34')]);_0x1fcef1[_0x2758('0x32')]=_[_0x2758('0x35')](_0x1fcef1['model'],_0x1fcef1[_0x2758('0x34')]);_0xe6425e[_0x2758('0x37')]=_['intersection'](_0x1fcef1[_0x2758('0x33')],qs['fields'](_0x307b9a[_0x2758('0x34')]['fields']));_0xe6425e['attributes']=_0xe6425e['attributes'][_0x2758('0x38')]?_0xe6425e['attributes']:_0x1fcef1[_0x2758('0x33')];_0xe6425e[_0x2758('0x3b')]=qs['sort'](_0x307b9a[_0x2758('0x34')]['sort']);_0xe6425e['where']=qs[_0x2758('0x32')](_['pick'](_0x307b9a[_0x2758('0x34')],_0x1fcef1['filters']));if(_0x307b9a[_0x2758('0x34')]['filter']){_0xe6425e[_0x2758('0x3d')]=_[_0x2758('0x3f')](_0xe6425e[_0x2758('0x3d')],{'$or':_['map'](_0xe6425e['attributes'],function(_0x1de6f7){var _0x23a64a={};_0x23a64a[_0x1de6f7]={'$like':'%'+_0x307b9a[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x23a64a;})});}_0xe6425e=_[_0x2758('0x3f')]({},_0xe6425e,_0x307b9a[_0x2758('0x42')]);return _0x3ab0e6[_0x2758('0x60')](_0xe6425e);}})[_0x2758('0x24')](function(_0x561a69){if(_0x561a69){_0x490999=_0x561a69[_0x2758('0x38')];if(!_0x307b9a[_0x2758('0x34')]['hasOwnProperty'](_0x2758('0x3a'))){_0xe6425e[_0x2758('0x1d')]=qs[_0x2758('0x1d')](_0x307b9a[_0x2758('0x34')][_0x2758('0x1d')]);_0xe6425e[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x307b9a[_0x2758('0x34')][_0x2758('0x1b')]);}return _0x3ab0e6[_0x2758('0x60')](_0xe6425e);}})['then'](function(_0x2467fd){if(_0x2467fd){return _0x2467fd?{'count':_0x490999,'rows':_0x2467fd}:null;}})[_0x2758('0x24')](respondWithResult(_0x3896c6,null))[_0x2758('0x46')](handleError(_0x3896c6,null));};exports[_0x2758('0x61')]=function(_0x5c14a8,_0x3172e4,_0x358f98){var _0x433d2f,_0x4894fa;var _0x279293=[];var _0x5353fe=moment()[_0x2758('0x62')](_0x2758('0x63'));return db['Campaign'][_0x2758('0x4a')]({'where':{'id':_0x5c14a8[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x3172e4,null))[_0x2758('0x24')](function(_0x5649e0){if(_0x5649e0){_0x4894fa=_0x5649e0;return _0x5649e0[_0x2758('0x61')](_0x5c14a8[_0x2758('0x4c')][_0x2758('0x64')],_[_0x2758('0x65')](_0x5c14a8['body'],[_0x2758('0x64'),'id'])||{});}return null;})[_0x2758('0x66')](function(_0x51d1b5){var _0x5a4060;var _0x440f4f;_0x433d2f=_0x51d1b5||[];var _0xa685b2=[];if(_0x51d1b5){for(var _0x220444=0x0;_0x220444<_0x51d1b5[_0x2758('0x38')];_0x220444+=0x1){var _0x2db99f=_0x51d1b5[_0x220444][_0x2758('0x26')]({'plain':!![]});_0x4894fa[_0x2758('0x67')]=_0x5c14a8[_0x2758('0x4c')][_0x2758('0x67')]?_0x5c14a8['body'][_0x2758('0x67')]:_0x4894fa['dialCheckDuplicateType'];switch(_0x4894fa['dialCheckDuplicateType']){case'always':_0x5a4060=squel[_0x2758('0x68')]()[_0x2758('0x69')](_0x2758('0x6a'))[_0x2758('0x6b')]([_0x2758('0x6c'),'scheduledAt','ContactId','ListId',_0x2758('0x59'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()[_0x2758('0x6e')](_0x2758('0x6c'),'phone')[_0x2758('0x6e')]('NOW()','scheduledAt')['field']('id',_0x2758('0x6f'))['field'](_0x2db99f['CmListId'][_0x2758('0x70')](),_0x2758('0x71'))['field'](_0x5c14a8[_0x2758('0x54')]['id']['toString'](),_0x2758('0x59'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27','updatedAt')[_0x2758('0x72')](_0x2758('0x73'))['where'](_0x2758('0x74'))[_0x2758('0x3d')](_0x2758('0x75'),_0x2db99f[_0x2758('0x76')]['toString']())['where'](_0x2758('0x77'))[_0x2758('0x3d')](_0x2758('0x78'),squel[_0x2758('0x6d')]()['field'](_0x2758('0x79'))[_0x2758('0x72')]('cm_hopper_final')[_0x2758('0x3d')]('CampaignId\x20=\x20?',_0x5c14a8['params']['id'][_0x2758('0x70')]()))[_0x2758('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2758('0x6e')](_0x2758('0x7a'))[_0x2758('0x72')]('cm_hopper')[_0x2758('0x3d')]('CampaignId\x20=\x20?',_0x5c14a8[_0x2758('0x54')]['id'][_0x2758('0x70')]())))[_0x2758('0x70')]();break;case'onlyIfOpen':_0x5a4060=squel[_0x2758('0x68')]()['into'](_0x2758('0x6a'))[_0x2758('0x6b')]([_0x2758('0x6c'),_0x2758('0x7b'),'ContactId',_0x2758('0x71'),_0x2758('0x59'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()[_0x2758('0x6e')](_0x2758('0x6c'),_0x2758('0x6c'))[_0x2758('0x6e')](_0x2758('0x7c'),_0x2758('0x7b'))[_0x2758('0x6e')]('id',_0x2758('0x6f'))[_0x2758('0x6e')](_0x2db99f[_0x2758('0x76')][_0x2758('0x70')](),'ListId')['field'](_0x5c14a8[_0x2758('0x54')]['id']['toString'](),_0x2758('0x59'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x56'))[_0x2758('0x72')]('cm_contacts')['where'](_0x2758('0x74'))['where'](_0x2758('0x75'),_0x2db99f[_0x2758('0x76')][_0x2758('0x70')]())[_0x2758('0x3d')](_0x2758('0x77'))[_0x2758('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x2758('0x6e')]('COALESCE(phone,\x27\x27)')[_0x2758('0x72')]('cm_hopper')[_0x2758('0x3d')](_0x2758('0x7d'),_0x5c14a8[_0x2758('0x54')]['id'][_0x2758('0x70')]())))[_0x2758('0x70')]();break;default:_0x5a4060=squel[_0x2758('0x68')]()[_0x2758('0x69')](_0x2758('0x6a'))[_0x2758('0x6b')]([_0x2758('0x6c'),_0x2758('0x7b'),_0x2758('0x6f'),'ListId',_0x2758('0x59'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()[_0x2758('0x6e')]('phone','phone')[_0x2758('0x6e')](_0x2758('0x7c'),_0x2758('0x7b'))['field']('id','ContactId')[_0x2758('0x6e')](_0x2db99f['CmListId'][_0x2758('0x70')](),_0x2758('0x71'))[_0x2758('0x6e')](_0x5c14a8[_0x2758('0x54')]['id'][_0x2758('0x70')](),_0x2758('0x59'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))['field']('\x27'+_0x5353fe+'\x27',_0x2758('0x56'))[_0x2758('0x72')](_0x2758('0x73'))[_0x2758('0x3d')](_0x2758('0x74'))[_0x2758('0x3d')](_0x2758('0x75'),_0x2db99f[_0x2758('0x76')][_0x2758('0x70')]())[_0x2758('0x3d')](_0x2758('0x77')))[_0x2758('0x70')]();}_0x440f4f=squel[_0x2758('0x68')]()[_0x2758('0x69')](_0x2758('0x7e'))[_0x2758('0x6b')]([_0x2758('0x7f'),_0x2758('0x7b'),_0x2758('0x6c'),_0x2758('0x80'),_0x2758('0x55'),_0x2758('0x56')],squel[_0x2758('0x6d')]()['field'](_0x2758('0x81'),'id')[_0x2758('0x6e')]('NOW()','scheduledAt')['field'](_0x2758('0x82'),_0x2758('0x6c'))[_0x2758('0x6e')](_0x2758('0x83'),_0x2758('0x80'))[_0x2758('0x6e')]('\x27'+_0x5353fe+'\x27',_0x2758('0x55'))['field']('\x27'+_0x5353fe+'\x27',_0x2758('0x56'))[_0x2758('0x72')](_0x2758('0x84'),'ci')[_0x2758('0x85')]('cm_hopper','h',_0x2758('0x86'))[_0x2758('0x3d')]('h.ListId\x20=\x20?',_0x2db99f[_0x2758('0x76')][_0x2758('0x70')]())[_0x2758('0x3d')]('h.CampaignId=?',_0x5c14a8[_0x2758('0x54')]['id']['toString']())[_0x2758('0x3d')](_0x2758('0x87'),_0x5353fe))['toString']();_0xa685b2[_0x2758('0x88')](db['sequelize']['query'](_0x5a4060));_0x279293[_0x2758('0x88')](db[_0x2758('0x89')][_0x2758('0x34')](_0x440f4f));}return BPromise[_0x2758('0x8a')](_0xa685b2);}})['then'](function(){return BPromise[_0x2758('0x8a')](_0x279293);})['then'](function(){return _0x433d2f;})[_0x2758('0x24')](respondWithResult(_0x3172e4,null))[_0x2758('0x46')](handleError(_0x3172e4,null));};exports[_0x2758('0x8b')]=function(_0x5f21c0,_0x295964,_0x5da95e){return db[_0x2758('0x43')][_0x2758('0x4a')]({'where':{'id':_0x5f21c0[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x295964,null))[_0x2758('0x24')](function(_0x212a4f){if(_0x212a4f){return _0x212a4f[_0x2758('0x8b')](_0x5f21c0[_0x2758('0x34')][_0x2758('0x64')]);}})[_0x2758('0x24')](function(_0x435370){if(_0x435370){return db[_0x2758('0x5a')][_0x2758('0x25')]({'where':{'ListId':_0x5f21c0[_0x2758('0x34')][_0x2758('0x64')],'CampaignId':_0x5f21c0[_0x2758('0x54')]['id']}})[_0x2758('0x24')](function(){return _0x435370;});}})['then'](respondWithStatusCode(_0x295964,null))[_0x2758('0x46')](handleError(_0x295964,null));};exports[_0x2758('0x8c')]=function(_0x2c0208,_0x58a98c,_0x4caf5e){var _0x156e50={};var _0x47c32f={};var _0x14a65c;var _0x11c84d;return db[_0x2758('0x43')][_0x2758('0x58')]({'where':{'id':_0x2c0208[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x58a98c,null))[_0x2758('0x24')](function(_0x5ba958){if(_0x5ba958){_0x14a65c=_0x5ba958;_0x47c32f[_0x2758('0x33')]=_[_0x2758('0x31')](db[_0x2758('0x8d')][_0x2758('0x2e')]);_0x47c32f[_0x2758('0x34')]=_[_0x2758('0x31')](_0x2c0208['query']);_0x47c32f[_0x2758('0x32')]=_[_0x2758('0x35')](_0x47c32f[_0x2758('0x33')],_0x47c32f[_0x2758('0x34')]);_0x156e50[_0x2758('0x37')]=_[_0x2758('0x35')](_0x47c32f['model'],qs[_0x2758('0x36')](_0x2c0208['query']['fields']));_0x156e50[_0x2758('0x37')]=_0x156e50[_0x2758('0x37')][_0x2758('0x38')]?_0x156e50['attributes']:_0x47c32f[_0x2758('0x33')];_0x156e50[_0x2758('0x3b')]=qs[_0x2758('0x3c')](_0x2c0208[_0x2758('0x34')][_0x2758('0x3c')]);_0x156e50[_0x2758('0x3d')]=qs[_0x2758('0x32')](_['pick'](_0x2c0208[_0x2758('0x34')],_0x47c32f[_0x2758('0x32')]));if(_0x2c0208['query'][_0x2758('0x41')]){_0x156e50[_0x2758('0x3d')]=_['merge'](_0x156e50[_0x2758('0x3d')],{'$or':_[_0x2758('0x2d')](_0x156e50[_0x2758('0x37')],function(_0x3f0358){var _0x2ece96={};_0x2ece96[_0x3f0358]={'$like':'%'+_0x2c0208[_0x2758('0x34')][_0x2758('0x41')]+'%'};return _0x2ece96;})});}_0x156e50=_[_0x2758('0x3f')]({},_0x156e50,_0x2c0208[_0x2758('0x42')]);return _0x14a65c[_0x2758('0x8c')](_0x156e50);}})['then'](function(_0x19c2db){if(_0x19c2db){_0x11c84d=_0x19c2db[_0x2758('0x38')];if(!_0x2c0208[_0x2758('0x34')]['hasOwnProperty'](_0x2758('0x3a'))){_0x156e50['limit']=qs[_0x2758('0x1d')](_0x2c0208['query'][_0x2758('0x1d')]);_0x156e50[_0x2758('0x1b')]=qs[_0x2758('0x1b')](_0x2c0208['query'][_0x2758('0x1b')]);}return _0x14a65c[_0x2758('0x8c')](_0x156e50);}})['then'](function(_0x493508){if(_0x493508){return _0x493508?{'count':_0x11c84d,'rows':_0x493508}:null;}})['then'](respondWithResult(_0x58a98c,null))['catch'](handleError(_0x58a98c,null));};exports[_0x2758('0x8e')]=function(_0xb52bbb,_0x1b1fa7,_0x19c18f){var _0x21ee55,_0x502d79;var _0x562edd=[];var _0x1d9bfe=moment()[_0x2758('0x62')](_0x2758('0x63'));return db[_0x2758('0x43')]['find']({'where':{'id':_0xb52bbb[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x1b1fa7,null))[_0x2758('0x24')](function(_0x5a8e41){if(_0x5a8e41){_0x502d79=_0x5a8e41;return _0x5a8e41[_0x2758('0x8e')](_0xb52bbb[_0x2758('0x4c')][_0x2758('0x64')],_[_0x2758('0x65')](_0xb52bbb[_0x2758('0x4c')],[_0x2758('0x64'),'id'])||{});}return null;})[_0x2758('0x66')](function(_0x1428e2){var _0x45a800;var _0x5b8764;_0x21ee55=_0x1428e2||[];var _0x57ca48=[];if(_0x1428e2){for(var _0x207551=0x0;_0x207551<_0x1428e2[_0x2758('0x38')];_0x207551+=0x1){var _0x538989=_0x1428e2[_0x207551]['get']({'plain':!![]});_0x45a800=squel[_0x2758('0x68')]()['into'](_0x2758('0x8f'))[_0x2758('0x6b')](['phone',_0x2758('0x6f'),_0x2758('0x71'),_0x2758('0x59'),_0x2758('0x55'),'updatedAt'],squel[_0x2758('0x6d')]()[_0x2758('0x6e')]('phone',_0x2758('0x6c'))[_0x2758('0x6e')]('id',_0x2758('0x6f'))[_0x2758('0x6e')](_0x538989['CmListId'][_0x2758('0x70')](),'ListId')[_0x2758('0x6e')](_0xb52bbb[_0x2758('0x54')]['id']['toString'](),_0x2758('0x59'))['field'](_0x2758('0x7c'),_0x2758('0x55'))['field'](_0x2758('0x7c'),_0x2758('0x56'))[_0x2758('0x72')](_0x2758('0x73'))[_0x2758('0x3d')](_0x2758('0x74'))[_0x2758('0x3d')](_0x2758('0x75'),_0x538989[_0x2758('0x76')]['toString']())[_0x2758('0x3d')]('phone\x20IS\x20NOT\x20NULL'))[_0x2758('0x70')]();_0x57ca48[_0x2758('0x88')](db[_0x2758('0x89')][_0x2758('0x34')](_0x45a800));}return BPromise[_0x2758('0x8a')](_0x57ca48);}})[_0x2758('0x24')](function(){return _0x21ee55;})[_0x2758('0x24')](respondWithResult(_0x1b1fa7,null))[_0x2758('0x46')](handleError(_0x1b1fa7,null));};exports['removeBlackLists']=function(_0x2ed741,_0x2be3b0,_0x3a5572){return db['Campaign'][_0x2758('0x4a')]({'where':{'id':_0x2ed741[_0x2758('0x54')]['id']}})[_0x2758('0x24')](handleEntityNotFound(_0x2be3b0,null))['then'](function(_0x47507f){if(_0x47507f){return _0x47507f[_0x2758('0x90')](_0x2ed741[_0x2758('0x34')][_0x2758('0x64')]);}})[_0x2758('0x24')](function(_0x2b6796){if(_0x2b6796){return db[_0x2758('0x5f')][_0x2758('0x25')]({'where':{'ListId':_0x2ed741[_0x2758('0x34')]['ids'],'CampaignId':_0x2ed741['params']['id']}})['then'](function(){return _0x2b6796;});}})[_0x2758('0x24')](respondWithStatusCode(_0x2be3b0,null))[_0x2758('0x46')](handleError(_0x2be3b0,null));};
\ No newline at end of file
+var _0x53aa=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','params','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','phone','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','cm_hopper','insert','cm_hopper_additional_phones','cmHopperId','ci.OrderBY','OrderBy','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','Campaign','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error'];(function(_0x3b1c9a,_0x5b2988){var _0x4bfe0e=function(_0x6050c2){while(--_0x6050c2){_0x3b1c9a['push'](_0x3b1c9a['shift']());}};_0x4bfe0e(++_0x5b2988);}(_0x53aa,0x167));var _0xa53a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x53aa[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xa53a('0x0'));var rimraf=require(_0xa53a('0x1'));var zipdir=require(_0xa53a('0x2'));var jsonpatch=require(_0xa53a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa53a('0x4'));var Mustache=require('mustache');var util=require(_0xa53a('0x5'));var path=require(_0xa53a('0x6'));var sox=require(_0xa53a('0x7'));var csv=require(_0xa53a('0x8'));var ejs=require(_0xa53a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa53a('0xa'));var squel=require(_0xa53a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa53a('0xc'));var deskjs=require(_0xa53a('0xd'));var toCsv=require(_0xa53a('0x8'));var querystring=require('querystring');var Papa=require(_0xa53a('0xe'));var Redis=require('ioredis');var authService=require(_0xa53a('0xf'));var qs=require(_0xa53a('0x10'));var as=require(_0xa53a('0x11'));var hardwareService=require(_0xa53a('0x12'));var logger=require(_0xa53a('0x13'))(_0xa53a('0x14'));var utils=require(_0xa53a('0x15'));var config=require(_0xa53a('0x16'));var licenseUtil=require(_0xa53a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448fcb,_0x52cb14){_0x52cb14=_0x52cb14||0xcc;return function(_0x3d5a63){if(_0x3d5a63){return _0x448fcb[_0xa53a('0x18')](_0x52cb14);}return _0x448fcb[_0xa53a('0x19')](_0x52cb14)[_0xa53a('0x1a')]();};}function respondWithResult(_0x252c59,_0x333cdc){_0x333cdc=_0x333cdc||0xc8;return function(_0xebb4b7){if(_0xebb4b7){return _0x252c59[_0xa53a('0x19')](_0x333cdc)[_0xa53a('0x1b')](_0xebb4b7);}};}function respondWithFilteredResult(_0x1ce266,_0x2d1f21){return function(_0x427d66){if(_0x427d66){var _0x5c5a14=typeof _0x2d1f21[_0xa53a('0x1c')]===_0xa53a('0x1d')&&typeof _0x2d1f21['limit']===_0xa53a('0x1d');var _0x3f3869=_0x427d66[_0xa53a('0x1e')];var _0xf61650=_0x5c5a14?0x0:_0x2d1f21[_0xa53a('0x1c')];var _0x379a0b=_0x5c5a14?_0x427d66[_0xa53a('0x1e')]:_0x2d1f21[_0xa53a('0x1c')]+_0x2d1f21[_0xa53a('0x1f')];var _0x1e1401;if(_0x379a0b>=_0x3f3869){_0x379a0b=_0x3f3869;_0x1e1401=0xc8;}else{_0x1e1401=0xce;}_0x1ce266[_0xa53a('0x19')](_0x1e1401);return _0x1ce266[_0xa53a('0x20')](_0xa53a('0x21'),_0xf61650+'-'+_0x379a0b+'/'+_0x3f3869)[_0xa53a('0x1b')](_0x427d66);}return null;};}function patchUpdates(_0x584c4e){return function(_0x4527c8){try{jsonpatch[_0xa53a('0x22')](_0x4527c8,_0x584c4e,!![]);}catch(_0x478ff2){return BPromise[_0xa53a('0x23')](_0x478ff2);}return _0x4527c8['save']();};}function saveUpdates(_0x1a2a2a,_0x352f91){return function(_0xc5fe37){if(_0xc5fe37){return _0xc5fe37[_0xa53a('0x24')](_0x1a2a2a)[_0xa53a('0x25')](function(_0x324a24){return _0x324a24;});}return null;};}function removeEntity(_0x5cdb5c,_0x138a10){return function(_0x2cc210){if(_0x2cc210){return _0x2cc210['destroy']()[_0xa53a('0x25')](function(){var _0x3878e0=_0x2cc210[_0xa53a('0x26')]({'plain':!![]});var _0x1d9466=_0xa53a('0x27');return db[_0xa53a('0x28')][_0xa53a('0x29')]({'where':{'type':_0x1d9466,'resourceId':_0x3878e0['id']}})['then'](function(){return _0x2cc210;});})['then'](function(){_0x5cdb5c[_0xa53a('0x19')](0xcc)[_0xa53a('0x1a')]();});}};}function handleEntityNotFound(_0x512d96,_0x3d11a2){return function(_0xe10903){if(!_0xe10903){_0x512d96[_0xa53a('0x18')](0x194);}return _0xe10903;};}function handleError(_0x33565a,_0x2ffcb6){_0x2ffcb6=_0x2ffcb6||0x1f4;return function(_0x1e796b){logger['error'](_0x1e796b[_0xa53a('0x2a')]);if(_0x1e796b[_0xa53a('0x2b')]){delete _0x1e796b[_0xa53a('0x2b')];}_0x33565a['status'](_0x2ffcb6)['send'](_0x1e796b);};}exports[_0xa53a('0x2c')]=function(_0x37ef40,_0x1bb99d){var _0x4bd9b9={},_0x2d78eb={},_0xd60689={'count':0x0,'rows':[]};var _0x7e6177=_[_0xa53a('0x2d')](db['Campaign']['rawAttributes'],function(_0x2b7024){return{'name':_0x2b7024[_0xa53a('0x2e')],'type':_0x2b7024[_0xa53a('0x2f')][_0xa53a('0x30')]};});_0x2d78eb[_0xa53a('0x31')]=_[_0xa53a('0x2d')](_0x7e6177,_0xa53a('0x2b'));_0x2d78eb[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x37ef40['query']);_0x2d78eb[_0xa53a('0x34')]=_['intersection'](_0x2d78eb[_0xa53a('0x31')],_0x2d78eb[_0xa53a('0x32')]);_0x4bd9b9[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x2d78eb[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x37')]));_0x4bd9b9[_0xa53a('0x35')]=_0x4bd9b9['attributes'][_0xa53a('0x38')]?_0x4bd9b9['attributes']:_0x2d78eb['model'];if(!_0x37ef40[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x4bd9b9['limit']=qs[_0xa53a('0x1f')](_0x37ef40['query'][_0xa53a('0x1f')]);_0x4bd9b9[_0xa53a('0x1c')]=qs['offset'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x4bd9b9[_0xa53a('0x3b')]=qs['sort'](_0x37ef40[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x4bd9b9['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x37ef40[_0xa53a('0x32')],_0x2d78eb[_0xa53a('0x34')]),_0x7e6177);if(_0x37ef40[_0xa53a('0x32')]['filter']){_0x4bd9b9[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x4bd9b9['where'],{'$or':_[_0xa53a('0x2d')](_0x7e6177,function(_0x11e623){if(_0x11e623[_0xa53a('0x2f')]!==_0xa53a('0x40')){var _0x4602b5={};_0x4602b5[_0x11e623[_0xa53a('0x2b')]]={'$like':'%'+_0x37ef40[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4602b5;}})});}_0x4bd9b9=_[_0xa53a('0x3f')]({},_0x4bd9b9,_0x37ef40[_0xa53a('0x42')]);var _0x50fd89={'where':_0x4bd9b9[_0xa53a('0x3e')]};return db['Campaign'][_0xa53a('0x1e')](_0x50fd89)[_0xa53a('0x25')](function(_0x4a9d5d){_0xd60689[_0xa53a('0x1e')]=_0x4a9d5d;if(_0x37ef40[_0xa53a('0x32')][_0xa53a('0x43')]){_0x4bd9b9[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x45')][_0xa53a('0x46')](_0x4bd9b9);})[_0xa53a('0x25')](function(_0x3fc9ea){_0xd60689[_0xa53a('0x47')]=_0x3fc9ea;return _0xd60689;})[_0xa53a('0x25')](respondWithFilteredResult(_0x1bb99d,_0x4bd9b9))[_0xa53a('0x48')](handleError(_0x1bb99d,null));};exports[_0xa53a('0x49')]=function(_0x4f5178,_0x1e4536){var _0x55ded6={'raw':![],'where':{'id':_0x4f5178['params']['id']}},_0x1dd82b={};_0x1dd82b[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x1dd82b[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x4f5178[_0xa53a('0x32')]);_0x1dd82b[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],_0x1dd82b[_0xa53a('0x32')]);_0x55ded6[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1dd82b[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x4f5178['query']['fields']));_0x55ded6[_0xa53a('0x35')]=_0x55ded6[_0xa53a('0x35')][_0xa53a('0x38')]?_0x55ded6[_0xa53a('0x35')]:_0x1dd82b[_0xa53a('0x31')];if(_0x4f5178[_0xa53a('0x32')][_0xa53a('0x43')]){_0x55ded6[_0xa53a('0x44')]=[{'all':!![]}];}_0x55ded6=_[_0xa53a('0x3f')]({},_0x55ded6,_0x4f5178['options']);return db[_0xa53a('0x45')][_0xa53a('0x4b')](_0x55ded6)[_0xa53a('0x25')](handleEntityNotFound(_0x1e4536,null))[_0xa53a('0x25')](respondWithResult(_0x1e4536,null))[_0xa53a('0x48')](handleError(_0x1e4536,null));};exports['create']=function(_0xd16651,_0xec389b){return db[_0xa53a('0x45')][_0xa53a('0x4c')](_0xd16651[_0xa53a('0x4d')],{})[_0xa53a('0x25')](function(_0x30e30f){var _0x10b86b=_0xd16651[_0xa53a('0x4e')][_0xa53a('0x26')]({'plain':!![]});if(!_0x10b86b)throw new Error(_0xa53a('0x4f'));if(_0x10b86b[_0xa53a('0x50')]===_0xa53a('0x4e')){var _0x515f62=_0x30e30f[_0xa53a('0x26')]({'plain':!![]});var _0x5380bb=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x5380bb,'userProfileId':_0x10b86b[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x13acaf){if(_0x13acaf&&_0x13acaf[_0xa53a('0x53')]===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0x515f62[_0xa53a('0x2b')],'resourceId':_0x515f62['id'],'type':_0x13acaf[_0xa53a('0x2b')],'sectionId':_0x13acaf['id']},{})[_0xa53a('0x25')](function(){return _0x30e30f;});}else{return _0x30e30f;}})['catch'](function(_0x56a4ef){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x56a4ef);throw _0x56a4ef;});}return _0x30e30f;})[_0xa53a('0x25')](respondWithResult(_0xec389b,0xc9))['catch'](handleError(_0xec389b,null));};exports[_0xa53a('0x56')]=function(_0x1a9449,_0x36b9c){var _0x2416f3={'where':{'id':_0x1a9449['params']['id']}},_0x5709e9={};_0x5709e9[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x45')][_0xa53a('0x4a')]);_0x2416f3[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x5709e9[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x1a9449[_0xa53a('0x32')][_0xa53a('0x37')]));_0x2416f3['attributes']=_0x2416f3[_0xa53a('0x35')]['length']?_0x2416f3['attributes']:_0x5709e9[_0xa53a('0x31')];if(_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]){_0x2416f3['include']=[{'all':!![]}];}_0x2416f3=_[_0xa53a('0x3f')]({},_0x2416f3,_0x1a9449[_0xa53a('0x42')]);return db['Campaign'][_0xa53a('0x4b')](_0x2416f3)[_0xa53a('0x25')](handleEntityNotFound(_0x36b9c,null))[_0xa53a('0x25')](function(_0x4fbe3b){if(_0x4fbe3b){var _0x75f0e0=_0x4fbe3b[_0xa53a('0x26')]({'plain':!![]});_0x75f0e0=qs[_0xa53a('0x57')](_0x75f0e0,['id',_0xa53a('0x58'),_0xa53a('0x59')]);_0x1a9449['body']=_['omit'](_0x1a9449['body'],['id','createdAt','updatedAt']);return db[_0xa53a('0x45')][_0xa53a('0x4c')](_[_0xa53a('0x3f')](_0x75f0e0,_0x1a9449['body']),{'include':_0x1a9449[_0xa53a('0x32')][_0xa53a('0x43')]?[{'all':!![]}]:undefined})[_0xa53a('0x25')](function(_0x5556da){var _0x306891=_0x1a9449['user']['get']({'plain':!![]});if(!_0x306891)throw new Error(_0xa53a('0x4f'));if(_0x306891['role']===_0xa53a('0x4e')){var _0xfa9984=_0x5556da[_0xa53a('0x26')]({'plain':!![]});var _0x35c243=_0xa53a('0x27');return db[_0xa53a('0x51')]['find']({'where':{'name':_0x35c243,'userProfileId':_0x306891[_0xa53a('0x52')]},'raw':!![]})[_0xa53a('0x25')](function(_0x1439a4){if(_0x1439a4&&_0x1439a4['autoAssociation']===0x0){return db[_0xa53a('0x28')][_0xa53a('0x4c')]({'name':_0xfa9984[_0xa53a('0x2b')],'resourceId':_0xfa9984['id'],'type':_0x1439a4[_0xa53a('0x2b')],'sectionId':_0x1439a4['id']},{})[_0xa53a('0x25')](function(){return _0x5556da;});}else{return _0x5556da;}})[_0xa53a('0x48')](function(_0x5bd848){logger[_0xa53a('0x54')](_0xa53a('0x55'),_0x5bd848);throw _0x5bd848;});}return _0x5556da;});}})['then'](respondWithResult(_0x36b9c,0xc9))[_0xa53a('0x48')](handleError(_0x36b9c,null));};exports[_0xa53a('0x24')]=function(_0x530ca8,_0x4c7f47){if(_0x530ca8['body']['id']){delete _0x530ca8[_0xa53a('0x4d')]['id'];}return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x530ca8[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x4c7f47,null))['then'](saveUpdates(_0x530ca8[_0xa53a('0x4d')],null))[_0xa53a('0x25')](respondWithResult(_0x4c7f47,null))[_0xa53a('0x48')](handleError(_0x4c7f47,null));};exports[_0xa53a('0x29')]=function(_0x16ac88,_0x240a25){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x16ac88[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x240a25,null))['then'](removeEntity(_0x240a25,null))['catch'](handleError(_0x240a25,null));};exports[_0xa53a('0x5b')]=function(_0x25044f,_0x11f1c3,_0x3f16df){var _0x17f983={'raw':!![],'where':{}};var _0x229f8c={};var _0x4143f2={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x25044f[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x11f1c3,null))[_0xa53a('0x25')](function(_0x363ae1){if(_0x363ae1){_0x229f8c['model']=_[_0xa53a('0x33')](db[_0xa53a('0x5d')][_0xa53a('0x4a')]);_0x229f8c[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x25044f[_0xa53a('0x32')]);_0x229f8c[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x229f8c['model'],_0x229f8c['query']);_0x17f983[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x229f8c['model'],qs['fields'](_0x25044f[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17f983[_0xa53a('0x35')]=_0x17f983[_0xa53a('0x35')]['length']?_0x17f983[_0xa53a('0x35')]:_0x229f8c[_0xa53a('0x31')];if(!_0x25044f[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17f983[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1f')]);_0x17f983[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x17f983[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x25044f[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17f983[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x25044f[_0xa53a('0x32')],_0x229f8c[_0xa53a('0x34')]));_0x17f983[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x363ae1['id'];if(_0x25044f[_0xa53a('0x32')]['filter']){_0x17f983[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17f983['where'],{'$or':_[_0xa53a('0x2d')](_0x17f983[_0xa53a('0x35')],function(_0x3a7675){var _0x15976a={};_0x15976a[_0x3a7675]={'$like':'%'+_0x25044f['query'][_0xa53a('0x41')]+'%'};return _0x15976a;})});}_0x17f983=_[_0xa53a('0x3f')]({},_0x17f983,_0x25044f[_0xa53a('0x42')]);return db['CmHopper']['count']({'where':_0x17f983[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x343235){_0x4143f2['count']=_0x343235;if(_0x25044f[_0xa53a('0x32')][_0xa53a('0x43')]){_0x17f983[_0xa53a('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0xa53a('0x46')](_0x17f983);})[_0xa53a('0x25')](function(_0x5da9ce){_0x4143f2[_0xa53a('0x47')]=_0x5da9ce;return _0x4143f2;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x11f1c3,_0x17f983))['catch'](handleError(_0x11f1c3,null));};exports[_0xa53a('0x5f')]=function(_0x27decf,_0xdec0eb,_0x77779){var _0x208d92={'raw':!![],'where':{}};var _0x324446={};var _0x916b0a={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x27decf[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0xdec0eb,null))[_0xa53a('0x25')](function(_0x2a3227){if(_0x2a3227){_0x324446[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x60')][_0xa53a('0x4a')]);_0x324446[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x27decf['query']);_0x324446['filters']=_[_0xa53a('0x36')](_0x324446['model'],_0x324446[_0xa53a('0x32')]);_0x208d92[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x324446[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x27decf[_0xa53a('0x32')]['fields']));_0x208d92[_0xa53a('0x35')]=_0x208d92['attributes'][_0xa53a('0x38')]?_0x208d92[_0xa53a('0x35')]:_0x324446[_0xa53a('0x31')];if(!_0x27decf[_0xa53a('0x32')][_0xa53a('0x39')]('nolimit')){_0x208d92[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x27decf[_0xa53a('0x32')]['limit']);_0x208d92[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x27decf[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x208d92[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x27decf[_0xa53a('0x32')]['sort']);_0x208d92[_0xa53a('0x3e')]=qs['filters'](_[_0xa53a('0x3d')](_0x27decf[_0xa53a('0x32')],_0x324446[_0xa53a('0x34')]));_0x208d92[_0xa53a('0x3e')]['CampaignId']=_0x2a3227['id'];if(_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]){_0x208d92[_0xa53a('0x3e')]=_['merge'](_0x208d92['where'],{'$or':_['map'](_0x208d92[_0xa53a('0x35')],function(_0x5004e8){var _0x31ec53={};_0x31ec53[_0x5004e8]={'$like':'%'+_0x27decf[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x31ec53;})});}_0x208d92=_[_0xa53a('0x3f')]({},_0x208d92,_0x27decf[_0xa53a('0x42')]);return db[_0xa53a('0x60')][_0xa53a('0x1e')]({'where':_0x208d92[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x2335ea){_0x916b0a['count']=_0x2335ea;if(_0x27decf['query']['includeAll']){_0x208d92[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x60')][_0xa53a('0x46')](_0x208d92);})['then'](function(_0x439134){_0x916b0a[_0xa53a('0x47')]=_0x439134;return _0x916b0a;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0xdec0eb,_0x208d92))[_0xa53a('0x48')](handleError(_0xdec0eb,null));};exports[_0xa53a('0x61')]=function(_0x2b1cb2,_0x131375,_0x17eddb){var _0xf317e7={'raw':!![],'where':{}};var _0x1c9cd3={};var _0x454358={'count':0x0,'rows':[]};return db['Campaign'][_0xa53a('0x5c')]({'where':{'id':_0x2b1cb2[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x131375,null))['then'](function(_0x34c13b){if(_0x34c13b){_0x1c9cd3[_0xa53a('0x31')]=_['keys'](db[_0xa53a('0x62')][_0xa53a('0x4a')]);_0x1c9cd3[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x2b1cb2[_0xa53a('0x32')]);_0x1c9cd3[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x1c9cd3['model'],_0x1c9cd3[_0xa53a('0x32')]);_0xf317e7[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x1c9cd3['model'],qs[_0xa53a('0x37')](_0x2b1cb2['query'][_0xa53a('0x37')]));_0xf317e7['attributes']=_0xf317e7[_0xa53a('0x35')][_0xa53a('0x38')]?_0xf317e7[_0xa53a('0x35')]:_0x1c9cd3[_0xa53a('0x31')];if(!_0x2b1cb2['query'][_0xa53a('0x39')]('nolimit')){_0xf317e7[_0xa53a('0x1f')]=qs['limit'](_0x2b1cb2[_0xa53a('0x32')]['limit']);_0xf317e7[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0xf317e7[_0xa53a('0x3b')]=qs['sort'](_0x2b1cb2['query'][_0xa53a('0x3c')]);_0xf317e7['where']=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x2b1cb2[_0xa53a('0x32')],_0x1c9cd3[_0xa53a('0x34')]));_0xf317e7[_0xa53a('0x3e')][_0xa53a('0x5e')]=_0x34c13b['id'];if(_0x2b1cb2['query'][_0xa53a('0x41')]){_0xf317e7[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0xf317e7[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0xf317e7['attributes'],function(_0x25e9c9){var _0x4e3b51={};_0x4e3b51[_0x25e9c9]={'$like':'%'+_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4e3b51;})});}_0xf317e7=_['merge']({},_0xf317e7,_0x2b1cb2[_0xa53a('0x42')]);return db[_0xa53a('0x62')][_0xa53a('0x1e')]({'where':_0xf317e7[_0xa53a('0x3e')]})[_0xa53a('0x25')](function(_0x447fbb){_0x454358['count']=_0x447fbb;if(_0x2b1cb2[_0xa53a('0x32')][_0xa53a('0x43')]){_0xf317e7[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x62')]['findAll'](_0xf317e7);})[_0xa53a('0x25')](function(_0x17d295){_0x454358[_0xa53a('0x47')]=_0x17d295;return _0x454358;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x131375,_0xf317e7))['catch'](handleError(_0x131375,null));};exports[_0xa53a('0x63')]=function(_0x10fa08,_0x2de2e8,_0x16c3f4){var _0x3e0ce2={'raw':!![],'where':{}};var _0x941bad={};var _0x20871b={'count':0x0,'rows':[]};return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x10fa08[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x2de2e8,null))[_0xa53a('0x25')](function(_0x3151bb){if(_0x3151bb){_0x941bad[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x64')][_0xa53a('0x4a')]);_0x941bad[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x10fa08[_0xa53a('0x32')]);_0x941bad[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x941bad[_0xa53a('0x31')],_0x941bad[_0xa53a('0x32')]);_0x3e0ce2[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x941bad[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x10fa08['query']['fields']));_0x3e0ce2[_0xa53a('0x35')]=_0x3e0ce2['attributes'][_0xa53a('0x38')]?_0x3e0ce2['attributes']:_0x941bad[_0xa53a('0x31')];if(!_0x10fa08[_0xa53a('0x32')]['hasOwnProperty']('nolimit')){_0x3e0ce2[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x10fa08['query'][_0xa53a('0x1f')]);_0x3e0ce2[_0xa53a('0x1c')]=qs['offset'](_0x10fa08[_0xa53a('0x32')][_0xa53a('0x1c')]);}_0x3e0ce2['order']=qs[_0xa53a('0x3c')](_0x10fa08[_0xa53a('0x32')]['sort']);_0x3e0ce2[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x10fa08[_0xa53a('0x32')],_0x941bad[_0xa53a('0x34')]));_0x3e0ce2['where'][_0xa53a('0x5e')]=_0x3151bb['id'];if(_0x10fa08[_0xa53a('0x32')]['filter']){_0x3e0ce2[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x3e0ce2[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0x3e0ce2[_0xa53a('0x35')],function(_0x32eebf){var _0x4911eb={};_0x4911eb[_0x32eebf]={'$like':'%'+_0x10fa08[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x4911eb;})});}_0x3e0ce2=_[_0xa53a('0x3f')]({},_0x3e0ce2,_0x10fa08[_0xa53a('0x42')]);return db[_0xa53a('0x64')]['count']({'where':_0x3e0ce2[_0xa53a('0x3e')]})['then'](function(_0x34e770){_0x20871b['count']=_0x34e770;if(_0x10fa08[_0xa53a('0x32')][_0xa53a('0x43')]){_0x3e0ce2[_0xa53a('0x44')]=[{'all':!![]}];}return db[_0xa53a('0x64')][_0xa53a('0x46')](_0x3e0ce2);})[_0xa53a('0x25')](function(_0x443530){_0x20871b[_0xa53a('0x47')]=_0x443530;return _0x20871b;});}})[_0xa53a('0x25')](respondWithFilteredResult(_0x2de2e8,_0x3e0ce2))[_0xa53a('0x48')](handleError(_0x2de2e8,null));};exports[_0xa53a('0x65')]=function(_0x588aaa,_0x211888,_0x1a41f2){var _0x17ba41={};var _0x192edf={};var _0x5727ed;var _0x21ca42;return db[_0xa53a('0x45')]['findOne']({'where':{'id':_0x588aaa[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x211888,null))[_0xa53a('0x25')](function(_0x279a2a){if(_0x279a2a){_0x5727ed=_0x279a2a;_0x192edf[_0xa53a('0x31')]=_[_0xa53a('0x33')](db[_0xa53a('0x66')]['rawAttributes']);_0x192edf[_0xa53a('0x32')]=_[_0xa53a('0x33')](_0x588aaa[_0xa53a('0x32')]);_0x192edf[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x192edf[_0xa53a('0x31')],_0x192edf['query']);_0x17ba41[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x192edf[_0xa53a('0x31')],qs['fields'](_0x588aaa[_0xa53a('0x32')][_0xa53a('0x37')]));_0x17ba41[_0xa53a('0x35')]=_0x17ba41[_0xa53a('0x35')][_0xa53a('0x38')]?_0x17ba41[_0xa53a('0x35')]:_0x192edf[_0xa53a('0x31')];_0x17ba41[_0xa53a('0x3b')]=qs[_0xa53a('0x3c')](_0x588aaa[_0xa53a('0x32')][_0xa53a('0x3c')]);_0x17ba41[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_[_0xa53a('0x3d')](_0x588aaa['query'],_0x192edf[_0xa53a('0x34')]));if(_0x588aaa[_0xa53a('0x32')][_0xa53a('0x41')]){_0x17ba41[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x17ba41[_0xa53a('0x3e')],{'$or':_['map'](_0x17ba41[_0xa53a('0x35')],function(_0x20a11d){var _0x1a02a0={};_0x1a02a0[_0x20a11d]={'$like':'%'+_0x588aaa[_0xa53a('0x32')][_0xa53a('0x41')]+'%'};return _0x1a02a0;})});}_0x17ba41=_[_0xa53a('0x3f')]({},_0x17ba41,_0x588aaa[_0xa53a('0x42')]);return _0x5727ed[_0xa53a('0x65')](_0x17ba41);}})[_0xa53a('0x25')](function(_0x35d9dc){if(_0x35d9dc){_0x21ca42=_0x35d9dc[_0xa53a('0x38')];if(!_0x588aaa[_0xa53a('0x32')][_0xa53a('0x39')](_0xa53a('0x3a'))){_0x17ba41[_0xa53a('0x1f')]=qs[_0xa53a('0x1f')](_0x588aaa['query'][_0xa53a('0x1f')]);_0x17ba41['offset']=qs['offset'](_0x588aaa[_0xa53a('0x32')]['offset']);}return _0x5727ed['getLists'](_0x17ba41);}})[_0xa53a('0x25')](function(_0x2e02ca){if(_0x2e02ca){return _0x2e02ca?{'count':_0x21ca42,'rows':_0x2e02ca}:null;}})[_0xa53a('0x25')](respondWithResult(_0x211888,null))['catch'](handleError(_0x211888,null));};exports[_0xa53a('0x67')]=function(_0x51754e,_0x9f05cb,_0x15e837){var _0x132533,_0xadb0af;var _0x3bcca7=[];var _0x1218e7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa53a('0x45')]['find']({'where':{'id':_0x51754e[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x9f05cb,null))['then'](function(_0x3c238e){if(_0x3c238e){_0xadb0af=_0x3c238e;return _0x3c238e[_0xa53a('0x67')](_0x51754e[_0xa53a('0x4d')]['ids'],_['omit'](_0x51754e[_0xa53a('0x4d')],[_0xa53a('0x68'),'id'])||{});}return null;})[_0xa53a('0x69')](function(_0x24d470){var _0x406f0c;var _0x10685e;_0x132533=_0x24d470||[];var _0x2254d3=[];if(_0x24d470){for(var _0x582064=0x0;_0x582064<_0x24d470[_0xa53a('0x38')];_0x582064+=0x1){var _0x131d06=_0x24d470[_0x582064][_0xa53a('0x26')]({'plain':!![]});_0xadb0af[_0xa53a('0x6a')]=_0x51754e[_0xa53a('0x4d')][_0xa53a('0x6a')]?_0x51754e[_0xa53a('0x4d')][_0xa53a('0x6a')]:_0xadb0af[_0xa53a('0x6a')];switch(_0xadb0af[_0xa53a('0x6a')]){case _0xa53a('0x6b'):_0x406f0c=squel['insert']()[_0xa53a('0x6c')]('cm_hopper')[_0xa53a('0x6d')](['phone',_0xa53a('0x6e'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('phone','phone')[_0xa53a('0x72')](_0xa53a('0x73'),_0xa53a('0x6e'))['field']('id','ContactId')['field'](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))[_0xa53a('0x72')](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))['field']('\x27'+_0x1218e7+'\x27','createdAt')[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27','updatedAt')[_0xa53a('0x76')](_0xa53a('0x77'))['where']('deletedAt\x20IS\x20NULL')[_0xa53a('0x3e')]('ListId\x20=\x20?',_0x131d06['CmListId'][_0xa53a('0x75')]())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('COALESCE(calleridnum,\x27\x27)')[_0xa53a('0x76')](_0xa53a('0x78'))[_0xa53a('0x3e')](_0xa53a('0x79'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]()))['where'](_0xa53a('0x7a'),squel[_0xa53a('0x71')]()[_0xa53a('0x72')](_0xa53a('0x7b'))[_0xa53a('0x76')]('cm_hopper')[_0xa53a('0x3e')](_0xa53a('0x79'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]())))[_0xa53a('0x75')]();break;case _0xa53a('0x7c'):_0x406f0c=squel['insert']()[_0xa53a('0x6c')]('cm_hopper')[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6e'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel[_0xa53a('0x71')]()['field'](_0xa53a('0x7d'),'phone')[_0xa53a('0x72')](_0xa53a('0x73'),'scheduledAt')['field']('id',_0xa53a('0x6f'))['field'](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),'ListId')['field'](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27','createdAt')[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')]('cm_contacts')[_0xa53a('0x3e')](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')]())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0xa53a('0x3e')](_0xa53a('0x7a'),squel[_0xa53a('0x71')]()['field'](_0xa53a('0x7b'))[_0xa53a('0x76')](_0xa53a('0x80'))['where'](_0xa53a('0x79'),_0x51754e['params']['id']['toString']())))[_0xa53a('0x75')]();break;default:_0x406f0c=squel[_0xa53a('0x81')]()[_0xa53a('0x6c')](_0xa53a('0x80'))[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6e'),'ContactId','ListId',_0xa53a('0x5e'),'createdAt',_0xa53a('0x59')],squel['select']()[_0xa53a('0x72')]('phone',_0xa53a('0x7d'))[_0xa53a('0x72')](_0xa53a('0x73'),'scheduledAt')['field']('id',_0xa53a('0x6f'))[_0xa53a('0x72')](_0x131d06[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))['field'](_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')](),_0xa53a('0x5e'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x58'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')](_0xa53a('0x77'))[_0xa53a('0x3e')](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x131d06[_0xa53a('0x74')]['toString']())[_0xa53a('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0xa53a('0x75')]();}_0x10685e=squel[_0xa53a('0x81')]()['into'](_0xa53a('0x82'))[_0xa53a('0x6d')]([_0xa53a('0x83'),_0xa53a('0x6e'),'phone','OrderBy',_0xa53a('0x58'),'updatedAt'],squel[_0xa53a('0x71')]()[_0xa53a('0x72')]('h.id','id')[_0xa53a('0x72')](_0xa53a('0x73'),_0xa53a('0x6e'))[_0xa53a('0x72')]('ci.item',_0xa53a('0x7d'))[_0xa53a('0x72')](_0xa53a('0x84'),_0xa53a('0x85'))[_0xa53a('0x72')]('\x27'+_0x1218e7+'\x27',_0xa53a('0x58'))['field']('\x27'+_0x1218e7+'\x27',_0xa53a('0x59'))[_0xa53a('0x76')]('cm_contact_has_items','ci')['join'](_0xa53a('0x80'),'h',_0xa53a('0x86'))['where'](_0xa53a('0x87'),_0x131d06[_0xa53a('0x74')]['toString']())['where'](_0xa53a('0x88'),_0x51754e[_0xa53a('0x5a')]['id'][_0xa53a('0x75')]())[_0xa53a('0x3e')](_0xa53a('0x89'),_0x1218e7))[_0xa53a('0x75')]();_0x2254d3[_0xa53a('0x8a')](db[_0xa53a('0x8b')][_0xa53a('0x32')](_0x406f0c));_0x3bcca7[_0xa53a('0x8a')](db['sequelize'][_0xa53a('0x32')](_0x10685e));}return BPromise[_0xa53a('0x8c')](_0x2254d3);}})[_0xa53a('0x25')](function(){return BPromise[_0xa53a('0x8c')](_0x3bcca7);})['then'](function(){return _0x132533;})[_0xa53a('0x25')](respondWithResult(_0x9f05cb,null))[_0xa53a('0x48')](handleError(_0x9f05cb,null));};exports['removeLists']=function(_0x19f146,_0x48569e,_0x1f1790){return db['Campaign'][_0xa53a('0x4b')]({'where':{'id':_0x19f146[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x48569e,null))['then'](function(_0x3d0a22){if(_0x3d0a22){return _0x3d0a22[_0xa53a('0x8d')](_0x19f146[_0xa53a('0x32')]['ids']);}})[_0xa53a('0x25')](function(_0x456fdc){if(_0x456fdc){return db['CmHopper'][_0xa53a('0x29')]({'where':{'ListId':_0x19f146[_0xa53a('0x32')]['ids'],'CampaignId':_0x19f146[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](function(){return _0x456fdc;});}})[_0xa53a('0x25')](respondWithStatusCode(_0x48569e,null))[_0xa53a('0x48')](handleError(_0x48569e,null));};exports[_0xa53a('0x8e')]=function(_0x3cb79d,_0x226e59,_0x24dc87){var _0x15a860={};var _0x208e72={};var _0x2b5c2d;var _0x1aa738;return db[_0xa53a('0x45')][_0xa53a('0x5c')]({'where':{'id':_0x3cb79d[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x226e59,null))[_0xa53a('0x25')](function(_0x250e29){if(_0x250e29){_0x2b5c2d=_0x250e29;_0x208e72['model']=_[_0xa53a('0x33')](db[_0xa53a('0x66')]['rawAttributes']);_0x208e72['query']=_[_0xa53a('0x33')](_0x3cb79d[_0xa53a('0x32')]);_0x208e72[_0xa53a('0x34')]=_[_0xa53a('0x36')](_0x208e72['model'],_0x208e72[_0xa53a('0x32')]);_0x15a860[_0xa53a('0x35')]=_[_0xa53a('0x36')](_0x208e72[_0xa53a('0x31')],qs[_0xa53a('0x37')](_0x3cb79d[_0xa53a('0x32')]['fields']));_0x15a860[_0xa53a('0x35')]=_0x15a860[_0xa53a('0x35')][_0xa53a('0x38')]?_0x15a860[_0xa53a('0x35')]:_0x208e72[_0xa53a('0x31')];_0x15a860[_0xa53a('0x3b')]=qs['sort'](_0x3cb79d['query']['sort']);_0x15a860[_0xa53a('0x3e')]=qs[_0xa53a('0x34')](_['pick'](_0x3cb79d['query'],_0x208e72[_0xa53a('0x34')]));if(_0x3cb79d[_0xa53a('0x32')][_0xa53a('0x41')]){_0x15a860[_0xa53a('0x3e')]=_[_0xa53a('0x3f')](_0x15a860[_0xa53a('0x3e')],{'$or':_[_0xa53a('0x2d')](_0x15a860[_0xa53a('0x35')],function(_0x1d007d){var _0x25b669={};_0x25b669[_0x1d007d]={'$like':'%'+_0x3cb79d['query'][_0xa53a('0x41')]+'%'};return _0x25b669;})});}_0x15a860=_[_0xa53a('0x3f')]({},_0x15a860,_0x3cb79d[_0xa53a('0x42')]);return _0x2b5c2d['getBlackLists'](_0x15a860);}})['then'](function(_0x16bf8b){if(_0x16bf8b){_0x1aa738=_0x16bf8b[_0xa53a('0x38')];if(!_0x3cb79d['query']['hasOwnProperty'](_0xa53a('0x3a'))){_0x15a860['limit']=qs[_0xa53a('0x1f')](_0x3cb79d['query'][_0xa53a('0x1f')]);_0x15a860[_0xa53a('0x1c')]=qs[_0xa53a('0x1c')](_0x3cb79d[_0xa53a('0x32')]['offset']);}return _0x2b5c2d['getBlackLists'](_0x15a860);}})[_0xa53a('0x25')](function(_0x5d7e51){if(_0x5d7e51){return _0x5d7e51?{'count':_0x1aa738,'rows':_0x5d7e51}:null;}})[_0xa53a('0x25')](respondWithResult(_0x226e59,null))[_0xa53a('0x48')](handleError(_0x226e59,null));};exports[_0xa53a('0x8f')]=function(_0x367414,_0x2d7f1c,_0x50ee18){var _0x1bef52,_0x2d6cdd;var _0x457ebb=[];var _0x5c61c5=moment()[_0xa53a('0x90')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0xa53a('0x45')]['find']({'where':{'id':_0x367414[_0xa53a('0x5a')]['id']}})[_0xa53a('0x25')](handleEntityNotFound(_0x2d7f1c,null))[_0xa53a('0x25')](function(_0x5ee541){if(_0x5ee541){_0x2d6cdd=_0x5ee541;return _0x5ee541[_0xa53a('0x8f')](_0x367414[_0xa53a('0x4d')][_0xa53a('0x68')],_[_0xa53a('0x57')](_0x367414[_0xa53a('0x4d')],['ids','id'])||{});}return null;})[_0xa53a('0x69')](function(_0x340371){var _0x4d63de;var _0x599b17;_0x1bef52=_0x340371||[];var _0x4142f5=[];if(_0x340371){for(var _0x28dbf4=0x0;_0x28dbf4<_0x340371['length'];_0x28dbf4+=0x1){var _0x29a129=_0x340371[_0x28dbf4][_0xa53a('0x26')]({'plain':!![]});_0x4d63de=squel['insert']()[_0xa53a('0x6c')](_0xa53a('0x91'))[_0xa53a('0x6d')]([_0xa53a('0x7d'),_0xa53a('0x6f'),_0xa53a('0x70'),_0xa53a('0x5e'),_0xa53a('0x58'),_0xa53a('0x59')],squel['select']()[_0xa53a('0x72')]('phone',_0xa53a('0x7d'))[_0xa53a('0x72')]('id','ContactId')[_0xa53a('0x72')](_0x29a129[_0xa53a('0x74')][_0xa53a('0x75')](),_0xa53a('0x70'))[_0xa53a('0x72')](_0x367414[_0xa53a('0x5a')]['id']['toString'](),_0xa53a('0x5e'))[_0xa53a('0x72')](_0xa53a('0x73'),'createdAt')['field']('NOW()','updatedAt')[_0xa53a('0x76')](_0xa53a('0x77'))['where'](_0xa53a('0x7e'))[_0xa53a('0x3e')](_0xa53a('0x7f'),_0x29a129[_0xa53a('0x74')][_0xa53a('0x75')]())[_0xa53a('0x3e')](_0xa53a('0x92')))[_0xa53a('0x75')]();_0x4142f5['push'](db[_0xa53a('0x8b')][_0xa53a('0x32')](_0x4d63de));}return BPromise[_0xa53a('0x8c')](_0x4142f5);}})['then'](function(){return _0x1bef52;})[_0xa53a('0x25')](respondWithResult(_0x2d7f1c,null))[_0xa53a('0x48')](handleError(_0x2d7f1c,null));};exports['removeBlackLists']=function(_0x1732fd,_0xb0a044,_0x4d3e55){return db[_0xa53a('0x45')][_0xa53a('0x4b')]({'where':{'id':_0x1732fd[_0xa53a('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb0a044,null))[_0xa53a('0x25')](function(_0x48f3c8){if(_0x48f3c8){return _0x48f3c8[_0xa53a('0x93')](_0x1732fd[_0xa53a('0x32')][_0xa53a('0x68')]);}})[_0xa53a('0x25')](function(_0x536871){if(_0x536871){return db[_0xa53a('0x64')]['destroy']({'where':{'ListId':_0x1732fd[_0xa53a('0x32')]['ids'],'CampaignId':_0x1732fd[_0xa53a('0x5a')]['id']}})['then'](function(){return _0x536871;});}})[_0xa53a('0x25')](respondWithStatusCode(_0xb0a044,null))[_0xa53a('0x48')](handleError(_0xb0a044,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 13c5119..21df338 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1bc2d6,_0x1257d3){var _0x559744=function(_0x537bad){while(--_0x537bad){_0x1bc2d6['push'](_0x1bc2d6['shift']());}};_0x559744(++_0x1257d3);}(_0x7a54,0x106));var _0x47a5=function(_0x3fda4c,_0x58f389){_0x3fda4c=_0x3fda4c-0x0;var _0x362dc5=_0x7a54[_0x3fda4c];return _0x362dc5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index d6ea42f..9f25fcf 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x295f=['where','attributes','limit','include','map','model','GetCampaign','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','findAll','options'];(function(_0x2b93a5,_0x31934c){var _0x4111dc=function(_0x3d4f71){while(--_0x3d4f71){_0x2b93a5['push'](_0x2b93a5['shift']());}};_0x4111dc(++_0x31934c);}(_0x295f,0x168));var _0xf295=function(_0x459f65,_0x23bf86){_0x459f65=_0x459f65-0x0;var _0x1286c6=_0x295f[_0x459f65];return _0x1286c6;};'use strict';var _=require('lodash');var util=require(_0xf295('0x0'));var moment=require(_0xf295('0x1'));var BPromise=require(_0xf295('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf295('0x3'));var db=require(_0xf295('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf295('0x5'));var config=require(_0xf295('0x6'));var jayson=require(_0xf295('0x7'));var client=jayson[_0xf295('0x8')][_0xf295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a890,_0x2b302f,_0x44e292){return new BPromise(function(_0x1f3320,_0x4041d5){return client[_0xf295('0xa')](_0x50a890,_0x44e292)[_0xf295('0xb')](function(_0xaf1853){logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));logger[_0xf295('0xf')](_0xf295('0x10'),_0x2b302f,'request\x20sent',JSON[_0xf295('0x11')](_0xaf1853));if(_0xaf1853[_0xf295('0x12')]){if(_0xaf1853['error'][_0xf295('0x13')]===0x1f4){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x4041d5(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x1f3320(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}else{logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));_0x1f3320(_0xaf1853[_0xf295('0x15')][_0xf295('0x14')]);}})['catch'](function(_0x57e1bc){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0x57e1bc);_0x4041d5(_0x57e1bc);});});}exports['GetCampaign']=function(_0x3e0a44){var _0x5d18e1=this;return new Promise(function(_0x30ad22,_0x4deacb){return db['Campaign'][_0xf295('0x16')]({'raw':_0x3e0a44[_0xf295('0x17')]?_0x3e0a44['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e0a44[_0xf295('0x17')]?_0x3e0a44[_0xf295('0x17')][_0xf295('0x18')]||null:null,'attributes':_0x3e0a44[_0xf295('0x17')]?_0x3e0a44[_0xf295('0x17')][_0xf295('0x19')]||null:null,'limit':_0x3e0a44['options']?_0x3e0a44['options'][_0xf295('0x1a')]||null:null,'include':_0x3e0a44['options']?_0x3e0a44[_0xf295('0x17')][_0xf295('0x1b')]?_[_0xf295('0x1c')](_0x3e0a44['options'][_0xf295('0x1b')],function(_0x2e079e){return{'model':db[_0x2e079e['model']],'as':_0x2e079e['as'],'attributes':_0x2e079e[_0xf295('0x19')],'include':_0x2e079e[_0xf295('0x1b')]?_[_0xf295('0x1c')](_0x2e079e[_0xf295('0x1b')],function(_0x111449){return{'model':db[_0x111449['model']],'as':_0x111449['as'],'attributes':_0x111449[_0xf295('0x19')],'include':_0x111449[_0xf295('0x1b')]?_['map'](_0x111449['include'],function(_0x1ba1dd){return{'model':db[_0x1ba1dd[_0xf295('0x1d')]],'as':_0x1ba1dd['as'],'attributes':_0x1ba1dd[_0xf295('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf295('0xb')](function(_0x2f3f73){logger[_0xf295('0xc')](_0xf295('0x1e'),_0x3e0a44);logger[_0xf295('0xf')](_0xf295('0x1e'),_0x3e0a44,JSON['stringify'](_0x2f3f73));_0x30ad22(_0x2f3f73);})[_0xf295('0x1f')](function(_0x19ec3a){logger[_0xf295('0x12')](_0xf295('0x1e'),_0x19ec3a[_0xf295('0x14')],_0x3e0a44);_0x4deacb(_0x5d18e1[_0xf295('0x12')](0x1f4,_0x19ec3a['message']));});});};
\ No newline at end of file
+var _0x2821=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','map','include','model','then','lodash','util','moment','bluebird','randomstring'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x2821,0x87));var _0x1282=function(_0x553638,_0x3ffb99){_0x553638=_0x553638-0x0;var _0x2d3710=_0x2821[_0x553638];return _0x2d3710;};'use strict';var _=require(_0x1282('0x0'));var util=require(_0x1282('0x1'));var moment=require(_0x1282('0x2'));var BPromise=require(_0x1282('0x3'));var rs=require(_0x1282('0x4'));var fs=require('fs');var Redis=require(_0x1282('0x5'));var db=require(_0x1282('0x6'))['db'];var utils=require(_0x1282('0x7'));var logger=require(_0x1282('0x8'))(_0x1282('0x9'));var config=require(_0x1282('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1282('0xb')][_0x1282('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x293947,_0x13beb5,_0xa4eee9){return new BPromise(function(_0x1a8666,_0x18d69a){return client[_0x1282('0xd')](_0x293947,_0xa4eee9)['then'](function(_0x41c458){logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));logger[_0x1282('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x13beb5,_0x1282('0x10'),JSON[_0x1282('0x12')](_0x41c458));if(_0x41c458['error']){if(_0x41c458[_0x1282('0x13')][_0x1282('0x14')]===0x1f4){logger['error'](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x18d69a(_0x41c458[_0x1282('0x13')][_0x1282('0x15')]);}logger[_0x1282('0x13')](_0x1282('0xf'),_0x13beb5,_0x41c458['error']['message']);return _0x1a8666(_0x41c458['error'][_0x1282('0x15')]);}else{logger[_0x1282('0xe')](_0x1282('0xf'),_0x13beb5,_0x1282('0x10'));_0x1a8666(_0x41c458[_0x1282('0x16')][_0x1282('0x15')]);}})[_0x1282('0x17')](function(_0x116ef1){logger['error'](_0x1282('0xf'),_0x13beb5,_0x116ef1);_0x18d69a(_0x116ef1);});});}exports[_0x1282('0x18')]=function(_0x518733){var _0x48c857=this;return new Promise(function(_0xebc97e,_0x4e3ec7){return db[_0x1282('0x19')][_0x1282('0x1a')]({'raw':_0x518733['options']?_0x518733['options']['raw']===undefined?!![]:![]:!![],'where':_0x518733['options']?_0x518733[_0x1282('0x1b')][_0x1282('0x1c')]||null:null,'attributes':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')][_0x1282('0x1d')]||null:null,'limit':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')][_0x1282('0x1e')]||null:null,'include':_0x518733[_0x1282('0x1b')]?_0x518733[_0x1282('0x1b')]['include']?_[_0x1282('0x1f')](_0x518733['options'][_0x1282('0x20')],function(_0x25dbb5){return{'model':db[_0x25dbb5[_0x1282('0x21')]],'as':_0x25dbb5['as'],'attributes':_0x25dbb5[_0x1282('0x1d')],'include':_0x25dbb5[_0x1282('0x20')]?_['map'](_0x25dbb5[_0x1282('0x20')],function(_0x117e5c){return{'model':db[_0x117e5c[_0x1282('0x21')]],'as':_0x117e5c['as'],'attributes':_0x117e5c[_0x1282('0x1d')],'include':_0x117e5c[_0x1282('0x20')]?_[_0x1282('0x1f')](_0x117e5c[_0x1282('0x20')],function(_0x28e686){return{'model':db[_0x28e686['model']],'as':_0x28e686['as'],'attributes':_0x28e686['attributes']};}):[]};}):[]};}):[]:[]})[_0x1282('0x22')](function(_0x5d97b4){logger[_0x1282('0xe')]('GetCampaign',_0x518733);logger[_0x1282('0x11')]('GetCampaign',_0x518733,JSON[_0x1282('0x12')](_0x5d97b4));_0xebc97e(_0x5d97b4);})['catch'](function(_0x519a7f){logger['error']('GetCampaign',_0x519a7f['message'],_0x518733);_0x4e3ec7(_0x48c857['error'](0x1f4,_0x519a7f[_0x1282('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index c40635a..1301778 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe3f3=['addLists','addBlackLists','put','destroy','removeLists','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','get','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone'];(function(_0xf0c8bd,_0x226453){var _0x38aac2=function(_0x2d5f2d){while(--_0x2d5f2d){_0xf0c8bd['push'](_0xf0c8bd['shift']());}};_0x38aac2(++_0x226453);}(_0xe3f3,0xed));var _0x3e3f=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xe3f3[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var path=require(_0x3e3f('0x2'));var timeout=require(_0x3e3f('0x3'));var express=require(_0x3e3f('0x4'));var router=express['Router']();var fs_extra=require(_0x3e3f('0x5'));var auth=require(_0x3e3f('0x6'));var interaction=require(_0x3e3f('0x7'));var config=require(_0x3e3f('0x8'));var controller=require('./campaign.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3e3f('0x9')]);router['get'](_0x3e3f('0xa'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0xc')]);router[_0x3e3f('0xd')](_0x3e3f('0xe'),auth['isAuthenticated'](),controller[_0x3e3f('0xf')]);router[_0x3e3f('0xd')](_0x3e3f('0x10'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x11')]);router[_0x3e3f('0xd')]('/:id/hopper_finals',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x12')]);router['get']('/:id/hopper_black',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x13')]);router[_0x3e3f('0xd')](_0x3e3f('0x14'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x3e3f('0x15'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x16')]);router[_0x3e3f('0x17')]('/',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x18')]);router[_0x3e3f('0x17')](_0x3e3f('0x19'),auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x1a')]);router[_0x3e3f('0x17')]('/:id/lists',auth[_0x3e3f('0xb')](),controller[_0x3e3f('0x1b')]);router['post'](_0x3e3f('0x15'),auth['isAuthenticated'](),controller[_0x3e3f('0x1c')]);router[_0x3e3f('0x1d')]('/:id',auth[_0x3e3f('0xb')](),controller['update']);router['delete'](_0x3e3f('0xa'),auth['isAuthenticated'](),controller[_0x3e3f('0x1e')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x3e3f('0x1f')]);router[_0x3e3f('0x20')](_0x3e3f('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x9946=['addLists','addBlackLists','destroy','delete','removeBlackLists','exports','multer','util','path','express','Router','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x42ddb9,_0x2b7ecd){var _0x25f162=function(_0x385534){while(--_0x385534){_0x42ddb9['push'](_0x42ddb9['shift']());}};_0x25f162(++_0x2b7ecd);}(_0x9946,0x82));var _0x6994=function(_0x157eb6,_0x39d9c0){_0x157eb6=_0x157eb6-0x0;var _0x5da78c=_0x9946[_0x157eb6];return _0x5da78c;};'use strict';var multer=require(_0x6994('0x0'));var util=require(_0x6994('0x1'));var path=require(_0x6994('0x2'));var timeout=require('connect-timeout');var express=require(_0x6994('0x3'));var router=express[_0x6994('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6994('0x5'));var controller=require(_0x6994('0x6'));router['get']('/',auth[_0x6994('0x7')](),controller[_0x6994('0x8')]);router[_0x6994('0x9')](_0x6994('0xa'),auth[_0x6994('0x7')](),controller[_0x6994('0xb')]);router[_0x6994('0x9')](_0x6994('0xc'),auth[_0x6994('0x7')](),controller['getHoppers']);router[_0x6994('0x9')](_0x6994('0xd'),auth[_0x6994('0x7')](),controller[_0x6994('0xe')]);router[_0x6994('0x9')]('/:id/hopper_finals',auth[_0x6994('0x7')](),controller[_0x6994('0xf')]);router[_0x6994('0x9')](_0x6994('0x10'),auth[_0x6994('0x7')](),controller[_0x6994('0x11')]);router[_0x6994('0x9')](_0x6994('0x12'),auth[_0x6994('0x7')](),controller[_0x6994('0x13')]);router[_0x6994('0x9')](_0x6994('0x14'),auth[_0x6994('0x7')](),controller[_0x6994('0x15')]);router[_0x6994('0x16')]('/',auth[_0x6994('0x7')](),controller[_0x6994('0x17')]);router[_0x6994('0x16')](_0x6994('0x18'),auth[_0x6994('0x7')](),controller['clone']);router[_0x6994('0x16')](_0x6994('0x12'),auth['isAuthenticated'](),controller[_0x6994('0x19')]);router['post'](_0x6994('0x14'),auth[_0x6994('0x7')](),controller[_0x6994('0x1a')]);router['put']('/:id',auth[_0x6994('0x7')](),controller['update']);router['delete'](_0x6994('0xa'),auth[_0x6994('0x7')](),controller[_0x6994('0x1b')]);router[_0x6994('0x1c')](_0x6994('0x12'),auth[_0x6994('0x7')](),controller['removeLists']);router[_0x6994('0x1c')]('/:id/blacklists',auth[_0x6994('0x7')](),controller[_0x6994('0x1d')]);module[_0x6994('0x1e')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index eaea5c9..92c2a36 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x05b2=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x45f575,_0x3ae51c){var _0xd8e1a1=function(_0x34867b){while(--_0x34867b){_0x45f575['push'](_0x45f575['shift']());}};_0xd8e1a1(++_0x3ae51c);}(_0x05b2,0x1f1));var _0x205b=function(_0x392b57,_0x3aba0d){_0x392b57=_0x392b57-0x0;var _0x19032e=_0x05b2[_0x392b57];return _0x19032e;};'use strict';var Sequelize=require(_0x205b('0x0'));module[_0x205b('0x1')]={'key':{'type':Sequelize[_0x205b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x205b('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x205b('0x2')]},'name':{'type':Sequelize[_0x205b('0x4')],'get':function(){return this[_0x205b('0x5')](_0x205b('0x6'));}}};
\ No newline at end of file
+var _0xae32=['exports','STRING','TEXT'];(function(_0x42ddec,_0x3cac95){var _0x4939d0=function(_0x236d13){while(--_0x236d13){_0x42ddec['push'](_0x42ddec['shift']());}};_0x4939d0(++_0x3cac95);}(_0xae32,0x114));var _0x2ae3=function(_0x1f63d2,_0x417963){_0x1f63d2=_0x1f63d2-0x0;var _0xe7496c=_0xae32[_0x1f63d2];return _0xe7496c;};'use strict';var Sequelize=require('sequelize');module[_0x2ae3('0x0')]={'key':{'type':Sequelize[_0x2ae3('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x2ae3('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 1023281..67904d7 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbf7=['where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','body','find','catch','create','MailAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','send','index','map','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort'];(function(_0x3b2148,_0x3eed71){var _0x4dcd51=function(_0x51e79f){while(--_0x51e79f){_0x3b2148['push'](_0x3b2148['shift']());}};_0x4dcd51(++_0x3eed71);}(_0xdbf7,0x12d));var _0x7dbf=function(_0x1c6a3e,_0x5c3938){_0x1c6a3e=_0x1c6a3e-0x0;var _0x3637da=_0xdbf7[_0x1c6a3e];return _0x3637da;};'use strict';var emlformat=require(_0x7dbf('0x0'));var rimraf=require(_0x7dbf('0x1'));var zipdir=require(_0x7dbf('0x2'));var jsonpatch=require(_0x7dbf('0x3'));var rp=require(_0x7dbf('0x4'));var moment=require(_0x7dbf('0x5'));var BPromise=require(_0x7dbf('0x6'));var Mustache=require(_0x7dbf('0x7'));var util=require('util');var path=require(_0x7dbf('0x8'));var sox=require(_0x7dbf('0x9'));var csv=require('to-csv');var ejs=require(_0x7dbf('0xa'));var fs=require('fs');var fs_extra=require(_0x7dbf('0xb'));var _=require(_0x7dbf('0xc'));var squel=require(_0x7dbf('0xd'));var crypto=require(_0x7dbf('0xe'));var jsforce=require(_0x7dbf('0xf'));var deskjs=require(_0x7dbf('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7dbf('0x11'));var Papa=require(_0x7dbf('0x12'));var Redis=require('ioredis');var authService=require(_0x7dbf('0x13'));var qs=require(_0x7dbf('0x14'));var as=require(_0x7dbf('0x15'));var hardwareService=require(_0x7dbf('0x16'));var logger=require(_0x7dbf('0x17'))(_0x7dbf('0x18'));var utils=require(_0x7dbf('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x383565,_0x1cbf0b){_0x1cbf0b=_0x1cbf0b||0xcc;return function(_0x39a0b4){if(_0x39a0b4){return _0x383565[_0x7dbf('0x1a')](_0x1cbf0b);}return _0x383565[_0x7dbf('0x1b')](_0x1cbf0b)['end']();};}function respondWithResult(_0x1a6018,_0x245447){_0x245447=_0x245447||0xc8;return function(_0x42704c){if(_0x42704c){return _0x1a6018['status'](_0x245447)[_0x7dbf('0x1c')](_0x42704c);}};}function respondWithFilteredResult(_0x1085cd,_0xd2bda2){return function(_0xa531b8){if(_0xa531b8){var _0x4002a7=typeof _0xd2bda2[_0x7dbf('0x1d')]==='undefined'&&typeof _0xd2bda2[_0x7dbf('0x1e')]===_0x7dbf('0x1f');var _0x14d4e9=_0xa531b8['count'];var _0x1a822f=_0x4002a7?0x0:_0xd2bda2[_0x7dbf('0x1d')];var _0x1fc42a=_0x4002a7?_0xa531b8['count']:_0xd2bda2[_0x7dbf('0x1d')]+_0xd2bda2[_0x7dbf('0x1e')];var _0x108f6e;if(_0x1fc42a>=_0x14d4e9){_0x1fc42a=_0x14d4e9;_0x108f6e=0xc8;}else{_0x108f6e=0xce;}_0x1085cd[_0x7dbf('0x1b')](_0x108f6e);return _0x1085cd[_0x7dbf('0x20')](_0x7dbf('0x21'),_0x1a822f+'-'+_0x1fc42a+'/'+_0x14d4e9)[_0x7dbf('0x1c')](_0xa531b8);}return null;};}function patchUpdates(_0x58c951){return function(_0x5db709){try{jsonpatch['apply'](_0x5db709,_0x58c951,!![]);}catch(_0x4a5b1c){return BPromise[_0x7dbf('0x22')](_0x4a5b1c);}return _0x5db709[_0x7dbf('0x23')]();};}function saveUpdates(_0x1bf5c4,_0x7b6026){return function(_0x255ea8){if(_0x255ea8){return _0x255ea8[_0x7dbf('0x24')](_0x1bf5c4)[_0x7dbf('0x25')](function(_0x4c3d53){return _0x4c3d53;});}return null;};}function removeEntity(_0x2dcd00,_0x3a00ab){return function(_0x3292c9){if(_0x3292c9){return _0x3292c9[_0x7dbf('0x26')]()[_0x7dbf('0x25')](function(){var _0x23cc32=_0x3292c9[_0x7dbf('0x27')]({'plain':!![]});var _0x3488f9=_0x7dbf('0x28');return db[_0x7dbf('0x29')][_0x7dbf('0x26')]({'where':{'type':_0x3488f9,'resourceId':_0x23cc32['id']}})['then'](function(){return _0x3292c9;});})['then'](function(){_0x2dcd00[_0x7dbf('0x1b')](0xcc)[_0x7dbf('0x2a')]();});}};}function handleEntityNotFound(_0x5476e8,_0x2f87fa){return function(_0x11a602){if(!_0x11a602){_0x5476e8[_0x7dbf('0x1a')](0x194);}return _0x11a602;};}function handleError(_0x579ea3,_0x17db00){_0x17db00=_0x17db00||0x1f4;return function(_0x394cc8){logger[_0x7dbf('0x2b')](_0x394cc8[_0x7dbf('0x2c')]);if(_0x394cc8['name']){delete _0x394cc8['name'];}_0x579ea3[_0x7dbf('0x1b')](_0x17db00)[_0x7dbf('0x2d')](_0x394cc8);};}exports[_0x7dbf('0x2e')]=function(_0x685fe4,_0x1ca9ff){var _0xf9b2d4={},_0x413e9={},_0x4d76f1={'count':0x0,'rows':[]};var _0x4499af=_[_0x7dbf('0x2f')](db['CannedAnswer']['rawAttributes'],function(_0x398295){return{'name':_0x398295[_0x7dbf('0x30')],'type':_0x398295[_0x7dbf('0x31')][_0x7dbf('0x32')]};});_0x413e9[_0x7dbf('0x33')]=_[_0x7dbf('0x2f')](_0x4499af,_0x7dbf('0x34'));_0x413e9[_0x7dbf('0x35')]=_[_0x7dbf('0x36')](_0x685fe4['query']);_0x413e9[_0x7dbf('0x37')]=_['intersection'](_0x413e9[_0x7dbf('0x33')],_0x413e9[_0x7dbf('0x35')]);_0xf9b2d4[_0x7dbf('0x38')]=_[_0x7dbf('0x39')](_0x413e9[_0x7dbf('0x33')],qs['fields'](_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x3a')]));_0xf9b2d4[_0x7dbf('0x38')]=_0xf9b2d4[_0x7dbf('0x38')][_0x7dbf('0x3b')]?_0xf9b2d4[_0x7dbf('0x38')]:_0x413e9[_0x7dbf('0x33')];if(!_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x3c')]('nolimit')){_0xf9b2d4['limit']=qs[_0x7dbf('0x1e')](_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x1e')]);_0xf9b2d4[_0x7dbf('0x1d')]=qs[_0x7dbf('0x1d')](_0x685fe4[_0x7dbf('0x35')]['offset']);}_0xf9b2d4[_0x7dbf('0x3d')]=qs[_0x7dbf('0x3e')](_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x3e')]);_0xf9b2d4[_0x7dbf('0x3f')]=qs['filters'](_[_0x7dbf('0x40')](_0x685fe4[_0x7dbf('0x35')],_0x413e9[_0x7dbf('0x37')]),_0x4499af);if(_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x41')]){_0xf9b2d4['where']=_[_0x7dbf('0x42')](_0xf9b2d4[_0x7dbf('0x3f')],{'$or':[{'key':{'$like':'%'+_0x685fe4[_0x7dbf('0x35')][_0x7dbf('0x41')]+'%'}},{'value':{'$like':'%'+_0x685fe4['query']['filter']+'%'}}]});}_0xf9b2d4=_[_0x7dbf('0x42')]({},_0xf9b2d4,_0x685fe4[_0x7dbf('0x43')]);var _0x16f495={'where':_0xf9b2d4['where']};return db[_0x7dbf('0x44')]['count'](_0x16f495)[_0x7dbf('0x25')](function(_0x8a36d2){_0x4d76f1['count']=_0x8a36d2;if(_0x685fe4['query'][_0x7dbf('0x45')]){_0xf9b2d4[_0x7dbf('0x46')]=[{'all':!![]}];}return db[_0x7dbf('0x44')][_0x7dbf('0x47')](_0xf9b2d4);})[_0x7dbf('0x25')](function(_0x12d986){_0x4d76f1[_0x7dbf('0x48')]=_0x12d986;return _0x4d76f1;})[_0x7dbf('0x25')](respondWithFilteredResult(_0x1ca9ff,_0xf9b2d4))['catch'](handleError(_0x1ca9ff,null));};exports[_0x7dbf('0x49')]=function(_0x23f5cf,_0x2f7825){var _0x35920d={'raw':!![],'where':{'id':_0x23f5cf[_0x7dbf('0x4a')]['id']}},_0x42bc79={};_0x42bc79['model']=_[_0x7dbf('0x36')](db[_0x7dbf('0x44')]['rawAttributes']);_0x42bc79[_0x7dbf('0x35')]=_[_0x7dbf('0x36')](_0x23f5cf[_0x7dbf('0x35')]);_0x42bc79[_0x7dbf('0x37')]=_[_0x7dbf('0x39')](_0x42bc79[_0x7dbf('0x33')],_0x42bc79[_0x7dbf('0x35')]);_0x35920d[_0x7dbf('0x38')]=_['intersection'](_0x42bc79[_0x7dbf('0x33')],qs['fields'](_0x23f5cf[_0x7dbf('0x35')][_0x7dbf('0x3a')]));_0x35920d[_0x7dbf('0x38')]=_0x35920d[_0x7dbf('0x38')][_0x7dbf('0x3b')]?_0x35920d[_0x7dbf('0x38')]:_0x42bc79[_0x7dbf('0x33')];if(_0x23f5cf[_0x7dbf('0x35')][_0x7dbf('0x45')]){_0x35920d[_0x7dbf('0x46')]=[{'all':!![]}];}_0x35920d=_[_0x7dbf('0x42')]({},_0x35920d,_0x23f5cf[_0x7dbf('0x43')]);return db[_0x7dbf('0x44')]['find'](_0x35920d)[_0x7dbf('0x25')](handleEntityNotFound(_0x2f7825,null))[_0x7dbf('0x25')](respondWithResult(_0x2f7825,null))['catch'](handleError(_0x2f7825,null));};exports[_0x7dbf('0x24')]=function(_0x54bbe1,_0x26eba1){if(_0x54bbe1[_0x7dbf('0x4b')]['id']){delete _0x54bbe1[_0x7dbf('0x4b')]['id'];}return db['CannedAnswer'][_0x7dbf('0x4c')]({'where':{'id':_0x54bbe1['params']['id']}})[_0x7dbf('0x25')](handleEntityNotFound(_0x26eba1,null))[_0x7dbf('0x25')](saveUpdates(_0x54bbe1[_0x7dbf('0x4b')],null))[_0x7dbf('0x25')](respondWithResult(_0x26eba1,null))[_0x7dbf('0x4d')](handleError(_0x26eba1,null));};exports[_0x7dbf('0x26')]=function(_0xd0abfc,_0x1f8705){return db[_0x7dbf('0x44')][_0x7dbf('0x4c')]({'where':{'id':_0xd0abfc[_0x7dbf('0x4a')]['id']}})[_0x7dbf('0x25')](handleEntityNotFound(_0x1f8705,null))['then'](removeEntity(_0x1f8705,null))[_0x7dbf('0x4d')](handleError(_0x1f8705,null));};exports[_0x7dbf('0x4e')]=function(_0x2d84f3,_0x2dcb40){var _0x38a057={'key':_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x32')]};if(_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x4f')]){_0x38a057[_0x7dbf('0x4f')]=_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x4f')];}else if(_0x2d84f3[_0x7dbf('0x4b')]['SmsAccountId']){_0x38a057['SmsAccountId']=_0x2d84f3['body']['SmsAccountId'];}else if(_0x2d84f3['body'][_0x7dbf('0x50')]){_0x38a057['OpenchannelAccountId']=_0x2d84f3['body'][_0x7dbf('0x50')];}else if(_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x51')]){_0x38a057[_0x7dbf('0x51')]=_0x2d84f3[_0x7dbf('0x4b')][_0x7dbf('0x51')];}return db[_0x7dbf('0x44')][_0x7dbf('0x4c')]({'where':_0x38a057})['then'](function(_0x18a765){if(_0x18a765){throw new db[(_0x7dbf('0x52'))][(_0x7dbf('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x7dbf('0x44')]['create'](_0x2d84f3[_0x7dbf('0x4b')]);})[_0x7dbf('0x25')](function(_0x566f4d){var _0x2461c1=_0x2d84f3['user'][_0x7dbf('0x27')]({'plain':!![]});if(!_0x2461c1)throw new Error(_0x7dbf('0x54'));if(_0x2461c1[_0x7dbf('0x55')]===_0x7dbf('0x56')){var _0x3336c3=_0x566f4d[_0x7dbf('0x27')]({'plain':!![]});return db[_0x7dbf('0x57')][_0x7dbf('0x4c')]({'where':{'name':_0x7dbf('0x28'),'userProfileId':_0x2461c1[_0x7dbf('0x58')]},'raw':!![]})['then'](function(_0x414e6f){if(_0x414e6f&&_0x414e6f[_0x7dbf('0x59')]===0x0){return db[_0x7dbf('0x29')]['create']({'name':_0x3336c3[_0x7dbf('0x34')],'resourceId':_0x3336c3['id'],'type':_0x414e6f[_0x7dbf('0x34')],'sectionId':_0x414e6f['id']},{})['then'](function(){return _0x566f4d;});}else{return _0x566f4d;}})[_0x7dbf('0x4d')](function(_0xc9c40){logger[_0x7dbf('0x2b')](_0x7dbf('0x5a'),_0xc9c40);throw _0xc9c40;});}return _0x566f4d;})[_0x7dbf('0x25')](respondWithResult(_0x2dcb40,0xc9))[_0x7dbf('0x4d')](handleError(_0x2dcb40,null));};
\ No newline at end of file
+var _0xad32=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','status','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','findAll','catch','show','params','length','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xad32,0x1a8));var _0x2ad3=function(_0x1b046f,_0x8e5fa6){_0x1b046f=_0x1b046f-0x0;var _0x1f6c8f=_0xad32[_0x1b046f];return _0x1f6c8f;};'use strict';var emlformat=require(_0x2ad3('0x0'));var rimraf=require(_0x2ad3('0x1'));var zipdir=require(_0x2ad3('0x2'));var jsonpatch=require(_0x2ad3('0x3'));var rp=require(_0x2ad3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2ad3('0x5'));var util=require(_0x2ad3('0x6'));var path=require(_0x2ad3('0x7'));var sox=require(_0x2ad3('0x8'));var csv=require(_0x2ad3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ad3('0xa'));var _=require(_0x2ad3('0xb'));var squel=require(_0x2ad3('0xc'));var crypto=require(_0x2ad3('0xd'));var jsforce=require(_0x2ad3('0xe'));var deskjs=require(_0x2ad3('0xf'));var toCsv=require(_0x2ad3('0x9'));var querystring=require(_0x2ad3('0x10'));var Papa=require(_0x2ad3('0x11'));var Redis=require('ioredis');var authService=require(_0x2ad3('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2ad3('0x13'))(_0x2ad3('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2ad3('0x15'));var db=require(_0x2ad3('0x16'))['db'];function respondWithStatusCode(_0x5d65a6,_0x360fc4){_0x360fc4=_0x360fc4||0xcc;return function(_0x25afcb){if(_0x25afcb){return _0x5d65a6['sendStatus'](_0x360fc4);}return _0x5d65a6[_0x2ad3('0x17')](_0x360fc4)['end']();};}function respondWithResult(_0xdbeaad,_0x4f911c){_0x4f911c=_0x4f911c||0xc8;return function(_0x3d268c){if(_0x3d268c){return _0xdbeaad[_0x2ad3('0x17')](_0x4f911c)['json'](_0x3d268c);}};}function respondWithFilteredResult(_0x3ce26d,_0x1a7288){return function(_0x8fe689){if(_0x8fe689){var _0x320d0e=typeof _0x1a7288['offset']==='undefined'&&typeof _0x1a7288[_0x2ad3('0x18')]==='undefined';var _0x3c615b=_0x8fe689[_0x2ad3('0x19')];var _0x3c9943=_0x320d0e?0x0:_0x1a7288['offset'];var _0x195e26=_0x320d0e?_0x8fe689[_0x2ad3('0x19')]:_0x1a7288[_0x2ad3('0x1a')]+_0x1a7288['limit'];var _0x5e2e8e;if(_0x195e26>=_0x3c615b){_0x195e26=_0x3c615b;_0x5e2e8e=0xc8;}else{_0x5e2e8e=0xce;}_0x3ce26d['status'](_0x5e2e8e);return _0x3ce26d[_0x2ad3('0x1b')](_0x2ad3('0x1c'),_0x3c9943+'-'+_0x195e26+'/'+_0x3c615b)[_0x2ad3('0x1d')](_0x8fe689);}return null;};}function patchUpdates(_0x401308){return function(_0xec511d){try{jsonpatch[_0x2ad3('0x1e')](_0xec511d,_0x401308,!![]);}catch(_0x17c009){return BPromise[_0x2ad3('0x1f')](_0x17c009);}return _0xec511d['save']();};}function saveUpdates(_0x243453,_0x9398e9){return function(_0x1905e){if(_0x1905e){return _0x1905e[_0x2ad3('0x20')](_0x243453)[_0x2ad3('0x21')](function(_0x337bae){return _0x337bae;});}return null;};}function removeEntity(_0x4cf566,_0x27dda6){return function(_0x840ee2){if(_0x840ee2){return _0x840ee2[_0x2ad3('0x22')]()[_0x2ad3('0x21')](function(){var _0x104511=_0x840ee2[_0x2ad3('0x23')]({'plain':!![]});var _0x1562f3=_0x2ad3('0x24');return db[_0x2ad3('0x25')]['destroy']({'where':{'type':_0x1562f3,'resourceId':_0x104511['id']}})[_0x2ad3('0x21')](function(){return _0x840ee2;});})[_0x2ad3('0x21')](function(){_0x4cf566[_0x2ad3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49819a,_0x3c63ac){return function(_0x479279){if(!_0x479279){_0x49819a[_0x2ad3('0x26')](0x194);}return _0x479279;};}function handleError(_0x13bae3,_0x143f0c){_0x143f0c=_0x143f0c||0x1f4;return function(_0x34599e){logger['error'](_0x34599e[_0x2ad3('0x27')]);if(_0x34599e[_0x2ad3('0x28')]){delete _0x34599e[_0x2ad3('0x28')];}_0x13bae3[_0x2ad3('0x17')](_0x143f0c)['send'](_0x34599e);};}exports[_0x2ad3('0x29')]=function(_0x1060ca,_0x122042){var _0x196cfe={},_0x54c338={},_0x53611d={'count':0x0,'rows':[]};var _0x5b6fa2=_[_0x2ad3('0x2a')](db[_0x2ad3('0x2b')][_0x2ad3('0x2c')],function(_0xb77b6e){return{'name':_0xb77b6e[_0x2ad3('0x2d')],'type':_0xb77b6e[_0x2ad3('0x2e')][_0x2ad3('0x2f')]};});_0x54c338['model']=_[_0x2ad3('0x2a')](_0x5b6fa2,'name');_0x54c338['query']=_[_0x2ad3('0x30')](_0x1060ca[_0x2ad3('0x31')]);_0x54c338[_0x2ad3('0x32')]=_[_0x2ad3('0x33')](_0x54c338[_0x2ad3('0x34')],_0x54c338[_0x2ad3('0x31')]);_0x196cfe['attributes']=_['intersection'](_0x54c338[_0x2ad3('0x34')],qs[_0x2ad3('0x35')](_0x1060ca[_0x2ad3('0x31')]['fields']));_0x196cfe[_0x2ad3('0x36')]=_0x196cfe['attributes']['length']?_0x196cfe[_0x2ad3('0x36')]:_0x54c338[_0x2ad3('0x34')];if(!_0x1060ca['query'][_0x2ad3('0x37')]('nolimit')){_0x196cfe[_0x2ad3('0x18')]=qs['limit'](_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x18')]);_0x196cfe['offset']=qs[_0x2ad3('0x1a')](_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x1a')]);}_0x196cfe[_0x2ad3('0x38')]=qs[_0x2ad3('0x39')](_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x39')]);_0x196cfe[_0x2ad3('0x3a')]=qs['filters'](_[_0x2ad3('0x3b')](_0x1060ca['query'],_0x54c338[_0x2ad3('0x32')]),_0x5b6fa2);if(_0x1060ca[_0x2ad3('0x31')]['filter']){_0x196cfe['where']=_[_0x2ad3('0x3c')](_0x196cfe[_0x2ad3('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1060ca[_0x2ad3('0x31')]['filter']+'%'}},{'value':{'$like':'%'+_0x1060ca['query']['filter']+'%'}}]});}_0x196cfe=_[_0x2ad3('0x3c')]({},_0x196cfe,_0x1060ca['options']);var _0x26a843={'where':_0x196cfe[_0x2ad3('0x3a')]};return db['CannedAnswer'][_0x2ad3('0x19')](_0x26a843)[_0x2ad3('0x21')](function(_0x5148bf){_0x53611d[_0x2ad3('0x19')]=_0x5148bf;if(_0x1060ca[_0x2ad3('0x31')][_0x2ad3('0x3d')]){_0x196cfe[_0x2ad3('0x3e')]=[{'all':!![]}];}return db[_0x2ad3('0x2b')][_0x2ad3('0x3f')](_0x196cfe);})[_0x2ad3('0x21')](function(_0x35d2de){_0x53611d['rows']=_0x35d2de;return _0x53611d;})[_0x2ad3('0x21')](respondWithFilteredResult(_0x122042,_0x196cfe))[_0x2ad3('0x40')](handleError(_0x122042,null));};exports[_0x2ad3('0x41')]=function(_0x447705,_0x4fd971){var _0x2cf87e={'raw':!![],'where':{'id':_0x447705[_0x2ad3('0x42')]['id']}},_0x198ad3={};_0x198ad3[_0x2ad3('0x34')]=_[_0x2ad3('0x30')](db[_0x2ad3('0x2b')]['rawAttributes']);_0x198ad3[_0x2ad3('0x31')]=_[_0x2ad3('0x30')](_0x447705[_0x2ad3('0x31')]);_0x198ad3['filters']=_['intersection'](_0x198ad3[_0x2ad3('0x34')],_0x198ad3[_0x2ad3('0x31')]);_0x2cf87e[_0x2ad3('0x36')]=_['intersection'](_0x198ad3[_0x2ad3('0x34')],qs[_0x2ad3('0x35')](_0x447705['query'][_0x2ad3('0x35')]));_0x2cf87e[_0x2ad3('0x36')]=_0x2cf87e[_0x2ad3('0x36')][_0x2ad3('0x43')]?_0x2cf87e[_0x2ad3('0x36')]:_0x198ad3[_0x2ad3('0x34')];if(_0x447705['query'][_0x2ad3('0x3d')]){_0x2cf87e[_0x2ad3('0x3e')]=[{'all':!![]}];}_0x2cf87e=_[_0x2ad3('0x3c')]({},_0x2cf87e,_0x447705[_0x2ad3('0x44')]);return db['CannedAnswer'][_0x2ad3('0x45')](_0x2cf87e)[_0x2ad3('0x21')](handleEntityNotFound(_0x4fd971,null))[_0x2ad3('0x21')](respondWithResult(_0x4fd971,null))['catch'](handleError(_0x4fd971,null));};exports[_0x2ad3('0x20')]=function(_0x56e3a8,_0x354522){if(_0x56e3a8[_0x2ad3('0x46')]['id']){delete _0x56e3a8[_0x2ad3('0x46')]['id'];}return db['CannedAnswer'][_0x2ad3('0x45')]({'where':{'id':_0x56e3a8[_0x2ad3('0x42')]['id']}})['then'](handleEntityNotFound(_0x354522,null))[_0x2ad3('0x21')](saveUpdates(_0x56e3a8[_0x2ad3('0x46')],null))[_0x2ad3('0x21')](respondWithResult(_0x354522,null))[_0x2ad3('0x40')](handleError(_0x354522,null));};exports[_0x2ad3('0x22')]=function(_0x1cb5af,_0x4e9f59){return db[_0x2ad3('0x2b')][_0x2ad3('0x45')]({'where':{'id':_0x1cb5af[_0x2ad3('0x42')]['id']}})[_0x2ad3('0x21')](handleEntityNotFound(_0x4e9f59,null))[_0x2ad3('0x21')](removeEntity(_0x4e9f59,null))[_0x2ad3('0x40')](handleError(_0x4e9f59,null));};exports[_0x2ad3('0x47')]=function(_0x186fd6,_0x35c459){var _0x15bca7={'key':_0x186fd6[_0x2ad3('0x46')][_0x2ad3('0x2f')]};if(_0x186fd6[_0x2ad3('0x46')]['MailAccountId']){_0x15bca7[_0x2ad3('0x48')]=_0x186fd6[_0x2ad3('0x46')]['MailAccountId'];}else if(_0x186fd6['body']['SmsAccountId']){_0x15bca7['SmsAccountId']=_0x186fd6['body'][_0x2ad3('0x49')];}else if(_0x186fd6['body'][_0x2ad3('0x4a')]){_0x15bca7[_0x2ad3('0x4a')]=_0x186fd6['body'][_0x2ad3('0x4a')];}else if(_0x186fd6[_0x2ad3('0x46')][_0x2ad3('0x4b')]){_0x15bca7[_0x2ad3('0x4b')]=_0x186fd6['body']['ChatWebsiteId'];}return db[_0x2ad3('0x2b')]['find']({'where':_0x15bca7})[_0x2ad3('0x21')](function(_0x24f560){if(_0x24f560){throw new db[(_0x2ad3('0x4c'))][(_0x2ad3('0x4d'))](_0x2ad3('0x4e'));}return db[_0x2ad3('0x2b')][_0x2ad3('0x47')](_0x186fd6['body']);})['then'](function(_0x4a8080){var _0x325261=_0x186fd6[_0x2ad3('0x4f')][_0x2ad3('0x23')]({'plain':!![]});if(!_0x325261)throw new Error(_0x2ad3('0x50'));if(_0x325261[_0x2ad3('0x51')]===_0x2ad3('0x4f')){var _0x20a95a=_0x4a8080[_0x2ad3('0x23')]({'plain':!![]});return db[_0x2ad3('0x52')][_0x2ad3('0x45')]({'where':{'name':_0x2ad3('0x24'),'userProfileId':_0x325261[_0x2ad3('0x53')]},'raw':!![]})['then'](function(_0x53b004){if(_0x53b004&&_0x53b004[_0x2ad3('0x54')]===0x0){return db[_0x2ad3('0x25')]['create']({'name':_0x20a95a[_0x2ad3('0x28')],'resourceId':_0x20a95a['id'],'type':_0x53b004[_0x2ad3('0x28')],'sectionId':_0x53b004['id']},{})[_0x2ad3('0x21')](function(){return _0x4a8080;});}else{return _0x4a8080;}})[_0x2ad3('0x40')](function(_0x1e3615){logger[_0x2ad3('0x55')](_0x2ad3('0x56'),_0x1e3615);throw _0x1e3615;});}return _0x4a8080;})[_0x2ad3('0x21')](respondWithResult(_0x35c459,0xc9))[_0x2ad3('0x40')](handleError(_0x35c459,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 770bb0a..9643699 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b2d=['api','moment','bluebird','request-promise','path','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x2b2d,0x142));var _0xd2b2=function(_0x1dbfa3,_0x5717dd){_0x1dbfa3=_0x1dbfa3-0x0;var _0x4f8e54=_0x2b2d[_0x1dbfa3];return _0x4f8e54;};'use strict';var _=require('lodash');var util=require(_0xd2b2('0x0'));var logger=require(_0xd2b2('0x1'))(_0xd2b2('0x2'));var moment=require(_0xd2b2('0x3'));var BPromise=require(_0xd2b2('0x4'));var rp=require(_0xd2b2('0x5'));var fs=require('fs');var path=require(_0xd2b2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd2b2('0x7'));module['exports']=function(_0x3b8505,_0x16599c){return _0x3b8505[_0xd2b2('0x8')]('CannedAnswer',attributes,{'tableName':_0xd2b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd2b2('0xa'),'collate':_0xd2b2('0xb')});};
\ No newline at end of file
+var _0x6f59=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','lodash','util'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x6f59,0x1be));var _0x96f5=function(_0x473da3,_0x469bfa){_0x473da3=_0x473da3-0x0;var _0x5449ef=_0x6f59[_0x473da3];return _0x5449ef;};'use strict';var _=require(_0x96f5('0x0'));var util=require(_0x96f5('0x1'));var logger=require(_0x96f5('0x2'))(_0x96f5('0x3'));var moment=require(_0x96f5('0x4'));var BPromise=require(_0x96f5('0x5'));var rp=require(_0x96f5('0x6'));var fs=require('fs');var path=require(_0x96f5('0x7'));var rimraf=require(_0x96f5('0x8'));var config=require(_0x96f5('0x9'));var attributes=require(_0x96f5('0xa'));module[_0x96f5('0xb')]=function(_0x598154,_0xf6cd7d){return _0x598154['define'](_0x96f5('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x96f5('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index e522cb5..fa1ad06 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x308d39,_0x309f94){var _0xad36e4=function(_0x1adc08){while(--_0x1adc08){_0x308d39['push'](_0x308d39['shift']());}};_0xad36e4(++_0x309f94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1428ab,_0x44fcd3){var _0x2af07b=function(_0x30e609){while(--_0x30e609){_0x1428ab['push'](_0x1428ab['shift']());}};_0x2af07b(++_0x44fcd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index ebb7151..c7a695a 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1556=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3819fc,_0x5a2a2d){var _0x46d262=function(_0x1e9896){while(--_0x1e9896){_0x3819fc['push'](_0x3819fc['shift']());}};_0x46d262(++_0x5a2a2d);}(_0x1556,0x105));var _0x6155=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1556[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x6155('0x0'));var util=require(_0x6155('0x1'));var path=require(_0x6155('0x2'));var timeout=require(_0x6155('0x3'));var express=require(_0x6155('0x4'));var router=express[_0x6155('0x5')]();var fs_extra=require(_0x6155('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6155('0x7'));var config=require(_0x6155('0x8'));var controller=require(_0x6155('0x9'));router['get']('/',auth[_0x6155('0xa')](),controller[_0x6155('0xb')]);router[_0x6155('0xc')](_0x6155('0xd'),auth[_0x6155('0xa')](),controller[_0x6155('0xe')]);router['post']('/',auth[_0x6155('0xa')](),controller['create']);router[_0x6155('0xf')]('/:id',auth[_0x6155('0xa')](),controller[_0x6155('0x10')]);router['delete']('/:id',auth[_0x6155('0xa')](),controller[_0x6155('0x11')]);module[_0x6155('0x12')]=router;
\ No newline at end of file
+var _0xb88f=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','put','update','delete'];(function(_0x4fccb0,_0x30de60){var _0x12f48b=function(_0x1958f5){while(--_0x1958f5){_0x4fccb0['push'](_0x4fccb0['shift']());}};_0x12f48b(++_0x30de60);}(_0xb88f,0x92));var _0xfb88=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xb88f[_0x18b344];return _0x5ef6bb;};'use strict';var multer=require(_0xfb88('0x0'));var util=require(_0xfb88('0x1'));var path=require(_0xfb88('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb88('0x3'));var router=express[_0xfb88('0x4')]();var fs_extra=require(_0xfb88('0x5'));var auth=require(_0xfb88('0x6'));var interaction=require(_0xfb88('0x7'));var config=require(_0xfb88('0x8'));var controller=require('./cannedAnswer.controller');router[_0xfb88('0x9')]('/',auth[_0xfb88('0xa')](),controller[_0xfb88('0xb')]);router[_0xfb88('0x9')](_0xfb88('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfb88('0xd')]('/:id',auth[_0xfb88('0xa')](),controller[_0xfb88('0xe')]);router[_0xfb88('0xf')](_0xfb88('0xc'),auth[_0xfb88('0xa')](),controller[_0xfb88('0x10')]);module[_0xfb88('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 88308fc..d38fe23 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x66f4=['INTEGER','exports','STRING'];(function(_0xeab745,_0x3c7728){var _0x118296=function(_0x3a3403){while(--_0x3a3403){_0xeab745['push'](_0xeab745['shift']());}};_0x118296(++_0x3c7728);}(_0x66f4,0x7f));var _0x466f=function(_0x7fa17b,_0x375ec5){_0x7fa17b=_0x7fa17b-0x0;var _0x21950f=_0x66f4[_0x7fa17b];return _0x21950f;};'use strict';var Sequelize=require('sequelize');module[_0x466f('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x466f('0x1')]},'src':{'type':Sequelize[_0x466f('0x1')]},'dst':{'type':Sequelize[_0x466f('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x466f('0x1')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x466f('0x1')]},'amaflags':{'type':Sequelize[_0x466f('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x466f('0x1')]},'uniqueid':{'type':Sequelize[_0x466f('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x466f('0x1')]},'tag':{'type':Sequelize[_0x466f('0x1')]}};
\ No newline at end of file
+var _0x81a5=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1ab59f,_0x49b3e4){var _0xc57b9a=function(_0xabb164){while(--_0xabb164){_0x1ab59f['push'](_0x1ab59f['shift']());}};_0xc57b9a(++_0x49b3e4);}(_0x81a5,0x1c8));var _0x581a=function(_0x1c8417,_0x367fb9){_0x1c8417=_0x1c8417-0x0;var _0x4f7dcc=_0x81a5[_0x1c8417];return _0x4f7dcc;};'use strict';var Sequelize=require(_0x581a('0x0'));module[_0x581a('0x1')]={'calldate':{'type':Sequelize[_0x581a('0x2')],'allowNull':![],'defaultValue':_0x581a('0x3')},'clid':{'type':Sequelize[_0x581a('0x4')]},'src':{'type':Sequelize[_0x581a('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x581a('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x581a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x581a('0x4')]},'amaflags':{'type':Sequelize[_0x581a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x581a('0x4')]},'userfield':{'type':Sequelize[_0x581a('0x4')]},'uniqueid':{'type':Sequelize[_0x581a('0x4')]},'linkedid':{'type':Sequelize[_0x581a('0x4')]},'sequence':{'type':Sequelize[_0x581a('0x4')]},'peeraccount':{'type':Sequelize[_0x581a('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x581a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 1de2bce..e7c5805 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8085=['name','send','index','map','Cdr','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x171d3a,_0x161588){var _0xbd17cf=function(_0x331e4e){while(--_0x331e4e){_0x171d3a['push'](_0x171d3a['shift']());}};_0xbd17cf(++_0x161588);}(_0x8085,0x71));var _0x5808=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8085[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0x5808('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5808('0x1'));var rp=require(_0x5808('0x2'));var moment=require(_0x5808('0x3'));var BPromise=require(_0x5808('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5808('0x5'));var sox=require(_0x5808('0x6'));var csv=require('to-csv');var ejs=require(_0x5808('0x7'));var fs=require('fs');var fs_extra=require(_0x5808('0x8'));var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0xe'));var querystring=require(_0x5808('0xf'));var Papa=require(_0x5808('0x10'));var Redis=require(_0x5808('0x11'));var authService=require(_0x5808('0x12'));var qs=require(_0x5808('0x13'));var as=require(_0x5808('0x14'));var hardwareService=require(_0x5808('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5808('0x16'));var config=require(_0x5808('0x17'));var licenseUtil=require(_0x5808('0x18'));var db=require(_0x5808('0x19'))['db'];function respondWithStatusCode(_0xab4f46,_0x19be03){_0x19be03=_0x19be03||0xcc;return function(_0x10572d){if(_0x10572d){return _0xab4f46['sendStatus'](_0x19be03);}return _0xab4f46['status'](_0x19be03)[_0x5808('0x1a')]();};}function respondWithResult(_0x19252b,_0x3582d6){_0x3582d6=_0x3582d6||0xc8;return function(_0x3e7c09){if(_0x3e7c09){return _0x19252b[_0x5808('0x1b')](_0x3582d6)[_0x5808('0x1c')](_0x3e7c09);}};}function respondWithFilteredResult(_0x299b22,_0x2af9da){return function(_0x1dda8d){if(_0x1dda8d){var _0x46dd8a=typeof _0x2af9da[_0x5808('0x1d')]==='undefined'&&typeof _0x2af9da[_0x5808('0x1e')]==='undefined';var _0x406e65=_0x1dda8d[_0x5808('0x1f')];var _0x3bf0ee=_0x46dd8a?0x0:_0x2af9da['offset'];var _0x9e58d4=_0x46dd8a?_0x1dda8d[_0x5808('0x1f')]:_0x2af9da['offset']+_0x2af9da['limit'];var _0x3c7c02;if(_0x9e58d4>=_0x406e65){_0x9e58d4=_0x406e65;_0x3c7c02=0xc8;}else{_0x3c7c02=0xce;}_0x299b22['status'](_0x3c7c02);return _0x299b22[_0x5808('0x20')](_0x5808('0x21'),_0x3bf0ee+'-'+_0x9e58d4+'/'+_0x406e65)[_0x5808('0x1c')](_0x1dda8d);}return null;};}function patchUpdates(_0xaac16a){return function(_0x578d70){try{jsonpatch['apply'](_0x578d70,_0xaac16a,!![]);}catch(_0xe82ad0){return BPromise[_0x5808('0x22')](_0xe82ad0);}return _0x578d70[_0x5808('0x23')]();};}function saveUpdates(_0x39bca3,_0x409337){return function(_0x33b583){if(_0x33b583){return _0x33b583[_0x5808('0x24')](_0x39bca3)[_0x5808('0x25')](function(_0x3a575e){return _0x3a575e;});}return null;};}function removeEntity(_0x4e1dfc,_0x5b5175){return function(_0x130590){if(_0x130590){return _0x130590[_0x5808('0x26')]()['then'](function(){_0x4e1dfc['status'](0xcc)[_0x5808('0x1a')]();});}};}function handleEntityNotFound(_0x467500,_0x1dddbd){return function(_0x4a4d05){if(!_0x4a4d05){_0x467500['sendStatus'](0x194);}return _0x4a4d05;};}function handleError(_0x24ee0f,_0x2c2cb5){_0x2c2cb5=_0x2c2cb5||0x1f4;return function(_0x27c991){logger[_0x5808('0x27')](_0x27c991[_0x5808('0x28')]);if(_0x27c991['name']){delete _0x27c991[_0x5808('0x29')];}_0x24ee0f[_0x5808('0x1b')](_0x2c2cb5)[_0x5808('0x2a')](_0x27c991);};}exports[_0x5808('0x2b')]=function(_0x28c1eb,_0x19ac63){var _0x1117ac={},_0x4ad6d8={},_0x560e83={'count':0x0,'rows':[]};var _0x4f6342=_[_0x5808('0x2c')](db[_0x5808('0x2d')]['rawAttributes'],function(_0x3faa07){return{'name':_0x3faa07[_0x5808('0x2e')],'type':_0x3faa07[_0x5808('0x2f')][_0x5808('0x30')]};});_0x4ad6d8[_0x5808('0x31')]=_[_0x5808('0x2c')](_0x4f6342,'name');_0x4ad6d8[_0x5808('0x32')]=_[_0x5808('0x33')](_0x28c1eb[_0x5808('0x32')]);_0x4ad6d8['filters']=_['intersection'](_0x4ad6d8[_0x5808('0x31')],_0x4ad6d8['query']);_0x1117ac[_0x5808('0x34')]=_[_0x5808('0x35')](_0x4ad6d8['model'],qs[_0x5808('0x36')](_0x28c1eb[_0x5808('0x32')]['fields']));_0x1117ac['attributes']=_0x1117ac[_0x5808('0x34')]['length']?_0x1117ac[_0x5808('0x34')]:_0x4ad6d8['model'];if(!_0x28c1eb[_0x5808('0x32')][_0x5808('0x37')](_0x5808('0x38'))){_0x1117ac['limit']=qs[_0x5808('0x1e')](_0x28c1eb['query'][_0x5808('0x1e')]);_0x1117ac['offset']=qs['offset'](_0x28c1eb[_0x5808('0x32')][_0x5808('0x1d')]);}_0x1117ac[_0x5808('0x39')]=qs['sort'](_0x28c1eb['query'][_0x5808('0x3a')]);_0x1117ac[_0x5808('0x3b')]=qs['filters'](_[_0x5808('0x3c')](_0x28c1eb[_0x5808('0x32')],_0x4ad6d8[_0x5808('0x3d')]),_0x4f6342);if(_0x28c1eb['query'][_0x5808('0x3e')]){_0x1117ac[_0x5808('0x3b')]=_[_0x5808('0x3f')](_0x1117ac['where'],{'$or':_[_0x5808('0x2c')](_0x4f6342,function(_0x12a045){if(_0x12a045['type']!=='VIRTUAL'){var _0x477278={};_0x477278[_0x12a045['name']]={'$like':'%'+_0x28c1eb[_0x5808('0x32')][_0x5808('0x3e')]+'%'};return _0x477278;}})});}_0x1117ac=_[_0x5808('0x3f')]({},_0x1117ac,_0x28c1eb[_0x5808('0x40')]);var _0x21fc36={'where':_0x1117ac['where']};return db['Cdr'][_0x5808('0x1f')](_0x21fc36)[_0x5808('0x25')](function(_0x402b4e){_0x560e83['count']=_0x402b4e;if(_0x28c1eb[_0x5808('0x32')][_0x5808('0x41')]){_0x1117ac[_0x5808('0x42')]=[{'all':!![]}];}return db[_0x5808('0x2d')][_0x5808('0x43')](_0x1117ac);})['then'](function(_0x1130c8){_0x560e83[_0x5808('0x44')]=_0x1130c8;return _0x560e83;})[_0x5808('0x25')](respondWithFilteredResult(_0x19ac63,_0x1117ac))['catch'](handleError(_0x19ac63,null));};exports[_0x5808('0x45')]=function(_0x287e07,_0xc62608){var _0x5e1230={'raw':!![],'where':{'id':_0x287e07[_0x5808('0x46')]['id']}},_0x5dcb50={};_0x5dcb50[_0x5808('0x31')]=_[_0x5808('0x33')](db[_0x5808('0x2d')][_0x5808('0x47')]);_0x5dcb50[_0x5808('0x32')]=_[_0x5808('0x33')](_0x287e07[_0x5808('0x32')]);_0x5dcb50[_0x5808('0x3d')]=_[_0x5808('0x35')](_0x5dcb50[_0x5808('0x31')],_0x5dcb50[_0x5808('0x32')]);_0x5e1230[_0x5808('0x34')]=_['intersection'](_0x5dcb50['model'],qs[_0x5808('0x36')](_0x287e07[_0x5808('0x32')][_0x5808('0x36')]));_0x5e1230[_0x5808('0x34')]=_0x5e1230[_0x5808('0x34')][_0x5808('0x48')]?_0x5e1230[_0x5808('0x34')]:_0x5dcb50['model'];if(_0x287e07[_0x5808('0x32')]['includeAll']){_0x5e1230[_0x5808('0x42')]=[{'all':!![]}];}_0x5e1230=_['merge']({},_0x5e1230,_0x287e07[_0x5808('0x40')]);return db['Cdr']['find'](_0x5e1230)['then'](handleEntityNotFound(_0xc62608,null))[_0x5808('0x25')](respondWithResult(_0xc62608,null))[_0x5808('0x49')](handleError(_0xc62608,null));};exports['create']=function(_0x46c8ed,_0x4568d0){return db[_0x5808('0x2d')]['create'](_0x46c8ed[_0x5808('0x4a')],{})['then'](respondWithResult(_0x4568d0,0xc9))[_0x5808('0x49')](handleError(_0x4568d0,null));};exports[_0x5808('0x24')]=function(_0x13fe11,_0x5cc977){if(_0x13fe11[_0x5808('0x4a')]['id']){delete _0x13fe11[_0x5808('0x4a')]['id'];}return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x13fe11['params']['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x5cc977,null))[_0x5808('0x25')](saveUpdates(_0x13fe11[_0x5808('0x4a')],null))[_0x5808('0x25')](respondWithResult(_0x5cc977,null))[_0x5808('0x49')](handleError(_0x5cc977,null));};exports[_0x5808('0x26')]=function(_0x5572f3,_0x23d2fe){return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x5572f3[_0x5808('0x46')]['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x23d2fe,null))['then'](removeEntity(_0x23d2fe,null))[_0x5808('0x49')](handleError(_0x23d2fe,null));};exports[_0x5808('0x4c')]=function(_0xc2c5d7,_0x44ff0a){return db[_0x5808('0x2d')][_0x5808('0x4c')]()['then'](respondWithResult(_0x44ff0a,null))[_0x5808('0x49')](handleError(_0x44ff0a,null));};
\ No newline at end of file
+var _0x9335=['hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','include','findAll','then','rows','show','params','rawAttributes','includeAll','options','find','create','catch','update','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','save','error','name','send','map','Cdr','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x5104a7,_0x2ef02a){var _0xae2c96=function(_0x50d1b0){while(--_0x50d1b0){_0x5104a7['push'](_0x5104a7['shift']());}};_0xae2c96(++_0x2ef02a);}(_0x9335,0xab));var _0x5933=function(_0xd5e128,_0x24d42a){_0xd5e128=_0xd5e128-0x0;var _0x4a8840=_0x9335[_0xd5e128];return _0x4a8840;};'use strict';var emlformat=require(_0x5933('0x0'));var rimraf=require(_0x5933('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5933('0x2'));var rp=require(_0x5933('0x3'));var moment=require(_0x5933('0x4'));var BPromise=require(_0x5933('0x5'));var Mustache=require(_0x5933('0x6'));var util=require(_0x5933('0x7'));var path=require(_0x5933('0x8'));var sox=require('sox');var csv=require(_0x5933('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5933('0xa'));var squel=require(_0x5933('0xb'));var crypto=require(_0x5933('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5933('0xd'));var toCsv=require(_0x5933('0x9'));var querystring=require(_0x5933('0xe'));var Papa=require(_0x5933('0xf'));var Redis=require(_0x5933('0x10'));var authService=require(_0x5933('0x11'));var qs=require(_0x5933('0x12'));var as=require(_0x5933('0x13'));var hardwareService=require(_0x5933('0x14'));var logger=require(_0x5933('0x15'))(_0x5933('0x16'));var utils=require(_0x5933('0x17'));var config=require(_0x5933('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5933('0x19'))['db'];function respondWithStatusCode(_0x5af679,_0x8b6bad){_0x8b6bad=_0x8b6bad||0xcc;return function(_0x1b4428){if(_0x1b4428){return _0x5af679[_0x5933('0x1a')](_0x8b6bad);}return _0x5af679['status'](_0x8b6bad)[_0x5933('0x1b')]();};}function respondWithResult(_0x542448,_0x1ab3d0){_0x1ab3d0=_0x1ab3d0||0xc8;return function(_0x4fc51d){if(_0x4fc51d){return _0x542448[_0x5933('0x1c')](_0x1ab3d0)['json'](_0x4fc51d);}};}function respondWithFilteredResult(_0xf6321f,_0x5e91da){return function(_0x404555){if(_0x404555){var _0x34c035=typeof _0x5e91da[_0x5933('0x1d')]==='undefined'&&typeof _0x5e91da['limit']===_0x5933('0x1e');var _0x2a2532=_0x404555[_0x5933('0x1f')];var _0x51a525=_0x34c035?0x0:_0x5e91da['offset'];var _0x15263f=_0x34c035?_0x404555['count']:_0x5e91da[_0x5933('0x1d')]+_0x5e91da[_0x5933('0x20')];var _0x21b1d7;if(_0x15263f>=_0x2a2532){_0x15263f=_0x2a2532;_0x21b1d7=0xc8;}else{_0x21b1d7=0xce;}_0xf6321f['status'](_0x21b1d7);return _0xf6321f[_0x5933('0x21')](_0x5933('0x22'),_0x51a525+'-'+_0x15263f+'/'+_0x2a2532)[_0x5933('0x23')](_0x404555);}return null;};}function patchUpdates(_0x4d661c){return function(_0x59a2cd){try{jsonpatch['apply'](_0x59a2cd,_0x4d661c,!![]);}catch(_0x36d602){return BPromise['reject'](_0x36d602);}return _0x59a2cd[_0x5933('0x24')]();};}function saveUpdates(_0x4a5252,_0x2d0fb7){return function(_0x50026f){if(_0x50026f){return _0x50026f['update'](_0x4a5252)['then'](function(_0x4a1901){return _0x4a1901;});}return null;};}function removeEntity(_0x3d70ef,_0x5639c7){return function(_0x1a2f5d){if(_0x1a2f5d){return _0x1a2f5d['destroy']()['then'](function(){_0x3d70ef[_0x5933('0x1c')](0xcc)[_0x5933('0x1b')]();});}};}function handleEntityNotFound(_0x297b15,_0x56e8a9){return function(_0xd2320){if(!_0xd2320){_0x297b15[_0x5933('0x1a')](0x194);}return _0xd2320;};}function handleError(_0x2348bc,_0x5a0de4){_0x5a0de4=_0x5a0de4||0x1f4;return function(_0x1e24f6){logger[_0x5933('0x25')](_0x1e24f6['stack']);if(_0x1e24f6[_0x5933('0x26')]){delete _0x1e24f6[_0x5933('0x26')];}_0x2348bc['status'](_0x5a0de4)[_0x5933('0x27')](_0x1e24f6);};}exports['index']=function(_0x51dbae,_0x45039b){var _0x1af598={},_0x4adb80={},_0x255ed5={'count':0x0,'rows':[]};var _0x51e2d6=_[_0x5933('0x28')](db[_0x5933('0x29')]['rawAttributes'],function(_0x4fc086){return{'name':_0x4fc086['fieldName'],'type':_0x4fc086[_0x5933('0x2a')][_0x5933('0x2b')]};});_0x4adb80['model']=_[_0x5933('0x28')](_0x51e2d6,_0x5933('0x26'));_0x4adb80[_0x5933('0x2c')]=_[_0x5933('0x2d')](_0x51dbae['query']);_0x4adb80[_0x5933('0x2e')]=_['intersection'](_0x4adb80[_0x5933('0x2f')],_0x4adb80['query']);_0x1af598[_0x5933('0x30')]=_[_0x5933('0x31')](_0x4adb80[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x51dbae['query'][_0x5933('0x32')]));_0x1af598[_0x5933('0x30')]=_0x1af598['attributes']['length']?_0x1af598[_0x5933('0x30')]:_0x4adb80['model'];if(!_0x51dbae['query'][_0x5933('0x33')](_0x5933('0x34'))){_0x1af598[_0x5933('0x20')]=qs[_0x5933('0x20')](_0x51dbae['query']['limit']);_0x1af598['offset']=qs['offset'](_0x51dbae[_0x5933('0x2c')]['offset']);}_0x1af598['order']=qs['sort'](_0x51dbae[_0x5933('0x2c')][_0x5933('0x35')]);_0x1af598[_0x5933('0x36')]=qs[_0x5933('0x2e')](_[_0x5933('0x37')](_0x51dbae[_0x5933('0x2c')],_0x4adb80[_0x5933('0x2e')]),_0x51e2d6);if(_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]){_0x1af598[_0x5933('0x36')]=_['merge'](_0x1af598[_0x5933('0x36')],{'$or':_[_0x5933('0x28')](_0x51e2d6,function(_0x6e2a66){if(_0x6e2a66[_0x5933('0x2a')]!==_0x5933('0x39')){var _0x2c1484={};_0x2c1484[_0x6e2a66[_0x5933('0x26')]]={'$like':'%'+_0x51dbae[_0x5933('0x2c')][_0x5933('0x38')]+'%'};return _0x2c1484;}})});}_0x1af598=_[_0x5933('0x3a')]({},_0x1af598,_0x51dbae['options']);var _0x5c2bd0={'where':_0x1af598[_0x5933('0x36')]};return db[_0x5933('0x29')][_0x5933('0x1f')](_0x5c2bd0)['then'](function(_0x5d07da){_0x255ed5[_0x5933('0x1f')]=_0x5d07da;if(_0x51dbae[_0x5933('0x2c')]['includeAll']){_0x1af598[_0x5933('0x3b')]=[{'all':!![]}];}return db[_0x5933('0x29')][_0x5933('0x3c')](_0x1af598);})[_0x5933('0x3d')](function(_0x192576){_0x255ed5[_0x5933('0x3e')]=_0x192576;return _0x255ed5;})['then'](respondWithFilteredResult(_0x45039b,_0x1af598))['catch'](handleError(_0x45039b,null));};exports[_0x5933('0x3f')]=function(_0x1aef52,_0x36d072){var _0x293845={'raw':!![],'where':{'id':_0x1aef52[_0x5933('0x40')]['id']}},_0x247c65={};_0x247c65['model']=_[_0x5933('0x2d')](db[_0x5933('0x29')][_0x5933('0x41')]);_0x247c65['query']=_[_0x5933('0x2d')](_0x1aef52[_0x5933('0x2c')]);_0x247c65[_0x5933('0x2e')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],_0x247c65[_0x5933('0x2c')]);_0x293845[_0x5933('0x30')]=_[_0x5933('0x31')](_0x247c65[_0x5933('0x2f')],qs[_0x5933('0x32')](_0x1aef52['query'][_0x5933('0x32')]));_0x293845['attributes']=_0x293845['attributes']['length']?_0x293845[_0x5933('0x30')]:_0x247c65['model'];if(_0x1aef52['query'][_0x5933('0x42')]){_0x293845[_0x5933('0x3b')]=[{'all':!![]}];}_0x293845=_['merge']({},_0x293845,_0x1aef52[_0x5933('0x43')]);return db['Cdr'][_0x5933('0x44')](_0x293845)[_0x5933('0x3d')](handleEntityNotFound(_0x36d072,null))['then'](respondWithResult(_0x36d072,null))['catch'](handleError(_0x36d072,null));};exports[_0x5933('0x45')]=function(_0x4622bd,_0x38e713){return db[_0x5933('0x29')][_0x5933('0x45')](_0x4622bd['body'],{})[_0x5933('0x3d')](respondWithResult(_0x38e713,0xc9))[_0x5933('0x46')](handleError(_0x38e713,null));};exports[_0x5933('0x47')]=function(_0x4c2e69,_0x2d5fd4){if(_0x4c2e69[_0x5933('0x48')]['id']){delete _0x4c2e69[_0x5933('0x48')]['id'];}return db[_0x5933('0x29')]['find']({'where':{'id':_0x4c2e69[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x2d5fd4,null))[_0x5933('0x3d')](saveUpdates(_0x4c2e69[_0x5933('0x48')],null))['then'](respondWithResult(_0x2d5fd4,null))[_0x5933('0x46')](handleError(_0x2d5fd4,null));};exports[_0x5933('0x49')]=function(_0x41be67,_0x38f681){return db[_0x5933('0x29')][_0x5933('0x44')]({'where':{'id':_0x41be67[_0x5933('0x40')]['id']}})[_0x5933('0x3d')](handleEntityNotFound(_0x38f681,null))[_0x5933('0x3d')](removeEntity(_0x38f681,null))[_0x5933('0x46')](handleError(_0x38f681,null));};exports['describe']=function(_0x3fdd78,_0x4d0bb8){return db[_0x5933('0x29')]['describe']()[_0x5933('0x3d')](respondWithResult(_0x4d0bb8,null))['catch'](handleError(_0x4d0bb8,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 68bebe9..ddeb379 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x292263,_0x389471){var _0xe8a919=function(_0x14ffeb){while(--_0x14ffeb){_0x292263['push'](_0x292263['shift']());}};_0xe8a919(++_0x389471);}(_0x7a54,0x106));var _0x47a5=function(_0x395e5b,_0x21b27a){_0x395e5b=_0x395e5b-0x0;var _0x528496=_0x7a54[_0x395e5b];return _0x528496;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x514bbf,_0x3c1c08){var _0x107ff5=function(_0x1a8376){while(--_0x1a8376){_0x514bbf['push'](_0x514bbf['shift']());}};_0x107ff5(++_0x3c1c08);}(_0x7a54,0x106));var _0x47a5=function(_0x35ed5b,_0x369c77){_0x35ed5b=_0x35ed5b-0x0;var _0x1a82a8=_0x7a54[_0x35ed5b];return _0x1a82a8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 91634ff..1c3fa65 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5061=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5061,0x151));var _0x1506=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x5061[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0x1506('0x0'));var util=require(_0x1506('0x1'));var moment=require(_0x1506('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1506('0x3'));var db=require(_0x1506('0x4'))['db'];var utils=require(_0x1506('0x5'));var logger=require(_0x1506('0x6'))(_0x1506('0x7'));var config=require(_0x1506('0x8'));var jayson=require(_0x1506('0x9'));var client=jayson[_0x1506('0xa')][_0x1506('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5636e2,_0x37a103,_0x4b570c){return new BPromise(function(_0x51fafa,_0x3c9ed1){return client[_0x1506('0xc')](_0x5636e2,_0x4b570c)[_0x1506('0xd')](function(_0x2acf89){logger['info'](_0x1506('0xe'),_0x37a103,_0x1506('0xf'));logger[_0x1506('0x10')](_0x1506('0x11'),_0x37a103,'request\x20sent',JSON['stringify'](_0x2acf89));if(_0x2acf89[_0x1506('0x12')]){if(_0x2acf89[_0x1506('0x12')][_0x1506('0x13')]===0x1f4){logger[_0x1506('0x12')]('Cdr,\x20%s,\x20%s',_0x37a103,_0x2acf89[_0x1506('0x12')][_0x1506('0x14')]);return _0x3c9ed1(_0x2acf89[_0x1506('0x12')][_0x1506('0x14')]);}logger[_0x1506('0x12')](_0x1506('0xe'),_0x37a103,_0x2acf89[_0x1506('0x12')][_0x1506('0x14')]);return _0x51fafa(_0x2acf89['error'][_0x1506('0x14')]);}else{logger[_0x1506('0x15')](_0x1506('0xe'),_0x37a103,_0x1506('0xf'));_0x51fafa(_0x2acf89['result'][_0x1506('0x14')]);}})['catch'](function(_0x233ff5){logger[_0x1506('0x12')](_0x1506('0xe'),_0x37a103,_0x233ff5);_0x3c9ed1(_0x233ff5);});});}
\ No newline at end of file
+var _0x6a42=['debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request','Cdr,\x20%s,\x20%s'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x6a42,0xcd));var _0x26a4=function(_0x2e0c8f,_0x45668a){_0x2e0c8f=_0x2e0c8f-0x0;var _0x4f4d4b=_0x6a42[_0x2e0c8f];return _0x4f4d4b;};'use strict';var _=require(_0x26a4('0x0'));var util=require(_0x26a4('0x1'));var moment=require('moment');var BPromise=require(_0x26a4('0x2'));var rs=require(_0x26a4('0x3'));var fs=require('fs');var Redis=require(_0x26a4('0x4'));var db=require(_0x26a4('0x5'))['db'];var utils=require(_0x26a4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x26a4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x26a4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cd3f,_0x15a3fa,_0x4ed9d7){return new BPromise(function(_0x1ca4df,_0x3364ed){return client[_0x26a4('0x9')](_0x26cd3f,_0x4ed9d7)['then'](function(_0x52da13){logger['info'](_0x26a4('0xa'),_0x15a3fa,'request\x20sent');logger[_0x26a4('0xb')](_0x26a4('0xc'),_0x15a3fa,_0x26a4('0xd'),JSON[_0x26a4('0xe')](_0x52da13));if(_0x52da13['error']){if(_0x52da13[_0x26a4('0xf')][_0x26a4('0x10')]===0x1f4){logger[_0x26a4('0xf')](_0x26a4('0xa'),_0x15a3fa,_0x52da13[_0x26a4('0xf')][_0x26a4('0x11')]);return _0x3364ed(_0x52da13[_0x26a4('0xf')]['message']);}logger[_0x26a4('0xf')]('Cdr,\x20%s,\x20%s',_0x15a3fa,_0x52da13[_0x26a4('0xf')][_0x26a4('0x11')]);return _0x1ca4df(_0x52da13[_0x26a4('0xf')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x15a3fa,_0x26a4('0xd'));_0x1ca4df(_0x52da13['result'][_0x26a4('0x11')]);}})['catch'](function(_0x547574){logger[_0x26a4('0xf')](_0x26a4('0xa'),_0x15a3fa,_0x547574);_0x3364ed(_0x547574);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index f8c10bc..6f7f62a 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x25257a,_0x48b74e){var _0x2ecfd7=function(_0x5a4452){while(--_0x5a4452){_0x25257a['push'](_0x25257a['shift']());}};_0x2ecfd7(++_0x48b74e);}(_0xb10b,0x12a));var _0xbb10=function(_0x150cc4,_0x15e9f1){_0x150cc4=_0x150cc4-0x0;var _0x22a995=_0xb10b[_0x150cc4];return _0x22a995;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index b753ab5..1cee110 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdbaa=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0xdbaa,0xab));var _0xadba=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xdbaa[_0x87b0ff];return _0x3bc0b2;};'use strict';var Sequelize=require(_0xadba('0x0'));module[_0xadba('0x1')]={'priority':{'type':Sequelize[_0xadba('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xadba('0x3')],'allowNull':![],'defaultValue':_0xadba('0x4')},'appdata':{'type':Sequelize[_0xadba('0x5')]()},'description':{'type':Sequelize[_0xadba('0x3')]},'interval':{'type':Sequelize[_0xadba('0x3')],'defaultValue':_0xadba('0x6')}};
\ No newline at end of file
+var _0x521b=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1158d5,_0x4e7ee8){var _0x3e9d61=function(_0x182cc7){while(--_0x182cc7){_0x1158d5['push'](_0x1158d5['shift']());}};_0x3e9d61(++_0x4e7ee8);}(_0x521b,0x117));var _0xb521=function(_0x488982,_0x3e260c){_0x488982=_0x488982-0x0;var _0xfe389c=_0x521b[_0x488982];return _0xfe389c;};'use strict';var Sequelize=require(_0xb521('0x0'));module[_0xb521('0x1')]={'priority':{'type':Sequelize[_0xb521('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb521('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb521('0x4')]},'interval':{'type':Sequelize[_0xb521('0x4')],'defaultValue':_0xb521('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ec638db..12ba339 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x78f0=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x90f4e5,_0x446d1e){var _0x4378d1=function(_0x24d1ed){while(--_0x24d1ed){_0x90f4e5['push'](_0x90f4e5['shift']());}};_0x4378d1(++_0x446d1e);}(_0x78f0,0x15d));var _0x078f=function(_0x13e922,_0x1fecb9){_0x13e922=_0x13e922-0x0;var _0x2c4846=_0x78f0[_0x13e922];return _0x2c4846;};'use strict';var emlformat=require(_0x078f('0x0'));var rimraf=require(_0x078f('0x1'));var zipdir=require(_0x078f('0x2'));var jsonpatch=require(_0x078f('0x3'));var rp=require(_0x078f('0x4'));var moment=require(_0x078f('0x5'));var BPromise=require(_0x078f('0x6'));var Mustache=require(_0x078f('0x7'));var util=require('util');var path=require(_0x078f('0x8'));var sox=require(_0x078f('0x9'));var csv=require(_0x078f('0xa'));var ejs=require(_0x078f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x078f('0xc'));var squel=require(_0x078f('0xd'));var crypto=require('crypto');var jsforce=require(_0x078f('0xe'));var deskjs=require(_0x078f('0xf'));var toCsv=require(_0x078f('0xa'));var querystring=require(_0x078f('0x10'));var Papa=require(_0x078f('0x11'));var Redis=require(_0x078f('0x12'));var authService=require(_0x078f('0x13'));var qs=require(_0x078f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x078f('0x15'));var logger=require(_0x078f('0x16'))('api');var utils=require(_0x078f('0x17'));var config=require(_0x078f('0x18'));var licenseUtil=require(_0x078f('0x19'));var db=require(_0x078f('0x1a'))['db'];function respondWithStatusCode(_0x5b6b5a,_0x5de876){_0x5de876=_0x5de876||0xcc;return function(_0xe740c0){if(_0xe740c0){return _0x5b6b5a[_0x078f('0x1b')](_0x5de876);}return _0x5b6b5a[_0x078f('0x1c')](_0x5de876)[_0x078f('0x1d')]();};}function respondWithResult(_0x5df646,_0x36670d){_0x36670d=_0x36670d||0xc8;return function(_0x2d29f8){if(_0x2d29f8){return _0x5df646['status'](_0x36670d)[_0x078f('0x1e')](_0x2d29f8);}};}function respondWithFilteredResult(_0x1a44f1,_0x21fc72){return function(_0x363dfd){if(_0x363dfd){var _0x247de9=typeof _0x21fc72[_0x078f('0x1f')]==='undefined'&&typeof _0x21fc72['limit']===_0x078f('0x20');var _0x1e32c0=_0x363dfd[_0x078f('0x21')];var _0x19a182=_0x247de9?0x0:_0x21fc72[_0x078f('0x1f')];var _0x25bb2d=_0x247de9?_0x363dfd[_0x078f('0x21')]:_0x21fc72[_0x078f('0x1f')]+_0x21fc72[_0x078f('0x22')];var _0x276442;if(_0x25bb2d>=_0x1e32c0){_0x25bb2d=_0x1e32c0;_0x276442=0xc8;}else{_0x276442=0xce;}_0x1a44f1[_0x078f('0x1c')](_0x276442);return _0x1a44f1[_0x078f('0x23')]('Content-Range',_0x19a182+'-'+_0x25bb2d+'/'+_0x1e32c0)[_0x078f('0x1e')](_0x363dfd);}return null;};}function patchUpdates(_0x52c74f){return function(_0x567d26){try{jsonpatch[_0x078f('0x24')](_0x567d26,_0x52c74f,!![]);}catch(_0x3c70c2){return BPromise[_0x078f('0x25')](_0x3c70c2);}return _0x567d26[_0x078f('0x26')]();};}function saveUpdates(_0x712d52,_0x2c6db4){return function(_0x104eeb){if(_0x104eeb){return _0x104eeb[_0x078f('0x27')](_0x712d52)[_0x078f('0x28')](function(_0x4b8d12){return _0x4b8d12;});}return null;};}function removeEntity(_0x1f6b98,_0x14ad5c){return function(_0x363cce){if(_0x363cce){return _0x363cce['destroy']()['then'](function(){_0x1f6b98[_0x078f('0x1c')](0xcc)[_0x078f('0x1d')]();});}};}function handleEntityNotFound(_0x3d9d08,_0x240fb4){return function(_0x25fe4f){if(!_0x25fe4f){_0x3d9d08[_0x078f('0x1b')](0x194);}return _0x25fe4f;};}function handleError(_0x186fe3,_0x4e738b){_0x4e738b=_0x4e738b||0x1f4;return function(_0x1f6596){logger[_0x078f('0x29')](_0x1f6596['stack']);if(_0x1f6596[_0x078f('0x2a')]){delete _0x1f6596[_0x078f('0x2a')];}_0x186fe3[_0x078f('0x1c')](_0x4e738b)[_0x078f('0x2b')](_0x1f6596);};}exports[_0x078f('0x2c')]=function(_0xd57307,_0x1a8530){var _0xe41e2e={'raw':!![],'where':{'id':_0xd57307[_0x078f('0x2d')]['id']}},_0x1f0ad6={};_0x1f0ad6[_0x078f('0x2e')]=_[_0x078f('0x2f')](db[_0x078f('0x30')][_0x078f('0x31')]);_0x1f0ad6[_0x078f('0x32')]=_[_0x078f('0x2f')](_0xd57307[_0x078f('0x32')]);_0x1f0ad6[_0x078f('0x33')]=_['intersection'](_0x1f0ad6[_0x078f('0x2e')],_0x1f0ad6['query']);_0xe41e2e['attributes']=_[_0x078f('0x34')](_0x1f0ad6[_0x078f('0x2e')],qs[_0x078f('0x35')](_0xd57307[_0x078f('0x32')]['fields']));_0xe41e2e[_0x078f('0x36')]=_0xe41e2e[_0x078f('0x36')][_0x078f('0x37')]?_0xe41e2e[_0x078f('0x36')]:_0x1f0ad6[_0x078f('0x2e')];if(_0xd57307['query'][_0x078f('0x38')]){_0xe41e2e[_0x078f('0x39')]=[{'all':!![]}];}_0xe41e2e=_['merge']({},_0xe41e2e,_0xd57307['options']);return db[_0x078f('0x30')][_0x078f('0x3a')](_0xe41e2e)['then'](handleEntityNotFound(_0x1a8530,null))[_0x078f('0x28')](respondWithResult(_0x1a8530,null))[_0x078f('0x3b')](handleError(_0x1a8530,null));};exports[_0x078f('0x27')]=function(_0x5165e4,_0x2dfad1){if(_0x5165e4[_0x078f('0x3c')]['id']){delete _0x5165e4[_0x078f('0x3c')]['id'];}return db[_0x078f('0x30')][_0x078f('0x3a')]({'where':{'id':_0x5165e4[_0x078f('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2dfad1,null))[_0x078f('0x28')](saveUpdates(_0x5165e4[_0x078f('0x3c')],null))[_0x078f('0x28')](respondWithResult(_0x2dfad1,null))[_0x078f('0x3b')](handleError(_0x2dfad1,null));};exports['destroy']=function(_0x474a46,_0x2b1e0f){return db[_0x078f('0x30')][_0x078f('0x3a')]({'where':{'id':_0x474a46[_0x078f('0x2d')]['id']}})[_0x078f('0x28')](handleEntityNotFound(_0x2b1e0f,null))[_0x078f('0x28')](removeEntity(_0x2b1e0f,null))[_0x078f('0x3b')](handleError(_0x2b1e0f,null));};
\ No newline at end of file
+var _0x44f8=['attributes','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','show','params','model','ChatApplication','query','keys','intersection','fields'];(function(_0x2883f9,_0x1c48a3){var _0x756f64=function(_0x32bcee){while(--_0x32bcee){_0x2883f9['push'](_0x2883f9['shift']());}};_0x756f64(++_0x1c48a3);}(_0x44f8,0x1de));var _0x844f=function(_0x184f4f,_0x57977f){_0x184f4f=_0x184f4f-0x0;var _0x2d7a36=_0x44f8[_0x184f4f];return _0x2d7a36;};'use strict';var emlformat=require(_0x844f('0x0'));var rimraf=require(_0x844f('0x1'));var zipdir=require(_0x844f('0x2'));var jsonpatch=require(_0x844f('0x3'));var rp=require(_0x844f('0x4'));var moment=require(_0x844f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x844f('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x844f('0x7'));var fs=require('fs');var fs_extra=require(_0x844f('0x8'));var _=require(_0x844f('0x9'));var squel=require(_0x844f('0xa'));var crypto=require(_0x844f('0xb'));var jsforce=require(_0x844f('0xc'));var deskjs=require(_0x844f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x844f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x844f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x844f('0x10'));var config=require(_0x844f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x844f('0x12'))['db'];function respondWithStatusCode(_0x110dc2,_0x2320fc){_0x2320fc=_0x2320fc||0xcc;return function(_0x5ea542){if(_0x5ea542){return _0x110dc2['sendStatus'](_0x2320fc);}return _0x110dc2[_0x844f('0x13')](_0x2320fc)['end']();};}function respondWithResult(_0x3137c1,_0x31a0d9){_0x31a0d9=_0x31a0d9||0xc8;return function(_0x449887){if(_0x449887){return _0x3137c1[_0x844f('0x13')](_0x31a0d9)[_0x844f('0x14')](_0x449887);}};}function respondWithFilteredResult(_0x486fa0,_0x5da4ab){return function(_0x1b04a9){if(_0x1b04a9){var _0x149f21=typeof _0x5da4ab[_0x844f('0x15')]===_0x844f('0x16')&&typeof _0x5da4ab['limit']===_0x844f('0x16');var _0x547881=_0x1b04a9['count'];var _0x1f96d0=_0x149f21?0x0:_0x5da4ab[_0x844f('0x15')];var _0x5cc55c=_0x149f21?_0x1b04a9[_0x844f('0x17')]:_0x5da4ab['offset']+_0x5da4ab['limit'];var _0x31431e;if(_0x5cc55c>=_0x547881){_0x5cc55c=_0x547881;_0x31431e=0xc8;}else{_0x31431e=0xce;}_0x486fa0['status'](_0x31431e);return _0x486fa0[_0x844f('0x18')](_0x844f('0x19'),_0x1f96d0+'-'+_0x5cc55c+'/'+_0x547881)[_0x844f('0x14')](_0x1b04a9);}return null;};}function patchUpdates(_0x38e732){return function(_0x3f5060){try{jsonpatch['apply'](_0x3f5060,_0x38e732,!![]);}catch(_0x270be6){return BPromise['reject'](_0x270be6);}return _0x3f5060['save']();};}function saveUpdates(_0x3f83cd,_0x4261b6){return function(_0x1b2037){if(_0x1b2037){return _0x1b2037[_0x844f('0x1a')](_0x3f83cd)[_0x844f('0x1b')](function(_0x523f49){return _0x523f49;});}return null;};}function removeEntity(_0x189523,_0x4bd66d){return function(_0x22c055){if(_0x22c055){return _0x22c055['destroy']()[_0x844f('0x1b')](function(){_0x189523[_0x844f('0x13')](0xcc)[_0x844f('0x1c')]();});}};}function handleEntityNotFound(_0x7dc0c9,_0x46bf96){return function(_0x1e66c0){if(!_0x1e66c0){_0x7dc0c9[_0x844f('0x1d')](0x194);}return _0x1e66c0;};}function handleError(_0x5c9892,_0xba1365){_0xba1365=_0xba1365||0x1f4;return function(_0x16d7ad){logger[_0x844f('0x1e')](_0x16d7ad[_0x844f('0x1f')]);if(_0x16d7ad[_0x844f('0x20')]){delete _0x16d7ad[_0x844f('0x20')];}_0x5c9892['status'](_0xba1365)[_0x844f('0x21')](_0x16d7ad);};}exports[_0x844f('0x22')]=function(_0x3f62f1,_0x4d3abd){var _0x520102={'raw':!![],'where':{'id':_0x3f62f1[_0x844f('0x23')]['id']}},_0x1e243c={};_0x1e243c[_0x844f('0x24')]=_['keys'](db[_0x844f('0x25')]['rawAttributes']);_0x1e243c[_0x844f('0x26')]=_[_0x844f('0x27')](_0x3f62f1['query']);_0x1e243c['filters']=_[_0x844f('0x28')](_0x1e243c[_0x844f('0x24')],_0x1e243c['query']);_0x520102['attributes']=_[_0x844f('0x28')](_0x1e243c[_0x844f('0x24')],qs[_0x844f('0x29')](_0x3f62f1['query'][_0x844f('0x29')]));_0x520102[_0x844f('0x2a')]=_0x520102[_0x844f('0x2a')][_0x844f('0x2b')]?_0x520102['attributes']:_0x1e243c[_0x844f('0x24')];if(_0x3f62f1[_0x844f('0x26')][_0x844f('0x2c')]){_0x520102[_0x844f('0x2d')]=[{'all':!![]}];}_0x520102=_[_0x844f('0x2e')]({},_0x520102,_0x3f62f1[_0x844f('0x2f')]);return db[_0x844f('0x25')][_0x844f('0x30')](_0x520102)['then'](handleEntityNotFound(_0x4d3abd,null))[_0x844f('0x1b')](respondWithResult(_0x4d3abd,null))['catch'](handleError(_0x4d3abd,null));};exports[_0x844f('0x1a')]=function(_0x1e1213,_0x175071){if(_0x1e1213[_0x844f('0x31')]['id']){delete _0x1e1213['body']['id'];}return db[_0x844f('0x25')][_0x844f('0x30')]({'where':{'id':_0x1e1213['params']['id']}})[_0x844f('0x1b')](handleEntityNotFound(_0x175071,null))[_0x844f('0x1b')](saveUpdates(_0x1e1213[_0x844f('0x31')],null))[_0x844f('0x1b')](respondWithResult(_0x175071,null))[_0x844f('0x32')](handleError(_0x175071,null));};exports[_0x844f('0x33')]=function(_0x5900ab,_0x3592d9){return db['ChatApplication']['find']({'where':{'id':_0x5900ab[_0x844f('0x23')]['id']}})['then'](handleEntityNotFound(_0x3592d9,null))[_0x844f('0x1b')](removeEntity(_0x3592d9,null))[_0x844f('0x32')](handleError(_0x3592d9,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 58994a0..a7096f8 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x095f=['./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xb5114d,_0x4f6b9e){var _0x50895b=function(_0x48055a){while(--_0x48055a){_0xb5114d['push'](_0xb5114d['shift']());}};_0x50895b(++_0x4f6b9e);}(_0x095f,0x8c));var _0xf095=function(_0x23b29c,_0x8358ae){_0x23b29c=_0x23b29c-0x0;var _0x4b22e1=_0x095f[_0x23b29c];return _0x4b22e1;};'use strict';var _=require(_0xf095('0x0'));var util=require(_0xf095('0x1'));var logger=require(_0xf095('0x2'))(_0xf095('0x3'));var moment=require(_0xf095('0x4'));var BPromise=require(_0xf095('0x5'));var rp=require(_0xf095('0x6'));var fs=require('fs');var path=require(_0xf095('0x7'));var rimraf=require(_0xf095('0x8'));var config=require(_0xf095('0x9'));var attributes=require(_0xf095('0xa'));module['exports']=function(_0x52aa40,_0x28c17e){return _0x52aa40['define'](_0xf095('0xb'),attributes,{'tableName':_0xf095('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf095('0xd'),'collate':_0xf095('0xe')});};
\ No newline at end of file
+var _0x8aac=['ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','exports'];(function(_0x16b334,_0x58bd7f){var _0x54aff2=function(_0x366b0e){while(--_0x366b0e){_0x16b334['push'](_0x16b334['shift']());}};_0x54aff2(++_0x58bd7f);}(_0x8aac,0x11c));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8aa('0x0'));var util=require('util');var logger=require(_0xc8aa('0x1'))(_0xc8aa('0x2'));var moment=require(_0xc8aa('0x3'));var BPromise=require(_0xc8aa('0x4'));var rp=require(_0xc8aa('0x5'));var fs=require('fs');var path=require(_0xc8aa('0x6'));var rimraf=require(_0xc8aa('0x7'));var config=require('../../config/environment');var attributes=require(_0xc8aa('0x8'));module[_0xc8aa('0x9')]=function(_0x2f28e0,_0x57bd5e){return _0x2f28e0['define'](_0xc8aa('0xa'),attributes,{'tableName':_0xc8aa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8aa('0xc'),'collate':_0xc8aa('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 086b794..2536b94 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x58d8=['result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x58d8,0xec));var _0x858d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x858d('0x0'));var util=require(_0x858d('0x1'));var moment=require('moment');var BPromise=require(_0x858d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x858d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x858d('0x4'))(_0x858d('0x5'));var config=require('../../config/environment');var jayson=require(_0x858d('0x6'));var client=jayson[_0x858d('0x7')][_0x858d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bad36,_0x4d2989,_0x19e043){return new BPromise(function(_0x94851d,_0x3545bc){return client['request'](_0x2bad36,_0x19e043)['then'](function(_0x3552ce){logger[_0x858d('0x9')]('ChatApplication,\x20%s,\x20%s',_0x4d2989,_0x858d('0xa'));logger['debug'](_0x858d('0xb'),_0x4d2989,_0x858d('0xa'),JSON[_0x858d('0xc')](_0x3552ce));if(_0x3552ce[_0x858d('0xd')]){if(_0x3552ce['error']['code']===0x1f4){logger['error'](_0x858d('0xe'),_0x4d2989,_0x3552ce['error'][_0x858d('0xf')]);return _0x3545bc(_0x3552ce[_0x858d('0xd')][_0x858d('0xf')]);}logger[_0x858d('0xd')](_0x858d('0xe'),_0x4d2989,_0x3552ce[_0x858d('0xd')]['message']);return _0x94851d(_0x3552ce[_0x858d('0xd')][_0x858d('0xf')]);}else{logger['info'](_0x858d('0xe'),_0x4d2989,_0x858d('0xa'));_0x94851d(_0x3552ce[_0x858d('0x10')]['message']);}})[_0x858d('0x11')](function(_0x2b9e1d){logger[_0x858d('0xd')](_0x858d('0xe'),_0x4d2989,_0x2b9e1d);_0x3545bc(_0x2b9e1d);});});}
\ No newline at end of file
+var _0xa9fa=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring'];(function(_0x6841b,_0xf789e4){var _0x407e81=function(_0x76278f){while(--_0x76278f){_0x6841b['push'](_0x6841b['shift']());}};_0x407e81(++_0xf789e4);}(_0xa9fa,0x1dc));var _0xaa9f=function(_0x189794,_0x3ed84c){_0x189794=_0x189794-0x0;var _0x4bacad=_0xa9fa[_0x189794];return _0x4bacad;};'use strict';var _=require(_0xaa9f('0x0'));var util=require(_0xaa9f('0x1'));var moment=require(_0xaa9f('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaa9f('0x4'));var logger=require(_0xaa9f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaa9f('0x6'));var client=jayson[_0xaa9f('0x7')][_0xaa9f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x98797c,_0x173087,_0x1aed44){return new BPromise(function(_0x549c3a,_0x7191e3){return client[_0xaa9f('0x9')](_0x98797c,_0x1aed44)[_0xaa9f('0xa')](function(_0x1ea6ce){logger['info'](_0xaa9f('0xb'),_0x173087,_0xaa9f('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x173087,_0xaa9f('0xc'),JSON[_0xaa9f('0xd')](_0x1ea6ce));if(_0x1ea6ce[_0xaa9f('0xe')]){if(_0x1ea6ce[_0xaa9f('0xe')][_0xaa9f('0xf')]===0x1f4){logger[_0xaa9f('0xe')](_0xaa9f('0xb'),_0x173087,_0x1ea6ce[_0xaa9f('0xe')][_0xaa9f('0x10')]);return _0x7191e3(_0x1ea6ce[_0xaa9f('0xe')][_0xaa9f('0x10')]);}logger[_0xaa9f('0xe')](_0xaa9f('0xb'),_0x173087,_0x1ea6ce[_0xaa9f('0xe')]['message']);return _0x549c3a(_0x1ea6ce['error']['message']);}else{logger[_0xaa9f('0x11')](_0xaa9f('0xb'),_0x173087,_0xaa9f('0xc'));_0x549c3a(_0x1ea6ce[_0xaa9f('0x12')]['message']);}})[_0xaa9f('0x13')](function(_0x5924fa){logger['error'](_0xaa9f('0xb'),_0x173087,_0x5924fa);_0x7191e3(_0x5924fa);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 5d51113..2e047ff 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc96a=['delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated'];(function(_0x52419c,_0x2a9043){var _0x560902=function(_0x4df864){while(--_0x4df864){_0x52419c['push'](_0x52419c['shift']());}};_0x560902(++_0x2a9043);}(_0xc96a,0xd3));var _0xac96=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xc96a[_0x725a4c];return _0x37b2cc;};'use strict';var multer=require('multer');var util=require(_0xac96('0x0'));var path=require(_0xac96('0x1'));var timeout=require(_0xac96('0x2'));var express=require(_0xac96('0x3'));var router=express['Router']();var fs_extra=require(_0xac96('0x4'));var auth=require(_0xac96('0x5'));var interaction=require(_0xac96('0x6'));var config=require(_0xac96('0x7'));var controller=require('./chatApplication.controller');router['get'](_0xac96('0x8'),auth['isAuthenticated'](),controller['show']);router['put'](_0xac96('0x8'),auth[_0xac96('0x9')](),controller['update']);router[_0xac96('0xa')](_0xac96('0x8'),auth[_0xac96('0x9')](),controller[_0xac96('0xb')]);module[_0xac96('0xc')]=router;
\ No newline at end of file
+var _0xa7b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x40f1e7,_0x5d3cb0){var _0x8ad80f=function(_0x44d776){while(--_0x44d776){_0x40f1e7['push'](_0x40f1e7['shift']());}};_0x8ad80f(++_0x5d3cb0);}(_0xa7b0,0x8c));var _0x0a7b=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0xa7b0[_0x4fdc46];return _0x2c178a;};'use strict';var multer=require(_0x0a7b('0x0'));var util=require(_0x0a7b('0x1'));var path=require('path');var timeout=require(_0x0a7b('0x2'));var express=require(_0x0a7b('0x3'));var router=express[_0x0a7b('0x4')]();var fs_extra=require(_0x0a7b('0x5'));var auth=require(_0x0a7b('0x6'));var interaction=require(_0x0a7b('0x7'));var config=require(_0x0a7b('0x8'));var controller=require(_0x0a7b('0x9'));router[_0x0a7b('0xa')](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xd')]);router[_0x0a7b('0xe')](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0xf')]);router['delete'](_0x0a7b('0xb'),auth[_0x0a7b('0xc')](),controller[_0x0a7b('0x10')]);module[_0x0a7b('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 9d4e258..748c4d2 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf771=['STRING','BOOLEAN','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xf771,0x8e));var _0x1f77=function(_0x7739fc,_0x5e7aad){_0x7739fc=_0x7739fc-0x0;var _0x3d51e8=_0xf771[_0x7739fc];return _0x3d51e8;};'use strict';var Sequelize=require(_0x1f77('0x0'));module[_0x1f77('0x1')]={'name':{'type':Sequelize[_0x1f77('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1f77('0x2')]},'write':{'type':Sequelize[_0x1f77('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1fa9=['BOOLEAN','sequelize','STRING'];(function(_0x2e986d,_0x4b6b63){var _0x351c79=function(_0xf178c7){while(--_0xf178c7){_0x2e986d['push'](_0x2e986d['shift']());}};_0x351c79(++_0x4b6b63);}(_0x1fa9,0x136));var _0x91fa=function(_0x5b9fe9,_0x1877b2){_0x5b9fe9=_0x5b9fe9-0x0;var _0x2e6e69=_0x1fa9[_0x5b9fe9];return _0x2e6e69;};'use strict';var Sequelize=require(_0x91fa('0x0'));module['exports']={'name':{'type':Sequelize[_0x91fa('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x91fa('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 5b18e37..51044e0 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x472c=['addMembers','omit','ids','getMembers','findOne','hasOwnProperty','removeMembers','addMessage','ChatGroupId','$gte','split','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','ChatGroup','findAll','rows','catch','show','params','include','options','find','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger'];(function(_0x270fb7,_0x4b26a7){var _0x586847=function(_0x3d852c){while(--_0x3d852c){_0x270fb7['push'](_0x270fb7['shift']());}};_0x586847(++_0x4b26a7);}(_0x472c,0x11c));var _0xc472=function(_0x4b9a61,_0x1e0f82){_0x4b9a61=_0x4b9a61-0x0;var _0x591643=_0x472c[_0x4b9a61];return _0x591643;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc472('0x0'));var zipdir=require(_0xc472('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc472('0x2'));var moment=require('moment');var BPromise=require(_0xc472('0x3'));var Mustache=require(_0xc472('0x4'));var util=require(_0xc472('0x5'));var path=require(_0xc472('0x6'));var sox=require(_0xc472('0x7'));var csv=require(_0xc472('0x8'));var ejs=require(_0xc472('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc472('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc472('0xb'));var deskjs=require(_0xc472('0xc'));var toCsv=require(_0xc472('0x8'));var querystring=require(_0xc472('0xd'));var Papa=require(_0xc472('0xe'));var Redis=require(_0xc472('0xf'));var authService=require(_0xc472('0x10'));var qs=require(_0xc472('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc472('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc472('0x13'));var config=require(_0xc472('0x14'));var licenseUtil=require(_0xc472('0x15'));var db=require(_0xc472('0x16'))['db'];config[_0xc472('0x17')]=_[_0xc472('0x18')](config[_0xc472('0x17')],{'host':_0xc472('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc472('0x1a'))[_0xc472('0x1b')](socket);function respondWithStatusCode(_0x474da0,_0x22adfe){_0x22adfe=_0x22adfe||0xcc;return function(_0x1fc9bf){if(_0x1fc9bf){return _0x474da0[_0xc472('0x1c')](_0x22adfe);}return _0x474da0[_0xc472('0x1d')](_0x22adfe)[_0xc472('0x1e')]();};}function respondWithResult(_0x32e96d,_0x195513){_0x195513=_0x195513||0xc8;return function(_0x1bb615){if(_0x1bb615){return _0x32e96d[_0xc472('0x1d')](_0x195513)[_0xc472('0x1f')](_0x1bb615);}};}function respondWithFilteredResult(_0x5c09a7,_0x8fe7ee){return function(_0x22207e){if(_0x22207e){var _0x5ee51b=typeof _0x8fe7ee[_0xc472('0x20')]===_0xc472('0x21')&&typeof _0x8fe7ee[_0xc472('0x22')]===_0xc472('0x21');var _0x5d8ce9=_0x22207e[_0xc472('0x23')];var _0x3e45b9=_0x5ee51b?0x0:_0x8fe7ee[_0xc472('0x20')];var _0x104ddf=_0x5ee51b?_0x22207e[_0xc472('0x23')]:_0x8fe7ee[_0xc472('0x20')]+_0x8fe7ee['limit'];var _0x39c76b;if(_0x104ddf>=_0x5d8ce9){_0x104ddf=_0x5d8ce9;_0x39c76b=0xc8;}else{_0x39c76b=0xce;}_0x5c09a7['status'](_0x39c76b);return _0x5c09a7['set']('Content-Range',_0x3e45b9+'-'+_0x104ddf+'/'+_0x5d8ce9)[_0xc472('0x1f')](_0x22207e);}return null;};}function patchUpdates(_0x3a19b5){return function(_0xfe15b1){try{jsonpatch[_0xc472('0x24')](_0xfe15b1,_0x3a19b5,!![]);}catch(_0x150280){return BPromise[_0xc472('0x25')](_0x150280);}return _0xfe15b1[_0xc472('0x26')]();};}function saveUpdates(_0x3aeb30,_0x10f2c0){return function(_0x598313){if(_0x598313){return _0x598313[_0xc472('0x27')](_0x3aeb30)[_0xc472('0x28')](function(_0x18530b){return _0x18530b;});}return null;};}function removeEntity(_0x369f23,_0x2f8961){return function(_0x5c3573){if(_0x5c3573){return _0x5c3573['destroy']()[_0xc472('0x28')](function(){_0x369f23[_0xc472('0x1d')](0xcc)[_0xc472('0x1e')]();});}};}function handleEntityNotFound(_0x52869c,_0x200aab){return function(_0xf227cf){if(!_0xf227cf){_0x52869c[_0xc472('0x1c')](0x194);}return _0xf227cf;};}function handleError(_0x377e5c,_0x289a43){_0x289a43=_0x289a43||0x1f4;return function(_0x22521b){logger[_0xc472('0x29')](_0x22521b['stack']);if(_0x22521b[_0xc472('0x2a')]){delete _0x22521b[_0xc472('0x2a')];}_0x377e5c['status'](_0x289a43)['send'](_0x22521b);};}exports[_0xc472('0x2b')]=function(_0x4bc370,_0x2c2a54){var _0x3740af={},_0x5f532e={},_0x373e8a={'count':0x0,'rows':[]};var _0x531617=_[_0xc472('0x2c')](db['ChatGroup'][_0xc472('0x2d')],function(_0x4dd5ab){return{'name':_0x4dd5ab[_0xc472('0x2e')],'type':_0x4dd5ab['type'][_0xc472('0x2f')]};});_0x5f532e[_0xc472('0x30')]=_[_0xc472('0x2c')](_0x531617,'name');_0x5f532e['query']=_[_0xc472('0x31')](_0x4bc370[_0xc472('0x32')]);_0x5f532e['filters']=_[_0xc472('0x33')](_0x5f532e[_0xc472('0x30')],_0x5f532e['query']);_0x3740af['attributes']=_[_0xc472('0x33')](_0x5f532e['model'],qs[_0xc472('0x34')](_0x4bc370['query']['fields']));_0x3740af[_0xc472('0x35')]=_0x3740af[_0xc472('0x35')][_0xc472('0x36')]?_0x3740af[_0xc472('0x35')]:_0x5f532e[_0xc472('0x30')];if(!_0x4bc370['query']['hasOwnProperty'](_0xc472('0x37'))){_0x3740af[_0xc472('0x22')]=qs[_0xc472('0x22')](_0x4bc370[_0xc472('0x32')][_0xc472('0x22')]);_0x3740af['offset']=qs[_0xc472('0x20')](_0x4bc370[_0xc472('0x32')][_0xc472('0x20')]);}_0x3740af[_0xc472('0x38')]=qs[_0xc472('0x39')](_0x4bc370[_0xc472('0x32')][_0xc472('0x39')]);_0x3740af[_0xc472('0x3a')]=qs['filters'](_[_0xc472('0x3b')](_0x4bc370[_0xc472('0x32')],_0x5f532e[_0xc472('0x3c')]),_0x531617);if(_0x4bc370['query'][_0xc472('0x3d')]){_0x3740af[_0xc472('0x3a')]=_[_0xc472('0x3e')](_0x3740af['where'],{'$or':_[_0xc472('0x2c')](_0x531617,function(_0x5bd786){if(_0x5bd786['type']!==_0xc472('0x3f')){var _0x8c5d44={};_0x8c5d44[_0x5bd786[_0xc472('0x2a')]]={'$like':'%'+_0x4bc370[_0xc472('0x32')]['filter']+'%'};return _0x8c5d44;}})});}_0x3740af=_[_0xc472('0x3e')]({},_0x3740af,_0x4bc370['options']);var _0x37e42e={'where':_0x3740af['where']};return db[_0xc472('0x40')][_0xc472('0x23')](_0x37e42e)['then'](function(_0x2fca49){_0x373e8a[_0xc472('0x23')]=_0x2fca49;if(_0x4bc370['query']['includeAll']){_0x3740af['include']=[{'all':!![]}];}return db['ChatGroup'][_0xc472('0x41')](_0x3740af);})['then'](function(_0x246f4d){_0x373e8a[_0xc472('0x42')]=_0x246f4d;return _0x373e8a;})[_0xc472('0x28')](respondWithFilteredResult(_0x2c2a54,_0x3740af))[_0xc472('0x43')](handleError(_0x2c2a54,null));};exports[_0xc472('0x44')]=function(_0xb4bfb1,_0x25715e){var _0x400977={'raw':!![],'where':{'id':_0xb4bfb1[_0xc472('0x45')]['id']}},_0x79df3f={};_0x79df3f[_0xc472('0x30')]=_[_0xc472('0x31')](db['ChatGroup'][_0xc472('0x2d')]);_0x79df3f[_0xc472('0x32')]=_['keys'](_0xb4bfb1[_0xc472('0x32')]);_0x79df3f[_0xc472('0x3c')]=_['intersection'](_0x79df3f[_0xc472('0x30')],_0x79df3f['query']);_0x400977[_0xc472('0x35')]=_[_0xc472('0x33')](_0x79df3f[_0xc472('0x30')],qs[_0xc472('0x34')](_0xb4bfb1[_0xc472('0x32')]['fields']));_0x400977['attributes']=_0x400977[_0xc472('0x35')][_0xc472('0x36')]?_0x400977['attributes']:_0x79df3f[_0xc472('0x30')];if(_0xb4bfb1[_0xc472('0x32')]['includeAll']){_0x400977[_0xc472('0x46')]=[{'all':!![]}];}_0x400977=_[_0xc472('0x3e')]({},_0x400977,_0xb4bfb1[_0xc472('0x47')]);return db['ChatGroup'][_0xc472('0x48')](_0x400977)['then'](handleEntityNotFound(_0x25715e,null))[_0xc472('0x28')](respondWithResult(_0x25715e,null))[_0xc472('0x43')](handleError(_0x25715e,null));};exports[_0xc472('0x49')]=function(_0x66c79,_0x206c7d){return db[_0xc472('0x40')]['create'](_0x66c79[_0xc472('0x4a')],{})[_0xc472('0x28')](respondWithResult(_0x206c7d,0xc9))[_0xc472('0x43')](handleError(_0x206c7d,null));};exports['update']=function(_0x4ee2d0,_0x120428){if(_0x4ee2d0[_0xc472('0x4a')]['id']){delete _0x4ee2d0['body']['id'];}return db[_0xc472('0x40')][_0xc472('0x48')]({'where':{'id':_0x4ee2d0[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x120428,null))[_0xc472('0x28')](saveUpdates(_0x4ee2d0[_0xc472('0x4a')],null))['then'](respondWithResult(_0x120428,null))[_0xc472('0x43')](handleError(_0x120428,null));};exports[_0xc472('0x4b')]=function(_0x22b542,_0x335a7e){return db[_0xc472('0x40')][_0xc472('0x48')]({'where':{'id':_0x22b542[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x335a7e,null))[_0xc472('0x28')](removeEntity(_0x335a7e,null))[_0xc472('0x43')](handleError(_0x335a7e,null));};exports['describe']=function(_0x5c23c3,_0x3d088f){return db[_0xc472('0x40')][_0xc472('0x4c')]()[_0xc472('0x28')](respondWithResult(_0x3d088f,null))[_0xc472('0x43')](handleError(_0x3d088f,null));};exports[_0xc472('0x4d')]=function(_0x40f1a5,_0x2e3f09,_0x5108de){return db[_0xc472('0x4e')][_0xc472('0x23')]({'where':{'ChatGroupId':_0x40f1a5['params']['id'],'ToId':_0x40f1a5['user']['id'],'read':![]}})[_0xc472('0x28')](function(_0x10855b){return{'id':_[_0xc472('0x4f')](_0x40f1a5[_0xc472('0x45')]['id']),'count':_0x10855b};})[_0xc472('0x28')](respondWithResult(_0x2e3f09,null))[_0xc472('0x43')](handleError(_0x2e3f09,null));};exports[_0xc472('0x50')]=function(_0x33d3d6,_0x514410,_0x4c1cae){return db[_0xc472('0x40')]['find']({'where':{'id':_0x33d3d6[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x514410,null))['then'](function(_0x507484){if(_0x507484){return _0x507484[_0xc472('0x50')](_0x33d3d6[_0xc472('0x4a')]['ids'],_[_0xc472('0x51')](_0x33d3d6[_0xc472('0x4a')],[_0xc472('0x52'),'id'])||{});}})[_0xc472('0x28')](respondWithResult(_0x514410,null))['catch'](handleError(_0x514410,null));};exports[_0xc472('0x53')]=function(_0x56d091,_0xf8b7b1,_0x328c22){var _0x5b2c47={};var _0x40bfaf={};var _0x566d97;var _0x3ffcc7;return db[_0xc472('0x40')][_0xc472('0x54')]({'where':{'id':_0x56d091['params']['id']}})[_0xc472('0x28')](handleEntityNotFound(_0xf8b7b1,null))['then'](function(_0x7f8879){if(_0x7f8879){_0x566d97=_0x7f8879;_0x40bfaf[_0xc472('0x30')]=_['keys'](db['User'][_0xc472('0x2d')]);_0x40bfaf[_0xc472('0x32')]=_[_0xc472('0x31')](_0x56d091['query']);_0x40bfaf[_0xc472('0x3c')]=_[_0xc472('0x33')](_0x40bfaf[_0xc472('0x30')],_0x40bfaf[_0xc472('0x32')]);_0x5b2c47[_0xc472('0x35')]=_['intersection'](_0x40bfaf[_0xc472('0x30')],qs['fields'](_0x56d091[_0xc472('0x32')]['fields']));_0x5b2c47[_0xc472('0x35')]=_0x5b2c47[_0xc472('0x35')][_0xc472('0x36')]?_0x5b2c47[_0xc472('0x35')]:_0x40bfaf[_0xc472('0x30')];_0x5b2c47[_0xc472('0x38')]=qs[_0xc472('0x39')](_0x56d091[_0xc472('0x32')]['sort']);_0x5b2c47[_0xc472('0x3a')]=qs[_0xc472('0x3c')](_['pick'](_0x56d091[_0xc472('0x32')],_0x40bfaf[_0xc472('0x3c')]));if(_0x56d091[_0xc472('0x32')]['filter']){_0x5b2c47[_0xc472('0x3a')]=_['merge'](_0x5b2c47[_0xc472('0x3a')],{'$or':_[_0xc472('0x2c')](_0x5b2c47['attributes'],function(_0xc1a5cc){var _0x173007={};_0x173007[_0xc1a5cc]={'$like':'%'+_0x56d091[_0xc472('0x32')][_0xc472('0x3d')]+'%'};return _0x173007;})});}_0x5b2c47=_['merge']({},_0x5b2c47,_0x56d091[_0xc472('0x47')]);return _0x566d97[_0xc472('0x53')](_0x5b2c47);}})[_0xc472('0x28')](function(_0x497614){if(_0x497614){_0x3ffcc7=_0x497614['length'];if(!_0x56d091['query'][_0xc472('0x55')](_0xc472('0x37'))){_0x5b2c47[_0xc472('0x22')]=qs['limit'](_0x56d091['query'][_0xc472('0x22')]);_0x5b2c47[_0xc472('0x20')]=qs['offset'](_0x56d091[_0xc472('0x32')][_0xc472('0x20')]);}return _0x566d97[_0xc472('0x53')](_0x5b2c47);}})[_0xc472('0x28')](function(_0x2aea0e){if(_0x2aea0e){return _0x2aea0e?{'count':_0x3ffcc7,'rows':_0x2aea0e}:null;}})[_0xc472('0x28')](respondWithResult(_0xf8b7b1,null))[_0xc472('0x43')](handleError(_0xf8b7b1,null));};exports[_0xc472('0x56')]=function(_0x196eac,_0x56d57d,_0x59fa48){return db[_0xc472('0x40')]['find']({'where':{'id':_0x196eac[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x56d57d,null))[_0xc472('0x28')](function(_0x3f7804){if(_0x3f7804){return _0x3f7804[_0xc472('0x56')](_0x196eac[_0xc472('0x32')][_0xc472('0x52')]);}})[_0xc472('0x28')](respondWithStatusCode(_0x56d57d,null))['catch'](handleError(_0x56d57d,null));};exports[_0xc472('0x57')]=function(_0xd7f3fb,_0x457e4e,_0x3839f5){if(_0xd7f3fb[_0xc472('0x4a')]['id']){delete _0xd7f3fb[_0xc472('0x4a')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0xd7f3fb['params']['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x457e4e,null))[_0xc472('0x28')](function(_0x10b452){if(_0x10b452){_0xd7f3fb['body'][_0xc472('0x58')]=_0x10b452['id'];return db['ChatInternalMessage']['create'](_0xd7f3fb[_0xc472('0x4a')]);}})[_0xc472('0x28')](respondWithResult(_0x457e4e,null))['catch'](handleError(_0x457e4e,null));};exports['getMessages']=function(_0x57198b,_0x31e961,_0x16bc6a){var _0x1cd5f5={};var _0x3d412f={};var _0x4ab432;var _0x4985bb;return db[_0xc472('0x40')][_0xc472('0x54')]({'where':{'id':_0x57198b[_0xc472('0x45')]['id']}})[_0xc472('0x28')](handleEntityNotFound(_0x31e961,null))[_0xc472('0x28')](function(_0x163c38){if(_0x163c38){_0x4ab432=_0x163c38;_0x3d412f['model']=_[_0xc472('0x31')](db[_0xc472('0x4e')][_0xc472('0x2d')]);_0x3d412f[_0xc472('0x32')]=_[_0xc472('0x31')](_0x57198b[_0xc472('0x32')]);_0x3d412f['filters']=_[_0xc472('0x33')](_0x3d412f[_0xc472('0x30')],_0x3d412f['query']);_0x1cd5f5['attributes']=_[_0xc472('0x33')](_0x3d412f[_0xc472('0x30')],qs['fields'](_0x57198b['query']['fields']));_0x1cd5f5['attributes']=_0x1cd5f5[_0xc472('0x35')][_0xc472('0x36')]?_0x1cd5f5['attributes']:_0x3d412f[_0xc472('0x30')];_0x1cd5f5[_0xc472('0x38')]=qs[_0xc472('0x39')](_0x57198b[_0xc472('0x32')][_0xc472('0x39')]);_0x1cd5f5['where']=qs[_0xc472('0x3c')](_[_0xc472('0x3b')](_0x57198b[_0xc472('0x32')],_0x3d412f[_0xc472('0x3c')]));if(_0x57198b['query'][_0xc472('0x3d')]){_0x1cd5f5['where']=_[_0xc472('0x3e')](_0x1cd5f5[_0xc472('0x3a')],{'$or':_['map'](_0x1cd5f5[_0xc472('0x35')],function(_0x3bb340){var _0x4cca0d={};_0x4cca0d[_0x3bb340]={'$like':'%'+_0x57198b[_0xc472('0x32')][_0xc472('0x3d')]+'%'};return _0x4cca0d;})});}if(_0x57198b[_0xc472('0x32')][_0xc472('0x59')]){var _0x9b74f4=_0x57198b[_0xc472('0x32')][_0xc472('0x59')][_0xc472('0x5a')](',');var _0x373006={};_0x373006[_0x9b74f4[0x0]]={'$gte':moment(_0x9b74f4[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1cd5f5['where']=_[_0xc472('0x3e')](_0x1cd5f5[_0xc472('0x3a')],_0x373006);}_0x1cd5f5=_['merge']({},_0x1cd5f5,_0x57198b[_0xc472('0x47')]);return _0x4ab432['getMessages'](_0x1cd5f5);}})[_0xc472('0x28')](function(_0x687f02){if(_0x687f02){_0x4985bb=_0x687f02[_0xc472('0x36')];if(!_0x57198b['query'][_0xc472('0x55')](_0xc472('0x37'))){_0x1cd5f5[_0xc472('0x22')]=qs[_0xc472('0x22')](_0x57198b[_0xc472('0x32')][_0xc472('0x22')]);_0x1cd5f5['offset']=qs[_0xc472('0x20')](_0x57198b[_0xc472('0x32')][_0xc472('0x20')]);}return _0x4ab432['getMessages'](_0x1cd5f5);}})[_0xc472('0x28')](function(_0x2f297a){if(_0x2f297a){return _0x2f297a?{'count':_0x4985bb,'rows':_0x2f297a}:null;}})[_0xc472('0x28')](respondWithResult(_0x31e961,null))[_0xc472('0x43')](handleError(_0x31e961,null));};
\ No newline at end of file
+var _0x087c=['update','destroy','then','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','catch','body','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','findOne','User','length','order','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save'];(function(_0x108883,_0x58fa26){var _0x3eee97=function(_0x3b7dab){while(--_0x3b7dab){_0x108883['push'](_0x108883['shift']());}};_0x3eee97(++_0x58fa26);}(_0x087c,0x154));var _0xc087=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x087c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc087('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc087('0x1'));var moment=require(_0xc087('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc087('0x3'));var path=require(_0xc087('0x4'));var sox=require(_0xc087('0x5'));var csv=require('to-csv');var ejs=require(_0xc087('0x6'));var fs=require('fs');var fs_extra=require(_0xc087('0x7'));var _=require(_0xc087('0x8'));var squel=require(_0xc087('0x9'));var crypto=require(_0xc087('0xa'));var jsforce=require(_0xc087('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc087('0xc'));var querystring=require('querystring');var Papa=require(_0xc087('0xd'));var Redis=require('ioredis');var authService=require(_0xc087('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc087('0xf'));var hardwareService=require(_0xc087('0x10'));var logger=require(_0xc087('0x11'))(_0xc087('0x12'));var utils=require('../../config/utils');var config=require(_0xc087('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xc087('0x14')]=_[_0xc087('0x15')](config['redis'],{'host':_0xc087('0x16'),'port':0x18eb});var socket=require(_0xc087('0x17'))(new Redis(config['redis']));require(_0xc087('0x18'))[_0xc087('0x19')](socket);function respondWithStatusCode(_0x1c0be3,_0x1177ce){_0x1177ce=_0x1177ce||0xcc;return function(_0x8deadd){if(_0x8deadd){return _0x1c0be3[_0xc087('0x1a')](_0x1177ce);}return _0x1c0be3[_0xc087('0x1b')](_0x1177ce)['end']();};}function respondWithResult(_0x171f59,_0x2c5b04){_0x2c5b04=_0x2c5b04||0xc8;return function(_0x1c2ae6){if(_0x1c2ae6){return _0x171f59[_0xc087('0x1b')](_0x2c5b04)[_0xc087('0x1c')](_0x1c2ae6);}};}function respondWithFilteredResult(_0x55274f,_0x33a68c){return function(_0x4d8c95){if(_0x4d8c95){var _0x57b9bd=typeof _0x33a68c[_0xc087('0x1d')]===_0xc087('0x1e')&&typeof _0x33a68c[_0xc087('0x1f')]==='undefined';var _0x5e4683=_0x4d8c95[_0xc087('0x20')];var _0x550be4=_0x57b9bd?0x0:_0x33a68c[_0xc087('0x1d')];var _0x48c875=_0x57b9bd?_0x4d8c95[_0xc087('0x20')]:_0x33a68c[_0xc087('0x1d')]+_0x33a68c[_0xc087('0x1f')];var _0x35e58d;if(_0x48c875>=_0x5e4683){_0x48c875=_0x5e4683;_0x35e58d=0xc8;}else{_0x35e58d=0xce;}_0x55274f[_0xc087('0x1b')](_0x35e58d);return _0x55274f['set'](_0xc087('0x21'),_0x550be4+'-'+_0x48c875+'/'+_0x5e4683)[_0xc087('0x1c')](_0x4d8c95);}return null;};}function patchUpdates(_0xf9a300){return function(_0x227071){try{jsonpatch[_0xc087('0x22')](_0x227071,_0xf9a300,!![]);}catch(_0x2fdf34){return BPromise['reject'](_0x2fdf34);}return _0x227071[_0xc087('0x23')]();};}function saveUpdates(_0x5bb715,_0x51420f){return function(_0x3e964b){if(_0x3e964b){return _0x3e964b[_0xc087('0x24')](_0x5bb715)['then'](function(_0x5a94f4){return _0x5a94f4;});}return null;};}function removeEntity(_0x325664,_0x4d567d){return function(_0x2915c1){if(_0x2915c1){return _0x2915c1[_0xc087('0x25')]()[_0xc087('0x26')](function(){_0x325664[_0xc087('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28106f,_0x21daf0){return function(_0x54be44){if(!_0x54be44){_0x28106f[_0xc087('0x1a')](0x194);}return _0x54be44;};}function handleError(_0x3ef5de,_0x54de79){_0x54de79=_0x54de79||0x1f4;return function(_0x11eb40){logger[_0xc087('0x27')](_0x11eb40[_0xc087('0x28')]);if(_0x11eb40[_0xc087('0x29')]){delete _0x11eb40[_0xc087('0x29')];}_0x3ef5de[_0xc087('0x1b')](_0x54de79)[_0xc087('0x2a')](_0x11eb40);};}exports[_0xc087('0x2b')]=function(_0x263203,_0x308f04){var _0x439ccd={},_0x271c88={},_0x145fed={'count':0x0,'rows':[]};var _0x1b14a2=_[_0xc087('0x2c')](db[_0xc087('0x2d')][_0xc087('0x2e')],function(_0xc71e31){return{'name':_0xc71e31[_0xc087('0x2f')],'type':_0xc71e31[_0xc087('0x30')]['key']};});_0x271c88['model']=_[_0xc087('0x2c')](_0x1b14a2,_0xc087('0x29'));_0x271c88[_0xc087('0x31')]=_[_0xc087('0x32')](_0x263203[_0xc087('0x31')]);_0x271c88[_0xc087('0x33')]=_['intersection'](_0x271c88[_0xc087('0x34')],_0x271c88[_0xc087('0x31')]);_0x439ccd['attributes']=_[_0xc087('0x35')](_0x271c88[_0xc087('0x34')],qs[_0xc087('0x36')](_0x263203[_0xc087('0x31')]['fields']));_0x439ccd[_0xc087('0x37')]=_0x439ccd[_0xc087('0x37')]['length']?_0x439ccd[_0xc087('0x37')]:_0x271c88['model'];if(!_0x263203[_0xc087('0x31')][_0xc087('0x38')](_0xc087('0x39'))){_0x439ccd[_0xc087('0x1f')]=qs['limit'](_0x263203[_0xc087('0x31')][_0xc087('0x1f')]);_0x439ccd['offset']=qs[_0xc087('0x1d')](_0x263203[_0xc087('0x31')]['offset']);}_0x439ccd['order']=qs['sort'](_0x263203[_0xc087('0x31')][_0xc087('0x3a')]);_0x439ccd[_0xc087('0x3b')]=qs[_0xc087('0x33')](_[_0xc087('0x3c')](_0x263203[_0xc087('0x31')],_0x271c88[_0xc087('0x33')]),_0x1b14a2);if(_0x263203[_0xc087('0x31')][_0xc087('0x3d')]){_0x439ccd['where']=_[_0xc087('0x3e')](_0x439ccd['where'],{'$or':_[_0xc087('0x2c')](_0x1b14a2,function(_0x478866){if(_0x478866['type']!==_0xc087('0x3f')){var _0x2d3c29={};_0x2d3c29[_0x478866[_0xc087('0x29')]]={'$like':'%'+_0x263203[_0xc087('0x31')][_0xc087('0x3d')]+'%'};return _0x2d3c29;}})});}_0x439ccd=_[_0xc087('0x3e')]({},_0x439ccd,_0x263203[_0xc087('0x40')]);var _0x47aa2b={'where':_0x439ccd[_0xc087('0x3b')]};return db[_0xc087('0x2d')][_0xc087('0x20')](_0x47aa2b)['then'](function(_0x37fe19){_0x145fed['count']=_0x37fe19;if(_0x263203[_0xc087('0x31')]['includeAll']){_0x439ccd[_0xc087('0x41')]=[{'all':!![]}];}return db[_0xc087('0x2d')][_0xc087('0x42')](_0x439ccd);})['then'](function(_0x1419fd){_0x145fed[_0xc087('0x43')]=_0x1419fd;return _0x145fed;})[_0xc087('0x26')](respondWithFilteredResult(_0x308f04,_0x439ccd))['catch'](handleError(_0x308f04,null));};exports[_0xc087('0x44')]=function(_0x226a2a,_0x5aca61){var _0x5384af={'raw':!![],'where':{'id':_0x226a2a[_0xc087('0x45')]['id']}},_0x95e9fe={};_0x95e9fe[_0xc087('0x34')]=_[_0xc087('0x32')](db['ChatGroup'][_0xc087('0x2e')]);_0x95e9fe[_0xc087('0x31')]=_[_0xc087('0x32')](_0x226a2a[_0xc087('0x31')]);_0x95e9fe[_0xc087('0x33')]=_[_0xc087('0x35')](_0x95e9fe[_0xc087('0x34')],_0x95e9fe[_0xc087('0x31')]);_0x5384af['attributes']=_['intersection'](_0x95e9fe[_0xc087('0x34')],qs[_0xc087('0x36')](_0x226a2a[_0xc087('0x31')][_0xc087('0x36')]));_0x5384af['attributes']=_0x5384af[_0xc087('0x37')]['length']?_0x5384af[_0xc087('0x37')]:_0x95e9fe['model'];if(_0x226a2a[_0xc087('0x31')][_0xc087('0x46')]){_0x5384af[_0xc087('0x41')]=[{'all':!![]}];}_0x5384af=_[_0xc087('0x3e')]({},_0x5384af,_0x226a2a[_0xc087('0x40')]);return db['ChatGroup'][_0xc087('0x47')](_0x5384af)[_0xc087('0x26')](handleEntityNotFound(_0x5aca61,null))['then'](respondWithResult(_0x5aca61,null))['catch'](handleError(_0x5aca61,null));};exports[_0xc087('0x48')]=function(_0x1fee02,_0x3b8870){return db[_0xc087('0x2d')]['create'](_0x1fee02['body'],{})[_0xc087('0x26')](respondWithResult(_0x3b8870,0xc9))[_0xc087('0x49')](handleError(_0x3b8870,null));};exports[_0xc087('0x24')]=function(_0x5c2aab,_0x5e441b){if(_0x5c2aab[_0xc087('0x4a')]['id']){delete _0x5c2aab[_0xc087('0x4a')]['id'];}return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0x5c2aab[_0xc087('0x45')]['id']}})[_0xc087('0x26')](handleEntityNotFound(_0x5e441b,null))['then'](saveUpdates(_0x5c2aab[_0xc087('0x4a')],null))[_0xc087('0x26')](respondWithResult(_0x5e441b,null))[_0xc087('0x49')](handleError(_0x5e441b,null));};exports[_0xc087('0x25')]=function(_0x3c212c,_0x468056){return db['ChatGroup'][_0xc087('0x47')]({'where':{'id':_0x3c212c['params']['id']}})['then'](handleEntityNotFound(_0x468056,null))[_0xc087('0x26')](removeEntity(_0x468056,null))[_0xc087('0x49')](handleError(_0x468056,null));};exports[_0xc087('0x4b')]=function(_0x4a1f1c,_0x1b995c){return db['ChatGroup'][_0xc087('0x4b')]()[_0xc087('0x26')](respondWithResult(_0x1b995c,null))[_0xc087('0x49')](handleError(_0x1b995c,null));};exports[_0xc087('0x4c')]=function(_0x56fb65,_0x32efda,_0x36c719){return db[_0xc087('0x4d')][_0xc087('0x20')]({'where':{'ChatGroupId':_0x56fb65['params']['id'],'ToId':_0x56fb65['user']['id'],'read':![]}})[_0xc087('0x26')](function(_0x562f29){return{'id':_[_0xc087('0x4e')](_0x56fb65[_0xc087('0x45')]['id']),'count':_0x562f29};})[_0xc087('0x26')](respondWithResult(_0x32efda,null))['catch'](handleError(_0x32efda,null));};exports[_0xc087('0x4f')]=function(_0x2bdbeb,_0x4235e6,_0x2c9382){return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0x2bdbeb[_0xc087('0x45')]['id']}})['then'](handleEntityNotFound(_0x4235e6,null))[_0xc087('0x26')](function(_0x532adb){if(_0x532adb){return _0x532adb[_0xc087('0x4f')](_0x2bdbeb['body']['ids'],_['omit'](_0x2bdbeb[_0xc087('0x4a')],[_0xc087('0x50'),'id'])||{});}})['then'](respondWithResult(_0x4235e6,null))['catch'](handleError(_0x4235e6,null));};exports[_0xc087('0x51')]=function(_0x260fb9,_0xbabc5c,_0x44eb30){var _0x56adf6={};var _0x226aee={};var _0x56a711;var _0x4cabdf;return db[_0xc087('0x2d')][_0xc087('0x52')]({'where':{'id':_0x260fb9['params']['id']}})[_0xc087('0x26')](handleEntityNotFound(_0xbabc5c,null))[_0xc087('0x26')](function(_0x293155){if(_0x293155){_0x56a711=_0x293155;_0x226aee[_0xc087('0x34')]=_[_0xc087('0x32')](db[_0xc087('0x53')][_0xc087('0x2e')]);_0x226aee[_0xc087('0x31')]=_['keys'](_0x260fb9['query']);_0x226aee[_0xc087('0x33')]=_[_0xc087('0x35')](_0x226aee[_0xc087('0x34')],_0x226aee['query']);_0x56adf6['attributes']=_[_0xc087('0x35')](_0x226aee['model'],qs['fields'](_0x260fb9[_0xc087('0x31')][_0xc087('0x36')]));_0x56adf6[_0xc087('0x37')]=_0x56adf6[_0xc087('0x37')][_0xc087('0x54')]?_0x56adf6['attributes']:_0x226aee[_0xc087('0x34')];_0x56adf6[_0xc087('0x55')]=qs[_0xc087('0x3a')](_0x260fb9['query'][_0xc087('0x3a')]);_0x56adf6[_0xc087('0x3b')]=qs['filters'](_[_0xc087('0x3c')](_0x260fb9[_0xc087('0x31')],_0x226aee[_0xc087('0x33')]));if(_0x260fb9[_0xc087('0x31')][_0xc087('0x3d')]){_0x56adf6[_0xc087('0x3b')]=_['merge'](_0x56adf6[_0xc087('0x3b')],{'$or':_[_0xc087('0x2c')](_0x56adf6[_0xc087('0x37')],function(_0x58d153){var _0x3ea7e2={};_0x3ea7e2[_0x58d153]={'$like':'%'+_0x260fb9[_0xc087('0x31')][_0xc087('0x3d')]+'%'};return _0x3ea7e2;})});}_0x56adf6=_['merge']({},_0x56adf6,_0x260fb9[_0xc087('0x40')]);return _0x56a711[_0xc087('0x51')](_0x56adf6);}})[_0xc087('0x26')](function(_0x526d20){if(_0x526d20){_0x4cabdf=_0x526d20[_0xc087('0x54')];if(!_0x260fb9['query']['hasOwnProperty']('nolimit')){_0x56adf6[_0xc087('0x1f')]=qs['limit'](_0x260fb9[_0xc087('0x31')][_0xc087('0x1f')]);_0x56adf6[_0xc087('0x1d')]=qs[_0xc087('0x1d')](_0x260fb9[_0xc087('0x31')][_0xc087('0x1d')]);}return _0x56a711[_0xc087('0x51')](_0x56adf6);}})[_0xc087('0x26')](function(_0x519121){if(_0x519121){return _0x519121?{'count':_0x4cabdf,'rows':_0x519121}:null;}})[_0xc087('0x26')](respondWithResult(_0xbabc5c,null))[_0xc087('0x49')](handleError(_0xbabc5c,null));};exports[_0xc087('0x56')]=function(_0x468eef,_0x1fe4fd,_0x3bedef){return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0x468eef[_0xc087('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fe4fd,null))[_0xc087('0x26')](function(_0x18ee35){if(_0x18ee35){return _0x18ee35[_0xc087('0x56')](_0x468eef[_0xc087('0x31')][_0xc087('0x50')]);}})[_0xc087('0x26')](respondWithStatusCode(_0x1fe4fd,null))['catch'](handleError(_0x1fe4fd,null));};exports[_0xc087('0x57')]=function(_0xfd6a63,_0x39d6ed,_0x4cc0e4){if(_0xfd6a63['body']['id']){delete _0xfd6a63['body']['id'];}return db[_0xc087('0x2d')][_0xc087('0x47')]({'where':{'id':_0xfd6a63['params']['id']}})['then'](handleEntityNotFound(_0x39d6ed,null))['then'](function(_0x2a1e0f){if(_0x2a1e0f){_0xfd6a63[_0xc087('0x4a')][_0xc087('0x58')]=_0x2a1e0f['id'];return db[_0xc087('0x4d')]['create'](_0xfd6a63[_0xc087('0x4a')]);}})[_0xc087('0x26')](respondWithResult(_0x39d6ed,null))['catch'](handleError(_0x39d6ed,null));};exports['getMessages']=function(_0x4da7c5,_0x102e91,_0x3cd597){var _0x1a101f={};var _0x1ed0fa={};var _0x445b84;var _0x54e604;return db[_0xc087('0x2d')][_0xc087('0x52')]({'where':{'id':_0x4da7c5['params']['id']}})[_0xc087('0x26')](handleEntityNotFound(_0x102e91,null))[_0xc087('0x26')](function(_0x2aa4fa){if(_0x2aa4fa){_0x445b84=_0x2aa4fa;_0x1ed0fa['model']=_[_0xc087('0x32')](db[_0xc087('0x4d')][_0xc087('0x2e')]);_0x1ed0fa['query']=_[_0xc087('0x32')](_0x4da7c5[_0xc087('0x31')]);_0x1ed0fa['filters']=_[_0xc087('0x35')](_0x1ed0fa[_0xc087('0x34')],_0x1ed0fa[_0xc087('0x31')]);_0x1a101f[_0xc087('0x37')]=_['intersection'](_0x1ed0fa[_0xc087('0x34')],qs['fields'](_0x4da7c5[_0xc087('0x31')][_0xc087('0x36')]));_0x1a101f['attributes']=_0x1a101f['attributes'][_0xc087('0x54')]?_0x1a101f[_0xc087('0x37')]:_0x1ed0fa['model'];_0x1a101f[_0xc087('0x55')]=qs['sort'](_0x4da7c5[_0xc087('0x31')][_0xc087('0x3a')]);_0x1a101f['where']=qs[_0xc087('0x33')](_[_0xc087('0x3c')](_0x4da7c5['query'],_0x1ed0fa[_0xc087('0x33')]));if(_0x4da7c5[_0xc087('0x31')]['filter']){_0x1a101f[_0xc087('0x3b')]=_[_0xc087('0x3e')](_0x1a101f['where'],{'$or':_['map'](_0x1a101f[_0xc087('0x37')],function(_0x101bb5){var _0x3353de={};_0x3353de[_0x101bb5]={'$like':'%'+_0x4da7c5['query'][_0xc087('0x3d')]+'%'};return _0x3353de;})});}if(_0x4da7c5['query'][_0xc087('0x59')]){var _0x44544c=_0x4da7c5[_0xc087('0x31')]['$gte'][_0xc087('0x5a')](',');var _0x3ae2f9={};_0x3ae2f9[_0x44544c[0x0]]={'$gte':moment(_0x44544c[0x1])[_0xc087('0x5b')](_0xc087('0x5c'))};_0x1a101f[_0xc087('0x3b')]=_['merge'](_0x1a101f[_0xc087('0x3b')],_0x3ae2f9);}_0x1a101f=_['merge']({},_0x1a101f,_0x4da7c5[_0xc087('0x40')]);return _0x445b84[_0xc087('0x5d')](_0x1a101f);}})[_0xc087('0x26')](function(_0x43ed53){if(_0x43ed53){_0x54e604=_0x43ed53['length'];if(!_0x4da7c5[_0xc087('0x31')][_0xc087('0x38')](_0xc087('0x39'))){_0x1a101f[_0xc087('0x1f')]=qs['limit'](_0x4da7c5[_0xc087('0x31')]['limit']);_0x1a101f[_0xc087('0x1d')]=qs[_0xc087('0x1d')](_0x4da7c5['query'][_0xc087('0x1d')]);}return _0x445b84[_0xc087('0x5d')](_0x1a101f);}})['then'](function(_0x296f59){if(_0x296f59){return _0x296f59?{'count':_0x54e604,'rows':_0x296f59}:null;}})[_0xc087('0x26')](respondWithResult(_0x102e91,null))[_0xc087('0x49')](handleError(_0x102e91,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 14ae127..ab679d3 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2837=['emit','hook','exports','events','../../mysqldb','ChatGroup','save','update'];(function(_0x5c9c0f,_0x36c608){var _0x180fe6=function(_0x414b28){while(--_0x414b28){_0x5c9c0f['push'](_0x5c9c0f['shift']());}};_0x180fe6(++_0x36c608);}(_0x2837,0x12b));var _0x7283=function(_0x19fb24,_0x4f4d0e){_0x19fb24=_0x19fb24-0x0;var _0x4021cd=_0x2837[_0x19fb24];return _0x4021cd;};'use strict';var EventEmitter=require(_0x7283('0x0'));var ChatGroup=require(_0x7283('0x1'))['db'][_0x7283('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7283('0x3'),'afterUpdate':_0x7283('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53f90e){return function(_0x40df2e,_0x3341f2,_0xdc68e3){ChatGroupEvents['emit'](_0x53f90e+':'+_0x40df2e['id'],_0x40df2e);ChatGroupEvents[_0x7283('0x5')](_0x53f90e,_0x40df2e);_0xdc68e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7283('0x6')](e,emitEvent(event));}}module[_0x7283('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe24e=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2f6858,_0x158b5e){var _0x233438=function(_0x4182df){while(--_0x4182df){_0x2f6858['push'](_0x2f6858['shift']());}};_0x233438(++_0x158b5e);}(_0xe24e,0x15f));var _0xee24=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xe24e[_0xcfeda9];return _0x4826c7;};'use strict';var EventEmitter=require(_0xee24('0x0'));var ChatGroup=require(_0xee24('0x1'))['db'][_0xee24('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xee24('0x3')](0x0);var events={'afterCreate':_0xee24('0x4'),'afterUpdate':_0xee24('0x5'),'afterDestroy':_0xee24('0x6')};function emitEvent(_0x4aaefd){return function(_0x451b0a,_0x5ce5fc,_0x57aace){ChatGroupEvents['emit'](_0x4aaefd+':'+_0x451b0a['id'],_0x451b0a);ChatGroupEvents[_0xee24('0x7')](_0x4aaefd,_0x451b0a);_0x57aace(null);};}for(var e in events){if(events[_0xee24('0x8')](e)){var event=events[e];ChatGroup[_0xee24('0x9')](e,emitEvent(event));}}module[_0xee24('0xa')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 4f00ead..454b2b2 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa952=['chat_groups','lodash','util','moment','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xa952,0x9b));var _0x2a95=function(_0x16d36c,_0x2cb0f6){_0x16d36c=_0x16d36c-0x0;var _0x33a4f1=_0xa952[_0x16d36c];return _0x33a4f1;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2a95('0x2'));var BPromise=require('bluebird');var rp=require(_0x2a95('0x3'));var fs=require('fs');var path=require(_0x2a95('0x4'));var rimraf=require('rimraf');var config=require(_0x2a95('0x5'));var attributes=require(_0x2a95('0x6'));module[_0x2a95('0x7')]=function(_0x302732,_0x41e0b2){return _0x302732[_0x2a95('0x8')](_0x2a95('0x9'),attributes,{'tableName':_0x2a95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xacef=['chat_groups','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x5105e8,_0x44a2e0){var _0x53bbf5=function(_0x29dfb8){while(--_0x29dfb8){_0x5105e8['push'](_0x5105e8['shift']());}};_0x53bbf5(++_0x44a2e0);}(_0xacef,0x199));var _0xface=function(_0x16257d,_0x4310f5){_0x16257d=_0x16257d-0x0;var _0x3350e8=_0xacef[_0x16257d];return _0x3350e8;};'use strict';var _=require(_0xface('0x0'));var util=require(_0xface('0x1'));var logger=require(_0xface('0x2'))('api');var moment=require(_0xface('0x3'));var BPromise=require('bluebird');var rp=require(_0xface('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xface('0x5'));var config=require(_0xface('0x6'));var attributes=require(_0xface('0x7'));module[_0xface('0x8')]=function(_0x4ad67c,_0x347d80){return _0x4ad67c[_0xface('0x9')](_0xface('0xa'),attributes,{'tableName':_0xface('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index 3f7c107..7eb75ad 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xccc9=['then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x1a1d5a,_0x3d1246){var _0x2e578b=function(_0x18f06b){while(--_0x18f06b){_0x1a1d5a['push'](_0x1a1d5a['shift']());}};_0x2e578b(++_0x3d1246);}(_0xccc9,0xf4));var _0x9ccc=function(_0x13948e,_0x3bfc5b){_0x13948e=_0x13948e-0x0;var _0x325561=_0xccc9[_0x13948e];return _0x325561;};'use strict';var _=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var moment=require(_0x9ccc('0x2'));var BPromise=require(_0x9ccc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ccc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ccc('0x5'));var logger=require('../../config/logger')(_0x9ccc('0x6'));var config=require('../../config/environment');var jayson=require(_0x9ccc('0x7'));var client=jayson[_0x9ccc('0x8')][_0x9ccc('0x9')]({'port':0x232a});config[_0x9ccc('0xa')]=_[_0x9ccc('0xb')](config[_0x9ccc('0xa')],{'host':_0x9ccc('0xc'),'port':0x18eb});var socket=require(_0x9ccc('0xd'))(new Redis(config[_0x9ccc('0xa')]));require(_0x9ccc('0xe'))[_0x9ccc('0xf')](socket);function respondWithRpcPromise(_0x256882,_0x5e1fad,_0x14f681){return new BPromise(function(_0x31b622,_0x264673){return client[_0x9ccc('0x10')](_0x256882,_0x14f681)[_0x9ccc('0x11')](function(_0x3ce6d6){logger[_0x9ccc('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5e1fad,'request\x20sent');logger[_0x9ccc('0x13')](_0x9ccc('0x14'),_0x5e1fad,_0x9ccc('0x15'),JSON[_0x9ccc('0x16')](_0x3ce6d6));if(_0x3ce6d6[_0x9ccc('0x17')]){if(_0x3ce6d6[_0x9ccc('0x17')][_0x9ccc('0x18')]===0x1f4){logger[_0x9ccc('0x17')](_0x9ccc('0x19'),_0x5e1fad,_0x3ce6d6[_0x9ccc('0x17')][_0x9ccc('0x1a')]);return _0x264673(_0x3ce6d6[_0x9ccc('0x17')]['message']);}logger[_0x9ccc('0x17')](_0x9ccc('0x19'),_0x5e1fad,_0x3ce6d6[_0x9ccc('0x17')][_0x9ccc('0x1a')]);return _0x31b622(_0x3ce6d6[_0x9ccc('0x17')]['message']);}else{logger[_0x9ccc('0x12')](_0x9ccc('0x19'),_0x5e1fad,_0x9ccc('0x15'));_0x31b622(_0x3ce6d6[_0x9ccc('0x1b')][_0x9ccc('0x1a')]);}})[_0x9ccc('0x1c')](function(_0x500b50){logger[_0x9ccc('0x17')](_0x9ccc('0x19'),_0x5e1fad,_0x500b50);_0x264673(_0x500b50);});});}
\ No newline at end of file
+var _0xdf71=['redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x26afa8,_0x14be89){var _0x7a1195=function(_0x21a65b){while(--_0x21a65b){_0x26afa8['push'](_0x26afa8['shift']());}};_0x7a1195(++_0x14be89);}(_0xdf71,0x1d2));var _0x1df7=function(_0x205ce0,_0x3d16e7){_0x205ce0=_0x205ce0-0x0;var _0x138ae7=_0xdf71[_0x205ce0];return _0x138ae7;};'use strict';var _=require(_0x1df7('0x0'));var util=require('util');var moment=require(_0x1df7('0x1'));var BPromise=require(_0x1df7('0x2'));var rs=require(_0x1df7('0x3'));var fs=require('fs');var Redis=require(_0x1df7('0x4'));var db=require(_0x1df7('0x5'))['db'];var utils=require(_0x1df7('0x6'));var logger=require(_0x1df7('0x7'))('rpc');var config=require(_0x1df7('0x8'));var jayson=require(_0x1df7('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x1df7('0xa')]=_[_0x1df7('0xb')](config['redis'],{'host':_0x1df7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1df7('0xa')]));require(_0x1df7('0xd'))[_0x1df7('0xe')](socket);function respondWithRpcPromise(_0x319511,_0x589400,_0x3bc01a){return new BPromise(function(_0x3e44fd,_0x28585a){return client[_0x1df7('0xf')](_0x319511,_0x3bc01a)[_0x1df7('0x10')](function(_0x1a9882){logger['info'](_0x1df7('0x11'),_0x589400,'request\x20sent');logger[_0x1df7('0x12')](_0x1df7('0x13'),_0x589400,_0x1df7('0x14'),JSON[_0x1df7('0x15')](_0x1a9882));if(_0x1a9882[_0x1df7('0x16')]){if(_0x1a9882['error'][_0x1df7('0x17')]===0x1f4){logger[_0x1df7('0x16')](_0x1df7('0x11'),_0x589400,_0x1a9882['error']['message']);return _0x28585a(_0x1a9882[_0x1df7('0x16')]['message']);}logger[_0x1df7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x1a9882[_0x1df7('0x16')][_0x1df7('0x18')]);return _0x3e44fd(_0x1a9882[_0x1df7('0x16')][_0x1df7('0x18')]);}else{logger[_0x1df7('0x19')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x1df7('0x14'));_0x3e44fd(_0x1a9882[_0x1df7('0x1a')][_0x1df7('0x18')]);}})[_0x1df7('0x1b')](function(_0x5af91){logger[_0x1df7('0x16')]('ChatGroup,\x20%s,\x20%s',_0x589400,_0x5af91);_0x28585a(_0x5af91);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 3f2c71e..e986f94 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd418=['chatGroup:','./chatGroup.events','save','update','removeListener','register','length'];(function(_0x1cfc39,_0x1d3913){var _0x957a28=function(_0x2be930){while(--_0x2be930){_0x1cfc39['push'](_0x1cfc39['shift']());}};_0x957a28(++_0x1d3913);}(_0xd418,0x14a));var _0x8d41=function(_0x29bf8d,_0x43aeee){_0x29bf8d=_0x29bf8d-0x0;var _0x497583=_0xd418[_0x29bf8d];return _0x497583;};'use strict';var ChatGroupEvents=require(_0x8d41('0x0'));var events=[_0x8d41('0x1'),'remove',_0x8d41('0x2')];function createListener(_0x5e5fbb,_0x38dbd8){return function(_0x2327b6){_0x38dbd8['emit'](_0x5e5fbb,_0x2327b6);};}function removeListener(_0x381142,_0x460cfb){return function(){ChatGroupEvents[_0x8d41('0x3')](_0x381142,_0x460cfb);};}exports[_0x8d41('0x4')]=function(_0x366a4a){for(var _0x4aa2b6=0x0,_0x5bc9d2=events[_0x8d41('0x5')];_0x4aa2b6<_0x5bc9d2;_0x4aa2b6++){var _0x3ef06c=events[_0x4aa2b6];var _0x1af172=createListener(_0x8d41('0x6')+_0x3ef06c,_0x366a4a);ChatGroupEvents['on'](_0x3ef06c,_0x1af172);}};
\ No newline at end of file
+var _0x6c0b=['./chatGroup.events','save','remove','update','removeListener','length','chatGroup:'];(function(_0x3e2f4a,_0x4aa7d9){var _0x15ca76=function(_0x5e2dea){while(--_0x5e2dea){_0x3e2f4a['push'](_0x3e2f4a['shift']());}};_0x15ca76(++_0x4aa7d9);}(_0x6c0b,0x142));var _0xb6c0=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x6c0b[_0x1e3671];return _0x48d5f5;};'use strict';var ChatGroupEvents=require(_0xb6c0('0x0'));var events=[_0xb6c0('0x1'),_0xb6c0('0x2'),_0xb6c0('0x3')];function createListener(_0x4c889c,_0x161758){return function(_0x35e5b7){_0x161758['emit'](_0x4c889c,_0x35e5b7);};}function removeListener(_0xc3574,_0x139475){return function(){ChatGroupEvents[_0xb6c0('0x4')](_0xc3574,_0x139475);};}exports['register']=function(_0x50870f){for(var _0x1544f0=0x0,_0x444434=events[_0xb6c0('0x5')];_0x1544f0<_0x444434;_0x1544f0++){var _0x46898f=events[_0x1544f0];var _0x5a7c70=createListener(_0xb6c0('0x6')+_0x46898f,_0x50870f);ChatGroupEvents['on'](_0x46898f,_0x5a7c70);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index ca22250..38f0260 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe77d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','put','update','delete','destroy','removeMembers','exports','multer','util'];(function(_0x33ee4b,_0x559654){var _0x1f9511=function(_0x914b5c){while(--_0x914b5c){_0x33ee4b['push'](_0x33ee4b['shift']());}};_0x1f9511(++_0x559654);}(_0xe77d,0x1b1));var _0xde77=function(_0x43c05b,_0x5bd7c6){_0x43c05b=_0x43c05b-0x0;var _0x235a74=_0xe77d[_0x43c05b];return _0x235a74;};'use strict';var multer=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var path=require(_0xde77('0x2'));var timeout=require(_0xde77('0x3'));var express=require(_0xde77('0x4'));var router=express[_0xde77('0x5')]();var fs_extra=require(_0xde77('0x6'));var auth=require(_0xde77('0x7'));var interaction=require(_0xde77('0x8'));var config=require('../../config/environment');var controller=require(_0xde77('0x9'));router[_0xde77('0xa')]('/',auth[_0xde77('0xb')](),controller['index']);router['get'](_0xde77('0xc'),auth[_0xde77('0xb')](),controller[_0xde77('0xd')]);router[_0xde77('0xa')](_0xde77('0xe'),auth[_0xde77('0xb')](),controller[_0xde77('0xf')]);router[_0xde77('0xa')](_0xde77('0x10'),auth['isAuthenticated'](),controller[_0xde77('0x11')]);router[_0xde77('0xa')](_0xde77('0x12'),auth[_0xde77('0xb')](),controller[_0xde77('0x13')]);router['get'](_0xde77('0x14'),auth[_0xde77('0xb')](),controller[_0xde77('0x15')]);router[_0xde77('0x16')]('/',auth[_0xde77('0xb')](),controller['create']);router[_0xde77('0x16')]('/:id/members',auth[_0xde77('0xb')](),controller['addMembers']);router[_0xde77('0x16')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0xde77('0x17')](_0xde77('0xe'),auth[_0xde77('0xb')](),controller[_0xde77('0x18')]);router[_0xde77('0x19')](_0xde77('0xe'),auth[_0xde77('0xb')](),controller[_0xde77('0x1a')]);router[_0xde77('0x19')](_0xde77('0x12'),auth[_0xde77('0xb')](),controller[_0xde77('0x1b')]);module[_0xde77('0x1c')]=router;
\ No newline at end of file
+var _0x127e=['put','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMessages','create','addMembers','addMessage'];(function(_0x483716,_0x69ee28){var _0x259fc6=function(_0x1ea0db){while(--_0x1ea0db){_0x483716['push'](_0x483716['shift']());}};_0x259fc6(++_0x69ee28);}(_0x127e,0x12f));var _0xe127=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x127e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe127('0x0'));var util=require(_0xe127('0x1'));var path=require(_0xe127('0x2'));var timeout=require(_0xe127('0x3'));var express=require('express');var router=express[_0xe127('0x4')]();var fs_extra=require(_0xe127('0x5'));var auth=require(_0xe127('0x6'));var interaction=require(_0xe127('0x7'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xe127('0x8')]('/',auth['isAuthenticated'](),controller[_0xe127('0x9')]);router[_0xe127('0x8')]('/describe',auth[_0xe127('0xa')](),controller[_0xe127('0xb')]);router[_0xe127('0x8')](_0xe127('0xc'),auth[_0xe127('0xa')](),controller[_0xe127('0xd')]);router[_0xe127('0x8')](_0xe127('0xe'),auth[_0xe127('0xa')](),controller[_0xe127('0xf')]);router[_0xe127('0x8')](_0xe127('0x10'),auth['isAuthenticated'](),controller['getMembers']);router['get']('/:id/messages',auth[_0xe127('0xa')](),controller[_0xe127('0x11')]);router['post']('/',auth[_0xe127('0xa')](),controller[_0xe127('0x12')]);router['post']('/:id/members',auth[_0xe127('0xa')](),controller[_0xe127('0x13')]);router['post']('/:id/messages',auth[_0xe127('0xa')](),controller[_0xe127('0x14')]);router[_0xe127('0x15')]('/:id',auth[_0xe127('0xa')](),controller[_0xe127('0x16')]);router[_0xe127('0x17')](_0xe127('0xc'),auth[_0xe127('0xa')](),controller[_0xe127('0x18')]);router[_0xe127('0x17')](_0xe127('0x10'),auth[_0xe127('0xa')](),controller[_0xe127('0x19')]);module[_0xe127('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index c8624fa..b32e459 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3750=['thumb','star','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x2a3e9e,_0xbe6590){var _0x53ca15=function(_0x2a5e2f){while(--_0x2a5e2f){_0x2a3e9e['push'](_0x2a3e9e['shift']());}};_0x53ca15(++_0xbe6590);}(_0x3750,0xbb));var _0x0375=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x3750[_0x3a0c4f];return _0x247049;};'use strict';var Sequelize=require(_0x0375('0x0'));module[_0x0375('0x1')]={'closed':{'type':Sequelize[_0x0375('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x0375('0x3')]},'ratingType':{'type':Sequelize[_0x0375('0x4')]('star',_0x0375('0x5')),'defaultValue':_0x0375('0x6')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x0375('0x7')]},'mailTranscript':{'type':Sequelize[_0x0375('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x0375('0x9')]},'disposition':{'type':Sequelize[_0x0375('0x8')]},'secondDisposition':{'type':Sequelize[_0x0375('0x8')]},'thirdDisposition':{'type':Sequelize[_0x0375('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x0375('0x8')]},'browserVersion':{'type':Sequelize[_0x0375('0x8')]},'osName':{'type':Sequelize[_0x0375('0x8')]},'osVersion':{'type':Sequelize[_0x0375('0x8')]},'deviceModel':{'type':Sequelize[_0x0375('0x8')]},'deviceVendor':{'type':Sequelize[_0x0375('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x0375('0x7')]},'customerIp':{'type':Sequelize[_0x0375('0x8')]},'formData':{'type':Sequelize[_0x0375('0x7')](_0x0375('0xa'))},'read1stAt':{'type':Sequelize[_0x0375('0x9')]},'lastMsgAt':{'type':Sequelize[_0x0375('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x0375('0x4')]('in',_0x0375('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x0375('0x8')]},'customerPort':{'type':Sequelize[_0x0375('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x0375('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x0375('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb9be=['INTEGER','ENUM','star','thumb','TEXT','DATE','STRING','sequelize','exports','BOOLEAN'];(function(_0x728644,_0x237ab7){var _0x5f11e3=function(_0x3fed1f){while(--_0x3fed1f){_0x728644['push'](_0x728644['shift']());}};_0x5f11e3(++_0x237ab7);}(_0xb9be,0xc5));var _0xeb9b=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0xb9be[_0x340380];return _0x49ce1c;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'closed':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb9b('0x3')]},'ratingType':{'type':Sequelize[_0xeb9b('0x4')](_0xeb9b('0x5'),_0xeb9b('0x6')),'defaultValue':_0xeb9b('0x5')},'ratingMessage':{'type':Sequelize[_0xeb9b('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeb9b('0x8')]},'disposition':{'type':Sequelize[_0xeb9b('0x9')]},'secondDisposition':{'type':Sequelize[_0xeb9b('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xeb9b('0x9')]},'browserName':{'type':Sequelize[_0xeb9b('0x9')]},'browserVersion':{'type':Sequelize[_0xeb9b('0x9')]},'osName':{'type':Sequelize[_0xeb9b('0x9')]},'osVersion':{'type':Sequelize[_0xeb9b('0x9')]},'deviceModel':{'type':Sequelize[_0xeb9b('0x9')]},'deviceVendor':{'type':Sequelize[_0xeb9b('0x9')]},'deviceType':{'type':Sequelize[_0xeb9b('0x9')]},'referer':{'type':Sequelize[_0xeb9b('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeb9b('0x7')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xeb9b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeb9b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb9b('0x9')]},'customerPort':{'type':Sequelize[_0xeb9b('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xeb9b('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xeb9b('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 7aba505..22f52c2 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4509=['account','map','ChatInteraction','fieldName','type','getOptions','chat','query','user','show','params','rawAttributes','keys','filters','intersection','model','fields','attributes','length','include','merge','find','create','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','email','POST','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','server/files/attachments/','join','download','close','mailTranscript','format','transcript-%s.txt','now','ChatMessage','Messages','User','ChatWebsite','%s%d','agentAlias','System','customer','Visitor','ContactId','agentIdentifier','website_alias','alias','agent_fullname','fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','getMessages','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','options','includeAll','findAll','rows','getMyMessages','hasOwnProperty','order','includeAgent','push','addTags','setTags','ids','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','lastName','read','Account','Owner','get','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','Chat','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','destroy','end','stack','name','send','render','body','contact','agent'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x4509,0x173));var _0x9450=function(_0xedb4ff,_0x54430b){_0xedb4ff=_0xedb4ff-0x0;var _0x1956b4=_0x4509[_0xedb4ff];return _0x1956b4;};'use strict';var rimraf=require(_0x9450('0x0'));var zipdir=require(_0x9450('0x1'));var rp=require(_0x9450('0x2'));var moment=require(_0x9450('0x3'));var BPromise=require(_0x9450('0x4'));var Mustache=require(_0x9450('0x5'));var util=require(_0x9450('0x6'));var path=require(_0x9450('0x7'));var ejs=require(_0x9450('0x8'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x9450('0x9'));var interaction=require(_0x9450('0xa'));var qs=require(_0x9450('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x9450('0xc'))(_0x9450('0xd'));var config=require(_0x9450('0xe'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x9450('0xf')](config[_0x9450('0x10')],{'host':_0x9450('0x11'),'port':0x18eb});var socket=require(_0x9450('0x12'))(new Redis(config[_0x9450('0x10')]));require('./chatInteraction.socket')[_0x9450('0x13')](socket);var jayson=require(_0x9450('0x14'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson[_0x9450('0x15')][_0x9450('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x1d2af4,_0x576b8d,_0xdf58ce,_0x5cf091){return new BPromise(function(_0x5a221f,_0x3ca086){var _0x468ce0=_0x5cf091||client;return _0x468ce0[_0x9450('0x17')](_0x1d2af4,_0xdf58ce)[_0x9450('0x18')](function(_0x943a81){logger[_0x9450('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x576b8d,_0x9450('0x1a'));logger[_0x9450('0x1b')](_0x9450('0x1c'),_0x576b8d,_0x9450('0x1a'),JSON[_0x9450('0x1d')](_0x943a81));if(_0x943a81[_0x9450('0x1e')]){if(_0x943a81[_0x9450('0x1e')]['code']===0x1f4){logger[_0x9450('0x1e')](_0x9450('0x1f'),_0x576b8d,_0x943a81[_0x9450('0x1e')]['message']);return _0x3ca086(_0x943a81[_0x9450('0x1e')]['message']);}logger[_0x9450('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x576b8d,_0x943a81[_0x9450('0x1e')][_0x9450('0x20')]);return _0x5a221f(_0x943a81[_0x9450('0x1e')][_0x9450('0x20')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x576b8d,'request\x20sent');_0x5a221f(_0x943a81[_0x9450('0x21')][_0x9450('0x20')]);}})[_0x9450('0x22')](function(_0x1f4992){logger['error'](_0x9450('0x1f'),_0x576b8d,_0x1f4992);_0x3ca086(_0x1f4992);});});}function respondWithStatusCode(_0x5c8e17,_0x54612b){_0x54612b=_0x54612b||0xcc;return function(_0x4a7313){if(_0x4a7313){return _0x5c8e17[_0x9450('0x23')](_0x54612b);}return _0x5c8e17[_0x9450('0x24')](_0x54612b)['end']();};}function respondWithResult(_0x567564,_0x4b8eec){_0x4b8eec=_0x4b8eec||0xc8;return function(_0x3906d6){if(_0x3906d6){return _0x567564['status'](_0x4b8eec)[_0x9450('0x25')](_0x3906d6);}};}function respondWithFilteredResult(_0x24082d,_0x5d3b33){return function(_0x153c21){if(_0x153c21){var _0x7613c1=typeof _0x5d3b33['offset']===_0x9450('0x26')&&typeof _0x5d3b33['limit']==='undefined';var _0x36dcd2=_0x153c21['count'];var _0xf7f019=_0x7613c1?0x0:_0x5d3b33[_0x9450('0x27')];var _0x45b261=_0x7613c1?_0x153c21[_0x9450('0x28')]:_0x5d3b33['offset']+_0x5d3b33[_0x9450('0x29')];var _0xf7ff84;if(_0x45b261>=_0x36dcd2){_0x45b261=_0x36dcd2;_0xf7ff84=0xc8;}else{_0xf7ff84=0xce;}_0x24082d['status'](_0xf7ff84);return _0x24082d[_0x9450('0x2a')](_0x9450('0x2b'),_0xf7f019+'-'+_0x45b261+'/'+_0x36dcd2)[_0x9450('0x25')](_0x153c21);}return null;};}function saveUpdates(_0x51ecf9){return function(_0x3c4e07){if(_0x3c4e07){return _0x3c4e07['update'](_0x51ecf9)[_0x9450('0x18')](function(_0x212ed4){return _0x212ed4;});}return null;};}function removeEntity(_0x546482){return function(_0x4a90e3){if(_0x4a90e3){return _0x4a90e3[_0x9450('0x2c')]()[_0x9450('0x18')](function(){_0x546482[_0x9450('0x24')](0xcc)[_0x9450('0x2d')]();});}};}function handleEntityNotFound(_0x253067){return function(_0x5ba6b6){if(!_0x5ba6b6){_0x253067['sendStatus'](0x194);}return _0x5ba6b6;};}function handleError(_0x34b535,_0xd00a1c){_0xd00a1c=_0xd00a1c||0x1f4;return function(_0x39469d){logger[_0x9450('0x1e')](_0x39469d[_0x9450('0x2e')]);if(_0x39469d['name']){delete _0x39469d[_0x9450('0x2f')];}_0x34b535['status'](_0xd00a1c)[_0x9450('0x30')](_0x39469d);};}function getMustacheRender(_0x4a3cdc,_0x16d66e){return Mustache[_0x9450('0x31')](_0x4a3cdc,_['merge'](_0x16d66e[_0x9450('0x32')],{'contact':_0x16d66e[_0x9450('0x33')],'message':_0x16d66e['message'],'agent':_0x16d66e[_0x9450('0x34')],'interaction':_0x16d66e['interaction'],'account':_0x16d66e[_0x9450('0x35')]}))||'';}exports['index']=function(_0x2065b9,_0x1a3ece){var _0x8cacfd={};var _0x296c4b=_[_0x9450('0x36')](db[_0x9450('0x37')]['rawAttributes'],function(_0x476014){return{'name':_0x476014[_0x9450('0x38')],'type':_0x476014[_0x9450('0x39')]['key']};});_0x8cacfd=qs[_0x9450('0x3a')](_0x296c4b,_0x2065b9);return interaction['findAll'](_0x9450('0x3b'),_0x2065b9[_0x9450('0x3c')],_0x2065b9[_0x9450('0x3d')],_0x8cacfd,_0x296c4b)[_0x9450('0x18')](respondWithFilteredResult(_0x1a3ece,_0x8cacfd))[_0x9450('0x22')](handleError(_0x1a3ece,null));};exports[_0x9450('0x3e')]=function(_0x1286a0,_0x2b636b){var _0x35a496={'raw':![],'where':{'id':_0x1286a0[_0x9450('0x3f')]['id']}},_0x8a494a={};_0x8a494a['model']=_['keys'](db[_0x9450('0x37')][_0x9450('0x40')]);_0x8a494a[_0x9450('0x3c')]=_[_0x9450('0x41')](_0x1286a0[_0x9450('0x3c')]);_0x8a494a[_0x9450('0x42')]=_[_0x9450('0x43')](_0x8a494a[_0x9450('0x44')],_0x8a494a[_0x9450('0x3c')]);_0x35a496['attributes']=_['intersection'](_0x8a494a[_0x9450('0x44')],qs[_0x9450('0x45')](_0x1286a0[_0x9450('0x3c')][_0x9450('0x45')]));_0x35a496[_0x9450('0x46')]=_0x35a496[_0x9450('0x46')][_0x9450('0x47')]?_0x35a496[_0x9450('0x46')]:_0x8a494a[_0x9450('0x44')];if(_0x1286a0[_0x9450('0x3c')]['includeAll']){_0x35a496[_0x9450('0x48')]=[{'all':!![]}];}_0x35a496=_[_0x9450('0x49')]({},_0x35a496,_0x1286a0['options']);return db[_0x9450('0x37')][_0x9450('0x4a')](_0x35a496)['then'](handleEntityNotFound(_0x2b636b,null))[_0x9450('0x18')](respondWithResult(_0x2b636b,null))['catch'](handleError(_0x2b636b,null));};exports[_0x9450('0x4b')]=function(_0x3d6085,_0x5a35d0){return db[_0x9450('0x37')][_0x9450('0x4b')](_0x3d6085[_0x9450('0x32')],{})[_0x9450('0x18')](respondWithResult(_0x5a35d0,0xc9))['catch'](handleError(_0x5a35d0,null));};exports['update']=function(_0x5ab9ff,_0x302f25){if(_0x5ab9ff[_0x9450('0x32')]['id']){delete _0x5ab9ff[_0x9450('0x32')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5ab9ff[_0x9450('0x3f')]['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x302f25,null))['then'](saveUpdates(_0x5ab9ff[_0x9450('0x32')],null))['then'](respondWithResult(_0x302f25,null))[_0x9450('0x22')](handleError(_0x302f25,null));};exports[_0x9450('0x2c')]=function(_0x327475,_0x2a1359){return db[_0x9450('0x37')]['find']({'where':{'id':_0x327475['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x2a1359,null))[_0x9450('0x18')](removeEntity(_0x2a1359,null))[_0x9450('0x22')](handleError(_0x2a1359,null));};exports['describe']=function(_0x410841,_0x5d9832){return db[_0x9450('0x37')][_0x9450('0x4c')]()[_0x9450('0x18')](respondWithResult(_0x5d9832,null))[_0x9450('0x22')](handleError(_0x5d9832,null));};exports[_0x9450('0x4d')]=function(_0x338a95,_0x129408){var _0x1bd76d=_0x338a95[_0x9450('0x3f')]['id'];var _0x49a9d0;var _0x13dfa9;var _0x54af33;return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x1bd76d}})[_0x9450('0x18')](function(_0x4d623e){_0x49a9d0=_0x4d623e;return db['ChatWebsite'][_0x9450('0x4e')]({'where':{'id':_0x4d623e[_0x9450('0x4f')]},'attributes':['id','vidaooApiKey',_0x9450('0x50'),_0x9450('0x51'),_0x9450('0x52'),_0x9450('0x53')],'raw':!![]});})[_0x9450('0x18')](function(_0x40665a){if(_0x40665a&&_0x40665a[_0x9450('0x54')]&&_0x40665a['vidaooEscalation']){_0x13dfa9=_0x40665a;var _0x42b95c={'interaction':{'id':_0x1bd76d},'agent':{'id':_0x338a95[_0x9450('0x3d')]['id'],'name':_0x338a95[_0x9450('0x3d')][_0x9450('0x2f')],'fullname':_0x338a95[_0x9450('0x3d')]['fullname'],'email':_0x338a95[_0x9450('0x3d')][_0x9450('0x55')]},'contact':_0x338a95[_0x9450('0x32')]['contact'],'account':_0x338a95[_0x9450('0x32')][_0x9450('0x35')]};var _0x438ba4={'rejectUnauthorized':![],'method':_0x9450('0x56'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x40665a[_0x9450('0x54')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x338a95[_0x9450('0x3d')][_0x9450('0x55')]],'buttons':null,'topic':_0x13dfa9[_0x9450('0x51')],'note':_[_0x9450('0x57')](_0x13dfa9[_0x9450('0x52')])?null:getMustacheRender(_0x13dfa9[_0x9450('0x52')],_0x42b95c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x9450('0x57')](_0x13dfa9['vidaooMetadata'])){var _0xe1ec57=getMustacheRender(_0x13dfa9[_0x9450('0x53')],_0x42b95c);var _0x20e893=JSON[_0x9450('0x58')](_0xe1ec57);_0x438ba4[_0x9450('0x32')][_0x9450('0x59')]=_0x20e893;}}catch(_0x21e98f){throw new db[(_0x9450('0x5a'))][(_0x9450('0x5b'))](_0x9450('0x5c'));}return rp(_0x438ba4);}else{throw new db[(_0x9450('0x5a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x9450('0x18')](function(_0x1550f6){_0x54af33=_0x1550f6;if(_0x54af33['id']){var _0x5ed908={'body':_0x54af33[_0x9450('0x5d')],'ChatWebsiteId':_0x13dfa9['id'],'ChatInteractionId':_0x49a9d0['id'],'direction':_0x9450('0x5e'),'UserId':_0x338a95[_0x9450('0x3d')]['id']};return db['ChatMessage'][_0x9450('0x4b')](_0x5ed908,{});}else{throw new db[(_0x9450('0x5a'))]['ValidationError'](_0x9450('0x5f'));}})[_0x9450('0x18')](function(){return _0x49a9d0[_0x9450('0x60')]({'vidaooSessionId':_0x54af33['id']});})[_0x9450('0x18')](respondWithResult(_0x129408,null))['catch'](handleError(_0x129408,null));};exports[_0x9450('0x61')]=function(_0xe3d43e,_0x241d81){if(_0xe3d43e[_0x9450('0x32')]['id']){delete _0xe3d43e[_0x9450('0x32')]['id'];}return db['ChatInteraction'][_0x9450('0x4a')]({'where':{'id':_0xe3d43e[_0x9450('0x3f')]['id']},'include':[{'model':db[_0x9450('0x62')],'as':_0x9450('0x63')}]})[_0x9450('0x18')](handleEntityNotFound(_0x241d81,null))[_0x9450('0x18')](saveUpdates(_0xe3d43e[_0x9450('0x32')],null))[_0x9450('0x18')](respondWithResult(_0x241d81,null))[_0x9450('0x22')](handleError(_0x241d81,null));};exports[_0x9450('0x64')]=function(_0x56fcd1,_0x448c24){if(_0x56fcd1[_0x9450('0x32')]['id']){delete _0x56fcd1[_0x9450('0x32')]['id'];}return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x56fcd1[_0x9450('0x3f')]['id']}})[_0x9450('0x18')](function(_0x492d71){if(!_0x492d71){logger[_0x9450('0x1e')](_0x9450('0x65'),_0x9450('0x64'),0x194,_0x9450('0x66'));_0x448c24[_0x9450('0x23')](0x194);}else{if(_0x492d71[_0x9450('0x67')]){throw new db[(_0x9450('0x5a'))][(_0x9450('0x5b'))](_0x9450('0x68'));}}return _0x492d71;})[_0x9450('0x18')](function(_0x4c6685){if(_0x4c6685){return _0x4c6685['update']({'closed':_0x56fcd1[_0x9450('0x32')][_0x9450('0x69')],'disposition':_0x56fcd1[_0x9450('0x32')][_0x9450('0x6a')]})['then'](function(_0xb6112f){return _0xb6112f;});}})[_0x9450('0x18')](function(){return respondWithRpcPromise(_0x9450('0x6b'),_0x9450('0x64'),_0x56fcd1[_0x9450('0x32')],client9004);})[_0x9450('0x18')](respondWithResult(_0x448c24,null))['catch'](handleError(_0x448c24,null));};exports[_0x9450('0x6c')]=function(_0x379a1d,_0x2409ec){_0x379a1d[_0x9450('0x32')]['name']=_0x379a1d[_0x9450('0x6d')]['originalname'];_0x379a1d[_0x9450('0x32')][_0x9450('0x6e')]=_0x379a1d[_0x9450('0x6d')][_0x9450('0x6f')];_0x379a1d[_0x9450('0x32')]['type']=_0x379a1d[_0x9450('0x6d')][_0x9450('0x70')];return db[_0x9450('0x71')][_0x9450('0x4b')](_0x379a1d[_0x9450('0x32')])[_0x9450('0x18')](respondWithResult(_0x2409ec,0xc9))['catch'](handleError(_0x2409ec,null));};exports[_0x9450('0x72')]=function(_0x52d4b8,_0x2a2784){return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x52d4b8[_0x9450('0x3f')]['id']},'raw':!![]})[_0x9450('0x18')](handleEntityNotFound(_0x2a2784,null))['then'](function(_0x3471c8){if(_0x3471c8){if(_0x3471c8[_0x9450('0x69')]){return _0x2a2784[_0x9450('0x24')](0x193)[_0x9450('0x25')]({'status':0x193,'message':_0x9450('0x73')});}return db[_0x9450('0x71')][_0x9450('0x4e')]({'where':{'id':_0x52d4b8[_0x9450('0x3c')]['attachId']},'raw':!![]})[_0x9450('0x18')](handleEntityNotFound(_0x2a2784,null));}})['then'](function(_0x5c7996){if(_0x5c7996){var _0xcd1201=_0x5c7996[_0x9450('0x74')]!==null;var _0x485968=path['join'](config[_0x9450('0x75')],_0x9450('0x76'));if(_0xcd1201){_0x485968=path[_0x9450('0x77')](_0x485968,'offline-chat/');}var _0x11ac39=path['join'](_0x485968,_0x5c7996[_0x9450('0x6e')]);return _0x2a2784[_0x9450('0x78')](_0x11ac39);}})[_0x9450('0x22')](handleError(_0x2a2784,null));};exports[_0x9450('0x79')]=function(_0x2590f4,_0x3dcf9e){var _0x3d0eaa=null;var _0x3d0c46=null;var _0x409819=null;if(_0x2590f4[_0x9450('0x32')]['id']){delete _0x2590f4[_0x9450('0x32')]['id'];}if(_0x2590f4['body'][_0x9450('0x7a')]){_0x409819=path[_0x9450('0x77')](config[_0x9450('0x75')],'server/files/chat/upload/',util[_0x9450('0x7b')](_0x9450('0x7c'),Date[_0x9450('0x7d')]()));_0x2590f4[_0x9450('0x32')]['pathTranscript']=_0x409819;}return db['ChatInteraction'][_0x9450('0x4a')]({'where':{'id':_0x2590f4[_0x9450('0x3f')]['id']},'include':[{'model':db[_0x9450('0x7e')],'as':_0x9450('0x7f'),'include':[{'model':db[_0x9450('0x80')],'as':_0x9450('0x80')}]}]})[_0x9450('0x18')](handleEntityNotFound(_0x3dcf9e,null))['then'](saveUpdates(_0x2590f4[_0x9450('0x32')],null))[_0x9450('0x18')](function(_0x1a05b1){if(_0x1a05b1){_0x3d0eaa=_0x1a05b1;return db[_0x9450('0x81')][_0x9450('0x4a')]({'where':{'id':_0x3d0eaa[_0x9450('0x4f')]}});}})[_0x9450('0x18')](function(_0x18808b){if(_0x18808b){_0x3d0c46=_0x18808b;return db[_0x9450('0x62')][_0x9450('0x4a')]({'where':{'id':_0x3d0eaa['ContactId']}});}})[_0x9450('0x18')](function(_0x3c4628){if(_0x3c4628){if(_0x409819){var _0x3bd07c=null;for(var _0x5d2bff=0x1;_0x5d2bff<_0x3d0eaa['Messages']['length'];++_0x5d2bff){_0x3bd07c=_0x3d0eaa[_0x9450('0x7f')][_0x5d2bff];var _0x173552=_0x3bd07c[_0x9450('0x67')]?util[_0x9450('0x7b')](_0x9450('0x82'),_0x3d0c46[_0x9450('0x83')],_0x3bd07c[_0x9450('0x67')]):_0x9450('0x84');var _0x2c9b21=_0x2590f4[_0x9450('0x32')][_0x9450('0x85')]||util[_0x9450('0x7b')](_0x9450('0x82'),_0x9450('0x86'),_0x3bd07c[_0x9450('0x87')]);switch(_0x3d0c46[_0x9450('0x88')]){case _0x9450('0x89'):_0x173552=_0x3bd07c[_0x9450('0x67')]?util[_0x9450('0x7b')]('%s%d',_0x3d0c46[_0x9450('0x83')],_0x3bd07c[_0x9450('0x67')]):_0x9450('0x84');break;case'agent_alias':_0x173552=_0x3bd07c['UserId']?_0x3bd07c[_0x9450('0x80')][_0x9450('0x8a')]||_0x3bd07c[_0x9450('0x80')]['fullname']:_0x9450('0x84');break;case _0x9450('0x8b'):_0x173552=_0x3bd07c[_0x9450('0x67')]?_0x3bd07c['User'][_0x9450('0x8c')]:_0x9450('0x84');break;default:_0x173552=_0x3bd07c['UserId']?util[_0x9450('0x7b')](_0x9450('0x82'),_0x3d0c46[_0x9450('0x83')],_0x3bd07c[_0x9450('0x67')]):_0x9450('0x84');}var _0x5c02c8=util[_0x9450('0x7b')]('[%s]\x20%s:\x20%s\x0a',moment(_0x3bd07c[_0x9450('0x8d')])[_0x9450('0x7b')](_0x9450('0x8e')),_0x3bd07c[_0x9450('0x8f')]==='in'?_0x2c9b21:_0x173552,_0x3bd07c[_0x9450('0x32')]);if(!_0x3bd07c[_0x9450('0x90')]){fs[_0x9450('0x91')](_0x409819,_0x5c02c8);}}return db[_0x9450('0x92')][_0x9450('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x9450('0x93')],'as':_0x9450('0x94'),'raw':!![],'include':[{'model':db[_0x9450('0x95')],'as':_0x9450('0x95'),'raw':!![]}]}]});}}})[_0x9450('0x18')](function(_0x2e69fc){if(!_0x2e69fc||!_0x2e69fc[_0x9450('0x94')]||!_0x2590f4[_0x9450('0x32')])return _0x3d0eaa;var _0x8714ff=_0x2e69fc[_0x9450('0x96')]();return respondWithRpcPromise('SendMail',_0x9450('0x97'),{'account':_0x8714ff,'message':{'from':util[_0x9450('0x7b')](_0x9450('0x98'),_0x2e69fc[_0x9450('0x2f')],_0x2e69fc[_0x9450('0x55')]||_0x2e69fc[_0x9450('0x94')][_0x9450('0x3d')]),'to':_0x2590f4[_0x9450('0x32')][_0x9450('0x7a')],'subject':'Mail\x20Transcript','text':util[_0x9450('0x7b')](_0x9450('0x99'),_0x2590f4[_0x9450('0x32')]['mailTranscript']),'attachments':[{'path':_0x409819}]}})[_0x9450('0x18')](function(){return _0x3d0eaa;})['catch'](function(_0x1a2b5e){logger['error'](_0x1a2b5e);});})['then'](respondWithStatusCode(_0x3dcf9e,0xc8))['catch'](handleError(_0x3dcf9e,null));};exports[_0x9450('0x9a')]=function(_0x587016,_0x5daa6a){return db[_0x9450('0x7e')][_0x9450('0x4a')]({'where':{'id':_0x587016[_0x9450('0x3f')]['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x5daa6a,null))[_0x9450('0x18')](function(_0x128095){if(_0x128095){return _0x128095[_0x9450('0x9a')](_0x587016[_0x9450('0x32')]['ids'],_[_0x9450('0x9b')](_0x587016[_0x9450('0x32')],['ids','id'])||{});}})['then'](respondWithResult(_0x5daa6a,null))[_0x9450('0x22')](handleError(_0x5daa6a,null));};exports[_0x9450('0x9c')]=function(_0x595eb2,_0x536758){var _0x3ed545={'raw':![],'where':{}};var _0x45c796={};var _0x1bb6a1={'count':0x0,'rows':[]};return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x595eb2['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x536758,null))[_0x9450('0x18')](function(_0x3fc722){if(_0x3fc722){_0x45c796[_0x9450('0x44')]=_[_0x9450('0x41')](db['ChatMessage'][_0x9450('0x40')]);_0x45c796[_0x9450('0x3c')]=_[_0x9450('0x41')](_0x595eb2['query']);_0x45c796[_0x9450('0x42')]=_[_0x9450('0x43')](_0x45c796[_0x9450('0x44')],_0x45c796[_0x9450('0x3c')]);_0x3ed545[_0x9450('0x46')]=_[_0x9450('0x43')](_0x45c796[_0x9450('0x44')],qs[_0x9450('0x45')](_0x595eb2[_0x9450('0x3c')][_0x9450('0x45')]));_0x3ed545[_0x9450('0x46')]=_0x3ed545[_0x9450('0x46')][_0x9450('0x47')]?_0x3ed545[_0x9450('0x46')]:_0x45c796[_0x9450('0x44')];if(!_0x595eb2[_0x9450('0x3c')]['hasOwnProperty'](_0x9450('0x9d'))){_0x3ed545[_0x9450('0x29')]=qs[_0x9450('0x29')](_0x595eb2['query'][_0x9450('0x29')]);_0x3ed545[_0x9450('0x27')]=qs['offset'](_0x595eb2[_0x9450('0x3c')][_0x9450('0x27')]);}_0x3ed545['order']=qs['sort'](_0x595eb2[_0x9450('0x3c')][_0x9450('0x9e')]);_0x3ed545[_0x9450('0x9f')]=qs[_0x9450('0x42')](_[_0x9450('0xa0')](_0x595eb2['query'],_0x45c796[_0x9450('0x42')]));_0x3ed545[_0x9450('0x9f')][_0x9450('0xa1')]=_0x3fc722['id'];if(_0x595eb2[_0x9450('0x3c')][_0x9450('0xa2')]){_0x3ed545[_0x9450('0x9f')]=_['merge'](_0x3ed545[_0x9450('0x9f')],{'$or':_[_0x9450('0x36')](_0x3ed545['attributes'],function(_0xe9b6c1){var _0x2e4038={};_0x2e4038[_0xe9b6c1]={'$like':'%'+_0x595eb2[_0x9450('0x3c')][_0x9450('0xa2')]+'%'};return _0x2e4038;})});}if(_0x595eb2[_0x9450('0x3c')][_0x9450('0xa3')]){var _0x546aaa=_0x595eb2[_0x9450('0x3c')][_0x9450('0xa3')]['split'](',');var _0x11c88b={};_0x11c88b[_0x546aaa[0x0]]={'$gte':moment(_0x546aaa[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3ed545['where']=_['merge'](_0x3ed545['where'],_0x11c88b);}_0x3ed545=_[_0x9450('0x49')]({},_0x3ed545,_0x595eb2[_0x9450('0xa4')]);return db[_0x9450('0x7e')][_0x9450('0x28')]({'where':_0x3ed545[_0x9450('0x9f')]})[_0x9450('0x18')](function(_0x4c172a){_0x1bb6a1[_0x9450('0x28')]=_0x4c172a;if(_0x595eb2[_0x9450('0x3c')][_0x9450('0xa5')]){_0x3ed545['include']=[{'all':!![]}];}return db[_0x9450('0x7e')][_0x9450('0xa6')](_0x3ed545);})[_0x9450('0x18')](function(_0x393d3d){_0x1bb6a1[_0x9450('0xa7')]=_0x393d3d;return _0x1bb6a1;});}})[_0x9450('0x18')](respondWithFilteredResult(_0x536758,_0x3ed545))[_0x9450('0x22')](handleError(_0x536758,null));};exports[_0x9450('0xa8')]=function(_0x6b290e,_0x38cfcf){var _0x1cc52c={'where':{}},_0x298d9a={},_0x349231={'count':0x0,'rows':[]};return db[_0x9450('0x37')][_0x9450('0x4e')]({'where':{'id':_0x6b290e['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x38cfcf,null))[_0x9450('0x18')](function(_0x458421){if(_0x458421){_0x298d9a['model']=_['keys'](db[_0x9450('0x7e')][_0x9450('0x40')]);_0x298d9a[_0x9450('0x3c')]=_[_0x9450('0x41')](_0x6b290e[_0x9450('0x3c')]);_0x298d9a['filters']=_[_0x9450('0x43')](_0x298d9a[_0x9450('0x44')],_0x298d9a[_0x9450('0x3c')]);_0x1cc52c['attributes']=_[_0x9450('0x43')](_0x298d9a[_0x9450('0x44')],qs['fields'](_0x6b290e[_0x9450('0x3c')][_0x9450('0x45')]));_0x1cc52c['attributes']=_0x1cc52c['attributes'][_0x9450('0x47')]?_0x1cc52c['attributes']:_0x298d9a[_0x9450('0x44')];if(!_0x6b290e['query'][_0x9450('0xa9')](_0x9450('0x9d'))){_0x1cc52c[_0x9450('0x29')]=qs['limit'](_0x6b290e[_0x9450('0x3c')][_0x9450('0x29')]);_0x1cc52c[_0x9450('0x27')]=qs[_0x9450('0x27')](_0x6b290e[_0x9450('0x3c')][_0x9450('0x27')]);}_0x1cc52c[_0x9450('0xaa')]=qs['sort'](_0x6b290e['query'][_0x9450('0x9e')]);_0x1cc52c['where']=qs[_0x9450('0x42')](_['pick'](_0x6b290e['query'],_0x298d9a[_0x9450('0x42')]));_0x1cc52c[_0x9450('0x9f')][_0x9450('0xa1')]=_0x458421['id'];if(_0x6b290e['query'][_0x9450('0xa2')]){_0x1cc52c[_0x9450('0x9f')]=_[_0x9450('0x49')](_0x1cc52c[_0x9450('0x9f')],{'$or':_[_0x9450('0x36')](_0x1cc52c[_0x9450('0x46')],function(_0x23c6f5){var _0x44831a={};_0x44831a[_0x23c6f5]={'$like':'%'+_0x6b290e[_0x9450('0x3c')][_0x9450('0xa2')]+'%'};return _0x44831a;})});}_0x1cc52c[_0x9450('0x9f')][_0x9450('0x90')]=![];if(_0x6b290e[_0x9450('0x3c')]['id']){_0x1cc52c['where']['id']={'$gt':_0x6b290e['query']['id']};}_0x1cc52c=_[_0x9450('0x49')]({},_0x1cc52c,_0x6b290e['options']);return db[_0x9450('0x7e')]['count']({'where':_0x1cc52c['where']})[_0x9450('0x18')](function(_0x286e4a){_0x349231['count']=_0x286e4a;_0x1cc52c[_0x9450('0x48')]=[];if(_0x6b290e[_0x9450('0x3c')][_0x9450('0xab')]){_0x1cc52c[_0x9450('0x48')][_0x9450('0xac')]({'model':db[_0x9450('0x80')],'as':_0x9450('0x80'),'attributes':['id',_0x9450('0x8c'),_0x9450('0x8a')]});}if(_0x6b290e['query']['includeAll']){_0x1cc52c[_0x9450('0x48')]=[{'all':!![]}];}return db['ChatMessage'][_0x9450('0xa6')](_0x1cc52c);})[_0x9450('0x18')](function(_0x29f14c){_0x349231['rows']=_0x29f14c;return _0x349231;});}})[_0x9450('0x18')](respondWithFilteredResult(_0x38cfcf,_0x1cc52c))[_0x9450('0x22')](handleError(_0x38cfcf,null));};exports[_0x9450('0xad')]=function(_0x4cfd3d,_0x2f7dd8){return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x4cfd3d['params']['id']}})[_0x9450('0x18')](handleEntityNotFound(_0x2f7dd8,null))[_0x9450('0x18')](function(_0xa810f0){if(_0xa810f0){return _0xa810f0[_0x9450('0xae')](_0x4cfd3d[_0x9450('0x32')][_0x9450('0xaf')],_[_0x9450('0x9b')](_0x4cfd3d[_0x9450('0x32')],[_0x9450('0xaf'),'id'])||{})['spread'](function(){return db[_0x9450('0xb0')]['findAll']({'attributes':['id','name',_0x9450('0xb1')],'where':{'id':_0x4cfd3d[_0x9450('0x32')]['ids']}});})[_0x9450('0x18')](function(_0x124f96){socket[_0x9450('0xb2')](_0x9450('0xb3'),{'id':Number(_0x4cfd3d[_0x9450('0x3f')]['id']),'tags':_0x124f96||[]});return{'id':Number(_0x4cfd3d[_0x9450('0x3f')]['id']),'tags':_0x124f96||[]};});}})[_0x9450('0x18')](respondWithResult(_0x2f7dd8,null))[_0x9450('0x22')](handleError(_0x2f7dd8,null));};exports['removeTags']=function(_0x1dc027,_0x5d91e3){return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x1dc027[_0x9450('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d91e3,null))[_0x9450('0x18')](function(_0x5ebb6b){if(_0x5ebb6b){return _0x5ebb6b[_0x9450('0xb4')](_0x1dc027[_0x9450('0x3c')]['ids']);}})[_0x9450('0x18')](respondWithStatusCode(_0x5d91e3,null))[_0x9450('0x22')](handleError(_0x5d91e3,null));};exports[_0x9450('0x78')]=function(_0x5d7112,_0x13077d){var _0x2625e7=moment()[_0x9450('0xb5')]()[_0x9450('0xb6')]();var _0x3d949f=path[_0x9450('0x77')](config[_0x9450('0x75')],_0x9450('0xb7'),'files',_0x9450('0xb8'));var _0x14b111=path[_0x9450('0x77')](config[_0x9450('0x75')],_0x9450('0xb7'),'files',_0x9450('0xb9'));var _0x1d26bb=path[_0x9450('0x77')](_0x3d949f,_0x2625e7);var _0x163926=util[_0x9450('0x7b')](_0x9450('0xba'),_0x5d7112[_0x9450('0x3f')]['id'],_0x2625e7);var _0x115e66=path[_0x9450('0x77')](_0x3d949f,_0x163926);var _0x1f1b4a=[];_0x1f1b4a[_0x9450('0xac')]({'model':db[_0x9450('0x80')],'as':_0x9450('0x80'),'attributes':['id','fullname'],'raw':!![]});_0x1f1b4a[_0x9450('0xac')]({'model':db[_0x9450('0x62')],'as':_0x9450('0x63'),'attributes':['id','firstName',_0x9450('0xbb')],'raw':!![]});if(_0x5d7112[_0x9450('0x3c')][_0x9450('0xb9')]){_0x1f1b4a['push']({'model':db[_0x9450('0x71')],'as':_0x9450('0x71'),'raw':!![]});}var _0x229fea=[{'model':db[_0x9450('0x7e')],'as':_0x9450('0x7f'),'attributes':['id',_0x9450('0x32'),_0x9450('0x8d'),_0x9450('0x8f'),'secret',_0x9450('0xbc')],'include':_0x1f1b4a}];_0x229fea[_0x9450('0xac')]({'model':db[_0x9450('0x81')],'as':_0x9450('0xbd'),'attributes':['id',_0x9450('0x2f')]});_0x229fea[_0x9450('0xac')]({'model':db[_0x9450('0x80')],'as':_0x9450('0xbe'),'attributes':['id','fullname']});return db[_0x9450('0x37')][_0x9450('0x4a')]({'where':{'id':_0x5d7112[_0x9450('0x3f')]['id']},'include':_0x229fea})['then'](handleEntityNotFound(_0x13077d,null))[_0x9450('0x18')](function(_0x31c170){if(_0x31c170){var _0x4e800e=_0x31c170[_0x9450('0xbf')]({'plain':!![]});fs['mkdirSync'](_0x1d26bb);var _0x1edd65={'channel':'Chat','account':_0x4e800e[_0x9450('0xbd')]['name'],'agent':_0x4e800e[_0x9450('0xbe')]?_0x4e800e['Owner'][_0x9450('0x8c')]:_0x9450('0xc0'),'createdAt':moment(_0x4e800e[_0x9450('0x8d')])[_0x9450('0x7b')](_0x9450('0xc1'))[_0x9450('0xb6')](),'closedAt':_0x4e800e['closed']?moment(_0x4e800e[_0x9450('0xc2')])[_0x9450('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9450('0xb6')]():'','disposition':_0x4e800e[_0x9450('0x6a')],'chatInfo':{'browser':_0x4e800e['browserName'],'os':_0x4e800e['osName'],'referer':_0x4e800e[_0x9450('0xc3')],'customerIp':_0x4e800e[_0x9450('0xc4')],'customerPort':_0x4e800e[_0x9450('0xc5')]?_0x4e800e[_0x9450('0xc5')]:_0x9450('0xc0')},'messages':_(_0x4e800e[_0x9450('0x7f')])[_0x9450('0xc6')]()[_0x9450('0xa2')]({'secret':![]})[_0x9450('0x36')](function(_0x472712){if(_0x472712['Attachment']){var _0x6560ca=path[_0x9450('0x77')](_0x14b111,_0x472712[_0x9450('0x71')]['basename']);if(fs[_0x9450('0xc7')](_0x6560ca)){fs[_0x9450('0xc8')](_0x6560ca)['pipe'](fs[_0x9450('0xc9')](path[_0x9450('0x77')](_0x1d26bb,_0x472712[_0x9450('0x71')][_0x9450('0x6e')])));}}return{'date':moment(_0x472712[_0x9450('0x8d')])['format'](_0x9450('0xc1'))['toString'](),'sender':_0x472712[_0x9450('0x8f')]===_0x9450('0x5e')?_0x472712['User']?_0x472712[_0x9450('0x80')][_0x9450('0x8c')]:'System':_0x472712[_0x9450('0x63')][_0x9450('0xca')]+(_0x472712[_0x9450('0x63')][_0x9450('0xbb')]?'\x20'+_0x472712[_0x9450('0x63')][_0x9450('0xbb')]:''),'body':_0x472712[_0x9450('0x71')]?_0x472712[_0x9450('0x71')][_0x9450('0x6e')]:_0x472712['body'],'direction':_0x472712[_0x9450('0x8f')]===_0x9450('0x5e')?'A':'C','secret':_0x472712[_0x9450('0x90')],'read':_0x472712[_0x9450('0xbc')],'attachment':_0x472712[_0x9450('0x71')]};})[_0x9450('0xcb')]()};return ejs['renderFile'](path[_0x9450('0x77')](config[_0x9450('0x75')],_0x9450('0xb7'),_0x9450('0xcc'),_0x9450('0xcd')),{'interaction':_0x1edd65})[_0x9450('0x18')](function(_0x22cf20){var _0x1aff24=path[_0x9450('0x77')](_0x1d26bb,_0x9450('0xce')+_0x4e800e['id']+'-'+_0x2625e7+_0x9450('0xcf'));var _0x4702b0={'path':_0x1aff24,'channel':_0x9450('0xd0'),'interactionId':_0x4e800e['id']};return pdf[_0x9450('0xd1')](_0x22cf20,_0x4702b0);})[_0x9450('0x18')](function(){return new Promise(function(_0xa1bceb,_0x57ca46){zipdir(_0x1d26bb,{'saveTo':_0x115e66},function(_0x5d3689,_0x17a093){if(_0x5d3689)return _0x57ca46(_0x5d3689);return _0xa1bceb(_0x17a093);});})[_0x9450('0x18')](function(){return new BPromise(function(_0x437758,_0x27cf0e){rimraf(_0x1d26bb,function(_0x4b2396){if(_0x4b2396)_0x27cf0e(_0x4b2396);return _0x437758();});});})['then'](function(){return _0x13077d[_0x9450('0x78')](_0x115e66,_0x163926,function(_0xe6ab8d){if(_0xe6ab8d){logger[_0x9450('0x1e')](_0x9450('0xd2'),_0xe6ab8d);}else{fs[_0x9450('0xd3')](_0x115e66);}});});});}else{return _0x13077d['sendStatus'](0xc8);}})['catch'](handleError(_0x13077d,null));};
\ No newline at end of file
+var _0x0e5c=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','then','destroy','sendStatus','stack','name','send','render','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','params','model','keys','filters','attributes','intersection','fields','length','include','merge','options','find','create','update','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','file','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','download','format','pathTranscript','ChatMessage','Messages','User','CmContact','%s%d','agentAlias','customer','Visitor','ContactId','agentIdentifier','website_alias','agent_alias','alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','order','sort','where','pick','ChatInteractionId','filter','$gte','split','rows','getMyMessages','nolimit','includeAgent','includeAll','addTags','spread','color','removeTags','unix','toString','files','server','attachments','transcript-%d-%s.zip','push','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','read','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','rimraf','request-promise','moment','bluebird','mustache','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xa2cd53,_0x56a30a){var _0x4b92b1=function(_0x1c9d7c){while(--_0x1c9d7c){_0xa2cd53['push'](_0xa2cd53['shift']());}};_0x4b92b1(++_0x56a30a);}(_0x0e5c,0x17e));var _0xc0e5=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0e5c[_0x13ea00];return _0x1f7347;};'use strict';var rimraf=require(_0xc0e5('0x0'));var zipdir=require('zip-dir');var rp=require(_0xc0e5('0x1'));var moment=require(_0xc0e5('0x2'));var BPromise=require(_0xc0e5('0x3'));var Mustache=require(_0xc0e5('0x4'));var util=require('util');var path=require('path');var ejs=require(_0xc0e5('0x5'));var fs=require('fs');var _=require(_0xc0e5('0x6'));var Redis=require(_0xc0e5('0x7'));var interaction=require(_0xc0e5('0x8'));var qs=require(_0xc0e5('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xc0e5('0xa'))('api');var config=require(_0xc0e5('0xb'));var db=require(_0xc0e5('0xc'))['db'];config[_0xc0e5('0xd')]=_['defaults'](config[_0xc0e5('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc0e5('0xe'))(new Redis(config[_0xc0e5('0xd')]));require('./chatInteraction.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xc0e5('0xf')][_0xc0e5('0x10')]({'port':0x232b});var client9004=jayson[_0xc0e5('0xf')][_0xc0e5('0x10')]({'port':0x232c});function respondWithRpcPromise(_0x383461,_0x140b42,_0x16216c,_0x17c217){return new BPromise(function(_0x28a1d5,_0x12855f){var _0x409305=_0x17c217||client;return _0x409305[_0xc0e5('0x11')](_0x383461,_0x16216c)['then'](function(_0x2311e9){logger[_0xc0e5('0x12')](_0xc0e5('0x13'),_0x140b42,_0xc0e5('0x14'));logger[_0xc0e5('0x15')](_0xc0e5('0x16'),_0x140b42,_0xc0e5('0x14'),JSON[_0xc0e5('0x17')](_0x2311e9));if(_0x2311e9[_0xc0e5('0x18')]){if(_0x2311e9['error'][_0xc0e5('0x19')]===0x1f4){logger[_0xc0e5('0x18')](_0xc0e5('0x13'),_0x140b42,_0x2311e9['error']['message']);return _0x12855f(_0x2311e9[_0xc0e5('0x18')][_0xc0e5('0x1a')]);}logger['error']('ChatInteraction,\x20%s,\x20%s',_0x140b42,_0x2311e9[_0xc0e5('0x18')]['message']);return _0x28a1d5(_0x2311e9['error'][_0xc0e5('0x1a')]);}else{logger['info'](_0xc0e5('0x13'),_0x140b42,_0xc0e5('0x14'));_0x28a1d5(_0x2311e9[_0xc0e5('0x1b')]['message']);}})[_0xc0e5('0x1c')](function(_0x431ef1){logger[_0xc0e5('0x18')](_0xc0e5('0x13'),_0x140b42,_0x431ef1);_0x12855f(_0x431ef1);});});}function respondWithStatusCode(_0x32df09,_0x53ae3e){_0x53ae3e=_0x53ae3e||0xcc;return function(_0x208c75){if(_0x208c75){return _0x32df09['sendStatus'](_0x53ae3e);}return _0x32df09[_0xc0e5('0x1d')](_0x53ae3e)[_0xc0e5('0x1e')]();};}function respondWithResult(_0x212d18,_0x10e258){_0x10e258=_0x10e258||0xc8;return function(_0x2542c3){if(_0x2542c3){return _0x212d18[_0xc0e5('0x1d')](_0x10e258)[_0xc0e5('0x1f')](_0x2542c3);}};}function respondWithFilteredResult(_0x13271b,_0x17ca16){return function(_0x40411a){if(_0x40411a){var _0x108690=typeof _0x17ca16['offset']===_0xc0e5('0x20')&&typeof _0x17ca16[_0xc0e5('0x21')]===_0xc0e5('0x20');var _0x1b9b30=_0x40411a[_0xc0e5('0x22')];var _0x2e5fa1=_0x108690?0x0:_0x17ca16[_0xc0e5('0x23')];var _0x92b44f=_0x108690?_0x40411a['count']:_0x17ca16[_0xc0e5('0x23')]+_0x17ca16['limit'];var _0x57745b;if(_0x92b44f>=_0x1b9b30){_0x92b44f=_0x1b9b30;_0x57745b=0xc8;}else{_0x57745b=0xce;}_0x13271b[_0xc0e5('0x1d')](_0x57745b);return _0x13271b[_0xc0e5('0x24')](_0xc0e5('0x25'),_0x2e5fa1+'-'+_0x92b44f+'/'+_0x1b9b30)['json'](_0x40411a);}return null;};}function saveUpdates(_0x2b9c29){return function(_0x5743cc){if(_0x5743cc){return _0x5743cc['update'](_0x2b9c29)[_0xc0e5('0x26')](function(_0xac1938){return _0xac1938;});}return null;};}function removeEntity(_0xd6f7d6){return function(_0x7d30db){if(_0x7d30db){return _0x7d30db[_0xc0e5('0x27')]()[_0xc0e5('0x26')](function(){_0xd6f7d6[_0xc0e5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4def8f){return function(_0x1f6952){if(!_0x1f6952){_0x4def8f[_0xc0e5('0x28')](0x194);}return _0x1f6952;};}function handleError(_0x446a2c,_0x98ce70){_0x98ce70=_0x98ce70||0x1f4;return function(_0x271fa3){logger[_0xc0e5('0x18')](_0x271fa3[_0xc0e5('0x29')]);if(_0x271fa3[_0xc0e5('0x2a')]){delete _0x271fa3[_0xc0e5('0x2a')];}_0x446a2c[_0xc0e5('0x1d')](_0x98ce70)[_0xc0e5('0x2b')](_0x271fa3);};}function getMustacheRender(_0x8065d3,_0x299ec9){return Mustache[_0xc0e5('0x2c')](_0x8065d3,_['merge'](_0x299ec9[_0xc0e5('0x2d')],{'contact':_0x299ec9[_0xc0e5('0x2e')],'message':_0x299ec9[_0xc0e5('0x1a')],'agent':_0x299ec9[_0xc0e5('0x2f')],'interaction':_0x299ec9['interaction'],'account':_0x299ec9[_0xc0e5('0x30')]}))||'';}exports[_0xc0e5('0x31')]=function(_0x32a5ea,_0x566867){var _0x511ae0={};var _0x46372a=_[_0xc0e5('0x32')](db[_0xc0e5('0x33')][_0xc0e5('0x34')],function(_0x2e2cc7){return{'name':_0x2e2cc7['fieldName'],'type':_0x2e2cc7[_0xc0e5('0x35')]['key']};});_0x511ae0=qs[_0xc0e5('0x36')](_0x46372a,_0x32a5ea);return interaction[_0xc0e5('0x37')]('chat',_0x32a5ea[_0xc0e5('0x38')],_0x32a5ea[_0xc0e5('0x39')],_0x511ae0,_0x46372a)[_0xc0e5('0x26')](respondWithFilteredResult(_0x566867,_0x511ae0))[_0xc0e5('0x1c')](handleError(_0x566867,null));};exports['show']=function(_0x201776,_0x28b8a6){var _0x352ed2={'raw':![],'where':{'id':_0x201776[_0xc0e5('0x3a')]['id']}},_0x5ba1b5={};_0x5ba1b5[_0xc0e5('0x3b')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x5ba1b5[_0xc0e5('0x38')]=_[_0xc0e5('0x3c')](_0x201776[_0xc0e5('0x38')]);_0x5ba1b5[_0xc0e5('0x3d')]=_['intersection'](_0x5ba1b5['model'],_0x5ba1b5[_0xc0e5('0x38')]);_0x352ed2[_0xc0e5('0x3e')]=_[_0xc0e5('0x3f')](_0x5ba1b5[_0xc0e5('0x3b')],qs[_0xc0e5('0x40')](_0x201776['query'][_0xc0e5('0x40')]));_0x352ed2[_0xc0e5('0x3e')]=_0x352ed2['attributes'][_0xc0e5('0x41')]?_0x352ed2[_0xc0e5('0x3e')]:_0x5ba1b5[_0xc0e5('0x3b')];if(_0x201776[_0xc0e5('0x38')]['includeAll']){_0x352ed2[_0xc0e5('0x42')]=[{'all':!![]}];}_0x352ed2=_[_0xc0e5('0x43')]({},_0x352ed2,_0x201776[_0xc0e5('0x44')]);return db[_0xc0e5('0x33')][_0xc0e5('0x45')](_0x352ed2)[_0xc0e5('0x26')](handleEntityNotFound(_0x28b8a6,null))['then'](respondWithResult(_0x28b8a6,null))['catch'](handleError(_0x28b8a6,null));};exports[_0xc0e5('0x46')]=function(_0x4b4bf3,_0x9db29d){return db[_0xc0e5('0x33')][_0xc0e5('0x46')](_0x4b4bf3[_0xc0e5('0x2d')],{})[_0xc0e5('0x26')](respondWithResult(_0x9db29d,0xc9))[_0xc0e5('0x1c')](handleError(_0x9db29d,null));};exports[_0xc0e5('0x47')]=function(_0x26f96b,_0x46d945){if(_0x26f96b[_0xc0e5('0x2d')]['id']){delete _0x26f96b[_0xc0e5('0x2d')]['id'];}return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x26f96b[_0xc0e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x46d945,null))[_0xc0e5('0x26')](saveUpdates(_0x26f96b[_0xc0e5('0x2d')],null))[_0xc0e5('0x26')](respondWithResult(_0x46d945,null))['catch'](handleError(_0x46d945,null));};exports['destroy']=function(_0x555e22,_0x18d4fb){return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x555e22[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x18d4fb,null))[_0xc0e5('0x26')](removeEntity(_0x18d4fb,null))[_0xc0e5('0x1c')](handleError(_0x18d4fb,null));};exports[_0xc0e5('0x48')]=function(_0x289ea2,_0x2a5a15){return db[_0xc0e5('0x33')]['describe']()[_0xc0e5('0x26')](respondWithResult(_0x2a5a15,null))[_0xc0e5('0x1c')](handleError(_0x2a5a15,null));};exports['createVidaooSession']=function(_0x39d512,_0x235062){var _0x421f33=_0x39d512[_0xc0e5('0x3a')]['id'];var _0x3e9087;var _0x2f16f0;var _0x3ccf9a;return db[_0xc0e5('0x33')][_0xc0e5('0x49')]({'where':{'id':_0x421f33}})[_0xc0e5('0x26')](function(_0xf8768f){_0x3e9087=_0xf8768f;return db[_0xc0e5('0x4a')][_0xc0e5('0x49')]({'where':{'id':_0xf8768f['ChatWebsiteId']},'attributes':['id',_0xc0e5('0x4b'),_0xc0e5('0x4c'),_0xc0e5('0x4d'),_0xc0e5('0x4e'),_0xc0e5('0x4f')],'raw':!![]});})[_0xc0e5('0x26')](function(_0x2d1a98){if(_0x2d1a98&&_0x2d1a98[_0xc0e5('0x4b')]&&_0x2d1a98['vidaooEscalation']){_0x2f16f0=_0x2d1a98;var _0x20b935={'interaction':{'id':_0x421f33},'agent':{'id':_0x39d512['user']['id'],'name':_0x39d512[_0xc0e5('0x39')]['name'],'fullname':_0x39d512[_0xc0e5('0x39')][_0xc0e5('0x50')],'email':_0x39d512[_0xc0e5('0x39')][_0xc0e5('0x51')]},'contact':_0x39d512[_0xc0e5('0x2d')][_0xc0e5('0x2e')],'account':_0x39d512[_0xc0e5('0x2d')][_0xc0e5('0x30')]};var _0x15a73f={'rejectUnauthorized':![],'method':_0xc0e5('0x52'),'url':_0xc0e5('0x53'),'headers':{'X-APIKEY':_0x2d1a98['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39d512[_0xc0e5('0x39')]['email']],'buttons':null,'topic':_0x2f16f0[_0xc0e5('0x4d')],'note':_[_0xc0e5('0x54')](_0x2f16f0[_0xc0e5('0x4e')])?null:getMustacheRender(_0x2f16f0[_0xc0e5('0x4e')],_0x20b935),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xc0e5('0x54')](_0x2f16f0[_0xc0e5('0x4f')])){var _0x26a9ee=getMustacheRender(_0x2f16f0[_0xc0e5('0x4f')],_0x20b935);var _0x4f9b2d=JSON[_0xc0e5('0x55')](_0x26a9ee);_0x15a73f[_0xc0e5('0x2d')][_0xc0e5('0x56')]=_0x4f9b2d;}}catch(_0x591b9c){throw new db[(_0xc0e5('0x57'))][(_0xc0e5('0x58'))](_0xc0e5('0x59'));}return rp(_0x15a73f);}else{throw new db[(_0xc0e5('0x57'))][(_0xc0e5('0x58'))](_0xc0e5('0x5a'));}})[_0xc0e5('0x26')](function(_0x365d53){_0x3ccf9a=_0x365d53;if(_0x3ccf9a['id']){var _0x1b4b95={'body':_0x3ccf9a['join_url'],'ChatWebsiteId':_0x2f16f0['id'],'ChatInteractionId':_0x3e9087['id'],'direction':_0xc0e5('0x5b'),'UserId':_0x39d512['user']['id']};return db['ChatMessage'][_0xc0e5('0x46')](_0x1b4b95,{});}else{throw new db[(_0xc0e5('0x57'))][(_0xc0e5('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xc0e5('0x26')](function(){return _0x3e9087[_0xc0e5('0x5c')]({'vidaooSessionId':_0x3ccf9a['id']});})[_0xc0e5('0x26')](respondWithResult(_0x235062,null))[_0xc0e5('0x1c')](handleError(_0x235062,null));};exports[_0xc0e5('0x5d')]=function(_0x9b16b7,_0x59c228){if(_0x9b16b7[_0xc0e5('0x2d')]['id']){delete _0x9b16b7['body']['id'];}return db['ChatInteraction'][_0xc0e5('0x45')]({'where':{'id':_0x9b16b7['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xc0e5('0x26')](handleEntityNotFound(_0x59c228,null))[_0xc0e5('0x26')](saveUpdates(_0x9b16b7[_0xc0e5('0x2d')],null))['then'](respondWithResult(_0x59c228,null))[_0xc0e5('0x1c')](handleError(_0x59c228,null));};exports[_0xc0e5('0x5e')]=function(_0x58a824,_0x264897){if(_0x58a824[_0xc0e5('0x2d')]['id']){delete _0x58a824[_0xc0e5('0x2d')]['id'];}return db['ChatInteraction'][_0xc0e5('0x45')]({'where':{'id':_0x58a824[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](function(_0xd95f66){if(!_0xd95f66){logger[_0xc0e5('0x18')](_0xc0e5('0x5f'),_0xc0e5('0x5e'),0x194,_0xc0e5('0x60'));_0x264897[_0xc0e5('0x28')](0x194);}else{if(_0xd95f66[_0xc0e5('0x61')]){throw new db['Sequelize'][(_0xc0e5('0x58'))](_0xc0e5('0x62'));}}return _0xd95f66;})[_0xc0e5('0x26')](function(_0x40a761){if(_0x40a761){return _0x40a761[_0xc0e5('0x47')]({'closed':_0x58a824[_0xc0e5('0x2d')][_0xc0e5('0x63')],'disposition':_0x58a824['body'][_0xc0e5('0x64')]})[_0xc0e5('0x26')](function(_0x1e5adc){return _0x1e5adc;});}})[_0xc0e5('0x26')](function(){return respondWithRpcPromise(_0xc0e5('0x65'),_0xc0e5('0x5e'),_0x58a824[_0xc0e5('0x2d')],client9004);})[_0xc0e5('0x26')](respondWithResult(_0x264897,null))[_0xc0e5('0x1c')](handleError(_0x264897,null));};exports[_0xc0e5('0x66')]=function(_0x1601d7,_0x2be434){_0x1601d7['body'][_0xc0e5('0x2a')]=_0x1601d7['file'][_0xc0e5('0x67')];_0x1601d7[_0xc0e5('0x2d')]['basename']=_0x1601d7[_0xc0e5('0x68')][_0xc0e5('0x69')];_0x1601d7[_0xc0e5('0x2d')]['type']=_0x1601d7[_0xc0e5('0x68')][_0xc0e5('0x6a')];return db[_0xc0e5('0x6b')]['create'](_0x1601d7['body'])[_0xc0e5('0x26')](respondWithResult(_0x2be434,0xc9))[_0xc0e5('0x1c')](handleError(_0x2be434,null));};exports['attachmentDownload']=function(_0x1268ee,_0x50d127){return db['ChatInteraction'][_0xc0e5('0x49')]({'where':{'id':_0x1268ee['params']['id']},'raw':!![]})[_0xc0e5('0x26')](handleEntityNotFound(_0x50d127,null))[_0xc0e5('0x26')](function(_0xc7bed4){if(_0xc7bed4){if(_0xc7bed4['closed']){return _0x50d127[_0xc0e5('0x1d')](0x193)[_0xc0e5('0x1f')]({'status':0x193,'message':_0xc0e5('0x6c')});}return db[_0xc0e5('0x6b')][_0xc0e5('0x49')]({'where':{'id':_0x1268ee[_0xc0e5('0x38')][_0xc0e5('0x6d')]},'raw':!![]})[_0xc0e5('0x26')](handleEntityNotFound(_0x50d127,null));}})[_0xc0e5('0x26')](function(_0x38d6ec){if(_0x38d6ec){var _0x31c029=_0x38d6ec[_0xc0e5('0x6e')]!==null;var _0x3df6f4=path[_0xc0e5('0x6f')](config[_0xc0e5('0x70')],_0xc0e5('0x71'));if(_0x31c029){_0x3df6f4=path['join'](_0x3df6f4,_0xc0e5('0x72'));}var _0x2d6d9d=path[_0xc0e5('0x6f')](_0x3df6f4,_0x38d6ec[_0xc0e5('0x73')]);return _0x50d127[_0xc0e5('0x74')](_0x2d6d9d);}})['catch'](handleError(_0x50d127,null));};exports['close']=function(_0x5dc377,_0x56bd38){var _0x42c9c8=null;var _0x5168c1=null;var _0xfe7bf0=null;if(_0x5dc377['body']['id']){delete _0x5dc377[_0xc0e5('0x2d')]['id'];}if(_0x5dc377['body']['mailTranscript']){_0xfe7bf0=path[_0xc0e5('0x6f')](config[_0xc0e5('0x70')],'server/files/chat/upload/',util[_0xc0e5('0x75')]('transcript-%s.txt',Date['now']()));_0x5dc377[_0xc0e5('0x2d')][_0xc0e5('0x76')]=_0xfe7bf0;}return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x5dc377['params']['id']},'include':[{'model':db[_0xc0e5('0x77')],'as':_0xc0e5('0x78'),'include':[{'model':db[_0xc0e5('0x79')],'as':'User'}]}]})[_0xc0e5('0x26')](handleEntityNotFound(_0x56bd38,null))[_0xc0e5('0x26')](saveUpdates(_0x5dc377[_0xc0e5('0x2d')],null))['then'](function(_0x43e0c8){if(_0x43e0c8){_0x42c9c8=_0x43e0c8;return db[_0xc0e5('0x4a')]['find']({'where':{'id':_0x42c9c8['ChatWebsiteId']}});}})[_0xc0e5('0x26')](function(_0x5e79ec){if(_0x5e79ec){_0x5168c1=_0x5e79ec;return db[_0xc0e5('0x7a')][_0xc0e5('0x45')]({'where':{'id':_0x42c9c8['ContactId']}});}})[_0xc0e5('0x26')](function(_0x41056d){if(_0x41056d){if(_0xfe7bf0){var _0x5ec81e=null;for(var _0x24112a=0x1;_0x24112a<_0x42c9c8[_0xc0e5('0x78')][_0xc0e5('0x41')];++_0x24112a){_0x5ec81e=_0x42c9c8[_0xc0e5('0x78')][_0x24112a];var _0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?util[_0xc0e5('0x75')](_0xc0e5('0x7b'),_0x5168c1[_0xc0e5('0x7c')],_0x5ec81e[_0xc0e5('0x61')]):'System';var _0x3fbc1a=_0x5dc377[_0xc0e5('0x2d')][_0xc0e5('0x7d')]||util['format'](_0xc0e5('0x7b'),_0xc0e5('0x7e'),_0x5ec81e[_0xc0e5('0x7f')]);switch(_0x5168c1[_0xc0e5('0x80')]){case _0xc0e5('0x81'):_0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?util[_0xc0e5('0x75')]('%s%d',_0x5168c1['agentAlias'],_0x5ec81e[_0xc0e5('0x61')]):'System';break;case _0xc0e5('0x82'):_0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?_0x5ec81e[_0xc0e5('0x79')][_0xc0e5('0x83')]||_0x5ec81e[_0xc0e5('0x79')]['fullname']:_0xc0e5('0x84');break;case _0xc0e5('0x85'):_0x2710e7=_0x5ec81e[_0xc0e5('0x61')]?_0x5ec81e[_0xc0e5('0x79')]['fullname']:'System';break;default:_0x2710e7=_0x5ec81e['UserId']?util['format'](_0xc0e5('0x7b'),_0x5168c1['agentAlias'],_0x5ec81e[_0xc0e5('0x61')]):_0xc0e5('0x84');}var _0x807783=util[_0xc0e5('0x75')](_0xc0e5('0x86'),moment(_0x5ec81e[_0xc0e5('0x87')])[_0xc0e5('0x75')](_0xc0e5('0x88')),_0x5ec81e[_0xc0e5('0x89')]==='in'?_0x3fbc1a:_0x2710e7,_0x5ec81e[_0xc0e5('0x2d')]);if(!_0x5ec81e[_0xc0e5('0x8a')]){fs[_0xc0e5('0x8b')](_0xfe7bf0,_0x807783);}}return db['MailAccount'][_0xc0e5('0x49')]({'where':{'service':!![]},'include':[{'model':db[_0xc0e5('0x8c')],'as':_0xc0e5('0x8d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xc0e5('0x8e'),'raw':!![]}]}]});}}})[_0xc0e5('0x26')](function(_0x2f515d){if(!_0x2f515d||!_0x2f515d[_0xc0e5('0x8d')]||!_0x5dc377['body'])return _0x42c9c8;var _0x228ebd=_0x2f515d[_0xc0e5('0x8f')]();return respondWithRpcPromise('SendMail',_0xc0e5('0x90'),{'account':_0x228ebd,'message':{'from':util[_0xc0e5('0x75')](_0xc0e5('0x91'),_0x2f515d[_0xc0e5('0x2a')],_0x2f515d[_0xc0e5('0x51')]||_0x2f515d[_0xc0e5('0x8d')][_0xc0e5('0x39')]),'to':_0x5dc377['body']['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xc0e5('0x75')](_0xc0e5('0x92'),_0x5dc377[_0xc0e5('0x2d')]['mailTranscript']),'attachments':[{'path':_0xfe7bf0}]}})[_0xc0e5('0x26')](function(){return _0x42c9c8;})['catch'](function(_0x1c93e4){logger[_0xc0e5('0x18')](_0x1c93e4);});})[_0xc0e5('0x26')](respondWithStatusCode(_0x56bd38,0xc8))[_0xc0e5('0x1c')](handleError(_0x56bd38,null));};exports[_0xc0e5('0x93')]=function(_0x4133b2,_0x48bce7){return db[_0xc0e5('0x77')][_0xc0e5('0x45')]({'where':{'id':_0x4133b2[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x48bce7,null))[_0xc0e5('0x26')](function(_0x153c21){if(_0x153c21){return _0x153c21['addMessage'](_0x4133b2['body'][_0xc0e5('0x94')],_[_0xc0e5('0x95')](_0x4133b2[_0xc0e5('0x2d')],[_0xc0e5('0x94'),'id'])||{});}})[_0xc0e5('0x26')](respondWithResult(_0x48bce7,null))['catch'](handleError(_0x48bce7,null));};exports[_0xc0e5('0x96')]=function(_0x255955,_0x5b26a5){var _0x2a7c47={'raw':![],'where':{}};var _0x35ca14={};var _0x50e3b6={'count':0x0,'rows':[]};return db[_0xc0e5('0x33')][_0xc0e5('0x49')]({'where':{'id':_0x255955[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x5b26a5,null))['then'](function(_0x12383a){if(_0x12383a){_0x35ca14[_0xc0e5('0x3b')]=_[_0xc0e5('0x3c')](db[_0xc0e5('0x77')][_0xc0e5('0x34')]);_0x35ca14[_0xc0e5('0x38')]=_[_0xc0e5('0x3c')](_0x255955[_0xc0e5('0x38')]);_0x35ca14[_0xc0e5('0x3d')]=_[_0xc0e5('0x3f')](_0x35ca14[_0xc0e5('0x3b')],_0x35ca14[_0xc0e5('0x38')]);_0x2a7c47[_0xc0e5('0x3e')]=_[_0xc0e5('0x3f')](_0x35ca14[_0xc0e5('0x3b')],qs[_0xc0e5('0x40')](_0x255955['query'][_0xc0e5('0x40')]));_0x2a7c47['attributes']=_0x2a7c47['attributes'][_0xc0e5('0x41')]?_0x2a7c47['attributes']:_0x35ca14[_0xc0e5('0x3b')];if(!_0x255955['query'][_0xc0e5('0x97')]('nolimit')){_0x2a7c47[_0xc0e5('0x21')]=qs[_0xc0e5('0x21')](_0x255955[_0xc0e5('0x38')]['limit']);_0x2a7c47['offset']=qs[_0xc0e5('0x23')](_0x255955[_0xc0e5('0x38')][_0xc0e5('0x23')]);}_0x2a7c47[_0xc0e5('0x98')]=qs['sort'](_0x255955['query'][_0xc0e5('0x99')]);_0x2a7c47[_0xc0e5('0x9a')]=qs[_0xc0e5('0x3d')](_[_0xc0e5('0x9b')](_0x255955['query'],_0x35ca14[_0xc0e5('0x3d')]));_0x2a7c47[_0xc0e5('0x9a')][_0xc0e5('0x9c')]=_0x12383a['id'];if(_0x255955[_0xc0e5('0x38')]['filter']){_0x2a7c47[_0xc0e5('0x9a')]=_[_0xc0e5('0x43')](_0x2a7c47[_0xc0e5('0x9a')],{'$or':_[_0xc0e5('0x32')](_0x2a7c47[_0xc0e5('0x3e')],function(_0xcc76be){var _0x38c685={};_0x38c685[_0xcc76be]={'$like':'%'+_0x255955[_0xc0e5('0x38')][_0xc0e5('0x9d')]+'%'};return _0x38c685;})});}if(_0x255955[_0xc0e5('0x38')][_0xc0e5('0x9e')]){var _0x55ecc1=_0x255955[_0xc0e5('0x38')][_0xc0e5('0x9e')][_0xc0e5('0x9f')](',');var _0x3cd7a5={};_0x3cd7a5[_0x55ecc1[0x0]]={'$gte':moment(_0x55ecc1[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2a7c47[_0xc0e5('0x9a')]=_[_0xc0e5('0x43')](_0x2a7c47[_0xc0e5('0x9a')],_0x3cd7a5);}_0x2a7c47=_[_0xc0e5('0x43')]({},_0x2a7c47,_0x255955[_0xc0e5('0x44')]);return db[_0xc0e5('0x77')][_0xc0e5('0x22')]({'where':_0x2a7c47[_0xc0e5('0x9a')]})[_0xc0e5('0x26')](function(_0x54f494){_0x50e3b6['count']=_0x54f494;if(_0x255955[_0xc0e5('0x38')]['includeAll']){_0x2a7c47[_0xc0e5('0x42')]=[{'all':!![]}];}return db[_0xc0e5('0x77')]['findAll'](_0x2a7c47);})['then'](function(_0x5bda6d){_0x50e3b6[_0xc0e5('0xa0')]=_0x5bda6d;return _0x50e3b6;});}})['then'](respondWithFilteredResult(_0x5b26a5,_0x2a7c47))[_0xc0e5('0x1c')](handleError(_0x5b26a5,null));};exports[_0xc0e5('0xa1')]=function(_0x564cf7,_0x3e43b4){var _0x496378={'where':{}},_0x7f8eed={},_0x3186f3={'count':0x0,'rows':[]};return db[_0xc0e5('0x33')][_0xc0e5('0x49')]({'where':{'id':_0x564cf7[_0xc0e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3e43b4,null))[_0xc0e5('0x26')](function(_0x4d4fd2){if(_0x4d4fd2){_0x7f8eed[_0xc0e5('0x3b')]=_[_0xc0e5('0x3c')](db[_0xc0e5('0x77')][_0xc0e5('0x34')]);_0x7f8eed[_0xc0e5('0x38')]=_[_0xc0e5('0x3c')](_0x564cf7[_0xc0e5('0x38')]);_0x7f8eed[_0xc0e5('0x3d')]=_[_0xc0e5('0x3f')](_0x7f8eed['model'],_0x7f8eed['query']);_0x496378['attributes']=_[_0xc0e5('0x3f')](_0x7f8eed['model'],qs[_0xc0e5('0x40')](_0x564cf7[_0xc0e5('0x38')]['fields']));_0x496378['attributes']=_0x496378['attributes'][_0xc0e5('0x41')]?_0x496378[_0xc0e5('0x3e')]:_0x7f8eed[_0xc0e5('0x3b')];if(!_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x97')](_0xc0e5('0xa2'))){_0x496378[_0xc0e5('0x21')]=qs[_0xc0e5('0x21')](_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x21')]);_0x496378['offset']=qs[_0xc0e5('0x23')](_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x23')]);}_0x496378['order']=qs[_0xc0e5('0x99')](_0x564cf7[_0xc0e5('0x38')]['sort']);_0x496378[_0xc0e5('0x9a')]=qs[_0xc0e5('0x3d')](_[_0xc0e5('0x9b')](_0x564cf7[_0xc0e5('0x38')],_0x7f8eed[_0xc0e5('0x3d')]));_0x496378[_0xc0e5('0x9a')][_0xc0e5('0x9c')]=_0x4d4fd2['id'];if(_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x9d')]){_0x496378['where']=_[_0xc0e5('0x43')](_0x496378['where'],{'$or':_[_0xc0e5('0x32')](_0x496378[_0xc0e5('0x3e')],function(_0x3c7527){var _0x4c8984={};_0x4c8984[_0x3c7527]={'$like':'%'+_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0x9d')]+'%'};return _0x4c8984;})});}_0x496378[_0xc0e5('0x9a')][_0xc0e5('0x8a')]=![];if(_0x564cf7[_0xc0e5('0x38')]['id']){_0x496378[_0xc0e5('0x9a')]['id']={'$gt':_0x564cf7[_0xc0e5('0x38')]['id']};}_0x496378=_['merge']({},_0x496378,_0x564cf7[_0xc0e5('0x44')]);return db[_0xc0e5('0x77')]['count']({'where':_0x496378['where']})['then'](function(_0x4bf5fa){_0x3186f3[_0xc0e5('0x22')]=_0x4bf5fa;_0x496378[_0xc0e5('0x42')]=[];if(_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0xa3')]){_0x496378[_0xc0e5('0x42')]['push']({'model':db[_0xc0e5('0x79')],'as':'User','attributes':['id',_0xc0e5('0x50'),_0xc0e5('0x83')]});}if(_0x564cf7[_0xc0e5('0x38')][_0xc0e5('0xa4')]){_0x496378[_0xc0e5('0x42')]=[{'all':!![]}];}return db[_0xc0e5('0x77')]['findAll'](_0x496378);})['then'](function(_0x50cb1e){_0x3186f3['rows']=_0x50cb1e;return _0x3186f3;});}})['then'](respondWithFilteredResult(_0x3e43b4,_0x496378))[_0xc0e5('0x1c')](handleError(_0x3e43b4,null));};exports[_0xc0e5('0xa5')]=function(_0x16d03f,_0x5e4c6e){return db[_0xc0e5('0x33')][_0xc0e5('0x45')]({'where':{'id':_0x16d03f[_0xc0e5('0x3a')]['id']}})[_0xc0e5('0x26')](handleEntityNotFound(_0x5e4c6e,null))[_0xc0e5('0x26')](function(_0x5cd79d){if(_0x5cd79d){return _0x5cd79d['setTags'](_0x16d03f[_0xc0e5('0x2d')][_0xc0e5('0x94')],_[_0xc0e5('0x95')](_0x16d03f[_0xc0e5('0x2d')],[_0xc0e5('0x94'),'id'])||{})[_0xc0e5('0xa6')](function(){return db['Tag'][_0xc0e5('0x37')]({'attributes':['id',_0xc0e5('0x2a'),_0xc0e5('0xa7')],'where':{'id':_0x16d03f['body'][_0xc0e5('0x94')]}});})[_0xc0e5('0x26')](function(_0x1a23a6){socket['emit']('chatInteractionTags:save',{'id':Number(_0x16d03f[_0xc0e5('0x3a')]['id']),'tags':_0x1a23a6||[]});return{'id':Number(_0x16d03f['params']['id']),'tags':_0x1a23a6||[]};});}})['then'](respondWithResult(_0x5e4c6e,null))[_0xc0e5('0x1c')](handleError(_0x5e4c6e,null));};exports[_0xc0e5('0xa8')]=function(_0x5be3d,_0x5958f4){return db['ChatInteraction']['find']({'where':{'id':_0x5be3d[_0xc0e5('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5958f4,null))[_0xc0e5('0x26')](function(_0x3b86ab){if(_0x3b86ab){return _0x3b86ab[_0xc0e5('0xa8')](_0x5be3d[_0xc0e5('0x38')][_0xc0e5('0x94')]);}})[_0xc0e5('0x26')](respondWithStatusCode(_0x5958f4,null))[_0xc0e5('0x1c')](handleError(_0x5958f4,null));};exports[_0xc0e5('0x74')]=function(_0x2ecb79,_0x42282e){var _0xef5e5a=moment()[_0xc0e5('0xa9')]()[_0xc0e5('0xaa')]();var _0x5307db=path[_0xc0e5('0x6f')](config[_0xc0e5('0x70')],'server',_0xc0e5('0xab'),'tmp');var _0x5449e1=path[_0xc0e5('0x6f')](config['root'],_0xc0e5('0xac'),_0xc0e5('0xab'),_0xc0e5('0xad'));var _0x460d94=path[_0xc0e5('0x6f')](_0x5307db,_0xef5e5a);var _0x266480=util['format'](_0xc0e5('0xae'),_0x2ecb79[_0xc0e5('0x3a')]['id'],_0xef5e5a);var _0x4e7c7c=path[_0xc0e5('0x6f')](_0x5307db,_0x266480);var _0x409d74=[];_0x409d74[_0xc0e5('0xaf')]({'model':db['User'],'as':_0xc0e5('0x79'),'attributes':['id','fullname'],'raw':!![]});_0x409d74['push']({'model':db[_0xc0e5('0x7a')],'as':_0xc0e5('0xb0'),'attributes':['id',_0xc0e5('0xb1'),_0xc0e5('0xb2')],'raw':!![]});if(_0x2ecb79[_0xc0e5('0x38')]['attachments']){_0x409d74[_0xc0e5('0xaf')]({'model':db[_0xc0e5('0x6b')],'as':_0xc0e5('0x6b'),'raw':!![]});}var _0x20bf5e=[{'model':db[_0xc0e5('0x77')],'as':'Messages','attributes':['id',_0xc0e5('0x2d'),_0xc0e5('0x87'),_0xc0e5('0x89'),_0xc0e5('0x8a'),'read'],'include':_0x409d74}];_0x20bf5e[_0xc0e5('0xaf')]({'model':db[_0xc0e5('0x4a')],'as':_0xc0e5('0xb3'),'attributes':['id',_0xc0e5('0x2a')]});_0x20bf5e[_0xc0e5('0xaf')]({'model':db[_0xc0e5('0x79')],'as':_0xc0e5('0xb4'),'attributes':['id',_0xc0e5('0x50')]});return db[_0xc0e5('0x33')]['find']({'where':{'id':_0x2ecb79[_0xc0e5('0x3a')]['id']},'include':_0x20bf5e})[_0xc0e5('0x26')](handleEntityNotFound(_0x42282e,null))[_0xc0e5('0x26')](function(_0x11ecbe){if(_0x11ecbe){var _0x52678c=_0x11ecbe[_0xc0e5('0xb5')]({'plain':!![]});fs[_0xc0e5('0xb6')](_0x460d94);var _0x410d5a={'channel':_0xc0e5('0xb7'),'account':_0x52678c['Account'][_0xc0e5('0x2a')],'agent':_0x52678c['Owner']?_0x52678c[_0xc0e5('0xb4')][_0xc0e5('0x50')]:'N.A.','createdAt':moment(_0x52678c[_0xc0e5('0x87')])[_0xc0e5('0x75')](_0xc0e5('0xb8'))[_0xc0e5('0xaa')](),'closedAt':_0x52678c[_0xc0e5('0x63')]?moment(_0x52678c[_0xc0e5('0xb9')])[_0xc0e5('0x75')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x52678c[_0xc0e5('0x64')],'chatInfo':{'browser':_0x52678c[_0xc0e5('0xba')],'os':_0x52678c[_0xc0e5('0xbb')],'referer':_0x52678c[_0xc0e5('0xbc')],'customerIp':_0x52678c[_0xc0e5('0xbd')],'customerPort':_0x52678c['customerPort']?_0x52678c[_0xc0e5('0xbe')]:'N.A.'},'messages':_(_0x52678c[_0xc0e5('0x78')])[_0xc0e5('0xbf')]()[_0xc0e5('0x9d')]({'secret':![]})[_0xc0e5('0x32')](function(_0x3fedd3){if(_0x3fedd3[_0xc0e5('0x6b')]){var _0x436bb6=path[_0xc0e5('0x6f')](_0x5449e1,_0x3fedd3[_0xc0e5('0x6b')][_0xc0e5('0x73')]);if(fs[_0xc0e5('0xc0')](_0x436bb6)){fs[_0xc0e5('0xc1')](_0x436bb6)[_0xc0e5('0xc2')](fs[_0xc0e5('0xc3')](path[_0xc0e5('0x6f')](_0x460d94,_0x3fedd3[_0xc0e5('0x6b')][_0xc0e5('0x73')])));}}return{'date':moment(_0x3fedd3[_0xc0e5('0x87')])[_0xc0e5('0x75')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc0e5('0xaa')](),'sender':_0x3fedd3[_0xc0e5('0x89')]==='out'?_0x3fedd3[_0xc0e5('0x79')]?_0x3fedd3[_0xc0e5('0x79')][_0xc0e5('0x50')]:_0xc0e5('0x84'):_0x3fedd3[_0xc0e5('0xb0')][_0xc0e5('0xb1')]+(_0x3fedd3[_0xc0e5('0xb0')][_0xc0e5('0xb2')]?'\x20'+_0x3fedd3['Contact'][_0xc0e5('0xb2')]:''),'body':_0x3fedd3[_0xc0e5('0x6b')]?_0x3fedd3[_0xc0e5('0x6b')]['basename']:_0x3fedd3['body'],'direction':_0x3fedd3[_0xc0e5('0x89')]===_0xc0e5('0x5b')?'A':'C','secret':_0x3fedd3[_0xc0e5('0x8a')],'read':_0x3fedd3[_0xc0e5('0xc4')],'attachment':_0x3fedd3[_0xc0e5('0x6b')]};})['value']()};return ejs['renderFile'](path[_0xc0e5('0x6f')](config['root'],'server',_0xc0e5('0xc5'),_0xc0e5('0xc6')),{'interaction':_0x410d5a})[_0xc0e5('0x26')](function(_0x3f5fd6){var _0x30b951=path[_0xc0e5('0x6f')](_0x460d94,'transcript-'+_0x52678c['id']+'-'+_0xef5e5a+_0xc0e5('0xc7'));var _0x42f498={'path':_0x30b951,'channel':_0xc0e5('0xb7'),'interactionId':_0x52678c['id']};return pdf[_0xc0e5('0xc8')](_0x3f5fd6,_0x42f498);})[_0xc0e5('0x26')](function(){return new Promise(function(_0x46436f,_0x5f529a){zipdir(_0x460d94,{'saveTo':_0x4e7c7c},function(_0x31eb21,_0x3532a1){if(_0x31eb21)return _0x5f529a(_0x31eb21);return _0x46436f(_0x3532a1);});})['then'](function(){return new BPromise(function(_0x9257c6,_0x1805e8){rimraf(_0x460d94,function(_0x18a035){if(_0x18a035)_0x1805e8(_0x18a035);return _0x9257c6();});});})[_0xc0e5('0x26')](function(){return _0x42282e[_0xc0e5('0x74')](_0x4e7c7c,_0x266480,function(_0x5b9728){if(_0x5b9728){logger[_0xc0e5('0x18')](_0xc0e5('0xc9'),_0x5b9728);}else{fs['unlinkSync'](_0x4e7c7c);}});});});}else{return _0x42282e['sendStatus'](0xc8);}})[_0xc0e5('0x1c')](handleError(_0x42282e,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index b85d985..f0fa7c7 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4a4=['then','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3e35b9,_0x482ef8){var _0x558e83=function(_0x1d7b09){while(--_0x1d7b09){_0x3e35b9['push'](_0x3e35b9['shift']());}};_0x558e83(++_0x482ef8);}(_0xf4a4,0x151));var _0x4f4a=function(_0x20f962,_0x12974d){_0x20f962=_0x20f962-0x0;var _0x4df9d9=_0xf4a4[_0x20f962];return _0x4df9d9;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x4f4a('0x0'))['db'][_0x4f4a('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x4f4a('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4f4a('0x3')](0x0);var events={'afterCreate':_0x4f4a('0x4'),'afterUpdate':_0x4f4a('0x5'),'afterDestroy':_0x4f4a('0x6')};function emitEvent(_0x3d2852){return function(_0x3ff01e,_0x35a331,_0x38fe8e){_0x3ff01e[_0x4f4a('0x7')]({'attributes':['id'],'raw':!![]})[_0x4f4a('0x8')](function(_0x46f62b){_0x3ff01e[_0x4f4a('0x9')]('Users',_0x46f62b['map'](function(_0x568b14){return{'id':_0x568b14['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3ff01e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4f4a('0x8')](function(_0x12e184){_0x3ff01e[_0x4f4a('0x9')](_0x4f4a('0xa'),_0x12e184['length']);ChatInteractionEvents[_0x4f4a('0xb')](_0x3d2852+':'+_0x3ff01e['id'],_0x3ff01e);ChatInteractionEvents[_0x4f4a('0xb')](_0x3d2852,_0x3ff01e);_0x38fe8e(null);})[_0x4f4a('0xc')](_0x38fe8e(null));};}for(var e in events){if(events[_0x4f4a('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x4f4a('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xa42e=['getUsers','setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','setMaxListeners','update'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0xa42e,0xcd));var _0xea42=function(_0x1b7745,_0x49af5b){_0x1b7745=_0x1b7745-0x0;var _0x40f24f=_0xa42e[_0x1b7745];return _0x40f24f;};'use strict';var EventEmitter=require(_0xea42('0x0'));var ChatInteraction=require(_0xea42('0x1'))['db'][_0xea42('0x2')];var ChatMessage=require(_0xea42('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xea42('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xea42('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ca2e7){return function(_0x28aee4,_0x515f3a,_0x3a013b){_0x28aee4[_0xea42('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x423b90){_0x28aee4[_0xea42('0x6')](_0xea42('0x7'),_0x423b90['map'](function(_0x2b879c){return{'id':_0x2b879c['id']};}));return ChatMessage[_0xea42('0x8')]({'where':{'ChatInteractionId':_0x28aee4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x298993){_0x28aee4[_0xea42('0x6')]('unreadMessages',_0x298993[_0xea42('0x9')]);ChatInteractionEvents[_0xea42('0xa')](_0x4ca2e7+':'+_0x28aee4['id'],_0x28aee4);ChatInteractionEvents[_0xea42('0xa')](_0x4ca2e7,_0x28aee4);_0x3a013b(null);})[_0xea42('0xb')](_0x3a013b(null));};}for(var e in events){if(events[_0xea42('0xc')](e)){var event=events[e];ChatInteraction[_0xea42('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index ba8ea8b..f3877ae 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9d12=['format','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed'];(function(_0x598504,_0x595134){var _0x23bab6=function(_0x465053){while(--_0x465053){_0x598504['push'](_0x598504['shift']());}};_0x23bab6(++_0x595134);}(_0x9d12,0x173));var _0x29d1=function(_0xecf641,_0xbd2f8f){_0xecf641=_0xecf641-0x0;var _0x1e389b=_0x9d12[_0xecf641];return _0x1e389b;};'use strict';var _=require(_0x29d1('0x0'));var util=require(_0x29d1('0x1'));var logger=require(_0x29d1('0x2'))('api');var moment=require(_0x29d1('0x3'));var BPromise=require(_0x29d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29d1('0x5'));var rimraf=require(_0x29d1('0x6'));var config=require('../../config/environment');var attributes=require(_0x29d1('0x7'));module[_0x29d1('0x8')]=function(_0x37d177,_0x5cda5f){return _0x37d177[_0x29d1('0x9')]('ChatInteraction',attributes,{'tableName':_0x29d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8c9cf0,_0x279214,_0x5c5d0d){if(_0x8c9cf0[_0x29d1('0xb')](_0x29d1('0xc'))){_0x8c9cf0['closedAt']=moment()[_0x29d1('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5c5d0d(null,_0x8c9cf0);}},'charset':_0x29d1('0xe'),'collate':_0x29d1('0xf')});};
\ No newline at end of file
+var _0x145f=['path','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2399ad,_0x565649){var _0x1d8f84=function(_0x4d9fb0){while(--_0x4d9fb0){_0x2399ad['push'](_0x2399ad['shift']());}};_0x1d8f84(++_0x565649);}(_0x145f,0xc5));var _0xf145=function(_0x26bd13,_0x46162a){_0x26bd13=_0x26bd13-0x0;var _0x1bb69c=_0x145f[_0x26bd13];return _0x1bb69c;};'use strict';var _=require(_0xf145('0x0'));var util=require(_0xf145('0x1'));var logger=require(_0xf145('0x2'))(_0xf145('0x3'));var moment=require(_0xf145('0x4'));var BPromise=require(_0xf145('0x5'));var rp=require(_0xf145('0x6'));var fs=require('fs');var path=require(_0xf145('0x7'));var rimraf=require('rimraf');var config=require(_0xf145('0x8'));var attributes=require(_0xf145('0x9'));module['exports']=function(_0x2bb2ef,_0x2ae104){return _0x2bb2ef[_0xf145('0xa')](_0xf145('0xb'),attributes,{'tableName':_0xf145('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15875c,_0x3c39ec,_0x493b87){if(_0x15875c[_0xf145('0xd')](_0xf145('0xe'))){_0x15875c['closedAt']=moment()[_0xf145('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x493b87(null,_0x15875c);}},'charset':_0xf145('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 4dd659c..58ada0b 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7105=['ChatInteraction','update','body','options','raw','where','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','request','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch'];(function(_0x1a62f8,_0xbb6aa2){var _0x4a561c=function(_0x129d0d){while(--_0x129d0d){_0x1a62f8['push'](_0x1a62f8['shift']());}};_0x4a561c(++_0xbb6aa2);}(_0x7105,0xa4));var _0x5710=function(_0x5eb0fd,_0x17d8ef){_0x5eb0fd=_0x5eb0fd-0x0;var _0x22cb4a=_0x7105[_0x5eb0fd];return _0x22cb4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5710('0x0'));var BPromise=require(_0x5710('0x1'));var rs=require(_0x5710('0x2'));var fs=require('fs');var Redis=require(_0x5710('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5710('0x4'));var config=require(_0x5710('0x5'));var jayson=require(_0x5710('0x6'));var client=jayson[_0x5710('0x7')]['http']({'port':0x232a});config['redis']=_[_0x5710('0x8')](config[_0x5710('0x9')],{'host':_0x5710('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x49ec40,_0x3b47bb,_0x710be4){return new BPromise(function(_0x3cca86,_0x3d2d19){return client[_0x5710('0xb')](_0x49ec40,_0x710be4)['then'](function(_0xe6854a){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3b47bb,'request\x20sent');logger[_0x5710('0xc')](_0x5710('0xd'),_0x3b47bb,'request\x20sent',JSON[_0x5710('0xe')](_0xe6854a));if(_0xe6854a[_0x5710('0xf')]){if(_0xe6854a['error'][_0x5710('0x10')]===0x1f4){logger['error'](_0x5710('0x11'),_0x3b47bb,_0xe6854a['error'][_0x5710('0x12')]);return _0x3d2d19(_0xe6854a['error'][_0x5710('0x12')]);}logger[_0x5710('0xf')](_0x5710('0x11'),_0x3b47bb,_0xe6854a[_0x5710('0xf')][_0x5710('0x12')]);return _0x3cca86(_0xe6854a[_0x5710('0xf')][_0x5710('0x12')]);}else{logger[_0x5710('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x3b47bb,'request\x20sent');_0x3cca86(_0xe6854a['result'][_0x5710('0x12')]);}})[_0x5710('0x14')](function(_0x22482f){logger[_0x5710('0xf')](_0x5710('0x11'),_0x3b47bb,_0x22482f);_0x3d2d19(_0x22482f);});});}exports['UpdateChatInteraction']=function(_0x3b3e95){var _0x39753e=this;return new Promise(function(_0x5dcb75,_0x515ff4){return db[_0x5710('0x15')][_0x5710('0x16')](_0x3b3e95[_0x5710('0x17')],{'raw':_0x3b3e95[_0x5710('0x18')]?_0x3b3e95[_0x5710('0x18')][_0x5710('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b3e95['options']?_0x3b3e95[_0x5710('0x18')][_0x5710('0x1a')]||null:null,'attributes':_0x3b3e95[_0x5710('0x18')]?_0x3b3e95[_0x5710('0x18')]['attributes']||null:null,'limit':_0x3b3e95[_0x5710('0x18')]?_0x3b3e95[_0x5710('0x18')][_0x5710('0x1b')]||null:null})[_0x5710('0x1c')](function(_0x285a73){logger['info'](_0x5710('0x1d'),_0x3b3e95);logger[_0x5710('0xc')](_0x5710('0x1d'),_0x3b3e95,JSON[_0x5710('0xe')](_0x285a73));_0x5dcb75(_0x285a73);})[_0x5710('0x14')](function(_0x4db659){logger[_0x5710('0xf')](_0x5710('0x1d'),_0x4db659[_0x5710('0x12')],_0x3b3e95);_0x515ff4(_0x39753e[_0x5710('0xf')](0x1f4,_0x4db659['message']));});});};exports[_0x5710('0x1e')]=function(_0x1db148){return new Promise(function(_0x2b6475,_0x5d39af){return db[_0x5710('0x15')][_0x5710('0x1f')]({'where':_0x1db148['options']?_0x1db148[_0x5710('0x18')][_0x5710('0x1a')]||null:null})[_0x5710('0x1c')](function(_0x2d0363){if(_0x2d0363){return _0x2d0363[_0x5710('0x20')](_0x1db148[_0x5710('0x17')][_0x5710('0x21')],_[_0x5710('0x22')](_0x1db148[_0x5710('0x17')],[_0x5710('0x21'),'id'])||{});}})[_0x5710('0x23')](function(_0x19525a){logger[_0x5710('0x13')]('AddTags',_0x1db148);logger[_0x5710('0xc')](_0x5710('0x24'),_0x1db148,JSON['stringify'](_0x19525a));_0x2b6475(_0x19525a);})[_0x5710('0x14')](function(_0x1c0446){logger[_0x5710('0xf')](_0x5710('0x24'),_0x1c0446[_0x5710('0x12')],_0x1db148);_0x5d39af(_this[_0x5710('0xf')](0x1f4,_0x1c0446[_0x5710('0x12')]));});});};
\ No newline at end of file
+var _0x5656=['where','attributes','limit','ChatInteraction','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','update','body','options','raw'];(function(_0xe3cdae,_0x152d75){var _0x427679=function(_0x58539b){while(--_0x58539b){_0xe3cdae['push'](_0xe3cdae['shift']());}};_0x427679(++_0x152d75);}(_0x5656,0x1a1));var _0x6565=function(_0x1395d6,_0x5afcb1){_0x1395d6=_0x1395d6-0x0;var _0xe11ccc=_0x5656[_0x1395d6];return _0xe11ccc;};'use strict';var _=require(_0x6565('0x0'));var util=require('util');var moment=require(_0x6565('0x1'));var BPromise=require(_0x6565('0x2'));var rs=require(_0x6565('0x3'));var fs=require('fs');var Redis=require(_0x6565('0x4'));var db=require(_0x6565('0x5'))['db'];var utils=require(_0x6565('0x6'));var logger=require(_0x6565('0x7'))(_0x6565('0x8'));var config=require('../../config/environment');var jayson=require(_0x6565('0x9'));var client=jayson[_0x6565('0xa')][_0x6565('0xb')]({'port':0x232a});config[_0x6565('0xc')]=_[_0x6565('0xd')](config[_0x6565('0xc')],{'host':_0x6565('0xe'),'port':0x18eb});var socket=require(_0x6565('0xf'))(new Redis(config[_0x6565('0xc')]));require(_0x6565('0x10'))[_0x6565('0x11')](socket);function respondWithRpcPromise(_0xa156a,_0x2e6669,_0x1ae9cd){return new BPromise(function(_0x475bbc,_0x19ed59){return client[_0x6565('0x12')](_0xa156a,_0x1ae9cd)[_0x6565('0x13')](function(_0x41b774){logger[_0x6565('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2e6669,_0x6565('0x15'));logger[_0x6565('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2e6669,'request\x20sent',JSON[_0x6565('0x17')](_0x41b774));if(_0x41b774['error']){if(_0x41b774[_0x6565('0x18')]['code']===0x1f4){logger[_0x6565('0x18')](_0x6565('0x19'),_0x2e6669,_0x41b774[_0x6565('0x18')][_0x6565('0x1a')]);return _0x19ed59(_0x41b774['error'][_0x6565('0x1a')]);}logger['error'](_0x6565('0x19'),_0x2e6669,_0x41b774[_0x6565('0x18')][_0x6565('0x1a')]);return _0x475bbc(_0x41b774['error'][_0x6565('0x1a')]);}else{logger[_0x6565('0x14')](_0x6565('0x19'),_0x2e6669,_0x6565('0x15'));_0x475bbc(_0x41b774[_0x6565('0x1b')][_0x6565('0x1a')]);}})[_0x6565('0x1c')](function(_0x342901){logger[_0x6565('0x18')](_0x6565('0x19'),_0x2e6669,_0x342901);_0x19ed59(_0x342901);});});}exports[_0x6565('0x1d')]=function(_0x351611){var _0x49402f=this;return new Promise(function(_0x93a014,_0x5d818a){return db['ChatInteraction'][_0x6565('0x1e')](_0x351611[_0x6565('0x1f')],{'raw':_0x351611[_0x6565('0x20')]?_0x351611[_0x6565('0x20')][_0x6565('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x351611[_0x6565('0x20')]?_0x351611[_0x6565('0x20')][_0x6565('0x22')]||null:null,'attributes':_0x351611[_0x6565('0x20')]?_0x351611[_0x6565('0x20')][_0x6565('0x23')]||null:null,'limit':_0x351611[_0x6565('0x20')]?_0x351611['options'][_0x6565('0x24')]||null:null})[_0x6565('0x13')](function(_0x58d6d9){logger[_0x6565('0x14')](_0x6565('0x1d'),_0x351611);logger['debug']('UpdateChatInteraction',_0x351611,JSON[_0x6565('0x17')](_0x58d6d9));_0x93a014(_0x58d6d9);})[_0x6565('0x1c')](function(_0xcfa6e2){logger[_0x6565('0x18')]('UpdateChatInteraction',_0xcfa6e2[_0x6565('0x1a')],_0x351611);_0x5d818a(_0x49402f[_0x6565('0x18')](0x1f4,_0xcfa6e2['message']));});});};exports['AddTagsToChatInteraction']=function(_0x3e2f2a){return new Promise(function(_0x44c98b,_0x429d5b){return db[_0x6565('0x25')]['find']({'where':_0x3e2f2a[_0x6565('0x20')]?_0x3e2f2a[_0x6565('0x20')][_0x6565('0x22')]||null:null})[_0x6565('0x13')](function(_0x53fab1){if(_0x53fab1){return _0x53fab1['addTags'](_0x3e2f2a[_0x6565('0x1f')][_0x6565('0x26')],_['omit'](_0x3e2f2a[_0x6565('0x1f')],[_0x6565('0x26'),'id'])||{});}})[_0x6565('0x27')](function(_0x4c4df0){logger['info'](_0x6565('0x28'),_0x3e2f2a);logger[_0x6565('0x16')](_0x6565('0x28'),_0x3e2f2a,JSON['stringify'](_0x4c4df0));_0x44c98b(_0x4c4df0);})[_0x6565('0x1c')](function(_0x59f2a8){logger['error']('AddTags',_0x59f2a8[_0x6565('0x1a')],_0x3e2f2a);_0x429d5b(_this[_0x6565('0x18')](0x1f4,_0x59f2a8[_0x6565('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index d220781..ef6c2b0 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ab7=['remove','removeListener','register','length','./chatInteraction.events','save'];(function(_0x14dd0a,_0x4b7074){var _0x4ff564=function(_0x23444f){while(--_0x23444f){_0x14dd0a['push'](_0x14dd0a['shift']());}};_0x4ff564(++_0x4b7074);}(_0x6ab7,0x15a));var _0x76ab=function(_0x51168c,_0x2f3ea2){_0x51168c=_0x51168c-0x0;var _0x323bc0=_0x6ab7[_0x51168c];return _0x323bc0;};'use strict';var ChatInteractionEvents=require(_0x76ab('0x0'));var events=[_0x76ab('0x1'),_0x76ab('0x2'),'update'];function createListener(_0x37b7a0,_0x58c961){return function(_0x2c69e9){_0x58c961['emit'](_0x37b7a0,_0x2c69e9);};}function removeListener(_0x3e962b,_0x56e42e){return function(){ChatInteractionEvents[_0x76ab('0x3')](_0x3e962b,_0x56e42e);};}exports[_0x76ab('0x4')]=function(_0x21403c){for(var _0x43fc37=0x0,_0x40dfc1=events[_0x76ab('0x5')];_0x43fc37<_0x40dfc1;_0x43fc37++){var _0x394009=events[_0x43fc37];var _0x28d95d=createListener('chatInteraction:'+_0x394009,_0x21403c);ChatInteractionEvents['on'](_0x394009,_0x28d95d);}};
\ No newline at end of file
+var _0xc1fe=['update','emit','register','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x3f7101,_0x3af08b){var _0x1a30a0=function(_0x750e5b){while(--_0x750e5b){_0x3f7101['push'](_0x3f7101['shift']());}};_0x1a30a0(++_0x3af08b);}(_0xc1fe,0xdd));var _0xec1f=function(_0x1e97be,_0x576484){_0x1e97be=_0x1e97be-0x0;var _0x3def0f=_0xc1fe[_0x1e97be];return _0x3def0f;};'use strict';var ChatInteractionEvents=require(_0xec1f('0x0'));var events=[_0xec1f('0x1'),_0xec1f('0x2'),_0xec1f('0x3')];function createListener(_0x5e1e48,_0x381316){return function(_0x582c11){_0x381316[_0xec1f('0x4')](_0x5e1e48,_0x582c11);};}function removeListener(_0x27ed11,_0x53befb){return function(){ChatInteractionEvents['removeListener'](_0x27ed11,_0x53befb);};}exports[_0xec1f('0x5')]=function(_0x3bdb30){for(var _0x4e267b=0x0,_0x504d96=events['length'];_0x4e267b<_0x504d96;_0x4e267b++){var _0x30206b=events[_0x4e267b];var _0x1e9b65=createListener(_0xec1f('0x6')+_0x30206b,_0x3bdb30);ChatInteractionEvents['on'](_0x30206b,_0x1e9b65);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 0ce1029..2517169 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x488f=['/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','customUpdate','/:id/abandon','abandon','close','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index'];(function(_0x294095,_0x29e946){var _0xd5f54=function(_0x8e8630){while(--_0x8e8630){_0x294095['push'](_0x294095['shift']());}};_0xd5f54(++_0x29e946);}(_0x488f,0x89));var _0xf488=function(_0x265c9f,_0x435dba){_0x265c9f=_0x265c9f-0x0;var _0x3fbd7d=_0x488f[_0x265c9f];return _0x3fbd7d;};'use strict';var multer=require(_0xf488('0x0'));var util=require(_0xf488('0x1'));var path=require('path');var timeout=require(_0xf488('0x2'));var express=require(_0xf488('0x3'));var router=express[_0xf488('0x4')]();var fs_extra=require(_0xf488('0x5'));var auth=require(_0xf488('0x6'));var interaction=require(_0xf488('0x7'));var config=require(_0xf488('0x8'));var controller=require(_0xf488('0x9'));router[_0xf488('0xa')]('/',auth[_0xf488('0xb')](),controller[_0xf488('0xc')]);router['get'](_0xf488('0xd'),auth[_0xf488('0xb')](),controller[_0xf488('0xe')]);router[_0xf488('0xa')](_0xf488('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xf488('0x10')]);router[_0xf488('0xa')](_0xf488('0x11'),auth[_0xf488('0x12')](),controller[_0xf488('0x13')]);router[_0xf488('0xa')](_0xf488('0x14'),auth[_0xf488('0xb')](),controller['getMessages']);router[_0xf488('0xa')]('/:id/my_messages',auth[_0xf488('0x12')](),controller[_0xf488('0x15')]);router[_0xf488('0xa')](_0xf488('0x16'),auth[_0xf488('0xb')](),controller['download']);router[_0xf488('0x17')]('/',auth['isAuthenticated'](),controller[_0xf488('0x18')]);router[_0xf488('0x17')](_0xf488('0x19'),auth[_0xf488('0xb')](),controller[_0xf488('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5d8192,_0x32ae85,_0x5146a7){_0x5146a7(null,path[_0xf488('0x1b')](config[_0xf488('0x1c')],_0xf488('0x1d')));},'filename':function(_0x2f878c,_0x2f5f05,_0x44d906){_0x44d906(null,util[_0xf488('0x1e')](_0xf488('0x1f'),Date[_0xf488('0x20')](),_0x2f5f05[_0xf488('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf488('0x17')]('/:id/attachment_upload',upload['single']('file'),controller[_0xf488('0x22')]);router[_0xf488('0x17')](_0xf488('0x14'),auth[_0xf488('0x12')](),controller[_0xf488('0x23')]);router[_0xf488('0x17')](_0xf488('0x24'),auth[_0xf488('0xb')](),interaction[_0xf488('0x25')](_0xf488('0x26'),_0xf488('0x27')),controller[_0xf488('0x28')]);router[_0xf488('0x29')](_0xf488('0xf'),auth[_0xf488('0xb')](),interaction[_0xf488('0x25')]('chat',_0xf488('0x2a')),controller['update']);router[_0xf488('0x29')]('/:id/custom_update',controller[_0xf488('0x2b')]);router['put'](_0xf488('0x2c'),auth[_0xf488('0x12')](),controller[_0xf488('0x2d')]);router[_0xf488('0x29')]('/:id/close',controller[_0xf488('0x2e')]);router[_0xf488('0x2f')]('/:id',auth[_0xf488('0xb')](),interaction['tracked']('chat','chatinteraction:destroy'),controller['destroy']);router[_0xf488('0x2f')](_0xf488('0x24'),auth['isAuthenticated'](),controller[_0xf488('0x30')]);module[_0xf488('0x31')]=router;
\ No newline at end of file
+var _0xdf49=['%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chat','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','createVidaooSession','diskStorage','join','root','format'];(function(_0x223c57,_0x25e922){var _0x5ce105=function(_0x37ae6b){while(--_0x37ae6b){_0x223c57['push'](_0x223c57['shift']());}};_0x5ce105(++_0x25e922);}(_0xdf49,0xbe));var _0x9df4=function(_0x32b3c2,_0xe56fd){_0x32b3c2=_0x32b3c2-0x0;var _0x40a313=_0xdf49[_0x32b3c2];return _0x40a313;};'use strict';var multer=require(_0x9df4('0x0'));var util=require(_0x9df4('0x1'));var path=require(_0x9df4('0x2'));var timeout=require(_0x9df4('0x3'));var express=require('express');var router=express[_0x9df4('0x4')]();var fs_extra=require(_0x9df4('0x5'));var auth=require(_0x9df4('0x6'));var interaction=require(_0x9df4('0x7'));var config=require(_0x9df4('0x8'));var controller=require(_0x9df4('0x9'));router['get']('/',auth[_0x9df4('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x9df4('0xb')](_0x9df4('0xc'),auth[_0x9df4('0xd')](),controller[_0x9df4('0xe')]);router[_0x9df4('0xb')](_0x9df4('0xf'),auth[_0x9df4('0xd')](),controller[_0x9df4('0x10')]);router[_0x9df4('0xb')](_0x9df4('0x11'),auth['isAuthenticated'](),controller[_0x9df4('0x12')]);router[_0x9df4('0xb')](_0x9df4('0x13'),auth[_0x9df4('0xd')](),controller[_0x9df4('0x14')]);router[_0x9df4('0xb')](_0x9df4('0x15'),auth[_0x9df4('0xa')](),controller[_0x9df4('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9df4('0x17')]);router[_0x9df4('0x18')]('/:id/vidaoo',auth[_0x9df4('0xa')](),controller[_0x9df4('0x19')]);var upload=multer({'storage':multer[_0x9df4('0x1a')]({'destination':function(_0x47244a,_0x34da6b,_0x1e4bed){_0x1e4bed(null,path[_0x9df4('0x1b')](config[_0x9df4('0x1c')],'server/files/attachments/'));},'filename':function(_0x3ed988,_0x3d7856,_0x3425db){_0x3425db(null,util[_0x9df4('0x1d')](_0x9df4('0x1e'),Date[_0x9df4('0x1f')](),_0x3d7856[_0x9df4('0x20')][_0x9df4('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9df4('0x18')]('/:id/attachment_upload',upload[_0x9df4('0x22')](_0x9df4('0x23')),controller[_0x9df4('0x24')]);router[_0x9df4('0x18')](_0x9df4('0x11'),auth[_0x9df4('0xd')](),controller[_0x9df4('0x25')]);router[_0x9df4('0x18')](_0x9df4('0x26'),auth[_0x9df4('0xa')](),interaction[_0x9df4('0x27')]('chat','chatinteraction:addtags'),controller[_0x9df4('0x28')]);router[_0x9df4('0x29')](_0x9df4('0xc'),auth['isAuthenticated'](),interaction[_0x9df4('0x27')]('chat',_0x9df4('0x2a')),controller[_0x9df4('0x2b')]);router[_0x9df4('0x29')](_0x9df4('0x2c'),controller[_0x9df4('0x2d')]);router[_0x9df4('0x29')](_0x9df4('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0x9df4('0x2f')]);router[_0x9df4('0x29')](_0x9df4('0x30'),controller[_0x9df4('0x31')]);router[_0x9df4('0x32')](_0x9df4('0xc'),auth[_0x9df4('0xa')](),interaction[_0x9df4('0x27')](_0x9df4('0x33'),'chatinteraction:destroy'),controller[_0x9df4('0x34')]);router[_0x9df4('0x32')]('/:id/tags',auth[_0x9df4('0xa')](),controller[_0x9df4('0x35')]);module[_0x9df4('0x36')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index e940a57..33d59b9 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2b8c=['medium','BOOLEAN','INTEGER','TEXT'];(function(_0x3e53d2,_0x56ac2b){var _0xfb1cd3=function(_0x42f75b){while(--_0x42f75b){_0x3e53d2['push'](_0x3e53d2['shift']());}};_0xfb1cd3(++_0x56ac2b);}(_0x2b8c,0x147));var _0xc2b8=function(_0x4c2b79,_0x4c064d){_0x4c2b79=_0x4c2b79-0x0;var _0x45063f=_0x2b8c[_0x4c2b79];return _0x45063f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xc2b8('0x0')](_0xc2b8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xc2b8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xc2b8('0x3')]}};
\ No newline at end of file
+var _0xd8d0=['exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd8d0,0x1db));var _0x0d8d=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xd8d0[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require('sequelize');module[_0x0d8d('0x0')]={'body':{'type':Sequelize[_0x0d8d('0x1')](_0x0d8d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0d8d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x0d8d('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index a813985..5b2b68a 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf7fc=['eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','ChatInternalMessage','rawAttributes','type','model','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','merge','where','VIRTUAL','filter','includeAll','include','catch','show','length','find','create','body','params','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueues','get','Agents','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all'];(function(_0x432ca9,_0x5251ce){var _0x6531b9=function(_0x51a9c0){while(--_0x51a9c0){_0x432ca9['push'](_0x432ca9['shift']());}};_0x6531b9(++_0x5251ce);}(_0xf7fc,0x6a));var _0xcf7f=function(_0x1a2d46,_0x19bd98){_0x1a2d46=_0x1a2d46-0x0;var _0x48b660=_0xf7fc[_0x1a2d46];return _0x48b660;};'use strict';var emlformat=require(_0xcf7f('0x0'));var rimraf=require(_0xcf7f('0x1'));var zipdir=require(_0xcf7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcf7f('0x4'));var util=require(_0xcf7f('0x5'));var path=require(_0xcf7f('0x6'));var sox=require(_0xcf7f('0x7'));var csv=require(_0xcf7f('0x8'));var ejs=require(_0xcf7f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf7f('0xa'));var squel=require(_0xcf7f('0xb'));var crypto=require(_0xcf7f('0xc'));var jsforce=require(_0xcf7f('0xd'));var deskjs=require(_0xcf7f('0xe'));var toCsv=require(_0xcf7f('0x8'));var querystring=require(_0xcf7f('0xf'));var Papa=require(_0xcf7f('0x10'));var Redis=require(_0xcf7f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcf7f('0x12'));var as=require(_0xcf7f('0x13'));var hardwareService=require(_0xcf7f('0x14'));var logger=require('../../config/logger')(_0xcf7f('0x15'));var utils=require(_0xcf7f('0x16'));var config=require(_0xcf7f('0x17'));var licenseUtil=require(_0xcf7f('0x18'));var db=require(_0xcf7f('0x19'))['db'];config['redis']=_[_0xcf7f('0x1a')](config[_0xcf7f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf7f('0x1c'))(new Redis(config['redis']));require(_0xcf7f('0x1d'))[_0xcf7f('0x1e')](socket);function respondWithStatusCode(_0x3d82ab,_0x3b0e0a){_0x3b0e0a=_0x3b0e0a||0xcc;return function(_0x43e8f2){if(_0x43e8f2){return _0x3d82ab[_0xcf7f('0x1f')](_0x3b0e0a);}return _0x3d82ab[_0xcf7f('0x20')](_0x3b0e0a)[_0xcf7f('0x21')]();};}function respondWithResult(_0x581cd5,_0x548b76){_0x548b76=_0x548b76||0xc8;return function(_0x538b26){if(_0x538b26){return _0x581cd5['status'](_0x548b76)[_0xcf7f('0x22')](_0x538b26);}};}function respondWithFilteredResult(_0x1bbbfb,_0x51a252){return function(_0xf10e01){if(_0xf10e01){var _0xe3e7d8=typeof _0x51a252[_0xcf7f('0x23')]==='undefined'&&typeof _0x51a252[_0xcf7f('0x24')]==='undefined';var _0x291849=_0xf10e01[_0xcf7f('0x25')];var _0xe1da1a=_0xe3e7d8?0x0:_0x51a252[_0xcf7f('0x23')];var _0x2cf936=_0xe3e7d8?_0xf10e01[_0xcf7f('0x25')]:_0x51a252[_0xcf7f('0x23')]+_0x51a252[_0xcf7f('0x24')];var _0x293842;if(_0x2cf936>=_0x291849){_0x2cf936=_0x291849;_0x293842=0xc8;}else{_0x293842=0xce;}_0x1bbbfb[_0xcf7f('0x20')](_0x293842);return _0x1bbbfb[_0xcf7f('0x26')](_0xcf7f('0x27'),_0xe1da1a+'-'+_0x2cf936+'/'+_0x291849)['json'](_0xf10e01);}return null;};}function patchUpdates(_0x4ae600){return function(_0x5039d4){try{jsonpatch['apply'](_0x5039d4,_0x4ae600,!![]);}catch(_0x4c0204){return BPromise['reject'](_0x4c0204);}return _0x5039d4[_0xcf7f('0x28')]();};}function saveUpdates(_0x5b364a,_0xd2630){return function(_0x105123){if(_0x105123){return _0x105123[_0xcf7f('0x29')](_0x5b364a)[_0xcf7f('0x2a')](function(_0x3f4574){return _0x3f4574;});}return null;};}function removeEntity(_0x905d34,_0xbe24b){return function(_0x5ba178){if(_0x5ba178){return _0x5ba178[_0xcf7f('0x2b')]()['then'](function(){_0x905d34[_0xcf7f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x518e44,_0x3ee97a){return function(_0x411547){if(!_0x411547){_0x518e44[_0xcf7f('0x1f')](0x194);}return _0x411547;};}function handleError(_0x2b5ff7,_0xb7189f){_0xb7189f=_0xb7189f||0x1f4;return function(_0x3d1948){logger[_0xcf7f('0x2c')](_0x3d1948['stack']);if(_0x3d1948['name']){delete _0x3d1948[_0xcf7f('0x2d')];}_0x2b5ff7[_0xcf7f('0x20')](_0xb7189f)[_0xcf7f('0x2e')](_0x3d1948);};}exports[_0xcf7f('0x2f')]=function(_0x33b973,_0x3f5d46){var _0x32e3bc={},_0x9a6b24={},_0x4ae277={'count':0x0,'rows':[]};var _0x3e6dc0=_[_0xcf7f('0x30')](db[_0xcf7f('0x31')][_0xcf7f('0x32')],function(_0x200183){return{'name':_0x200183['fieldName'],'type':_0x200183[_0xcf7f('0x33')]['key']};});_0x9a6b24[_0xcf7f('0x34')]=_[_0xcf7f('0x30')](_0x3e6dc0,'name');_0x9a6b24[_0xcf7f('0x35')]=_[_0xcf7f('0x36')](_0x33b973[_0xcf7f('0x35')]);_0x9a6b24['filters']=_['intersection'](_0x9a6b24[_0xcf7f('0x34')],_0x9a6b24[_0xcf7f('0x35')]);_0x32e3bc[_0xcf7f('0x37')]=_[_0xcf7f('0x38')](_0x9a6b24[_0xcf7f('0x34')],qs[_0xcf7f('0x39')](_0x33b973[_0xcf7f('0x35')]['fields']));_0x32e3bc[_0xcf7f('0x37')]=_0x32e3bc[_0xcf7f('0x37')]['length']?_0x32e3bc[_0xcf7f('0x37')]:_0x9a6b24[_0xcf7f('0x34')];if(!_0x33b973[_0xcf7f('0x35')]['hasOwnProperty'](_0xcf7f('0x3a'))){_0x32e3bc[_0xcf7f('0x24')]=qs['limit'](_0x33b973[_0xcf7f('0x35')][_0xcf7f('0x24')]);_0x32e3bc['offset']=qs[_0xcf7f('0x23')](_0x33b973[_0xcf7f('0x35')]['offset']);}_0x32e3bc[_0xcf7f('0x3b')]=qs[_0xcf7f('0x3c')](_0x33b973[_0xcf7f('0x35')]['sort']);_0x32e3bc['where']=qs[_0xcf7f('0x3d')](_[_0xcf7f('0x3e')](_0x33b973[_0xcf7f('0x35')],_0x9a6b24['filters']),_0x3e6dc0);if(_0x33b973['query']['filter']){_0x32e3bc['where']=_[_0xcf7f('0x3f')](_0x32e3bc[_0xcf7f('0x40')],{'$or':_[_0xcf7f('0x30')](_0x3e6dc0,function(_0x3d39b7){if(_0x3d39b7[_0xcf7f('0x33')]!==_0xcf7f('0x41')){var _0x35c1e4={};_0x35c1e4[_0x3d39b7[_0xcf7f('0x2d')]]={'$like':'%'+_0x33b973[_0xcf7f('0x35')][_0xcf7f('0x42')]+'%'};return _0x35c1e4;}})});}_0x32e3bc=_[_0xcf7f('0x3f')]({},_0x32e3bc,_0x33b973['options']);var _0x5d753c={'where':_0x32e3bc[_0xcf7f('0x40')]};return db[_0xcf7f('0x31')]['count'](_0x5d753c)[_0xcf7f('0x2a')](function(_0x53a197){_0x4ae277['count']=_0x53a197;if(_0x33b973[_0xcf7f('0x35')][_0xcf7f('0x43')]){_0x32e3bc[_0xcf7f('0x44')]=[{'all':!![]}];}return db[_0xcf7f('0x31')]['findAll'](_0x32e3bc);})['then'](function(_0x43b235){_0x4ae277['rows']=_0x43b235;return _0x4ae277;})[_0xcf7f('0x2a')](respondWithFilteredResult(_0x3f5d46,_0x32e3bc))[_0xcf7f('0x45')](handleError(_0x3f5d46,null));};exports[_0xcf7f('0x46')]=function(_0x38fbb7,_0x4b72f8){var _0x46fecd={'raw':!![],'where':{'id':_0x38fbb7['params']['id']}},_0x12551d={};_0x12551d[_0xcf7f('0x34')]=_[_0xcf7f('0x36')](db['ChatInternalMessage'][_0xcf7f('0x32')]);_0x12551d[_0xcf7f('0x35')]=_[_0xcf7f('0x36')](_0x38fbb7[_0xcf7f('0x35')]);_0x12551d[_0xcf7f('0x3d')]=_[_0xcf7f('0x38')](_0x12551d[_0xcf7f('0x34')],_0x12551d[_0xcf7f('0x35')]);_0x46fecd['attributes']=_[_0xcf7f('0x38')](_0x12551d[_0xcf7f('0x34')],qs[_0xcf7f('0x39')](_0x38fbb7[_0xcf7f('0x35')][_0xcf7f('0x39')]));_0x46fecd[_0xcf7f('0x37')]=_0x46fecd[_0xcf7f('0x37')][_0xcf7f('0x47')]?_0x46fecd[_0xcf7f('0x37')]:_0x12551d[_0xcf7f('0x34')];if(_0x38fbb7[_0xcf7f('0x35')]['includeAll']){_0x46fecd[_0xcf7f('0x44')]=[{'all':!![]}];}_0x46fecd=_[_0xcf7f('0x3f')]({},_0x46fecd,_0x38fbb7['options']);return db[_0xcf7f('0x31')][_0xcf7f('0x48')](_0x46fecd)[_0xcf7f('0x2a')](handleEntityNotFound(_0x4b72f8,null))[_0xcf7f('0x2a')](respondWithResult(_0x4b72f8,null))[_0xcf7f('0x45')](handleError(_0x4b72f8,null));};exports['create']=function(_0x25f8d9,_0x4fe318){return db[_0xcf7f('0x31')][_0xcf7f('0x49')](_0x25f8d9['body'],{})[_0xcf7f('0x2a')](respondWithResult(_0x4fe318,0xc9))['catch'](handleError(_0x4fe318,null));};exports['update']=function(_0x3b15f2,_0x181bc1){if(_0x3b15f2[_0xcf7f('0x4a')]['id']){delete _0x3b15f2[_0xcf7f('0x4a')]['id'];}return db[_0xcf7f('0x31')][_0xcf7f('0x48')]({'where':{'id':_0x3b15f2[_0xcf7f('0x4b')]['id']}})[_0xcf7f('0x2a')](handleEntityNotFound(_0x181bc1,null))['then'](saveUpdates(_0x3b15f2[_0xcf7f('0x4a')],null))[_0xcf7f('0x2a')](respondWithResult(_0x181bc1,null))['catch'](handleError(_0x181bc1,null));};exports[_0xcf7f('0x2b')]=function(_0x5942b3,_0x4853ee){return db[_0xcf7f('0x31')][_0xcf7f('0x48')]({'where':{'id':_0x5942b3[_0xcf7f('0x4b')]['id']}})[_0xcf7f('0x2a')](handleEntityNotFound(_0x4853ee,null))[_0xcf7f('0x2a')](removeEntity(_0x4853ee,null))['catch'](handleError(_0x4853ee,null));};exports[_0xcf7f('0x4c')]=function(_0x3f2da8,_0x512937){return db['ChatInternalMessage']['describe']()[_0xcf7f('0x2a')](respondWithResult(_0x512937,null))[_0xcf7f('0x45')](handleError(_0x512937,null));};function wrapUser(_0x467f9f){return function(_0x35d7a2){var _0x118aa4=_0x467f9f['get']({'plain':!![]});_0x118aa4[_0xcf7f('0x4d')]=[];if(_0x35d7a2){_0x118aa4[_0xcf7f('0x4e')]=_0x35d7a2[_0xcf7f('0x4f')];_0x118aa4[_0xcf7f('0x50')]=_0x35d7a2;}else{_0x118aa4[_0xcf7f('0x4e')]=moment(0x0)[_0xcf7f('0x51')](_0xcf7f('0x52'));_0x118aa4[_0xcf7f('0x50')]={};}return _0x118aa4;};}exports['getUsers']=function(_0xaede00,_0x581e1c,_0x5ba1e2){var _0x21cbb7=[];return db[_0xcf7f('0x53')][_0xcf7f('0x54')]({'where':{'role':[_0xcf7f('0x55'),_0xcf7f('0x56'),_0xcf7f('0x57')]},'attributes':['id',_0xcf7f('0x58'),_0xcf7f('0x2d'),_0xcf7f('0x59'),_0xcf7f('0x5a'),_0xcf7f('0x5b'),_0xcf7f('0x5c'),_0xcf7f('0x5d'),_0xcf7f('0x5e'),'showWebBar'],'order':qs[_0xcf7f('0x3c')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0xcf7f('0x5f'),'attributes':['id',_0xcf7f('0x2d'),_0xcf7f('0x33')],'through':{'attributes':[]}}]})[_0xcf7f('0x2a')](function(_0x18398f){if(_0x18398f){var _0x2ea2e2=_0xaede00[_0xcf7f('0x57')][_0xcf7f('0x60')]({'plain':!![]});if(!_0x2ea2e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ea2e2[_0xcf7f('0x59')]===_0xcf7f('0x57')){return db['UserProfileSection']['find']({'where':{'name':_0xcf7f('0x61'),'userProfileId':_0x2ea2e2['userProfileId']},'raw':!![]})[_0xcf7f('0x2a')](function(_0x3d4112){if(_0x3d4112){if(_0x3d4112[_0xcf7f('0x62')]===0x0){return db[_0xcf7f('0x63')]['findAll']({'where':{'sectionId':_0x3d4112['id']},'raw':!![]})[_0xcf7f('0x2a')](function(_0x5e318e){var _0x3a3950=[];if(_[_0xcf7f('0x64')](_0x5e318e)){_0x3a3950=_[_0xcf7f('0x42')](_0x18398f,function(_0x88261c){if(_0x88261c[_0xcf7f('0x59')]!==_0xcf7f('0x55')){return _0x88261c;}});return _0x3a3950;}else{for(var _0x42d82f=0x0;_0x42d82f<_0x18398f[_0xcf7f('0x47')];_0x42d82f++){var _0x1cd12e=_0x18398f[_0x42d82f];if(_0x1cd12e[_0xcf7f('0x59')]==='agent'){var _0xbb2263=_['find'](_0x5e318e,function(_0x408800){return _0x408800['resourceId']===_0x1cd12e['id'];});if(_0xbb2263)_0x3a3950[_0xcf7f('0x65')](_0x1cd12e);}else{_0x3a3950[_0xcf7f('0x65')](_0x1cd12e);}}return _0x3a3950;}});}else{return _0x18398f;}}else{var _0x10293a=_[_0xcf7f('0x42')](_0x18398f,function(_0xcaadbc){if(_0xcaadbc[_0xcf7f('0x59')]!=='agent'){return _0xcaadbc;}});return _0x10293a;}});}else{return _0x18398f;}}})[_0xcf7f('0x2a')](function(_0x30badb){var _0x2236fc=[];if(_0x30badb){_0x21cbb7=_0x30badb;for(var _0x4e6f64=0x0;_0x4e6f64<_0x30badb['length'];_0x4e6f64+=0x1){_0x21cbb7[_0x4e6f64]['messages']=[];_0x2236fc[_0xcf7f('0x65')](db[_0xcf7f('0x31')][_0xcf7f('0x48')]({'where':{'FromId':[_0xaede00[_0xcf7f('0x57')]['id'],_0x30badb[_0x4e6f64]['id']],'ToId':[_0xaede00[_0xcf7f('0x57')]['id'],_0x30badb[_0x4e6f64]['id']],'ChatGroupId':null},'attributes':['id',_0xcf7f('0x4f'),_0xcf7f('0x66'),'ToId',_0xcf7f('0x67'),_0xcf7f('0x4a')],'order':qs['sort'](_0xcf7f('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x30badb[_0x4e6f64])));}return BPromise[_0xcf7f('0x69')](_0x2236fc);}return[];})['then'](function(_0x6532b1){return{'rows':_0x6532b1,'count':_0x6532b1[_0xcf7f('0x47')]};})[_0xcf7f('0x2a')](respondWithResult(_0x581e1c,null))['catch'](handleError(_0x581e1c,null));};
\ No newline at end of file
+var _0xc1f4=['catch','params','include','find','create','body','update','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','role','userpic','online','showWebBar','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','isEmpty','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows'];(function(_0x334444,_0x20403c){var _0x303741=function(_0x2c7753){while(--_0x2c7753){_0x334444['push'](_0x334444['shift']());}};_0x303741(++_0x20403c);}(_0xc1f4,0x1d7));var _0x4c1f=function(_0x29abe6,_0x39ef28){_0x29abe6=_0x29abe6-0x0;var _0x4f91aa=_0xc1f4[_0x29abe6];return _0x4f91aa;};'use strict';var emlformat=require(_0x4c1f('0x0'));var rimraf=require(_0x4c1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c1f('0x2'));var rp=require('request-promise');var moment=require(_0x4c1f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c1f('0x4'));var util=require(_0x4c1f('0x5'));var path=require('path');var sox=require(_0x4c1f('0x6'));var csv=require('to-csv');var ejs=require(_0x4c1f('0x7'));var fs=require('fs');var fs_extra=require(_0x4c1f('0x8'));var _=require('lodash');var squel=require(_0x4c1f('0x9'));var crypto=require(_0x4c1f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4c1f('0xb'));var toCsv=require(_0x4c1f('0xc'));var querystring=require(_0x4c1f('0xd'));var Papa=require('papaparse');var Redis=require(_0x4c1f('0xe'));var authService=require(_0x4c1f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4c1f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c1f('0x11'))(_0x4c1f('0x12'));var utils=require(_0x4c1f('0x13'));var config=require(_0x4c1f('0x14'));var licenseUtil=require(_0x4c1f('0x15'));var db=require(_0x4c1f('0x16'))['db'];config[_0x4c1f('0x17')]=_[_0x4c1f('0x18')](config[_0x4c1f('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c1f('0x19'))(new Redis(config[_0x4c1f('0x17')]));require(_0x4c1f('0x1a'))[_0x4c1f('0x1b')](socket);function respondWithStatusCode(_0x18f13d,_0xc811e9){_0xc811e9=_0xc811e9||0xcc;return function(_0x6e3238){if(_0x6e3238){return _0x18f13d[_0x4c1f('0x1c')](_0xc811e9);}return _0x18f13d[_0x4c1f('0x1d')](_0xc811e9)[_0x4c1f('0x1e')]();};}function respondWithResult(_0x1f6bfb,_0x38b0e4){_0x38b0e4=_0x38b0e4||0xc8;return function(_0x334a1f){if(_0x334a1f){return _0x1f6bfb[_0x4c1f('0x1d')](_0x38b0e4)[_0x4c1f('0x1f')](_0x334a1f);}};}function respondWithFilteredResult(_0xd06c51,_0x33fb61){return function(_0x5c0506){if(_0x5c0506){var _0x4eef28=typeof _0x33fb61[_0x4c1f('0x20')]===_0x4c1f('0x21')&&typeof _0x33fb61[_0x4c1f('0x22')]==='undefined';var _0x41607d=_0x5c0506[_0x4c1f('0x23')];var _0x4ca17b=_0x4eef28?0x0:_0x33fb61[_0x4c1f('0x20')];var _0x59c391=_0x4eef28?_0x5c0506[_0x4c1f('0x23')]:_0x33fb61[_0x4c1f('0x20')]+_0x33fb61['limit'];var _0xe48a67;if(_0x59c391>=_0x41607d){_0x59c391=_0x41607d;_0xe48a67=0xc8;}else{_0xe48a67=0xce;}_0xd06c51[_0x4c1f('0x1d')](_0xe48a67);return _0xd06c51[_0x4c1f('0x24')](_0x4c1f('0x25'),_0x4ca17b+'-'+_0x59c391+'/'+_0x41607d)[_0x4c1f('0x1f')](_0x5c0506);}return null;};}function patchUpdates(_0x41ccb6){return function(_0x26ab6a){try{jsonpatch[_0x4c1f('0x26')](_0x26ab6a,_0x41ccb6,!![]);}catch(_0x502ff4){return BPromise['reject'](_0x502ff4);}return _0x26ab6a['save']();};}function saveUpdates(_0x19697b,_0x541a02){return function(_0x3a411b){if(_0x3a411b){return _0x3a411b['update'](_0x19697b)[_0x4c1f('0x27')](function(_0x9d2452){return _0x9d2452;});}return null;};}function removeEntity(_0x3de0b8,_0x123397){return function(_0xaa106a){if(_0xaa106a){return _0xaa106a[_0x4c1f('0x28')]()['then'](function(){_0x3de0b8[_0x4c1f('0x1d')](0xcc)[_0x4c1f('0x1e')]();});}};}function handleEntityNotFound(_0x1b0704,_0x390ce0){return function(_0x5f3649){if(!_0x5f3649){_0x1b0704[_0x4c1f('0x1c')](0x194);}return _0x5f3649;};}function handleError(_0x451977,_0x2153aa){_0x2153aa=_0x2153aa||0x1f4;return function(_0x12a1b7){logger[_0x4c1f('0x29')](_0x12a1b7[_0x4c1f('0x2a')]);if(_0x12a1b7[_0x4c1f('0x2b')]){delete _0x12a1b7[_0x4c1f('0x2b')];}_0x451977['status'](_0x2153aa)[_0x4c1f('0x2c')](_0x12a1b7);};}exports[_0x4c1f('0x2d')]=function(_0x45e542,_0x2a8927){var _0x5d0915={},_0x356090={},_0x357270={'count':0x0,'rows':[]};var _0x128654=_[_0x4c1f('0x2e')](db[_0x4c1f('0x2f')][_0x4c1f('0x30')],function(_0x152283){return{'name':_0x152283[_0x4c1f('0x31')],'type':_0x152283[_0x4c1f('0x32')][_0x4c1f('0x33')]};});_0x356090[_0x4c1f('0x34')]=_[_0x4c1f('0x2e')](_0x128654,_0x4c1f('0x2b'));_0x356090[_0x4c1f('0x35')]=_[_0x4c1f('0x36')](_0x45e542[_0x4c1f('0x35')]);_0x356090[_0x4c1f('0x37')]=_[_0x4c1f('0x38')](_0x356090[_0x4c1f('0x34')],_0x356090['query']);_0x5d0915['attributes']=_[_0x4c1f('0x38')](_0x356090['model'],qs[_0x4c1f('0x39')](_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x39')]));_0x5d0915[_0x4c1f('0x3a')]=_0x5d0915[_0x4c1f('0x3a')][_0x4c1f('0x3b')]?_0x5d0915[_0x4c1f('0x3a')]:_0x356090[_0x4c1f('0x34')];if(!_0x45e542[_0x4c1f('0x35')]['hasOwnProperty']('nolimit')){_0x5d0915[_0x4c1f('0x22')]=qs['limit'](_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x22')]);_0x5d0915[_0x4c1f('0x20')]=qs['offset'](_0x45e542['query'][_0x4c1f('0x20')]);}_0x5d0915['order']=qs[_0x4c1f('0x3c')](_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x3c')]);_0x5d0915[_0x4c1f('0x3d')]=qs['filters'](_[_0x4c1f('0x3e')](_0x45e542[_0x4c1f('0x35')],_0x356090['filters']),_0x128654);if(_0x45e542[_0x4c1f('0x35')]['filter']){_0x5d0915['where']=_[_0x4c1f('0x3f')](_0x5d0915[_0x4c1f('0x3d')],{'$or':_[_0x4c1f('0x2e')](_0x128654,function(_0x345610){if(_0x345610[_0x4c1f('0x32')]!==_0x4c1f('0x40')){var _0xfc4cc4={};_0xfc4cc4[_0x345610[_0x4c1f('0x2b')]]={'$like':'%'+_0x45e542[_0x4c1f('0x35')][_0x4c1f('0x41')]+'%'};return _0xfc4cc4;}})});}_0x5d0915=_[_0x4c1f('0x3f')]({},_0x5d0915,_0x45e542[_0x4c1f('0x42')]);var _0x4d5b1d={'where':_0x5d0915[_0x4c1f('0x3d')]};return db[_0x4c1f('0x2f')][_0x4c1f('0x23')](_0x4d5b1d)[_0x4c1f('0x27')](function(_0x383317){_0x357270[_0x4c1f('0x23')]=_0x383317;if(_0x45e542['query'][_0x4c1f('0x43')]){_0x5d0915['include']=[{'all':!![]}];}return db[_0x4c1f('0x2f')]['findAll'](_0x5d0915);})[_0x4c1f('0x27')](function(_0x282619){_0x357270[_0x4c1f('0x44')]=_0x282619;return _0x357270;})['then'](respondWithFilteredResult(_0x2a8927,_0x5d0915))[_0x4c1f('0x45')](handleError(_0x2a8927,null));};exports['show']=function(_0x1a7897,_0x463723){var _0x52c5ac={'raw':!![],'where':{'id':_0x1a7897[_0x4c1f('0x46')]['id']}},_0x2244a9={};_0x2244a9[_0x4c1f('0x34')]=_[_0x4c1f('0x36')](db[_0x4c1f('0x2f')][_0x4c1f('0x30')]);_0x2244a9[_0x4c1f('0x35')]=_[_0x4c1f('0x36')](_0x1a7897[_0x4c1f('0x35')]);_0x2244a9[_0x4c1f('0x37')]=_[_0x4c1f('0x38')](_0x2244a9[_0x4c1f('0x34')],_0x2244a9[_0x4c1f('0x35')]);_0x52c5ac[_0x4c1f('0x3a')]=_['intersection'](_0x2244a9['model'],qs[_0x4c1f('0x39')](_0x1a7897[_0x4c1f('0x35')][_0x4c1f('0x39')]));_0x52c5ac[_0x4c1f('0x3a')]=_0x52c5ac['attributes'][_0x4c1f('0x3b')]?_0x52c5ac[_0x4c1f('0x3a')]:_0x2244a9[_0x4c1f('0x34')];if(_0x1a7897['query'][_0x4c1f('0x43')]){_0x52c5ac[_0x4c1f('0x47')]=[{'all':!![]}];}_0x52c5ac=_[_0x4c1f('0x3f')]({},_0x52c5ac,_0x1a7897['options']);return db['ChatInternalMessage'][_0x4c1f('0x48')](_0x52c5ac)[_0x4c1f('0x27')](handleEntityNotFound(_0x463723,null))[_0x4c1f('0x27')](respondWithResult(_0x463723,null))[_0x4c1f('0x45')](handleError(_0x463723,null));};exports[_0x4c1f('0x49')]=function(_0x43634b,_0x3bd075){return db['ChatInternalMessage'][_0x4c1f('0x49')](_0x43634b[_0x4c1f('0x4a')],{})[_0x4c1f('0x27')](respondWithResult(_0x3bd075,0xc9))[_0x4c1f('0x45')](handleError(_0x3bd075,null));};exports[_0x4c1f('0x4b')]=function(_0x558ef3,_0x493ee2){if(_0x558ef3['body']['id']){delete _0x558ef3[_0x4c1f('0x4a')]['id'];}return db[_0x4c1f('0x2f')][_0x4c1f('0x48')]({'where':{'id':_0x558ef3['params']['id']}})[_0x4c1f('0x27')](handleEntityNotFound(_0x493ee2,null))[_0x4c1f('0x27')](saveUpdates(_0x558ef3[_0x4c1f('0x4a')],null))['then'](respondWithResult(_0x493ee2,null))[_0x4c1f('0x45')](handleError(_0x493ee2,null));};exports[_0x4c1f('0x28')]=function(_0x50c4c5,_0x1be4fb){return db[_0x4c1f('0x2f')][_0x4c1f('0x48')]({'where':{'id':_0x50c4c5[_0x4c1f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1be4fb,null))[_0x4c1f('0x27')](removeEntity(_0x1be4fb,null))[_0x4c1f('0x45')](handleError(_0x1be4fb,null));};exports[_0x4c1f('0x4c')]=function(_0x4b31b9,_0x390a2c){return db[_0x4c1f('0x2f')][_0x4c1f('0x4c')]()['then'](respondWithResult(_0x390a2c,null))[_0x4c1f('0x45')](handleError(_0x390a2c,null));};function wrapUser(_0x2166d7){return function(_0x53d367){var _0x587ee1=_0x2166d7[_0x4c1f('0x4d')]({'plain':!![]});_0x587ee1[_0x4c1f('0x4e')]=[];if(_0x53d367){_0x587ee1[_0x4c1f('0x4f')]=_0x53d367['createdAt'];_0x587ee1[_0x4c1f('0x50')]=_0x53d367;}else{_0x587ee1[_0x4c1f('0x4f')]=moment(0x0)[_0x4c1f('0x51')](_0x4c1f('0x52'));_0x587ee1[_0x4c1f('0x50')]={};}return _0x587ee1;};}exports[_0x4c1f('0x53')]=function(_0x2c7af2,_0x584b03,_0x3c8cc1){var _0x5e2439=[];return db[_0x4c1f('0x54')][_0x4c1f('0x55')]({'where':{'role':[_0x4c1f('0x56'),_0x4c1f('0x57'),'user']},'attributes':['id',_0x4c1f('0x58'),'name',_0x4c1f('0x59'),_0x4c1f('0x5a'),'internal',_0x4c1f('0x5b'),'lastLoginAt','allowmessenger',_0x4c1f('0x5c')],'order':qs[_0x4c1f('0x3c')](_0x4c1f('0x5d')),'include':[{'model':db['VoiceQueue'],'as':_0x4c1f('0x5e'),'attributes':['id',_0x4c1f('0x2b'),'type'],'through':{'attributes':[]}}]})[_0x4c1f('0x27')](function(_0x3908ad){if(_0x3908ad){var _0x181757=_0x2c7af2[_0x4c1f('0x5f')][_0x4c1f('0x4d')]({'plain':!![]});if(!_0x181757)throw new Error(_0x4c1f('0x60'));if(_0x181757[_0x4c1f('0x59')]===_0x4c1f('0x5f')){return db[_0x4c1f('0x61')][_0x4c1f('0x48')]({'where':{'name':'Agents','userProfileId':_0x181757['userProfileId']},'raw':!![]})['then'](function(_0x3feea5){if(_0x3feea5){if(_0x3feea5[_0x4c1f('0x62')]===0x0){return db['UserProfileResource'][_0x4c1f('0x55')]({'where':{'sectionId':_0x3feea5['id']},'raw':!![]})[_0x4c1f('0x27')](function(_0xd6be2b){var _0x3ab148=[];if(_[_0x4c1f('0x63')](_0xd6be2b)){_0x3ab148=_['filter'](_0x3908ad,function(_0x32ddbb){if(_0x32ddbb[_0x4c1f('0x59')]!==_0x4c1f('0x56')){return _0x32ddbb;}});return _0x3ab148;}else{for(var _0x2f7244=0x0;_0x2f7244<_0x3908ad[_0x4c1f('0x3b')];_0x2f7244++){var _0x1b86d5=_0x3908ad[_0x2f7244];if(_0x1b86d5[_0x4c1f('0x59')]==='agent'){var _0x1e1872=_[_0x4c1f('0x48')](_0xd6be2b,function(_0x17b23e){return _0x17b23e[_0x4c1f('0x64')]===_0x1b86d5['id'];});if(_0x1e1872)_0x3ab148['push'](_0x1b86d5);}else{_0x3ab148[_0x4c1f('0x65')](_0x1b86d5);}}return _0x3ab148;}});}else{return _0x3908ad;}}else{var _0x1cf5b2=_[_0x4c1f('0x41')](_0x3908ad,function(_0x2ced8f){if(_0x2ced8f[_0x4c1f('0x59')]!==_0x4c1f('0x56')){return _0x2ced8f;}});return _0x1cf5b2;}});}else{return _0x3908ad;}}})[_0x4c1f('0x27')](function(_0x15da66){var _0x876ac8=[];if(_0x15da66){_0x5e2439=_0x15da66;for(var _0x2cfd8c=0x0;_0x2cfd8c<_0x15da66[_0x4c1f('0x3b')];_0x2cfd8c+=0x1){_0x5e2439[_0x2cfd8c]['messages']=[];_0x876ac8[_0x4c1f('0x65')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x2c7af2[_0x4c1f('0x5f')]['id'],_0x15da66[_0x2cfd8c]['id']],'ToId':[_0x2c7af2['user']['id'],_0x15da66[_0x2cfd8c]['id']],'ChatGroupId':null},'attributes':['id',_0x4c1f('0x66'),_0x4c1f('0x67'),_0x4c1f('0x68'),_0x4c1f('0x69'),_0x4c1f('0x4a')],'order':qs['sort'](_0x4c1f('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x15da66[_0x2cfd8c])));}return BPromise[_0x4c1f('0x6b')](_0x876ac8);}return[];})[_0x4c1f('0x27')](function(_0x16a377){return{'rows':_0x16a377,'count':_0x16a377['length']};})[_0x4c1f('0x27')](respondWithResult(_0x584b03,null))[_0x4c1f('0x45')](handleError(_0x584b03,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 7e6c0cc..260049a 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x864e=['emit','hasOwnProperty','hook','events','ChatInternalMessage','setMaxListeners','update','remove'];(function(_0xc2b3ce,_0x533dfd){var _0x30e6bb=function(_0x1f24aa){while(--_0x1f24aa){_0xc2b3ce['push'](_0xc2b3ce['shift']());}};_0x30e6bb(++_0x533dfd);}(_0x864e,0x13b));var _0xe864=function(_0x5329c5,_0x2bcffc){_0x5329c5=_0x5329c5-0x0;var _0x39cf4e=_0x864e[_0x5329c5];return _0x39cf4e;};'use strict';var EventEmitter=require(_0xe864('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xe864('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe864('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe864('0x3'),'afterDestroy':_0xe864('0x4')};function emitEvent(_0x59712b){return function(_0x26cb42,_0x16483e,_0x3b9b1d){ChatInternalMessageEvents[_0xe864('0x5')](_0x59712b+':'+_0x26cb42['id'],_0x26cb42);ChatInternalMessageEvents[_0xe864('0x5')](_0x59712b,_0x26cb42);_0x3b9b1d(null);};}for(var e in events){if(events[_0xe864('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe864('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xbd65=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x3e1555,_0xd901c2){var _0x14824b=function(_0x5c4482){while(--_0x5c4482){_0x3e1555['push'](_0x3e1555['shift']());}};_0x14824b(++_0xd901c2);}(_0xbd65,0x102));var _0x5bd6=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xbd65[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x5bd6('0x0'));var ChatInternalMessage=require(_0x5bd6('0x1'))['db'][_0x5bd6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5bd6('0x3')](0x0);var events={'afterCreate':_0x5bd6('0x4'),'afterUpdate':_0x5bd6('0x5'),'afterDestroy':_0x5bd6('0x6')};function emitEvent(_0x162a6e){return function(_0x93918f,_0x1c297d,_0x36c2ea){ChatInternalMessageEvents[_0x5bd6('0x7')](_0x162a6e+':'+_0x93918f['id'],_0x93918f);ChatInternalMessageEvents[_0x5bd6('0x7')](_0x162a6e,_0x93918f);_0x36c2ea(null);};}for(var e in events){if(events[_0x5bd6('0x8')](e)){var event=events[e];ChatInternalMessage[_0x5bd6('0x9')](e,emitEvent(event));}}module[_0x5bd6('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 0b4b40c..04364a5 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4379=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','utf8mb4'];(function(_0x33ec2b,_0x153e18){var _0x4ec376=function(_0x2e5742){while(--_0x2e5742){_0x33ec2b['push'](_0x33ec2b['shift']());}};_0x4ec376(++_0x153e18);}(_0x4379,0x138));var _0x9437=function(_0x1aaa28,_0x12f88b){_0x1aaa28=_0x1aaa28-0x0;var _0x1e8371=_0x4379[_0x1aaa28];return _0x1e8371;};'use strict';var _=require(_0x9437('0x0'));var util=require(_0x9437('0x1'));var logger=require(_0x9437('0x2'))(_0x9437('0x3'));var moment=require(_0x9437('0x4'));var BPromise=require(_0x9437('0x5'));var rp=require(_0x9437('0x6'));var fs=require('fs');var path=require(_0x9437('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9437('0x8'));module['exports']=function(_0x1bea4b,_0x1d7ea5){return _0x1bea4b[_0x9437('0x9')](_0x9437('0xa'),attributes,{'tableName':_0x9437('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9437('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5362=['lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4_unicode_ci'];(function(_0x3d9be7,_0x28364d){var _0x531878=function(_0xb9dfc5){while(--_0xb9dfc5){_0x3d9be7['push'](_0x3d9be7['shift']());}};_0x531878(++_0x28364d);}(_0x5362,0x12c));var _0x2536=function(_0x5e9f0e,_0x3f4402){_0x5e9f0e=_0x5e9f0e-0x0;var _0x2e6250=_0x5362[_0x5e9f0e];return _0x2e6250;};'use strict';var _=require(_0x2536('0x0'));var util=require(_0x2536('0x1'));var logger=require(_0x2536('0x2'))(_0x2536('0x3'));var moment=require(_0x2536('0x4'));var BPromise=require(_0x2536('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2536('0x6'));var attributes=require(_0x2536('0x7'));module[_0x2536('0x8')]=function(_0x1f1d9e,_0x293a04){return _0x1f1d9e[_0x2536('0x9')]('ChatInternalMessage',attributes,{'tableName':_0x2536('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2536('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 590e081..718379f 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8cb5=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x19d415,_0x2cbee6){var _0x3d30de=function(_0x54b239){while(--_0x54b239){_0x19d415['push'](_0x19d415['shift']());}};_0x3d30de(++_0x2cbee6);}(_0x8cb5,0x19f));var _0x58cb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cb5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x58cb('0x0'));var util=require(_0x58cb('0x1'));var moment=require(_0x58cb('0x2'));var BPromise=require(_0x58cb('0x3'));var rs=require(_0x58cb('0x4'));var fs=require('fs');var Redis=require(_0x58cb('0x5'));var db=require(_0x58cb('0x6'))['db'];var utils=require(_0x58cb('0x7'));var logger=require('../../config/logger')(_0x58cb('0x8'));var config=require(_0x58cb('0x9'));var jayson=require(_0x58cb('0xa'));var client=jayson[_0x58cb('0xb')][_0x58cb('0xc')]({'port':0x232a});config[_0x58cb('0xd')]=_[_0x58cb('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x58cb('0xf'))(new Redis(config[_0x58cb('0xd')]));require('./chatInternalMessage.socket')[_0x58cb('0x10')](socket);function respondWithRpcPromise(_0x28a052,_0x914403,_0xdd4b65){return new BPromise(function(_0x31e886,_0x2eeea9){return client['request'](_0x28a052,_0xdd4b65)[_0x58cb('0x11')](function(_0x250895){logger['info'](_0x58cb('0x12'),_0x914403,_0x58cb('0x13'));logger[_0x58cb('0x14')](_0x58cb('0x15'),_0x914403,_0x58cb('0x13'),JSON[_0x58cb('0x16')](_0x250895));if(_0x250895[_0x58cb('0x17')]){if(_0x250895[_0x58cb('0x17')][_0x58cb('0x18')]===0x1f4){logger[_0x58cb('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,_0x250895[_0x58cb('0x17')]['message']);return _0x2eeea9(_0x250895[_0x58cb('0x17')]['message']);}logger[_0x58cb('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,_0x250895['error']['message']);return _0x31e886(_0x250895[_0x58cb('0x17')][_0x58cb('0x19')]);}else{logger[_0x58cb('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,'request\x20sent');_0x31e886(_0x250895[_0x58cb('0x1b')]['message']);}})[_0x58cb('0x1c')](function(_0x4e11b9){logger[_0x58cb('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x914403,_0x4e11b9);_0x2eeea9(_0x4e11b9);});});}
\ No newline at end of file
+var _0xad6d=['client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xad6d,0x17d));var _0xdad6=function(_0x28345e,_0x192de0){_0x28345e=_0x28345e-0x0;var _0xf0b4f1=_0xad6d[_0x28345e];return _0xf0b4f1;};'use strict';var _=require('lodash');var util=require(_0xdad6('0x0'));var moment=require(_0xdad6('0x1'));var BPromise=require('bluebird');var rs=require(_0xdad6('0x2'));var fs=require('fs');var Redis=require(_0xdad6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdad6('0x4'));var logger=require(_0xdad6('0x5'))(_0xdad6('0x6'));var config=require(_0xdad6('0x7'));var jayson=require(_0xdad6('0x8'));var client=jayson[_0xdad6('0x9')][_0xdad6('0xa')]({'port':0x232a});config[_0xdad6('0xb')]=_['defaults'](config[_0xdad6('0xb')],{'host':_0xdad6('0xc'),'port':0x18eb});var socket=require(_0xdad6('0xd'))(new Redis(config[_0xdad6('0xb')]));require(_0xdad6('0xe'))['register'](socket);function respondWithRpcPromise(_0x321ce3,_0x1aa40f,_0x1c3e32){return new BPromise(function(_0x278169,_0x466dfb){return client[_0xdad6('0xf')](_0x321ce3,_0x1c3e32)[_0xdad6('0x10')](function(_0x4ab568){logger[_0xdad6('0x11')](_0xdad6('0x12'),_0x1aa40f,'request\x20sent');logger['debug'](_0xdad6('0x13'),_0x1aa40f,'request\x20sent',JSON['stringify'](_0x4ab568));if(_0x4ab568['error']){if(_0x4ab568[_0xdad6('0x14')][_0xdad6('0x15')]===0x1f4){logger[_0xdad6('0x14')](_0xdad6('0x12'),_0x1aa40f,_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);return _0x466dfb(_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);}logger[_0xdad6('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1aa40f,_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);return _0x278169(_0x4ab568[_0xdad6('0x14')][_0xdad6('0x16')]);}else{logger['info'](_0xdad6('0x12'),_0x1aa40f,_0xdad6('0x17'));_0x278169(_0x4ab568[_0xdad6('0x18')][_0xdad6('0x16')]);}})[_0xdad6('0x19')](function(_0xbb70fc){logger[_0xdad6('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x1aa40f,_0xbb70fc);_0x466dfb(_0xbb70fc);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 0ac2482..e5977eb 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xccd8=['update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0xc444e3,_0x24b4aa){var _0x18c6f3=function(_0x49307e){while(--_0x49307e){_0xc444e3['push'](_0xc444e3['shift']());}};_0x18c6f3(++_0x24b4aa);}(_0xccd8,0x19d));var _0x8ccd=function(_0x424bc1,_0x22cc1b){_0x424bc1=_0x424bc1-0x0;var _0x502fdc=_0xccd8[_0x424bc1];return _0x502fdc;};'use strict';var ChatInternalMessageEvents=require(_0x8ccd('0x0'));var events=[_0x8ccd('0x1'),_0x8ccd('0x2'),_0x8ccd('0x3')];function createListener(_0x31864f,_0x7be675){return function(_0x11d5fc){_0x7be675[_0x8ccd('0x4')](_0x31864f,_0x11d5fc);};}function removeListener(_0x52d552,_0x5d016b){return function(){ChatInternalMessageEvents[_0x8ccd('0x5')](_0x52d552,_0x5d016b);};}exports[_0x8ccd('0x6')]=function(_0x1d6160){for(var _0x5b352b=0x0,_0x2afb42=events['length'];_0x5b352b<_0x2afb42;_0x5b352b++){var _0x2c3982=events[_0x5b352b];var _0x390ff2=createListener(_0x8ccd('0x7')+_0x2c3982,_0x1d6160);ChatInternalMessageEvents['on'](_0x2c3982,_0x390ff2);}};
\ No newline at end of file
+var _0x4884=['register','length','chatInternalMessage:','./chatInternalMessage.events','remove','update'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x4884,0x10b));var _0x4488=function(_0x3b4114,_0xd3294a){_0x3b4114=_0x3b4114-0x0;var _0x14ad03=_0x4884[_0x3b4114];return _0x14ad03;};'use strict';var ChatInternalMessageEvents=require(_0x4488('0x0'));var events=['save',_0x4488('0x1'),_0x4488('0x2')];function createListener(_0x240025,_0xa1ec40){return function(_0xeb0927){_0xa1ec40['emit'](_0x240025,_0xeb0927);};}function removeListener(_0x5f0273,_0x17acc3){return function(){ChatInternalMessageEvents['removeListener'](_0x5f0273,_0x17acc3);};}exports[_0x4488('0x3')]=function(_0xfd77c1){for(var _0x1b8dea=0x0,_0x20e8be=events[_0x4488('0x4')];_0x1b8dea<_0x20e8be;_0x1b8dea++){var _0x5219f6=events[_0x1b8dea];var _0x3302a5=createListener(_0x4488('0x5')+_0x5219f6,_0xfd77c1);ChatInternalMessageEvents['on'](_0x5219f6,_0x3302a5);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index cb89f1c..d0a7876 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7f2d=['delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x46040d,_0x144f45){var _0x27fe40=function(_0x149b62){while(--_0x149b62){_0x46040d['push'](_0x46040d['shift']());}};_0x27fe40(++_0x144f45);}(_0x7f2d,0x157));var _0xd7f2=function(_0x11b0fc,_0xef00a){_0x11b0fc=_0x11b0fc-0x0;var _0xd79b47=_0x7f2d[_0x11b0fc];return _0xd79b47;};'use strict';var multer=require(_0xd7f2('0x0'));var util=require(_0xd7f2('0x1'));var path=require(_0xd7f2('0x2'));var timeout=require('connect-timeout');var express=require(_0xd7f2('0x3'));var router=express[_0xd7f2('0x4')]();var fs_extra=require(_0xd7f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd7f2('0x6'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0xd7f2('0x7')]('/',auth[_0xd7f2('0x8')](),controller['index']);router[_0xd7f2('0x7')](_0xd7f2('0x9'),auth[_0xd7f2('0x8')](),controller[_0xd7f2('0xa')]);router[_0xd7f2('0x7')]('/users',auth[_0xd7f2('0x8')](),controller['getUsers']);router[_0xd7f2('0x7')](_0xd7f2('0xb'),auth[_0xd7f2('0x8')](),controller[_0xd7f2('0xc')]);router[_0xd7f2('0xd')]('/',auth[_0xd7f2('0x8')](),controller[_0xd7f2('0xe')]);router[_0xd7f2('0xf')]('/:id',controller[_0xd7f2('0x10')]);router[_0xd7f2('0x11')]('/:id',auth[_0xd7f2('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xeba8=['update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','post','create','/:id'];(function(_0xe5d784,_0x15a1c8){var _0x398b3f=function(_0x6d8aec){while(--_0x6d8aec){_0xe5d784['push'](_0xe5d784['shift']());}};_0x398b3f(++_0x15a1c8);}(_0xeba8,0x1f1));var _0x8eba=function(_0x327cbf,_0x114362){_0x327cbf=_0x327cbf-0x0;var _0x409cb8=_0xeba8[_0x327cbf];return _0x409cb8;};'use strict';var multer=require(_0x8eba('0x0'));var util=require('util');var path=require(_0x8eba('0x1'));var timeout=require(_0x8eba('0x2'));var express=require(_0x8eba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8eba('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8eba('0x5'));var controller=require(_0x8eba('0x6'));router[_0x8eba('0x7')]('/',auth[_0x8eba('0x8')](),controller[_0x8eba('0x9')]);router['get']('/describe',auth[_0x8eba('0x8')](),controller[_0x8eba('0xa')]);router[_0x8eba('0x7')](_0x8eba('0xb'),auth[_0x8eba('0x8')](),controller[_0x8eba('0xc')]);router[_0x8eba('0x7')]('/:id',auth[_0x8eba('0x8')](),controller['show']);router[_0x8eba('0xd')]('/',auth[_0x8eba('0x8')](),controller[_0x8eba('0xe')]);router['put'](_0x8eba('0xf'),controller[_0x8eba('0x10')]);router[_0x8eba('0x11')](_0x8eba('0xf'),auth[_0x8eba('0x8')](),controller['destroy']);module[_0x8eba('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 952d0d6..5311e28 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5eb1=['ENUM','out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x5eb1,0x7c));var _0x15eb=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x5eb1[_0x3457b4];return _0xaa8fa9;};'use strict';var Sequelize=require('sequelize');module[_0x15eb('0x0')]={'body':{'type':Sequelize[_0x15eb('0x1')](_0x15eb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x15eb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x15eb('0x4')]('in','out'),'defaultValue':_0x15eb('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x15eb('0x6')]},'providerName':{'type':Sequelize[_0x15eb('0x7')]},'providerResponse':{'type':Sequelize[_0x15eb('0x1')]}};
\ No newline at end of file
+var _0xbbdd=['out','TEXT','exports','medium','BOOLEAN'];(function(_0x92ab15,_0x2a3eea){var _0x2bcc36=function(_0x595270){while(--_0x595270){_0x92ab15['push'](_0x92ab15['shift']());}};_0x2bcc36(++_0x2a3eea);}(_0xbbdd,0x1ba));var _0xdbbd=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xbbdd[_0x45bf86];return _0x1f02b7;};'use strict';var Sequelize=require('sequelize');module[_0xdbbd('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdbbd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xdbbd('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xdbbd('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdbbd('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index fd7d50a..c74757c 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1658=['attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','show','params','keys','create','body','find','describe','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','RejectMessage','email','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','filters','intersection','query'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1658,0x14c));var _0x8165=function(_0x382c01,_0x3d04aa){_0x382c01=_0x382c01-0x0;var _0x24cdcd=_0x1658[_0x382c01];return _0x24cdcd;};'use strict';var emlformat=require(_0x8165('0x0'));var rimraf=require(_0x8165('0x1'));var zipdir=require(_0x8165('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8165('0x3'));var moment=require(_0x8165('0x4'));var BPromise=require(_0x8165('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8165('0x6'));var sox=require(_0x8165('0x7'));var csv=require('to-csv');var ejs=require(_0x8165('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8165('0x9'));var squel=require(_0x8165('0xa'));var crypto=require(_0x8165('0xb'));var jsforce=require(_0x8165('0xc'));var deskjs=require(_0x8165('0xd'));var toCsv=require(_0x8165('0xe'));var querystring=require('querystring');var Papa=require(_0x8165('0xf'));var Redis=require(_0x8165('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8165('0x11'));var as=require(_0x8165('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8165('0x13'))(_0x8165('0x14'));var utils=require(_0x8165('0x15'));var config=require(_0x8165('0x16'));var licenseUtil=require(_0x8165('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x8165('0x18')](config['redis'],{'host':_0x8165('0x19'),'port':0x18eb});var socket=require(_0x8165('0x1a'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x8165('0x1b')](socket);var jayson=require(_0x8165('0x1c'));var client=jayson[_0x8165('0x1d')][_0x8165('0x1e')]({'port':0x232c});var client9002=jayson[_0x8165('0x1d')][_0x8165('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x53cee9,_0x170280,_0x5760a7,_0x17849b){return new BPromise(function(_0x440b58,_0x218c6d){var _0x8d48db=_0x17849b||client;return _0x8d48db['request'](_0x53cee9,_0x5760a7)[_0x8165('0x1f')](function(_0x524924){logger[_0x8165('0x20')](_0x8165('0x21'),_0x170280,_0x8165('0x22'));logger[_0x8165('0x23')](_0x8165('0x24'),_0x170280,_0x8165('0x22'),JSON[_0x8165('0x25')](_0x524924));if(_0x524924[_0x8165('0x26')]){if(_0x524924[_0x8165('0x26')][_0x8165('0x27')]===0x1f4){logger[_0x8165('0x26')](_0x8165('0x21'),_0x170280,_0x524924[_0x8165('0x26')][_0x8165('0x28')]);return _0x218c6d(_0x524924[_0x8165('0x26')][_0x8165('0x28')]);}logger[_0x8165('0x26')](_0x8165('0x21'),_0x170280,_0x524924[_0x8165('0x26')][_0x8165('0x28')]);return _0x440b58(_0x524924[_0x8165('0x26')][_0x8165('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x170280,_0x8165('0x22'));_0x440b58(_0x524924['result']['message']);}})[_0x8165('0x29')](function(_0x1f2a04){logger[_0x8165('0x26')](_0x8165('0x21'),_0x170280,_0x1f2a04);_0x218c6d(_0x1f2a04);});});}function respondWithStatusCode(_0x1cdb2c,_0xc38c3){_0xc38c3=_0xc38c3||0xcc;return function(_0x21aa29){if(_0x21aa29){return _0x1cdb2c[_0x8165('0x2a')](_0xc38c3);}return _0x1cdb2c[_0x8165('0x2b')](_0xc38c3)[_0x8165('0x2c')]();};}function respondWithResult(_0x4e51d0,_0x5a91b5){_0x5a91b5=_0x5a91b5||0xc8;return function(_0x2ddb89){if(_0x2ddb89){return _0x4e51d0[_0x8165('0x2b')](_0x5a91b5)[_0x8165('0x2d')](_0x2ddb89);}};}function respondWithFilteredResult(_0x43e7ae,_0x1a20d0){return function(_0x2eaa36){if(_0x2eaa36){var _0x1ae6f8=typeof _0x1a20d0['offset']===_0x8165('0x2e')&&typeof _0x1a20d0['limit']===_0x8165('0x2e');var _0x29d0a8=_0x2eaa36['count'];var _0x1c2322=_0x1ae6f8?0x0:_0x1a20d0[_0x8165('0x2f')];var _0x3ab18c=_0x1ae6f8?_0x2eaa36['count']:_0x1a20d0[_0x8165('0x2f')]+_0x1a20d0[_0x8165('0x30')];var _0x22248b;if(_0x3ab18c>=_0x29d0a8){_0x3ab18c=_0x29d0a8;_0x22248b=0xc8;}else{_0x22248b=0xce;}_0x43e7ae[_0x8165('0x2b')](_0x22248b);return _0x43e7ae[_0x8165('0x31')](_0x8165('0x32'),_0x1c2322+'-'+_0x3ab18c+'/'+_0x29d0a8)[_0x8165('0x2d')](_0x2eaa36);}return null;};}function patchUpdates(_0x39e4bb){return function(_0x284734){try{jsonpatch[_0x8165('0x33')](_0x284734,_0x39e4bb,!![]);}catch(_0x127bb4){return BPromise['reject'](_0x127bb4);}return _0x284734[_0x8165('0x34')]();};}function saveUpdates(_0x155874,_0x234317){return function(_0x4be661){if(_0x4be661){return _0x4be661[_0x8165('0x35')](_0x155874)[_0x8165('0x1f')](function(_0x1ae0a4){return _0x1ae0a4;});}return null;};}function removeEntity(_0x277db2,_0xde54bd){return function(_0x296fc9){if(_0x296fc9){return _0x296fc9[_0x8165('0x36')]()['then'](function(){_0x277db2[_0x8165('0x2b')](0xcc)[_0x8165('0x2c')]();});}};}function handleEntityNotFound(_0x492521,_0x895ee8){return function(_0x2f3511){if(!_0x2f3511){_0x492521[_0x8165('0x2a')](0x194);}return _0x2f3511;};}function handleError(_0x30a31f,_0x245c2c){_0x245c2c=_0x245c2c||0x1f4;return function(_0x4c5a91){logger['error'](_0x4c5a91[_0x8165('0x37')]);if(_0x4c5a91[_0x8165('0x38')]){delete _0x4c5a91[_0x8165('0x38')];}_0x30a31f['status'](_0x245c2c)[_0x8165('0x39')](_0x4c5a91);};}exports[_0x8165('0x3a')]=function(_0x4aaf2c,_0x1f39cb){var _0x2f36cd={},_0xfbb71b={},_0x1c82f4={'count':0x0,'rows':[]};var _0x4ba21e=_[_0x8165('0x3b')](db[_0x8165('0x3c')][_0x8165('0x3d')],function(_0x393aa0){return{'name':_0x393aa0[_0x8165('0x3e')],'type':_0x393aa0['type'][_0x8165('0x3f')]};});_0xfbb71b['model']=_[_0x8165('0x3b')](_0x4ba21e,_0x8165('0x38'));_0xfbb71b['query']=_['keys'](_0x4aaf2c['query']);_0xfbb71b[_0x8165('0x40')]=_[_0x8165('0x41')](_0xfbb71b['model'],_0xfbb71b[_0x8165('0x42')]);_0x2f36cd[_0x8165('0x43')]=_[_0x8165('0x41')](_0xfbb71b[_0x8165('0x44')],qs['fields'](_0x4aaf2c['query'][_0x8165('0x45')]));_0x2f36cd[_0x8165('0x43')]=_0x2f36cd[_0x8165('0x43')][_0x8165('0x46')]?_0x2f36cd['attributes']:_0xfbb71b[_0x8165('0x44')];if(!_0x4aaf2c['query'][_0x8165('0x47')](_0x8165('0x48'))){_0x2f36cd[_0x8165('0x30')]=qs['limit'](_0x4aaf2c[_0x8165('0x42')][_0x8165('0x30')]);_0x2f36cd[_0x8165('0x2f')]=qs[_0x8165('0x2f')](_0x4aaf2c[_0x8165('0x42')][_0x8165('0x2f')]);}_0x2f36cd[_0x8165('0x49')]=qs[_0x8165('0x4a')](_0x4aaf2c[_0x8165('0x42')]['sort']);_0x2f36cd[_0x8165('0x4b')]=qs[_0x8165('0x40')](_[_0x8165('0x4c')](_0x4aaf2c[_0x8165('0x42')],_0xfbb71b[_0x8165('0x40')]),_0x4ba21e);if(_0x4aaf2c[_0x8165('0x42')][_0x8165('0x4d')]){_0x2f36cd[_0x8165('0x4b')]=_[_0x8165('0x4e')](_0x2f36cd['where'],{'$or':_[_0x8165('0x3b')](_0x4ba21e,function(_0x551a87){if(_0x551a87[_0x8165('0x4f')]!==_0x8165('0x50')){var _0x52f0b4={};_0x52f0b4[_0x551a87['name']]={'$like':'%'+_0x4aaf2c['query'][_0x8165('0x4d')]+'%'};return _0x52f0b4;}})});}_0x2f36cd=_[_0x8165('0x4e')]({},_0x2f36cd,_0x4aaf2c[_0x8165('0x51')]);var _0x45a667={'where':_0x2f36cd[_0x8165('0x4b')]};return db['ChatMessage'][_0x8165('0x52')](_0x45a667)[_0x8165('0x1f')](function(_0x1a326a){_0x1c82f4[_0x8165('0x52')]=_0x1a326a;if(_0x4aaf2c[_0x8165('0x42')][_0x8165('0x53')]){_0x2f36cd[_0x8165('0x54')]=[{'all':!![]}];}return db[_0x8165('0x3c')]['findAll'](_0x2f36cd);})[_0x8165('0x1f')](function(_0x3fc377){_0x1c82f4[_0x8165('0x55')]=_0x3fc377;return _0x1c82f4;})[_0x8165('0x1f')](respondWithFilteredResult(_0x1f39cb,_0x2f36cd))[_0x8165('0x29')](handleError(_0x1f39cb,null));};exports[_0x8165('0x56')]=function(_0x24a8b1,_0x51f597){var _0x23ce7b={'raw':!![],'where':{'id':_0x24a8b1[_0x8165('0x57')]['id']}},_0x27646e={};_0x27646e[_0x8165('0x44')]=_[_0x8165('0x58')](db[_0x8165('0x3c')][_0x8165('0x3d')]);_0x27646e['query']=_[_0x8165('0x58')](_0x24a8b1[_0x8165('0x42')]);_0x27646e[_0x8165('0x40')]=_[_0x8165('0x41')](_0x27646e[_0x8165('0x44')],_0x27646e[_0x8165('0x42')]);_0x23ce7b[_0x8165('0x43')]=_[_0x8165('0x41')](_0x27646e[_0x8165('0x44')],qs[_0x8165('0x45')](_0x24a8b1[_0x8165('0x42')]['fields']));_0x23ce7b[_0x8165('0x43')]=_0x23ce7b[_0x8165('0x43')][_0x8165('0x46')]?_0x23ce7b[_0x8165('0x43')]:_0x27646e[_0x8165('0x44')];if(_0x24a8b1[_0x8165('0x42')][_0x8165('0x53')]){_0x23ce7b[_0x8165('0x54')]=[{'all':!![]}];}_0x23ce7b=_[_0x8165('0x4e')]({},_0x23ce7b,_0x24a8b1[_0x8165('0x51')]);return db[_0x8165('0x3c')]['find'](_0x23ce7b)['then'](handleEntityNotFound(_0x51f597,null))[_0x8165('0x1f')](respondWithResult(_0x51f597,null))[_0x8165('0x29')](handleError(_0x51f597,null));};exports[_0x8165('0x59')]=function(_0x59f5b7,_0x4d88da){return db[_0x8165('0x3c')][_0x8165('0x59')](_0x59f5b7[_0x8165('0x5a')],{})[_0x8165('0x1f')](respondWithResult(_0x4d88da,0xc9))[_0x8165('0x29')](handleError(_0x4d88da,null));};exports[_0x8165('0x35')]=function(_0x2ddb44,_0x547246){if(_0x2ddb44[_0x8165('0x5a')]['id']){delete _0x2ddb44[_0x8165('0x5a')]['id'];}return db[_0x8165('0x3c')][_0x8165('0x5b')]({'where':{'id':_0x2ddb44[_0x8165('0x57')]['id']}})[_0x8165('0x1f')](handleEntityNotFound(_0x547246,null))[_0x8165('0x1f')](saveUpdates(_0x2ddb44[_0x8165('0x5a')],null))[_0x8165('0x1f')](respondWithResult(_0x547246,null))['catch'](handleError(_0x547246,null));};exports['destroy']=function(_0x10e594,_0x180b3f){return db['ChatMessage'][_0x8165('0x5b')]({'where':{'id':_0x10e594['params']['id']}})['then'](handleEntityNotFound(_0x180b3f,null))['then'](removeEntity(_0x180b3f,null))[_0x8165('0x29')](handleError(_0x180b3f,null));};exports['describe']=function(_0x1f9b2f,_0x3a0b12){return db[_0x8165('0x3c')][_0x8165('0x5c')]()[_0x8165('0x1f')](respondWithResult(_0x3a0b12,null))[_0x8165('0x29')](handleError(_0x3a0b12,null));};var interaction_log=require(_0x8165('0x13'))(_0x8165('0x5d'));exports[_0x8165('0x5e')]=function(_0x2fd1a7,_0x1dd940,_0x4ea434){var _0x5e171f={'agent':{},'channel':'chat'};if(_0x2fd1a7[_0x8165('0x5a')]['id']){delete _0x2fd1a7[_0x8165('0x5a')]['id'];}_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x5f')]=!![];_0x2fd1a7['body']['readAt']=moment()[_0x8165('0x60')](_0x8165('0x61'));_0x2fd1a7['body'][_0x8165('0x62')]=_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')]||_0x2fd1a7[_0x8165('0x63')]['id'];_0x5e171f[_0x8165('0x64')]['id']=_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')];return db['ChatMessage'][_0x8165('0x5b')]({'where':{'id':_0x2fd1a7['params']['id'],'UserId':null}})[_0x8165('0x1f')](handleEntityNotFound(_0x1dd940,null))['then'](saveUpdates(_0x2fd1a7[_0x8165('0x5a')],null))[_0x8165('0x1f')](function(_0x23cbc6){if(_0x23cbc6){_0x5e171f['message']=_0x23cbc6[_0x8165('0x65')]({'plain':!![]});return db[_0x8165('0x66')][_0x8165('0x5b')]({'where':{'id':_0x23cbc6[_0x8165('0x67')]}});}return null;})[_0x8165('0x1f')](handleEntityNotFound(_0x1dd940,null))[_0x8165('0x1f')](function(_0x4c289f){if(_0x4c289f){return _0x4c289f[_0x8165('0x35')]({'UserId':_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')],'read1stAt':_[_0x8165('0x68')](_0x4c289f[_0x8165('0x69')])?moment()[_0x8165('0x60')](_0x8165('0x61')):undefined});}return null;})[_0x8165('0x1f')](function(_0x51c446){if(_0x51c446){_0x5e171f[_0x8165('0x6a')]=_0x51c446[_0x8165('0x65')]({'plain':!![]});interaction_log[_0x8165('0x20')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2fd1a7[_0x8165('0x63')]['id'],_0x2fd1a7[_0x8165('0x63')][_0x8165('0x38')],_0x2fd1a7['user'][_0x8165('0x6b')],_0x5e171f['interaction']['id'],_0x2fd1a7[_0x8165('0x5a')]?JSON['stringify'](_0x2fd1a7['body']):_0x8165('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x8165('0x6d'),_0x5e171f);}return null;})[_0x8165('0x1f')](function(_0x4aa66e){var _0x4cd100=_0x8165('0x6e')+_0x4aa66e[_0x8165('0x28')][_0x8165('0x6f')];return db['sequelize'][_0x8165('0x42')](_0x4cd100,{'type':db[_0x8165('0x70')][_0x8165('0x71')][_0x8165('0x72')],'raw':!![]})['then'](function(_0x30a379){return _0x30a379;});})[_0x8165('0x1f')](function(_0x23a80f){if(_0x23a80f){_0x5e171f[_0x8165('0x28')][_0x8165('0x73')]=_0x23a80f[0x0];if(!_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')])return;return db[_0x8165('0x74')]['find']({'where':{'id':_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x62')],'role':_0x8165('0x64')},'attributes':['id',_0x8165('0x38'),_0x8165('0x75'),'email',_0x8165('0x76')],'raw':!![]});}return null;})[_0x8165('0x1f')](function(_0x196e19){if(!_0x196e19)return null;_0x5e171f['message'][_0x8165('0x64')]=_0x196e19;return _0x5e171f;})[_0x8165('0x1f')](function(_0x1af162){if(_0x1af162){if(_0x2fd1a7[_0x8165('0x5a')][_0x8165('0x77')]){_0x5e171f[_0x8165('0x28')][_0x8165('0x78')]=util['format'](_0x8165('0x79'),_0x2fd1a7[_0x8165('0x63')][_0x8165('0x38')]);_0x5e171f[_0x8165('0x28')]['channel']=_0x5e171f[_0x8165('0x7a')];_0x5e171f[_0x8165('0x28')][_0x8165('0x7b')]=_0x5e171f[_0x8165('0x7a')];_0x5e171f['message'][_0x8165('0x7c')]=_0x8165('0x5e');return respondWithRpcPromise(_0x8165('0x7d'),_0x8165('0x7d'),{'event':_0x8165('0x7e'),'message':_[_0x8165('0x4e')](_0x5e171f[_0x8165('0x28')],JSON[_0x8165('0x7f')](_0x5e171f[_0x8165('0x6a')][_0x8165('0x80')]))},client9002)[_0x8165('0x1f')](function(){return _0x5e171f;});}return _0x5e171f;}return null;})[_0x8165('0x1f')](respondWithResult(_0x1dd940,null))[_0x8165('0x29')](handleError(_0x1dd940,null));};var interaction_log=require(_0x8165('0x13'))(_0x8165('0x5d'));exports[_0x8165('0x81')]=function(_0x1f4956,_0x4cd3c8,_0x4a367d){var _0x39e5fb={'agent':{},'channel':'chat'};if(_0x1f4956[_0x8165('0x5a')]['id']){delete _0x1f4956[_0x8165('0x5a')]['id'];}_0x1f4956[_0x8165('0x5a')]['UserId']=_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')]||_0x1f4956[_0x8165('0x63')]['id'];_0x39e5fb[_0x8165('0x64')]['id']=_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')];return db[_0x8165('0x3c')]['find']({'where':{'id':_0x1f4956[_0x8165('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4cd3c8,null))[_0x8165('0x1f')](function(_0x218474){if(_0x218474){_0x39e5fb[_0x8165('0x28')]=_0x218474[_0x8165('0x65')]({'plain':!![]});return db[_0x8165('0x66')][_0x8165('0x5b')]({'where':{'id':_0x218474['ChatInteractionId']}});}return null;})[_0x8165('0x1f')](handleEntityNotFound(_0x4cd3c8,null))[_0x8165('0x1f')](function(_0x3d3c67){if(_0x3d3c67){_0x39e5fb[_0x8165('0x6a')]=_0x3d3c67[_0x8165('0x65')]({'plain':!![]});interaction_log[_0x8165('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1f4956[_0x8165('0x63')]['id'],_0x1f4956[_0x8165('0x63')][_0x8165('0x38')],_0x1f4956['user']['role'],_0x39e5fb[_0x8165('0x6a')]['id'],_0x1f4956[_0x8165('0x5a')]?JSON[_0x8165('0x25')](_0x1f4956[_0x8165('0x5a')]):_0x8165('0x6c'));return respondWithRpcPromise(_0x8165('0x82'),'rejectMessage',_0x39e5fb);}return null;})[_0x8165('0x1f')](function(_0x3691bd){var _0x1094fb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3691bd[_0x8165('0x28')]['ContactId'];return db['sequelize']['query'](_0x1094fb,{'type':db[_0x8165('0x70')]['QueryTypes']['SELECT'],'raw':!![]})[_0x8165('0x1f')](function(_0x482f6c){return _0x482f6c;});})[_0x8165('0x1f')](function(_0x2723e4){if(_0x2723e4){_0x39e5fb[_0x8165('0x28')][_0x8165('0x73')]=_0x2723e4[0x0];if(!_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')])return;return db[_0x8165('0x74')][_0x8165('0x5b')]({'where':{'id':_0x1f4956[_0x8165('0x5a')][_0x8165('0x62')],'role':_0x8165('0x64')},'attributes':['id','name',_0x8165('0x75'),_0x8165('0x83'),_0x8165('0x76')],'raw':!![]});}return null;})[_0x8165('0x1f')](function(_0x1586e7){if(!_0x1586e7)return null;_0x39e5fb[_0x8165('0x28')][_0x8165('0x64')]=_0x1586e7;return _0x39e5fb;})[_0x8165('0x1f')](function(_0x2c679c){if(_0x2c679c){_0x2c679c[_0x8165('0x28')][_0x8165('0x78')]=util[_0x8165('0x60')]('SIP/%s',_0x1f4956[_0x8165('0x63')][_0x8165('0x38')]);_0x2c679c[_0x8165('0x28')][_0x8165('0x7a')]=_0x39e5fb['channel'];_0x2c679c[_0x8165('0x28')]['motionChannel']=_0x39e5fb['channel'];_0x2c679c[_0x8165('0x28')]['event']=_0x8165('0x81');respondWithRpcPromise(_0x8165('0x7d'),_0x8165('0x7d'),{'event':_0x8165('0x84'),'message':_[_0x8165('0x4e')](_0x39e5fb[_0x8165('0x28')],JSON[_0x8165('0x7f')](_0x39e5fb['interaction']['formData']))},client9002);return _0x39e5fb;}return null;})[_0x8165('0x1f')](respondWithResult(_0x4cd3c8,null))[_0x8165('0x29')](handleError(_0x4cd3c8,null));};
\ No newline at end of file
+var _0x1d63=['includeAll','include','findAll','show','params','find','create','body','update','describe','../../config/logger','accept','chat','read','readAt','UserId','user','ChatInteraction','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','chat-interactions','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','destroy','stack','name','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','filter','options'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0x1d63,0x13c));var _0x31d6=function(_0x5d1dfd,_0x1fd572){_0x5d1dfd=_0x5d1dfd-0x0;var _0x4cba70=_0x1d63[_0x5d1dfd];return _0x4cba70;};'use strict';var emlformat=require(_0x31d6('0x0'));var rimraf=require(_0x31d6('0x1'));var zipdir=require(_0x31d6('0x2'));var jsonpatch=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var moment=require(_0x31d6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x31d6('0x6'));var util=require(_0x31d6('0x7'));var path=require(_0x31d6('0x8'));var sox=require('sox');var csv=require(_0x31d6('0x9'));var ejs=require(_0x31d6('0xa'));var fs=require('fs');var fs_extra=require(_0x31d6('0xb'));var _=require(_0x31d6('0xc'));var squel=require(_0x31d6('0xd'));var crypto=require(_0x31d6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x31d6('0xf'));var toCsv=require(_0x31d6('0x9'));var querystring=require(_0x31d6('0x10'));var Papa=require(_0x31d6('0x11'));var Redis=require(_0x31d6('0x12'));var authService=require(_0x31d6('0x13'));var qs=require(_0x31d6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31d6('0x15'));var logger=require('../../config/logger')(_0x31d6('0x16'));var utils=require(_0x31d6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x31d6('0x18'));var db=require(_0x31d6('0x19'))['db'];config[_0x31d6('0x1a')]=_[_0x31d6('0x1b')](config[_0x31d6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x31d6('0x1c'))(new Redis(config[_0x31d6('0x1a')]));require('./chatMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x31d6('0x1d')][_0x31d6('0x1e')]({'port':0x232c});var client9002=jayson[_0x31d6('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c97c9,_0x291685,_0xef4b44,_0x189838){return new BPromise(function(_0x53301b,_0x4e3a1b){var _0x394692=_0x189838||client;return _0x394692[_0x31d6('0x1f')](_0x2c97c9,_0xef4b44)[_0x31d6('0x20')](function(_0x3d1aaf){logger[_0x31d6('0x21')](_0x31d6('0x22'),_0x291685,_0x31d6('0x23'));logger[_0x31d6('0x24')](_0x31d6('0x25'),_0x291685,_0x31d6('0x23'),JSON[_0x31d6('0x26')](_0x3d1aaf));if(_0x3d1aaf[_0x31d6('0x27')]){if(_0x3d1aaf['error'][_0x31d6('0x28')]===0x1f4){logger['error'](_0x31d6('0x22'),_0x291685,_0x3d1aaf[_0x31d6('0x27')][_0x31d6('0x29')]);return _0x4e3a1b(_0x3d1aaf[_0x31d6('0x27')][_0x31d6('0x29')]);}logger[_0x31d6('0x27')](_0x31d6('0x22'),_0x291685,_0x3d1aaf[_0x31d6('0x27')]['message']);return _0x53301b(_0x3d1aaf['error'][_0x31d6('0x29')]);}else{logger['info'](_0x31d6('0x22'),_0x291685,_0x31d6('0x23'));_0x53301b(_0x3d1aaf[_0x31d6('0x2a')][_0x31d6('0x29')]);}})[_0x31d6('0x2b')](function(_0xb62601){logger[_0x31d6('0x27')](_0x31d6('0x22'),_0x291685,_0xb62601);_0x4e3a1b(_0xb62601);});});}function respondWithStatusCode(_0x44d248,_0x18a8bb){_0x18a8bb=_0x18a8bb||0xcc;return function(_0x2a04b0){if(_0x2a04b0){return _0x44d248[_0x31d6('0x2c')](_0x18a8bb);}return _0x44d248[_0x31d6('0x2d')](_0x18a8bb)[_0x31d6('0x2e')]();};}function respondWithResult(_0x441f9f,_0x2bfb52){_0x2bfb52=_0x2bfb52||0xc8;return function(_0x3e2520){if(_0x3e2520){return _0x441f9f['status'](_0x2bfb52)['json'](_0x3e2520);}};}function respondWithFilteredResult(_0x481b34,_0x17bc47){return function(_0x162ad8){if(_0x162ad8){var _0x4ed85a=typeof _0x17bc47[_0x31d6('0x2f')]===_0x31d6('0x30')&&typeof _0x17bc47[_0x31d6('0x31')]==='undefined';var _0x4518c9=_0x162ad8[_0x31d6('0x32')];var _0x285a2e=_0x4ed85a?0x0:_0x17bc47[_0x31d6('0x2f')];var _0x5ec272=_0x4ed85a?_0x162ad8['count']:_0x17bc47['offset']+_0x17bc47[_0x31d6('0x31')];var _0x17f492;if(_0x5ec272>=_0x4518c9){_0x5ec272=_0x4518c9;_0x17f492=0xc8;}else{_0x17f492=0xce;}_0x481b34[_0x31d6('0x2d')](_0x17f492);return _0x481b34['set'](_0x31d6('0x33'),_0x285a2e+'-'+_0x5ec272+'/'+_0x4518c9)[_0x31d6('0x34')](_0x162ad8);}return null;};}function patchUpdates(_0x3d7e9c){return function(_0x17d241){try{jsonpatch['apply'](_0x17d241,_0x3d7e9c,!![]);}catch(_0xe64dc0){return BPromise[_0x31d6('0x35')](_0xe64dc0);}return _0x17d241[_0x31d6('0x36')]();};}function saveUpdates(_0x2e106c,_0x25c15d){return function(_0x70ad43){if(_0x70ad43){return _0x70ad43['update'](_0x2e106c)[_0x31d6('0x20')](function(_0x4461ab){return _0x4461ab;});}return null;};}function removeEntity(_0x7c258e,_0x1d5fc3){return function(_0x22750e){if(_0x22750e){return _0x22750e[_0x31d6('0x37')]()[_0x31d6('0x20')](function(){_0x7c258e['status'](0xcc)[_0x31d6('0x2e')]();});}};}function handleEntityNotFound(_0x49037a,_0x6f8b40){return function(_0xac0543){if(!_0xac0543){_0x49037a[_0x31d6('0x2c')](0x194);}return _0xac0543;};}function handleError(_0x5c339c,_0x36a6bb){_0x36a6bb=_0x36a6bb||0x1f4;return function(_0x4596bd){logger['error'](_0x4596bd[_0x31d6('0x38')]);if(_0x4596bd[_0x31d6('0x39')]){delete _0x4596bd[_0x31d6('0x39')];}_0x5c339c['status'](_0x36a6bb)['send'](_0x4596bd);};}exports[_0x31d6('0x3a')]=function(_0x177f66,_0x502618){var _0x467d03={},_0x252048={},_0x2151de={'count':0x0,'rows':[]};var _0x1546b6=_[_0x31d6('0x3b')](db[_0x31d6('0x3c')][_0x31d6('0x3d')],function(_0x20d3e8){return{'name':_0x20d3e8[_0x31d6('0x3e')],'type':_0x20d3e8['type'][_0x31d6('0x3f')]};});_0x252048[_0x31d6('0x40')]=_[_0x31d6('0x3b')](_0x1546b6,_0x31d6('0x39'));_0x252048[_0x31d6('0x41')]=_[_0x31d6('0x42')](_0x177f66['query']);_0x252048[_0x31d6('0x43')]=_[_0x31d6('0x44')](_0x252048['model'],_0x252048['query']);_0x467d03[_0x31d6('0x45')]=_[_0x31d6('0x44')](_0x252048[_0x31d6('0x40')],qs['fields'](_0x177f66[_0x31d6('0x41')][_0x31d6('0x46')]));_0x467d03[_0x31d6('0x45')]=_0x467d03[_0x31d6('0x45')][_0x31d6('0x47')]?_0x467d03[_0x31d6('0x45')]:_0x252048[_0x31d6('0x40')];if(!_0x177f66[_0x31d6('0x41')]['hasOwnProperty'](_0x31d6('0x48'))){_0x467d03[_0x31d6('0x31')]=qs[_0x31d6('0x31')](_0x177f66[_0x31d6('0x41')][_0x31d6('0x31')]);_0x467d03[_0x31d6('0x2f')]=qs[_0x31d6('0x2f')](_0x177f66[_0x31d6('0x41')][_0x31d6('0x2f')]);}_0x467d03['order']=qs[_0x31d6('0x49')](_0x177f66['query'][_0x31d6('0x49')]);_0x467d03[_0x31d6('0x4a')]=qs[_0x31d6('0x43')](_[_0x31d6('0x4b')](_0x177f66[_0x31d6('0x41')],_0x252048['filters']),_0x1546b6);if(_0x177f66[_0x31d6('0x41')]['filter']){_0x467d03[_0x31d6('0x4a')]=_[_0x31d6('0x4c')](_0x467d03[_0x31d6('0x4a')],{'$or':_[_0x31d6('0x3b')](_0x1546b6,function(_0x4afe26){if(_0x4afe26[_0x31d6('0x4d')]!=='VIRTUAL'){var _0x21f553={};_0x21f553[_0x4afe26[_0x31d6('0x39')]]={'$like':'%'+_0x177f66[_0x31d6('0x41')][_0x31d6('0x4e')]+'%'};return _0x21f553;}})});}_0x467d03=_[_0x31d6('0x4c')]({},_0x467d03,_0x177f66[_0x31d6('0x4f')]);var _0x4a7587={'where':_0x467d03['where']};return db['ChatMessage']['count'](_0x4a7587)['then'](function(_0x36e054){_0x2151de[_0x31d6('0x32')]=_0x36e054;if(_0x177f66[_0x31d6('0x41')][_0x31d6('0x50')]){_0x467d03[_0x31d6('0x51')]=[{'all':!![]}];}return db[_0x31d6('0x3c')][_0x31d6('0x52')](_0x467d03);})[_0x31d6('0x20')](function(_0x9cbec2){_0x2151de['rows']=_0x9cbec2;return _0x2151de;})[_0x31d6('0x20')](respondWithFilteredResult(_0x502618,_0x467d03))[_0x31d6('0x2b')](handleError(_0x502618,null));};exports[_0x31d6('0x53')]=function(_0x80e5e3,_0x49e4b1){var _0x5b4d79={'raw':!![],'where':{'id':_0x80e5e3[_0x31d6('0x54')]['id']}},_0x54ce75={};_0x54ce75[_0x31d6('0x40')]=_[_0x31d6('0x42')](db['ChatMessage'][_0x31d6('0x3d')]);_0x54ce75[_0x31d6('0x41')]=_[_0x31d6('0x42')](_0x80e5e3[_0x31d6('0x41')]);_0x54ce75[_0x31d6('0x43')]=_[_0x31d6('0x44')](_0x54ce75['model'],_0x54ce75[_0x31d6('0x41')]);_0x5b4d79['attributes']=_[_0x31d6('0x44')](_0x54ce75[_0x31d6('0x40')],qs[_0x31d6('0x46')](_0x80e5e3[_0x31d6('0x41')][_0x31d6('0x46')]));_0x5b4d79[_0x31d6('0x45')]=_0x5b4d79[_0x31d6('0x45')][_0x31d6('0x47')]?_0x5b4d79[_0x31d6('0x45')]:_0x54ce75[_0x31d6('0x40')];if(_0x80e5e3[_0x31d6('0x41')]['includeAll']){_0x5b4d79[_0x31d6('0x51')]=[{'all':!![]}];}_0x5b4d79=_[_0x31d6('0x4c')]({},_0x5b4d79,_0x80e5e3[_0x31d6('0x4f')]);return db['ChatMessage'][_0x31d6('0x55')](_0x5b4d79)[_0x31d6('0x20')](handleEntityNotFound(_0x49e4b1,null))[_0x31d6('0x20')](respondWithResult(_0x49e4b1,null))[_0x31d6('0x2b')](handleError(_0x49e4b1,null));};exports['create']=function(_0x372367,_0x355e16){return db['ChatMessage'][_0x31d6('0x56')](_0x372367[_0x31d6('0x57')],{})['then'](respondWithResult(_0x355e16,0xc9))[_0x31d6('0x2b')](handleError(_0x355e16,null));};exports[_0x31d6('0x58')]=function(_0x42839c,_0x50feda){if(_0x42839c[_0x31d6('0x57')]['id']){delete _0x42839c['body']['id'];}return db[_0x31d6('0x3c')][_0x31d6('0x55')]({'where':{'id':_0x42839c[_0x31d6('0x54')]['id']}})[_0x31d6('0x20')](handleEntityNotFound(_0x50feda,null))[_0x31d6('0x20')](saveUpdates(_0x42839c[_0x31d6('0x57')],null))[_0x31d6('0x20')](respondWithResult(_0x50feda,null))['catch'](handleError(_0x50feda,null));};exports[_0x31d6('0x37')]=function(_0x4c0670,_0x33975a){return db[_0x31d6('0x3c')][_0x31d6('0x55')]({'where':{'id':_0x4c0670[_0x31d6('0x54')]['id']}})[_0x31d6('0x20')](handleEntityNotFound(_0x33975a,null))[_0x31d6('0x20')](removeEntity(_0x33975a,null))[_0x31d6('0x2b')](handleError(_0x33975a,null));};exports['describe']=function(_0x51836a,_0x4b1691){return db[_0x31d6('0x3c')][_0x31d6('0x59')]()['then'](respondWithResult(_0x4b1691,null))[_0x31d6('0x2b')](handleError(_0x4b1691,null));};var interaction_log=require(_0x31d6('0x5a'))('chat-interactions');exports[_0x31d6('0x5b')]=function(_0x3897bb,_0x11999d,_0x5ec436){var _0x1f0958={'agent':{},'channel':_0x31d6('0x5c')};if(_0x3897bb[_0x31d6('0x57')]['id']){delete _0x3897bb[_0x31d6('0x57')]['id'];}_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5d')]=!![];_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5f')]=_0x3897bb['body'][_0x31d6('0x5f')]||_0x3897bb[_0x31d6('0x60')]['id'];_0x1f0958['agent']['id']=_0x3897bb['body'][_0x31d6('0x5f')];return db['ChatMessage'][_0x31d6('0x55')]({'where':{'id':_0x3897bb[_0x31d6('0x54')]['id'],'UserId':null}})[_0x31d6('0x20')](handleEntityNotFound(_0x11999d,null))[_0x31d6('0x20')](saveUpdates(_0x3897bb['body'],null))['then'](function(_0x25d717){if(_0x25d717){_0x1f0958[_0x31d6('0x29')]=_0x25d717['get']({'plain':!![]});return db[_0x31d6('0x61')][_0x31d6('0x55')]({'where':{'id':_0x25d717['ChatInteractionId']}});}return null;})[_0x31d6('0x20')](handleEntityNotFound(_0x11999d,null))['then'](function(_0x540340){if(_0x540340){return _0x540340['update']({'UserId':_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5f')],'read1stAt':_[_0x31d6('0x62')](_0x540340[_0x31d6('0x63')])?moment()[_0x31d6('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x31d6('0x20')](function(_0x28bc0a){if(_0x28bc0a){_0x1f0958[_0x31d6('0x65')]=_0x28bc0a['get']({'plain':!![]});interaction_log[_0x31d6('0x21')](_0x31d6('0x66'),_0x3897bb[_0x31d6('0x60')]['id'],_0x3897bb['user'][_0x31d6('0x39')],_0x3897bb['user'][_0x31d6('0x67')],_0x1f0958['interaction']['id'],_0x3897bb[_0x31d6('0x57')]?JSON['stringify'](_0x3897bb[_0x31d6('0x57')]):_0x31d6('0x68'));return respondWithRpcPromise('AcceptMessage',_0x31d6('0x69'),_0x1f0958);}return null;})['then'](function(_0x2e8afd){var _0x3a0547=_0x31d6('0x6a')+_0x2e8afd[_0x31d6('0x29')][_0x31d6('0x6b')];return db['sequelize'][_0x31d6('0x41')](_0x3a0547,{'type':db[_0x31d6('0x6c')][_0x31d6('0x6d')][_0x31d6('0x6e')],'raw':!![]})['then'](function(_0xd6239f){return _0xd6239f;});})[_0x31d6('0x20')](function(_0x36ad02){if(_0x36ad02){_0x1f0958[_0x31d6('0x29')][_0x31d6('0x6f')]=_0x36ad02[0x0];if(!_0x3897bb['body']['UserId'])return;return db[_0x31d6('0x70')][_0x31d6('0x55')]({'where':{'id':_0x3897bb[_0x31d6('0x57')][_0x31d6('0x5f')],'role':'agent'},'attributes':['id',_0x31d6('0x39'),_0x31d6('0x71'),_0x31d6('0x72'),_0x31d6('0x73')],'raw':!![]});}return null;})[_0x31d6('0x20')](function(_0x2f579c){if(!_0x2f579c)return null;_0x1f0958['message'][_0x31d6('0x74')]=_0x2f579c;return _0x1f0958;})[_0x31d6('0x20')](function(_0x1a2b7e){if(_0x1a2b7e){if(_0x3897bb[_0x31d6('0x57')][_0x31d6('0x75')]){_0x1f0958['message'][_0x31d6('0x76')]=util[_0x31d6('0x64')](_0x31d6('0x77'),_0x3897bb['user']['name']);_0x1f0958['message'][_0x31d6('0x78')]=_0x1f0958[_0x31d6('0x78')];_0x1f0958[_0x31d6('0x29')][_0x31d6('0x79')]=_0x1f0958[_0x31d6('0x78')];_0x1f0958[_0x31d6('0x29')]['event']=_0x31d6('0x5b');return respondWithRpcPromise(_0x31d6('0x7a'),_0x31d6('0x7a'),{'event':_0x31d6('0x7b'),'message':_[_0x31d6('0x4c')](_0x1f0958['message'],JSON[_0x31d6('0x7c')](_0x1f0958[_0x31d6('0x65')][_0x31d6('0x7d')]))},client9002)[_0x31d6('0x20')](function(){return _0x1f0958;});}return _0x1f0958;}return null;})['then'](respondWithResult(_0x11999d,null))[_0x31d6('0x2b')](handleError(_0x11999d,null));};var interaction_log=require(_0x31d6('0x5a'))(_0x31d6('0x7e'));exports[_0x31d6('0x35')]=function(_0x2b31d6,_0x2f060e,_0xb0067d){var _0x3a7194={'agent':{},'channel':_0x31d6('0x5c')};if(_0x2b31d6['body']['id']){delete _0x2b31d6[_0x31d6('0x57')]['id'];}_0x2b31d6['body'][_0x31d6('0x5f')]=_0x2b31d6['body'][_0x31d6('0x5f')]||_0x2b31d6[_0x31d6('0x60')]['id'];_0x3a7194[_0x31d6('0x74')]['id']=_0x2b31d6[_0x31d6('0x57')][_0x31d6('0x5f')];return db[_0x31d6('0x3c')][_0x31d6('0x55')]({'where':{'id':_0x2b31d6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f060e,null))[_0x31d6('0x20')](function(_0x1169e9){if(_0x1169e9){_0x3a7194['message']=_0x1169e9[_0x31d6('0x7f')]({'plain':!![]});return db['ChatInteraction'][_0x31d6('0x55')]({'where':{'id':_0x1169e9['ChatInteractionId']}});}return null;})[_0x31d6('0x20')](handleEntityNotFound(_0x2f060e,null))[_0x31d6('0x20')](function(_0x14dee1){if(_0x14dee1){_0x3a7194['interaction']=_0x14dee1[_0x31d6('0x7f')]({'plain':!![]});interaction_log['info'](_0x31d6('0x80'),_0x2b31d6[_0x31d6('0x60')]['id'],_0x2b31d6['user'][_0x31d6('0x39')],_0x2b31d6['user'][_0x31d6('0x67')],_0x3a7194[_0x31d6('0x65')]['id'],_0x2b31d6[_0x31d6('0x57')]?JSON[_0x31d6('0x26')](_0x2b31d6[_0x31d6('0x57')]):_0x31d6('0x68'));return respondWithRpcPromise(_0x31d6('0x81'),_0x31d6('0x82'),_0x3a7194);}return null;})['then'](function(_0x5479a5){var _0x2a9e0d=_0x31d6('0x6a')+_0x5479a5[_0x31d6('0x29')]['ContactId'];return db['sequelize'][_0x31d6('0x41')](_0x2a9e0d,{'type':db['Sequelize'][_0x31d6('0x6d')][_0x31d6('0x6e')],'raw':!![]})[_0x31d6('0x20')](function(_0x204df9){return _0x204df9;});})['then'](function(_0x410fd7){if(_0x410fd7){_0x3a7194[_0x31d6('0x29')]['contact']=_0x410fd7[0x0];if(!_0x2b31d6[_0x31d6('0x57')][_0x31d6('0x5f')])return;return db[_0x31d6('0x70')][_0x31d6('0x55')]({'where':{'id':_0x2b31d6[_0x31d6('0x57')]['UserId'],'role':_0x31d6('0x74')},'attributes':['id','name',_0x31d6('0x71'),_0x31d6('0x72'),_0x31d6('0x73')],'raw':!![]});}return null;})[_0x31d6('0x20')](function(_0xae64a0){if(!_0xae64a0)return null;_0x3a7194[_0x31d6('0x29')][_0x31d6('0x74')]=_0xae64a0;return _0x3a7194;})[_0x31d6('0x20')](function(_0x47b879){if(_0x47b879){_0x47b879['message'][_0x31d6('0x76')]=util[_0x31d6('0x64')](_0x31d6('0x77'),_0x2b31d6['user']['name']);_0x47b879[_0x31d6('0x29')][_0x31d6('0x78')]=_0x3a7194[_0x31d6('0x78')];_0x47b879[_0x31d6('0x29')][_0x31d6('0x79')]=_0x3a7194['channel'];_0x47b879[_0x31d6('0x29')]['event']=_0x31d6('0x35');respondWithRpcPromise(_0x31d6('0x7a'),_0x31d6('0x7a'),{'event':_0x31d6('0x83'),'message':_['merge'](_0x3a7194[_0x31d6('0x29')],JSON[_0x31d6('0x7c')](_0x3a7194['interaction'][_0x31d6('0x7d')]))},client9002);return _0x3a7194;}return null;})[_0x31d6('0x20')](respondWithResult(_0x2f060e,null))[_0x31d6('0x2b')](handleError(_0x2f060e,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 4354499..8526ec2 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x55bf=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x5c5d53,_0x4427c3){var _0xb3a9e=function(_0x4f5050){while(--_0x4f5050){_0x5c5d53['push'](_0x5c5d53['shift']());}};_0xb3a9e(++_0x4427c3);}(_0x55bf,0x69));var _0xf55b=function(_0x520da5,_0x30025e){_0x520da5=_0x520da5-0x0;var _0x55425b=_0x55bf[_0x520da5];return _0x55425b;};'use strict';var EventEmitter=require(_0xf55b('0x0'));var ChatMessage=require(_0xf55b('0x1'))['db'][_0xf55b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xf55b('0x3')](0x0);var events={'afterCreate':_0xf55b('0x4'),'afterUpdate':_0xf55b('0x5'),'afterDestroy':_0xf55b('0x6')};function emitEvent(_0x136681){return function(_0x81c0e9,_0x5c52b4,_0x1640b1){ChatMessageEvents[_0xf55b('0x7')](_0x136681+':'+_0x81c0e9['id'],_0x81c0e9);ChatMessageEvents[_0xf55b('0x7')](_0x136681,_0x81c0e9);_0x1640b1(null);};}for(var e in events){if(events[_0xf55b('0x8')](e)){var event=events[e];ChatMessage[_0xf55b('0x9')](e,emitEvent(event));}}module[_0xf55b('0xa')]=ChatMessageEvents;
\ No newline at end of file
+var _0x8bbc=['save','remove','emit','hook','exports','events','ChatMessage'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x8bbc,0xfa));var _0xc8bb=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x8bbc[_0x51e79c];return _0x2467be;};'use strict';var EventEmitter=require(_0xc8bb('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xc8bb('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8bb('0x2'),'afterUpdate':'update','afterDestroy':_0xc8bb('0x3')};function emitEvent(_0x165a58){return function(_0x5f5b73,_0x5ca8e2,_0x2adb0d){ChatMessageEvents[_0xc8bb('0x4')](_0x165a58+':'+_0x5f5b73['id'],_0x5f5b73);ChatMessageEvents[_0xc8bb('0x4')](_0x165a58,_0x5f5b73);_0x2adb0d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc8bb('0x5')](e,emitEvent(event));}}module[_0xc8bb('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 46d2998..da35628 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f11=['update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','ChatInteraction'];(function(_0x2431dd,_0x5eff9e){var _0x7ac975=function(_0x17329e){while(--_0x17329e){_0x2431dd['push'](_0x2431dd['shift']());}};_0x7ac975(++_0x5eff9e);}(_0x3f11,0x1a5));var _0x13f1=function(_0x127565,_0x4cf4c7){_0x127565=_0x127565-0x0;var _0x35090e=_0x3f11[_0x127565];return _0x35090e;};'use strict';var _=require(_0x13f1('0x0'));var util=require(_0x13f1('0x1'));var logger=require('../../config/logger')(_0x13f1('0x2'));var moment=require(_0x13f1('0x3'));var BPromise=require(_0x13f1('0x4'));var rp=require(_0x13f1('0x5'));var fs=require('fs');var path=require(_0x13f1('0x6'));var rimraf=require(_0x13f1('0x7'));var config=require('../../config/environment');var attributes=require(_0x13f1('0x8'));module[_0x13f1('0x9')]=function(_0x4e71e3,_0x56aa7b){return _0x4e71e3[_0x13f1('0xa')](_0x13f1('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x13f1('0xc'),'fields':[_0x13f1('0xd')],'type':_0x13f1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d30e9,_0x31c409,_0x146882){var _0x47ffeb=_0x4e71e3[_0x13f1('0xf')];var _0x17cf36=_0x1d30e9['get']({'plain':!![]});if(_0x17cf36[_0x13f1('0x10')]['toLowerCase']()==='in'||_0x17cf36[_0x13f1('0x10')][_0x13f1('0x11')]()===_0x13f1('0x12')&&!_0x17cf36[_0x13f1('0x13')]&&!_['isNil'](_0x17cf36['UserId'])){_0x47ffeb[_0x13f1('0x14')]['findOne']({'where':{'id':_0x17cf36['ChatInteractionId']}})['then'](function(_0x457e8c){if(_0x457e8c){_0x457e8c[_0x13f1('0x15')]({'lastMsgAt':_0x17cf36[_0x13f1('0x16')],'lastMsgDirection':_0x17cf36[_0x13f1('0x10')][_0x13f1('0x11')]()});}})['catch'](function(_0x2f8d74){console[_0x13f1('0x17')](_0x2f8d74);});}_0x146882();}},'charset':_0x13f1('0x18'),'collate':_0x13f1('0x19')});};
\ No newline at end of file
+var _0x74fb=['moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','models','direction','toLowerCase','out','secret','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x56d956,_0x541848){var _0x671840=function(_0x3767a8){while(--_0x3767a8){_0x56d956['push'](_0x56d956['shift']());}};_0x671840(++_0x541848);}(_0x74fb,0x111));var _0xb74f=function(_0x204981,_0x3a678e){_0x204981=_0x204981-0x0;var _0x1876c1=_0x74fb[_0x204981];return _0x1876c1;};'use strict';var _=require(_0xb74f('0x0'));var util=require(_0xb74f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb74f('0x2'));var BPromise=require(_0xb74f('0x3'));var rp=require(_0xb74f('0x4'));var fs=require('fs');var path=require(_0xb74f('0x5'));var rimraf=require('rimraf');var config=require(_0xb74f('0x6'));var attributes=require(_0xb74f('0x7'));module[_0xb74f('0x8')]=function(_0x366055,_0x1639bf){return _0x366055[_0xb74f('0x9')](_0xb74f('0xa'),attributes,{'tableName':_0xb74f('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xb74f('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4630b4,_0x52894a,_0x30fbe8){var _0x5c2ade=_0x366055[_0xb74f('0xd')];var _0xdd448f=_0x4630b4['get']({'plain':!![]});if(_0xdd448f[_0xb74f('0xe')][_0xb74f('0xf')]()==='in'||_0xdd448f['direction']['toLowerCase']()===_0xb74f('0x10')&&!_0xdd448f[_0xb74f('0x11')]&&!_['isNil'](_0xdd448f['UserId'])){_0x5c2ade['ChatInteraction'][_0xb74f('0x12')]({'where':{'id':_0xdd448f['ChatInteractionId']}})[_0xb74f('0x13')](function(_0x47e004){if(_0x47e004){_0x47e004['update']({'lastMsgAt':_0xdd448f[_0xb74f('0x14')],'lastMsgDirection':_0xdd448f['direction'][_0xb74f('0xf')]()});}})[_0xb74f('0x15')](function(_0x3ca742){console[_0xb74f('0x16')](_0x3ca742);});}_0x30fbe8();}},'charset':_0xb74f('0x17'),'collate':_0xb74f('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 30ec3a0..2bf5ff2 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf781=['result','body','then','info','CreateChatMessage','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xd601cd,_0xa60b07){var _0x5664a3=function(_0x3f5247){while(--_0x3f5247){_0xd601cd['push'](_0xd601cd['shift']());}};_0x5664a3(++_0xa60b07);}(_0xf781,0xd2));var _0x1f78=function(_0x225d29,_0x1d34ff){_0x225d29=_0x225d29-0x0;var _0x6ec715=_0xf781[_0x225d29];return _0x6ec715;};'use strict';var _=require(_0x1f78('0x0'));var util=require('util');var moment=require(_0x1f78('0x1'));var BPromise=require(_0x1f78('0x2'));var rs=require(_0x1f78('0x3'));var fs=require('fs');var Redis=require(_0x1f78('0x4'));var db=require(_0x1f78('0x5'))['db'];var utils=require(_0x1f78('0x6'));var logger=require(_0x1f78('0x7'))(_0x1f78('0x8'));var config=require(_0x1f78('0x9'));var jayson=require(_0x1f78('0xa'));var client=jayson[_0x1f78('0xb')][_0x1f78('0xc')]({'port':0x232a});config[_0x1f78('0xd')]=_[_0x1f78('0xe')](config[_0x1f78('0xd')],{'host':_0x1f78('0xf'),'port':0x18eb});var socket=require(_0x1f78('0x10'))(new Redis(config[_0x1f78('0xd')]));require(_0x1f78('0x11'))[_0x1f78('0x12')](socket);function respondWithRpcPromise(_0x16213b,_0x297a6e,_0x509aa1){return new BPromise(function(_0x30346b,_0xa8213c){return client[_0x1f78('0x13')](_0x16213b,_0x509aa1)['then'](function(_0x1b5781){logger['info'](_0x1f78('0x14'),_0x297a6e,'request\x20sent');logger[_0x1f78('0x15')](_0x1f78('0x16'),_0x297a6e,_0x1f78('0x17'),JSON[_0x1f78('0x18')](_0x1b5781));if(_0x1b5781[_0x1f78('0x19')]){if(_0x1b5781[_0x1f78('0x19')][_0x1f78('0x1a')]===0x1f4){logger[_0x1f78('0x19')](_0x1f78('0x14'),_0x297a6e,_0x1b5781['error']['message']);return _0xa8213c(_0x1b5781[_0x1f78('0x19')][_0x1f78('0x1b')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x297a6e,_0x1b5781[_0x1f78('0x19')]['message']);return _0x30346b(_0x1b5781[_0x1f78('0x19')][_0x1f78('0x1b')]);}else{logger['info'](_0x1f78('0x14'),_0x297a6e,'request\x20sent');_0x30346b(_0x1b5781[_0x1f78('0x1c')][_0x1f78('0x1b')]);}})['catch'](function(_0xc93a53){logger['error'](_0x1f78('0x14'),_0x297a6e,_0xc93a53);_0xa8213c(_0xc93a53);});});}exports['CreateChatMessage']=function(_0x245d03){var _0x5c686d=this;return new Promise(function(_0x3677e5,_0x2af3cd){return db['ChatMessage']['create'](_0x245d03[_0x1f78('0x1d')],{'raw':_0x245d03['options']?_0x245d03['options']['raw']===undefined?!![]:![]:!![]})[_0x1f78('0x1e')](function(_0x5121b5){logger[_0x1f78('0x1f')](_0x1f78('0x20'),_0x245d03);logger[_0x1f78('0x15')]('CreateChatMessage',_0x245d03,JSON['stringify'](_0x5121b5));_0x3677e5(_0x5121b5);})[_0x1f78('0x21')](function(_0x4b6f54){logger[_0x1f78('0x19')]('CreateChatMessage',_0x4b6f54[_0x1f78('0x1b')],_0x245d03);_0x2af3cd(_0x5c686d[_0x1f78('0x19')](0x1f4,_0x4b6f54[_0x1f78('0x1b')]));});});};
\ No newline at end of file
+var _0x98f7=['error','code','message','result','catch','create','body','raw','then','info','CreateChatMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./chatMessage.socket','register','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0x98f7,0xcb));var _0x798f=function(_0x363e2d,_0x162f16){_0x363e2d=_0x363e2d-0x0;var _0x58f34f=_0x98f7[_0x363e2d];return _0x58f34f;};'use strict';var _=require(_0x798f('0x0'));var util=require('util');var moment=require(_0x798f('0x1'));var BPromise=require('bluebird');var rs=require(_0x798f('0x2'));var fs=require('fs');var Redis=require(_0x798f('0x3'));var db=require(_0x798f('0x4'))['db'];var utils=require(_0x798f('0x5'));var logger=require(_0x798f('0x6'))(_0x798f('0x7'));var config=require(_0x798f('0x8'));var jayson=require(_0x798f('0x9'));var client=jayson['client'][_0x798f('0xa')]({'port':0x232a});config['redis']=_[_0x798f('0xb')](config[_0x798f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x798f('0xd'))(new Redis(config[_0x798f('0xc')]));require(_0x798f('0xe'))[_0x798f('0xf')](socket);function respondWithRpcPromise(_0x32dfd7,_0x48fbe7,_0x598e49){return new BPromise(function(_0x1e6845,_0x3cedb3){return client[_0x798f('0x10')](_0x32dfd7,_0x598e49)['then'](function(_0x55a1b3){logger['info'](_0x798f('0x11'),_0x48fbe7,_0x798f('0x12'));logger[_0x798f('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x48fbe7,_0x798f('0x12'),JSON[_0x798f('0x14')](_0x55a1b3));if(_0x55a1b3[_0x798f('0x15')]){if(_0x55a1b3[_0x798f('0x15')][_0x798f('0x16')]===0x1f4){logger[_0x798f('0x15')]('ChatMessage,\x20%s,\x20%s',_0x48fbe7,_0x55a1b3[_0x798f('0x15')]['message']);return _0x3cedb3(_0x55a1b3['error'][_0x798f('0x17')]);}logger[_0x798f('0x15')](_0x798f('0x11'),_0x48fbe7,_0x55a1b3['error']['message']);return _0x1e6845(_0x55a1b3[_0x798f('0x15')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x48fbe7,_0x798f('0x12'));_0x1e6845(_0x55a1b3[_0x798f('0x18')][_0x798f('0x17')]);}})[_0x798f('0x19')](function(_0x5169c1){logger[_0x798f('0x15')](_0x798f('0x11'),_0x48fbe7,_0x5169c1);_0x3cedb3(_0x5169c1);});});}exports['CreateChatMessage']=function(_0x223e67){var _0x5ddcac=this;return new Promise(function(_0x4f233f,_0x251483){return db['ChatMessage'][_0x798f('0x1a')](_0x223e67[_0x798f('0x1b')],{'raw':_0x223e67['options']?_0x223e67['options'][_0x798f('0x1c')]===undefined?!![]:![]:!![]})[_0x798f('0x1d')](function(_0x5ec886){logger[_0x798f('0x1e')](_0x798f('0x1f'),_0x223e67);logger[_0x798f('0x13')](_0x798f('0x1f'),_0x223e67,JSON['stringify'](_0x5ec886));_0x4f233f(_0x5ec886);})[_0x798f('0x19')](function(_0x431dc0){logger[_0x798f('0x15')]('CreateChatMessage',_0x431dc0[_0x798f('0x17')],_0x223e67);_0x251483(_0x5ddcac[_0x798f('0x15')](0x1f4,_0x431dc0[_0x798f('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 555ea00..8688d2d 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb647=['register','length','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x29d439,_0x1ed945){var _0x25b480=function(_0x43423e){while(--_0x43423e){_0x29d439['push'](_0x29d439['shift']());}};_0x25b480(++_0x1ed945);}(_0xb647,0xdb));var _0x7b64=function(_0x2a4b06,_0x41bf9b){_0x2a4b06=_0x2a4b06-0x0;var _0x4b76c3=_0xb647[_0x2a4b06];return _0x4b76c3;};'use strict';var ChatMessageEvents=require(_0x7b64('0x0'));var events=[_0x7b64('0x1'),_0x7b64('0x2'),_0x7b64('0x3')];function createListener(_0x38de52,_0x3b659e){return function(_0x274824){_0x3b659e[_0x7b64('0x4')](_0x38de52,_0x274824);};}function removeListener(_0x54eee8,_0x36ff12){return function(){ChatMessageEvents['removeListener'](_0x54eee8,_0x36ff12);};}exports[_0x7b64('0x5')]=function(_0x38ebf7){for(var _0x31915b=0x0,_0x80721a=events[_0x7b64('0x6')];_0x31915b<_0x80721a;_0x31915b++){var _0x22eca3=events[_0x31915b];var _0x727684=createListener(_0x7b64('0x7')+_0x22eca3,_0x38ebf7);ChatMessageEvents['on'](_0x22eca3,_0x727684);}};
\ No newline at end of file
+var _0xfb65=['emit','removeListener','register','length','save','remove'];(function(_0x9b5bb2,_0x5db315){var _0x2e1e92=function(_0x5621c9){while(--_0x5621c9){_0x9b5bb2['push'](_0x9b5bb2['shift']());}};_0x2e1e92(++_0x5db315);}(_0xfb65,0x82));var _0x5fb6=function(_0x58459e,_0x3f7d79){_0x58459e=_0x58459e-0x0;var _0x4b5be2=_0xfb65[_0x58459e];return _0x4b5be2;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5fb6('0x0'),_0x5fb6('0x1'),'update'];function createListener(_0x860687,_0x54af6d){return function(_0x194bac){_0x54af6d[_0x5fb6('0x2')](_0x860687,_0x194bac);};}function removeListener(_0xca6345,_0xb5f7c4){return function(){ChatMessageEvents[_0x5fb6('0x3')](_0xca6345,_0xb5f7c4);};}exports[_0x5fb6('0x4')]=function(_0x4dec8f){for(var _0x50782b=0x0,_0x238914=events[_0x5fb6('0x5')];_0x50782b<_0x238914;_0x50782b++){var _0x1f99b8=events[_0x50782b];var _0x840390=createListener('chatMessage:'+_0x1f99b8,_0x4dec8f);ChatMessageEvents['on'](_0x1f99b8,_0x840390);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b238ef4..3ce9cba 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4e57=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','describe','/:id','isAuthenticated','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','path'];(function(_0x2fde11,_0x3a54a5){var _0x3c023f=function(_0x2efe52){while(--_0x2efe52){_0x2fde11['push'](_0x2fde11['shift']());}};_0x3c023f(++_0x3a54a5);}(_0x4e57,0x1e3));var _0x74e5=function(_0x498481,_0x3fc2cf){_0x498481=_0x498481-0x0;var _0x6cd424=_0x4e57[_0x498481];return _0x6cd424;};'use strict';var multer=require(_0x74e5('0x0'));var util=require(_0x74e5('0x1'));var path=require(_0x74e5('0x2'));var timeout=require('connect-timeout');var express=require(_0x74e5('0x3'));var router=express[_0x74e5('0x4')]();var fs_extra=require(_0x74e5('0x5'));var auth=require(_0x74e5('0x6'));var interaction=require(_0x74e5('0x7'));var config=require(_0x74e5('0x8'));var controller=require(_0x74e5('0x9'));router[_0x74e5('0xa')]('/',auth['isAuthenticated'](),controller[_0x74e5('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x74e5('0xc')]);router[_0x74e5('0xa')](_0x74e5('0xd'),auth[_0x74e5('0xe')](),controller['show']);router['post']('/',auth[_0x74e5('0xe')](),interaction[_0x74e5('0xf')](_0x74e5('0x10'),_0x74e5('0x11')),controller[_0x74e5('0x12')]);router[_0x74e5('0x13')](_0x74e5('0xd'),controller[_0x74e5('0x14')]);router[_0x74e5('0x13')](_0x74e5('0x15'),auth[_0x74e5('0xe')](),controller[_0x74e5('0x16')]);router['put'](_0x74e5('0x17'),auth[_0x74e5('0xe')](),controller[_0x74e5('0x18')]);router[_0x74e5('0x19')](_0x74e5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x74e5('0x1a')]=router;
\ No newline at end of file
+var _0x2aaf=['/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','tracked','chat','chatmessage:create','create','put','update'];(function(_0x11f91c,_0x1b6301){var _0x3cc054=function(_0x4d7e79){while(--_0x4d7e79){_0x11f91c['push'](_0x11f91c['shift']());}};_0x3cc054(++_0x1b6301);}(_0x2aaf,0x130));var _0xf2aa=function(_0x4a1c27,_0x46a040){_0x4a1c27=_0x4a1c27-0x0;var _0x564029=_0x2aaf[_0x4a1c27];return _0x564029;};'use strict';var multer=require(_0xf2aa('0x0'));var util=require(_0xf2aa('0x1'));var path=require('path');var timeout=require(_0xf2aa('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf2aa('0x3'));var auth=require(_0xf2aa('0x4'));var interaction=require(_0xf2aa('0x5'));var config=require(_0xf2aa('0x6'));var controller=require(_0xf2aa('0x7'));router[_0xf2aa('0x8')]('/',auth[_0xf2aa('0x9')](),controller[_0xf2aa('0xa')]);router[_0xf2aa('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xf2aa('0xb'),auth[_0xf2aa('0x9')](),controller['show']);router['post']('/',auth[_0xf2aa('0x9')](),interaction[_0xf2aa('0xc')](_0xf2aa('0xd'),_0xf2aa('0xe')),controller[_0xf2aa('0xf')]);router[_0xf2aa('0x10')]('/:id',controller[_0xf2aa('0x11')]);router['put'](_0xf2aa('0x12'),auth['isAuthenticated'](),controller[_0xf2aa('0x13')]);router[_0xf2aa('0x10')](_0xf2aa('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0xf2aa('0x15')](_0xf2aa('0xb'),auth[_0xf2aa('0x9')](),controller[_0xf2aa('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 3217d6e..3173df4 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0b0e,0x187));var _0xe0b0=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0x0b0e[_0x133296];return _0x193517;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x1a6789,_0x1b0600){var _0xbcfafa=function(_0x31d29d){while(--_0x31d29d){_0x1a6789['push'](_0x1a6789['shift']());}};_0xbcfafa(++_0x1b0600);}(_0x5f2f,0x73));var _0xf5f2=function(_0x28158f,_0x51146d){_0x28158f=_0x28158f-0x0;var _0x274ae4=_0x5f2f[_0x28158f];return _0x274ae4;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 2a6bbed..3e11c0f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x7a54,0x106));var _0x47a5=function(_0x2961de,_0x25d3d1){_0x2961de=_0x2961de-0x0;var _0x5e05f8=_0x7a54[_0x2961de];return _0x5e05f8;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7a54,0x106));var _0x47a5=function(_0x2d89dc,_0x7e32fe){_0x2d89dc=_0x2d89dc-0x0;var _0x4e50c3=_0x7a54[_0x2d89dc];return _0x4e50c3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 22dd678..b7e10da 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd906=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x19bc2b,_0x1fac70){var _0x4a0f75=function(_0x204000){while(--_0x204000){_0x19bc2b['push'](_0x19bc2b['shift']());}};_0x4a0f75(++_0x1fac70);}(_0xd906,0x197));var _0x6d90=function(_0x394d98,_0x40c4dc){_0x394d98=_0x394d98-0x0;var _0x377709=_0xd906[_0x394d98];return _0x377709;};'use strict';var EventEmitter=require(_0x6d90('0x0'));var ChatOfflineMessage=require(_0x6d90('0x1'))['db'][_0x6d90('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x6d90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d90('0x4'),'afterDestroy':_0x6d90('0x5')};function emitEvent(_0x4d6081){return function(_0x4f7015,_0x2d1d56,_0x73af2a){ChatOfflineMessageEvents[_0x6d90('0x6')](_0x4d6081+':'+_0x4f7015['id'],_0x4f7015);ChatOfflineMessageEvents[_0x6d90('0x6')](_0x4d6081,_0x4f7015);_0x73af2a(null);};}for(var e in events){if(events[_0x6d90('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x6d90('0x8')](e,emitEvent(event));}}module[_0x6d90('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x1f89=['hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x533879,_0x184a56){var _0x583f88=function(_0x5dfc82){while(--_0x5dfc82){_0x533879['push'](_0x533879['shift']());}};_0x583f88(++_0x184a56);}(_0x1f89,0x14c));var _0x91f8=function(_0x38022a,_0x54b1dc){_0x38022a=_0x38022a-0x0;var _0x1b0d93=_0x1f89[_0x38022a];return _0x1b0d93;};'use strict';var EventEmitter=require(_0x91f8('0x0'));var ChatOfflineMessage=require(_0x91f8('0x1'))['db'][_0x91f8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x91f8('0x3')](0x0);var events={'afterCreate':_0x91f8('0x4'),'afterUpdate':_0x91f8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x408f1e){return function(_0x52b2d1,_0x2d1ffb,_0x171382){ChatOfflineMessageEvents[_0x91f8('0x6')](_0x408f1e+':'+_0x52b2d1['id'],_0x52b2d1);ChatOfflineMessageEvents['emit'](_0x408f1e,_0x52b2d1);_0x171382(null);};}for(var e in events){if(events[_0x91f8('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x91f8('0x8')](e,emitEvent(event));}}module[_0x91f8('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index c2b7052..b342359 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9b7=['./chatOfflineMessage.attributes','exports','define'];(function(_0x570408,_0x47dfc0){var _0x1990bf=function(_0x4dc2c2){while(--_0x4dc2c2){_0x570408['push'](_0x570408['shift']());}};_0x1990bf(++_0x47dfc0);}(_0xa9b7,0x13e));var _0x7a9b=function(_0xc908d4,_0xf98162){_0xc908d4=_0xc908d4-0x0;var _0x330143=_0xa9b7[_0xc908d4];return _0x330143;};'use strict';var attributes=require(_0x7a9b('0x0'));module[_0x7a9b('0x1')]=function(_0x2dfa99){return _0x2dfa99[_0x7a9b('0x2')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6e61=['define','ChatOfflineMessage','chat_offline_messages','./chatOfflineMessage.attributes','exports'];(function(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0x6e61,0xe4));var _0x16e6=function(_0x43828c,_0x119bd2){_0x43828c=_0x43828c-0x0;var _0x5d0d46=_0x6e61[_0x43828c];return _0x5d0d46;};'use strict';var attributes=require(_0x16e6('0x0'));module[_0x16e6('0x1')]=function(_0x48f388){return _0x48f388[_0x16e6('0x2')](_0x16e6('0x3'),attributes,{'tableName':_0x16e6('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 3efdb15..1c894d5 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xedc2=['info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then'];(function(_0x4f3882,_0x5127a0){var _0x567c35=function(_0x3515d0){while(--_0x3515d0){_0x4f3882['push'](_0x4f3882['shift']());}};_0x567c35(++_0x5127a0);}(_0xedc2,0x183));var _0x2edc=function(_0xe56e0a,_0x51667b){_0xe56e0a=_0xe56e0a-0x0;var _0x2f8b29=_0xedc2[_0xe56e0a];return _0x2f8b29;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2edc('0x0'));var fs=require('fs');var Redis=require(_0x2edc('0x1'));var db=require(_0x2edc('0x2'))['db'];var utils=require(_0x2edc('0x3'));var logger=require(_0x2edc('0x4'))(_0x2edc('0x5'));var config=require(_0x2edc('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b08af,_0x476e2f,_0x400875){return new BPromise(function(_0x4712ee,_0x2a13cd){return client[_0x2edc('0x7')](_0x2b08af,_0x400875)[_0x2edc('0x8')](function(_0x3305ef){logger[_0x2edc('0x9')](_0x2edc('0xa'),_0x476e2f,_0x2edc('0xb'));logger[_0x2edc('0xc')](_0x2edc('0xd'),_0x476e2f,_0x2edc('0xb'),JSON[_0x2edc('0xe')](_0x3305ef));if(_0x3305ef[_0x2edc('0xf')]){if(_0x3305ef[_0x2edc('0xf')]['code']===0x1f4){logger[_0x2edc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x476e2f,_0x3305ef[_0x2edc('0xf')]['message']);return _0x2a13cd(_0x3305ef['error'][_0x2edc('0x10')]);}logger[_0x2edc('0xf')](_0x2edc('0xa'),_0x476e2f,_0x3305ef['error'][_0x2edc('0x10')]);return _0x4712ee(_0x3305ef['error'][_0x2edc('0x10')]);}else{logger[_0x2edc('0x9')](_0x2edc('0xa'),_0x476e2f,_0x2edc('0xb'));_0x4712ee(_0x3305ef[_0x2edc('0x11')][_0x2edc('0x10')]);}})['catch'](function(_0x5a6e60){logger[_0x2edc('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x476e2f,_0x5a6e60);_0x2a13cd(_0x5a6e60);});});}
\ No newline at end of file
+var _0xd088=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd088,0x160));var _0x8d08=function(_0x8d1557,_0x5b0561){_0x8d1557=_0x8d1557-0x0;var _0x13dd86=_0xd088[_0x8d1557];return _0x13dd86;};'use strict';var _=require(_0x8d08('0x0'));var util=require(_0x8d08('0x1'));var moment=require(_0x8d08('0x2'));var BPromise=require(_0x8d08('0x3'));var rs=require(_0x8d08('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d08('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d08('0x6'))('rpc');var config=require(_0x8d08('0x7'));var jayson=require(_0x8d08('0x8'));var client=jayson[_0x8d08('0x9')][_0x8d08('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d58b,_0x3accbb,_0x1cf2d2){return new BPromise(function(_0x53a6ae,_0x4ed00c){return client[_0x8d08('0xb')](_0x48d58b,_0x1cf2d2)[_0x8d08('0xc')](function(_0x1ff34f){logger['info'](_0x8d08('0xd'),_0x3accbb,_0x8d08('0xe'));logger['debug'](_0x8d08('0xf'),_0x3accbb,_0x8d08('0xe'),JSON['stringify'](_0x1ff34f));if(_0x1ff34f[_0x8d08('0x10')]){if(_0x1ff34f['error'][_0x8d08('0x11')]===0x1f4){logger[_0x8d08('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3accbb,_0x1ff34f['error']['message']);return _0x4ed00c(_0x1ff34f[_0x8d08('0x10')][_0x8d08('0x12')]);}logger[_0x8d08('0x10')](_0x8d08('0xd'),_0x3accbb,_0x1ff34f[_0x8d08('0x10')][_0x8d08('0x12')]);return _0x53a6ae(_0x1ff34f[_0x8d08('0x10')][_0x8d08('0x12')]);}else{logger[_0x8d08('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3accbb,_0x8d08('0xe'));_0x53a6ae(_0x1ff34f['result'][_0x8d08('0x12')]);}})[_0x8d08('0x14')](function(_0xf4b3be){logger[_0x8d08('0x10')](_0x8d08('0xd'),_0x3accbb,_0xf4b3be);_0x4ed00c(_0xf4b3be);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 36cff39..4f9688a 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x36dd=['../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x36dd,0xca));var _0xd36d=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x36dd[_0x47a40b];return _0x19610c;};'use strict';var multer=require(_0xd36d('0x0'));var util=require(_0xd36d('0x1'));var path=require('path');var timeout=require(_0xd36d('0x2'));var express=require(_0xd36d('0x3'));var router=express[_0xd36d('0x4')]();var fs_extra=require(_0xd36d('0x5'));var auth=require(_0xd36d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd36d('0x7'));var controller=require(_0xd36d('0x8'));router['get']('/',auth[_0xd36d('0x9')](),controller['index']);router[_0xd36d('0xa')](_0xd36d('0xb'),auth[_0xd36d('0x9')](),controller[_0xd36d('0xc')]);router[_0xd36d('0xa')](_0xd36d('0xd'),auth[_0xd36d('0x9')](),controller[_0xd36d('0xe')]);router['post']('/',auth[_0xd36d('0x9')](),controller[_0xd36d('0xf')]);router[_0xd36d('0x10')](_0xd36d('0xd'),auth[_0xd36d('0x9')](),controller[_0xd36d('0x11')]);router[_0xd36d('0x12')](_0xd36d('0xd'),auth[_0xd36d('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8835=['describe','isAuthenticated','show','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x4b99dc,_0x33d412){var _0xe3b7b8=function(_0x55109f){while(--_0x55109f){_0x4b99dc['push'](_0x4b99dc['shift']());}};_0xe3b7b8(++_0x33d412);}(_0x8835,0xdb));var _0x5883=function(_0x45eb26,_0xc0cb2c){_0x45eb26=_0x45eb26-0x0;var _0xf27984=_0x8835[_0x45eb26];return _0xf27984;};'use strict';var multer=require('multer');var util=require(_0x5883('0x0'));var path=require(_0x5883('0x1'));var timeout=require(_0x5883('0x2'));var express=require(_0x5883('0x3'));var router=express[_0x5883('0x4')]();var fs_extra=require(_0x5883('0x5'));var auth=require(_0x5883('0x6'));var interaction=require(_0x5883('0x7'));var config=require(_0x5883('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x5883('0x9')]('/',auth['isAuthenticated'](),controller[_0x5883('0xa')]);router['get'](_0x5883('0xb'),auth['isAuthenticated'](),controller[_0x5883('0xc')]);router[_0x5883('0x9')]('/:id',auth[_0x5883('0xd')](),controller[_0x5883('0xe')]);router['post']('/',auth[_0x5883('0xd')](),controller['create']);router[_0x5883('0xf')](_0x5883('0x10'),auth['isAuthenticated'](),controller[_0x5883('0x11')]);router[_0x5883('0x12')](_0x5883('0x10'),auth[_0x5883('0xd')](),controller[_0x5883('0x13')]);module[_0x5883('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index bad5141..3e758fa 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f28=['INTEGER','sequelize','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x36f243,_0x188505){var _0x426436=function(_0x1c8622){while(--_0x1c8622){_0x36f243['push'](_0x36f243['shift']());}};_0x426436(++_0x188505);}(_0x5f28,0x1b3));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x85f2('0x0'));module[_0x85f2('0x1')]={'name':{'type':Sequelize[_0x85f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x85f2('0x3')]('mouseOver',_0x85f2('0x4')),'defaultValue':_0x85f2('0x5')},'selector':{'type':Sequelize[_0x85f2('0x2')]},'timeout':{'type':Sequelize[_0x85f2('0x6')]}};
\ No newline at end of file
+var _0x649a=['sequelize','exports','STRING','mouseOver','timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x649a,0x19a));var _0xa649=function(_0x3e8bf8,_0x4e76d6){_0x3e8bf8=_0x3e8bf8-0x0;var _0x3391ce=_0x649a[_0x3e8bf8];return _0x3391ce;};'use strict';var Sequelize=require(_0xa649('0x0'));module[_0xa649('0x1')]={'name':{'type':Sequelize[_0xa649('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa649('0x3'),_0xa649('0x4')),'defaultValue':_0xa649('0x3')},'selector':{'type':Sequelize[_0xa649('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index bb4b6ea..9c5f9b1 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e11=['body','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','send','params','keys','rawAttributes','query','attributes','model','fields','length','merge','catch','create','ChatProactiveAction'];(function(_0x4613d5,_0x50cdfd){var _0x18a5b8=function(_0x26bb02){while(--_0x26bb02){_0x4613d5['push'](_0x4613d5['shift']());}};_0x18a5b8(++_0x50cdfd);}(_0x5e11,0x1c3));var _0x15e1=function(_0x16a223,_0x31b6e8){_0x16a223=_0x16a223-0x0;var _0x5ded66=_0x5e11[_0x16a223];return _0x5ded66;};'use strict';var emlformat=require(_0x15e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15e1('0x1'));var jsonpatch=require(_0x15e1('0x2'));var rp=require(_0x15e1('0x3'));var moment=require(_0x15e1('0x4'));var BPromise=require(_0x15e1('0x5'));var Mustache=require(_0x15e1('0x6'));var util=require('util');var path=require(_0x15e1('0x7'));var sox=require('sox');var csv=require(_0x15e1('0x8'));var ejs=require(_0x15e1('0x9'));var fs=require('fs');var fs_extra=require(_0x15e1('0xa'));var _=require(_0x15e1('0xb'));var squel=require(_0x15e1('0xc'));var crypto=require('crypto');var jsforce=require(_0x15e1('0xd'));var deskjs=require(_0x15e1('0xe'));var toCsv=require(_0x15e1('0x8'));var querystring=require(_0x15e1('0xf'));var Papa=require('papaparse');var Redis=require(_0x15e1('0x10'));var authService=require(_0x15e1('0x11'));var qs=require(_0x15e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15e1('0x13'));var logger=require(_0x15e1('0x14'))(_0x15e1('0x15'));var utils=require(_0x15e1('0x16'));var config=require(_0x15e1('0x17'));var licenseUtil=require(_0x15e1('0x18'));var db=require(_0x15e1('0x19'))['db'];function respondWithStatusCode(_0xacda2f,_0x3d423c){_0x3d423c=_0x3d423c||0xcc;return function(_0x11486f){if(_0x11486f){return _0xacda2f[_0x15e1('0x1a')](_0x3d423c);}return _0xacda2f[_0x15e1('0x1b')](_0x3d423c)['end']();};}function respondWithResult(_0x3629ea,_0x158d0f){_0x158d0f=_0x158d0f||0xc8;return function(_0x3db265){if(_0x3db265){return _0x3629ea['status'](_0x158d0f)[_0x15e1('0x1c')](_0x3db265);}};}function respondWithFilteredResult(_0x4647a0,_0x499bd3){return function(_0x381bb4){if(_0x381bb4){var _0xa1ba90=typeof _0x499bd3[_0x15e1('0x1d')]===_0x15e1('0x1e')&&typeof _0x499bd3[_0x15e1('0x1f')]===_0x15e1('0x1e');var _0x376500=_0x381bb4[_0x15e1('0x20')];var _0x46cd6f=_0xa1ba90?0x0:_0x499bd3[_0x15e1('0x1d')];var _0x440c73=_0xa1ba90?_0x381bb4[_0x15e1('0x20')]:_0x499bd3[_0x15e1('0x1d')]+_0x499bd3[_0x15e1('0x1f')];var _0x1b3b13;if(_0x440c73>=_0x376500){_0x440c73=_0x376500;_0x1b3b13=0xc8;}else{_0x1b3b13=0xce;}_0x4647a0[_0x15e1('0x1b')](_0x1b3b13);return _0x4647a0['set'](_0x15e1('0x21'),_0x46cd6f+'-'+_0x440c73+'/'+_0x376500)[_0x15e1('0x1c')](_0x381bb4);}return null;};}function patchUpdates(_0x5de6d9){return function(_0x4712fe){try{jsonpatch[_0x15e1('0x22')](_0x4712fe,_0x5de6d9,!![]);}catch(_0x9a97d1){return BPromise[_0x15e1('0x23')](_0x9a97d1);}return _0x4712fe['save']();};}function saveUpdates(_0x522dd0,_0x1648f4){return function(_0x160c65){if(_0x160c65){return _0x160c65[_0x15e1('0x24')](_0x522dd0)[_0x15e1('0x25')](function(_0x2d91ee){return _0x2d91ee;});}return null;};}function removeEntity(_0x2e3f31,_0x2e8796){return function(_0x59369e){if(_0x59369e){return _0x59369e['destroy']()[_0x15e1('0x25')](function(){_0x2e3f31[_0x15e1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b89a3,_0x3d0f0f){return function(_0x130ed6){if(!_0x130ed6){_0x4b89a3['sendStatus'](0x194);}return _0x130ed6;};}function handleError(_0x477ff1,_0x1c8538){_0x1c8538=_0x1c8538||0x1f4;return function(_0x21d188){logger[_0x15e1('0x26')](_0x21d188[_0x15e1('0x27')]);if(_0x21d188['name']){delete _0x21d188['name'];}_0x477ff1['status'](_0x1c8538)[_0x15e1('0x28')](_0x21d188);};}exports['show']=function(_0x2dd839,_0x23664b){var _0x201b53={'raw':!![],'where':{'id':_0x2dd839[_0x15e1('0x29')]['id']}},_0x16c14e={};_0x16c14e['model']=_[_0x15e1('0x2a')](db['ChatProactiveAction'][_0x15e1('0x2b')]);_0x16c14e['query']=_['keys'](_0x2dd839[_0x15e1('0x2c')]);_0x16c14e['filters']=_['intersection'](_0x16c14e['model'],_0x16c14e[_0x15e1('0x2c')]);_0x201b53[_0x15e1('0x2d')]=_['intersection'](_0x16c14e[_0x15e1('0x2e')],qs[_0x15e1('0x2f')](_0x2dd839['query'][_0x15e1('0x2f')]));_0x201b53[_0x15e1('0x2d')]=_0x201b53[_0x15e1('0x2d')][_0x15e1('0x30')]?_0x201b53['attributes']:_0x16c14e[_0x15e1('0x2e')];if(_0x2dd839[_0x15e1('0x2c')]['includeAll']){_0x201b53['include']=[{'all':!![]}];}_0x201b53=_[_0x15e1('0x31')]({},_0x201b53,_0x2dd839['options']);return db['ChatProactiveAction']['find'](_0x201b53)[_0x15e1('0x25')](handleEntityNotFound(_0x23664b,null))[_0x15e1('0x25')](respondWithResult(_0x23664b,null))[_0x15e1('0x32')](handleError(_0x23664b,null));};exports[_0x15e1('0x33')]=function(_0x2616f7,_0x348acd){return db[_0x15e1('0x34')][_0x15e1('0x33')](_0x2616f7[_0x15e1('0x35')],{})[_0x15e1('0x25')](respondWithResult(_0x348acd,0xc9))[_0x15e1('0x32')](handleError(_0x348acd,null));};exports[_0x15e1('0x24')]=function(_0x49866d,_0x4c74e9){if(_0x49866d['body']['id']){delete _0x49866d[_0x15e1('0x35')]['id'];}return db['ChatProactiveAction'][_0x15e1('0x36')]({'where':{'id':_0x49866d['params']['id']}})['then'](handleEntityNotFound(_0x4c74e9,null))[_0x15e1('0x25')](saveUpdates(_0x49866d[_0x15e1('0x35')],null))[_0x15e1('0x25')](respondWithResult(_0x4c74e9,null))[_0x15e1('0x32')](handleError(_0x4c74e9,null));};exports[_0x15e1('0x37')]=function(_0x2cf4f6,_0x55825b){return db[_0x15e1('0x34')][_0x15e1('0x36')]({'where':{'id':_0x2cf4f6['params']['id']}})['then'](handleEntityNotFound(_0x55825b,null))['then'](removeEntity(_0x55825b,null))[_0x15e1('0x32')](handleError(_0x55825b,null));};
\ No newline at end of file
+var _0x7d9f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','update','then','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','create','body'];(function(_0x29ce5f,_0x293fed){var _0x25dfc6=function(_0x22bc69){while(--_0x22bc69){_0x29ce5f['push'](_0x29ce5f['shift']());}};_0x25dfc6(++_0x293fed);}(_0x7d9f,0x15c));var _0xf7d9=function(_0xc83c25,_0x106681){_0xc83c25=_0xc83c25-0x0;var _0x5ed069=_0x7d9f[_0xc83c25];return _0x5ed069;};'use strict';var emlformat=require(_0xf7d9('0x0'));var rimraf=require(_0xf7d9('0x1'));var zipdir=require(_0xf7d9('0x2'));var jsonpatch=require(_0xf7d9('0x3'));var rp=require(_0xf7d9('0x4'));var moment=require('moment');var BPromise=require(_0xf7d9('0x5'));var Mustache=require(_0xf7d9('0x6'));var util=require(_0xf7d9('0x7'));var path=require(_0xf7d9('0x8'));var sox=require(_0xf7d9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf7d9('0xa'));var _=require(_0xf7d9('0xb'));var squel=require('squel');var crypto=require(_0xf7d9('0xc'));var jsforce=require(_0xf7d9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7d9('0xe'));var querystring=require('querystring');var Papa=require(_0xf7d9('0xf'));var Redis=require(_0xf7d9('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf7d9('0x11'));var hardwareService=require(_0xf7d9('0x12'));var logger=require(_0xf7d9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf7d9('0x14'));var licenseUtil=require(_0xf7d9('0x15'));var db=require(_0xf7d9('0x16'))['db'];function respondWithStatusCode(_0x35e156,_0x594dfe){_0x594dfe=_0x594dfe||0xcc;return function(_0x16e680){if(_0x16e680){return _0x35e156[_0xf7d9('0x17')](_0x594dfe);}return _0x35e156[_0xf7d9('0x18')](_0x594dfe)[_0xf7d9('0x19')]();};}function respondWithResult(_0x49f766,_0x189c82){_0x189c82=_0x189c82||0xc8;return function(_0x359843){if(_0x359843){return _0x49f766[_0xf7d9('0x18')](_0x189c82)[_0xf7d9('0x1a')](_0x359843);}};}function respondWithFilteredResult(_0x5d3029,_0x405ed4){return function(_0x22ed4a){if(_0x22ed4a){var _0x341e27=typeof _0x405ed4['offset']==='undefined'&&typeof _0x405ed4[_0xf7d9('0x1b')]===_0xf7d9('0x1c');var _0xe29103=_0x22ed4a['count'];var _0x44ebd3=_0x341e27?0x0:_0x405ed4[_0xf7d9('0x1d')];var _0x5eb7c9=_0x341e27?_0x22ed4a[_0xf7d9('0x1e')]:_0x405ed4['offset']+_0x405ed4[_0xf7d9('0x1b')];var _0x1bbc77;if(_0x5eb7c9>=_0xe29103){_0x5eb7c9=_0xe29103;_0x1bbc77=0xc8;}else{_0x1bbc77=0xce;}_0x5d3029['status'](_0x1bbc77);return _0x5d3029[_0xf7d9('0x1f')](_0xf7d9('0x20'),_0x44ebd3+'-'+_0x5eb7c9+'/'+_0xe29103)[_0xf7d9('0x1a')](_0x22ed4a);}return null;};}function patchUpdates(_0x316d54){return function(_0x165160){try{jsonpatch[_0xf7d9('0x21')](_0x165160,_0x316d54,!![]);}catch(_0xd04b9d){return BPromise[_0xf7d9('0x22')](_0xd04b9d);}return _0x165160['save']();};}function saveUpdates(_0x5e96df,_0x36b974){return function(_0x4cfe93){if(_0x4cfe93){return _0x4cfe93[_0xf7d9('0x23')](_0x5e96df)[_0xf7d9('0x24')](function(_0x574b12){return _0x574b12;});}return null;};}function removeEntity(_0x8d8e48,_0x27ba8c){return function(_0x514ffa){if(_0x514ffa){return _0x514ffa['destroy']()[_0xf7d9('0x24')](function(){_0x8d8e48[_0xf7d9('0x18')](0xcc)[_0xf7d9('0x19')]();});}};}function handleEntityNotFound(_0x595556,_0x3c0b91){return function(_0x496ab7){if(!_0x496ab7){_0x595556[_0xf7d9('0x17')](0x194);}return _0x496ab7;};}function handleError(_0x3b3ea5,_0x144ae2){_0x144ae2=_0x144ae2||0x1f4;return function(_0x5b1ea5){logger[_0xf7d9('0x25')](_0x5b1ea5[_0xf7d9('0x26')]);if(_0x5b1ea5[_0xf7d9('0x27')]){delete _0x5b1ea5[_0xf7d9('0x27')];}_0x3b3ea5[_0xf7d9('0x18')](_0x144ae2)['send'](_0x5b1ea5);};}exports[_0xf7d9('0x28')]=function(_0x3847ff,_0x2b5f17){var _0x2c04c3={'raw':!![],'where':{'id':_0x3847ff[_0xf7d9('0x29')]['id']}},_0x508b00={};_0x508b00[_0xf7d9('0x2a')]=_[_0xf7d9('0x2b')](db[_0xf7d9('0x2c')][_0xf7d9('0x2d')]);_0x508b00[_0xf7d9('0x2e')]=_['keys'](_0x3847ff['query']);_0x508b00['filters']=_[_0xf7d9('0x2f')](_0x508b00['model'],_0x508b00[_0xf7d9('0x2e')]);_0x2c04c3['attributes']=_[_0xf7d9('0x2f')](_0x508b00['model'],qs['fields'](_0x3847ff['query'][_0xf7d9('0x30')]));_0x2c04c3['attributes']=_0x2c04c3[_0xf7d9('0x31')][_0xf7d9('0x32')]?_0x2c04c3[_0xf7d9('0x31')]:_0x508b00[_0xf7d9('0x2a')];if(_0x3847ff[_0xf7d9('0x2e')][_0xf7d9('0x33')]){_0x2c04c3[_0xf7d9('0x34')]=[{'all':!![]}];}_0x2c04c3=_[_0xf7d9('0x35')]({},_0x2c04c3,_0x3847ff['options']);return db[_0xf7d9('0x2c')][_0xf7d9('0x36')](_0x2c04c3)['then'](handleEntityNotFound(_0x2b5f17,null))['then'](respondWithResult(_0x2b5f17,null))[_0xf7d9('0x37')](handleError(_0x2b5f17,null));};exports[_0xf7d9('0x38')]=function(_0x4110ce,_0x5301a8){return db[_0xf7d9('0x2c')][_0xf7d9('0x38')](_0x4110ce[_0xf7d9('0x39')],{})[_0xf7d9('0x24')](respondWithResult(_0x5301a8,0xc9))[_0xf7d9('0x37')](handleError(_0x5301a8,null));};exports[_0xf7d9('0x23')]=function(_0x427963,_0x1280fa){if(_0x427963[_0xf7d9('0x39')]['id']){delete _0x427963[_0xf7d9('0x39')]['id'];}return db[_0xf7d9('0x2c')]['find']({'where':{'id':_0x427963[_0xf7d9('0x29')]['id']}})['then'](handleEntityNotFound(_0x1280fa,null))[_0xf7d9('0x24')](saveUpdates(_0x427963[_0xf7d9('0x39')],null))[_0xf7d9('0x24')](respondWithResult(_0x1280fa,null))[_0xf7d9('0x37')](handleError(_0x1280fa,null));};exports['destroy']=function(_0x55b49d,_0x2173e2){return db['ChatProactiveAction'][_0xf7d9('0x36')]({'where':{'id':_0x55b49d[_0xf7d9('0x29')]['id']}})[_0xf7d9('0x24')](handleEntityNotFound(_0x2173e2,null))[_0xf7d9('0x24')](removeEntity(_0x2173e2,null))['catch'](handleError(_0x2173e2,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7c2ae62..8670164 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4421=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x44bee9,_0xd35c5b){var _0x4fea9b=function(_0xc363c0){while(--_0xc363c0){_0x44bee9['push'](_0x44bee9['shift']());}};_0x4fea9b(++_0xd35c5b);}(_0x4421,0x18d));var _0x1442=function(_0x55010f,_0x338587){_0x55010f=_0x55010f-0x0;var _0x3cf4a7=_0x4421[_0x55010f];return _0x3cf4a7;};'use strict';var _=require(_0x1442('0x0'));var util=require(_0x1442('0x1'));var logger=require(_0x1442('0x2'))('api');var moment=require(_0x1442('0x3'));var BPromise=require(_0x1442('0x4'));var rp=require(_0x1442('0x5'));var fs=require('fs');var path=require(_0x1442('0x6'));var rimraf=require(_0x1442('0x7'));var config=require(_0x1442('0x8'));var attributes=require(_0x1442('0x9'));module['exports']=function(_0x23dc35,_0x5d7f52){return _0x23dc35[_0x1442('0xa')](_0x1442('0xb'),attributes,{'tableName':_0x1442('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b0b=['request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird'];(function(_0x383c11,_0xb533b2){var _0x4ff44e=function(_0x49bbab){while(--_0x49bbab){_0x383c11['push'](_0x383c11['shift']());}};_0x4ff44e(++_0xb533b2);}(_0x6b0b,0x1c2));var _0xb6b0=function(_0x53c002,_0x23fce9){_0x53c002=_0x53c002-0x0;var _0x1e8b60=_0x6b0b[_0x53c002];return _0x1e8b60;};'use strict';var _=require(_0xb6b0('0x0'));var util=require(_0xb6b0('0x1'));var logger=require(_0xb6b0('0x2'))(_0xb6b0('0x3'));var moment=require('moment');var BPromise=require(_0xb6b0('0x4'));var rp=require(_0xb6b0('0x5'));var fs=require('fs');var path=require(_0xb6b0('0x6'));var rimraf=require(_0xb6b0('0x7'));var config=require('../../config/environment');var attributes=require(_0xb6b0('0x8'));module[_0xb6b0('0x9')]=function(_0x158782,_0xbf5ef8){return _0x158782[_0xb6b0('0xa')](_0xb6b0('0xb'),attributes,{'tableName':_0xb6b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 75ae577..91e242b 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8c58=['ioredis','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x515afd,_0x1a1e91){var _0x536d53=function(_0x1d3a89){while(--_0x1d3a89){_0x515afd['push'](_0x515afd['shift']());}};_0x536d53(++_0x1a1e91);}(_0x8c58,0x123));var _0x88c5=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x8c58[_0x16d10f];return _0x50c823;};'use strict';var _=require('lodash');var util=require(_0x88c5('0x0'));var moment=require('moment');var BPromise=require(_0x88c5('0x1'));var rs=require(_0x88c5('0x2'));var fs=require('fs');var Redis=require(_0x88c5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x88c5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x88c5('0x5'));var client=jayson[_0x88c5('0x6')][_0x88c5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x295e46,_0x27709b,_0x2d0dc6){return new BPromise(function(_0x27a696,_0x19f3f9){return client[_0x88c5('0x8')](_0x295e46,_0x2d0dc6)[_0x88c5('0x9')](function(_0x19dc51){logger[_0x88c5('0xa')](_0x88c5('0xb'),_0x27709b,_0x88c5('0xc'));logger[_0x88c5('0xd')](_0x88c5('0xe'),_0x27709b,_0x88c5('0xc'),JSON[_0x88c5('0xf')](_0x19dc51));if(_0x19dc51['error']){if(_0x19dc51[_0x88c5('0x10')][_0x88c5('0x11')]===0x1f4){logger[_0x88c5('0x10')](_0x88c5('0xb'),_0x27709b,_0x19dc51[_0x88c5('0x10')]['message']);return _0x19f3f9(_0x19dc51[_0x88c5('0x10')][_0x88c5('0x12')]);}logger['error'](_0x88c5('0xb'),_0x27709b,_0x19dc51['error'][_0x88c5('0x12')]);return _0x27a696(_0x19dc51['error'][_0x88c5('0x12')]);}else{logger[_0x88c5('0xa')](_0x88c5('0xb'),_0x27709b,_0x88c5('0xc'));_0x27a696(_0x19dc51[_0x88c5('0x13')]['message']);}})[_0x88c5('0x14')](function(_0xb51307){logger[_0x88c5('0x10')](_0x88c5('0xb'),_0x27709b,_0xb51307);_0x19f3f9(_0xb51307);});});}
\ No newline at end of file
+var _0x3d9c=['rpc','../../config/environment','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x43712d,_0x3f54b3){var _0x4b661f=function(_0x2ccd47){while(--_0x2ccd47){_0x43712d['push'](_0x43712d['shift']());}};_0x4b661f(++_0x3f54b3);}(_0x3d9c,0x134));var _0xc3d9=function(_0xce9c37,_0x1baa04){_0xce9c37=_0xce9c37-0x0;var _0x31be8e=_0x3d9c[_0xce9c37];return _0x31be8e;};'use strict';var _=require(_0xc3d9('0x0'));var util=require('util');var moment=require(_0xc3d9('0x1'));var BPromise=require(_0xc3d9('0x2'));var rs=require(_0xc3d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3d9('0x4'))['db'];var utils=require(_0xc3d9('0x5'));var logger=require(_0xc3d9('0x6'))(_0xc3d9('0x7'));var config=require(_0xc3d9('0x8'));var jayson=require(_0xc3d9('0x9'));var client=jayson[_0xc3d9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x375380,_0x46704e,_0x4ecff0){return new BPromise(function(_0x3c0a2f,_0x50bfe8){return client[_0xc3d9('0xb')](_0x375380,_0x4ecff0)[_0xc3d9('0xc')](function(_0x3f04bf){logger['info'](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));logger['debug'](_0xc3d9('0xf'),_0x46704e,_0xc3d9('0xe'),JSON[_0xc3d9('0x10')](_0x3f04bf));if(_0x3f04bf[_0xc3d9('0x11')]){if(_0x3f04bf['error'][_0xc3d9('0x12')]===0x1f4){logger['error'](_0xc3d9('0xd'),_0x46704e,_0x3f04bf[_0xc3d9('0x11')][_0xc3d9('0x13')]);return _0x50bfe8(_0x3f04bf['error'][_0xc3d9('0x13')]);}logger[_0xc3d9('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x46704e,_0x3f04bf['error'][_0xc3d9('0x13')]);return _0x3c0a2f(_0x3f04bf['error'][_0xc3d9('0x13')]);}else{logger[_0xc3d9('0x14')](_0xc3d9('0xd'),_0x46704e,_0xc3d9('0xe'));_0x3c0a2f(_0x3f04bf['result']['message']);}})['catch'](function(_0x143194){logger[_0xc3d9('0x11')](_0xc3d9('0xd'),_0x46704e,_0x143194);_0x50bfe8(_0x143194);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 0480830..fa8ca5f 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3eea=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','post','create','update','isAuthenticated','destroy','multer'];(function(_0x42347d,_0x2f37a1){var _0x24560a=function(_0x4dbb87){while(--_0x4dbb87){_0x42347d['push'](_0x42347d['shift']());}};_0x24560a(++_0x2f37a1);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4be2c3,_0x54181f){_0x4be2c3=_0x4be2c3-0x0;var _0x3b36b9=_0x3eea[_0x4be2c3];return _0x3b36b9;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')](_0xa3ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xa3ee('0xc')]('/',auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['put'](_0xa3ee('0xb'),auth['isAuthenticated'](),controller[_0xa3ee('0xe')]);router['delete'](_0xa3ee('0xb'),auth[_0xa3ee('0xf')](),controller[_0xa3ee('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x7da7=['util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','show','isAuthenticated','create','put','delete','exports','multer'];(function(_0x4f217f,_0x313163){var _0x3b583a=function(_0x334971){while(--_0x334971){_0x4f217f['push'](_0x4f217f['shift']());}};_0x3b583a(++_0x313163);}(_0x7da7,0x10d));var _0x77da=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0x7da7[_0x193ddf];return _0x5bc6df;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var fs_extra=require(_0x77da('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x77da('0x7')](_0x77da('0x8'),auth['isAuthenticated'](),controller[_0x77da('0x9')]);router['post']('/',auth[_0x77da('0xa')](),controller[_0x77da('0xb')]);router[_0x77da('0xc')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['update']);router[_0x77da('0xd')](_0x77da('0x8'),auth[_0x77da('0xa')](),controller['destroy']);module[_0x77da('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ddd7707..8adbd74 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe0be=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0xb0846c,_0x2e868b){var _0x318cc6=function(_0x35c8bc){while(--_0x35c8bc){_0xb0846c['push'](_0xb0846c['shift']());}};_0x318cc6(++_0x2e868b);}(_0xe0be,0x1b4));var _0xee0b=function(_0x39b93c,_0x54fc94){_0x39b93c=_0x39b93c-0x0;var _0x4be668=_0xe0be[_0x39b93c];return _0x4be668;};'use strict';var Sequelize=require(_0xee0b('0x0'));module[_0xee0b('0x1')]={'name':{'type':Sequelize[_0xee0b('0x2')],'unique':_0xee0b('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xee0b('0x2')]},'timeout':{'type':Sequelize[_0xee0b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xee0b('0x5')](_0xee0b('0x6'),_0xee0b('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0x64e5=['name','INTEGER','ENUM','beepall','roundrobin','STRING'];(function(_0x526d6c,_0x24546d){var _0x27938d=function(_0x2683f4){while(--_0x2683f4){_0x526d6c['push'](_0x526d6c['shift']());}};_0x27938d(++_0x24546d);}(_0x64e5,0x185));var _0x564e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x64e5[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x564e('0x0')],'unique':_0x564e('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x564e('0x0')]},'timeout':{'type':Sequelize[_0x564e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x564e('0x3')]('rrmemory',_0x564e('0x4'),_0x564e('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index be9a0cf..318dbde 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7b23=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./chatQueue.socket','register','jayson/promise','client','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','then','sendStatus','name','index','ChatQueue','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','keys','rawAttributes','length','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','params','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','Team','getTeams','addTeams','ids','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','value','isEmpty','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','../../components/auth/service'];(function(_0x56a977,_0x192273){var _0x22539e=function(_0x474132){while(--_0x474132){_0x56a977['push'](_0x56a977['shift']());}};_0x22539e(++_0x192273);}(_0x7b23,0x10b));var _0x37b2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b23[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x37b2('0x0'));var rimraf=require(_0x37b2('0x1'));var zipdir=require(_0x37b2('0x2'));var jsonpatch=require(_0x37b2('0x3'));var rp=require(_0x37b2('0x4'));var moment=require(_0x37b2('0x5'));var BPromise=require(_0x37b2('0x6'));var Mustache=require(_0x37b2('0x7'));var util=require(_0x37b2('0x8'));var path=require(_0x37b2('0x9'));var sox=require(_0x37b2('0xa'));var csv=require(_0x37b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37b2('0xc'));var squel=require(_0x37b2('0xd'));var crypto=require('crypto');var jsforce=require(_0x37b2('0xe'));var deskjs=require(_0x37b2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37b2('0x10'));var qs=require(_0x37b2('0x11'));var as=require(_0x37b2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x37b2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x37b2('0x14'));var db=require(_0x37b2('0x15'))['db'];config[_0x37b2('0x16')]=_[_0x37b2('0x17')](config[_0x37b2('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37b2('0x16')]));require(_0x37b2('0x18'))[_0x37b2('0x19')](socket);var jayson=require(_0x37b2('0x1a'));var client=jayson[_0x37b2('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41bac9,_0x16db94,_0x5e91a3,_0x37db1a){return new BPromise(function(_0xacc349,_0x18fd5a){var _0x174d25=_0x37db1a||client;return _0x174d25[_0x37b2('0x1c')](_0x41bac9,_0x5e91a3)['then'](function(_0x5a695e){logger[_0x37b2('0x1d')](_0x37b2('0x1e'),_0x16db94,_0x37b2('0x1f'));logger[_0x37b2('0x20')](_0x37b2('0x21'),_0x16db94,_0x37b2('0x1f'),JSON[_0x37b2('0x22')](_0x5a695e));if(_0x5a695e[_0x37b2('0x23')]){if(_0x5a695e[_0x37b2('0x23')]['code']===0x1f4){logger[_0x37b2('0x23')]('ChatQueue,\x20%s,\x20%s',_0x16db94,_0x5a695e['error'][_0x37b2('0x24')]);return _0x18fd5a(_0x5a695e[_0x37b2('0x23')][_0x37b2('0x24')]);}logger['error'](_0x37b2('0x1e'),_0x16db94,_0x5a695e['error'][_0x37b2('0x24')]);return _0xacc349(_0x5a695e[_0x37b2('0x23')][_0x37b2('0x24')]);}else{logger['info'](_0x37b2('0x1e'),_0x16db94,_0x37b2('0x1f'));_0xacc349(_0x5a695e[_0x37b2('0x25')][_0x37b2('0x24')]);}})[_0x37b2('0x26')](function(_0xfe9923){logger[_0x37b2('0x23')](_0x37b2('0x1e'),_0x16db94,_0xfe9923);_0x18fd5a(_0xfe9923);});});}function respondWithStatusCode(_0x5e70a4,_0x4eb24c){_0x4eb24c=_0x4eb24c||0xcc;return function(_0x3783c9){if(_0x3783c9){return _0x5e70a4['sendStatus'](_0x4eb24c);}return _0x5e70a4[_0x37b2('0x27')](_0x4eb24c)[_0x37b2('0x28')]();};}function respondWithResult(_0x258b57,_0x4b8889){_0x4b8889=_0x4b8889||0xc8;return function(_0x492c9e){if(_0x492c9e){return _0x258b57[_0x37b2('0x27')](_0x4b8889)['json'](_0x492c9e);}};}function respondWithFilteredResult(_0x3b7e73,_0x503206){return function(_0xb5800b){if(_0xb5800b){var _0x4e3f97=typeof _0x503206[_0x37b2('0x29')]===_0x37b2('0x2a')&&typeof _0x503206[_0x37b2('0x2b')]==='undefined';var _0x3296e2=_0xb5800b[_0x37b2('0x2c')];var _0xec7892=_0x4e3f97?0x0:_0x503206[_0x37b2('0x29')];var _0xc4b286=_0x4e3f97?_0xb5800b[_0x37b2('0x2c')]:_0x503206['offset']+_0x503206[_0x37b2('0x2b')];var _0x55c165;if(_0xc4b286>=_0x3296e2){_0xc4b286=_0x3296e2;_0x55c165=0xc8;}else{_0x55c165=0xce;}_0x3b7e73[_0x37b2('0x27')](_0x55c165);return _0x3b7e73[_0x37b2('0x2d')](_0x37b2('0x2e'),_0xec7892+'-'+_0xc4b286+'/'+_0x3296e2)['json'](_0xb5800b);}return null;};}function patchUpdates(_0x32fd3f){return function(_0x35b280){try{jsonpatch['apply'](_0x35b280,_0x32fd3f,!![]);}catch(_0x4b7b3d){return BPromise[_0x37b2('0x2f')](_0x4b7b3d);}return _0x35b280[_0x37b2('0x30')]();};}function saveUpdates(_0x31c1e0,_0x2916a4){return function(_0x5563fd){if(_0x5563fd){return _0x5563fd[_0x37b2('0x31')](_0x31c1e0)['then'](function(_0x4d0f0b){return _0x4d0f0b;});}return null;};}function removeEntity(_0x3912aa,_0x14fea1){return function(_0x3898ef){if(_0x3898ef){return _0x3898ef[_0x37b2('0x32')]()['then'](function(){var _0x15bd03=_0x3898ef[_0x37b2('0x33')]({'plain':!![]});var _0x2cfb97=_0x37b2('0x34');return db[_0x37b2('0x35')][_0x37b2('0x32')]({'where':{'type':_0x2cfb97,'resourceId':_0x15bd03['id']}})[_0x37b2('0x36')](function(){return _0x3898ef;});})[_0x37b2('0x36')](function(){_0x3912aa[_0x37b2('0x27')](0xcc)[_0x37b2('0x28')]();});}};}function handleEntityNotFound(_0x153d5c,_0x142612){return function(_0x5dc5d6){if(!_0x5dc5d6){_0x153d5c[_0x37b2('0x37')](0x194);}return _0x5dc5d6;};}function handleError(_0x10cd13,_0x4af2bf){_0x4af2bf=_0x4af2bf||0x1f4;return function(_0x4a2f45){logger[_0x37b2('0x23')](_0x4a2f45['stack']);if(_0x4a2f45[_0x37b2('0x38')]){delete _0x4a2f45[_0x37b2('0x38')];}_0x10cd13[_0x37b2('0x27')](_0x4af2bf)['send'](_0x4a2f45);};}exports[_0x37b2('0x39')]=function(_0x549403,_0x45fe3a){var _0xabf06f={},_0x5735ea={},_0x552523={'count':0x0,'rows':[]};var _0x3fbc91=_['map'](db[_0x37b2('0x3a')]['rawAttributes'],function(_0x7187f3){return{'name':_0x7187f3['fieldName'],'type':_0x7187f3[_0x37b2('0x3b')][_0x37b2('0x3c')]};});_0x5735ea[_0x37b2('0x3d')]=_[_0x37b2('0x3e')](_0x3fbc91,_0x37b2('0x38'));_0x5735ea[_0x37b2('0x3f')]=_['keys'](_0x549403[_0x37b2('0x3f')]);_0x5735ea[_0x37b2('0x40')]=_['intersection'](_0x5735ea[_0x37b2('0x3d')],_0x5735ea['query']);_0xabf06f[_0x37b2('0x41')]=_[_0x37b2('0x42')](_0x5735ea[_0x37b2('0x3d')],qs['fields'](_0x549403[_0x37b2('0x3f')][_0x37b2('0x43')]));_0xabf06f['attributes']=_0xabf06f[_0x37b2('0x41')]['length']?_0xabf06f[_0x37b2('0x41')]:_0x5735ea[_0x37b2('0x3d')];if(!_0x549403['query'][_0x37b2('0x44')](_0x37b2('0x45'))){_0xabf06f[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x549403['query'][_0x37b2('0x2b')]);_0xabf06f[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x549403['query'][_0x37b2('0x29')]);}_0xabf06f['order']=qs[_0x37b2('0x46')](_0x549403[_0x37b2('0x3f')][_0x37b2('0x46')]);_0xabf06f['where']=qs['filters'](_[_0x37b2('0x47')](_0x549403[_0x37b2('0x3f')],_0x5735ea[_0x37b2('0x40')]),_0x3fbc91);if(_0x549403[_0x37b2('0x3f')][_0x37b2('0x48')]){_0xabf06f['where']=_[_0x37b2('0x49')](_0xabf06f[_0x37b2('0x4a')],{'$or':_[_0x37b2('0x3e')](_0x3fbc91,function(_0xbd370a){if(_0xbd370a[_0x37b2('0x3b')]!==_0x37b2('0x4b')){var _0x3dc8b7={};_0x3dc8b7[_0xbd370a[_0x37b2('0x38')]]={'$like':'%'+_0x549403[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0x3dc8b7;}})});}_0xabf06f=_[_0x37b2('0x49')]({},_0xabf06f,_0x549403['options']);var _0x4a5b16={'where':_0xabf06f[_0x37b2('0x4a')]};return db[_0x37b2('0x3a')][_0x37b2('0x2c')](_0x4a5b16)['then'](function(_0xdcad8e){_0x552523[_0x37b2('0x2c')]=_0xdcad8e;if(_0x549403[_0x37b2('0x3f')][_0x37b2('0x4c')]){_0xabf06f[_0x37b2('0x4d')]=[{'all':!![]}];}return db[_0x37b2('0x3a')][_0x37b2('0x4e')](_0xabf06f);})[_0x37b2('0x36')](function(_0x1f3f65){_0x552523['rows']=_0x1f3f65;return _0x552523;})[_0x37b2('0x36')](respondWithFilteredResult(_0x45fe3a,_0xabf06f))['catch'](handleError(_0x45fe3a,null));};exports['show']=function(_0x4d623a,_0x1c911f){var _0x2b1dbe={'raw':!![],'where':{'id':_0x4d623a['params']['id']}},_0x2ce8e1={};_0x2ce8e1[_0x37b2('0x3d')]=_[_0x37b2('0x4f')](db[_0x37b2('0x3a')][_0x37b2('0x50')]);_0x2ce8e1[_0x37b2('0x3f')]=_[_0x37b2('0x4f')](_0x4d623a[_0x37b2('0x3f')]);_0x2ce8e1['filters']=_[_0x37b2('0x42')](_0x2ce8e1['model'],_0x2ce8e1[_0x37b2('0x3f')]);_0x2b1dbe['attributes']=_[_0x37b2('0x42')](_0x2ce8e1[_0x37b2('0x3d')],qs[_0x37b2('0x43')](_0x4d623a[_0x37b2('0x3f')][_0x37b2('0x43')]));_0x2b1dbe[_0x37b2('0x41')]=_0x2b1dbe[_0x37b2('0x41')][_0x37b2('0x51')]?_0x2b1dbe[_0x37b2('0x41')]:_0x2ce8e1[_0x37b2('0x3d')];if(_0x4d623a[_0x37b2('0x3f')]['includeAll']){_0x2b1dbe['include']=[{'all':!![]}];}_0x2b1dbe=_[_0x37b2('0x49')]({},_0x2b1dbe,_0x4d623a[_0x37b2('0x52')]);return db[_0x37b2('0x3a')]['find'](_0x2b1dbe)[_0x37b2('0x36')](handleEntityNotFound(_0x1c911f,null))[_0x37b2('0x36')](respondWithResult(_0x1c911f,null))[_0x37b2('0x26')](handleError(_0x1c911f,null));};exports['create']=function(_0x1f5cce,_0x45dccb){return db[_0x37b2('0x3a')]['create'](_0x1f5cce[_0x37b2('0x53')],{})[_0x37b2('0x36')](function(_0x687997){var _0x5a5386=_0x1f5cce[_0x37b2('0x54')]['get']({'plain':!![]});if(!_0x5a5386)throw new Error(_0x37b2('0x55'));if(_0x5a5386[_0x37b2('0x56')]===_0x37b2('0x54')){var _0x387a5c=_0x687997[_0x37b2('0x33')]({'plain':!![]});var _0x4e91ed='ChatQueues';return db['UserProfileSection'][_0x37b2('0x57')]({'where':{'name':_0x4e91ed,'userProfileId':_0x5a5386['userProfileId']},'raw':!![]})[_0x37b2('0x36')](function(_0x1c38d5){if(_0x1c38d5&&_0x1c38d5[_0x37b2('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x387a5c[_0x37b2('0x38')],'resourceId':_0x387a5c['id'],'type':_0x1c38d5[_0x37b2('0x38')],'sectionId':_0x1c38d5['id']},{})[_0x37b2('0x36')](function(){return _0x687997;});}else{return _0x687997;}})['catch'](function(_0x4680cf){logger[_0x37b2('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4680cf);throw _0x4680cf;});}return _0x687997;})[_0x37b2('0x36')](respondWithResult(_0x45dccb,0xc9))[_0x37b2('0x26')](handleError(_0x45dccb,null));};exports[_0x37b2('0x31')]=function(_0x5113b3,_0x3bfb4e){if(_0x5113b3['body']['id']){delete _0x5113b3[_0x37b2('0x53')]['id'];}return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x5113b3[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x3bfb4e,null))[_0x37b2('0x36')](saveUpdates(_0x5113b3['body'],null))[_0x37b2('0x36')](respondWithResult(_0x3bfb4e,null))['catch'](handleError(_0x3bfb4e,null));};exports[_0x37b2('0x32')]=function(_0x5abd3f,_0x33cf1c){return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x5abd3f[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x33cf1c,null))[_0x37b2('0x36')](removeEntity(_0x33cf1c,null))[_0x37b2('0x26')](handleError(_0x33cf1c,null));};exports[_0x37b2('0x5a')]=function(_0x47c5a7,_0x5bed4b){return db[_0x37b2('0x3a')][_0x37b2('0x5a')]()[_0x37b2('0x36')](respondWithResult(_0x5bed4b,null))['catch'](handleError(_0x5bed4b,null));};exports[_0x37b2('0x5b')]=function(_0x31a63c,_0x837233,_0x883698){var _0x57f87d={'raw':!![],'where':{}},_0x339279={},_0x5b45b3;return db[_0x37b2('0x3a')][_0x37b2('0x5c')]({'where':{'id':_0x31a63c[_0x37b2('0x59')]['id']}})['then'](handleEntityNotFound(_0x837233,null))[_0x37b2('0x36')](function(_0x2003ce){if(_0x2003ce){_0x5b45b3=_0x2003ce[_0x37b2('0x33')]({'plain':!![]});_0x339279[_0x37b2('0x3d')]=_[_0x37b2('0x4f')](db[_0x37b2('0x5d')][_0x37b2('0x50')]);_0x339279['query']=_[_0x37b2('0x4f')](_0x31a63c[_0x37b2('0x3f')]);_0x339279[_0x37b2('0x40')]=_['intersection'](_0x339279[_0x37b2('0x3d')],_0x339279[_0x37b2('0x3f')]);_0x57f87d['attributes']=_[_0x37b2('0x42')](_0x339279[_0x37b2('0x3d')],qs[_0x37b2('0x43')](_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x43')]));_0x57f87d[_0x37b2('0x41')]=_0x57f87d[_0x37b2('0x41')][_0x37b2('0x51')]?_0x57f87d[_0x37b2('0x41')]:_0x339279[_0x37b2('0x3d')];if(!_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x44')]('nolimit')){_0x57f87d[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x2b')]);_0x57f87d[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x29')]);}_0x57f87d[_0x37b2('0x5e')]=qs[_0x37b2('0x46')](_0x31a63c[_0x37b2('0x3f')]['sort']);_0x57f87d[_0x37b2('0x4a')]=qs[_0x37b2('0x40')](_[_0x37b2('0x47')](_0x31a63c[_0x37b2('0x3f')],_0x339279['filters']));_0x57f87d[_0x37b2('0x4a')][_0x37b2('0x5f')]=_0x2003ce['id'];if(_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x48')]){_0x57f87d[_0x37b2('0x4a')]=_[_0x37b2('0x49')](_0x57f87d[_0x37b2('0x4a')],{'$or':_['map'](_0x57f87d['attributes'],function(_0x134b96){var _0xb0db15={};_0xb0db15[_0x134b96]={'$like':'%'+_0x31a63c[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0xb0db15;})});}_0x57f87d=_[_0x37b2('0x49')]({},_0x57f87d,_0x31a63c['options']);return db[_0x37b2('0x5d')][_0x37b2('0x4e')](_0x57f87d);}})[_0x37b2('0x36')](function(_0x214aa7){if(_0x214aa7){return db[_0x37b2('0x60')]['findAndCountAll']({'where':{'id':_[_0x37b2('0x3e')](_0x214aa7,_0x37b2('0x61')),'role':_0x37b2('0x62')},'attributes':['id',_0x37b2('0x38'),_0x37b2('0x63'),_0x37b2('0x64'),_0x37b2('0x65')]});}})[_0x37b2('0x36')](function(_0x121afd){if(_0x121afd){return{'count':_0x121afd[_0x37b2('0x2c')],'rows':_[_0x37b2('0x3e')](_0x121afd[_0x37b2('0x66')],function(_0x581920){return{'membername':_0x581920[_0x37b2('0x38')],'UserId':_0x581920['id'],'queue_name':_0x5b45b3[_0x37b2('0x38')],'ChatQueueId':_0x5b45b3['id'],'interface':util[_0x37b2('0x67')](_0x37b2('0x68'),'SIP',_0x581920[_0x37b2('0x38')]),'penalty':0x0,'paused':_0x581920[_0x37b2('0x63')],'createdAt':_0x581920['createdAt'],'updatedAt':_0x581920[_0x37b2('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x837233,_0x57f87d))[_0x37b2('0x26')](handleError(_0x837233,null));};exports['getTeams']=function(_0x198496,_0x4b60b2,_0x20562a){var _0x30dcb0={};var _0x2fbdf1={};var _0x3be084;var _0x3798d4;return db[_0x37b2('0x3a')]['findOne']({'where':{'id':_0x198496[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x4b60b2,null))[_0x37b2('0x36')](function(_0x1d0c57){if(_0x1d0c57){_0x3be084=_0x1d0c57;_0x2fbdf1[_0x37b2('0x3d')]=_['keys'](db[_0x37b2('0x69')][_0x37b2('0x50')]);_0x2fbdf1[_0x37b2('0x3f')]=_[_0x37b2('0x4f')](_0x198496[_0x37b2('0x3f')]);_0x2fbdf1['filters']=_[_0x37b2('0x42')](_0x2fbdf1[_0x37b2('0x3d')],_0x2fbdf1[_0x37b2('0x3f')]);_0x30dcb0[_0x37b2('0x41')]=_[_0x37b2('0x42')](_0x2fbdf1[_0x37b2('0x3d')],qs['fields'](_0x198496[_0x37b2('0x3f')]['fields']));_0x30dcb0['attributes']=_0x30dcb0[_0x37b2('0x41')][_0x37b2('0x51')]?_0x30dcb0[_0x37b2('0x41')]:_0x2fbdf1[_0x37b2('0x3d')];_0x30dcb0['order']=qs[_0x37b2('0x46')](_0x198496[_0x37b2('0x3f')][_0x37b2('0x46')]);_0x30dcb0['where']=qs[_0x37b2('0x40')](_[_0x37b2('0x47')](_0x198496['query'],_0x2fbdf1[_0x37b2('0x40')]));if(_0x198496[_0x37b2('0x3f')][_0x37b2('0x48')]){_0x30dcb0[_0x37b2('0x4a')]=_[_0x37b2('0x49')](_0x30dcb0['where'],{'$or':_['map'](_0x30dcb0[_0x37b2('0x41')],function(_0x277978){var _0xc7aac3={};_0xc7aac3[_0x277978]={'$like':'%'+_0x198496[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0xc7aac3;})});}_0x30dcb0=_[_0x37b2('0x49')]({},_0x30dcb0,_0x198496['options']);return _0x3be084[_0x37b2('0x6a')](_0x30dcb0);}})[_0x37b2('0x36')](function(_0x58f17e){if(_0x58f17e){_0x3798d4=_0x58f17e[_0x37b2('0x51')];if(!_0x198496[_0x37b2('0x3f')][_0x37b2('0x44')]('nolimit')){_0x30dcb0[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x198496[_0x37b2('0x3f')][_0x37b2('0x2b')]);_0x30dcb0[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x198496[_0x37b2('0x3f')]['offset']);}return _0x3be084[_0x37b2('0x6a')](_0x30dcb0);}})['then'](function(_0x4abbbf){if(_0x4abbbf){return _0x4abbbf?{'count':_0x3798d4,'rows':_0x4abbbf}:null;}})[_0x37b2('0x36')](respondWithResult(_0x4b60b2,null))[_0x37b2('0x26')](handleError(_0x4b60b2,null));};exports[_0x37b2('0x6b')]=function(_0x2d6482,_0x1bbb2e,_0x4919a9){var _0x5159e1=_0x2d6482[_0x37b2('0x53')][_0x37b2('0x6c')];return db[_0x37b2('0x69')][_0x37b2('0x4e')]({'where':{'id':_0x5159e1},'attributes':['id'],'include':[{'model':db[_0x37b2('0x60')],'as':_0x37b2('0x6d'),'attributes':['id',_0x37b2('0x38'),'online',_0x37b2('0x6e'),_0x37b2('0x6f')],'raw':!![]}]})[_0x37b2('0x36')](function(_0x37501b){if(_0x37501b){var _0x1e1e49=_['flatMap'](_0x37501b,function(_0x1d923b){var _0xd64a66=_0x1d923b[_0x37b2('0x33')]({'plain':!![]});return _0xd64a66[_0x37b2('0x6d')];});return db['ChatQueue'][_0x37b2('0x57')]({'where':{'id':_0x2d6482[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](function(_0x266f15){return db[_0x37b2('0x70')][_0x37b2('0x71')](function(_0x35be63){return _0x266f15[_0x37b2('0x6b')](_0x5159e1,{'transaction':_0x35be63})[_0x37b2('0x36')](function(){return BPromise[_0x37b2('0x72')](_0x1e1e49,function(_0x3fdf26){return db[_0x37b2('0x5d')][_0x37b2('0x73')]({'where':{'UserId':_0x3fdf26['id'],'ChatQueueId':_0x2d6482[_0x37b2('0x59')]['id']},'transaction':_0x35be63});});})['then'](function(){_0x1e1e49[_0x37b2('0x74')](function(_0x2cf0b2){socket[_0x37b2('0x75')](_0x37b2('0x76'),{'UserId':_0x2cf0b2['id'],'ChatQueueId':_0x266f15['id']});});});});});}})[_0x37b2('0x36')](respondWithStatusCode(_0x1bbb2e,null))['catch'](handleError(_0x1bbb2e,null));};exports[_0x37b2('0x77')]=function(_0x50329,_0x5dfa92,_0x3a443e){return db[_0x37b2('0x69')]['findAll']({'where':{'id':_0x50329[_0x37b2('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x37b2('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x37b2('0x36')](handleEntityNotFound(_0x5dfa92,null))[_0x37b2('0x36')](function(_0x1a28f3){var _0x416707=_['map'](_0x1a28f3,'id');var _0x3fdb8c=[];var _0x4204ad=[];var _0x5d70f5=squel[_0x37b2('0x78')]();_0x5d70f5['field']('tq.TeamId')[_0x37b2('0x79')]('team_has_chat_queues','tq')[_0x37b2('0x7a')]('user_has_teams','ut',_0x37b2('0x7b'))[_0x37b2('0x4a')](_0x37b2('0x7c'),_0x50329['params']['id']);for(var _0x21c145=0x0;_0x21c145<_0x1a28f3[_0x37b2('0x51')];_0x21c145+=0x1){let _0x5c073a=_0x1a28f3[_0x21c145];for(var _0x1be723=0x0;_0x1be723<_0x5c073a[_0x37b2('0x6d')][_0x37b2('0x51')];_0x1be723+=0x1){let _0x2d00d9=_0x5c073a['Agents'][_0x1be723];var _0x2bd589=_0x5d70f5['clone']();_0x2bd589[_0x37b2('0x4a')](_0x37b2('0x7d'),_0x2d00d9['id']);_0x4204ad[_0x37b2('0x7e')](db[_0x37b2('0x70')][_0x37b2('0x3f')](_0x2bd589[_0x37b2('0x7f')](),{'type':db[_0x37b2('0x70')][_0x37b2('0x80')][_0x37b2('0x81')]})[_0x37b2('0x36')](function(_0x578402){if(_0x578402['length']===0x1){return _0x2d00d9['id'];}else{var _0x1ea508=_[_0x37b2('0x82')](_[_0x37b2('0x3e')](_0x578402,_0x37b2('0x83')),function(_0x4068d8){return _['includes'](_0x416707,_0x4068d8);});if(_0x1ea508){return _0x2d00d9['id'];}}}));}}return BPromise['all'](_0x4204ad)[_0x37b2('0x36')](function(_0x1540cd){_0x3fdb8c=_(_0x3fdb8c)[_0x37b2('0x84')](_0x1540cd)['compact']()[_0x37b2('0x85')]();return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x50329[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](function(_0x514d89){return db[_0x37b2('0x70')]['transaction'](function(_0x3f8664){return _0x514d89[_0x37b2('0x77')](_0x50329[_0x37b2('0x3f')][_0x37b2('0x6c')],{'transaction':_0x3f8664})[_0x37b2('0x36')](function(){if(!_[_0x37b2('0x86')](_0x3fdb8c)){return _0x514d89['removeAgents'](_0x3fdb8c,{'transaction':_0x3f8664});}})[_0x37b2('0x36')](function(){_0x3fdb8c[_0x37b2('0x74')](function(_0x5d7825){socket[_0x37b2('0x75')](_0x37b2('0x87'),{'UserId':_0x5d7825,'ChatQueueId':_0x514d89['id']});});});});});});})[_0x37b2('0x36')](respondWithStatusCode(_0x5dfa92,null))['catch'](handleError(_0x5dfa92,null));};exports[_0x37b2('0x88')]=function(_0x19ea51,_0x404c52,_0x125bb8){return db['ChatQueue'][_0x37b2('0x57')]({'where':{'id':_0x19ea51[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x404c52,null))[_0x37b2('0x36')](function(_0x52a891){if(_0x52a891){return _0x52a891['addAgents'](_0x19ea51[_0x37b2('0x53')][_0x37b2('0x6c')],_[_0x37b2('0x89')](_0x19ea51[_0x37b2('0x53')],[_0x37b2('0x6c'),'id'])||{})[_0x37b2('0x8a')](function(_0x21714f){for(var _0x52b9db=0x0;_0x52b9db<_0x19ea51['body']['ids'][_0x37b2('0x51')];_0x52b9db+=0x1){socket[_0x37b2('0x75')](_0x37b2('0x76'),{'UserId':Number(_0x19ea51['body'][_0x37b2('0x6c')][_0x52b9db]),'ChatQueueId':Number(_0x19ea51[_0x37b2('0x59')]['id'])});}return _0x21714f;});}})[_0x37b2('0x36')](respondWithResult(_0x404c52,null))['catch'](handleError(_0x404c52,null));};exports[_0x37b2('0x8b')]=function(_0x2f8393,_0x12d91a,_0x43b187){return db[_0x37b2('0x3a')][_0x37b2('0x57')]({'where':{'id':_0x2f8393['params']['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x12d91a,null))[_0x37b2('0x36')](function(_0x118c6c){if(_0x118c6c){return _0x118c6c['removeAgents'](_0x2f8393[_0x37b2('0x3f')]['ids'])[_0x37b2('0x36')](function(){if(_[_0x37b2('0x8c')](_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')])){for(var _0x10e08f=0x0;_0x10e08f<_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')][_0x37b2('0x51')];_0x10e08f+=0x1){socket[_0x37b2('0x75')](_0x37b2('0x87'),{'UserId':Number(_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')][_0x10e08f]),'ChatQueueId':Number(_0x2f8393['params']['id'])});}}else{socket[_0x37b2('0x75')](_0x37b2('0x87'),{'UserId':Number(_0x2f8393[_0x37b2('0x3f')][_0x37b2('0x6c')]),'ChatQueueId':Number(_0x2f8393[_0x37b2('0x59')]['id'])});}});}})[_0x37b2('0x36')](respondWithStatusCode(_0x12d91a,null))['catch'](handleError(_0x12d91a,null));};exports['getAgents']=function(_0x353a7e,_0x2b3094,_0x5e8ab4){var _0x159b00={};var _0x3d27ed={};var _0x134890;var _0x3f4ef2;return db[_0x37b2('0x3a')][_0x37b2('0x5c')]({'where':{'id':_0x353a7e[_0x37b2('0x59')]['id']}})[_0x37b2('0x36')](handleEntityNotFound(_0x2b3094,null))[_0x37b2('0x36')](function(_0x22118d){if(_0x22118d){_0x134890=_0x22118d;_0x3d27ed[_0x37b2('0x3d')]=_[_0x37b2('0x4f')](db[_0x37b2('0x60')][_0x37b2('0x50')]);_0x3d27ed[_0x37b2('0x3f')]=_['keys'](_0x353a7e['query']);_0x3d27ed[_0x37b2('0x40')]=_[_0x37b2('0x42')](_0x3d27ed['model'],_0x3d27ed[_0x37b2('0x3f')]);_0x159b00[_0x37b2('0x41')]=_['intersection'](_0x3d27ed[_0x37b2('0x3d')],qs['fields'](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x43')]));_0x159b00[_0x37b2('0x41')]=_0x159b00[_0x37b2('0x41')][_0x37b2('0x51')]?_0x159b00['attributes']:_0x3d27ed['model'];_0x159b00['order']=qs['sort'](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x46')]);_0x159b00[_0x37b2('0x4a')]=qs[_0x37b2('0x40')](_['pick'](_0x353a7e['query'],_0x3d27ed[_0x37b2('0x40')]));if(_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x48')]){_0x159b00[_0x37b2('0x4a')]=_[_0x37b2('0x49')](_0x159b00[_0x37b2('0x4a')],{'$or':_[_0x37b2('0x3e')](_0x159b00[_0x37b2('0x41')],function(_0x30f780){var _0x30795d={};_0x30795d[_0x30f780]={'$like':'%'+_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x48')]+'%'};return _0x30795d;})});}_0x159b00=_[_0x37b2('0x49')]({},_0x159b00,_0x353a7e['options']);return _0x134890['getAgents'](_0x159b00);}})['then'](function(_0x14e3a1){if(_0x14e3a1){_0x3f4ef2=_0x14e3a1[_0x37b2('0x51')];if(!_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x44')](_0x37b2('0x45'))){_0x159b00[_0x37b2('0x2b')]=qs[_0x37b2('0x2b')](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x2b')]);_0x159b00[_0x37b2('0x29')]=qs[_0x37b2('0x29')](_0x353a7e[_0x37b2('0x3f')][_0x37b2('0x29')]);}return _0x134890[_0x37b2('0x8d')](_0x159b00);}})[_0x37b2('0x36')](function(_0x2d9471){if(_0x2d9471){return _0x2d9471?{'count':_0x3f4ef2,'rows':_0x2d9471}:null;}})['then'](respondWithResult(_0x2b3094,null))[_0x37b2('0x26')](handleError(_0x2b3094,null));};
\ No newline at end of file
+var _0xdb4c=['ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','each','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','sequelize','toString','every','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./chatQueue.socket','register','jayson/promise','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','include','ChatQueue','rows','show','params','includeAll','catch','create','body','user','UserProfileSection','userProfileId','autoAssociation','find','describe','getMembers','findOne','UserChatQueue','sort'];(function(_0x3ee361,_0x244c67){var _0x32a3d0=function(_0x238363){while(--_0x238363){_0x3ee361['push'](_0x3ee361['shift']());}};_0x32a3d0(++_0x244c67);}(_0xdb4c,0x15d));var _0xcdb4=function(_0x2d32f2,_0x267096){_0x2d32f2=_0x2d32f2-0x0;var _0xfb7da7=_0xdb4c[_0x2d32f2];return _0xfb7da7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdb4('0x0'));var zipdir=require(_0xcdb4('0x1'));var jsonpatch=require(_0xcdb4('0x2'));var rp=require('request-promise');var moment=require(_0xcdb4('0x3'));var BPromise=require(_0xcdb4('0x4'));var Mustache=require(_0xcdb4('0x5'));var util=require(_0xcdb4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xcdb4('0x7'));var ejs=require(_0xcdb4('0x8'));var fs=require('fs');var fs_extra=require(_0xcdb4('0x9'));var _=require(_0xcdb4('0xa'));var squel=require(_0xcdb4('0xb'));var crypto=require(_0xcdb4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xcdb4('0xd'));var toCsv=require(_0xcdb4('0x7'));var querystring=require(_0xcdb4('0xe'));var Papa=require(_0xcdb4('0xf'));var Redis=require(_0xcdb4('0x10'));var authService=require(_0xcdb4('0x11'));var qs=require(_0xcdb4('0x12'));var as=require(_0xcdb4('0x13'));var hardwareService=require(_0xcdb4('0x14'));var logger=require(_0xcdb4('0x15'))(_0xcdb4('0x16'));var utils=require(_0xcdb4('0x17'));var config=require(_0xcdb4('0x18'));var licenseUtil=require(_0xcdb4('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcdb4('0x1a')](config[_0xcdb4('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcdb4('0x1b')]));require(_0xcdb4('0x1c'))[_0xcdb4('0x1d')](socket);var jayson=require(_0xcdb4('0x1e'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1734ff,_0x73edd3,_0x23cf16,_0x3e2b4d){return new BPromise(function(_0x6e2cf0,_0x4fd574){var _0x42cb56=_0x3e2b4d||client;return _0x42cb56[_0xcdb4('0x1f')](_0x1734ff,_0x23cf16)[_0xcdb4('0x20')](function(_0xca805a){logger[_0xcdb4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,'request\x20sent');logger[_0xcdb4('0x22')](_0xcdb4('0x23'),_0x73edd3,_0xcdb4('0x24'),JSON[_0xcdb4('0x25')](_0xca805a));if(_0xca805a[_0xcdb4('0x26')]){if(_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x27')]===0x1f4){logger[_0xcdb4('0x26')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,_0xca805a['error']['message']);return _0x4fd574(_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x28')]);}logger[_0xcdb4('0x26')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x28')]);return _0x6e2cf0(_0xca805a[_0xcdb4('0x26')][_0xcdb4('0x28')]);}else{logger[_0xcdb4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x73edd3,'request\x20sent');_0x6e2cf0(_0xca805a[_0xcdb4('0x29')][_0xcdb4('0x28')]);}})['catch'](function(_0x522576){logger['error']('ChatQueue,\x20%s,\x20%s',_0x73edd3,_0x522576);_0x4fd574(_0x522576);});});}function respondWithStatusCode(_0x2cc561,_0x413bb4){_0x413bb4=_0x413bb4||0xcc;return function(_0x1c1dc6){if(_0x1c1dc6){return _0x2cc561[_0xcdb4('0x2a')](_0x413bb4);}return _0x2cc561[_0xcdb4('0x2b')](_0x413bb4)[_0xcdb4('0x2c')]();};}function respondWithResult(_0x25f11a,_0xa35c60){_0xa35c60=_0xa35c60||0xc8;return function(_0x4a8290){if(_0x4a8290){return _0x25f11a[_0xcdb4('0x2b')](_0xa35c60)[_0xcdb4('0x2d')](_0x4a8290);}};}function respondWithFilteredResult(_0x108bc6,_0x4023dd){return function(_0x433466){if(_0x433466){var _0x4c5e48=typeof _0x4023dd[_0xcdb4('0x2e')]===_0xcdb4('0x2f')&&typeof _0x4023dd['limit']==='undefined';var _0x476019=_0x433466[_0xcdb4('0x30')];var _0x40fd40=_0x4c5e48?0x0:_0x4023dd[_0xcdb4('0x2e')];var _0x1addb1=_0x4c5e48?_0x433466[_0xcdb4('0x30')]:_0x4023dd[_0xcdb4('0x2e')]+_0x4023dd['limit'];var _0x40ff05;if(_0x1addb1>=_0x476019){_0x1addb1=_0x476019;_0x40ff05=0xc8;}else{_0x40ff05=0xce;}_0x108bc6[_0xcdb4('0x2b')](_0x40ff05);return _0x108bc6[_0xcdb4('0x31')](_0xcdb4('0x32'),_0x40fd40+'-'+_0x1addb1+'/'+_0x476019)[_0xcdb4('0x2d')](_0x433466);}return null;};}function patchUpdates(_0x268eea){return function(_0x5e1bc4){try{jsonpatch[_0xcdb4('0x33')](_0x5e1bc4,_0x268eea,!![]);}catch(_0x237772){return BPromise['reject'](_0x237772);}return _0x5e1bc4[_0xcdb4('0x34')]();};}function saveUpdates(_0x34d817,_0x1730d0){return function(_0x417d43){if(_0x417d43){return _0x417d43[_0xcdb4('0x35')](_0x34d817)['then'](function(_0xdc82f8){return _0xdc82f8;});}return null;};}function removeEntity(_0x1b112c,_0x4f51fd){return function(_0xbc2940){if(_0xbc2940){return _0xbc2940[_0xcdb4('0x36')]()['then'](function(){var _0x4e2f27=_0xbc2940[_0xcdb4('0x37')]({'plain':!![]});var _0x3eeb00=_0xcdb4('0x38');return db[_0xcdb4('0x39')][_0xcdb4('0x36')]({'where':{'type':_0x3eeb00,'resourceId':_0x4e2f27['id']}})['then'](function(){return _0xbc2940;});})[_0xcdb4('0x20')](function(){_0x1b112c[_0xcdb4('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a947f,_0x355613){return function(_0x53aa81){if(!_0x53aa81){_0x2a947f[_0xcdb4('0x2a')](0x194);}return _0x53aa81;};}function handleError(_0xa2fa74,_0xc8915a){_0xc8915a=_0xc8915a||0x1f4;return function(_0x46d82f){logger[_0xcdb4('0x26')](_0x46d82f[_0xcdb4('0x3a')]);if(_0x46d82f[_0xcdb4('0x3b')]){delete _0x46d82f[_0xcdb4('0x3b')];}_0xa2fa74[_0xcdb4('0x2b')](_0xc8915a)[_0xcdb4('0x3c')](_0x46d82f);};}exports[_0xcdb4('0x3d')]=function(_0xea3b6a,_0x8f0890){var _0x2a68f4={},_0x3e454d={},_0x50e267={'count':0x0,'rows':[]};var _0xb2fb8b=_[_0xcdb4('0x3e')](db['ChatQueue'][_0xcdb4('0x3f')],function(_0x2a053c){return{'name':_0x2a053c[_0xcdb4('0x40')],'type':_0x2a053c[_0xcdb4('0x41')][_0xcdb4('0x42')]};});_0x3e454d[_0xcdb4('0x43')]=_['map'](_0xb2fb8b,_0xcdb4('0x3b'));_0x3e454d[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0xea3b6a[_0xcdb4('0x44')]);_0x3e454d[_0xcdb4('0x46')]=_[_0xcdb4('0x47')](_0x3e454d['model'],_0x3e454d[_0xcdb4('0x44')]);_0x2a68f4[_0xcdb4('0x48')]=_[_0xcdb4('0x47')](_0x3e454d[_0xcdb4('0x43')],qs['fields'](_0xea3b6a['query'][_0xcdb4('0x49')]));_0x2a68f4[_0xcdb4('0x48')]=_0x2a68f4[_0xcdb4('0x48')][_0xcdb4('0x4a')]?_0x2a68f4[_0xcdb4('0x48')]:_0x3e454d[_0xcdb4('0x43')];if(!_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x4b')](_0xcdb4('0x4c'))){_0x2a68f4[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4d')](_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x4d')]);_0x2a68f4[_0xcdb4('0x2e')]=qs[_0xcdb4('0x2e')](_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x2e')]);}_0x2a68f4[_0xcdb4('0x4e')]=qs['sort'](_0xea3b6a[_0xcdb4('0x44')]['sort']);_0x2a68f4[_0xcdb4('0x4f')]=qs[_0xcdb4('0x46')](_[_0xcdb4('0x50')](_0xea3b6a[_0xcdb4('0x44')],_0x3e454d['filters']),_0xb2fb8b);if(_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x51')]){_0x2a68f4['where']=_[_0xcdb4('0x52')](_0x2a68f4[_0xcdb4('0x4f')],{'$or':_[_0xcdb4('0x3e')](_0xb2fb8b,function(_0x263ae3){if(_0x263ae3[_0xcdb4('0x41')]!==_0xcdb4('0x53')){var _0x3e3ae6={};_0x3e3ae6[_0x263ae3[_0xcdb4('0x3b')]]={'$like':'%'+_0xea3b6a[_0xcdb4('0x44')][_0xcdb4('0x51')]+'%'};return _0x3e3ae6;}})});}_0x2a68f4=_[_0xcdb4('0x52')]({},_0x2a68f4,_0xea3b6a[_0xcdb4('0x54')]);var _0x38eb51={'where':_0x2a68f4[_0xcdb4('0x4f')]};return db['ChatQueue'][_0xcdb4('0x30')](_0x38eb51)[_0xcdb4('0x20')](function(_0x3af190){_0x50e267[_0xcdb4('0x30')]=_0x3af190;if(_0xea3b6a['query']['includeAll']){_0x2a68f4[_0xcdb4('0x55')]=[{'all':!![]}];}return db[_0xcdb4('0x56')]['findAll'](_0x2a68f4);})['then'](function(_0xa65250){_0x50e267[_0xcdb4('0x57')]=_0xa65250;return _0x50e267;})['then'](respondWithFilteredResult(_0x8f0890,_0x2a68f4))['catch'](handleError(_0x8f0890,null));};exports[_0xcdb4('0x58')]=function(_0x2f1220,_0x14710b){var _0x2c29f={'raw':!![],'where':{'id':_0x2f1220[_0xcdb4('0x59')]['id']}},_0x2f0737={};_0x2f0737[_0xcdb4('0x43')]=_[_0xcdb4('0x45')](db['ChatQueue'][_0xcdb4('0x3f')]);_0x2f0737[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x2f1220[_0xcdb4('0x44')]);_0x2f0737[_0xcdb4('0x46')]=_[_0xcdb4('0x47')](_0x2f0737['model'],_0x2f0737['query']);_0x2c29f[_0xcdb4('0x48')]=_['intersection'](_0x2f0737[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x2f1220[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x2c29f[_0xcdb4('0x48')]=_0x2c29f[_0xcdb4('0x48')][_0xcdb4('0x4a')]?_0x2c29f[_0xcdb4('0x48')]:_0x2f0737['model'];if(_0x2f1220['query'][_0xcdb4('0x5a')]){_0x2c29f[_0xcdb4('0x55')]=[{'all':!![]}];}_0x2c29f=_[_0xcdb4('0x52')]({},_0x2c29f,_0x2f1220[_0xcdb4('0x54')]);return db[_0xcdb4('0x56')]['find'](_0x2c29f)['then'](handleEntityNotFound(_0x14710b,null))[_0xcdb4('0x20')](respondWithResult(_0x14710b,null))[_0xcdb4('0x5b')](handleError(_0x14710b,null));};exports[_0xcdb4('0x5c')]=function(_0x269d32,_0x4a835){return db[_0xcdb4('0x56')][_0xcdb4('0x5c')](_0x269d32[_0xcdb4('0x5d')],{})[_0xcdb4('0x20')](function(_0xc2dc34){var _0x414f39=_0x269d32[_0xcdb4('0x5e')][_0xcdb4('0x37')]({'plain':!![]});if(!_0x414f39)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414f39['role']===_0xcdb4('0x5e')){var _0x7addd3=_0xc2dc34[_0xcdb4('0x37')]({'plain':!![]});var _0x1bc0d7=_0xcdb4('0x38');return db[_0xcdb4('0x5f')]['find']({'where':{'name':_0x1bc0d7,'userProfileId':_0x414f39[_0xcdb4('0x60')]},'raw':!![]})['then'](function(_0x41d2e8){if(_0x41d2e8&&_0x41d2e8[_0xcdb4('0x61')]===0x0){return db[_0xcdb4('0x39')]['create']({'name':_0x7addd3['name'],'resourceId':_0x7addd3['id'],'type':_0x41d2e8[_0xcdb4('0x3b')],'sectionId':_0x41d2e8['id']},{})[_0xcdb4('0x20')](function(){return _0xc2dc34;});}else{return _0xc2dc34;}})[_0xcdb4('0x5b')](function(_0x4b6ab2){logger[_0xcdb4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b6ab2);throw _0x4b6ab2;});}return _0xc2dc34;})[_0xcdb4('0x20')](respondWithResult(_0x4a835,0xc9))[_0xcdb4('0x5b')](handleError(_0x4a835,null));};exports[_0xcdb4('0x35')]=function(_0x4c3ac2,_0x2ec81d){if(_0x4c3ac2[_0xcdb4('0x5d')]['id']){delete _0x4c3ac2['body']['id'];}return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x4c3ac2[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x2ec81d,null))[_0xcdb4('0x20')](saveUpdates(_0x4c3ac2[_0xcdb4('0x5d')],null))['then'](respondWithResult(_0x2ec81d,null))[_0xcdb4('0x5b')](handleError(_0x2ec81d,null));};exports[_0xcdb4('0x36')]=function(_0x2c190f,_0x4413bc){return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x2c190f[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x4413bc,null))[_0xcdb4('0x20')](removeEntity(_0x4413bc,null))['catch'](handleError(_0x4413bc,null));};exports[_0xcdb4('0x63')]=function(_0x3104f8,_0x40ebfc){return db[_0xcdb4('0x56')][_0xcdb4('0x63')]()[_0xcdb4('0x20')](respondWithResult(_0x40ebfc,null))[_0xcdb4('0x5b')](handleError(_0x40ebfc,null));};exports[_0xcdb4('0x64')]=function(_0x27d772,_0x58f6ac,_0x4262f4){var _0x2d2bb5={'raw':!![],'where':{}},_0x5573f4={},_0x328ec9;return db[_0xcdb4('0x56')][_0xcdb4('0x65')]({'where':{'id':_0x27d772[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x58f6ac,null))[_0xcdb4('0x20')](function(_0x37b007){if(_0x37b007){_0x328ec9=_0x37b007['get']({'plain':!![]});_0x5573f4[_0xcdb4('0x43')]=_['keys'](db[_0xcdb4('0x66')][_0xcdb4('0x3f')]);_0x5573f4[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x27d772[_0xcdb4('0x44')]);_0x5573f4['filters']=_[_0xcdb4('0x47')](_0x5573f4[_0xcdb4('0x43')],_0x5573f4[_0xcdb4('0x44')]);_0x2d2bb5[_0xcdb4('0x48')]=_[_0xcdb4('0x47')](_0x5573f4[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x2d2bb5[_0xcdb4('0x48')]=_0x2d2bb5['attributes'][_0xcdb4('0x4a')]?_0x2d2bb5[_0xcdb4('0x48')]:_0x5573f4[_0xcdb4('0x43')];if(!_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x4b')]('nolimit')){_0x2d2bb5[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4d')](_0x27d772['query'][_0xcdb4('0x4d')]);_0x2d2bb5['offset']=qs['offset'](_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x2e')]);}_0x2d2bb5[_0xcdb4('0x4e')]=qs[_0xcdb4('0x67')](_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x67')]);_0x2d2bb5[_0xcdb4('0x4f')]=qs[_0xcdb4('0x46')](_[_0xcdb4('0x50')](_0x27d772['query'],_0x5573f4[_0xcdb4('0x46')]));_0x2d2bb5[_0xcdb4('0x4f')][_0xcdb4('0x68')]=_0x37b007['id'];if(_0x27d772[_0xcdb4('0x44')][_0xcdb4('0x51')]){_0x2d2bb5[_0xcdb4('0x4f')]=_[_0xcdb4('0x52')](_0x2d2bb5[_0xcdb4('0x4f')],{'$or':_[_0xcdb4('0x3e')](_0x2d2bb5[_0xcdb4('0x48')],function(_0x46fbcb){var _0x2b1ce3={};_0x2b1ce3[_0x46fbcb]={'$like':'%'+_0x27d772['query']['filter']+'%'};return _0x2b1ce3;})});}_0x2d2bb5=_['merge']({},_0x2d2bb5,_0x27d772[_0xcdb4('0x54')]);return db[_0xcdb4('0x66')][_0xcdb4('0x69')](_0x2d2bb5);}})[_0xcdb4('0x20')](function(_0x55287e){if(_0x55287e){return db[_0xcdb4('0x6a')][_0xcdb4('0x6b')]({'where':{'id':_[_0xcdb4('0x3e')](_0x55287e,_0xcdb4('0x6c')),'role':_0xcdb4('0x6d')},'attributes':['id','name',_0xcdb4('0x6e'),_0xcdb4('0x6f'),_0xcdb4('0x70')]});}})[_0xcdb4('0x20')](function(_0x22f49b){if(_0x22f49b){return{'count':_0x22f49b[_0xcdb4('0x30')],'rows':_[_0xcdb4('0x3e')](_0x22f49b['rows'],function(_0x2c3e8b){return{'membername':_0x2c3e8b[_0xcdb4('0x3b')],'UserId':_0x2c3e8b['id'],'queue_name':_0x328ec9[_0xcdb4('0x3b')],'ChatQueueId':_0x328ec9['id'],'interface':util[_0xcdb4('0x71')](_0xcdb4('0x72'),_0xcdb4('0x73'),_0x2c3e8b[_0xcdb4('0x3b')]),'penalty':0x0,'paused':_0x2c3e8b[_0xcdb4('0x6e')],'createdAt':_0x2c3e8b[_0xcdb4('0x70')],'updatedAt':_0x2c3e8b[_0xcdb4('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcdb4('0x20')](respondWithFilteredResult(_0x58f6ac,_0x2d2bb5))[_0xcdb4('0x5b')](handleError(_0x58f6ac,null));};exports[_0xcdb4('0x74')]=function(_0x329a07,_0x202204,_0xb99ccd){var _0x98a008={};var _0x39523b={};var _0x3044ad;var _0xea0fd0;return db[_0xcdb4('0x56')][_0xcdb4('0x65')]({'where':{'id':_0x329a07['params']['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x202204,null))['then'](function(_0x35afe7){if(_0x35afe7){_0x3044ad=_0x35afe7;_0x39523b[_0xcdb4('0x43')]=_[_0xcdb4('0x45')](db[_0xcdb4('0x75')][_0xcdb4('0x3f')]);_0x39523b[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x329a07['query']);_0x39523b[_0xcdb4('0x46')]=_[_0xcdb4('0x47')](_0x39523b[_0xcdb4('0x43')],_0x39523b[_0xcdb4('0x44')]);_0x98a008['attributes']=_[_0xcdb4('0x47')](_0x39523b[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x98a008[_0xcdb4('0x48')]=_0x98a008[_0xcdb4('0x48')]['length']?_0x98a008['attributes']:_0x39523b[_0xcdb4('0x43')];_0x98a008[_0xcdb4('0x4e')]=qs[_0xcdb4('0x67')](_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x67')]);_0x98a008['where']=qs[_0xcdb4('0x46')](_[_0xcdb4('0x50')](_0x329a07[_0xcdb4('0x44')],_0x39523b['filters']));if(_0x329a07[_0xcdb4('0x44')]['filter']){_0x98a008[_0xcdb4('0x4f')]=_[_0xcdb4('0x52')](_0x98a008[_0xcdb4('0x4f')],{'$or':_['map'](_0x98a008[_0xcdb4('0x48')],function(_0x38e5e0){var _0xf1aa83={};_0xf1aa83[_0x38e5e0]={'$like':'%'+_0x329a07[_0xcdb4('0x44')]['filter']+'%'};return _0xf1aa83;})});}_0x98a008=_[_0xcdb4('0x52')]({},_0x98a008,_0x329a07[_0xcdb4('0x54')]);return _0x3044ad[_0xcdb4('0x74')](_0x98a008);}})[_0xcdb4('0x20')](function(_0x12c869){if(_0x12c869){_0xea0fd0=_0x12c869[_0xcdb4('0x4a')];if(!_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x4b')](_0xcdb4('0x4c'))){_0x98a008[_0xcdb4('0x4d')]=qs[_0xcdb4('0x4d')](_0x329a07[_0xcdb4('0x44')]['limit']);_0x98a008[_0xcdb4('0x2e')]=qs[_0xcdb4('0x2e')](_0x329a07[_0xcdb4('0x44')][_0xcdb4('0x2e')]);}return _0x3044ad[_0xcdb4('0x74')](_0x98a008);}})[_0xcdb4('0x20')](function(_0x5e1681){if(_0x5e1681){return _0x5e1681?{'count':_0xea0fd0,'rows':_0x5e1681}:null;}})[_0xcdb4('0x20')](respondWithResult(_0x202204,null))[_0xcdb4('0x5b')](handleError(_0x202204,null));};exports[_0xcdb4('0x76')]=function(_0xf96867,_0x5eee36,_0x460d15){var _0x3a45e6=_0xf96867['body'][_0xcdb4('0x77')];return db['Team'][_0xcdb4('0x69')]({'where':{'id':_0x3a45e6},'attributes':['id'],'include':[{'model':db[_0xcdb4('0x6a')],'as':_0xcdb4('0x78'),'attributes':['id','name','online',_0xcdb4('0x79'),_0xcdb4('0x7a')],'raw':!![]}]})[_0xcdb4('0x20')](function(_0x5e8581){if(_0x5e8581){var _0x3da204=_[_0xcdb4('0x7b')](_0x5e8581,function(_0x181730){var _0x519027=_0x181730[_0xcdb4('0x37')]({'plain':!![]});return _0x519027[_0xcdb4('0x78')];});return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0xf96867['params']['id']}})[_0xcdb4('0x20')](function(_0x13004e){return db['sequelize']['transaction'](function(_0x27b80a){return _0x13004e[_0xcdb4('0x76')](_0x3a45e6,{'transaction':_0x27b80a})[_0xcdb4('0x20')](function(){return BPromise[_0xcdb4('0x7c')](_0x3da204,function(_0x170f6b){return db[_0xcdb4('0x66')]['findOrCreate']({'where':{'UserId':_0x170f6b['id'],'ChatQueueId':_0xf96867['params']['id']},'transaction':_0x27b80a});});})[_0xcdb4('0x20')](function(){_0x3da204[_0xcdb4('0x7d')](function(_0x588f01){socket[_0xcdb4('0x7e')](_0xcdb4('0x7f'),{'UserId':_0x588f01['id'],'ChatQueueId':_0x13004e['id']});});});});});}})['then'](respondWithStatusCode(_0x5eee36,null))[_0xcdb4('0x5b')](handleError(_0x5eee36,null));};exports[_0xcdb4('0x80')]=function(_0x3b21f6,_0x483494,_0x335b65){return db[_0xcdb4('0x75')][_0xcdb4('0x69')]({'where':{'id':_0x3b21f6[_0xcdb4('0x44')][_0xcdb4('0x77')]},'attributes':['id'],'include':[{'model':db[_0xcdb4('0x6a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xcdb4('0x20')](handleEntityNotFound(_0x483494,null))['then'](function(_0x3359d3){var _0x32526d=_[_0xcdb4('0x3e')](_0x3359d3,'id');var _0x29f109=[];var _0x828c2f=[];var _0xc74918=squel['select']();_0xc74918[_0xcdb4('0x81')](_0xcdb4('0x82'))[_0xcdb4('0x83')](_0xcdb4('0x84'),'tq')[_0xcdb4('0x85')](_0xcdb4('0x86'),'ut',_0xcdb4('0x87'))[_0xcdb4('0x4f')](_0xcdb4('0x88'),_0x3b21f6[_0xcdb4('0x59')]['id']);for(var _0x33bd67=0x0;_0x33bd67<_0x3359d3[_0xcdb4('0x4a')];_0x33bd67+=0x1){let _0x470142=_0x3359d3[_0x33bd67];for(var _0x1b63fe=0x0;_0x1b63fe<_0x470142[_0xcdb4('0x78')]['length'];_0x1b63fe+=0x1){let _0x23ea1b=_0x470142['Agents'][_0x1b63fe];var _0x43fe66=_0xc74918[_0xcdb4('0x89')]();_0x43fe66[_0xcdb4('0x4f')]('ut.UserId\x20=\x20?',_0x23ea1b['id']);_0x828c2f['push'](db[_0xcdb4('0x8a')][_0xcdb4('0x44')](_0x43fe66[_0xcdb4('0x8b')](),{'type':db[_0xcdb4('0x8a')]['QueryTypes']['SELECT']})['then'](function(_0x9eb06c){if(_0x9eb06c['length']===0x1){return _0x23ea1b['id'];}else{var _0x52739e=_[_0xcdb4('0x8c')](_[_0xcdb4('0x3e')](_0x9eb06c,'TeamId'),function(_0x5e6898){return _['includes'](_0x32526d,_0x5e6898);});if(_0x52739e){return _0x23ea1b['id'];}}}));}}return BPromise[_0xcdb4('0x8d')](_0x828c2f)['then'](function(_0x4b4794){_0x29f109=_(_0x29f109)[_0xcdb4('0x8e')](_0x4b4794)['compact']()[_0xcdb4('0x8f')]();return db['ChatQueue'][_0xcdb4('0x62')]({'where':{'id':_0x3b21f6[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](function(_0x146a82){return db[_0xcdb4('0x8a')]['transaction'](function(_0x3a2ce4){return _0x146a82['removeTeams'](_0x3b21f6['query'][_0xcdb4('0x77')],{'transaction':_0x3a2ce4})[_0xcdb4('0x20')](function(){if(!_[_0xcdb4('0x90')](_0x29f109)){return _0x146a82[_0xcdb4('0x91')](_0x29f109,{'transaction':_0x3a2ce4});}})[_0xcdb4('0x20')](function(){_0x29f109[_0xcdb4('0x7d')](function(_0x2887d4){socket['emit'](_0xcdb4('0x92'),{'UserId':_0x2887d4,'ChatQueueId':_0x146a82['id']});});});});});});})[_0xcdb4('0x20')](respondWithStatusCode(_0x483494,null))[_0xcdb4('0x5b')](handleError(_0x483494,null));};exports[_0xcdb4('0x93')]=function(_0x32482c,_0x376044,_0x507d8b){return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x32482c[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x376044,null))['then'](function(_0x2670cc){if(_0x2670cc){return _0x2670cc[_0xcdb4('0x93')](_0x32482c[_0xcdb4('0x5d')]['ids'],_['omit'](_0x32482c[_0xcdb4('0x5d')],[_0xcdb4('0x77'),'id'])||{})[_0xcdb4('0x94')](function(_0x2e2ec9){for(var _0x1c4f73=0x0;_0x1c4f73<_0x32482c[_0xcdb4('0x5d')]['ids'][_0xcdb4('0x4a')];_0x1c4f73+=0x1){socket[_0xcdb4('0x7e')]('userChatQueue:save',{'UserId':Number(_0x32482c[_0xcdb4('0x5d')][_0xcdb4('0x77')][_0x1c4f73]),'ChatQueueId':Number(_0x32482c['params']['id'])});}return _0x2e2ec9;});}})[_0xcdb4('0x20')](respondWithResult(_0x376044,null))['catch'](handleError(_0x376044,null));};exports['removeAgents']=function(_0x1c73f9,_0x6961c6,_0x1aa3e1){return db[_0xcdb4('0x56')][_0xcdb4('0x62')]({'where':{'id':_0x1c73f9[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x6961c6,null))[_0xcdb4('0x20')](function(_0x4b1e22){if(_0x4b1e22){return _0x4b1e22[_0xcdb4('0x91')](_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')])[_0xcdb4('0x20')](function(){if(_[_0xcdb4('0x95')](_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')])){for(var _0x44957e=0x0;_0x44957e<_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')][_0xcdb4('0x4a')];_0x44957e+=0x1){socket[_0xcdb4('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x1c73f9[_0xcdb4('0x44')]['ids'][_0x44957e]),'ChatQueueId':Number(_0x1c73f9[_0xcdb4('0x59')]['id'])});}}else{socket[_0xcdb4('0x7e')]('userChatQueue:remove',{'UserId':Number(_0x1c73f9[_0xcdb4('0x44')][_0xcdb4('0x77')]),'ChatQueueId':Number(_0x1c73f9[_0xcdb4('0x59')]['id'])});}});}})[_0xcdb4('0x20')](respondWithStatusCode(_0x6961c6,null))[_0xcdb4('0x5b')](handleError(_0x6961c6,null));};exports[_0xcdb4('0x96')]=function(_0x1b330a,_0x4a9a98,_0x38641a){var _0x2b3e16={};var _0xbd351b={};var _0x46e271;var _0x3e0132;return db[_0xcdb4('0x56')][_0xcdb4('0x65')]({'where':{'id':_0x1b330a[_0xcdb4('0x59')]['id']}})[_0xcdb4('0x20')](handleEntityNotFound(_0x4a9a98,null))['then'](function(_0x3f2b18){if(_0x3f2b18){_0x46e271=_0x3f2b18;_0xbd351b[_0xcdb4('0x43')]=_[_0xcdb4('0x45')](db[_0xcdb4('0x6a')][_0xcdb4('0x3f')]);_0xbd351b[_0xcdb4('0x44')]=_[_0xcdb4('0x45')](_0x1b330a[_0xcdb4('0x44')]);_0xbd351b['filters']=_[_0xcdb4('0x47')](_0xbd351b[_0xcdb4('0x43')],_0xbd351b[_0xcdb4('0x44')]);_0x2b3e16[_0xcdb4('0x48')]=_[_0xcdb4('0x47')](_0xbd351b[_0xcdb4('0x43')],qs[_0xcdb4('0x49')](_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x49')]));_0x2b3e16[_0xcdb4('0x48')]=_0x2b3e16['attributes'][_0xcdb4('0x4a')]?_0x2b3e16[_0xcdb4('0x48')]:_0xbd351b[_0xcdb4('0x43')];_0x2b3e16[_0xcdb4('0x4e')]=qs[_0xcdb4('0x67')](_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x67')]);_0x2b3e16['where']=qs[_0xcdb4('0x46')](_['pick'](_0x1b330a['query'],_0xbd351b[_0xcdb4('0x46')]));if(_0x1b330a[_0xcdb4('0x44')]['filter']){_0x2b3e16['where']=_[_0xcdb4('0x52')](_0x2b3e16['where'],{'$or':_[_0xcdb4('0x3e')](_0x2b3e16[_0xcdb4('0x48')],function(_0x4d446d){var _0x90f4e3={};_0x90f4e3[_0x4d446d]={'$like':'%'+_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x51')]+'%'};return _0x90f4e3;})});}_0x2b3e16=_['merge']({},_0x2b3e16,_0x1b330a[_0xcdb4('0x54')]);return _0x46e271['getAgents'](_0x2b3e16);}})[_0xcdb4('0x20')](function(_0xa85dde){if(_0xa85dde){_0x3e0132=_0xa85dde[_0xcdb4('0x4a')];if(!_0x1b330a[_0xcdb4('0x44')][_0xcdb4('0x4b')]('nolimit')){_0x2b3e16['limit']=qs[_0xcdb4('0x4d')](_0x1b330a['query']['limit']);_0x2b3e16[_0xcdb4('0x2e')]=qs[_0xcdb4('0x2e')](_0x1b330a['query'][_0xcdb4('0x2e')]);}return _0x46e271['getAgents'](_0x2b3e16);}})[_0xcdb4('0x20')](function(_0x259348){if(_0x259348){return _0x259348?{'count':_0x3e0132,'rows':_0x259348}:null;}})[_0xcdb4('0x20')](respondWithResult(_0x4a9a98,null))['catch'](handleError(_0x4a9a98,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 905bc63..ba2b28b 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf464=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','emit'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0xf464,0x161));var _0x4f46=function(_0x36e41b,_0x320627){_0x36e41b=_0x36e41b-0x0;var _0x40e228=_0xf464[_0x36e41b];return _0x40e228;};'use strict';var EventEmitter=require(_0x4f46('0x0'));var ChatQueue=require(_0x4f46('0x1'))['db'][_0x4f46('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4f46('0x3')](0x0);var events={'afterCreate':_0x4f46('0x4'),'afterUpdate':_0x4f46('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3535e6){return function(_0x44de5a,_0x33853e,_0x4230dc){ChatQueueEvents[_0x4f46('0x6')](_0x3535e6+':'+_0x44de5a['id'],_0x44de5a);ChatQueueEvents[_0x4f46('0x6')](_0x3535e6,_0x44de5a);_0x4230dc(null);};}for(var e in events){if(events[_0x4f46('0x7')](e)){var event=events[e];ChatQueue[_0x4f46('0x8')](e,emitEvent(event));}}module[_0x4f46('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x6d37=['exports','events','../../mysqldb','ChatQueue','save','update','emit','hasOwnProperty','hook'];(function(_0xebc64a,_0x440ee2){var _0x5131e1=function(_0x2d3720){while(--_0x2d3720){_0xebc64a['push'](_0xebc64a['shift']());}};_0x5131e1(++_0x440ee2);}(_0x6d37,0x88));var _0x76d3=function(_0x4b7b82,_0x1320db){_0x4b7b82=_0x4b7b82-0x0;var _0x3e9a63=_0x6d37[_0x4b7b82];return _0x3e9a63;};'use strict';var EventEmitter=require(_0x76d3('0x0'));var ChatQueue=require(_0x76d3('0x1'))['db'][_0x76d3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x76d3('0x3'),'afterUpdate':_0x76d3('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe78bc7){return function(_0x77d567,_0x1694eb,_0x43d29b){ChatQueueEvents[_0x76d3('0x5')](_0xe78bc7+':'+_0x77d567['id'],_0x77d567);ChatQueueEvents[_0x76d3('0x5')](_0xe78bc7,_0x77d567);_0x43d29b(null);};}for(var e in events){if(events[_0x76d3('0x6')](e)){var event=events[e];ChatQueue[_0x76d3('0x7')](e,emitEvent(event));}}module[_0x76d3('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 23b04f7..8c1d7da 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb2e1=['./chatQueue.attributes','exports','define','ChatQueue','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x5c2a64,_0x4d73d1){var _0x97eb2c=function(_0x191d14){while(--_0x191d14){_0x5c2a64['push'](_0x5c2a64['shift']());}};_0x97eb2c(++_0x4d73d1);}(_0xb2e1,0x70));var _0x1b2e=function(_0x25a4a1,_0x516862){_0x25a4a1=_0x25a4a1-0x0;var _0x3cac71=_0xb2e1[_0x25a4a1];return _0x3cac71;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1b2e('0x0'))(_0x1b2e('0x1'));var moment=require('moment');var BPromise=require(_0x1b2e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b2e('0x3'));var config=require(_0x1b2e('0x4'));var attributes=require(_0x1b2e('0x5'));module[_0x1b2e('0x6')]=function(_0x5cca0c,_0xf5ef12){return _0x5cca0c[_0x1b2e('0x7')](_0x1b2e('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d50=['./chatQueue.attributes','exports','define','ChatQueue','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2df833,_0x5a8075){var _0x504939=function(_0x5030b5){while(--_0x5030b5){_0x2df833['push'](_0x2df833['shift']());}};_0x504939(++_0x5a8075);}(_0x5d50,0x117));var _0x05d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x05d5('0x0'));var logger=require(_0x05d5('0x1'))('api');var moment=require(_0x05d5('0x2'));var BPromise=require(_0x05d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05d5('0x4'));var rimraf=require(_0x05d5('0x5'));var config=require(_0x05d5('0x6'));var attributes=require(_0x05d5('0x7'));module[_0x05d5('0x8')]=function(_0x3c64ee,_0x39837f){return _0x3c64ee[_0x05d5('0x9')](_0x05d5('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index b3031f1..315c8b3 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9f95=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','register','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','findAll','options','where','limit','map','include','model','attributes','GetChatQueue','ShowChatQueue','raw','lodash'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x9f95,0x97));var _0x59f9=function(_0x3f2b05,_0x53adad){_0x3f2b05=_0x3f2b05-0x0;var _0x3061a9=_0x9f95[_0x3f2b05];return _0x3061a9;};'use strict';var _=require(_0x59f9('0x0'));var util=require('util');var moment=require(_0x59f9('0x1'));var BPromise=require(_0x59f9('0x2'));var rs=require(_0x59f9('0x3'));var fs=require('fs');var Redis=require(_0x59f9('0x4'));var db=require(_0x59f9('0x5'))['db'];var utils=require(_0x59f9('0x6'));var logger=require(_0x59f9('0x7'))('rpc');var config=require(_0x59f9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x59f9('0x9')]['http']({'port':0x232a});config['redis']=_[_0x59f9('0xa')](config[_0x59f9('0xb')],{'host':_0x59f9('0xc'),'port':0x18eb});var socket=require(_0x59f9('0xd'))(new Redis(config[_0x59f9('0xb')]));require('./chatQueue.socket')[_0x59f9('0xe')](socket);function respondWithRpcPromise(_0x5289dd,_0x3376f5,_0x527bdf){return new BPromise(function(_0x41b875,_0x42dee0){return client['request'](_0x5289dd,_0x527bdf)[_0x59f9('0xf')](function(_0x3ce834){logger[_0x59f9('0x10')]('ChatQueue,\x20%s,\x20%s',_0x3376f5,_0x59f9('0x11'));logger[_0x59f9('0x12')](_0x59f9('0x13'),_0x3376f5,_0x59f9('0x11'),JSON[_0x59f9('0x14')](_0x3ce834));if(_0x3ce834['error']){if(_0x3ce834[_0x59f9('0x15')][_0x59f9('0x16')]===0x1f4){logger['error'](_0x59f9('0x17'),_0x3376f5,_0x3ce834['error'][_0x59f9('0x18')]);return _0x42dee0(_0x3ce834['error'][_0x59f9('0x18')]);}logger[_0x59f9('0x15')]('ChatQueue,\x20%s,\x20%s',_0x3376f5,_0x3ce834[_0x59f9('0x15')][_0x59f9('0x18')]);return _0x41b875(_0x3ce834[_0x59f9('0x15')][_0x59f9('0x18')]);}else{logger[_0x59f9('0x10')](_0x59f9('0x17'),_0x3376f5,_0x59f9('0x11'));_0x41b875(_0x3ce834[_0x59f9('0x19')]['message']);}})[_0x59f9('0x1a')](function(_0x2d9eec){logger[_0x59f9('0x15')](_0x59f9('0x17'),_0x3376f5,_0x2d9eec);_0x42dee0(_0x2d9eec);});});}exports['GetChatQueue']=function(_0x2ba943){var _0x53aecb=this;return new Promise(function(_0x5c2c85,_0x510159){return db['ChatQueue'][_0x59f9('0x1b')]({'raw':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ba943['options']?_0x2ba943['options'][_0x59f9('0x1d')]||null:null,'attributes':_0x2ba943['options']?_0x2ba943[_0x59f9('0x1c')]['attributes']||null:null,'limit':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')][_0x59f9('0x1e')]||null:null,'include':_0x2ba943[_0x59f9('0x1c')]?_0x2ba943[_0x59f9('0x1c')]['include']?_[_0x59f9('0x1f')](_0x2ba943[_0x59f9('0x1c')][_0x59f9('0x20')],function(_0x5bd4f1){return{'model':db[_0x5bd4f1[_0x59f9('0x21')]],'as':_0x5bd4f1['as'],'attributes':_0x5bd4f1[_0x59f9('0x22')],'include':_0x5bd4f1['include']?_[_0x59f9('0x1f')](_0x5bd4f1[_0x59f9('0x20')],function(_0xb099e9){return{'model':db[_0xb099e9[_0x59f9('0x21')]],'as':_0xb099e9['as'],'attributes':_0xb099e9[_0x59f9('0x22')],'include':_0xb099e9[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0xb099e9[_0x59f9('0x20')],function(_0x459624){return{'model':db[_0x459624['model']],'as':_0x459624['as'],'attributes':_0x459624[_0x59f9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x545e8e){logger['info'](_0x59f9('0x23'),_0x2ba943);logger[_0x59f9('0x12')](_0x59f9('0x23'),_0x2ba943,JSON[_0x59f9('0x14')](_0x545e8e));_0x5c2c85(_0x545e8e);})[_0x59f9('0x1a')](function(_0x5e7f10){logger[_0x59f9('0x15')](_0x59f9('0x23'),_0x5e7f10['message'],_0x2ba943);_0x510159(_0x53aecb[_0x59f9('0x15')](0x1f4,_0x5e7f10['message']));});});};exports[_0x59f9('0x24')]=function(_0x2bad87){var _0x2f935a=this;return new Promise(function(_0x87577b,_0x133d9a){return db['ChatQueue']['find']({'raw':_0x2bad87['options']?_0x2bad87['options'][_0x59f9('0x25')]===undefined?!![]:![]:!![],'where':_0x2bad87['options']?_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x1d')]||null:null,'attributes':_0x2bad87[_0x59f9('0x1c')]?_0x2bad87['options'][_0x59f9('0x22')]||null:null,'include':_0x2bad87['options']?_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x2bad87[_0x59f9('0x1c')][_0x59f9('0x20')],function(_0x54e19f){return{'model':db[_0x54e19f[_0x59f9('0x21')]],'as':_0x54e19f['as'],'attributes':_0x54e19f[_0x59f9('0x22')],'include':_0x54e19f[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x54e19f[_0x59f9('0x20')],function(_0x1a8376){return{'model':db[_0x1a8376['model']],'as':_0x1a8376['as'],'attributes':_0x1a8376[_0x59f9('0x22')],'include':_0x1a8376[_0x59f9('0x20')]?_[_0x59f9('0x1f')](_0x1a8376[_0x59f9('0x20')],function(_0x1f42ba){return{'model':db[_0x1f42ba[_0x59f9('0x21')]],'as':_0x1f42ba['as'],'attributes':_0x1f42ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x59f9('0xf')](function(_0x232275){logger[_0x59f9('0x10')](_0x59f9('0x24'),_0x2bad87);logger[_0x59f9('0x12')]('ShowChatQueue',_0x2bad87,JSON[_0x59f9('0x14')](_0x232275));_0x87577b(_0x232275);})['catch'](function(_0x4c7e8e){logger[_0x59f9('0x15')]('ShowChatQueue',_0x4c7e8e['message'],_0x2bad87);_0x133d9a(_0x2f935a[_0x59f9('0x15')](0x1f4,_0x4c7e8e[_0x59f9('0x18')]));});});};
\ No newline at end of file
+var _0x4201=['../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','stringify','ShowChatQueue','ChatQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x530cb0,_0x337937){var _0x39e18c=function(_0x265b81){while(--_0x265b81){_0x530cb0['push'](_0x530cb0['shift']());}};_0x39e18c(++_0x337937);}(_0x4201,0x71));var _0x1420=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x4201[_0xe09d0];return _0x44ad05;};'use strict';var _=require(_0x1420('0x0'));var util=require(_0x1420('0x1'));var moment=require('moment');var BPromise=require(_0x1420('0x2'));var rs=require(_0x1420('0x3'));var fs=require('fs');var Redis=require(_0x1420('0x4'));var db=require(_0x1420('0x5'))['db'];var utils=require(_0x1420('0x6'));var logger=require(_0x1420('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1420('0x8'));var client=jayson[_0x1420('0x9')][_0x1420('0xa')]({'port':0x232a});config[_0x1420('0xb')]=_[_0x1420('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1420('0xd'))(new Redis(config[_0x1420('0xb')]));require('./chatQueue.socket')[_0x1420('0xe')](socket);function respondWithRpcPromise(_0x53199d,_0x4d8d95,_0xc73d13){return new BPromise(function(_0x1b360f,_0x5cf903){return client[_0x1420('0xf')](_0x53199d,_0xc73d13)[_0x1420('0x10')](function(_0x1b76fc){logger[_0x1420('0x11')](_0x1420('0x12'),_0x4d8d95,_0x1420('0x13'));logger[_0x1420('0x14')](_0x1420('0x15'),_0x4d8d95,'request\x20sent',JSON['stringify'](_0x1b76fc));if(_0x1b76fc['error']){if(_0x1b76fc['error'][_0x1420('0x16')]===0x1f4){logger[_0x1420('0x17')](_0x1420('0x12'),_0x4d8d95,_0x1b76fc[_0x1420('0x17')][_0x1420('0x18')]);return _0x5cf903(_0x1b76fc[_0x1420('0x17')]['message']);}logger['error'](_0x1420('0x12'),_0x4d8d95,_0x1b76fc['error']['message']);return _0x1b360f(_0x1b76fc[_0x1420('0x17')][_0x1420('0x18')]);}else{logger[_0x1420('0x11')](_0x1420('0x12'),_0x4d8d95,'request\x20sent');_0x1b360f(_0x1b76fc[_0x1420('0x19')][_0x1420('0x18')]);}})[_0x1420('0x1a')](function(_0x4fa1f7){logger[_0x1420('0x17')](_0x1420('0x12'),_0x4d8d95,_0x4fa1f7);_0x5cf903(_0x4fa1f7);});});}exports[_0x1420('0x1b')]=function(_0x310454){var _0x4f3c6b=this;return new Promise(function(_0x5535c0,_0x410abb){return db['ChatQueue'][_0x1420('0x1c')]({'raw':_0x310454[_0x1420('0x1d')]?_0x310454[_0x1420('0x1d')][_0x1420('0x1e')]===undefined?!![]:![]:!![],'where':_0x310454[_0x1420('0x1d')]?_0x310454['options'][_0x1420('0x1f')]||null:null,'attributes':_0x310454[_0x1420('0x1d')]?_0x310454[_0x1420('0x1d')][_0x1420('0x20')]||null:null,'limit':_0x310454[_0x1420('0x1d')]?_0x310454[_0x1420('0x1d')]['limit']||null:null,'include':_0x310454['options']?_0x310454['options'][_0x1420('0x21')]?_[_0x1420('0x22')](_0x310454[_0x1420('0x1d')][_0x1420('0x21')],function(_0x32710e){return{'model':db[_0x32710e['model']],'as':_0x32710e['as'],'attributes':_0x32710e['attributes'],'include':_0x32710e[_0x1420('0x21')]?_[_0x1420('0x22')](_0x32710e[_0x1420('0x21')],function(_0x18666a){return{'model':db[_0x18666a[_0x1420('0x23')]],'as':_0x18666a['as'],'attributes':_0x18666a[_0x1420('0x20')],'include':_0x18666a['include']?_[_0x1420('0x22')](_0x18666a[_0x1420('0x21')],function(_0x36ff7c){return{'model':db[_0x36ff7c[_0x1420('0x23')]],'as':_0x36ff7c['as'],'attributes':_0x36ff7c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1420('0x10')](function(_0x2a25fd){logger[_0x1420('0x11')](_0x1420('0x1b'),_0x310454);logger['debug'](_0x1420('0x1b'),_0x310454,JSON[_0x1420('0x24')](_0x2a25fd));_0x5535c0(_0x2a25fd);})[_0x1420('0x1a')](function(_0x42a317){logger[_0x1420('0x17')](_0x1420('0x1b'),_0x42a317[_0x1420('0x18')],_0x310454);_0x410abb(_0x4f3c6b[_0x1420('0x17')](0x1f4,_0x42a317[_0x1420('0x18')]));});});};exports[_0x1420('0x25')]=function(_0x367f08){var _0x3754ba=this;return new Promise(function(_0x5f0d8f,_0xf3b37a){return db[_0x1420('0x26')][_0x1420('0x27')]({'raw':_0x367f08[_0x1420('0x1d')]?_0x367f08[_0x1420('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x367f08[_0x1420('0x1d')]?_0x367f08[_0x1420('0x1d')]['where']||null:null,'attributes':_0x367f08[_0x1420('0x1d')]?_0x367f08['options']['attributes']||null:null,'include':_0x367f08['options']?_0x367f08[_0x1420('0x1d')][_0x1420('0x21')]?_[_0x1420('0x22')](_0x367f08[_0x1420('0x1d')][_0x1420('0x21')],function(_0x89a6da){return{'model':db[_0x89a6da['model']],'as':_0x89a6da['as'],'attributes':_0x89a6da[_0x1420('0x20')],'include':_0x89a6da[_0x1420('0x21')]?_['map'](_0x89a6da[_0x1420('0x21')],function(_0x93bf5f){return{'model':db[_0x93bf5f[_0x1420('0x23')]],'as':_0x93bf5f['as'],'attributes':_0x93bf5f[_0x1420('0x20')],'include':_0x93bf5f[_0x1420('0x21')]?_[_0x1420('0x22')](_0x93bf5f[_0x1420('0x21')],function(_0x3e64f2){return{'model':db[_0x3e64f2['model']],'as':_0x3e64f2['as'],'attributes':_0x3e64f2[_0x1420('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1420('0x10')](function(_0x3cddad){logger[_0x1420('0x11')](_0x1420('0x25'),_0x367f08);logger['debug'](_0x1420('0x25'),_0x367f08,JSON[_0x1420('0x24')](_0x3cddad));_0x5f0d8f(_0x3cddad);})[_0x1420('0x1a')](function(_0x38eb26){logger['error'](_0x1420('0x25'),_0x38eb26[_0x1420('0x18')],_0x367f08);_0xf3b37a(_0x3754ba[_0x1420('0x17')](0x1f4,_0x38eb26[_0x1420('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ca0ee06..b948cb6 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6aa7=['update','emit','length','chatQueue:','./chatQueue.events','remove'];(function(_0xbb146,_0x1b3260){var _0x5094d0=function(_0x3bd1c0){while(--_0x3bd1c0){_0xbb146['push'](_0xbb146['shift']());}};_0x5094d0(++_0x1b3260);}(_0x6aa7,0x178));var _0x76aa=function(_0x11f568,_0x27e975){_0x11f568=_0x11f568-0x0;var _0x11a019=_0x6aa7[_0x11f568];return _0x11a019;};'use strict';var ChatQueueEvents=require(_0x76aa('0x0'));var events=['save',_0x76aa('0x1'),_0x76aa('0x2')];function createListener(_0x25c818,_0x2db4fe){return function(_0x4f007e){_0x2db4fe[_0x76aa('0x3')](_0x25c818,_0x4f007e);};}function removeListener(_0xef15ef,_0x1d6e04){return function(){ChatQueueEvents['removeListener'](_0xef15ef,_0x1d6e04);};}exports['register']=function(_0x1aceaa){for(var _0x4d53f6=0x0,_0x32dee5=events[_0x76aa('0x4')];_0x4d53f6<_0x32dee5;_0x4d53f6++){var _0xa9b695=events[_0x4d53f6];var _0x56d6bc=createListener(_0x76aa('0x5')+_0xa9b695,_0x1aceaa);ChatQueueEvents['on'](_0xa9b695,_0x56d6bc);}};
\ No newline at end of file
+var _0xedd9=['removeListener','register','length','chatQueue:','save','remove','update','emit'];(function(_0x56ddd0,_0x1c260c){var _0x522d41=function(_0x120ce3){while(--_0x120ce3){_0x56ddd0['push'](_0x56ddd0['shift']());}};_0x522d41(++_0x1c260c);}(_0xedd9,0xfc));var _0x9edd=function(_0x4d4356,_0x27f883){_0x4d4356=_0x4d4356-0x0;var _0x232113=_0xedd9[_0x4d4356];return _0x232113;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){ChatQueueEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);ChatQueueEvents['on'](_0x571af9,_0x172522);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 2291111..2b74d54 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5489c1,_0x4dc85d){var _0x4ab0ee=function(_0x240ca2){while(--_0x240ca2){_0x5489c1['push'](_0x5489c1['shift']());}};_0x4ab0ee(++_0x4dc85d);}(_0xe14b,0x93));var _0xbe14=function(_0xf823ef,_0x2f7a1b){_0xf823ef=_0xf823ef-0x0;var _0x456a79=_0xe14b[_0xf823ef];return _0x456a79;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0x5fc3[_0x2db667];return _0x83ff9;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index d3a2797..15c18b4 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57fe=['sequelize','STRING','DATE','moment'];(function(_0x1e03ce,_0x4bfdb3){var _0x1284a2=function(_0x1516ef){while(--_0x1516ef){_0x1e03ce['push'](_0x1e03ce['shift']());}};_0x1284a2(++_0x4bfdb3);}(_0x57fe,0x13b));var _0xe57f=function(_0x513951,_0xccc3cc){_0x513951=_0x513951-0x0;var _0x34657c=_0x57fe[_0x513951];return _0x34657c;};'use strict';var moment=require(_0xe57f('0x0'));var Sequelize=require(_0xe57f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe57f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe57f('0x2')]},'joinAt':{'type':Sequelize[_0xe57f('0x3')]},'leaveAt':{'type':Sequelize[_0xe57f('0x3')]},'acceptAt':{'type':Sequelize[_0xe57f('0x3')]},'exitAt':{'type':Sequelize[_0xe57f('0x3')]},'reason':{'type':Sequelize[_0xe57f('0x2')]}};
\ No newline at end of file
+var _0xd90b=['moment','STRING','DATE'];(function(_0x41ede1,_0x42e44e){var _0x1b2e7c=function(_0x82ae80){while(--_0x82ae80){_0x41ede1['push'](_0x41ede1['shift']());}};_0x1b2e7c(++_0x42e44e);}(_0xd90b,0xbd));var _0xbd90=function(_0x3a28d5,_0x2ccc77){_0x3a28d5=_0x3a28d5-0x0;var _0x166097=_0xd90b[_0x3a28d5];return _0x166097;};'use strict';var moment=require(_0xbd90('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbd90('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd90('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbd90('0x2')]},'reason':{'type':Sequelize[_0xbd90('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index f89a078..66bcc1f 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8861=['then','error','stack','name','send','index','ChatQueueReport','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','count','status','Content-Range','apply','save','update','destroy'];(function(_0x5b8118,_0x1ebf18){var _0x2862b3=function(_0x4c0b33){while(--_0x4c0b33){_0x5b8118['push'](_0x5b8118['shift']());}};_0x2862b3(++_0x1ebf18);}(_0x8861,0x6d));var _0x1886=function(_0x4f9544,_0x34fab3){_0x4f9544=_0x4f9544-0x0;var _0x3680b4=_0x8861[_0x4f9544];return _0x3680b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1886('0x0'));var jsonpatch=require(_0x1886('0x1'));var rp=require(_0x1886('0x2'));var moment=require(_0x1886('0x3'));var BPromise=require(_0x1886('0x4'));var Mustache=require(_0x1886('0x5'));var util=require(_0x1886('0x6'));var path=require(_0x1886('0x7'));var sox=require(_0x1886('0x8'));var csv=require(_0x1886('0x9'));var ejs=require(_0x1886('0xa'));var fs=require('fs');var fs_extra=require(_0x1886('0xb'));var _=require(_0x1886('0xc'));var squel=require(_0x1886('0xd'));var crypto=require(_0x1886('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1886('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1886('0x10'));var Papa=require('papaparse');var Redis=require(_0x1886('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1886('0x12'));var as=require(_0x1886('0x13'));var hardwareService=require(_0x1886('0x14'));var logger=require(_0x1886('0x15'))(_0x1886('0x16'));var utils=require(_0x1886('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1886('0x18'));var db=require(_0x1886('0x19'))['db'];function respondWithStatusCode(_0x13a77f,_0x30c26a){_0x30c26a=_0x30c26a||0xcc;return function(_0x101b21){if(_0x101b21){return _0x13a77f[_0x1886('0x1a')](_0x30c26a);}return _0x13a77f['status'](_0x30c26a)['end']();};}function respondWithResult(_0x26dcf9,_0x23ec3f){_0x23ec3f=_0x23ec3f||0xc8;return function(_0x218d82){if(_0x218d82){return _0x26dcf9['status'](_0x23ec3f)[_0x1886('0x1b')](_0x218d82);}};}function respondWithFilteredResult(_0x43f020,_0x3767ba){return function(_0x4993fe){if(_0x4993fe){var _0x54d2ee=typeof _0x3767ba[_0x1886('0x1c')]==='undefined'&&typeof _0x3767ba[_0x1886('0x1d')]==='undefined';var _0xe3ba5e=_0x4993fe['count'];var _0x59e422=_0x54d2ee?0x0:_0x3767ba[_0x1886('0x1c')];var _0x33765e=_0x54d2ee?_0x4993fe[_0x1886('0x1e')]:_0x3767ba[_0x1886('0x1c')]+_0x3767ba[_0x1886('0x1d')];var _0x1c9a22;if(_0x33765e>=_0xe3ba5e){_0x33765e=_0xe3ba5e;_0x1c9a22=0xc8;}else{_0x1c9a22=0xce;}_0x43f020[_0x1886('0x1f')](_0x1c9a22);return _0x43f020['set'](_0x1886('0x20'),_0x59e422+'-'+_0x33765e+'/'+_0xe3ba5e)[_0x1886('0x1b')](_0x4993fe);}return null;};}function patchUpdates(_0x49dc6c){return function(_0x3df84f){try{jsonpatch[_0x1886('0x21')](_0x3df84f,_0x49dc6c,!![]);}catch(_0x2f39c4){return BPromise['reject'](_0x2f39c4);}return _0x3df84f[_0x1886('0x22')]();};}function saveUpdates(_0x1b4fb0,_0x257831){return function(_0x452f93){if(_0x452f93){return _0x452f93[_0x1886('0x23')](_0x1b4fb0)['then'](function(_0x500e13){return _0x500e13;});}return null;};}function removeEntity(_0x3f7bb1,_0x345bd7){return function(_0x2e508c){if(_0x2e508c){return _0x2e508c[_0x1886('0x24')]()[_0x1886('0x25')](function(){_0x3f7bb1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c8841,_0x3c4d84){return function(_0x195846){if(!_0x195846){_0x1c8841['sendStatus'](0x194);}return _0x195846;};}function handleError(_0x2d2dff,_0x188ab5){_0x188ab5=_0x188ab5||0x1f4;return function(_0x410046){logger[_0x1886('0x26')](_0x410046[_0x1886('0x27')]);if(_0x410046[_0x1886('0x28')]){delete _0x410046[_0x1886('0x28')];}_0x2d2dff[_0x1886('0x1f')](_0x188ab5)[_0x1886('0x29')](_0x410046);};}exports[_0x1886('0x2a')]=function(_0x13fe64,_0x177307){var _0x4edca2={},_0x2e7a79={},_0x11c0d2={'count':0x0,'rows':[]};var _0x1bd068=_['map'](db[_0x1886('0x2b')][_0x1886('0x2c')],function(_0x3d1142){return{'name':_0x3d1142['fieldName'],'type':_0x3d1142['type']['key']};});_0x2e7a79[_0x1886('0x2d')]=_[_0x1886('0x2e')](_0x1bd068,_0x1886('0x28'));_0x2e7a79[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x13fe64[_0x1886('0x2f')]);_0x2e7a79['filters']=_[_0x1886('0x31')](_0x2e7a79[_0x1886('0x2d')],_0x2e7a79['query']);_0x4edca2[_0x1886('0x32')]=_['intersection'](_0x2e7a79['model'],qs[_0x1886('0x33')](_0x13fe64[_0x1886('0x2f')][_0x1886('0x33')]));_0x4edca2[_0x1886('0x32')]=_0x4edca2[_0x1886('0x32')][_0x1886('0x34')]?_0x4edca2[_0x1886('0x32')]:_0x2e7a79[_0x1886('0x2d')];if(!_0x13fe64[_0x1886('0x2f')][_0x1886('0x35')]('nolimit')){_0x4edca2['limit']=qs[_0x1886('0x1d')](_0x13fe64['query'][_0x1886('0x1d')]);_0x4edca2[_0x1886('0x1c')]=qs[_0x1886('0x1c')](_0x13fe64[_0x1886('0x2f')][_0x1886('0x1c')]);}_0x4edca2[_0x1886('0x36')]=qs[_0x1886('0x37')](_0x13fe64['query'][_0x1886('0x37')]);_0x4edca2[_0x1886('0x38')]=qs[_0x1886('0x39')](_[_0x1886('0x3a')](_0x13fe64[_0x1886('0x2f')],_0x2e7a79[_0x1886('0x39')]),_0x1bd068);if(_0x13fe64[_0x1886('0x2f')][_0x1886('0x3b')]){_0x4edca2['where']=_[_0x1886('0x3c')](_0x4edca2[_0x1886('0x38')],{'$or':_[_0x1886('0x2e')](_0x1bd068,function(_0x89bded){if(_0x89bded[_0x1886('0x3d')]!=='VIRTUAL'){var _0x39694d={};_0x39694d[_0x89bded['name']]={'$like':'%'+_0x13fe64['query']['filter']+'%'};return _0x39694d;}})});}_0x4edca2=_[_0x1886('0x3c')]({},_0x4edca2,_0x13fe64[_0x1886('0x3e')]);var _0x5dafa6={'where':_0x4edca2[_0x1886('0x38')]};return db['ChatQueueReport']['count'](_0x5dafa6)[_0x1886('0x25')](function(_0xe85aad){_0x11c0d2[_0x1886('0x1e')]=_0xe85aad;if(_0x13fe64[_0x1886('0x2f')][_0x1886('0x3f')]){_0x4edca2[_0x1886('0x40')]=[{'all':!![]}];}return db[_0x1886('0x2b')][_0x1886('0x41')](_0x4edca2);})[_0x1886('0x25')](function(_0x298be6){_0x11c0d2[_0x1886('0x42')]=_0x298be6;return _0x11c0d2;})[_0x1886('0x25')](respondWithFilteredResult(_0x177307,_0x4edca2))[_0x1886('0x43')](handleError(_0x177307,null));};exports[_0x1886('0x44')]=function(_0x8d162d,_0x2d406e){var _0x28abde={'raw':!![],'where':{'id':_0x8d162d[_0x1886('0x45')]['id']}},_0x412970={};_0x412970[_0x1886('0x2d')]=_[_0x1886('0x30')](db[_0x1886('0x2b')][_0x1886('0x2c')]);_0x412970[_0x1886('0x2f')]=_[_0x1886('0x30')](_0x8d162d['query']);_0x412970[_0x1886('0x39')]=_['intersection'](_0x412970[_0x1886('0x2d')],_0x412970['query']);_0x28abde[_0x1886('0x32')]=_['intersection'](_0x412970[_0x1886('0x2d')],qs['fields'](_0x8d162d[_0x1886('0x2f')]['fields']));_0x28abde[_0x1886('0x32')]=_0x28abde['attributes'][_0x1886('0x34')]?_0x28abde['attributes']:_0x412970[_0x1886('0x2d')];if(_0x8d162d['query'][_0x1886('0x3f')]){_0x28abde['include']=[{'all':!![]}];}_0x28abde=_[_0x1886('0x3c')]({},_0x28abde,_0x8d162d[_0x1886('0x3e')]);return db['ChatQueueReport'][_0x1886('0x46')](_0x28abde)[_0x1886('0x25')](handleEntityNotFound(_0x2d406e,null))[_0x1886('0x25')](respondWithResult(_0x2d406e,null))['catch'](handleError(_0x2d406e,null));};exports[_0x1886('0x47')]=function(_0x22b229,_0x55f03d){return db[_0x1886('0x2b')][_0x1886('0x47')](_0x22b229[_0x1886('0x48')],{})[_0x1886('0x25')](respondWithResult(_0x55f03d,0xc9))[_0x1886('0x43')](handleError(_0x55f03d,null));};exports[_0x1886('0x23')]=function(_0x40e260,_0x5022ae){if(_0x40e260[_0x1886('0x48')]['id']){delete _0x40e260['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x40e260[_0x1886('0x45')]['id']}})[_0x1886('0x25')](handleEntityNotFound(_0x5022ae,null))['then'](saveUpdates(_0x40e260[_0x1886('0x48')],null))[_0x1886('0x25')](respondWithResult(_0x5022ae,null))[_0x1886('0x43')](handleError(_0x5022ae,null));};exports[_0x1886('0x24')]=function(_0x303a43,_0x5b2caf){return db[_0x1886('0x2b')]['find']({'where':{'id':_0x303a43[_0x1886('0x45')]['id']}})[_0x1886('0x25')](handleEntityNotFound(_0x5b2caf,null))[_0x1886('0x25')](removeEntity(_0x5b2caf,null))[_0x1886('0x43')](handleError(_0x5b2caf,null));};exports['describe']=function(_0x416164,_0x6595f){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x6595f,null))['catch'](handleError(_0x6595f,null));};
\ No newline at end of file
+var _0x8daf=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','error','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','merge','count','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','body','destroy','describe','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0xf74ddb,_0x8383bd){var _0x44e4cd=function(_0x20be15){while(--_0x20be15){_0xf74ddb['push'](_0xf74ddb['shift']());}};_0x44e4cd(++_0x8383bd);}(_0x8daf,0x15c));var _0xf8da=function(_0x4014e5,_0x125e6a){_0x4014e5=_0x4014e5-0x0;var _0x4ee8b7=_0x8daf[_0x4014e5];return _0x4ee8b7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf8da('0x0'));var moment=require(_0xf8da('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xf8da('0x2'));var util=require(_0xf8da('0x3'));var path=require(_0xf8da('0x4'));var sox=require(_0xf8da('0x5'));var csv=require(_0xf8da('0x6'));var ejs=require(_0xf8da('0x7'));var fs=require('fs');var fs_extra=require(_0xf8da('0x8'));var _=require(_0xf8da('0x9'));var squel=require(_0xf8da('0xa'));var crypto=require('crypto');var jsforce=require(_0xf8da('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf8da('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf8da('0xc'));var authService=require(_0xf8da('0xd'));var qs=require(_0xf8da('0xe'));var as=require(_0xf8da('0xf'));var hardwareService=require(_0xf8da('0x10'));var logger=require(_0xf8da('0x11'))(_0xf8da('0x12'));var utils=require(_0xf8da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf8da('0x14'));var db=require(_0xf8da('0x15'))['db'];function respondWithStatusCode(_0x3a436d,_0x1cfce2){_0x1cfce2=_0x1cfce2||0xcc;return function(_0x5cd714){if(_0x5cd714){return _0x3a436d[_0xf8da('0x16')](_0x1cfce2);}return _0x3a436d['status'](_0x1cfce2)[_0xf8da('0x17')]();};}function respondWithResult(_0x1a93ab,_0x259b96){_0x259b96=_0x259b96||0xc8;return function(_0x3e5413){if(_0x3e5413){return _0x1a93ab[_0xf8da('0x18')](_0x259b96)['json'](_0x3e5413);}};}function respondWithFilteredResult(_0x387c8e,_0x4296ff){return function(_0x36cee8){if(_0x36cee8){var _0x3fa368=typeof _0x4296ff[_0xf8da('0x19')]===_0xf8da('0x1a')&&typeof _0x4296ff[_0xf8da('0x1b')]==='undefined';var _0x1c9486=_0x36cee8['count'];var _0x5dc9db=_0x3fa368?0x0:_0x4296ff[_0xf8da('0x19')];var _0x2611c2=_0x3fa368?_0x36cee8['count']:_0x4296ff[_0xf8da('0x19')]+_0x4296ff[_0xf8da('0x1b')];var _0x30e1;if(_0x2611c2>=_0x1c9486){_0x2611c2=_0x1c9486;_0x30e1=0xc8;}else{_0x30e1=0xce;}_0x387c8e[_0xf8da('0x18')](_0x30e1);return _0x387c8e[_0xf8da('0x1c')](_0xf8da('0x1d'),_0x5dc9db+'-'+_0x2611c2+'/'+_0x1c9486)[_0xf8da('0x1e')](_0x36cee8);}return null;};}function patchUpdates(_0xfe5c73){return function(_0x5acd3f){try{jsonpatch[_0xf8da('0x1f')](_0x5acd3f,_0xfe5c73,!![]);}catch(_0x22adc7){return BPromise['reject'](_0x22adc7);}return _0x5acd3f[_0xf8da('0x20')]();};}function saveUpdates(_0x5361e7,_0x4ca909){return function(_0x5a295f){if(_0x5a295f){return _0x5a295f[_0xf8da('0x21')](_0x5361e7)[_0xf8da('0x22')](function(_0x2255b8){return _0x2255b8;});}return null;};}function removeEntity(_0x389391,_0x493d6c){return function(_0x4f7ceb){if(_0x4f7ceb){return _0x4f7ceb['destroy']()['then'](function(){_0x389391[_0xf8da('0x18')](0xcc)[_0xf8da('0x17')]();});}};}function handleEntityNotFound(_0x43934c,_0x2b403d){return function(_0x4b8d17){if(!_0x4b8d17){_0x43934c[_0xf8da('0x16')](0x194);}return _0x4b8d17;};}function handleError(_0x2ca340,_0x4326b1){_0x4326b1=_0x4326b1||0x1f4;return function(_0x550590){logger[_0xf8da('0x23')](_0x550590['stack']);if(_0x550590[_0xf8da('0x24')]){delete _0x550590[_0xf8da('0x24')];}_0x2ca340[_0xf8da('0x18')](_0x4326b1)[_0xf8da('0x25')](_0x550590);};}exports[_0xf8da('0x26')]=function(_0x3da568,_0x35544b){var _0x424f5d={},_0x51014c={},_0xd5780a={'count':0x0,'rows':[]};var _0x552ed3=_['map'](db[_0xf8da('0x27')][_0xf8da('0x28')],function(_0x16d7e9){return{'name':_0x16d7e9[_0xf8da('0x29')],'type':_0x16d7e9[_0xf8da('0x2a')]['key']};});_0x51014c[_0xf8da('0x2b')]=_['map'](_0x552ed3,'name');_0x51014c['query']=_['keys'](_0x3da568['query']);_0x51014c[_0xf8da('0x2c')]=_['intersection'](_0x51014c[_0xf8da('0x2b')],_0x51014c[_0xf8da('0x2d')]);_0x424f5d[_0xf8da('0x2e')]=_['intersection'](_0x51014c['model'],qs[_0xf8da('0x2f')](_0x3da568[_0xf8da('0x2d')][_0xf8da('0x2f')]));_0x424f5d[_0xf8da('0x2e')]=_0x424f5d[_0xf8da('0x2e')][_0xf8da('0x30')]?_0x424f5d['attributes']:_0x51014c[_0xf8da('0x2b')];if(!_0x3da568[_0xf8da('0x2d')][_0xf8da('0x31')](_0xf8da('0x32'))){_0x424f5d[_0xf8da('0x1b')]=qs[_0xf8da('0x1b')](_0x3da568['query'][_0xf8da('0x1b')]);_0x424f5d[_0xf8da('0x19')]=qs[_0xf8da('0x19')](_0x3da568[_0xf8da('0x2d')]['offset']);}_0x424f5d[_0xf8da('0x33')]=qs['sort'](_0x3da568[_0xf8da('0x2d')]['sort']);_0x424f5d[_0xf8da('0x34')]=qs['filters'](_[_0xf8da('0x35')](_0x3da568[_0xf8da('0x2d')],_0x51014c[_0xf8da('0x2c')]),_0x552ed3);if(_0x3da568[_0xf8da('0x2d')][_0xf8da('0x36')]){_0x424f5d[_0xf8da('0x34')]=_['merge'](_0x424f5d[_0xf8da('0x34')],{'$or':_[_0xf8da('0x37')](_0x552ed3,function(_0x235756){if(_0x235756['type']!==_0xf8da('0x38')){var _0x3eb5b1={};_0x3eb5b1[_0x235756[_0xf8da('0x24')]]={'$like':'%'+_0x3da568['query'][_0xf8da('0x36')]+'%'};return _0x3eb5b1;}})});}_0x424f5d=_[_0xf8da('0x39')]({},_0x424f5d,_0x3da568['options']);var _0x236244={'where':_0x424f5d[_0xf8da('0x34')]};return db[_0xf8da('0x27')]['count'](_0x236244)[_0xf8da('0x22')](function(_0xec8256){_0xd5780a[_0xf8da('0x3a')]=_0xec8256;if(_0x3da568[_0xf8da('0x2d')][_0xf8da('0x3b')]){_0x424f5d[_0xf8da('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xf8da('0x3d')](_0x424f5d);})[_0xf8da('0x22')](function(_0x55c307){_0xd5780a['rows']=_0x55c307;return _0xd5780a;})[_0xf8da('0x22')](respondWithFilteredResult(_0x35544b,_0x424f5d))[_0xf8da('0x3e')](handleError(_0x35544b,null));};exports[_0xf8da('0x3f')]=function(_0x72f494,_0x555822){var _0x246192={'raw':!![],'where':{'id':_0x72f494[_0xf8da('0x40')]['id']}},_0x2807f9={};_0x2807f9[_0xf8da('0x2b')]=_['keys'](db['ChatQueueReport'][_0xf8da('0x28')]);_0x2807f9['query']=_[_0xf8da('0x41')](_0x72f494['query']);_0x2807f9[_0xf8da('0x2c')]=_[_0xf8da('0x42')](_0x2807f9[_0xf8da('0x2b')],_0x2807f9[_0xf8da('0x2d')]);_0x246192[_0xf8da('0x2e')]=_[_0xf8da('0x42')](_0x2807f9[_0xf8da('0x2b')],qs['fields'](_0x72f494[_0xf8da('0x2d')][_0xf8da('0x2f')]));_0x246192['attributes']=_0x246192[_0xf8da('0x2e')][_0xf8da('0x30')]?_0x246192['attributes']:_0x2807f9[_0xf8da('0x2b')];if(_0x72f494[_0xf8da('0x2d')][_0xf8da('0x3b')]){_0x246192[_0xf8da('0x3c')]=[{'all':!![]}];}_0x246192=_[_0xf8da('0x39')]({},_0x246192,_0x72f494['options']);return db['ChatQueueReport'][_0xf8da('0x43')](_0x246192)['then'](handleEntityNotFound(_0x555822,null))[_0xf8da('0x22')](respondWithResult(_0x555822,null))['catch'](handleError(_0x555822,null));};exports[_0xf8da('0x44')]=function(_0x3970b8,_0x1703a1){return db[_0xf8da('0x27')][_0xf8da('0x44')](_0x3970b8[_0xf8da('0x45')],{})[_0xf8da('0x22')](respondWithResult(_0x1703a1,0xc9))[_0xf8da('0x3e')](handleError(_0x1703a1,null));};exports['update']=function(_0x26db7f,_0x3decc8){if(_0x26db7f['body']['id']){delete _0x26db7f[_0xf8da('0x45')]['id'];}return db[_0xf8da('0x27')][_0xf8da('0x43')]({'where':{'id':_0x26db7f[_0xf8da('0x40')]['id']}})[_0xf8da('0x22')](handleEntityNotFound(_0x3decc8,null))['then'](saveUpdates(_0x26db7f['body'],null))['then'](respondWithResult(_0x3decc8,null))['catch'](handleError(_0x3decc8,null));};exports[_0xf8da('0x46')]=function(_0x2f8d1a,_0x5c9c5a){return db['ChatQueueReport'][_0xf8da('0x43')]({'where':{'id':_0x2f8d1a[_0xf8da('0x40')]['id']}})[_0xf8da('0x22')](handleEntityNotFound(_0x5c9c5a,null))[_0xf8da('0x22')](removeEntity(_0x5c9c5a,null))[_0xf8da('0x3e')](handleError(_0x5c9c5a,null));};exports[_0xf8da('0x47')]=function(_0x2780fe,_0x1b31bf){return db[_0xf8da('0x27')]['describe']()['then'](respondWithResult(_0x1b31bf,null))['catch'](handleError(_0x1b31bf,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index c1d1ba9..15aaf16 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4277ba,_0x39dd98){var _0x2e6f3d=function(_0x4a218c){while(--_0x4a218c){_0x4277ba['push'](_0x4277ba['shift']());}};_0x2e6f3d(++_0x39dd98);}(_0x757a,0xde));var _0xa757=function(_0xae522a,_0x49854d){_0xae522a=_0xae522a-0x0;var _0x62d323=_0x757a[_0xae522a];return _0x62d323;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x223b20,_0x3f2c5d){var _0x9fb3c1=function(_0x338cd7){while(--_0x338cd7){_0x223b20['push'](_0x223b20['shift']());}};_0x9fb3c1(++_0x3f2c5d);}(_0x757a,0xde));var _0xa757=function(_0x44b598,_0x2dd4b6){_0x44b598=_0x44b598-0x0;var _0x44d4d0=_0x757a[_0x44b598];return _0x44d4d0;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 4ec78ef..d9dc919 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8fde=['catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','where','attributes','limit','debug','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x588fde,_0x11084e){var _0x1da4d9=function(_0x4638e5){while(--_0x4638e5){_0x588fde['push'](_0x588fde['shift']());}};_0x1da4d9(++_0x11084e);}(_0x8fde,0x138));var _0xe8fd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8fde[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0xe8fd('0x0'));var moment=require('moment');var BPromise=require(_0xe8fd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe8fd('0x2'));var logger=require(_0xe8fd('0x3'))(_0xe8fd('0x4'));var config=require(_0xe8fd('0x5'));var jayson=require(_0xe8fd('0x6'));var client=jayson[_0xe8fd('0x7')][_0xe8fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9236d6,_0x1f07cb,_0xaee575){return new BPromise(function(_0x2eb4cf,_0x31f334){return client[_0xe8fd('0x9')](_0x9236d6,_0xaee575)['then'](function(_0x537227){logger[_0xe8fd('0xa')](_0xe8fd('0xb'),_0x1f07cb,_0xe8fd('0xc'));logger['debug'](_0xe8fd('0xd'),_0x1f07cb,_0xe8fd('0xc'),JSON['stringify'](_0x537227));if(_0x537227['error']){if(_0x537227['error'][_0xe8fd('0xe')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x1f07cb,_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);return _0x31f334(_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);}logger[_0xe8fd('0xf')](_0xe8fd('0xb'),_0x1f07cb,_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);return _0x2eb4cf(_0x537227[_0xe8fd('0xf')][_0xe8fd('0x10')]);}else{logger[_0xe8fd('0xa')](_0xe8fd('0xb'),_0x1f07cb,_0xe8fd('0xc'));_0x2eb4cf(_0x537227[_0xe8fd('0x11')][_0xe8fd('0x10')]);}})[_0xe8fd('0x12')](function(_0xa6fe4c){logger[_0xe8fd('0xf')](_0xe8fd('0xb'),_0x1f07cb,_0xa6fe4c);_0x31f334(_0xa6fe4c);});});}exports['CreateChatQueueReport']=function(_0x8eafb7){var _0x2549b9=this;return new Promise(function(_0x18adf5,_0x1c9d0c){return db[_0xe8fd('0x13')][_0xe8fd('0x14')](_0x8eafb7[_0xe8fd('0x15')],{'raw':_0x8eafb7[_0xe8fd('0x16')]?_0x8eafb7[_0xe8fd('0x16')][_0xe8fd('0x17')]===undefined?!![]:![]:!![]})[_0xe8fd('0x18')](function(_0x39a3e3){logger[_0xe8fd('0xa')](_0xe8fd('0x19'),_0x8eafb7);logger['debug'](_0xe8fd('0x19'),_0x8eafb7,JSON[_0xe8fd('0x1a')](_0x39a3e3));_0x18adf5(_0x39a3e3);})['catch'](function(_0x2f1a00){logger['error'](_0xe8fd('0x19'),_0x2f1a00['message'],_0x8eafb7);_0x1c9d0c(_0x2549b9[_0xe8fd('0xf')](0x1f4,_0x2f1a00[_0xe8fd('0x10')]));});});};exports[_0xe8fd('0x1b')]=function(_0x45b52c){var _0x4098fb=this;return new Promise(function(_0x3ab225,_0x25c199){return db[_0xe8fd('0x13')][_0xe8fd('0x1c')](_0x45b52c[_0xe8fd('0x15')],{'raw':_0x45b52c['options']?_0x45b52c[_0xe8fd('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b52c[_0xe8fd('0x16')]?_0x45b52c[_0xe8fd('0x16')][_0xe8fd('0x1d')]||null:null,'attributes':_0x45b52c[_0xe8fd('0x16')]?_0x45b52c['options'][_0xe8fd('0x1e')]||null:null,'limit':_0x45b52c[_0xe8fd('0x16')]?_0x45b52c[_0xe8fd('0x16')][_0xe8fd('0x1f')]||null:null})['then'](function(_0x277883){logger[_0xe8fd('0xa')](_0xe8fd('0x1b'),_0x45b52c);logger[_0xe8fd('0x20')](_0xe8fd('0x1b'),_0x45b52c,JSON['stringify'](_0x277883));_0x3ab225(_0x277883);})[_0xe8fd('0x12')](function(_0x5d111d){logger[_0xe8fd('0xf')]('UpdateChatQueueReport',_0x5d111d[_0xe8fd('0x10')],_0x45b52c);_0x25c199(_0x4098fb[_0xe8fd('0xf')](0x1f4,_0x5d111d[_0xe8fd('0x10')]));});});};
\ No newline at end of file
+var _0x8eea=['ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatQueueReport','body','options','raw','then','stringify','UpdateChatQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a1426,_0x4ae821){var _0x5ac7dd=function(_0x11eccd){while(--_0x11eccd){_0x4a1426['push'](_0x4a1426['shift']());}};_0x5ac7dd(++_0x4ae821);}(_0x8eea,0xd2));var _0xa8ee=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0x8eea[_0x5959c9];return _0x4ffcbc;};'use strict';var _=require(_0xa8ee('0x0'));var util=require('util');var moment=require(_0xa8ee('0x1'));var BPromise=require(_0xa8ee('0x2'));var rs=require(_0xa8ee('0x3'));var fs=require('fs');var Redis=require(_0xa8ee('0x4'));var db=require(_0xa8ee('0x5'))['db'];var utils=require(_0xa8ee('0x6'));var logger=require(_0xa8ee('0x7'))(_0xa8ee('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8ee('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28931f,_0x53c75f,_0x238806){return new BPromise(function(_0x365757,_0x20bd87){return client[_0xa8ee('0xa')](_0x28931f,_0x238806)['then'](function(_0x1f42a7){logger['info'](_0xa8ee('0xb'),_0x53c75f,_0xa8ee('0xc'));logger[_0xa8ee('0xd')](_0xa8ee('0xe'),_0x53c75f,_0xa8ee('0xc'),JSON['stringify'](_0x1f42a7));if(_0x1f42a7[_0xa8ee('0xf')]){if(_0x1f42a7[_0xa8ee('0xf')][_0xa8ee('0x10')]===0x1f4){logger['error'](_0xa8ee('0xb'),_0x53c75f,_0x1f42a7[_0xa8ee('0xf')][_0xa8ee('0x11')]);return _0x20bd87(_0x1f42a7['error']['message']);}logger[_0xa8ee('0xf')](_0xa8ee('0xb'),_0x53c75f,_0x1f42a7['error'][_0xa8ee('0x11')]);return _0x365757(_0x1f42a7[_0xa8ee('0xf')][_0xa8ee('0x11')]);}else{logger[_0xa8ee('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x53c75f,_0xa8ee('0xc'));_0x365757(_0x1f42a7[_0xa8ee('0x13')][_0xa8ee('0x11')]);}})[_0xa8ee('0x14')](function(_0x2a09f6){logger[_0xa8ee('0xf')](_0xa8ee('0xb'),_0x53c75f,_0x2a09f6);_0x20bd87(_0x2a09f6);});});}exports[_0xa8ee('0x15')]=function(_0x2904b7){var _0x5bb89a=this;return new Promise(function(_0x3db1c0,_0x1bf4c8){return db['ChatQueueReport']['create'](_0x2904b7[_0xa8ee('0x16')],{'raw':_0x2904b7[_0xa8ee('0x17')]?_0x2904b7[_0xa8ee('0x17')][_0xa8ee('0x18')]===undefined?!![]:![]:!![]})[_0xa8ee('0x19')](function(_0x2c174f){logger[_0xa8ee('0x12')](_0xa8ee('0x15'),_0x2904b7);logger['debug'](_0xa8ee('0x15'),_0x2904b7,JSON[_0xa8ee('0x1a')](_0x2c174f));_0x3db1c0(_0x2c174f);})['catch'](function(_0x11d86e){logger[_0xa8ee('0xf')](_0xa8ee('0x15'),_0x11d86e[_0xa8ee('0x11')],_0x2904b7);_0x1bf4c8(_0x5bb89a[_0xa8ee('0xf')](0x1f4,_0x11d86e[_0xa8ee('0x11')]));});});};exports[_0xa8ee('0x1b')]=function(_0x5236ed){var _0x35cb87=this;return new Promise(function(_0x3b4f0c,_0x560f0b){return db['ChatQueueReport'][_0xa8ee('0x1c')](_0x5236ed['body'],{'raw':_0x5236ed[_0xa8ee('0x17')]?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5236ed['options']?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x1d')]||null:null,'attributes':_0x5236ed[_0xa8ee('0x17')]?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x1e')]||null:null,'limit':_0x5236ed[_0xa8ee('0x17')]?_0x5236ed[_0xa8ee('0x17')][_0xa8ee('0x1f')]||null:null})[_0xa8ee('0x19')](function(_0xbd735f){logger[_0xa8ee('0x12')]('UpdateChatQueueReport',_0x5236ed);logger[_0xa8ee('0xd')](_0xa8ee('0x1b'),_0x5236ed,JSON['stringify'](_0xbd735f));_0x3b4f0c(_0xbd735f);})['catch'](function(_0x285b17){logger[_0xa8ee('0xf')](_0xa8ee('0x1b'),_0x285b17[_0xa8ee('0x11')],_0x5236ed);_0x560f0b(_0x35cb87['error'](0x1f4,_0x285b17[_0xa8ee('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 9703a75..caa9ccc 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xda6a=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda6a,0x14e));var _0xada6=function(_0x13dbbf,_0x15523a){_0x13dbbf=_0x13dbbf-0x0;var _0x2b4fe0=_0xda6a[_0x13dbbf];return _0x2b4fe0;};'use strict';var multer=require(_0xada6('0x0'));var util=require('util');var path=require(_0xada6('0x1'));var timeout=require(_0xada6('0x2'));var express=require(_0xada6('0x3'));var router=express[_0xada6('0x4')]();var fs_extra=require(_0xada6('0x5'));var auth=require(_0xada6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xada6('0x7'));var controller=require(_0xada6('0x8'));router[_0xada6('0x9')]('/',auth[_0xada6('0xa')](),controller[_0xada6('0xb')]);router['get']('/describe',auth[_0xada6('0xa')](),controller[_0xada6('0xc')]);router[_0xada6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xada6('0xd')]);router[_0xada6('0xe')]('/',auth[_0xada6('0xa')](),controller[_0xada6('0xf')]);router[_0xada6('0x10')](_0xada6('0x11'),auth[_0xada6('0xa')](),controller[_0xada6('0x12')]);router[_0xada6('0x13')]('/:id',auth[_0xada6('0xa')](),controller[_0xada6('0x14')]);module[_0xada6('0x15')]=router;
\ No newline at end of file
+var _0x8782=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id'];(function(_0x2ddc59,_0x4451bc){var _0x3d4045=function(_0x25e6f9){while(--_0x25e6f9){_0x2ddc59['push'](_0x2ddc59['shift']());}};_0x3d4045(++_0x4451bc);}(_0x8782,0x97));var _0x2878=function(_0x72d656,_0x85ae0d){_0x72d656=_0x72d656-0x0;var _0x1f44d4=_0x8782[_0x72d656];return _0x1f44d4;};'use strict';var multer=require(_0x2878('0x0'));var util=require('util');var path=require(_0x2878('0x1'));var timeout=require(_0x2878('0x2'));var express=require(_0x2878('0x3'));var router=express['Router']();var fs_extra=require(_0x2878('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2878('0x5'));var config=require(_0x2878('0x6'));var controller=require(_0x2878('0x7'));router['get']('/',auth[_0x2878('0x8')](),controller[_0x2878('0x9')]);router[_0x2878('0xa')]('/describe',auth[_0x2878('0x8')](),controller[_0x2878('0xb')]);router[_0x2878('0xa')]('/:id',auth[_0x2878('0x8')](),controller[_0x2878('0xc')]);router[_0x2878('0xd')]('/',auth[_0x2878('0x8')](),controller[_0x2878('0xe')]);router[_0x2878('0xf')](_0x2878('0x10'),auth[_0x2878('0x8')](),controller[_0x2878('0x11')]);router[_0x2878('0x12')](_0x2878('0x10'),auth[_0x2878('0x8')](),controller[_0x2878('0x13')]);module[_0x2878('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index e2379b8..9e566d3 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x23e728,_0x21d571){var _0x548642=function(_0x2b7eaf){while(--_0x2b7eaf){_0x23e728['push'](_0x23e728['shift']());}};_0x548642(++_0x21d571);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2c0608,_0x173e4a){_0x2c0608=_0x2c0608-0x0;var _0x3123d9=_0xf4eb[_0x2c0608];return _0x3123d9;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x2d3690,_0x1dcd3f){var _0x433792=function(_0x15b208){while(--_0x15b208){_0x2d3690['push'](_0x2d3690['shift']());}};_0x433792(++_0x1dcd3f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3a7ee4,_0x165841){_0x3a7ee4=_0x3a7ee4-0x0;var _0x5c15b4=_0xf4eb[_0x3a7ee4];return _0x5c15b4;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 4bf7d62..e3e69cc 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x38ec=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x3cd128,_0x4c36f5){var _0x1c3e99=function(_0x2b009f){while(--_0x2b009f){_0x3cd128['push'](_0x3cd128['shift']());}};_0x1c3e99(++_0x4c36f5);}(_0x38ec,0xa6));var _0xc38e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x38ec[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc38e('0x0'));var rimraf=require(_0xc38e('0x1'));var zipdir=require(_0xc38e('0x2'));var jsonpatch=require(_0xc38e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc38e('0x4'));var Mustache=require('mustache');var util=require(_0xc38e('0x5'));var path=require(_0xc38e('0x6'));var sox=require(_0xc38e('0x7'));var csv=require(_0xc38e('0x8'));var ejs=require(_0xc38e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc38e('0xa'));var squel=require(_0xc38e('0xb'));var crypto=require(_0xc38e('0xc'));var jsforce=require(_0xc38e('0xd'));var deskjs=require(_0xc38e('0xe'));var toCsv=require(_0xc38e('0x8'));var querystring=require(_0xc38e('0xf'));var Papa=require(_0xc38e('0x10'));var Redis=require(_0xc38e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc38e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc38e('0x13'))(_0xc38e('0x14'));var utils=require(_0xc38e('0x15'));var config=require(_0xc38e('0x16'));var licenseUtil=require(_0xc38e('0x17'));var db=require(_0xc38e('0x18'))['db'];function respondWithStatusCode(_0x22bf41,_0x309b81){_0x309b81=_0x309b81||0xcc;return function(_0x33c1d1){if(_0x33c1d1){return _0x22bf41[_0xc38e('0x19')](_0x309b81);}return _0x22bf41[_0xc38e('0x1a')](_0x309b81)['end']();};}function respondWithResult(_0x45c028,_0x7c105d){_0x7c105d=_0x7c105d||0xc8;return function(_0x337151){if(_0x337151){return _0x45c028[_0xc38e('0x1a')](_0x7c105d)[_0xc38e('0x1b')](_0x337151);}};}function respondWithFilteredResult(_0xd6b2ea,_0x26a6fb){return function(_0xca1988){if(_0xca1988){var _0x3bb910=typeof _0x26a6fb[_0xc38e('0x1c')]===_0xc38e('0x1d')&&typeof _0x26a6fb[_0xc38e('0x1e')]===_0xc38e('0x1d');var _0x3102d7=_0xca1988[_0xc38e('0x1f')];var _0x5cf87c=_0x3bb910?0x0:_0x26a6fb[_0xc38e('0x1c')];var _0x2f8eb3=_0x3bb910?_0xca1988[_0xc38e('0x1f')]:_0x26a6fb[_0xc38e('0x1c')]+_0x26a6fb['limit'];var _0x106704;if(_0x2f8eb3>=_0x3102d7){_0x2f8eb3=_0x3102d7;_0x106704=0xc8;}else{_0x106704=0xce;}_0xd6b2ea[_0xc38e('0x1a')](_0x106704);return _0xd6b2ea['set'](_0xc38e('0x20'),_0x5cf87c+'-'+_0x2f8eb3+'/'+_0x3102d7)[_0xc38e('0x1b')](_0xca1988);}return null;};}function patchUpdates(_0x16cada){return function(_0x149dcb){try{jsonpatch[_0xc38e('0x21')](_0x149dcb,_0x16cada,!![]);}catch(_0x53287f){return BPromise['reject'](_0x53287f);}return _0x149dcb[_0xc38e('0x22')]();};}function saveUpdates(_0x58e648,_0x5a92d9){return function(_0x24813c){if(_0x24813c){return _0x24813c[_0xc38e('0x23')](_0x58e648)[_0xc38e('0x24')](function(_0x4441c0){return _0x4441c0;});}return null;};}function removeEntity(_0x170b97,_0x438abd){return function(_0x3045fd){if(_0x3045fd){return _0x3045fd['destroy']()[_0xc38e('0x24')](function(){_0x170b97[_0xc38e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7960df,_0x45a389){return function(_0x26b91e){if(!_0x26b91e){_0x7960df[_0xc38e('0x19')](0x194);}return _0x26b91e;};}function handleError(_0x51d464,_0xe3864){_0xe3864=_0xe3864||0x1f4;return function(_0x27f69d){logger[_0xc38e('0x25')](_0x27f69d[_0xc38e('0x26')]);if(_0x27f69d[_0xc38e('0x27')]){delete _0x27f69d['name'];}_0x51d464[_0xc38e('0x1a')](_0xe3864)[_0xc38e('0x28')](_0x27f69d);};}exports[_0xc38e('0x29')]=function(_0x3bc1aa,_0x4dd41f){var _0xa05bc5={},_0x4540bc={},_0xbd09c5={'count':0x0,'rows':[]};var _0x44da3d=_[_0xc38e('0x2a')](db[_0xc38e('0x2b')][_0xc38e('0x2c')],function(_0x166368){return{'name':_0x166368[_0xc38e('0x2d')],'type':_0x166368[_0xc38e('0x2e')][_0xc38e('0x2f')]};});_0x4540bc[_0xc38e('0x30')]=_[_0xc38e('0x2a')](_0x44da3d,_0xc38e('0x27'));_0x4540bc[_0xc38e('0x31')]=_[_0xc38e('0x32')](_0x3bc1aa[_0xc38e('0x31')]);_0x4540bc[_0xc38e('0x33')]=_[_0xc38e('0x34')](_0x4540bc[_0xc38e('0x30')],_0x4540bc[_0xc38e('0x31')]);_0xa05bc5[_0xc38e('0x35')]=_['intersection'](_0x4540bc[_0xc38e('0x30')],qs[_0xc38e('0x36')](_0x3bc1aa['query'][_0xc38e('0x36')]));_0xa05bc5[_0xc38e('0x35')]=_0xa05bc5[_0xc38e('0x35')]['length']?_0xa05bc5['attributes']:_0x4540bc[_0xc38e('0x30')];if(!_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x37')]('nolimit')){_0xa05bc5['limit']=qs['limit'](_0x3bc1aa['query'][_0xc38e('0x1e')]);_0xa05bc5['offset']=qs['offset'](_0x3bc1aa['query'][_0xc38e('0x1c')]);}_0xa05bc5[_0xc38e('0x38')]=qs[_0xc38e('0x39')](_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x39')]);_0xa05bc5[_0xc38e('0x3a')]=qs[_0xc38e('0x33')](_['pick'](_0x3bc1aa[_0xc38e('0x31')],_0x4540bc['filters']),_0x44da3d);if(_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x3b')]){_0xa05bc5[_0xc38e('0x3a')]=_[_0xc38e('0x3c')](_0xa05bc5[_0xc38e('0x3a')],{'$or':_[_0xc38e('0x2a')](_0x44da3d,function(_0x49eff4){if(_0x49eff4[_0xc38e('0x2e')]!==_0xc38e('0x3d')){var _0x37c64a={};_0x37c64a[_0x49eff4[_0xc38e('0x27')]]={'$like':'%'+_0x3bc1aa[_0xc38e('0x31')]['filter']+'%'};return _0x37c64a;}})});}_0xa05bc5=_[_0xc38e('0x3c')]({},_0xa05bc5,_0x3bc1aa[_0xc38e('0x3e')]);var _0x4814c2={'where':_0xa05bc5[_0xc38e('0x3a')]};return db[_0xc38e('0x2b')][_0xc38e('0x1f')](_0x4814c2)[_0xc38e('0x24')](function(_0x53ee91){_0xbd09c5[_0xc38e('0x1f')]=_0x53ee91;if(_0x3bc1aa[_0xc38e('0x31')][_0xc38e('0x3f')]){_0xa05bc5[_0xc38e('0x40')]=[{'all':!![]}];}return db[_0xc38e('0x2b')][_0xc38e('0x41')](_0xa05bc5);})[_0xc38e('0x24')](function(_0x4363e6){_0xbd09c5[_0xc38e('0x42')]=_0x4363e6;return _0xbd09c5;})[_0xc38e('0x24')](respondWithFilteredResult(_0x4dd41f,_0xa05bc5))[_0xc38e('0x43')](handleError(_0x4dd41f,null));};exports['show']=function(_0x35c55b,_0x100632){var _0x25fe74={'raw':!![],'where':{'id':_0x35c55b['params']['id']}},_0x530e47={};_0x530e47['model']=_[_0xc38e('0x32')](db[_0xc38e('0x2b')][_0xc38e('0x2c')]);_0x530e47[_0xc38e('0x31')]=_['keys'](_0x35c55b[_0xc38e('0x31')]);_0x530e47[_0xc38e('0x33')]=_[_0xc38e('0x34')](_0x530e47[_0xc38e('0x30')],_0x530e47[_0xc38e('0x31')]);_0x25fe74[_0xc38e('0x35')]=_[_0xc38e('0x34')](_0x530e47[_0xc38e('0x30')],qs[_0xc38e('0x36')](_0x35c55b['query'][_0xc38e('0x36')]));_0x25fe74[_0xc38e('0x35')]=_0x25fe74['attributes'][_0xc38e('0x44')]?_0x25fe74[_0xc38e('0x35')]:_0x530e47[_0xc38e('0x30')];if(_0x35c55b[_0xc38e('0x31')][_0xc38e('0x3f')]){_0x25fe74[_0xc38e('0x40')]=[{'all':!![]}];}_0x25fe74=_[_0xc38e('0x3c')]({},_0x25fe74,_0x35c55b[_0xc38e('0x3e')]);return db[_0xc38e('0x2b')]['find'](_0x25fe74)[_0xc38e('0x24')](handleEntityNotFound(_0x100632,null))['then'](respondWithResult(_0x100632,null))[_0xc38e('0x43')](handleError(_0x100632,null));};exports[_0xc38e('0x45')]=function(_0x4f4f91,_0x258671){return db[_0xc38e('0x2b')][_0xc38e('0x45')](_0x4f4f91[_0xc38e('0x46')],{})[_0xc38e('0x24')](respondWithResult(_0x258671,0xc9))[_0xc38e('0x43')](handleError(_0x258671,null));};exports['update']=function(_0x446791,_0x1ca673){if(_0x446791['body']['id']){delete _0x446791['body']['id'];}return db[_0xc38e('0x2b')][_0xc38e('0x47')]({'where':{'id':_0x446791[_0xc38e('0x48')]['id']}})[_0xc38e('0x24')](handleEntityNotFound(_0x1ca673,null))[_0xc38e('0x24')](saveUpdates(_0x446791[_0xc38e('0x46')],null))[_0xc38e('0x24')](respondWithResult(_0x1ca673,null))[_0xc38e('0x43')](handleError(_0x1ca673,null));};exports['destroy']=function(_0x376f9d,_0x1c13f2){return db['ChatTransferReport']['find']({'where':{'id':_0x376f9d[_0xc38e('0x48')]['id']}})[_0xc38e('0x24')](handleEntityNotFound(_0x1c13f2,null))[_0xc38e('0x24')](removeEntity(_0x1c13f2,null))[_0xc38e('0x43')](handleError(_0x1c13f2,null));};exports[_0xc38e('0x49')]=function(_0x102ecf,_0x465b56){return db[_0xc38e('0x2b')]['describe']()[_0xc38e('0x24')](respondWithResult(_0x465b56,null))['catch'](handleError(_0x465b56,null));};
\ No newline at end of file
+var _0xd67d=['error','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','keys','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x1ea1d7,_0x244b88){var _0x1a431c=function(_0x5bcd21){while(--_0x5bcd21){_0x1ea1d7['push'](_0x1ea1d7['shift']());}};_0x1a431c(++_0x244b88);}(_0xd67d,0xbd));var _0xdd67=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xd67d[_0x2c1dcd];return _0x158ce5;};'use strict';var emlformat=require(_0xdd67('0x0'));var rimraf=require(_0xdd67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd67('0x2'));var rp=require(_0xdd67('0x3'));var moment=require(_0xdd67('0x4'));var BPromise=require(_0xdd67('0x5'));var Mustache=require(_0xdd67('0x6'));var util=require(_0xdd67('0x7'));var path=require(_0xdd67('0x8'));var sox=require(_0xdd67('0x9'));var csv=require(_0xdd67('0xa'));var ejs=require(_0xdd67('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd67('0xc'));var squel=require(_0xdd67('0xd'));var crypto=require(_0xdd67('0xe'));var jsforce=require(_0xdd67('0xf'));var deskjs=require(_0xdd67('0x10'));var toCsv=require(_0xdd67('0xa'));var querystring=require(_0xdd67('0x11'));var Papa=require(_0xdd67('0x12'));var Redis=require(_0xdd67('0x13'));var authService=require(_0xdd67('0x14'));var qs=require(_0xdd67('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd67('0x16'));var logger=require('../../config/logger')(_0xdd67('0x17'));var utils=require(_0xdd67('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdd67('0x19'));var db=require(_0xdd67('0x1a'))['db'];function respondWithStatusCode(_0x21cf73,_0x367214){_0x367214=_0x367214||0xcc;return function(_0x2d11ba){if(_0x2d11ba){return _0x21cf73[_0xdd67('0x1b')](_0x367214);}return _0x21cf73[_0xdd67('0x1c')](_0x367214)[_0xdd67('0x1d')]();};}function respondWithResult(_0x593124,_0xe1bccc){_0xe1bccc=_0xe1bccc||0xc8;return function(_0x2b31c0){if(_0x2b31c0){return _0x593124['status'](_0xe1bccc)[_0xdd67('0x1e')](_0x2b31c0);}};}function respondWithFilteredResult(_0x589ff9,_0x4b7004){return function(_0x445b35){if(_0x445b35){var _0x1d3f7f=typeof _0x4b7004['offset']==='undefined'&&typeof _0x4b7004[_0xdd67('0x1f')]==='undefined';var _0xa5e290=_0x445b35[_0xdd67('0x20')];var _0x2fa37e=_0x1d3f7f?0x0:_0x4b7004[_0xdd67('0x21')];var _0x2da65a=_0x1d3f7f?_0x445b35[_0xdd67('0x20')]:_0x4b7004[_0xdd67('0x21')]+_0x4b7004[_0xdd67('0x1f')];var _0x2a4496;if(_0x2da65a>=_0xa5e290){_0x2da65a=_0xa5e290;_0x2a4496=0xc8;}else{_0x2a4496=0xce;}_0x589ff9[_0xdd67('0x1c')](_0x2a4496);return _0x589ff9[_0xdd67('0x22')](_0xdd67('0x23'),_0x2fa37e+'-'+_0x2da65a+'/'+_0xa5e290)[_0xdd67('0x1e')](_0x445b35);}return null;};}function patchUpdates(_0x1ac5dd){return function(_0x3ba201){try{jsonpatch[_0xdd67('0x24')](_0x3ba201,_0x1ac5dd,!![]);}catch(_0x385280){return BPromise[_0xdd67('0x25')](_0x385280);}return _0x3ba201[_0xdd67('0x26')]();};}function saveUpdates(_0x2c79bb,_0x5cd7d1){return function(_0x21f2c7){if(_0x21f2c7){return _0x21f2c7[_0xdd67('0x27')](_0x2c79bb)[_0xdd67('0x28')](function(_0x2f5da8){return _0x2f5da8;});}return null;};}function removeEntity(_0x49e802,_0x5e597d){return function(_0x5a671b){if(_0x5a671b){return _0x5a671b[_0xdd67('0x29')]()[_0xdd67('0x28')](function(){_0x49e802['status'](0xcc)[_0xdd67('0x1d')]();});}};}function handleEntityNotFound(_0x22277f,_0x228d61){return function(_0x201b82){if(!_0x201b82){_0x22277f[_0xdd67('0x1b')](0x194);}return _0x201b82;};}function handleError(_0x517d35,_0x69a726){_0x69a726=_0x69a726||0x1f4;return function(_0x4205e4){logger[_0xdd67('0x2a')](_0x4205e4['stack']);if(_0x4205e4[_0xdd67('0x2b')]){delete _0x4205e4[_0xdd67('0x2b')];}_0x517d35[_0xdd67('0x1c')](_0x69a726)[_0xdd67('0x2c')](_0x4205e4);};}exports['index']=function(_0x410941,_0x3bf23b){var _0x2071f6={},_0x4532f1={},_0x38820d={'count':0x0,'rows':[]};var _0x3fe580=_[_0xdd67('0x2d')](db[_0xdd67('0x2e')][_0xdd67('0x2f')],function(_0x4b45a4){return{'name':_0x4b45a4[_0xdd67('0x30')],'type':_0x4b45a4[_0xdd67('0x31')][_0xdd67('0x32')]};});_0x4532f1[_0xdd67('0x33')]=_['map'](_0x3fe580,_0xdd67('0x2b'));_0x4532f1[_0xdd67('0x34')]=_['keys'](_0x410941[_0xdd67('0x34')]);_0x4532f1[_0xdd67('0x35')]=_[_0xdd67('0x36')](_0x4532f1['model'],_0x4532f1['query']);_0x2071f6['attributes']=_[_0xdd67('0x36')](_0x4532f1['model'],qs['fields'](_0x410941[_0xdd67('0x34')][_0xdd67('0x37')]));_0x2071f6['attributes']=_0x2071f6[_0xdd67('0x38')][_0xdd67('0x39')]?_0x2071f6[_0xdd67('0x38')]:_0x4532f1[_0xdd67('0x33')];if(!_0x410941[_0xdd67('0x34')][_0xdd67('0x3a')](_0xdd67('0x3b'))){_0x2071f6[_0xdd67('0x1f')]=qs[_0xdd67('0x1f')](_0x410941[_0xdd67('0x34')][_0xdd67('0x1f')]);_0x2071f6[_0xdd67('0x21')]=qs[_0xdd67('0x21')](_0x410941[_0xdd67('0x34')]['offset']);}_0x2071f6[_0xdd67('0x3c')]=qs[_0xdd67('0x3d')](_0x410941[_0xdd67('0x34')]['sort']);_0x2071f6['where']=qs[_0xdd67('0x35')](_[_0xdd67('0x3e')](_0x410941[_0xdd67('0x34')],_0x4532f1[_0xdd67('0x35')]),_0x3fe580);if(_0x410941[_0xdd67('0x34')][_0xdd67('0x3f')]){_0x2071f6[_0xdd67('0x40')]=_[_0xdd67('0x41')](_0x2071f6[_0xdd67('0x40')],{'$or':_['map'](_0x3fe580,function(_0x2722fc){if(_0x2722fc['type']!==_0xdd67('0x42')){var _0x449c84={};_0x449c84[_0x2722fc[_0xdd67('0x2b')]]={'$like':'%'+_0x410941[_0xdd67('0x34')][_0xdd67('0x3f')]+'%'};return _0x449c84;}})});}_0x2071f6=_[_0xdd67('0x41')]({},_0x2071f6,_0x410941[_0xdd67('0x43')]);var _0x5b76e5={'where':_0x2071f6['where']};return db[_0xdd67('0x2e')][_0xdd67('0x20')](_0x5b76e5)[_0xdd67('0x28')](function(_0x2e18af){_0x38820d[_0xdd67('0x20')]=_0x2e18af;if(_0x410941[_0xdd67('0x34')][_0xdd67('0x44')]){_0x2071f6['include']=[{'all':!![]}];}return db[_0xdd67('0x2e')][_0xdd67('0x45')](_0x2071f6);})[_0xdd67('0x28')](function(_0x585cc8){_0x38820d[_0xdd67('0x46')]=_0x585cc8;return _0x38820d;})[_0xdd67('0x28')](respondWithFilteredResult(_0x3bf23b,_0x2071f6))['catch'](handleError(_0x3bf23b,null));};exports['show']=function(_0x28a9f5,_0xa73484){var _0x525eed={'raw':!![],'where':{'id':_0x28a9f5['params']['id']}},_0x116e05={};_0x116e05['model']=_[_0xdd67('0x47')](db[_0xdd67('0x2e')][_0xdd67('0x2f')]);_0x116e05['query']=_[_0xdd67('0x47')](_0x28a9f5[_0xdd67('0x34')]);_0x116e05[_0xdd67('0x35')]=_[_0xdd67('0x36')](_0x116e05[_0xdd67('0x33')],_0x116e05[_0xdd67('0x34')]);_0x525eed[_0xdd67('0x38')]=_[_0xdd67('0x36')](_0x116e05[_0xdd67('0x33')],qs[_0xdd67('0x37')](_0x28a9f5[_0xdd67('0x34')][_0xdd67('0x37')]));_0x525eed[_0xdd67('0x38')]=_0x525eed[_0xdd67('0x38')]['length']?_0x525eed[_0xdd67('0x38')]:_0x116e05[_0xdd67('0x33')];if(_0x28a9f5[_0xdd67('0x34')][_0xdd67('0x44')]){_0x525eed['include']=[{'all':!![]}];}_0x525eed=_[_0xdd67('0x41')]({},_0x525eed,_0x28a9f5[_0xdd67('0x43')]);return db[_0xdd67('0x2e')][_0xdd67('0x48')](_0x525eed)[_0xdd67('0x28')](handleEntityNotFound(_0xa73484,null))[_0xdd67('0x28')](respondWithResult(_0xa73484,null))[_0xdd67('0x49')](handleError(_0xa73484,null));};exports[_0xdd67('0x4a')]=function(_0x5be4d7,_0x4058ed){return db[_0xdd67('0x2e')][_0xdd67('0x4a')](_0x5be4d7['body'],{})[_0xdd67('0x28')](respondWithResult(_0x4058ed,0xc9))['catch'](handleError(_0x4058ed,null));};exports[_0xdd67('0x27')]=function(_0x214e9d,_0x111be6){if(_0x214e9d[_0xdd67('0x4b')]['id']){delete _0x214e9d[_0xdd67('0x4b')]['id'];}return db[_0xdd67('0x2e')]['find']({'where':{'id':_0x214e9d['params']['id']}})['then'](handleEntityNotFound(_0x111be6,null))['then'](saveUpdates(_0x214e9d[_0xdd67('0x4b')],null))[_0xdd67('0x28')](respondWithResult(_0x111be6,null))[_0xdd67('0x49')](handleError(_0x111be6,null));};exports[_0xdd67('0x29')]=function(_0x1c2c27,_0x35b070){return db[_0xdd67('0x2e')][_0xdd67('0x48')]({'where':{'id':_0x1c2c27['params']['id']}})['then'](handleEntityNotFound(_0x35b070,null))[_0xdd67('0x28')](removeEntity(_0x35b070,null))[_0xdd67('0x49')](handleError(_0x35b070,null));};exports[_0xdd67('0x4c')]=function(_0x51d101,_0x591798){return db[_0xdd67('0x2e')]['describe']()[_0xdd67('0x28')](respondWithResult(_0x591798,null))[_0xdd67('0x49')](handleError(_0x591798,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 2a5ea3f..0076a20 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdee5=['rimraf','exports','define','ChatTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x45715c,_0x17caa5){var _0x2141ef=function(_0x54d51c){while(--_0x54d51c){_0x45715c['push'](_0x45715c['shift']());}};_0x2141ef(++_0x17caa5);}(_0xdee5,0x191));var _0x5dee=function(_0x35027c,_0x4af623){_0x35027c=_0x35027c-0x0;var _0x4bba7d=_0xdee5[_0x35027c];return _0x4bba7d;};'use strict';var _=require('lodash');var util=require(_0x5dee('0x0'));var logger=require(_0x5dee('0x1'))(_0x5dee('0x2'));var moment=require(_0x5dee('0x3'));var BPromise=require(_0x5dee('0x4'));var rp=require(_0x5dee('0x5'));var fs=require('fs');var path=require(_0x5dee('0x6'));var rimraf=require(_0x5dee('0x7'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x5dee('0x8')]=function(_0x2eeb9e,_0x45fde0){return _0x2eeb9e[_0x5dee('0x9')](_0x5dee('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5dee('0xb'),'fields':[_0x5dee('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b7a=['api','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash','../../config/logger'];(function(_0x50b6b8,_0x35d7cb){var _0x3bf466=function(_0x26943d){while(--_0x26943d){_0x50b6b8['push'](_0x50b6b8['shift']());}};_0x3bf466(++_0x35d7cb);}(_0x9b7a,0x17a));var _0xa9b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa9b7('0x0'));var util=require('util');var logger=require(_0xa9b7('0x1'))(_0xa9b7('0x2'));var moment=require('moment');var BPromise=require(_0xa9b7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa9b7('0x4'));var config=require(_0xa9b7('0x5'));var attributes=require(_0xa9b7('0x6'));module['exports']=function(_0x95c30f,_0x2eea15){return _0x95c30f[_0xa9b7('0x7')]('ChatTransferReport',attributes,{'tableName':_0xa9b7('0x8'),'paranoid':![],'indexes':[{'name':_0xa9b7('0x9'),'fields':[_0xa9b7('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 8870f14..43f337c 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x790f=['error','code','ChatTransferReport,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x790f,0x1e5));var _0xf790=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0x790f[_0x36f47c];return _0x296c55;};'use strict';var _=require(_0xf790('0x0'));var util=require(_0xf790('0x1'));var moment=require(_0xf790('0x2'));var BPromise=require(_0xf790('0x3'));var rs=require(_0xf790('0x4'));var fs=require('fs');var Redis=require(_0xf790('0x5'));var db=require(_0xf790('0x6'))['db'];var utils=require(_0xf790('0x7'));var logger=require(_0xf790('0x8'))('rpc');var config=require(_0xf790('0x9'));var jayson=require(_0xf790('0xa'));var client=jayson[_0xf790('0xb')][_0xf790('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1befe4,_0x4b9ba5,_0x1bdc95){return new BPromise(function(_0x4e5303,_0x33c1a1){return client[_0xf790('0xd')](_0x1befe4,_0x1bdc95)[_0xf790('0xe')](function(_0x56c9ef){logger[_0xf790('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x4b9ba5,'request\x20sent');logger[_0xf790('0x10')](_0xf790('0x11'),_0x4b9ba5,'request\x20sent',JSON[_0xf790('0x12')](_0x56c9ef));if(_0x56c9ef[_0xf790('0x13')]){if(_0x56c9ef[_0xf790('0x13')][_0xf790('0x14')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4b9ba5,_0x56c9ef[_0xf790('0x13')]['message']);return _0x33c1a1(_0x56c9ef[_0xf790('0x13')]['message']);}logger[_0xf790('0x13')](_0xf790('0x15'),_0x4b9ba5,_0x56c9ef[_0xf790('0x13')]['message']);return _0x4e5303(_0x56c9ef[_0xf790('0x13')][_0xf790('0x16')]);}else{logger[_0xf790('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x4b9ba5,_0xf790('0x17'));_0x4e5303(_0x56c9ef['result'][_0xf790('0x16')]);}})['catch'](function(_0x3db6ea){logger[_0xf790('0x13')](_0xf790('0x15'),_0x4b9ba5,_0x3db6ea);_0x33c1a1(_0x3db6ea);});});}
\ No newline at end of file
+var _0xd365=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x19ae02,_0x32d426){var _0x575138=function(_0x16c94a){while(--_0x16c94a){_0x19ae02['push'](_0x19ae02['shift']());}};_0x575138(++_0x32d426);}(_0xd365,0x1e5));var _0x5d36=function(_0x3dfcf1,_0x99ca71){_0x3dfcf1=_0x3dfcf1-0x0;var _0x37867b=_0xd365[_0x3dfcf1];return _0x37867b;};'use strict';var _=require('lodash');var util=require(_0x5d36('0x0'));var moment=require(_0x5d36('0x1'));var BPromise=require(_0x5d36('0x2'));var rs=require(_0x5d36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d36('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d36('0x5'));var config=require(_0x5d36('0x6'));var jayson=require(_0x5d36('0x7'));var client=jayson[_0x5d36('0x8')][_0x5d36('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a085,_0x498f68,_0x386b4d){return new BPromise(function(_0x56ce51,_0x4f0095){return client[_0x5d36('0xa')](_0x35a085,_0x386b4d)[_0x5d36('0xb')](function(_0xafdb60){logger[_0x5d36('0xc')](_0x5d36('0xd'),_0x498f68,_0x5d36('0xe'));logger['debug'](_0x5d36('0xf'),_0x498f68,_0x5d36('0xe'),JSON['stringify'](_0xafdb60));if(_0xafdb60[_0x5d36('0x10')]){if(_0xafdb60[_0x5d36('0x10')][_0x5d36('0x11')]===0x1f4){logger[_0x5d36('0x10')](_0x5d36('0xd'),_0x498f68,_0xafdb60[_0x5d36('0x10')][_0x5d36('0x12')]);return _0x4f0095(_0xafdb60[_0x5d36('0x10')][_0x5d36('0x12')]);}logger[_0x5d36('0x10')](_0x5d36('0xd'),_0x498f68,_0xafdb60[_0x5d36('0x10')]['message']);return _0x56ce51(_0xafdb60[_0x5d36('0x10')][_0x5d36('0x12')]);}else{logger['info'](_0x5d36('0xd'),_0x498f68,_0x5d36('0xe'));_0x56ce51(_0xafdb60[_0x5d36('0x13')][_0x5d36('0x12')]);}})[_0x5d36('0x14')](function(_0x3b9292){logger[_0x5d36('0x10')](_0x5d36('0xd'),_0x498f68,_0x3b9292);_0x4f0095(_0x3b9292);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 8b83542..99b9e87 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x46b1=['get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46b1,0x9a));var _0x146b=function(_0x4d672c,_0x15a6e0){_0x4d672c=_0x4d672c-0x0;var _0x22dc61=_0x46b1[_0x4d672c];return _0x22dc61;};'use strict';var multer=require(_0x146b('0x0'));var util=require(_0x146b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x146b('0x2'));var router=express[_0x146b('0x3')]();var fs_extra=require(_0x146b('0x4'));var auth=require(_0x146b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x146b('0x6'));var controller=require(_0x146b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x146b('0x8')](_0x146b('0x9'),auth[_0x146b('0xa')](),controller[_0x146b('0xb')]);router['get'](_0x146b('0xc'),auth[_0x146b('0xa')](),controller['show']);router[_0x146b('0xd')]('/',auth[_0x146b('0xa')](),controller[_0x146b('0xe')]);router[_0x146b('0xf')]('/:id',auth[_0x146b('0xa')](),controller['update']);router[_0x146b('0x10')](_0x146b('0xc'),auth[_0x146b('0xa')](),controller['destroy']);module[_0x146b('0x11')]=router;
\ No newline at end of file
+var _0x4dc8=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','destroy','exports'];(function(_0x3eda5d,_0x2320c4){var _0x5cdebc=function(_0x1de022){while(--_0x1de022){_0x3eda5d['push'](_0x3eda5d['shift']());}};_0x5cdebc(++_0x2320c4);}(_0x4dc8,0x143));var _0x84dc=function(_0xd498a,_0x1be1b9){_0xd498a=_0xd498a-0x0;var _0x3e802e=_0x4dc8[_0xd498a];return _0x3e802e;};'use strict';var multer=require(_0x84dc('0x0'));var util=require('util');var path=require(_0x84dc('0x1'));var timeout=require('connect-timeout');var express=require(_0x84dc('0x2'));var router=express[_0x84dc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x84dc('0x4'));var interaction=require(_0x84dc('0x5'));var config=require(_0x84dc('0x6'));var controller=require('./chatTransferReport.controller');router[_0x84dc('0x7')]('/',auth[_0x84dc('0x8')](),controller[_0x84dc('0x9')]);router[_0x84dc('0x7')]('/describe',auth[_0x84dc('0x8')](),controller[_0x84dc('0xa')]);router[_0x84dc('0x7')]('/:id',auth[_0x84dc('0x8')](),controller[_0x84dc('0xb')]);router[_0x84dc('0xc')]('/',auth['isAuthenticated'](),controller[_0x84dc('0xd')]);router[_0x84dc('0xe')]('/:id',auth[_0x84dc('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x84dc('0xf')]);module[_0x84dc('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 9e13544..7c83317 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x99e9=['System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x366ef2,_0x16e62f){var _0x51a5f3=function(_0x2d32ea){while(--_0x2d32ea){_0x366ef2['push'](_0x366ef2['shift']());}};_0x51a5f3(++_0x16e62f);}(_0x99e9,0xb4));var _0x999e=function(_0x57a50d,_0x2871f8){_0x57a50d=_0x57a50d-0x0;var _0x1b25b3=_0x99e9[_0x57a50d];return _0x1b25b3;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x999e('0x0'));module[_0x999e('0x1')]={'name':{'type':Sequelize[_0x999e('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x999e('0x2')]},'mapKey':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x4')},'customerAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x999e('0x2')]},'animation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x999e('0x9')](_0x999e('0xa'),_0x999e('0xb')),'defaultValue':_0x999e('0xa')},'header_online':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xc')},'start_chat_button':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0xf')},'download_transcript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x999e('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x13')},'noteTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x999e('0x15')},'closingMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'skipMessageButton':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'conditionAgreement':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x17')},'ratingType':{'type':Sequelize['ENUM'](_0x999e('0x18'),_0x999e('0x19')),'defaultValue':_0x999e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x999e('0x1c'),'helpText':''}},{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':_0x999e('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x999e('0x1d')](_0x999e('0x1e'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')]('onlineForm')):{};},'set':function(_0x2e1cc5){return this[_0x999e('0x20')](_0x999e('0x1e'),JSON[_0x999e('0x1a')](_0x2e1cc5));}},'offlineForm':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return JSON[_0x999e('0x1a')]({'items':[{'type':_0x999e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x999e('0x3'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':_0x999e('0x21')},'props':{'title':_0x999e('0x21'),'helpText':_0x999e('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x999e('0x23'))?JSON[_0x999e('0x1f')](this[_0x999e('0x1d')](_0x999e('0x23'))):{};},'set':function(_0x15dca1){return this[_0x999e('0x20')](_0x999e('0x23'),JSON[_0x999e('0x1a')](_0x15dca1));}},'token':{'type':Sequelize[_0x999e('0x2')],'defaultValue':function(){return rs[_0x999e('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x999e('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x999e('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x16')},'sendUnmanaged':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x999e('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x999e('0x2')]},'notificationTemplate':{'type':Sequelize[_0x999e('0x11')],'defaultValue':function(){return _0x999e('0x27');}},'notificationSound':{'type':Sequelize[_0x999e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x999e('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x999e('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x999e('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x999e('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x999e('0x2')],'defaultValue':_0x999e('0x28')},'systemAvatar':{'type':Sequelize[_0x999e('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x999e('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'comment':_0x999e('0x29'),'set':function(_0x1e1229){if(!_0x1e1229)this[_0x999e('0x20')]('mandatoryDispositionPauseId',null);this[_0x999e('0x20')]('mandatoryDisposition',_0x1e1229);}},'vidaooEscalation':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x999e('0x2')]},'vidaooTopic':{'type':Sequelize[_0x999e('0x2')],'allowNull':![],'defaultValue':_0x999e('0x2a')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x999e('0x2b');}},'vidaooMetadata':{'type':Sequelize[_0x999e('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x999e('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0x1ed8c3,_0x169ba1){_0x1ed8c3=_0x1ed8c3-0x0;var _0x1b71ab=_0x2750[_0x1ed8c3];return _0x1b71ab;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4292fe1..cad9f22 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfa7f=['redis','defaults','localhost','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','update','destroy','get','ChatWebsites','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','Pause','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','hasOwnProperty','findAll','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','Sequelize','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','List','Contacts','DESC','Applications','account','list','applications','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','spread','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','bluebird','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x2e1e9f,_0x294546){var _0x1d79f5=function(_0x5fdcf5){while(--_0x5fdcf5){_0x2e1e9f['push'](_0x2e1e9f['shift']());}};_0x1d79f5(++_0x294546);}(_0xfa7f,0x11d));var _0xffa7=function(_0x143f75,_0x290630){_0x143f75=_0x143f75-0x0;var _0x56c94f=_0xfa7f[_0x143f75];return _0x56c94f;};'use strict';var BPromise=require(_0xffa7('0x0'));var Mustache=require(_0xffa7('0x1'));var util=require(_0xffa7('0x2'));var path=require(_0xffa7('0x3'));var ejs=require(_0xffa7('0x4'));var fs=require('fs');var fs_extra=require(_0xffa7('0x5'));var _=require(_0xffa7('0x6'));var querystring=require(_0xffa7('0x7'));var Redis=require(_0xffa7('0x8'));var qs=require(_0xffa7('0x9'));var logger=require(_0xffa7('0xa'))(_0xffa7('0xb'));var config=require(_0xffa7('0xc'));var db=require('../../mysqldb')['db'];config[_0xffa7('0xd')]=_[_0xffa7('0xe')](config['redis'],{'host':_0xffa7('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xffa7('0xd')]));require(_0xffa7('0x10'))['register'](socket);var htmlToText=require(_0xffa7('0x11'));var jayson=require(_0xffa7('0x12'));var client=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x232c});var client9002=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x232a});var client9003=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x232b});var client9001=jayson[_0xffa7('0x13')][_0xffa7('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x299911,_0x5c6457,_0x1fa5d2,_0x32ed18){return new BPromise(function(_0x2912fa,_0x426ac3){var _0x1884cd=_0x32ed18||client;return _0x1884cd[_0xffa7('0x15')](_0x299911,_0x1fa5d2)[_0xffa7('0x16')](function(_0x248cb){logger[_0xffa7('0x17')](_0xffa7('0x18'),_0x5c6457,_0xffa7('0x19'));logger[_0xffa7('0x1a')](_0xffa7('0x1b'),_0x5c6457,'request\x20sent',JSON['stringify'](_0x248cb));if(_0x248cb[_0xffa7('0x1c')]){if(_0x248cb[_0xffa7('0x1c')][_0xffa7('0x1d')]===0x1f4){logger[_0xffa7('0x1c')](_0xffa7('0x18'),_0x5c6457,_0x248cb[_0xffa7('0x1c')]['message']);return _0x426ac3(_0x248cb['error'][_0xffa7('0x1e')]);}logger[_0xffa7('0x1c')]('ChatWebsite,\x20%s,\x20%s',_0x5c6457,_0x248cb[_0xffa7('0x1c')][_0xffa7('0x1e')]);return _0x2912fa(_0x248cb[_0xffa7('0x1c')][_0xffa7('0x1e')]);}else{logger[_0xffa7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5c6457,_0xffa7('0x19'));_0x2912fa(_0x248cb['result'][_0xffa7('0x1e')]);}})[_0xffa7('0x1f')](function(_0x5b4b33){logger[_0xffa7('0x1c')](_0xffa7('0x18'),_0x5c6457,_0x5b4b33);_0x426ac3(_0x5b4b33);});});}function respondWithStatusCode(_0xf9051,_0x205674){_0x205674=_0x205674||0xcc;return function(_0x4520fe){if(_0x4520fe){return _0xf9051[_0xffa7('0x20')](_0x205674);}return _0xf9051['status'](_0x205674)[_0xffa7('0x21')]();};}function respondWithResult(_0x17006e,_0x21171f){_0x21171f=_0x21171f||0xc8;return function(_0x3b3581){if(_0x3b3581){return _0x17006e[_0xffa7('0x22')](_0x21171f)['json'](_0x3b3581);}};}function respondWithFilteredResult(_0x5cd2ee,_0x4996f1){return function(_0x1fce85){if(_0x1fce85){var _0xe2552b=typeof _0x4996f1['offset']===_0xffa7('0x23')&&typeof _0x4996f1[_0xffa7('0x24')]===_0xffa7('0x23');var _0x5225b4=_0x1fce85[_0xffa7('0x25')];var _0x5042b4=_0xe2552b?0x0:_0x4996f1[_0xffa7('0x26')];var _0x52b757=_0xe2552b?_0x1fce85[_0xffa7('0x25')]:_0x4996f1['offset']+_0x4996f1[_0xffa7('0x24')];var _0x30f24d;if(_0x52b757>=_0x5225b4){_0x52b757=_0x5225b4;_0x30f24d=0xc8;}else{_0x30f24d=0xce;}_0x5cd2ee[_0xffa7('0x22')](_0x30f24d);return _0x5cd2ee[_0xffa7('0x27')](_0xffa7('0x28'),_0x5042b4+'-'+_0x52b757+'/'+_0x5225b4)[_0xffa7('0x29')](_0x1fce85);}return null;};}function saveUpdates(_0x374e82){return function(_0x28e4f0){if(_0x28e4f0){return _0x28e4f0[_0xffa7('0x2a')](_0x374e82)['then'](function(_0x2ec522){return _0x2ec522;});}return null;};}function removeEntity(_0x16f27e){return function(_0x167648){if(_0x167648){return _0x167648[_0xffa7('0x2b')]()[_0xffa7('0x16')](function(){var _0x3fa0f6=_0x167648[_0xffa7('0x2c')]({'plain':!![]});var _0x36f5fc=_0xffa7('0x2d');return db['UserProfileResource'][_0xffa7('0x2b')]({'where':{'type':_0x36f5fc,'resourceId':_0x3fa0f6['id']}})['then'](function(){return _0x167648;});})['then'](function(){_0x16f27e[_0xffa7('0x22')](0xcc)[_0xffa7('0x21')]();});}};}function handleEntityNotFound(_0x3b808a){return function(_0x357790){if(!_0x357790){_0x3b808a[_0xffa7('0x20')](0x194);}return _0x357790;};}function handleError(_0x586bcd,_0x43e413){_0x43e413=_0x43e413||0x1f4;return function(_0x2430e0){logger[_0xffa7('0x1c')](_0x2430e0[_0xffa7('0x2e')]);if(_0x2430e0[_0xffa7('0x2f')]){delete _0x2430e0[_0xffa7('0x2f')];}_0x586bcd[_0xffa7('0x22')](_0x43e413)[_0xffa7('0x30')](_0x2430e0);};}exports[_0xffa7('0x31')]=function(_0x5c2bd6,_0x582286){var _0x416dc9={'include':[{'model':db['Pause'],'as':_0xffa7('0x32')}]},_0x5b7dce={},_0x5aa95b={'count':0x0,'rows':[]};var _0x58e32a=_[_0xffa7('0x33')](db[_0xffa7('0x34')][_0xffa7('0x35')],function(_0x1203f1){return{'name':_0x1203f1[_0xffa7('0x36')],'type':_0x1203f1[_0xffa7('0x37')][_0xffa7('0x38')]};});_0x5b7dce[_0xffa7('0x39')]=_[_0xffa7('0x33')](_0x58e32a,_0xffa7('0x2f'));_0x5b7dce['query']=_['keys'](_0x5c2bd6[_0xffa7('0x3a')]);_0x5b7dce[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x5b7dce[_0xffa7('0x39')],_0x5b7dce[_0xffa7('0x3a')]);_0x416dc9[_0xffa7('0x3d')]=_[_0xffa7('0x3c')](_0x5b7dce[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x5c2bd6['query'][_0xffa7('0x3e')]));_0x416dc9['attributes']=_0x416dc9[_0xffa7('0x3d')]['length']?_0x416dc9[_0xffa7('0x3d')]:_0x5b7dce[_0xffa7('0x39')];if(!_0x5c2bd6[_0xffa7('0x3a')]['hasOwnProperty'](_0xffa7('0x3f'))){_0x416dc9['limit']=qs[_0xffa7('0x24')](_0x5c2bd6[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x416dc9['offset']=qs[_0xffa7('0x26')](_0x5c2bd6[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x416dc9[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x5c2bd6['query'][_0xffa7('0x41')]);_0x416dc9[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x5c2bd6[_0xffa7('0x3a')],_0x5b7dce[_0xffa7('0x3b')]),_0x58e32a);if(_0x5c2bd6[_0xffa7('0x3a')]['filter']){_0x416dc9[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x416dc9[_0xffa7('0x42')],{'$or':_['map'](_0x58e32a,function(_0x357fe6){if(_0x357fe6[_0xffa7('0x37')]!==_0xffa7('0x45')){var _0x1d1927={};_0x1d1927[_0x357fe6[_0xffa7('0x2f')]]={'$like':'%'+_0x5c2bd6[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x1d1927;}})});}_0x416dc9=_[_0xffa7('0x44')]({},_0x416dc9,_0x5c2bd6[_0xffa7('0x47')]);var _0x408a19={'where':_0x416dc9[_0xffa7('0x42')]};return db['ChatWebsite'][_0xffa7('0x25')](_0x408a19)[_0xffa7('0x16')](function(_0x18150f){_0x5aa95b[_0xffa7('0x25')]=_0x18150f;if(_0x5c2bd6['query'][_0xffa7('0x48')]){_0x416dc9[_0xffa7('0x49')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x416dc9);})[_0xffa7('0x16')](function(_0x57e060){_0x5aa95b[_0xffa7('0x4a')]=_0x57e060;return _0x5aa95b;})[_0xffa7('0x16')](respondWithFilteredResult(_0x582286,_0x416dc9))[_0xffa7('0x1f')](handleError(_0x582286,null));};exports[_0xffa7('0x4b')]=function(_0x20baaf,_0x33743e){var _0x4a1a63={'raw':![],'where':{'id':_0x20baaf[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x4d')],'as':_0xffa7('0x32')}]},_0x5a764d={};_0x5a764d['model']=_[_0xffa7('0x4e')](db[_0xffa7('0x34')][_0xffa7('0x35')]);_0x5a764d['query']=_[_0xffa7('0x4e')](_0x20baaf[_0xffa7('0x3a')]);_0x5a764d[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x5a764d[_0xffa7('0x39')],_0x5a764d['query']);_0x4a1a63['attributes']=_[_0xffa7('0x3c')](_0x5a764d[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x20baaf[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x4a1a63[_0xffa7('0x3d')]=_0x4a1a63[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x4a1a63['attributes']:_0x5a764d[_0xffa7('0x39')];if(_0x20baaf[_0xffa7('0x3a')][_0xffa7('0x48')]){_0x4a1a63['include']=[{'all':!![]}];}_0x4a1a63=_[_0xffa7('0x44')]({},_0x4a1a63,_0x20baaf[_0xffa7('0x47')]);return db[_0xffa7('0x34')]['find'](_0x4a1a63)['then'](handleEntityNotFound(_0x33743e,null))['then'](respondWithResult(_0x33743e,null))['catch'](handleError(_0x33743e,null));};exports[_0xffa7('0x50')]=function(_0x5c20d6,_0x271b8e){return db[_0xffa7('0x34')][_0xffa7('0x50')](_0x5c20d6[_0xffa7('0x51')],{})[_0xffa7('0x16')](function(_0x597ecd){var _0x535fac=_0x5c20d6[_0xffa7('0x52')][_0xffa7('0x2c')]({'plain':!![]});if(!_0x535fac)throw new Error(_0xffa7('0x53'));if(_0x535fac[_0xffa7('0x54')]===_0xffa7('0x52')){var _0x51cbd8=_0x597ecd[_0xffa7('0x2c')]({'plain':!![]});var _0x1d19d7='ChatWebsites';return db[_0xffa7('0x55')][_0xffa7('0x56')]({'where':{'name':_0x1d19d7,'userProfileId':_0x535fac[_0xffa7('0x57')]},'raw':!![]})[_0xffa7('0x16')](function(_0x174d89){if(_0x174d89&&_0x174d89[_0xffa7('0x58')]===0x0){return db['UserProfileResource'][_0xffa7('0x50')]({'name':_0x51cbd8[_0xffa7('0x2f')],'resourceId':_0x51cbd8['id'],'type':_0x174d89[_0xffa7('0x2f')],'sectionId':_0x174d89['id']},{})['then'](function(){return _0x597ecd;});}else{return _0x597ecd;}})['catch'](function(_0x2c12da){logger[_0xffa7('0x1c')](_0xffa7('0x59'),_0x2c12da);throw _0x2c12da;});}return _0x597ecd;})[_0xffa7('0x16')](respondWithResult(_0x271b8e,0xc9))['catch'](handleError(_0x271b8e,null));};exports[_0xffa7('0x2a')]=function(_0x5c18e5,_0x515c84){if(_0x5c18e5[_0xffa7('0x51')]['id']){delete _0x5c18e5['body']['id'];}return db['ChatWebsite'][_0xffa7('0x56')]({'where':{'id':_0x5c18e5[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x4d')],'as':_0xffa7('0x32')}]})['then'](handleEntityNotFound(_0x515c84,null))[_0xffa7('0x16')](saveUpdates(_0x5c18e5[_0xffa7('0x51')],null))[_0xffa7('0x16')](respondWithResult(_0x515c84,null))[_0xffa7('0x1f')](handleError(_0x515c84,null));};exports[_0xffa7('0x2b')]=function(_0x20f98f,_0x4ab2f7){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x20f98f[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ab2f7,null))[_0xffa7('0x16')](removeEntity(_0x4ab2f7,null))['catch'](handleError(_0x4ab2f7,null));};exports[_0xffa7('0x5a')]=function(_0x2f27c4,_0x2df5be){return db[_0xffa7('0x34')][_0xffa7('0x5a')]()[_0xffa7('0x16')](respondWithResult(_0x2df5be,null))['catch'](handleError(_0x2df5be,null));};exports[_0xffa7('0x5b')]=function(_0x3da240,_0xbed77b){if(_0x3da240[_0xffa7('0x51')]['id']){delete _0x3da240[_0xffa7('0x51')]['id'];}return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x3da240[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0xbed77b,null))[_0xffa7('0x16')](function(_0x3b55d7){if(_0x3b55d7){_0x3da240[_0xffa7('0x51')][_0xffa7('0x5c')]=_0x3b55d7['id'];return db[_0xffa7('0x5d')][_0xffa7('0x50')](_0x3da240[_0xffa7('0x51')]);}})['then'](respondWithResult(_0xbed77b,null))[_0xffa7('0x1f')](handleError(_0xbed77b,null));};exports['getDispositions']=function(_0x1ae3d4,_0x101121){var _0x423aad={'raw':![],'where':{}};var _0x3a930f={};var _0x284fd7={'count':0x0,'rows':[]};return db[_0xffa7('0x34')]['findOne']({'where':{'id':_0x1ae3d4['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x101121,null))[_0xffa7('0x16')](function(_0x1d474f){if(_0x1d474f){_0x3a930f[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x5d')]['rawAttributes']);_0x3a930f['query']=_[_0xffa7('0x4e')](_0x1ae3d4[_0xffa7('0x3a')]);_0x3a930f[_0xffa7('0x3b')]=_['intersection'](_0x3a930f[_0xffa7('0x39')],_0x3a930f[_0xffa7('0x3a')]);_0x423aad[_0xffa7('0x3d')]=_['intersection'](_0x3a930f[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x1ae3d4['query'][_0xffa7('0x3e')]));_0x423aad[_0xffa7('0x3d')]=_0x423aad['attributes'][_0xffa7('0x4f')]?_0x423aad[_0xffa7('0x3d')]:_0x3a930f['model'];if(!_0x1ae3d4['query']['hasOwnProperty']('nolimit')){_0x423aad['limit']=qs[_0xffa7('0x24')](_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x423aad[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x423aad['order']=qs['sort'](_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x423aad[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x1ae3d4[_0xffa7('0x3a')],_0x3a930f['filters']));_0x423aad['where'][_0xffa7('0x5c')]=_0x1d474f['id'];if(_0x1ae3d4[_0xffa7('0x3a')]['filter']){_0x423aad[_0xffa7('0x42')]=_['merge'](_0x423aad[_0xffa7('0x42')],{'$or':_['map'](_0x423aad['attributes'],function(_0x406f34){var _0x187134={};_0x187134[_0x406f34]={'$like':'%'+_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x187134;})});}_0x423aad=_[_0xffa7('0x44')]({},_0x423aad,_0x1ae3d4[_0xffa7('0x47')]);return db[_0xffa7('0x5d')]['count']({'where':_0x423aad[_0xffa7('0x42')]})[_0xffa7('0x16')](function(_0x9fcbfc){_0x284fd7['count']=_0x9fcbfc;if(_0x1ae3d4[_0xffa7('0x3a')][_0xffa7('0x48')]){_0x423aad[_0xffa7('0x49')]=[{'all':!![]}];}return db[_0xffa7('0x5d')]['findAll'](_0x423aad);})[_0xffa7('0x16')](function(_0x2734e1){_0x284fd7['rows']=_0x2734e1;return _0x284fd7;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x101121,_0x423aad))[_0xffa7('0x1f')](handleError(_0x101121,null));};exports[_0xffa7('0x5e')]=function(_0x2d90d5,_0x925c44){return db[_0xffa7('0x34')]['find']({'where':{'id':_0x2d90d5[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x925c44,null))[_0xffa7('0x16')](function(_0x56dacc){if(_0x56dacc){return _0x56dacc[_0xffa7('0x5e')](_0x2d90d5[_0xffa7('0x3a')][_0xffa7('0x5f')]);}})[_0xffa7('0x16')](respondWithStatusCode(_0x925c44,null))[_0xffa7('0x1f')](handleError(_0x925c44,null));};exports['addAnswer']=function(_0x3f340f,_0x16febd){if(_0x3f340f[_0xffa7('0x51')]['id']){delete _0x3f340f['body']['id'];}return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x3f340f[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x16febd,null))[_0xffa7('0x16')](function(_0x1095c1){if(_0x1095c1){_0x3f340f[_0xffa7('0x51')][_0xffa7('0x5c')]=_0x1095c1['id'];return db[_0xffa7('0x60')][_0xffa7('0x50')](_0x3f340f[_0xffa7('0x51')]);}})[_0xffa7('0x16')](respondWithResult(_0x16febd,null))[_0xffa7('0x1f')](handleError(_0x16febd,null));};exports[_0xffa7('0x61')]=function(_0x59f872,_0x231c4d){var _0x71406e={'raw':![],'where':{}};var _0x54869f={};var _0x58027a={'count':0x0,'rows':[]};return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x59f872['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x231c4d,null))[_0xffa7('0x16')](function(_0x44f8d4){if(_0x44f8d4){_0x54869f[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db['CannedAnswer'][_0xffa7('0x35')]);_0x54869f[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x59f872[_0xffa7('0x3a')]);_0x54869f[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x54869f[_0xffa7('0x39')],_0x54869f[_0xffa7('0x3a')]);_0x71406e[_0xffa7('0x3d')]=_[_0xffa7('0x3c')](_0x54869f[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x59f872[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x71406e[_0xffa7('0x3d')]=_0x71406e[_0xffa7('0x3d')]['length']?_0x71406e[_0xffa7('0x3d')]:_0x54869f[_0xffa7('0x39')];if(!_0x59f872[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x71406e[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x59f872['query'][_0xffa7('0x24')]);_0x71406e[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x59f872['query'][_0xffa7('0x26')]);}_0x71406e[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x59f872['query']['sort']);_0x71406e[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x59f872[_0xffa7('0x3a')],_0x54869f[_0xffa7('0x3b')]));_0x71406e['where'][_0xffa7('0x5c')]=_0x44f8d4['id'];if(_0x59f872[_0xffa7('0x3a')][_0xffa7('0x46')]){_0x71406e[_0xffa7('0x42')]=_['merge'](_0x71406e[_0xffa7('0x42')],{'$or':_[_0xffa7('0x33')](_0x71406e[_0xffa7('0x3d')],function(_0x193eba){var _0x38b94e={};_0x38b94e[_0x193eba]={'$like':'%'+_0x59f872[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x38b94e;})});}_0x71406e=_[_0xffa7('0x44')]({},_0x71406e,_0x59f872['options']);return db[_0xffa7('0x60')][_0xffa7('0x25')]({'where':_0x71406e[_0xffa7('0x42')]})[_0xffa7('0x16')](function(_0x27e76c){_0x58027a['count']=_0x27e76c;if(_0x59f872['query'][_0xffa7('0x48')]){_0x71406e[_0xffa7('0x49')]=[{'all':!![]}];}return db['CannedAnswer'][_0xffa7('0x64')](_0x71406e);})[_0xffa7('0x16')](function(_0x1634f6){_0x58027a[_0xffa7('0x4a')]=_0x1634f6;return _0x58027a;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x231c4d,_0x71406e))[_0xffa7('0x1f')](handleError(_0x231c4d,null));};exports[_0xffa7('0x65')]=function(_0x49aa0c,_0x3afdfe){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x49aa0c['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x3afdfe,null))[_0xffa7('0x16')](function(_0x362bfc){if(_0x362bfc){return _0x362bfc['removeAnswers'](_0x49aa0c[_0xffa7('0x3a')][_0xffa7('0x5f')]);}})[_0xffa7('0x16')](respondWithStatusCode(_0x3afdfe,null))['catch'](handleError(_0x3afdfe,null));};exports[_0xffa7('0x66')]=function(_0x5ec0b7,_0x5a60eb){_0x5ec0b7['body'][_0xffa7('0x67')]=_0x5ec0b7[_0xffa7('0x68')][_0xffa7('0x69')];return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x5ec0b7[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x5a60eb,null))['then'](saveUpdates(_0x5ec0b7['body'],null))[_0xffa7('0x16')](respondWithResult(_0x5a60eb,null))[_0xffa7('0x1f')](handleError(_0x5a60eb,null));};exports['addAvatar']=function(_0x25419a,_0x3d8a9f){_0x25419a['body']['agentAvatar']=_0x25419a[_0xffa7('0x68')][_0xffa7('0x69')];return db['ChatWebsite'][_0xffa7('0x56')]({'where':{'id':_0x25419a[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x3d8a9f,null))[_0xffa7('0x16')](saveUpdates(_0x25419a[_0xffa7('0x51')],null))[_0xffa7('0x16')](respondWithResult(_0x3d8a9f,null))[_0xffa7('0x1f')](handleError(_0x3d8a9f,null));};exports[_0xffa7('0x6a')]=function(_0x4cb1bf,_0x5805e9){_0x4cb1bf[_0xffa7('0x51')][_0xffa7('0x6b')]=_0x4cb1bf['file'][_0xffa7('0x69')];return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x4cb1bf[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x5805e9,null))['then'](saveUpdates(_0x4cb1bf['body'],null))[_0xffa7('0x16')](respondWithResult(_0x5805e9,null))[_0xffa7('0x1f')](handleError(_0x5805e9,null));};exports[_0xffa7('0x6c')]=function(_0x35ff56,_0x329805){_0x35ff56[_0xffa7('0x51')][_0xffa7('0x6d')]=_0x35ff56[_0xffa7('0x68')][_0xffa7('0x69')];return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x35ff56[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x329805,null))[_0xffa7('0x16')](saveUpdates(_0x35ff56[_0xffa7('0x51')],null))[_0xffa7('0x16')](respondWithResult(_0x329805,null))[_0xffa7('0x1f')](handleError(_0x329805,null));};exports[_0xffa7('0x6e')]=function(_0x5db9f0,_0x218d4e){var _0x263799=path['join'](config[_0xffa7('0x6f')],'server/files/images/logos/default_logo.svg');var _0x1da094={'where':{'id':_0x5db9f0[_0xffa7('0x4c')]['id']},'attributes':['id',_0xffa7('0x67')],'raw':!![]};var _0x91ef40=![];return require(_0xffa7('0x70'))[_0xffa7('0x71')]()['then'](function(_0x485f90){if(_0x485f90){_0x91ef40=_0x485f90[_0xffa7('0x72')];}})[_0xffa7('0x16')](function(){return db[_0xffa7('0x34')]['find'](_0x1da094);})[_0xffa7('0x16')](handleEntityNotFound(_0x218d4e,null))[_0xffa7('0x16')](function(_0x54bfab){if(_0x54bfab){if(!_['isNil'](_0x54bfab[_0xffa7('0x67')])){if(fs[_0xffa7('0x73')](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x75'),_0x54bfab[_0xffa7('0x67')]))&&_0x91ef40){_0x263799=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],'server/files/images/logos/',_0x54bfab[_0xffa7('0x67')]);}}return _0x218d4e[_0xffa7('0x76')](_0x263799);}})[_0xffa7('0x1f')](handleError(_0x218d4e,null));};exports[_0xffa7('0x77')]=function(_0x5e9767,_0x48f3a4){var _0x861f8a=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x78'));var _0x32c84f={'where':{'id':_0x5e9767[_0xffa7('0x4c')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xffa7('0x34')][_0xffa7('0x56')](_0x32c84f)[_0xffa7('0x16')](handleEntityNotFound(_0x48f3a4,null))[_0xffa7('0x16')](function(_0x58c043){if(_0x58c043){if(!_[_0xffa7('0x79')](_0x58c043[_0xffa7('0x7a')])){if(fs[_0xffa7('0x73')](path['join'](config['root'],_0xffa7('0x7b'),_0x58c043['agentAvatar']))){_0x861f8a=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],'server/files/images/avatars/',_0x58c043[_0xffa7('0x7a')]);}}return _0x48f3a4['download'](_0x861f8a);}})[_0xffa7('0x1f')](handleError(_0x48f3a4,null));};exports[_0xffa7('0x7c')]=function(_0x150d07,_0x47467a){var _0x2c6995=path[_0xffa7('0x74')](config['root'],_0xffa7('0x7d'));var _0x25f0c6={'where':{'id':_0x150d07[_0xffa7('0x4c')]['id']},'attributes':['id',_0xffa7('0x6b'),_0xffa7('0x7e')],'raw':!![]};return db[_0xffa7('0x34')][_0xffa7('0x56')](_0x25f0c6)[_0xffa7('0x16')](handleEntityNotFound(_0x47467a,null))[_0xffa7('0x16')](function(_0x438011){if(_0x438011){if(!_[_0xffa7('0x79')](_0x438011[_0xffa7('0x6b')])){if(fs[_0xffa7('0x73')](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x7b'),_0x438011['customerAvatar']))&&_0x438011['showCustomerAvatar']){_0x2c6995=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x7b'),_0x438011[_0xffa7('0x6b')]);}}return _0x47467a[_0xffa7('0x76')](_0x2c6995);}})[_0xffa7('0x1f')](handleError(_0x47467a,null));};exports['getSystemAvatar']=function(_0x198c9e,_0x1454eb){var _0x5f4e67=path[_0xffa7('0x74')](config[_0xffa7('0x6f')],'server/files/images/avatars/system_avatar.png');var _0x13ae2e={'where':{'id':_0x198c9e['params']['id']},'attributes':['id',_0xffa7('0x6d')],'raw':!![]};return db[_0xffa7('0x34')][_0xffa7('0x56')](_0x13ae2e)[_0xffa7('0x16')](handleEntityNotFound(_0x1454eb,null))['then'](function(_0x23fbd4){if(_0x23fbd4){if(!_[_0xffa7('0x79')](_0x23fbd4[_0xffa7('0x6d')])){if(fs[_0xffa7('0x73')](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0x7b'),_0x23fbd4[_0xffa7('0x6d')]))){_0x5f4e67=path[_0xffa7('0x74')](config['root'],'server/files/images/avatars/',_0x23fbd4[_0xffa7('0x6d')]);}}return _0x1454eb[_0xffa7('0x76')](_0x5f4e67);}})[_0xffa7('0x1f')](handleError(_0x1454eb,null));};exports[_0xffa7('0x7f')]=function(_0x5a9740,_0xb57c69){var _0xed1d4b=require(_0xffa7('0x80'));var _0x5bd065=new _0xed1d4b();var _0x3adb7d=_0x5bd065[_0xffa7('0x81')](_0x5a9740[_0xffa7('0x82')]['user-agent'])[_0xffa7('0x83')]();var _0x58f548={'body':_0x5a9740[_0xffa7('0x51')],'channel':_0xffa7('0x84')};var _0x5e01fb=[];var _0x1dd448=[];var _0x1406ae={};var _0x5c456d=![];return db[_0xffa7('0x85')]['describe']()[_0xffa7('0x16')](function(_0x321262){if(!_0x321262){throw new db[(_0xffa7('0x86'))]['ValidationError']('no\x20available\x20attributes');}_0x5e01fb=_['difference'](_[_0xffa7('0x4e')](_0x321262),[_0xffa7('0x87'),_0xffa7('0x88')]);_0x1dd448=_['difference'](_[_0xffa7('0x4e')](_0x321262),['createdAt',_0xffa7('0x88'),_0xffa7('0x89'),_0xffa7('0x8a')]);if(_0x5a9740[_0xffa7('0x51')]['id']){delete _0x5a9740[_0xffa7('0x51')]['id'];}if(_['isNil'](_0x5a9740[_0xffa7('0x51')][_0xffa7('0x8b')])){throw new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0x8d'));}if(_[_0xffa7('0x79')](_0x5a9740['body'][_0xffa7('0x51')])||_0x5a9740[_0xffa7('0x51')][_0xffa7('0x51')]===''){throw new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0x8e'));}if(_['isNil'](_0x5a9740[_0xffa7('0x51')]['mapKey'])){throw new db['Sequelize'][(_0xffa7('0x8c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dd448);}if(!_[_0xffa7('0x8f')](_0x1dd448,_0x5a9740['body'][_0xffa7('0x90')])){throw new db['Sequelize'][(_0xffa7('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1dd448);}_0x1406ae[_0x5a9740[_0xffa7('0x51')][_0xffa7('0x90')]]=_0x5a9740[_0xffa7('0x51')][_0xffa7('0x8b')];})[_0xffa7('0x16')](function(){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x5a9740[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x91')],'as':_0xffa7('0x92'),'include':[{'model':db[_0xffa7('0x85')],'as':_0xffa7('0x93'),'where':_0x1406ae,'limit':0x1,'order':[[_0xffa7('0x88'),_0xffa7('0x94')]]}]},{'model':db['ChatApplication'],'as':_0xffa7('0x95')}]});})['then'](handleEntityNotFound(_0xb57c69,null))['then'](function(_0x3a7b37){if(_0x3a7b37&&_0x3a7b37['List']){_0x58f548[_0xffa7('0x96')]=_0x3a7b37;_0x58f548['applications']=_0x3a7b37[_0xffa7('0x95')];_0x58f548[_0xffa7('0x97')]=_0x3a7b37[_0xffa7('0x92')];_0x58f548[_0xffa7('0x98')]=_[_0xffa7('0x99')](_0x58f548['applications'],[_0xffa7('0x9a')],[_0xffa7('0x9b')]);if(_0x58f548[_0xffa7('0x96')][_0xffa7('0x95')]){delete _0x58f548[_0xffa7('0x96')]['Applications'];}if(_0x58f548[_0xffa7('0x96')][_0xffa7('0x92')]&&_0x58f548[_0xffa7('0x96')][_0xffa7('0x92')][_0xffa7('0x93')]['length']){return _0x58f548[_0xffa7('0x96')][_0xffa7('0x92')][_0xffa7('0x93')][0x0];}var _0xe1d653=_[_0xffa7('0xe')](_0x5a9740[_0xffa7('0x51')],{'firstName':_0x5a9740[_0xffa7('0x51')][_0xffa7('0x8b')],'ListId':_0x3a7b37['ListId']});_0xe1d653[_0x5a9740[_0xffa7('0x51')][_0xffa7('0x90')]]=_0x5a9740['body']['from'];return db['CmContact'][_0xffa7('0x50')](_0xe1d653,{'fields':_0x5e01fb,'raw':!![]});}})[_0xffa7('0x16')](handleEntityNotFound(_0xb57c69,null))['then'](function(_0x23bb43){_0x58f548[_0xffa7('0x9c')]=_0x23bb43;var _0x574df8=_0x5a9740[_0xffa7('0x51')]['customerIp'];if(_0x5a9740[_0xffa7('0x82')]['cf-connecting-ip']){_0x574df8=_0x5a9740[_0xffa7('0x82')][_0xffa7('0x9d')];}else if(_0x5a9740['headers'][_0xffa7('0x9e')]){_0x574df8=_[_0xffa7('0x9f')](_0x5a9740['headers']['x-forwarded-for']['split'](','));}if(_0x23bb43){var _0x55cc81={'ContactId':_0x23bb43['id'],'ChatWebsiteId':_0x5a9740['params']['id'],'from':(_0x23bb43[_0xffa7('0xa0')]||'')+'\x20'+(_0x23bb43[_0xffa7('0xa1')]||''),'customerIp':_0x574df8,'customerPort':_0x5a9740[_0xffa7('0x82')][_0xffa7('0xa2')]?_0x5a9740[_0xffa7('0x82')][_0xffa7('0xa2')]:null,'referer':_0x5a9740[_0xffa7('0x51')]['referer'],'browserName':_0x3adb7d['browser'][_0xffa7('0x2f')]&&_0x3adb7d[_0xffa7('0xa3')][_0xffa7('0xa4')]?util[_0xffa7('0xa5')](_0xffa7('0xa6'),_0x3adb7d[_0xffa7('0xa3')][_0xffa7('0x2f')],_0x3adb7d['browser'][_0xffa7('0xa4')]):_0xffa7('0xa7'),'browserVersion':_0x3adb7d[_0xffa7('0xa3')][_0xffa7('0xa4')]||_0xffa7('0xa7'),'osName':util[_0xffa7('0xa5')](_0xffa7('0xa6'),_0x3adb7d['os'][_0xffa7('0x2f')],_0x3adb7d['os'][_0xffa7('0xa4')]),'osVersion':_0x3adb7d['os'][_0xffa7('0xa4')],'deviceModel':_0x3adb7d[_0xffa7('0xa8')]['model']&&_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0xa9')]?util[_0xffa7('0xa5')](_0xffa7('0xaa'),_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0x39')],_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0xa9')],_0x3adb7d['device'][_0xffa7('0x37')]):null,'deviceVendor':_0x3adb7d[_0xffa7('0xa8')][_0xffa7('0xa9')],'deviceType':_0x3adb7d['device'][_0xffa7('0x37')],'formData':JSON[_0xffa7('0xab')](_0x5a9740['body'])};var _0x574134={'ChatWebsiteId':_0x5a9740[_0xffa7('0x4c')]['id'],'closed':![]};if(_0x5a9740['body'][_0xffa7('0xac')]){_0x574134[_0xffa7('0xac')]=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xac')];return db[_0xffa7('0xad')][_0xffa7('0x56')]({'where':_0x574134})[_0xffa7('0x16')](function(_0x557e33){if(_0x557e33){return[_0x557e33,![]];}_0x55cc81[_0xffa7('0xac')]=_0x5a9740['body']['threadId'];_0x55cc81[_0xffa7('0xae')]=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xae')];return db[_0xffa7('0xad')]['create'](_0x55cc81)[_0xffa7('0x16')](function(_0xb6010c){return[_0xb6010c,!![]];});});}_0x574134[_0xffa7('0xaf')]=_0x23bb43['id'];if(_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb0')]&&_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb0')]['id']){_0x574134['id']=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb0')]['id'];return db[_0xffa7('0xad')][_0xffa7('0x56')]({'where':_0x574134})[_0xffa7('0x16')](function(_0x4656a0){if(_0x4656a0){return[_0x4656a0,![]];}return db[_0xffa7('0xad')][_0xffa7('0x50')](_0x55cc81)[_0xffa7('0x16')](function(_0x1d80d3){return[_0x1d80d3,!![]];});});}return db[_0xffa7('0xad')][_0xffa7('0x50')](_0x55cc81)[_0xffa7('0x16')](function(_0x5571f1){return[_0x5571f1,!![]];});}})['spread'](function(_0x3cebf1,_0x3b6cca){if(_0x3cebf1){_0x5c456d=_0x3b6cca;if(!_0x3b6cca){var _0x3b30db={'from':(_0x58f548[_0xffa7('0x9c')][_0xffa7('0xa0')]||'')+'\x20'+(_0x58f548[_0xffa7('0x9c')]['lastName']||'')};if(_0x5a9740[_0xffa7('0x51')][_0xffa7('0xac')]&&_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb1')]&&_0x5a9740[_0xffa7('0x51')][_0xffa7('0xac')]!=_0x5a9740[_0xffa7('0x51')][_0xffa7('0xb1')]){_0x3b30db[_0xffa7('0xac')]=_0x5a9740['body'][_0xffa7('0xb1')];}return _0x3cebf1[_0xffa7('0x2a')](_0x3b30db);}else{return _0x3cebf1;}}})[_0xffa7('0x16')](function(_0x14cbc7){_0x58f548['interaction']=_0x14cbc7['get']({'plain':!![]});_0x58f548['interaction'][_0xffa7('0xb2')]=_0x5c456d;if(_0x58f548[_0xffa7('0xb0')][_0xffa7('0xb2')]){if(_0x58f548['account']['autoclose']){_0x58f548[_0xffa7('0x98')][_0xffa7('0xb3')]({'id':0x0,'priority':_0x58f548['applications'][_0xffa7('0x4f')]+0x1,'app':_0xffa7('0xb4'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xffa7('0xb5')][_0xffa7('0x50')]({'body':_0x5a9740[_0xffa7('0x51')][_0xffa7('0x51')],'ChatWebsiteId':_0x5a9740[_0xffa7('0x4c')]['id'],'ChatInteractionId':_0x14cbc7['id'],'direction':'in','ContactId':_0x58f548['contact']['id'],'AttachmentId':_0x5a9740[_0xffa7('0x51')]['AttachmentId']});})[_0xffa7('0x16')](function(_0x41b4d9){_0x58f548[_0xffa7('0x1e')]=_0x41b4d9;if(_0x58f548[_0xffa7('0xb0')][_0xffa7('0xb6')]){return db['User'][_0xffa7('0x56')]({'attributes':['id',_0xffa7('0x2f')],'where':{'id':_0x58f548[_0xffa7('0xb0')][_0xffa7('0xb6')]}})[_0xffa7('0x16')](function(_0x1b4d82){if(_0x1b4d82){_0x58f548['applications'][_0xffa7('0xb7')]({'id':0x0,'priority':0x0,'app':_0xffa7('0xb8'),'appdata':_0x1b4d82['name']+','+(_0x58f548['account'][_0xffa7('0xb9')]||0xa),'interval':'*,*,*,*'});_0x58f548[_0xffa7('0xba')]=!![];}return respondWithRpcPromise(_0xffa7('0xbb'),_0xffa7('0xbc'),_0x58f548);});}return respondWithRpcPromise(_0xffa7('0xbb'),'startRouting',_0x58f548);})[_0xffa7('0x16')](function(_0x2c79d6){respondWithRpcPromise(_0xffa7('0xbd'),_0xffa7('0xbd'),{'event':'notify','message':_0x2c79d6},client9002);return _0x2c79d6;})['then'](respondWithResult(_0xb57c69,null))['catch'](handleError(_0xb57c69,null));};exports[_0xffa7('0xbe')]=function(_0x129680,_0x22cf04){var _0x4cf31f,_0x4b3f4a,_0x11764e;var _0x4973eb=[];var _0x120d06={};var _0x1f4329=_0x129680[_0xffa7('0xbf')]||[];var _0xcd71f8=[];var _0x5517d3;return db['CmContact'][_0xffa7('0x5a')]()[_0xffa7('0x16')](function(_0x46bbc2){if(!_0x46bbc2){throw new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))]('no\x20available\x20attributes');}_0x4973eb=_['difference'](_[_0xffa7('0x4e')](_0x46bbc2),[_0xffa7('0x87'),_0xffa7('0x88'),_0xffa7('0x89'),'ListId']);if(_0x129680[_0xffa7('0x51')]['id']){delete _0x129680['body']['id'];}if(_[_0xffa7('0x79')](_0x129680['body']['from'])){throw _0x22cf04[_0xffa7('0x22')](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))]['ValidationError'](_0xffa7('0x8d')));}if(_[_0xffa7('0x79')](_0x129680[_0xffa7('0x51')][_0xffa7('0x51')])||_0x129680['body'][_0xffa7('0x51')]===''){throw _0x22cf04['status'](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x129680[_0xffa7('0x51')][_0xffa7('0xc0')])){throw _0x22cf04[_0xffa7('0x22')](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0xc1')+_0x4973eb));}if(!_[_0xffa7('0x8f')](_0x4973eb,_0x129680[_0xffa7('0x51')][_0xffa7('0xc0')])){throw _0x22cf04[_0xffa7('0x22')](0x1f4)[_0xffa7('0x30')](new db[(_0xffa7('0x86'))][(_0xffa7('0x8c'))](_0xffa7('0xc2')+_0x4973eb));}_0x120d06[_0x129680['body']['mapKeyOffline']]=_0x129680[_0xffa7('0x51')]['from'];})[_0xffa7('0x16')](function(){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x129680[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0x91')],'as':'List'},{'model':db[_0xffa7('0xc3')],'as':_0xffa7('0xc3')}]});})[_0xffa7('0x16')](handleEntityNotFound(_0x22cf04,null))['then'](function(_0x5e159b){if(_0x5e159b&&_0x5e159b[_0xffa7('0x92')]){_0x4b3f4a=_0x5e159b;var _0x1131e0=_[_0xffa7('0xe')](_0x129680[_0xffa7('0x51')],{'firstName':_0x129680[_0xffa7('0x51')][_0xffa7('0x8b')],'phone':_0x129680[_0xffa7('0x51')][_0xffa7('0x8b')],'ListId':_0x5e159b[_0xffa7('0x8a')]});_0x1131e0[_0x129680[_0xffa7('0x51')]['mapKeyOffline']]=_0x129680[_0xffa7('0x51')][_0xffa7('0x8b')];return db['CmContact'][_0xffa7('0xc4')]({'where':_0x120d06,'defaults':_0x1131e0});}})['spread'](function(_0x54ae96){if(_0x54ae96){_0x11764e=_0x54ae96;var _0xbaf0c9=fs['readFileSync'](path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0xc5')),_0xffa7('0xc6'));var _0x1e682d=ejs[_0xffa7('0xc7')](_0xbaf0c9,{'body':_[_0xffa7('0xc8')](_0x129680[_0xffa7('0x51')][_0xffa7('0x51')]),'bodyTitle':_0x4b3f4a['offlineMessageBody']});return db[_0xffa7('0xc9')][_0xffa7('0x50')]({'body':_0x1e682d,'plainBody':htmlToText[_0xffa7('0xca')](_0x1e682d),'ContactId':_0x54ae96['id'],'ChatWebsiteId':_0x4b3f4a['id']});}})[_0xffa7('0x16')](function(_0x409c9a){_0x5517d3=_0x409c9a;if(_0x1f4329[_0xffa7('0x4f')]){var _0x7f5d78=_0x1f4329[_0xffa7('0x33')](function(_0x44629c){return{'name':_0x44629c[_0xffa7('0xcb')],'basename':_0x44629c[_0xffa7('0x69')],'type':_0x44629c['mimetype'],'ChatOfflineMessageId':_0x409c9a['id']};});_0xcd71f8=_0x7f5d78['map'](_0x3a0f59=>{var _0x40ff9b={'filename':_0x3a0f59['name'],'path':path[_0xffa7('0x74')](config[_0xffa7('0x6f')],_0xffa7('0xcc'),_0xffa7('0xbf'),_0xffa7('0xcd'),_0xffa7('0xce'),_0x3a0f59[_0xffa7('0xcf')])};return _0x40ff9b;});if(!_0x4b3f4a[_0xffa7('0xd0')]){return db[_0xffa7('0xd1')][_0xffa7('0xd2')](function(_0x4725d6){return db[_0xffa7('0xd3')][_0xffa7('0xd4')](_0x7f5d78,{'transaction':_0x4725d6});});}}})[_0xffa7('0x16')](function(){if(_0x5517d3){_0x4cf31f=_0x5517d3;return db[_0xffa7('0xc3')][_0xffa7('0x62')]({'where':{'service':!![]},'include':[{'model':db[_0xffa7('0xd5')],'as':_0xffa7('0xd6'),'raw':!![],'include':[{'model':db[_0xffa7('0xd7')],'as':_0xffa7('0xd7'),'raw':!![]}]}]});}})[_0xffa7('0x16')](function(_0x5acc57){if(_0x5acc57&&_0x5acc57[_0xffa7('0xd6')]&&_0x4b3f4a[_0xffa7('0xd8')]&&_0x4b3f4a['forwardOfflineAddress']){var _0x3d2499=_0x5acc57[_0xffa7('0xd9')]();return respondWithRpcPromise(_0xffa7('0xda'),_0xffa7('0xdb'),{'account':_0x3d2499,'message':{'from':util['format'](_0xffa7('0xdc'),_0x5acc57[_0xffa7('0x2f')],_0x5acc57[_0xffa7('0xdd')]||_0x5acc57[_0xffa7('0xd6')][_0xffa7('0x52')]),'to':_0x4b3f4a[_0xffa7('0xde')],'subject':_0x4b3f4a['offlineMessageSubject'],'html':_0x4cf31f[_0xffa7('0x51')],'attachments':_0xcd71f8}},client9003)[_0xffa7('0x16')](function(){return _0x4cf31f;})[_0xffa7('0x1f')](function(_0x5285b5){logger[_0xffa7('0x1c')](_0x5285b5);});}})['then'](function(){if(_0x4b3f4a&&_0x4b3f4a[_0xffa7('0xd0')]&&_0x4b3f4a[_0xffa7('0xdf')]){var _0x378b36=[];if(_0x1f4329[_0xffa7('0x4f')]){_0x378b36=_0x1f4329[_0xffa7('0x33')](function(_0x443207){return{'name':_0x443207[_0xffa7('0xcb')],'basename':_0x443207[_0xffa7('0x69')],'type':_0x443207[_0xffa7('0xe0')],'ChatOfflineMessageId':_0x5517d3['id']};});}var _0x26e1ea;if(!_['isNil'](_0x4b3f4a[_0xffa7('0xe1')])){var _0x33eb6d=_[_0xffa7('0x33')](_0x129680[_0xffa7('0x51')],function(_0x278e16){return _0x278e16;});var _0x274d49=_[_0xffa7('0xe2')](_0x33eb6d)[0x0];var _0x4f1224=_[_0xffa7('0xe3')](_0x274d49,function(_0x461704){return _0x461704;});_0x26e1ea=_0x4f1224[0x1][_0x4b3f4a[_0xffa7('0xe1')]];}var _0x62de4e={'from':_0x11764e[_0xffa7('0xdd')],'firstName':_0x11764e['firstName'],'lastName':_0x11764e[_0xffa7('0xa1')],'mapKey':_0xffa7('0xdd'),'message':{'from':_0x11764e[_0xffa7('0xdd')],'to':_0x4b3f4a[_0xffa7('0xc3')][_0xffa7('0xdd')],'cc':'','subject':_[_0xffa7('0x79')](_0x26e1ea)?_0x4b3f4a['offlineMessageSubject']:_0x26e1ea,'messageId':'','sentAt':new Date(),'attach':_0x378b36[_0xffa7('0x4f')],'attachments':_0x378b36,'originChannel':_0xffa7('0xe4'),'ChatWebsiteId':_0x4b3f4a['id'],'ChatOfflineMessageId':_0x4cf31f['id'],'originTo':_0x4b3f4a['MailAccount'][_0xffa7('0xdd')]},'body':_0x4cf31f[_0xffa7('0x51')]};var _0x32cd21={'account':{'id':_0x4b3f4a[_0xffa7('0xdf')]},'body':_0x62de4e,'log':_0xffa7('0xe5')};return respondWithRpcPromise(_0xffa7('0xe5'),_0xffa7('0xe6'),_0x32cd21,client9001)['then'](function(){return _0x4cf31f;})['catch'](function(_0x17ad24){logger['error'](_0x17ad24);});}return;})[_0xffa7('0x16')](function(){if(_0x4cf31f){return _0x4cf31f;}})[_0xffa7('0x16')](respondWithResult(_0x22cf04,null))[_0xffa7('0x1f')](function(_0x12920e){logger['error'](_0xffa7('0x1f'),_0x12920e);for(var _0x135225 of _0x1f4329){var _0x4d0e5f=path[_0xffa7('0x74')](config['root'],_0xffa7('0xcc'),_0xffa7('0xbf'),_0xffa7('0xcd'),'offline-chat',_0x135225[_0xffa7('0x69')]);fs_extra[_0xffa7('0xe7')](_0x4d0e5f)[_0xffa7('0x1f')](function(_0x55ff5c){logger[_0xffa7('0x1c')](_0xffa7('0xe8'),_0x4d0e5f,_0x55ff5c);});}});};exports[_0xffa7('0xe9')]=function(_0x16894d,_0x5ed92d){return db['ChatInteraction'][_0xffa7('0x56')]({'where':{'id':_0x16894d[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5ed92d,null))[_0xffa7('0x16')](function(_0x14be03){if(_0x14be03){return _0x14be03[_0xffa7('0xe9')](_0x16894d[_0xffa7('0x51')][_0xffa7('0x5f')],_['omit'](_0x16894d[_0xffa7('0x51')],[_0xffa7('0x5f'),'id'])||{});}})[_0xffa7('0x16')](respondWithResult(_0x5ed92d,null))['catch'](handleError(_0x5ed92d,null));};exports[_0xffa7('0xea')]=function(_0x5f423a,_0x4f69af){var _0x5a86ef={'raw':![],'where':{}};var _0x5802cc={};var _0x3f669b={'count':0x0,'rows':[]};return db[_0xffa7('0x34')]['findOne']({'where':{'id':_0x5f423a[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4f69af,null))[_0xffa7('0x16')](function(_0x4234df){if(_0x4234df){_0x5802cc[_0xffa7('0x39')]=_['keys'](db['ChatInteraction'][_0xffa7('0x35')]);_0x5802cc[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x5f423a['query']);_0x5802cc[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x5802cc[_0xffa7('0x39')],_0x5802cc[_0xffa7('0x3a')]);_0x5a86ef['attributes']=_[_0xffa7('0x3c')](_0x5802cc['model'],qs['fields'](_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x5a86ef[_0xffa7('0x3d')]=_0x5a86ef[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x5a86ef['attributes']:_0x5802cc[_0xffa7('0x39')];if(!_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x5a86ef[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x5a86ef[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x5a86ef[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x5f423a['query'][_0xffa7('0x41')]);_0x5a86ef[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x5f423a[_0xffa7('0x3a')],_0x5802cc['filters']));_0x5a86ef[_0xffa7('0x42')][_0xffa7('0x5c')]=_0x4234df['id'];if(_0x5f423a['query'][_0xffa7('0x46')]){_0x5a86ef[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x5a86ef[_0xffa7('0x42')],{'$or':_[_0xffa7('0x33')](_0x5a86ef[_0xffa7('0x3d')],function(_0x4132e0){var _0x1239c2={};_0x1239c2[_0x4132e0]={'$like':'%'+_0x5f423a[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x1239c2;})});}_0x5a86ef=_[_0xffa7('0x44')]({},_0x5a86ef,_0x5f423a[_0xffa7('0x47')]);return db[_0xffa7('0xad')]['count']({'where':_0x5a86ef['where']})[_0xffa7('0x16')](function(_0x3f83a8){_0x3f669b[_0xffa7('0x25')]=_0x3f83a8;if(_0x5f423a[_0xffa7('0x3a')]['includeAll']){_0x5a86ef['include']=[{'model':db[_0xffa7('0x85')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0xffa7('0x2f'),'fullname',_0xffa7('0xeb')],'required':![]},{'model':db[_0xffa7('0xec')],'as':_0xffa7('0xed'),'attributes':['id','name',_0xffa7('0xee')],'where':_0x5f423a['query'][_0xffa7('0xef')]?{'id':_0x5f423a['query'][_0xffa7('0xef')]}:undefined,'required':_0x5f423a[_0xffa7('0x3a')][_0xffa7('0xef')]?!![]:![]}];}return db['ChatInteraction'][_0xffa7('0x64')](_0x5a86ef);})['then'](function(_0x18bdd2){_0x3f669b['rows']=_0x18bdd2;return _0x3f669b;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x4f69af,_0x5a86ef))[_0xffa7('0x1f')](handleError(_0x4f69af,null));};function iftimePromise(_0x20ffec,_0x63936f){return respondWithRpcPromise(_0xffa7('0xf0'),_0xffa7('0xf1'),{'command':_0x63936f['timezone']?util[_0xffa7('0xa5')]('iftime\x20%s,%s',_0x20ffec['interval'],_0x63936f[_0xffa7('0xf2')]):util['format']('iftime\x20%s',_0x20ffec[_0xffa7('0xf3')])},client9002)[_0xffa7('0x16')](function(_0x4ed411){var _0xb5ac4e=_0x4ed411&&_0x4ed411['indexOf'](_0xffa7('0xf4'))>=0x0?!![]:![];logger[_0xffa7('0x17')](_0xffa7('0xf5'),_0x63936f['id'],_0x20ffec['id'],_0x20ffec[_0xffa7('0xf3')],_0xb5ac4e?'ONLINE':_0xffa7('0xf6'),_0x63936f[_0xffa7('0xf2')]?_0x63936f['timezone']:'No\x20timezone');return _0xb5ac4e;})['catch'](function(_0x4e4b79){logger['error'](_0xffa7('0xf5'),_0x63936f['id'],_0x20ffec['id'],_0x20ffec[_0xffa7('0xf3')],util[_0xffa7('0xf7')](_0x4e4b79,{'showHidden':![],'depth':null}),_0x63936f[_0xffa7('0xf2')]?_0x63936f[_0xffa7('0xf2')]:_0xffa7('0xf8'));return![];});}exports[_0xffa7('0xf1')]=function(_0x2b51a0,_0x5bf638){var _0x15571a=0x0;var _0x3b9694=0x0;var _0x10772e=![];var _0x850074;var _0x29873e;return db[_0xffa7('0x34')]['find']({'where':{'id':_0x2b51a0[_0xffa7('0x4c')]['id']},'include':[{'model':db[_0xffa7('0xf9')],'as':'Interval','include':[{'model':db[_0xffa7('0xf9')],'as':_0xffa7('0xfa'),'attributes':['id',_0xffa7('0xf3')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x5bf638,null))[_0xffa7('0x16')](function(_0x18ee3f){if(_0x18ee3f){_0x850074=_0x18ee3f;return _0x18ee3f[_0xffa7('0xfb')]({'raw':!![]});}})['then'](function(_0x4b5944){if(_0x850074){if(_0x4b5944){_0x29873e=_0x4b5944;}}return require(_0xffa7('0x70'))['getLicense']();})[_0xffa7('0x16')](function(_0x2dd6b2){if(_0x2dd6b2){_0x3b9694=_0x2dd6b2['virtual'];_0x10772e=_0x2dd6b2['custom'];}})[_0xffa7('0x16')](function(){return db['ChatInteraction'][_0xffa7('0x25')]({'where':{'closed':![]}});})['then'](function(_0x4c9323){_0x15571a=_0x4c9323;if(_0x3b9694&&_0x4c9323>_0x3b9694){return db['License'][_0xffa7('0x62')]({'where':{'id':0x1}})[_0xffa7('0x16')](function(_0x2a9404){if(_0x2a9404){_0x2a9404[_0xffa7('0xfc')](_0xffa7('0xfd'));}});}})[_0xffa7('0x16')](function(){if(_0x850074[_0xffa7('0xf9')]&&_0x850074[_0xffa7('0xf9')][_0xffa7('0xfa')]){var _0x4f7a45=[];for(var _0x36422c=0x0;_0x36422c<_0x850074[_0xffa7('0xf9')][_0xffa7('0xfa')][_0xffa7('0x4f')];_0x36422c++){var _0x1a4855=_0x850074[_0xffa7('0xf9')][_0xffa7('0xfa')][_0x36422c][_0xffa7('0x2c')]({'plain':!![]});_0x4f7a45[_0xffa7('0xb3')](iftimePromise(_0x1a4855,_0x850074));}return BPromise[_0xffa7('0xfe')](_0x4f7a45)[_0xffa7('0x16')](function(_0xa32790){return _[_0xffa7('0xff')](_0xa32790);});}else{return!![];}})[_0xffa7('0x16')](function(_0x54517f){var _0x295d87=fs[_0xffa7('0x100')](path[_0xffa7('0x74')](config['root'],_0xffa7('0x101')),_0xffa7('0xc6'));var _0x22fc97={'remote':_0x850074[_0xffa7('0x102')],'query':querystring[_0xffa7('0xab')](_[_0xffa7('0x44')](_0x850074['get']({'plain':!![]}),{'customerIp':_0x2b51a0[_0xffa7('0x82')][_0xffa7('0x9e')]||_0x2b51a0[_0xffa7('0x82')][_0xffa7('0x103')]||_0x2b51a0[_0xffa7('0x104')]['remoteAddress']||_0x2b51a0['ip'],'referer':_0x2b51a0[_0xffa7('0x82')]['referer'],'openedInteractions':_0x15571a,'maxInteractions':_0x3b9694,'virtual':_0x10772e['virtual'],'online':_0x54517f,'custom':_0x10772e}))[_0xffa7('0x105')](/'/g,'\x5c\x27')};_0x5bf638[_0xffa7('0x30')](ejs[_0xffa7('0xc7')](Mustache[_0xffa7('0xc7')](_0x295d87,_0x22fc97),{'proactiveActions':_0x29873e,'alignment':_0x850074[_0xffa7('0x106')],'verticalAlignment':_0x850074[_0xffa7('0x107')],'div_color':_0x850074['color'],'labelText':_0x850074[_0xffa7('0x108')],'text_color':_0x850074[_0xffa7('0x109')],'text_button_color':_0x850074[_0xffa7('0x10a')],'button_color':_0x850074[_0xffa7('0x10b')],'background_color':_0x850074[_0xffa7('0x10c')],'hideWhenOffline':_0x850074[_0xffa7('0x10d')],'interval':_0x850074[_0xffa7('0x10e')]}));})['catch'](handleError(_0x5bf638,null));};exports['addApplications']=function(_0xd30756,_0x4b9dc7){var _0x35548c=_0xd30756[_0xffa7('0x4c')]['id'];var _0x3dcf05=_0xd30756[_0xffa7('0x51')];var _0x112f0d=0xc8;var _0x2f6881=null;return db[_0xffa7('0xd1')][_0xffa7('0xd2')]({'isolationLevel':db['sequelize'][_0xffa7('0x10f')][_0xffa7('0x110')][_0xffa7('0x111')]},function(_0x83eb9f){return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x35548c},'transaction':_0x83eb9f})[_0xffa7('0x16')](function(_0x563007){if(_0x563007){return db['ChatApplication'][_0xffa7('0x2b')]({'where':{'ChatWebsiteId':_0x35548c},'transaction':_0x83eb9f})[_0xffa7('0x16')](function(){var _0x8d7df3=_['map'](_0x3dcf05,function(_0x586508){_0x586508['ChatWebsiteId']=_0x35548c;return _0x586508;});return db[_0xffa7('0x112')][_0xffa7('0xd4')](_0x8d7df3,{'transaction':_0x83eb9f});});}else{_0x112f0d=0x194;_0x2f6881=[];}});})[_0xffa7('0x16')](function(){if(_0x112f0d!==0x194){return db[_0xffa7('0x112')][_0xffa7('0x113')]({'where':{'ChatWebsiteId':_0x35548c},'order':'priority'})[_0xffa7('0x16')](function(_0x5109fc){_0x2f6881=_0x5109fc;});}})['catch'](function(_0x3d7475){_0x112f0d=0x1f4;logger[_0xffa7('0x1c')](_0x3d7475[_0xffa7('0x2e')]);if(_0x3d7475[_0xffa7('0x2f')]){delete _0x3d7475[_0xffa7('0x2f')];}_0x2f6881=_0x3d7475;})[_0xffa7('0x114')](function(){if(_0x2f6881===null){_0x4b9dc7[_0xffa7('0x20')](_0x112f0d);}else{if(_0x112f0d===0x1f4){_0x4b9dc7[_0xffa7('0x22')](_0x112f0d)[_0xffa7('0x30')](_0x2f6881);}else{_0x4b9dc7['status'](_0x112f0d)[_0xffa7('0x29')](_0x2f6881);}}});};exports['getApplications']=function(_0x217159,_0x29ccef){var _0x247ede={};var _0x810c39={};var _0x32c880;var _0x16d8d3;return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x217159[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29ccef,null))[_0xffa7('0x16')](function(_0x1e0d86){if(_0x1e0d86){_0x32c880=_0x1e0d86;_0x810c39[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x112')][_0xffa7('0x35')]);_0x810c39[_0xffa7('0x3a')]=_['keys'](_0x217159[_0xffa7('0x3a')]);_0x810c39[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x810c39[_0xffa7('0x39')],_0x810c39['query']);_0x247ede[_0xffa7('0x3d')]=_['intersection'](_0x810c39[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x217159['query'][_0xffa7('0x3e')]));_0x247ede[_0xffa7('0x3d')]=_0x247ede[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x247ede['attributes']:_0x810c39['model'];_0x247ede[_0xffa7('0x40')]=qs['sort'](_0x217159[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x247ede[_0xffa7('0x42')]=qs['filters'](_[_0xffa7('0x43')](_0x217159[_0xffa7('0x3a')],_0x810c39[_0xffa7('0x3b')]));if(_0x217159['query'][_0xffa7('0x46')]){_0x247ede[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x247ede[_0xffa7('0x42')],{'$or':_['map'](_0x247ede['attributes'],function(_0xc03afd){var _0x179f07={};_0x179f07[_0xc03afd]={'$like':'%'+_0x217159['query']['filter']+'%'};return _0x179f07;})});}_0x247ede=_[_0xffa7('0x44')]({},_0x247ede,_0x217159[_0xffa7('0x47')]);return _0x32c880[_0xffa7('0x115')](_0x247ede);}})[_0xffa7('0x16')](function(_0x1cf409){if(_0x1cf409){_0x16d8d3=_0x1cf409[_0xffa7('0x4f')];if(!_0x217159[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x247ede[_0xffa7('0x24')]=qs['limit'](_0x217159[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x247ede[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x217159[_0xffa7('0x3a')][_0xffa7('0x26')]);}return _0x32c880['getApplications'](_0x247ede);}})[_0xffa7('0x16')](function(_0x468a0a){if(_0x468a0a){return _0x468a0a?{'count':_0x16d8d3,'rows':_0x468a0a}:null;}})[_0xffa7('0x16')](respondWithResult(_0x29ccef,null))[_0xffa7('0x1f')](handleError(_0x29ccef,null));};exports[_0xffa7('0x116')]=function(_0x1de24d,_0x16bb3c){return db['chatProactiveAction'][_0xffa7('0x56')]({'where':{'id':_0x1de24d[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x16bb3c,null))['then'](function(_0x38c2a2){if(_0x38c2a2){return _0x38c2a2[_0xffa7('0x116')](_0x1de24d[_0xffa7('0x51')][_0xffa7('0x5f')],_[_0xffa7('0x117')](_0x1de24d[_0xffa7('0x51')],[_0xffa7('0x5f'),'id'])||{});}})[_0xffa7('0x16')](respondWithResult(_0x16bb3c,null))[_0xffa7('0x1f')](handleError(_0x16bb3c,null));};exports['getProactiveActions']=function(_0x2680eb,_0x5c55d2){var _0x462cdd={};var _0x38e609={};var _0x4e5ecb;var _0x1d3f30;return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x2680eb[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x5c55d2,null))[_0xffa7('0x16')](function(_0x168edb){if(_0x168edb){_0x4e5ecb=_0x168edb;_0x38e609[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x118')][_0xffa7('0x35')]);_0x38e609[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x2680eb[_0xffa7('0x3a')]);_0x38e609[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x38e609[_0xffa7('0x39')],_0x38e609[_0xffa7('0x3a')]);_0x462cdd['attributes']=_[_0xffa7('0x3c')](_0x38e609[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x2680eb[_0xffa7('0x3a')]['fields']));_0x462cdd[_0xffa7('0x3d')]=_0x462cdd[_0xffa7('0x3d')]['length']?_0x462cdd[_0xffa7('0x3d')]:_0x38e609[_0xffa7('0x39')];_0x462cdd['order']=qs['sort'](_0x2680eb['query'][_0xffa7('0x41')]);_0x462cdd[_0xffa7('0x42')]=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x2680eb[_0xffa7('0x3a')],_0x38e609[_0xffa7('0x3b')]));if(_0x2680eb[_0xffa7('0x3a')][_0xffa7('0x46')]){_0x462cdd[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x462cdd[_0xffa7('0x42')],{'$or':_['map'](_0x462cdd[_0xffa7('0x3d')],function(_0x401057){var _0x1b71a0={};_0x1b71a0[_0x401057]={'$like':'%'+_0x2680eb[_0xffa7('0x3a')]['filter']+'%'};return _0x1b71a0;})});}_0x462cdd=_[_0xffa7('0x44')]({},_0x462cdd,_0x2680eb[_0xffa7('0x47')]);return _0x4e5ecb[_0xffa7('0xfb')](_0x462cdd);}})[_0xffa7('0x16')](function(_0x12fc95){if(_0x12fc95){_0x1d3f30=_0x12fc95[_0xffa7('0x4f')];if(!_0x2680eb[_0xffa7('0x3a')][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x462cdd[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x2680eb['query'][_0xffa7('0x24')]);_0x462cdd[_0xffa7('0x26')]=qs['offset'](_0x2680eb[_0xffa7('0x3a')][_0xffa7('0x26')]);}return _0x4e5ecb[_0xffa7('0xfb')](_0x462cdd);}})['then'](function(_0x35ef67){if(_0x35ef67){return _0x35ef67?{'count':_0x1d3f30,'rows':_0x35ef67}:null;}})[_0xffa7('0x16')](respondWithResult(_0x5c55d2,null))['catch'](handleError(_0x5c55d2,null));};exports[_0xffa7('0x119')]=function(_0x47869b,_0xc2e97b){var _0x1f0867=_0x47869b[_0xffa7('0x3a')][_0xffa7('0x11a')]===_0xffa7('0x11b')?'offlineForm':_0xffa7('0x11c');return db[_0xffa7('0x34')][_0xffa7('0x56')]({'attributes':['id',_0x1f0867],'where':{'id':_0x47869b[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc2e97b,null))[_0xffa7('0x16')](function(_0x1548e2){if(_0x1548e2){var _0x30f031=_0x1548e2[_0x1f0867];var _0x374b3d=_0x30f031&&_0x30f031['items']?_0x30f031[_0xffa7('0x11d')]:[];_0xc2e97b['send']({'fromKey':_['isNil'](_0x30f031[_0xffa7('0x11e')])?undefined:_0x30f031[_0xffa7('0x11e')],'count':_0x374b3d[_0xffa7('0x4f')],'rows':_0x374b3d});}})[_0xffa7('0x1f')](handleError(_0xc2e97b,null));};exports[_0xffa7('0x11f')]=function(_0x2569b8,_0x4ec254){var _0x250abd={'raw':![],'where':{}};var _0x56405f={};var _0x34821e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xffa7('0x62')]({'where':{'id':_0x2569b8[_0xffa7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ec254,null))[_0xffa7('0x16')](function(_0x9d7a5b){if(_0x9d7a5b){_0x56405f[_0xffa7('0x39')]=_['keys'](db[_0xffa7('0xc9')]['rawAttributes']);_0x56405f[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x2569b8[_0xffa7('0x3a')]);_0x56405f[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x56405f[_0xffa7('0x39')],_0x56405f['query']);_0x250abd[_0xffa7('0x3d')]=_['intersection'](_0x56405f['model'],qs[_0xffa7('0x3e')](_0x2569b8[_0xffa7('0x3a')]['fields']));_0x250abd[_0xffa7('0x3d')]=_0x250abd[_0xffa7('0x3d')]['length']?_0x250abd['attributes']:_0x56405f[_0xffa7('0x39')];if(!_0x2569b8['query'][_0xffa7('0x63')](_0xffa7('0x3f'))){_0x250abd['limit']=qs[_0xffa7('0x24')](_0x2569b8['query']['limit']);_0x250abd[_0xffa7('0x26')]=qs[_0xffa7('0x26')](_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x26')]);}_0x250abd['order']=qs[_0xffa7('0x41')](_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x250abd['where']=qs[_0xffa7('0x3b')](_[_0xffa7('0x43')](_0x2569b8[_0xffa7('0x3a')],_0x56405f['filters']));_0x250abd['where']['ChatWebsiteId']=_0x9d7a5b['id'];if(_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x46')]){_0x250abd[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x250abd[_0xffa7('0x42')],{'$or':_[_0xffa7('0x33')](_0x250abd[_0xffa7('0x3d')],function(_0x29456a){var _0x1bb485={};_0x1bb485[_0x29456a]={'$like':'%'+_0x2569b8[_0xffa7('0x3a')]['filter']+'%'};return _0x1bb485;})});}_0x250abd=_[_0xffa7('0x44')]({},_0x250abd,_0x2569b8[_0xffa7('0x47')]);return db[_0xffa7('0xc9')][_0xffa7('0x25')]({'where':_0x250abd['where']})[_0xffa7('0x16')](function(_0x58fe78){_0x34821e['count']=_0x58fe78;if(_0x2569b8[_0xffa7('0x3a')][_0xffa7('0x48')]){_0x250abd['include']=[{'all':!![]}];}else{_0x250abd[_0xffa7('0x49')]=[{'model':db[_0xffa7('0x85')],'as':_0xffa7('0x120'),'required':![]},{'model':db[_0xffa7('0xd3')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0xffa7('0x64')](_0x250abd);})['then'](function(_0x2db90d){_0x34821e[_0xffa7('0x4a')]=_0x2db90d;return _0x34821e;});}})[_0xffa7('0x16')](respondWithFilteredResult(_0x4ec254,_0x250abd))[_0xffa7('0x1f')](handleError(_0x4ec254,null));};exports[_0xffa7('0x121')]=function(_0x3ac8a8,_0x4664a2){return db['ChatWebsite'][_0xffa7('0x56')]({'where':{'id':_0x3ac8a8['params']['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x4664a2,null))['then'](function(_0x4f447e){if(_0x4f447e){return _0x4f447e['addAgents'](_0x3ac8a8[_0xffa7('0x51')][_0xffa7('0x5f')],_['omit'](_0x3ac8a8['body'],['ids','id'])||{})[_0xffa7('0x122')](function(_0x1e65b2){for(var _0x260319=0x0;_0x260319<_0x3ac8a8[_0xffa7('0x51')]['ids']['length'];_0x260319+=0x1){socket['emit'](_0xffa7('0x123'),{'UserId':Number(_0x3ac8a8[_0xffa7('0x51')][_0xffa7('0x5f')][_0x260319]),'ChatWebsiteId':Number(_0x3ac8a8[_0xffa7('0x4c')]['id'])});}return _0x1e65b2;});}})['then'](respondWithResult(_0x4664a2,null))['catch'](handleError(_0x4664a2,null));};exports['removeAgents']=function(_0x3f6a0c,_0x13ccd1){return db[_0xffa7('0x34')][_0xffa7('0x56')]({'where':{'id':_0x3f6a0c[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x13ccd1,null))[_0xffa7('0x16')](function(_0x45d20c){if(_0x45d20c){return _0x45d20c[_0xffa7('0x124')](_0x3f6a0c['query'][_0xffa7('0x5f')])[_0xffa7('0x16')](function(){if(_[_0xffa7('0x125')](_0x3f6a0c['query'][_0xffa7('0x5f')])){for(var _0x2f1b69=0x0;_0x2f1b69<_0x3f6a0c['query'][_0xffa7('0x5f')][_0xffa7('0x4f')];_0x2f1b69+=0x1){socket[_0xffa7('0x126')](_0xffa7('0x127'),{'UserId':Number(_0x3f6a0c['query'][_0xffa7('0x5f')][_0x2f1b69]),'ChatWebsiteId':Number(_0x3f6a0c[_0xffa7('0x4c')]['id'])});}}else{socket[_0xffa7('0x126')](_0xffa7('0x127'),{'UserId':Number(_0x3f6a0c[_0xffa7('0x3a')][_0xffa7('0x5f')]),'ChatWebsiteId':Number(_0x3f6a0c[_0xffa7('0x4c')]['id'])});}});}})[_0xffa7('0x16')](respondWithStatusCode(_0x13ccd1,null))['catch'](handleError(_0x13ccd1,null));};exports[_0xffa7('0x128')]=function(_0x39adc5,_0x1bdd26){var _0x3a4915={};var _0x1b0810={};var _0x52196d;var _0x461ca8;return db[_0xffa7('0x34')][_0xffa7('0x62')]({'where':{'id':_0x39adc5[_0xffa7('0x4c')]['id']}})[_0xffa7('0x16')](handleEntityNotFound(_0x1bdd26,null))[_0xffa7('0x16')](function(_0x439bfb){if(_0x439bfb){_0x52196d=_0x439bfb;_0x1b0810[_0xffa7('0x39')]=_[_0xffa7('0x4e')](db[_0xffa7('0x129')][_0xffa7('0x35')]);_0x1b0810[_0xffa7('0x3a')]=_[_0xffa7('0x4e')](_0x39adc5[_0xffa7('0x3a')]);_0x1b0810[_0xffa7('0x3b')]=_[_0xffa7('0x3c')](_0x1b0810['model'],_0x1b0810[_0xffa7('0x3a')]);_0x3a4915[_0xffa7('0x3d')]=_[_0xffa7('0x3c')](_0x1b0810[_0xffa7('0x39')],qs[_0xffa7('0x3e')](_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x3e')]));_0x3a4915['attributes']=_0x3a4915[_0xffa7('0x3d')][_0xffa7('0x4f')]?_0x3a4915[_0xffa7('0x3d')]:_0x1b0810[_0xffa7('0x39')];_0x3a4915[_0xffa7('0x40')]=qs[_0xffa7('0x41')](_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x41')]);_0x3a4915[_0xffa7('0x42')]=qs['filters'](_['pick'](_0x39adc5[_0xffa7('0x3a')],_0x1b0810[_0xffa7('0x3b')]));if(_0x39adc5[_0xffa7('0x3a')]['filter']){_0x3a4915[_0xffa7('0x42')]=_[_0xffa7('0x44')](_0x3a4915[_0xffa7('0x42')],{'$or':_['map'](_0x3a4915[_0xffa7('0x3d')],function(_0x5ecdd6){var _0x9fc5ce={};_0x9fc5ce[_0x5ecdd6]={'$like':'%'+_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x46')]+'%'};return _0x9fc5ce;})});}_0x3a4915=_[_0xffa7('0x44')]({},_0x3a4915,_0x39adc5[_0xffa7('0x47')]);return _0x52196d[_0xffa7('0x128')](_0x3a4915);}})[_0xffa7('0x16')](function(_0x5a4a37){if(_0x5a4a37){_0x461ca8=_0x5a4a37['length'];if(!_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x63')]('nolimit')){_0x3a4915[_0xffa7('0x24')]=qs[_0xffa7('0x24')](_0x39adc5[_0xffa7('0x3a')][_0xffa7('0x24')]);_0x3a4915['offset']=qs[_0xffa7('0x26')](_0x39adc5[_0xffa7('0x3a')]['offset']);}return _0x52196d['getAgents'](_0x3a4915);}})[_0xffa7('0x16')](function(_0x4ada51){if(_0x4ada51){return _0x4ada51?{'count':_0x461ca8,'rows':_0x4ada51}:null;}})[_0xffa7('0x16')](respondWithResult(_0x1bdd26,null))[_0xffa7('0x1f')](handleError(_0x1bdd26,null));};
\ No newline at end of file
+var _0xbb07=['attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','getProactiveActions','License','increment','Interval','Intervals','some','server/files/chat/iframe.ejs','x-real-ip','connection','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','count','limit','set','update','destroy','get','ChatWebsites','end','stack','name','map','ChatWebsite','rawAttributes','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','Pause','mandatoryDispositionPause','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','ChatWebsiteId','Disposition','create','getDispositions','ids','addAnswer','CannedAnswer','getAnswers','length','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','ListId','contact','cf-connecting-ip','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','notify','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','server'];(function(_0x17177d,_0x4a8d9f){var _0x2c90f8=function(_0x1321f0){while(--_0x1321f0){_0x17177d['push'](_0x17177d['shift']());}};_0x2c90f8(++_0x4a8d9f);}(_0xbb07,0x167));var _0x7bb0=function(_0x40306a,_0x1f6a0a){_0x40306a=_0x40306a-0x0;var _0x1842c3=_0xbb07[_0x40306a];return _0x1842c3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x7bb0('0x0'));var util=require(_0x7bb0('0x1'));var path=require(_0x7bb0('0x2'));var ejs=require(_0x7bb0('0x3'));var fs=require('fs');var fs_extra=require(_0x7bb0('0x4'));var _=require('lodash');var querystring=require(_0x7bb0('0x5'));var Redis=require(_0x7bb0('0x6'));var qs=require(_0x7bb0('0x7'));var logger=require('../../config/logger')(_0x7bb0('0x8'));var config=require(_0x7bb0('0x9'));var db=require(_0x7bb0('0xa'))['db'];config[_0x7bb0('0xb')]=_[_0x7bb0('0xc')](config[_0x7bb0('0xb')],{'host':_0x7bb0('0xd'),'port':0x18eb});var socket=require(_0x7bb0('0xe'))(new Redis(config[_0x7bb0('0xb')]));require(_0x7bb0('0xf'))[_0x7bb0('0x10')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x7bb0('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x7bb0('0x12')]['http']({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x11aaf1,_0x116d29,_0x5e4d8a,_0x40ee95){return new BPromise(function(_0xabf4,_0x222cea){var _0x3f98a5=_0x40ee95||client;return _0x3f98a5['request'](_0x11aaf1,_0x5e4d8a)[_0x7bb0('0x13')](function(_0x140253){logger[_0x7bb0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x116d29,'request\x20sent');logger[_0x7bb0('0x15')](_0x7bb0('0x16'),_0x116d29,'request\x20sent',JSON[_0x7bb0('0x17')](_0x140253));if(_0x140253[_0x7bb0('0x18')]){if(_0x140253['error'][_0x7bb0('0x19')]===0x1f4){logger[_0x7bb0('0x18')](_0x7bb0('0x1a'),_0x116d29,_0x140253[_0x7bb0('0x18')][_0x7bb0('0x1b')]);return _0x222cea(_0x140253[_0x7bb0('0x18')][_0x7bb0('0x1b')]);}logger[_0x7bb0('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x116d29,_0x140253[_0x7bb0('0x18')]['message']);return _0xabf4(_0x140253[_0x7bb0('0x18')][_0x7bb0('0x1b')]);}else{logger[_0x7bb0('0x14')](_0x7bb0('0x1a'),_0x116d29,'request\x20sent');_0xabf4(_0x140253[_0x7bb0('0x1c')][_0x7bb0('0x1b')]);}})[_0x7bb0('0x1d')](function(_0x5ef6c5){logger[_0x7bb0('0x18')](_0x7bb0('0x1a'),_0x116d29,_0x5ef6c5);_0x222cea(_0x5ef6c5);});});}function respondWithStatusCode(_0x10b9a9,_0x121f78){_0x121f78=_0x121f78||0xcc;return function(_0x2e5906){if(_0x2e5906){return _0x10b9a9[_0x7bb0('0x1e')](_0x121f78);}return _0x10b9a9[_0x7bb0('0x1f')](_0x121f78)['end']();};}function respondWithResult(_0x246006,_0x1b6bfb){_0x1b6bfb=_0x1b6bfb||0xc8;return function(_0x1e6013){if(_0x1e6013){return _0x246006[_0x7bb0('0x1f')](_0x1b6bfb)[_0x7bb0('0x20')](_0x1e6013);}};}function respondWithFilteredResult(_0x5db5ea,_0x200c60){return function(_0x165a24){if(_0x165a24){var _0x1622fb=typeof _0x200c60[_0x7bb0('0x21')]===_0x7bb0('0x22')&&typeof _0x200c60['limit']===_0x7bb0('0x22');var _0x1c8070=_0x165a24[_0x7bb0('0x23')];var _0x195b66=_0x1622fb?0x0:_0x200c60['offset'];var _0x357601=_0x1622fb?_0x165a24['count']:_0x200c60[_0x7bb0('0x21')]+_0x200c60[_0x7bb0('0x24')];var _0x238118;if(_0x357601>=_0x1c8070){_0x357601=_0x1c8070;_0x238118=0xc8;}else{_0x238118=0xce;}_0x5db5ea[_0x7bb0('0x1f')](_0x238118);return _0x5db5ea[_0x7bb0('0x25')]('Content-Range',_0x195b66+'-'+_0x357601+'/'+_0x1c8070)[_0x7bb0('0x20')](_0x165a24);}return null;};}function saveUpdates(_0x5b8cc1){return function(_0x457e3d){if(_0x457e3d){return _0x457e3d[_0x7bb0('0x26')](_0x5b8cc1)[_0x7bb0('0x13')](function(_0x200135){return _0x200135;});}return null;};}function removeEntity(_0x1a84f7){return function(_0x2f85d4){if(_0x2f85d4){return _0x2f85d4[_0x7bb0('0x27')]()[_0x7bb0('0x13')](function(){var _0x2be9d3=_0x2f85d4[_0x7bb0('0x28')]({'plain':!![]});var _0x344a60=_0x7bb0('0x29');return db['UserProfileResource'][_0x7bb0('0x27')]({'where':{'type':_0x344a60,'resourceId':_0x2be9d3['id']}})['then'](function(){return _0x2f85d4;});})[_0x7bb0('0x13')](function(){_0x1a84f7[_0x7bb0('0x1f')](0xcc)[_0x7bb0('0x2a')]();});}};}function handleEntityNotFound(_0x500de7){return function(_0x27f890){if(!_0x27f890){_0x500de7[_0x7bb0('0x1e')](0x194);}return _0x27f890;};}function handleError(_0x4f719f,_0x295846){_0x295846=_0x295846||0x1f4;return function(_0x2d1d06){logger[_0x7bb0('0x18')](_0x2d1d06[_0x7bb0('0x2b')]);if(_0x2d1d06['name']){delete _0x2d1d06[_0x7bb0('0x2c')];}_0x4f719f['status'](_0x295846)['send'](_0x2d1d06);};}exports['index']=function(_0x3bace3,_0x47ad58){var _0x54d519={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x34c9ad={},_0x39fa13={'count':0x0,'rows':[]};var _0x391ef6=_[_0x7bb0('0x2d')](db[_0x7bb0('0x2e')][_0x7bb0('0x2f')],function(_0x4b3d36){return{'name':_0x4b3d36['fieldName'],'type':_0x4b3d36[_0x7bb0('0x30')]['key']};});_0x34c9ad['model']=_[_0x7bb0('0x2d')](_0x391ef6,_0x7bb0('0x2c'));_0x34c9ad[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x3bace3[_0x7bb0('0x31')]);_0x34c9ad['filters']=_[_0x7bb0('0x33')](_0x34c9ad[_0x7bb0('0x34')],_0x34c9ad[_0x7bb0('0x31')]);_0x54d519[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x34c9ad[_0x7bb0('0x34')],qs[_0x7bb0('0x36')](_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x54d519[_0x7bb0('0x35')]=_0x54d519['attributes']['length']?_0x54d519[_0x7bb0('0x35')]:_0x34c9ad[_0x7bb0('0x34')];if(!_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x54d519['limit']=qs[_0x7bb0('0x24')](_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x54d519[_0x7bb0('0x21')]=qs['offset'](_0x3bace3['query'][_0x7bb0('0x21')]);}_0x54d519[_0x7bb0('0x39')]=qs['sort'](_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x54d519[_0x7bb0('0x3b')]=qs['filters'](_[_0x7bb0('0x3c')](_0x3bace3[_0x7bb0('0x31')],_0x34c9ad[_0x7bb0('0x3d')]),_0x391ef6);if(_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x54d519[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x54d519[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x391ef6,function(_0x378731){if(_0x378731['type']!==_0x7bb0('0x40')){var _0x4704ab={};_0x4704ab[_0x378731[_0x7bb0('0x2c')]]={'$like':'%'+_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x4704ab;}})});}_0x54d519=_[_0x7bb0('0x3f')]({},_0x54d519,_0x3bace3[_0x7bb0('0x41')]);var _0x64ac14={'where':_0x54d519[_0x7bb0('0x3b')]};return db[_0x7bb0('0x2e')][_0x7bb0('0x23')](_0x64ac14)[_0x7bb0('0x13')](function(_0x463c15){_0x39fa13[_0x7bb0('0x23')]=_0x463c15;if(_0x3bace3[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x54d519[_0x7bb0('0x43')]=[{'all':!![]}];}return db[_0x7bb0('0x2e')][_0x7bb0('0x44')](_0x54d519);})['then'](function(_0x4d6f8f){_0x39fa13[_0x7bb0('0x45')]=_0x4d6f8f;return _0x39fa13;})[_0x7bb0('0x13')](respondWithFilteredResult(_0x47ad58,_0x54d519))[_0x7bb0('0x1d')](handleError(_0x47ad58,null));};exports[_0x7bb0('0x46')]=function(_0x4164a7,_0x412839){var _0x4feaaf={'raw':![],'where':{'id':_0x4164a7['params']['id']},'include':[{'model':db[_0x7bb0('0x47')],'as':_0x7bb0('0x48')}]},_0x4fb3a4={};_0x4fb3a4[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0x2e')][_0x7bb0('0x2f')]);_0x4fb3a4[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x4164a7[_0x7bb0('0x31')]);_0x4fb3a4[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x4fb3a4[_0x7bb0('0x34')],_0x4fb3a4['query']);_0x4feaaf['attributes']=_[_0x7bb0('0x33')](_0x4fb3a4[_0x7bb0('0x34')],qs['fields'](_0x4164a7[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x4feaaf[_0x7bb0('0x35')]=_0x4feaaf[_0x7bb0('0x35')]['length']?_0x4feaaf[_0x7bb0('0x35')]:_0x4fb3a4[_0x7bb0('0x34')];if(_0x4164a7[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x4feaaf[_0x7bb0('0x43')]=[{'all':!![]}];}_0x4feaaf=_[_0x7bb0('0x3f')]({},_0x4feaaf,_0x4164a7['options']);return db[_0x7bb0('0x2e')]['find'](_0x4feaaf)[_0x7bb0('0x13')](handleEntityNotFound(_0x412839,null))[_0x7bb0('0x13')](respondWithResult(_0x412839,null))[_0x7bb0('0x1d')](handleError(_0x412839,null));};exports['create']=function(_0x2f9735,_0x2dd176){return db[_0x7bb0('0x2e')]['create'](_0x2f9735[_0x7bb0('0x49')],{})['then'](function(_0x271c15){var _0x517d57=_0x2f9735[_0x7bb0('0x4a')][_0x7bb0('0x28')]({'plain':!![]});if(!_0x517d57)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x517d57[_0x7bb0('0x4b')]===_0x7bb0('0x4a')){var _0x344635=_0x271c15['get']({'plain':!![]});var _0x3a855b=_0x7bb0('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x3a855b,'userProfileId':_0x517d57[_0x7bb0('0x4c')]},'raw':!![]})[_0x7bb0('0x13')](function(_0x2f7eba){if(_0x2f7eba&&_0x2f7eba[_0x7bb0('0x4d')]===0x0){return db[_0x7bb0('0x4e')]['create']({'name':_0x344635[_0x7bb0('0x2c')],'resourceId':_0x344635['id'],'type':_0x2f7eba[_0x7bb0('0x2c')],'sectionId':_0x2f7eba['id']},{})[_0x7bb0('0x13')](function(){return _0x271c15;});}else{return _0x271c15;}})[_0x7bb0('0x1d')](function(_0x1a3926){logger[_0x7bb0('0x18')](_0x7bb0('0x4f'),_0x1a3926);throw _0x1a3926;});}return _0x271c15;})[_0x7bb0('0x13')](respondWithResult(_0x2dd176,0xc9))[_0x7bb0('0x1d')](handleError(_0x2dd176,null));};exports[_0x7bb0('0x26')]=function(_0x3f3d8b,_0x13df31){if(_0x3f3d8b[_0x7bb0('0x49')]['id']){delete _0x3f3d8b[_0x7bb0('0x49')]['id'];}return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x3f3d8b[_0x7bb0('0x51')]['id']},'include':[{'model':db['Pause'],'as':_0x7bb0('0x48')}]})[_0x7bb0('0x13')](handleEntityNotFound(_0x13df31,null))[_0x7bb0('0x13')](saveUpdates(_0x3f3d8b[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x13df31,null))[_0x7bb0('0x1d')](handleError(_0x13df31,null));};exports[_0x7bb0('0x27')]=function(_0x49bb3d,_0x293081){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x49bb3d[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x293081,null))[_0x7bb0('0x13')](removeEntity(_0x293081,null))['catch'](handleError(_0x293081,null));};exports[_0x7bb0('0x52')]=function(_0x874741,_0x4e4975){return db[_0x7bb0('0x2e')][_0x7bb0('0x52')]()[_0x7bb0('0x13')](respondWithResult(_0x4e4975,null))[_0x7bb0('0x1d')](handleError(_0x4e4975,null));};exports[_0x7bb0('0x53')]=function(_0x210b02,_0x18453a){if(_0x210b02[_0x7bb0('0x49')]['id']){delete _0x210b02['body']['id'];}return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x210b02['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x18453a,null))[_0x7bb0('0x13')](function(_0x281605){if(_0x281605){_0x210b02[_0x7bb0('0x49')][_0x7bb0('0x54')]=_0x281605['id'];return db[_0x7bb0('0x55')][_0x7bb0('0x56')](_0x210b02[_0x7bb0('0x49')]);}})['then'](respondWithResult(_0x18453a,null))[_0x7bb0('0x1d')](handleError(_0x18453a,null));};exports[_0x7bb0('0x57')]=function(_0x2331bd,_0x1733c2){var _0x104cc0={'raw':![],'where':{}};var _0xae753={};var _0x4eb6b3={'count':0x0,'rows':[]};return db[_0x7bb0('0x2e')]['findOne']({'where':{'id':_0x2331bd[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1733c2,null))['then'](function(_0x52cc83){if(_0x52cc83){_0xae753[_0x7bb0('0x34')]=_['keys'](db[_0x7bb0('0x55')][_0x7bb0('0x2f')]);_0xae753['query']=_[_0x7bb0('0x32')](_0x2331bd[_0x7bb0('0x31')]);_0xae753['filters']=_[_0x7bb0('0x33')](_0xae753[_0x7bb0('0x34')],_0xae753['query']);_0x104cc0[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0xae753[_0x7bb0('0x34')],qs[_0x7bb0('0x36')](_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x104cc0['attributes']=_0x104cc0['attributes']['length']?_0x104cc0['attributes']:_0xae753[_0x7bb0('0x34')];if(!_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x104cc0[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x104cc0[_0x7bb0('0x21')]=qs[_0x7bb0('0x21')](_0x2331bd[_0x7bb0('0x31')]['offset']);}_0x104cc0[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x104cc0[_0x7bb0('0x3b')]=qs['filters'](_[_0x7bb0('0x3c')](_0x2331bd['query'],_0xae753[_0x7bb0('0x3d')]));_0x104cc0[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x52cc83['id'];if(_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x104cc0[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x104cc0[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x104cc0['attributes'],function(_0x2d34fa){var _0x14c8d2={};_0x14c8d2[_0x2d34fa]={'$like':'%'+_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x14c8d2;})});}_0x104cc0=_[_0x7bb0('0x3f')]({},_0x104cc0,_0x2331bd[_0x7bb0('0x41')]);return db['Disposition'][_0x7bb0('0x23')]({'where':_0x104cc0['where']})['then'](function(_0x23f0c0){_0x4eb6b3[_0x7bb0('0x23')]=_0x23f0c0;if(_0x2331bd[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x104cc0[_0x7bb0('0x43')]=[{'all':!![]}];}return db['Disposition'][_0x7bb0('0x44')](_0x104cc0);})[_0x7bb0('0x13')](function(_0x266feb){_0x4eb6b3[_0x7bb0('0x45')]=_0x266feb;return _0x4eb6b3;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0x1733c2,_0x104cc0))['catch'](handleError(_0x1733c2,null));};exports['removeDispositions']=function(_0x2cb799,_0x2124cc){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x2cb799[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x2124cc,null))[_0x7bb0('0x13')](function(_0x54bef6){if(_0x54bef6){return _0x54bef6['removeDispositions'](_0x2cb799[_0x7bb0('0x31')][_0x7bb0('0x58')]);}})[_0x7bb0('0x13')](respondWithStatusCode(_0x2124cc,null))['catch'](handleError(_0x2124cc,null));};exports[_0x7bb0('0x59')]=function(_0xbfa18f,_0x527a3f){if(_0xbfa18f[_0x7bb0('0x49')]['id']){delete _0xbfa18f[_0x7bb0('0x49')]['id'];}return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0xbfa18f[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x527a3f,null))[_0x7bb0('0x13')](function(_0x363b88){if(_0x363b88){_0xbfa18f[_0x7bb0('0x49')][_0x7bb0('0x54')]=_0x363b88['id'];return db[_0x7bb0('0x5a')][_0x7bb0('0x56')](_0xbfa18f['body']);}})['then'](respondWithResult(_0x527a3f,null))[_0x7bb0('0x1d')](handleError(_0x527a3f,null));};exports[_0x7bb0('0x5b')]=function(_0x57f84f,_0x2bfb91){var _0x257251={'raw':![],'where':{}};var _0x1151a5={};var _0x5b15f8={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x57f84f['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x2bfb91,null))[_0x7bb0('0x13')](function(_0x355514){if(_0x355514){_0x1151a5[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0x5a')][_0x7bb0('0x2f')]);_0x1151a5['query']=_[_0x7bb0('0x32')](_0x57f84f[_0x7bb0('0x31')]);_0x1151a5[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x1151a5[_0x7bb0('0x34')],_0x1151a5[_0x7bb0('0x31')]);_0x257251[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x1151a5['model'],qs[_0x7bb0('0x36')](_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x257251[_0x7bb0('0x35')]=_0x257251['attributes'][_0x7bb0('0x5c')]?_0x257251['attributes']:_0x1151a5[_0x7bb0('0x34')];if(!_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x257251[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x57f84f['query'][_0x7bb0('0x24')]);_0x257251[_0x7bb0('0x21')]=qs[_0x7bb0('0x21')](_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x21')]);}_0x257251[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x57f84f['query'][_0x7bb0('0x3a')]);_0x257251[_0x7bb0('0x3b')]=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x57f84f[_0x7bb0('0x31')],_0x1151a5['filters']));_0x257251[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x355514['id'];if(_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x257251[_0x7bb0('0x3b')]=_['merge'](_0x257251[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x257251['attributes'],function(_0x280504){var _0xba16cc={};_0xba16cc[_0x280504]={'$like':'%'+_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0xba16cc;})});}_0x257251=_[_0x7bb0('0x3f')]({},_0x257251,_0x57f84f['options']);return db['CannedAnswer'][_0x7bb0('0x23')]({'where':_0x257251[_0x7bb0('0x3b')]})['then'](function(_0x295aa7){_0x5b15f8[_0x7bb0('0x23')]=_0x295aa7;if(_0x57f84f[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x257251['include']=[{'all':!![]}];}return db[_0x7bb0('0x5a')][_0x7bb0('0x44')](_0x257251);})[_0x7bb0('0x13')](function(_0x1f25fb){_0x5b15f8[_0x7bb0('0x45')]=_0x1f25fb;return _0x5b15f8;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0x2bfb91,_0x257251))[_0x7bb0('0x1d')](handleError(_0x2bfb91,null));};exports[_0x7bb0('0x5d')]=function(_0x3185bd,_0x57ba61){return db[_0x7bb0('0x2e')]['find']({'where':{'id':_0x3185bd['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x57ba61,null))[_0x7bb0('0x13')](function(_0x113ef5){if(_0x113ef5){return _0x113ef5[_0x7bb0('0x5d')](_0x3185bd['query'][_0x7bb0('0x58')]);}})[_0x7bb0('0x13')](respondWithStatusCode(_0x57ba61,null))['catch'](handleError(_0x57ba61,null));};exports[_0x7bb0('0x5e')]=function(_0x3e5f3c,_0x346afd){_0x3e5f3c[_0x7bb0('0x49')][_0x7bb0('0x5f')]=_0x3e5f3c[_0x7bb0('0x60')][_0x7bb0('0x61')];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x3e5f3c[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x346afd,null))[_0x7bb0('0x13')](saveUpdates(_0x3e5f3c['body'],null))[_0x7bb0('0x13')](respondWithResult(_0x346afd,null))['catch'](handleError(_0x346afd,null));};exports['addAvatar']=function(_0x374491,_0x5ca5f3){_0x374491[_0x7bb0('0x49')]['agentAvatar']=_0x374491[_0x7bb0('0x60')][_0x7bb0('0x61')];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x374491[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x5ca5f3,null))[_0x7bb0('0x13')](saveUpdates(_0x374491[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x5ca5f3,null))[_0x7bb0('0x1d')](handleError(_0x5ca5f3,null));};exports[_0x7bb0('0x62')]=function(_0x28fbdd,_0x2b7bc8){_0x28fbdd[_0x7bb0('0x49')]['customerAvatar']=_0x28fbdd[_0x7bb0('0x60')]['filename'];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x28fbdd[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x2b7bc8,null))[_0x7bb0('0x13')](saveUpdates(_0x28fbdd[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x2b7bc8,null))[_0x7bb0('0x1d')](handleError(_0x2b7bc8,null));};exports[_0x7bb0('0x63')]=function(_0x53c1a0,_0x33bdab){_0x53c1a0[_0x7bb0('0x49')]['systemAvatar']=_0x53c1a0[_0x7bb0('0x60')][_0x7bb0('0x61')];return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x53c1a0['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x33bdab,null))[_0x7bb0('0x13')](saveUpdates(_0x53c1a0[_0x7bb0('0x49')],null))[_0x7bb0('0x13')](respondWithResult(_0x33bdab,null))[_0x7bb0('0x1d')](handleError(_0x33bdab,null));};exports['getLogo']=function(_0x178287,_0x16e02b){var _0x5e0fb5=path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x66'));var _0x1fefa8={'where':{'id':_0x178287[_0x7bb0('0x51')]['id']},'attributes':['id',_0x7bb0('0x5f')],'raw':!![]};var _0x2d1dfd=![];return require(_0x7bb0('0x67'))[_0x7bb0('0x68')]()[_0x7bb0('0x13')](function(_0x10c0fd){if(_0x10c0fd){_0x2d1dfd=_0x10c0fd[_0x7bb0('0x69')];}})['then'](function(){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')](_0x1fefa8);})[_0x7bb0('0x13')](handleEntityNotFound(_0x16e02b,null))[_0x7bb0('0x13')](function(_0x925cb2){if(_0x925cb2){if(!_[_0x7bb0('0x6a')](_0x925cb2[_0x7bb0('0x5f')])){if(fs[_0x7bb0('0x6b')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x6c'),_0x925cb2['sitepic']))&&_0x2d1dfd){_0x5e0fb5=path[_0x7bb0('0x64')](config['root'],_0x7bb0('0x6c'),_0x925cb2[_0x7bb0('0x5f')]);}}return _0x16e02b[_0x7bb0('0x6d')](_0x5e0fb5);}})[_0x7bb0('0x1d')](handleError(_0x16e02b,null));};exports[_0x7bb0('0x6e')]=function(_0x1784da,_0x40a89f){var _0x1ec56a=path['join'](config[_0x7bb0('0x65')],'server/files/images/avatars/default_avatar.png');var _0x24e813={'where':{'id':_0x1784da[_0x7bb0('0x51')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x7bb0('0x2e')][_0x7bb0('0x50')](_0x24e813)['then'](handleEntityNotFound(_0x40a89f,null))[_0x7bb0('0x13')](function(_0x5ba35c){if(_0x5ba35c){if(!_[_0x7bb0('0x6a')](_0x5ba35c[_0x7bb0('0x6f')])){if(fs['existsSync'](path['join'](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x5ba35c['agentAvatar']))){_0x1ec56a=path['join'](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x5ba35c[_0x7bb0('0x6f')]);}}return _0x40a89f[_0x7bb0('0x6d')](_0x1ec56a);}})[_0x7bb0('0x1d')](handleError(_0x40a89f,null));};exports[_0x7bb0('0x71')]=function(_0x112db7,_0x2fe0ec){var _0x27c092=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x17d809={'where':{'id':_0x112db7[_0x7bb0('0x51')]['id']},'attributes':['id',_0x7bb0('0x72'),_0x7bb0('0x73')],'raw':!![]};return db['ChatWebsite'][_0x7bb0('0x50')](_0x17d809)['then'](handleEntityNotFound(_0x2fe0ec,null))[_0x7bb0('0x13')](function(_0x4169dd){if(_0x4169dd){if(!_['isNil'](_0x4169dd['customerAvatar'])){if(fs['existsSync'](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x4169dd['customerAvatar']))&&_0x4169dd[_0x7bb0('0x73')]){_0x27c092=path['join'](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0x4169dd['customerAvatar']);}}return _0x2fe0ec[_0x7bb0('0x6d')](_0x27c092);}})[_0x7bb0('0x1d')](handleError(_0x2fe0ec,null));};exports['getSystemAvatar']=function(_0x293d3b,_0x544b82){var _0x47868f=path[_0x7bb0('0x64')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x28e9e2={'where':{'id':_0x293d3b[_0x7bb0('0x51')]['id']},'attributes':['id',_0x7bb0('0x74')],'raw':!![]};return db[_0x7bb0('0x2e')][_0x7bb0('0x50')](_0x28e9e2)[_0x7bb0('0x13')](handleEntityNotFound(_0x544b82,null))[_0x7bb0('0x13')](function(_0xb7285e){if(_0xb7285e){if(!_[_0x7bb0('0x6a')](_0xb7285e['systemAvatar'])){if(fs[_0x7bb0('0x6b')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0x70'),_0xb7285e['systemAvatar']))){_0x47868f=path[_0x7bb0('0x64')](config['root'],_0x7bb0('0x70'),_0xb7285e[_0x7bb0('0x74')]);}}return _0x544b82[_0x7bb0('0x6d')](_0x47868f);}})['catch'](handleError(_0x544b82,null));};exports['notify']=function(_0x17eeea,_0x8229ef){var _0x2a5f21=require(_0x7bb0('0x75'));var _0x474eb3=new _0x2a5f21();var _0x66e01c=_0x474eb3[_0x7bb0('0x76')](_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x78')])['getResult']();var _0x159567={'body':_0x17eeea[_0x7bb0('0x49')],'channel':_0x7bb0('0x79')};var _0x7afb45=[];var _0x3e37de=[];var _0x3b25fb={};var _0x4b64d2=![];return db['CmContact'][_0x7bb0('0x52')]()[_0x7bb0('0x13')](function(_0x1f5e4c){if(!_0x1f5e4c){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x7c'));}_0x7afb45=_['difference'](_[_0x7bb0('0x32')](_0x1f5e4c),[_0x7bb0('0x7d'),_0x7bb0('0x7e')]);_0x3e37de=_[_0x7bb0('0x7f')](_['keys'](_0x1f5e4c),[_0x7bb0('0x7d'),_0x7bb0('0x7e'),'CompanyId','ListId']);if(_0x17eeea[_0x7bb0('0x49')]['id']){delete _0x17eeea[_0x7bb0('0x49')]['id'];}if(_[_0x7bb0('0x6a')](_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x80')])){throw new db[(_0x7bb0('0x7a'))]['ValidationError'](_0x7bb0('0x81'));}if(_['isNil'](_0x17eeea['body'][_0x7bb0('0x49')])||_0x17eeea['body'][_0x7bb0('0x49')]===''){throw new db['Sequelize']['ValidationError'](_0x7bb0('0x82'));}if(_[_0x7bb0('0x6a')](_0x17eeea[_0x7bb0('0x49')]['mapKey'])){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e37de);}if(!_[_0x7bb0('0x83')](_0x3e37de,_0x17eeea[_0x7bb0('0x49')]['mapKey'])){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x84')+_0x3e37de);}_0x3b25fb[_0x17eeea['body'][_0x7bb0('0x85')]]=_0x17eeea[_0x7bb0('0x49')]['from'];})[_0x7bb0('0x13')](function(){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x17eeea[_0x7bb0('0x51')]['id']},'include':[{'model':db[_0x7bb0('0x86')],'as':_0x7bb0('0x87'),'include':[{'model':db[_0x7bb0('0x88')],'as':_0x7bb0('0x89'),'where':_0x3b25fb,'limit':0x1,'order':[[_0x7bb0('0x7e'),_0x7bb0('0x8a')]]}]},{'model':db[_0x7bb0('0x8b')],'as':_0x7bb0('0x8c')}]});})['then'](handleEntityNotFound(_0x8229ef,null))[_0x7bb0('0x13')](function(_0x499590){if(_0x499590&&_0x499590[_0x7bb0('0x87')]){_0x159567[_0x7bb0('0x8d')]=_0x499590;_0x159567['applications']=_0x499590[_0x7bb0('0x8c')];_0x159567[_0x7bb0('0x8e')]=_0x499590[_0x7bb0('0x87')];_0x159567[_0x7bb0('0x8f')]=_[_0x7bb0('0x90')](_0x159567[_0x7bb0('0x8f')],['priority'],['asc']);if(_0x159567['account'][_0x7bb0('0x8c')]){delete _0x159567[_0x7bb0('0x8d')][_0x7bb0('0x8c')];}if(_0x159567[_0x7bb0('0x8d')][_0x7bb0('0x87')]&&_0x159567[_0x7bb0('0x8d')]['List']['Contacts'][_0x7bb0('0x5c')]){return _0x159567[_0x7bb0('0x8d')][_0x7bb0('0x87')][_0x7bb0('0x89')][0x0];}var _0x42b9bd=_[_0x7bb0('0xc')](_0x17eeea['body'],{'firstName':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x80')],'ListId':_0x499590[_0x7bb0('0x91')]});_0x42b9bd[_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x85')]]=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x80')];return db['CmContact'][_0x7bb0('0x56')](_0x42b9bd,{'fields':_0x7afb45,'raw':!![]});}})['then'](handleEntityNotFound(_0x8229ef,null))[_0x7bb0('0x13')](function(_0x877b33){_0x159567[_0x7bb0('0x92')]=_0x877b33;var _0x2c23c4=_0x17eeea[_0x7bb0('0x49')]['customerIp'];if(_0x17eeea[_0x7bb0('0x77')]['cf-connecting-ip']){_0x2c23c4=_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x93')];}else if(_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x94')]){_0x2c23c4=_['first'](_0x17eeea['headers']['x-forwarded-for']['split'](','));}if(_0x877b33){var _0x2a3206={'ContactId':_0x877b33['id'],'ChatWebsiteId':_0x17eeea[_0x7bb0('0x51')]['id'],'from':(_0x877b33[_0x7bb0('0x95')]||'')+'\x20'+(_0x877b33[_0x7bb0('0x96')]||''),'customerIp':_0x2c23c4,'customerPort':_0x17eeea[_0x7bb0('0x77')]['x-real-port']?_0x17eeea[_0x7bb0('0x77')][_0x7bb0('0x97')]:null,'referer':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x98')],'browserName':_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x2c')]&&_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x9a')]?util[_0x7bb0('0x9b')](_0x7bb0('0x9c'),_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x2c')],_0x66e01c[_0x7bb0('0x99')][_0x7bb0('0x9a')]):'unknown','browserVersion':_0x66e01c[_0x7bb0('0x99')]['version']||_0x7bb0('0x9d'),'osName':util[_0x7bb0('0x9b')](_0x7bb0('0x9c'),_0x66e01c['os'][_0x7bb0('0x2c')],_0x66e01c['os'][_0x7bb0('0x9a')]),'osVersion':_0x66e01c['os'][_0x7bb0('0x9a')],'deviceModel':_0x66e01c['device']['model']&&_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x9f')]?util[_0x7bb0('0x9b')](_0x7bb0('0xa0'),_0x66e01c[_0x7bb0('0x9e')]['model'],_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x9f')],_0x66e01c[_0x7bb0('0x9e')]['type']):null,'deviceVendor':_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x9f')],'deviceType':_0x66e01c[_0x7bb0('0x9e')][_0x7bb0('0x30')],'formData':JSON[_0x7bb0('0x17')](_0x17eeea[_0x7bb0('0x49')])};var _0x471b08={'ChatWebsiteId':_0x17eeea['params']['id'],'closed':![]};if(_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa1')]){_0x471b08['threadId']=_0x17eeea['body'][_0x7bb0('0xa1')];return db[_0x7bb0('0xa2')][_0x7bb0('0x50')]({'where':_0x471b08})[_0x7bb0('0x13')](function(_0x262849){if(_0x262849){return[_0x262849,![]];}_0x2a3206[_0x7bb0('0xa1')]=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa1')];_0x2a3206[_0x7bb0('0xa3')]=_0x17eeea[_0x7bb0('0x49')]['externalUrl'];return db[_0x7bb0('0xa2')][_0x7bb0('0x56')](_0x2a3206)['then'](function(_0x5a0ef7){return[_0x5a0ef7,!![]];});});}_0x471b08[_0x7bb0('0xa4')]=_0x877b33['id'];if(_0x17eeea['body']['interaction']&&_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa5')]['id']){_0x471b08['id']=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa5')]['id'];return db[_0x7bb0('0xa2')]['find']({'where':_0x471b08})[_0x7bb0('0x13')](function(_0x45aa5b){if(_0x45aa5b){return[_0x45aa5b,![]];}return db[_0x7bb0('0xa2')][_0x7bb0('0x56')](_0x2a3206)[_0x7bb0('0x13')](function(_0x10f59d){return[_0x10f59d,!![]];});});}return db['ChatInteraction'][_0x7bb0('0x56')](_0x2a3206)[_0x7bb0('0x13')](function(_0x3389a5){return[_0x3389a5,!![]];});}})[_0x7bb0('0xa6')](function(_0x132f4f,_0x3aa2b2){if(_0x132f4f){_0x4b64d2=_0x3aa2b2;if(!_0x3aa2b2){var _0x2a2e5e={'from':(_0x159567[_0x7bb0('0x92')]['firstName']||'')+'\x20'+(_0x159567[_0x7bb0('0x92')][_0x7bb0('0x96')]||'')};if(_0x17eeea['body'][_0x7bb0('0xa1')]&&_0x17eeea[_0x7bb0('0x49')]['messageId']&&_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa1')]!=_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xa7')]){_0x2a2e5e[_0x7bb0('0xa1')]=_0x17eeea[_0x7bb0('0x49')]['messageId'];}return _0x132f4f[_0x7bb0('0x26')](_0x2a2e5e);}else{return _0x132f4f;}}})[_0x7bb0('0x13')](function(_0x1de5be){_0x159567[_0x7bb0('0xa5')]=_0x1de5be[_0x7bb0('0x28')]({'plain':!![]});_0x159567[_0x7bb0('0xa5')][_0x7bb0('0xa8')]=_0x4b64d2;if(_0x159567['interaction'][_0x7bb0('0xa8')]){if(_0x159567[_0x7bb0('0x8d')][_0x7bb0('0xa9')]){_0x159567['applications'][_0x7bb0('0xaa')]({'id':0x0,'priority':_0x159567[_0x7bb0('0x8f')]['length']+0x1,'app':_0x7bb0('0xab'),'appdata':_0x7bb0('0xac'),'interval':_0x7bb0('0xad')});}}return db['ChatMessage'][_0x7bb0('0x56')]({'body':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0x49')],'ChatWebsiteId':_0x17eeea[_0x7bb0('0x51')]['id'],'ChatInteractionId':_0x1de5be['id'],'direction':'in','ContactId':_0x159567[_0x7bb0('0x92')]['id'],'AttachmentId':_0x17eeea[_0x7bb0('0x49')][_0x7bb0('0xae')]});})[_0x7bb0('0x13')](function(_0x442347){_0x159567['message']=_0x442347;if(_0x159567[_0x7bb0('0xa5')][_0x7bb0('0xaf')]){return db[_0x7bb0('0xb0')][_0x7bb0('0x50')]({'attributes':['id',_0x7bb0('0x2c')],'where':{'id':_0x159567[_0x7bb0('0xa5')][_0x7bb0('0xaf')]}})[_0x7bb0('0x13')](function(_0x3e925c){if(_0x3e925c){_0x159567[_0x7bb0('0x8f')][_0x7bb0('0xb1')]({'id':0x0,'priority':0x0,'app':_0x7bb0('0xb2'),'appdata':_0x3e925c[_0x7bb0('0x2c')]+','+(_0x159567['account'][_0x7bb0('0xb3')]||0xa),'interval':_0x7bb0('0xad')});_0x159567[_0x7bb0('0xb4')]=!![];}return respondWithRpcPromise('Start',_0x7bb0('0xb5'),_0x159567);});}return respondWithRpcPromise('Start',_0x7bb0('0xb5'),_0x159567);})[_0x7bb0('0x13')](function(_0xc33a79){respondWithRpcPromise('EventManager','EventManager',{'event':_0x7bb0('0xb6'),'message':_0xc33a79},client9002);return _0xc33a79;})['then'](respondWithResult(_0x8229ef,null))['catch'](handleError(_0x8229ef,null));};exports['offline']=function(_0x48ae89,_0x5013cb){var _0x2dbd27,_0x2f60ba,_0x2b27fb;var _0x4225b4=[];var _0x2ddd59={};var _0x4bdb96=_0x48ae89[_0x7bb0('0xb7')]||[];var _0x553765=[];var _0x4420b1;return db[_0x7bb0('0x88')]['describe']()[_0x7bb0('0x13')](function(_0x4ca351){if(!_0x4ca351){throw new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x7c'));}_0x4225b4=_[_0x7bb0('0x7f')](_['keys'](_0x4ca351),[_0x7bb0('0x7d'),_0x7bb0('0x7e'),'CompanyId',_0x7bb0('0x91')]);if(_0x48ae89[_0x7bb0('0x49')]['id']){delete _0x48ae89[_0x7bb0('0x49')]['id'];}if(_[_0x7bb0('0x6a')](_0x48ae89['body'][_0x7bb0('0x80')])){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)[_0x7bb0('0xb8')](new db['Sequelize'][(_0x7bb0('0x7b'))]('from\x20is\x20mandatory'));}if(_[_0x7bb0('0x6a')](_0x48ae89['body'][_0x7bb0('0x49')])||_0x48ae89['body']['body']===''){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)['send'](new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0x82')));}if(_['isNil'](_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0xb9')])){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)[_0x7bb0('0xb8')](new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0xba')+_0x4225b4));}if(!_[_0x7bb0('0x83')](_0x4225b4,_0x48ae89[_0x7bb0('0x49')]['mapKeyOffline'])){throw _0x5013cb[_0x7bb0('0x1f')](0x1f4)[_0x7bb0('0xb8')](new db[(_0x7bb0('0x7a'))][(_0x7bb0('0x7b'))](_0x7bb0('0xbb')+_0x4225b4));}_0x2ddd59[_0x48ae89['body'][_0x7bb0('0xb9')]]=_0x48ae89['body'][_0x7bb0('0x80')];})[_0x7bb0('0x13')](function(){return db['ChatWebsite'][_0x7bb0('0x50')]({'where':{'id':_0x48ae89[_0x7bb0('0x51')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x7bb0('0xbc')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x5013cb,null))[_0x7bb0('0x13')](function(_0x23c1b6){if(_0x23c1b6&&_0x23c1b6[_0x7bb0('0x87')]){_0x2f60ba=_0x23c1b6;var _0x2dd5ec=_['defaults'](_0x48ae89[_0x7bb0('0x49')],{'firstName':_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0x80')],'phone':_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0x80')],'ListId':_0x23c1b6[_0x7bb0('0x91')]});_0x2dd5ec[_0x48ae89[_0x7bb0('0x49')][_0x7bb0('0xb9')]]=_0x48ae89['body'][_0x7bb0('0x80')];return db['CmContact'][_0x7bb0('0xbd')]({'where':_0x2ddd59,'defaults':_0x2dd5ec});}})[_0x7bb0('0xa6')](function(_0x29afff){if(_0x29afff){_0x2b27fb=_0x29afff;var _0xfa1d9d=fs[_0x7bb0('0xbe')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0xbf')),_0x7bb0('0xc0'));var _0x25657e=ejs[_0x7bb0('0xc1')](_0xfa1d9d,{'body':_[_0x7bb0('0xc2')](_0x48ae89['body'][_0x7bb0('0x49')]),'bodyTitle':_0x2f60ba[_0x7bb0('0xc3')]});return db[_0x7bb0('0xc4')][_0x7bb0('0x56')]({'body':_0x25657e,'plainBody':htmlToText['fromString'](_0x25657e),'ContactId':_0x29afff['id'],'ChatWebsiteId':_0x2f60ba['id']});}})[_0x7bb0('0x13')](function(_0x33b1df){_0x4420b1=_0x33b1df;if(_0x4bdb96[_0x7bb0('0x5c')]){var _0x3b8e1e=_0x4bdb96[_0x7bb0('0x2d')](function(_0x127e29){return{'name':_0x127e29[_0x7bb0('0xc5')],'basename':_0x127e29[_0x7bb0('0x61')],'type':_0x127e29[_0x7bb0('0xc6')],'ChatOfflineMessageId':_0x33b1df['id']};});_0x553765=_0x3b8e1e['map'](_0x3febcf=>{var _0x4c6f0c={'filename':_0x3febcf[_0x7bb0('0x2c')],'path':path[_0x7bb0('0x64')](config['root'],'server',_0x7bb0('0xb7'),'attachments',_0x7bb0('0xc7'),_0x3febcf[_0x7bb0('0xc8')])};return _0x4c6f0c;});if(!_0x2f60ba[_0x7bb0('0xc9')]){return db[_0x7bb0('0xca')][_0x7bb0('0xcb')](function(_0x2e1ff7){return db[_0x7bb0('0xcc')][_0x7bb0('0xcd')](_0x3b8e1e,{'transaction':_0x2e1ff7});});}}})[_0x7bb0('0x13')](function(){if(_0x4420b1){_0x2dbd27=_0x4420b1;return db[_0x7bb0('0xbc')][_0x7bb0('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0x7bb0('0xcf')],'as':_0x7bb0('0xd0'),'raw':!![],'include':[{'model':db[_0x7bb0('0xd1')],'as':_0x7bb0('0xd1'),'raw':!![]}]}]});}})['then'](function(_0x3ff717){if(_0x3ff717&&_0x3ff717[_0x7bb0('0xd0')]&&_0x2f60ba['forwardOffline']&&_0x2f60ba[_0x7bb0('0xd2')]){var _0x3b3c71=_0x3ff717[_0x7bb0('0xd3')]();return respondWithRpcPromise(_0x7bb0('0xd4'),_0x7bb0('0xd5'),{'account':_0x3b3c71,'message':{'from':util[_0x7bb0('0x9b')]('\x22%s\x22\x20<%s>',_0x3ff717['name'],_0x3ff717[_0x7bb0('0xd6')]||_0x3ff717[_0x7bb0('0xd0')][_0x7bb0('0x4a')]),'to':_0x2f60ba['forwardOfflineAddress'],'subject':_0x2f60ba[_0x7bb0('0xd7')],'html':_0x2dbd27['body'],'attachments':_0x553765}},client9003)[_0x7bb0('0x13')](function(){return _0x2dbd27;})[_0x7bb0('0x1d')](function(_0x2d6d46){logger['error'](_0x2d6d46);});}})['then'](function(){if(_0x2f60ba&&_0x2f60ba['openNewInteraction']&&_0x2f60ba[_0x7bb0('0xd8')]){var _0x3bdfef=[];if(_0x4bdb96[_0x7bb0('0x5c')]){_0x3bdfef=_0x4bdb96[_0x7bb0('0x2d')](function(_0x551bdc){return{'name':_0x551bdc[_0x7bb0('0xc5')],'basename':_0x551bdc['filename'],'type':_0x551bdc[_0x7bb0('0xc6')],'ChatOfflineMessageId':_0x4420b1['id']};});}var _0x216456;if(!_['isNil'](_0x2f60ba[_0x7bb0('0xd9')])){var _0x59fa34=_[_0x7bb0('0x2d')](_0x48ae89[_0x7bb0('0x49')],function(_0x303b5d){return _0x303b5d;});var _0x212e14=_['toPairsIn'](_0x59fa34)[0x0];var _0x3fbb06=_[_0x7bb0('0xda')](_0x212e14,function(_0x2dd7c0){return _0x2dd7c0;});_0x216456=_0x3fbb06[0x1][_0x2f60ba[_0x7bb0('0xd9')]];}var _0x4f33b5={'from':_0x2b27fb['email'],'firstName':_0x2b27fb[_0x7bb0('0x95')],'lastName':_0x2b27fb[_0x7bb0('0x96')],'mapKey':_0x7bb0('0xd6'),'message':{'from':_0x2b27fb[_0x7bb0('0xd6')],'to':_0x2f60ba[_0x7bb0('0xbc')][_0x7bb0('0xd6')],'cc':'','subject':_[_0x7bb0('0x6a')](_0x216456)?_0x2f60ba[_0x7bb0('0xd7')]:_0x216456,'messageId':'','sentAt':new Date(),'attach':_0x3bdfef[_0x7bb0('0x5c')],'attachments':_0x3bdfef,'originChannel':_0x7bb0('0xdb'),'ChatWebsiteId':_0x2f60ba['id'],'ChatOfflineMessageId':_0x2dbd27['id'],'originTo':_0x2f60ba[_0x7bb0('0xbc')][_0x7bb0('0xd6')]},'body':_0x2dbd27[_0x7bb0('0x49')]};var _0x546f7f={'account':{'id':_0x2f60ba[_0x7bb0('0xd8')]},'body':_0x4f33b5,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x7bb0('0xdc'),_0x7bb0('0xdd'),_0x546f7f,client9001)['then'](function(){return _0x2dbd27;})[_0x7bb0('0x1d')](function(_0x16b47a){logger[_0x7bb0('0x18')](_0x16b47a);});}return;})[_0x7bb0('0x13')](function(){if(_0x2dbd27){return _0x2dbd27;}})[_0x7bb0('0x13')](respondWithResult(_0x5013cb,null))['catch'](function(_0x4fe59a){logger[_0x7bb0('0x18')]('catch',_0x4fe59a);for(var _0x3f3d0b of _0x4bdb96){var _0x4e2cf5=path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0xde'),_0x7bb0('0xb7'),_0x7bb0('0xdf'),_0x7bb0('0xc7'),_0x3f3d0b[_0x7bb0('0x61')]);fs_extra[_0x7bb0('0xe0')](_0x4e2cf5)['catch'](function(_0x5c0c70){logger['error'](_0x7bb0('0xe1'),_0x4e2cf5,_0x5c0c70);});}});};exports['addInteraction']=function(_0x612c04,_0x56c520){return db[_0x7bb0('0xa2')]['find']({'where':{'id':_0x612c04[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x56c520,null))['then'](function(_0x526264){if(_0x526264){return _0x526264[_0x7bb0('0xe2')](_0x612c04['body'][_0x7bb0('0x58')],_[_0x7bb0('0xe3')](_0x612c04['body'],[_0x7bb0('0x58'),'id'])||{});}})[_0x7bb0('0x13')](respondWithResult(_0x56c520,null))[_0x7bb0('0x1d')](handleError(_0x56c520,null));};exports['getInteractions']=function(_0x56b0ad,_0x1044c7){var _0x44f909={'raw':![],'where':{}};var _0x2bdfdd={};var _0x56f2c2={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x7bb0('0xce')]({'where':{'id':_0x56b0ad[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1044c7,null))['then'](function(_0x20da56){if(_0x20da56){_0x2bdfdd[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0xa2')][_0x7bb0('0x2f')]);_0x2bdfdd[_0x7bb0('0x31')]=_['keys'](_0x56b0ad[_0x7bb0('0x31')]);_0x2bdfdd[_0x7bb0('0x3d')]=_['intersection'](_0x2bdfdd[_0x7bb0('0x34')],_0x2bdfdd[_0x7bb0('0x31')]);_0x44f909[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x2bdfdd['model'],qs[_0x7bb0('0x36')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x44f909['attributes']=_0x44f909[_0x7bb0('0x35')]['length']?_0x44f909['attributes']:_0x2bdfdd[_0x7bb0('0x34')];if(!_0x56b0ad['query'][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x44f909[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x44f909['offset']=qs[_0x7bb0('0x21')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x21')]);}_0x44f909[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x44f909['where']=qs['filters'](_[_0x7bb0('0x3c')](_0x56b0ad[_0x7bb0('0x31')],_0x2bdfdd['filters']));_0x44f909[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x20da56['id'];if(_0x56b0ad[_0x7bb0('0x31')]['filter']){_0x44f909['where']=_['merge'](_0x44f909[_0x7bb0('0x3b')],{'$or':_['map'](_0x44f909[_0x7bb0('0x35')],function(_0x47338a){var _0x275de0={};_0x275de0[_0x47338a]={'$like':'%'+_0x56b0ad['query'][_0x7bb0('0x3e')]+'%'};return _0x275de0;})});}_0x44f909=_[_0x7bb0('0x3f')]({},_0x44f909,_0x56b0ad[_0x7bb0('0x41')]);return db[_0x7bb0('0xa2')]['count']({'where':_0x44f909[_0x7bb0('0x3b')]})[_0x7bb0('0x13')](function(_0x47ac69){_0x56f2c2[_0x7bb0('0x23')]=_0x47ac69;if(_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x44f909[_0x7bb0('0x43')]=[{'model':db[_0x7bb0('0x88')],'as':_0x7bb0('0xe4'),'required':![]},{'model':db[_0x7bb0('0xb0')],'as':_0x7bb0('0xe5'),'attributes':[_0x7bb0('0x2c'),_0x7bb0('0xe6'),_0x7bb0('0xe7')],'required':![]},{'model':db[_0x7bb0('0xe8')],'as':_0x7bb0('0xe9'),'attributes':['id',_0x7bb0('0x2c'),_0x7bb0('0xea')],'where':_0x56b0ad['query'][_0x7bb0('0xeb')]?{'id':_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0xeb')]}:undefined,'required':_0x56b0ad[_0x7bb0('0x31')][_0x7bb0('0xeb')]?!![]:![]}];}return db[_0x7bb0('0xa2')][_0x7bb0('0x44')](_0x44f909);})[_0x7bb0('0x13')](function(_0x40ccb3){_0x56f2c2['rows']=_0x40ccb3;return _0x56f2c2;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0x1044c7,_0x44f909))[_0x7bb0('0x1d')](handleError(_0x1044c7,null));};function iftimePromise(_0x14bc81,_0x36b329){return respondWithRpcPromise(_0x7bb0('0xec'),_0x7bb0('0xed'),{'command':_0x36b329[_0x7bb0('0xee')]?util[_0x7bb0('0x9b')](_0x7bb0('0xef'),_0x14bc81[_0x7bb0('0xf0')],_0x36b329['timezone']):util[_0x7bb0('0x9b')](_0x7bb0('0xf1'),_0x14bc81[_0x7bb0('0xf0')])},client9002)['then'](function(_0x276f41){var _0x324498=_0x276f41&&_0x276f41['indexOf'](_0x7bb0('0xf2'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x36b329['id'],_0x14bc81['id'],_0x14bc81['interval'],_0x324498?_0x7bb0('0xf3'):_0x7bb0('0xf4'),_0x36b329[_0x7bb0('0xee')]?_0x36b329[_0x7bb0('0xee')]:_0x7bb0('0xf5'));return _0x324498;})[_0x7bb0('0x1d')](function(_0x4d5352){logger[_0x7bb0('0x18')](_0x7bb0('0xf6'),_0x36b329['id'],_0x14bc81['id'],_0x14bc81['interval'],util['inspect'](_0x4d5352,{'showHidden':![],'depth':null}),_0x36b329['timezone']?_0x36b329[_0x7bb0('0xee')]:_0x7bb0('0xf5'));return![];});}exports[_0x7bb0('0xed')]=function(_0x4ee46c,_0x21af01){var _0xbe6035=0x0;var _0x2cd9fc=0x0;var _0x3591eb=![];var _0x3ce8da;var _0x512fb2;return db[_0x7bb0('0x2e')]['find']({'where':{'id':_0x4ee46c[_0x7bb0('0x51')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x7bb0('0xf0')],'raw':!![]}]}]})[_0x7bb0('0x13')](handleEntityNotFound(_0x21af01,null))[_0x7bb0('0x13')](function(_0x52596f){if(_0x52596f){_0x3ce8da=_0x52596f;return _0x52596f[_0x7bb0('0xf7')]({'raw':!![]});}})[_0x7bb0('0x13')](function(_0xff378c){if(_0x3ce8da){if(_0xff378c){_0x512fb2=_0xff378c;}}return require('../../config/license/util')[_0x7bb0('0x68')]();})[_0x7bb0('0x13')](function(_0x36fb06){if(_0x36fb06){_0x2cd9fc=_0x36fb06['virtual'];_0x3591eb=_0x36fb06[_0x7bb0('0x69')];}})[_0x7bb0('0x13')](function(){return db[_0x7bb0('0xa2')]['count']({'where':{'closed':![]}});})[_0x7bb0('0x13')](function(_0x1b528b){_0xbe6035=_0x1b528b;if(_0x2cd9fc&&_0x1b528b>_0x2cd9fc){return db[_0x7bb0('0xf8')][_0x7bb0('0xce')]({'where':{'id':0x1}})[_0x7bb0('0x13')](function(_0x3a1a94){if(_0x3a1a94){_0x3a1a94[_0x7bb0('0xf9')]('chatLicenseExceeded');}});}})[_0x7bb0('0x13')](function(){if(_0x3ce8da[_0x7bb0('0xfa')]&&_0x3ce8da['Interval'][_0x7bb0('0xfb')]){var _0x536c5e=[];for(var _0x1ae6b1=0x0;_0x1ae6b1<_0x3ce8da[_0x7bb0('0xfa')][_0x7bb0('0xfb')][_0x7bb0('0x5c')];_0x1ae6b1++){var _0x5ba3e2=_0x3ce8da['Interval'][_0x7bb0('0xfb')][_0x1ae6b1][_0x7bb0('0x28')]({'plain':!![]});_0x536c5e[_0x7bb0('0xaa')](iftimePromise(_0x5ba3e2,_0x3ce8da));}return BPromise['all'](_0x536c5e)[_0x7bb0('0x13')](function(_0xde3817){return _[_0x7bb0('0xfc')](_0xde3817);});}else{return!![];}})[_0x7bb0('0x13')](function(_0x108223){var _0x27e7f0=fs[_0x7bb0('0xbe')](path[_0x7bb0('0x64')](config[_0x7bb0('0x65')],_0x7bb0('0xfd')),_0x7bb0('0xc0'));var _0x1305de={'remote':_0x3ce8da['remote'],'query':querystring['stringify'](_[_0x7bb0('0x3f')](_0x3ce8da[_0x7bb0('0x28')]({'plain':!![]}),{'customerIp':_0x4ee46c[_0x7bb0('0x77')][_0x7bb0('0x94')]||_0x4ee46c[_0x7bb0('0x77')][_0x7bb0('0xfe')]||_0x4ee46c[_0x7bb0('0xff')]['remoteAddress']||_0x4ee46c['ip'],'referer':_0x4ee46c['headers'][_0x7bb0('0x98')],'openedInteractions':_0xbe6035,'maxInteractions':_0x2cd9fc,'virtual':_0x3591eb['virtual'],'online':_0x108223,'custom':_0x3591eb}))['replace'](/'/g,'\x5c\x27')};_0x21af01[_0x7bb0('0xb8')](ejs[_0x7bb0('0xc1')](Mustache['render'](_0x27e7f0,_0x1305de),{'proactiveActions':_0x512fb2,'alignment':_0x3ce8da[_0x7bb0('0x100')],'verticalAlignment':_0x3ce8da[_0x7bb0('0x101')],'div_color':_0x3ce8da['color'],'labelText':_0x3ce8da[_0x7bb0('0x102')],'text_color':_0x3ce8da[_0x7bb0('0x103')],'text_button_color':_0x3ce8da[_0x7bb0('0x104')],'button_color':_0x3ce8da[_0x7bb0('0x105')],'background_color':_0x3ce8da[_0x7bb0('0x106')],'hideWhenOffline':_0x3ce8da[_0x7bb0('0x107')],'interval':_0x3ce8da[_0x7bb0('0x108')]}));})['catch'](handleError(_0x21af01,null));};exports[_0x7bb0('0x109')]=function(_0x583e80,_0x153259){var _0x411d29=_0x583e80['params']['id'];var _0x269664=_0x583e80[_0x7bb0('0x49')];var _0x468569=0xc8;var _0x25dfa8=null;return db[_0x7bb0('0xca')][_0x7bb0('0xcb')]({'isolationLevel':db[_0x7bb0('0xca')][_0x7bb0('0x10a')][_0x7bb0('0x10b')][_0x7bb0('0x10c')]},function(_0x5c95b4){return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x411d29},'transaction':_0x5c95b4})[_0x7bb0('0x13')](function(_0x8d3ddd){if(_0x8d3ddd){return db[_0x7bb0('0x8b')]['destroy']({'where':{'ChatWebsiteId':_0x411d29},'transaction':_0x5c95b4})[_0x7bb0('0x13')](function(){var _0x4f3eaa=_['map'](_0x269664,function(_0xccc6a8){_0xccc6a8[_0x7bb0('0x54')]=_0x411d29;return _0xccc6a8;});return db[_0x7bb0('0x8b')][_0x7bb0('0xcd')](_0x4f3eaa,{'transaction':_0x5c95b4});});}else{_0x468569=0x194;_0x25dfa8=[];}});})['then'](function(){if(_0x468569!==0x194){return db[_0x7bb0('0x8b')][_0x7bb0('0x10d')]({'where':{'ChatWebsiteId':_0x411d29},'order':_0x7bb0('0x10e')})['then'](function(_0x10d460){_0x25dfa8=_0x10d460;});}})['catch'](function(_0x777ec4){_0x468569=0x1f4;logger['error'](_0x777ec4[_0x7bb0('0x2b')]);if(_0x777ec4['name']){delete _0x777ec4[_0x7bb0('0x2c')];}_0x25dfa8=_0x777ec4;})[_0x7bb0('0x10f')](function(){if(_0x25dfa8===null){_0x153259[_0x7bb0('0x1e')](_0x468569);}else{if(_0x468569===0x1f4){_0x153259[_0x7bb0('0x1f')](_0x468569)[_0x7bb0('0xb8')](_0x25dfa8);}else{_0x153259[_0x7bb0('0x1f')](_0x468569)[_0x7bb0('0x20')](_0x25dfa8);}}});};exports[_0x7bb0('0x110')]=function(_0x305fc9,_0x1ec35a){var _0x2d9a7f={};var _0x690130={};var _0x1019b8;var _0x246593;return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x305fc9[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1ec35a,null))['then'](function(_0x97b7d8){if(_0x97b7d8){_0x1019b8=_0x97b7d8;_0x690130['model']=_[_0x7bb0('0x32')](db[_0x7bb0('0x8b')][_0x7bb0('0x2f')]);_0x690130['query']=_[_0x7bb0('0x32')](_0x305fc9[_0x7bb0('0x31')]);_0x690130[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x690130[_0x7bb0('0x34')],_0x690130['query']);_0x2d9a7f['attributes']=_['intersection'](_0x690130['model'],qs[_0x7bb0('0x36')](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x2d9a7f[_0x7bb0('0x35')]=_0x2d9a7f[_0x7bb0('0x35')][_0x7bb0('0x5c')]?_0x2d9a7f['attributes']:_0x690130['model'];_0x2d9a7f[_0x7bb0('0x39')]=qs['sort'](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x2d9a7f[_0x7bb0('0x3b')]=qs['filters'](_[_0x7bb0('0x3c')](_0x305fc9[_0x7bb0('0x31')],_0x690130[_0x7bb0('0x3d')]));if(_0x305fc9['query'][_0x7bb0('0x3e')]){_0x2d9a7f[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x2d9a7f[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x2d9a7f[_0x7bb0('0x35')],function(_0xe22a10){var _0x3249b1={};_0x3249b1[_0xe22a10]={'$like':'%'+_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x3249b1;})});}_0x2d9a7f=_[_0x7bb0('0x3f')]({},_0x2d9a7f,_0x305fc9[_0x7bb0('0x41')]);return _0x1019b8['getApplications'](_0x2d9a7f);}})['then'](function(_0x185253){if(_0x185253){_0x246593=_0x185253[_0x7bb0('0x5c')];if(!_0x305fc9['query'][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x2d9a7f[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x2d9a7f['offset']=qs['offset'](_0x305fc9[_0x7bb0('0x31')][_0x7bb0('0x21')]);}return _0x1019b8[_0x7bb0('0x110')](_0x2d9a7f);}})[_0x7bb0('0x13')](function(_0x196ac2){if(_0x196ac2){return _0x196ac2?{'count':_0x246593,'rows':_0x196ac2}:null;}})[_0x7bb0('0x13')](respondWithResult(_0x1ec35a,null))['catch'](handleError(_0x1ec35a,null));};exports[_0x7bb0('0x111')]=function(_0x360d99,_0x24c849){return db[_0x7bb0('0x112')][_0x7bb0('0x50')]({'where':{'id':_0x360d99[_0x7bb0('0x51')]['id']}})['then'](handleEntityNotFound(_0x24c849,null))['then'](function(_0x48a3de){if(_0x48a3de){return _0x48a3de['addProactiveActions'](_0x360d99[_0x7bb0('0x49')][_0x7bb0('0x58')],_['omit'](_0x360d99[_0x7bb0('0x49')],[_0x7bb0('0x58'),'id'])||{});}})['then'](respondWithResult(_0x24c849,null))[_0x7bb0('0x1d')](handleError(_0x24c849,null));};exports[_0x7bb0('0xf7')]=function(_0x56296a,_0x3f1ff6){var _0x569386={};var _0x2b09aa={};var _0x3e87c9;var _0x27f656;return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x56296a[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x3f1ff6,null))[_0x7bb0('0x13')](function(_0x2b2a5d){if(_0x2b2a5d){_0x3e87c9=_0x2b2a5d;_0x2b09aa[_0x7bb0('0x34')]=_[_0x7bb0('0x32')](db[_0x7bb0('0x113')][_0x7bb0('0x2f')]);_0x2b09aa[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x56296a['query']);_0x2b09aa['filters']=_[_0x7bb0('0x33')](_0x2b09aa['model'],_0x2b09aa[_0x7bb0('0x31')]);_0x569386['attributes']=_[_0x7bb0('0x33')](_0x2b09aa['model'],qs[_0x7bb0('0x36')](_0x56296a['query'][_0x7bb0('0x36')]));_0x569386[_0x7bb0('0x35')]=_0x569386[_0x7bb0('0x35')]['length']?_0x569386[_0x7bb0('0x35')]:_0x2b09aa['model'];_0x569386[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x569386[_0x7bb0('0x3b')]=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x56296a['query'],_0x2b09aa[_0x7bb0('0x3d')]));if(_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x569386[_0x7bb0('0x3b')]=_['merge'](_0x569386[_0x7bb0('0x3b')],{'$or':_[_0x7bb0('0x2d')](_0x569386[_0x7bb0('0x35')],function(_0x319a83){var _0x2cddbb={};_0x2cddbb[_0x319a83]={'$like':'%'+_0x56296a['query'][_0x7bb0('0x3e')]+'%'};return _0x2cddbb;})});}_0x569386=_['merge']({},_0x569386,_0x56296a[_0x7bb0('0x41')]);return _0x3e87c9['getProactiveActions'](_0x569386);}})[_0x7bb0('0x13')](function(_0x3a6ab2){if(_0x3a6ab2){_0x27f656=_0x3a6ab2[_0x7bb0('0x5c')];if(!_0x56296a[_0x7bb0('0x31')]['hasOwnProperty'](_0x7bb0('0x38'))){_0x569386[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x569386['offset']=qs[_0x7bb0('0x21')](_0x56296a[_0x7bb0('0x31')][_0x7bb0('0x21')]);}return _0x3e87c9[_0x7bb0('0xf7')](_0x569386);}})[_0x7bb0('0x13')](function(_0x170c42){if(_0x170c42){return _0x170c42?{'count':_0x27f656,'rows':_0x170c42}:null;}})[_0x7bb0('0x13')](respondWithResult(_0x3f1ff6,null))['catch'](handleError(_0x3f1ff6,null));};exports[_0x7bb0('0x114')]=function(_0x595683,_0x1e517e){var _0x42487f=_0x595683[_0x7bb0('0x31')][_0x7bb0('0x115')]===_0x7bb0('0x116')?_0x7bb0('0x117'):'onlineForm';return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'attributes':['id',_0x42487f],'where':{'id':_0x595683['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x1e517e,null))[_0x7bb0('0x13')](function(_0x50af30){if(_0x50af30){var _0x22b72d=_0x50af30[_0x42487f];var _0x5179fc=_0x22b72d&&_0x22b72d[_0x7bb0('0x118')]?_0x22b72d[_0x7bb0('0x118')]:[];_0x1e517e[_0x7bb0('0xb8')]({'fromKey':_[_0x7bb0('0x6a')](_0x22b72d[_0x7bb0('0x119')])?undefined:_0x22b72d[_0x7bb0('0x119')],'count':_0x5179fc['length'],'rows':_0x5179fc});}})[_0x7bb0('0x1d')](handleError(_0x1e517e,null));};exports[_0x7bb0('0x11a')]=function(_0x1b2e49,_0xe2aa0b){var _0x311231={'raw':![],'where':{}};var _0x5bc353={};var _0x42194e={'count':0x0,'rows':[]};return db[_0x7bb0('0x2e')][_0x7bb0('0xce')]({'where':{'id':_0x1b2e49['params']['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0xe2aa0b,null))[_0x7bb0('0x13')](function(_0x5d85de){if(_0x5d85de){_0x5bc353['model']=_[_0x7bb0('0x32')](db[_0x7bb0('0xc4')][_0x7bb0('0x2f')]);_0x5bc353['query']=_[_0x7bb0('0x32')](_0x1b2e49[_0x7bb0('0x31')]);_0x5bc353[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x5bc353[_0x7bb0('0x34')],_0x5bc353['query']);_0x311231['attributes']=_['intersection'](_0x5bc353['model'],qs['fields'](_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x36')]));_0x311231['attributes']=_0x311231[_0x7bb0('0x35')]['length']?_0x311231[_0x7bb0('0x35')]:_0x5bc353[_0x7bb0('0x34')];if(!_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x37')]('nolimit')){_0x311231[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x311231['offset']=qs[_0x7bb0('0x21')](_0x1b2e49['query'][_0x7bb0('0x21')]);}_0x311231[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x1b2e49['query'][_0x7bb0('0x3a')]);_0x311231[_0x7bb0('0x3b')]=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x1b2e49[_0x7bb0('0x31')],_0x5bc353['filters']));_0x311231[_0x7bb0('0x3b')][_0x7bb0('0x54')]=_0x5d85de['id'];if(_0x1b2e49[_0x7bb0('0x31')]['filter']){_0x311231[_0x7bb0('0x3b')]=_['merge'](_0x311231[_0x7bb0('0x3b')],{'$or':_['map'](_0x311231[_0x7bb0('0x35')],function(_0x2fa701){var _0x3896eb={};_0x3896eb[_0x2fa701]={'$like':'%'+_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x3896eb;})});}_0x311231=_[_0x7bb0('0x3f')]({},_0x311231,_0x1b2e49[_0x7bb0('0x41')]);return db[_0x7bb0('0xc4')][_0x7bb0('0x23')]({'where':_0x311231[_0x7bb0('0x3b')]})[_0x7bb0('0x13')](function(_0x4ff4ff){_0x42194e['count']=_0x4ff4ff;if(_0x1b2e49[_0x7bb0('0x31')][_0x7bb0('0x42')]){_0x311231[_0x7bb0('0x43')]=[{'all':!![]}];}else{_0x311231[_0x7bb0('0x43')]=[{'model':db['CmContact'],'as':_0x7bb0('0xe4'),'required':![]},{'model':db[_0x7bb0('0xcc')],'as':_0x7bb0('0x11b'),'required':![]}];}return db[_0x7bb0('0xc4')]['findAll'](_0x311231);})[_0x7bb0('0x13')](function(_0x4b7e6d){_0x42194e[_0x7bb0('0x45')]=_0x4b7e6d;return _0x42194e;});}})[_0x7bb0('0x13')](respondWithFilteredResult(_0xe2aa0b,_0x311231))[_0x7bb0('0x1d')](handleError(_0xe2aa0b,null));};exports['addAgents']=function(_0x2fdc93,_0x182a83){return db[_0x7bb0('0x2e')]['find']({'where':{'id':_0x2fdc93[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x182a83,null))['then'](function(_0x36921d){if(_0x36921d){return _0x36921d[_0x7bb0('0x11c')](_0x2fdc93[_0x7bb0('0x49')][_0x7bb0('0x58')],_[_0x7bb0('0xe3')](_0x2fdc93[_0x7bb0('0x49')],[_0x7bb0('0x58'),'id'])||{})[_0x7bb0('0xa6')](function(_0x4f25f6){for(var _0x357729=0x0;_0x357729<_0x2fdc93[_0x7bb0('0x49')]['ids']['length'];_0x357729+=0x1){socket[_0x7bb0('0x11d')](_0x7bb0('0x11e'),{'UserId':Number(_0x2fdc93[_0x7bb0('0x49')]['ids'][_0x357729]),'ChatWebsiteId':Number(_0x2fdc93['params']['id'])});}return _0x4f25f6;});}})[_0x7bb0('0x13')](respondWithResult(_0x182a83,null))['catch'](handleError(_0x182a83,null));};exports[_0x7bb0('0x11f')]=function(_0x3f3e6d,_0x12e909){return db[_0x7bb0('0x2e')][_0x7bb0('0x50')]({'where':{'id':_0x3f3e6d[_0x7bb0('0x51')]['id']}})[_0x7bb0('0x13')](handleEntityNotFound(_0x12e909,null))[_0x7bb0('0x13')](function(_0x5a64a3){if(_0x5a64a3){return _0x5a64a3[_0x7bb0('0x11f')](_0x3f3e6d[_0x7bb0('0x31')][_0x7bb0('0x58')])[_0x7bb0('0x13')](function(){if(_[_0x7bb0('0x120')](_0x3f3e6d[_0x7bb0('0x31')]['ids'])){for(var _0x44ea77=0x0;_0x44ea77<_0x3f3e6d['query'][_0x7bb0('0x58')][_0x7bb0('0x5c')];_0x44ea77+=0x1){socket[_0x7bb0('0x11d')](_0x7bb0('0x121'),{'UserId':Number(_0x3f3e6d['query'][_0x7bb0('0x58')][_0x44ea77]),'ChatWebsiteId':Number(_0x3f3e6d['params']['id'])});}}else{socket['emit'](_0x7bb0('0x121'),{'UserId':Number(_0x3f3e6d[_0x7bb0('0x31')][_0x7bb0('0x58')]),'ChatWebsiteId':Number(_0x3f3e6d[_0x7bb0('0x51')]['id'])});}});}})[_0x7bb0('0x13')](respondWithStatusCode(_0x12e909,null))['catch'](handleError(_0x12e909,null));};exports[_0x7bb0('0x122')]=function(_0x25addd,_0x30ccdd){var _0x3bd824={};var _0x23cd6c={};var _0x4c2278;var _0x57eaa5;return db['ChatWebsite'][_0x7bb0('0xce')]({'where':{'id':_0x25addd['params']['id']}})['then'](handleEntityNotFound(_0x30ccdd,null))['then'](function(_0x47201d){if(_0x47201d){_0x4c2278=_0x47201d;_0x23cd6c['model']=_[_0x7bb0('0x32')](db[_0x7bb0('0xb0')][_0x7bb0('0x2f')]);_0x23cd6c[_0x7bb0('0x31')]=_[_0x7bb0('0x32')](_0x25addd[_0x7bb0('0x31')]);_0x23cd6c[_0x7bb0('0x3d')]=_[_0x7bb0('0x33')](_0x23cd6c[_0x7bb0('0x34')],_0x23cd6c['query']);_0x3bd824[_0x7bb0('0x35')]=_[_0x7bb0('0x33')](_0x23cd6c['model'],qs[_0x7bb0('0x36')](_0x25addd['query'][_0x7bb0('0x36')]));_0x3bd824[_0x7bb0('0x35')]=_0x3bd824[_0x7bb0('0x35')][_0x7bb0('0x5c')]?_0x3bd824[_0x7bb0('0x35')]:_0x23cd6c[_0x7bb0('0x34')];_0x3bd824[_0x7bb0('0x39')]=qs[_0x7bb0('0x3a')](_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x3a')]);_0x3bd824['where']=qs[_0x7bb0('0x3d')](_[_0x7bb0('0x3c')](_0x25addd['query'],_0x23cd6c[_0x7bb0('0x3d')]));if(_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x3e')]){_0x3bd824[_0x7bb0('0x3b')]=_[_0x7bb0('0x3f')](_0x3bd824['where'],{'$or':_[_0x7bb0('0x2d')](_0x3bd824[_0x7bb0('0x35')],function(_0x58f9b7){var _0x31b4b2={};_0x31b4b2[_0x58f9b7]={'$like':'%'+_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x3e')]+'%'};return _0x31b4b2;})});}_0x3bd824=_['merge']({},_0x3bd824,_0x25addd[_0x7bb0('0x41')]);return _0x4c2278[_0x7bb0('0x122')](_0x3bd824);}})[_0x7bb0('0x13')](function(_0x1a0914){if(_0x1a0914){_0x57eaa5=_0x1a0914[_0x7bb0('0x5c')];if(!_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x37')](_0x7bb0('0x38'))){_0x3bd824[_0x7bb0('0x24')]=qs[_0x7bb0('0x24')](_0x25addd[_0x7bb0('0x31')][_0x7bb0('0x24')]);_0x3bd824[_0x7bb0('0x21')]=qs[_0x7bb0('0x21')](_0x25addd[_0x7bb0('0x31')]['offset']);}return _0x4c2278[_0x7bb0('0x122')](_0x3bd824);}})['then'](function(_0x3cac98){if(_0x3cac98){return _0x3cac98?{'count':_0x57eaa5,'rows':_0x3cac98}:null;}})[_0x7bb0('0x13')](respondWithResult(_0x30ccdd,null))[_0x7bb0('0x1d')](handleError(_0x30ccdd,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 60a4d27..a9435c0 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x689c=['remove','emit','hasOwnProperty','hook','exports','ChatWebsite','setMaxListeners','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x689c,0x9e));var _0xc689=function(_0x10e18c,_0x103636){_0x10e18c=_0x10e18c-0x0;var _0x52ca75=_0x689c[_0x10e18c];return _0x52ca75;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0xc689('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc689('0x1')](0x0);var events={'afterCreate':_0xc689('0x2'),'afterUpdate':_0xc689('0x3'),'afterDestroy':_0xc689('0x4')};function emitEvent(_0x28d0cd){return function(_0x4b863b,_0x3d106f,_0x5ce767){ChatWebsiteEvents['emit'](_0x28d0cd+':'+_0x4b863b['id'],_0x4b863b);ChatWebsiteEvents[_0xc689('0x5')](_0x28d0cd,_0x4b863b);_0x5ce767(null);};}for(var e in events){if(events[_0xc689('0x6')](e)){var event=events[e];ChatWebsite[_0xc689('0x7')](e,emitEvent(event));}}module[_0xc689('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x4f5d=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x47943a,_0x39fcbc){var _0x3604c4=function(_0x5ea451){while(--_0x5ea451){_0x47943a['push'](_0x47943a['shift']());}};_0x3604c4(++_0x39fcbc);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x4f5d[_0x422905];return _0x33dc6c;};'use strict';var EventEmitter=require(_0xd4f5('0x0'));var ChatWebsite=require(_0xd4f5('0x1'))['db'][_0xd4f5('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd4f5('0x3')](0x0);var events={'afterCreate':_0xd4f5('0x4'),'afterUpdate':_0xd4f5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x45f512){return function(_0x468609,_0xf61335,_0x3956d8){ChatWebsiteEvents[_0xd4f5('0x6')](_0x45f512+':'+_0x468609['id'],_0x468609);ChatWebsiteEvents[_0xd4f5('0x6')](_0x45f512,_0x468609);_0x3956d8(null);};}for(var e in events){if(events[_0xd4f5('0x7')](e)){var event=events[e];ChatWebsite[_0xd4f5('0x8')](e,emitEvent(event));}}module[_0xd4f5('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 23b60f6..28ee51c 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb598=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x293256,_0x52f08b){var _0x5f3d32=function(_0x4bcca4){while(--_0x4bcca4){_0x293256['push'](_0x293256['shift']());}};_0x5f3d32(++_0x52f08b);}(_0xb598,0x7a));var _0x8b59=function(_0x213bc2,_0xfa9447){_0x213bc2=_0x213bc2-0x0;var _0x12a74f=_0xb598[_0x213bc2];return _0x12a74f;};'use strict';var _=require(_0x8b59('0x0'));var util=require('util');var logger=require(_0x8b59('0x1'))(_0x8b59('0x2'));var moment=require(_0x8b59('0x3'));var BPromise=require(_0x8b59('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b59('0x5'));var rimraf=require(_0x8b59('0x6'));var config=require(_0x8b59('0x7'));var attributes=require(_0x8b59('0x8'));module[_0x8b59('0x9')]=function(_0x496aab,_0xf3b887){return _0x496aab[_0x8b59('0xa')](_0x8b59('0xb'),attributes,{'tableName':_0x8b59('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cd1=['define','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x5b0ee5,_0x437c51){var _0x441fea=function(_0x4c3f9){while(--_0x4c3f9){_0x5b0ee5['push'](_0x5b0ee5['shift']());}};_0x441fea(++_0x437c51);}(_0x6cd1,0x121));var _0x16cd=function(_0x4f57e4,_0x18914d){_0x4f57e4=_0x4f57e4-0x0;var _0x4a584c=_0x6cd1[_0x4f57e4];return _0x4a584c;};'use strict';var _=require(_0x16cd('0x0'));var util=require('util');var logger=require(_0x16cd('0x1'))(_0x16cd('0x2'));var moment=require(_0x16cd('0x3'));var BPromise=require(_0x16cd('0x4'));var rp=require(_0x16cd('0x5'));var fs=require('fs');var path=require(_0x16cd('0x6'));var rimraf=require('rimraf');var config=require(_0x16cd('0x7'));var attributes=require(_0x16cd('0x8'));module[_0x16cd('0x9')]=function(_0x39d84e,_0x32912b){return _0x39d84e[_0x16cd('0xa')](_0x16cd('0xb'),attributes,{'tableName':_0x16cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 447e1e3..416b94a 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd59d=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0xd59d,0x1c2));var _0xdd59=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xd59d[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0xdd59('0x0'));var util=require(_0xdd59('0x1'));var moment=require(_0xdd59('0x2'));var BPromise=require(_0xdd59('0x3'));var rs=require(_0xdd59('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd59('0x5'))['db'];var utils=require(_0xdd59('0x6'));var logger=require('../../config/logger')(_0xdd59('0x7'));var config=require(_0xdd59('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xdd59('0x9')]=_['defaults'](config['redis'],{'host':_0xdd59('0xa'),'port':0x18eb});var socket=require(_0xdd59('0xb'))(new Redis(config[_0xdd59('0x9')]));require(_0xdd59('0xc'))[_0xdd59('0xd')](socket);function respondWithRpcPromise(_0x28b8f2,_0x1b0cdc,_0x24fd20){return new BPromise(function(_0xd1da78,_0x2f2608){return client[_0xdd59('0xe')](_0x28b8f2,_0x24fd20)[_0xdd59('0xf')](function(_0xae6d83){logger[_0xdd59('0x10')](_0xdd59('0x11'),_0x1b0cdc,_0xdd59('0x12'));logger[_0xdd59('0x13')](_0xdd59('0x14'),_0x1b0cdc,_0xdd59('0x12'),JSON['stringify'](_0xae6d83));if(_0xae6d83[_0xdd59('0x15')]){if(_0xae6d83[_0xdd59('0x15')]['code']===0x1f4){logger[_0xdd59('0x15')](_0xdd59('0x11'),_0x1b0cdc,_0xae6d83['error'][_0xdd59('0x16')]);return _0x2f2608(_0xae6d83['error'][_0xdd59('0x16')]);}logger[_0xdd59('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x1b0cdc,_0xae6d83[_0xdd59('0x15')][_0xdd59('0x16')]);return _0xd1da78(_0xae6d83[_0xdd59('0x15')][_0xdd59('0x16')]);}else{logger[_0xdd59('0x10')](_0xdd59('0x11'),_0x1b0cdc,_0xdd59('0x12'));_0xd1da78(_0xae6d83[_0xdd59('0x17')][_0xdd59('0x16')]);}})[_0xdd59('0x18')](function(_0x4d416b){logger[_0xdd59('0x15')](_0xdd59('0x11'),_0x1b0cdc,_0x4d416b);_0x2f2608(_0x4d416b);});});}
\ No newline at end of file
+var _0x704a=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x2d63f1,_0x418717){var _0x31f145=function(_0x4065de){while(--_0x4065de){_0x2d63f1['push'](_0x2d63f1['shift']());}};_0x31f145(++_0x418717);}(_0x704a,0x179));var _0xa704=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x704a[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xa704('0x0'));var util=require('util');var moment=require(_0xa704('0x1'));var BPromise=require(_0xa704('0x2'));var rs=require(_0xa704('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa704('0x4'))['db'];var utils=require(_0xa704('0x5'));var logger=require(_0xa704('0x6'))(_0xa704('0x7'));var config=require(_0xa704('0x8'));var jayson=require(_0xa704('0x9'));var client=jayson[_0xa704('0xa')]['http']({'port':0x232a});config[_0xa704('0xb')]=_[_0xa704('0xc')](config[_0xa704('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa704('0xd'))(new Redis(config[_0xa704('0xb')]));require(_0xa704('0xe'))[_0xa704('0xf')](socket);function respondWithRpcPromise(_0x7c91b8,_0x375470,_0x2d4e52){return new BPromise(function(_0x1dff23,_0x34daf0){return client[_0xa704('0x10')](_0x7c91b8,_0x2d4e52)[_0xa704('0x11')](function(_0x456e11){logger[_0xa704('0x12')](_0xa704('0x13'),_0x375470,_0xa704('0x14'));logger['debug'](_0xa704('0x15'),_0x375470,_0xa704('0x14'),JSON[_0xa704('0x16')](_0x456e11));if(_0x456e11[_0xa704('0x17')]){if(_0x456e11[_0xa704('0x17')]['code']===0x1f4){logger[_0xa704('0x17')](_0xa704('0x13'),_0x375470,_0x456e11['error']['message']);return _0x34daf0(_0x456e11[_0xa704('0x17')][_0xa704('0x18')]);}logger['error'](_0xa704('0x13'),_0x375470,_0x456e11[_0xa704('0x17')][_0xa704('0x18')]);return _0x1dff23(_0x456e11[_0xa704('0x17')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x375470,_0xa704('0x14'));_0x1dff23(_0x456e11[_0xa704('0x19')]['message']);}})[_0xa704('0x1a')](function(_0x17596e){logger[_0xa704('0x17')](_0xa704('0x13'),_0x375470,_0x17596e);_0x34daf0(_0x17596e);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 552dada..3b4b392 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xde17=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener'];(function(_0xd37620,_0x5cbc85){var _0xc56870=function(_0x4e5904){while(--_0x4e5904){_0xd37620['push'](_0xd37620['shift']());}};_0xc56870(++_0x5cbc85);}(_0xde17,0x7f));var _0x7de1=function(_0x8237a1,_0x3599d0){_0x8237a1=_0x8237a1-0x0;var _0x3e933a=_0xde17[_0x8237a1];return _0x3e933a;};'use strict';var ChatWebsiteEvents=require(_0x7de1('0x0'));var events=[_0x7de1('0x1'),_0x7de1('0x2'),'update'];function createListener(_0x53401e,_0x1185a1){return function(_0x56bcec){_0x1185a1[_0x7de1('0x3')](_0x53401e,_0x56bcec);};}function removeListener(_0x3ffb68,_0x46656e){return function(){ChatWebsiteEvents[_0x7de1('0x4')](_0x3ffb68,_0x46656e);};}exports['register']=function(_0x224cc5){for(var _0x57e591=0x0,_0x234799=events['length'];_0x57e591<_0x234799;_0x57e591++){var _0x4f8d13=events[_0x57e591];var _0x3bfb3a=createListener(_0x7de1('0x5')+_0x4f8d13,_0x224cc5);ChatWebsiteEvents['on'](_0x4f8d13,_0x3bfb3a);}};
\ No newline at end of file
+var _0x78b2=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x78b2,0x1f2));var _0x278b=function(_0x21c5d9,_0x3ba88c){_0x21c5d9=_0x21c5d9-0x0;var _0xc2c168=_0x78b2[_0x21c5d9];return _0xc2c168;};'use strict';var ChatWebsiteEvents=require(_0x278b('0x0'));var events=[_0x278b('0x1'),_0x278b('0x2'),_0x278b('0x3')];function createListener(_0x1f784f,_0xec0ae8){return function(_0x1ccba7){_0xec0ae8[_0x278b('0x4')](_0x1f784f,_0x1ccba7);};}function removeListener(_0x57d6ac,_0x2a50b1){return function(){ChatWebsiteEvents[_0x278b('0x5')](_0x57d6ac,_0x2a50b1);};}exports[_0x278b('0x6')]=function(_0x5b0a5e){for(var _0x5ea08c=0x0,_0x1ac347=events[_0x278b('0x7')];_0x5ea08c<_0x1ac347;_0x5ea08c++){var _0x4156de=events[_0x5ea08c];var _0x155e68=createListener(_0x278b('0x8')+_0x4156de,_0x5b0a5e);ChatWebsiteEvents['on'](_0x4156de,_0x155e68);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 1174524..daef47b 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5779=['server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','addAvatar','/:id/system_avatar','file','addSystemAvatar','/:id/notify','notify'];(function(_0x7a6c3f,_0x287200){var _0x4bae05=function(_0x4b35ad){while(--_0x4b35ad){_0x7a6c3f['push'](_0x7a6c3f['shift']());}};_0x4bae05(++_0x287200);}(_0x5779,0x1d6));var _0x9577=function(_0x12c0b3,_0x44ed4d){_0x12c0b3=_0x12c0b3-0x0;var _0x3dae4f=_0x5779[_0x12c0b3];return _0x3dae4f;};'use strict';var multer=require(_0x9577('0x0'));var util=require(_0x9577('0x1'));var path=require(_0x9577('0x2'));var timeout=require(_0x9577('0x3'));var express=require(_0x9577('0x4'));var router=express[_0x9577('0x5')]();var fs_extra=require(_0x9577('0x6'));var auth=require(_0x9577('0x7'));var interaction=require(_0x9577('0x8'));var config=require(_0x9577('0x9'));var controller=require(_0x9577('0xa'));router[_0x9577('0xb')]('/',auth[_0x9577('0xc')](),controller[_0x9577('0xd')]);router[_0x9577('0xb')](_0x9577('0xe'),auth[_0x9577('0xc')](),controller[_0x9577('0xf')]);router[_0x9577('0xb')](_0x9577('0x10'),auth[_0x9577('0xc')](),controller['show']);router['get'](_0x9577('0x11'),auth[_0x9577('0xc')](),controller['getDispositions']);router['get'](_0x9577('0x12'),auth[_0x9577('0xc')](),controller[_0x9577('0x13')]);router['get']('/:id/logo',controller[_0x9577('0x14')]);router[_0x9577('0xb')](_0x9577('0x15'),controller[_0x9577('0x16')]);router[_0x9577('0xb')](_0x9577('0x17'),controller[_0x9577('0x18')]);router[_0x9577('0xb')]('/:id/system_avatar',controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0x9577('0xc')](),controller[_0x9577('0x19')]);router[_0x9577('0xb')](_0x9577('0x1a'),controller['getSnippet']);router[_0x9577('0xb')](_0x9577('0x1b'),auth['isAuthenticated'](),controller[_0x9577('0x1c')]);router[_0x9577('0xb')](_0x9577('0x1d'),auth['isAuthenticated'](),controller[_0x9577('0x1e')]);router[_0x9577('0xb')](_0x9577('0x1f'),controller[_0x9577('0x20')]);router[_0x9577('0xb')](_0x9577('0x21'),auth[_0x9577('0xc')](),controller['getOfflineMessages']);router[_0x9577('0xb')](_0x9577('0x22'),auth[_0x9577('0xc')](),controller['getAgents']);router[_0x9577('0x23')]('/',auth[_0x9577('0xc')](),controller[_0x9577('0x24')]);router['post'](_0x9577('0x11'),auth['isAuthenticated'](),controller[_0x9577('0x25')]);router[_0x9577('0x23')](_0x9577('0x12'),auth[_0x9577('0xc')](),controller[_0x9577('0x26')]);var upload=multer({'storage':multer[_0x9577('0x27')]({'destination':function(_0x3e2036,_0x327163,_0x5756c6){_0x5756c6(null,path[_0x9577('0x28')](config[_0x9577('0x29')],'server/files/images/logos/'));},'filename':function(_0x2347f5,_0x2aaa04,_0x579977){_0x579977(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date[_0x9577('0x2c')](),_0x2aaa04[_0x9577('0x2d')]));}})});router[_0x9577('0x23')]('/:id/logo',upload[_0x9577('0x2e')]('file'),controller[_0x9577('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x192dc0,_0x5b156b,_0x551043){_0x551043(null,path['join'](config[_0x9577('0x29')],_0x9577('0x30')));},'filename':function(_0x286a0e,_0x495ac4,_0x5754a3){_0x5754a3(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date[_0x9577('0x2c')](),_0x495ac4['originalname']));}})});router[_0x9577('0x23')](_0x9577('0x15'),upload[_0x9577('0x2e')]('file'),controller[_0x9577('0x31')]);var upload=multer({'storage':multer[_0x9577('0x27')]({'destination':function(_0x55f12d,_0x409689,_0x1b8b25){_0x1b8b25(null,path['join'](config[_0x9577('0x29')],_0x9577('0x30')));},'filename':function(_0x7097b6,_0x5cfdba,_0x4d32d1){_0x4d32d1(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date['now'](),_0x5cfdba[_0x9577('0x2d')]));}})});router[_0x9577('0x23')](_0x9577('0x17'),upload[_0x9577('0x2e')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55641d,_0xfee9ec,_0x134afa){_0x134afa(null,path[_0x9577('0x28')](config[_0x9577('0x29')],_0x9577('0x30')));},'filename':function(_0x2ee6e3,_0x5b1cfa,_0x36dabf){_0x36dabf(null,util[_0x9577('0x2a')](_0x9577('0x2b'),Date[_0x9577('0x2c')](),_0x5b1cfa[_0x9577('0x2d')]));}})});router[_0x9577('0x23')](_0x9577('0x32'),upload[_0x9577('0x2e')](_0x9577('0x33')),controller[_0x9577('0x34')]);router[_0x9577('0x23')](_0x9577('0x35'),controller[_0x9577('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5ed47a,_0x2e72c9,_0x5e80ed){const _0x4121c3=path['join'](config[_0x9577('0x29')],_0x9577('0x37'),_0x9577('0x38'),_0x9577('0x39'));fs_extra[_0x9577('0x3a')](_0x4121c3,function(){_0x5e80ed(null,_0x4121c3);});},'filename':function(_0x18b83d,_0x5ba5ae,_0x4bb376){const _0x3bee68=_0x5ba5ae[_0x9577('0x2d')][_0x9577('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x308fff=path[_0x9577('0x3c')](_0x3bee68);const _0x5f08c2=Date[_0x9577('0x2c')]()+'-'+_0x3bee68['replace'](_0x308fff,'')+_0x308fff;_0x4bb376(null,_0x5f08c2);}})});router['post'](_0x9577('0x3d'),offlineUploadMulter[_0x9577('0x3e')](),controller[_0x9577('0x3f')]);router[_0x9577('0x23')](_0x9577('0x40'),auth['isAuthenticated'](),controller[_0x9577('0x41')]);router[_0x9577('0x23')](_0x9577('0x1b'),auth['isAuthenticated'](),controller[_0x9577('0x42')]);router[_0x9577('0x23')](_0x9577('0x1d'),auth[_0x9577('0xc')](),controller['addProactiveActions']);router[_0x9577('0x23')](_0x9577('0x22'),auth[_0x9577('0xc')](),controller[_0x9577('0x43')]);router[_0x9577('0x44')](_0x9577('0x10'),auth[_0x9577('0xc')](),controller[_0x9577('0x45')]);router['delete'](_0x9577('0x10'),auth[_0x9577('0xc')](),controller['destroy']);router[_0x9577('0x46')](_0x9577('0x11'),auth['isAuthenticated'](),controller[_0x9577('0x47')]);router[_0x9577('0x46')](_0x9577('0x12'),auth[_0x9577('0xc')](),controller[_0x9577('0x48')]);router[_0x9577('0x46')](_0x9577('0x22'),auth['isAuthenticated'](),controller[_0x9577('0x49')]);module[_0x9577('0x4a')]=router;
\ No newline at end of file
+var _0x33d9=['file','format','addAvatar','join','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','server/files','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','/:id/users','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','%s-%s','now','originalname','single'];(function(_0x594cb4,_0x14151a){var _0x31688a=function(_0x5ccee6){while(--_0x5ccee6){_0x594cb4['push'](_0x594cb4['shift']());}};_0x31688a(++_0x14151a);}(_0x33d9,0x176));var _0x933d=function(_0x335243,_0x3b804c){_0x335243=_0x335243-0x0;var _0x596d14=_0x33d9[_0x335243];return _0x596d14;};'use strict';var multer=require(_0x933d('0x0'));var util=require(_0x933d('0x1'));var path=require(_0x933d('0x2'));var timeout=require(_0x933d('0x3'));var express=require(_0x933d('0x4'));var router=express[_0x933d('0x5')]();var fs_extra=require(_0x933d('0x6'));var auth=require(_0x933d('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x933d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x933d('0x9')](_0x933d('0xa'),auth['isAuthenticated'](),controller[_0x933d('0xb')]);router[_0x933d('0x9')](_0x933d('0xc'),auth[_0x933d('0xd')](),controller[_0x933d('0xe')]);router[_0x933d('0x9')](_0x933d('0xf'),auth[_0x933d('0xd')](),controller['getDispositions']);router[_0x933d('0x9')](_0x933d('0x10'),auth[_0x933d('0xd')](),controller[_0x933d('0x11')]);router[_0x933d('0x9')](_0x933d('0x12'),controller[_0x933d('0x13')]);router[_0x933d('0x9')](_0x933d('0x14'),controller[_0x933d('0x15')]);router[_0x933d('0x9')](_0x933d('0x16'),controller[_0x933d('0x17')]);router[_0x933d('0x9')](_0x933d('0x18'),controller[_0x933d('0x19')]);router[_0x933d('0x9')](_0x933d('0x1a'),auth[_0x933d('0xd')](),controller[_0x933d('0x1b')]);router[_0x933d('0x9')](_0x933d('0x1c'),controller['getSnippet']);router[_0x933d('0x9')](_0x933d('0x1d'),auth[_0x933d('0xd')](),controller['getApplications']);router[_0x933d('0x9')](_0x933d('0x1e'),auth[_0x933d('0xd')](),controller[_0x933d('0x1f')]);router[_0x933d('0x9')]('/:id/fields',controller[_0x933d('0x20')]);router[_0x933d('0x9')](_0x933d('0x21'),auth['isAuthenticated'](),controller[_0x933d('0x22')]);router[_0x933d('0x9')]('/:id/users',auth[_0x933d('0xd')](),controller[_0x933d('0x23')]);router[_0x933d('0x24')]('/',auth[_0x933d('0xd')](),controller[_0x933d('0x25')]);router['post'](_0x933d('0xf'),auth[_0x933d('0xd')](),controller[_0x933d('0x26')]);router[_0x933d('0x24')]('/:id/canned_answers',auth[_0x933d('0xd')](),controller[_0x933d('0x27')]);var upload=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x5b3f8a,_0x1b4d8c,_0x1a195b){_0x1a195b(null,path['join'](config[_0x933d('0x29')],'server/files/images/logos/'));},'filename':function(_0x28f20a,_0x3f7bf7,_0x563d34){_0x563d34(null,util['format'](_0x933d('0x2a'),Date[_0x933d('0x2b')](),_0x3f7bf7[_0x933d('0x2c')]));}})});router[_0x933d('0x24')](_0x933d('0x12'),upload[_0x933d('0x2d')](_0x933d('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x38a61f,_0x542f24,_0x5a2e45){_0x5a2e45(null,path['join'](config[_0x933d('0x29')],'server/files/images/avatars/'));},'filename':function(_0x4d4f27,_0x350a34,_0x4ddc6c){_0x4ddc6c(null,util[_0x933d('0x2f')](_0x933d('0x2a'),Date[_0x933d('0x2b')](),_0x350a34[_0x933d('0x2c')]));}})});router[_0x933d('0x24')](_0x933d('0x14'),upload[_0x933d('0x2d')](_0x933d('0x2e')),controller[_0x933d('0x30')]);var upload=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x447865,_0x4ef23a,_0x39d824){_0x39d824(null,path[_0x933d('0x31')](config[_0x933d('0x29')],_0x933d('0x32')));},'filename':function(_0x556770,_0x2e5111,_0x4c5c4b){_0x4c5c4b(null,util['format']('%s-%s',Date['now'](),_0x2e5111[_0x933d('0x2c')]));}})});router[_0x933d('0x24')]('/:id/customer_avatar',upload['single'](_0x933d('0x2e')),controller[_0x933d('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x299b4d,_0x5afd16,_0x18654c){_0x18654c(null,path[_0x933d('0x31')](config[_0x933d('0x29')],_0x933d('0x32')));},'filename':function(_0xdf379f,_0x412c5f,_0x13657d){_0x13657d(null,util['format'](_0x933d('0x2a'),Date['now'](),_0x412c5f[_0x933d('0x2c')]));}})});router['post'](_0x933d('0x18'),upload[_0x933d('0x2d')](_0x933d('0x2e')),controller[_0x933d('0x34')]);router[_0x933d('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x933d('0x28')]({'destination':function(_0x48f3d5,_0x40201d,_0x35e333){const _0x1ce0ae=path[_0x933d('0x31')](config[_0x933d('0x29')],_0x933d('0x35'),'attachments',_0x933d('0x36'));fs_extra[_0x933d('0x37')](_0x1ce0ae,function(){_0x35e333(null,_0x1ce0ae);});},'filename':function(_0x126eb2,_0x7f903b,_0x265d4c){const _0x481a8a=_0x7f903b['originalname'][_0x933d('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3c056e=path[_0x933d('0x39')](_0x481a8a);const _0x41ed7d=Date[_0x933d('0x2b')]()+'-'+_0x481a8a[_0x933d('0x38')](_0x3c056e,'')+_0x3c056e;_0x265d4c(null,_0x41ed7d);}})});router[_0x933d('0x24')]('/:id/offline',offlineUploadMulter[_0x933d('0x3a')](),controller[_0x933d('0x3b')]);router[_0x933d('0x24')](_0x933d('0x1a'),auth[_0x933d('0xd')](),controller[_0x933d('0x3c')]);router[_0x933d('0x24')](_0x933d('0x1d'),auth[_0x933d('0xd')](),controller['addApplications']);router[_0x933d('0x24')](_0x933d('0x1e'),auth['isAuthenticated'](),controller[_0x933d('0x3d')]);router[_0x933d('0x24')]('/:id/users',auth[_0x933d('0xd')](),controller[_0x933d('0x3e')]);router[_0x933d('0x3f')](_0x933d('0xc'),auth[_0x933d('0xd')](),controller[_0x933d('0x40')]);router[_0x933d('0x41')](_0x933d('0xc'),auth[_0x933d('0xd')](),controller[_0x933d('0x42')]);router[_0x933d('0x41')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x933d('0xd')](),controller['removeAnswers']);router[_0x933d('0x41')](_0x933d('0x43'),auth['isAuthenticated'](),controller[_0x933d('0x44')]);module[_0x933d('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index f23d14b..eb0b781 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71a1=['app','get','client-side-logger','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../config/environment'];(function(_0x446a6c,_0x2ba430){var _0x3d279e=function(_0x328540){while(--_0x328540){_0x446a6c['push'](_0x446a6c['shift']());}};_0x3d279e(++_0x2ba430);}(_0x71a1,0x1da));var _0x171a=function(_0x58217a,_0x4aa596){_0x58217a=_0x58217a-0x0;var _0x3b12d4=_0x71a1[_0x58217a];return _0x3b12d4;};var beaverLogger=require(_0x171a('0x0'));var express=require(_0x171a('0x1'));var auth=require('../components/auth/service');var config=require(_0x171a('0x2'));var router=express['Router']();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x46c57e,_0x41e548,_0xdf04ba){var _0x215b50=_0x46c57e[_0x171a('0x3')][_0x171a('0x4')](_0x171a('0x5'));if(!_0x215b50){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x171a('0x6')]({'uri':_0x171a('0x7'),'logger':_0x215b50,'enableCors':!isProduction})(_0x46c57e,_0x41e548,_0xdf04ba);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x171a('0x8')]=router;
\ No newline at end of file
+var _0xc366=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','../config/environment','Router','production'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc366,0x1a8));var _0x6c36=function(_0x11d337,_0x3ccb4b){_0x11d337=_0x11d337-0x0;var _0x359e28=_0xc366[_0x11d337];return _0x359e28;};var beaverLogger=require(_0x6c36('0x0'));var express=require('express');var auth=require(_0x6c36('0x1'));var config=require(_0x6c36('0x2'));var router=express[_0x6c36('0x3')]();var isProduction=config['env']===_0x6c36('0x4')||![];function clientSideLogs(_0x34eaab,_0x56e18e,_0x309e5f){var _0x2b1cda=_0x34eaab[_0x6c36('0x5')][_0x6c36('0x6')](_0x6c36('0x7'));if(!_0x2b1cda){throw new Error(_0x6c36('0x8'));}return beaverLogger[_0x6c36('0x9')]({'uri':_0x6c36('0xa'),'logger':_0x2b1cda,'enableCors':!isProduction})(_0x34eaab,_0x56e18e,_0x309e5f);}router[_0x6c36('0xb')](auth[_0x6c36('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 2d9dd99..150a62e 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2c49=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','MicrosoftAzure','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2c49,0x141));var _0x92c4=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x2c49[_0x296923];return _0x29af70;};'use strict';var Sequelize=require(_0x92c4('0x0'));module['exports']={'name':{'type':Sequelize[_0x92c4('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS','Google',_0x92c4('0x2')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x92c4('0x3')]('Outlook365',_0x92c4('0x4'))},'data1':{'type':Sequelize[_0x92c4('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x92c4('0x1')],'comment':_0x92c4('0x5')},'data3':{'type':Sequelize[_0x92c4('0x1')],'comment':_0x92c4('0x6')},'data4':{'type':Sequelize[_0x92c4('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x92c4('0x7')],'comment':_0x92c4('0x8')},'data6':{'type':Sequelize[_0x92c4('0x7')],'comment':_0x92c4('0x9')},'data7':{'type':Sequelize[_0x92c4('0x7')],'comment':_0x92c4('0xa')}};
\ No newline at end of file
+var _0xe6f8=['MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x38d4ab,_0x40b8a6){var _0x580890=function(_0xc95791){while(--_0xc95791){_0x38d4ab['push'](_0x38d4ab['shift']());}};_0x580890(++_0x40b8a6);}(_0xe6f8,0x75));var _0x8e6f=function(_0xc81e27,_0x283135){_0xc81e27=_0xc81e27-0x0;var _0x32870c=_0xe6f8[_0xc81e27];return _0x32870c;};'use strict';var Sequelize=require(_0x8e6f('0x0'));module[_0x8e6f('0x1')]={'name':{'type':Sequelize[_0x8e6f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8e6f('0x3')](_0x8e6f('0x4'),_0x8e6f('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x8e6f('0x6'),_0x8e6f('0x7'))},'data1':{'type':Sequelize[_0x8e6f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x8e6f('0x2')],'comment':_0x8e6f('0x8')},'data4':{'type':Sequelize[_0x8e6f('0x2')],'comment':_0x8e6f('0x9')},'data5':{'type':Sequelize[_0x8e6f('0xa')],'comment':_0x8e6f('0xb')},'data6':{'type':Sequelize[_0x8e6f('0xa')],'comment':_0x8e6f('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x8e6f('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 99b4296..7a8a1f6 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc096=['error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','service','MicrosoftAzure','decryptString','data3','includeAll','include','find','create','body','Name\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','catch','params','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','parse','from','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','update','then','destroy'];(function(_0x1eedb8,_0x41a839){var _0x23ce75=function(_0xfdf9c7){while(--_0xfdf9c7){_0x1eedb8['push'](_0x1eedb8['shift']());}};_0x23ce75(++_0x41a839);}(_0xc096,0xac));var _0x6c09=function(_0x4ea444,_0x56dde4){_0x4ea444=_0x4ea444-0x0;var _0x52b1e0=_0xc096[_0x4ea444];return _0x52b1e0;};'use strict';var _=require(_0x6c09('0x0'));var Redis=require(_0x6c09('0x1'));var qs=require(_0x6c09('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x6c09('0x3'));var logger=require(_0x6c09('0x4'))('api');var db=require(_0x6c09('0x5'))['db'];var oauth=require(_0x6c09('0x6'));config['redis']=_[_0x6c09('0x7')](config[_0x6c09('0x8')],{'host':_0x6c09('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c09('0x8')]));var redis=new Redis(config[_0x6c09('0x8')]);function respondWithStatusCode(_0x2033d7,_0x10f206){_0x10f206=_0x10f206||0xcc;return function(_0xbc69c0){if(_0xbc69c0){return _0x2033d7[_0x6c09('0xa')](_0x10f206);}return _0x2033d7[_0x6c09('0xb')](_0x10f206)[_0x6c09('0xc')]();};}function respondWithResult(_0x1bb6ed,_0x321a15){_0x321a15=_0x321a15||0xc8;return function(_0x7cc238){if(_0x7cc238){return _0x1bb6ed[_0x6c09('0xb')](_0x321a15)['json'](_0x7cc238);}};}function respondWithFilteredResult(_0x199c2b,_0x344c7b){return function(_0x59388a){if(_0x59388a){var _0x55340c=typeof _0x344c7b[_0x6c09('0xd')]==='undefined'&&typeof _0x344c7b[_0x6c09('0xe')]===_0x6c09('0xf');var _0x3db3ab=_0x59388a[_0x6c09('0x10')];var _0x4d854a=_0x55340c?0x0:_0x344c7b[_0x6c09('0xd')];var _0x37995=_0x55340c?_0x59388a[_0x6c09('0x10')]:_0x344c7b[_0x6c09('0xd')]+_0x344c7b['limit'];var _0x20b34b;if(_0x37995>=_0x3db3ab){_0x37995=_0x3db3ab;_0x20b34b=0xc8;}else{_0x20b34b=0xce;}_0x199c2b[_0x6c09('0xb')](_0x20b34b);return _0x199c2b[_0x6c09('0x11')](_0x6c09('0x12'),_0x4d854a+'-'+_0x37995+'/'+_0x3db3ab)['json'](_0x59388a);}return null;};}function saveUpdates(_0x40f068){return function(_0xc6b885){if(_0xc6b885){return _0xc6b885[_0x6c09('0x13')](_0x40f068)[_0x6c09('0x14')](function(_0x172ac1){return _0x172ac1;});}return null;};}function removeEntity(_0x522ffe){return function(_0xd462ab){if(_0xd462ab){return _0xd462ab[_0x6c09('0x15')]()[_0x6c09('0x14')](function(){_0x522ffe[_0x6c09('0xb')](0xcc)[_0x6c09('0xc')]();});}};}function handleEntityNotFound(_0x30e2f4){return function(_0x115889){if(!_0x115889){_0x30e2f4['sendStatus'](0x194);}return _0x115889;};}function handleError(_0x13acf6,_0x2c03d8){_0x2c03d8=_0x2c03d8||0x1f4;return function(_0x50b6f0){logger[_0x6c09('0x16')](_0x50b6f0[_0x6c09('0x17')]);if(_0x50b6f0[_0x6c09('0x18')]){delete _0x50b6f0[_0x6c09('0x18')];}_0x13acf6['status'](_0x2c03d8)[_0x6c09('0x19')](_0x50b6f0);};}function maskClientSecret(_0x10c230){return _[_0x6c09('0x1a')](_0x10c230[_0x6c09('0x1b')](0x0,0x3),0x14,'*');}exports[_0x6c09('0x1c')]=function(_0x3a00c3,_0x81b90e){var _0x392a67={},_0x462271={},_0x34d7ed={'count':0x0,'rows':[]};var _0x32c8fc=_[_0x6c09('0x1d')](db[_0x6c09('0x1e')][_0x6c09('0x1f')],function(_0x5b7a2a){return{'name':_0x5b7a2a[_0x6c09('0x20')],'type':_0x5b7a2a[_0x6c09('0x21')][_0x6c09('0x22')]};});_0x462271[_0x6c09('0x23')]=_[_0x6c09('0x1d')](_0x32c8fc,_0x6c09('0x18'));_0x462271[_0x6c09('0x24')]=_[_0x6c09('0x25')](_0x3a00c3[_0x6c09('0x24')]);_0x462271['filters']=_[_0x6c09('0x26')](_0x462271[_0x6c09('0x23')],_0x462271[_0x6c09('0x24')]);_0x392a67[_0x6c09('0x27')]=_[_0x6c09('0x26')](_0x462271[_0x6c09('0x23')],qs[_0x6c09('0x28')](_0x3a00c3[_0x6c09('0x24')][_0x6c09('0x28')]));_0x392a67[_0x6c09('0x27')]=_0x392a67['attributes'][_0x6c09('0x29')]?_0x392a67['attributes']:_0x462271[_0x6c09('0x23')];if(!_0x3a00c3['query'][_0x6c09('0x2a')](_0x6c09('0x2b'))){_0x392a67['limit']=qs['limit'](_0x3a00c3[_0x6c09('0x24')][_0x6c09('0xe')]);_0x392a67[_0x6c09('0xd')]=qs[_0x6c09('0xd')](_0x3a00c3['query'][_0x6c09('0xd')]);}_0x392a67['order']=qs[_0x6c09('0x2c')](_0x3a00c3[_0x6c09('0x24')]['sort']);_0x392a67[_0x6c09('0x2d')]=qs[_0x6c09('0x2e')](_['pick'](_0x3a00c3[_0x6c09('0x24')],_0x462271[_0x6c09('0x2e')]),_0x32c8fc);if(_0x3a00c3[_0x6c09('0x24')][_0x6c09('0x2f')]){_0x392a67[_0x6c09('0x2d')]=_[_0x6c09('0x30')](_0x392a67[_0x6c09('0x2d')],{'$or':_['map'](_0x32c8fc,function(_0x49ea5b){if(_0x49ea5b[_0x6c09('0x21')]!==_0x6c09('0x31')){var _0x436428={};_0x436428[_0x49ea5b['name']]={'$like':'%'+_0x3a00c3[_0x6c09('0x24')][_0x6c09('0x2f')]+'%'};return _0x436428;}})});}_0x392a67=_[_0x6c09('0x30')]({},_0x392a67,_0x3a00c3[_0x6c09('0x32')]);var _0x289893={'where':_0x392a67[_0x6c09('0x2d')]};return db[_0x6c09('0x1e')][_0x6c09('0x10')](_0x289893)['then'](function(_0x5979d3){_0x34d7ed[_0x6c09('0x10')]=_0x5979d3;if(_0x3a00c3[_0x6c09('0x24')]['includeAll']){_0x392a67['include']=[{'all':!![]}];}return db['CloudProvider'][_0x6c09('0x33')](_0x392a67);})[_0x6c09('0x14')](function(_0x1be736){_0x34d7ed[_0x6c09('0x34')]=_[_0x6c09('0x1d')](_0x1be736,function(_0x1e01ec){if(_0x1e01ec[_0x6c09('0x35')]===_0x6c09('0x36')){var _0x9cfcce=encryptor[_0x6c09('0x37')](_0x1e01ec[_0x6c09('0x38')]);_0x1e01ec[_0x6c09('0x38')]=maskClientSecret(_0x9cfcce);}return _0x1e01ec;});return _0x34d7ed;})[_0x6c09('0x14')](respondWithFilteredResult(_0x81b90e,_0x392a67))['catch'](handleError(_0x81b90e,null));};exports['show']=function(_0x57a78d,_0x18df4c){var _0x3c24a6={'raw':!![],'where':{'id':_0x57a78d['params']['id']}},_0x677808={};_0x677808[_0x6c09('0x23')]=_[_0x6c09('0x25')](db[_0x6c09('0x1e')][_0x6c09('0x1f')]);_0x677808[_0x6c09('0x24')]=_[_0x6c09('0x25')](_0x57a78d[_0x6c09('0x24')]);_0x677808[_0x6c09('0x2e')]=_[_0x6c09('0x26')](_0x677808[_0x6c09('0x23')],_0x677808[_0x6c09('0x24')]);_0x3c24a6['attributes']=_[_0x6c09('0x26')](_0x677808['model'],qs['fields'](_0x57a78d[_0x6c09('0x24')][_0x6c09('0x28')]));_0x3c24a6[_0x6c09('0x27')]=_0x3c24a6[_0x6c09('0x27')][_0x6c09('0x29')]?_0x3c24a6[_0x6c09('0x27')]:_0x677808[_0x6c09('0x23')];if(_0x57a78d['query'][_0x6c09('0x39')]){_0x3c24a6[_0x6c09('0x3a')]=[{'all':!![]}];}_0x3c24a6=_['merge']({},_0x3c24a6,_0x57a78d[_0x6c09('0x32')]);return db[_0x6c09('0x1e')][_0x6c09('0x3b')](_0x3c24a6)[_0x6c09('0x14')](handleEntityNotFound(_0x18df4c,null))[_0x6c09('0x14')](function(_0xaf4989){if(_0xaf4989['service']===_0x6c09('0x36')){var _0x57edf1=encryptor['decryptString'](_0xaf4989['data3']);_0xaf4989[_0x6c09('0x38')]=maskClientSecret(_0x57edf1);}return _0xaf4989;})[_0x6c09('0x14')](respondWithResult(_0x18df4c,null))['catch'](handleError(_0x18df4c,null));};exports[_0x6c09('0x3c')]=function(_0x1e1a2a,_0x11ac07){if(!_0x1e1a2a[_0x6c09('0x3d')][_0x6c09('0x18')])throw new Error(_0x6c09('0x3e'));if(!_0x1e1a2a['body'][_0x6c09('0x35')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4c3628=db[_0x6c09('0x1e')][_0x6c09('0x1f')][_0x6c09('0x35')][_0x6c09('0x3f')];if(!_0x4c3628[_0x6c09('0x40')](_0x1e1a2a['body']['service']))throw new Error(_0x6c09('0x41')+_0x4c3628[_0x6c09('0x42')](',\x20'));if(_0x1e1a2a[_0x6c09('0x3d')][_0x6c09('0x35')]==='MicrosoftAzure'&&_0x1e1a2a[_0x6c09('0x3d')][_0x6c09('0x38')]){_0x1e1a2a['body'][_0x6c09('0x38')]=encryptor['encryptString'](_0x1e1a2a['body'][_0x6c09('0x38')]);}return db[_0x6c09('0x1e')]['create'](_0x1e1a2a[_0x6c09('0x3d')],{})[_0x6c09('0x14')](respondWithResult(_0x11ac07,0xc9))[_0x6c09('0x43')](handleError(_0x11ac07,null));};exports[_0x6c09('0x13')]=function(_0x1ccaea,_0x26d1a0){if(_0x1ccaea['body']['id']){delete _0x1ccaea[_0x6c09('0x3d')]['id'];}return db[_0x6c09('0x1e')]['find']({'where':{'id':_0x1ccaea[_0x6c09('0x44')]['id']}})[_0x6c09('0x14')](handleEntityNotFound(_0x26d1a0,null))[_0x6c09('0x14')](function(_0x421d6c){if(_0x421d6c[_0x6c09('0x35')]===_0x6c09('0x36')&&_0x1ccaea[_0x6c09('0x3d')][_0x6c09('0x38')]){_0x1ccaea[_0x6c09('0x3d')][_0x6c09('0x38')]=encryptor[_0x6c09('0x45')](_0x1ccaea[_0x6c09('0x3d')][_0x6c09('0x38')]);}return _0x421d6c;})[_0x6c09('0x14')](saveUpdates(_0x1ccaea[_0x6c09('0x3d')],null))[_0x6c09('0x14')](respondWithResult(_0x26d1a0,null))[_0x6c09('0x43')](handleError(_0x26d1a0,null));};exports[_0x6c09('0x15')]=function(_0x47ad23,_0x512fb5){return db[_0x6c09('0x1e')][_0x6c09('0x3b')]({'where':{'id':_0x47ad23[_0x6c09('0x44')]['id']}})[_0x6c09('0x14')](handleEntityNotFound(_0x512fb5,null))[_0x6c09('0x14')](removeEntity(_0x512fb5,null))[_0x6c09('0x43')](handleError(_0x512fb5,null));};exports[_0x6c09('0x46')]=function(_0x13cc69,_0x460d79){return db[_0x6c09('0x1e')][_0x6c09('0x47')]({'where':{'id':_0x13cc69['params']['id']},'raw':!![]})['then'](function(_0x55a646){if(!_0x55a646)return _0x460d79[_0x6c09('0xa')](0x194);return{'url':oauth[_0x6c09('0x48')](_0x55a646,_0x13cc69[_0x6c09('0x49')]['id'])};})['then'](respondWithResult(_0x460d79,null))[_0x6c09('0x43')](handleError(_0x460d79,null));};exports[_0x6c09('0x4a')]=function(_0x1c4531,_0x1fe189){var _0x5b86f7=_0x1c4531['body'];var _0x1a7707;var _0x3b93c4;if(_0x5b86f7[_0x6c09('0x16')])throw _0x5b86f7;redis['get'](_0x5b86f7[_0x6c09('0x4b')])[_0x6c09('0x14')](function(_0x2b2c57){if(!_0x2b2c57)throw new Error('Invalid\x20state\x20parameter');_0x1a7707=JSON[_0x6c09('0x4c')](_0x2b2c57);var _0x1a1f82=Buffer[_0x6c09('0x4d')](_0x5b86f7[_0x6c09('0x4b')],_0x6c09('0x4e'))[_0x6c09('0x4f')](_0x6c09('0x50'));_0x3b93c4=JSON[_0x6c09('0x4c')](_0x1a1f82);if(!oauth[_0x6c09('0x51')](_0x5b86f7['id_token'],_0x1a7707[_0x6c09('0x52')]))throw new Error(_0x6c09('0x53'));redis[_0x6c09('0x54')](_0x5b86f7[_0x6c09('0x4b')]);return oauth[_0x6c09('0x55')](_0x5b86f7[_0x6c09('0x56')],_0x1a7707);})[_0x6c09('0x14')](function(_0xaadda0){_0x1a7707[_0x6c09('0x57')]=_0xaadda0['access_token'];_0x1a7707[_0x6c09('0x58')]=_0xaadda0[_0x6c09('0x59')];return db[_0x6c09('0x1e')][_0x6c09('0x13')]({'data5':_0x1a7707[_0x6c09('0x57')],'data6':_0x1a7707['data6']},{'where':{'id':_0x1a7707['id']}});})[_0x6c09('0x14')](function(){oauth[_0x6c09('0x5a')](_0x1a7707);socket[_0x6c09('0x5b')](_0x6c09('0x5c'),{'id':_0x3b93c4['id']});return;})[_0x6c09('0x14')](respondWithStatusCode(_0x1fe189,null))[_0x6c09('0x43')](function(_0x1d70cf){if(_0x3b93c4){socket[_0x6c09('0x5b')](_0x6c09('0x5d'),{'id':_0x3b93c4['id']});}if(!_0x1a7707){logger[_0x6c09('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x1d70cf);return _0x1fe189[_0x6c09('0xb')](0x1f4)[_0x6c09('0x19')](_0x1d70cf[_0x6c09('0x5e')]);}logger[_0x6c09('0x16')](_0x6c09('0x5f'),_0x1a7707['id'],JSON[_0x6c09('0x60')](_0x1d70cf));});};
\ No newline at end of file
+var _0xd1d6=['map','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','show','params','keys','find','catch','create','body','service','Service\x20parameter\x20not\x20specified','values','includes','join','encryptString','user','oauth2MicrosoftCallback','error','state','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','undefined','limit','count','offset','set','update','then','destroy','name','send','index','CloudProvider','rawAttributes','fieldName','type','key','model'];(function(_0x34a507,_0x51f563){var _0xcabaa2=function(_0x3ef2bd){while(--_0x3ef2bd){_0x34a507['push'](_0x34a507['shift']());}};_0xcabaa2(++_0x51f563);}(_0xd1d6,0x14d));var _0x6d1d=function(_0x41bcc9,_0x35f72d){_0x41bcc9=_0x41bcc9-0x0;var _0x54e11b=_0xd1d6[_0x41bcc9];return _0x54e11b;};'use strict';var _=require(_0x6d1d('0x0'));var Redis=require(_0x6d1d('0x1'));var qs=require(_0x6d1d('0x2'));var encryptor=require(_0x6d1d('0x3'));var config=require(_0x6d1d('0x4'));var logger=require(_0x6d1d('0x5'))('api');var db=require(_0x6d1d('0x6'))['db'];var oauth=require(_0x6d1d('0x7'));config[_0x6d1d('0x8')]=_[_0x6d1d('0x9')](config[_0x6d1d('0x8')],{'host':_0x6d1d('0xa'),'port':0x18eb});var socket=require(_0x6d1d('0xb'))(new Redis(config[_0x6d1d('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1545a8,_0x417a23){_0x417a23=_0x417a23||0xcc;return function(_0x426d14){if(_0x426d14){return _0x1545a8[_0x6d1d('0xc')](_0x417a23);}return _0x1545a8['status'](_0x417a23)['end']();};}function respondWithResult(_0x3fdc30,_0x1ea3f9){_0x1ea3f9=_0x1ea3f9||0xc8;return function(_0x2de539){if(_0x2de539){return _0x3fdc30[_0x6d1d('0xd')](_0x1ea3f9)['json'](_0x2de539);}};}function respondWithFilteredResult(_0x5eef90,_0x4a8a13){return function(_0x3fa892){if(_0x3fa892){var _0x59b74e=typeof _0x4a8a13['offset']===_0x6d1d('0xe')&&typeof _0x4a8a13[_0x6d1d('0xf')]===_0x6d1d('0xe');var _0x5e18e5=_0x3fa892[_0x6d1d('0x10')];var _0x32a0fb=_0x59b74e?0x0:_0x4a8a13[_0x6d1d('0x11')];var _0x3ffcb5=_0x59b74e?_0x3fa892[_0x6d1d('0x10')]:_0x4a8a13[_0x6d1d('0x11')]+_0x4a8a13['limit'];var _0x38993a;if(_0x3ffcb5>=_0x5e18e5){_0x3ffcb5=_0x5e18e5;_0x38993a=0xc8;}else{_0x38993a=0xce;}_0x5eef90['status'](_0x38993a);return _0x5eef90[_0x6d1d('0x12')]('Content-Range',_0x32a0fb+'-'+_0x3ffcb5+'/'+_0x5e18e5)['json'](_0x3fa892);}return null;};}function saveUpdates(_0x3ce178){return function(_0x4634db){if(_0x4634db){return _0x4634db[_0x6d1d('0x13')](_0x3ce178)[_0x6d1d('0x14')](function(_0x22dc17){return _0x22dc17;});}return null;};}function removeEntity(_0x365384){return function(_0x34fdb4){if(_0x34fdb4){return _0x34fdb4[_0x6d1d('0x15')]()['then'](function(){_0x365384['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4576a1){return function(_0x2f9979){if(!_0x2f9979){_0x4576a1[_0x6d1d('0xc')](0x194);}return _0x2f9979;};}function handleError(_0x11c865,_0x116187){_0x116187=_0x116187||0x1f4;return function(_0x1856bc){logger['error'](_0x1856bc['stack']);if(_0x1856bc[_0x6d1d('0x16')]){delete _0x1856bc[_0x6d1d('0x16')];}_0x11c865[_0x6d1d('0xd')](_0x116187)[_0x6d1d('0x17')](_0x1856bc);};}function maskClientSecret(_0x35dbae){return _['padEnd'](_0x35dbae['slice'](0x0,0x3),0x14,'*');}exports[_0x6d1d('0x18')]=function(_0x14a02e,_0x3393fd){var _0x2efc56={},_0x57d43b={},_0xef91c5={'count':0x0,'rows':[]};var _0x2bb15f=_['map'](db[_0x6d1d('0x19')][_0x6d1d('0x1a')],function(_0x4886c7){return{'name':_0x4886c7[_0x6d1d('0x1b')],'type':_0x4886c7[_0x6d1d('0x1c')][_0x6d1d('0x1d')]};});_0x57d43b[_0x6d1d('0x1e')]=_[_0x6d1d('0x1f')](_0x2bb15f,'name');_0x57d43b[_0x6d1d('0x20')]=_['keys'](_0x14a02e['query']);_0x57d43b['filters']=_['intersection'](_0x57d43b['model'],_0x57d43b['query']);_0x2efc56[_0x6d1d('0x21')]=_[_0x6d1d('0x22')](_0x57d43b[_0x6d1d('0x1e')],qs[_0x6d1d('0x23')](_0x14a02e[_0x6d1d('0x20')][_0x6d1d('0x23')]));_0x2efc56['attributes']=_0x2efc56[_0x6d1d('0x21')][_0x6d1d('0x24')]?_0x2efc56['attributes']:_0x57d43b[_0x6d1d('0x1e')];if(!_0x14a02e[_0x6d1d('0x20')][_0x6d1d('0x25')]('nolimit')){_0x2efc56[_0x6d1d('0xf')]=qs[_0x6d1d('0xf')](_0x14a02e[_0x6d1d('0x20')]['limit']);_0x2efc56[_0x6d1d('0x11')]=qs[_0x6d1d('0x11')](_0x14a02e[_0x6d1d('0x20')]['offset']);}_0x2efc56['order']=qs[_0x6d1d('0x26')](_0x14a02e['query'][_0x6d1d('0x26')]);_0x2efc56[_0x6d1d('0x27')]=qs['filters'](_[_0x6d1d('0x28')](_0x14a02e[_0x6d1d('0x20')],_0x57d43b[_0x6d1d('0x29')]),_0x2bb15f);if(_0x14a02e['query'][_0x6d1d('0x2a')]){_0x2efc56[_0x6d1d('0x27')]=_[_0x6d1d('0x2b')](_0x2efc56[_0x6d1d('0x27')],{'$or':_['map'](_0x2bb15f,function(_0x1b47d4){if(_0x1b47d4['type']!==_0x6d1d('0x2c')){var _0x14c045={};_0x14c045[_0x1b47d4['name']]={'$like':'%'+_0x14a02e[_0x6d1d('0x20')][_0x6d1d('0x2a')]+'%'};return _0x14c045;}})});}_0x2efc56=_[_0x6d1d('0x2b')]({},_0x2efc56,_0x14a02e[_0x6d1d('0x2d')]);var _0x3db887={'where':_0x2efc56[_0x6d1d('0x27')]};return db[_0x6d1d('0x19')]['count'](_0x3db887)[_0x6d1d('0x14')](function(_0x13641c){_0xef91c5[_0x6d1d('0x10')]=_0x13641c;if(_0x14a02e['query'][_0x6d1d('0x2e')]){_0x2efc56[_0x6d1d('0x2f')]=[{'all':!![]}];}return db['CloudProvider'][_0x6d1d('0x30')](_0x2efc56);})[_0x6d1d('0x14')](function(_0x3ed63f){_0xef91c5[_0x6d1d('0x31')]=_[_0x6d1d('0x1f')](_0x3ed63f,function(_0x1b6686){if(_0x1b6686['service']===_0x6d1d('0x32')){var _0x16f1de=encryptor[_0x6d1d('0x33')](_0x1b6686['data3']);_0x1b6686[_0x6d1d('0x34')]=maskClientSecret(_0x16f1de);}return _0x1b6686;});return _0xef91c5;})[_0x6d1d('0x14')](respondWithFilteredResult(_0x3393fd,_0x2efc56))['catch'](handleError(_0x3393fd,null));};exports[_0x6d1d('0x35')]=function(_0x12a78d,_0x435932){var _0xade116={'raw':!![],'where':{'id':_0x12a78d[_0x6d1d('0x36')]['id']}},_0x261768={};_0x261768['model']=_['keys'](db[_0x6d1d('0x19')][_0x6d1d('0x1a')]);_0x261768[_0x6d1d('0x20')]=_[_0x6d1d('0x37')](_0x12a78d[_0x6d1d('0x20')]);_0x261768[_0x6d1d('0x29')]=_[_0x6d1d('0x22')](_0x261768['model'],_0x261768[_0x6d1d('0x20')]);_0xade116[_0x6d1d('0x21')]=_[_0x6d1d('0x22')](_0x261768['model'],qs[_0x6d1d('0x23')](_0x12a78d[_0x6d1d('0x20')][_0x6d1d('0x23')]));_0xade116[_0x6d1d('0x21')]=_0xade116[_0x6d1d('0x21')]['length']?_0xade116[_0x6d1d('0x21')]:_0x261768[_0x6d1d('0x1e')];if(_0x12a78d[_0x6d1d('0x20')]['includeAll']){_0xade116[_0x6d1d('0x2f')]=[{'all':!![]}];}_0xade116=_[_0x6d1d('0x2b')]({},_0xade116,_0x12a78d[_0x6d1d('0x2d')]);return db['CloudProvider'][_0x6d1d('0x38')](_0xade116)[_0x6d1d('0x14')](handleEntityNotFound(_0x435932,null))[_0x6d1d('0x14')](function(_0x328536){if(_0x328536['service']==='MicrosoftAzure'){var _0x1935f8=encryptor[_0x6d1d('0x33')](_0x328536[_0x6d1d('0x34')]);_0x328536['data3']=maskClientSecret(_0x1935f8);}return _0x328536;})[_0x6d1d('0x14')](respondWithResult(_0x435932,null))[_0x6d1d('0x39')](handleError(_0x435932,null));};exports[_0x6d1d('0x3a')]=function(_0x248707,_0x31e077){if(!_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x16')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x3c')])throw new Error(_0x6d1d('0x3d'));var _0x55f890=db['CloudProvider'][_0x6d1d('0x1a')][_0x6d1d('0x3c')][_0x6d1d('0x3e')];if(!_0x55f890[_0x6d1d('0x3f')](_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x3c')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x55f890[_0x6d1d('0x40')](',\x20'));if(_0x248707[_0x6d1d('0x3b')]['service']==='MicrosoftAzure'&&_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x34')]){_0x248707[_0x6d1d('0x3b')][_0x6d1d('0x34')]=encryptor[_0x6d1d('0x41')](_0x248707[_0x6d1d('0x3b')]['data3']);}return db['CloudProvider']['create'](_0x248707[_0x6d1d('0x3b')],{})['then'](respondWithResult(_0x31e077,0xc9))[_0x6d1d('0x39')](handleError(_0x31e077,null));};exports[_0x6d1d('0x13')]=function(_0x48e6b2,_0x3a09cf){if(_0x48e6b2[_0x6d1d('0x3b')]['id']){delete _0x48e6b2[_0x6d1d('0x3b')]['id'];}return db[_0x6d1d('0x19')][_0x6d1d('0x38')]({'where':{'id':_0x48e6b2[_0x6d1d('0x36')]['id']}})['then'](handleEntityNotFound(_0x3a09cf,null))[_0x6d1d('0x14')](function(_0x185db4){if(_0x185db4[_0x6d1d('0x3c')]==='MicrosoftAzure'&&_0x48e6b2['body'][_0x6d1d('0x34')]){_0x48e6b2[_0x6d1d('0x3b')][_0x6d1d('0x34')]=encryptor[_0x6d1d('0x41')](_0x48e6b2['body'][_0x6d1d('0x34')]);}return _0x185db4;})[_0x6d1d('0x14')](saveUpdates(_0x48e6b2[_0x6d1d('0x3b')],null))[_0x6d1d('0x14')](respondWithResult(_0x3a09cf,null))[_0x6d1d('0x39')](handleError(_0x3a09cf,null));};exports['destroy']=function(_0x20eedb,_0x538d95){return db[_0x6d1d('0x19')][_0x6d1d('0x38')]({'where':{'id':_0x20eedb[_0x6d1d('0x36')]['id']}})[_0x6d1d('0x14')](handleEntityNotFound(_0x538d95,null))[_0x6d1d('0x14')](removeEntity(_0x538d95,null))['catch'](handleError(_0x538d95,null));};exports['oauth2MicrosoftAuthorize']=function(_0x42ae36,_0x4dc40e){return db['CloudProvider']['findOne']({'where':{'id':_0x42ae36[_0x6d1d('0x36')]['id']},'raw':!![]})[_0x6d1d('0x14')](function(_0x2030fe){if(!_0x2030fe)return _0x4dc40e[_0x6d1d('0xc')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x2030fe,_0x42ae36[_0x6d1d('0x42')]['id'])};})[_0x6d1d('0x14')](respondWithResult(_0x4dc40e,null))[_0x6d1d('0x39')](handleError(_0x4dc40e,null));};exports[_0x6d1d('0x43')]=function(_0x5b9120,_0x2137d9){var _0x140b63=_0x5b9120[_0x6d1d('0x3b')];var _0x2421bd;var _0x20d44f;if(_0x140b63[_0x6d1d('0x44')])throw _0x140b63;redis['get'](_0x140b63['state'])[_0x6d1d('0x14')](function(_0x44f1f6){if(!_0x44f1f6)throw new Error('Invalid\x20state\x20parameter');_0x2421bd=JSON['parse'](_0x44f1f6);var _0x465b0e=Buffer['from'](_0x140b63[_0x6d1d('0x45')],'base64')[_0x6d1d('0x46')](_0x6d1d('0x47'));_0x20d44f=JSON[_0x6d1d('0x48')](_0x465b0e);if(!oauth[_0x6d1d('0x49')](_0x140b63[_0x6d1d('0x4a')],_0x2421bd[_0x6d1d('0x4b')]))throw new Error(_0x6d1d('0x4c'));redis[_0x6d1d('0x4d')](_0x140b63[_0x6d1d('0x45')]);return oauth[_0x6d1d('0x4e')](_0x140b63[_0x6d1d('0x4f')],_0x2421bd);})[_0x6d1d('0x14')](function(_0x29ac73){_0x2421bd[_0x6d1d('0x50')]=_0x29ac73[_0x6d1d('0x51')];_0x2421bd[_0x6d1d('0x52')]=_0x29ac73[_0x6d1d('0x53')];return db['CloudProvider'][_0x6d1d('0x13')]({'data5':_0x2421bd['data5'],'data6':_0x2421bd[_0x6d1d('0x52')]},{'where':{'id':_0x2421bd['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x2421bd);socket[_0x6d1d('0x54')](_0x6d1d('0x55'),{'id':_0x20d44f['id']});return;})[_0x6d1d('0x14')](respondWithStatusCode(_0x2137d9,null))['catch'](function(_0x5e23e6){if(_0x20d44f){socket[_0x6d1d('0x54')](_0x6d1d('0x56'),{'id':_0x20d44f['id']});}if(!_0x2421bd){logger[_0x6d1d('0x44')](_0x6d1d('0x57'),_0x5e23e6);return _0x2137d9[_0x6d1d('0xd')](0x1f4)[_0x6d1d('0x17')](_0x5e23e6[_0x6d1d('0x58')]);}logger[_0x6d1d('0x44')](_0x6d1d('0x59'),_0x2421bd['id'],JSON[_0x6d1d('0x5a')](_0x5e23e6));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index ec48803..a9992d4 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8b07=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash'];(function(_0x1788d2,_0x577054){var _0x2f5bc3=function(_0x68a6f4){while(--_0x68a6f4){_0x1788d2['push'](_0x1788d2['shift']());}};_0x2f5bc3(++_0x577054);}(_0x8b07,0xc2));var _0x78b0=function(_0x43597e,_0x542b30){_0x43597e=_0x43597e-0x0;var _0x4cdd53=_0x8b07[_0x43597e];return _0x4cdd53;};'use strict';var _=require(_0x78b0('0x0'));var util=require(_0x78b0('0x1'));var logger=require(_0x78b0('0x2'))(_0x78b0('0x3'));var moment=require(_0x78b0('0x4'));var BPromise=require(_0x78b0('0x5'));var rp=require(_0x78b0('0x6'));var fs=require('fs');var path=require(_0x78b0('0x7'));var rimraf=require(_0x78b0('0x8'));var config=require(_0x78b0('0x9'));var attributes=require(_0x78b0('0xa'));module[_0x78b0('0xb')]=function(_0x2ce1a0,_0x390fa8){return _0x2ce1a0[_0x78b0('0xc')](_0x78b0('0xd'),attributes,{'tableName':_0x78b0('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x37d0=['CloudProvider','cloud_providers','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0xb6c029,_0x289717){var _0x369954=function(_0xf20e69){while(--_0xf20e69){_0xb6c029['push'](_0xb6c029['shift']());}};_0x369954(++_0x289717);}(_0x37d0,0x1af));var _0x037d=function(_0x471450,_0x13f132){_0x471450=_0x471450-0x0;var _0xd594c9=_0x37d0[_0x471450];return _0xd594c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x037d('0x0'))(_0x037d('0x1'));var moment=require(_0x037d('0x2'));var BPromise=require(_0x037d('0x3'));var rp=require(_0x037d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x037d('0x5'));var config=require(_0x037d('0x6'));var attributes=require(_0x037d('0x7'));module[_0x037d('0x8')]=function(_0x59a01a,_0x58ea17){return _0x59a01a['define'](_0x037d('0x9'),attributes,{'tableName':_0x037d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 46af9fc..021c7b6 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf98d=['value','oauth2Claims','oauth2/','set','payload','iss','aud','audience','isAfter','unix','data3','findOne','then','refresh_token','decryptString','POST','data5','access_token','data6','update','catch','error','authorization_code','data1','intervals','bind','CloudProvider','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','client_id','response_type','join','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','key'];(function(_0xf41af4,_0x2dca83){var _0x1290bc=function(_0x1c9c08){while(--_0x1c9c08){_0xf41af4['push'](_0xf41af4['shift']());}};_0x1290bc(++_0x2dca83);}(_0xf98d,0x11e));var _0xdf98=function(_0x12d247,_0x239701){_0x12d247=_0x12d247-0x0;var _0x4c9a7a=_0xf98d[_0x12d247];return _0x4c9a7a;};'use strict';var _=require(_0xdf98('0x0'));var crypto=require(_0xdf98('0x1'));var jwt=require(_0xdf98('0x2'));var moment=require(_0xdf98('0x3'));var Redis=require(_0xdf98('0x4'));var rp=require(_0xdf98('0x5'));var util=require(_0xdf98('0x6'));var encryptor=require(_0xdf98('0x7'));var config=require(_0xdf98('0x8'));var logger=require(_0xdf98('0x9'))(_0xdf98('0xa'));var schedule=require(_0xdf98('0xb'));var db=require(_0xdf98('0xc'))['db'];config[_0xdf98('0xd')]=_[_0xdf98('0xe')](config[_0xdf98('0xd')],{'host':_0xdf98('0xf'),'port':0x18eb});var redis=new Redis(config[_0xdf98('0xd')]);var MICROSOFT_AUTH_URL=_0xdf98('0x10');var AZURE_AUTH_SCOPES={'Outlook365':[_0xdf98('0x11'),'profile',_0xdf98('0x12'),_0xdf98('0x13'),_0xdf98('0x14'),_0xdf98('0x15'),_0xdf98('0x16')],'Dynamics365':[_0xdf98('0x11'),_0xdf98('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0xdf98('0x17');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x545b96){var _0x51088d=_[_0xdf98('0x18')](AZURE_AUTH_SCOPES[_0x545b96[_0xdf98('0x19')]]);if(_0x545b96[_0xdf98('0x19')]===_0xdf98('0x1a'))_0x51088d[_0xdf98('0x1b')](_0x545b96[_0xdf98('0x1c')]+_0xdf98('0x1d'));return _0x51088d['join']('\x20');}function getAccessTokenScope(_0x16d543){if(_0x16d543[_0xdf98('0x19')]===_0xdf98('0x1e'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x16d543[_0xdf98('0x19')]===_0xdf98('0x1a'))return _0x16d543[_0xdf98('0x1c')]+_0xdf98('0x1d');}function generateMicrosoftAuthorizationUrl(_0x1a1094,_0x5cf414){var _0x47f5dd=MICROSOFT_AUTH_URL[_0xdf98('0x1f')](_0xdf98('0x20'),_0x1a1094[_0xdf98('0x21')]);var _0xdc7c57=[_0xdf98('0x22'),_0xdf98('0x23')];var _0x42eb56=Buffer[_0xdf98('0x24')](JSON[_0xdf98('0x25')]({'id':_0x5cf414}))[_0xdf98('0x26')](_0xdf98('0x27'));var _0x93e2ec=crypto[_0xdf98('0x28')](0x10)['toString'](_0xdf98('0x29'));var _0x5cb049=getAuthorizationScopes(_0x1a1094);var _0x13d827=[{'key':_0xdf98('0x2a'),'value':_0x1a1094['data1']},{'key':_0xdf98('0x2b'),'value':encodeURIComponent(_0xdc7c57[_0xdf98('0x2c')]('\x20'))},{'key':_0xdf98('0x2d'),'value':_0x1a1094[_0xdf98('0x2e')]},{'key':'response_mode','value':_0xdf98('0x2f')},{'key':_0xdf98('0x30'),'value':encodeURIComponent(_0x5cb049)},{'key':_0xdf98('0x31'),'value':_0x42eb56},{'key':_0xdf98('0x32'),'value':_0x93e2ec},{'key':_0xdf98('0x33'),'value':_0xdf98('0x34')}];var _0x2c1872=_0x47f5dd+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdf98('0x18')](_0x13d827,function(_0x4ee237){return _0x4ee237[_0xdf98('0x35')]+'='+_0x4ee237[_0xdf98('0x36')];})['join']('&');_0x1a1094[_0xdf98('0x37')]={'issuer':_0x47f5dd[_0xdf98('0x1f')](_0xdf98('0x38'),''),'audience':_0x1a1094['data1'],'state':_0x42eb56,'nonce':_0x93e2ec};redis[_0xdf98('0x39')](_0x42eb56,JSON[_0xdf98('0x25')](_0x1a1094));return _0x2c1872;}function isValidIdToken(_0x53678c,_0x5b9200){try{var _0x45d6fb=jwt['decode'](_0x53678c,{'complete':!![]});var _0x5b0174=_0x45d6fb[_0xdf98('0x3a')];if(_0x5b0174[_0xdf98('0x3b')]!==_0x5b9200['issuer'])return![];if(_0x5b0174[_0xdf98('0x3c')]!==_0x5b9200[_0xdf98('0x3d')])return![];if(_0x5b0174[_0xdf98('0x32')]!==_0x5b9200[_0xdf98('0x32')])return![];if(moment()[_0xdf98('0x3e')](moment[_0xdf98('0x3f')](_0x5b0174['exp'])))return![];return!![];}catch(_0x2b2015){throw _0x2b2015;}}function refreshOauth2MicrosoftAccessToken(_0xdcdf03){return Promise['resolve']()['then'](function(){if(_0xdcdf03[_0xdf98('0x40')])return _0xdcdf03;return db['CloudProvider'][_0xdf98('0x41')]({'where':{'id':_0xdcdf03['id']},'raw':!![]});})[_0xdf98('0x42')](function(_0x56ced4){var _0xb9df57={'grant_type':_0xdf98('0x43'),'refresh_token':_0x56ced4['data6'],'scope':getAccessTokenScope(_0x56ced4),'redirect_uri':_0x56ced4['data4'],'client_id':_0x56ced4['data1'],'client_secret':encryptor[_0xdf98('0x44')](_0x56ced4['data3'])};var _0xbf3be3={'method':_0xdf98('0x45'),'uri':MICROSOFT_AUTH_URL[_0xdf98('0x1f')]('{TENANT_ID}',_0x56ced4[_0xdf98('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xb9df57,'json':!![]};return rp(_0xbf3be3);})[_0xdf98('0x42')](function(_0x588710){_0xdcdf03[_0xdf98('0x46')]=_0x588710[_0xdf98('0x47')];_0xdcdf03[_0xdf98('0x48')]=_0x588710[_0xdf98('0x43')];return db['CloudProvider'][_0xdf98('0x49')]({'data5':_0xdcdf03[_0xdf98('0x46')],'data6':_0xdcdf03[_0xdf98('0x48')]},{'where':{'id':_0xdcdf03['id']}});})['then'](function(){return _0xdcdf03;})[_0xdf98('0x4a')](function(_0xe91d8f){logger[_0xdf98('0x4b')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0xdcdf03['id'],_0xe91d8f);});}function getOauth2MicrosoftAccessToken(_0x1961d6,_0x11dcfd){var _0x473899={'grant_type':_0xdf98('0x4c'),'code':_0x1961d6,'scope':getAccessTokenScope(_0x11dcfd),'redirect_uri':_0x11dcfd[_0xdf98('0x2e')],'client_id':_0x11dcfd[_0xdf98('0x4d')],'client_secret':encryptor[_0xdf98('0x44')](_0x11dcfd['data3'])};var _0x1fd8ac={'method':_0xdf98('0x45'),'uri':MICROSOFT_AUTH_URL[_0xdf98('0x1f')]('{TENANT_ID}',_0x11dcfd[_0xdf98('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x473899,'json':!![]};return rp(_0x1fd8ac);}function startRefreshInterval(_0x5787d3){var _0x22ebc4=schedule[_0xdf98('0x4e')];if(_0x22ebc4[_0x5787d3['id']])clearInterval(_0x22ebc4[_0x5787d3['id']]);_0x22ebc4[_0x5787d3['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdf98('0x4f')](this,{'id':_0x5787d3['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xdf98('0x4e')]=_0x22ebc4;}function startAllRefreshIntervals(){return db[_0xdf98('0x50')][_0xdf98('0x51')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x4c6e92){var _0x30346b=_0x4c6e92['map'](function(_0x46f560){return refreshOauth2MicrosoftAccessToken(_0x46f560)['then'](function(_0x5bb6ff){startRefreshInterval(_0x5bb6ff);});});return Promise[_0xdf98('0x52')](_0x30346b);})[_0xdf98('0x4a')](function(_0x5aaf42){var _0x30cc2a=_0x5aaf42?util[_0xdf98('0x53')](_0x5aaf42,{'showHidden':![],'depth':null}):'';logger['error'](_0xdf98('0x54'),_0x30cc2a);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xb33b=['join','Outlook365','replace','{TENANT_ID}','id_token','from','stringify','base64','randomBytes','toString','hex','data1','response_type','response_mode','form_post','nonce','login','map','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','exp','resolve','then','CloudProvider','refresh_token','data6','data4','decryptString','data3','POST','data2','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb33b,0xd1));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb33('0x0'));var crypto=require(_0xbb33('0x1'));var jwt=require(_0xbb33('0x2'));var moment=require(_0xbb33('0x3'));var Redis=require(_0xbb33('0x4'));var rp=require(_0xbb33('0x5'));var util=require(_0xbb33('0x6'));var encryptor=require(_0xbb33('0x7'));var config=require(_0xbb33('0x8'));var logger=require('../../config/logger')('api');var schedule=require(_0xbb33('0x9'));var db=require(_0xbb33('0xa'))['db'];config['redis']=_[_0xbb33('0xb')](config[_0xbb33('0xc')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0xbb33('0xc')]);var MICROSOFT_AUTH_URL=_0xbb33('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbb33('0xe'),_0xbb33('0xf'),_0xbb33('0x10'),_0xbb33('0x11'),_0xbb33('0x12'),_0xbb33('0x13'),_0xbb33('0x14')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbb33('0x15');var MICROSOFT_TOKEN_ENDPOINT=_0xbb33('0x16');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4b8c0e){var _0x15bedd=_['map'](AZURE_AUTH_SCOPES[_0x4b8c0e[_0xbb33('0x17')]]);if(_0x4b8c0e['type']===_0xbb33('0x18'))_0x15bedd[_0xbb33('0x19')](_0x4b8c0e[_0xbb33('0x1a')]+_0xbb33('0x1b'));return _0x15bedd[_0xbb33('0x1c')]('\x20');}function getAccessTokenScope(_0xb492e2){if(_0xb492e2[_0xbb33('0x17')]===_0xbb33('0x1d'))return _0xbb33('0x12');if(_0xb492e2[_0xbb33('0x17')]===_0xbb33('0x18'))return _0xb492e2[_0xbb33('0x1a')]+_0xbb33('0x1b');}function generateMicrosoftAuthorizationUrl(_0x594733,_0x5d41c4){var _0x1aac40=MICROSOFT_AUTH_URL[_0xbb33('0x1e')](_0xbb33('0x1f'),_0x594733['data2']);var _0x375ad1=['code',_0xbb33('0x20')];var _0x3fa8a1=Buffer[_0xbb33('0x21')](JSON[_0xbb33('0x22')]({'id':_0x5d41c4}))['toString'](_0xbb33('0x23'));var _0x4aa779=crypto[_0xbb33('0x24')](0x10)[_0xbb33('0x25')](_0xbb33('0x26'));var _0x773352=getAuthorizationScopes(_0x594733);var _0x1198f8=[{'key':'client_id','value':_0x594733[_0xbb33('0x27')]},{'key':_0xbb33('0x28'),'value':encodeURIComponent(_0x375ad1[_0xbb33('0x1c')]('\x20'))},{'key':'redirect_uri','value':_0x594733['data4']},{'key':_0xbb33('0x29'),'value':_0xbb33('0x2a')},{'key':'scope','value':encodeURIComponent(_0x773352)},{'key':'state','value':_0x3fa8a1},{'key':_0xbb33('0x2b'),'value':_0x4aa779},{'key':'prompt','value':_0xbb33('0x2c')}];var _0x2a52fa=_0x1aac40+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbb33('0x2d')](_0x1198f8,function(_0x545fbf){return _0x545fbf[_0xbb33('0x2e')]+'='+_0x545fbf[_0xbb33('0x2f')];})[_0xbb33('0x1c')]('&');_0x594733[_0xbb33('0x30')]={'issuer':_0x1aac40['replace'](_0xbb33('0x31'),''),'audience':_0x594733[_0xbb33('0x27')],'state':_0x3fa8a1,'nonce':_0x4aa779};redis[_0xbb33('0x32')](_0x3fa8a1,JSON[_0xbb33('0x22')](_0x594733));return _0x2a52fa;}function isValidIdToken(_0x1668a9,_0x5568c2){try{var _0xb5d2f9=jwt[_0xbb33('0x33')](_0x1668a9,{'complete':!![]});var _0x346caa=_0xb5d2f9[_0xbb33('0x34')];if(_0x346caa[_0xbb33('0x35')]!==_0x5568c2[_0xbb33('0x36')])return![];if(_0x346caa['aud']!==_0x5568c2['audience'])return![];if(_0x346caa[_0xbb33('0x2b')]!==_0x5568c2[_0xbb33('0x2b')])return![];if(moment()['isAfter'](moment['unix'](_0x346caa[_0xbb33('0x37')])))return![];return!![];}catch(_0x118477){throw _0x118477;}}function refreshOauth2MicrosoftAccessToken(_0x472dcb){return Promise[_0xbb33('0x38')]()[_0xbb33('0x39')](function(){if(_0x472dcb['data3'])return _0x472dcb;return db[_0xbb33('0x3a')]['findOne']({'where':{'id':_0x472dcb['id']},'raw':!![]});})[_0xbb33('0x39')](function(_0x51afaa){var _0x39aebe={'grant_type':_0xbb33('0x3b'),'refresh_token':_0x51afaa[_0xbb33('0x3c')],'scope':getAccessTokenScope(_0x51afaa),'redirect_uri':_0x51afaa[_0xbb33('0x3d')],'client_id':_0x51afaa[_0xbb33('0x27')],'client_secret':encryptor[_0xbb33('0x3e')](_0x51afaa[_0xbb33('0x3f')])};var _0x571e77={'method':_0xbb33('0x40'),'uri':MICROSOFT_AUTH_URL[_0xbb33('0x1e')](_0xbb33('0x1f'),_0x51afaa[_0xbb33('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x39aebe,'json':!![]};return rp(_0x571e77);})[_0xbb33('0x39')](function(_0x348557){_0x472dcb[_0xbb33('0x42')]=_0x348557[_0xbb33('0x43')];_0x472dcb[_0xbb33('0x3c')]=_0x348557[_0xbb33('0x3b')];return db['CloudProvider'][_0xbb33('0x44')]({'data5':_0x472dcb[_0xbb33('0x42')],'data6':_0x472dcb[_0xbb33('0x3c')]},{'where':{'id':_0x472dcb['id']}});})[_0xbb33('0x39')](function(){return _0x472dcb;})[_0xbb33('0x45')](function(_0x4eb092){logger['error'](_0xbb33('0x46'),_0x472dcb['id'],_0x4eb092);});}function getOauth2MicrosoftAccessToken(_0x5f110e,_0x156864){var _0x411f9b={'grant_type':_0xbb33('0x47'),'code':_0x5f110e,'scope':getAccessTokenScope(_0x156864),'redirect_uri':_0x156864[_0xbb33('0x3d')],'client_id':_0x156864['data1'],'client_secret':encryptor[_0xbb33('0x3e')](_0x156864[_0xbb33('0x3f')])};var _0x15c1da={'method':_0xbb33('0x40'),'uri':MICROSOFT_AUTH_URL[_0xbb33('0x1e')](_0xbb33('0x1f'),_0x156864[_0xbb33('0x41')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x411f9b,'json':!![]};return rp(_0x15c1da);}function startRefreshInterval(_0x22c84e){var _0x1b6306=schedule[_0xbb33('0x48')];if(_0x1b6306[_0x22c84e['id']])clearInterval(_0x1b6306[_0x22c84e['id']]);_0x1b6306[_0x22c84e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbb33('0x49')](this,{'id':_0x22c84e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x1b6306;}function startAllRefreshIntervals(){return db[_0xbb33('0x3a')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xbb33('0x39')](function(_0x268741){var _0x26448c=_0x268741[_0xbb33('0x2d')](function(_0x4d9c58){return refreshOauth2MicrosoftAccessToken(_0x4d9c58)['then'](function(_0x9621eb){startRefreshInterval(_0x9621eb);});});return Promise[_0xbb33('0x4a')](_0x26448c);})[_0xbb33('0x45')](function(_0x2dc470){var _0x3cdfd3=_0x2dc470?util[_0xbb33('0x4b')](_0x2dc470,{'showHidden':![],'depth':null}):'';logger[_0xbb33('0x4c')](_0xbb33('0x4d'),_0x3cdfd3);});}module[_0xbb33('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 5e4e20a..0ca9c72 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8f1a=['debug','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x5ac090,_0x4cab85){_0x5ac090=_0x5ac090-0x0;var _0x13ffe2=_0x8f1a[_0x5ac090];return _0x13ffe2;};'use strict';var _=require(_0xa8f1('0x0'));var util=require(_0xa8f1('0x1'));var moment=require(_0xa8f1('0x2'));var BPromise=require(_0xa8f1('0x3'));var rs=require(_0xa8f1('0x4'));var fs=require('fs');var Redis=require(_0xa8f1('0x5'));var db=require(_0xa8f1('0x6'))['db'];var utils=require(_0xa8f1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa8f1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa8f1('0x9')][_0xa8f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c2920,_0x43c3ed,_0x13f210){return new BPromise(function(_0xcc8a38,_0x36b58b){return client[_0xa8f1('0xb')](_0x4c2920,_0x13f210)[_0xa8f1('0xc')](function(_0x1a23a0){logger[_0xa8f1('0xd')]('CloudProvider,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'));logger[_0xa8f1('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x43c3ed,_0xa8f1('0xe'),JSON['stringify'](_0x1a23a0));if(_0x1a23a0[_0xa8f1('0x10')]){if(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x11')]===0x1f4){logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);return _0x36b58b(_0x1a23a0[_0xa8f1('0x10')][_0xa8f1('0x13')]);}logger['error'](_0xa8f1('0x12'),_0x43c3ed,_0x1a23a0['error'][_0xa8f1('0x13')]);return _0xcc8a38(_0x1a23a0[_0xa8f1('0x10')]['message']);}else{logger['info'](_0xa8f1('0x12'),_0x43c3ed,_0xa8f1('0xe'));_0xcc8a38(_0x1a23a0[_0xa8f1('0x14')][_0xa8f1('0x13')]);}})[_0xa8f1('0x15')](function(_0x15bfad){logger[_0xa8f1('0x10')](_0xa8f1('0x12'),_0x43c3ed,_0x15bfad);_0x36b58b(_0x15bfad);});});}
\ No newline at end of file
+var _0xf277=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','message','CloudProvider,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf277,0x1e1));var _0x7f27=function(_0x51c956,_0x49a0b6){_0x51c956=_0x51c956-0x0;var _0x507143=_0xf277[_0x51c956];return _0x507143;};'use strict';var _=require(_0x7f27('0x0'));var util=require(_0x7f27('0x1'));var moment=require('moment');var BPromise=require(_0x7f27('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f27('0x3'));var db=require(_0x7f27('0x4'))['db'];var utils=require(_0x7f27('0x5'));var logger=require(_0x7f27('0x6'))(_0x7f27('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f27('0x8'));var client=jayson['client'][_0x7f27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39dcee,_0x480cd6,_0x23dbcc){return new BPromise(function(_0x25c4dc,_0x5c0dbb){return client[_0x7f27('0xa')](_0x39dcee,_0x23dbcc)[_0x7f27('0xb')](function(_0x8ecc84){logger[_0x7f27('0xc')]('CloudProvider,\x20%s,\x20%s',_0x480cd6,'request\x20sent');logger[_0x7f27('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'),JSON[_0x7f27('0xf')](_0x8ecc84));if(_0x8ecc84[_0x7f27('0x10')]){if(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x11')]===0x1f4){logger[_0x7f27('0x10')]('CloudProvider,\x20%s,\x20%s',_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x5c0dbb(_0x8ecc84['error'][_0x7f27('0x12')]);}logger[_0x7f27('0x10')](_0x7f27('0x13'),_0x480cd6,_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);return _0x25c4dc(_0x8ecc84[_0x7f27('0x10')][_0x7f27('0x12')]);}else{logger[_0x7f27('0xc')]('CloudProvider,\x20%s,\x20%s',_0x480cd6,_0x7f27('0xe'));_0x25c4dc(_0x8ecc84[_0x7f27('0x14')]['message']);}})[_0x7f27('0x15')](function(_0x402610){logger['error'](_0x7f27('0x13'),_0x480cd6,_0x402610);_0x5c0dbb(_0x402610);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7fd641a..0f4035d 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x53564e,_0x126614){_0x53564e=_0x53564e-0x0;var _0x3d35d6=_0x7a54[_0x53564e];return _0x3d35d6;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x35887e,_0x23922c){var _0x285cb0=function(_0x59ab61){while(--_0x59ab61){_0x35887e['push'](_0x35887e['shift']());}};_0x285cb0(++_0x23922c);}(_0xadb5,0xad));var _0x5adb=function(_0x23cf1f,_0x5241a3){_0x23cf1f=_0x23cf1f-0x0;var _0x2158dd=_0xadb5[_0x23cf1f];return _0x2158dd;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 233d842..b2f26ac 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f08=['exports','name','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f08,0x138));var _0x85f0=function(_0x2857d9,_0x93afd9){_0x2857d9=_0x2857d9-0x0;var _0x54a427=_0x5f08[_0x2857d9];return _0x54a427;};'use strict';var Sequelize=require('sequelize');module[_0x85f0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x85f0('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x85f0('0x2')]},'companyId':{'type':Sequelize[_0x85f0('0x2')]},'website':{'type':Sequelize[_0x85f0('0x2')]},'phone':{'type':Sequelize[_0x85f0('0x2')]},'fax':{'type':Sequelize[_0x85f0('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x85f0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x85f0('0x2')]},'sPostalCode':{'type':Sequelize[_0x85f0('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe7de=['sequelize','exports','name','STRING'];(function(_0x59145c,_0x94d69a){var _0x4651d0=function(_0x5705b1){while(--_0x5705b1){_0x59145c['push'](_0x59145c['shift']());}};_0x4651d0(++_0x94d69a);}(_0xe7de,0xdc));var _0xee7d=function(_0x58597c,_0x401aaa){_0x58597c=_0x58597c-0x0;var _0x42c6b2=_0xe7de[_0x58597c];return _0x42c6b2;};'use strict';var Sequelize=require(_0xee7d('0x0'));module[_0xee7d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xee7d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xee7d('0x3')]},'companyId':{'type':Sequelize[_0xee7d('0x3')]},'website':{'type':Sequelize[_0xee7d('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xee7d('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xee7d('0x3')]},'city':{'type':Sequelize[_0xee7d('0x3')]},'country':{'type':Sequelize[_0xee7d('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xee7d('0x3')]},'sStreet':{'type':Sequelize[_0xee7d('0x3')]},'sPostalCode':{'type':Sequelize[_0xee7d('0x3')]},'sCity':{'type':Sequelize[_0xee7d('0x3')]},'sCountry':{'type':Sequelize[_0xee7d('0x3')]},'description':{'type':Sequelize[_0xee7d('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index d585e50..94a062e 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe733=['set','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count'];(function(_0xb15971,_0x839878){var _0x1ec56d=function(_0x3764b0){while(--_0x3764b0){_0xb15971['push'](_0xb15971['shift']());}};_0x1ec56d(++_0x839878);}(_0xe733,0x1e1));var _0x3e73=function(_0xd3a254,_0x3b20d3){_0xd3a254=_0xd3a254-0x0;var _0x2dd3dd=_0xe733[_0xd3a254];return _0x2dd3dd;};'use strict';var emlformat=require(_0x3e73('0x0'));var rimraf=require(_0x3e73('0x1'));var zipdir=require(_0x3e73('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e73('0x3'));var moment=require(_0x3e73('0x4'));var BPromise=require(_0x3e73('0x5'));var Mustache=require(_0x3e73('0x6'));var util=require('util');var path=require(_0x3e73('0x7'));var sox=require('sox');var csv=require(_0x3e73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e73('0x9'));var squel=require('squel');var crypto=require(_0x3e73('0xa'));var jsforce=require(_0x3e73('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e73('0xc'));var Papa=require('papaparse');var Redis=require(_0x3e73('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3e73('0xe'));var as=require(_0x3e73('0xf'));var hardwareService=require(_0x3e73('0x10'));var logger=require(_0x3e73('0x11'))(_0x3e73('0x12'));var utils=require(_0x3e73('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3e73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbddf,_0x379c6c){_0x379c6c=_0x379c6c||0xcc;return function(_0x2f3f58){if(_0x2f3f58){return _0x4cbddf[_0x3e73('0x15')](_0x379c6c);}return _0x4cbddf[_0x3e73('0x16')](_0x379c6c)[_0x3e73('0x17')]();};}function respondWithResult(_0x5ea485,_0x4f8d44){_0x4f8d44=_0x4f8d44||0xc8;return function(_0x419fd8){if(_0x419fd8){return _0x5ea485[_0x3e73('0x16')](_0x4f8d44)[_0x3e73('0x18')](_0x419fd8);}};}function respondWithFilteredResult(_0x35bfc5,_0xc5d0e9){return function(_0x112b8c){if(_0x112b8c){var _0x161fe7=typeof _0xc5d0e9[_0x3e73('0x19')]==='undefined'&&typeof _0xc5d0e9[_0x3e73('0x1a')]===_0x3e73('0x1b');var _0x59d197=_0x112b8c[_0x3e73('0x1c')];var _0x61da7f=_0x161fe7?0x0:_0xc5d0e9[_0x3e73('0x19')];var _0x6a0b9=_0x161fe7?_0x112b8c[_0x3e73('0x1c')]:_0xc5d0e9[_0x3e73('0x19')]+_0xc5d0e9[_0x3e73('0x1a')];var _0x569f92;if(_0x6a0b9>=_0x59d197){_0x6a0b9=_0x59d197;_0x569f92=0xc8;}else{_0x569f92=0xce;}_0x35bfc5[_0x3e73('0x16')](_0x569f92);return _0x35bfc5[_0x3e73('0x1d')]('Content-Range',_0x61da7f+'-'+_0x6a0b9+'/'+_0x59d197)['json'](_0x112b8c);}return null;};}function patchUpdates(_0x11ad4c){return function(_0x4368a6){try{jsonpatch[_0x3e73('0x1e')](_0x4368a6,_0x11ad4c,!![]);}catch(_0x4e56df){return BPromise['reject'](_0x4e56df);}return _0x4368a6[_0x3e73('0x1f')]();};}function saveUpdates(_0x3858fe,_0x268c5e){return function(_0x3ea07c){if(_0x3ea07c){return _0x3ea07c[_0x3e73('0x20')](_0x3858fe)['then'](function(_0x4fb919){return _0x4fb919;});}return null;};}function removeEntity(_0x2b8e71,_0x2c5f3b){return function(_0x4f6c58){if(_0x4f6c58){return _0x4f6c58[_0x3e73('0x21')]()['then'](function(){var _0x198fdb=_0x4f6c58[_0x3e73('0x22')]({'plain':!![]});var _0x3a8327='Companies';return db[_0x3e73('0x23')][_0x3e73('0x21')]({'where':{'type':_0x3a8327,'resourceId':_0x198fdb['id']}})[_0x3e73('0x24')](function(){return _0x4f6c58;});})[_0x3e73('0x24')](function(){_0x2b8e71[_0x3e73('0x16')](0xcc)[_0x3e73('0x17')]();});}};}function handleEntityNotFound(_0x18de42,_0x4f7572){return function(_0x4e83a3){if(!_0x4e83a3){_0x18de42['sendStatus'](0x194);}return _0x4e83a3;};}function handleError(_0x140be0,_0x57f408){_0x57f408=_0x57f408||0x1f4;return function(_0xa24f05){logger[_0x3e73('0x25')](_0xa24f05[_0x3e73('0x26')]);if(_0xa24f05[_0x3e73('0x27')]){delete _0xa24f05[_0x3e73('0x27')];}_0x140be0[_0x3e73('0x16')](_0x57f408)[_0x3e73('0x28')](_0xa24f05);};}exports[_0x3e73('0x29')]=function(_0x4e9914,_0x5dc4a6){var _0x1aea96={},_0x410049={},_0x331b47={'count':0x0,'rows':[]};return db[_0x3e73('0x2a')][_0x3e73('0x2b')]()[_0x3e73('0x24')](function(_0x15ca5f){_0x410049[_0x3e73('0x2c')]=_[_0x3e73('0x2d')](_0x15ca5f);_0x410049['query']=_['keys'](_0x4e9914[_0x3e73('0x2e')]);_0x410049[_0x3e73('0x2f')]=_['intersection'](_0x410049[_0x3e73('0x2c')],_0x410049[_0x3e73('0x2e')]);_0x1aea96[_0x3e73('0x30')]=_[_0x3e73('0x31')](_0x410049[_0x3e73('0x2c')],qs['fields'](_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x32')]));_0x1aea96[_0x3e73('0x30')]=_0x1aea96[_0x3e73('0x30')][_0x3e73('0x33')]?_0x1aea96['attributes']:_0x410049[_0x3e73('0x2c')];if(!_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x34')](_0x3e73('0x35'))){_0x1aea96['limit']=qs[_0x3e73('0x1a')](_0x4e9914['query'][_0x3e73('0x1a')]);_0x1aea96['offset']=qs['offset'](_0x4e9914['query'][_0x3e73('0x19')]);}_0x1aea96[_0x3e73('0x36')]=qs['sort'](_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x37')]);_0x1aea96[_0x3e73('0x38')]=qs[_0x3e73('0x2f')](_[_0x3e73('0x39')](_0x4e9914['query'],_0x410049[_0x3e73('0x2f')]),_0x15ca5f);if(_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x3a')]){_0x1aea96[_0x3e73('0x38')]=_[_0x3e73('0x3b')](_0x1aea96['where'],{'$or':_[_0x3e73('0x3c')](_0x1aea96['attributes'],function(_0x37cff8){var _0x5f2940={};_0x5f2940[_0x37cff8]={'$like':'%'+_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x3a')]+'%'};return _0x5f2940;})});}_0x1aea96=_['merge']({},_0x1aea96,_0x4e9914[_0x3e73('0x3d')]);var _0x31fd2c={'where':_0x1aea96[_0x3e73('0x38')]};return db['CmCompany'][_0x3e73('0x1c')](_0x31fd2c)[_0x3e73('0x24')](function(_0x59b52e){_0x331b47[_0x3e73('0x1c')]=_0x59b52e;if(_0x4e9914[_0x3e73('0x2e')][_0x3e73('0x3e')]){_0x1aea96['include']=[{'all':!![]}];}return db[_0x3e73('0x2a')][_0x3e73('0x3f')](_0x1aea96);})[_0x3e73('0x24')](function(_0x289677){_0x331b47['rows']=_0x289677;return _0x331b47;})[_0x3e73('0x24')](respondWithFilteredResult(_0x5dc4a6,_0x1aea96))[_0x3e73('0x40')](handleError(_0x5dc4a6,null));})[_0x3e73('0x40')](handleError(_0x5dc4a6,null));};exports[_0x3e73('0x41')]=function(_0x1d6527,_0x2e16a7){var _0x3651d1={'raw':![],'where':{'id':_0x1d6527[_0x3e73('0x42')]['id']}},_0xfd9871={};_0xfd9871[_0x3e73('0x2c')]=_[_0x3e73('0x2d')](db['CmCompany'][_0x3e73('0x43')]);_0xfd9871[_0x3e73('0x2e')]=_[_0x3e73('0x2d')](_0x1d6527['query']);_0xfd9871[_0x3e73('0x2f')]=_[_0x3e73('0x31')](_0xfd9871[_0x3e73('0x2c')],_0xfd9871[_0x3e73('0x2e')]);_0x3651d1['attributes']=_['intersection'](_0xfd9871[_0x3e73('0x2c')],qs[_0x3e73('0x32')](_0x1d6527[_0x3e73('0x2e')][_0x3e73('0x32')]));_0x3651d1[_0x3e73('0x30')]=_0x3651d1['attributes'][_0x3e73('0x33')]?_0x3651d1[_0x3e73('0x30')]:_0xfd9871[_0x3e73('0x2c')];if(_0x1d6527[_0x3e73('0x2e')][_0x3e73('0x3e')]){_0x3651d1['include']=[{'all':!![]}];}_0x3651d1=_[_0x3e73('0x3b')]({},_0x3651d1,_0x1d6527['options']);return db[_0x3e73('0x2a')][_0x3e73('0x44')](_0x3651d1)[_0x3e73('0x24')](handleEntityNotFound(_0x2e16a7,null))[_0x3e73('0x24')](respondWithResult(_0x2e16a7,null))[_0x3e73('0x40')](handleError(_0x2e16a7,null));};exports[_0x3e73('0x45')]=function(_0x1c7ace,_0x596aa6){return db['CmCompany'][_0x3e73('0x45')](_0x1c7ace[_0x3e73('0x46')],{})['then'](function(_0x4fd38e){var _0x4bb59f=_0x1c7ace['user'][_0x3e73('0x22')]({'plain':!![]});if(!_0x4bb59f)throw new Error(_0x3e73('0x47'));if(_0x4bb59f[_0x3e73('0x48')]===_0x3e73('0x49')){var _0x5e4d48=_0x4fd38e[_0x3e73('0x22')]({'plain':!![]});var _0x54437e=_0x3e73('0x4a');return db[_0x3e73('0x4b')][_0x3e73('0x44')]({'where':{'name':_0x54437e,'userProfileId':_0x4bb59f[_0x3e73('0x4c')]},'raw':!![]})[_0x3e73('0x24')](function(_0xf270a6){if(_0xf270a6&&_0xf270a6[_0x3e73('0x4d')]===0x0){return db[_0x3e73('0x23')]['create']({'name':_0x5e4d48[_0x3e73('0x27')],'resourceId':_0x5e4d48['id'],'type':_0xf270a6['name'],'sectionId':_0xf270a6['id']},{})['then'](function(){return _0x4fd38e;});}else{return _0x4fd38e;}})['catch'](function(_0x56502d){logger['error'](_0x3e73('0x4e'),_0x56502d);throw _0x56502d;});}return _0x4fd38e;})[_0x3e73('0x24')](respondWithResult(_0x596aa6,0xc9))[_0x3e73('0x40')](handleError(_0x596aa6,null));};exports[_0x3e73('0x20')]=function(_0x3d2849,_0x4e412b){if(_0x3d2849['body']['id']){delete _0x3d2849[_0x3e73('0x46')]['id'];}return db[_0x3e73('0x2a')][_0x3e73('0x44')]({'where':{'id':_0x3d2849[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x4e412b,null))[_0x3e73('0x24')](saveUpdates(_0x3d2849[_0x3e73('0x46')],null))[_0x3e73('0x24')](respondWithResult(_0x4e412b,null))[_0x3e73('0x40')](handleError(_0x4e412b,null));};exports['destroy']=function(_0x318262,_0x4e0cf9){return db['CmCompany']['find']({'where':{'id':_0x318262[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x4e0cf9,null))[_0x3e73('0x24')](removeEntity(_0x4e0cf9,null))['catch'](handleError(_0x4e0cf9,null));};exports[_0x3e73('0x2b')]=function(_0x4c4472,_0x278332){return db[_0x3e73('0x2a')][_0x3e73('0x2b')]()['then'](respondWithResult(_0x278332,null))['catch'](handleError(_0x278332,null));};exports['addContacts']=function(_0xc21e59,_0x76c39f,_0x3ae5c5){return db[_0x3e73('0x4f')]['find']({'where':{'id':_0xc21e59[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x76c39f,null))['then'](function(_0x20aa6f){if(_0x20aa6f){return _0x20aa6f[_0x3e73('0x50')](_0xc21e59['body'][_0x3e73('0x51')],_[_0x3e73('0x52')](_0xc21e59[_0x3e73('0x46')],[_0x3e73('0x51'),'id'])||{});}})[_0x3e73('0x24')](respondWithResult(_0x76c39f,null))[_0x3e73('0x40')](handleError(_0x76c39f,null));};exports[_0x3e73('0x53')]=function(_0x3ac4ff,_0x5cb54b,_0x33a7ca){var _0xb81a1e={};var _0x1cd794={};var _0x134514;var _0x835343;return db[_0x3e73('0x2a')][_0x3e73('0x54')]({'where':{'id':_0x3ac4ff[_0x3e73('0x42')]['id']}})[_0x3e73('0x24')](handleEntityNotFound(_0x5cb54b,null))[_0x3e73('0x24')](function(_0x3fedb9){if(_0x3fedb9){_0x134514=_0x3fedb9;_0x1cd794[_0x3e73('0x2c')]=_['keys'](db['CmContact'][_0x3e73('0x43')]);_0x1cd794[_0x3e73('0x2e')]=_['keys'](_0x3ac4ff[_0x3e73('0x2e')]);_0x1cd794[_0x3e73('0x2f')]=_['intersection'](_0x1cd794[_0x3e73('0x2c')],_0x1cd794['query']);_0xb81a1e[_0x3e73('0x30')]=_[_0x3e73('0x31')](_0x1cd794['model'],qs[_0x3e73('0x32')](_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x32')]));_0xb81a1e['attributes']=_0xb81a1e[_0x3e73('0x30')][_0x3e73('0x33')]?_0xb81a1e[_0x3e73('0x30')]:_0x1cd794[_0x3e73('0x2c')];_0xb81a1e['order']=qs['sort'](_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x37')]);_0xb81a1e['where']=qs[_0x3e73('0x2f')](_[_0x3e73('0x39')](_0x3ac4ff['query'],_0x1cd794[_0x3e73('0x2f')]));if(_0x3ac4ff[_0x3e73('0x2e')]['filter']){_0xb81a1e[_0x3e73('0x38')]=_['merge'](_0xb81a1e[_0x3e73('0x38')],{'$or':_[_0x3e73('0x3c')](_0xb81a1e[_0x3e73('0x30')],function(_0x1849db){var _0x11eb7f={};_0x11eb7f[_0x1849db]={'$like':'%'+_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x3a')]+'%'};return _0x11eb7f;})});}_0xb81a1e=_[_0x3e73('0x3b')]({},_0xb81a1e,_0x3ac4ff['options']);return _0x134514[_0x3e73('0x53')](_0xb81a1e);}})['then'](function(_0x1b0ba6){if(_0x1b0ba6){_0x835343=_0x1b0ba6['length'];if(!_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x34')](_0x3e73('0x35'))){_0xb81a1e['limit']=qs['limit'](_0x3ac4ff[_0x3e73('0x2e')]['limit']);_0xb81a1e['offset']=qs[_0x3e73('0x19')](_0x3ac4ff[_0x3e73('0x2e')][_0x3e73('0x19')]);}return _0x134514[_0x3e73('0x53')](_0xb81a1e);}})[_0x3e73('0x24')](function(_0x1235fd){if(_0x1235fd){return _0x1235fd?{'count':_0x835343,'rows':_0x1235fd}:null;}})[_0x3e73('0x24')](respondWithResult(_0x5cb54b,null))[_0x3e73('0x40')](handleError(_0x5cb54b,null));};
\ No newline at end of file
+var _0x0ac6=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','addContacts','ids','getContacts','eml-format','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','Companies','UserProfileResource','stack','name','send','CmCompany','describe','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','user','get'];(function(_0x270a62,_0x5610cc){var _0x573606=function(_0x567c2a){while(--_0x567c2a){_0x270a62['push'](_0x270a62['shift']());}};_0x573606(++_0x5610cc);}(_0x0ac6,0xff));var _0x60ac=function(_0x2280ea,_0x295bc7){_0x2280ea=_0x2280ea-0x0;var _0x4e5f8b=_0x0ac6[_0x2280ea];return _0x4e5f8b;};'use strict';var emlformat=require(_0x60ac('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x60ac('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x60ac('0x2'));var Mustache=require(_0x60ac('0x3'));var util=require(_0x60ac('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x60ac('0x5'));var ejs=require(_0x60ac('0x6'));var fs=require('fs');var fs_extra=require(_0x60ac('0x7'));var _=require(_0x60ac('0x8'));var squel=require(_0x60ac('0x9'));var crypto=require('crypto');var jsforce=require(_0x60ac('0xa'));var deskjs=require(_0x60ac('0xb'));var toCsv=require(_0x60ac('0x5'));var querystring=require(_0x60ac('0xc'));var Papa=require(_0x60ac('0xd'));var Redis=require(_0x60ac('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x60ac('0xf'));var as=require(_0x60ac('0x10'));var hardwareService=require(_0x60ac('0x11'));var logger=require(_0x60ac('0x12'))('api');var utils=require(_0x60ac('0x13'));var config=require(_0x60ac('0x14'));var licenseUtil=require(_0x60ac('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243b80,_0x589e73){_0x589e73=_0x589e73||0xcc;return function(_0x1492df){if(_0x1492df){return _0x243b80[_0x60ac('0x16')](_0x589e73);}return _0x243b80[_0x60ac('0x17')](_0x589e73)[_0x60ac('0x18')]();};}function respondWithResult(_0x571cf7,_0x344987){_0x344987=_0x344987||0xc8;return function(_0x5164bb){if(_0x5164bb){return _0x571cf7[_0x60ac('0x17')](_0x344987)[_0x60ac('0x19')](_0x5164bb);}};}function respondWithFilteredResult(_0x250925,_0x4389f7){return function(_0x23c918){if(_0x23c918){var _0x2e366e=typeof _0x4389f7[_0x60ac('0x1a')]===_0x60ac('0x1b')&&typeof _0x4389f7[_0x60ac('0x1c')]===_0x60ac('0x1b');var _0x3ed5cd=_0x23c918[_0x60ac('0x1d')];var _0x2495b9=_0x2e366e?0x0:_0x4389f7[_0x60ac('0x1a')];var _0x394b5b=_0x2e366e?_0x23c918[_0x60ac('0x1d')]:_0x4389f7[_0x60ac('0x1a')]+_0x4389f7[_0x60ac('0x1c')];var _0x574289;if(_0x394b5b>=_0x3ed5cd){_0x394b5b=_0x3ed5cd;_0x574289=0xc8;}else{_0x574289=0xce;}_0x250925[_0x60ac('0x17')](_0x574289);return _0x250925[_0x60ac('0x1e')]('Content-Range',_0x2495b9+'-'+_0x394b5b+'/'+_0x3ed5cd)['json'](_0x23c918);}return null;};}function patchUpdates(_0x1d2ca1){return function(_0x594d12){try{jsonpatch[_0x60ac('0x1f')](_0x594d12,_0x1d2ca1,!![]);}catch(_0x5be7d0){return BPromise[_0x60ac('0x20')](_0x5be7d0);}return _0x594d12[_0x60ac('0x21')]();};}function saveUpdates(_0x5e321b,_0x501fca){return function(_0x38a1ba){if(_0x38a1ba){return _0x38a1ba[_0x60ac('0x22')](_0x5e321b)['then'](function(_0x433d23){return _0x433d23;});}return null;};}function removeEntity(_0x4db2ff,_0x252523){return function(_0x2cba86){if(_0x2cba86){return _0x2cba86[_0x60ac('0x23')]()[_0x60ac('0x24')](function(){var _0x32e5b9=_0x2cba86['get']({'plain':!![]});var _0x234b0f=_0x60ac('0x25');return db[_0x60ac('0x26')][_0x60ac('0x23')]({'where':{'type':_0x234b0f,'resourceId':_0x32e5b9['id']}})[_0x60ac('0x24')](function(){return _0x2cba86;});})[_0x60ac('0x24')](function(){_0x4db2ff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x477c5b,_0x6ed4e5){return function(_0x247c07){if(!_0x247c07){_0x477c5b[_0x60ac('0x16')](0x194);}return _0x247c07;};}function handleError(_0x3a1f1e,_0x3a8b0d){_0x3a8b0d=_0x3a8b0d||0x1f4;return function(_0x1f7bc8){logger['error'](_0x1f7bc8[_0x60ac('0x27')]);if(_0x1f7bc8[_0x60ac('0x28')]){delete _0x1f7bc8[_0x60ac('0x28')];}_0x3a1f1e[_0x60ac('0x17')](_0x3a8b0d)[_0x60ac('0x29')](_0x1f7bc8);};}exports['index']=function(_0xa5e1e6,_0x114fcd){var _0x160e9e={},_0x436104={},_0x265a73={'count':0x0,'rows':[]};return db[_0x60ac('0x2a')][_0x60ac('0x2b')]()[_0x60ac('0x24')](function(_0x56eed4){_0x436104['model']=_[_0x60ac('0x2c')](_0x56eed4);_0x436104['query']=_[_0x60ac('0x2c')](_0xa5e1e6[_0x60ac('0x2d')]);_0x436104['filters']=_[_0x60ac('0x2e')](_0x436104[_0x60ac('0x2f')],_0x436104['query']);_0x160e9e[_0x60ac('0x30')]=_['intersection'](_0x436104[_0x60ac('0x2f')],qs['fields'](_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x31')]));_0x160e9e['attributes']=_0x160e9e['attributes'][_0x60ac('0x32')]?_0x160e9e[_0x60ac('0x30')]:_0x436104['model'];if(!_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x33')](_0x60ac('0x34'))){_0x160e9e[_0x60ac('0x1c')]=qs[_0x60ac('0x1c')](_0xa5e1e6['query'][_0x60ac('0x1c')]);_0x160e9e[_0x60ac('0x1a')]=qs[_0x60ac('0x1a')](_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x1a')]);}_0x160e9e['order']=qs[_0x60ac('0x35')](_0xa5e1e6[_0x60ac('0x2d')]['sort']);_0x160e9e[_0x60ac('0x36')]=qs['filters'](_[_0x60ac('0x37')](_0xa5e1e6[_0x60ac('0x2d')],_0x436104['filters']),_0x56eed4);if(_0xa5e1e6[_0x60ac('0x2d')]['filter']){_0x160e9e[_0x60ac('0x36')]=_[_0x60ac('0x38')](_0x160e9e['where'],{'$or':_[_0x60ac('0x39')](_0x160e9e['attributes'],function(_0x5abab4){var _0x448bed={};_0x448bed[_0x5abab4]={'$like':'%'+_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x3a')]+'%'};return _0x448bed;})});}_0x160e9e=_[_0x60ac('0x38')]({},_0x160e9e,_0xa5e1e6[_0x60ac('0x3b')]);var _0x2783d2={'where':_0x160e9e[_0x60ac('0x36')]};return db[_0x60ac('0x2a')][_0x60ac('0x1d')](_0x2783d2)[_0x60ac('0x24')](function(_0x2efebf){_0x265a73[_0x60ac('0x1d')]=_0x2efebf;if(_0xa5e1e6[_0x60ac('0x2d')][_0x60ac('0x3c')]){_0x160e9e[_0x60ac('0x3d')]=[{'all':!![]}];}return db[_0x60ac('0x2a')][_0x60ac('0x3e')](_0x160e9e);})['then'](function(_0x46eee2){_0x265a73[_0x60ac('0x3f')]=_0x46eee2;return _0x265a73;})[_0x60ac('0x24')](respondWithFilteredResult(_0x114fcd,_0x160e9e))[_0x60ac('0x40')](handleError(_0x114fcd,null));})['catch'](handleError(_0x114fcd,null));};exports[_0x60ac('0x41')]=function(_0x361420,_0x9c4f80){var _0x9a40bc={'raw':![],'where':{'id':_0x361420[_0x60ac('0x42')]['id']}},_0x3f8a20={};_0x3f8a20[_0x60ac('0x2f')]=_['keys'](db[_0x60ac('0x2a')][_0x60ac('0x43')]);_0x3f8a20[_0x60ac('0x2d')]=_[_0x60ac('0x2c')](_0x361420['query']);_0x3f8a20[_0x60ac('0x44')]=_['intersection'](_0x3f8a20['model'],_0x3f8a20[_0x60ac('0x2d')]);_0x9a40bc[_0x60ac('0x30')]=_[_0x60ac('0x2e')](_0x3f8a20[_0x60ac('0x2f')],qs[_0x60ac('0x31')](_0x361420[_0x60ac('0x2d')][_0x60ac('0x31')]));_0x9a40bc['attributes']=_0x9a40bc['attributes'][_0x60ac('0x32')]?_0x9a40bc[_0x60ac('0x30')]:_0x3f8a20[_0x60ac('0x2f')];if(_0x361420[_0x60ac('0x2d')][_0x60ac('0x3c')]){_0x9a40bc['include']=[{'all':!![]}];}_0x9a40bc=_[_0x60ac('0x38')]({},_0x9a40bc,_0x361420[_0x60ac('0x3b')]);return db[_0x60ac('0x2a')][_0x60ac('0x45')](_0x9a40bc)[_0x60ac('0x24')](handleEntityNotFound(_0x9c4f80,null))['then'](respondWithResult(_0x9c4f80,null))[_0x60ac('0x40')](handleError(_0x9c4f80,null));};exports[_0x60ac('0x46')]=function(_0x44077a,_0x2eb0a0){return db['CmCompany'][_0x60ac('0x46')](_0x44077a['body'],{})[_0x60ac('0x24')](function(_0x25a06b){var _0x141b5b=_0x44077a[_0x60ac('0x47')][_0x60ac('0x48')]({'plain':!![]});if(!_0x141b5b)throw new Error(_0x60ac('0x49'));if(_0x141b5b[_0x60ac('0x4a')]==='user'){var _0x113a94=_0x25a06b[_0x60ac('0x48')]({'plain':!![]});var _0xab07e=_0x60ac('0x25');return db[_0x60ac('0x4b')][_0x60ac('0x45')]({'where':{'name':_0xab07e,'userProfileId':_0x141b5b[_0x60ac('0x4c')]},'raw':!![]})['then'](function(_0x710a38){if(_0x710a38&&_0x710a38['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x113a94[_0x60ac('0x28')],'resourceId':_0x113a94['id'],'type':_0x710a38[_0x60ac('0x28')],'sectionId':_0x710a38['id']},{})[_0x60ac('0x24')](function(){return _0x25a06b;});}else{return _0x25a06b;}})[_0x60ac('0x40')](function(_0x5eb128){logger[_0x60ac('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5eb128);throw _0x5eb128;});}return _0x25a06b;})[_0x60ac('0x24')](respondWithResult(_0x2eb0a0,0xc9))[_0x60ac('0x40')](handleError(_0x2eb0a0,null));};exports[_0x60ac('0x22')]=function(_0x1fa407,_0x4bb6a3){if(_0x1fa407[_0x60ac('0x4e')]['id']){delete _0x1fa407[_0x60ac('0x4e')]['id'];}return db[_0x60ac('0x2a')][_0x60ac('0x45')]({'where':{'id':_0x1fa407['params']['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x4bb6a3,null))[_0x60ac('0x24')](saveUpdates(_0x1fa407[_0x60ac('0x4e')],null))[_0x60ac('0x24')](respondWithResult(_0x4bb6a3,null))[_0x60ac('0x40')](handleError(_0x4bb6a3,null));};exports['destroy']=function(_0x57a50d,_0x225310){return db[_0x60ac('0x2a')]['find']({'where':{'id':_0x57a50d[_0x60ac('0x42')]['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x225310,null))['then'](removeEntity(_0x225310,null))[_0x60ac('0x40')](handleError(_0x225310,null));};exports[_0x60ac('0x2b')]=function(_0x163e67,_0x12c4c2){return db['CmCompany']['describe']()[_0x60ac('0x24')](respondWithResult(_0x12c4c2,null))[_0x60ac('0x40')](handleError(_0x12c4c2,null));};exports[_0x60ac('0x4f')]=function(_0x5a0c53,_0x1a629b,_0x2d0da0){return db['CmContact']['find']({'where':{'id':_0x5a0c53['params']['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x1a629b,null))[_0x60ac('0x24')](function(_0x54e7a9){if(_0x54e7a9){return _0x54e7a9['addContacts'](_0x5a0c53[_0x60ac('0x4e')][_0x60ac('0x50')],_['omit'](_0x5a0c53[_0x60ac('0x4e')],[_0x60ac('0x50'),'id'])||{});}})[_0x60ac('0x24')](respondWithResult(_0x1a629b,null))[_0x60ac('0x40')](handleError(_0x1a629b,null));};exports[_0x60ac('0x51')]=function(_0x5308f1,_0x502fff,_0x29e7f9){var _0x5b47e0={};var _0x568fec={};var _0x15062c;var _0x1e38ba;return db[_0x60ac('0x2a')]['findOne']({'where':{'id':_0x5308f1[_0x60ac('0x42')]['id']}})[_0x60ac('0x24')](handleEntityNotFound(_0x502fff,null))[_0x60ac('0x24')](function(_0x4066c5){if(_0x4066c5){_0x15062c=_0x4066c5;_0x568fec[_0x60ac('0x2f')]=_[_0x60ac('0x2c')](db['CmContact'][_0x60ac('0x43')]);_0x568fec['query']=_[_0x60ac('0x2c')](_0x5308f1['query']);_0x568fec[_0x60ac('0x44')]=_[_0x60ac('0x2e')](_0x568fec[_0x60ac('0x2f')],_0x568fec['query']);_0x5b47e0[_0x60ac('0x30')]=_['intersection'](_0x568fec['model'],qs[_0x60ac('0x31')](_0x5308f1['query'][_0x60ac('0x31')]));_0x5b47e0[_0x60ac('0x30')]=_0x5b47e0['attributes']['length']?_0x5b47e0[_0x60ac('0x30')]:_0x568fec[_0x60ac('0x2f')];_0x5b47e0['order']=qs['sort'](_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x35')]);_0x5b47e0['where']=qs['filters'](_[_0x60ac('0x37')](_0x5308f1['query'],_0x568fec[_0x60ac('0x44')]));if(_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x3a')]){_0x5b47e0['where']=_[_0x60ac('0x38')](_0x5b47e0[_0x60ac('0x36')],{'$or':_[_0x60ac('0x39')](_0x5b47e0[_0x60ac('0x30')],function(_0xbeddbc){var _0x44dd00={};_0x44dd00[_0xbeddbc]={'$like':'%'+_0x5308f1[_0x60ac('0x2d')]['filter']+'%'};return _0x44dd00;})});}_0x5b47e0=_[_0x60ac('0x38')]({},_0x5b47e0,_0x5308f1[_0x60ac('0x3b')]);return _0x15062c[_0x60ac('0x51')](_0x5b47e0);}})[_0x60ac('0x24')](function(_0x37fddf){if(_0x37fddf){_0x1e38ba=_0x37fddf[_0x60ac('0x32')];if(!_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x33')](_0x60ac('0x34'))){_0x5b47e0[_0x60ac('0x1c')]=qs[_0x60ac('0x1c')](_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x1c')]);_0x5b47e0[_0x60ac('0x1a')]=qs[_0x60ac('0x1a')](_0x5308f1[_0x60ac('0x2d')][_0x60ac('0x1a')]);}return _0x15062c[_0x60ac('0x51')](_0x5b47e0);}})[_0x60ac('0x24')](function(_0x4a228c){if(_0x4a228c){return _0x4a228c?{'count':_0x1e38ba,'rows':_0x4a228c}:null;}})['then'](respondWithResult(_0x502fff,null))['catch'](handleError(_0x502fff,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 290f032..cc79ee5 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4c83=['exports','define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x12781,_0x5e49b5){var _0x5a88db=function(_0x35f86e){while(--_0x35f86e){_0x12781['push'](_0x12781['shift']());}};_0x5a88db(++_0x5e49b5);}(_0x4c83,0x1d1));var _0x34c8=function(_0x11b377,_0x2f7ccd){_0x11b377=_0x11b377-0x0;var _0x3f5e73=_0x4c83[_0x11b377];return _0x3f5e73;};'use strict';var _=require(_0x34c8('0x0'));var util=require(_0x34c8('0x1'));var logger=require(_0x34c8('0x2'))(_0x34c8('0x3'));var moment=require(_0x34c8('0x4'));var BPromise=require(_0x34c8('0x5'));var rp=require(_0x34c8('0x6'));var fs=require('fs');var path=require(_0x34c8('0x7'));var rimraf=require(_0x34c8('0x8'));var config=require(_0x34c8('0x9'));var attributes=require(_0x34c8('0xa'));module[_0x34c8('0xb')]=function(_0x5eaf6b,_0x221fc1){return _0x5eaf6b[_0x34c8('0xc')]('CmCompany',attributes,{'tableName':_0x34c8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b53=['lodash','util','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8b53,0x64));var _0x38b5=function(_0xc82cdd,_0x4a3b9e){_0xc82cdd=_0xc82cdd-0x0;var _0x2d851b=_0x8b53[_0xc82cdd];return _0x2d851b;};'use strict';var _=require(_0x38b5('0x0'));var util=require(_0x38b5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x38b5('0x2'));var fs=require('fs');var path=require(_0x38b5('0x3'));var rimraf=require(_0x38b5('0x4'));var config=require(_0x38b5('0x5'));var attributes=require(_0x38b5('0x6'));module[_0x38b5('0x7')]=function(_0x31f9e2,_0x267310){return _0x31f9e2[_0x38b5('0x8')]('CmCompany',attributes,{'tableName':_0x38b5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 98574da..fe4e1b3 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd03a=['code','message','request\x20sent','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xd03a,0x17e));var _0xad03=function(_0x14977e,_0x18fb88){_0x14977e=_0x14977e-0x0;var _0x1892b8=_0xd03a[_0x14977e];return _0x1892b8;};'use strict';var _=require(_0xad03('0x0'));var util=require('util');var moment=require(_0xad03('0x1'));var BPromise=require(_0xad03('0x2'));var rs=require(_0xad03('0x3'));var fs=require('fs');var Redis=require(_0xad03('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xad03('0x5'))('rpc');var config=require(_0xad03('0x6'));var jayson=require(_0xad03('0x7'));var client=jayson['client'][_0xad03('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50d301,_0x589c21,_0x24d557){return new BPromise(function(_0x4b5aa4,_0x47583b){return client[_0xad03('0x9')](_0x50d301,_0x24d557)[_0xad03('0xa')](function(_0x2452f5){logger[_0xad03('0xb')](_0xad03('0xc'),_0x589c21,'request\x20sent');logger[_0xad03('0xd')](_0xad03('0xe'),_0x589c21,'request\x20sent',JSON[_0xad03('0xf')](_0x2452f5));if(_0x2452f5[_0xad03('0x10')]){if(_0x2452f5[_0xad03('0x10')][_0xad03('0x11')]===0x1f4){logger[_0xad03('0x10')]('CmCompany,\x20%s,\x20%s',_0x589c21,_0x2452f5[_0xad03('0x10')][_0xad03('0x12')]);return _0x47583b(_0x2452f5['error'][_0xad03('0x12')]);}logger['error'](_0xad03('0xc'),_0x589c21,_0x2452f5['error'][_0xad03('0x12')]);return _0x4b5aa4(_0x2452f5['error']['message']);}else{logger[_0xad03('0xb')](_0xad03('0xc'),_0x589c21,_0xad03('0x13'));_0x4b5aa4(_0x2452f5[_0xad03('0x14')][_0xad03('0x12')]);}})['catch'](function(_0x43f79b){logger[_0xad03('0x10')](_0xad03('0xc'),_0x589c21,_0x43f79b);_0x47583b(_0x43f79b);});});}
\ No newline at end of file
+var _0x2c9f=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x10b6d9,_0xc31308){var _0x484bd7=function(_0x24eaf4){while(--_0x24eaf4){_0x10b6d9['push'](_0x10b6d9['shift']());}};_0x484bd7(++_0xc31308);}(_0x2c9f,0x95));var _0xf2c9=function(_0x28dc39,_0x31eef9){_0x28dc39=_0x28dc39-0x0;var _0x5d5d44=_0x2c9f[_0x28dc39];return _0x5d5d44;};'use strict';var _=require(_0xf2c9('0x0'));var util=require('util');var moment=require(_0xf2c9('0x1'));var BPromise=require(_0xf2c9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf2c9('0x3'));var db=require(_0xf2c9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf2c9('0x5'));var config=require('../../config/environment');var jayson=require(_0xf2c9('0x6'));var client=jayson[_0xf2c9('0x7')][_0xf2c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2440bd,_0x3e9d8f,_0x17f8f4){return new BPromise(function(_0x388b6d,_0x55555b){return client[_0xf2c9('0x9')](_0x2440bd,_0x17f8f4)[_0xf2c9('0xa')](function(_0x226e9c){logger[_0xf2c9('0xb')]('CmCompany,\x20%s,\x20%s',_0x3e9d8f,'request\x20sent');logger['debug'](_0xf2c9('0xc'),_0x3e9d8f,'request\x20sent',JSON[_0xf2c9('0xd')](_0x226e9c));if(_0x226e9c[_0xf2c9('0xe')]){if(_0x226e9c['error'][_0xf2c9('0xf')]===0x1f4){logger[_0xf2c9('0xe')]('CmCompany,\x20%s,\x20%s',_0x3e9d8f,_0x226e9c['error'][_0xf2c9('0x10')]);return _0x55555b(_0x226e9c[_0xf2c9('0xe')][_0xf2c9('0x10')]);}logger['error'](_0xf2c9('0x11'),_0x3e9d8f,_0x226e9c['error'][_0xf2c9('0x10')]);return _0x388b6d(_0x226e9c[_0xf2c9('0xe')][_0xf2c9('0x10')]);}else{logger[_0xf2c9('0xb')](_0xf2c9('0x11'),_0x3e9d8f,_0xf2c9('0x12'));_0x388b6d(_0x226e9c[_0xf2c9('0x13')][_0xf2c9('0x10')]);}})[_0xf2c9('0x14')](function(_0x5a91f3){logger[_0xf2c9('0xe')](_0xf2c9('0x11'),_0x3e9d8f,_0x5a91f3);_0x55555b(_0x5a91f3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 222f2d5..8392250 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2a38=['post','create','addContacts','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','get','show','/:id/contacts'];(function(_0x2b85c8,_0x560c38){var _0x50f2a3=function(_0x34d881){while(--_0x34d881){_0x2b85c8['push'](_0x2b85c8['shift']());}};_0x50f2a3(++_0x560c38);}(_0x2a38,0x1e8));var _0x82a3=function(_0x4226d6,_0x3864ca){_0x4226d6=_0x4226d6-0x0;var _0x19655b=_0x2a38[_0x4226d6];return _0x19655b;};'use strict';var multer=require('multer');var util=require(_0x82a3('0x0'));var path=require(_0x82a3('0x1'));var timeout=require(_0x82a3('0x2'));var express=require(_0x82a3('0x3'));var router=express[_0x82a3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x82a3('0x5'));var config=require(_0x82a3('0x6'));var controller=require(_0x82a3('0x7'));router['get']('/',auth[_0x82a3('0x8')](),controller['index']);router['get']('/describe',auth[_0x82a3('0x8')](),controller['describe']);router[_0x82a3('0x9')]('/:id',auth[_0x82a3('0x8')](),controller[_0x82a3('0xa')]);router[_0x82a3('0x9')](_0x82a3('0xb'),auth[_0x82a3('0x8')](),controller['getContacts']);router[_0x82a3('0xc')]('/',auth[_0x82a3('0x8')](),controller[_0x82a3('0xd')]);router[_0x82a3('0xc')](_0x82a3('0xb'),auth[_0x82a3('0x8')](),controller[_0x82a3('0xe')]);router[_0x82a3('0xf')](_0x82a3('0x10'),auth[_0x82a3('0x8')](),controller[_0x82a3('0x11')]);router[_0x82a3('0x12')](_0x82a3('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x82a3('0x13')]=router;
\ No newline at end of file
+var _0xde06=['index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated'];(function(_0xb30689,_0x59a222){var _0x2bed52=function(_0x3a8e4a){while(--_0x3a8e4a){_0xb30689['push'](_0xb30689['shift']());}};_0x2bed52(++_0x59a222);}(_0xde06,0x113));var _0x6de0=function(_0x5a1397,_0x1f80ae){_0x5a1397=_0x5a1397-0x0;var _0x56224d=_0xde06[_0x5a1397];return _0x56224d;};'use strict';var multer=require(_0x6de0('0x0'));var util=require(_0x6de0('0x1'));var path=require(_0x6de0('0x2'));var timeout=require(_0x6de0('0x3'));var express=require('express');var router=express[_0x6de0('0x4')]();var fs_extra=require(_0x6de0('0x5'));var auth=require(_0x6de0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6de0('0x7'));var controller=require(_0x6de0('0x8'));router[_0x6de0('0x9')]('/',auth[_0x6de0('0xa')](),controller[_0x6de0('0xb')]);router[_0x6de0('0x9')](_0x6de0('0xc'),auth[_0x6de0('0xa')](),controller[_0x6de0('0xd')]);router[_0x6de0('0x9')](_0x6de0('0xe'),auth[_0x6de0('0xa')](),controller[_0x6de0('0xf')]);router[_0x6de0('0x9')](_0x6de0('0x10'),auth[_0x6de0('0xa')](),controller[_0x6de0('0x11')]);router[_0x6de0('0x12')]('/',auth[_0x6de0('0xa')](),controller[_0x6de0('0x13')]);router[_0x6de0('0x12')]('/:id/contacts',auth[_0x6de0('0xa')](),controller[_0x6de0('0x14')]);router[_0x6de0('0x15')](_0x6de0('0xe'),auth['isAuthenticated'](),controller[_0x6de0('0x16')]);router[_0x6de0('0x17')](_0x6de0('0xe'),auth[_0x6de0('0xa')](),controller[_0x6de0('0x18')]);module[_0x6de0('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3eef3da..12fe9b5 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x038e=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x038e,0x151));var _0xe038=function(_0x105e63,_0x2c41c2){_0x105e63=_0x105e63-0x0;var _0x4dc9f1=_0x038e[_0x105e63];return _0x4dc9f1;};'use strict';var _=require(_0xe038('0x0'));var Sequelize=require(_0xe038('0x1'));module[_0xe038('0x2')]={'firstName':{'type':Sequelize[_0xe038('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe038('0x3')]},'postalCode':{'type':Sequelize[_0xe038('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xe038('0x3')]},'description':{'type':Sequelize[_0xe038('0x4')]},'phone':{'type':Sequelize[_0xe038('0x3')]},'mobile':{'type':Sequelize[_0xe038('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xe038('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe038('0x3')]},'twitter':{'type':Sequelize[_0xe038('0x3')]},'skype':{'type':Sequelize[_0xe038('0x3')]},'teams':{'type':Sequelize[_0xe038('0x3')]},'viber':{'type':Sequelize[_0xe038('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xe038('0x3')]},'telegram':{'type':Sequelize[_0xe038('0x3')]},'UserId':{'type':Sequelize[_0xe038('0x5')]},'AdditionalPhones':{'type':Sequelize[_0xe038('0x3')]},'priority':{'type':Sequelize[_0xe038('0x5')](0x2)[_0xe038('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe038('0x7')],'defaultValue':Sequelize[_0xe038('0x8')]},'dialTimezone':{'type':Sequelize[_0xe038('0x3')]},'utcOffset':{'type':Sequelize[_0xe038('0x5')]}};
\ No newline at end of file
+var _0x0ae3=['DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x5b2253,_0x48091f){var _0x277250=function(_0xdf3ff9){while(--_0xdf3ff9){_0x5b2253['push'](_0x5b2253['shift']());}};_0x277250(++_0x48091f);}(_0x0ae3,0x158));var _0x30ae=function(_0x4f354c,_0x39069d){_0x4f354c=_0x4f354c-0x0;var _0x3707e2=_0x0ae3[_0x4f354c];return _0x3707e2;};'use strict';var _=require(_0x30ae('0x0'));var Sequelize=require(_0x30ae('0x1'));module[_0x30ae('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x30ae('0x3')]},'city':{'type':Sequelize[_0x30ae('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x30ae('0x3')]},'description':{'type':Sequelize[_0x30ae('0x4')]},'phone':{'type':Sequelize[_0x30ae('0x3')]},'mobile':{'type':Sequelize[_0x30ae('0x3')]},'fax':{'type':Sequelize[_0x30ae('0x3')]},'email':{'type':Sequelize[_0x30ae('0x3')]},'url':{'type':Sequelize[_0x30ae('0x3')]},'facebook':{'type':Sequelize[_0x30ae('0x3')]},'fb_data':{'type':Sequelize[_0x30ae('0x3')]},'twitter':{'type':Sequelize[_0x30ae('0x3')]},'skype':{'type':Sequelize[_0x30ae('0x3')]},'teams':{'type':Sequelize[_0x30ae('0x3')]},'viber':{'type':Sequelize[_0x30ae('0x3')]},'line':{'type':Sequelize[_0x30ae('0x3')]},'wechat':{'type':Sequelize[_0x30ae('0x3')]},'telegram':{'type':Sequelize[_0x30ae('0x3')]},'UserId':{'type':Sequelize[_0x30ae('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x30ae('0x3')]},'priority':{'type':Sequelize[_0x30ae('0x5')](0x2)[_0x30ae('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x30ae('0x7')],'defaultValue':Sequelize[_0x30ae('0x8')]},'dialTimezone':{'type':Sequelize[_0x30ae('0x3')]},'utcOffset':{'type':Sequelize[_0x30ae('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 8b70403..e59053f 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','Attachments','Data','generateXOAuth2Token','user=','toString','lodash','randomstring','util','node-tnef','../../../config/logger','email','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','split','slice','Anonymous','length','isEmpty','html','test','includes'];(function(_0x568691,_0x149a6d){var _0x3b5a1f=function(_0x4096d4){while(--_0x4096d4){_0x568691['push'](_0x568691['shift']());}};_0x3b5a1f(++_0x149a6d);}(_0x52e0,0x10d));var _0x052e=function(_0x288371,_0x1958f1){_0x288371=_0x288371-0x0;var _0x70f8f3=_0x52e0[_0x288371];return _0x70f8f3;};'use strict';var _=require(_0x052e('0x0'));var moment=require('moment');var random=require(_0x052e('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x052e('0x2'));var tnef=require(_0x052e('0x3'));var logger=require(_0x052e('0x4'))(_0x052e('0x5'));var config=require('../../../config/environment');function getAddress(_0xd4e00a){var _0x2863c2=_['head'](_0xd4e00a[_0x052e('0x6')]);return _0x2863c2&&_0x2863c2[_0x052e('0x7')]?_0x2863c2['address']:_0x052e('0x8')+random[_0x052e('0x9')](0x6)+_0x052e('0xa');}function getFirstName(_0x4b113c){var _0x3c98fa=_[_0x052e('0xb')](_0x4b113c[_0x052e('0x6')]);if(_0x3c98fa&&_0x3c98fa[_0x052e('0xc')]){if(_0x3c98fa[_0x052e('0xc')]==_0x3c98fa[_0x052e('0x7')]){return _0x3c98fa[_0x052e('0xc')][_0x052e('0xd')](0x0,_0x3c98fa['name'][_0x052e('0xe')]('@'));}var _0x470603=_0x3c98fa[_0x052e('0xc')][_0x052e('0xf')](/\s+/);return _0x470603['length']>0x1?_0x470603[_0x052e('0x10')](0x0,-0x1)['join']('\x20'):_0x3c98fa[_0x052e('0xc')];}return _0x052e('0x11');}function getLastName(_0x84692e){var _0x28a8bf=_[_0x052e('0xb')](_0x84692e['value']);if(_0x28a8bf&&_0x28a8bf[_0x052e('0xc')]){var _0x3d484f=_0x28a8bf[_0x052e('0xc')]['split'](/\s+/);return _0x3d484f['length']>0x1?_0x3d484f['pop']():'';}return'';}function getMails(_0x442a6a,_0x53364b){var _0x17f864='';for(var _0x172f92=0x0;_0x172f92<_0x53364b['value'][_0x052e('0x12')];_0x172f92+=0x1){if(_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]!==_0x442a6a){if(!_[_0x052e('0x13')](_0x17f864)){_0x17f864+=',';}_0x17f864+=_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0xc')]||_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]||'';_0x17f864+='\x20<';_0x17f864+=_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]?_0x53364b[_0x052e('0x6')][_0x172f92][_0x052e('0x7')]:_0x052e('0x8')+random['generate'](0x6)+_0x052e('0xa');_0x17f864+='>';}}return _0x17f864;}function parseEmail(_0x1e14c5,_0x54439d,_0x26c05f){if(_0x54439d[_0x052e('0x14')]){var _0x5dfb87=/