From 19344ef5a7e7c534e5499bc1697eb587f137daa3 Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Sun, 31 Oct 2021 22:36:36 +0100
Subject: [PATCH] Built motion from commit 9fbeeb6e.|2.5.37
---
apidoc/api_project.js | 2 +-
apidoc/api_project.json | 2 +-
public/app/main/apps/staff/i18n/en.json | 2 +-
server/api/action/action.attributes.js | 2 +-
server/api/action/action.controller.js | 2 +-
server/api/action/action.model.js | 2 +-
server/api/action/action.rpc.js | 2 +-
server/api/action/index.js | 2 +-
.../analyticCustomReport.attributes.js | 2 +-
.../analyticCustomReport.controller.js | 2 +-
.../analyticCustomReport.model.js | 2 +-
.../analyticCustomReport.rpc.js | 2 +-
server/api/analyticCustomReport/index.js | 2 +-
.../analyticDefaultReport.attributes.js | 2 +-
.../analyticDefaultReport.controller.js | 2 +-
.../analyticDefaultReport.model.js | 2 +-
.../analyticDefaultReport.rpc.js | 2 +-
server/api/analyticDefaultReport/index.js | 2 +-
.../analyticExtractedReport.attributes.js | 2 +-
.../analyticExtractedReport.controller.js | 2 +-
.../analyticExtractedReport.model.js | 2 +-
.../analyticExtractedReport.rpc.js | 2 +-
server/api/analyticExtractedReport/index.js | 2 +-
.../analyticFieldReport.attributes.js | 2 +-
.../analyticFieldReport.controller.js | 2 +-
.../analyticFieldReport.model.js | 2 +-
.../analyticFieldReport/analyticFieldReport.rpc.js | 2 +-
server/api/analyticFieldReport/index.js | 2 +-
.../analyticMetric/analyticMetric.attributes.js | 2 +-
.../analyticMetric/analyticMetric.controller.js | 2 +-
server/api/analyticMetric/analyticMetric.model.js | 2 +-
server/api/analyticMetric/analyticMetric.rpc.js | 2 +-
server/api/analyticMetric/index.js | 2 +-
.../analyticTreeReport.attributes.js | 2 +-
.../analyticTreeReport.controller.js | 2 +-
.../analyticTreeReport/analyticTreeReport.model.js | 2 +-
.../analyticTreeReport/analyticTreeReport.rpc.js | 2 +-
server/api/analyticTreeReport/index.js | 2 +-
server/api/attachment/attachment.attributes.js | 2 +-
server/api/attachment/attachment.controller.js | 2 +-
server/api/attachment/attachment.model.js | 2 +-
server/api/attachment/attachment.rpc.js | 2 +-
server/api/attachment/index.js | 2 +-
.../authActiveDirectory.controller.js | 2 +-
server/api/authActiveDirectory/index.js | 2 +-
server/api/authGoogle/authGoogle.controller.js | 2 +-
server/api/authGoogle/index.js | 2 +-
server/api/authLocal/authLocal.controller.js | 2 +-
server/api/authLocal/index.js | 2 +-
server/api/automation/automation.attributes.js | 2 +-
server/api/automation/automation.controller.js | 2 +-
server/api/automation/automation.model.js | 2 +-
server/api/automation/automation.rpc.js | 2 +-
server/api/automation/index.js | 2 +-
server/api/campaign/campaign.attributes.js | 2 +-
server/api/campaign/campaign.controller.js | 2 +-
server/api/campaign/campaign.model.js | 2 +-
server/api/campaign/campaign.rpc.js | 2 +-
server/api/campaign/index.js | 2 +-
server/api/cannedAnswer/cannedAnswer.attributes.js | 2 +-
server/api/cannedAnswer/cannedAnswer.controller.js | 2 +-
server/api/cannedAnswer/cannedAnswer.model.js | 2 +-
server/api/cannedAnswer/cannedAnswer.rpc.js | 2 +-
server/api/cannedAnswer/index.js | 2 +-
server/api/cdr/cdr.attributes.js | 2 +-
server/api/cdr/cdr.controller.js | 2 +-
server/api/cdr/cdr.model.js | 2 +-
server/api/cdr/cdr.rpc.js | 2 +-
server/api/cdr/index.js | 2 +-
.../chatApplication/chatApplication.attributes.js | 2 +-
.../chatApplication/chatApplication.controller.js | 2 +-
.../api/chatApplication/chatApplication.model.js | 2 +-
server/api/chatApplication/chatApplication.rpc.js | 2 +-
server/api/chatApplication/index.js | 2 +-
server/api/chatGroup/chatGroup.attributes.js | 2 +-
server/api/chatGroup/chatGroup.controller.js | 2 +-
server/api/chatGroup/chatGroup.events.js | 2 +-
server/api/chatGroup/chatGroup.model.js | 2 +-
server/api/chatGroup/chatGroup.rpc.js | 2 +-
server/api/chatGroup/chatGroup.socket.js | 2 +-
server/api/chatGroup/index.js | 2 +-
.../chatInteraction/chatInteraction.attributes.js | 2 +-
.../chatInteraction/chatInteraction.controller.js | 2 +-
.../api/chatInteraction/chatInteraction.events.js | 2 +-
.../api/chatInteraction/chatInteraction.model.js | 2 +-
server/api/chatInteraction/chatInteraction.rpc.js | 2 +-
.../api/chatInteraction/chatInteraction.socket.js | 2 +-
server/api/chatInteraction/index.js | 2 +-
.../chatInternalMessage.attributes.js | 2 +-
.../chatInternalMessage.controller.js | 2 +-
.../chatInternalMessage.events.js | 2 +-
.../chatInternalMessage.model.js | 2 +-
.../chatInternalMessage/chatInternalMessage.rpc.js | 2 +-
.../chatInternalMessage.socket.js | 2 +-
server/api/chatInternalMessage/index.js | 2 +-
server/api/chatMessage/chatMessage.attributes.js | 2 +-
server/api/chatMessage/chatMessage.controller.js | 2 +-
server/api/chatMessage/chatMessage.events.js | 2 +-
server/api/chatMessage/chatMessage.model.js | 2 +-
server/api/chatMessage/chatMessage.rpc.js | 2 +-
server/api/chatMessage/chatMessage.socket.js | 2 +-
server/api/chatMessage/index.js | 2 +-
.../chatOfflineMessage.attributes.js | 2 +-
.../chatOfflineMessage.controller.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.model.js | 2 +-
.../chatOfflineMessage/chatOfflineMessage.rpc.js | 2 +-
server/api/chatOfflineMessage/index.js | 2 +-
.../chatProactiveAction.attributes.js | 2 +-
.../chatProactiveAction.controller.js | 2 +-
.../chatProactiveAction.model.js | 2 +-
.../chatProactiveAction/chatProactiveAction.rpc.js | 2 +-
server/api/chatProactiveAction/index.js | 2 +-
server/api/chatQueue/chatQueue.attributes.js | 2 +-
server/api/chatQueue/chatQueue.controller.js | 2 +-
server/api/chatQueue/chatQueue.events.js | 2 +-
server/api/chatQueue/chatQueue.model.js | 2 +-
server/api/chatQueue/chatQueue.rpc.js | 2 +-
server/api/chatQueue/chatQueue.socket.js | 2 +-
server/api/chatQueue/index.js | 2 +-
.../chatQueueReport/chatQueueReport.attributes.js | 2 +-
.../chatQueueReport/chatQueueReport.controller.js | 2 +-
.../api/chatQueueReport/chatQueueReport.model.js | 2 +-
server/api/chatQueueReport/chatQueueReport.rpc.js | 2 +-
server/api/chatQueueReport/index.js | 2 +-
.../chatTransferReport.attributes.js | 2 +-
.../chatTransferReport.controller.js | 2 +-
.../chatTransferReport/chatTransferReport.model.js | 2 +-
.../chatTransferReport/chatTransferReport.rpc.js | 2 +-
server/api/chatTransferReport/index.js | 2 +-
server/api/chatWebsite/chatWebsite.attributes.js | 2 +-
server/api/chatWebsite/chatWebsite.controller.js | 2 +-
server/api/chatWebsite/chatWebsite.events.js | 2 +-
server/api/chatWebsite/chatWebsite.model.js | 2 +-
server/api/chatWebsite/chatWebsite.rpc.js | 2 +-
server/api/chatWebsite/chatWebsite.socket.js | 2 +-
server/api/chatWebsite/index.js | 2 +-
.../api/cloudProvider/cloudProvider.attributes.js | 2 +-
.../api/cloudProvider/cloudProvider.controller.js | 2 +-
server/api/cloudProvider/cloudProvider.model.js | 2 +-
server/api/cloudProvider/cloudProvider.rpc.js | 2 +-
server/api/cloudProvider/index.js | 2 +-
server/api/cmCompany/cmCompany.attributes.js | 2 +-
server/api/cmCompany/cmCompany.controller.js | 2 +-
server/api/cmCompany/cmCompany.model.js | 2 +-
server/api/cmCompany/cmCompany.rpc.js | 2 +-
server/api/cmCompany/index.js | 2 +-
server/api/cmContact/cmContact.attributes.js | 2 +-
server/api/cmContact/cmContact.controller.js | 2 +-
server/api/cmContact/cmContact.events.js | 2 +-
server/api/cmContact/cmContact.model.js | 2 +-
server/api/cmContact/cmContact.rpc.js | 2 +-
server/api/cmContact/cmContact.socket.js | 2 +-
server/api/cmContact/index.js | 2 +-
.../api/cmCustomField/cmCustomField.attributes.js | 2 +-
.../api/cmCustomField/cmCustomField.controller.js | 2 +-
server/api/cmCustomField/cmCustomField.model.js | 2 +-
server/api/cmCustomField/cmCustomField.rpc.js | 2 +-
server/api/cmCustomField/index.js | 2 +-
server/api/cmHopper/cmHopper.attributes.js | 2 +-
server/api/cmHopper/cmHopper.controller.js | 2 +-
server/api/cmHopper/cmHopper.model.js | 2 +-
server/api/cmHopper/cmHopper.rpc.js | 2 +-
server/api/cmHopper/index.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.attributes.js | 2 +-
.../api/cmHopperBlack/cmHopperBlack.controller.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.model.js | 2 +-
server/api/cmHopperBlack/cmHopperBlack.rpc.js | 2 +-
server/api/cmHopperBlack/index.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.attributes.js | 2 +-
.../api/cmHopperFinal/cmHopperFinal.controller.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.model.js | 2 +-
server/api/cmHopperFinal/cmHopperFinal.rpc.js | 2 +-
server/api/cmHopperFinal/index.js | 2 +-
.../cmHopperHistory/cmHopperHistory.attributes.js | 2 +-
.../cmHopperHistory/cmHopperHistory.controller.js | 2 +-
.../api/cmHopperHistory/cmHopperHistory.model.js | 2 +-
server/api/cmHopperHistory/cmHopperHistory.rpc.js | 2 +-
server/api/cmHopperHistory/index.js | 2 +-
server/api/cmList/cmList.attributes.js | 2 +-
server/api/cmList/cmList.controller.js | 2 +-
server/api/cmList/cmList.events.js | 2 +-
server/api/cmList/cmList.model.js | 2 +-
server/api/cmList/cmList.rpc.js | 2 +-
server/api/cmList/cmList.socket.js | 2 +-
server/api/cmList/index.js | 2 +-
server/api/condition/condition.attributes.js | 2 +-
server/api/condition/condition.controller.js | 2 +-
server/api/condition/condition.model.js | 2 +-
server/api/condition/condition.rpc.js | 2 +-
server/api/condition/index.js | 2 +-
server/api/dashboard/dashboard.attributes.js | 2 +-
server/api/dashboard/dashboard.controller.js | 2 +-
server/api/dashboard/dashboard.events.js | 2 +-
server/api/dashboard/dashboard.model.js | 2 +-
server/api/dashboard/dashboard.rpc.js | 2 +-
server/api/dashboard/dashboard.socket.js | 2 +-
server/api/dashboard/index.js | 2 +-
.../api/dashboardItem/dashboardItem.attributes.js | 2 +-
.../api/dashboardItem/dashboardItem.controller.js | 2 +-
server/api/dashboardItem/dashboardItem.events.js | 2 +-
server/api/dashboardItem/dashboardItem.model.js | 2 +-
server/api/dashboardItem/dashboardItem.rpc.js | 2 +-
server/api/dashboardItem/dashboardItem.socket.js | 2 +-
server/api/dashboardItem/index.js | 2 +-
server/api/disposition/disposition.attributes.js | 2 +-
server/api/disposition/disposition.controller.js | 2 +-
server/api/disposition/disposition.model.js | 2 +-
server/api/disposition/disposition.rpc.js | 2 +-
server/api/disposition/index.js | 2 +-
server/api/faxAccount/faxAccount.attributes.js | 2 +-
server/api/faxAccount/faxAccount.controller.js | 2 +-
server/api/faxAccount/faxAccount.events.js | 2 +-
server/api/faxAccount/faxAccount.model.js | 2 +-
server/api/faxAccount/faxAccount.rpc.js | 2 +-
server/api/faxAccount/faxAccount.socket.js | 2 +-
server/api/faxAccount/index.js | 2 +-
.../faxApplication/faxApplication.attributes.js | 2 +-
.../faxApplication/faxApplication.controller.js | 2 +-
server/api/faxApplication/faxApplication.model.js | 2 +-
server/api/faxApplication/faxApplication.rpc.js | 2 +-
server/api/faxApplication/index.js | 2 +-
.../faxInteraction/faxInteraction.attributes.js | 2 +-
.../faxInteraction/faxInteraction.controller.js | 2 +-
server/api/faxInteraction/faxInteraction.events.js | 2 +-
server/api/faxInteraction/faxInteraction.model.js | 2 +-
server/api/faxInteraction/faxInteraction.rpc.js | 2 +-
server/api/faxInteraction/faxInteraction.socket.js | 2 +-
server/api/faxInteraction/index.js | 2 +-
server/api/faxMessage/faxMessage.attributes.js | 2 +-
server/api/faxMessage/faxMessage.controller.js | 2 +-
server/api/faxMessage/faxMessage.events.js | 2 +-
server/api/faxMessage/faxMessage.model.js | 2 +-
server/api/faxMessage/faxMessage.rpc.js | 2 +-
server/api/faxMessage/faxMessage.socket.js | 2 +-
server/api/faxMessage/index.js | 2 +-
server/api/faxQueue/faxQueue.attributes.js | 2 +-
server/api/faxQueue/faxQueue.controller.js | 2 +-
server/api/faxQueue/faxQueue.events.js | 2 +-
server/api/faxQueue/faxQueue.model.js | 2 +-
server/api/faxQueue/faxQueue.rpc.js | 2 +-
server/api/faxQueue/faxQueue.socket.js | 2 +-
server/api/faxQueue/index.js | 2 +-
.../faxQueueReport/faxQueueReport.attributes.js | 2 +-
.../faxQueueReport/faxQueueReport.controller.js | 2 +-
server/api/faxQueueReport/faxQueueReport.model.js | 2 +-
server/api/faxQueueReport/faxQueueReport.rpc.js | 2 +-
server/api/faxQueueReport/index.js | 2 +-
.../faxTransferReport.attributes.js | 2 +-
.../faxTransferReport.controller.js | 2 +-
.../faxTransferReport/faxTransferReport.model.js | 2 +-
.../api/faxTransferReport/faxTransferReport.rpc.js | 2 +-
server/api/faxTransferReport/index.js | 2 +-
server/api/intDeskAccount/index.js | 2 +-
.../intDeskAccount/intDeskAccount.attributes.js | 2 +-
.../intDeskAccount/intDeskAccount.controller.js | 2 +-
server/api/intDeskAccount/intDeskAccount.model.js | 2 +-
server/api/intDeskAccount/intDeskAccount.rpc.js | 2 +-
server/api/intDeskConfiguration/index.js | 2 +-
.../intDeskConfiguration.attributes.js | 2 +-
.../intDeskConfiguration.controller.js | 2 +-
.../intDeskConfiguration.model.js | 2 +-
.../intDeskConfiguration.rpc.js | 2 +-
server/api/intDeskField/index.js | 2 +-
server/api/intDeskField/intDeskField.attributes.js | 2 +-
server/api/intDeskField/intDeskField.controller.js | 2 +-
server/api/intDeskField/intDeskField.model.js | 2 +-
server/api/intDeskField/intDeskField.rpc.js | 2 +-
server/api/intDynamics365Account/index.js | 2 +-
.../intDynamics365Account.attributes.js | 2 +-
.../intDynamics365Account.controller.js | 2 +-
.../intDynamics365Account.model.js | 2 +-
.../intDynamics365Account.rpc.js | 2 +-
server/api/intDynamics365Configuration/index.js | 2 +-
.../intDynamics365Configuration.attributes.js | 2 +-
.../intDynamics365Configuration.controller.js | 2 +-
.../intDynamics365Configuration.model.js | 2 +-
.../intDynamics365Configuration.rpc.js | 2 +-
server/api/intDynamics365Field/index.js | 2 +-
.../intDynamics365Field.attributes.js | 2 +-
.../intDynamics365Field.controller.js | 2 +-
.../intDynamics365Field.model.js | 2 +-
.../intDynamics365Field/intDynamics365Field.rpc.js | 2 +-
server/api/intFreshdeskAccount/index.js | 2 +-
.../intFreshdeskAccount.attributes.js | 2 +-
.../intFreshdeskAccount.controller.js | 2 +-
.../intFreshdeskAccount.model.js | 2 +-
.../intFreshdeskAccount/intFreshdeskAccount.rpc.js | 2 +-
server/api/intFreshdeskConfiguration/index.js | 2 +-
.../intFreshdeskConfiguration.attributes.js | 2 +-
.../intFreshdeskConfiguration.controller.js | 2 +-
.../intFreshdeskConfiguration.model.js | 2 +-
.../intFreshdeskConfiguration.rpc.js | 2 +-
server/api/intFreshdeskField/index.js | 2 +-
.../intFreshdeskField.attributes.js | 2 +-
.../intFreshdeskField.controller.js | 2 +-
.../intFreshdeskField/intFreshdeskField.model.js | 2 +-
.../api/intFreshdeskField/intFreshdeskField.rpc.js | 2 +-
server/api/intFreshsalesAccount/index.js | 2 +-
.../intFreshsalesAccount.attributes.js | 2 +-
.../intFreshsalesAccount.controller.js | 2 +-
.../intFreshsalesAccount.model.js | 2 +-
.../intFreshsalesAccount.rpc.js | 2 +-
server/api/intFreshsalesConfiguration/index.js | 2 +-
.../intFreshsalesConfiguration.attributes.js | 2 +-
.../intFreshsalesConfiguration.controller.js | 2 +-
.../intFreshsalesConfiguration.model.js | 2 +-
.../intFreshsalesConfiguration.rpc.js | 2 +-
server/api/intFreshsalesField/index.js | 2 +-
.../intFreshsalesField.attributes.js | 2 +-
.../intFreshsalesField.controller.js | 2 +-
.../intFreshsalesField/intFreshsalesField.model.js | 2 +-
.../intFreshsalesField/intFreshsalesField.rpc.js | 2 +-
server/api/intSalesforceAccount/index.js | 2 +-
.../intSalesforceAccount.attributes.js | 2 +-
.../intSalesforceAccount.controller.js | 2 +-
.../intSalesforceAccount.model.js | 2 +-
.../intSalesforceAccount.rpc.js | 2 +-
server/api/intSalesforceConfiguration/index.js | 2 +-
.../intSalesforceConfiguration.attributes.js | 2 +-
.../intSalesforceConfiguration.controller.js | 2 +-
.../intSalesforceConfiguration.model.js | 2 +-
.../intSalesforceConfiguration.rpc.js | 2 +-
server/api/intSalesforceField/index.js | 2 +-
.../intSalesforceField.attributes.js | 2 +-
.../intSalesforceField.controller.js | 2 +-
.../intSalesforceField/intSalesforceField.model.js | 2 +-
.../intSalesforceField/intSalesforceField.rpc.js | 2 +-
server/api/intServicenowAccount/index.js | 2 +-
.../intServicenowAccount.attributes.js | 2 +-
.../intServicenowAccount.controller.js | 2 +-
.../intServicenowAccount.model.js | 2 +-
.../intServicenowAccount.rpc.js | 2 +-
server/api/intServicenowConfiguration/index.js | 2 +-
.../intServicenowConfiguration.attributes.js | 2 +-
.../intServicenowConfiguration.controller.js | 2 +-
.../intServicenowConfiguration.model.js | 2 +-
.../intServicenowConfiguration.rpc.js | 2 +-
server/api/intServicenowField/index.js | 2 +-
.../intServicenowField.attributes.js | 2 +-
.../intServicenowField.controller.js | 2 +-
.../intServicenowField/intServicenowField.model.js | 2 +-
.../intServicenowField/intServicenowField.rpc.js | 2 +-
server/api/intSugarcrmAccount/index.js | 2 +-
.../intSugarcrmAccount.attributes.js | 2 +-
.../intSugarcrmAccount.controller.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +-
.../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +-
server/api/intSugarcrmConfiguration/index.js | 2 +-
.../intSugarcrmConfiguration.attributes.js | 2 +-
.../intSugarcrmConfiguration.controller.js | 2 +-
.../intSugarcrmConfiguration.model.js | 2 +-
.../intSugarcrmConfiguration.rpc.js | 2 +-
server/api/intSugarcrmField/index.js | 2 +-
.../intSugarcrmField.attributes.js | 2 +-
.../intSugarcrmField.controller.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.model.js | 2 +-
.../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +-
server/api/intVtigerAccount/index.js | 2 +-
.../intVtigerAccount.attributes.js | 2 +-
.../intVtigerAccount.controller.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.model.js | 2 +-
.../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +-
server/api/intVtigerConfiguration/index.js | 2 +-
.../intVtigerConfiguration.attributes.js | 2 +-
.../intVtigerConfiguration.controller.js | 2 +-
.../intVtigerConfiguration.model.js | 2 +-
.../intVtigerConfiguration.rpc.js | 2 +-
server/api/intVtigerField/index.js | 2 +-
.../intVtigerField/intVtigerField.attributes.js | 2 +-
.../intVtigerField/intVtigerField.controller.js | 2 +-
server/api/intVtigerField/intVtigerField.model.js | 2 +-
server/api/intVtigerField/intVtigerField.rpc.js | 2 +-
server/api/intZendeskAccount/index.js | 2 +-
.../intZendeskAccount.attributes.js | 2 +-
.../intZendeskAccount.controller.js | 2 +-
.../intZendeskAccount/intZendeskAccount.model.js | 2 +-
.../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +-
server/api/intZendeskConfiguration/index.js | 2 +-
.../intZendeskConfiguration.attributes.js | 2 +-
.../intZendeskConfiguration.controller.js | 2 +-
.../intZendeskConfiguration.model.js | 2 +-
.../intZendeskConfiguration.rpc.js | 2 +-
server/api/intZendeskField/index.js | 2 +-
.../intZendeskField/intZendeskField.attributes.js | 2 +-
.../intZendeskField/intZendeskField.controller.js | 2 +-
.../api/intZendeskField/intZendeskField.model.js | 2 +-
server/api/intZendeskField/intZendeskField.rpc.js | 2 +-
server/api/intZohoAccount/index.js | 2 +-
.../intZohoAccount/intZohoAccount.attributes.js | 2 +-
.../intZohoAccount/intZohoAccount.controller.js | 2 +-
server/api/intZohoAccount/intZohoAccount.model.js | 2 +-
server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +-
server/api/intZohoConfiguration/index.js | 2 +-
.../intZohoConfiguration.attributes.js | 2 +-
.../intZohoConfiguration.controller.js | 2 +-
.../intZohoConfiguration.model.js | 2 +-
.../intZohoConfiguration.rpc.js | 2 +-
server/api/intZohoField/index.js | 2 +-
server/api/intZohoField/intZohoField.attributes.js | 2 +-
server/api/intZohoField/intZohoField.controller.js | 2 +-
server/api/intZohoField/intZohoField.model.js | 2 +-
server/api/intZohoField/intZohoField.rpc.js | 2 +-
server/api/integration/index.js | 2 +-
server/api/integration/integration.attributes.js | 2 +-
server/api/integration/integration.controller.js | 2 +-
server/api/integration/integration.model.js | 2 +-
server/api/integration/integration.rpc.js | 2 +-
server/api/integrationReport/index.js | 2 +-
.../integrationReport.attributes.js | 2 +-
.../integrationReport.controller.js | 2 +-
.../integrationReport/integrationReport.model.js | 2 +-
.../api/integrationReport/integrationReport.rpc.js | 2 +-
server/api/interval/index.js | 2 +-
server/api/interval/interval.attributes.js | 2 +-
server/api/interval/interval.controller.js | 2 +-
server/api/interval/interval.model.js | 2 +-
server/api/interval/interval.rpc.js | 2 +-
server/api/jira/index.js | 2 +-
server/api/jira/jira.controller.js | 2 +-
server/api/jscriptyAnswerReport/index.js | 2 +-
.../jscriptyAnswerReport.attributes.js | 2 +-
.../jscriptyAnswerReport.controller.js | 2 +-
.../jscriptyAnswerReport.model.js | 2 +-
.../jscriptyAnswerReport.rpc.js | 2 +-
server/api/jscriptyProject/index.js | 2 +-
.../jscriptyProject/jscriptyProject.attributes.js | 2 +-
.../jscriptyProject/jscriptyProject.controller.js | 2 +-
.../api/jscriptyProject/jscriptyProject.model.js | 2 +-
server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +-
server/api/jscriptyQuestionReport/index.js | 2 +-
.../jscriptyQuestionReport.attributes.js | 2 +-
.../jscriptyQuestionReport.controller.js | 2 +-
.../jscriptyQuestionReport.model.js | 2 +-
.../jscriptyQuestionReport.rpc.js | 2 +-
server/api/jscriptySessionReport/index.js | 2 +-
.../jscriptySessionReport.attributes.js | 2 +-
.../jscriptySessionReport.controller.js | 2 +-
.../jscriptySessionReport.model.js | 2 +-
.../jscriptySessionReport.rpc.js | 2 +-
server/api/license/index.js | 2 +-
server/api/license/license.attributes.js | 2 +-
server/api/license/license.controller.js | 2 +-
server/api/license/license.model.js | 2 +-
server/api/license/license.rpc.js | 2 +-
server/api/mailAccount/index.js | 2 +-
server/api/mailAccount/mailAccount.attributes.js | 2 +-
server/api/mailAccount/mailAccount.controller.js | 2 +-
server/api/mailAccount/mailAccount.events.js | 2 +-
server/api/mailAccount/mailAccount.model.js | 2 +-
server/api/mailAccount/mailAccount.rpc.js | 2 +-
server/api/mailAccount/mailAccount.socket.js | 2 +-
server/api/mailApplication/index.js | 2 +-
.../mailApplication/mailApplication.attributes.js | 2 +-
.../mailApplication/mailApplication.controller.js | 2 +-
.../api/mailApplication/mailApplication.model.js | 2 +-
server/api/mailApplication/mailApplication.rpc.js | 2 +-
server/api/mailInteraction/index.js | 2 +-
.../mailInteraction/mailInteraction.attributes.js | 2 +-
.../mailInteraction/mailInteraction.controller.js | 2 +-
.../api/mailInteraction/mailInteraction.events.js | 2 +-
.../api/mailInteraction/mailInteraction.model.js | 2 +-
server/api/mailInteraction/mailInteraction.rpc.js | 2 +-
.../api/mailInteraction/mailInteraction.socket.js | 2 +-
server/api/mailMessage/index.js | 2 +-
server/api/mailMessage/mailMessage.attributes.js | 2 +-
server/api/mailMessage/mailMessage.controller.js | 2 +-
server/api/mailMessage/mailMessage.events.js | 2 +-
server/api/mailMessage/mailMessage.model.js | 2 +-
server/api/mailMessage/mailMessage.rpc.js | 2 +-
server/api/mailMessage/mailMessage.socket.js | 2 +-
server/api/mailQueue/index.js | 2 +-
server/api/mailQueue/mailQueue.attributes.js | 2 +-
server/api/mailQueue/mailQueue.controller.js | 2 +-
server/api/mailQueue/mailQueue.events.js | 2 +-
server/api/mailQueue/mailQueue.model.js | 2 +-
server/api/mailQueue/mailQueue.rpc.js | 2 +-
server/api/mailQueue/mailQueue.socket.js | 2 +-
server/api/mailQueueReport/index.js | 2 +-
.../mailQueueReport/mailQueueReport.attributes.js | 2 +-
.../mailQueueReport/mailQueueReport.controller.js | 2 +-
.../api/mailQueueReport/mailQueueReport.model.js | 2 +-
server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +-
server/api/mailServerIn/index.js | 2 +-
server/api/mailServerIn/mailServerIn.attributes.js | 2 +-
server/api/mailServerIn/mailServerIn.model.js | 2 +-
server/api/mailServerIn/mailServerIn.rpc.js | 2 +-
server/api/mailServerOut/index.js | 2 +-
.../api/mailServerOut/mailServerOut.attributes.js | 2 +-
.../api/mailServerOut/mailServerOut.controller.js | 2 +-
server/api/mailServerOut/mailServerOut.model.js | 2 +-
server/api/mailServerOut/mailServerOut.rpc.js | 2 +-
server/api/mailSubstatus/index.js | 2 +-
.../api/mailSubstatus/mailSubstatus.attributes.js | 2 +-
.../api/mailSubstatus/mailSubstatus.controller.js | 2 +-
server/api/mailSubstatus/mailSubstatus.events.js | 2 +-
server/api/mailSubstatus/mailSubstatus.model.js | 2 +-
server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +-
server/api/mailTransferReport/index.js | 2 +-
.../mailTransferReport.attributes.js | 2 +-
.../mailTransferReport.controller.js | 2 +-
.../mailTransferReport/mailTransferReport.model.js | 2 +-
.../mailTransferReport/mailTransferReport.rpc.js | 2 +-
server/api/memberReport/index.js | 2 +-
server/api/memberReport/memberReport.attributes.js | 2 +-
server/api/memberReport/memberReport.controller.js | 2 +-
server/api/memberReport/memberReport.model.js | 2 +-
server/api/memberReport/memberReport.rpc.js | 2 +-
server/api/migration/index.js | 2 +-
server/api/migration/migration.attributes.js | 2 +-
server/api/migration/migration.controller.js | 2 +-
server/api/migration/migration.model.js | 2 +-
server/api/migration/migration.rpc.js | 2 +-
server/api/network/index.js | 2 +-
server/api/network/network.attributes.js | 2 +-
server/api/network/network.controller.js | 2 +-
server/api/network/network.model.js | 2 +-
server/api/network/network.rpc.js | 2 +-
server/api/openchannelAccount/index.js | 2 +-
.../openchannelAccount.attributes.js | 2 +-
.../openchannelAccount.controller.js | 2 +-
.../openchannelAccount.events.js | 2 +-
.../openchannelAccount/openchannelAccount.model.js | 2 +-
.../openchannelAccount/openchannelAccount.rpc.js | 2 +-
.../openchannelAccount.socket.js | 2 +-
server/api/openchannelApplication/index.js | 2 +-
.../openchannelApplication.attributes.js | 2 +-
.../openchannelApplication.controller.js | 2 +-
.../openchannelApplication.model.js | 2 +-
.../openchannelApplication.rpc.js | 2 +-
server/api/openchannelInteraction/index.js | 2 +-
.../openchannelInteraction.attributes.js | 2 +-
.../openchannelInteraction.controller.js | 2 +-
.../openchannelInteraction.events.js | 2 +-
.../openchannelInteraction.model.js | 2 +-
.../openchannelInteraction.rpc.js | 2 +-
.../openchannelInteraction.socket.js | 2 +-
server/api/openchannelMessage/index.js | 2 +-
.../openchannelMessage.attributes.js | 2 +-
.../openchannelMessage.controller.js | 2 +-
.../openchannelMessage.events.js | 2 +-
.../openchannelMessage/openchannelMessage.model.js | 2 +-
.../openchannelMessage/openchannelMessage.rpc.js | 2 +-
.../openchannelMessage.socket.js | 2 +-
server/api/openchannelQueue/index.js | 2 +-
.../openchannelQueue.attributes.js | 2 +-
.../openchannelQueue.controller.js | 2 +-
.../openchannelQueue/openchannelQueue.events.js | 2 +-
.../api/openchannelQueue/openchannelQueue.model.js | 2 +-
.../api/openchannelQueue/openchannelQueue.rpc.js | 2 +-
.../openchannelQueue/openchannelQueue.socket.js | 2 +-
server/api/openchannelQueueReport/index.js | 2 +-
.../openchannelQueueReport.attributes.js | 2 +-
.../openchannelQueueReport.controller.js | 2 +-
.../openchannelQueueReport.model.js | 2 +-
.../openchannelQueueReport.rpc.js | 2 +-
server/api/openchannelTransferReport/index.js | 2 +-
.../openchannelTransferReport.attributes.js | 2 +-
.../openchannelTransferReport.controller.js | 2 +-
.../openchannelTransferReport.model.js | 2 +-
.../openchannelTransferReport.rpc.js | 2 +-
server/api/pause/index.js | 2 +-
server/api/pause/pause.attributes.js | 2 +-
server/api/pause/pause.controller.js | 2 +-
server/api/pause/pause.model.js | 2 +-
server/api/pause/pause.rpc.js | 2 +-
server/api/plugin/index.js | 2 +-
server/api/plugin/plugin.attributes.js | 2 +-
server/api/plugin/plugin.controller.js | 2 +-
server/api/plugin/plugin.events.js | 2 +-
server/api/plugin/plugin.model.js | 2 +-
server/api/plugin/plugin.rpc.js | 2 +-
server/api/plugin/plugin.socket.js | 2 +-
server/api/pm2/index.js | 2 +-
server/api/pm2/pm2.controller.js | 2 +-
server/api/realtime/index.js | 2 +-
server/api/realtime/realtime.controller.js | 2 +-
server/api/reportAgentPreview/index.js | 2 +-
.../reportAgentPreview.attributes.js | 2 +-
.../reportAgentPreview/reportAgentPreview.model.js | 2 +-
.../reportAgentPreview/reportAgentPreview.rpc.js | 2 +-
server/api/rpc/index.js | 2 +-
server/api/rpc/rpc.controller.js | 2 +-
server/api/schedule/index.js | 2 +-
server/api/schedule/schedule.attributes.js | 2 +-
server/api/schedule/schedule.controller.js | 2 +-
server/api/schedule/schedule.model.js | 2 +-
server/api/schedule/schedule.rpc.js | 2 +-
server/api/screenRecording/index.js | 2 +-
.../screenRecording/screenRecording.attributes.js | 2 +-
.../screenRecording/screenRecording.controller.js | 2 +-
.../api/screenRecording/screenRecording.model.js | 2 +-
server/api/screenRecording/screenRecording.rpc.js | 2 +-
server/api/setting/index.js | 2 +-
server/api/setting/setting.attributes.js | 2 +-
server/api/setting/setting.controller.js | 2 +-
server/api/setting/setting.model.js | 2 +-
server/api/setting/setting.rpc.js | 2 +-
server/api/smsAccount/index.js | 2 +-
server/api/smsAccount/smsAccount.attributes.js | 2 +-
server/api/smsAccount/smsAccount.controller.js | 2 +-
server/api/smsAccount/smsAccount.events.js | 2 +-
server/api/smsAccount/smsAccount.model.js | 2 +-
server/api/smsAccount/smsAccount.rpc.js | 2 +-
server/api/smsAccount/smsAccount.socket.js | 2 +-
server/api/smsApplication/index.js | 2 +-
.../smsApplication/smsApplication.attributes.js | 2 +-
.../smsApplication/smsApplication.controller.js | 2 +-
server/api/smsApplication/smsApplication.model.js | 2 +-
server/api/smsApplication/smsApplication.rpc.js | 2 +-
server/api/smsInteraction/index.js | 2 +-
.../smsInteraction/smsInteraction.attributes.js | 2 +-
.../smsInteraction/smsInteraction.controller.js | 2 +-
server/api/smsInteraction/smsInteraction.events.js | 2 +-
server/api/smsInteraction/smsInteraction.model.js | 2 +-
server/api/smsInteraction/smsInteraction.rpc.js | 2 +-
server/api/smsInteraction/smsInteraction.socket.js | 2 +-
server/api/smsMessage/index.js | 2 +-
server/api/smsMessage/smsMessage.attributes.js | 2 +-
server/api/smsMessage/smsMessage.controller.js | 2 +-
server/api/smsMessage/smsMessage.events.js | 2 +-
server/api/smsMessage/smsMessage.model.js | 2 +-
server/api/smsMessage/smsMessage.rpc.js | 2 +-
server/api/smsMessage/smsMessage.socket.js | 2 +-
server/api/smsQueue/index.js | 2 +-
server/api/smsQueue/smsQueue.attributes.js | 2 +-
server/api/smsQueue/smsQueue.controller.js | 2 +-
server/api/smsQueue/smsQueue.events.js | 2 +-
server/api/smsQueue/smsQueue.model.js | 2 +-
server/api/smsQueue/smsQueue.rpc.js | 2 +-
server/api/smsQueue/smsQueue.socket.js | 2 +-
server/api/smsQueueReport/index.js | 2 +-
.../smsQueueReport/smsQueueReport.attributes.js | 2 +-
.../smsQueueReport/smsQueueReport.controller.js | 2 +-
server/api/smsQueueReport/smsQueueReport.model.js | 2 +-
server/api/smsQueueReport/smsQueueReport.rpc.js | 2 +-
server/api/smsTransferReport/index.js | 2 +-
.../smsTransferReport.attributes.js | 2 +-
.../smsTransferReport.controller.js | 2 +-
.../smsTransferReport/smsTransferReport.model.js | 2 +-
.../api/smsTransferReport/smsTransferReport.rpc.js | 2 +-
server/api/sound/index.js | 2 +-
server/api/sound/sound.attributes.js | 2 +-
server/api/sound/sound.controller.js | 2 +-
server/api/sound/sound.model.js | 2 +-
server/api/sound/sound.rpc.js | 2 +-
server/api/squareMessage/index.js | 2 +-
.../api/squareMessage/squareMessage.attributes.js | 2 +-
.../api/squareMessage/squareMessage.controller.js | 2 +-
server/api/squareMessage/squareMessage.model.js | 2 +-
server/api/squareMessage/squareMessage.rpc.js | 2 +-
server/api/squareOdbc/index.js | 2 +-
server/api/squareOdbc/squareOdbc.attributes.js | 2 +-
server/api/squareOdbc/squareOdbc.controller.js | 2 +-
server/api/squareOdbc/squareOdbc.model.js | 2 +-
server/api/squareOdbc/squareOdbc.rpc.js | 2 +-
server/api/squareProject/index.js | 2 +-
.../api/squareProject/squareProject.attributes.js | 2 +-
.../api/squareProject/squareProject.controller.js | 2 +-
server/api/squareProject/squareProject.events.js | 2 +-
server/api/squareProject/squareProject.model.js | 2 +-
server/api/squareProject/squareProject.rpc.js | 2 +-
server/api/squareProject/squareProject.socket.js | 2 +-
server/api/squareRecording/index.js | 2 +-
.../squareRecording/squareRecording.attributes.js | 2 +-
.../squareRecording/squareRecording.controller.js | 2 +-
.../api/squareRecording/squareRecording.model.js | 2 +-
server/api/squareRecording/squareRecording.rpc.js | 2 +-
server/api/squareReport/index.js | 2 +-
server/api/squareReport/squareReport.attributes.js | 2 +-
server/api/squareReport/squareReport.controller.js | 2 +-
server/api/squareReport/squareReport.model.js | 2 +-
server/api/squareReport/squareReport.rpc.js | 2 +-
server/api/squareReportDetail/index.js | 2 +-
.../squareReportDetail.attributes.js | 2 +-
.../squareReportDetail.controller.js | 2 +-
.../squareReportDetail/squareReportDetail.model.js | 2 +-
.../squareReportDetail/squareReportDetail.rpc.js | 2 +-
server/api/system/index.js | 2 +-
server/api/system/system.controller.js | 2 +-
server/api/tag/index.js | 2 +-
server/api/tag/tag.attributes.js | 2 +-
server/api/tag/tag.controller.js | 2 +-
server/api/tag/tag.model.js | 2 +-
server/api/tag/tag.rpc.js | 2 +-
server/api/team/index.js | 2 +-
server/api/team/team.attributes.js | 2 +-
server/api/team/team.controller.js | 2 +-
server/api/team/team.events.js | 2 +-
server/api/team/team.model.js | 2 +-
server/api/team/team.rpc.js | 2 +-
server/api/team/team.socket.js | 2 +-
.../teamVoicePrefix/teamVoicePrefix.attributes.js | 2 +-
.../api/teamVoicePrefix/teamVoicePrefix.model.js | 2 +-
server/api/teamVoiceQueue/index.js | 2 +-
.../teamVoiceQueue/teamVoiceQueue.attributes.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.model.js | 2 +-
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js | 2 +-
server/api/template/index.js | 2 +-
server/api/template/template.attributes.js | 2 +-
server/api/template/template.controller.js | 2 +-
server/api/template/template.model.js | 2 +-
server/api/template/template.rpc.js | 2 +-
server/api/trigger/index.js | 2 +-
server/api/trigger/trigger.attributes.js | 2 +-
server/api/trigger/trigger.controller.js | 2 +-
server/api/trigger/trigger.model.js | 2 +-
server/api/trigger/trigger.rpc.js | 2 +-
server/api/trunk/index.js | 2 +-
server/api/trunk/trunk.attributes.js | 2 +-
server/api/trunk/trunk.controller.js | 2 +-
server/api/trunk/trunk.model.js | 2 +-
server/api/trunk/trunk.rpc.js | 2 +-
server/api/user/index.js | 2 +-
server/api/user/user.attributes.js | 2 +-
server/api/user/user.controller.js | 2 +-
server/api/user/user.events.js | 2 +-
server/api/user/user.model.js | 2 +-
server/api/user/user.rpc.js | 2 +-
server/api/user/user.socket.js | 2 +-
server/api/userChatQueue/index.js | 2 +-
.../api/userChatQueue/userChatQueue.attributes.js | 2 +-
server/api/userChatQueue/userChatQueue.model.js | 2 +-
server/api/userChatQueue/userChatQueue.rpc.js | 2 +-
server/api/userFaxQueue/index.js | 2 +-
server/api/userFaxQueue/userFaxQueue.attributes.js | 2 +-
server/api/userFaxQueue/userFaxQueue.model.js | 2 +-
server/api/userFaxQueue/userFaxQueue.rpc.js | 2 +-
server/api/userMailQueue/index.js | 2 +-
.../api/userMailQueue/userMailQueue.attributes.js | 2 +-
server/api/userMailQueue/userMailQueue.model.js | 2 +-
server/api/userMailQueue/userMailQueue.rpc.js | 2 +-
server/api/userNotification/index.js | 2 +-
.../userNotification.attributes.js | 2 +-
.../userNotification.controller.js | 2 +-
.../userNotification/userNotification.events.js | 2 +-
.../api/userNotification/userNotification.model.js | 2 +-
.../api/userNotification/userNotification.rpc.js | 2 +-
.../userNotification/userNotification.socket.js | 2 +-
server/api/userOpenchannelQueue/index.js | 2 +-
.../userOpenchannelQueue.attributes.js | 2 +-
.../userOpenchannelQueue.model.js | 2 +-
.../userOpenchannelQueue.rpc.js | 2 +-
server/api/userProfile/index.js | 2 +-
server/api/userProfile/userProfile.attributes.js | 2 +-
server/api/userProfile/userProfile.controller.js | 2 +-
server/api/userProfile/userProfile.events.js | 2 +-
server/api/userProfile/userProfile.model.js | 2 +-
server/api/userProfile/userProfile.rpc.js | 2 +-
server/api/userProfile/userProfile.socket.js | 2 +-
server/api/userProfileResource/index.js | 2 +-
.../userProfileResource.attributes.js | 2 +-
.../userProfileResource.controller.js | 2 +-
.../userProfileResource.model.js | 2 +-
.../userProfileResource/userProfileResource.rpc.js | 2 +-
server/api/userProfileSection/index.js | 2 +-
.../userProfileSection.attributes.js | 2 +-
.../userProfileSection.controller.js | 2 +-
.../userProfileSection/userProfileSection.model.js | 2 +-
.../userProfileSection/userProfileSection.rpc.js | 2 +-
server/api/userSmsQueue/index.js | 2 +-
server/api/userSmsQueue/userSmsQueue.attributes.js | 2 +-
server/api/userSmsQueue/userSmsQueue.model.js | 2 +-
server/api/userSmsQueue/userSmsQueue.rpc.js | 2 +-
.../userVoicePrefix/userVoicePrefix.attributes.js | 2 +-
.../api/userVoicePrefix/userVoicePrefix.model.js | 2 +-
server/api/userVoiceQueue/index.js | 2 +-
.../userVoiceQueue/userVoiceQueue.attributes.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +-
server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +-
server/api/userVoiceQueueRt/index.js | 2 +-
.../userVoiceQueueRt.attributes.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +-
.../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +-
.../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +-
server/api/userWhatsappQueue/index.js | 2 +-
.../userWhatsappQueue.attributes.js | 2 +-
.../userWhatsappQueue/userWhatsappQueue.model.js | 2 +-
.../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +-
server/api/variable/index.js | 2 +-
server/api/variable/variable.attributes.js | 2 +-
server/api/variable/variable.controller.js | 2 +-
server/api/variable/variable.model.js | 2 +-
server/api/variable/variable.rpc.js | 2 +-
server/api/version/index.js | 2 +-
server/api/version/version.controller.js | 2 +-
server/api/voiceAgentReport/index.js | 2 +-
.../voiceAgentReport.attributes.js | 2 +-
.../voiceAgentReport.controller.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.model.js | 2 +-
.../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +-
server/api/voiceCallReport/index.js | 2 +-
.../voiceCallReport/voiceCallReport.attributes.js | 2 +-
.../voiceCallReport/voiceCallReport.controller.js | 2 +-
.../api/voiceCallReport/voiceCallReport.model.js | 2 +-
server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +-
server/api/voiceChanSpy/index.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +-
server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +-
server/api/voiceContext/index.js | 2 +-
server/api/voiceContext/voiceContext.attributes.js | 2 +-
server/api/voiceContext/voiceContext.controller.js | 2 +-
server/api/voiceContext/voiceContext.model.js | 2 +-
server/api/voiceContext/voiceContext.rpc.js | 2 +-
server/api/voiceDialReport/index.js | 2 +-
.../voiceDialReport/voiceDialReport.attributes.js | 2 +-
.../voiceDialReport/voiceDialReport.controller.js | 2 +-
.../api/voiceDialReport/voiceDialReport.model.js | 2 +-
server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +-
server/api/voiceExtension/index.js | 2 +-
.../voiceExtension/voiceExtension.attributes.js | 2 +-
.../voiceExtension/voiceExtension.controller.js | 2 +-
server/api/voiceExtension/voiceExtension.events.js | 2 +-
server/api/voiceExtension/voiceExtension.model.js | 2 +-
server/api/voiceExtension/voiceExtension.rpc.js | 2 +-
server/api/voiceExtension/voiceExtension.socket.js | 2 +-
server/api/voiceMail/index.js | 2 +-
server/api/voiceMail/voiceMail.attributes.js | 2 +-
server/api/voiceMail/voiceMail.controller.js | 2 +-
server/api/voiceMail/voiceMail.model.js | 2 +-
server/api/voiceMail/voiceMail.rpc.js | 2 +-
server/api/voiceMailMessage/index.js | 2 +-
.../voiceMailMessage.attributes.js | 2 +-
.../voiceMailMessage.controller.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.model.js | 2 +-
.../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +-
server/api/voiceMusicOnHold/index.js | 2 +-
.../voiceMusicOnHold.attributes.js | 2 +-
.../voiceMusicOnHold.controller.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +-
.../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +-
server/api/voicePrefix/index.js | 2 +-
server/api/voicePrefix/voicePrefix.attributes.js | 2 +-
server/api/voicePrefix/voicePrefix.controller.js | 2 +-
server/api/voicePrefix/voicePrefix.events.js | 2 +-
server/api/voicePrefix/voicePrefix.model.js | 2 +-
server/api/voicePrefix/voicePrefix.rpc.js | 2 +-
server/api/voicePrefix/voicePrefix.socket.js | 2 +-
server/api/voiceQueue/index.js | 2 +-
server/api/voiceQueue/voiceQueue.attributes.js | 2 +-
server/api/voiceQueue/voiceQueue.controller.js | 2 +-
server/api/voiceQueue/voiceQueue.events.js | 2 +-
server/api/voiceQueue/voiceQueue.model.js | 2 +-
server/api/voiceQueue/voiceQueue.rpc.js | 2 +-
server/api/voiceQueue/voiceQueue.socket.js | 2 +-
server/api/voiceQueueReport/index.js | 2 +-
.../voiceQueueReport.attributes.js | 2 +-
.../voiceQueueReport.controller.js | 2 +-
.../voiceQueueReport/voiceQueueReport.events.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.model.js | 2 +-
.../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +-
.../voiceQueueReport/voiceQueueReport.socket.js | 2 +-
server/api/voiceQueuesLog/index.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +-
.../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +-
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +-
server/api/voiceRecording/index.js | 2 +-
.../voiceRecording/voiceRecording.attributes.js | 2 +-
.../voiceRecording/voiceRecording.controller.js | 2 +-
server/api/voiceRecording/voiceRecording.model.js | 2 +-
server/api/voiceRecording/voiceRecording.rpc.js | 2 +-
server/api/voiceTransferReport/index.js | 2 +-
.../voiceTransferReport.attributes.js | 2 +-
.../voiceTransferReport.controller.js | 2 +-
.../voiceTransferReport.model.js | 2 +-
.../voiceTransferReport/voiceTransferReport.rpc.js | 2 +-
server/api/webbar/index.js | 2 +-
server/api/webbar/webbar.controller.js | 2 +-
server/api/whatsappAccount/index.js | 2 +-
.../whatsappAccount/whatsappAccount.attributes.js | 2 +-
.../whatsappAccount/whatsappAccount.controller.js | 2 +-
.../api/whatsappAccount/whatsappAccount.events.js | 2 +-
.../api/whatsappAccount/whatsappAccount.model.js | 2 +-
server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +-
.../api/whatsappAccount/whatsappAccount.socket.js | 2 +-
server/api/whatsappApplication/index.js | 2 +-
.../whatsappApplication.attributes.js | 2 +-
.../whatsappApplication.controller.js | 2 +-
.../whatsappApplication.model.js | 2 +-
.../whatsappApplication/whatsappApplication.rpc.js | 2 +-
server/api/whatsappInteraction/index.js | 2 +-
.../whatsappInteraction.attributes.js | 2 +-
.../whatsappInteraction.controller.js | 2 +-
.../whatsappInteraction.events.js | 2 +-
.../whatsappInteraction.model.js | 2 +-
.../whatsappInteraction/whatsappInteraction.rpc.js | 2 +-
.../whatsappInteraction.socket.js | 2 +-
server/api/whatsappMessage/index.js | 2 +-
.../whatsappMessage/whatsappMessage.attributes.js | 2 +-
.../whatsappMessage/whatsappMessage.controller.js | 2 +-
.../api/whatsappMessage/whatsappMessage.events.js | 2 +-
.../api/whatsappMessage/whatsappMessage.model.js | 2 +-
server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +-
.../api/whatsappMessage/whatsappMessage.socket.js | 2 +-
server/api/whatsappQueue/index.js | 2 +-
.../api/whatsappQueue/whatsappQueue.attributes.js | 2 +-
.../api/whatsappQueue/whatsappQueue.controller.js | 2 +-
server/api/whatsappQueue/whatsappQueue.events.js | 2 +-
server/api/whatsappQueue/whatsappQueue.model.js | 2 +-
server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +-
server/api/whatsappQueue/whatsappQueue.socket.js | 2 +-
server/api/whatsappQueueReport/index.js | 2 +-
.../whatsappQueueReport.attributes.js | 2 +-
.../whatsappQueueReport.controller.js | 2 +-
.../whatsappQueueReport.model.js | 2 +-
.../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +-
server/api/whatsappTransferReport/index.js | 2 +-
.../whatsappTransferReport.attributes.js | 2 +-
.../whatsappTransferReport.controller.js | 2 +-
.../whatsappTransferReport.model.js | 2 +-
.../whatsappTransferReport.rpc.js | 2 +-
server/app.js | 2 +-
server/components/auth/service.js | 2 +-
server/components/encryptor/index.js | 2 +-
server/components/export/csv.js | 2 +-
server/components/export/pdf.js | 2 +-
server/components/export/xlsx.js | 2 +-
server/components/extensions/rewrite.js | 2 +-
server/components/import/cm/csv.js | 2 +-
server/components/import/cm/csv2.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/config/express.js | 2 +-
server/config/license/hardware.js | 2 +-
server/config/license/index.js | 2 +-
server/config/license/util.js | 2 +-
server/config/local.env.js | 2 +-
server/config/logger.js | 2 +-
server/config/pm2/config.js | 2 +-
server/config/pm2/index.js | 2 +-
server/config/schedule/chat.js | 2 +-
server/config/schedule/index.js | 2 +-
server/config/schedule/transcribe.js | 2 +-
server/config/schedule/whatsapp.js | 2 +-
server/config/seedContact.js | 2 +-
server/config/seedUsers.js | 2 +-
server/config/socketio.js | 2 +-
server/config/triggers/index.js | 2 +-
server/config/utils.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/safe-template.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/graph/index.js | 2 +-
server/services/agi/index.js | 2 +-
server/services/agi/mailRpc/index.js | 2 +-
server/services/agi/reply.js | 2 +-
server/services/agi/rpc/index.js | 2 +-
server/services/agi/scripts/aws/index.js | 2 +-
server/services/agi/scripts/aws/lex/index.js | 2 +-
server/services/agi/scripts/aws/lex/lib/api.js | 2 +-
server/services/agi/scripts/aws/polly/index.js | 2 +-
server/services/agi/scripts/aws/polly/lib/api.js | 2 +-
server/services/agi/scripts/google/asr/index.js | 2 +-
server/services/agi/scripts/google/asr/lib/api.js | 2 +-
server/services/agi/scripts/google/index.js | 2 +-
server/services/agi/scripts/index.js | 2 +-
server/services/agi/scripts/sestek/index.js | 2 +-
server/services/agi/scripts/sestek/nda/index.js | 2 +-
server/services/agi/scripts/tilde/asr/index.js | 2 +-
server/services/agi/scripts/tilde/asr/lib/api.js | 2 +-
server/services/agi/scripts/tilde/index.js | 2 +-
server/services/agi/server.js | 2 +-
server/services/agi/vertices.js | 2 +-
server/services/ami/acw/index.js | 2 +-
server/services/ami/ami.js | 2 +-
server/services/ami/client.js | 2 +-
server/services/ami/dialer/action.js | 2 +-
server/services/ami/dialer/agentComplete.js | 2 +-
server/services/ami/dialer/final.js | 2 +-
server/services/ami/dialer/hangup.js | 2 +-
server/services/ami/dialer/history.js | 2 +-
server/services/ami/dialer/index.js | 2 +-
server/services/ami/dialer/queueCallerAbandon.js | 2 +-
server/services/ami/fax/action.js | 2 +-
server/services/ami/fax/index.js | 2 +-
server/services/ami/fax/rpcDb.js | 2 +-
server/services/ami/fax/util/gs.js | 2 +-
server/services/ami/fax/util/util.js | 2 +-
server/services/ami/index.js | 2 +-
server/services/ami/model/agent.js | 2 +-
server/services/ami/model/campaign.js | 2 +-
server/services/ami/model/channel.js | 2 +-
server/services/ami/model/deskAccount.js | 2 +-
server/services/ami/model/dynamics365Account.js | 2 +-
server/services/ami/model/faxAccount.js | 2 +-
server/services/ami/model/freshdeskAccount.js | 2 +-
server/services/ami/model/freshsalesAccount.js | 2 +-
server/services/ami/model/queueReport.js | 2 +-
server/services/ami/model/salesforceAccount.js | 2 +-
server/services/ami/model/servicenowAccount.js | 2 +-
server/services/ami/model/sugarcrmAccount.js | 2 +-
server/services/ami/model/telephone.js | 2 +-
server/services/ami/model/template.js | 2 +-
server/services/ami/model/trigger.js | 2 +-
server/services/ami/model/trunk.js | 2 +-
server/services/ami/model/voiceExtension.js | 2 +-
server/services/ami/model/voiceQueue.js | 2 +-
server/services/ami/model/vtigerAccount.js | 2 +-
server/services/ami/model/zendeskAccount.js | 2 +-
server/services/ami/model/zohoAccount.js | 2 +-
server/services/ami/preview/action.js | 2 +-
server/services/ami/preview/index.js | 2 +-
server/services/ami/preview/rpcDb.js | 2 +-
server/services/ami/preview/util/util.js | 2 +-
server/services/ami/properties.js | 2 +-
server/services/ami/realtime/index.js | 2 +-
server/services/ami/report/index.js | 2 +-
server/services/ami/report/userReport.js | 2 +-
server/services/ami/report/voiceAgentReport.js | 2 +-
server/services/ami/report/voiceCallReport.js | 2 +-
server/services/ami/report/voiceDialReport.js | 2 +-
server/services/ami/report/voiceQueueReport.js | 2 +-
server/services/ami/rpc/agentReportPreview.js | 2 +-
server/services/ami/rpc/attachment.js | 2 +-
server/services/ami/rpc/campaign.js | 2 +-
server/services/ami/rpc/cmContact.js | 2 +-
server/services/ami/rpc/cmHopper.js | 2 +-
server/services/ami/rpc/cmHopperBlack.js | 2 +-
server/services/ami/rpc/cmHopperFinal.js | 2 +-
server/services/ami/rpc/cmHopperHistory.js | 2 +-
server/services/ami/rpc/faxAccount.js | 2 +-
server/services/ami/rpc/faxMessage.js | 2 +-
server/services/ami/rpc/integrations/desk.js | 2 +-
.../services/ami/rpc/integrations/dynamics365.js | 2 +-
server/services/ami/rpc/integrations/freshdesk.js | 2 +-
server/services/ami/rpc/integrations/freshsales.js | 2 +-
server/services/ami/rpc/integrations/salesforce.js | 2 +-
server/services/ami/rpc/integrations/servicenow.js | 2 +-
server/services/ami/rpc/integrations/sugarcrm.js | 2 +-
server/services/ami/rpc/integrations/vtiger.js | 2 +-
server/services/ami/rpc/integrations/zendesk.js | 2 +-
server/services/ami/rpc/integrations/zoho.js | 2 +-
server/services/ami/rpc/memberReport.js | 2 +-
server/services/ami/rpc/setting.js | 2 +-
server/services/ami/rpc/template.js | 2 +-
server/services/ami/rpc/trigger.js | 2 +-
server/services/ami/rpc/trunk.js | 2 +-
server/services/ami/rpc/user.js | 2 +-
server/services/ami/rpc/voiceAgentReport.js | 2 +-
server/services/ami/rpc/voiceCallReport.js | 2 +-
server/services/ami/rpc/voiceDialReport.js | 2 +-
server/services/ami/rpc/voiceExtension.js | 2 +-
server/services/ami/rpc/voiceQueue.js | 2 +-
server/services/ami/rpc/voiceQueueReport.js | 2 +-
server/services/ami/rpc/voiceQueueRt.js | 2 +-
server/services/ami/rpc/voiceRecording.js | 2 +-
server/services/ami/rpc/voiceTransferReport.js | 2 +-
server/services/ami/server/index.js | 2 +-
server/services/ami/trigger/cmContact/index.js | 2 +-
server/services/ami/trigger/index.js | 2 +-
server/services/ami/trigger/integration/desk.js | 2 +-
.../ami/trigger/integration/dynamics365.js | 2 +-
.../services/ami/trigger/integration/freshdesk.js | 2 +-
.../services/ami/trigger/integration/freshsales.js | 2 +-
server/services/ami/trigger/integration/index.js | 2 +-
.../services/ami/trigger/integration/salesforce.js | 2 +-
.../services/ami/trigger/integration/servicenow.js | 2 +-
.../services/ami/trigger/integration/sugarcrm.js | 2 +-
server/services/ami/trigger/integration/util.js | 2 +-
server/services/ami/trigger/integration/vtiger.js | 2 +-
server/services/ami/trigger/integration/zendesk.js | 2 +-
server/services/ami/trigger/integration/zoho.js | 2 +-
server/services/ami/trigger/script/index.js | 2 +-
server/services/ami/trigger/urlforward/index.js | 2 +-
server/services/email/client.js | 2 +-
server/services/email/index.js | 2 +-
server/services/email/lib/email.js | 2 +-
server/services/email/lib/imap.js | 2 +-
server/services/email/lib/smtp.js | 2 +-
server/services/email/lib/utils.js | 2 +-
server/services/email/model/mailAccount.js | 2 +-
server/services/email/realtime/index.js | 2 +-
server/services/email/rpc/mailAccount.js | 2 +-
server/services/email/rpc/setting.js | 2 +-
server/services/email/server/index.js | 2 +-
server/services/express/index.js | 2 +-
server/services/routing/client.js | 2 +-
server/services/routing/index.js | 2 +-
server/services/routing/lib/rule-engine.js | 2 +-
server/services/routing/mailRpc/index.js | 2 +-
server/services/routing/model/agent.js | 2 +-
server/services/routing/model/chatQueue.js | 2 +-
server/services/routing/model/faxQueue.js | 2 +-
server/services/routing/model/interval.js | 2 +-
server/services/routing/model/mailQueue.js | 2 +-
server/services/routing/model/openchannelQueue.js | 2 +-
server/services/routing/model/smsQueue.js | 2 +-
server/services/routing/model/whatsappQueue.js | 2 +-
server/services/routing/realtime/index.js | 2 +-
server/services/routing/rpc/chatInteraction.js | 2 +-
server/services/routing/rpc/chatMessage.js | 2 +-
server/services/routing/rpc/chatQueue.js | 2 +-
server/services/routing/rpc/chatQueueReport.js | 2 +-
server/services/routing/rpc/faxInteraction.js | 2 +-
server/services/routing/rpc/faxMessage.js | 2 +-
server/services/routing/rpc/faxQueue.js | 2 +-
server/services/routing/rpc/faxQueueReport.js | 2 +-
server/services/routing/rpc/interval.js | 2 +-
server/services/routing/rpc/mailInteraction.js | 2 +-
server/services/routing/rpc/mailMessage.js | 2 +-
server/services/routing/rpc/mailQueue.js | 2 +-
server/services/routing/rpc/mailQueueReport.js | 2 +-
.../services/routing/rpc/openchannelInteraction.js | 2 +-
server/services/routing/rpc/openchannelMessage.js | 2 +-
server/services/routing/rpc/openchannelQueue.js | 2 +-
.../services/routing/rpc/openchannelQueueReport.js | 2 +-
server/services/routing/rpc/smsInteraction.js | 2 +-
server/services/routing/rpc/smsMessage.js | 2 +-
server/services/routing/rpc/smsQueue.js | 2 +-
server/services/routing/rpc/smsQueueReport.js | 2 +-
server/services/routing/rpc/user.js | 2 +-
server/services/routing/rpc/whatsappInteraction.js | 2 +-
server/services/routing/rpc/whatsappMessage.js | 2 +-
server/services/routing/rpc/whatsappQueue.js | 2 +-
server/services/routing/rpc/whatsappQueueReport.js | 2 +-
.../services/routing/server/applications/agent.js | 2 +-
.../routing/server/applications/amazonlex.js | 2 +-
.../routing/server/applications/autoreply.js | 2 +-
.../services/routing/server/applications/close.js | 2 +-
.../routing/server/applications/dialogflow.js | 2 +-
.../routing/server/applications/dialogflowV2.js | 2 +-
.../services/routing/server/applications/gotoif.js | 2 +-
.../services/routing/server/applications/gotop.js | 2 +-
.../routing/server/applications/message.js | 2 +-
.../services/routing/server/applications/noop.js | 2 +-
.../services/routing/server/applications/queue.js | 2 +-
.../routing/server/applications/strategy/agent.js | 2 +-
.../server/applications/strategy/beepall.js | 2 +-
.../routing/server/applications/strategy/index.js | 2 +-
.../server/applications/strategy/rrmemory.js | 2 +-
.../routing/server/applications/strategy/util.js | 2 +-
.../services/routing/server/applications/system.js | 2 +-
server/services/routing/server/applications/tag.js | 2 +-
.../services/routing/server/applications/tvox.js | 2 +-
.../services/routing/server/applications/utils.js | 2 +-
server/services/routing/server/index.js | 2 +-
server/services/routing/server/interval.js | 2 +-
server/services/xdr/agents.controller.js | 2 +-
server/services/xdr/calls.controller.js | 2 +-
server/services/xdr/core.controller.js | 2 +-
server/services/xdr/dials.controller.js | 2 +-
server/services/xdr/index.js | 2 +-
server/services/xdr/members.controller.js | 2 +-
server/services/xdr/queues.controller.js | 2 +-
server/services/xdr/recordings.controller.js | 2 +-
server/services/xdr/transfers.controller.js | 2 +-
server/services/xdr/utils.js | 2 +-
1157 files changed, 1157 insertions(+), 1157 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 5992fe2..b834d9f 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-31T18:41:03.692Z",
+ "time": "2021-10-31T21:22:38.786Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 60de990..ff26f53 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-10-31T18:41:03.692Z",
+ "time": "2021-10-31T21:22:38.786Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/public/app/main/apps/staff/i18n/en.json b/public/app/main/apps/staff/i18n/en.json
index 9edf2f3..6fe6483 100644
--- a/public/app/main/apps/staff/i18n/en.json
+++ b/public/app/main/apps/staff/i18n/en.json
@@ -112,7 +112,7 @@
"ALLOWCODECS": "Allowed Codecs",
"DISABLED": "Deactivated",
"BLOCKED": "Locked",
- "AD_SSO_ENABLED": "Active Directory SSO Enabled",
+ "AD_SSO_ENABLED": "Active Directory SSO",
"AUTHENTICATION": "Authentication",
"HELP": {
"DISABLED": "select to deactivate / unselect to reactivate",
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index cd140d0..c189604 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 _0x7eff=['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]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xf7ef('0x0')]={'name':{'type':Sequelize[_0xf7ef('0x1')],'get':function(_0x2d6db5){return this['getDataValue'](_0xf7ef('0x2'));}},'action':{'type':Sequelize[_0xf7ef('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf7ef('0x4'),_0xf7ef('0x5'),'motionbar','jscripty',_0xf7ef('0x6'),_0xf7ef('0x7'),_0xf7ef('0x8'),_0xf7ef('0x9')]],'msg':_0xf7ef('0xa')}},'comment':_0xf7ef('0xa')},'data1':{'type':Sequelize[_0xf7ef('0x3')](0x1000),'comment':_0xf7ef('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xf7ef('0xc')},'data3':{'type':Sequelize[_0xf7ef('0x3')](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[_0xf7ef('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xf7ef('0xd')},'data6':{'type':Sequelize['STRING'],'comments':_0xf7ef('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}};
\ No newline at end of file
+var _0x4803=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','VIRTUAL','action','contactManager','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','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)]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4803,0x137));var _0x3480=function(_0x26b814,_0x35f2b1){_0x26b814=_0x26b814-0x0;var _0x428cbd=_0x4803[_0x26b814];return _0x428cbd;};'use strict';var Sequelize=require(_0x3480('0x0'));module['exports']={'name':{'type':Sequelize[_0x3480('0x1')],'get':function(_0x221297){return this['getDataValue'](_0x3480('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3480('0x3'),'integration',_0x3480('0x4'),'jscripty',_0x3480('0x5'),_0x3480('0x6'),_0x3480('0x7'),_0x3480('0x8')]],'msg':_0x3480('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x3480('0xa')](0x1000),'comment':_0x3480('0xb')},'data2':{'type':Sequelize[_0x3480('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x3480('0xa')](0x1000),'comment':_0x3480('0xc')},'data4':{'type':Sequelize[_0x3480('0xa')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x3480('0xa')](0x1000),'comments':_0x3480('0xd')},'data6':{'type':Sequelize[_0x3480('0xa')],'comments':_0x3480('0xe')},'data7':{'type':Sequelize[_0x3480('0xf')],'comments':_0x3480('0x10')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index aa0ef07..f32438c 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 _0x19d4=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','name','send','update','body','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xb89ac4,_0x29849a){var _0x2a26b4=function(_0x2ada35){while(--_0x2ada35){_0xb89ac4['push'](_0xb89ac4['shift']());}};_0x2a26b4(++_0x29849a);}(_0x19d4,0x110));var _0x419d=function(_0x4c13a0,_0x3ba38a){_0x4c13a0=_0x4c13a0-0x0;var _0x37dbb5=_0x19d4[_0x4c13a0];return _0x37dbb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x419d('0x0'));var zipdir=require(_0x419d('0x1'));var jsonpatch=require(_0x419d('0x2'));var rp=require('request-promise');var moment=require(_0x419d('0x3'));var BPromise=require(_0x419d('0x4'));var Mustache=require(_0x419d('0x5'));var util=require(_0x419d('0x6'));var path=require(_0x419d('0x7'));var sox=require(_0x419d('0x8'));var csv=require(_0x419d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x419d('0xa'));var _=require(_0x419d('0xb'));var squel=require(_0x419d('0xc'));var crypto=require(_0x419d('0xd'));var jsforce=require(_0x419d('0xe'));var deskjs=require(_0x419d('0xf'));var toCsv=require(_0x419d('0x9'));var querystring=require(_0x419d('0x10'));var Papa=require(_0x419d('0x11'));var Redis=require(_0x419d('0x12'));var authService=require(_0x419d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x419d('0x14'));var hardwareService=require(_0x419d('0x15'));var logger=require('../../config/logger')(_0x419d('0x16'));var utils=require('../../config/utils');var config=require(_0x419d('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32fdb9,_0x140b5d){_0x140b5d=_0x140b5d||0xcc;return function(_0x3d75b6){if(_0x3d75b6){return _0x32fdb9[_0x419d('0x18')](_0x140b5d);}return _0x32fdb9[_0x419d('0x19')](_0x140b5d)[_0x419d('0x1a')]();};}function respondWithResult(_0x477e64,_0xf105c3){_0xf105c3=_0xf105c3||0xc8;return function(_0xac5823){if(_0xac5823){return _0x477e64[_0x419d('0x19')](_0xf105c3)[_0x419d('0x1b')](_0xac5823);}};}function respondWithFilteredResult(_0x335d07,_0x4a6ae0){return function(_0x2a3804){if(_0x2a3804){var _0x3d4c4c=typeof _0x4a6ae0[_0x419d('0x1c')]===_0x419d('0x1d')&&typeof _0x4a6ae0['limit']===_0x419d('0x1d');var _0x6f12da=_0x2a3804[_0x419d('0x1e')];var _0x1af614=_0x3d4c4c?0x0:_0x4a6ae0[_0x419d('0x1c')];var _0x1294fb=_0x3d4c4c?_0x2a3804['count']:_0x4a6ae0[_0x419d('0x1c')]+_0x4a6ae0[_0x419d('0x1f')];var _0x448c8f;if(_0x1294fb>=_0x6f12da){_0x1294fb=_0x6f12da;_0x448c8f=0xc8;}else{_0x448c8f=0xce;}_0x335d07['status'](_0x448c8f);return _0x335d07[_0x419d('0x20')](_0x419d('0x21'),_0x1af614+'-'+_0x1294fb+'/'+_0x6f12da)['json'](_0x2a3804);}return null;};}function patchUpdates(_0x529d59){return function(_0x483ce9){try{jsonpatch[_0x419d('0x22')](_0x483ce9,_0x529d59,!![]);}catch(_0x1f7b9c){return BPromise[_0x419d('0x23')](_0x1f7b9c);}return _0x483ce9[_0x419d('0x24')]();};}function saveUpdates(_0x1ba2cc,_0x305b26){return function(_0x9a8dd4){if(_0x9a8dd4){return _0x9a8dd4['update'](_0x1ba2cc)[_0x419d('0x25')](function(_0x39ca43){return _0x39ca43;});}return null;};}function removeEntity(_0x81763d,_0x590e36){return function(_0x3b425e){if(_0x3b425e){return _0x3b425e[_0x419d('0x26')]()['then'](function(){_0x81763d[_0x419d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353d70,_0x1784c7){return function(_0x877122){if(!_0x877122){_0x353d70[_0x419d('0x18')](0x194);}return _0x877122;};}function handleError(_0x45f565,_0xa7bd59){_0xa7bd59=_0xa7bd59||0x1f4;return function(_0xaabd64){logger['error'](_0xaabd64['stack']);if(_0xaabd64[_0x419d('0x27')]){delete _0xaabd64[_0x419d('0x27')];}_0x45f565[_0x419d('0x19')](_0xa7bd59)[_0x419d('0x28')](_0xaabd64);};}exports[_0x419d('0x29')]=function(_0x5aa0f6,_0x522cf9){if(_0x5aa0f6[_0x419d('0x2a')]['id']){delete _0x5aa0f6[_0x419d('0x2a')]['id'];}return db[_0x419d('0x2b')][_0x419d('0x2c')]({'where':{'id':_0x5aa0f6[_0x419d('0x2d')]['id']}})[_0x419d('0x25')](handleEntityNotFound(_0x522cf9,null))[_0x419d('0x25')](saveUpdates(_0x5aa0f6[_0x419d('0x2a')],null))['then'](respondWithResult(_0x522cf9,null))['catch'](handleError(_0x522cf9,null));};exports['destroy']=function(_0x25ca8a,_0x261a86){return db['Action'][_0x419d('0x2c')]({'where':{'id':_0x25ca8a[_0x419d('0x2d')]['id']}})[_0x419d('0x25')](handleEntityNotFound(_0x261a86,null))['then'](removeEntity(_0x261a86,null))[_0x419d('0x2e')](handleError(_0x261a86,null));};
\ No newline at end of file
+var _0x1a45=['undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','body','Action','params','then','catch','find','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset'];(function(_0x5f1dd9,_0x59871c){var _0x54579a=function(_0x267eaa){while(--_0x267eaa){_0x5f1dd9['push'](_0x5f1dd9['shift']());}};_0x54579a(++_0x59871c);}(_0x1a45,0x6a));var _0x51a4=function(_0x48526c,_0x26df5e){_0x48526c=_0x48526c-0x0;var _0x1a09a1=_0x1a45[_0x48526c];return _0x1a09a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x51a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51a4('0x1'));var moment=require(_0x51a4('0x2'));var BPromise=require(_0x51a4('0x3'));var Mustache=require(_0x51a4('0x4'));var util=require(_0x51a4('0x5'));var path=require(_0x51a4('0x6'));var sox=require(_0x51a4('0x7'));var csv=require(_0x51a4('0x8'));var ejs=require(_0x51a4('0x9'));var fs=require('fs');var fs_extra=require(_0x51a4('0xa'));var _=require(_0x51a4('0xb'));var squel=require(_0x51a4('0xc'));var crypto=require(_0x51a4('0xd'));var jsforce=require(_0x51a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x51a4('0x8'));var querystring=require('querystring');var Papa=require(_0x51a4('0xf'));var Redis=require(_0x51a4('0x10'));var authService=require(_0x51a4('0x11'));var qs=require(_0x51a4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x51a4('0x13'));var config=require(_0x51a4('0x14'));var licenseUtil=require(_0x51a4('0x15'));var db=require(_0x51a4('0x16'))['db'];function respondWithStatusCode(_0x59f691,_0x337aa5){_0x337aa5=_0x337aa5||0xcc;return function(_0x84d744){if(_0x84d744){return _0x59f691['sendStatus'](_0x337aa5);}return _0x59f691[_0x51a4('0x17')](_0x337aa5)[_0x51a4('0x18')]();};}function respondWithResult(_0x50dd59,_0x11242f){_0x11242f=_0x11242f||0xc8;return function(_0x219059){if(_0x219059){return _0x50dd59[_0x51a4('0x17')](_0x11242f)['json'](_0x219059);}};}function respondWithFilteredResult(_0xb14455,_0x43b6dd){return function(_0x5049fa){if(_0x5049fa){var _0x49a45f=typeof _0x43b6dd[_0x51a4('0x19')]===_0x51a4('0x1a')&&typeof _0x43b6dd[_0x51a4('0x1b')]===_0x51a4('0x1a');var _0x5da166=_0x5049fa['count'];var _0x38e6b9=_0x49a45f?0x0:_0x43b6dd['offset'];var _0x1be7fd=_0x49a45f?_0x5049fa[_0x51a4('0x1c')]:_0x43b6dd['offset']+_0x43b6dd['limit'];var _0x2a4745;if(_0x1be7fd>=_0x5da166){_0x1be7fd=_0x5da166;_0x2a4745=0xc8;}else{_0x2a4745=0xce;}_0xb14455[_0x51a4('0x17')](_0x2a4745);return _0xb14455['set'](_0x51a4('0x1d'),_0x38e6b9+'-'+_0x1be7fd+'/'+_0x5da166)['json'](_0x5049fa);}return null;};}function patchUpdates(_0x4dc894){return function(_0x546ba5){try{jsonpatch[_0x51a4('0x1e')](_0x546ba5,_0x4dc894,!![]);}catch(_0x566f69){return BPromise[_0x51a4('0x1f')](_0x566f69);}return _0x546ba5[_0x51a4('0x20')]();};}function saveUpdates(_0x16393d,_0x244bfc){return function(_0xa4c102){if(_0xa4c102){return _0xa4c102[_0x51a4('0x21')](_0x16393d)['then'](function(_0x43b753){return _0x43b753;});}return null;};}function removeEntity(_0x49b697,_0x1863a2){return function(_0x4bc066){if(_0x4bc066){return _0x4bc066[_0x51a4('0x22')]()['then'](function(){_0x49b697[_0x51a4('0x17')](0xcc)[_0x51a4('0x18')]();});}};}function handleEntityNotFound(_0x4b73b8,_0x3421d9){return function(_0x54e3ee){if(!_0x54e3ee){_0x4b73b8['sendStatus'](0x194);}return _0x54e3ee;};}function handleError(_0x113c59,_0x12f0f8){_0x12f0f8=_0x12f0f8||0x1f4;return function(_0x52bed3){logger[_0x51a4('0x23')](_0x52bed3[_0x51a4('0x24')]);if(_0x52bed3[_0x51a4('0x25')]){delete _0x52bed3[_0x51a4('0x25')];}_0x113c59[_0x51a4('0x17')](_0x12f0f8)['send'](_0x52bed3);};}exports[_0x51a4('0x21')]=function(_0x224e1b,_0x1c3e9b){if(_0x224e1b[_0x51a4('0x26')]['id']){delete _0x224e1b[_0x51a4('0x26')]['id'];}return db[_0x51a4('0x27')]['find']({'where':{'id':_0x224e1b[_0x51a4('0x28')]['id']}})[_0x51a4('0x29')](handleEntityNotFound(_0x1c3e9b,null))['then'](saveUpdates(_0x224e1b['body'],null))[_0x51a4('0x29')](respondWithResult(_0x1c3e9b,null))[_0x51a4('0x2a')](handleError(_0x1c3e9b,null));};exports['destroy']=function(_0x33696f,_0x85b097){return db[_0x51a4('0x27')][_0x51a4('0x2b')]({'where':{'id':_0x33696f['params']['id']}})[_0x51a4('0x29')](handleEntityNotFound(_0x85b097,null))['then'](removeEntity(_0x85b097,null))[_0x51a4('0x2a')](handleError(_0x85b097,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 58ee0a4..be12776 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 _0xe007=['lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./action.attributes'];(function(_0x32076a,_0x1b8c0c){var _0x382196=function(_0x42e557){while(--_0x42e557){_0x32076a['push'](_0x32076a['shift']());}};_0x382196(++_0x1b8c0c);}(_0xe007,0xe7));var _0x7e00=function(_0x4448e2,_0x215d51){_0x4448e2=_0x4448e2-0x0;var _0x1b5648=_0xe007[_0x4448e2];return _0x1b5648;};'use strict';var _=require(_0x7e00('0x0'));var util=require('util');var logger=require(_0x7e00('0x1'))(_0x7e00('0x2'));var moment=require('moment');var BPromise=require(_0x7e00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e00('0x4'));var config=require(_0x7e00('0x5'));var attributes=require(_0x7e00('0x6'));module['exports']=function(_0x4db8c2,_0x5c0c13){return _0x4db8c2['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d89=['define','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x13b3e7,_0x29c10f){var _0x1d0106=function(_0x201048){while(--_0x201048){_0x13b3e7['push'](_0x13b3e7['shift']());}};_0x1d0106(++_0x29c10f);}(_0x1d89,0x18f));var _0x91d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x91d8('0x0'));var util=require('util');var logger=require(_0x91d8('0x1'))(_0x91d8('0x2'));var moment=require(_0x91d8('0x3'));var BPromise=require(_0x91d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x91d8('0x5'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x2940a8,_0x4cdfed){return _0x2940a8[_0x91d8('0x6')](_0x91d8('0x7'),attributes,{'tableName':_0x91d8('0x8'),'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 08ed9c8..2f3b053 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x2bae5f,_0x8ac4f7){var _0x3714e5=function(_0x59397e){while(--_0x59397e){_0x2bae5f['push'](_0x2bae5f['shift']());}};_0x3714e5(++_0x8ac4f7);}(_0x5fc3,0xa8));var _0x35fc=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x5fc3[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
+var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x28b805,_0x10554a){_0x28b805=_0x28b805-0x0;var _0x231b70=_0x1cb9[_0x28b805];return _0x231b70;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 77ff1f8..bf170d8 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 _0x6f18=['/:id','isAuthenticated','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','put'];(function(_0x1872bb,_0x139eff){var _0x8566be=function(_0x1c663c){while(--_0x1c663c){_0x1872bb['push'](_0x1872bb['shift']());}};_0x8566be(++_0x139eff);}(_0x6f18,0x1e6));var _0x86f1=function(_0x197825,_0x3d056e){_0x197825=_0x197825-0x0;var _0x3714b3=_0x6f18[_0x197825];return _0x3714b3;};'use strict';var multer=require(_0x86f1('0x0'));var util=require(_0x86f1('0x1'));var path=require(_0x86f1('0x2'));var timeout=require('connect-timeout');var express=require(_0x86f1('0x3'));var router=express[_0x86f1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x86f1('0x5'));var config=require(_0x86f1('0x6'));var controller=require('./action.controller');router[_0x86f1('0x7')](_0x86f1('0x8'),auth[_0x86f1('0x9')](),controller[_0x86f1('0xa')]);router[_0x86f1('0xb')](_0x86f1('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x86f1('0xc')]=router;
\ No newline at end of file
+var _0x15c7=['put','/:id','isAuthenticated','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x52b408,_0x22fe7e){var _0x403deb=function(_0x13defa){while(--_0x13defa){_0x52b408['push'](_0x52b408['shift']());}};_0x403deb(++_0x22fe7e);}(_0x15c7,0xa1));var _0x715c=function(_0x158424,_0x3081a7){_0x158424=_0x158424-0x0;var _0x4948d8=_0x15c7[_0x158424];return _0x4948d8;};'use strict';var multer=require(_0x715c('0x0'));var util=require('util');var path=require(_0x715c('0x1'));var timeout=require('connect-timeout');var express=require(_0x715c('0x2'));var router=express['Router']();var fs_extra=require(_0x715c('0x3'));var auth=require(_0x715c('0x4'));var interaction=require(_0x715c('0x5'));var config=require(_0x715c('0x6'));var controller=require('./action.controller');router[_0x715c('0x7')](_0x715c('0x8'),auth[_0x715c('0x9')](),controller['update']);router['delete'](_0x715c('0x8'),auth['isAuthenticated'](),controller[_0x715c('0xa')]);module[_0x715c('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 958f834..a6f83de 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 _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xdc97,0x13b));var _0x7dc9=function(_0x5c139d,_0x3ccbb4){_0x5c139d=_0x5c139d-0x0;var _0x1ca9a5=_0xdc97[_0x5c139d];return _0x1ca9a5;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x5bfb4d,_0x44a0eb){var _0x128703=function(_0xaf0134){while(--_0xaf0134){_0x5bfb4d['push'](_0x5bfb4d['shift']());}};_0x128703(++_0x44a0eb);}(_0xd8fb,0x99));var _0xbd8f=function(_0x3f8b7b,_0x53f0b7){_0x3f8b7b=_0x3f8b7b-0x0;var _0x313cd7=_0xd8fb[_0x3f8b7b];return _0x313cd7;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index abd9ba2..08c39fe 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 _0xdb8d=['bluebird','util','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','AnalyticCustomReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','map','filter','merge','includeAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','autoAssociation','CustomReports','preview','join','left_join','COUNT(%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)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','options','getFields','ValidationErrorItem','AnalyticMetric','findAll','keyBy','from','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','right_join','cross_join','SUM(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','Sequelize','select','function','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','fork','../../files/reports','savename','countTable','SELECT','QueryTypes','runReport','Please\x20insert\x20at\x20least\x20one\x20field','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xbcf185,_0x251002){var _0x2ae4de=function(_0x26f5d2){while(--_0x26f5d2){_0xbcf185['push'](_0xbcf185['shift']());}};_0x2ae4de(++_0x251002);}(_0xdb8d,0x136));var _0xddb8=function(_0x28bcbc,_0x30ec21){_0x28bcbc=_0x28bcbc-0x0;var _0x3a814e=_0xdb8d[_0x28bcbc];return _0x3a814e;};'use strict';var emlformat=require(_0xddb8('0x0'));var rimraf=require(_0xddb8('0x1'));var zipdir=require(_0xddb8('0x2'));var jsonpatch=require(_0xddb8('0x3'));var rp=require(_0xddb8('0x4'));var moment=require(_0xddb8('0x5'));var BPromise=require(_0xddb8('0x6'));var Mustache=require('mustache');var util=require(_0xddb8('0x7'));var path=require('path');var sox=require(_0xddb8('0x8'));var csv=require('to-csv');var ejs=require(_0xddb8('0x9'));var fs=require('fs');var fs_extra=require(_0xddb8('0xa'));var _=require('lodash');var squel=require(_0xddb8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xddb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0xddb8('0xd'));var Papa=require(_0xddb8('0xe'));var Redis=require(_0xddb8('0xf'));var authService=require(_0xddb8('0x10'));var qs=require(_0xddb8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xddb8('0x12'));var utils=require('../../config/utils');var config=require(_0xddb8('0x13'));var licenseUtil=require(_0xddb8('0x14'));var db=require(_0xddb8('0x15'))['db'];var dbH=require(_0xddb8('0x15'))[_0xddb8('0x16')];function respondWithStatusCode(_0x10cb5d,_0x1a0087){_0x1a0087=_0x1a0087||0xcc;return function(_0x102fea){if(_0x102fea){return _0x10cb5d[_0xddb8('0x17')](_0x1a0087);}return _0x10cb5d[_0xddb8('0x18')](_0x1a0087)[_0xddb8('0x19')]();};}function respondWithResult(_0x1d328c,_0x535010){_0x535010=_0x535010||0xc8;return function(_0x41e27a){if(_0x41e27a){return _0x1d328c[_0xddb8('0x18')](_0x535010)[_0xddb8('0x1a')](_0x41e27a);}};}function respondWithFilteredResult(_0x14bf86,_0x3ccd41){return function(_0x197da8){if(_0x197da8){var _0x4ad260=typeof _0x3ccd41[_0xddb8('0x1b')]==='undefined'&&typeof _0x3ccd41[_0xddb8('0x1c')]===_0xddb8('0x1d');var _0x55c8dc=_0x197da8['count'];var _0x540ad3=_0x4ad260?0x0:_0x3ccd41[_0xddb8('0x1b')];var _0x53b88f=_0x4ad260?_0x197da8[_0xddb8('0x1e')]:_0x3ccd41[_0xddb8('0x1b')]+_0x3ccd41['limit'];var _0x601cf6;if(_0x53b88f>=_0x55c8dc){_0x53b88f=_0x55c8dc;_0x601cf6=0xc8;}else{_0x601cf6=0xce;}_0x14bf86['status'](_0x601cf6);return _0x14bf86['set'](_0xddb8('0x1f'),_0x540ad3+'-'+_0x53b88f+'/'+_0x55c8dc)['json'](_0x197da8);}return null;};}function patchUpdates(_0x4b2ced){return function(_0x35d7d5){try{jsonpatch['apply'](_0x35d7d5,_0x4b2ced,!![]);}catch(_0x43b8f6){return BPromise[_0xddb8('0x20')](_0x43b8f6);}return _0x35d7d5[_0xddb8('0x21')]();};}function saveUpdates(_0x33bea7,_0x21b663){return function(_0xf20cd6){if(_0xf20cd6){return _0xf20cd6[_0xddb8('0x22')](_0x33bea7)[_0xddb8('0x23')](function(_0x4a4a94){return _0x4a4a94;});}return null;};}function removeEntity(_0x410a07,_0x50f303){return function(_0x6b8550){if(_0x6b8550){return _0x6b8550[_0xddb8('0x24')]()['then'](function(){var _0xedaaff=_0x6b8550[_0xddb8('0x25')]({'plain':!![]});var _0xa3411c='CustomReports';return db[_0xddb8('0x26')][_0xddb8('0x24')]({'where':{'type':_0xa3411c,'resourceId':_0xedaaff['id']}})[_0xddb8('0x23')](function(){return _0x6b8550;});})['then'](function(){_0x410a07[_0xddb8('0x18')](0xcc)[_0xddb8('0x19')]();});}};}function handleEntityNotFound(_0x5cf747,_0x2dd540){return function(_0x25ca12){if(!_0x25ca12){_0x5cf747[_0xddb8('0x17')](0x194);}return _0x25ca12;};}function handleError(_0x527462,_0x41577f){_0x41577f=_0x41577f||0x1f4;return function(_0x14bed6){logger[_0xddb8('0x27')](_0x14bed6[_0xddb8('0x28')]);if(_0x14bed6['name']){delete _0x14bed6[_0xddb8('0x29')];}_0x527462[_0xddb8('0x18')](_0x41577f)['send'](_0x14bed6);};}exports[_0xddb8('0x2a')]=function(_0xfd64b5,_0x521757){var _0xf0dc9d={},_0x4efe56={},_0x110614={'count':0x0,'rows':[]};var _0xfd41ca=_['map'](db[_0xddb8('0x2b')][_0xddb8('0x2c')],function(_0x244c9c){return{'name':_0x244c9c['fieldName'],'type':_0x244c9c[_0xddb8('0x2d')][_0xddb8('0x2e')]};});_0x4efe56[_0xddb8('0x2f')]=_['map'](_0xfd41ca,_0xddb8('0x29'));_0x4efe56[_0xddb8('0x30')]=_['keys'](_0xfd64b5[_0xddb8('0x30')]);_0x4efe56[_0xddb8('0x31')]=_[_0xddb8('0x32')](_0x4efe56[_0xddb8('0x2f')],_0x4efe56['query']);_0xf0dc9d[_0xddb8('0x33')]=_[_0xddb8('0x32')](_0x4efe56[_0xddb8('0x2f')],qs[_0xddb8('0x34')](_0xfd64b5[_0xddb8('0x30')]['fields']));_0xf0dc9d[_0xddb8('0x33')]=_0xf0dc9d[_0xddb8('0x33')][_0xddb8('0x35')]?_0xf0dc9d[_0xddb8('0x33')]:_0x4efe56['model'];if(!_0xfd64b5[_0xddb8('0x30')]['hasOwnProperty']('nolimit')){_0xf0dc9d[_0xddb8('0x1c')]=qs[_0xddb8('0x1c')](_0xfd64b5['query'][_0xddb8('0x1c')]);_0xf0dc9d[_0xddb8('0x1b')]=qs['offset'](_0xfd64b5[_0xddb8('0x30')]['offset']);}_0xf0dc9d[_0xddb8('0x36')]=qs[_0xddb8('0x37')](_0xfd64b5[_0xddb8('0x30')]['sort']);_0xf0dc9d[_0xddb8('0x38')]=qs['filters'](_[_0xddb8('0x39')](_0xfd64b5[_0xddb8('0x30')],_0x4efe56[_0xddb8('0x31')]),_0xfd41ca);if(_0xfd64b5[_0xddb8('0x30')]['filter']){_0xf0dc9d['where']=_['merge'](_0xf0dc9d['where'],{'$or':_[_0xddb8('0x3a')](_0xfd41ca,function(_0x5fdaeb){if(_0x5fdaeb['type']!=='VIRTUAL'){var _0xffa075={};_0xffa075[_0x5fdaeb[_0xddb8('0x29')]]={'$like':'%'+_0xfd64b5[_0xddb8('0x30')][_0xddb8('0x3b')]+'%'};return _0xffa075;}})});}_0xf0dc9d=_[_0xddb8('0x3c')]({},_0xf0dc9d,_0xfd64b5['options']);var _0x21884c={'where':_0xf0dc9d[_0xddb8('0x38')]};return db['AnalyticCustomReport'][_0xddb8('0x1e')](_0x21884c)[_0xddb8('0x23')](function(_0xbf27ef){_0x110614[_0xddb8('0x1e')]=_0xbf27ef;if(_0xfd64b5[_0xddb8('0x30')][_0xddb8('0x3d')]){_0xf0dc9d['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0xf0dc9d);})[_0xddb8('0x23')](function(_0x2b4b47){_0x110614[_0xddb8('0x3e')]=_0x2b4b47;return _0x110614;})[_0xddb8('0x23')](respondWithFilteredResult(_0x521757,_0xf0dc9d))[_0xddb8('0x3f')](handleError(_0x521757,null));};exports[_0xddb8('0x40')]=function(_0x3a89b8,_0x1e8bd1){var _0x395b51={'raw':![],'where':{'id':_0x3a89b8[_0xddb8('0x41')]['id']}},_0x4e5786={};_0x4e5786[_0xddb8('0x2f')]=_['keys'](db['AnalyticCustomReport'][_0xddb8('0x2c')]);_0x4e5786[_0xddb8('0x30')]=_[_0xddb8('0x42')](_0x3a89b8[_0xddb8('0x30')]);_0x4e5786['filters']=_[_0xddb8('0x32')](_0x4e5786[_0xddb8('0x2f')],_0x4e5786[_0xddb8('0x30')]);_0x395b51[_0xddb8('0x33')]=_[_0xddb8('0x32')](_0x4e5786['model'],qs[_0xddb8('0x34')](_0x3a89b8['query'][_0xddb8('0x34')]));_0x395b51[_0xddb8('0x33')]=_0x395b51['attributes'][_0xddb8('0x35')]?_0x395b51['attributes']:_0x4e5786[_0xddb8('0x2f')];if(_0x3a89b8['query'][_0xddb8('0x3d')]){_0x395b51[_0xddb8('0x43')]=[{'all':!![]}];}_0x395b51=_['merge']({},_0x395b51,_0x3a89b8['options']);return db[_0xddb8('0x2b')]['find'](_0x395b51)['then'](handleEntityNotFound(_0x1e8bd1,null))[_0xddb8('0x23')](respondWithResult(_0x1e8bd1,null))[_0xddb8('0x3f')](handleError(_0x1e8bd1,null));};exports[_0xddb8('0x44')]=function(_0x1bede5,_0xd6b198){return db[_0xddb8('0x2b')][_0xddb8('0x44')](_0x1bede5[_0xddb8('0x45')],{})[_0xddb8('0x23')](function(_0x26b648){var _0x5bfca9=_0x1bede5[_0xddb8('0x46')][_0xddb8('0x25')]({'plain':!![]});if(!_0x5bfca9)throw new Error(_0xddb8('0x47'));if(_0x5bfca9[_0xddb8('0x48')]===_0xddb8('0x46')){var _0xd807f7=_0x26b648[_0xddb8('0x25')]({'plain':!![]});var _0x354766=_0xddb8('0x49');return db[_0xddb8('0x4a')][_0xddb8('0x4b')]({'where':{'name':_0x354766,'userProfileId':_0x5bfca9['userProfileId']},'raw':!![]})['then'](function(_0x5e4ab6){if(_0x5e4ab6&&_0x5e4ab6[_0xddb8('0x4c')]===0x0){return db[_0xddb8('0x26')]['create']({'name':_0xd807f7[_0xddb8('0x29')],'resourceId':_0xd807f7['id'],'type':_0xddb8('0x4d'),'sectionId':_0x5e4ab6['id']},{})['then'](function(){return _0x26b648;});}else{return _0x26b648;}})['catch'](function(_0x4566bd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4566bd);throw _0x4566bd;});}return _0x26b648;})[_0xddb8('0x23')](respondWithResult(_0xd6b198,0xc9))[_0xddb8('0x3f')](handleError(_0xd6b198,null));};exports[_0xddb8('0x22')]=function(_0x44c962,_0x4a5000){if(_0x44c962['body']['id']){delete _0x44c962[_0xddb8('0x45')]['id'];}return db[_0xddb8('0x2b')][_0xddb8('0x4b')]({'where':{'id':_0x44c962['params']['id']}})[_0xddb8('0x23')](handleEntityNotFound(_0x4a5000,null))['then'](saveUpdates(_0x44c962[_0xddb8('0x45')],null))[_0xddb8('0x23')](respondWithResult(_0x4a5000,null))[_0xddb8('0x3f')](handleError(_0x4a5000,null));};exports['destroy']=function(_0x5a99c3,_0xd8e2b8){return db[_0xddb8('0x2b')]['find']({'where':{'id':_0x5a99c3['params']['id']}})[_0xddb8('0x23')](handleEntityNotFound(_0xd8e2b8,null))[_0xddb8('0x23')](removeEntity(_0xd8e2b8,null))['catch'](handleError(_0xd8e2b8,null));};exports[_0xddb8('0x4e')]=function(_0x300749,_0x5da048){var _0x5cfbb2=0xa;var _0x4687bd=[_0xddb8('0x4f'),_0xddb8('0x50'),'right_join','cross_join'];var _0xcee83={'SUM':'SUM(%s)','COUNT':_0xddb8('0x51'),'COUNT DISTINCT':_0xddb8('0x52'),'MAX':_0xddb8('0x53'),'MIN':_0xddb8('0x54'),'AVG':_0xddb8('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xddb8('0x56'),'GROUP_CONCAT DESC':_0xddb8('0x57')};var _0x13bc0e={'SEC_TO_TIME':_0xddb8('0x58'),'DATE':_0xddb8('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xddb8('0x5a'),'UNIX_TIMESTAMP':_0xddb8('0x5b')};var _0x46318a=function(_0x3d61cf){return!_[_0xddb8('0x5c')]([_0xddb8('0x5d'),_0xddb8('0x5e'),'IS\x20EMPTY',_0xddb8('0x5f')],_0x3d61cf);};var _0x1d18fc=function(_0x2c9222){if(!_0x2c9222||!_0x2c9222[_0xddb8('0x60')][_0xddb8('0x35')]){return'';}for(var _0x266de0='(',_0x3d19ba=0x0;_0x3d19ba<_0x2c9222[_0xddb8('0x60')][_0xddb8('0x35')];_0x3d19ba+=0x1){_0x3d19ba>0x0&&(_0x266de0+='\x20'+_0x2c9222[_0xddb8('0x61')]+'\x20');_0x266de0+=_0x2c9222[_0xddb8('0x60')][_0x3d19ba][_0xddb8('0x62')]?_0x1d18fc(_0x2c9222[_0xddb8('0x60')][_0x3d19ba][_0xddb8('0x62')]):_0x2c9222[_0xddb8('0x60')][_0x3d19ba][_0xddb8('0x63')]+'\x20'+_0x2c9222['rules'][_0x3d19ba][_0xddb8('0x64')]+(_0x46318a(_0x2c9222['rules'][_0x3d19ba]['condition'])?'\x20'+_0x2c9222[_0xddb8('0x60')][_0x3d19ba]['value']:'');}return _0x266de0+')';};var _0x499fa7={'where':{'id':_0x300749[_0xddb8('0x41')]['id']}},_0x2c7f9b,_0x49fb8a,_0x249d0f,_0x1e46a9,_0x581fcd;_0x499fa7=_[_0xddb8('0x3c')]({},_0x499fa7,_0x300749[_0xddb8('0x65')]);return db[_0xddb8('0x2b')][_0xddb8('0x4b')](_0x499fa7)[_0xddb8('0x23')](function(_0x26e13e){if(_0x26e13e){_0x2c7f9b=_0x26e13e;return _0x26e13e[_0xddb8('0x66')]();}return null;})['then'](function(_0x13afac){if(_0x13afac){if(!_0x13afac['length']){throw new db['Sequelize'][(_0xddb8('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x49fb8a=_0x13afac;return db[_0xddb8('0x68')][_0xddb8('0x69')]({'raw':!![]});}return null;})[_0xddb8('0x23')](function(_0x4c7b47){if(_0x4c7b47){_0x249d0f=_[_0xddb8('0x6a')](_0x4c7b47,'id');var _0x3b9c15;var _0x5dbbc4=squel['select']();_0x5dbbc4[_0xddb8('0x6b')](_0x2c7f9b[_0xddb8('0x6c')]);for(var _0x5e10a8=0x0;_0x5e10a8<_0x49fb8a[_0xddb8('0x35')];_0x5e10a8+=0x1){_0x3b9c15=_0x49fb8a[_0x5e10a8][_0xddb8('0x6d')]?_0x249d0f[_0x49fb8a[_0x5e10a8][_0xddb8('0x6d')]][_0xddb8('0x6e')]:_0x49fb8a[_0x5e10a8]['field'];_0x3b9c15=_0x49fb8a[_0x5e10a8]['function']?_[_0xddb8('0x6f')](_0xcee83[_0x49fb8a[_0x5e10a8]['function']],'%s',_0x3b9c15):_0x3b9c15;_0x3b9c15=_0x49fb8a[_0x5e10a8][_0xddb8('0x70')]?_[_0xddb8('0x6f')](_0x13bc0e[_0x49fb8a[_0x5e10a8][_0xddb8('0x70')]],'%s',_0x3b9c15):_0x3b9c15;if(_0x49fb8a[_0x5e10a8][_0xddb8('0x71')]){_0x5dbbc4[_0xddb8('0x62')](_0x3b9c15);}_0x49fb8a[_0x5e10a8]['orderBy']&&_0x5dbbc4['order'](_0x3b9c15,_0x49fb8a[_0x5e10a8][_0xddb8('0x72')]===_0xddb8('0x73')?![]:!![]);_0x5dbbc4['field'](_0x3b9c15,_0x49fb8a[_0x5e10a8][_0xddb8('0x74')]||_0x3b9c15);}if(_0x2c7f9b[_0xddb8('0x75')]){_0x2c7f9b[_0xddb8('0x75')]=JSON[_0xddb8('0x76')](_0x2c7f9b[_0xddb8('0x75')]);for(var _0x20f548=0x0;_0x20f548<_0x2c7f9b['joins'][_0xddb8('0x35')];_0x20f548+=0x1){if(_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x2d')]&&_[_0xddb8('0x5c')](_0x4687bd,_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x2d')])&&_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x77')]&&_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x78')]&&_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x79')]){_0x5dbbc4[_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x2d')]](_0x2c7f9b['joins'][_0x20f548][_0xddb8('0x78')],null,util[_0xddb8('0x70')](_0xddb8('0x7a'),_0x2c7f9b[_0xddb8('0x6c')],_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x77')],_0x2c7f9b[_0xddb8('0x75')][_0x20f548]['foreignTable'],_0x2c7f9b[_0xddb8('0x75')][_0x20f548][_0xddb8('0x79')]));}}}if(_0x2c7f9b[_0xddb8('0x7b')]){_0x2c7f9b[_0xddb8('0x7b')]=JSON[_0xddb8('0x76')](_0x2c7f9b[_0xddb8('0x7b')]);_0x5dbbc4['where'](_0x1d18fc(_0x2c7f9b[_0xddb8('0x7b')][_0xddb8('0x62')]));}_0x581fcd=_0x5dbbc4[_0xddb8('0x7c')]();_0x5dbbc4[_0xddb8('0x1c')](_0x5cfbb2);_0x5dbbc4[_0xddb8('0x1b')](0x0);logger[_0xddb8('0x7d')]('Limited\x20Query:',_0x5dbbc4[_0xddb8('0x7e')]());return dbH[_0xddb8('0x7f')]['query'](_0x5dbbc4[_0xddb8('0x7e')](),{'type':dbH[_0xddb8('0x7f')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x5da048,null))[_0xddb8('0x3f')](handleError(_0x5da048,null));};function runReport(_0x20bc25,_0x2a8df5,_0x6eee1d){var _0xccb1f8=_0x2a8df5[_0xddb8('0x29')];var _0x536385=0xa;var _0x4bedd2=[_0xddb8('0x4f'),'left_join',_0xddb8('0x80'),_0xddb8('0x81')];var _0x451711={'SUM':_0xddb8('0x82'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xddb8('0x52'),'MAX':_0xddb8('0x53'),'MIN':_0xddb8('0x54'),'AVG':_0xddb8('0x55'),'GROUP_CONCAT':_0xddb8('0x83'),'GROUP_CONCAT ASC':_0xddb8('0x56'),'GROUP_CONCAT DESC':_0xddb8('0x57')};var _0x571a0b={'SEC_TO_TIME':_0xddb8('0x58'),'DATE':_0xddb8('0x59'),'HOUR':_0xddb8('0x84'),'ROUND':_0xddb8('0x5a'),'UNIX_TIMESTAMP':_0xddb8('0x5b')};var _0x505259=function(_0x2fc2b6){return!_[_0xddb8('0x5c')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xddb8('0x5f')],_0x2fc2b6);};var _0x2849a3=function(_0x3a515c){if(!_0x3a515c||!_0x3a515c[_0xddb8('0x60')][_0xddb8('0x35')]){return'';}for(var _0x59fb1a='(',_0x510ab8=0x0;_0x510ab8<_0x3a515c['rules'][_0xddb8('0x35')];_0x510ab8+=0x1){_0x510ab8>0x0&&(_0x59fb1a+='\x20'+_0x3a515c[_0xddb8('0x61')]+'\x20');_0x59fb1a+=_0x3a515c[_0xddb8('0x60')][_0x510ab8]['group']?_0x2849a3(_0x3a515c['rules'][_0x510ab8][_0xddb8('0x62')]):_0x3a515c[_0xddb8('0x60')][_0x510ab8][_0xddb8('0x63')]+'\x20'+_0x3a515c[_0xddb8('0x60')][_0x510ab8][_0xddb8('0x64')]+(_0x505259(_0x3a515c[_0xddb8('0x60')][_0x510ab8][_0xddb8('0x64')])?'\x20'+_0x3a515c['rules'][_0x510ab8][_0xddb8('0x85')]:'');}return _0x59fb1a+')';};var _0x51f9a7={'where':{'id':_0x20bc25['id']}},_0x5af679,_0xd28dde,_0x3eae35,_0x5a86ca,_0x11a881;_0x51f9a7=_[_0xddb8('0x3c')]({},_0x51f9a7,_0x6eee1d);return db[_0xddb8('0x2b')][_0xddb8('0x4b')](_0x51f9a7)['then'](function(_0x2119bf){if(_0x2119bf){_0x5af679=_0x2119bf;return _0x2119bf[_0xddb8('0x66')]();}return null;})['then'](function(_0x4c504b){if(_0x4c504b){if(!_0x4c504b[_0xddb8('0x35')]){throw new db[(_0xddb8('0x86'))][(_0xddb8('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd28dde=_0x4c504b;return db[_0xddb8('0x68')]['findAll']({'raw':!![]});}return null;})[_0xddb8('0x23')](function(_0x331385){if(_0x331385){_0x3eae35=_[_0xddb8('0x6a')](_0x331385,'id');var _0x8a6a29;var _0x495596=squel[_0xddb8('0x87')]();_0x495596[_0xddb8('0x6b')](_0x5af679['table']);for(var _0x4a0e66=0x0;_0x4a0e66<_0xd28dde[_0xddb8('0x35')];_0x4a0e66+=0x1){_0x8a6a29=_0xd28dde[_0x4a0e66]['MetricId']?_0x3eae35[_0xd28dde[_0x4a0e66][_0xddb8('0x6d')]][_0xddb8('0x6e')]:_0xd28dde[_0x4a0e66][_0xddb8('0x63')];_0x8a6a29=_0xd28dde[_0x4a0e66]['function']?_[_0xddb8('0x6f')](_0x451711[_0xd28dde[_0x4a0e66][_0xddb8('0x88')]],'%s',_0x8a6a29):_0x8a6a29;_0x8a6a29=_0xd28dde[_0x4a0e66][_0xddb8('0x70')]?_[_0xddb8('0x6f')](_0x571a0b[_0xd28dde[_0x4a0e66][_0xddb8('0x70')]],'%s',_0x8a6a29):_0x8a6a29;if(_0xd28dde[_0x4a0e66]['groupBy']){_0x495596['group'](_0x8a6a29);}_0xd28dde[_0x4a0e66][_0xddb8('0x72')]&&_0x495596[_0xddb8('0x36')](_0x8a6a29,_0xd28dde[_0x4a0e66][_0xddb8('0x72')]===_0xddb8('0x73')?![]:!![]);_0x495596[_0xddb8('0x63')](_0x8a6a29,_0xd28dde[_0x4a0e66][_0xddb8('0x74')]||_0x8a6a29);}if(_0x5af679[_0xddb8('0x75')]){_0x5af679[_0xddb8('0x75')]=JSON[_0xddb8('0x76')](_0x5af679[_0xddb8('0x75')]);for(var _0x320c52=0x0;_0x320c52<_0x5af679[_0xddb8('0x75')][_0xddb8('0x35')];_0x320c52+=0x1){if(_0x5af679[_0xddb8('0x75')][_0x320c52][_0xddb8('0x2d')]&&_[_0xddb8('0x5c')](_0x4bedd2,_0x5af679[_0xddb8('0x75')][_0x320c52][_0xddb8('0x2d')])&&_0x5af679[_0xddb8('0x75')][_0x320c52][_0xddb8('0x77')]&&_0x5af679[_0xddb8('0x75')][_0x320c52][_0xddb8('0x78')]&&_0x5af679[_0xddb8('0x75')][_0x320c52][_0xddb8('0x79')]){_0x495596[_0x5af679['joins'][_0x320c52][_0xddb8('0x2d')]](_0x5af679[_0xddb8('0x75')][_0x320c52][_0xddb8('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x5af679[_0xddb8('0x6c')],_0x5af679['joins'][_0x320c52][_0xddb8('0x77')],_0x5af679[_0xddb8('0x75')][_0x320c52]['foreignTable'],_0x5af679[_0xddb8('0x75')][_0x320c52]['foreignKey']));}}}if(_0x5af679[_0xddb8('0x7b')]){_0x5af679[_0xddb8('0x7b')]=JSON['parse'](_0x5af679[_0xddb8('0x7b')]);_0x495596[_0xddb8('0x38')](_0x2849a3(_0x5af679[_0xddb8('0x7b')][_0xddb8('0x62')]));}_0x11a881=_0x495596[_0xddb8('0x7c')]();_0x495596[_0xddb8('0x1c')](_0x536385);_0x495596[_0xddb8('0x1b')](0x0);return;}})[_0xddb8('0x23')](function(){if(_0x2a8df5[_0xddb8('0x89')]===_0xddb8('0x8a')){return null;}var _0x9305df=_[_0xddb8('0x3c')](_0x2a8df5,{'name':_0x2a8df5[_0xddb8('0x8b')]||_0x2a8df5['name']||_0x5af679[_0xddb8('0x29')],'basename':_0xccb1f8,'savename':util[_0xddb8('0x70')]('%s-%s.%s',_0x2a8df5['name']||_0x5af679[_0xddb8('0x29')],require(_0xddb8('0x8c'))[_0xddb8('0x8d')](0x4),_0x2a8df5[_0xddb8('0x89')]||_0xddb8('0x8e')),'reportId':_0x5af679['id'],'reportType':'custom'});return db[_0xddb8('0x8f')]['create'](_0x9305df,{'raw':!![]});})[_0xddb8('0x23')](function(_0x308d58){if(_0x5af679[_0xddb8('0x6c')]===_0xddb8('0x90')){_0x11a881[_0xddb8('0x38')](_0x5af679['table']+_0xddb8('0x91'),_0x2a8df5['startDate'],_0x2a8df5['endDate']);}else{_0x11a881[_0xddb8('0x38')](_0x5af679[_0xddb8('0x6c')]+_0xddb8('0x92'),_0x2a8df5['startDate'],_0x2a8df5[_0xddb8('0x93')]);}if(_0x308d58){logger['info'](_0xddb8('0x94'),_0x11a881[_0xddb8('0x7e')]());require('child_process')[_0xddb8('0x95')](path[_0xddb8('0x4f')](__dirname,'../../components/export/',_0x308d58[_0xddb8('0x89')]),[_0x308d58['id'],_0x11a881[_0xddb8('0x7e')](),path['join'](__dirname,_0xddb8('0x96'),_0x308d58[_0xddb8('0x97')]),_0xccb1f8]);return _0x308d58;}else{var _0x4ae690=squel[_0xddb8('0x87')]();_0x4ae690[_0xddb8('0x6b')]('('+_0x11a881['toString']()+')',_0xddb8('0x98'));_0x4ae690[_0xddb8('0x63')]('COUNT(*)',_0xddb8('0x1e'));_0x11a881[_0xddb8('0x1c')](_0x2a8df5['limit']||_0x536385);_0x11a881[_0xddb8('0x1b')](_0x2a8df5['offset']||0x0);return dbH[_0xddb8('0x7f')][_0xddb8('0x30')](_0x4ae690[_0xddb8('0x7e')](),{'type':dbH['sequelize']['QueryTypes'][_0xddb8('0x99')]})[_0xddb8('0x23')](function(_0x2a7ec8){if(!_0x2a7ec8[_0xddb8('0x35')]){_0x5a86ca=0x0;}else{_0x5a86ca=_0x2a7ec8[0x0]['count']||0x0;}return dbH[_0xddb8('0x7f')]['query'](_0x11a881[_0xddb8('0x7e')](),{'type':dbH[_0xddb8('0x7f')][_0xddb8('0x9a')][_0xddb8('0x99')]});})[_0xddb8('0x23')](function(_0x3ae5b5){return{'rows':_0x3ae5b5||[],'count':_0x5a86ca};});}});}exports['run']=function(_0x146b04,_0x272099){return runReport(_0x146b04[_0xddb8('0x41')],_0x146b04[_0xddb8('0x30')],_0x146b04['options'])['then'](respondWithResult(_0x272099,null))[_0xddb8('0x3f')](handleError(_0x272099,null));};exports[_0xddb8('0x9b')]=runReport;exports[_0xddb8('0x30')]=function(_0x2a5eee,_0x3ba098){var _0x1a358a=0xa;var _0x165889=[_0xddb8('0x4f'),'left_join',_0xddb8('0x80'),_0xddb8('0x81')];var _0x32c8a0={'SUM':'SUM(%s)','COUNT':_0xddb8('0x51'),'COUNT DISTINCT':_0xddb8('0x52'),'MAX':_0xddb8('0x53'),'MIN':_0xddb8('0x54'),'AVG':_0xddb8('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xddb8('0x56'),'GROUP_CONCAT DESC':_0xddb8('0x57')};var _0x447262={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xddb8('0x84'),'ROUND':_0xddb8('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x186959=function(_0x235fdf){return!_[_0xddb8('0x5c')]([_0xddb8('0x5d'),_0xddb8('0x5e'),'IS\x20EMPTY',_0xddb8('0x5f')],_0x235fdf);};var _0x57c5e7=function(_0x24c753){if(!_0x24c753||!_0x24c753[_0xddb8('0x60')][_0xddb8('0x35')]){return'';}for(var _0x55c730='(',_0xc18a60=0x0;_0xc18a60<_0x24c753[_0xddb8('0x60')][_0xddb8('0x35')];_0xc18a60+=0x1){_0xc18a60>0x0&&(_0x55c730+='\x20'+_0x24c753[_0xddb8('0x61')]+'\x20');_0x55c730+=_0x24c753['rules'][_0xc18a60]['group']?_0x57c5e7(_0x24c753[_0xddb8('0x60')][_0xc18a60][_0xddb8('0x62')]):_0x24c753['rules'][_0xc18a60]['field']+'\x20'+_0x24c753[_0xddb8('0x60')][_0xc18a60][_0xddb8('0x64')]+(_0x186959(_0x24c753[_0xddb8('0x60')][_0xc18a60][_0xddb8('0x64')])?'\x20'+_0x24c753['rules'][_0xc18a60][_0xddb8('0x85')]:'');}return _0x55c730+')';};var _0x22a463={'where':{'id':_0x2a5eee['params']['id']}},_0x43cb18,_0x3be3c0,_0x156524,_0x24b040,_0x2a7200;_0x22a463=_[_0xddb8('0x3c')]({},_0x22a463,_0x2a5eee['options']);return db[_0xddb8('0x2b')][_0xddb8('0x4b')](_0x22a463)[_0xddb8('0x23')](function(_0x50fccd){if(_0x50fccd){_0x43cb18=_0x50fccd;return _0x50fccd[_0xddb8('0x66')]();}return null;})['then'](function(_0xb58b86){if(_0xb58b86){if(!_0xb58b86[_0xddb8('0x35')]){throw new db[(_0xddb8('0x86'))]['ValidationErrorItem'](_0xddb8('0x9c'),0x193);}_0x3be3c0=_0xb58b86;return db[_0xddb8('0x68')][_0xddb8('0x69')]({'raw':!![]});}return null;})[_0xddb8('0x23')](function(_0x3ddddd){if(_0x3ddddd){_0x156524=_[_0xddb8('0x6a')](_0x3ddddd,'id');var _0x3553c8;var _0x37342e=squel[_0xddb8('0x87')]();_0x37342e[_0xddb8('0x6b')](_0x43cb18[_0xddb8('0x6c')]);for(var _0x3fbd7c=0x0;_0x3fbd7c<_0x3be3c0[_0xddb8('0x35')];_0x3fbd7c+=0x1){_0x3553c8=_0x3be3c0[_0x3fbd7c][_0xddb8('0x6d')]?_0x156524[_0x3be3c0[_0x3fbd7c][_0xddb8('0x6d')]]['metric']:_0x3be3c0[_0x3fbd7c][_0xddb8('0x63')];_0x3553c8=_0x3be3c0[_0x3fbd7c][_0xddb8('0x88')]?_[_0xddb8('0x6f')](_0x32c8a0[_0x3be3c0[_0x3fbd7c]['function']],'%s',_0x3553c8):_0x3553c8;_0x3553c8=_0x3be3c0[_0x3fbd7c][_0xddb8('0x70')]?_[_0xddb8('0x6f')](_0x447262[_0x3be3c0[_0x3fbd7c]['format']],'%s',_0x3553c8):_0x3553c8;if(_0x3be3c0[_0x3fbd7c][_0xddb8('0x71')]){_0x37342e[_0xddb8('0x62')](_0x3553c8);}_0x3be3c0[_0x3fbd7c][_0xddb8('0x72')]&&_0x37342e['order'](_0x3553c8,_0x3be3c0[_0x3fbd7c][_0xddb8('0x72')]===_0xddb8('0x73')?![]:!![]);_0x37342e[_0xddb8('0x63')](_0x3553c8,_0x3be3c0[_0x3fbd7c][_0xddb8('0x74')]||_0x3553c8);}if(_0x43cb18[_0xddb8('0x75')]){_0x43cb18[_0xddb8('0x75')]=JSON[_0xddb8('0x76')](_0x43cb18[_0xddb8('0x75')]);for(var _0x27eb61=0x0;_0x27eb61<_0x43cb18[_0xddb8('0x75')]['length'];_0x27eb61+=0x1){if(_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x2d')]&&_[_0xddb8('0x5c')](_0x165889,_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x2d')])&&_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x77')]&&_0x43cb18['joins'][_0x27eb61]['foreignTable']&&_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x79')]){_0x37342e[_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x2d')]](_0x43cb18['joins'][_0x27eb61]['foreignTable'],null,util[_0xddb8('0x70')](_0xddb8('0x7a'),_0x43cb18[_0xddb8('0x6c')],_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x77')],_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x78')],_0x43cb18[_0xddb8('0x75')][_0x27eb61][_0xddb8('0x79')]));}}}if(_0x43cb18['conditions']){_0x43cb18['conditions']=JSON['parse'](_0x43cb18[_0xddb8('0x7b')]);_0x37342e[_0xddb8('0x38')](_0x57c5e7(_0x43cb18['conditions']['group']));}_0x2a7200=_0x37342e[_0xddb8('0x7c')]();_0x37342e['limit'](_0x1a358a);_0x37342e[_0xddb8('0x1b')](0x0);logger['debug'](_0xddb8('0x9d'),_0x37342e[_0xddb8('0x7e')]());return dbH[_0xddb8('0x7f')][_0xddb8('0x30')](_0x37342e[_0xddb8('0x7e')](),{'type':dbH[_0xddb8('0x7f')][_0xddb8('0x9a')]['SELECT']});}})['then'](function(){return{'sql':_0x2a7200[_0xddb8('0x7e')]()};})[_0xddb8('0x23')](respondWithResult(_0x3ba098,null))[_0xddb8('0x3f')](handleError(_0x3ba098,null));};
\ No newline at end of file
+var _0xa1ac=['orderBy','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','QueryTypes','rimraf','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','dbH','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','sendStatus','error','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','find','body','role','user','userProfileId','autoAssociation','UserProfileResource','create','join','right_join','SUM(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','merge','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','replace','function','format','groupBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','getFields','Please\x20insert\x20at\x20least\x20one\x20field'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa1ac,0xbb));var _0xca1a=function(_0xd44bc1,_0x524adc){_0xd44bc1=_0xd44bc1-0x0;var _0x6f240e=_0xa1ac[_0xd44bc1];return _0x6f240e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca1a('0x0'));var zipdir=require(_0xca1a('0x1'));var jsonpatch=require(_0xca1a('0x2'));var rp=require(_0xca1a('0x3'));var moment=require(_0xca1a('0x4'));var BPromise=require(_0xca1a('0x5'));var Mustache=require(_0xca1a('0x6'));var util=require(_0xca1a('0x7'));var path=require(_0xca1a('0x8'));var sox=require('sox');var csv=require(_0xca1a('0x9'));var ejs=require(_0xca1a('0xa'));var fs=require('fs');var fs_extra=require(_0xca1a('0xb'));var _=require(_0xca1a('0xc'));var squel=require(_0xca1a('0xd'));var crypto=require(_0xca1a('0xe'));var jsforce=require(_0xca1a('0xf'));var deskjs=require(_0xca1a('0x10'));var toCsv=require(_0xca1a('0x9'));var querystring=require('querystring');var Papa=require(_0xca1a('0x11'));var Redis=require(_0xca1a('0x12'));var authService=require(_0xca1a('0x13'));var qs=require(_0xca1a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca1a('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca1a('0x16'));var licenseUtil=require(_0xca1a('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xca1a('0x18')];function respondWithStatusCode(_0x264399,_0x2c136d){_0x2c136d=_0x2c136d||0xcc;return function(_0xe7622c){if(_0xe7622c){return _0x264399['sendStatus'](_0x2c136d);}return _0x264399['status'](_0x2c136d)[_0xca1a('0x19')]();};}function respondWithResult(_0x3b7f14,_0x2bf135){_0x2bf135=_0x2bf135||0xc8;return function(_0x5027a5){if(_0x5027a5){return _0x3b7f14[_0xca1a('0x1a')](_0x2bf135)[_0xca1a('0x1b')](_0x5027a5);}};}function respondWithFilteredResult(_0x3d2fc2,_0x4f2598){return function(_0x56a580){if(_0x56a580){var _0x3d7ed3=typeof _0x4f2598[_0xca1a('0x1c')]==='undefined'&&typeof _0x4f2598[_0xca1a('0x1d')]==='undefined';var _0x5029d0=_0x56a580['count'];var _0x195290=_0x3d7ed3?0x0:_0x4f2598[_0xca1a('0x1c')];var _0x389e29=_0x3d7ed3?_0x56a580['count']:_0x4f2598[_0xca1a('0x1c')]+_0x4f2598[_0xca1a('0x1d')];var _0x2ff1c4;if(_0x389e29>=_0x5029d0){_0x389e29=_0x5029d0;_0x2ff1c4=0xc8;}else{_0x2ff1c4=0xce;}_0x3d2fc2[_0xca1a('0x1a')](_0x2ff1c4);return _0x3d2fc2[_0xca1a('0x1e')](_0xca1a('0x1f'),_0x195290+'-'+_0x389e29+'/'+_0x5029d0)['json'](_0x56a580);}return null;};}function patchUpdates(_0x36795c){return function(_0x2276af){try{jsonpatch[_0xca1a('0x20')](_0x2276af,_0x36795c,!![]);}catch(_0x19fc8b){return BPromise[_0xca1a('0x21')](_0x19fc8b);}return _0x2276af[_0xca1a('0x22')]();};}function saveUpdates(_0x552d33,_0x2193ec){return function(_0x5c7fb1){if(_0x5c7fb1){return _0x5c7fb1[_0xca1a('0x23')](_0x552d33)[_0xca1a('0x24')](function(_0x2cd555){return _0x2cd555;});}return null;};}function removeEntity(_0x383015,_0x142625){return function(_0x2da4cd){if(_0x2da4cd){return _0x2da4cd[_0xca1a('0x25')]()['then'](function(){var _0x1a9c74=_0x2da4cd[_0xca1a('0x26')]({'plain':!![]});var _0x1fc77e=_0xca1a('0x27');return db['UserProfileResource'][_0xca1a('0x25')]({'where':{'type':_0x1fc77e,'resourceId':_0x1a9c74['id']}})[_0xca1a('0x24')](function(){return _0x2da4cd;});})[_0xca1a('0x24')](function(){_0x383015[_0xca1a('0x1a')](0xcc)[_0xca1a('0x19')]();});}};}function handleEntityNotFound(_0x2db480,_0x173808){return function(_0xc957b7){if(!_0xc957b7){_0x2db480[_0xca1a('0x28')](0x194);}return _0xc957b7;};}function handleError(_0x16ec0e,_0x41a565){_0x41a565=_0x41a565||0x1f4;return function(_0x49c8f0){logger[_0xca1a('0x29')](_0x49c8f0['stack']);if(_0x49c8f0[_0xca1a('0x2a')]){delete _0x49c8f0[_0xca1a('0x2a')];}_0x16ec0e['status'](_0x41a565)[_0xca1a('0x2b')](_0x49c8f0);};}exports[_0xca1a('0x2c')]=function(_0x3cf160,_0x79fe7){var _0x29468c={},_0x1409b4={},_0x176f27={'count':0x0,'rows':[]};var _0x1818fd=_[_0xca1a('0x2d')](db[_0xca1a('0x2e')][_0xca1a('0x2f')],function(_0xea4022){return{'name':_0xea4022[_0xca1a('0x30')],'type':_0xea4022[_0xca1a('0x31')]['key']};});_0x1409b4[_0xca1a('0x32')]=_[_0xca1a('0x2d')](_0x1818fd,_0xca1a('0x2a'));_0x1409b4[_0xca1a('0x33')]=_['keys'](_0x3cf160['query']);_0x1409b4['filters']=_['intersection'](_0x1409b4[_0xca1a('0x32')],_0x1409b4[_0xca1a('0x33')]);_0x29468c[_0xca1a('0x34')]=_[_0xca1a('0x35')](_0x1409b4[_0xca1a('0x32')],qs[_0xca1a('0x36')](_0x3cf160[_0xca1a('0x33')][_0xca1a('0x36')]));_0x29468c[_0xca1a('0x34')]=_0x29468c[_0xca1a('0x34')][_0xca1a('0x37')]?_0x29468c[_0xca1a('0x34')]:_0x1409b4['model'];if(!_0x3cf160[_0xca1a('0x33')][_0xca1a('0x38')](_0xca1a('0x39'))){_0x29468c[_0xca1a('0x1d')]=qs['limit'](_0x3cf160['query']['limit']);_0x29468c['offset']=qs['offset'](_0x3cf160[_0xca1a('0x33')]['offset']);}_0x29468c[_0xca1a('0x3a')]=qs[_0xca1a('0x3b')](_0x3cf160['query'][_0xca1a('0x3b')]);_0x29468c['where']=qs[_0xca1a('0x3c')](_[_0xca1a('0x3d')](_0x3cf160[_0xca1a('0x33')],_0x1409b4[_0xca1a('0x3c')]),_0x1818fd);if(_0x3cf160[_0xca1a('0x33')][_0xca1a('0x3e')]){_0x29468c[_0xca1a('0x3f')]=_['merge'](_0x29468c[_0xca1a('0x3f')],{'$or':_[_0xca1a('0x2d')](_0x1818fd,function(_0x35cb93){if(_0x35cb93[_0xca1a('0x31')]!==_0xca1a('0x40')){var _0x43781d={};_0x43781d[_0x35cb93[_0xca1a('0x2a')]]={'$like':'%'+_0x3cf160[_0xca1a('0x33')][_0xca1a('0x3e')]+'%'};return _0x43781d;}})});}_0x29468c=_['merge']({},_0x29468c,_0x3cf160[_0xca1a('0x41')]);var _0x51ed16={'where':_0x29468c[_0xca1a('0x3f')]};return db[_0xca1a('0x2e')][_0xca1a('0x42')](_0x51ed16)[_0xca1a('0x24')](function(_0x2b80fc){_0x176f27[_0xca1a('0x42')]=_0x2b80fc;if(_0x3cf160['query'][_0xca1a('0x43')]){_0x29468c[_0xca1a('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xca1a('0x45')](_0x29468c);})[_0xca1a('0x24')](function(_0x325b0e){_0x176f27['rows']=_0x325b0e;return _0x176f27;})['then'](respondWithFilteredResult(_0x79fe7,_0x29468c))[_0xca1a('0x46')](handleError(_0x79fe7,null));};exports[_0xca1a('0x47')]=function(_0x3071ed,_0x3d628d){var _0xc50eb2={'raw':![],'where':{'id':_0x3071ed[_0xca1a('0x48')]['id']}},_0x4c9a54={};_0x4c9a54[_0xca1a('0x32')]=_[_0xca1a('0x49')](db[_0xca1a('0x2e')][_0xca1a('0x2f')]);_0x4c9a54[_0xca1a('0x33')]=_[_0xca1a('0x49')](_0x3071ed[_0xca1a('0x33')]);_0x4c9a54['filters']=_[_0xca1a('0x35')](_0x4c9a54[_0xca1a('0x32')],_0x4c9a54[_0xca1a('0x33')]);_0xc50eb2[_0xca1a('0x34')]=_['intersection'](_0x4c9a54[_0xca1a('0x32')],qs[_0xca1a('0x36')](_0x3071ed[_0xca1a('0x33')][_0xca1a('0x36')]));_0xc50eb2[_0xca1a('0x34')]=_0xc50eb2[_0xca1a('0x34')]['length']?_0xc50eb2[_0xca1a('0x34')]:_0x4c9a54[_0xca1a('0x32')];if(_0x3071ed[_0xca1a('0x33')][_0xca1a('0x43')]){_0xc50eb2['include']=[{'all':!![]}];}_0xc50eb2=_['merge']({},_0xc50eb2,_0x3071ed['options']);return db[_0xca1a('0x2e')][_0xca1a('0x4a')](_0xc50eb2)[_0xca1a('0x24')](handleEntityNotFound(_0x3d628d,null))[_0xca1a('0x24')](respondWithResult(_0x3d628d,null))[_0xca1a('0x46')](handleError(_0x3d628d,null));};exports['create']=function(_0x554b22,_0x3cbff8){return db[_0xca1a('0x2e')]['create'](_0x554b22[_0xca1a('0x4b')],{})['then'](function(_0x1c6196){var _0x1fd2ba=_0x554b22['user']['get']({'plain':!![]});if(!_0x1fd2ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1fd2ba[_0xca1a('0x4c')]===_0xca1a('0x4d')){var _0x431843=_0x1c6196[_0xca1a('0x26')]({'plain':!![]});var _0x1bfaea='Reports';return db['UserProfileSection'][_0xca1a('0x4a')]({'where':{'name':_0x1bfaea,'userProfileId':_0x1fd2ba[_0xca1a('0x4e')]},'raw':!![]})[_0xca1a('0x24')](function(_0x33f8de){if(_0x33f8de&&_0x33f8de[_0xca1a('0x4f')]===0x0){return db[_0xca1a('0x50')][_0xca1a('0x51')]({'name':_0x431843[_0xca1a('0x2a')],'resourceId':_0x431843['id'],'type':'CustomReports','sectionId':_0x33f8de['id']},{})['then'](function(){return _0x1c6196;});}else{return _0x1c6196;}})[_0xca1a('0x46')](function(_0x4a0cf6){logger[_0xca1a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a0cf6);throw _0x4a0cf6;});}return _0x1c6196;})['then'](respondWithResult(_0x3cbff8,0xc9))[_0xca1a('0x46')](handleError(_0x3cbff8,null));};exports[_0xca1a('0x23')]=function(_0x38e01e,_0x2a7210){if(_0x38e01e['body']['id']){delete _0x38e01e[_0xca1a('0x4b')]['id'];}return db[_0xca1a('0x2e')]['find']({'where':{'id':_0x38e01e[_0xca1a('0x48')]['id']}})[_0xca1a('0x24')](handleEntityNotFound(_0x2a7210,null))['then'](saveUpdates(_0x38e01e[_0xca1a('0x4b')],null))[_0xca1a('0x24')](respondWithResult(_0x2a7210,null))[_0xca1a('0x46')](handleError(_0x2a7210,null));};exports['destroy']=function(_0x28cbd3,_0x3401aa){return db[_0xca1a('0x2e')][_0xca1a('0x4a')]({'where':{'id':_0x28cbd3[_0xca1a('0x48')]['id']}})[_0xca1a('0x24')](handleEntityNotFound(_0x3401aa,null))[_0xca1a('0x24')](removeEntity(_0x3401aa,null))[_0xca1a('0x46')](handleError(_0x3401aa,null));};exports['preview']=function(_0x253d57,_0x59978f){var _0x5d0487=0xa;var _0x47e3bc=[_0xca1a('0x52'),'left_join',_0xca1a('0x53'),'cross_join'];var _0x2f5d2f={'SUM':_0xca1a('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xca1a('0x55'),'MIN':'MIN(%s)','AVG':_0xca1a('0x56'),'GROUP_CONCAT':_0xca1a('0x57'),'GROUP_CONCAT ASC':_0xca1a('0x58'),'GROUP_CONCAT DESC':_0xca1a('0x59')};var _0x12b4ed={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xca1a('0x5a'),'HOUR':_0xca1a('0x5b'),'ROUND':_0xca1a('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3ad689=function(_0x459637){return!_[_0xca1a('0x5d')]([_0xca1a('0x5e'),'IS\x20NOT\x20NULL',_0xca1a('0x5f'),_0xca1a('0x60')],_0x459637);};var _0x4e0d71=function(_0x2418bd){if(!_0x2418bd||!_0x2418bd['rules'][_0xca1a('0x37')]){return'';}for(var _0x16ed51='(',_0xa06ec=0x0;_0xa06ec<_0x2418bd[_0xca1a('0x61')]['length'];_0xa06ec+=0x1){_0xa06ec>0x0&&(_0x16ed51+='\x20'+_0x2418bd[_0xca1a('0x62')]+'\x20');_0x16ed51+=_0x2418bd[_0xca1a('0x61')][_0xa06ec][_0xca1a('0x63')]?_0x4e0d71(_0x2418bd['rules'][_0xa06ec]['group']):_0x2418bd[_0xca1a('0x61')][_0xa06ec]['field']+'\x20'+_0x2418bd[_0xca1a('0x61')][_0xa06ec][_0xca1a('0x64')]+(_0x3ad689(_0x2418bd[_0xca1a('0x61')][_0xa06ec][_0xca1a('0x64')])?'\x20'+_0x2418bd[_0xca1a('0x61')][_0xa06ec][_0xca1a('0x65')]:'');}return _0x16ed51+')';};var _0x14d3f3={'where':{'id':_0x253d57[_0xca1a('0x48')]['id']}},_0x5d5645,_0x4ec7a4,_0x367bb4,_0x123353,_0x44d3f1;_0x14d3f3=_[_0xca1a('0x66')]({},_0x14d3f3,_0x253d57[_0xca1a('0x41')]);return db[_0xca1a('0x2e')][_0xca1a('0x4a')](_0x14d3f3)[_0xca1a('0x24')](function(_0x4db5fc){if(_0x4db5fc){_0x5d5645=_0x4db5fc;return _0x4db5fc['getFields']();}return null;})[_0xca1a('0x24')](function(_0x154d71){if(_0x154d71){if(!_0x154d71['length']){throw new db[(_0xca1a('0x67'))][(_0xca1a('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ec7a4=_0x154d71;return db[_0xca1a('0x69')][_0xca1a('0x45')]({'raw':!![]});}return null;})[_0xca1a('0x24')](function(_0x51d587){if(_0x51d587){_0x367bb4=_[_0xca1a('0x6a')](_0x51d587,'id');var _0x55f191;var _0x23e214=squel[_0xca1a('0x6b')]();_0x23e214[_0xca1a('0x6c')](_0x5d5645[_0xca1a('0x6d')]);for(var _0x343b06=0x0;_0x343b06<_0x4ec7a4[_0xca1a('0x37')];_0x343b06+=0x1){_0x55f191=_0x4ec7a4[_0x343b06]['MetricId']?_0x367bb4[_0x4ec7a4[_0x343b06][_0xca1a('0x6e')]][_0xca1a('0x6f')]:_0x4ec7a4[_0x343b06][_0xca1a('0x70')];_0x55f191=_0x4ec7a4[_0x343b06]['function']?_[_0xca1a('0x71')](_0x2f5d2f[_0x4ec7a4[_0x343b06][_0xca1a('0x72')]],'%s',_0x55f191):_0x55f191;_0x55f191=_0x4ec7a4[_0x343b06][_0xca1a('0x73')]?_['replace'](_0x12b4ed[_0x4ec7a4[_0x343b06][_0xca1a('0x73')]],'%s',_0x55f191):_0x55f191;if(_0x4ec7a4[_0x343b06][_0xca1a('0x74')]){_0x23e214[_0xca1a('0x63')](_0x55f191);}_0x4ec7a4[_0x343b06]['orderBy']&&_0x23e214[_0xca1a('0x3a')](_0x55f191,_0x4ec7a4[_0x343b06]['orderBy']===_0xca1a('0x75')?![]:!![]);_0x23e214[_0xca1a('0x70')](_0x55f191,_0x4ec7a4[_0x343b06][_0xca1a('0x76')]||_0x55f191);}if(_0x5d5645[_0xca1a('0x77')]){_0x5d5645['joins']=JSON[_0xca1a('0x78')](_0x5d5645[_0xca1a('0x77')]);for(var _0x17ec70=0x0;_0x17ec70<_0x5d5645[_0xca1a('0x77')]['length'];_0x17ec70+=0x1){if(_0x5d5645[_0xca1a('0x77')][_0x17ec70][_0xca1a('0x31')]&&_['includes'](_0x47e3bc,_0x5d5645['joins'][_0x17ec70][_0xca1a('0x31')])&&_0x5d5645['joins'][_0x17ec70]['parentKey']&&_0x5d5645[_0xca1a('0x77')][_0x17ec70][_0xca1a('0x79')]&&_0x5d5645[_0xca1a('0x77')][_0x17ec70][_0xca1a('0x7a')]){_0x23e214[_0x5d5645['joins'][_0x17ec70][_0xca1a('0x31')]](_0x5d5645[_0xca1a('0x77')][_0x17ec70][_0xca1a('0x79')],null,util[_0xca1a('0x73')](_0xca1a('0x7b'),_0x5d5645[_0xca1a('0x6d')],_0x5d5645[_0xca1a('0x77')][_0x17ec70][_0xca1a('0x7c')],_0x5d5645[_0xca1a('0x77')][_0x17ec70][_0xca1a('0x79')],_0x5d5645['joins'][_0x17ec70][_0xca1a('0x7a')]));}}}if(_0x5d5645[_0xca1a('0x7d')]){_0x5d5645['conditions']=JSON['parse'](_0x5d5645[_0xca1a('0x7d')]);_0x23e214['where'](_0x4e0d71(_0x5d5645[_0xca1a('0x7d')][_0xca1a('0x63')]));}_0x44d3f1=_0x23e214[_0xca1a('0x7e')]();_0x23e214[_0xca1a('0x1d')](_0x5d0487);_0x23e214['offset'](0x0);logger[_0xca1a('0x7f')](_0xca1a('0x80'),_0x23e214[_0xca1a('0x81')]());return dbH[_0xca1a('0x82')][_0xca1a('0x33')](_0x23e214['toString'](),{'type':dbH[_0xca1a('0x82')]['QueryTypes'][_0xca1a('0x83')]});}})[_0xca1a('0x24')](respondWithResult(_0x59978f,null))[_0xca1a('0x46')](handleError(_0x59978f,null));};function runReport(_0xd70387,_0x25983b,_0x4cb65f){var _0x2dd895=_0x25983b[_0xca1a('0x2a')];var _0x5b59e7=0xa;var _0x4e09e7=[_0xca1a('0x52'),_0xca1a('0x84'),_0xca1a('0x53'),_0xca1a('0x85')];var _0x16607a={'SUM':_0xca1a('0x54'),'COUNT':_0xca1a('0x86'),'COUNT DISTINCT':_0xca1a('0x87'),'MAX':_0xca1a('0x55'),'MIN':'MIN(%s)','AVG':_0xca1a('0x56'),'GROUP_CONCAT':_0xca1a('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xca1a('0x59')};var _0x534c98={'SEC_TO_TIME':_0xca1a('0x88'),'DATE':_0xca1a('0x5a'),'HOUR':_0xca1a('0x5b'),'ROUND':_0xca1a('0x5c'),'UNIX_TIMESTAMP':_0xca1a('0x89')};var _0x25ff05=function(_0x27880c){return!_[_0xca1a('0x5d')]([_0xca1a('0x5e'),_0xca1a('0x8a'),_0xca1a('0x5f'),_0xca1a('0x60')],_0x27880c);};var _0xe1ef42=function(_0x5eede5){if(!_0x5eede5||!_0x5eede5[_0xca1a('0x61')][_0xca1a('0x37')]){return'';}for(var _0x43ea6e='(',_0x1f0625=0x0;_0x1f0625<_0x5eede5[_0xca1a('0x61')][_0xca1a('0x37')];_0x1f0625+=0x1){_0x1f0625>0x0&&(_0x43ea6e+='\x20'+_0x5eede5[_0xca1a('0x62')]+'\x20');_0x43ea6e+=_0x5eede5[_0xca1a('0x61')][_0x1f0625][_0xca1a('0x63')]?_0xe1ef42(_0x5eede5['rules'][_0x1f0625][_0xca1a('0x63')]):_0x5eede5['rules'][_0x1f0625]['field']+'\x20'+_0x5eede5[_0xca1a('0x61')][_0x1f0625][_0xca1a('0x64')]+(_0x25ff05(_0x5eede5[_0xca1a('0x61')][_0x1f0625][_0xca1a('0x64')])?'\x20'+_0x5eede5['rules'][_0x1f0625]['value']:'');}return _0x43ea6e+')';};var _0x7b23be={'where':{'id':_0xd70387['id']}},_0x23b64d,_0x30c9d3,_0x5462a3,_0x2903fb,_0x206259;_0x7b23be=_['merge']({},_0x7b23be,_0x4cb65f);return db[_0xca1a('0x2e')][_0xca1a('0x4a')](_0x7b23be)[_0xca1a('0x24')](function(_0x214889){if(_0x214889){_0x23b64d=_0x214889;return _0x214889[_0xca1a('0x8b')]();}return null;})[_0xca1a('0x24')](function(_0x53742b){if(_0x53742b){if(!_0x53742b['length']){throw new db[(_0xca1a('0x67'))][(_0xca1a('0x68'))](_0xca1a('0x8c'),0x193);}_0x30c9d3=_0x53742b;return db[_0xca1a('0x69')][_0xca1a('0x45')]({'raw':!![]});}return null;})[_0xca1a('0x24')](function(_0x5ad057){if(_0x5ad057){_0x5462a3=_[_0xca1a('0x6a')](_0x5ad057,'id');var _0x518140;var _0x12136a=squel[_0xca1a('0x6b')]();_0x12136a['from'](_0x23b64d['table']);for(var _0x429ed2=0x0;_0x429ed2<_0x30c9d3[_0xca1a('0x37')];_0x429ed2+=0x1){_0x518140=_0x30c9d3[_0x429ed2][_0xca1a('0x6e')]?_0x5462a3[_0x30c9d3[_0x429ed2][_0xca1a('0x6e')]][_0xca1a('0x6f')]:_0x30c9d3[_0x429ed2][_0xca1a('0x70')];_0x518140=_0x30c9d3[_0x429ed2][_0xca1a('0x72')]?_['replace'](_0x16607a[_0x30c9d3[_0x429ed2][_0xca1a('0x72')]],'%s',_0x518140):_0x518140;_0x518140=_0x30c9d3[_0x429ed2][_0xca1a('0x73')]?_[_0xca1a('0x71')](_0x534c98[_0x30c9d3[_0x429ed2][_0xca1a('0x73')]],'%s',_0x518140):_0x518140;if(_0x30c9d3[_0x429ed2][_0xca1a('0x74')]){_0x12136a[_0xca1a('0x63')](_0x518140);}_0x30c9d3[_0x429ed2][_0xca1a('0x8d')]&&_0x12136a[_0xca1a('0x3a')](_0x518140,_0x30c9d3[_0x429ed2]['orderBy']==='DESC'?![]:!![]);_0x12136a[_0xca1a('0x70')](_0x518140,_0x30c9d3[_0x429ed2][_0xca1a('0x76')]||_0x518140);}if(_0x23b64d[_0xca1a('0x77')]){_0x23b64d[_0xca1a('0x77')]=JSON[_0xca1a('0x78')](_0x23b64d[_0xca1a('0x77')]);for(var _0x267e20=0x0;_0x267e20<_0x23b64d['joins']['length'];_0x267e20+=0x1){if(_0x23b64d[_0xca1a('0x77')][_0x267e20][_0xca1a('0x31')]&&_['includes'](_0x4e09e7,_0x23b64d['joins'][_0x267e20][_0xca1a('0x31')])&&_0x23b64d['joins'][_0x267e20][_0xca1a('0x7c')]&&_0x23b64d[_0xca1a('0x77')][_0x267e20][_0xca1a('0x79')]&&_0x23b64d[_0xca1a('0x77')][_0x267e20][_0xca1a('0x7a')]){_0x12136a[_0x23b64d[_0xca1a('0x77')][_0x267e20][_0xca1a('0x31')]](_0x23b64d['joins'][_0x267e20][_0xca1a('0x79')],null,util[_0xca1a('0x73')](_0xca1a('0x7b'),_0x23b64d['table'],_0x23b64d[_0xca1a('0x77')][_0x267e20]['parentKey'],_0x23b64d['joins'][_0x267e20][_0xca1a('0x79')],_0x23b64d['joins'][_0x267e20][_0xca1a('0x7a')]));}}}if(_0x23b64d[_0xca1a('0x7d')]){_0x23b64d['conditions']=JSON[_0xca1a('0x78')](_0x23b64d[_0xca1a('0x7d')]);_0x12136a['where'](_0xe1ef42(_0x23b64d['conditions'][_0xca1a('0x63')]));}_0x206259=_0x12136a[_0xca1a('0x7e')]();_0x12136a[_0xca1a('0x1d')](_0x5b59e7);_0x12136a[_0xca1a('0x1c')](0x0);return;}})['then'](function(){if(_0x25983b[_0xca1a('0x8e')]===_0xca1a('0x8f')){return null;}var _0x19d55d=_[_0xca1a('0x66')](_0x25983b,{'name':_0x25983b['fullPath']||_0x25983b[_0xca1a('0x2a')]||_0x23b64d[_0xca1a('0x2a')],'basename':_0x2dd895,'savename':util[_0xca1a('0x73')](_0xca1a('0x90'),_0x25983b['name']||_0x23b64d[_0xca1a('0x2a')],require(_0xca1a('0x91'))[_0xca1a('0x92')](0x4),_0x25983b['output']||_0xca1a('0x93')),'reportId':_0x23b64d['id'],'reportType':_0xca1a('0x94')});return db['AnalyticExtractedReport'][_0xca1a('0x51')](_0x19d55d,{'raw':!![]});})[_0xca1a('0x24')](function(_0x16c2ba){if(_0x23b64d['table']===_0xca1a('0x95')){_0x206259['where'](_0x23b64d[_0xca1a('0x6d')]+_0xca1a('0x96'),_0x25983b[_0xca1a('0x97')],_0x25983b[_0xca1a('0x98')]);}else{_0x206259[_0xca1a('0x3f')](_0x23b64d['table']+_0xca1a('0x99'),_0x25983b['startDate'],_0x25983b[_0xca1a('0x98')]);}if(_0x16c2ba){logger['info'](_0xca1a('0x9a'),_0x206259['toString']());require(_0xca1a('0x9b'))[_0xca1a('0x9c')](path[_0xca1a('0x52')](__dirname,_0xca1a('0x9d'),_0x16c2ba['output']),[_0x16c2ba['id'],_0x206259['toString'](),path[_0xca1a('0x52')](__dirname,_0xca1a('0x9e'),_0x16c2ba[_0xca1a('0x9f')]),_0x2dd895]);return _0x16c2ba;}else{var _0x14a75c=squel['select']();_0x14a75c[_0xca1a('0x6c')]('('+_0x206259[_0xca1a('0x81')]()+')',_0xca1a('0xa0'));_0x14a75c['field']('COUNT(*)',_0xca1a('0x42'));_0x206259[_0xca1a('0x1d')](_0x25983b[_0xca1a('0x1d')]||_0x5b59e7);_0x206259[_0xca1a('0x1c')](_0x25983b[_0xca1a('0x1c')]||0x0);return dbH[_0xca1a('0x82')][_0xca1a('0x33')](_0x14a75c[_0xca1a('0x81')](),{'type':dbH[_0xca1a('0x82')]['QueryTypes'][_0xca1a('0x83')]})[_0xca1a('0x24')](function(_0x1c519c){if(!_0x1c519c[_0xca1a('0x37')]){_0x2903fb=0x0;}else{_0x2903fb=_0x1c519c[0x0][_0xca1a('0x42')]||0x0;}return dbH[_0xca1a('0x82')][_0xca1a('0x33')](_0x206259[_0xca1a('0x81')](),{'type':dbH['sequelize']['QueryTypes'][_0xca1a('0x83')]});})['then'](function(_0x37c0c7){return{'rows':_0x37c0c7||[],'count':_0x2903fb};});}});}exports[_0xca1a('0xa1')]=function(_0x333289,_0x35c9d4){return runReport(_0x333289['params'],_0x333289['query'],_0x333289['options'])[_0xca1a('0x24')](respondWithResult(_0x35c9d4,null))['catch'](handleError(_0x35c9d4,null));};exports[_0xca1a('0xa2')]=runReport;exports[_0xca1a('0x33')]=function(_0x971aaa,_0x4d42a5){var _0x51fc53=0xa;var _0xc3a3ab=[_0xca1a('0x52'),_0xca1a('0x84'),_0xca1a('0x53'),_0xca1a('0x85')];var _0x2c2782={'SUM':'SUM(%s)','COUNT':_0xca1a('0x86'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xca1a('0x55'),'MIN':'MIN(%s)','AVG':_0xca1a('0x56'),'GROUP_CONCAT':_0xca1a('0x57'),'GROUP_CONCAT ASC':_0xca1a('0x58'),'GROUP_CONCAT DESC':_0xca1a('0x59')};var _0x27b695={'SEC_TO_TIME':_0xca1a('0x88'),'DATE':'DATE(%s)','HOUR':_0xca1a('0x5b'),'ROUND':_0xca1a('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x174284=function(_0x49e6cd){return!_[_0xca1a('0x5d')](['IS\x20NULL',_0xca1a('0x8a'),_0xca1a('0x5f'),_0xca1a('0x60')],_0x49e6cd);};var _0x1cbfee=function(_0x145d95){if(!_0x145d95||!_0x145d95['rules'][_0xca1a('0x37')]){return'';}for(var _0x5114db='(',_0x127ed2=0x0;_0x127ed2<_0x145d95['rules'][_0xca1a('0x37')];_0x127ed2+=0x1){_0x127ed2>0x0&&(_0x5114db+='\x20'+_0x145d95[_0xca1a('0x62')]+'\x20');_0x5114db+=_0x145d95[_0xca1a('0x61')][_0x127ed2][_0xca1a('0x63')]?_0x1cbfee(_0x145d95['rules'][_0x127ed2][_0xca1a('0x63')]):_0x145d95['rules'][_0x127ed2]['field']+'\x20'+_0x145d95[_0xca1a('0x61')][_0x127ed2][_0xca1a('0x64')]+(_0x174284(_0x145d95[_0xca1a('0x61')][_0x127ed2][_0xca1a('0x64')])?'\x20'+_0x145d95[_0xca1a('0x61')][_0x127ed2][_0xca1a('0x65')]:'');}return _0x5114db+')';};var _0x151211={'where':{'id':_0x971aaa[_0xca1a('0x48')]['id']}},_0xb36e2,_0x4b9353,_0x47fd5c,_0x148b9d,_0x4d50de;_0x151211=_[_0xca1a('0x66')]({},_0x151211,_0x971aaa[_0xca1a('0x41')]);return db['AnalyticCustomReport']['find'](_0x151211)[_0xca1a('0x24')](function(_0x20d190){if(_0x20d190){_0xb36e2=_0x20d190;return _0x20d190[_0xca1a('0x8b')]();}return null;})['then'](function(_0x3fb5a3){if(_0x3fb5a3){if(!_0x3fb5a3['length']){throw new db[(_0xca1a('0x67'))]['ValidationErrorItem'](_0xca1a('0x8c'),0x193);}_0x4b9353=_0x3fb5a3;return db[_0xca1a('0x69')]['findAll']({'raw':!![]});}return null;})[_0xca1a('0x24')](function(_0x23bfc7){if(_0x23bfc7){_0x47fd5c=_['keyBy'](_0x23bfc7,'id');var _0x32f6ef;var _0x3c0f10=squel[_0xca1a('0x6b')]();_0x3c0f10[_0xca1a('0x6c')](_0xb36e2[_0xca1a('0x6d')]);for(var _0xf1df5b=0x0;_0xf1df5b<_0x4b9353['length'];_0xf1df5b+=0x1){_0x32f6ef=_0x4b9353[_0xf1df5b][_0xca1a('0x6e')]?_0x47fd5c[_0x4b9353[_0xf1df5b]['MetricId']][_0xca1a('0x6f')]:_0x4b9353[_0xf1df5b][_0xca1a('0x70')];_0x32f6ef=_0x4b9353[_0xf1df5b][_0xca1a('0x72')]?_['replace'](_0x2c2782[_0x4b9353[_0xf1df5b][_0xca1a('0x72')]],'%s',_0x32f6ef):_0x32f6ef;_0x32f6ef=_0x4b9353[_0xf1df5b]['format']?_['replace'](_0x27b695[_0x4b9353[_0xf1df5b]['format']],'%s',_0x32f6ef):_0x32f6ef;if(_0x4b9353[_0xf1df5b][_0xca1a('0x74')]){_0x3c0f10[_0xca1a('0x63')](_0x32f6ef);}_0x4b9353[_0xf1df5b][_0xca1a('0x8d')]&&_0x3c0f10['order'](_0x32f6ef,_0x4b9353[_0xf1df5b][_0xca1a('0x8d')]===_0xca1a('0x75')?![]:!![]);_0x3c0f10['field'](_0x32f6ef,_0x4b9353[_0xf1df5b][_0xca1a('0x76')]||_0x32f6ef);}if(_0xb36e2['joins']){_0xb36e2[_0xca1a('0x77')]=JSON[_0xca1a('0x78')](_0xb36e2[_0xca1a('0x77')]);for(var _0x535d9a=0x0;_0x535d9a<_0xb36e2['joins'][_0xca1a('0x37')];_0x535d9a+=0x1){if(_0xb36e2[_0xca1a('0x77')][_0x535d9a][_0xca1a('0x31')]&&_[_0xca1a('0x5d')](_0xc3a3ab,_0xb36e2[_0xca1a('0x77')][_0x535d9a]['type'])&&_0xb36e2[_0xca1a('0x77')][_0x535d9a][_0xca1a('0x7c')]&&_0xb36e2['joins'][_0x535d9a][_0xca1a('0x79')]&&_0xb36e2[_0xca1a('0x77')][_0x535d9a][_0xca1a('0x7a')]){_0x3c0f10[_0xb36e2['joins'][_0x535d9a][_0xca1a('0x31')]](_0xb36e2[_0xca1a('0x77')][_0x535d9a]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0xb36e2[_0xca1a('0x6d')],_0xb36e2[_0xca1a('0x77')][_0x535d9a][_0xca1a('0x7c')],_0xb36e2[_0xca1a('0x77')][_0x535d9a][_0xca1a('0x79')],_0xb36e2['joins'][_0x535d9a][_0xca1a('0x7a')]));}}}if(_0xb36e2['conditions']){_0xb36e2['conditions']=JSON[_0xca1a('0x78')](_0xb36e2['conditions']);_0x3c0f10[_0xca1a('0x3f')](_0x1cbfee(_0xb36e2[_0xca1a('0x7d')][_0xca1a('0x63')]));}_0x4d50de=_0x3c0f10[_0xca1a('0x7e')]();_0x3c0f10[_0xca1a('0x1d')](_0x51fc53);_0x3c0f10['offset'](0x0);logger[_0xca1a('0x7f')](_0xca1a('0x80'),_0x3c0f10[_0xca1a('0x81')]());return dbH[_0xca1a('0x82')][_0xca1a('0x33')](_0x3c0f10['toString'](),{'type':dbH[_0xca1a('0x82')][_0xca1a('0xa3')]['SELECT']});}})[_0xca1a('0x24')](function(){return{'sql':_0x4d50de[_0xca1a('0x81')]()};})[_0xca1a('0x24')](respondWithResult(_0x4d42a5,null))[_0xca1a('0x46')](handleError(_0x4d42a5,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 9975069..3a85dd5 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 _0x674d=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0x674d,0x1c5));var _0xd674=function(_0xf47939,_0x124b6a){_0xf47939=_0xf47939-0x0;var _0x5f1ec1=_0x674d[_0xf47939];return _0x5f1ec1;};'use strict';var _=require(_0xd674('0x0'));var util=require(_0xd674('0x1'));var logger=require(_0xd674('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd674('0x3'));var rp=require(_0xd674('0x4'));var fs=require('fs');var path=require(_0xd674('0x5'));var rimraf=require(_0xd674('0x6'));var config=require(_0xd674('0x7'));var attributes=require(_0xd674('0x8'));module[_0xd674('0x9')]=function(_0x451e4f,_0x26ec5d){return _0x451e4f[_0xd674('0xa')](_0xd674('0xb'),attributes,{'tableName':_0xd674('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x582d=['request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xb4f654,_0x33ce4b){var _0x521323=function(_0x531016){while(--_0x531016){_0xb4f654['push'](_0xb4f654['shift']());}};_0x521323(++_0x33ce4b);}(_0x582d,0x14a));var _0xd582=function(_0x19d30f,_0x59d859){_0x19d30f=_0x19d30f-0x0;var _0x4cf401=_0x582d[_0x19d30f];return _0x4cf401;};'use strict';var _=require(_0xd582('0x0'));var util=require(_0xd582('0x1'));var logger=require(_0xd582('0x2'))(_0xd582('0x3'));var moment=require(_0xd582('0x4'));var BPromise=require(_0xd582('0x5'));var rp=require(_0xd582('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd582('0x7'));var config=require(_0xd582('0x8'));var attributes=require(_0xd582('0x9'));module[_0xd582('0xa')]=function(_0x109bc1,_0x2484a6){return _0x109bc1[_0xd582('0xb')](_0xd582('0xc'),attributes,{'tableName':_0xd582('0xd'),'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 a9aa098..82f9779 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 _0x1147=['client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x54bbf0,_0x218cef){var _0x1e54ac=function(_0x31a233){while(--_0x31a233){_0x54bbf0['push'](_0x54bbf0['shift']());}};_0x1e54ac(++_0x218cef);}(_0x1147,0x12a));var _0x7114=function(_0x18ec8d,_0xe7f6be){_0x18ec8d=_0x18ec8d-0x0;var _0x2b162e=_0x1147[_0x18ec8d];return _0x2b162e;};'use strict';var _=require('lodash');var util=require(_0x7114('0x0'));var moment=require(_0x7114('0x1'));var BPromise=require(_0x7114('0x2'));var rs=require(_0x7114('0x3'));var fs=require('fs');var Redis=require(_0x7114('0x4'));var db=require(_0x7114('0x5'))['db'];var utils=require(_0x7114('0x6'));var logger=require('../../config/logger')(_0x7114('0x7'));var config=require(_0x7114('0x8'));var jayson=require(_0x7114('0x9'));var client=jayson[_0x7114('0xa')][_0x7114('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24b175,_0xb5170f,_0x172977){return new BPromise(function(_0x4fc97d,_0xd6da87){return client[_0x7114('0xc')](_0x24b175,_0x172977)[_0x7114('0xd')](function(_0x38f9dd){logger['info'](_0x7114('0xe'),_0xb5170f,_0x7114('0xf'));logger[_0x7114('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xb5170f,'request\x20sent',JSON[_0x7114('0x11')](_0x38f9dd));if(_0x38f9dd['error']){if(_0x38f9dd['error']['code']===0x1f4){logger[_0x7114('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xb5170f,_0x38f9dd[_0x7114('0x12')][_0x7114('0x13')]);return _0xd6da87(_0x38f9dd[_0x7114('0x12')][_0x7114('0x13')]);}logger[_0x7114('0x12')](_0x7114('0xe'),_0xb5170f,_0x38f9dd[_0x7114('0x12')][_0x7114('0x13')]);return _0x4fc97d(_0x38f9dd['error']['message']);}else{logger['info'](_0x7114('0xe'),_0xb5170f,_0x7114('0xf'));_0x4fc97d(_0x38f9dd[_0x7114('0x14')][_0x7114('0x13')]);}})[_0x7114('0x15')](function(_0xb0b9a6){logger[_0x7114('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0xb5170f,_0xb0b9a6);_0xd6da87(_0xb0b9a6);});});}
\ No newline at end of file
+var _0xba41=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','lodash'];(function(_0x166953,_0x214d3a){var _0x4a8baf=function(_0x4de85c){while(--_0x4de85c){_0x166953['push'](_0x166953['shift']());}};_0x4a8baf(++_0x214d3a);}(_0xba41,0xaa));var _0x1ba4=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xba41[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x1ba4('0x0'));var util=require(_0x1ba4('0x1'));var moment=require(_0x1ba4('0x2'));var BPromise=require(_0x1ba4('0x3'));var rs=require(_0x1ba4('0x4'));var fs=require('fs');var Redis=require(_0x1ba4('0x5'));var db=require(_0x1ba4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1ba4('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ba4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe355e0,_0x2a0f90,_0x452a5a){return new BPromise(function(_0x1cd322,_0xeb5aee){return client['request'](_0xe355e0,_0x452a5a)[_0x1ba4('0x9')](function(_0xfa74df){logger[_0x1ba4('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2a0f90,'request\x20sent');logger[_0x1ba4('0xb')](_0x1ba4('0xc'),_0x2a0f90,_0x1ba4('0xd'),JSON[_0x1ba4('0xe')](_0xfa74df));if(_0xfa74df['error']){if(_0xfa74df[_0x1ba4('0xf')][_0x1ba4('0x10')]===0x1f4){logger[_0x1ba4('0xf')](_0x1ba4('0x11'),_0x2a0f90,_0xfa74df[_0x1ba4('0xf')][_0x1ba4('0x12')]);return _0xeb5aee(_0xfa74df[_0x1ba4('0xf')][_0x1ba4('0x12')]);}logger[_0x1ba4('0xf')](_0x1ba4('0x11'),_0x2a0f90,_0xfa74df[_0x1ba4('0xf')][_0x1ba4('0x12')]);return _0x1cd322(_0xfa74df['error']['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2a0f90,_0x1ba4('0xd'));_0x1cd322(_0xfa74df['result'][_0x1ba4('0x12')]);}})['catch'](function(_0x584c48){logger[_0x1ba4('0xf')](_0x1ba4('0x11'),_0x2a0f90,_0x584c48);_0xeb5aee(_0x584c48);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index d77e840..e8db83a 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 _0xd676=['update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query','post','create','put'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0xd676,0x76));var _0x6d67=function(_0xaefa77,_0x34c56d){_0xaefa77=_0xaefa77-0x0;var _0x159f15=_0xd676[_0xaefa77];return _0x159f15;};'use strict';var multer=require(_0x6d67('0x0'));var util=require('util');var path=require(_0x6d67('0x1'));var timeout=require(_0x6d67('0x2'));var express=require(_0x6d67('0x3'));var router=express['Router']();var fs_extra=require(_0x6d67('0x4'));var auth=require(_0x6d67('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6d67('0x6'));var controller=require(_0x6d67('0x7'));router[_0x6d67('0x8')]('/',auth[_0x6d67('0x9')](),controller[_0x6d67('0xa')]);router[_0x6d67('0x8')](_0x6d67('0xb'),auth[_0x6d67('0x9')](),controller[_0x6d67('0xc')]);router[_0x6d67('0x8')](_0x6d67('0xd'),auth['isAuthenticated'](),controller[_0x6d67('0xe')]);router[_0x6d67('0x8')]('/:id/run',auth[_0x6d67('0x9')](),controller[_0x6d67('0xf')]);router[_0x6d67('0x8')](_0x6d67('0x10'),auth[_0x6d67('0x9')](),controller['query']);router[_0x6d67('0x11')]('/',auth['isAuthenticated'](),controller[_0x6d67('0x12')]);router[_0x6d67('0x13')](_0x6d67('0xb'),auth['isAuthenticated'](),controller[_0x6d67('0x14')]);router[_0x6d67('0x15')](_0x6d67('0xb'),auth[_0x6d67('0x9')](),controller[_0x6d67('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x9ee9=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','destroy','exports','multer'];(function(_0x577fc1,_0x4aaf10){var _0x4c9a79=function(_0x5302cd){while(--_0x5302cd){_0x577fc1['push'](_0x577fc1['shift']());}};_0x4c9a79(++_0x4aaf10);}(_0x9ee9,0x11d));var _0x99ee=function(_0x368cbe,_0x36331c){_0x368cbe=_0x368cbe-0x0;var _0x2a04de=_0x9ee9[_0x368cbe];return _0x2a04de;};'use strict';var multer=require(_0x99ee('0x0'));var util=require(_0x99ee('0x1'));var path=require(_0x99ee('0x2'));var timeout=require(_0x99ee('0x3'));var express=require('express');var router=express[_0x99ee('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x99ee('0x5'));var config=require(_0x99ee('0x6'));var controller=require(_0x99ee('0x7'));router[_0x99ee('0x8')]('/',auth[_0x99ee('0x9')](),controller[_0x99ee('0xa')]);router[_0x99ee('0x8')](_0x99ee('0xb'),auth[_0x99ee('0x9')](),controller['show']);router[_0x99ee('0x8')](_0x99ee('0xc'),auth[_0x99ee('0x9')](),controller[_0x99ee('0xd')]);router[_0x99ee('0x8')](_0x99ee('0xe'),auth[_0x99ee('0x9')](),controller[_0x99ee('0xf')]);router[_0x99ee('0x8')](_0x99ee('0x10'),auth[_0x99ee('0x9')](),controller['query']);router['post']('/',auth[_0x99ee('0x9')](),controller[_0x99ee('0x11')]);router[_0x99ee('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x99ee('0x13')]);router['delete'](_0x99ee('0xb'),auth[_0x99ee('0x9')](),controller[_0x99ee('0x14')]);module[_0x99ee('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index a423f21..e524d7f 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 _0x2eb2=['TEXT','exports','STRING'];(function(_0x39194a,_0x10366c){var _0x21af77=function(_0x6e421b){while(--_0x6e421b){_0x39194a['push'](_0x39194a['shift']());}};_0x21af77(++_0x10366c);}(_0x2eb2,0x19f));var _0x22eb=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x2eb2[_0x12d033];return _0x3b4e80;};'use strict';var Sequelize=require('sequelize');module[_0x22eb('0x0')]={'name':{'type':Sequelize[_0x22eb('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x22eb('0x1')]},'parent':{'type':Sequelize[_0x22eb('0x1')]},'table':{'type':Sequelize[_0x22eb('0x1')]},'conditions':{'type':Sequelize[_0x22eb('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x326f=['STRING','TEXT','sequelize'];(function(_0xaf70a4,_0x8a3649){var _0x35eee1=function(_0x492eb8){while(--_0x492eb8){_0xaf70a4['push'](_0xaf70a4['shift']());}};_0x35eee1(++_0x8a3649);}(_0x326f,0xd1));var _0xf326=function(_0x10cc01,_0x122eb2){_0x10cc01=_0x10cc01-0x0;var _0x29a7c6=_0x326f[_0x10cc01];return _0x29a7c6;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf326('0x1')]},'parent':{'type':Sequelize[_0xf326('0x1')]},'table':{'type':Sequelize[_0xf326('0x1')]},'conditions':{'type':Sequelize[_0xf326('0x2')]},'joins':{'type':Sequelize[_0xf326('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 7fb311f..991a4a2 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 _0x46ed=['SEC_TO_TIME(%s)','value','AnalyticMetric','select','DESC','output','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../files/reports','savename','countTable','COUNT(*)','sequelize','runReport','left_join','COUNT(%s)','MIN(%s)','AVG(%s)','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Reports','UserProfileSection','userProfileId','autoAssociation','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','QueryTypes','SELECT'];(function(_0x4c8dfa,_0xd9c68b){var _0x2ec23b=function(_0x3e151b){while(--_0x3e151b){_0x4c8dfa['push'](_0x4c8dfa['shift']());}};_0x2ec23b(++_0xd9c68b);}(_0x46ed,0x168));var _0xd46e=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x46ed[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0xd46e('0x0'));var rimraf=require(_0xd46e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd46e('0x2'));var rp=require(_0xd46e('0x3'));var moment=require(_0xd46e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd46e('0x5'));var util=require(_0xd46e('0x6'));var path=require('path');var sox=require(_0xd46e('0x7'));var csv=require(_0xd46e('0x8'));var ejs=require(_0xd46e('0x9'));var fs=require('fs');var fs_extra=require(_0xd46e('0xa'));var _=require(_0xd46e('0xb'));var squel=require(_0xd46e('0xc'));var crypto=require(_0xd46e('0xd'));var jsforce=require(_0xd46e('0xe'));var deskjs=require(_0xd46e('0xf'));var toCsv=require(_0xd46e('0x8'));var querystring=require(_0xd46e('0x10'));var Papa=require('papaparse');var Redis=require(_0xd46e('0x11'));var authService=require(_0xd46e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd46e('0x13'));var hardwareService=require(_0xd46e('0x14'));var logger=require(_0xd46e('0x15'))(_0xd46e('0x16'));var utils=require(_0xd46e('0x17'));var config=require(_0xd46e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd46e('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xf3048c,_0x27dbfb){_0x27dbfb=_0x27dbfb||0xcc;return function(_0x53b309){if(_0x53b309){return _0xf3048c['sendStatus'](_0x27dbfb);}return _0xf3048c[_0xd46e('0x1a')](_0x27dbfb)[_0xd46e('0x1b')]();};}function respondWithResult(_0x1e9aae,_0x3fdf88){_0x3fdf88=_0x3fdf88||0xc8;return function(_0x50c7c3){if(_0x50c7c3){return _0x1e9aae[_0xd46e('0x1a')](_0x3fdf88)[_0xd46e('0x1c')](_0x50c7c3);}};}function respondWithFilteredResult(_0x417402,_0x3d72ce){return function(_0x36a317){if(_0x36a317){var _0x47fa8f=typeof _0x3d72ce[_0xd46e('0x1d')]===_0xd46e('0x1e')&&typeof _0x3d72ce[_0xd46e('0x1f')]==='undefined';var _0x5ddd04=_0x36a317[_0xd46e('0x20')];var _0x1bd574=_0x47fa8f?0x0:_0x3d72ce['offset'];var _0x4fd1f2=_0x47fa8f?_0x36a317[_0xd46e('0x20')]:_0x3d72ce[_0xd46e('0x1d')]+_0x3d72ce[_0xd46e('0x1f')];var _0x2273c5;if(_0x4fd1f2>=_0x5ddd04){_0x4fd1f2=_0x5ddd04;_0x2273c5=0xc8;}else{_0x2273c5=0xce;}_0x417402[_0xd46e('0x1a')](_0x2273c5);return _0x417402[_0xd46e('0x21')](_0xd46e('0x22'),_0x1bd574+'-'+_0x4fd1f2+'/'+_0x5ddd04)[_0xd46e('0x1c')](_0x36a317);}return null;};}function patchUpdates(_0xb4940){return function(_0x3c7e91){try{jsonpatch[_0xd46e('0x23')](_0x3c7e91,_0xb4940,!![]);}catch(_0x5ba94d){return BPromise[_0xd46e('0x24')](_0x5ba94d);}return _0x3c7e91[_0xd46e('0x25')]();};}function saveUpdates(_0x79aa51,_0x45ce0b){return function(_0x128246){if(_0x128246){return _0x128246[_0xd46e('0x26')](_0x79aa51)[_0xd46e('0x27')](function(_0x8a1be){return _0x8a1be;});}return null;};}function removeEntity(_0x62dea5,_0x4cf899){return function(_0x314570){if(_0x314570){return _0x314570['destroy']()['then'](function(){var _0x371054=_0x314570[_0xd46e('0x28')]({'plain':!![]});var _0x21135f=_0xd46e('0x29');return db[_0xd46e('0x2a')][_0xd46e('0x2b')]({'where':{'type':_0x21135f,'resourceId':_0x371054['id']}})[_0xd46e('0x27')](function(){return _0x314570;});})['then'](function(){_0x62dea5[_0xd46e('0x1a')](0xcc)[_0xd46e('0x1b')]();});}};}function handleEntityNotFound(_0xddbce9,_0x17db79){return function(_0x96f15c){if(!_0x96f15c){_0xddbce9[_0xd46e('0x2c')](0x194);}return _0x96f15c;};}function handleError(_0x58aeef,_0x465d54){_0x465d54=_0x465d54||0x1f4;return function(_0x3a1ced){logger[_0xd46e('0x2d')](_0x3a1ced[_0xd46e('0x2e')]);if(_0x3a1ced[_0xd46e('0x2f')]){delete _0x3a1ced[_0xd46e('0x2f')];}_0x58aeef[_0xd46e('0x1a')](_0x465d54)[_0xd46e('0x30')](_0x3a1ced);};}exports[_0xd46e('0x31')]=function(_0x45ea47,_0x2ff785){var _0x504324={},_0x2f4a1b={},_0x5ed8dc={'count':0x0,'rows':[]};var _0x1248ce=_[_0xd46e('0x32')](db[_0xd46e('0x33')][_0xd46e('0x34')],function(_0x5ef248){return{'name':_0x5ef248[_0xd46e('0x35')],'type':_0x5ef248[_0xd46e('0x36')]['key']};});_0x2f4a1b[_0xd46e('0x37')]=_[_0xd46e('0x32')](_0x1248ce,'name');_0x2f4a1b[_0xd46e('0x38')]=_[_0xd46e('0x39')](_0x45ea47[_0xd46e('0x38')]);_0x2f4a1b['filters']=_['intersection'](_0x2f4a1b[_0xd46e('0x37')],_0x2f4a1b[_0xd46e('0x38')]);_0x504324[_0xd46e('0x3a')]=_[_0xd46e('0x3b')](_0x2f4a1b[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x504324['attributes']=_0x504324[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x504324[_0xd46e('0x3a')]:_0x2f4a1b[_0xd46e('0x37')];if(!_0x45ea47[_0xd46e('0x38')][_0xd46e('0x3e')](_0xd46e('0x3f'))){_0x504324['limit']=qs[_0xd46e('0x1f')](_0x45ea47[_0xd46e('0x38')]['limit']);_0x504324[_0xd46e('0x1d')]=qs[_0xd46e('0x1d')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x1d')]);}_0x504324['order']=qs[_0xd46e('0x40')](_0x45ea47[_0xd46e('0x38')][_0xd46e('0x40')]);_0x504324[_0xd46e('0x41')]=qs[_0xd46e('0x42')](_[_0xd46e('0x43')](_0x45ea47[_0xd46e('0x38')],_0x2f4a1b[_0xd46e('0x42')]),_0x1248ce);if(_0x45ea47['query'][_0xd46e('0x44')]){_0x504324[_0xd46e('0x41')]=_[_0xd46e('0x45')](_0x504324[_0xd46e('0x41')],{'$or':_[_0xd46e('0x32')](_0x1248ce,function(_0x56f99c){if(_0x56f99c[_0xd46e('0x36')]!=='VIRTUAL'){var _0x55230d={};_0x55230d[_0x56f99c['name']]={'$like':'%'+_0x45ea47['query'][_0xd46e('0x44')]+'%'};return _0x55230d;}})});}_0x504324=_['merge']({},_0x504324,_0x45ea47[_0xd46e('0x46')]);var _0x40720e={'where':_0x504324['where']};return db[_0xd46e('0x33')][_0xd46e('0x20')](_0x40720e)[_0xd46e('0x27')](function(_0x31ba12){_0x5ed8dc[_0xd46e('0x20')]=_0x31ba12;if(_0x45ea47[_0xd46e('0x38')][_0xd46e('0x47')]){_0x504324[_0xd46e('0x48')]=[{'all':!![]}];}return db[_0xd46e('0x33')][_0xd46e('0x49')](_0x504324);})[_0xd46e('0x27')](function(_0x5ea048){_0x5ed8dc['rows']=_0x5ea048;return _0x5ed8dc;})['then'](respondWithFilteredResult(_0x2ff785,_0x504324))[_0xd46e('0x4a')](handleError(_0x2ff785,null));};exports['show']=function(_0x168d35,_0x272f5f){var _0x3fdf67={'raw':!![],'where':{'id':_0x168d35[_0xd46e('0x4b')]['id']}},_0x416505={};_0x416505[_0xd46e('0x37')]=_[_0xd46e('0x39')](db[_0xd46e('0x33')]['rawAttributes']);_0x416505[_0xd46e('0x38')]=_['keys'](_0x168d35[_0xd46e('0x38')]);_0x416505[_0xd46e('0x42')]=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],_0x416505[_0xd46e('0x38')]);_0x3fdf67['attributes']=_[_0xd46e('0x3b')](_0x416505[_0xd46e('0x37')],qs[_0xd46e('0x3c')](_0x168d35[_0xd46e('0x38')][_0xd46e('0x3c')]));_0x3fdf67['attributes']=_0x3fdf67[_0xd46e('0x3a')][_0xd46e('0x3d')]?_0x3fdf67[_0xd46e('0x3a')]:_0x416505[_0xd46e('0x37')];if(_0x168d35[_0xd46e('0x38')]['includeAll']){_0x3fdf67[_0xd46e('0x48')]=[{'all':!![]}];}_0x3fdf67=_[_0xd46e('0x45')]({},_0x3fdf67,_0x168d35[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fdf67)[_0xd46e('0x27')](handleEntityNotFound(_0x272f5f,null))[_0xd46e('0x27')](respondWithResult(_0x272f5f,null))[_0xd46e('0x4a')](handleError(_0x272f5f,null));};exports['create']=function(_0xf9dab,_0x71a8dc){return db[_0xd46e('0x33')][_0xd46e('0x4d')](_0xf9dab[_0xd46e('0x4e')],{})['then'](function(_0x4ae314){var _0x3a94cf=_0xf9dab[_0xd46e('0x4f')][_0xd46e('0x28')]({'plain':!![]});if(!_0x3a94cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a94cf['role']===_0xd46e('0x4f')){var _0x9d8638=_0x4ae314['get']({'plain':!![]});var _0x2eee92=_0xd46e('0x50');return db[_0xd46e('0x51')][_0xd46e('0x4c')]({'where':{'name':_0x2eee92,'userProfileId':_0x3a94cf[_0xd46e('0x52')]},'raw':!![]})[_0xd46e('0x27')](function(_0x80ed51){if(_0x80ed51&&_0x80ed51[_0xd46e('0x53')]===0x0){return db['UserProfileResource'][_0xd46e('0x4d')]({'name':_0x9d8638[_0xd46e('0x2f')],'resourceId':_0x9d8638['id'],'type':_0xd46e('0x29'),'sectionId':_0x80ed51['id']},{})[_0xd46e('0x27')](function(){return _0x4ae314;});}else{return _0x4ae314;}})['catch'](function(_0x56dd9a){logger[_0xd46e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56dd9a);throw _0x56dd9a;});}return _0x4ae314;})[_0xd46e('0x27')](respondWithResult(_0x71a8dc,0xc9))[_0xd46e('0x4a')](handleError(_0x71a8dc,null));};exports[_0xd46e('0x26')]=function(_0x31f7eb,_0x5a7870){if(_0x31f7eb[_0xd46e('0x4e')]['id']){delete _0x31f7eb['body']['id'];}return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x31f7eb[_0xd46e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7870,null))[_0xd46e('0x27')](saveUpdates(_0x31f7eb[_0xd46e('0x4e')],null))[_0xd46e('0x27')](respondWithResult(_0x5a7870,null))[_0xd46e('0x4a')](handleError(_0x5a7870,null));};exports[_0xd46e('0x2b')]=function(_0x2cc676,_0x2760ef){return db[_0xd46e('0x33')][_0xd46e('0x4c')]({'where':{'id':_0x2cc676[_0xd46e('0x4b')]['id']}})[_0xd46e('0x27')](handleEntityNotFound(_0x2760ef,null))[_0xd46e('0x27')](removeEntity(_0x2760ef,null))[_0xd46e('0x4a')](handleError(_0x2760ef,null));};exports[_0xd46e('0x54')]=function(_0x47a86c,_0x3ec709){var _0x37a22f=0xa;var _0xe0cd61=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0xaf9641={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x481dce={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x2dacb4=function(_0x2f9fcb){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x2f9fcb);};var _0x1aaa99=function(_0x272514){if(!_0x272514||!_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x476f09='(',_0x5067b7=0x0;_0x5067b7<_0x272514[_0xd46e('0x67')][_0xd46e('0x3d')];_0x5067b7+=0x1){_0x5067b7>0x0&&(_0x476f09+='\x20'+_0x272514[_0xd46e('0x68')]+'\x20');_0x476f09+=_0x272514['rules'][_0x5067b7][_0xd46e('0x69')]?_0x1aaa99(_0x272514[_0xd46e('0x67')][_0x5067b7]['group']):_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6a')]+'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['condition']+(_0x2dacb4(_0x272514[_0xd46e('0x67')][_0x5067b7][_0xd46e('0x6b')])?'\x20'+_0x272514[_0xd46e('0x67')][_0x5067b7]['value']:'');}return _0x476f09+')';};var _0xe5f8cd={'where':{'id':_0x47a86c[_0xd46e('0x4b')]['id']}},_0x516e7d,_0x32eed0,_0x148187,_0x35db1b,_0x4f3ba0;_0xe5f8cd=_[_0xd46e('0x45')]({},_0xe5f8cd,_0x47a86c[_0xd46e('0x46')]);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0xe5f8cd)[_0xd46e('0x27')](function(_0x16f906){if(_0x16f906){_0x516e7d=_0x16f906;return _0x16f906[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0x3e55a3){if(_0x3e55a3){if(!_0x3e55a3[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))](_0xd46e('0x6f'),0x193);}_0x32eed0=_0x3e55a3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3e0ed5){if(_0x3e0ed5){_0x148187=_[_0xd46e('0x70')](_0x3e0ed5,'id');var _0x2fff69;var _0x249938=squel['select']();_0x249938[_0xd46e('0x71')](_0x516e7d[_0xd46e('0x72')]);for(var _0xfb4073=0x0;_0xfb4073<_0x32eed0[_0xd46e('0x3d')];_0xfb4073+=0x1){_0x2fff69=_0x32eed0[_0xfb4073]['MetricId']?_0x148187[_0x32eed0[_0xfb4073][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x32eed0[_0xfb4073]['field'];_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0xaf9641[_0x32eed0[_0xfb4073]['function']],'%s',_0x2fff69):_0x2fff69;_0x2fff69=_0x32eed0[_0xfb4073][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x481dce[_0x32eed0[_0xfb4073]['format']],'%s',_0x2fff69):_0x2fff69;if(_0x32eed0[_0xfb4073][_0xd46e('0x78')]){_0x249938['group'](_0x2fff69);}_0x32eed0[_0xfb4073][_0xd46e('0x79')]&&_0x249938[_0xd46e('0x7a')](_0x2fff69,_0x32eed0[_0xfb4073]['orderBy']==='DESC'?![]:!![]);_0x249938[_0xd46e('0x6a')](_0x2fff69,_0x32eed0[_0xfb4073][_0xd46e('0x7b')]||_0x2fff69);}if(_0x516e7d[_0xd46e('0x7c')]){_0x516e7d[_0xd46e('0x7c')]=JSON['parse'](_0x516e7d[_0xd46e('0x7c')]);for(var _0x372509=0x0;_0x372509<_0x516e7d['joins'][_0xd46e('0x3d')];_0x372509+=0x1){if(_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0xe0cd61,_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x36')])&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7d')]&&_0x516e7d[_0xd46e('0x7c')][_0x372509]['foreignTable']&&_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7e')]){_0x249938[_0x516e7d['joins'][_0x372509][_0xd46e('0x36')]](_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0x516e7d[_0xd46e('0x72')],_0x516e7d['joins'][_0x372509]['parentKey'],_0x516e7d[_0xd46e('0x7c')][_0x372509][_0xd46e('0x7f')],_0x516e7d['joins'][_0x372509]['foreignKey']));}}}if(_0x516e7d['conditions']){_0x516e7d[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x516e7d[_0xd46e('0x81')]);_0x249938['where'](_0x1aaa99(_0x516e7d[_0xd46e('0x81')][_0xd46e('0x69')]));}_0x4f3ba0=_0x249938[_0xd46e('0x83')]();_0x249938['limit'](_0x37a22f);_0x249938['offset'](0x0);logger['debug']('Limited\x20Query:',_0x249938[_0xd46e('0x84')]());return dbH['sequelize'][_0xd46e('0x38')](_0x249938['toString'](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](respondWithResult(_0x3ec709,null))[_0xd46e('0x4a')](handleError(_0x3ec709,null));};function runReport(_0xf16d87,_0x99872a,_0x57a7cc){var _0x586024=_0x99872a[_0xd46e('0x2f')];var _0x383919=0xa;var _0x114f2c=[_0xd46e('0x55'),'left_join',_0xd46e('0x56'),_0xd46e('0x57')];var _0x4ca21f={'SUM':_0xd46e('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':_0xd46e('0x5c'),'GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x5ef4cc={'SEC_TO_TIME':_0xd46e('0x87'),'DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':_0xd46e('0x61')};var _0x88460a=function(_0x3a3744){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),_0xd46e('0x64'),_0xd46e('0x65'),_0xd46e('0x66')],_0x3a3744);};var _0x3c476d=function(_0x1b2a6d){if(!_0x1b2a6d||!_0x1b2a6d[_0xd46e('0x67')][_0xd46e('0x3d')]){return'';}for(var _0x441f73='(',_0x1d2738=0x0;_0x1d2738<_0x1b2a6d['rules'][_0xd46e('0x3d')];_0x1d2738+=0x1){_0x1d2738>0x0&&(_0x441f73+='\x20'+_0x1b2a6d['operator']+'\x20');_0x441f73+=_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x69')]?_0x3c476d(_0x1b2a6d['rules'][_0x1d2738][_0xd46e('0x69')]):_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6a')]+'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')]+(_0x88460a(_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x6b')])?'\x20'+_0x1b2a6d[_0xd46e('0x67')][_0x1d2738][_0xd46e('0x88')]:'');}return _0x441f73+')';};var _0x3fa34d={'where':{'id':_0xf16d87['id']}},_0xc098c9,_0x5f5ba7,_0x493df5,_0x18e140,_0x459a0c;_0x3fa34d=_[_0xd46e('0x45')]({},_0x3fa34d,_0x57a7cc);return db[_0xd46e('0x33')][_0xd46e('0x4c')](_0x3fa34d)[_0xd46e('0x27')](function(_0x5b554e){if(_0x5b554e){_0xc098c9=_0x5b554e;return _0x5b554e[_0xd46e('0x6c')]();}return null;})[_0xd46e('0x27')](function(_0xa254f5){if(_0xa254f5){if(!_0xa254f5[_0xd46e('0x3d')]){throw new db[(_0xd46e('0x6d'))][(_0xd46e('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f5ba7=_0xa254f5;return db[_0xd46e('0x89')][_0xd46e('0x49')]({'raw':!![]});}return null;})['then'](function(_0x3c8d68){if(_0x3c8d68){_0x493df5=_[_0xd46e('0x70')](_0x3c8d68,'id');var _0x9e222d;var _0x3da17e=squel[_0xd46e('0x8a')]();_0x3da17e[_0xd46e('0x71')](_0xc098c9[_0xd46e('0x72')]);for(var _0x282f71=0x0;_0x282f71<_0x5f5ba7[_0xd46e('0x3d')];_0x282f71+=0x1){_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x73')]?_0x493df5[_0x5f5ba7[_0x282f71][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x5f5ba7[_0x282f71][_0xd46e('0x6a')];_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x75')]?_['replace'](_0x4ca21f[_0x5f5ba7[_0x282f71]['function']],'%s',_0x9e222d):_0x9e222d;_0x9e222d=_0x5f5ba7[_0x282f71][_0xd46e('0x77')]?_[_0xd46e('0x76')](_0x5ef4cc[_0x5f5ba7[_0x282f71][_0xd46e('0x77')]],'%s',_0x9e222d):_0x9e222d;if(_0x5f5ba7[_0x282f71][_0xd46e('0x78')]){_0x3da17e[_0xd46e('0x69')](_0x9e222d);}_0x5f5ba7[_0x282f71][_0xd46e('0x79')]&&_0x3da17e['order'](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x3da17e[_0xd46e('0x6a')](_0x9e222d,_0x5f5ba7[_0x282f71][_0xd46e('0x7b')]||_0x9e222d);}if(_0xc098c9['joins']){_0xc098c9[_0xd46e('0x7c')]=JSON[_0xd46e('0x82')](_0xc098c9['joins']);for(var _0xdf967c=0x0;_0xdf967c<_0xc098c9['joins']['length'];_0xdf967c+=0x1){if(_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x114f2c,_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['type'])&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7d')]&&_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7f')]&&_0xc098c9['joins'][_0xdf967c]['foreignKey']){_0x3da17e[_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x36')]](_0xc098c9['joins'][_0xdf967c]['foreignTable'],null,util[_0xd46e('0x77')](_0xd46e('0x80'),_0xc098c9[_0xd46e('0x72')],_0xc098c9[_0xd46e('0x7c')][_0xdf967c]['parentKey'],_0xc098c9[_0xd46e('0x7c')][_0xdf967c][_0xd46e('0x7f')],_0xc098c9['joins'][_0xdf967c][_0xd46e('0x7e')]));}}}if(_0xc098c9[_0xd46e('0x81')]){_0xc098c9[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0xc098c9[_0xd46e('0x81')]);_0x3da17e[_0xd46e('0x41')](_0x3c476d(_0xc098c9['conditions'][_0xd46e('0x69')]));}_0x459a0c=_0x3da17e[_0xd46e('0x83')]();_0x3da17e['limit'](_0x383919);_0x3da17e['offset'](0x0);return;}})[_0xd46e('0x27')](function(){if(_0x99872a[_0xd46e('0x8c')]==='web'){return null;}var _0x5e637d=_[_0xd46e('0x45')](_0x99872a,{'name':_0x99872a[_0xd46e('0x8d')]||_0x99872a['name']||_0xc098c9[_0xd46e('0x2f')],'basename':_0x586024,'savename':util[_0xd46e('0x77')](_0xd46e('0x8e'),_0x99872a[_0xd46e('0x2f')]||_0xc098c9[_0xd46e('0x2f')],require(_0xd46e('0x8f'))['generate'](0x4),_0x99872a[_0xd46e('0x8c')]||_0xd46e('0x90')),'reportId':_0xc098c9['id'],'reportType':_0xd46e('0x91')});return db[_0xd46e('0x92')][_0xd46e('0x4d')](_0x5e637d,{'raw':!![]});})[_0xd46e('0x27')](function(_0x3311a6){if(_0xc098c9[_0xd46e('0x72')]===_0xd46e('0x93')){_0x459a0c[_0xd46e('0x41')](_0xc098c9[_0xd46e('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x99872a[_0xd46e('0x94')],_0x99872a['endDate']);}else{_0x459a0c['where'](_0xc098c9[_0xd46e('0x72')]+_0xd46e('0x95'),_0x99872a[_0xd46e('0x94')],_0x99872a[_0xd46e('0x96')]);}if(_0x3311a6){logger[_0xd46e('0x97')](_0xd46e('0x98'),_0x459a0c[_0xd46e('0x84')]());require(_0xd46e('0x99'))['fork'](path[_0xd46e('0x55')](__dirname,'../../components/export/',_0x3311a6[_0xd46e('0x8c')]),[_0x3311a6['id'],_0x459a0c[_0xd46e('0x84')](),path[_0xd46e('0x55')](__dirname,_0xd46e('0x9a'),_0x3311a6[_0xd46e('0x9b')]),_0x586024]);return _0x3311a6;}else{var _0x399918=squel[_0xd46e('0x8a')]();_0x399918[_0xd46e('0x71')]('('+_0x459a0c['toString']()+')',_0xd46e('0x9c'));_0x399918[_0xd46e('0x6a')](_0xd46e('0x9d'),'count');_0x459a0c[_0xd46e('0x1f')](_0x99872a[_0xd46e('0x1f')]||_0x383919);_0x459a0c[_0xd46e('0x1d')](_0x99872a['offset']||0x0);return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x399918[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]})['then'](function(_0x4967ff){if(!_0x4967ff[_0xd46e('0x3d')]){_0x18e140=0x0;}else{_0x18e140=_0x4967ff[0x0][_0xd46e('0x20')]||0x0;}return dbH['sequelize'][_0xd46e('0x38')](_0x459a0c[_0xd46e('0x84')](),{'type':dbH[_0xd46e('0x9e')][_0xd46e('0x85')][_0xd46e('0x86')]});})[_0xd46e('0x27')](function(_0x4bb76b){return{'rows':_0x4bb76b||[],'count':_0x18e140};});}});}exports['run']=function(_0x204a9f,_0x52ca5a){return runReport(_0x204a9f[_0xd46e('0x4b')],_0x204a9f[_0xd46e('0x38')],_0x204a9f['options'])[_0xd46e('0x27')](respondWithResult(_0x52ca5a,null))[_0xd46e('0x4a')](handleError(_0x52ca5a,null));};exports[_0xd46e('0x9f')]=runReport;exports[_0xd46e('0x38')]=function(_0x786ae,_0x537c73){var _0x1610bd=0xa;var _0x20cc4c=[_0xd46e('0x55'),_0xd46e('0xa0'),_0xd46e('0x56'),_0xd46e('0x57')];var _0x368742={'SUM':_0xd46e('0x58'),'COUNT':_0xd46e('0xa1'),'COUNT DISTINCT':_0xd46e('0x59'),'MAX':_0xd46e('0x5a'),'MIN':_0xd46e('0xa2'),'AVG':_0xd46e('0xa3'),'GROUP_CONCAT':_0xd46e('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd46e('0x5d')};var _0x285cf8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xd46e('0x5e'),'HOUR':_0xd46e('0x5f'),'ROUND':_0xd46e('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc87da2=function(_0x195f02){return!_[_0xd46e('0x62')]([_0xd46e('0x63'),'IS\x20NOT\x20NULL',_0xd46e('0x65'),_0xd46e('0x66')],_0x195f02);};var _0x44322f=function(_0x49959f){if(!_0x49959f||!_0x49959f['rules'][_0xd46e('0x3d')]){return'';}for(var _0x2094e5='(',_0x85aac1=0x0;_0x85aac1<_0x49959f[_0xd46e('0x67')][_0xd46e('0x3d')];_0x85aac1+=0x1){_0x85aac1>0x0&&(_0x2094e5+='\x20'+_0x49959f[_0xd46e('0x68')]+'\x20');_0x2094e5+=_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]?_0x44322f(_0x49959f['rules'][_0x85aac1][_0xd46e('0x69')]):_0x49959f['rules'][_0x85aac1][_0xd46e('0x6a')]+'\x20'+_0x49959f['rules'][_0x85aac1]['condition']+(_0xc87da2(_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x6b')])?'\x20'+_0x49959f[_0xd46e('0x67')][_0x85aac1][_0xd46e('0x88')]:'');}return _0x2094e5+')';};var _0x101a29={'where':{'id':_0x786ae[_0xd46e('0x4b')]['id']}},_0x3a44da,_0x417068,_0x52e73e,_0x206077,_0xe729b6;_0x101a29=_[_0xd46e('0x45')]({},_0x101a29,_0x786ae[_0xd46e('0x46')]);return db['AnalyticDefaultReport'][_0xd46e('0x4c')](_0x101a29)[_0xd46e('0x27')](function(_0x1d08bb){if(_0x1d08bb){_0x3a44da=_0x1d08bb;return _0x1d08bb['getFields']();}return null;})[_0xd46e('0x27')](function(_0x8c6ed1){if(_0x8c6ed1){if(!_0x8c6ed1['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xd46e('0x6f'),0x193);}_0x417068=_0x8c6ed1;return db[_0xd46e('0x89')]['findAll']({'raw':!![]});}return null;})[_0xd46e('0x27')](function(_0x3a13f8){if(_0x3a13f8){_0x52e73e=_['keyBy'](_0x3a13f8,'id');var _0x5a8661;var _0x157fb0=squel[_0xd46e('0x8a')]();_0x157fb0[_0xd46e('0x71')](_0x3a44da[_0xd46e('0x72')]);for(var _0x50750f=0x0;_0x50750f<_0x417068['length'];_0x50750f+=0x1){_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x73')]?_0x52e73e[_0x417068[_0x50750f][_0xd46e('0x73')]][_0xd46e('0x74')]:_0x417068[_0x50750f][_0xd46e('0x6a')];_0x5a8661=_0x417068[_0x50750f][_0xd46e('0x75')]?_[_0xd46e('0x76')](_0x368742[_0x417068[_0x50750f][_0xd46e('0x75')]],'%s',_0x5a8661):_0x5a8661;_0x5a8661=_0x417068[_0x50750f]['format']?_[_0xd46e('0x76')](_0x285cf8[_0x417068[_0x50750f][_0xd46e('0x77')]],'%s',_0x5a8661):_0x5a8661;if(_0x417068[_0x50750f]['groupBy']){_0x157fb0[_0xd46e('0x69')](_0x5a8661);}_0x417068[_0x50750f][_0xd46e('0x79')]&&_0x157fb0[_0xd46e('0x7a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x79')]===_0xd46e('0x8b')?![]:!![]);_0x157fb0[_0xd46e('0x6a')](_0x5a8661,_0x417068[_0x50750f][_0xd46e('0x7b')]||_0x5a8661);}if(_0x3a44da[_0xd46e('0x7c')]){_0x3a44da['joins']=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x7c')]);for(var _0x3c819b=0x0;_0x3c819b<_0x3a44da[_0xd46e('0x7c')][_0xd46e('0x3d')];_0x3c819b+=0x1){if(_0x3a44da['joins'][_0x3c819b][_0xd46e('0x36')]&&_[_0xd46e('0x62')](_0x20cc4c,_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')])&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7d')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')]&&_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']){_0x157fb0[_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x36')]](_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a44da[_0xd46e('0x72')],_0x3a44da['joins'][_0x3c819b][_0xd46e('0x7d')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b][_0xd46e('0x7f')],_0x3a44da[_0xd46e('0x7c')][_0x3c819b]['foreignKey']));}}}if(_0x3a44da[_0xd46e('0x81')]){_0x3a44da[_0xd46e('0x81')]=JSON[_0xd46e('0x82')](_0x3a44da[_0xd46e('0x81')]);_0x157fb0[_0xd46e('0x41')](_0x44322f(_0x3a44da[_0xd46e('0x81')][_0xd46e('0x69')]));}_0xe729b6=_0x157fb0[_0xd46e('0x83')]();_0x157fb0[_0xd46e('0x1f')](_0x1610bd);_0x157fb0['offset'](0x0);logger['debug'](_0xd46e('0xa4'),_0x157fb0['toString']());return dbH[_0xd46e('0x9e')][_0xd46e('0x38')](_0x157fb0[_0xd46e('0x84')](),{'type':dbH['sequelize'][_0xd46e('0x85')][_0xd46e('0x86')]});}})[_0xd46e('0x27')](function(){return{'sql':_0xe729b6['toString']()};})['then'](respondWithResult(_0x537c73,null))[_0xd46e('0x4a')](handleError(_0x537c73,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc4aa[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 6168eab..2190d4c 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 _0xefcd=['analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x3539ba,_0x16846e){var _0x10b176=function(_0x36a5a5){while(--_0x36a5a5){_0x3539ba['push'](_0x3539ba['shift']());}};_0x10b176(++_0x16846e);}(_0xefcd,0xb7));var _0xdefc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xefcd[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xdefc('0x0'));var util=require('util');var logger=require(_0xdefc('0x1'))(_0xdefc('0x2'));var moment=require(_0xdefc('0x3'));var BPromise=require(_0xdefc('0x4'));var rp=require(_0xdefc('0x5'));var fs=require('fs');var path=require(_0xdefc('0x6'));var rimraf=require(_0xdefc('0x7'));var config=require(_0xdefc('0x8'));var attributes=require(_0xdefc('0x9'));module['exports']=function(_0x4ead0f,_0x2b40b6){return _0x4ead0f[_0xdefc('0xa')](_0xdefc('0xb'),attributes,{'tableName':_0xdefc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ac8=['../../config/logger','moment','request-promise','path','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x55da67,_0x318930){var _0x13af60=function(_0x1b882a){while(--_0x1b882a){_0x55da67['push'](_0x55da67['shift']());}};_0x13af60(++_0x318930);}(_0x9ac8,0x7f));var _0x89ac=function(_0x31ba51,_0x51ac52){_0x31ba51=_0x31ba51-0x0;var _0x4c9225=_0x9ac8[_0x31ba51];return _0x4c9225;};'use strict';var _=require(_0x89ac('0x0'));var util=require('util');var logger=require(_0x89ac('0x1'))('api');var moment=require(_0x89ac('0x2'));var BPromise=require('bluebird');var rp=require(_0x89ac('0x3'));var fs=require('fs');var path=require(_0x89ac('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x89ac('0x5'));module['exports']=function(_0x11c2de,_0x40c352){return _0x11c2de['define'](_0x89ac('0x6'),attributes,{'tableName':_0x89ac('0x7'),'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 977874d..f89eb86 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 _0x1807=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','ioredis'];(function(_0x41294a,_0x2c4e3e){var _0x3231f1=function(_0x3a2c38){while(--_0x3a2c38){_0x41294a['push'](_0x41294a['shift']());}};_0x3231f1(++_0x2c4e3e);}(_0x1807,0xb9));var _0x7180=function(_0x2feffe,_0x104382){_0x2feffe=_0x2feffe-0x0;var _0x190bb3=_0x1807[_0x2feffe];return _0x190bb3;};'use strict';var _=require(_0x7180('0x0'));var util=require(_0x7180('0x1'));var moment=require(_0x7180('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7180('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7180('0x4'));var logger=require(_0x7180('0x5'))('rpc');var config=require(_0x7180('0x6'));var jayson=require(_0x7180('0x7'));var client=jayson['client'][_0x7180('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c11d0,_0x18ac74,_0x5aa8a9){return new BPromise(function(_0x100e63,_0x22628c){return client[_0x7180('0x9')](_0x5c11d0,_0x5aa8a9)[_0x7180('0xa')](function(_0x452644){logger['info'](_0x7180('0xb'),_0x18ac74,_0x7180('0xc'));logger[_0x7180('0xd')](_0x7180('0xe'),_0x18ac74,_0x7180('0xc'),JSON[_0x7180('0xf')](_0x452644));if(_0x452644[_0x7180('0x10')]){if(_0x452644[_0x7180('0x10')]['code']===0x1f4){logger[_0x7180('0x10')](_0x7180('0xb'),_0x18ac74,_0x452644[_0x7180('0x10')][_0x7180('0x11')]);return _0x22628c(_0x452644[_0x7180('0x10')][_0x7180('0x11')]);}logger[_0x7180('0x10')](_0x7180('0xb'),_0x18ac74,_0x452644[_0x7180('0x10')][_0x7180('0x11')]);return _0x100e63(_0x452644[_0x7180('0x10')][_0x7180('0x11')]);}else{logger[_0x7180('0x12')](_0x7180('0xb'),_0x18ac74,'request\x20sent');_0x100e63(_0x452644[_0x7180('0x13')][_0x7180('0x11')]);}})[_0x7180('0x14')](function(_0x5a1a3c){logger[_0x7180('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x18ac74,_0x5a1a3c);_0x22628c(_0x5a1a3c);});});}
\ No newline at end of file
+var _0x53ec=['catch','lodash','util','moment','../../mysqldb','rpc','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3057dc,_0x587284){var _0x145878=function(_0x463e18){while(--_0x463e18){_0x3057dc['push'](_0x3057dc['shift']());}};_0x145878(++_0x587284);}(_0x53ec,0x1b1));var _0xc53e=function(_0x428ec2,_0x150404){_0x428ec2=_0x428ec2-0x0;var _0x1654d6=_0x53ec[_0x428ec2];return _0x1654d6;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc53e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc53e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc53e('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x453f05,_0x5860df,_0x409207){return new BPromise(function(_0x433aea,_0x174622){return client[_0xc53e('0x6')](_0x453f05,_0x409207)[_0xc53e('0x7')](function(_0x5376b3){logger[_0xc53e('0x8')](_0xc53e('0x9'),_0x5860df,_0xc53e('0xa'));logger[_0xc53e('0xb')](_0xc53e('0xc'),_0x5860df,'request\x20sent',JSON['stringify'](_0x5376b3));if(_0x5376b3['error']){if(_0x5376b3[_0xc53e('0xd')][_0xc53e('0xe')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5860df,_0x5376b3['error'][_0xc53e('0xf')]);return _0x174622(_0x5376b3[_0xc53e('0xd')][_0xc53e('0xf')]);}logger[_0xc53e('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5860df,_0x5376b3['error'][_0xc53e('0xf')]);return _0x433aea(_0x5376b3[_0xc53e('0xd')]['message']);}else{logger[_0xc53e('0x8')](_0xc53e('0x9'),_0x5860df,_0xc53e('0xa'));_0x433aea(_0x5376b3[_0xc53e('0x10')][_0xc53e('0xf')]);}})[_0xc53e('0x11')](function(_0x4c83d7){logger['error'](_0xc53e('0x9'),_0x5860df,_0x4c83d7);_0x174622(_0x4c83d7);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index dfbb907..26d5f73 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 _0x524a=['index','/:id','/:id/preview','isAuthenticated','/:id/run','run','/:id/query','query','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get'];(function(_0x59f79c,_0x5b7ac2){var _0x16eb4f=function(_0x282450){while(--_0x282450){_0x59f79c['push'](_0x59f79c['shift']());}};_0x16eb4f(++_0x5b7ac2);}(_0x524a,0xa4));var _0xa524=function(_0x29026c,_0x5a1f6f){_0x29026c=_0x29026c-0x0;var _0x1be1d9=_0x524a[_0x29026c];return _0x1be1d9;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require(_0xa524('0x4'));var router=express[_0xa524('0x5')]();var fs_extra=require(_0xa524('0x6'));var auth=require(_0xa524('0x7'));var interaction=require(_0xa524('0x8'));var config=require(_0xa524('0x9'));var controller=require(_0xa524('0xa'));router[_0xa524('0xb')]('/',auth['isAuthenticated'](),controller[_0xa524('0xc')]);router[_0xa524('0xb')](_0xa524('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa524('0xb')](_0xa524('0xe'),auth[_0xa524('0xf')](),controller['preview']);router[_0xa524('0xb')](_0xa524('0x10'),auth[_0xa524('0xf')](),controller[_0xa524('0x11')]);router[_0xa524('0xb')](_0xa524('0x12'),auth['isAuthenticated'](),controller[_0xa524('0x13')]);router['post']('/',auth[_0xa524('0xf')](),controller['create']);router['put'](_0xa524('0xd'),auth[_0xa524('0xf')](),controller['update']);router[_0xa524('0x14')](_0xa524('0xd'),auth[_0xa524('0xf')](),controller[_0xa524('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x3383=['index','/:id/preview','/:id/query','post','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x3383,0x1a7));var _0x3338=function(_0x466476,_0x2c8216){_0x466476=_0x466476-0x0;var _0x42d93f=_0x3383[_0x466476];return _0x42d93f;};'use strict';var multer=require(_0x3338('0x0'));var util=require(_0x3338('0x1'));var path=require(_0x3338('0x2'));var timeout=require(_0x3338('0x3'));var express=require('express');var router=express[_0x3338('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3338('0x5'));var interaction=require(_0x3338('0x6'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x3338('0x7')]('/',auth[_0x3338('0x8')](),controller[_0x3338('0x9')]);router[_0x3338('0x7')]('/:id',auth[_0x3338('0x8')](),controller['show']);router[_0x3338('0x7')](_0x3338('0xa'),auth[_0x3338('0x8')](),controller['preview']);router['get']('/:id/run',auth['isAuthenticated'](),controller['run']);router[_0x3338('0x7')](_0x3338('0xb'),auth['isAuthenticated'](),controller['query']);router[_0x3338('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3338('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3338('0xe')]);router[_0x3338('0xf')](_0x3338('0x10'),auth[_0x3338('0x8')](),controller[_0x3338('0x11')]);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 c90a300..e1df3d7 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 _0x2b9e=['DATE','Loading','ENUM','manual','scheduled','UNSIGNED','sequelize','exports','STRING','csv','pdf','xlsx'];(function(_0x185bcc,_0x816a57){var _0x855416=function(_0x2afea4){while(--_0x2afea4){_0x185bcc['push'](_0x185bcc['shift']());}};_0x855416(++_0x816a57);}(_0x2b9e,0x126));var _0xe2b9=function(_0x59562d,_0x3413ed){_0x59562d=_0x59562d-0x0;var _0x2b618e=_0x2b9e[_0x59562d];return _0x2b618e;};'use strict';var Sequelize=require(_0xe2b9('0x0'));var moment=require('moment');module[_0xe2b9('0x1')]={'name':{'type':Sequelize[_0xe2b9('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xe2b9('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe2b9('0x3'),_0xe2b9('0x4'),_0xe2b9('0x5')),'allowNull':![],'defaultValue':_0xe2b9('0x3')},'savename':{'type':Sequelize[_0xe2b9('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe2b9('0x6')]},'endDate':{'type':Sequelize[_0xe2b9('0x6')]},'status':{'type':Sequelize[_0xe2b9('0x2')],'defaultValue':_0xe2b9('0x7')},'type':{'type':Sequelize[_0xe2b9('0x8')](_0xe2b9('0x9'),_0xe2b9('0xa')),'allowNull':![],'defaultValue':_0xe2b9('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xe2b9('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x72c2=['UNSIGNED','moment','STRING','csv','xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER'];(function(_0x5fc9df,_0x120aca){var _0x3a537d=function(_0x4b2ffb){while(--_0x4b2ffb){_0x5fc9df['push'](_0x5fc9df['shift']());}};_0x3a537d(++_0x120aca);}(_0x72c2,0x12a));var _0x272c=function(_0x151ae9,_0x121f36){_0x151ae9=_0x151ae9-0x0;var _0xce4d51=_0x72c2[_0x151ae9];return _0xce4d51;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x272c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x272c('0x1')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x272c('0x2'),'pdf',_0x272c('0x3')),'allowNull':![],'defaultValue':_0x272c('0x2')},'savename':{'type':Sequelize[_0x272c('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x272c('0x4')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x272c('0x1')],'defaultValue':_0x272c('0x5')},'type':{'type':Sequelize[_0x272c('0x6')](_0x272c('0x7'),_0x272c('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x272c('0x9')](0xb)[_0x272c('0xa')]},'reportType':{'type':Sequelize[_0x272c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 9d0ff16..fdc3047 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 _0x2ede=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','ExtractedReports','UserProfileResource','destroy','end','stack','name','send','index','AnalyticExtractedReport','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','params','keys','includeAll','find','catch','create','user','role','UserProfileSection'];(function(_0x396eb7,_0x5ad2b4){var _0x3621e2=function(_0xb0526){while(--_0xb0526){_0x396eb7['push'](_0x396eb7['shift']());}};_0x3621e2(++_0x5ad2b4);}(_0x2ede,0xd6));var _0xe2ed=function(_0x41016d,_0x10a6d9){_0x41016d=_0x41016d-0x0;var _0x3e9b26=_0x2ede[_0x41016d];return _0x3e9b26;};'use strict';var emlformat=require(_0xe2ed('0x0'));var rimraf=require(_0xe2ed('0x1'));var zipdir=require(_0xe2ed('0x2'));var jsonpatch=require(_0xe2ed('0x3'));var rp=require(_0xe2ed('0x4'));var moment=require(_0xe2ed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe2ed('0x6'));var util=require(_0xe2ed('0x7'));var path=require(_0xe2ed('0x8'));var sox=require(_0xe2ed('0x9'));var csv=require(_0xe2ed('0xa'));var ejs=require(_0xe2ed('0xb'));var fs=require('fs');var fs_extra=require(_0xe2ed('0xc'));var _=require(_0xe2ed('0xd'));var squel=require(_0xe2ed('0xe'));var crypto=require(_0xe2ed('0xf'));var jsforce=require(_0xe2ed('0x10'));var deskjs=require(_0xe2ed('0x11'));var toCsv=require(_0xe2ed('0xa'));var querystring=require(_0xe2ed('0x12'));var Papa=require(_0xe2ed('0x13'));var Redis=require(_0xe2ed('0x14'));var authService=require(_0xe2ed('0x15'));var qs=require(_0xe2ed('0x16'));var as=require(_0xe2ed('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe2ed('0x18'));var utils=require(_0xe2ed('0x19'));var config=require(_0xe2ed('0x1a'));var licenseUtil=require(_0xe2ed('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x79810,_0x3aa8a0){_0x3aa8a0=_0x3aa8a0||0xcc;return function(_0x3cd1ab){if(_0x3cd1ab){return _0x79810[_0xe2ed('0x1c')](_0x3aa8a0);}return _0x79810[_0xe2ed('0x1d')](_0x3aa8a0)['end']();};}function respondWithResult(_0x36fb97,_0xb62891){_0xb62891=_0xb62891||0xc8;return function(_0xa74cac){if(_0xa74cac){return _0x36fb97['status'](_0xb62891)[_0xe2ed('0x1e')](_0xa74cac);}};}function respondWithFilteredResult(_0x16eabe,_0x1abe83){return function(_0xcca6ea){if(_0xcca6ea){var _0x15ad52=typeof _0x1abe83[_0xe2ed('0x1f')]===_0xe2ed('0x20')&&typeof _0x1abe83[_0xe2ed('0x21')]===_0xe2ed('0x20');var _0x3d4780=_0xcca6ea[_0xe2ed('0x22')];var _0xcd51dd=_0x15ad52?0x0:_0x1abe83['offset'];var _0x532cc9=_0x15ad52?_0xcca6ea[_0xe2ed('0x22')]:_0x1abe83[_0xe2ed('0x1f')]+_0x1abe83['limit'];var _0x3630b6;if(_0x532cc9>=_0x3d4780){_0x532cc9=_0x3d4780;_0x3630b6=0xc8;}else{_0x3630b6=0xce;}_0x16eabe[_0xe2ed('0x1d')](_0x3630b6);return _0x16eabe['set'](_0xe2ed('0x23'),_0xcd51dd+'-'+_0x532cc9+'/'+_0x3d4780)['json'](_0xcca6ea);}return null;};}function patchUpdates(_0x232f43){return function(_0x175898){try{jsonpatch[_0xe2ed('0x24')](_0x175898,_0x232f43,!![]);}catch(_0x3cb660){return BPromise[_0xe2ed('0x25')](_0x3cb660);}return _0x175898[_0xe2ed('0x26')]();};}function saveUpdates(_0x365c49,_0xdaf86e){return function(_0x447142){if(_0x447142){return _0x447142['update'](_0x365c49)['then'](function(_0x58263d){return _0x58263d;});}return null;};}function removeEntity(_0x3d490a,_0x3d37a2){return function(_0x256604){if(_0x256604){return _0x256604['destroy']()[_0xe2ed('0x27')](function(){var _0x4dd9fa=_0x256604[_0xe2ed('0x28')]({'plain':!![]});var _0x574897=_0xe2ed('0x29');return db[_0xe2ed('0x2a')][_0xe2ed('0x2b')]({'where':{'type':_0x574897,'resourceId':_0x4dd9fa['id']}})[_0xe2ed('0x27')](function(){return _0x256604;});})[_0xe2ed('0x27')](function(){_0x3d490a[_0xe2ed('0x1d')](0xcc)[_0xe2ed('0x2c')]();});}};}function handleEntityNotFound(_0xa163cb,_0x49438a){return function(_0x57cc10){if(!_0x57cc10){_0xa163cb[_0xe2ed('0x1c')](0x194);}return _0x57cc10;};}function handleError(_0x2d86a0,_0x12735d){_0x12735d=_0x12735d||0x1f4;return function(_0x265c7f){logger['error'](_0x265c7f[_0xe2ed('0x2d')]);if(_0x265c7f['name']){delete _0x265c7f[_0xe2ed('0x2e')];}_0x2d86a0['status'](_0x12735d)[_0xe2ed('0x2f')](_0x265c7f);};}exports[_0xe2ed('0x30')]=function(_0x5eea10,_0xfd0bd1){var _0x4a25a1={},_0x2de984={},_0x5795d1={'count':0x0,'rows':[]};var _0x13ec36=_['map'](db[_0xe2ed('0x31')][_0xe2ed('0x32')],function(_0x593bce){return{'name':_0x593bce['fieldName'],'type':_0x593bce['type'][_0xe2ed('0x33')]};});_0x2de984[_0xe2ed('0x34')]=_[_0xe2ed('0x35')](_0x13ec36,'name');_0x2de984[_0xe2ed('0x36')]=_['keys'](_0x5eea10[_0xe2ed('0x36')]);_0x2de984[_0xe2ed('0x37')]=_[_0xe2ed('0x38')](_0x2de984[_0xe2ed('0x34')],_0x2de984[_0xe2ed('0x36')]);_0x4a25a1[_0xe2ed('0x39')]=_[_0xe2ed('0x38')](_0x2de984['model'],qs[_0xe2ed('0x3a')](_0x5eea10[_0xe2ed('0x36')][_0xe2ed('0x3a')]));_0x4a25a1[_0xe2ed('0x39')]=_0x4a25a1[_0xe2ed('0x39')][_0xe2ed('0x3b')]?_0x4a25a1[_0xe2ed('0x39')]:_0x2de984[_0xe2ed('0x34')];if(!_0x5eea10['query'][_0xe2ed('0x3c')]('nolimit')){_0x4a25a1[_0xe2ed('0x21')]=qs[_0xe2ed('0x21')](_0x5eea10['query'][_0xe2ed('0x21')]);_0x4a25a1['offset']=qs[_0xe2ed('0x1f')](_0x5eea10[_0xe2ed('0x36')]['offset']);}_0x4a25a1[_0xe2ed('0x3d')]=qs[_0xe2ed('0x3e')](_0x5eea10[_0xe2ed('0x36')][_0xe2ed('0x3e')]);_0x4a25a1[_0xe2ed('0x3f')]=qs[_0xe2ed('0x37')](_['pick'](_0x5eea10[_0xe2ed('0x36')],_0x2de984[_0xe2ed('0x37')]),_0x13ec36);if(_0x5eea10[_0xe2ed('0x36')][_0xe2ed('0x40')]){_0x4a25a1[_0xe2ed('0x3f')]=_[_0xe2ed('0x41')](_0x4a25a1[_0xe2ed('0x3f')],{'$or':_[_0xe2ed('0x35')](_0x13ec36,function(_0x2874d3){if(_0x2874d3['type']!==_0xe2ed('0x42')){var _0xb0c99f={};_0xb0c99f[_0x2874d3['name']]={'$like':'%'+_0x5eea10['query'][_0xe2ed('0x40')]+'%'};return _0xb0c99f;}})});}_0x4a25a1=_['merge']({},_0x4a25a1,_0x5eea10[_0xe2ed('0x43')]);var _0xf29842={'where':_0x4a25a1[_0xe2ed('0x3f')]};return db['AnalyticExtractedReport'][_0xe2ed('0x22')](_0xf29842)[_0xe2ed('0x27')](function(_0x68a763){_0x5795d1[_0xe2ed('0x22')]=_0x68a763;if(_0x5eea10[_0xe2ed('0x36')]['includeAll']){_0x4a25a1[_0xe2ed('0x44')]=[{'all':!![]}];}return db[_0xe2ed('0x31')][_0xe2ed('0x45')](_0x4a25a1);})[_0xe2ed('0x27')](function(_0x54a027){_0x5795d1[_0xe2ed('0x46')]=_0x54a027;return _0x5795d1;})[_0xe2ed('0x27')](respondWithFilteredResult(_0xfd0bd1,_0x4a25a1))['catch'](handleError(_0xfd0bd1,null));};exports['show']=function(_0x30df70,_0x1d7c55){var _0x55e329={'raw':!![],'where':{'id':_0x30df70[_0xe2ed('0x47')]['id']}},_0x57ab32={};_0x57ab32[_0xe2ed('0x34')]=_[_0xe2ed('0x48')](db['AnalyticExtractedReport']['rawAttributes']);_0x57ab32['query']=_['keys'](_0x30df70[_0xe2ed('0x36')]);_0x57ab32[_0xe2ed('0x37')]=_[_0xe2ed('0x38')](_0x57ab32[_0xe2ed('0x34')],_0x57ab32[_0xe2ed('0x36')]);_0x55e329['attributes']=_[_0xe2ed('0x38')](_0x57ab32[_0xe2ed('0x34')],qs['fields'](_0x30df70[_0xe2ed('0x36')]['fields']));_0x55e329[_0xe2ed('0x39')]=_0x55e329[_0xe2ed('0x39')]['length']?_0x55e329[_0xe2ed('0x39')]:_0x57ab32[_0xe2ed('0x34')];if(_0x30df70[_0xe2ed('0x36')][_0xe2ed('0x49')]){_0x55e329['include']=[{'all':!![]}];}_0x55e329=_[_0xe2ed('0x41')]({},_0x55e329,_0x30df70[_0xe2ed('0x43')]);return db['AnalyticExtractedReport'][_0xe2ed('0x4a')](_0x55e329)[_0xe2ed('0x27')](handleEntityNotFound(_0x1d7c55,null))[_0xe2ed('0x27')](respondWithResult(_0x1d7c55,null))[_0xe2ed('0x4b')](handleError(_0x1d7c55,null));};exports[_0xe2ed('0x4c')]=function(_0x4ac112,_0x43e106){return db[_0xe2ed('0x31')][_0xe2ed('0x4c')](_0x4ac112['body'],{})[_0xe2ed('0x27')](function(_0x5e9679){var _0x476cc9=_0x4ac112[_0xe2ed('0x4d')][_0xe2ed('0x28')]({'plain':!![]});if(!_0x476cc9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x476cc9[_0xe2ed('0x4e')]===_0xe2ed('0x4d')){var _0x3b4040=_0x5e9679[_0xe2ed('0x28')]({'plain':!![]});var _0x2f1797='ExtractedReports';return db[_0xe2ed('0x4f')][_0xe2ed('0x4a')]({'where':{'name':_0x2f1797,'userProfileId':_0x476cc9[_0xe2ed('0x50')]},'raw':!![]})[_0xe2ed('0x27')](function(_0x3016b0){if(_0x3016b0&&_0x3016b0[_0xe2ed('0x51')]===0x0){return db[_0xe2ed('0x2a')]['create']({'name':_0x3b4040[_0xe2ed('0x2e')],'resourceId':_0x3b4040['id'],'type':_0x3016b0[_0xe2ed('0x2e')],'sectionId':_0x3016b0['id']},{})[_0xe2ed('0x27')](function(){return _0x5e9679;});}else{return _0x5e9679;}})[_0xe2ed('0x4b')](function(_0x3011af){logger[_0xe2ed('0x52')](_0xe2ed('0x53'),_0x3011af);throw _0x3011af;});}return _0x5e9679;})[_0xe2ed('0x27')](respondWithResult(_0x43e106,0xc9))[_0xe2ed('0x4b')](handleError(_0x43e106,null));};exports['update']=function(_0x4614a1,_0x37b040){if(_0x4614a1[_0xe2ed('0x54')]['id']){delete _0x4614a1[_0xe2ed('0x54')]['id'];}return db[_0xe2ed('0x31')][_0xe2ed('0x4a')]({'where':{'id':_0x4614a1[_0xe2ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x37b040,null))[_0xe2ed('0x27')](saveUpdates(_0x4614a1[_0xe2ed('0x54')],null))[_0xe2ed('0x27')](respondWithResult(_0x37b040,null))[_0xe2ed('0x4b')](handleError(_0x37b040,null));};exports[_0xe2ed('0x2b')]=function(_0x1a172a,_0x17aaae){return db[_0xe2ed('0x31')][_0xe2ed('0x4a')]({'where':{'id':_0x1a172a[_0xe2ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x17aaae,null))[_0xe2ed('0x27')](removeEntity(_0x17aaae,null))[_0xe2ed('0x4b')](handleError(_0x17aaae,null));};exports['download']=function(_0xaabf48,_0x121d5f,_0x4a613e){return db[_0xe2ed('0x31')][_0xe2ed('0x4a')]({'where':{'id':_0xaabf48['params']['id']},'attributes':[_0xe2ed('0x2e'),_0xe2ed('0x55'),_0xe2ed('0x56'),'output'],'raw':!![]})[_0xe2ed('0x27')](handleEntityNotFound(_0x121d5f,null))[_0xe2ed('0x27')](function(_0x3d7009){if(_0x3d7009){if(!fs[_0xe2ed('0x57')](path[_0xe2ed('0x58')](config[_0xe2ed('0x59')],_0xe2ed('0x5a'),_0x3d7009[_0xe2ed('0x56')]))){throw new db[(_0xe2ed('0x5b'))][(_0xe2ed('0x5c'))](_0xe2ed('0x5d'));}if(_0xaabf48[_0xe2ed('0x36')]['exists']){return _0x121d5f[_0xe2ed('0x1c')](0xc8);}return _0x121d5f['download'](path[_0xe2ed('0x58')](config[_0xe2ed('0x59')],_0xe2ed('0x5a'),_0x3d7009[_0xe2ed('0x56')]),util[_0xe2ed('0x5e')](_0xe2ed('0x5f'),_0x3d7009[_0xe2ed('0x55')]||_0x3d7009[_0xe2ed('0x2e')],_0x3d7009[_0xe2ed('0x60')][_0xe2ed('0x61')]()));}})[_0xe2ed('0x4b')](handleError(_0x121d5f,null));};
\ No newline at end of file
+var _0xa627=['savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','eml-format','rimraf','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename'];(function(_0x35f7d1,_0x39d318){var _0x53ac5f=function(_0x30b171){while(--_0x30b171){_0x35f7d1['push'](_0x35f7d1['shift']());}};_0x53ac5f(++_0x39d318);}(_0xa627,0x12b));var _0x7a62=function(_0x351ac6,_0x233039){_0x351ac6=_0x351ac6-0x0;var _0x33905f=_0xa627[_0x351ac6];return _0x33905f;};'use strict';var emlformat=require(_0x7a62('0x0'));var rimraf=require(_0x7a62('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7a62('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7a62('0x3'));var util=require(_0x7a62('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x7a62('0x5'));var ejs=require(_0x7a62('0x6'));var fs=require('fs');var fs_extra=require(_0x7a62('0x7'));var _=require(_0x7a62('0x8'));var squel=require(_0x7a62('0x9'));var crypto=require('crypto');var jsforce=require(_0x7a62('0xa'));var deskjs=require(_0x7a62('0xb'));var toCsv=require(_0x7a62('0x5'));var querystring=require(_0x7a62('0xc'));var Papa=require(_0x7a62('0xd'));var Redis=require(_0x7a62('0xe'));var authService=require(_0x7a62('0xf'));var qs=require(_0x7a62('0x10'));var as=require(_0x7a62('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a62('0x12'))(_0x7a62('0x13'));var utils=require(_0x7a62('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7a62('0x15'))['db'];function respondWithStatusCode(_0x509e76,_0x375216){_0x375216=_0x375216||0xcc;return function(_0x23e9b6){if(_0x23e9b6){return _0x509e76[_0x7a62('0x16')](_0x375216);}return _0x509e76[_0x7a62('0x17')](_0x375216)[_0x7a62('0x18')]();};}function respondWithResult(_0xb57a8d,_0x1095e2){_0x1095e2=_0x1095e2||0xc8;return function(_0x33fb9a){if(_0x33fb9a){return _0xb57a8d[_0x7a62('0x17')](_0x1095e2)['json'](_0x33fb9a);}};}function respondWithFilteredResult(_0x222312,_0x352e4e){return function(_0x49b28b){if(_0x49b28b){var _0x31cd5f=typeof _0x352e4e[_0x7a62('0x19')]===_0x7a62('0x1a')&&typeof _0x352e4e['limit']==='undefined';var _0x2ce369=_0x49b28b[_0x7a62('0x1b')];var _0x2cfddb=_0x31cd5f?0x0:_0x352e4e['offset'];var _0x43225b=_0x31cd5f?_0x49b28b[_0x7a62('0x1b')]:_0x352e4e['offset']+_0x352e4e[_0x7a62('0x1c')];var _0x322268;if(_0x43225b>=_0x2ce369){_0x43225b=_0x2ce369;_0x322268=0xc8;}else{_0x322268=0xce;}_0x222312[_0x7a62('0x17')](_0x322268);return _0x222312[_0x7a62('0x1d')](_0x7a62('0x1e'),_0x2cfddb+'-'+_0x43225b+'/'+_0x2ce369)[_0x7a62('0x1f')](_0x49b28b);}return null;};}function patchUpdates(_0x195ac2){return function(_0x1329e7){try{jsonpatch[_0x7a62('0x20')](_0x1329e7,_0x195ac2,!![]);}catch(_0x26d73e){return BPromise[_0x7a62('0x21')](_0x26d73e);}return _0x1329e7[_0x7a62('0x22')]();};}function saveUpdates(_0x5544ae,_0x4eff01){return function(_0x3f9f8d){if(_0x3f9f8d){return _0x3f9f8d[_0x7a62('0x23')](_0x5544ae)[_0x7a62('0x24')](function(_0x24730d){return _0x24730d;});}return null;};}function removeEntity(_0xdadd4,_0x1af485){return function(_0x5f27c6){if(_0x5f27c6){return _0x5f27c6[_0x7a62('0x25')]()[_0x7a62('0x24')](function(){var _0x312ce7=_0x5f27c6[_0x7a62('0x26')]({'plain':!![]});var _0xe87d37=_0x7a62('0x27');return db[_0x7a62('0x28')][_0x7a62('0x25')]({'where':{'type':_0xe87d37,'resourceId':_0x312ce7['id']}})['then'](function(){return _0x5f27c6;});})['then'](function(){_0xdadd4[_0x7a62('0x17')](0xcc)[_0x7a62('0x18')]();});}};}function handleEntityNotFound(_0x35be24,_0x1bbb12){return function(_0xa3f42d){if(!_0xa3f42d){_0x35be24['sendStatus'](0x194);}return _0xa3f42d;};}function handleError(_0x3b3dab,_0x335ac3){_0x335ac3=_0x335ac3||0x1f4;return function(_0x4eeebb){logger['error'](_0x4eeebb[_0x7a62('0x29')]);if(_0x4eeebb['name']){delete _0x4eeebb[_0x7a62('0x2a')];}_0x3b3dab['status'](_0x335ac3)[_0x7a62('0x2b')](_0x4eeebb);};}exports[_0x7a62('0x2c')]=function(_0x42e965,_0x52ac21){var _0x1cffa8={},_0x37295a={},_0x25081a={'count':0x0,'rows':[]};var _0x58ee17=_[_0x7a62('0x2d')](db[_0x7a62('0x2e')]['rawAttributes'],function(_0x142c4c){return{'name':_0x142c4c['fieldName'],'type':_0x142c4c[_0x7a62('0x2f')][_0x7a62('0x30')]};});_0x37295a['model']=_[_0x7a62('0x2d')](_0x58ee17,_0x7a62('0x2a'));_0x37295a[_0x7a62('0x31')]=_['keys'](_0x42e965[_0x7a62('0x31')]);_0x37295a[_0x7a62('0x32')]=_[_0x7a62('0x33')](_0x37295a[_0x7a62('0x34')],_0x37295a['query']);_0x1cffa8[_0x7a62('0x35')]=_['intersection'](_0x37295a['model'],qs['fields'](_0x42e965[_0x7a62('0x31')][_0x7a62('0x36')]));_0x1cffa8[_0x7a62('0x35')]=_0x1cffa8[_0x7a62('0x35')]['length']?_0x1cffa8[_0x7a62('0x35')]:_0x37295a[_0x7a62('0x34')];if(!_0x42e965['query'][_0x7a62('0x37')](_0x7a62('0x38'))){_0x1cffa8[_0x7a62('0x1c')]=qs[_0x7a62('0x1c')](_0x42e965[_0x7a62('0x31')][_0x7a62('0x1c')]);_0x1cffa8['offset']=qs['offset'](_0x42e965['query'][_0x7a62('0x19')]);}_0x1cffa8[_0x7a62('0x39')]=qs[_0x7a62('0x3a')](_0x42e965[_0x7a62('0x31')]['sort']);_0x1cffa8[_0x7a62('0x3b')]=qs[_0x7a62('0x32')](_['pick'](_0x42e965[_0x7a62('0x31')],_0x37295a[_0x7a62('0x32')]),_0x58ee17);if(_0x42e965[_0x7a62('0x31')][_0x7a62('0x3c')]){_0x1cffa8['where']=_[_0x7a62('0x3d')](_0x1cffa8[_0x7a62('0x3b')],{'$or':_[_0x7a62('0x2d')](_0x58ee17,function(_0x41f2fb){if(_0x41f2fb[_0x7a62('0x2f')]!==_0x7a62('0x3e')){var _0x285fa={};_0x285fa[_0x41f2fb[_0x7a62('0x2a')]]={'$like':'%'+_0x42e965[_0x7a62('0x31')][_0x7a62('0x3c')]+'%'};return _0x285fa;}})});}_0x1cffa8=_[_0x7a62('0x3d')]({},_0x1cffa8,_0x42e965[_0x7a62('0x3f')]);var _0x579a77={'where':_0x1cffa8[_0x7a62('0x3b')]};return db[_0x7a62('0x2e')][_0x7a62('0x1b')](_0x579a77)[_0x7a62('0x24')](function(_0x2271af){_0x25081a[_0x7a62('0x1b')]=_0x2271af;if(_0x42e965[_0x7a62('0x31')][_0x7a62('0x40')]){_0x1cffa8[_0x7a62('0x41')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x7a62('0x42')](_0x1cffa8);})['then'](function(_0x4de573){_0x25081a[_0x7a62('0x43')]=_0x4de573;return _0x25081a;})[_0x7a62('0x24')](respondWithFilteredResult(_0x52ac21,_0x1cffa8))[_0x7a62('0x44')](handleError(_0x52ac21,null));};exports[_0x7a62('0x45')]=function(_0x5c4b7c,_0x547788){var _0x262126={'raw':!![],'where':{'id':_0x5c4b7c['params']['id']}},_0x13dfb8={};_0x13dfb8[_0x7a62('0x34')]=_[_0x7a62('0x46')](db['AnalyticExtractedReport']['rawAttributes']);_0x13dfb8[_0x7a62('0x31')]=_[_0x7a62('0x46')](_0x5c4b7c[_0x7a62('0x31')]);_0x13dfb8[_0x7a62('0x32')]=_['intersection'](_0x13dfb8[_0x7a62('0x34')],_0x13dfb8['query']);_0x262126[_0x7a62('0x35')]=_[_0x7a62('0x33')](_0x13dfb8[_0x7a62('0x34')],qs[_0x7a62('0x36')](_0x5c4b7c[_0x7a62('0x31')]['fields']));_0x262126[_0x7a62('0x35')]=_0x262126['attributes'][_0x7a62('0x47')]?_0x262126['attributes']:_0x13dfb8[_0x7a62('0x34')];if(_0x5c4b7c[_0x7a62('0x31')][_0x7a62('0x40')]){_0x262126[_0x7a62('0x41')]=[{'all':!![]}];}_0x262126=_[_0x7a62('0x3d')]({},_0x262126,_0x5c4b7c[_0x7a62('0x3f')]);return db[_0x7a62('0x2e')][_0x7a62('0x48')](_0x262126)['then'](handleEntityNotFound(_0x547788,null))['then'](respondWithResult(_0x547788,null))[_0x7a62('0x44')](handleError(_0x547788,null));};exports[_0x7a62('0x49')]=function(_0x41cc9c,_0x3fe9f3){return db[_0x7a62('0x2e')][_0x7a62('0x49')](_0x41cc9c[_0x7a62('0x4a')],{})[_0x7a62('0x24')](function(_0x3c7db5){var _0x378bba=_0x41cc9c[_0x7a62('0x4b')][_0x7a62('0x26')]({'plain':!![]});if(!_0x378bba)throw new Error(_0x7a62('0x4c'));if(_0x378bba[_0x7a62('0x4d')]===_0x7a62('0x4b')){var _0x2f6416=_0x3c7db5[_0x7a62('0x26')]({'plain':!![]});var _0x3eb800='ExtractedReports';return db['UserProfileSection'][_0x7a62('0x48')]({'where':{'name':_0x3eb800,'userProfileId':_0x378bba[_0x7a62('0x4e')]},'raw':!![]})['then'](function(_0x3d7269){if(_0x3d7269&&_0x3d7269[_0x7a62('0x4f')]===0x0){return db[_0x7a62('0x28')][_0x7a62('0x49')]({'name':_0x2f6416['name'],'resourceId':_0x2f6416['id'],'type':_0x3d7269[_0x7a62('0x2a')],'sectionId':_0x3d7269['id']},{})['then'](function(){return _0x3c7db5;});}else{return _0x3c7db5;}})[_0x7a62('0x44')](function(_0x31d5ef){logger[_0x7a62('0x50')](_0x7a62('0x51'),_0x31d5ef);throw _0x31d5ef;});}return _0x3c7db5;})[_0x7a62('0x24')](respondWithResult(_0x3fe9f3,0xc9))['catch'](handleError(_0x3fe9f3,null));};exports[_0x7a62('0x23')]=function(_0x33f704,_0x545458){if(_0x33f704[_0x7a62('0x4a')]['id']){delete _0x33f704[_0x7a62('0x4a')]['id'];}return db[_0x7a62('0x2e')][_0x7a62('0x48')]({'where':{'id':_0x33f704['params']['id']}})['then'](handleEntityNotFound(_0x545458,null))['then'](saveUpdates(_0x33f704[_0x7a62('0x4a')],null))[_0x7a62('0x24')](respondWithResult(_0x545458,null))['catch'](handleError(_0x545458,null));};exports[_0x7a62('0x25')]=function(_0x1fd255,_0x575330){return db['AnalyticExtractedReport'][_0x7a62('0x48')]({'where':{'id':_0x1fd255[_0x7a62('0x52')]['id']}})['then'](handleEntityNotFound(_0x575330,null))[_0x7a62('0x24')](removeEntity(_0x575330,null))['catch'](handleError(_0x575330,null));};exports[_0x7a62('0x53')]=function(_0x125fd2,_0x52f140,_0x1d644d){return db[_0x7a62('0x2e')][_0x7a62('0x48')]({'where':{'id':_0x125fd2[_0x7a62('0x52')]['id']},'attributes':[_0x7a62('0x2a'),_0x7a62('0x54'),_0x7a62('0x55'),_0x7a62('0x56')],'raw':!![]})[_0x7a62('0x24')](handleEntityNotFound(_0x52f140,null))[_0x7a62('0x24')](function(_0x3e6571){if(_0x3e6571){if(!fs[_0x7a62('0x57')](path[_0x7a62('0x58')](config[_0x7a62('0x59')],_0x7a62('0x5a'),_0x3e6571[_0x7a62('0x55')]))){throw new db[(_0x7a62('0x5b'))][(_0x7a62('0x5c'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x125fd2[_0x7a62('0x31')][_0x7a62('0x5d')]){return _0x52f140[_0x7a62('0x16')](0xc8);}return _0x52f140[_0x7a62('0x53')](path[_0x7a62('0x58')](config[_0x7a62('0x59')],_0x7a62('0x5a'),_0x3e6571['savename']),util[_0x7a62('0x5e')](_0x7a62('0x5f'),_0x3e6571['basename']||_0x3e6571[_0x7a62('0x2a')],_0x3e6571['output']['toLowerCase']()));}})[_0x7a62('0x44')](handleError(_0x52f140,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 41df33f..8ce6f06 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 _0x5c40=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util'];(function(_0x7e1db7,_0x1da70f){var _0xc82fa0=function(_0x23b276){while(--_0x23b276){_0x7e1db7['push'](_0x7e1db7['shift']());}};_0xc82fa0(++_0x1da70f);}(_0x5c40,0xa7));var _0x05c4=function(_0x385510,_0x476690){_0x385510=_0x385510-0x0;var _0x5b5e1f=_0x5c40[_0x385510];return _0x5b5e1f;};'use strict';var _=require(_0x05c4('0x0'));var util=require(_0x05c4('0x1'));var logger=require('../../config/logger')(_0x05c4('0x2'));var moment=require(_0x05c4('0x3'));var BPromise=require(_0x05c4('0x4'));var rp=require(_0x05c4('0x5'));var fs=require('fs');var path=require(_0x05c4('0x6'));var rimraf=require(_0x05c4('0x7'));var config=require(_0x05c4('0x8'));var attributes=require(_0x05c4('0x9'));module[_0x05c4('0xa')]=function(_0x2e2842,_0x3e5fac){return _0x2e2842[_0x05c4('0xb')]('AnalyticExtractedReport',attributes,{'tableName':_0x05c4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8bd=['exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0x2d20ae,_0x3b1d15){var _0x58451e=function(_0xd0aed7){while(--_0xd0aed7){_0x2d20ae['push'](_0x2d20ae['shift']());}};_0x58451e(++_0x3b1d15);}(_0xd8bd,0x156));var _0xdd8b=function(_0x411f29,_0x561085){_0x411f29=_0x411f29-0x0;var _0xbbb918=_0xd8bd[_0x411f29];return _0xbbb918;};'use strict';var _=require(_0xdd8b('0x0'));var util=require('util');var logger=require(_0xdd8b('0x1'))(_0xdd8b('0x2'));var moment=require('moment');var BPromise=require(_0xdd8b('0x3'));var rp=require(_0xdd8b('0x4'));var fs=require('fs');var path=require(_0xdd8b('0x5'));var rimraf=require(_0xdd8b('0x6'));var config=require(_0xdd8b('0x7'));var attributes=require(_0xdd8b('0x8'));module[_0xdd8b('0x9')]=function(_0x29e326,_0x45c39f){return _0x29e326[_0xdd8b('0xa')](_0xdd8b('0xb'),attributes,{'tableName':_0xdd8b('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 34310f2..1b52fee 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 _0x849e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','../../mysqldb'];(function(_0x53ad9c,_0x448a91){var _0x51a477=function(_0x1cc81e){while(--_0x1cc81e){_0x53ad9c['push'](_0x53ad9c['shift']());}};_0x51a477(++_0x448a91);}(_0x849e,0xf4));var _0xe849=function(_0x3c8366,_0x46df4c){_0x3c8366=_0x3c8366-0x0;var _0xae08f1=_0x849e[_0x3c8366];return _0xae08f1;};'use strict';var _=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe849('0x2'))['db'];var utils=require(_0xe849('0x3'));var logger=require(_0xe849('0x4'))(_0xe849('0x5'));var config=require(_0xe849('0x6'));var jayson=require(_0xe849('0x7'));var client=jayson[_0xe849('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19965f,_0x316fda,_0x527092){return new BPromise(function(_0x254c1d,_0x1a666e){return client[_0xe849('0x9')](_0x19965f,_0x527092)['then'](function(_0x5154e2){logger[_0xe849('0xa')](_0xe849('0xb'),_0x316fda,_0xe849('0xc'));logger[_0xe849('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x316fda,_0xe849('0xc'),JSON[_0xe849('0xe')](_0x5154e2));if(_0x5154e2[_0xe849('0xf')]){if(_0x5154e2[_0xe849('0xf')][_0xe849('0x10')]===0x1f4){logger[_0xe849('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x316fda,_0x5154e2['error'][_0xe849('0x11')]);return _0x1a666e(_0x5154e2[_0xe849('0xf')][_0xe849('0x11')]);}logger[_0xe849('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x316fda,_0x5154e2[_0xe849('0xf')][_0xe849('0x11')]);return _0x254c1d(_0x5154e2[_0xe849('0xf')][_0xe849('0x11')]);}else{logger[_0xe849('0xa')](_0xe849('0xb'),_0x316fda,_0xe849('0xc'));_0x254c1d(_0x5154e2['result'][_0xe849('0x11')]);}})[_0xe849('0x12')](function(_0x26db49){logger[_0xe849('0xf')](_0xe849('0xb'),_0x316fda,_0x26db49);_0x1a666e(_0x26db49);});});}
\ No newline at end of file
+var _0xb8a2=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xb8a2,0xd2));var _0x2b8a=function(_0x3aa59f,_0x16229e){_0x3aa59f=_0x3aa59f-0x0;var _0x452bf5=_0xb8a2[_0x3aa59f];return _0x452bf5;};'use strict';var _=require(_0x2b8a('0x0'));var util=require('util');var moment=require(_0x2b8a('0x1'));var BPromise=require(_0x2b8a('0x2'));var rs=require(_0x2b8a('0x3'));var fs=require('fs');var Redis=require(_0x2b8a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b8a('0x5'))(_0x2b8a('0x6'));var config=require(_0x2b8a('0x7'));var jayson=require(_0x2b8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b7e8d,_0x21bf10,_0x1f6bef){return new BPromise(function(_0x534a7b,_0x477e5a){return client[_0x2b8a('0x9')](_0x3b7e8d,_0x1f6bef)[_0x2b8a('0xa')](function(_0x3949b7){logger[_0x2b8a('0xb')](_0x2b8a('0xc'),_0x21bf10,_0x2b8a('0xd'));logger[_0x2b8a('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x21bf10,_0x2b8a('0xd'),JSON[_0x2b8a('0xf')](_0x3949b7));if(_0x3949b7['error']){if(_0x3949b7[_0x2b8a('0x10')][_0x2b8a('0x11')]===0x1f4){logger[_0x2b8a('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x21bf10,_0x3949b7['error'][_0x2b8a('0x12')]);return _0x477e5a(_0x3949b7[_0x2b8a('0x10')][_0x2b8a('0x12')]);}logger[_0x2b8a('0x10')](_0x2b8a('0xc'),_0x21bf10,_0x3949b7[_0x2b8a('0x10')][_0x2b8a('0x12')]);return _0x534a7b(_0x3949b7[_0x2b8a('0x10')][_0x2b8a('0x12')]);}else{logger[_0x2b8a('0xb')](_0x2b8a('0xc'),_0x21bf10,_0x2b8a('0xd'));_0x534a7b(_0x3949b7['result'][_0x2b8a('0x12')]);}})[_0x2b8a('0x13')](function(_0x20ace2){logger['error'](_0x2b8a('0xc'),_0x21bf10,_0x20ace2);_0x477e5a(_0x20ace2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index aed7f8f..3f72fe6 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 _0xe440=['./analyticExtractedReport.controller','get','index','/:id','show','isAuthenticated','download','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x248a08,_0x43eaa0){var _0x16f178=function(_0x2e4e18){while(--_0x2e4e18){_0x248a08['push'](_0x248a08['shift']());}};_0x16f178(++_0x43eaa0);}(_0xe440,0xdd));var _0x0e44=function(_0x182bdd,_0x43bad3){_0x182bdd=_0x182bdd-0x0;var _0x156cf4=_0xe440[_0x182bdd];return _0x156cf4;};'use strict';var multer=require(_0x0e44('0x0'));var util=require(_0x0e44('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e44('0x2'));var router=express['Router']();var fs_extra=require(_0x0e44('0x3'));var auth=require(_0x0e44('0x4'));var interaction=require(_0x0e44('0x5'));var config=require(_0x0e44('0x6'));var controller=require(_0x0e44('0x7'));router[_0x0e44('0x8')]('/',auth['isAuthenticated'](),controller[_0x0e44('0x9')]);router[_0x0e44('0x8')](_0x0e44('0xa'),auth['isAuthenticated'](),controller[_0x0e44('0xb')]);router[_0x0e44('0x8')]('/:id/download',auth[_0x0e44('0xc')](),controller[_0x0e44('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0e44('0xe')]('/:id',auth[_0x0e44('0xc')](),controller[_0x0e44('0xf')]);router[_0x0e44('0x10')](_0x0e44('0xa'),auth[_0x0e44('0xc')](),controller[_0x0e44('0x11')]);module[_0x0e44('0x12')]=router;
\ No newline at end of file
+var _0x1ef7=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','index','isAuthenticated','show','/:id/download','download','create','/:id','delete','exports','multer'];(function(_0x2a100e,_0x263ba5){var _0x517ac8=function(_0x3342b9){while(--_0x3342b9){_0x2a100e['push'](_0x2a100e['shift']());}};_0x517ac8(++_0x263ba5);}(_0x1ef7,0x167));var _0x71ef=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x1ef7[_0x3fd3a3];return _0xa3e4d5;};'use strict';var multer=require(_0x71ef('0x0'));var util=require('util');var path=require(_0x71ef('0x1'));var timeout=require('connect-timeout');var express=require(_0x71ef('0x2'));var router=express[_0x71ef('0x3')]();var fs_extra=require(_0x71ef('0x4'));var auth=require(_0x71ef('0x5'));var interaction=require(_0x71ef('0x6'));var config=require('../../config/environment');var controller=require(_0x71ef('0x7'));router[_0x71ef('0x8')]('/',auth['isAuthenticated'](),controller[_0x71ef('0x9')]);router[_0x71ef('0x8')]('/:id',auth[_0x71ef('0xa')](),controller[_0x71ef('0xb')]);router[_0x71ef('0x8')](_0x71ef('0xc'),auth['isAuthenticated'](),controller[_0x71ef('0xd')]);router['post']('/',auth[_0x71ef('0xa')](),controller[_0x71ef('0xe')]);router['put'](_0x71ef('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x71ef('0x10')](_0x71ef('0xf'),auth[_0x71ef('0xa')](),controller['destroy']);module[_0x71ef('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 6e83e9c..8db4ffb 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 _0x19fd=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x4d6674,_0x23734a){var _0x4fcd4d=function(_0x2df1c9){while(--_0x2df1c9){_0x4d6674['push'](_0x4d6674['shift']());}};_0x4fcd4d(++_0x23734a);}(_0x19fd,0x10e));var _0xd19f=function(_0x59e229,_0x130f86){_0x59e229=_0x59e229-0x0;var _0x7f5d6b=_0x19fd[_0x59e229];return _0x7f5d6b;};'use strict';var Sequelize=require(_0xd19f('0x0'));module[_0xd19f('0x1')]={'field':{'type':Sequelize[_0xd19f('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xd19f('0x3')]},'format':{'type':Sequelize[_0xd19f('0x3')]},'groupBy':{'type':Sequelize[_0xd19f('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xd19f('0x3')]},'custom':{'type':Sequelize[_0xd19f('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x6ab4=['BOOLEAN','sequelize','exports','STRING'];(function(_0x28002a,_0x565666){var _0x45a345=function(_0x97bae4){while(--_0x97bae4){_0x28002a['push'](_0x28002a['shift']());}};_0x45a345(++_0x565666);}(_0x6ab4,0x139));var _0x46ab=function(_0x16e734,_0x46281a){_0x16e734=_0x16e734-0x0;var _0x45f4c3=_0x6ab4[_0x16e734];return _0x45f4c3;};'use strict';var Sequelize=require(_0x46ab('0x0'));module[_0x46ab('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x46ab('0x2')]},'function':{'type':Sequelize[_0x46ab('0x2')]},'format':{'type':Sequelize[_0x46ab('0x2')]},'groupBy':{'type':Sequelize[_0x46ab('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x46ab('0x2')]},'custom':{'type':Sequelize[_0x46ab('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 ec6a862..99eb121 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 _0xa694=['create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','sequelize','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x3b0966,_0x3fc4ca){var _0x18e6b0=function(_0x535058){while(--_0x535058){_0x3b0966['push'](_0x3b0966['shift']());}};_0x18e6b0(++_0x3fc4ca);}(_0xa694,0x153));var _0x4a69=function(_0xe8e923,_0x1cf325){_0xe8e923=_0xe8e923-0x0;var _0x2ab28c=_0xa694[_0xe8e923];return _0x2ab28c;};'use strict';var emlformat=require(_0x4a69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4a69('0x1'));var jsonpatch=require(_0x4a69('0x2'));var rp=require(_0x4a69('0x3'));var moment=require(_0x4a69('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4a69('0x5'));var util=require(_0x4a69('0x6'));var path=require(_0x4a69('0x7'));var sox=require(_0x4a69('0x8'));var csv=require('to-csv');var ejs=require(_0x4a69('0x9'));var fs=require('fs');var fs_extra=require(_0x4a69('0xa'));var _=require(_0x4a69('0xb'));var squel=require(_0x4a69('0xc'));var crypto=require(_0x4a69('0xd'));var jsforce=require(_0x4a69('0xe'));var deskjs=require(_0x4a69('0xf'));var toCsv=require(_0x4a69('0x10'));var querystring=require(_0x4a69('0x11'));var Papa=require(_0x4a69('0x12'));var Redis=require(_0x4a69('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x4a69('0x14'));var as=require(_0x4a69('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4a69('0x16'))('api');var utils=require(_0x4a69('0x17'));var config=require(_0x4a69('0x18'));var licenseUtil=require(_0x4a69('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b62df,_0x356b54){_0x356b54=_0x356b54||0xcc;return function(_0x3398a7){if(_0x3398a7){return _0x2b62df['sendStatus'](_0x356b54);}return _0x2b62df[_0x4a69('0x1a')](_0x356b54)[_0x4a69('0x1b')]();};}function respondWithResult(_0x1ae675,_0x3e13cf){_0x3e13cf=_0x3e13cf||0xc8;return function(_0x3a02c9){if(_0x3a02c9){return _0x1ae675['status'](_0x3e13cf)[_0x4a69('0x1c')](_0x3a02c9);}};}function respondWithFilteredResult(_0x1f305b,_0x5d7abb){return function(_0x9ff15f){if(_0x9ff15f){var _0x27445d=typeof _0x5d7abb[_0x4a69('0x1d')]===_0x4a69('0x1e')&&typeof _0x5d7abb[_0x4a69('0x1f')]===_0x4a69('0x1e');var _0x32dc26=_0x9ff15f[_0x4a69('0x20')];var _0x31f51e=_0x27445d?0x0:_0x5d7abb[_0x4a69('0x1d')];var _0x3df39f=_0x27445d?_0x9ff15f[_0x4a69('0x20')]:_0x5d7abb[_0x4a69('0x1d')]+_0x5d7abb[_0x4a69('0x1f')];var _0xa8d12;if(_0x3df39f>=_0x32dc26){_0x3df39f=_0x32dc26;_0xa8d12=0xc8;}else{_0xa8d12=0xce;}_0x1f305b[_0x4a69('0x1a')](_0xa8d12);return _0x1f305b[_0x4a69('0x21')](_0x4a69('0x22'),_0x31f51e+'-'+_0x3df39f+'/'+_0x32dc26)[_0x4a69('0x1c')](_0x9ff15f);}return null;};}function patchUpdates(_0x309656){return function(_0x331c97){try{jsonpatch[_0x4a69('0x23')](_0x331c97,_0x309656,!![]);}catch(_0x1ade6f){return BPromise[_0x4a69('0x24')](_0x1ade6f);}return _0x331c97[_0x4a69('0x25')]();};}function saveUpdates(_0x4edca4,_0x2f7085){return function(_0x4ccec0){if(_0x4ccec0){return _0x4ccec0[_0x4a69('0x26')](_0x4edca4)[_0x4a69('0x27')](function(_0x583e05){return _0x583e05;});}return null;};}function removeEntity(_0x1ae83a,_0x52c886){return function(_0x2c4676){if(_0x2c4676){return _0x2c4676[_0x4a69('0x28')]()[_0x4a69('0x27')](function(){_0x1ae83a[_0x4a69('0x1a')](0xcc)[_0x4a69('0x1b')]();});}};}function handleEntityNotFound(_0x11b8d9,_0x497a22){return function(_0x2144de){if(!_0x2144de){_0x11b8d9[_0x4a69('0x29')](0x194);}return _0x2144de;};}function handleError(_0x5b01ad,_0xcd1af1){_0xcd1af1=_0xcd1af1||0x1f4;return function(_0x305eb1){logger['error'](_0x305eb1['stack']);if(_0x305eb1[_0x4a69('0x2a')]){delete _0x305eb1['name'];}_0x5b01ad['status'](_0xcd1af1)[_0x4a69('0x2b')](_0x305eb1);};}exports[_0x4a69('0x2c')]=function(_0x34e36b,_0x436f08){var _0x3ff847={},_0x2d487c={},_0xad11cf={'count':0x0,'rows':[]};var _0xfe4538=_[_0x4a69('0x2d')](db[_0x4a69('0x2e')]['rawAttributes'],function(_0x283eb7){return{'name':_0x283eb7[_0x4a69('0x2f')],'type':_0x283eb7[_0x4a69('0x30')][_0x4a69('0x31')]};});_0x2d487c[_0x4a69('0x32')]=_[_0x4a69('0x2d')](_0xfe4538,_0x4a69('0x2a'));_0x2d487c['query']=_[_0x4a69('0x33')](_0x34e36b[_0x4a69('0x34')]);_0x2d487c['filters']=_[_0x4a69('0x35')](_0x2d487c[_0x4a69('0x32')],_0x2d487c[_0x4a69('0x34')]);_0x3ff847[_0x4a69('0x36')]=_[_0x4a69('0x35')](_0x2d487c[_0x4a69('0x32')],qs[_0x4a69('0x37')](_0x34e36b[_0x4a69('0x34')]['fields']));_0x3ff847[_0x4a69('0x36')]=_0x3ff847['attributes'][_0x4a69('0x38')]?_0x3ff847[_0x4a69('0x36')]:_0x2d487c[_0x4a69('0x32')];if(!_0x34e36b[_0x4a69('0x34')]['hasOwnProperty'](_0x4a69('0x39'))){_0x3ff847[_0x4a69('0x1f')]=qs[_0x4a69('0x1f')](_0x34e36b[_0x4a69('0x34')][_0x4a69('0x1f')]);_0x3ff847[_0x4a69('0x1d')]=qs[_0x4a69('0x1d')](_0x34e36b[_0x4a69('0x34')][_0x4a69('0x1d')]);}_0x3ff847[_0x4a69('0x3a')]=qs[_0x4a69('0x3b')](_0x34e36b[_0x4a69('0x34')]['sort']);_0x3ff847[_0x4a69('0x3c')]=qs['filters'](_[_0x4a69('0x3d')](_0x34e36b[_0x4a69('0x34')],_0x2d487c[_0x4a69('0x3e')]),_0xfe4538);if(_0x34e36b[_0x4a69('0x34')][_0x4a69('0x3f')]){_0x3ff847[_0x4a69('0x3c')]=_[_0x4a69('0x40')](_0x3ff847[_0x4a69('0x3c')],{'$or':_[_0x4a69('0x2d')](_0xfe4538,function(_0x22baf5){if(_0x22baf5[_0x4a69('0x30')]!==_0x4a69('0x41')){var _0x4e6de6={};_0x4e6de6[_0x22baf5['name']]={'$like':'%'+_0x34e36b[_0x4a69('0x34')]['filter']+'%'};return _0x4e6de6;}})});}_0x3ff847=_[_0x4a69('0x40')]({},_0x3ff847,_0x34e36b[_0x4a69('0x42')]);var _0x4ba11f={'where':_0x3ff847[_0x4a69('0x3c')]};return db[_0x4a69('0x2e')][_0x4a69('0x20')](_0x4ba11f)[_0x4a69('0x27')](function(_0x778d34){_0xad11cf[_0x4a69('0x20')]=_0x778d34;if(_0x34e36b[_0x4a69('0x34')][_0x4a69('0x43')]){_0x3ff847[_0x4a69('0x44')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x4a69('0x45')](_0x3ff847);})[_0x4a69('0x27')](function(_0x8ac1c0){_0xad11cf[_0x4a69('0x46')]=_0x8ac1c0;return _0xad11cf;})['then'](respondWithFilteredResult(_0x436f08,_0x3ff847))[_0x4a69('0x47')](handleError(_0x436f08,null));};exports[_0x4a69('0x48')]=function(_0x5bee9f,_0x23ffbe){var _0x19a05f={'raw':![],'where':{'id':_0x5bee9f[_0x4a69('0x49')]['id']}},_0x7370f1={};_0x7370f1[_0x4a69('0x32')]=_[_0x4a69('0x33')](db[_0x4a69('0x2e')][_0x4a69('0x4a')]);_0x7370f1[_0x4a69('0x34')]=_[_0x4a69('0x33')](_0x5bee9f[_0x4a69('0x34')]);_0x7370f1[_0x4a69('0x3e')]=_[_0x4a69('0x35')](_0x7370f1[_0x4a69('0x32')],_0x7370f1['query']);_0x19a05f[_0x4a69('0x36')]=_['intersection'](_0x7370f1['model'],qs[_0x4a69('0x37')](_0x5bee9f['query'][_0x4a69('0x37')]));_0x19a05f[_0x4a69('0x36')]=_0x19a05f[_0x4a69('0x36')][_0x4a69('0x38')]?_0x19a05f[_0x4a69('0x36')]:_0x7370f1[_0x4a69('0x32')];if(_0x5bee9f[_0x4a69('0x34')][_0x4a69('0x43')]){_0x19a05f[_0x4a69('0x44')]=[{'all':!![]}];}_0x19a05f=_['merge']({},_0x19a05f,_0x5bee9f[_0x4a69('0x42')]);return db[_0x4a69('0x2e')][_0x4a69('0x4b')](_0x19a05f)[_0x4a69('0x27')](handleEntityNotFound(_0x23ffbe,null))['then'](respondWithResult(_0x23ffbe,null))['catch'](handleError(_0x23ffbe,null));};exports['create']=function(_0x15880c,_0x42643){return db['AnalyticFieldReport'][_0x4a69('0x4c')](_0x15880c['body'],{})['then'](respondWithResult(_0x42643,0xc9))[_0x4a69('0x47')](handleError(_0x42643,null));};exports[_0x4a69('0x4d')]=function(_0x5397c4,_0x1e94b3){return db['AnalyticFieldReport'][_0x4a69('0x4d')](_0x5397c4[_0x4a69('0x4e')],{'raw':![],'individualHooks':!![]})[_0x4a69('0x27')](respondWithResult(_0x1e94b3,0xc9))[_0x4a69('0x47')](handleError(_0x1e94b3,null));};exports[_0x4a69('0x26')]=function(_0x482655,_0x4149a6){if(_0x482655[_0x4a69('0x4e')]['id']){delete _0x482655[_0x4a69('0x4e')]['id'];}return db[_0x4a69('0x2e')][_0x4a69('0x4b')]({'where':{'id':_0x482655['params']['id']}})[_0x4a69('0x27')](handleEntityNotFound(_0x4149a6,null))[_0x4a69('0x27')](saveUpdates(_0x482655[_0x4a69('0x4e')],null))[_0x4a69('0x27')](respondWithResult(_0x4149a6,null))[_0x4a69('0x47')](handleError(_0x4149a6,null));};exports['destroy']=function(_0x50be0b,_0x325b0a){return db['AnalyticFieldReport']['find']({'where':{'id':_0x50be0b[_0x4a69('0x49')]['id']}})[_0x4a69('0x27')](handleEntityNotFound(_0x325b0a,null))[_0x4a69('0x27')](removeEntity(_0x325b0a,null))[_0x4a69('0x47')](handleError(_0x325b0a,null));};exports[_0x4a69('0x4f')]=function(_0x108f1e,_0x16ae16){return db[_0x4a69('0x2e')][_0x4a69('0x28')]({'where':{'id':_0x108f1e['query'][_0x4a69('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x16ae16,0xcc))[_0x4a69('0x47')](handleError(_0x16ae16,null));};exports['addFields']=function(_0x16ebd6,_0x52ee6c,_0x30d304){return db[_0x4a69('0x51')]['findOne']({'where':{'id':_0x16ebd6[_0x4a69('0x49')]['id']}})[_0x4a69('0x27')](handleEntityNotFound(_0x52ee6c,null))[_0x4a69('0x27')](function(_0x5c7b07){if(_0x5c7b07){return db[_0x4a69('0x52')]['transaction'](function(_0x1319b7){return db['AnalyticFieldReport'][_0x4a69('0x28')]({'where':{'CustomReportId':_0x16ebd6['params']['id']},'transaction':_0x1319b7})[_0x4a69('0x27')](function(_0x403d2c){var _0x3a4ac1=_[_0x4a69('0x2d')](_0x16ebd6[_0x4a69('0x4e')],function(_0x2f0cfb){delete _0x2f0cfb['id'];_0x2f0cfb['CustomReportId']=_0x16ebd6[_0x4a69('0x49')]['id'];return _0x2f0cfb;});return db['AnalyticFieldReport'][_0x4a69('0x4d')](_0x3a4ac1,{'transaction':_0x1319b7});});})['then'](function(){return db[_0x4a69('0x2e')][_0x4a69('0x45')]({'where':{'CustomReportId':_0x16ebd6[_0x4a69('0x49')]['id']}});});}})[_0x4a69('0x27')](respondWithResult(_0x52ee6c,null))[_0x4a69('0x47')](handleError(_0x52ee6c,null));};
\ No newline at end of file
+var _0xef0d=['destroy','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','bulkCreate','bulkDestroy','addFields','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then'];(function(_0x28941b,_0x47603b){var _0x5d7a6b=function(_0x4ba646){while(--_0x4ba646){_0x28941b['push'](_0x28941b['shift']());}};_0x5d7a6b(++_0x47603b);}(_0xef0d,0x7d));var _0xdef0=function(_0x21b788,_0x1b000c){_0x21b788=_0x21b788-0x0;var _0x32e4ba=_0xef0d[_0x21b788];return _0x32e4ba;};'use strict';var emlformat=require(_0xdef0('0x0'));var rimraf=require(_0xdef0('0x1'));var zipdir=require(_0xdef0('0x2'));var jsonpatch=require(_0xdef0('0x3'));var rp=require('request-promise');var moment=require(_0xdef0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdef0('0x5'));var ejs=require(_0xdef0('0x6'));var fs=require('fs');var fs_extra=require(_0xdef0('0x7'));var _=require(_0xdef0('0x8'));var squel=require(_0xdef0('0x9'));var crypto=require(_0xdef0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdef0('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdef0('0xc'));var Redis=require(_0xdef0('0xd'));var authService=require(_0xdef0('0xe'));var qs=require(_0xdef0('0xf'));var as=require(_0xdef0('0x10'));var hardwareService=require(_0xdef0('0x11'));var logger=require(_0xdef0('0x12'))(_0xdef0('0x13'));var utils=require(_0xdef0('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdef0('0x15'));var db=require(_0xdef0('0x16'))['db'];function respondWithStatusCode(_0x128521,_0x136a26){_0x136a26=_0x136a26||0xcc;return function(_0x529a52){if(_0x529a52){return _0x128521[_0xdef0('0x17')](_0x136a26);}return _0x128521[_0xdef0('0x18')](_0x136a26)[_0xdef0('0x19')]();};}function respondWithResult(_0xb9dd6d,_0x4f3005){_0x4f3005=_0x4f3005||0xc8;return function(_0x28e80b){if(_0x28e80b){return _0xb9dd6d['status'](_0x4f3005)['json'](_0x28e80b);}};}function respondWithFilteredResult(_0x30b05d,_0x297368){return function(_0x4e3be2){if(_0x4e3be2){var _0x472f9b=typeof _0x297368[_0xdef0('0x1a')]===_0xdef0('0x1b')&&typeof _0x297368[_0xdef0('0x1c')]===_0xdef0('0x1b');var _0x5c9cf8=_0x4e3be2[_0xdef0('0x1d')];var _0x46d330=_0x472f9b?0x0:_0x297368[_0xdef0('0x1a')];var _0x514c84=_0x472f9b?_0x4e3be2[_0xdef0('0x1d')]:_0x297368['offset']+_0x297368['limit'];var _0x1e2dca;if(_0x514c84>=_0x5c9cf8){_0x514c84=_0x5c9cf8;_0x1e2dca=0xc8;}else{_0x1e2dca=0xce;}_0x30b05d['status'](_0x1e2dca);return _0x30b05d[_0xdef0('0x1e')](_0xdef0('0x1f'),_0x46d330+'-'+_0x514c84+'/'+_0x5c9cf8)[_0xdef0('0x20')](_0x4e3be2);}return null;};}function patchUpdates(_0x387f29){return function(_0xa0ab0c){try{jsonpatch[_0xdef0('0x21')](_0xa0ab0c,_0x387f29,!![]);}catch(_0x18a64b){return BPromise[_0xdef0('0x22')](_0x18a64b);}return _0xa0ab0c['save']();};}function saveUpdates(_0x356263,_0x45db66){return function(_0x5d6a21){if(_0x5d6a21){return _0x5d6a21[_0xdef0('0x23')](_0x356263)[_0xdef0('0x24')](function(_0x1ef2ec){return _0x1ef2ec;});}return null;};}function removeEntity(_0x130302,_0x3824e4){return function(_0x33a16f){if(_0x33a16f){return _0x33a16f[_0xdef0('0x25')]()[_0xdef0('0x24')](function(){_0x130302['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd24cef,_0x5b0440){return function(_0x452728){if(!_0x452728){_0xd24cef[_0xdef0('0x17')](0x194);}return _0x452728;};}function handleError(_0x58519f,_0x21b422){_0x21b422=_0x21b422||0x1f4;return function(_0x45ad28){logger['error'](_0x45ad28[_0xdef0('0x26')]);if(_0x45ad28[_0xdef0('0x27')]){delete _0x45ad28[_0xdef0('0x27')];}_0x58519f['status'](_0x21b422)[_0xdef0('0x28')](_0x45ad28);};}exports[_0xdef0('0x29')]=function(_0x433deb,_0x3f8b23){var _0x371d65={},_0x28921b={},_0x263793={'count':0x0,'rows':[]};var _0x1ba2e0=_['map'](db[_0xdef0('0x2a')][_0xdef0('0x2b')],function(_0x1065b9){return{'name':_0x1065b9[_0xdef0('0x2c')],'type':_0x1065b9[_0xdef0('0x2d')][_0xdef0('0x2e')]};});_0x28921b[_0xdef0('0x2f')]=_[_0xdef0('0x30')](_0x1ba2e0,_0xdef0('0x27'));_0x28921b['query']=_[_0xdef0('0x31')](_0x433deb['query']);_0x28921b[_0xdef0('0x32')]=_[_0xdef0('0x33')](_0x28921b[_0xdef0('0x2f')],_0x28921b[_0xdef0('0x34')]);_0x371d65['attributes']=_[_0xdef0('0x33')](_0x28921b[_0xdef0('0x2f')],qs['fields'](_0x433deb[_0xdef0('0x34')]['fields']));_0x371d65[_0xdef0('0x35')]=_0x371d65['attributes'][_0xdef0('0x36')]?_0x371d65['attributes']:_0x28921b['model'];if(!_0x433deb[_0xdef0('0x34')][_0xdef0('0x37')](_0xdef0('0x38'))){_0x371d65[_0xdef0('0x1c')]=qs[_0xdef0('0x1c')](_0x433deb['query'][_0xdef0('0x1c')]);_0x371d65[_0xdef0('0x1a')]=qs[_0xdef0('0x1a')](_0x433deb['query'][_0xdef0('0x1a')]);}_0x371d65['order']=qs['sort'](_0x433deb['query'][_0xdef0('0x39')]);_0x371d65[_0xdef0('0x3a')]=qs[_0xdef0('0x32')](_[_0xdef0('0x3b')](_0x433deb[_0xdef0('0x34')],_0x28921b[_0xdef0('0x32')]),_0x1ba2e0);if(_0x433deb[_0xdef0('0x34')][_0xdef0('0x3c')]){_0x371d65[_0xdef0('0x3a')]=_[_0xdef0('0x3d')](_0x371d65[_0xdef0('0x3a')],{'$or':_['map'](_0x1ba2e0,function(_0x2e5a9b){if(_0x2e5a9b[_0xdef0('0x2d')]!==_0xdef0('0x3e')){var _0x3a5c9f={};_0x3a5c9f[_0x2e5a9b['name']]={'$like':'%'+_0x433deb['query'][_0xdef0('0x3c')]+'%'};return _0x3a5c9f;}})});}_0x371d65=_[_0xdef0('0x3d')]({},_0x371d65,_0x433deb[_0xdef0('0x3f')]);var _0x111186={'where':_0x371d65['where']};return db['AnalyticFieldReport'][_0xdef0('0x1d')](_0x111186)[_0xdef0('0x24')](function(_0x409a5c){_0x263793['count']=_0x409a5c;if(_0x433deb['query'][_0xdef0('0x40')]){_0x371d65[_0xdef0('0x41')]=[{'all':!![]}];}return db[_0xdef0('0x2a')][_0xdef0('0x42')](_0x371d65);})['then'](function(_0x3e55de){_0x263793[_0xdef0('0x43')]=_0x3e55de;return _0x263793;})[_0xdef0('0x24')](respondWithFilteredResult(_0x3f8b23,_0x371d65))[_0xdef0('0x44')](handleError(_0x3f8b23,null));};exports[_0xdef0('0x45')]=function(_0x6c73a3,_0x361136){var _0x35f970={'raw':![],'where':{'id':_0x6c73a3[_0xdef0('0x46')]['id']}},_0x30ee41={};_0x30ee41['model']=_[_0xdef0('0x31')](db[_0xdef0('0x2a')][_0xdef0('0x2b')]);_0x30ee41[_0xdef0('0x34')]=_[_0xdef0('0x31')](_0x6c73a3[_0xdef0('0x34')]);_0x30ee41[_0xdef0('0x32')]=_['intersection'](_0x30ee41[_0xdef0('0x2f')],_0x30ee41['query']);_0x35f970[_0xdef0('0x35')]=_[_0xdef0('0x33')](_0x30ee41[_0xdef0('0x2f')],qs[_0xdef0('0x47')](_0x6c73a3[_0xdef0('0x34')][_0xdef0('0x47')]));_0x35f970['attributes']=_0x35f970['attributes']['length']?_0x35f970[_0xdef0('0x35')]:_0x30ee41[_0xdef0('0x2f')];if(_0x6c73a3[_0xdef0('0x34')][_0xdef0('0x40')]){_0x35f970[_0xdef0('0x41')]=[{'all':!![]}];}_0x35f970=_[_0xdef0('0x3d')]({},_0x35f970,_0x6c73a3[_0xdef0('0x3f')]);return db[_0xdef0('0x2a')][_0xdef0('0x48')](_0x35f970)[_0xdef0('0x24')](handleEntityNotFound(_0x361136,null))[_0xdef0('0x24')](respondWithResult(_0x361136,null))[_0xdef0('0x44')](handleError(_0x361136,null));};exports['create']=function(_0x41a9fc,_0x5350ab){return db[_0xdef0('0x2a')][_0xdef0('0x49')](_0x41a9fc[_0xdef0('0x4a')],{})[_0xdef0('0x24')](respondWithResult(_0x5350ab,0xc9))['catch'](handleError(_0x5350ab,null));};exports[_0xdef0('0x4b')]=function(_0x4a92eb,_0x7eafa8){return db['AnalyticFieldReport'][_0xdef0('0x4b')](_0x4a92eb[_0xdef0('0x4a')],{'raw':![],'individualHooks':!![]})[_0xdef0('0x24')](respondWithResult(_0x7eafa8,0xc9))[_0xdef0('0x44')](handleError(_0x7eafa8,null));};exports['update']=function(_0x5f2ab8,_0x1a0db3){if(_0x5f2ab8[_0xdef0('0x4a')]['id']){delete _0x5f2ab8['body']['id'];}return db['AnalyticFieldReport'][_0xdef0('0x48')]({'where':{'id':_0x5f2ab8['params']['id']}})['then'](handleEntityNotFound(_0x1a0db3,null))[_0xdef0('0x24')](saveUpdates(_0x5f2ab8[_0xdef0('0x4a')],null))[_0xdef0('0x24')](respondWithResult(_0x1a0db3,null))[_0xdef0('0x44')](handleError(_0x1a0db3,null));};exports[_0xdef0('0x25')]=function(_0x3b62c2,_0x342be5){return db['AnalyticFieldReport'][_0xdef0('0x48')]({'where':{'id':_0x3b62c2[_0xdef0('0x46')]['id']}})[_0xdef0('0x24')](handleEntityNotFound(_0x342be5,null))[_0xdef0('0x24')](removeEntity(_0x342be5,null))[_0xdef0('0x44')](handleError(_0x342be5,null));};exports[_0xdef0('0x4c')]=function(_0x5e75e3,_0xfef31d){return db[_0xdef0('0x2a')][_0xdef0('0x25')]({'where':{'id':_0x5e75e3[_0xdef0('0x34')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xdef0('0x24')](respondWithResult(_0xfef31d,0xcc))[_0xdef0('0x44')](handleError(_0xfef31d,null));};exports[_0xdef0('0x4d')]=function(_0x3314a5,_0x4c9543,_0x404edb){return db['AnalyticCustomReport'][_0xdef0('0x4e')]({'where':{'id':_0x3314a5['params']['id']}})[_0xdef0('0x24')](handleEntityNotFound(_0x4c9543,null))[_0xdef0('0x24')](function(_0x36f994){if(_0x36f994){return db['sequelize'][_0xdef0('0x4f')](function(_0x4ccb83){return db['AnalyticFieldReport'][_0xdef0('0x25')]({'where':{'CustomReportId':_0x3314a5[_0xdef0('0x46')]['id']},'transaction':_0x4ccb83})[_0xdef0('0x24')](function(_0x3b7639){var _0x29ee51=_[_0xdef0('0x30')](_0x3314a5[_0xdef0('0x4a')],function(_0x2cbda4){delete _0x2cbda4['id'];_0x2cbda4[_0xdef0('0x50')]=_0x3314a5[_0xdef0('0x46')]['id'];return _0x2cbda4;});return db['AnalyticFieldReport'][_0xdef0('0x4b')](_0x29ee51,{'transaction':_0x4ccb83});});})[_0xdef0('0x24')](function(){return db['AnalyticFieldReport'][_0xdef0('0x42')]({'where':{'CustomReportId':_0x3314a5[_0xdef0('0x46')]['id']}});});}})[_0xdef0('0x24')](respondWithResult(_0x4c9543,null))[_0xdef0('0x44')](handleError(_0x4c9543,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index c9f53bd..5ecbd52 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 _0x8d15=['define','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x48708a,_0x224103){var _0x1c596e=function(_0x5b73d4){while(--_0x5b73d4){_0x48708a['push'](_0x48708a['shift']());}};_0x1c596e(++_0x224103);}(_0x8d15,0x1ee));var _0x58d1=function(_0x2df588,_0x318219){_0x2df588=_0x2df588-0x0;var _0x2871a9=_0x8d15[_0x2df588];return _0x2871a9;};'use strict';var _=require(_0x58d1('0x0'));var util=require(_0x58d1('0x1'));var logger=require('../../config/logger')(_0x58d1('0x2'));var moment=require(_0x58d1('0x3'));var BPromise=require(_0x58d1('0x4'));var rp=require(_0x58d1('0x5'));var fs=require('fs');var path=require(_0x58d1('0x6'));var rimraf=require(_0x58d1('0x7'));var config=require('../../config/environment');var attributes=require(_0x58d1('0x8'));module[_0x58d1('0x9')]=function(_0x67f943,_0x812963){return _0x67f943[_0x58d1('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0x58d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc938=['moment','request-promise','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','../../config/logger','api'];(function(_0x4d35eb,_0x543ce3){var _0x1e248b=function(_0x184594){while(--_0x184594){_0x4d35eb['push'](_0x4d35eb['shift']());}};_0x1e248b(++_0x543ce3);}(_0xc938,0x1be));var _0x8c93=function(_0x5643fd,_0x220b84){_0x5643fd=_0x5643fd-0x0;var _0x11df89=_0xc938[_0x5643fd];return _0x11df89;};'use strict';var _=require(_0x8c93('0x0'));var util=require(_0x8c93('0x1'));var logger=require(_0x8c93('0x2'))(_0x8c93('0x3'));var moment=require(_0x8c93('0x4'));var BPromise=require('bluebird');var rp=require(_0x8c93('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c93('0x6'));var config=require('../../config/environment');var attributes=require(_0x8c93('0x7'));module[_0x8c93('0x8')]=function(_0x4c60f3,_0x4787c6){return _0x4c60f3['define'](_0x8c93('0x9'),attributes,{'tableName':'analytics_report_fields','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 3e02af0..dea0172 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 _0xa9c9=['rpc','../../config/environment','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x57b287,_0x495d83){var _0x3cafa5=function(_0x295881){while(--_0x295881){_0x57b287['push'](_0x57b287['shift']());}};_0x3cafa5(++_0x495d83);}(_0xa9c9,0xbf));var _0x9a9c=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xa9c9[_0x565ed7];return _0x183ad7;};'use strict';var _=require('lodash');var util=require(_0x9a9c('0x0'));var moment=require(_0x9a9c('0x1'));var BPromise=require(_0x9a9c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a9c('0x3'));var db=require(_0x9a9c('0x4'))['db'];var utils=require(_0x9a9c('0x5'));var logger=require(_0x9a9c('0x6'))(_0x9a9c('0x7'));var config=require(_0x9a9c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9a9c('0x9')][_0x9a9c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d6ea6,_0x523c4,_0x2d73ce){return new BPromise(function(_0x461e18,_0x11b9c8){return client[_0x9a9c('0xb')](_0x2d6ea6,_0x2d73ce)[_0x9a9c('0xc')](function(_0x361824){logger[_0x9a9c('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x523c4,'request\x20sent');logger['debug'](_0x9a9c('0xe'),_0x523c4,_0x9a9c('0xf'),JSON[_0x9a9c('0x10')](_0x361824));if(_0x361824[_0x9a9c('0x11')]){if(_0x361824[_0x9a9c('0x11')]['code']===0x1f4){logger[_0x9a9c('0x11')](_0x9a9c('0x12'),_0x523c4,_0x361824[_0x9a9c('0x11')][_0x9a9c('0x13')]);return _0x11b9c8(_0x361824[_0x9a9c('0x11')][_0x9a9c('0x13')]);}logger[_0x9a9c('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x523c4,_0x361824[_0x9a9c('0x11')][_0x9a9c('0x13')]);return _0x461e18(_0x361824[_0x9a9c('0x11')][_0x9a9c('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x523c4,_0x9a9c('0xf'));_0x461e18(_0x361824[_0x9a9c('0x14')][_0x9a9c('0x13')]);}})[_0x9a9c('0x15')](function(_0x88c5f8){logger[_0x9a9c('0x11')](_0x9a9c('0x12'),_0x523c4,_0x88c5f8);_0x11b9c8(_0x88c5f8);});});}
\ No newline at end of file
+var _0x6a3d=['rpc','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x6a3d,0x162));var _0xd6a3=function(_0x2c85c0,_0x1dac4f){_0x2c85c0=_0x2c85c0-0x0;var _0xf4d4c9=_0x6a3d[_0x2c85c0];return _0xf4d4c9;};'use strict';var _=require(_0xd6a3('0x0'));var util=require(_0xd6a3('0x1'));var moment=require(_0xd6a3('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6a3('0x5'))(_0xd6a3('0x6'));var config=require('../../config/environment');var jayson=require(_0xd6a3('0x7'));var client=jayson['client'][_0xd6a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3be654,_0xbd5fc1,_0x12b21f){return new BPromise(function(_0x404d2e,_0x1ceeeb){return client[_0xd6a3('0x9')](_0x3be654,_0x12b21f)[_0xd6a3('0xa')](function(_0x552b5b){logger[_0xd6a3('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0xbd5fc1,'request\x20sent');logger['debug'](_0xd6a3('0xc'),_0xbd5fc1,'request\x20sent',JSON['stringify'](_0x552b5b));if(_0x552b5b[_0xd6a3('0xd')]){if(_0x552b5b[_0xd6a3('0xd')][_0xd6a3('0xe')]===0x1f4){logger[_0xd6a3('0xd')](_0xd6a3('0xf'),_0xbd5fc1,_0x552b5b[_0xd6a3('0xd')][_0xd6a3('0x10')]);return _0x1ceeeb(_0x552b5b['error'][_0xd6a3('0x10')]);}logger[_0xd6a3('0xd')](_0xd6a3('0xf'),_0xbd5fc1,_0x552b5b['error'][_0xd6a3('0x10')]);return _0x404d2e(_0x552b5b[_0xd6a3('0xd')][_0xd6a3('0x10')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0xbd5fc1,_0xd6a3('0x11'));_0x404d2e(_0x552b5b[_0xd6a3('0x12')][_0xd6a3('0x10')]);}})[_0xd6a3('0x13')](function(_0x337591){logger[_0xd6a3('0xd')](_0xd6a3('0xf'),_0xbd5fc1,_0x337591);_0x1ceeeb(_0x337591);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 1c4dada..f586cb4 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(_0x23a399,_0x5b4e73){var _0x8a61e8=function(_0x5afa12){while(--_0x5afa12){_0x23a399['push'](_0x23a399['shift']());}};_0x8a61e8(++_0x5b4e73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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(_0x22a29e,_0xedff6b){var _0x1742b8=function(_0x15332b){while(--_0x15332b){_0x22a29e['push'](_0x22a29e['shift']());}};_0x1742b8(++_0xedff6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 730925c..ff887c3 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 _0x4dfc=['STRING','TEXT','name'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4dfc,0xda));var _0xc4df=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x4dfc[_0x1793de];return _0x4f0309;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc4df('0x0')},'table':{'type':Sequelize[_0xc4df('0x1')]},'metric':{'type':Sequelize[_0xc4df('0x2')]},'description':{'type':Sequelize[_0xc4df('0x1')]}};
\ No newline at end of file
+var _0xaa2d=['TEXT','STRING','exports'];(function(_0x56873b,_0x2852d0){var _0x89900d=function(_0x41c4a3){while(--_0x41c4a3){_0x56873b['push'](_0x56873b['shift']());}};_0x89900d(++_0x2852d0);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdaa2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xdaa2('0x1')]},'description':{'type':Sequelize[_0xdaa2('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index a45bc99..eddda8d 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x42a791,_0x1f32c7){var _0x1732b1=function(_0x5ed167){while(--_0x5ed167){_0x42a791['push'](_0x42a791['shift']());}};_0x1732b1(++_0x1f32c7);}(_0x008c,0x188));var _0xc008=function(_0x1f5974,_0x11540c){_0x1f5974=_0x1f5974-0x0;var _0x5cb353=_0x008c[_0x1f5974];return _0x5cb353;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
+var _0xd6d6=['includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x2b82a7,_0x12a217){var _0x54c5f5=function(_0x2016f3){while(--_0x2016f3){_0x2b82a7['push'](_0x2b82a7['shift']());}};_0x54c5f5(++_0x12a217);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x609711,_0x34ff04){_0x609711=_0x609711-0x0;var _0x5b0fe7=_0xd6d6[_0x609711];return _0x5b0fe7;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index d0cd987..999f109 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 _0x03db=['AnalyticMetric','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x79ed15,_0x2aceae){var _0x5b609e=function(_0x5916e8){while(--_0x5916e8){_0x79ed15['push'](_0x79ed15['shift']());}};_0x5b609e(++_0x2aceae);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb03d('0x0'));var util=require(_0xb03d('0x1'));var logger=require(_0xb03d('0x2'))(_0xb03d('0x3'));var moment=require('moment');var BPromise=require(_0xb03d('0x4'));var rp=require(_0xb03d('0x5'));var fs=require('fs');var path=require(_0xb03d('0x6'));var rimraf=require(_0xb03d('0x7'));var config=require(_0xb03d('0x8'));var attributes=require('./analyticMetric.attributes');module[_0xb03d('0x9')]=function(_0x1a01ba,_0x9a0f36){return _0x1a01ba['define'](_0xb03d('0xa'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9aac=['./analyticMetric.attributes','define','analytics_metrics','lodash','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x118867,_0x4fc6ee){var _0xc51d94=function(_0x45538b){while(--_0x45538b){_0x118867['push'](_0x118867['shift']());}};_0xc51d94(++_0x4fc6ee);}(_0x9aac,0x135));var _0xc9aa=function(_0x47ef54,_0x5b0637){_0x47ef54=_0x47ef54-0x0;var _0x323367=_0x9aac[_0x47ef54];return _0x323367;};'use strict';var _=require(_0xc9aa('0x0'));var util=require('util');var logger=require(_0xc9aa('0x1'))(_0xc9aa('0x2'));var moment=require('moment');var BPromise=require(_0xc9aa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9aa('0x4'));var rimraf=require('rimraf');var config=require(_0xc9aa('0x5'));var attributes=require(_0xc9aa('0x6'));module['exports']=function(_0x280687,_0x2f9029){return _0x280687[_0xc9aa('0x7')]('AnalyticMetric',attributes,{'tableName':_0xc9aa('0x8'),'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 6b7d1c9..a6e6bd4 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 _0x7df3=['request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x39e164,_0x2cb93b){var _0x13fa6b=function(_0x511cb2){while(--_0x511cb2){_0x39e164['push'](_0x39e164['shift']());}};_0x13fa6b(++_0x2cb93b);}(_0x7df3,0x14b));var _0x37df=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x7df3[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x37df('0x0'));var util=require('util');var moment=require(_0x37df('0x1'));var BPromise=require(_0x37df('0x2'));var rs=require(_0x37df('0x3'));var fs=require('fs');var Redis=require(_0x37df('0x4'));var db=require(_0x37df('0x5'))['db'];var utils=require(_0x37df('0x6'));var logger=require(_0x37df('0x7'))(_0x37df('0x8'));var config=require(_0x37df('0x9'));var jayson=require(_0x37df('0xa'));var client=jayson[_0x37df('0xb')][_0x37df('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c1caf,_0x2ab2f2,_0xd605da){return new BPromise(function(_0xc56756,_0x1e1b16){return client[_0x37df('0xd')](_0x2c1caf,_0xd605da)[_0x37df('0xe')](function(_0x1cc92a){logger[_0x37df('0xf')](_0x37df('0x10'),_0x2ab2f2,'request\x20sent');logger[_0x37df('0x11')](_0x37df('0x12'),_0x2ab2f2,_0x37df('0x13'),JSON['stringify'](_0x1cc92a));if(_0x1cc92a[_0x37df('0x14')]){if(_0x1cc92a['error'][_0x37df('0x15')]===0x1f4){logger[_0x37df('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x2ab2f2,_0x1cc92a['error'][_0x37df('0x16')]);return _0x1e1b16(_0x1cc92a[_0x37df('0x14')][_0x37df('0x16')]);}logger[_0x37df('0x14')](_0x37df('0x10'),_0x2ab2f2,_0x1cc92a[_0x37df('0x14')][_0x37df('0x16')]);return _0xc56756(_0x1cc92a[_0x37df('0x14')][_0x37df('0x16')]);}else{logger[_0x37df('0xf')](_0x37df('0x10'),_0x2ab2f2,_0x37df('0x13'));_0xc56756(_0x1cc92a[_0x37df('0x17')]['message']);}})[_0x37df('0x18')](function(_0x51f115){logger[_0x37df('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x2ab2f2,_0x51f115);_0x1e1b16(_0x51f115);});});}
\ No newline at end of file
+var _0xe2cb=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x19416d,_0x54c85e){var _0x17528f=function(_0x29fb3f){while(--_0x29fb3f){_0x19416d['push'](_0x19416d['shift']());}};_0x17528f(++_0x54c85e);}(_0xe2cb,0xcd));var _0xbe2c=function(_0x35112c,_0x2240b2){_0x35112c=_0x35112c-0x0;var _0x3bda61=_0xe2cb[_0x35112c];return _0x3bda61;};'use strict';var _=require('lodash');var util=require(_0xbe2c('0x0'));var moment=require(_0xbe2c('0x1'));var BPromise=require(_0xbe2c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe2c('0x3'));var db=require(_0xbe2c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbe2c('0x5'));var config=require(_0xbe2c('0x6'));var jayson=require(_0xbe2c('0x7'));var client=jayson[_0xbe2c('0x8')][_0xbe2c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa5f10a,_0x336335,_0x36ffde){return new BPromise(function(_0x21b19e,_0x3a1244){return client[_0xbe2c('0xa')](_0xa5f10a,_0x36ffde)['then'](function(_0x59a4f9){logger[_0xbe2c('0xb')](_0xbe2c('0xc'),_0x336335,_0xbe2c('0xd'));logger[_0xbe2c('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x336335,_0xbe2c('0xd'),JSON['stringify'](_0x59a4f9));if(_0x59a4f9['error']){if(_0x59a4f9[_0xbe2c('0xf')][_0xbe2c('0x10')]===0x1f4){logger['error'](_0xbe2c('0xc'),_0x336335,_0x59a4f9[_0xbe2c('0xf')][_0xbe2c('0x11')]);return _0x3a1244(_0x59a4f9[_0xbe2c('0xf')][_0xbe2c('0x11')]);}logger['error'](_0xbe2c('0xc'),_0x336335,_0x59a4f9['error'][_0xbe2c('0x11')]);return _0x21b19e(_0x59a4f9[_0xbe2c('0xf')][_0xbe2c('0x11')]);}else{logger[_0xbe2c('0xb')](_0xbe2c('0xc'),_0x336335,'request\x20sent');_0x21b19e(_0x59a4f9['result'][_0xbe2c('0x11')]);}})['catch'](function(_0x2cf8dc){logger[_0xbe2c('0xf')](_0xbe2c('0xc'),_0x336335,_0x2cf8dc);_0x3a1244(_0x2cf8dc);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 30fdf70..a068ae1 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 _0x7118=['show','post','create','put','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x7118,0x159));var _0x8711=function(_0x1bb4a8,_0x11b51e){_0x1bb4a8=_0x1bb4a8-0x0;var _0x270930=_0x7118[_0x1bb4a8];return _0x270930;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8711('0x0'));var timeout=require(_0x8711('0x1'));var express=require('express');var router=express[_0x8711('0x2')]();var fs_extra=require(_0x8711('0x3'));var auth=require(_0x8711('0x4'));var interaction=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var controller=require(_0x8711('0x7'));router[_0x8711('0x8')]('/',auth['isAuthenticated'](),controller[_0x8711('0x9')]);router[_0x8711('0x8')](_0x8711('0xa'),auth[_0x8711('0xb')](),controller[_0x8711('0xc')]);router[_0x8711('0xd')]('/',auth[_0x8711('0xb')](),controller[_0x8711('0xe')]);router[_0x8711('0xf')](_0x8711('0xa'),auth[_0x8711('0xb')](),controller['update']);router['delete'](_0x8711('0xa'),auth[_0x8711('0xb')](),controller[_0x8711('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x3981=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy'];(function(_0x5e51c0,_0x481fc4){var _0x200337=function(_0x5ee1ce){while(--_0x5ee1ce){_0x5e51c0['push'](_0x5e51c0['shift']());}};_0x200337(++_0x481fc4);}(_0x3981,0x144));var _0x1398=function(_0x582ef4,_0x3f1108){_0x582ef4=_0x582ef4-0x0;var _0x2aeed2=_0x3981[_0x582ef4];return _0x2aeed2;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var fs_extra=require(_0x1398('0x5'));var auth=require(_0x1398('0x6'));var interaction=require(_0x1398('0x7'));var config=require(_0x1398('0x8'));var controller=require(_0x1398('0x9'));router[_0x1398('0xa')]('/',auth[_0x1398('0xb')](),controller['index']);router[_0x1398('0xa')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['show']);router[_0x1398('0xd')]('/',auth[_0x1398('0xb')](),controller[_0x1398('0xe')]);router[_0x1398('0xf')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['update']);router[_0x1398('0x10')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller[_0x1398('0x11')]);module[_0x1398('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index dd479d3..9d8fe60 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 _0x1db5=['sequelize','TEXT'];(function(_0x5884b2,_0xa393d2){var _0x31574f=function(_0x316964){while(--_0x316964){_0x5884b2['push'](_0x5884b2['shift']());}};_0x31574f(++_0xa393d2);}(_0x1db5,0x1c0));var _0x51db=function(_0x32e3bb,_0x24dc99){_0x32e3bb=_0x32e3bb-0x0;var _0x572aca=_0x1db5[_0x32e3bb];return _0x572aca;};'use strict';var Sequelize=require(_0x51db('0x0'));module['exports']={'tree':{'type':Sequelize[_0x51db('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x1b9b=['exports','sequelize'];(function(_0x509f40,_0x59b376){var _0x1786f1=function(_0x32fb5f){while(--_0x32fb5f){_0x509f40['push'](_0x509f40['shift']());}};_0x1786f1(++_0x59b376);}(_0x1b9b,0xb9));var _0xb1b9=function(_0x200b8a,_0x23cd2b){_0x200b8a=_0x200b8a-0x0;var _0x4d9ca9=_0x1b9b[_0x200b8a];return _0x4d9ca9;};'use strict';var Sequelize=require(_0xb1b9('0x0'));module[_0xb1b9('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 881f5ce..7eabc96 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 _0xffc4=['count','offset','set','apply','reject','then','destroy','error','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','filter','options','includeAll','include','rows','catch','show','find','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x45f741,_0xc0ea1d){var _0x12e05a=function(_0x483c01){while(--_0x483c01){_0x45f741['push'](_0x45f741['shift']());}};_0x12e05a(++_0xc0ea1d);}(_0xffc4,0x6c));var _0x4ffc=function(_0x42dd53,_0xec94a){_0x42dd53=_0x42dd53-0x0;var _0x3d77cb=_0xffc4[_0x42dd53];return _0x3d77cb;};'use strict';var emlformat=require(_0x4ffc('0x0'));var rimraf=require(_0x4ffc('0x1'));var zipdir=require(_0x4ffc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4ffc('0x3'));var moment=require(_0x4ffc('0x4'));var BPromise=require(_0x4ffc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4ffc('0x6'));var sox=require(_0x4ffc('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ffc('0x8'));var _=require(_0x4ffc('0x9'));var squel=require('squel');var crypto=require(_0x4ffc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4ffc('0xb'));var toCsv=require(_0x4ffc('0xc'));var querystring=require(_0x4ffc('0xd'));var Papa=require(_0x4ffc('0xe'));var Redis=require('ioredis');var authService=require(_0x4ffc('0xf'));var qs=require(_0x4ffc('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4ffc('0x11'));var logger=require(_0x4ffc('0x12'))(_0x4ffc('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4ffc('0x14'));var db=require(_0x4ffc('0x15'))['db'];function respondWithStatusCode(_0x2b68f6,_0x71d8f9){_0x71d8f9=_0x71d8f9||0xcc;return function(_0x5df1f1){if(_0x5df1f1){return _0x2b68f6[_0x4ffc('0x16')](_0x71d8f9);}return _0x2b68f6[_0x4ffc('0x17')](_0x71d8f9)[_0x4ffc('0x18')]();};}function respondWithResult(_0x1d2a88,_0x1bd94f){_0x1bd94f=_0x1bd94f||0xc8;return function(_0xcc8b6b){if(_0xcc8b6b){return _0x1d2a88[_0x4ffc('0x17')](_0x1bd94f)[_0x4ffc('0x19')](_0xcc8b6b);}};}function respondWithFilteredResult(_0x19f2aa,_0x6e4c4b){return function(_0x1c33f6){if(_0x1c33f6){var _0x578a70=typeof _0x6e4c4b['offset']===_0x4ffc('0x1a')&&typeof _0x6e4c4b[_0x4ffc('0x1b')]===_0x4ffc('0x1a');var _0x7a9f77=_0x1c33f6[_0x4ffc('0x1c')];var _0x2186e9=_0x578a70?0x0:_0x6e4c4b[_0x4ffc('0x1d')];var _0x2e682d=_0x578a70?_0x1c33f6[_0x4ffc('0x1c')]:_0x6e4c4b[_0x4ffc('0x1d')]+_0x6e4c4b[_0x4ffc('0x1b')];var _0x36d69f;if(_0x2e682d>=_0x7a9f77){_0x2e682d=_0x7a9f77;_0x36d69f=0xc8;}else{_0x36d69f=0xce;}_0x19f2aa[_0x4ffc('0x17')](_0x36d69f);return _0x19f2aa[_0x4ffc('0x1e')]('Content-Range',_0x2186e9+'-'+_0x2e682d+'/'+_0x7a9f77)[_0x4ffc('0x19')](_0x1c33f6);}return null;};}function patchUpdates(_0x1e5230){return function(_0x56660a){try{jsonpatch[_0x4ffc('0x1f')](_0x56660a,_0x1e5230,!![]);}catch(_0x12e28d){return BPromise[_0x4ffc('0x20')](_0x12e28d);}return _0x56660a['save']();};}function saveUpdates(_0x3b2191,_0x109442){return function(_0x25984a){if(_0x25984a){return _0x25984a['update'](_0x3b2191)[_0x4ffc('0x21')](function(_0x5b4bdb){return _0x5b4bdb;});}return null;};}function removeEntity(_0x1109c6,_0x2565e4){return function(_0x52bd14){if(_0x52bd14){return _0x52bd14[_0x4ffc('0x22')]()[_0x4ffc('0x21')](function(){_0x1109c6[_0x4ffc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bd2ee,_0x1ac269){return function(_0x5ce627){if(!_0x5ce627){_0x4bd2ee[_0x4ffc('0x16')](0x194);}return _0x5ce627;};}function handleError(_0x244145,_0xdd3cec){_0xdd3cec=_0xdd3cec||0x1f4;return function(_0xe233b3){logger[_0x4ffc('0x23')](_0xe233b3[_0x4ffc('0x24')]);if(_0xe233b3[_0x4ffc('0x25')]){delete _0xe233b3[_0x4ffc('0x25')];}_0x244145['status'](_0xdd3cec)['send'](_0xe233b3);};}exports[_0x4ffc('0x26')]=function(_0x3e9a42,_0x16dceb){var _0x1e2854={},_0x2758bd={},_0x334c0f={'count':0x0,'rows':[]};var _0x403bf8=_['map'](db[_0x4ffc('0x27')][_0x4ffc('0x28')],function(_0xb294d0){return{'name':_0xb294d0[_0x4ffc('0x29')],'type':_0xb294d0['type'][_0x4ffc('0x2a')]};});_0x2758bd['model']=_['map'](_0x403bf8,_0x4ffc('0x25'));_0x2758bd['query']=_[_0x4ffc('0x2b')](_0x3e9a42[_0x4ffc('0x2c')]);_0x2758bd[_0x4ffc('0x2d')]=_[_0x4ffc('0x2e')](_0x2758bd[_0x4ffc('0x2f')],_0x2758bd[_0x4ffc('0x2c')]);_0x1e2854[_0x4ffc('0x30')]=_[_0x4ffc('0x2e')](_0x2758bd[_0x4ffc('0x2f')],qs[_0x4ffc('0x31')](_0x3e9a42[_0x4ffc('0x2c')]['fields']));_0x1e2854[_0x4ffc('0x30')]=_0x1e2854[_0x4ffc('0x30')][_0x4ffc('0x32')]?_0x1e2854['attributes']:_0x2758bd[_0x4ffc('0x2f')];if(!_0x3e9a42[_0x4ffc('0x2c')][_0x4ffc('0x33')](_0x4ffc('0x34'))){_0x1e2854['limit']=qs[_0x4ffc('0x1b')](_0x3e9a42[_0x4ffc('0x2c')]['limit']);_0x1e2854['offset']=qs[_0x4ffc('0x1d')](_0x3e9a42['query'][_0x4ffc('0x1d')]);}_0x1e2854[_0x4ffc('0x35')]=qs[_0x4ffc('0x36')](_0x3e9a42['query'][_0x4ffc('0x36')]);_0x1e2854[_0x4ffc('0x37')]=qs[_0x4ffc('0x2d')](_['pick'](_0x3e9a42['query'],_0x2758bd[_0x4ffc('0x2d')]),_0x403bf8);if(_0x3e9a42[_0x4ffc('0x2c')]['filter']){_0x1e2854[_0x4ffc('0x37')]=_[_0x4ffc('0x38')](_0x1e2854[_0x4ffc('0x37')],{'$or':_[_0x4ffc('0x39')](_0x403bf8,function(_0x18625c){if(_0x18625c['type']!=='VIRTUAL'){var _0xf7f0d2={};_0xf7f0d2[_0x18625c[_0x4ffc('0x25')]]={'$like':'%'+_0x3e9a42[_0x4ffc('0x2c')][_0x4ffc('0x3a')]+'%'};return _0xf7f0d2;}})});}_0x1e2854=_[_0x4ffc('0x38')]({},_0x1e2854,_0x3e9a42[_0x4ffc('0x3b')]);var _0x3b3da9={'where':_0x1e2854['where']};return db['AnalyticTreeReport'][_0x4ffc('0x1c')](_0x3b3da9)[_0x4ffc('0x21')](function(_0x6bf5c){_0x334c0f[_0x4ffc('0x1c')]=_0x6bf5c;if(_0x3e9a42[_0x4ffc('0x2c')][_0x4ffc('0x3c')]){_0x1e2854[_0x4ffc('0x3d')]=[{'all':!![]}];}return db[_0x4ffc('0x27')]['findAll'](_0x1e2854);})[_0x4ffc('0x21')](function(_0x14d9a6){_0x334c0f[_0x4ffc('0x3e')]=_0x14d9a6;return _0x334c0f;})[_0x4ffc('0x21')](respondWithFilteredResult(_0x16dceb,_0x1e2854))[_0x4ffc('0x3f')](handleError(_0x16dceb,null));};exports[_0x4ffc('0x40')]=function(_0x563995,_0xdd1086){var _0x49de5b={'raw':!![],'where':{'id':_0x563995['params']['id']}},_0x1d055e={};_0x1d055e[_0x4ffc('0x2f')]=_[_0x4ffc('0x2b')](db['AnalyticTreeReport'][_0x4ffc('0x28')]);_0x1d055e['query']=_[_0x4ffc('0x2b')](_0x563995[_0x4ffc('0x2c')]);_0x1d055e[_0x4ffc('0x2d')]=_[_0x4ffc('0x2e')](_0x1d055e[_0x4ffc('0x2f')],_0x1d055e['query']);_0x49de5b[_0x4ffc('0x30')]=_[_0x4ffc('0x2e')](_0x1d055e['model'],qs['fields'](_0x563995[_0x4ffc('0x2c')][_0x4ffc('0x31')]));_0x49de5b['attributes']=_0x49de5b[_0x4ffc('0x30')][_0x4ffc('0x32')]?_0x49de5b['attributes']:_0x1d055e[_0x4ffc('0x2f')];if(_0x563995['query']['includeAll']){_0x49de5b['include']=[{'all':!![]}];}_0x49de5b=_[_0x4ffc('0x38')]({},_0x49de5b,_0x563995['options']);return db[_0x4ffc('0x27')][_0x4ffc('0x41')](_0x49de5b)[_0x4ffc('0x21')](handleEntityNotFound(_0xdd1086,null))[_0x4ffc('0x21')](respondWithResult(_0xdd1086,null))[_0x4ffc('0x3f')](handleError(_0xdd1086,null));};exports['create']=function(_0x364429,_0x23b56b){return db[_0x4ffc('0x27')]['create'](_0x364429[_0x4ffc('0x42')],{})[_0x4ffc('0x21')](respondWithResult(_0x23b56b,0xc9))[_0x4ffc('0x3f')](handleError(_0x23b56b,null));};exports['update']=function(_0x478d98,_0x174752){if(_0x478d98[_0x4ffc('0x42')]['id']){delete _0x478d98[_0x4ffc('0x42')]['id'];}return db[_0x4ffc('0x27')][_0x4ffc('0x41')]({'where':{'id':_0x478d98['params']['id']}})[_0x4ffc('0x21')](handleEntityNotFound(_0x174752,null))[_0x4ffc('0x21')](saveUpdates(_0x478d98['body'],null))[_0x4ffc('0x21')](respondWithResult(_0x174752,null))[_0x4ffc('0x3f')](handleError(_0x174752,null));};exports[_0x4ffc('0x22')]=function(_0x1f02ca,_0x5db87c){return db[_0x4ffc('0x27')][_0x4ffc('0x41')]({'where':{'id':_0x1f02ca[_0x4ffc('0x43')]['id']}})['then'](handleEntityNotFound(_0x5db87c,null))[_0x4ffc('0x21')](removeEntity(_0x5db87c,null))[_0x4ffc('0x3f')](handleError(_0x5db87c,null));};
\ No newline at end of file
+var _0x3da6=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','rows','catch','show','params','includeAll','find','create','body','update','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','save','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0xb7b878,_0x5c3b92){var _0x3c84b9=function(_0x21d5a2){while(--_0x21d5a2){_0xb7b878['push'](_0xb7b878['shift']());}};_0x3c84b9(++_0x5c3b92);}(_0x3da6,0x126));var _0x63da=function(_0x586642,_0x3b2e5d){_0x586642=_0x586642-0x0;var _0xef997a=_0x3da6[_0x586642];return _0xef997a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x63da('0x0'));var zipdir=require(_0x63da('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63da('0x2'));var moment=require(_0x63da('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x63da('0x4'));var util=require(_0x63da('0x5'));var path=require('path');var sox=require(_0x63da('0x6'));var csv=require(_0x63da('0x7'));var ejs=require(_0x63da('0x8'));var fs=require('fs');var fs_extra=require(_0x63da('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x63da('0xa'));var toCsv=require('to-csv');var querystring=require(_0x63da('0xb'));var Papa=require(_0x63da('0xc'));var Redis=require(_0x63da('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x63da('0xe'));var as=require(_0x63da('0xf'));var hardwareService=require(_0x63da('0x10'));var logger=require(_0x63da('0x11'))(_0x63da('0x12'));var utils=require(_0x63da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x63da('0x14'));var db=require(_0x63da('0x15'))['db'];function respondWithStatusCode(_0x173624,_0x592a2d){_0x592a2d=_0x592a2d||0xcc;return function(_0x3c7330){if(_0x3c7330){return _0x173624[_0x63da('0x16')](_0x592a2d);}return _0x173624['status'](_0x592a2d)['end']();};}function respondWithResult(_0x50afa4,_0x2de1f9){_0x2de1f9=_0x2de1f9||0xc8;return function(_0x346178){if(_0x346178){return _0x50afa4[_0x63da('0x17')](_0x2de1f9)['json'](_0x346178);}};}function respondWithFilteredResult(_0x16f45b,_0x11e4f3){return function(_0x199628){if(_0x199628){var _0x92e0b7=typeof _0x11e4f3[_0x63da('0x18')]===_0x63da('0x19')&&typeof _0x11e4f3['limit']===_0x63da('0x19');var _0x5c697d=_0x199628[_0x63da('0x1a')];var _0x1c4532=_0x92e0b7?0x0:_0x11e4f3[_0x63da('0x18')];var _0x3218ea=_0x92e0b7?_0x199628[_0x63da('0x1a')]:_0x11e4f3['offset']+_0x11e4f3[_0x63da('0x1b')];var _0x1f6ffa;if(_0x3218ea>=_0x5c697d){_0x3218ea=_0x5c697d;_0x1f6ffa=0xc8;}else{_0x1f6ffa=0xce;}_0x16f45b[_0x63da('0x17')](_0x1f6ffa);return _0x16f45b[_0x63da('0x1c')]('Content-Range',_0x1c4532+'-'+_0x3218ea+'/'+_0x5c697d)['json'](_0x199628);}return null;};}function patchUpdates(_0x425d1b){return function(_0x13d80d){try{jsonpatch['apply'](_0x13d80d,_0x425d1b,!![]);}catch(_0x100ae6){return BPromise['reject'](_0x100ae6);}return _0x13d80d[_0x63da('0x1d')]();};}function saveUpdates(_0x3128b0,_0x435cdd){return function(_0x2a78aa){if(_0x2a78aa){return _0x2a78aa['update'](_0x3128b0)['then'](function(_0x1cad00){return _0x1cad00;});}return null;};}function removeEntity(_0x3b02ec,_0x358f47){return function(_0x4f8006){if(_0x4f8006){return _0x4f8006[_0x63da('0x1e')]()['then'](function(){_0x3b02ec[_0x63da('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251910,_0x186bf3){return function(_0x4a3109){if(!_0x4a3109){_0x251910[_0x63da('0x16')](0x194);}return _0x4a3109;};}function handleError(_0x173ffb,_0x227c5e){_0x227c5e=_0x227c5e||0x1f4;return function(_0x201478){logger[_0x63da('0x1f')](_0x201478['stack']);if(_0x201478[_0x63da('0x20')]){delete _0x201478[_0x63da('0x20')];}_0x173ffb[_0x63da('0x17')](_0x227c5e)[_0x63da('0x21')](_0x201478);};}exports[_0x63da('0x22')]=function(_0x391253,_0x51b05c){var _0x2cd60e={},_0x20bcfe={},_0x1f1a50={'count':0x0,'rows':[]};var _0x5830d2=_[_0x63da('0x23')](db[_0x63da('0x24')][_0x63da('0x25')],function(_0x1b61e9){return{'name':_0x1b61e9['fieldName'],'type':_0x1b61e9['type'][_0x63da('0x26')]};});_0x20bcfe['model']=_[_0x63da('0x23')](_0x5830d2,_0x63da('0x20'));_0x20bcfe[_0x63da('0x27')]=_[_0x63da('0x28')](_0x391253[_0x63da('0x27')]);_0x20bcfe[_0x63da('0x29')]=_['intersection'](_0x20bcfe[_0x63da('0x2a')],_0x20bcfe['query']);_0x2cd60e[_0x63da('0x2b')]=_[_0x63da('0x2c')](_0x20bcfe['model'],qs[_0x63da('0x2d')](_0x391253[_0x63da('0x27')]['fields']));_0x2cd60e[_0x63da('0x2b')]=_0x2cd60e[_0x63da('0x2b')][_0x63da('0x2e')]?_0x2cd60e[_0x63da('0x2b')]:_0x20bcfe[_0x63da('0x2a')];if(!_0x391253[_0x63da('0x27')][_0x63da('0x2f')](_0x63da('0x30'))){_0x2cd60e['limit']=qs[_0x63da('0x1b')](_0x391253['query'][_0x63da('0x1b')]);_0x2cd60e[_0x63da('0x18')]=qs[_0x63da('0x18')](_0x391253['query']['offset']);}_0x2cd60e[_0x63da('0x31')]=qs[_0x63da('0x32')](_0x391253[_0x63da('0x27')][_0x63da('0x32')]);_0x2cd60e[_0x63da('0x33')]=qs[_0x63da('0x29')](_[_0x63da('0x34')](_0x391253[_0x63da('0x27')],_0x20bcfe[_0x63da('0x29')]),_0x5830d2);if(_0x391253['query'][_0x63da('0x35')]){_0x2cd60e[_0x63da('0x33')]=_[_0x63da('0x36')](_0x2cd60e[_0x63da('0x33')],{'$or':_['map'](_0x5830d2,function(_0x49647f){if(_0x49647f['type']!==_0x63da('0x37')){var _0x3eacd1={};_0x3eacd1[_0x49647f[_0x63da('0x20')]]={'$like':'%'+_0x391253[_0x63da('0x27')]['filter']+'%'};return _0x3eacd1;}})});}_0x2cd60e=_[_0x63da('0x36')]({},_0x2cd60e,_0x391253[_0x63da('0x38')]);var _0x5610cf={'where':_0x2cd60e['where']};return db[_0x63da('0x24')][_0x63da('0x1a')](_0x5610cf)[_0x63da('0x39')](function(_0x167e8a){_0x1f1a50[_0x63da('0x1a')]=_0x167e8a;if(_0x391253[_0x63da('0x27')]['includeAll']){_0x2cd60e[_0x63da('0x3a')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x2cd60e);})['then'](function(_0x37f0e8){_0x1f1a50[_0x63da('0x3b')]=_0x37f0e8;return _0x1f1a50;})[_0x63da('0x39')](respondWithFilteredResult(_0x51b05c,_0x2cd60e))[_0x63da('0x3c')](handleError(_0x51b05c,null));};exports[_0x63da('0x3d')]=function(_0x3e514f,_0x1208b6){var _0x1f0df0={'raw':!![],'where':{'id':_0x3e514f[_0x63da('0x3e')]['id']}},_0x41570d={};_0x41570d[_0x63da('0x2a')]=_[_0x63da('0x28')](db['AnalyticTreeReport']['rawAttributes']);_0x41570d['query']=_[_0x63da('0x28')](_0x3e514f[_0x63da('0x27')]);_0x41570d['filters']=_[_0x63da('0x2c')](_0x41570d[_0x63da('0x2a')],_0x41570d[_0x63da('0x27')]);_0x1f0df0['attributes']=_['intersection'](_0x41570d['model'],qs['fields'](_0x3e514f[_0x63da('0x27')][_0x63da('0x2d')]));_0x1f0df0[_0x63da('0x2b')]=_0x1f0df0[_0x63da('0x2b')][_0x63da('0x2e')]?_0x1f0df0[_0x63da('0x2b')]:_0x41570d[_0x63da('0x2a')];if(_0x3e514f['query'][_0x63da('0x3f')]){_0x1f0df0['include']=[{'all':!![]}];}_0x1f0df0=_[_0x63da('0x36')]({},_0x1f0df0,_0x3e514f['options']);return db[_0x63da('0x24')][_0x63da('0x40')](_0x1f0df0)[_0x63da('0x39')](handleEntityNotFound(_0x1208b6,null))[_0x63da('0x39')](respondWithResult(_0x1208b6,null))['catch'](handleError(_0x1208b6,null));};exports[_0x63da('0x41')]=function(_0x1a5ceb,_0x3d4be8){return db['AnalyticTreeReport'][_0x63da('0x41')](_0x1a5ceb[_0x63da('0x42')],{})['then'](respondWithResult(_0x3d4be8,0xc9))[_0x63da('0x3c')](handleError(_0x3d4be8,null));};exports[_0x63da('0x43')]=function(_0x578a6d,_0x3cc1a2){if(_0x578a6d[_0x63da('0x42')]['id']){delete _0x578a6d[_0x63da('0x42')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x578a6d['params']['id']}})[_0x63da('0x39')](handleEntityNotFound(_0x3cc1a2,null))[_0x63da('0x39')](saveUpdates(_0x578a6d[_0x63da('0x42')],null))[_0x63da('0x39')](respondWithResult(_0x3cc1a2,null))[_0x63da('0x3c')](handleError(_0x3cc1a2,null));};exports[_0x63da('0x1e')]=function(_0x1935c3,_0x32cac9){return db[_0x63da('0x24')][_0x63da('0x40')]({'where':{'id':_0x1935c3[_0x63da('0x3e')]['id']}})[_0x63da('0x39')](handleEntityNotFound(_0x32cac9,null))[_0x63da('0x39')](removeEntity(_0x32cac9,null))[_0x63da('0x3c')](handleError(_0x32cac9,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5c8bcad..da697d8 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 _0x9311=['../../config/logger','request-promise','path','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0x9311,0x1a2));var _0x1931=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9311[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1931('0x0'));var util=require(_0x1931('0x1'));var logger=require(_0x1931('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1931('0x3'));var fs=require('fs');var path=require(_0x1931('0x4'));var rimraf=require(_0x1931('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x1931('0x6')]=function(_0x271523,_0x2b4068){return _0x271523[_0x1931('0x7')](_0x1931('0x8'),attributes,{'tableName':_0x1931('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1607=['exports','AnalyticTreeReport','analytics_report_trees','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x5aef75,_0x39228e){var _0x1bb942=function(_0x33884c){while(--_0x33884c){_0x5aef75['push'](_0x5aef75['shift']());}};_0x1bb942(++_0x39228e);}(_0x1607,0xb7));var _0x7160=function(_0x28e1dd,_0x1fa30f){_0x28e1dd=_0x28e1dd-0x0;var _0x14e3fe=_0x1607[_0x28e1dd];return _0x14e3fe;};'use strict';var _=require('lodash');var util=require(_0x7160('0x0'));var logger=require(_0x7160('0x1'))(_0x7160('0x2'));var moment=require('moment');var BPromise=require(_0x7160('0x3'));var rp=require(_0x7160('0x4'));var fs=require('fs');var path=require(_0x7160('0x5'));var rimraf=require(_0x7160('0x6'));var config=require(_0x7160('0x7'));var attributes=require(_0x7160('0x8'));module[_0x7160('0x9')]=function(_0x492370,_0x5bb043){return _0x492370['define'](_0x7160('0xa'),attributes,{'tableName':_0x7160('0xb'),'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 be8bdde..a6f147f 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x227bfa,_0x51bedc){var _0x331aba=function(_0x36e65b){while(--_0x36e65b){_0x227bfa['push'](_0x227bfa['shift']());}};_0x331aba(++_0x51bedc);}(_0x2ef3,0xba));var _0x32ef=function(_0x144c0e,_0x57d78e){_0x144c0e=_0x144c0e-0x0;var _0x2c8e1f=_0x2ef3[_0x144c0e];return _0x2c8e1f;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x11b25a,_0x5e4f65){var _0x27b8b2=function(_0x576318){while(--_0x576318){_0x11b25a['push'](_0x11b25a['shift']());}};_0x27b8b2(++_0x5e4f65);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e85d5c3..7a99c1f 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 _0x03dd=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','create','/:id','update','delete'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0x03dd,0x72));var _0xd03d=function(_0x12fec1,_0x20be9c){_0x12fec1=_0x12fec1-0x0;var _0x26c3af=_0x03dd[_0x12fec1];return _0x26c3af;};'use strict';var multer=require(_0xd03d('0x0'));var util=require('util');var path=require(_0xd03d('0x1'));var timeout=require('connect-timeout');var express=require(_0xd03d('0x2'));var router=express[_0xd03d('0x3')]();var fs_extra=require(_0xd03d('0x4'));var auth=require(_0xd03d('0x5'));var interaction=require(_0xd03d('0x6'));var config=require('../../config/environment');var controller=require(_0xd03d('0x7'));router[_0xd03d('0x8')]('/',auth[_0xd03d('0x9')](),controller['index']);router[_0xd03d('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd03d('0x9')](),controller[_0xd03d('0xa')]);router['put'](_0xd03d('0xb'),auth[_0xd03d('0x9')](),controller[_0xd03d('0xc')]);router[_0xd03d('0xd')]('/:id',auth[_0xd03d('0x9')](),controller[_0xd03d('0xe')]);module[_0xd03d('0xf')]=router;
\ No newline at end of file
+var _0x19e2=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x40ca6f,_0x806df8){var _0x4ad99d=function(_0x2785f4){while(--_0x2785f4){_0x40ca6f['push'](_0x40ca6f['shift']());}};_0x4ad99d(++_0x806df8);}(_0x19e2,0x19a));var _0x219e=function(_0x341de2,_0x31c27b){_0x341de2=_0x341de2-0x0;var _0x3d10b1=_0x19e2[_0x341de2];return _0x3d10b1;};'use strict';var multer=require(_0x219e('0x0'));var util=require(_0x219e('0x1'));var path=require(_0x219e('0x2'));var timeout=require(_0x219e('0x3'));var express=require(_0x219e('0x4'));var router=express[_0x219e('0x5')]();var fs_extra=require(_0x219e('0x6'));var auth=require(_0x219e('0x7'));var interaction=require(_0x219e('0x8'));var config=require(_0x219e('0x9'));var controller=require('./analyticTreeReport.controller');router[_0x219e('0xa')]('/',auth[_0x219e('0xb')](),controller[_0x219e('0xc')]);router[_0x219e('0xa')]('/:id',auth[_0x219e('0xb')](),controller[_0x219e('0xd')]);router['post']('/',auth[_0x219e('0xb')](),controller[_0x219e('0xe')]);router[_0x219e('0xf')](_0x219e('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x219e('0x11')](_0x219e('0x10'),auth[_0x219e('0xb')](),controller['destroy']);module[_0x219e('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 9077e08..25523db 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 _0x87ae=['STRING'];(function(_0x239cac,_0x143b28){var _0x1f3bbf=function(_0x572828){while(--_0x572828){_0x239cac['push'](_0x239cac['shift']());}};_0x1f3bbf(++_0x143b28);}(_0x87ae,0xf5));var _0xe87a=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x87ae[_0x22e47a];return _0x15a12a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe87a('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x18a5=['exports','STRING','sequelize'];(function(_0x43548f,_0x24ebb8){var _0x49b301=function(_0x45c336){while(--_0x45c336){_0x43548f['push'](_0x43548f['shift']());}};_0x49b301(++_0x24ebb8);}(_0x18a5,0x164));var _0x518a=function(_0x1f9ba0,_0x1d91d5){_0x1f9ba0=_0x1f9ba0-0x0;var _0x3267d5=_0x18a5[_0x1f9ba0];return _0x3267d5;};'use strict';var Sequelize=require(_0x518a('0x0'));module[_0x518a('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x518a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 033a07e..2ddddf5 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 _0x5401=['reject','save','update','destroy','then','stack','name','index','map','Attachment','rawAttributes','fieldName','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','clone','get','omit','updatedAt','body','createdAt','create','file','originalname','basename','type','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','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','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply'];(function(_0x57c711,_0x3fe948){var _0x123995=function(_0x538957){while(--_0x538957){_0x57c711['push'](_0x57c711['shift']());}};_0x123995(++_0x3fe948);}(_0x5401,0x9a));var _0x1540=function(_0x4b140a,_0x3d82ed){_0x4b140a=_0x4b140a-0x0;var _0x1d3b60=_0x5401[_0x4b140a];return _0x1d3b60;};'use strict';var emlformat=require(_0x1540('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1540('0x1'));var jsonpatch=require(_0x1540('0x2'));var rp=require(_0x1540('0x3'));var moment=require(_0x1540('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1540('0x5'));var util=require(_0x1540('0x6'));var path=require(_0x1540('0x7'));var sox=require(_0x1540('0x8'));var csv=require(_0x1540('0x9'));var ejs=require(_0x1540('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1540('0xb'));var squel=require(_0x1540('0xc'));var crypto=require(_0x1540('0xd'));var jsforce=require(_0x1540('0xe'));var deskjs=require(_0x1540('0xf'));var toCsv=require(_0x1540('0x9'));var querystring=require(_0x1540('0x10'));var Papa=require(_0x1540('0x11'));var Redis=require(_0x1540('0x12'));var authService=require(_0x1540('0x13'));var qs=require(_0x1540('0x14'));var as=require(_0x1540('0x15'));var hardwareService=require(_0x1540('0x16'));var logger=require(_0x1540('0x17'))(_0x1540('0x18'));var utils=require(_0x1540('0x19'));var config=require(_0x1540('0x1a'));var licenseUtil=require(_0x1540('0x1b'));var db=require(_0x1540('0x1c'))['db'];function respondWithStatusCode(_0x5a838b,_0x12fbb3){_0x12fbb3=_0x12fbb3||0xcc;return function(_0x44be7b){if(_0x44be7b){return _0x5a838b[_0x1540('0x1d')](_0x12fbb3);}return _0x5a838b[_0x1540('0x1e')](_0x12fbb3)[_0x1540('0x1f')]();};}function respondWithResult(_0x2987bc,_0x1fa8bc){_0x1fa8bc=_0x1fa8bc||0xc8;return function(_0xd10d67){if(_0xd10d67){return _0x2987bc[_0x1540('0x1e')](_0x1fa8bc)[_0x1540('0x20')](_0xd10d67);}};}function respondWithFilteredResult(_0x172e16,_0x5245ab){return function(_0x366991){if(_0x366991){var _0x29ecb5=typeof _0x5245ab['offset']===_0x1540('0x21')&&typeof _0x5245ab[_0x1540('0x22')]===_0x1540('0x21');var _0x212de4=_0x366991[_0x1540('0x23')];var _0x34cd9f=_0x29ecb5?0x0:_0x5245ab['offset'];var _0x24fc69=_0x29ecb5?_0x366991[_0x1540('0x23')]:_0x5245ab[_0x1540('0x24')]+_0x5245ab[_0x1540('0x22')];var _0x571fa7;if(_0x24fc69>=_0x212de4){_0x24fc69=_0x212de4;_0x571fa7=0xc8;}else{_0x571fa7=0xce;}_0x172e16[_0x1540('0x1e')](_0x571fa7);return _0x172e16[_0x1540('0x25')](_0x1540('0x26'),_0x34cd9f+'-'+_0x24fc69+'/'+_0x212de4)[_0x1540('0x20')](_0x366991);}return null;};}function patchUpdates(_0x433aee){return function(_0x3567de){try{jsonpatch[_0x1540('0x27')](_0x3567de,_0x433aee,!![]);}catch(_0x20825c){return BPromise[_0x1540('0x28')](_0x20825c);}return _0x3567de[_0x1540('0x29')]();};}function saveUpdates(_0x48d799,_0x556eed){return function(_0x3ce7a7){if(_0x3ce7a7){return _0x3ce7a7[_0x1540('0x2a')](_0x48d799)['then'](function(_0x59cbfb){return _0x59cbfb;});}return null;};}function removeEntity(_0x34dec4,_0x389162){return function(_0x3d9587){if(_0x3d9587){return _0x3d9587[_0x1540('0x2b')]()[_0x1540('0x2c')](function(){_0x34dec4['status'](0xcc)[_0x1540('0x1f')]();});}};}function handleEntityNotFound(_0x63408f,_0x378cf1){return function(_0x34015a){if(!_0x34015a){_0x63408f[_0x1540('0x1d')](0x194);}return _0x34015a;};}function handleError(_0x3d4ab7,_0x40d05b){_0x40d05b=_0x40d05b||0x1f4;return function(_0x166c6f){logger['error'](_0x166c6f[_0x1540('0x2d')]);if(_0x166c6f[_0x1540('0x2e')]){delete _0x166c6f['name'];}_0x3d4ab7['status'](_0x40d05b)['send'](_0x166c6f);};}exports[_0x1540('0x2f')]=function(_0x341b73,_0x25ec4e){var _0x19bec5={},_0x1f1249={},_0x3793f0={'count':0x0,'rows':[]};var _0x40e559=_[_0x1540('0x30')](db[_0x1540('0x31')][_0x1540('0x32')],function(_0xff683a){return{'name':_0xff683a[_0x1540('0x33')],'type':_0xff683a['type'][_0x1540('0x34')]};});_0x1f1249[_0x1540('0x35')]=_[_0x1540('0x30')](_0x40e559,_0x1540('0x2e'));_0x1f1249['query']=_[_0x1540('0x36')](_0x341b73['query']);_0x1f1249['filters']=_[_0x1540('0x37')](_0x1f1249[_0x1540('0x35')],_0x1f1249[_0x1540('0x38')]);_0x19bec5['attributes']=_['intersection'](_0x1f1249['model'],qs[_0x1540('0x39')](_0x341b73['query'][_0x1540('0x39')]));_0x19bec5['attributes']=_0x19bec5[_0x1540('0x3a')][_0x1540('0x3b')]?_0x19bec5[_0x1540('0x3a')]:_0x1f1249[_0x1540('0x35')];if(!_0x341b73[_0x1540('0x38')][_0x1540('0x3c')](_0x1540('0x3d'))){_0x19bec5[_0x1540('0x22')]=qs[_0x1540('0x22')](_0x341b73[_0x1540('0x38')][_0x1540('0x22')]);_0x19bec5[_0x1540('0x24')]=qs['offset'](_0x341b73['query'][_0x1540('0x24')]);}_0x19bec5[_0x1540('0x3e')]=qs[_0x1540('0x3f')](_0x341b73[_0x1540('0x38')][_0x1540('0x3f')]);_0x19bec5[_0x1540('0x40')]=qs[_0x1540('0x41')](_[_0x1540('0x42')](_0x341b73[_0x1540('0x38')],_0x1f1249[_0x1540('0x41')]),_0x40e559);if(_0x341b73[_0x1540('0x38')][_0x1540('0x43')]){_0x19bec5[_0x1540('0x40')]=_[_0x1540('0x44')](_0x19bec5[_0x1540('0x40')],{'$or':_[_0x1540('0x30')](_0x40e559,function(_0x69aede){if(_0x69aede['type']!==_0x1540('0x45')){var _0xc74270={};_0xc74270[_0x69aede[_0x1540('0x2e')]]={'$like':'%'+_0x341b73[_0x1540('0x38')][_0x1540('0x43')]+'%'};return _0xc74270;}})});}_0x19bec5=_[_0x1540('0x44')]({},_0x19bec5,_0x341b73[_0x1540('0x46')]);var _0xf5148b={'where':_0x19bec5[_0x1540('0x40')]};return db[_0x1540('0x31')][_0x1540('0x23')](_0xf5148b)[_0x1540('0x2c')](function(_0x398453){_0x3793f0[_0x1540('0x23')]=_0x398453;if(_0x341b73[_0x1540('0x38')]['includeAll']){_0x19bec5[_0x1540('0x47')]=[{'all':!![]}];}return db[_0x1540('0x31')][_0x1540('0x48')](_0x19bec5);})[_0x1540('0x2c')](function(_0x56af95){_0x3793f0[_0x1540('0x49')]=_0x56af95;return _0x3793f0;})[_0x1540('0x2c')](respondWithFilteredResult(_0x25ec4e,_0x19bec5))[_0x1540('0x4a')](handleError(_0x25ec4e,null));};exports[_0x1540('0x4b')]=function(_0x361f41,_0x9a25c4){var _0x49fc9f={'raw':!![],'where':{'id':_0x361f41[_0x1540('0x4c')]['id']}},_0x58ac8b={};_0x58ac8b['model']=_[_0x1540('0x36')](db[_0x1540('0x31')][_0x1540('0x32')]);_0x58ac8b[_0x1540('0x38')]=_[_0x1540('0x36')](_0x361f41[_0x1540('0x38')]);_0x58ac8b[_0x1540('0x41')]=_[_0x1540('0x37')](_0x58ac8b[_0x1540('0x35')],_0x58ac8b[_0x1540('0x38')]);_0x49fc9f['attributes']=_['intersection'](_0x58ac8b['model'],qs[_0x1540('0x39')](_0x361f41['query'][_0x1540('0x39')]));_0x49fc9f['attributes']=_0x49fc9f['attributes']['length']?_0x49fc9f[_0x1540('0x3a')]:_0x58ac8b['model'];if(_0x361f41[_0x1540('0x38')][_0x1540('0x4d')]){_0x49fc9f[_0x1540('0x47')]=[{'all':!![]}];}_0x49fc9f=_[_0x1540('0x44')]({},_0x49fc9f,_0x361f41[_0x1540('0x46')]);return db[_0x1540('0x31')][_0x1540('0x4e')](_0x49fc9f)[_0x1540('0x2c')](handleEntityNotFound(_0x9a25c4,null))[_0x1540('0x2c')](respondWithResult(_0x9a25c4,null))['catch'](handleError(_0x9a25c4,null));};exports[_0x1540('0x4f')]=function(_0x177ad1,_0x4b4204){var _0x21e7d7={'where':{'id':_0x177ad1[_0x1540('0x4c')]['id']}},_0x20531d={};_0x20531d['model']=_[_0x1540('0x36')](db['Attachment']['rawAttributes']);_0x21e7d7[_0x1540('0x3a')]=_[_0x1540('0x37')](_0x20531d[_0x1540('0x35')],qs[_0x1540('0x39')](_0x177ad1[_0x1540('0x38')]['fields']));_0x21e7d7['attributes']=_0x21e7d7[_0x1540('0x3a')][_0x1540('0x3b')]?_0x21e7d7[_0x1540('0x3a')]:_0x20531d[_0x1540('0x35')];if(_0x177ad1['query'][_0x1540('0x4d')]){_0x21e7d7[_0x1540('0x47')]=[{'all':!![]}];}_0x21e7d7=_[_0x1540('0x44')]({},_0x21e7d7,_0x177ad1[_0x1540('0x46')]);return db[_0x1540('0x31')][_0x1540('0x4e')](_0x21e7d7)['then'](handleEntityNotFound(_0x4b4204,null))[_0x1540('0x2c')](function(_0x57bb4a){if(_0x57bb4a){var _0x2d7095=_0x57bb4a[_0x1540('0x50')]({'plain':!![]});_0x2d7095=qs[_0x1540('0x51')](_0x2d7095,['id','createdAt',_0x1540('0x52')]);_0x177ad1[_0x1540('0x53')]=_[_0x1540('0x51')](_0x177ad1[_0x1540('0x53')],['id',_0x1540('0x54'),_0x1540('0x52')]);return db[_0x1540('0x31')][_0x1540('0x55')](_[_0x1540('0x44')](_0x2d7095,_0x177ad1['body']),{'include':_0x177ad1[_0x1540('0x38')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x1540('0x2c')](respondWithResult(_0x4b4204,0xc9))[_0x1540('0x4a')](handleError(_0x4b4204,null));};exports['update']=function(_0x439ed5,_0x19c18b){if(_0x439ed5[_0x1540('0x53')]['id']){delete _0x439ed5[_0x1540('0x53')]['id'];}return db[_0x1540('0x31')][_0x1540('0x4e')]({'where':{'id':_0x439ed5[_0x1540('0x4c')]['id']}})[_0x1540('0x2c')](handleEntityNotFound(_0x19c18b,null))[_0x1540('0x2c')](saveUpdates(_0x439ed5[_0x1540('0x53')],null))[_0x1540('0x2c')](respondWithResult(_0x19c18b,null))[_0x1540('0x4a')](handleError(_0x19c18b,null));};exports[_0x1540('0x2b')]=function(_0x42feb2,_0x13b44d){return db[_0x1540('0x31')]['find']({'where':{'id':_0x42feb2[_0x1540('0x4c')]['id']}})['then'](handleEntityNotFound(_0x13b44d,null))[_0x1540('0x2c')](removeEntity(_0x13b44d,null))[_0x1540('0x4a')](handleError(_0x13b44d,null));};exports['create']=function(_0x532f9b,_0x378b4a,_0x10b69e){_0x532f9b[_0x1540('0x53')][_0x1540('0x2e')]=_0x532f9b[_0x1540('0x56')][_0x1540('0x57')];_0x532f9b[_0x1540('0x53')][_0x1540('0x58')]=_0x532f9b['file']['filename'];_0x532f9b[_0x1540('0x53')][_0x1540('0x59')]=_0x532f9b[_0x1540('0x56')]['mimetype'];return db[_0x1540('0x31')][_0x1540('0x55')](_0x532f9b[_0x1540('0x53')])[_0x1540('0x2c')](respondWithResult(_0x378b4a,0xc9))[_0x1540('0x4a')](handleError(_0x378b4a,null));};exports[_0x1540('0x5a')]=function(_0x26d08,_0x56657a,_0x346d3e){return db[_0x1540('0x31')][_0x1540('0x5b')]({'where':{'id':_0x26d08[_0x1540('0x4c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x56657a,null))[_0x1540('0x2c')](function(_0x14986e){if(_0x14986e){var _0x29ff53=_0x14986e[_0x1540('0x5c')]!==null;var _0x3710e0=path[_0x1540('0x5d')](config[_0x1540('0x5e')],_0x1540('0x5f'));if(_0x29ff53){_0x3710e0=path[_0x1540('0x5d')](_0x3710e0,_0x1540('0x60'));}var _0x2651ce=path['join'](_0x3710e0,_0x14986e[_0x1540('0x58')]);return _0x56657a[_0x1540('0x5a')](_0x2651ce);}})[_0x1540('0x4a')](handleError(_0x56657a,null));};
\ No newline at end of file
+var _0xefa5=['update','then','destroy','error','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','clone','omit','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','join','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','json','apply','reject','save'];(function(_0x14a381,_0x1887d6){var _0xad254b=function(_0x1bb797){while(--_0x1bb797){_0x14a381['push'](_0x14a381['shift']());}};_0xad254b(++_0x1887d6);}(_0xefa5,0x18c));var _0x5efa=function(_0x283c87,_0x545688){_0x283c87=_0x283c87-0x0;var _0xde4143=_0xefa5[_0x283c87];return _0xde4143;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5efa('0x0'));var zipdir=require(_0x5efa('0x1'));var jsonpatch=require(_0x5efa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5efa('0x3'));var Mustache=require('mustache');var util=require(_0x5efa('0x4'));var path=require(_0x5efa('0x5'));var sox=require(_0x5efa('0x6'));var csv=require(_0x5efa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5efa('0x8'));var _=require(_0x5efa('0x9'));var squel=require(_0x5efa('0xa'));var crypto=require(_0x5efa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5efa('0xc'));var toCsv=require(_0x5efa('0x7'));var querystring=require(_0x5efa('0xd'));var Papa=require(_0x5efa('0xe'));var Redis=require(_0x5efa('0xf'));var authService=require(_0x5efa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5efa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5efa('0x12'))(_0x5efa('0x13'));var utils=require(_0x5efa('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5efa('0x15'));var db=require(_0x5efa('0x16'))['db'];function respondWithStatusCode(_0x57a0d1,_0x281280){_0x281280=_0x281280||0xcc;return function(_0x1f09e2){if(_0x1f09e2){return _0x57a0d1[_0x5efa('0x17')](_0x281280);}return _0x57a0d1['status'](_0x281280)[_0x5efa('0x18')]();};}function respondWithResult(_0x4299aa,_0x4336ad){_0x4336ad=_0x4336ad||0xc8;return function(_0x251619){if(_0x251619){return _0x4299aa['status'](_0x4336ad)['json'](_0x251619);}};}function respondWithFilteredResult(_0x345c06,_0x6c814f){return function(_0x40cf34){if(_0x40cf34){var _0x4e1705=typeof _0x6c814f[_0x5efa('0x19')]==='undefined'&&typeof _0x6c814f[_0x5efa('0x1a')]===_0x5efa('0x1b');var _0x515f72=_0x40cf34[_0x5efa('0x1c')];var _0x3cab3d=_0x4e1705?0x0:_0x6c814f[_0x5efa('0x19')];var _0x4a9381=_0x4e1705?_0x40cf34[_0x5efa('0x1c')]:_0x6c814f[_0x5efa('0x19')]+_0x6c814f[_0x5efa('0x1a')];var _0x3b2700;if(_0x4a9381>=_0x515f72){_0x4a9381=_0x515f72;_0x3b2700=0xc8;}else{_0x3b2700=0xce;}_0x345c06[_0x5efa('0x1d')](_0x3b2700);return _0x345c06['set']('Content-Range',_0x3cab3d+'-'+_0x4a9381+'/'+_0x515f72)[_0x5efa('0x1e')](_0x40cf34);}return null;};}function patchUpdates(_0x3c6f98){return function(_0x24ad7b){try{jsonpatch[_0x5efa('0x1f')](_0x24ad7b,_0x3c6f98,!![]);}catch(_0x2302a5){return BPromise[_0x5efa('0x20')](_0x2302a5);}return _0x24ad7b[_0x5efa('0x21')]();};}function saveUpdates(_0x3c62d9,_0x236ed2){return function(_0x3a69d1){if(_0x3a69d1){return _0x3a69d1[_0x5efa('0x22')](_0x3c62d9)[_0x5efa('0x23')](function(_0x5b718f){return _0x5b718f;});}return null;};}function removeEntity(_0x1cdc7a,_0x2471ba){return function(_0x36d539){if(_0x36d539){return _0x36d539[_0x5efa('0x24')]()[_0x5efa('0x23')](function(){_0x1cdc7a[_0x5efa('0x1d')](0xcc)[_0x5efa('0x18')]();});}};}function handleEntityNotFound(_0xb99be7,_0x50d115){return function(_0x37f75c){if(!_0x37f75c){_0xb99be7['sendStatus'](0x194);}return _0x37f75c;};}function handleError(_0xc17675,_0x559bbf){_0x559bbf=_0x559bbf||0x1f4;return function(_0x31f1bb){logger[_0x5efa('0x25')](_0x31f1bb['stack']);if(_0x31f1bb[_0x5efa('0x26')]){delete _0x31f1bb[_0x5efa('0x26')];}_0xc17675[_0x5efa('0x1d')](_0x559bbf)[_0x5efa('0x27')](_0x31f1bb);};}exports[_0x5efa('0x28')]=function(_0x1c1494,_0x1943a9){var _0x393df5={},_0xdb5375={},_0x3e21bb={'count':0x0,'rows':[]};var _0x1942b1=_['map'](db[_0x5efa('0x29')][_0x5efa('0x2a')],function(_0x567a57){return{'name':_0x567a57[_0x5efa('0x2b')],'type':_0x567a57[_0x5efa('0x2c')][_0x5efa('0x2d')]};});_0xdb5375[_0x5efa('0x2e')]=_[_0x5efa('0x2f')](_0x1942b1,_0x5efa('0x26'));_0xdb5375[_0x5efa('0x30')]=_[_0x5efa('0x31')](_0x1c1494[_0x5efa('0x30')]);_0xdb5375[_0x5efa('0x32')]=_[_0x5efa('0x33')](_0xdb5375[_0x5efa('0x2e')],_0xdb5375[_0x5efa('0x30')]);_0x393df5[_0x5efa('0x34')]=_[_0x5efa('0x33')](_0xdb5375[_0x5efa('0x2e')],qs[_0x5efa('0x35')](_0x1c1494[_0x5efa('0x30')]['fields']));_0x393df5[_0x5efa('0x34')]=_0x393df5[_0x5efa('0x34')][_0x5efa('0x36')]?_0x393df5[_0x5efa('0x34')]:_0xdb5375[_0x5efa('0x2e')];if(!_0x1c1494[_0x5efa('0x30')][_0x5efa('0x37')](_0x5efa('0x38'))){_0x393df5[_0x5efa('0x1a')]=qs[_0x5efa('0x1a')](_0x1c1494['query'][_0x5efa('0x1a')]);_0x393df5[_0x5efa('0x19')]=qs[_0x5efa('0x19')](_0x1c1494[_0x5efa('0x30')]['offset']);}_0x393df5[_0x5efa('0x39')]=qs[_0x5efa('0x3a')](_0x1c1494[_0x5efa('0x30')][_0x5efa('0x3a')]);_0x393df5['where']=qs['filters'](_['pick'](_0x1c1494[_0x5efa('0x30')],_0xdb5375[_0x5efa('0x32')]),_0x1942b1);if(_0x1c1494[_0x5efa('0x30')][_0x5efa('0x3b')]){_0x393df5[_0x5efa('0x3c')]=_[_0x5efa('0x3d')](_0x393df5[_0x5efa('0x3c')],{'$or':_[_0x5efa('0x2f')](_0x1942b1,function(_0x39f62c){if(_0x39f62c[_0x5efa('0x2c')]!==_0x5efa('0x3e')){var _0x517144={};_0x517144[_0x39f62c['name']]={'$like':'%'+_0x1c1494[_0x5efa('0x30')][_0x5efa('0x3b')]+'%'};return _0x517144;}})});}_0x393df5=_[_0x5efa('0x3d')]({},_0x393df5,_0x1c1494[_0x5efa('0x3f')]);var _0x3b990c={'where':_0x393df5[_0x5efa('0x3c')]};return db[_0x5efa('0x29')][_0x5efa('0x1c')](_0x3b990c)[_0x5efa('0x23')](function(_0x2449a7){_0x3e21bb[_0x5efa('0x1c')]=_0x2449a7;if(_0x1c1494['query']['includeAll']){_0x393df5[_0x5efa('0x40')]=[{'all':!![]}];}return db[_0x5efa('0x29')][_0x5efa('0x41')](_0x393df5);})[_0x5efa('0x23')](function(_0x180c6e){_0x3e21bb[_0x5efa('0x42')]=_0x180c6e;return _0x3e21bb;})['then'](respondWithFilteredResult(_0x1943a9,_0x393df5))[_0x5efa('0x43')](handleError(_0x1943a9,null));};exports[_0x5efa('0x44')]=function(_0x1cc531,_0x2b4165){var _0x19ffe0={'raw':!![],'where':{'id':_0x1cc531[_0x5efa('0x45')]['id']}},_0x17dc53={};_0x17dc53[_0x5efa('0x2e')]=_[_0x5efa('0x31')](db[_0x5efa('0x29')][_0x5efa('0x2a')]);_0x17dc53['query']=_['keys'](_0x1cc531[_0x5efa('0x30')]);_0x17dc53[_0x5efa('0x32')]=_[_0x5efa('0x33')](_0x17dc53[_0x5efa('0x2e')],_0x17dc53[_0x5efa('0x30')]);_0x19ffe0[_0x5efa('0x34')]=_[_0x5efa('0x33')](_0x17dc53[_0x5efa('0x2e')],qs['fields'](_0x1cc531[_0x5efa('0x30')][_0x5efa('0x35')]));_0x19ffe0['attributes']=_0x19ffe0[_0x5efa('0x34')][_0x5efa('0x36')]?_0x19ffe0[_0x5efa('0x34')]:_0x17dc53[_0x5efa('0x2e')];if(_0x1cc531[_0x5efa('0x30')][_0x5efa('0x46')]){_0x19ffe0['include']=[{'all':!![]}];}_0x19ffe0=_[_0x5efa('0x3d')]({},_0x19ffe0,_0x1cc531[_0x5efa('0x3f')]);return db[_0x5efa('0x29')][_0x5efa('0x47')](_0x19ffe0)[_0x5efa('0x23')](handleEntityNotFound(_0x2b4165,null))[_0x5efa('0x23')](respondWithResult(_0x2b4165,null))[_0x5efa('0x43')](handleError(_0x2b4165,null));};exports[_0x5efa('0x48')]=function(_0x391ddb,_0x1108d4){var _0x2e124d={'where':{'id':_0x391ddb[_0x5efa('0x45')]['id']}},_0x364e66={};_0x364e66['model']=_[_0x5efa('0x31')](db['Attachment'][_0x5efa('0x2a')]);_0x2e124d['attributes']=_[_0x5efa('0x33')](_0x364e66[_0x5efa('0x2e')],qs[_0x5efa('0x35')](_0x391ddb['query'][_0x5efa('0x35')]));_0x2e124d[_0x5efa('0x34')]=_0x2e124d[_0x5efa('0x34')][_0x5efa('0x36')]?_0x2e124d['attributes']:_0x364e66['model'];if(_0x391ddb[_0x5efa('0x30')][_0x5efa('0x46')]){_0x2e124d['include']=[{'all':!![]}];}_0x2e124d=_[_0x5efa('0x3d')]({},_0x2e124d,_0x391ddb[_0x5efa('0x3f')]);return db[_0x5efa('0x29')][_0x5efa('0x47')](_0x2e124d)[_0x5efa('0x23')](handleEntityNotFound(_0x1108d4,null))[_0x5efa('0x23')](function(_0x310a61){if(_0x310a61){var _0x31d7e2=_0x310a61['get']({'plain':!![]});_0x31d7e2=qs[_0x5efa('0x49')](_0x31d7e2,['id','createdAt',_0x5efa('0x4a')]);_0x391ddb['body']=_[_0x5efa('0x49')](_0x391ddb[_0x5efa('0x4b')],['id','createdAt',_0x5efa('0x4a')]);return db[_0x5efa('0x29')]['create'](_[_0x5efa('0x3d')](_0x31d7e2,_0x391ddb[_0x5efa('0x4b')]),{'include':_0x391ddb['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x5efa('0x23')](respondWithResult(_0x1108d4,0xc9))['catch'](handleError(_0x1108d4,null));};exports['update']=function(_0x4fe530,_0x139443){if(_0x4fe530[_0x5efa('0x4b')]['id']){delete _0x4fe530[_0x5efa('0x4b')]['id'];}return db['Attachment'][_0x5efa('0x47')]({'where':{'id':_0x4fe530['params']['id']}})[_0x5efa('0x23')](handleEntityNotFound(_0x139443,null))[_0x5efa('0x23')](saveUpdates(_0x4fe530[_0x5efa('0x4b')],null))[_0x5efa('0x23')](respondWithResult(_0x139443,null))[_0x5efa('0x43')](handleError(_0x139443,null));};exports[_0x5efa('0x24')]=function(_0xdb5563,_0x2b1379){return db[_0x5efa('0x29')][_0x5efa('0x47')]({'where':{'id':_0xdb5563['params']['id']}})['then'](handleEntityNotFound(_0x2b1379,null))['then'](removeEntity(_0x2b1379,null))[_0x5efa('0x43')](handleError(_0x2b1379,null));};exports[_0x5efa('0x4c')]=function(_0x28cb7c,_0x189829,_0xa91d25){_0x28cb7c[_0x5efa('0x4b')][_0x5efa('0x26')]=_0x28cb7c[_0x5efa('0x4d')]['originalname'];_0x28cb7c[_0x5efa('0x4b')][_0x5efa('0x4e')]=_0x28cb7c[_0x5efa('0x4d')][_0x5efa('0x4f')];_0x28cb7c[_0x5efa('0x4b')][_0x5efa('0x2c')]=_0x28cb7c[_0x5efa('0x4d')][_0x5efa('0x50')];return db['Attachment']['create'](_0x28cb7c[_0x5efa('0x4b')])[_0x5efa('0x23')](respondWithResult(_0x189829,0xc9))['catch'](handleError(_0x189829,null));};exports[_0x5efa('0x51')]=function(_0xc38bf0,_0x13ed4b,_0x4f4009){return db['Attachment'][_0x5efa('0x52')]({'where':{'id':_0xc38bf0[_0x5efa('0x45')]['id']},'raw':!![]})[_0x5efa('0x23')](handleEntityNotFound(_0x13ed4b,null))[_0x5efa('0x23')](function(_0xde35f3){if(_0xde35f3){var _0x13f17f=_0xde35f3['ChatOfflineMessageId']!==null;var _0x4e71a4=path[_0x5efa('0x53')](config['root'],_0x5efa('0x54'));if(_0x13f17f){_0x4e71a4=path[_0x5efa('0x53')](_0x4e71a4,_0x5efa('0x55'));}var _0x28518f=path[_0x5efa('0x53')](_0x4e71a4,_0xde35f3[_0x5efa('0x4e')]);return _0x13ed4b[_0x5efa('0x51')](_0x28518f);}})['catch'](handleError(_0x13ed4b,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 427a80c..384500b 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 _0x546b=['Attachment','attachments','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x1b8442,_0x5a33e0){var _0x334c40=function(_0x41d48a){while(--_0x41d48a){_0x1b8442['push'](_0x1b8442['shift']());}};_0x334c40(++_0x5a33e0);}(_0x546b,0x1db));var _0xb546=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x546b[_0x599e60];return _0x468e19;};'use strict';var _=require('lodash');var util=require(_0xb546('0x0'));var logger=require(_0xb546('0x1'))(_0xb546('0x2'));var moment=require('moment');var BPromise=require(_0xb546('0x3'));var rp=require(_0xb546('0x4'));var fs=require('fs');var path=require(_0xb546('0x5'));var rimraf=require(_0xb546('0x6'));var config=require(_0xb546('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x54be7d,_0x305a43){return _0x54be7d[_0xb546('0x8')](_0xb546('0x9'),attributes,{'tableName':_0xb546('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x969f=['exports','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x1868a1,_0x315386){var _0x18de1a=function(_0x5647c4){while(--_0x5647c4){_0x1868a1['push'](_0x1868a1['shift']());}};_0x18de1a(++_0x315386);}(_0x969f,0xf2));var _0xf969=function(_0x1558ee,_0x40ed70){_0x1558ee=_0x1558ee-0x0;var _0x252dba=_0x969f[_0x1558ee];return _0x252dba;};'use strict';var _=require(_0xf969('0x0'));var util=require(_0xf969('0x1'));var logger=require(_0xf969('0x2'))('api');var moment=require(_0xf969('0x3'));var BPromise=require(_0xf969('0x4'));var rp=require(_0xf969('0x5'));var fs=require('fs');var path=require(_0xf969('0x6'));var rimraf=require(_0xf969('0x7'));var config=require(_0xf969('0x8'));var attributes=require(_0xf969('0x9'));module[_0xf969('0xa')]=function(_0xb306ff,_0x44e7b1){return _0xb306ff['define']('Attachment',attributes,{'tableName':_0xf969('0xb'),'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 6b9a964..a6e22e0 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 _0x544a=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateAttachment','Attachment','create','options','raw','then','stringify','catch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x544a,0xbd));var _0xa544=function(_0x5b0500,_0x49be7d){_0x5b0500=_0x5b0500-0x0;var _0x2a5476=_0x544a[_0x5b0500];return _0x2a5476;};'use strict';var _=require(_0xa544('0x0'));var util=require(_0xa544('0x1'));var moment=require(_0xa544('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa544('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa544('0x4'));var logger=require(_0xa544('0x5'))('rpc');var config=require(_0xa544('0x6'));var jayson=require(_0xa544('0x7'));var client=jayson[_0xa544('0x8')][_0xa544('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39caac,_0x543cd1,_0x407443){return new BPromise(function(_0x495819,_0x39bcd7){return client[_0xa544('0xa')](_0x39caac,_0x407443)['then'](function(_0x2e9a6a){logger[_0xa544('0xb')](_0xa544('0xc'),_0x543cd1,_0xa544('0xd'));logger['debug'](_0xa544('0xe'),_0x543cd1,_0xa544('0xd'),JSON['stringify'](_0x2e9a6a));if(_0x2e9a6a[_0xa544('0xf')]){if(_0x2e9a6a['error'][_0xa544('0x10')]===0x1f4){logger[_0xa544('0xf')]('Attachment,\x20%s,\x20%s',_0x543cd1,_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);return _0x39bcd7(_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);}logger[_0xa544('0xf')](_0xa544('0xc'),_0x543cd1,_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);return _0x495819(_0x2e9a6a[_0xa544('0xf')][_0xa544('0x11')]);}else{logger[_0xa544('0xb')](_0xa544('0xc'),_0x543cd1,'request\x20sent');_0x495819(_0x2e9a6a[_0xa544('0x12')][_0xa544('0x11')]);}})['catch'](function(_0x9093bd){logger[_0xa544('0xf')](_0xa544('0xc'),_0x543cd1,_0x9093bd);_0x39bcd7(_0x9093bd);});});}exports[_0xa544('0x13')]=function(_0x2c5ae8){var _0x297298=this;return new Promise(function(_0x1f3fcc,_0x44ccd3){return db[_0xa544('0x14')][_0xa544('0x15')](_0x2c5ae8['body'],{'raw':_0x2c5ae8['options']?_0x2c5ae8[_0xa544('0x16')][_0xa544('0x17')]===undefined?!![]:![]:!![]})[_0xa544('0x18')](function(_0x57a154){logger[_0xa544('0xb')](_0xa544('0x13'),_0x2c5ae8);logger['debug'](_0xa544('0x13'),_0x2c5ae8,JSON[_0xa544('0x19')](_0x57a154));_0x1f3fcc(_0x57a154);})[_0xa544('0x1a')](function(_0xb7df3d){logger[_0xa544('0xf')]('CreateAttachment',_0xb7df3d['message'],_0x2c5ae8);_0x44ccd3(_0x297298[_0xa544('0xf')](0x1f4,_0xb7df3d['message']));});});};
\ No newline at end of file
+var _0x8eeb=['../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','create','body','options','raw','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x770d52,_0x58cd79){var _0x36f0b1=function(_0x499e5d){while(--_0x499e5d){_0x770d52['push'](_0x770d52['shift']());}};_0x36f0b1(++_0x58cd79);}(_0x8eeb,0x183));var _0xb8ee=function(_0x12b1ca,_0x6262dd){_0x12b1ca=_0x12b1ca-0x0;var _0x261745=_0x8eeb[_0x12b1ca];return _0x261745;};'use strict';var _=require(_0xb8ee('0x0'));var util=require('util');var moment=require(_0xb8ee('0x1'));var BPromise=require(_0xb8ee('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb8ee('0x3'));var db=require(_0xb8ee('0x4'))['db'];var utils=require(_0xb8ee('0x5'));var logger=require(_0xb8ee('0x6'))(_0xb8ee('0x7'));var config=require('../../config/environment');var jayson=require(_0xb8ee('0x8'));var client=jayson['client'][_0xb8ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30dff7,_0x430b38,_0x469393){return new BPromise(function(_0x4e2428,_0x27243c){return client[_0xb8ee('0xa')](_0x30dff7,_0x469393)[_0xb8ee('0xb')](function(_0x5ea3ab){logger[_0xb8ee('0xc')]('Attachment,\x20%s,\x20%s',_0x430b38,_0xb8ee('0xd'));logger[_0xb8ee('0xe')](_0xb8ee('0xf'),_0x430b38,_0xb8ee('0xd'),JSON[_0xb8ee('0x10')](_0x5ea3ab));if(_0x5ea3ab[_0xb8ee('0x11')]){if(_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x12')]===0x1f4){logger['error'](_0xb8ee('0x13'),_0x430b38,_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);return _0x27243c(_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);}logger[_0xb8ee('0x11')]('Attachment,\x20%s,\x20%s',_0x430b38,_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);return _0x4e2428(_0x5ea3ab[_0xb8ee('0x11')][_0xb8ee('0x14')]);}else{logger[_0xb8ee('0xc')](_0xb8ee('0x13'),_0x430b38,_0xb8ee('0xd'));_0x4e2428(_0x5ea3ab[_0xb8ee('0x15')][_0xb8ee('0x14')]);}})['catch'](function(_0x135d5d){logger['error']('Attachment,\x20%s,\x20%s',_0x430b38,_0x135d5d);_0x27243c(_0x135d5d);});});}exports[_0xb8ee('0x16')]=function(_0x34dfb9){var _0x4d9a82=this;return new Promise(function(_0x3f0577,_0x369e3e){return db['Attachment'][_0xb8ee('0x17')](_0x34dfb9[_0xb8ee('0x18')],{'raw':_0x34dfb9[_0xb8ee('0x19')]?_0x34dfb9['options'][_0xb8ee('0x1a')]===undefined?!![]:![]:!![]})[_0xb8ee('0xb')](function(_0x39d8b2){logger[_0xb8ee('0xc')](_0xb8ee('0x16'),_0x34dfb9);logger['debug'](_0xb8ee('0x16'),_0x34dfb9,JSON['stringify'](_0x39d8b2));_0x3f0577(_0x39d8b2);})[_0xb8ee('0x1b')](function(_0x134ddb){logger[_0xb8ee('0x11')](_0xb8ee('0x16'),_0x134ddb[_0xb8ee('0x14')],_0x34dfb9);_0x369e3e(_0x4d9a82[_0xb8ee('0x11')](0x1f4,_0x134ddb[_0xb8ee('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 355d4e2..f5069ff 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 _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x532c66,_0x1a885c){_0x532c66=_0x532c66-0x0;var _0x25fb9f=_0xdb28[_0x532c66];return _0x25fb9f;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x414334,_0x23d761){var _0x47cf2b=function(_0x46051b){while(--_0x46051b){_0x414334['push'](_0x414334['shift']());}};_0x47cf2b(++_0x23d761);}(_0xadb5,0xad));var _0x5adb=function(_0x38ace2,_0x28ea21){_0x38ace2=_0x38ace2-0x0;var _0x12fe49=_0xadb5[_0x38ace2];return _0x12fe49;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 4c3e293..b30582d 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 _0xf442=['use','password','User','passport','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','adAuthenticate','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','adSsoEnabled','blockDuration','then','log','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','salt','role','disabled','blockedAt','admin','agent','user','name','domain','res','minutes','getLicense','status','send','message','ad-login','login','signToken','json'];(function(_0x1502ef,_0x1182a7){var _0x115c6f=function(_0x22d504){while(--_0x22d504){_0x1502ef['push'](_0x1502ef['shift']());}};_0x115c6f(++_0x1182a7);}(_0xf442,0x123));var _0x2f44=function(_0x1cd8d1,_0x52fa43){_0x1cd8d1=_0x1cd8d1-0x0;var _0x450f18=_0xf442[_0x1cd8d1];return _0x450f18;};'use strict';var passport=require(_0x2f44('0x0'));var LocalStrategy=require('passport-local')[_0x2f44('0x1')];var moment=require(_0x2f44('0x2'));var ActiveDirectory=require(_0x2f44('0x3'));var BPromise=require(_0x2f44('0x4'));var db=require(_0x2f44('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x2f44('0x6'));var config=require(_0x2f44('0x7'));var logger=require(_0x2f44('0x8'))(_0x2f44('0x9'));function isActiveDirectoryConfigured(_0x173abc){var _0x3c57cf=![];if(typeof _0x173abc[_0x2f44('0xa')]!==_0x2f44('0xb')){_0x3c57cf=_0x173abc[_0x2f44('0xa')][_0x2f44('0xc')]&&_0x173abc[_0x2f44('0xa')][_0x2f44('0xd')]&&_0x173abc[_0x2f44('0xa')]['domain'];}return _0x3c57cf;}function adAuthenticate(_0x494763,_0x502d51,_0x59fd00){return new BPromise(function(_0x2482a4,_0x4a2185){try{var _0x2feffb=new ActiveDirectory(_0x494763);_0x2feffb[_0x2f44('0xe')](_0x502d51,_0x59fd00,function(_0x4f59d3,_0x5ccd39){console['log'](_0x2f44('0xf'),_0x4f59d3,_0x5ccd39);if(_0x4f59d3){_0x4a2185(_0x4f59d3);}else if(!_0x5ccd39){_0x4a2185('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2482a4(_0x5ccd39);}});}catch(_0xb6605d){_0x4a2185(_0xb6605d);}});}function ActiveDirectoryAuthenticate(_0x1eadca,_0x18f7c2,_0x363684,_0x11e0e8){var _0x854eda,_0x424435;if(!isActiveDirectoryConfigured(config)){logger[_0x2f44('0x10')](_0x2f44('0x11'),_0x18f7c2);return _0x11e0e8(null,![],{'message':_0x2f44('0x12')});}return db[_0x2f44('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x2f44('0x14'),_0x2f44('0x15')],'raw':!![]})[_0x2f44('0x16')](function(_0x3a1b3a){console[_0x2f44('0x17')]('settings',_0x3a1b3a);_0x854eda=_0x3a1b3a;if(!_0x854eda['adSsoEnabled']){logger['error'](_0x2f44('0x18'),_0x18f7c2);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x1eadca[_0x2f44('0x19')]({'logging':!![],'attributes':['id','name','password',_0x2f44('0x1a'),_0x2f44('0x1b'),_0x2f44('0x1c'),'blocked',_0x2f44('0x1d')],'where':{'name':_0x18f7c2,'role':{'$or':[_0x2f44('0x1e'),'user',_0x2f44('0x1f')]},'adSsoEnabled':!![]}});})[_0x2f44('0x16')](function(_0x5ba04f){console[_0x2f44('0x17')](_0x2f44('0x20'),_0x5ba04f);if(!_0x5ba04f||_0x5ba04f&&_0x5ba04f[_0x2f44('0x21')]!==_0x18f7c2){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x424435=_0x5ba04f;var _0x243a1b=_0x424435[_0x2f44('0x21')]+'@'+config['activedirectory'][_0x2f44('0x22')];return adAuthenticate(config[_0x2f44('0xa')],_0x243a1b,_0x363684);})[_0x2f44('0x16')](function(_0x2829fe){console[_0x2f44('0x17')](_0x2f44('0x23'),_0x2829fe);if(_0x424435[_0x2f44('0x1c')]){throw new Error(_0x2f44('0x12'));}if(_0x854eda['blockDuration']>0x0){if(_0x424435['blocked']){if(moment(_0x424435[_0x2f44('0x1d')])['add'](_0x854eda[_0x2f44('0x15')],_0x2f44('0x24'))>moment()){throw new Error(_0x2f44('0x12'));}return utils['clearBlockUser'](_0x424435,0x0,![],null)['then'](function(){return utils['getLicense'](_0x424435);})[_0x2f44('0x16')](function(){return _0x11e0e8(null,_0x424435);});}else{return utils[_0x2f44('0x25')](_0x424435)[_0x2f44('0x16')](function(){return _0x11e0e8(null,_0x424435);});}}else{return utils['getLicense'](_0x424435)['then'](function(){return _0x11e0e8(null,_0x424435);});}})['catch'](function(_0x4481bc){return _0x11e0e8(null,![],_0x4481bc);});}function handleError(_0xfc679e,_0x2df2d3,_0x30386c){return _0xfc679e[_0x2f44('0x26')](_0x2df2d3||0x1f4)[_0x2f44('0x27')]({'message':_0x30386c?_0x30386c[_0x2f44('0x28')]||_0x30386c:''});}exports['login']=function(_0x1f1e04,_0x1a6475,_0x10c0b0){passport['authenticate'](_0x2f44('0x29'),function(_0x5dca5d,_0xbeef9e,_0x2a0941){console[_0x2f44('0x17')](_0x2f44('0x2a'),_0x5dca5d,_0xbeef9e,_0x2a0941);var _0x162a6b=_0x5dca5d||_0x2a0941;if(_0x162a6b){return handleError(_0x1a6475,0x191,_0x162a6b);}if(!_0xbeef9e){return handleError(_0x1a6475,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3f7cfa={'payload':{'id':_0xbeef9e['id'],'role':_0xbeef9e[_0x2f44('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x2f44('0x2b')](_0x3f7cfa)[_0x2f44('0x16')](function(_0x1414a6){_0x1a6475[_0x2f44('0x2c')]({'id':_0xbeef9e['id'],'token':_0x1414a6,'statusCall':'','isAlreadyLogged':_0xbeef9e['online']});});}})(_0x1f1e04,_0x1a6475,_0x10c0b0);};passport[_0x2f44('0x2d')](_0x2f44('0x29'),new LocalStrategy({'usernameField':_0x2f44('0x21'),'passwordField':_0x2f44('0x2e')},function(_0x5aa025,_0x19eef0,_0x2b5810){return ActiveDirectoryAuthenticate(db[_0x2f44('0x2f')],_0x5aa025,_0x19eef0,_0x2b5810);}));
\ No newline at end of file
+var _0xa9e0=['salt','role','disabled','blocked','admin','user','then','minutes','clearBlockUser','getLicense','catch','status','message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','use','User','passport','passport-local','Strategy','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','baseDN','domain','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','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var passport=require(_0x0a9e('0x0'));var LocalStrategy=require(_0x0a9e('0x1'))[_0x0a9e('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0a9e('0x3'));var util=require('util');var db=require(_0x0a9e('0x4'))['db'];var authService=require(_0x0a9e('0x5'));var utils=require(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var logger=require(_0x0a9e('0x8'))('api');function isActiveDirectoryConfigured(_0x219af0){var _0x441e3a=![];if(typeof _0x219af0[_0x0a9e('0x9')]!=='undefined'){_0x441e3a=_0x219af0['activedirectory'][_0x0a9e('0xa')]&&_0x219af0['activedirectory']['url']&&_0x219af0[_0x0a9e('0x9')][_0x0a9e('0xb')];}return _0x441e3a;}function adAuthenticate(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){try{var _0x50dfb2=new ActiveDirectory(_0x307b3e);_0x50dfb2['authenticate'](_0x3ab53f,_0xfeb75b,function(_0x4cfe67,_0x273d4d){if(_0x4cfe67){logger[_0x0a9e('0xc')](_0x0a9e('0xd'),_0x3ab53f,util[_0x0a9e('0xe')](_0x4cfe67,{'showHidden':![],'depth':null}));_0x4a4c56(_0x0a9e('0xf'));}else if(!_0x273d4d){logger[_0x0a9e('0xc')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x3ab53f);_0x4a4c56(_0x0a9e('0xf'));}else{_0xbd1168(_0x273d4d);}});}catch(_0x239b12){_0x4a4c56(_0x239b12);}});}function ActiveDirectoryAuthenticate(_0x2b4227,_0x281129,_0x44dcfd,_0x4d5611){var _0x52a03d,_0x22dccb;if(!isActiveDirectoryConfigured(config)){logger['error'](_0x0a9e('0x10'),_0x281129);return _0x4d5611(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0a9e('0x11')][_0x0a9e('0x12')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0a9e('0x13')],'raw':!![]})['then'](function(_0x459eb1){_0x52a03d=_0x459eb1;if(!_0x52a03d[_0x0a9e('0x14')]){logger[_0x0a9e('0xc')](_0x0a9e('0x15'),_0x281129);throw new Error(_0x0a9e('0xf'));}return _0x2b4227[_0x0a9e('0x12')]({'logging':!![],'attributes':['id',_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),'blockedAt'],'where':{'name':_0x281129,'role':{'$or':[_0x0a9e('0x1c'),_0x0a9e('0x1d'),'agent']},'adSsoEnabled':!![]}});})[_0x0a9e('0x1e')](function(_0x5a09ef){if(!_0x5a09ef||_0x5a09ef&&_0x5a09ef['name']!==_0x281129){throw new Error(_0x0a9e('0xf'));}_0x22dccb=_0x5a09ef;var _0x432e56=_0x22dccb[_0x0a9e('0x16')]+'@'+config[_0x0a9e('0x9')]['domain'];return adAuthenticate(config[_0x0a9e('0x9')],_0x432e56,_0x44dcfd);})[_0x0a9e('0x1e')](function(_0x3b45bc){if(_0x22dccb[_0x0a9e('0x1a')]){throw new Error(_0x0a9e('0xf'));}if(_0x52a03d[_0x0a9e('0x13')]>0x0){if(_0x22dccb[_0x0a9e('0x1b')]){if(moment(_0x22dccb['blockedAt'])['add'](_0x52a03d[_0x0a9e('0x13')],_0x0a9e('0x1f'))>moment()){throw new Error(_0x0a9e('0xf'));}return utils[_0x0a9e('0x20')](_0x22dccb,0x0,![],null)['then'](function(){return utils[_0x0a9e('0x21')](_0x22dccb);})['then'](function(){return _0x4d5611(null,_0x22dccb);});}else{return utils[_0x0a9e('0x21')](_0x22dccb)['then'](function(){return _0x4d5611(null,_0x22dccb);});}}else{return utils[_0x0a9e('0x21')](_0x22dccb)[_0x0a9e('0x1e')](function(){return _0x4d5611(null,_0x22dccb);});}})[_0x0a9e('0x22')](function(_0x14433c){return _0x4d5611(null,![],_0x14433c);});}function handleError(_0x140511,_0x1538a4,_0x11c3b6){return _0x140511[_0x0a9e('0x23')](_0x1538a4||0x1f4)['send']({'message':_0x11c3b6?_0x11c3b6[_0x0a9e('0x24')]||_0x11c3b6:''});}exports[_0x0a9e('0x25')]=function(_0x2b1f27,_0x2ec755,_0x5c877d){passport[_0x0a9e('0x26')](_0x0a9e('0x27'),function(_0x1843b2,_0x824a4f,_0x58b06f){var _0x563b45=_0x1843b2||_0x58b06f;if(_0x563b45){return handleError(_0x2ec755,0x191,_0x563b45);}if(!_0x824a4f){return handleError(_0x2ec755,0x194,{'message':_0x0a9e('0x28')});}else{var _0x2e8759={'payload':{'id':_0x824a4f['id'],'role':_0x824a4f[_0x0a9e('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2e8759)[_0x0a9e('0x1e')](function(_0x5d1e0e){_0x2ec755[_0x0a9e('0x29')]({'id':_0x824a4f['id'],'token':_0x5d1e0e,'statusCall':'','isAlreadyLogged':_0x824a4f[_0x0a9e('0x2a')]});});}})(_0x2b1f27,_0x2ec755,_0x5c877d);};passport[_0x0a9e('0x2b')](_0x0a9e('0x27'),new LocalStrategy({'usernameField':_0x0a9e('0x16'),'passwordField':'password'},function(_0x66c1d2,_0x46f0a5,_0x40cb85){return ActiveDirectoryAuthenticate(db[_0x0a9e('0x2c')],_0x66c1d2,_0x46f0a5,_0x40cb85);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index e675764..2d2c3a0 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 _0xc73f=['Router','./authActiveDirectory.controller','exports'];(function(_0x49508f,_0x172399){var _0x1787ef=function(_0x1a9f45){while(--_0x1a9f45){_0x49508f['push'](_0x49508f['shift']());}};_0x1787ef(++_0x172399);}(_0xc73f,0x84));var _0xfc73=function(_0x32f262,_0x35e978){_0x32f262=_0x32f262-0x0;var _0x2f2e16=_0xc73f[_0x32f262];return _0x2f2e16;};'use strict';var express=require('express');var router=express[_0xfc73('0x0')]();var controller=require(_0xfc73('0x1'));router['post']('/',controller['login']);module[_0xfc73('0x2')]=router;
\ No newline at end of file
+var _0xb2c0=['Router','./authActiveDirectory.controller','exports','express'];(function(_0x44b3bd,_0x44c97d){var _0x1efc4a=function(_0x5d0205){while(--_0x5d0205){_0x44b3bd['push'](_0x44b3bd['shift']());}};_0x1efc4a(++_0x44c97d);}(_0xb2c0,0xff));var _0x0b2c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xb2c0[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0x0b2c('0x0'));var router=express[_0x0b2c('0x1')]();var controller=require(_0x0b2c('0x2'));router['post']('/',controller['login']);module[_0x0b2c('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 7a964b2..d95d167 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a54,0x106));var _0x47a5=function(_0x87f427,_0x11699d){_0x87f427=_0x87f427-0x0;var _0x135498=_0x7a54[_0x87f427];return _0x135498;};'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 _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(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x7a54,0x106));var _0x47a5=function(_0x1ee28d,_0x44577f){_0x1ee28d=_0x1ee28d-0x0;var _0x51be0e=_0x7a54[_0x1ee28d];return _0x51be0e;};'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
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index a52c40c..e615484 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 _0x4d85=['callback','isMiddleware','login','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d85,0x99));var _0x54d8=function(_0x4b912,_0x183b72){_0x4b912=_0x4b912-0x0;var _0x59d609=_0x4d85[_0x4b912];return _0x59d609;};'use strict';var express=require(_0x54d8('0x0'));var passport=require('passport');var router=express[_0x54d8('0x1')]();var controller=require(_0x54d8('0x2'));var userController=require(_0x54d8('0x3'));var authService=require(_0x54d8('0x4'));router['get']('/',controller['login']);router[_0x54d8('0x5')](_0x54d8('0x6'),controller[_0x54d8('0x7')],authService[_0x54d8('0x8')],userController[_0x54d8('0x9')],authService['setTokenCookie']);module['exports']=router;
\ No newline at end of file
+var _0x8c79=['express','../user/user.controller.js','get','login','/callback','setTokenCookie'];(function(_0x104857,_0x34844c){var _0x5c7d6d=function(_0x1aa95f){while(--_0x1aa95f){_0x104857['push'](_0x104857['shift']());}};_0x5c7d6d(++_0x34844c);}(_0x8c79,0xa8));var _0x98c7=function(_0x47c902,_0x220fd2){_0x47c902=_0x47c902-0x0;var _0x1ad6a0=_0x8c79[_0x47c902];return _0x1ad6a0;};'use strict';var express=require(_0x98c7('0x0'));var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x98c7('0x1'));var authService=require('../../components/auth/service');router[_0x98c7('0x2')]('/',controller[_0x98c7('0x3')]);router['get'](_0x98c7('0x4'),controller['callback'],authService['isMiddleware'],userController['login'],authService[_0x98c7('0x5')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index fe380b7..9b44277 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 _0xcd2c=['util','passport','passport-local','Strategy','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','blocked','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','user','merge','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','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','/reset/','Reset\x20Email\x20sent!','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcd2c,0x195));var _0xccd2=function(_0x5c61e4,_0x20a992){_0x5c61e4=_0x5c61e4-0x0;var _0x5224dc=_0xcd2c[_0x5c61e4];return _0x5224dc;};'use strict';var util=require(_0xccd2('0x0'));var passport=require(_0xccd2('0x1'));var LocalStrategy=require(_0xccd2('0x2'))[_0xccd2('0x3')];var jayson=require('jayson/promise');var _=require(_0xccd2('0x4'));var rs=require('randomstring');var moment=require(_0xccd2('0x5'));var db=require(_0xccd2('0x6'))['db'];var authService=require(_0xccd2('0x7'));var utils=require(_0xccd2('0x8'));var client=jayson[_0xccd2('0x9')][_0xccd2('0xa')]({'port':0x232b});function localAuthenticate(_0x40999d,_0x1a1fec,_0x44c4e7,_0x2fbd19){var _0x4b2ac2,_0x2b5982;return db[_0xccd2('0xb')][_0xccd2('0xc')]({'where':{'id':0x1},'attributes':[_0xccd2('0xd'),_0xccd2('0xe')],'raw':!![]})[_0xccd2('0xf')](function(_0x28ba04){_0x4b2ac2=_0x28ba04;return _0x40999d[_0xccd2('0xc')]({'attributes':['id',_0xccd2('0x10'),_0xccd2('0x11'),'salt',_0xccd2('0x12'),_0xccd2('0x13'),'blocked',_0xccd2('0x14'),_0xccd2('0x15')],'where':{'name':_0x1a1fec,'role':{'$or':[_0xccd2('0x16'),'user','agent']}}});})['then'](function(_0x365d3d){if(!_0x365d3d||_0x365d3d&&_0x365d3d['name']!==_0x1a1fec){throw new Error(_0xccd2('0x17'));}else{_0x2b5982=_0x365d3d;return _0x2b5982;}})[_0xccd2('0xf')](function(){_0x2b5982[_0xccd2('0x18')](_0x44c4e7,function(_0x2e7564,_0x51c5dd){var _0x1bbd95=_0x2b5982[_0xccd2('0x15')]+0x1;if(_0x2e7564){return _0x2fbd19(_0x2e7564);}else if(!_0x51c5dd){if(_0x2b5982[_0xccd2('0x13')]){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}else if(_0x4b2ac2['allowedLoginAttempts']>0x0){if(_0x2b5982['blocked']){if(_0x4b2ac2[_0xccd2('0xe')]>0x0){if(moment(_0x2b5982[_0xccd2('0x14')])[_0xccd2('0x19')](_0x4b2ac2[_0xccd2('0xe')],_0xccd2('0x1a'))>moment()){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}else{return utils[_0xccd2('0x1b')](_0x2b5982,_0x1bbd95,![],null)[_0xccd2('0xf')](function(){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});});}}else{return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}}else{if(_0x1bbd95>=_0x4b2ac2['allowedLoginAttempts']){return utils[_0xccd2('0x1b')](_0x2b5982,0x0,!![],moment())[_0xccd2('0xf')](function(){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});});}else{return utils[_0xccd2('0x1b')](_0x2b5982,_0x1bbd95,![],null)[_0xccd2('0xf')](function(){return _0x2fbd19(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}}else{if(_0x2b5982[_0xccd2('0x13')]){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}else if(_0x4b2ac2[_0xccd2('0xd')]>0x0){if(_0x2b5982[_0xccd2('0x1c')]){if(_0x4b2ac2[_0xccd2('0xe')]>0x0){if(moment(_0x2b5982[_0xccd2('0x14')])['add'](_0x4b2ac2['blockDuration'],'minutes')>moment()){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}else{return utils[_0xccd2('0x1b')](_0x2b5982,0x0,![],null)[_0xccd2('0xf')](function(){return utils['getLicense'](_0x2b5982);})[_0xccd2('0xf')](function(){return _0x2fbd19(null,_0x2b5982);});}}else{return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}}else{return utils[_0xccd2('0x1b')](_0x2b5982,0x0,![],null)['then'](function(){return utils[_0xccd2('0x1d')](_0x2b5982);})[_0xccd2('0xf')](function(){return _0x2fbd19(null,_0x2b5982);})[_0xccd2('0x1e')](function(_0x3b2d26){return _0x2fbd19(null,![],_0x3b2d26);});}}else{if(_0x2b5982[_0xccd2('0x1c')]){return _0x2fbd19(null,![],{'message':_0xccd2('0x17')});}else{return utils[_0xccd2('0x1d')](_0x2b5982)[_0xccd2('0xf')](function(){return _0x2fbd19(null,_0x2b5982);});}}}});})['catch'](function(_0x3037e1){return _0x2fbd19(null,![],_0x3037e1);});}function sendServiceMail(_0x5ab231){return db[_0xccd2('0x1f')][_0xccd2('0x20')]({'where':{'service':!![]},'attributes':['id',_0xccd2('0x10'),_0xccd2('0x21')],'include':[{'model':db['MailServerOut'],'as':_0xccd2('0x22')}]})[_0xccd2('0xf')](function(_0x4d5cf2){if(!_0x4d5cf2){throw new Error(_0xccd2('0x23'));}var _0x15a3dd={'tls':{'rejectUnauthorized':![]}};if(_0x4d5cf2['Smtp'][_0xccd2('0x24')]){_0x15a3dd[_0xccd2('0x24')]=_0x4d5cf2['Smtp'][_0xccd2('0x24')];}else{_0x15a3dd[_0xccd2('0x25')]=_0x4d5cf2[_0xccd2('0x22')]['host'];_0x15a3dd['port']=_0x4d5cf2['Smtp'][_0xccd2('0x26')];_0x15a3dd[_0xccd2('0x27')]=_0x4d5cf2[_0xccd2('0x22')][_0xccd2('0x27')];}if(_0x4d5cf2[_0xccd2('0x22')][_0xccd2('0x28')]){_0x15a3dd[_0xccd2('0x29')]={'user':_0x4d5cf2['Smtp'][_0xccd2('0x2a')],'pass':_0x4d5cf2['Smtp']['pass']};}var _0x20cab7={'account':_0x15a3dd,'message':_[_0xccd2('0x2b')]({'from':util[_0xccd2('0x2c')]('\x22%s\x22\x20<%s>',_0x4d5cf2[_0xccd2('0x10')],_0x4d5cf2[_0xccd2('0x21')]||_0x4d5cf2[_0xccd2('0x22')]['user'])},_0x5ab231)};return client[_0xccd2('0x2d')]('SendMail',_0x20cab7);})[_0xccd2('0xf')](function(_0x3e125c){if(_0x3e125c[_0xccd2('0x2e')]){throw new Error(util[_0xccd2('0x2c')](_0xccd2('0x2f'),_0x3e125c[_0xccd2('0x2e')][_0xccd2('0x30')]||JSON[_0xccd2('0x31')](_0x3e125c[_0xccd2('0x2e')])));}return!![];});}function handleError(_0x9393a,_0x522622,_0x4e686a){return _0x9393a[_0xccd2('0x32')](_0x522622||0x1f4)[_0xccd2('0x33')]({'message':_0x4e686a?_0x4e686a[_0xccd2('0x30')]||_0x4e686a:''});}exports['login']=function(_0x3be377,_0x27ad43,_0x296968){passport[_0xccd2('0x18')](_0xccd2('0x34'),function(_0x963167,_0x283d53,_0xf10b1f){var _0x4e9055=_0x963167||_0xf10b1f;if(_0x4e9055){return handleError(_0x27ad43,0x191,_0x4e9055);}if(!_0x283d53){return handleError(_0x27ad43,0x194,{'message':_0xccd2('0x35')});}else{var _0x349478={'payload':{'id':_0x283d53['id'],'role':_0x283d53[_0xccd2('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x349478)[_0xccd2('0xf')](function(_0x802e0d){_0x27ad43[_0xccd2('0x36')]({'id':_0x283d53['id'],'token':_0x802e0d,'statusCall':'','isAlreadyLogged':_0x283d53[_0xccd2('0x37')]});});}})(_0x3be377,_0x27ad43,_0x296968);};exports[_0xccd2('0x38')]=function(_0x3a5dab,_0x56a8fa,_0x48decb){if(!_0x3a5dab['body'][_0xccd2('0x21')]){return handleError(_0x56a8fa,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x34fa5a=rs['generate']();_0x3a5dab[_0xccd2('0x39')]['email']=_0x3a5dab[_0xccd2('0x39')][_0xccd2('0x21')][_0xccd2('0x3a')]()[_0xccd2('0x3b')]();var _0x53edbe;return db[_0xccd2('0xb')][_0xccd2('0xc')]({'where':{'id':0x1},'attributes':[_0xccd2('0xd'),_0xccd2('0xe')],'raw':!![]})[_0xccd2('0xf')](function(_0x35b6c2){_0x53edbe=_0x35b6c2;return db[_0xccd2('0x3c')][_0xccd2('0x20')]({'where':{'email':_0x3a5dab[_0xccd2('0x39')][_0xccd2('0x21')]}});})[_0xccd2('0xf')](function(_0x19d38a){if(!_0x19d38a){throw new Error(_0xccd2('0x3d'));}if(_0x19d38a[_0xccd2('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x19d38a[_0xccd2('0x1c')]){if(moment(_0x19d38a[_0xccd2('0x14')])[_0xccd2('0x19')](_0x53edbe[_0xccd2('0xe')],'minutes')>moment()){throw new Error(_0xccd2('0x3e'));}else{_0x19d38a[_0xccd2('0x1c')]=![];_0x19d38a[_0xccd2('0x14')]=null;}}_0x19d38a[_0xccd2('0x3f')]=_0x34fa5a;_0x19d38a[_0xccd2('0x40')]=Date[_0xccd2('0x41')]()+0x36ee80;return _0x19d38a[_0xccd2('0x42')]();})[_0xccd2('0xf')](function(){return sendServiceMail({'to':_0x3a5dab[_0xccd2('0x39')][_0xccd2('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xccd2('0x43')+_0xccd2('0x44')+_0xccd2('0x45')+_0x3a5dab[_0xccd2('0x46')][_0xccd2('0x25')]+_0xccd2('0x47')+_0x34fa5a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xccd2('0xf')](function(){_0x56a8fa[_0xccd2('0x32')](0xc8)['send']({'message':_0xccd2('0x48')});})[_0xccd2('0x1e')](function(_0x2be123){return handleError(_0x56a8fa,0x1f4,_0x2be123);});};exports['reset']=function(_0x113e04,_0x2e521b,_0x39f042){return db['User'][_0xccd2('0x20')]({'where':{'resetPasswordToken':_0x113e04['params'][_0xccd2('0x49')],'resetPasswordExpires':{'$gt':Date[_0xccd2('0x41')]()}}})[_0xccd2('0xf')](function(_0x3b2598){if(!_0x3b2598){throw new Error(_0xccd2('0x4a'));}return db['Setting'][_0xccd2('0xc')]({'attributes':['id',_0xccd2('0x4b'),_0xccd2('0x4c'),_0xccd2('0x4d')]})[_0xccd2('0xf')](function(_0x19114b){if(_0x19114b[_0xccd2('0x4b')])authService[_0xccd2('0x4e')](_0x113e04[_0xccd2('0x39')][_0xccd2('0x11')]);if(!_0x19114b[_0xccd2('0x4c')]||!_0x3b2598['previousPasswords'])return _0x3b2598;authService[_0xccd2('0x4f')](_0x113e04[_0xccd2('0x39')][_0xccd2('0x11')],_0x3b2598[_0xccd2('0x50')],_0x19114b['passwordHistoryLimit']);return _0x3b2598;})[_0xccd2('0xf')](function(){_0x3b2598[_0xccd2('0x11')]=_0x113e04['body']['password'];_0x3b2598[_0xccd2('0x3f')]=null;_0x3b2598[_0xccd2('0x40')]=null;return _0x3b2598[_0xccd2('0x42')]();});})[_0xccd2('0xf')](function(){_0x2e521b['status'](0xc8)['send']({'message':'Password\x20reset!'});})['catch'](function(_0x253fc6){return handleError(_0x2e521b,0x1f4,_0x253fc6);});};passport['use'](_0xccd2('0x34'),new LocalStrategy({'usernameField':'name','passwordField':_0xccd2('0x11')},function(_0xc92f16,_0x3a2e83,_0x25813c){return localAuthenticate(db[_0xccd2('0x3c')],_0xc92f16,_0x3a2e83,_0x25813c);}));
\ No newline at end of file
+var _0xf95a=['\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','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','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','resetPasswordToken','Password\x20reset!','use','passport','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','merge','format'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0xf95a,0xd6));var _0xaf95=function(_0x8584dd,_0x502183){_0x8584dd=_0x8584dd-0x0;var _0x5cc927=_0xf95a[_0x8584dd];return _0x5cc927;};'use strict';var util=require('util');var passport=require(_0xaf95('0x0'));var LocalStrategy=require('passport-local')[_0xaf95('0x1')];var jayson=require(_0xaf95('0x2'));var _=require('lodash');var rs=require(_0xaf95('0x3'));var moment=require(_0xaf95('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xaf95('0x5'));var utils=require(_0xaf95('0x6'));var client=jayson[_0xaf95('0x7')][_0xaf95('0x8')]({'port':0x232b});function localAuthenticate(_0x159c4c,_0x2e9df2,_0x16f322,_0x3029ee){var _0x546824,_0x5d7ece;return db[_0xaf95('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0xaf95('0xa'),_0xaf95('0xb')],'raw':!![]})[_0xaf95('0xc')](function(_0x101f5b){_0x546824=_0x101f5b;return _0x159c4c['findOne']({'attributes':['id',_0xaf95('0xd'),_0xaf95('0xe'),_0xaf95('0xf'),_0xaf95('0x10'),'disabled',_0xaf95('0x11'),_0xaf95('0x12'),_0xaf95('0x13')],'where':{'name':_0x2e9df2,'role':{'$or':[_0xaf95('0x14'),_0xaf95('0x15'),_0xaf95('0x16')]}}});})['then'](function(_0x51dcfd){if(!_0x51dcfd||_0x51dcfd&&_0x51dcfd[_0xaf95('0xd')]!==_0x2e9df2){throw new Error(_0xaf95('0x17'));}else{_0x5d7ece=_0x51dcfd;return _0x5d7ece;}})[_0xaf95('0xc')](function(){_0x5d7ece[_0xaf95('0x18')](_0x16f322,function(_0x2320c5,_0x47010b){var _0x29c81d=_0x5d7ece[_0xaf95('0x13')]+0x1;if(_0x2320c5){return _0x3029ee(_0x2320c5);}else if(!_0x47010b){if(_0x5d7ece[_0xaf95('0x19')]){return _0x3029ee(null,![],{'message':_0xaf95('0x17')});}else if(_0x546824['allowedLoginAttempts']>0x0){if(_0x5d7ece[_0xaf95('0x11')]){if(_0x546824['blockDuration']>0x0){if(moment(_0x5d7ece[_0xaf95('0x12')])[_0xaf95('0x1a')](_0x546824[_0xaf95('0xb')],_0xaf95('0x1b'))>moment()){return _0x3029ee(null,![],{'message':_0xaf95('0x17')});}else{return utils[_0xaf95('0x1c')](_0x5d7ece,_0x29c81d,![],null)[_0xaf95('0xc')](function(){return _0x3029ee(null,![],{'message':_0xaf95('0x17')});});}}else{return _0x3029ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x29c81d>=_0x546824['allowedLoginAttempts']){return utils['clearBlockUser'](_0x5d7ece,0x0,!![],moment())[_0xaf95('0xc')](function(){return _0x3029ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xaf95('0x1c')](_0x5d7ece,_0x29c81d,![],null)[_0xaf95('0xc')](function(){return _0x3029ee(null,![],{'message':_0xaf95('0x17')});});}}}else{return _0x3029ee(null,![],{'message':_0xaf95('0x17')});}}else{if(_0x5d7ece[_0xaf95('0x19')]){return _0x3029ee(null,![],{'message':_0xaf95('0x17')});}else if(_0x546824[_0xaf95('0xa')]>0x0){if(_0x5d7ece[_0xaf95('0x11')]){if(_0x546824[_0xaf95('0xb')]>0x0){if(moment(_0x5d7ece[_0xaf95('0x12')])[_0xaf95('0x1a')](_0x546824[_0xaf95('0xb')],_0xaf95('0x1b'))>moment()){return _0x3029ee(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xaf95('0x1c')](_0x5d7ece,0x0,![],null)['then'](function(){return utils[_0xaf95('0x1d')](_0x5d7ece);})['then'](function(){return _0x3029ee(null,_0x5d7ece);});}}else{return _0x3029ee(null,![],{'message':_0xaf95('0x17')});}}else{return utils[_0xaf95('0x1c')](_0x5d7ece,0x0,![],null)[_0xaf95('0xc')](function(){return utils[_0xaf95('0x1d')](_0x5d7ece);})[_0xaf95('0xc')](function(){return _0x3029ee(null,_0x5d7ece);})['catch'](function(_0x156af0){return _0x3029ee(null,![],_0x156af0);});}}else{if(_0x5d7ece[_0xaf95('0x11')]){return _0x3029ee(null,![],{'message':_0xaf95('0x17')});}else{return utils[_0xaf95('0x1d')](_0x5d7ece)[_0xaf95('0xc')](function(){return _0x3029ee(null,_0x5d7ece);});}}}});})[_0xaf95('0x1e')](function(_0x2323be){return _0x3029ee(null,![],_0x2323be);});}function sendServiceMail(_0x1f417e){return db[_0xaf95('0x1f')][_0xaf95('0x20')]({'where':{'service':!![]},'attributes':['id',_0xaf95('0xd'),_0xaf95('0x21')],'include':[{'model':db[_0xaf95('0x22')],'as':_0xaf95('0x23')}]})['then'](function(_0x19555d){if(!_0x19555d){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5a6e44={'tls':{'rejectUnauthorized':![]}};if(_0x19555d[_0xaf95('0x23')]['service']){_0x5a6e44[_0xaf95('0x24')]=_0x19555d['Smtp']['service'];}else{_0x5a6e44[_0xaf95('0x25')]=_0x19555d[_0xaf95('0x23')][_0xaf95('0x25')];_0x5a6e44[_0xaf95('0x26')]=_0x19555d[_0xaf95('0x23')][_0xaf95('0x26')];_0x5a6e44[_0xaf95('0x27')]=_0x19555d[_0xaf95('0x23')][_0xaf95('0x27')];}if(_0x19555d['Smtp'][_0xaf95('0x28')]){_0x5a6e44[_0xaf95('0x29')]={'user':_0x19555d[_0xaf95('0x23')][_0xaf95('0x15')],'pass':_0x19555d['Smtp']['pass']};}var _0x2c24a6={'account':_0x5a6e44,'message':_[_0xaf95('0x2a')]({'from':util[_0xaf95('0x2b')](_0xaf95('0x2c'),_0x19555d[_0xaf95('0xd')],_0x19555d['email']||_0x19555d['Smtp'][_0xaf95('0x15')])},_0x1f417e)};return client[_0xaf95('0x2d')](_0xaf95('0x2e'),_0x2c24a6);})[_0xaf95('0xc')](function(_0x302150){if(_0x302150['error']){throw new Error(util[_0xaf95('0x2b')](_0xaf95('0x2f'),_0x302150[_0xaf95('0x30')][_0xaf95('0x31')]||JSON[_0xaf95('0x32')](_0x302150[_0xaf95('0x30')])));}return!![];});}function handleError(_0x450288,_0x5134a6,_0x5d8149){return _0x450288[_0xaf95('0x33')](_0x5134a6||0x1f4)[_0xaf95('0x34')]({'message':_0x5d8149?_0x5d8149[_0xaf95('0x31')]||_0x5d8149:''});}exports['login']=function(_0x426b26,_0x50bfe9,_0x4008f6){passport[_0xaf95('0x18')](_0xaf95('0x35'),function(_0x1b4a22,_0x49dd4a,_0x19b778){var _0x149a1a=_0x1b4a22||_0x19b778;if(_0x149a1a){return handleError(_0x50bfe9,0x191,_0x149a1a);}if(!_0x49dd4a){return handleError(_0x50bfe9,0x194,{'message':_0xaf95('0x36')});}else{var _0x21e1f4={'payload':{'id':_0x49dd4a['id'],'role':_0x49dd4a['role']},'options':{'expiresIn':0x15180}};return authService[_0xaf95('0x37')](_0x21e1f4)[_0xaf95('0xc')](function(_0x53a3b6){_0x50bfe9[_0xaf95('0x38')]({'id':_0x49dd4a['id'],'token':_0x53a3b6,'statusCall':'','isAlreadyLogged':_0x49dd4a[_0xaf95('0x39')]});});}})(_0x426b26,_0x50bfe9,_0x4008f6);};exports[_0xaf95('0x3a')]=function(_0x550d88,_0x43d301,_0x1387fc){if(!_0x550d88[_0xaf95('0x3b')][_0xaf95('0x21')]){return handleError(_0x43d301,0x1f4,{'message':_0xaf95('0x3c')});}var _0x3c9bf4=rs[_0xaf95('0x3d')]();_0x550d88[_0xaf95('0x3b')]['email']=_0x550d88['body'][_0xaf95('0x21')]['trim']()[_0xaf95('0x3e')]();var _0xdb9776;return db[_0xaf95('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xaf95('0xb')],'raw':!![]})[_0xaf95('0xc')](function(_0xbdc73){_0xdb9776=_0xbdc73;return db[_0xaf95('0x3f')][_0xaf95('0x20')]({'where':{'email':_0x550d88[_0xaf95('0x3b')][_0xaf95('0x21')]}});})[_0xaf95('0xc')](function(_0x11a64d){if(!_0x11a64d){throw new Error(_0xaf95('0x40'));}if(_0x11a64d[_0xaf95('0x19')]){throw new Error(_0xaf95('0x41'));}if(_0x11a64d['blocked']){if(moment(_0x11a64d[_0xaf95('0x12')])['add'](_0xdb9776['blockDuration'],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x11a64d[_0xaf95('0x11')]=![];_0x11a64d['blockedAt']=null;}}_0x11a64d['resetPasswordToken']=_0x3c9bf4;_0x11a64d[_0xaf95('0x42')]=Date[_0xaf95('0x43')]()+0x36ee80;return _0x11a64d[_0xaf95('0x44')]();})[_0xaf95('0xc')](function(){return sendServiceMail({'to':_0x550d88[_0xaf95('0x3b')]['email'],'subject':_0xaf95('0x45'),'text':_0xaf95('0x46')+_0xaf95('0x47')+_0xaf95('0x48')+_0x550d88['headers']['host']+_0xaf95('0x49')+_0x3c9bf4+'\x0a\x0a'+_0xaf95('0x4a')});})[_0xaf95('0xc')](function(){_0x43d301[_0xaf95('0x33')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0xaf95('0x1e')](function(_0x267f11){return handleError(_0x43d301,0x1f4,_0x267f11);});};exports[_0xaf95('0x4b')]=function(_0x4d3fd1,_0x88e0f0,_0x475a77){return db['User']['find']({'where':{'resetPasswordToken':_0x4d3fd1['params'][_0xaf95('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xaf95('0x43')]()}}})[_0xaf95('0xc')](function(_0x35148a){if(!_0x35148a){throw new Error(_0xaf95('0x4d'));}return db['Setting'][_0xaf95('0x4e')]({'attributes':['id',_0xaf95('0x4f'),_0xaf95('0x50'),_0xaf95('0x51')]})[_0xaf95('0xc')](function(_0x409ee3){if(_0x409ee3['securePassword'])authService['validatePasswordPattern'](_0x4d3fd1[_0xaf95('0x3b')]['password']);if(!_0x409ee3['enforcePasswordHistory']||!_0x35148a[_0xaf95('0x52')])return _0x35148a;authService['validatePasswordHistory'](_0x4d3fd1[_0xaf95('0x3b')][_0xaf95('0xe')],_0x35148a['previousPasswords'],_0x409ee3[_0xaf95('0x51')]);return _0x35148a;})[_0xaf95('0xc')](function(){_0x35148a['password']=_0x4d3fd1[_0xaf95('0x3b')][_0xaf95('0xe')];_0x35148a[_0xaf95('0x53')]=null;_0x35148a[_0xaf95('0x42')]=null;return _0x35148a['save']();});})[_0xaf95('0xc')](function(){_0x88e0f0['status'](0xc8)[_0xaf95('0x34')]({'message':_0xaf95('0x54')});})[_0xaf95('0x1e')](function(_0x4390a1){return handleError(_0x88e0f0,0x1f4,_0x4390a1);});};passport[_0xaf95('0x55')](_0xaf95('0x35'),new LocalStrategy({'usernameField':'name','passwordField':_0xaf95('0xe')},function(_0x51024a,_0x2c5e01,_0x2e861a){return localAuthenticate(db['User'],_0x51024a,_0x2c5e01,_0x2e861a);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index c8f4e4d..409eee8 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 _0x6af4=['./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x1791b7,_0x205e7a){var _0x49d71a=function(_0x1c36a8){while(--_0x1c36a8){_0x1791b7['push'](_0x1791b7['shift']());}};_0x49d71a(++_0x205e7a);}(_0x6af4,0xce));var _0x46af=function(_0x126b67,_0x331b2e){_0x126b67=_0x126b67-0x0;var _0x351931=_0x6af4[_0x126b67];return _0x351931;};'use strict';var express=require(_0x46af('0x0'));var router=express['Router']();var controller=require(_0x46af('0x1'));router[_0x46af('0x2')]('/',controller[_0x46af('0x3')]);router[_0x46af('0x2')](_0x46af('0x4'),controller[_0x46af('0x5')]);router[_0x46af('0x2')](_0x46af('0x6'),controller[_0x46af('0x7')]);module[_0x46af('0x8')]=router;
\ No newline at end of file
+var _0xf81f=['/forgot','/reset/:token','reset','express','Router','./authLocal.controller','post','login'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf81f,0x1db));var _0xff81=function(_0x4f11dc,_0x4e3a99){_0x4f11dc=_0x4f11dc-0x0;var _0x37b7e3=_0xf81f[_0x4f11dc];return _0x37b7e3;};'use strict';var express=require(_0xff81('0x0'));var router=express[_0xff81('0x1')]();var controller=require(_0xff81('0x2'));router[_0xff81('0x3')]('/',controller[_0xff81('0x4')]);router[_0xff81('0x3')](_0xff81('0x5'),controller['forgot']);router[_0xff81('0x3')](_0xff81('0x6'),controller[_0xff81('0x7')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 1753516..329b28d 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 _0x3698=['INTEGER','sequelize','STRING'];(function(_0x204ce5,_0x46fb75){var _0x4f5a44=function(_0x55e0ac){while(--_0x55e0ac){_0x204ce5['push'](_0x204ce5['shift']());}};_0x4f5a44(++_0x46fb75);}(_0x3698,0x181));var _0x8369=function(_0xeb5575,_0x486f40){_0xeb5575=_0xeb5575-0x0;var _0x2da5cd=_0x3698[_0xeb5575];return _0x2da5cd;};'use strict';var Sequelize=require(_0x8369('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x8369('0x1')]},'description':{'type':Sequelize[_0x8369('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x8369('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5f54=['STRING','INTEGER','sequelize','exports'];(function(_0x2d819b,_0x321af5){var _0x3799fd=function(_0x50090b){while(--_0x50090b){_0x2d819b['push'](_0x2d819b['shift']());}};_0x3799fd(++_0x321af5);}(_0x5f54,0x13e));var _0x45f5=function(_0x3bfad2,_0xe86c5b){_0x3bfad2=_0x3bfad2-0x0;var _0x1a688e=_0x5f54[_0x3bfad2];return _0x1a688e;};'use strict';var Sequelize=require(_0x45f5('0x0'));module[_0x45f5('0x1')]={'name':{'type':Sequelize[_0x45f5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x45f5('0x2')]},'description':{'type':Sequelize[_0x45f5('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x45f5('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 ef53243..47139d6 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 _0x7a89=['Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Automation','includeAll','include','show','params','find','catch','create','body','destroy','Condition','addConditions','ids','omit','getConditions','findOne','hasOwnProperty','addActions'];(function(_0x44474f,_0x431580){var _0x427d97=function(_0x53f7d4){while(--_0x53f7d4){_0x44474f['push'](_0x44474f['shift']());}};_0x427d97(++_0x431580);}(_0x7a89,0x104));var _0x97a8=function(_0x15ec78,_0x1e3a18){_0x15ec78=_0x15ec78-0x0;var _0x191f90=_0x7a89[_0x15ec78];return _0x191f90;};'use strict';var emlformat=require(_0x97a8('0x0'));var rimraf=require(_0x97a8('0x1'));var zipdir=require(_0x97a8('0x2'));var jsonpatch=require(_0x97a8('0x3'));var rp=require(_0x97a8('0x4'));var moment=require(_0x97a8('0x5'));var BPromise=require(_0x97a8('0x6'));var Mustache=require(_0x97a8('0x7'));var util=require(_0x97a8('0x8'));var path=require('path');var sox=require(_0x97a8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97a8('0xa'));var _=require('lodash');var squel=require(_0x97a8('0xb'));var crypto=require(_0x97a8('0xc'));var jsforce=require(_0x97a8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x97a8('0xe'));var querystring=require(_0x97a8('0xf'));var Papa=require(_0x97a8('0x10'));var Redis=require(_0x97a8('0x11'));var authService=require(_0x97a8('0x12'));var qs=require(_0x97a8('0x13'));var as=require(_0x97a8('0x14'));var hardwareService=require(_0x97a8('0x15'));var logger=require(_0x97a8('0x16'))(_0x97a8('0x17'));var utils=require(_0x97a8('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97a8('0x19'))['db'];function respondWithStatusCode(_0x457aef,_0x21bb48){_0x21bb48=_0x21bb48||0xcc;return function(_0x27b945){if(_0x27b945){return _0x457aef[_0x97a8('0x1a')](_0x21bb48);}return _0x457aef['status'](_0x21bb48)['end']();};}function respondWithResult(_0x135c19,_0x37d687){_0x37d687=_0x37d687||0xc8;return function(_0x286609){if(_0x286609){return _0x135c19[_0x97a8('0x1b')](_0x37d687)[_0x97a8('0x1c')](_0x286609);}};}function respondWithFilteredResult(_0x40c8a9,_0x43c061){return function(_0x14199d){if(_0x14199d){var _0x2ecdb8=typeof _0x43c061[_0x97a8('0x1d')]===_0x97a8('0x1e')&&typeof _0x43c061['limit']===_0x97a8('0x1e');var _0x8820bf=_0x14199d[_0x97a8('0x1f')];var _0x2e87a9=_0x2ecdb8?0x0:_0x43c061[_0x97a8('0x1d')];var _0x47127c=_0x2ecdb8?_0x14199d[_0x97a8('0x1f')]:_0x43c061[_0x97a8('0x1d')]+_0x43c061[_0x97a8('0x20')];var _0x55fe5e;if(_0x47127c>=_0x8820bf){_0x47127c=_0x8820bf;_0x55fe5e=0xc8;}else{_0x55fe5e=0xce;}_0x40c8a9[_0x97a8('0x1b')](_0x55fe5e);return _0x40c8a9['set'](_0x97a8('0x21'),_0x2e87a9+'-'+_0x47127c+'/'+_0x8820bf)[_0x97a8('0x1c')](_0x14199d);}return null;};}function patchUpdates(_0x43ca2a){return function(_0x10b80d){try{jsonpatch[_0x97a8('0x22')](_0x10b80d,_0x43ca2a,!![]);}catch(_0x4666b0){return BPromise[_0x97a8('0x23')](_0x4666b0);}return _0x10b80d[_0x97a8('0x24')]();};}function saveUpdates(_0x40659d,_0x370950){return function(_0x269f1b){if(_0x269f1b){return _0x269f1b[_0x97a8('0x25')](_0x40659d)[_0x97a8('0x26')](function(_0x56ace7){return _0x56ace7;});}return null;};}function removeEntity(_0x4439c0,_0x5a81c6){return function(_0x291df7){if(_0x291df7){return _0x291df7['destroy']()[_0x97a8('0x26')](function(){_0x4439c0[_0x97a8('0x1b')](0xcc)[_0x97a8('0x27')]();});}};}function handleEntityNotFound(_0x400c2a,_0x1532ad){return function(_0x41512d){if(!_0x41512d){_0x400c2a[_0x97a8('0x1a')](0x194);}return _0x41512d;};}function handleError(_0x516c17,_0x1e3697){_0x1e3697=_0x1e3697||0x1f4;return function(_0x461136){logger[_0x97a8('0x28')](_0x461136[_0x97a8('0x29')]);if(_0x461136[_0x97a8('0x2a')]){delete _0x461136[_0x97a8('0x2a')];}_0x516c17[_0x97a8('0x1b')](_0x1e3697)[_0x97a8('0x2b')](_0x461136);};}exports[_0x97a8('0x2c')]=function(_0x223131,_0x2dc307){var _0x58df78={},_0x4d0217={},_0xf70eef={'count':0x0,'rows':[]};var _0x5c0803=_['map'](db['Automation'][_0x97a8('0x2d')],function(_0x5ba2fd){return{'name':_0x5ba2fd[_0x97a8('0x2e')],'type':_0x5ba2fd[_0x97a8('0x2f')]['key']};});_0x4d0217[_0x97a8('0x30')]=_[_0x97a8('0x31')](_0x5c0803,_0x97a8('0x2a'));_0x4d0217[_0x97a8('0x32')]=_[_0x97a8('0x33')](_0x223131[_0x97a8('0x32')]);_0x4d0217[_0x97a8('0x34')]=_[_0x97a8('0x35')](_0x4d0217[_0x97a8('0x30')],_0x4d0217[_0x97a8('0x32')]);_0x58df78[_0x97a8('0x36')]=_['intersection'](_0x4d0217[_0x97a8('0x30')],qs[_0x97a8('0x37')](_0x223131[_0x97a8('0x32')]['fields']));_0x58df78[_0x97a8('0x36')]=_0x58df78[_0x97a8('0x36')][_0x97a8('0x38')]?_0x58df78[_0x97a8('0x36')]:_0x4d0217[_0x97a8('0x30')];if(!_0x223131[_0x97a8('0x32')]['hasOwnProperty'](_0x97a8('0x39'))){_0x58df78[_0x97a8('0x20')]=qs[_0x97a8('0x20')](_0x223131[_0x97a8('0x32')]['limit']);_0x58df78['offset']=qs[_0x97a8('0x1d')](_0x223131[_0x97a8('0x32')][_0x97a8('0x1d')]);}_0x58df78[_0x97a8('0x3a')]=qs['sort'](_0x223131[_0x97a8('0x32')][_0x97a8('0x3b')]);_0x58df78[_0x97a8('0x3c')]=qs[_0x97a8('0x34')](_[_0x97a8('0x3d')](_0x223131[_0x97a8('0x32')],_0x4d0217['filters']),_0x5c0803);if(_0x223131[_0x97a8('0x32')]['filter']){_0x58df78[_0x97a8('0x3c')]=_[_0x97a8('0x3e')](_0x58df78[_0x97a8('0x3c')],{'$or':_[_0x97a8('0x31')](_0x5c0803,function(_0x409c29){if(_0x409c29[_0x97a8('0x2f')]!==_0x97a8('0x3f')){var _0x8ad478={};_0x8ad478[_0x409c29[_0x97a8('0x2a')]]={'$like':'%'+_0x223131[_0x97a8('0x32')][_0x97a8('0x40')]+'%'};return _0x8ad478;}})});}_0x58df78=_['merge']({},_0x58df78,_0x223131[_0x97a8('0x41')]);var _0x2214fd={'where':_0x58df78[_0x97a8('0x3c')]};return db[_0x97a8('0x42')][_0x97a8('0x1f')](_0x2214fd)['then'](function(_0x4a95e2){_0xf70eef[_0x97a8('0x1f')]=_0x4a95e2;if(_0x223131[_0x97a8('0x32')][_0x97a8('0x43')]){_0x58df78[_0x97a8('0x44')]=[{'all':!![]}];}return db[_0x97a8('0x42')]['findAll'](_0x58df78);})[_0x97a8('0x26')](function(_0x85562e){_0xf70eef['rows']=_0x85562e;return _0xf70eef;})[_0x97a8('0x26')](respondWithFilteredResult(_0x2dc307,_0x58df78))['catch'](handleError(_0x2dc307,null));};exports[_0x97a8('0x45')]=function(_0x4d3b76,_0x5e52ff){var _0x140f37={'raw':![],'where':{'id':_0x4d3b76[_0x97a8('0x46')]['id']}},_0x1343e2={};_0x1343e2[_0x97a8('0x30')]=_['keys'](db[_0x97a8('0x42')][_0x97a8('0x2d')]);_0x1343e2[_0x97a8('0x32')]=_[_0x97a8('0x33')](_0x4d3b76['query']);_0x1343e2[_0x97a8('0x34')]=_[_0x97a8('0x35')](_0x1343e2[_0x97a8('0x30')],_0x1343e2[_0x97a8('0x32')]);_0x140f37[_0x97a8('0x36')]=_[_0x97a8('0x35')](_0x1343e2[_0x97a8('0x30')],qs['fields'](_0x4d3b76[_0x97a8('0x32')][_0x97a8('0x37')]));_0x140f37['attributes']=_0x140f37[_0x97a8('0x36')][_0x97a8('0x38')]?_0x140f37[_0x97a8('0x36')]:_0x1343e2[_0x97a8('0x30')];if(_0x4d3b76[_0x97a8('0x32')][_0x97a8('0x43')]){_0x140f37[_0x97a8('0x44')]=[{'all':!![]}];}_0x140f37=_['merge']({},_0x140f37,_0x4d3b76[_0x97a8('0x41')]);return db[_0x97a8('0x42')][_0x97a8('0x47')](_0x140f37)[_0x97a8('0x26')](handleEntityNotFound(_0x5e52ff,null))[_0x97a8('0x26')](respondWithResult(_0x5e52ff,null))[_0x97a8('0x48')](handleError(_0x5e52ff,null));};exports[_0x97a8('0x49')]=function(_0x311ffb,_0x58b054){return db[_0x97a8('0x42')][_0x97a8('0x49')](_0x311ffb[_0x97a8('0x4a')],{})[_0x97a8('0x26')](respondWithResult(_0x58b054,0xc9))['catch'](handleError(_0x58b054,null));};exports[_0x97a8('0x25')]=function(_0x3caada,_0x505931){if(_0x3caada[_0x97a8('0x4a')]['id']){delete _0x3caada[_0x97a8('0x4a')]['id'];}return db[_0x97a8('0x42')][_0x97a8('0x47')]({'where':{'id':_0x3caada[_0x97a8('0x46')]['id']}})[_0x97a8('0x26')](handleEntityNotFound(_0x505931,null))['then'](saveUpdates(_0x3caada[_0x97a8('0x4a')],null))['then'](respondWithResult(_0x505931,null))['catch'](handleError(_0x505931,null));};exports[_0x97a8('0x4b')]=function(_0x3cecc5,_0xc9d98b){return db[_0x97a8('0x42')]['find']({'where':{'id':_0x3cecc5[_0x97a8('0x46')]['id']}})[_0x97a8('0x26')](handleEntityNotFound(_0xc9d98b,null))['then'](removeEntity(_0xc9d98b,null))[_0x97a8('0x48')](handleError(_0xc9d98b,null));};exports['addConditions']=function(_0x384b6c,_0xe8fcd6,_0x15b3be){return db[_0x97a8('0x4c')][_0x97a8('0x47')]({'where':{'id':_0x384b6c['params']['id']}})[_0x97a8('0x26')](handleEntityNotFound(_0xe8fcd6,null))[_0x97a8('0x26')](function(_0x2a2e59){if(_0x2a2e59){return _0x2a2e59[_0x97a8('0x4d')](_0x384b6c['body'][_0x97a8('0x4e')],_[_0x97a8('0x4f')](_0x384b6c[_0x97a8('0x4a')],[_0x97a8('0x4e'),'id'])||{});}})[_0x97a8('0x26')](respondWithResult(_0xe8fcd6,null))['catch'](handleError(_0xe8fcd6,null));};exports[_0x97a8('0x50')]=function(_0x2cfa07,_0xa79baa,_0x54fe93){var _0xcaea47={};var _0x2b40c0={};var _0x496f52;var _0x337ec6;return db['Automation'][_0x97a8('0x51')]({'where':{'id':_0x2cfa07[_0x97a8('0x46')]['id']}})['then'](handleEntityNotFound(_0xa79baa,null))[_0x97a8('0x26')](function(_0x33b2db){if(_0x33b2db){_0x496f52=_0x33b2db;_0x2b40c0[_0x97a8('0x30')]=_['keys'](db['Condition']['rawAttributes']);_0x2b40c0[_0x97a8('0x32')]=_['keys'](_0x2cfa07[_0x97a8('0x32')]);_0x2b40c0[_0x97a8('0x34')]=_[_0x97a8('0x35')](_0x2b40c0[_0x97a8('0x30')],_0x2b40c0[_0x97a8('0x32')]);_0xcaea47[_0x97a8('0x36')]=_[_0x97a8('0x35')](_0x2b40c0[_0x97a8('0x30')],qs[_0x97a8('0x37')](_0x2cfa07['query'][_0x97a8('0x37')]));_0xcaea47[_0x97a8('0x36')]=_0xcaea47[_0x97a8('0x36')][_0x97a8('0x38')]?_0xcaea47['attributes']:_0x2b40c0[_0x97a8('0x30')];_0xcaea47[_0x97a8('0x3a')]=qs[_0x97a8('0x3b')](_0x2cfa07[_0x97a8('0x32')][_0x97a8('0x3b')]);_0xcaea47[_0x97a8('0x3c')]=qs['filters'](_[_0x97a8('0x3d')](_0x2cfa07['query'],_0x2b40c0[_0x97a8('0x34')]));if(_0x2cfa07[_0x97a8('0x32')][_0x97a8('0x40')]){_0xcaea47['where']=_[_0x97a8('0x3e')](_0xcaea47[_0x97a8('0x3c')],{'$or':_[_0x97a8('0x31')](_0xcaea47[_0x97a8('0x36')],function(_0x560b1b){var _0x2be4b7={};_0x2be4b7[_0x560b1b]={'$like':'%'+_0x2cfa07[_0x97a8('0x32')][_0x97a8('0x40')]+'%'};return _0x2be4b7;})});}_0xcaea47=_['merge']({},_0xcaea47,_0x2cfa07[_0x97a8('0x41')]);return _0x496f52[_0x97a8('0x50')](_0xcaea47);}})[_0x97a8('0x26')](function(_0x14bd7e){if(_0x14bd7e){_0x337ec6=_0x14bd7e[_0x97a8('0x38')];if(!_0x2cfa07[_0x97a8('0x32')][_0x97a8('0x52')](_0x97a8('0x39'))){_0xcaea47[_0x97a8('0x20')]=qs[_0x97a8('0x20')](_0x2cfa07[_0x97a8('0x32')][_0x97a8('0x20')]);_0xcaea47['offset']=qs[_0x97a8('0x1d')](_0x2cfa07['query'][_0x97a8('0x1d')]);}return _0x496f52[_0x97a8('0x50')](_0xcaea47);}})[_0x97a8('0x26')](function(_0x15d80f){if(_0x15d80f){return _0x15d80f?{'count':_0x337ec6,'rows':_0x15d80f}:null;}})[_0x97a8('0x26')](respondWithResult(_0xa79baa,null))['catch'](handleError(_0xa79baa,null));};exports[_0x97a8('0x53')]=function(_0x4b53d4,_0x51b6eb,_0x207a1f){return db[_0x97a8('0x54')][_0x97a8('0x47')]({'where':{'id':_0x4b53d4[_0x97a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x51b6eb,null))[_0x97a8('0x26')](function(_0x44f0b2){if(_0x44f0b2){return _0x44f0b2['addActions'](_0x4b53d4[_0x97a8('0x4a')][_0x97a8('0x4e')],_[_0x97a8('0x4f')](_0x4b53d4[_0x97a8('0x4a')],[_0x97a8('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x51b6eb,null))[_0x97a8('0x48')](handleError(_0x51b6eb,null));};exports['getActions']=function(_0x172034,_0x55857e,_0x159459){var _0xc5e309={};var _0x368a9d={};var _0x5c1c9d;var _0x50622e;return db[_0x97a8('0x42')][_0x97a8('0x51')]({'where':{'id':_0x172034[_0x97a8('0x46')]['id']}})[_0x97a8('0x26')](handleEntityNotFound(_0x55857e,null))[_0x97a8('0x26')](function(_0x74a5a7){if(_0x74a5a7){_0x5c1c9d=_0x74a5a7;_0x368a9d['model']=_[_0x97a8('0x33')](db['Action'][_0x97a8('0x2d')]);_0x368a9d[_0x97a8('0x32')]=_[_0x97a8('0x33')](_0x172034[_0x97a8('0x32')]);_0x368a9d['filters']=_[_0x97a8('0x35')](_0x368a9d['model'],_0x368a9d['query']);_0xc5e309[_0x97a8('0x36')]=_[_0x97a8('0x35')](_0x368a9d['model'],qs['fields'](_0x172034[_0x97a8('0x32')]['fields']));_0xc5e309['attributes']=_0xc5e309[_0x97a8('0x36')][_0x97a8('0x38')]?_0xc5e309['attributes']:_0x368a9d[_0x97a8('0x30')];_0xc5e309['order']=qs['sort'](_0x172034[_0x97a8('0x32')][_0x97a8('0x3b')]);_0xc5e309[_0x97a8('0x3c')]=qs['filters'](_[_0x97a8('0x3d')](_0x172034[_0x97a8('0x32')],_0x368a9d[_0x97a8('0x34')]));if(_0x172034[_0x97a8('0x32')][_0x97a8('0x40')]){_0xc5e309[_0x97a8('0x3c')]=_[_0x97a8('0x3e')](_0xc5e309[_0x97a8('0x3c')],{'$or':_[_0x97a8('0x31')](_0xc5e309[_0x97a8('0x36')],function(_0x204efa){var _0x290f86={};_0x290f86[_0x204efa]={'$like':'%'+_0x172034[_0x97a8('0x32')][_0x97a8('0x40')]+'%'};return _0x290f86;})});}_0xc5e309=_[_0x97a8('0x3e')]({},_0xc5e309,_0x172034[_0x97a8('0x41')]);return _0x5c1c9d[_0x97a8('0x55')](_0xc5e309);}})[_0x97a8('0x26')](function(_0x35c79b){if(_0x35c79b){_0x50622e=_0x35c79b[_0x97a8('0x38')];if(!_0x172034[_0x97a8('0x32')][_0x97a8('0x52')](_0x97a8('0x39'))){_0xc5e309[_0x97a8('0x20')]=qs[_0x97a8('0x20')](_0x172034[_0x97a8('0x32')]['limit']);_0xc5e309[_0x97a8('0x1d')]=qs[_0x97a8('0x1d')](_0x172034['query']['offset']);}return _0x5c1c9d[_0x97a8('0x55')](_0xc5e309);}})[_0x97a8('0x26')](function(_0x5b55ba){if(_0x5b55ba){return _0x5b55ba?{'count':_0x50622e,'rows':_0x5b55ba}:null;}})[_0x97a8('0x26')](respondWithResult(_0x55857e,null))[_0x97a8('0x48')](handleError(_0x55857e,null));};
\ No newline at end of file
+var _0x6daa=['attributes','fields','nolimit','limit','offset','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','length','catch','update','body','find','params','addConditions','ids','omit','getConditions','Condition','pick','hasOwnProperty','addActions','Action','getActions','findOne','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','status','end','json','undefined','count','set','Content-Range','reject','save','destroy','then','sendStatus','stack','name','index','Automation','fieldName','key','model','map','query','keys','intersection'];(function(_0x335ff7,_0x3853e4){var _0x38637c=function(_0x1628f9){while(--_0x1628f9){_0x335ff7['push'](_0x335ff7['shift']());}};_0x38637c(++_0x3853e4);}(_0x6daa,0xc5));var _0xa6da=function(_0x4f9353,_0x253dc3){_0x4f9353=_0x4f9353-0x0;var _0x2de7b1=_0x6daa[_0x4f9353];return _0x2de7b1;};'use strict';var emlformat=require(_0xa6da('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa6da('0x1'));var rp=require(_0xa6da('0x2'));var moment=require('moment');var BPromise=require(_0xa6da('0x3'));var Mustache=require(_0xa6da('0x4'));var util=require(_0xa6da('0x5'));var path=require(_0xa6da('0x6'));var sox=require(_0xa6da('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa6da('0x8'));var _=require(_0xa6da('0x9'));var squel=require(_0xa6da('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6da('0xb'));var toCsv=require(_0xa6da('0xc'));var querystring=require(_0xa6da('0xd'));var Papa=require(_0xa6da('0xe'));var Redis=require('ioredis');var authService=require(_0xa6da('0xf'));var qs=require(_0xa6da('0x10'));var as=require(_0xa6da('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6da('0x12'))('api');var utils=require(_0xa6da('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e9790,_0x5a60d2){_0x5a60d2=_0x5a60d2||0xcc;return function(_0x32d04e){if(_0x32d04e){return _0x5e9790['sendStatus'](_0x5a60d2);}return _0x5e9790[_0xa6da('0x14')](_0x5a60d2)[_0xa6da('0x15')]();};}function respondWithResult(_0x4f54c9,_0x1b712d){_0x1b712d=_0x1b712d||0xc8;return function(_0x4a9806){if(_0x4a9806){return _0x4f54c9[_0xa6da('0x14')](_0x1b712d)[_0xa6da('0x16')](_0x4a9806);}};}function respondWithFilteredResult(_0x5bdf56,_0x161255){return function(_0x25d519){if(_0x25d519){var _0x58e482=typeof _0x161255['offset']===_0xa6da('0x17')&&typeof _0x161255['limit']===_0xa6da('0x17');var _0x34d3b9=_0x25d519[_0xa6da('0x18')];var _0x5ae34c=_0x58e482?0x0:_0x161255['offset'];var _0x460490=_0x58e482?_0x25d519[_0xa6da('0x18')]:_0x161255['offset']+_0x161255['limit'];var _0x24ee47;if(_0x460490>=_0x34d3b9){_0x460490=_0x34d3b9;_0x24ee47=0xc8;}else{_0x24ee47=0xce;}_0x5bdf56[_0xa6da('0x14')](_0x24ee47);return _0x5bdf56[_0xa6da('0x19')](_0xa6da('0x1a'),_0x5ae34c+'-'+_0x460490+'/'+_0x34d3b9)[_0xa6da('0x16')](_0x25d519);}return null;};}function patchUpdates(_0x2c1ed1){return function(_0x5a6724){try{jsonpatch['apply'](_0x5a6724,_0x2c1ed1,!![]);}catch(_0x5c4055){return BPromise[_0xa6da('0x1b')](_0x5c4055);}return _0x5a6724[_0xa6da('0x1c')]();};}function saveUpdates(_0x2336d2,_0x1bdf1c){return function(_0x30e928){if(_0x30e928){return _0x30e928['update'](_0x2336d2)['then'](function(_0x537f00){return _0x537f00;});}return null;};}function removeEntity(_0x587ef1,_0x49d4af){return function(_0x2e10f4){if(_0x2e10f4){return _0x2e10f4[_0xa6da('0x1d')]()[_0xa6da('0x1e')](function(){_0x587ef1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x547e35,_0x256491){return function(_0x2dcf64){if(!_0x2dcf64){_0x547e35[_0xa6da('0x1f')](0x194);}return _0x2dcf64;};}function handleError(_0x3d38e8,_0x3748c6){_0x3748c6=_0x3748c6||0x1f4;return function(_0x4a9d98){logger['error'](_0x4a9d98[_0xa6da('0x20')]);if(_0x4a9d98[_0xa6da('0x21')]){delete _0x4a9d98['name'];}_0x3d38e8[_0xa6da('0x14')](_0x3748c6)['send'](_0x4a9d98);};}exports[_0xa6da('0x22')]=function(_0x49b424,_0x26a47c){var _0x541c0a={},_0xd185a9={},_0x3790f7={'count':0x0,'rows':[]};var _0x48bfe8=_['map'](db[_0xa6da('0x23')]['rawAttributes'],function(_0x5ebeca){return{'name':_0x5ebeca[_0xa6da('0x24')],'type':_0x5ebeca['type'][_0xa6da('0x25')]};});_0xd185a9[_0xa6da('0x26')]=_[_0xa6da('0x27')](_0x48bfe8,_0xa6da('0x21'));_0xd185a9[_0xa6da('0x28')]=_[_0xa6da('0x29')](_0x49b424['query']);_0xd185a9['filters']=_[_0xa6da('0x2a')](_0xd185a9[_0xa6da('0x26')],_0xd185a9[_0xa6da('0x28')]);_0x541c0a[_0xa6da('0x2b')]=_['intersection'](_0xd185a9['model'],qs['fields'](_0x49b424['query'][_0xa6da('0x2c')]));_0x541c0a[_0xa6da('0x2b')]=_0x541c0a[_0xa6da('0x2b')]['length']?_0x541c0a[_0xa6da('0x2b')]:_0xd185a9[_0xa6da('0x26')];if(!_0x49b424['query']['hasOwnProperty'](_0xa6da('0x2d'))){_0x541c0a[_0xa6da('0x2e')]=qs[_0xa6da('0x2e')](_0x49b424[_0xa6da('0x28')][_0xa6da('0x2e')]);_0x541c0a['offset']=qs['offset'](_0x49b424[_0xa6da('0x28')][_0xa6da('0x2f')]);}_0x541c0a[_0xa6da('0x30')]=qs[_0xa6da('0x31')](_0x49b424[_0xa6da('0x28')][_0xa6da('0x31')]);_0x541c0a[_0xa6da('0x32')]=qs[_0xa6da('0x33')](_['pick'](_0x49b424[_0xa6da('0x28')],_0xd185a9[_0xa6da('0x33')]),_0x48bfe8);if(_0x49b424[_0xa6da('0x28')][_0xa6da('0x34')]){_0x541c0a[_0xa6da('0x32')]=_[_0xa6da('0x35')](_0x541c0a[_0xa6da('0x32')],{'$or':_['map'](_0x48bfe8,function(_0x2aaab4){if(_0x2aaab4[_0xa6da('0x36')]!==_0xa6da('0x37')){var _0x49236e={};_0x49236e[_0x2aaab4[_0xa6da('0x21')]]={'$like':'%'+_0x49b424[_0xa6da('0x28')][_0xa6da('0x34')]+'%'};return _0x49236e;}})});}_0x541c0a=_[_0xa6da('0x35')]({},_0x541c0a,_0x49b424[_0xa6da('0x38')]);var _0x536220={'where':_0x541c0a[_0xa6da('0x32')]};return db[_0xa6da('0x23')]['count'](_0x536220)[_0xa6da('0x1e')](function(_0x323cd5){_0x3790f7[_0xa6da('0x18')]=_0x323cd5;if(_0x49b424['query'][_0xa6da('0x39')]){_0x541c0a[_0xa6da('0x3a')]=[{'all':!![]}];}return db[_0xa6da('0x23')][_0xa6da('0x3b')](_0x541c0a);})[_0xa6da('0x1e')](function(_0x58a5e8){_0x3790f7[_0xa6da('0x3c')]=_0x58a5e8;return _0x3790f7;})[_0xa6da('0x1e')](respondWithFilteredResult(_0x26a47c,_0x541c0a))['catch'](handleError(_0x26a47c,null));};exports[_0xa6da('0x3d')]=function(_0x13e5c4,_0x17ae0d){var _0x1d84d4={'raw':![],'where':{'id':_0x13e5c4['params']['id']}},_0x559122={};_0x559122[_0xa6da('0x26')]=_['keys'](db[_0xa6da('0x23')][_0xa6da('0x3e')]);_0x559122[_0xa6da('0x28')]=_[_0xa6da('0x29')](_0x13e5c4[_0xa6da('0x28')]);_0x559122['filters']=_[_0xa6da('0x2a')](_0x559122[_0xa6da('0x26')],_0x559122[_0xa6da('0x28')]);_0x1d84d4[_0xa6da('0x2b')]=_[_0xa6da('0x2a')](_0x559122[_0xa6da('0x26')],qs[_0xa6da('0x2c')](_0x13e5c4[_0xa6da('0x28')][_0xa6da('0x2c')]));_0x1d84d4[_0xa6da('0x2b')]=_0x1d84d4[_0xa6da('0x2b')][_0xa6da('0x3f')]?_0x1d84d4[_0xa6da('0x2b')]:_0x559122[_0xa6da('0x26')];if(_0x13e5c4['query']['includeAll']){_0x1d84d4['include']=[{'all':!![]}];}_0x1d84d4=_[_0xa6da('0x35')]({},_0x1d84d4,_0x13e5c4[_0xa6da('0x38')]);return db[_0xa6da('0x23')]['find'](_0x1d84d4)[_0xa6da('0x1e')](handleEntityNotFound(_0x17ae0d,null))[_0xa6da('0x1e')](respondWithResult(_0x17ae0d,null))[_0xa6da('0x40')](handleError(_0x17ae0d,null));};exports['create']=function(_0xf33946,_0x41fca0){return db[_0xa6da('0x23')]['create'](_0xf33946['body'],{})[_0xa6da('0x1e')](respondWithResult(_0x41fca0,0xc9))['catch'](handleError(_0x41fca0,null));};exports[_0xa6da('0x41')]=function(_0x25032e,_0x235fac){if(_0x25032e[_0xa6da('0x42')]['id']){delete _0x25032e[_0xa6da('0x42')]['id'];}return db[_0xa6da('0x23')][_0xa6da('0x43')]({'where':{'id':_0x25032e[_0xa6da('0x44')]['id']}})[_0xa6da('0x1e')](handleEntityNotFound(_0x235fac,null))['then'](saveUpdates(_0x25032e[_0xa6da('0x42')],null))[_0xa6da('0x1e')](respondWithResult(_0x235fac,null))[_0xa6da('0x40')](handleError(_0x235fac,null));};exports['destroy']=function(_0x2736bb,_0x13ab43){return db[_0xa6da('0x23')][_0xa6da('0x43')]({'where':{'id':_0x2736bb[_0xa6da('0x44')]['id']}})['then'](handleEntityNotFound(_0x13ab43,null))[_0xa6da('0x1e')](removeEntity(_0x13ab43,null))[_0xa6da('0x40')](handleError(_0x13ab43,null));};exports[_0xa6da('0x45')]=function(_0x16b93a,_0x35d887,_0x1ad75b){return db['Condition'][_0xa6da('0x43')]({'where':{'id':_0x16b93a[_0xa6da('0x44')]['id']}})[_0xa6da('0x1e')](handleEntityNotFound(_0x35d887,null))[_0xa6da('0x1e')](function(_0x462ae4){if(_0x462ae4){return _0x462ae4[_0xa6da('0x45')](_0x16b93a[_0xa6da('0x42')][_0xa6da('0x46')],_[_0xa6da('0x47')](_0x16b93a['body'],[_0xa6da('0x46'),'id'])||{});}})[_0xa6da('0x1e')](respondWithResult(_0x35d887,null))[_0xa6da('0x40')](handleError(_0x35d887,null));};exports[_0xa6da('0x48')]=function(_0xb5ac44,_0x29ffb4,_0x36567a){var _0x3b451a={};var _0x16d086={};var _0x9d2a7e;var _0x1f1030;return db[_0xa6da('0x23')]['findOne']({'where':{'id':_0xb5ac44[_0xa6da('0x44')]['id']}})['then'](handleEntityNotFound(_0x29ffb4,null))[_0xa6da('0x1e')](function(_0x412dd6){if(_0x412dd6){_0x9d2a7e=_0x412dd6;_0x16d086['model']=_[_0xa6da('0x29')](db[_0xa6da('0x49')][_0xa6da('0x3e')]);_0x16d086[_0xa6da('0x28')]=_[_0xa6da('0x29')](_0xb5ac44[_0xa6da('0x28')]);_0x16d086[_0xa6da('0x33')]=_['intersection'](_0x16d086[_0xa6da('0x26')],_0x16d086[_0xa6da('0x28')]);_0x3b451a['attributes']=_[_0xa6da('0x2a')](_0x16d086['model'],qs['fields'](_0xb5ac44['query']['fields']));_0x3b451a['attributes']=_0x3b451a['attributes'][_0xa6da('0x3f')]?_0x3b451a[_0xa6da('0x2b')]:_0x16d086[_0xa6da('0x26')];_0x3b451a['order']=qs['sort'](_0xb5ac44[_0xa6da('0x28')][_0xa6da('0x31')]);_0x3b451a['where']=qs['filters'](_[_0xa6da('0x4a')](_0xb5ac44[_0xa6da('0x28')],_0x16d086[_0xa6da('0x33')]));if(_0xb5ac44[_0xa6da('0x28')][_0xa6da('0x34')]){_0x3b451a[_0xa6da('0x32')]=_[_0xa6da('0x35')](_0x3b451a[_0xa6da('0x32')],{'$or':_[_0xa6da('0x27')](_0x3b451a[_0xa6da('0x2b')],function(_0x51dbcb){var _0x560a70={};_0x560a70[_0x51dbcb]={'$like':'%'+_0xb5ac44[_0xa6da('0x28')][_0xa6da('0x34')]+'%'};return _0x560a70;})});}_0x3b451a=_[_0xa6da('0x35')]({},_0x3b451a,_0xb5ac44[_0xa6da('0x38')]);return _0x9d2a7e[_0xa6da('0x48')](_0x3b451a);}})[_0xa6da('0x1e')](function(_0x38f7f8){if(_0x38f7f8){_0x1f1030=_0x38f7f8[_0xa6da('0x3f')];if(!_0xb5ac44[_0xa6da('0x28')][_0xa6da('0x4b')](_0xa6da('0x2d'))){_0x3b451a['limit']=qs[_0xa6da('0x2e')](_0xb5ac44['query'][_0xa6da('0x2e')]);_0x3b451a[_0xa6da('0x2f')]=qs[_0xa6da('0x2f')](_0xb5ac44['query'][_0xa6da('0x2f')]);}return _0x9d2a7e[_0xa6da('0x48')](_0x3b451a);}})[_0xa6da('0x1e')](function(_0x10c8b1){if(_0x10c8b1){return _0x10c8b1?{'count':_0x1f1030,'rows':_0x10c8b1}:null;}})['then'](respondWithResult(_0x29ffb4,null))[_0xa6da('0x40')](handleError(_0x29ffb4,null));};exports[_0xa6da('0x4c')]=function(_0x3fcfd5,_0x4001a9,_0x5e70e5){return db[_0xa6da('0x4d')][_0xa6da('0x43')]({'where':{'id':_0x3fcfd5[_0xa6da('0x44')]['id']}})[_0xa6da('0x1e')](handleEntityNotFound(_0x4001a9,null))['then'](function(_0x2044f6){if(_0x2044f6){return _0x2044f6[_0xa6da('0x4c')](_0x3fcfd5['body'][_0xa6da('0x46')],_[_0xa6da('0x47')](_0x3fcfd5['body'],[_0xa6da('0x46'),'id'])||{});}})[_0xa6da('0x1e')](respondWithResult(_0x4001a9,null))[_0xa6da('0x40')](handleError(_0x4001a9,null));};exports[_0xa6da('0x4e')]=function(_0x1b0a7b,_0x3dd787,_0x460382){var _0x4b436c={};var _0x48583a={};var _0x417ed5;var _0x565b1c;return db['Automation'][_0xa6da('0x4f')]({'where':{'id':_0x1b0a7b[_0xa6da('0x44')]['id']}})[_0xa6da('0x1e')](handleEntityNotFound(_0x3dd787,null))[_0xa6da('0x1e')](function(_0x2dd286){if(_0x2dd286){_0x417ed5=_0x2dd286;_0x48583a[_0xa6da('0x26')]=_['keys'](db[_0xa6da('0x4d')][_0xa6da('0x3e')]);_0x48583a[_0xa6da('0x28')]=_[_0xa6da('0x29')](_0x1b0a7b[_0xa6da('0x28')]);_0x48583a[_0xa6da('0x33')]=_[_0xa6da('0x2a')](_0x48583a[_0xa6da('0x26')],_0x48583a['query']);_0x4b436c['attributes']=_[_0xa6da('0x2a')](_0x48583a['model'],qs[_0xa6da('0x2c')](_0x1b0a7b['query']['fields']));_0x4b436c['attributes']=_0x4b436c[_0xa6da('0x2b')][_0xa6da('0x3f')]?_0x4b436c[_0xa6da('0x2b')]:_0x48583a[_0xa6da('0x26')];_0x4b436c[_0xa6da('0x30')]=qs[_0xa6da('0x31')](_0x1b0a7b[_0xa6da('0x28')][_0xa6da('0x31')]);_0x4b436c[_0xa6da('0x32')]=qs['filters'](_['pick'](_0x1b0a7b[_0xa6da('0x28')],_0x48583a[_0xa6da('0x33')]));if(_0x1b0a7b[_0xa6da('0x28')][_0xa6da('0x34')]){_0x4b436c[_0xa6da('0x32')]=_[_0xa6da('0x35')](_0x4b436c[_0xa6da('0x32')],{'$or':_['map'](_0x4b436c[_0xa6da('0x2b')],function(_0x2386db){var _0x5ac2ad={};_0x5ac2ad[_0x2386db]={'$like':'%'+_0x1b0a7b[_0xa6da('0x28')][_0xa6da('0x34')]+'%'};return _0x5ac2ad;})});}_0x4b436c=_['merge']({},_0x4b436c,_0x1b0a7b[_0xa6da('0x38')]);return _0x417ed5['getActions'](_0x4b436c);}})['then'](function(_0x11324c){if(_0x11324c){_0x565b1c=_0x11324c['length'];if(!_0x1b0a7b[_0xa6da('0x28')][_0xa6da('0x4b')](_0xa6da('0x2d'))){_0x4b436c[_0xa6da('0x2e')]=qs[_0xa6da('0x2e')](_0x1b0a7b[_0xa6da('0x28')][_0xa6da('0x2e')]);_0x4b436c[_0xa6da('0x2f')]=qs[_0xa6da('0x2f')](_0x1b0a7b['query']['offset']);}return _0x417ed5['getActions'](_0x4b436c);}})['then'](function(_0x1fa6d0){if(_0x1fa6d0){return _0x1fa6d0?{'count':_0x565b1c,'rows':_0x1fa6d0}:null;}})[_0xa6da('0x1e')](respondWithResult(_0x3dd787,null))[_0xa6da('0x40')](handleError(_0x3dd787,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index dfcd005..890ae98 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 _0x0926=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Automation','tools_automations','lodash'];(function(_0x1b56a8,_0x139cf0){var _0x5b2289=function(_0x48f2d4){while(--_0x48f2d4){_0x1b56a8['push'](_0x1b56a8['shift']());}};_0x5b2289(++_0x139cf0);}(_0x0926,0x1b1));var _0x6092=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x0926[_0x38af48];return _0x445384;};'use strict';var _=require(_0x6092('0x0'));var util=require(_0x6092('0x1'));var logger=require(_0x6092('0x2'))(_0x6092('0x3'));var moment=require(_0x6092('0x4'));var BPromise=require(_0x6092('0x5'));var rp=require(_0x6092('0x6'));var fs=require('fs');var path=require(_0x6092('0x7'));var rimraf=require(_0x6092('0x8'));var config=require(_0x6092('0x9'));var attributes=require('./automation.attributes');module[_0x6092('0xa')]=function(_0x33bef1,_0x11cc23){return _0x33bef1[_0x6092('0xb')](_0x6092('0xc'),attributes,{'tableName':_0x6092('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fa6=['lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations'];(function(_0x376c94,_0x59131c){var _0x3bd8bb=function(_0x5c3fd4){while(--_0x5c3fd4){_0x376c94['push'](_0x376c94['shift']());}};_0x3bd8bb(++_0x59131c);}(_0x0fa6,0x176));var _0x60fa=function(_0xc8459e,_0x357636){_0xc8459e=_0xc8459e-0x0;var _0x2cff12=_0x0fa6[_0xc8459e];return _0x2cff12;};'use strict';var _=require(_0x60fa('0x0'));var util=require('util');var logger=require(_0x60fa('0x1'))('api');var moment=require(_0x60fa('0x2'));var BPromise=require(_0x60fa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x60fa('0x4'));var rimraf=require(_0x60fa('0x5'));var config=require(_0x60fa('0x6'));var attributes=require(_0x60fa('0x7'));module[_0x60fa('0x8')]=function(_0x195fea,_0x14486b){return _0x195fea['define'](_0x60fa('0x9'),attributes,{'tableName':_0x60fa('0xa'),'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 2468377..7165bb8 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 _0x9ab8=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0x9ab8,0x81));var _0x89ab=function(_0x54b800,_0x36bb53){_0x54b800=_0x54b800-0x0;var _0x541239=_0x9ab8[_0x54b800];return _0x541239;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var moment=require(_0x89ab('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ab('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x89ab('0x4'));var logger=require(_0x89ab('0x5'))('rpc');var config=require(_0x89ab('0x6'));var jayson=require(_0x89ab('0x7'));var client=jayson[_0x89ab('0x8')][_0x89ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29a984,_0x3ecaa0,_0x366c32){return new BPromise(function(_0x5fd99f,_0x42da87){return client[_0x89ab('0xa')](_0x29a984,_0x366c32)[_0x89ab('0xb')](function(_0x36dc63){logger['info']('Automation,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x3ecaa0,_0x89ab('0xc'),JSON[_0x89ab('0xd')](_0x36dc63));if(_0x36dc63[_0x89ab('0xe')]){if(_0x36dc63[_0x89ab('0xe')][_0x89ab('0xf')]===0x1f4){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x42da87(_0x36dc63[_0x89ab('0xe')][_0x89ab('0x11')]);}logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x36dc63['error'][_0x89ab('0x11')]);return _0x5fd99f(_0x36dc63[_0x89ab('0xe')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3ecaa0,'request\x20sent');_0x5fd99f(_0x36dc63['result']['message']);}})[_0x89ab('0x12')](function(_0x1ce918){logger[_0x89ab('0xe')](_0x89ab('0x10'),_0x3ecaa0,_0x1ce918);_0x42da87(_0x1ce918);});});}
\ No newline at end of file
+var _0x349f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x48cabe,_0x1b60b5){var _0x3cc062=function(_0x25216c){while(--_0x25216c){_0x48cabe['push'](_0x48cabe['shift']());}};_0x3cc062(++_0x1b60b5);}(_0x349f,0xa8));var _0xf349=function(_0x3c58cc,_0x3d85c8){_0x3c58cc=_0x3c58cc-0x0;var _0x2f51de=_0x349f[_0x3c58cc];return _0x2f51de;};'use strict';var _=require(_0xf349('0x0'));var util=require(_0xf349('0x1'));var moment=require(_0xf349('0x2'));var BPromise=require('bluebird');var rs=require(_0xf349('0x3'));var fs=require('fs');var Redis=require(_0xf349('0x4'));var db=require(_0xf349('0x5'))['db'];var utils=require(_0xf349('0x6'));var logger=require(_0xf349('0x7'))(_0xf349('0x8'));var config=require(_0xf349('0x9'));var jayson=require(_0xf349('0xa'));var client=jayson[_0xf349('0xb')][_0xf349('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c6f4c,_0x1bd44a,_0x23fb4b){return new BPromise(function(_0x6c6cd2,_0x21a480){return client[_0xf349('0xd')](_0x4c6f4c,_0x23fb4b)[_0xf349('0xe')](function(_0x3e2147){logger['info']('Automation,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));logger[_0xf349('0x10')](_0xf349('0x11'),_0x1bd44a,_0xf349('0xf'),JSON[_0xf349('0x12')](_0x3e2147));if(_0x3e2147['error']){if(_0x3e2147['error']['code']===0x1f4){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147[_0xf349('0x13')][_0xf349('0x15')]);return _0x21a480(_0x3e2147[_0xf349('0x13')]['message']);}logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x3e2147['error'][_0xf349('0x15')]);return _0x6c6cd2(_0x3e2147[_0xf349('0x13')]['message']);}else{logger[_0xf349('0x16')]('Automation,\x20%s,\x20%s',_0x1bd44a,_0xf349('0xf'));_0x6c6cd2(_0x3e2147[_0xf349('0x17')][_0xf349('0x15')]);}})[_0xf349('0x18')](function(_0x14c06d){logger[_0xf349('0x13')](_0xf349('0x14'),_0x1bd44a,_0x14c06d);_0x21a480(_0x14c06d);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 89d0740..bda007b 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 _0xb647=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','post','addConditions','put','update'];(function(_0x6fe240,_0x1827a6){var _0x2fc18b=function(_0x3111a3){while(--_0x3111a3){_0x6fe240['push'](_0x6fe240['shift']());}};_0x2fc18b(++_0x1827a6);}(_0xb647,0xdb));var _0x7b64=function(_0x17c95e,_0x1348c2){_0x17c95e=_0x17c95e-0x0;var _0x47d54c=_0xb647[_0x17c95e];return _0x47d54c;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./automation.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0x9')](_0x7b64('0xe'),auth['isAuthenticated'](),controller[_0x7b64('0xf')]);router['get'](_0x7b64('0x10'),auth['isAuthenticated'](),controller['getActions']);router[_0x7b64('0x11')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0x11')](_0x7b64('0xe'),auth[_0x7b64('0xa')](),controller[_0x7b64('0x12')]);router[_0x7b64('0x11')](_0x7b64('0x10'),auth[_0x7b64('0xa')](),controller['addActions']);router[_0x7b64('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7b64('0x14')]);router[_0x7b64('0x15')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0x16')]);module[_0x7b64('0x17')]=router;
\ No newline at end of file
+var _0x1a66=['../../components/interaction/service','../../config/environment','./automation.controller','/:id','isAuthenticated','get','getConditions','/:id/actions','post','create','addConditions','addActions','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x24693e,_0x2ba888){var _0x53e672=function(_0x5f6cff){while(--_0x5f6cff){_0x24693e['push'](_0x24693e['shift']());}};_0x53e672(++_0x2ba888);}(_0x1a66,0x102));var _0x61a6=function(_0x2abd73,_0x340684){_0x2abd73=_0x2abd73-0x0;var _0x4fc21d=_0x1a66[_0x2abd73];return _0x4fc21d;};'use strict';var multer=require(_0x61a6('0x0'));var util=require(_0x61a6('0x1'));var path=require(_0x61a6('0x2'));var timeout=require(_0x61a6('0x3'));var express=require(_0x61a6('0x4'));var router=express[_0x61a6('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x61a6('0x6'));var config=require(_0x61a6('0x7'));var controller=require(_0x61a6('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x61a6('0x9'),auth[_0x61a6('0xa')](),controller['show']);router[_0x61a6('0xb')]('/:id/conditions',auth[_0x61a6('0xa')](),controller[_0x61a6('0xc')]);router['get'](_0x61a6('0xd'),auth['isAuthenticated'](),controller['getActions']);router[_0x61a6('0xe')]('/',auth[_0x61a6('0xa')](),controller[_0x61a6('0xf')]);router[_0x61a6('0xe')]('/:id/conditions',auth[_0x61a6('0xa')](),controller[_0x61a6('0x10')]);router['post'](_0x61a6('0xd'),auth['isAuthenticated'](),controller[_0x61a6('0x11')]);router['put']('/:id',auth[_0x61a6('0xa')](),controller[_0x61a6('0x12')]);router[_0x61a6('0x13')](_0x61a6('0x9'),auth[_0x61a6('0xa')](),controller[_0x61a6('0x14')]);module[_0x61a6('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5ebd46b..ef48bb9 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 _0x2741=['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)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','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\x20(min:1,\x20max:999)','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','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4952a0,_0x396813){var _0x301cfb=function(_0x797af1){while(--_0x797af1){_0x4952a0['push'](_0x4952a0['shift']());}};_0x301cfb(++_0x396813);}(_0x2741,0xef));var _0x1274=function(_0x41a3d3,_0x5ef4f6){_0x41a3d3=_0x41a3d3-0x0;var _0x1b581e=_0x2741[_0x41a3d3];return _0x1b581e;};'use strict';var Sequelize=require(_0x1274('0x0'));module[_0x1274('0x1')]={'name':{'type':Sequelize[_0x1274('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1274('0x3')](_0x1274('0x4')),'allowNull':![],'defaultValue':_0x1274('0x4')},'description':{'type':Sequelize[_0x1274('0x2')]},'active':{'type':Sequelize[_0x1274('0x5')],'defaultValue':0x0,'comment':_0x1274('0x6')},'limitCalls':{'type':Sequelize[_0x1274('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1274('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1274('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1274('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1274('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1274('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x1274('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1274('0x7')](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1274('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x1274('0x3')](_0x1274('0x11'),_0x1274('0x12'),_0x1274('0x13')),'defaultValue':_0x1274('0x11')},'dialAMDActive':{'type':Sequelize[_0x1274('0x5')],'defaultValue':0x0,'comment':_0x1274('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x1274('0x7')](0x9)[_0x1274('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1274('0x7')](0x9)[_0x1274('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1274('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1274('0x7')](0x9)[_0x1274('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1274('0x7')](0x9)[_0x1274('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1274('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x1274('0x7')](0x9)[_0x1274('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1274('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1274('0x7')](0x9)[_0x1274('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1274('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1274('0x7')](0x5)[_0x1274('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1274('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1274('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1274('0x3')](_0x1274('0x1b'),'ASC'),'defaultValue':_0x1274('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1274('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1274('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1274('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x1274('0x7')](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1274('0x7')](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1274('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1274('0x7')](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x1274('0x7')](0x3)[_0x1274('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1274('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1274('0x7')](0x5)[_0x1274('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1274('0x23')}};
\ No newline at end of file
+var _0x473b=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\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)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM'];(function(_0x402360,_0x348a93){var _0x8a9941=function(_0x102fea){while(--_0x102fea){_0x402360['push'](_0x402360['shift']());}};_0x8a9941(++_0x348a93);}(_0x473b,0x11a));var _0xb473=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x473b[_0xa6cc5c];return _0x44803d;};'use strict';var Sequelize=require(_0xb473('0x0'));module[_0xb473('0x1')]={'name':{'type':Sequelize[_0xb473('0x2')],'unique':_0xb473('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb473('0x4')](_0xb473('0x5')),'allowNull':![],'defaultValue':_0xb473('0x5')},'description':{'type':Sequelize[_0xb473('0x2')]},'active':{'type':Sequelize[_0xb473('0x6')],'defaultValue':0x0,'comment':_0xb473('0x7')},'limitCalls':{'type':Sequelize[_0xb473('0x8')](0x4)[_0xb473('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb473('0xa')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb473('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xb473('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb473('0x9')],'defaultValue':0x3,'comment':_0xb473('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0x11')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xb473('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb473('0x2')],'defaultValue':_0xb473('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xb473('0x13'),_0xb473('0x14'),_0xb473('0x15')),'defaultValue':_0xb473('0x13')},'dialAMDActive':{'type':Sequelize[_0xb473('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb473('0x8')](0x9)[_0xb473('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb473('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xb473('0x8')](0x9)[_0xb473('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb473('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb473('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb473('0x18')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb473('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb473('0x19')},'dialAMDMinWordLength':{'type':Sequelize[_0xb473('0x8')](0x9)[_0xb473('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb473('0x1a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb473('0x8')](0x9)[_0xb473('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb473('0x1b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb473('0x8')](0x9)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb473('0x1c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb473('0x1d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb473('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb473('0x4')](_0xb473('0x1e'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb473('0x1f')},'dialCutDigit':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb473('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0x24')},'dialMachineMaxRetry':{'type':Sequelize[_0xb473('0x8')](0x3)[_0xb473('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0x26')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb473('0x27')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb473('0x8')](0x5)[_0xb473('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb473('0x28')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index ab64b46..fadc9b1 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 _0xbe72=['offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','end','stack','name','send','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','options','includeAll','rows','catch','show','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','clone','params','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','pick','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json'];(function(_0x28b2f2,_0x5c45b6){var _0x51aa69=function(_0x3bc10f){while(--_0x3bc10f){_0x28b2f2['push'](_0x28b2f2['shift']());}};_0x51aa69(++_0x5c45b6);}(_0xbe72,0xf4));var _0x2be7=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xbe72[_0x5c3c0b];return _0x52ecd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2be7('0x0'));var zipdir=require(_0x2be7('0x1'));var jsonpatch=require(_0x2be7('0x2'));var rp=require('request-promise');var moment=require(_0x2be7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2be7('0x4'));var util=require(_0x2be7('0x5'));var path=require(_0x2be7('0x6'));var sox=require(_0x2be7('0x7'));var csv=require('to-csv');var ejs=require(_0x2be7('0x8'));var fs=require('fs');var fs_extra=require(_0x2be7('0x9'));var _=require(_0x2be7('0xa'));var squel=require('squel');var crypto=require(_0x2be7('0xb'));var jsforce=require(_0x2be7('0xc'));var deskjs=require(_0x2be7('0xd'));var toCsv=require(_0x2be7('0xe'));var querystring=require('querystring');var Papa=require(_0x2be7('0xf'));var Redis=require(_0x2be7('0x10'));var authService=require(_0x2be7('0x11'));var qs=require(_0x2be7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2be7('0x13'))(_0x2be7('0x14'));var utils=require(_0x2be7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2be7('0x16'));var db=require(_0x2be7('0x17'))['db'];function respondWithStatusCode(_0x387dd5,_0x2e15a2){_0x2e15a2=_0x2e15a2||0xcc;return function(_0x2ee522){if(_0x2ee522){return _0x387dd5['sendStatus'](_0x2e15a2);}return _0x387dd5[_0x2be7('0x18')](_0x2e15a2)['end']();};}function respondWithResult(_0x266877,_0x14bda5){_0x14bda5=_0x14bda5||0xc8;return function(_0x50c232){if(_0x50c232){return _0x266877['status'](_0x14bda5)[_0x2be7('0x19')](_0x50c232);}};}function respondWithFilteredResult(_0x2e879d,_0x24b0e6){return function(_0x1a9b80){if(_0x1a9b80){var _0x17e96b=typeof _0x24b0e6[_0x2be7('0x1a')]===_0x2be7('0x1b')&&typeof _0x24b0e6[_0x2be7('0x1c')]===_0x2be7('0x1b');var _0x362b72=_0x1a9b80[_0x2be7('0x1d')];var _0x4033cf=_0x17e96b?0x0:_0x24b0e6[_0x2be7('0x1a')];var _0x202479=_0x17e96b?_0x1a9b80[_0x2be7('0x1d')]:_0x24b0e6[_0x2be7('0x1a')]+_0x24b0e6[_0x2be7('0x1c')];var _0x2fbe83;if(_0x202479>=_0x362b72){_0x202479=_0x362b72;_0x2fbe83=0xc8;}else{_0x2fbe83=0xce;}_0x2e879d[_0x2be7('0x18')](_0x2fbe83);return _0x2e879d[_0x2be7('0x1e')](_0x2be7('0x1f'),_0x4033cf+'-'+_0x202479+'/'+_0x362b72)['json'](_0x1a9b80);}return null;};}function patchUpdates(_0x179905){return function(_0x3c5483){try{jsonpatch[_0x2be7('0x20')](_0x3c5483,_0x179905,!![]);}catch(_0x4c33a2){return BPromise['reject'](_0x4c33a2);}return _0x3c5483[_0x2be7('0x21')]();};}function saveUpdates(_0x240a12,_0x23b9d2){return function(_0x456efb){if(_0x456efb){return _0x456efb[_0x2be7('0x22')](_0x240a12)['then'](function(_0x42ce49){return _0x42ce49;});}return null;};}function removeEntity(_0x5cf822,_0x113885){return function(_0x4e3cf3){if(_0x4e3cf3){return _0x4e3cf3[_0x2be7('0x23')]()[_0x2be7('0x24')](function(){var _0x27e88a=_0x4e3cf3[_0x2be7('0x25')]({'plain':!![]});var _0x24082f=_0x2be7('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x24082f,'resourceId':_0x27e88a['id']}})['then'](function(){return _0x4e3cf3;});})['then'](function(){_0x5cf822['status'](0xcc)[_0x2be7('0x27')]();});}};}function handleEntityNotFound(_0x441c4a,_0x2dbd24){return function(_0x3c9e51){if(!_0x3c9e51){_0x441c4a['sendStatus'](0x194);}return _0x3c9e51;};}function handleError(_0x1ea5ee,_0x32bce1){_0x32bce1=_0x32bce1||0x1f4;return function(_0x17a4ae){logger['error'](_0x17a4ae[_0x2be7('0x28')]);if(_0x17a4ae[_0x2be7('0x29')]){delete _0x17a4ae[_0x2be7('0x29')];}_0x1ea5ee[_0x2be7('0x18')](_0x32bce1)[_0x2be7('0x2a')](_0x17a4ae);};}exports['index']=function(_0x4c0886,_0x312096){var _0x12a8e3={},_0x375d7a={},_0x3276da={'count':0x0,'rows':[]};var _0x1ef1eb=_['map'](db[_0x2be7('0x2b')][_0x2be7('0x2c')],function(_0x579f30){return{'name':_0x579f30[_0x2be7('0x2d')],'type':_0x579f30[_0x2be7('0x2e')][_0x2be7('0x2f')]};});_0x375d7a[_0x2be7('0x30')]=_[_0x2be7('0x31')](_0x1ef1eb,_0x2be7('0x29'));_0x375d7a[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x4c0886['query']);_0x375d7a[_0x2be7('0x34')]=_[_0x2be7('0x35')](_0x375d7a[_0x2be7('0x30')],_0x375d7a[_0x2be7('0x32')]);_0x12a8e3['attributes']=_[_0x2be7('0x35')](_0x375d7a['model'],qs['fields'](_0x4c0886[_0x2be7('0x32')][_0x2be7('0x36')]));_0x12a8e3['attributes']=_0x12a8e3[_0x2be7('0x37')][_0x2be7('0x38')]?_0x12a8e3[_0x2be7('0x37')]:_0x375d7a[_0x2be7('0x30')];if(!_0x4c0886[_0x2be7('0x32')]['hasOwnProperty']('nolimit')){_0x12a8e3['limit']=qs['limit'](_0x4c0886['query']['limit']);_0x12a8e3[_0x2be7('0x1a')]=qs[_0x2be7('0x1a')](_0x4c0886[_0x2be7('0x32')][_0x2be7('0x1a')]);}_0x12a8e3[_0x2be7('0x39')]=qs[_0x2be7('0x3a')](_0x4c0886[_0x2be7('0x32')][_0x2be7('0x3a')]);_0x12a8e3[_0x2be7('0x3b')]=qs[_0x2be7('0x34')](_['pick'](_0x4c0886[_0x2be7('0x32')],_0x375d7a[_0x2be7('0x34')]),_0x1ef1eb);if(_0x4c0886[_0x2be7('0x32')][_0x2be7('0x3c')]){_0x12a8e3['where']=_[_0x2be7('0x3d')](_0x12a8e3[_0x2be7('0x3b')],{'$or':_['map'](_0x1ef1eb,function(_0x4b9385){if(_0x4b9385['type']!=='VIRTUAL'){var _0xa12a5a={};_0xa12a5a[_0x4b9385[_0x2be7('0x29')]]={'$like':'%'+_0x4c0886[_0x2be7('0x32')]['filter']+'%'};return _0xa12a5a;}})});}_0x12a8e3=_[_0x2be7('0x3d')]({},_0x12a8e3,_0x4c0886[_0x2be7('0x3e')]);var _0x55ea50={'where':_0x12a8e3[_0x2be7('0x3b')]};return db[_0x2be7('0x2b')]['count'](_0x55ea50)[_0x2be7('0x24')](function(_0x40ef2d){_0x3276da[_0x2be7('0x1d')]=_0x40ef2d;if(_0x4c0886[_0x2be7('0x32')][_0x2be7('0x3f')]){_0x12a8e3['include']=[{'all':!![]}];}return db[_0x2be7('0x2b')]['findAll'](_0x12a8e3);})[_0x2be7('0x24')](function(_0x516189){_0x3276da[_0x2be7('0x40')]=_0x516189;return _0x3276da;})[_0x2be7('0x24')](respondWithFilteredResult(_0x312096,_0x12a8e3))[_0x2be7('0x41')](handleError(_0x312096,null));};exports[_0x2be7('0x42')]=function(_0x1b2be0,_0x5d3419){var _0x216218={'raw':![],'where':{'id':_0x1b2be0['params']['id']}},_0x2db05f={};_0x2db05f['model']=_[_0x2be7('0x33')](db[_0x2be7('0x2b')]['rawAttributes']);_0x2db05f[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x1b2be0[_0x2be7('0x32')]);_0x2db05f[_0x2be7('0x34')]=_[_0x2be7('0x35')](_0x2db05f[_0x2be7('0x30')],_0x2db05f['query']);_0x216218[_0x2be7('0x37')]=_[_0x2be7('0x35')](_0x2db05f[_0x2be7('0x30')],qs['fields'](_0x1b2be0[_0x2be7('0x32')][_0x2be7('0x36')]));_0x216218[_0x2be7('0x37')]=_0x216218[_0x2be7('0x37')][_0x2be7('0x38')]?_0x216218[_0x2be7('0x37')]:_0x2db05f[_0x2be7('0x30')];if(_0x1b2be0[_0x2be7('0x32')][_0x2be7('0x3f')]){_0x216218[_0x2be7('0x43')]=[{'all':!![]}];}_0x216218=_[_0x2be7('0x3d')]({},_0x216218,_0x1b2be0[_0x2be7('0x3e')]);return db[_0x2be7('0x2b')][_0x2be7('0x44')](_0x216218)[_0x2be7('0x24')](handleEntityNotFound(_0x5d3419,null))[_0x2be7('0x24')](respondWithResult(_0x5d3419,null))[_0x2be7('0x41')](handleError(_0x5d3419,null));};exports[_0x2be7('0x45')]=function(_0x1346f9,_0x361bf9){return db[_0x2be7('0x2b')][_0x2be7('0x45')](_0x1346f9['body'],{})[_0x2be7('0x24')](function(_0x1e26ed){var _0x202127=_0x1346f9['user']['get']({'plain':!![]});if(!_0x202127)throw new Error(_0x2be7('0x46'));if(_0x202127['role']===_0x2be7('0x47')){var _0x2bf1b4=_0x1e26ed['get']({'plain':!![]});var _0x27ef60=_0x2be7('0x26');return db[_0x2be7('0x48')]['find']({'where':{'name':_0x27ef60,'userProfileId':_0x202127['userProfileId']},'raw':!![]})[_0x2be7('0x24')](function(_0x1e73e1){if(_0x1e73e1&&_0x1e73e1[_0x2be7('0x49')]===0x0){return db[_0x2be7('0x4a')]['create']({'name':_0x2bf1b4[_0x2be7('0x29')],'resourceId':_0x2bf1b4['id'],'type':_0x1e73e1['name'],'sectionId':_0x1e73e1['id']},{})[_0x2be7('0x24')](function(){return _0x1e26ed;});}else{return _0x1e26ed;}})[_0x2be7('0x41')](function(_0x565c81){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x565c81);throw _0x565c81;});}return _0x1e26ed;})[_0x2be7('0x24')](respondWithResult(_0x361bf9,0xc9))[_0x2be7('0x41')](handleError(_0x361bf9,null));};exports[_0x2be7('0x4b')]=function(_0xe2b232,_0x3b0dea){var _0x40546c={'where':{'id':_0xe2b232[_0x2be7('0x4c')]['id']}},_0x28fc91={};_0x28fc91[_0x2be7('0x30')]=_[_0x2be7('0x33')](db['Campaign']['rawAttributes']);_0x40546c['attributes']=_['intersection'](_0x28fc91[_0x2be7('0x30')],qs[_0x2be7('0x36')](_0xe2b232[_0x2be7('0x32')][_0x2be7('0x36')]));_0x40546c[_0x2be7('0x37')]=_0x40546c[_0x2be7('0x37')][_0x2be7('0x38')]?_0x40546c[_0x2be7('0x37')]:_0x28fc91[_0x2be7('0x30')];if(_0xe2b232[_0x2be7('0x32')][_0x2be7('0x3f')]){_0x40546c[_0x2be7('0x43')]=[{'all':!![]}];}_0x40546c=_['merge']({},_0x40546c,_0xe2b232[_0x2be7('0x3e')]);return db[_0x2be7('0x2b')]['find'](_0x40546c)[_0x2be7('0x24')](handleEntityNotFound(_0x3b0dea,null))['then'](function(_0x1ca702){if(_0x1ca702){var _0xe985de=_0x1ca702[_0x2be7('0x25')]({'plain':!![]});_0xe985de=qs['omit'](_0xe985de,['id',_0x2be7('0x4d'),_0x2be7('0x4e')]);_0xe2b232[_0x2be7('0x4f')]=_['omit'](_0xe2b232[_0x2be7('0x4f')],['id',_0x2be7('0x4d'),_0x2be7('0x4e')]);return db[_0x2be7('0x2b')][_0x2be7('0x45')](_[_0x2be7('0x3d')](_0xe985de,_0xe2b232[_0x2be7('0x4f')]),{'include':_0xe2b232[_0x2be7('0x32')][_0x2be7('0x3f')]?[{'all':!![]}]:undefined})['then'](function(_0x1f9b03){var _0x2e68cc=_0xe2b232[_0x2be7('0x47')][_0x2be7('0x25')]({'plain':!![]});if(!_0x2e68cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e68cc['role']===_0x2be7('0x47')){var _0x75c42f=_0x1f9b03[_0x2be7('0x25')]({'plain':!![]});var _0x177fc1=_0x2be7('0x26');return db['UserProfileSection'][_0x2be7('0x44')]({'where':{'name':_0x177fc1,'userProfileId':_0x2e68cc['userProfileId']},'raw':!![]})[_0x2be7('0x24')](function(_0x581ea4){if(_0x581ea4&&_0x581ea4['autoAssociation']===0x0){return db[_0x2be7('0x4a')][_0x2be7('0x45')]({'name':_0x75c42f[_0x2be7('0x29')],'resourceId':_0x75c42f['id'],'type':_0x581ea4[_0x2be7('0x29')],'sectionId':_0x581ea4['id']},{})['then'](function(){return _0x1f9b03;});}else{return _0x1f9b03;}})[_0x2be7('0x41')](function(_0x2b262e){logger['error'](_0x2be7('0x50'),_0x2b262e);throw _0x2b262e;});}return _0x1f9b03;});}})[_0x2be7('0x24')](respondWithResult(_0x3b0dea,0xc9))[_0x2be7('0x41')](handleError(_0x3b0dea,null));};exports['update']=function(_0x449fe7,_0x118f16){if(_0x449fe7[_0x2be7('0x4f')]['id']){delete _0x449fe7[_0x2be7('0x4f')]['id'];}return db[_0x2be7('0x2b')][_0x2be7('0x44')]({'where':{'id':_0x449fe7[_0x2be7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x118f16,null))[_0x2be7('0x24')](saveUpdates(_0x449fe7['body'],null))[_0x2be7('0x24')](respondWithResult(_0x118f16,null))['catch'](handleError(_0x118f16,null));};exports['destroy']=function(_0x4084fd,_0x307122){return db[_0x2be7('0x2b')][_0x2be7('0x44')]({'where':{'id':_0x4084fd[_0x2be7('0x4c')]['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x307122,null))[_0x2be7('0x24')](removeEntity(_0x307122,null))[_0x2be7('0x41')](handleError(_0x307122,null));};exports[_0x2be7('0x51')]=function(_0x4bdf3b,_0x1360e0,_0x44b7e1){var _0x5afdeb={'raw':!![],'where':{}};var _0x456cbc={};var _0x322c42={'count':0x0,'rows':[]};return db['Campaign'][_0x2be7('0x52')]({'where':{'id':_0x4bdf3b[_0x2be7('0x4c')]['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x1360e0,null))[_0x2be7('0x24')](function(_0x3cae55){if(_0x3cae55){_0x456cbc['model']=_['keys'](db[_0x2be7('0x53')][_0x2be7('0x2c')]);_0x456cbc[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x4bdf3b[_0x2be7('0x32')]);_0x456cbc[_0x2be7('0x34')]=_[_0x2be7('0x35')](_0x456cbc[_0x2be7('0x30')],_0x456cbc[_0x2be7('0x32')]);_0x5afdeb[_0x2be7('0x37')]=_['intersection'](_0x456cbc[_0x2be7('0x30')],qs[_0x2be7('0x36')](_0x4bdf3b[_0x2be7('0x32')]['fields']));_0x5afdeb[_0x2be7('0x37')]=_0x5afdeb[_0x2be7('0x37')][_0x2be7('0x38')]?_0x5afdeb[_0x2be7('0x37')]:_0x456cbc[_0x2be7('0x30')];if(!_0x4bdf3b[_0x2be7('0x32')][_0x2be7('0x54')](_0x2be7('0x55'))){_0x5afdeb[_0x2be7('0x1c')]=qs['limit'](_0x4bdf3b[_0x2be7('0x32')]['limit']);_0x5afdeb['offset']=qs[_0x2be7('0x1a')](_0x4bdf3b[_0x2be7('0x32')][_0x2be7('0x1a')]);}_0x5afdeb[_0x2be7('0x39')]=qs['sort'](_0x4bdf3b[_0x2be7('0x32')][_0x2be7('0x3a')]);_0x5afdeb[_0x2be7('0x3b')]=qs[_0x2be7('0x34')](_[_0x2be7('0x56')](_0x4bdf3b[_0x2be7('0x32')],_0x456cbc[_0x2be7('0x34')]));_0x5afdeb[_0x2be7('0x3b')][_0x2be7('0x57')]=_0x3cae55['id'];if(_0x4bdf3b[_0x2be7('0x32')][_0x2be7('0x3c')]){_0x5afdeb[_0x2be7('0x3b')]=_['merge'](_0x5afdeb[_0x2be7('0x3b')],{'$or':_['map'](_0x5afdeb[_0x2be7('0x37')],function(_0x16c036){var _0x397e87={};_0x397e87[_0x16c036]={'$like':'%'+_0x4bdf3b[_0x2be7('0x32')][_0x2be7('0x3c')]+'%'};return _0x397e87;})});}_0x5afdeb=_[_0x2be7('0x3d')]({},_0x5afdeb,_0x4bdf3b['options']);return db[_0x2be7('0x53')]['count']({'where':_0x5afdeb[_0x2be7('0x3b')]})['then'](function(_0x6770a9){_0x322c42[_0x2be7('0x1d')]=_0x6770a9;if(_0x4bdf3b[_0x2be7('0x32')][_0x2be7('0x3f')]){_0x5afdeb[_0x2be7('0x43')]=[{'all':!![]}];}return db[_0x2be7('0x53')][_0x2be7('0x58')](_0x5afdeb);})[_0x2be7('0x24')](function(_0x16d869){_0x322c42[_0x2be7('0x40')]=_0x16d869;return _0x322c42;});}})[_0x2be7('0x24')](respondWithFilteredResult(_0x1360e0,_0x5afdeb))['catch'](handleError(_0x1360e0,null));};exports[_0x2be7('0x59')]=function(_0x26087c,_0x1ea470,_0x5aefb9){var _0x3e1089={'raw':!![],'where':{}};var _0x307754={};var _0x4959ee={'count':0x0,'rows':[]};return db[_0x2be7('0x2b')][_0x2be7('0x52')]({'where':{'id':_0x26087c[_0x2be7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ea470,null))[_0x2be7('0x24')](function(_0x175902){if(_0x175902){_0x307754['model']=_['keys'](db['CmHopperHistory'][_0x2be7('0x2c')]);_0x307754[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x26087c['query']);_0x307754[_0x2be7('0x34')]=_[_0x2be7('0x35')](_0x307754[_0x2be7('0x30')],_0x307754[_0x2be7('0x32')]);_0x3e1089[_0x2be7('0x37')]=_[_0x2be7('0x35')](_0x307754['model'],qs['fields'](_0x26087c[_0x2be7('0x32')]['fields']));_0x3e1089[_0x2be7('0x37')]=_0x3e1089[_0x2be7('0x37')][_0x2be7('0x38')]?_0x3e1089['attributes']:_0x307754[_0x2be7('0x30')];if(!_0x26087c[_0x2be7('0x32')][_0x2be7('0x54')](_0x2be7('0x55'))){_0x3e1089[_0x2be7('0x1c')]=qs[_0x2be7('0x1c')](_0x26087c[_0x2be7('0x32')][_0x2be7('0x1c')]);_0x3e1089[_0x2be7('0x1a')]=qs[_0x2be7('0x1a')](_0x26087c['query'][_0x2be7('0x1a')]);}_0x3e1089[_0x2be7('0x39')]=qs[_0x2be7('0x3a')](_0x26087c['query'][_0x2be7('0x3a')]);_0x3e1089[_0x2be7('0x3b')]=qs[_0x2be7('0x34')](_[_0x2be7('0x56')](_0x26087c[_0x2be7('0x32')],_0x307754[_0x2be7('0x34')]));_0x3e1089['where'][_0x2be7('0x57')]=_0x175902['id'];if(_0x26087c[_0x2be7('0x32')][_0x2be7('0x3c')]){_0x3e1089[_0x2be7('0x3b')]=_[_0x2be7('0x3d')](_0x3e1089[_0x2be7('0x3b')],{'$or':_[_0x2be7('0x31')](_0x3e1089['attributes'],function(_0x23e4d6){var _0x5d37e1={};_0x5d37e1[_0x23e4d6]={'$like':'%'+_0x26087c[_0x2be7('0x32')]['filter']+'%'};return _0x5d37e1;})});}_0x3e1089=_[_0x2be7('0x3d')]({},_0x3e1089,_0x26087c[_0x2be7('0x3e')]);return db['CmHopperHistory'][_0x2be7('0x1d')]({'where':_0x3e1089[_0x2be7('0x3b')]})['then'](function(_0xd7e3a6){_0x4959ee[_0x2be7('0x1d')]=_0xd7e3a6;if(_0x26087c[_0x2be7('0x32')][_0x2be7('0x3f')]){_0x3e1089[_0x2be7('0x43')]=[{'all':!![]}];}return db[_0x2be7('0x5a')][_0x2be7('0x58')](_0x3e1089);})['then'](function(_0x3e82e0){_0x4959ee[_0x2be7('0x40')]=_0x3e82e0;return _0x4959ee;});}})[_0x2be7('0x24')](respondWithFilteredResult(_0x1ea470,_0x3e1089))['catch'](handleError(_0x1ea470,null));};exports[_0x2be7('0x5b')]=function(_0x12393c,_0x4c0139,_0x4cf138){var _0x166f52={'raw':!![],'where':{}};var _0x5bd0c4={};var _0x4a09e8={'count':0x0,'rows':[]};return db[_0x2be7('0x2b')][_0x2be7('0x52')]({'where':{'id':_0x12393c[_0x2be7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c0139,null))[_0x2be7('0x24')](function(_0x551fe1){if(_0x551fe1){_0x5bd0c4[_0x2be7('0x30')]=_[_0x2be7('0x33')](db[_0x2be7('0x5c')][_0x2be7('0x2c')]);_0x5bd0c4[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x12393c['query']);_0x5bd0c4[_0x2be7('0x34')]=_[_0x2be7('0x35')](_0x5bd0c4['model'],_0x5bd0c4[_0x2be7('0x32')]);_0x166f52[_0x2be7('0x37')]=_[_0x2be7('0x35')](_0x5bd0c4[_0x2be7('0x30')],qs[_0x2be7('0x36')](_0x12393c[_0x2be7('0x32')][_0x2be7('0x36')]));_0x166f52['attributes']=_0x166f52[_0x2be7('0x37')][_0x2be7('0x38')]?_0x166f52[_0x2be7('0x37')]:_0x5bd0c4['model'];if(!_0x12393c[_0x2be7('0x32')][_0x2be7('0x54')](_0x2be7('0x55'))){_0x166f52[_0x2be7('0x1c')]=qs[_0x2be7('0x1c')](_0x12393c['query'][_0x2be7('0x1c')]);_0x166f52[_0x2be7('0x1a')]=qs['offset'](_0x12393c[_0x2be7('0x32')][_0x2be7('0x1a')]);}_0x166f52[_0x2be7('0x39')]=qs[_0x2be7('0x3a')](_0x12393c[_0x2be7('0x32')][_0x2be7('0x3a')]);_0x166f52[_0x2be7('0x3b')]=qs[_0x2be7('0x34')](_[_0x2be7('0x56')](_0x12393c['query'],_0x5bd0c4[_0x2be7('0x34')]));_0x166f52['where'][_0x2be7('0x57')]=_0x551fe1['id'];if(_0x12393c[_0x2be7('0x32')][_0x2be7('0x3c')]){_0x166f52[_0x2be7('0x3b')]=_['merge'](_0x166f52['where'],{'$or':_[_0x2be7('0x31')](_0x166f52['attributes'],function(_0xee061e){var _0x24dd77={};_0x24dd77[_0xee061e]={'$like':'%'+_0x12393c[_0x2be7('0x32')]['filter']+'%'};return _0x24dd77;})});}_0x166f52=_[_0x2be7('0x3d')]({},_0x166f52,_0x12393c[_0x2be7('0x3e')]);return db[_0x2be7('0x5c')][_0x2be7('0x1d')]({'where':_0x166f52['where']})[_0x2be7('0x24')](function(_0x4ce5ba){_0x4a09e8[_0x2be7('0x1d')]=_0x4ce5ba;if(_0x12393c[_0x2be7('0x32')]['includeAll']){_0x166f52[_0x2be7('0x43')]=[{'all':!![]}];}return db[_0x2be7('0x5c')][_0x2be7('0x58')](_0x166f52);})[_0x2be7('0x24')](function(_0x5d325a){_0x4a09e8[_0x2be7('0x40')]=_0x5d325a;return _0x4a09e8;});}})['then'](respondWithFilteredResult(_0x4c0139,_0x166f52))['catch'](handleError(_0x4c0139,null));};exports[_0x2be7('0x5d')]=function(_0x59fd75,_0xe0cb06,_0x4dc152){var _0x431b6a={'raw':!![],'where':{}};var _0x333a39={};var _0x1c821c={'count':0x0,'rows':[]};return db[_0x2be7('0x2b')][_0x2be7('0x52')]({'where':{'id':_0x59fd75[_0x2be7('0x4c')]['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0xe0cb06,null))['then'](function(_0x35d47f){if(_0x35d47f){_0x333a39[_0x2be7('0x30')]=_[_0x2be7('0x33')](db['CmHopperBlack'][_0x2be7('0x2c')]);_0x333a39['query']=_[_0x2be7('0x33')](_0x59fd75['query']);_0x333a39['filters']=_['intersection'](_0x333a39[_0x2be7('0x30')],_0x333a39['query']);_0x431b6a[_0x2be7('0x37')]=_[_0x2be7('0x35')](_0x333a39['model'],qs[_0x2be7('0x36')](_0x59fd75['query'][_0x2be7('0x36')]));_0x431b6a[_0x2be7('0x37')]=_0x431b6a[_0x2be7('0x37')]['length']?_0x431b6a['attributes']:_0x333a39[_0x2be7('0x30')];if(!_0x59fd75['query'][_0x2be7('0x54')](_0x2be7('0x55'))){_0x431b6a['limit']=qs[_0x2be7('0x1c')](_0x59fd75[_0x2be7('0x32')][_0x2be7('0x1c')]);_0x431b6a['offset']=qs[_0x2be7('0x1a')](_0x59fd75[_0x2be7('0x32')][_0x2be7('0x1a')]);}_0x431b6a[_0x2be7('0x39')]=qs[_0x2be7('0x3a')](_0x59fd75[_0x2be7('0x32')][_0x2be7('0x3a')]);_0x431b6a['where']=qs[_0x2be7('0x34')](_['pick'](_0x59fd75[_0x2be7('0x32')],_0x333a39[_0x2be7('0x34')]));_0x431b6a[_0x2be7('0x3b')][_0x2be7('0x57')]=_0x35d47f['id'];if(_0x59fd75[_0x2be7('0x32')]['filter']){_0x431b6a[_0x2be7('0x3b')]=_[_0x2be7('0x3d')](_0x431b6a[_0x2be7('0x3b')],{'$or':_[_0x2be7('0x31')](_0x431b6a[_0x2be7('0x37')],function(_0x620e58){var _0x10b757={};_0x10b757[_0x620e58]={'$like':'%'+_0x59fd75[_0x2be7('0x32')][_0x2be7('0x3c')]+'%'};return _0x10b757;})});}_0x431b6a=_[_0x2be7('0x3d')]({},_0x431b6a,_0x59fd75[_0x2be7('0x3e')]);return db[_0x2be7('0x5e')][_0x2be7('0x1d')]({'where':_0x431b6a['where']})[_0x2be7('0x24')](function(_0x5f0d10){_0x1c821c[_0x2be7('0x1d')]=_0x5f0d10;if(_0x59fd75[_0x2be7('0x32')][_0x2be7('0x3f')]){_0x431b6a['include']=[{'all':!![]}];}return db[_0x2be7('0x5e')][_0x2be7('0x58')](_0x431b6a);})[_0x2be7('0x24')](function(_0x36f68e){_0x1c821c[_0x2be7('0x40')]=_0x36f68e;return _0x1c821c;});}})[_0x2be7('0x24')](respondWithFilteredResult(_0xe0cb06,_0x431b6a))[_0x2be7('0x41')](handleError(_0xe0cb06,null));};exports[_0x2be7('0x5f')]=function(_0x4832a1,_0x4d03e5,_0x2d708b){var _0x174c4f={};var _0x3b65f7={};var _0x3ce945;var _0x2e50ba;return db[_0x2be7('0x2b')][_0x2be7('0x52')]({'where':{'id':_0x4832a1[_0x2be7('0x4c')]['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x4d03e5,null))[_0x2be7('0x24')](function(_0x142954){if(_0x142954){_0x3ce945=_0x142954;_0x3b65f7['model']=_['keys'](db[_0x2be7('0x60')][_0x2be7('0x2c')]);_0x3b65f7[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x4832a1[_0x2be7('0x32')]);_0x3b65f7[_0x2be7('0x34')]=_['intersection'](_0x3b65f7[_0x2be7('0x30')],_0x3b65f7[_0x2be7('0x32')]);_0x174c4f[_0x2be7('0x37')]=_['intersection'](_0x3b65f7[_0x2be7('0x30')],qs[_0x2be7('0x36')](_0x4832a1[_0x2be7('0x32')][_0x2be7('0x36')]));_0x174c4f[_0x2be7('0x37')]=_0x174c4f[_0x2be7('0x37')][_0x2be7('0x38')]?_0x174c4f[_0x2be7('0x37')]:_0x3b65f7[_0x2be7('0x30')];_0x174c4f['order']=qs[_0x2be7('0x3a')](_0x4832a1[_0x2be7('0x32')][_0x2be7('0x3a')]);_0x174c4f[_0x2be7('0x3b')]=qs[_0x2be7('0x34')](_[_0x2be7('0x56')](_0x4832a1[_0x2be7('0x32')],_0x3b65f7[_0x2be7('0x34')]));if(_0x4832a1[_0x2be7('0x32')][_0x2be7('0x3c')]){_0x174c4f[_0x2be7('0x3b')]=_[_0x2be7('0x3d')](_0x174c4f[_0x2be7('0x3b')],{'$or':_['map'](_0x174c4f[_0x2be7('0x37')],function(_0x31c5af){var _0x4265c3={};_0x4265c3[_0x31c5af]={'$like':'%'+_0x4832a1['query'][_0x2be7('0x3c')]+'%'};return _0x4265c3;})});}_0x174c4f=_[_0x2be7('0x3d')]({},_0x174c4f,_0x4832a1['options']);return _0x3ce945['getLists'](_0x174c4f);}})[_0x2be7('0x24')](function(_0x1fb344){if(_0x1fb344){_0x2e50ba=_0x1fb344[_0x2be7('0x38')];if(!_0x4832a1[_0x2be7('0x32')][_0x2be7('0x54')]('nolimit')){_0x174c4f[_0x2be7('0x1c')]=qs[_0x2be7('0x1c')](_0x4832a1[_0x2be7('0x32')][_0x2be7('0x1c')]);_0x174c4f[_0x2be7('0x1a')]=qs[_0x2be7('0x1a')](_0x4832a1[_0x2be7('0x32')][_0x2be7('0x1a')]);}return _0x3ce945[_0x2be7('0x5f')](_0x174c4f);}})[_0x2be7('0x24')](function(_0x49ef37){if(_0x49ef37){return _0x49ef37?{'count':_0x2e50ba,'rows':_0x49ef37}:null;}})[_0x2be7('0x24')](respondWithResult(_0x4d03e5,null))[_0x2be7('0x41')](handleError(_0x4d03e5,null));};exports[_0x2be7('0x61')]=function(_0x3b1146,_0x1885a4,_0x494380){var _0x23c775,_0x35f56b;return db['Campaign'][_0x2be7('0x44')]({'where':{'id':_0x3b1146[_0x2be7('0x4c')]['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x1885a4,null))[_0x2be7('0x24')](function(_0x2e4ae8){if(_0x2e4ae8){_0x35f56b=_0x2e4ae8;return _0x2e4ae8[_0x2be7('0x61')](_0x3b1146[_0x2be7('0x4f')][_0x2be7('0x62')],_[_0x2be7('0x63')](_0x3b1146['body'],['ids','id'])||{});}return null;})[_0x2be7('0x64')](function(_0x1141d2){var _0x22fdf4;_0x23c775=_0x1141d2||[];var _0x2711a9=[];if(_0x1141d2){for(var _0x847256=0x0;_0x847256<_0x1141d2['length'];_0x847256+=0x1){var _0x2dec55=_0x1141d2[_0x847256]['get']({'plain':!![]});_0x35f56b[_0x2be7('0x65')]=_0x3b1146[_0x2be7('0x4f')][_0x2be7('0x65')]?_0x3b1146[_0x2be7('0x4f')][_0x2be7('0x65')]:_0x35f56b[_0x2be7('0x65')];switch(_0x35f56b[_0x2be7('0x65')]){case _0x2be7('0x66'):_0x22fdf4=squel[_0x2be7('0x67')]()[_0x2be7('0x68')](_0x2be7('0x69'))[_0x2be7('0x6a')]([_0x2be7('0x6b'),_0x2be7('0x6c'),_0x2be7('0x6d'),_0x2be7('0x6e'),_0x2be7('0x57'),_0x2be7('0x4d'),'updatedAt'],squel[_0x2be7('0x6f')]()[_0x2be7('0x70')](_0x2be7('0x6b'),_0x2be7('0x6b'))[_0x2be7('0x70')]('NOW()',_0x2be7('0x6c'))[_0x2be7('0x70')]('id',_0x2be7('0x6d'))['field'](_0x2dec55['CmListId'][_0x2be7('0x71')](),'ListId')[_0x2be7('0x70')](_0x3b1146[_0x2be7('0x4c')]['id'][_0x2be7('0x71')](),_0x2be7('0x57'))[_0x2be7('0x70')]('NOW()','createdAt')[_0x2be7('0x70')](_0x2be7('0x72'),_0x2be7('0x4e'))[_0x2be7('0x73')](_0x2be7('0x74'))[_0x2be7('0x3b')](_0x2be7('0x75'))['where'](_0x2be7('0x76'),_0x2dec55[_0x2be7('0x77')][_0x2be7('0x71')]())[_0x2be7('0x3b')](_0x2be7('0x78'))[_0x2be7('0x3b')](_0x2be7('0x79'),squel[_0x2be7('0x6f')]()[_0x2be7('0x70')](_0x2be7('0x7a'))[_0x2be7('0x73')](_0x2be7('0x7b'))[_0x2be7('0x3b')](_0x2be7('0x7c'),_0x3b1146[_0x2be7('0x4c')]['id']['toString']()))[_0x2be7('0x3b')](_0x2be7('0x79'),squel[_0x2be7('0x6f')]()[_0x2be7('0x70')]('COALESCE(phone,\x27\x27)')[_0x2be7('0x73')](_0x2be7('0x69'))['where'](_0x2be7('0x7c'),_0x3b1146[_0x2be7('0x4c')]['id']['toString']())))['toString']();break;case _0x2be7('0x7d'):_0x22fdf4=squel[_0x2be7('0x67')]()['into'](_0x2be7('0x69'))[_0x2be7('0x6a')]([_0x2be7('0x6b'),_0x2be7('0x6c'),_0x2be7('0x6d'),'ListId','CampaignId',_0x2be7('0x4d'),_0x2be7('0x4e')],squel[_0x2be7('0x6f')]()['field'](_0x2be7('0x6b'),_0x2be7('0x6b'))[_0x2be7('0x70')]('NOW()','scheduledAt')[_0x2be7('0x70')]('id',_0x2be7('0x6d'))['field'](_0x2dec55[_0x2be7('0x77')][_0x2be7('0x71')](),_0x2be7('0x6e'))[_0x2be7('0x70')](_0x3b1146[_0x2be7('0x4c')]['id'][_0x2be7('0x71')](),'CampaignId')[_0x2be7('0x70')](_0x2be7('0x72'),_0x2be7('0x4d'))[_0x2be7('0x70')](_0x2be7('0x72'),_0x2be7('0x4e'))[_0x2be7('0x73')]('cm_contacts')[_0x2be7('0x3b')]('deletedAt\x20IS\x20NULL')[_0x2be7('0x3b')](_0x2be7('0x76'),_0x2dec55[_0x2be7('0x77')][_0x2be7('0x71')]())[_0x2be7('0x3b')](_0x2be7('0x78'))[_0x2be7('0x3b')](_0x2be7('0x79'),squel[_0x2be7('0x6f')]()[_0x2be7('0x70')](_0x2be7('0x7e'))[_0x2be7('0x73')]('cm_hopper')[_0x2be7('0x3b')](_0x2be7('0x7c'),_0x3b1146[_0x2be7('0x4c')]['id'][_0x2be7('0x71')]())))['toString']();break;default:_0x22fdf4=squel[_0x2be7('0x67')]()['into']('cm_hopper')['fromQuery']([_0x2be7('0x6b'),_0x2be7('0x6c'),_0x2be7('0x6d'),_0x2be7('0x6e'),_0x2be7('0x57'),_0x2be7('0x4d'),_0x2be7('0x4e')],squel[_0x2be7('0x6f')]()['field'](_0x2be7('0x6b'),'phone')[_0x2be7('0x70')]('NOW()',_0x2be7('0x6c'))[_0x2be7('0x70')]('id',_0x2be7('0x6d'))['field'](_0x2dec55[_0x2be7('0x77')]['toString'](),_0x2be7('0x6e'))['field'](_0x3b1146[_0x2be7('0x4c')]['id'][_0x2be7('0x71')](),_0x2be7('0x57'))[_0x2be7('0x70')]('NOW()',_0x2be7('0x4d'))['field'](_0x2be7('0x72'),_0x2be7('0x4e'))[_0x2be7('0x73')](_0x2be7('0x74'))[_0x2be7('0x3b')](_0x2be7('0x75'))[_0x2be7('0x3b')](_0x2be7('0x76'),_0x2dec55[_0x2be7('0x77')][_0x2be7('0x71')]())[_0x2be7('0x3b')](_0x2be7('0x78')))[_0x2be7('0x71')]();}_0x2711a9[_0x2be7('0x7f')](db[_0x2be7('0x80')][_0x2be7('0x32')](_0x22fdf4));}return BPromise['all'](_0x2711a9);}})[_0x2be7('0x24')](function(){return _0x23c775;})[_0x2be7('0x24')](respondWithResult(_0x1885a4,null))[_0x2be7('0x41')](handleError(_0x1885a4,null));};exports[_0x2be7('0x81')]=function(_0x5ef377,_0x335986,_0x280d21){return db[_0x2be7('0x2b')][_0x2be7('0x44')]({'where':{'id':_0x5ef377['params']['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x335986,null))[_0x2be7('0x24')](function(_0xd09e0b){if(_0xd09e0b){return _0xd09e0b['removeLists'](_0x5ef377[_0x2be7('0x32')]['ids']);}})['then'](function(_0x848cef){if(_0x848cef){return db['CmHopper'][_0x2be7('0x23')]({'where':{'ListId':_0x5ef377[_0x2be7('0x32')]['ids'],'CampaignId':_0x5ef377['params']['id']}})[_0x2be7('0x24')](function(){return _0x848cef;});}})['then'](respondWithStatusCode(_0x335986,null))[_0x2be7('0x41')](handleError(_0x335986,null));};exports[_0x2be7('0x82')]=function(_0x341edc,_0x2c6484,_0x4fb989){var _0x16a350={};var _0x42305e={};var _0x3f4d9b;var _0x1efa06;return db[_0x2be7('0x2b')][_0x2be7('0x52')]({'where':{'id':_0x341edc['params']['id']}})['then'](handleEntityNotFound(_0x2c6484,null))['then'](function(_0x413003){if(_0x413003){_0x3f4d9b=_0x413003;_0x42305e[_0x2be7('0x30')]=_[_0x2be7('0x33')](db[_0x2be7('0x60')][_0x2be7('0x2c')]);_0x42305e[_0x2be7('0x32')]=_[_0x2be7('0x33')](_0x341edc['query']);_0x42305e[_0x2be7('0x34')]=_['intersection'](_0x42305e['model'],_0x42305e[_0x2be7('0x32')]);_0x16a350[_0x2be7('0x37')]=_[_0x2be7('0x35')](_0x42305e['model'],qs[_0x2be7('0x36')](_0x341edc[_0x2be7('0x32')][_0x2be7('0x36')]));_0x16a350[_0x2be7('0x37')]=_0x16a350[_0x2be7('0x37')][_0x2be7('0x38')]?_0x16a350[_0x2be7('0x37')]:_0x42305e[_0x2be7('0x30')];_0x16a350['order']=qs[_0x2be7('0x3a')](_0x341edc[_0x2be7('0x32')][_0x2be7('0x3a')]);_0x16a350[_0x2be7('0x3b')]=qs[_0x2be7('0x34')](_[_0x2be7('0x56')](_0x341edc[_0x2be7('0x32')],_0x42305e[_0x2be7('0x34')]));if(_0x341edc[_0x2be7('0x32')][_0x2be7('0x3c')]){_0x16a350[_0x2be7('0x3b')]=_[_0x2be7('0x3d')](_0x16a350['where'],{'$or':_[_0x2be7('0x31')](_0x16a350['attributes'],function(_0x52ca73){var _0x54af26={};_0x54af26[_0x52ca73]={'$like':'%'+_0x341edc[_0x2be7('0x32')][_0x2be7('0x3c')]+'%'};return _0x54af26;})});}_0x16a350=_[_0x2be7('0x3d')]({},_0x16a350,_0x341edc['options']);return _0x3f4d9b['getBlackLists'](_0x16a350);}})[_0x2be7('0x24')](function(_0x592927){if(_0x592927){_0x1efa06=_0x592927['length'];if(!_0x341edc[_0x2be7('0x32')][_0x2be7('0x54')](_0x2be7('0x55'))){_0x16a350[_0x2be7('0x1c')]=qs['limit'](_0x341edc[_0x2be7('0x32')][_0x2be7('0x1c')]);_0x16a350[_0x2be7('0x1a')]=qs[_0x2be7('0x1a')](_0x341edc[_0x2be7('0x32')][_0x2be7('0x1a')]);}return _0x3f4d9b[_0x2be7('0x82')](_0x16a350);}})['then'](function(_0x493b67){if(_0x493b67){return _0x493b67?{'count':_0x1efa06,'rows':_0x493b67}:null;}})[_0x2be7('0x24')](respondWithResult(_0x2c6484,null))['catch'](handleError(_0x2c6484,null));};exports[_0x2be7('0x83')]=function(_0x44f59f,_0x184a1c,_0x190a93){var _0x28bb4b,_0x1c9397;return db[_0x2be7('0x2b')][_0x2be7('0x44')]({'where':{'id':_0x44f59f[_0x2be7('0x4c')]['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x184a1c,null))['then'](function(_0x34da78){if(_0x34da78){_0x1c9397=_0x34da78;return _0x34da78[_0x2be7('0x83')](_0x44f59f['body'][_0x2be7('0x62')],_[_0x2be7('0x63')](_0x44f59f['body'],[_0x2be7('0x62'),'id'])||{});}return null;})[_0x2be7('0x64')](function(_0x5f510a){var _0x3d253c;_0x28bb4b=_0x5f510a||[];var _0x4c62fe=[];if(_0x5f510a){for(var _0x384dd2=0x0;_0x384dd2<_0x5f510a[_0x2be7('0x38')];_0x384dd2+=0x1){var _0x577781=_0x5f510a[_0x384dd2][_0x2be7('0x25')]({'plain':!![]});_0x3d253c=squel[_0x2be7('0x67')]()[_0x2be7('0x68')](_0x2be7('0x84'))[_0x2be7('0x6a')]([_0x2be7('0x6b'),_0x2be7('0x6d'),_0x2be7('0x6e'),'CampaignId',_0x2be7('0x4d'),'updatedAt'],squel[_0x2be7('0x6f')]()[_0x2be7('0x70')](_0x2be7('0x6b'),_0x2be7('0x6b'))[_0x2be7('0x70')]('id','ContactId')[_0x2be7('0x70')](_0x577781[_0x2be7('0x77')][_0x2be7('0x71')](),_0x2be7('0x6e'))['field'](_0x44f59f[_0x2be7('0x4c')]['id'][_0x2be7('0x71')](),_0x2be7('0x57'))[_0x2be7('0x70')](_0x2be7('0x72'),_0x2be7('0x4d'))[_0x2be7('0x70')]('NOW()','updatedAt')[_0x2be7('0x73')](_0x2be7('0x74'))[_0x2be7('0x3b')](_0x2be7('0x75'))['where'](_0x2be7('0x76'),_0x577781['CmListId'][_0x2be7('0x71')]())['where'](_0x2be7('0x78')))[_0x2be7('0x71')]();_0x4c62fe[_0x2be7('0x7f')](db[_0x2be7('0x80')][_0x2be7('0x32')](_0x3d253c));}return BPromise[_0x2be7('0x85')](_0x4c62fe);}})[_0x2be7('0x24')](function(){return _0x28bb4b;})[_0x2be7('0x24')](respondWithResult(_0x184a1c,null))[_0x2be7('0x41')](handleError(_0x184a1c,null));};exports['removeBlackLists']=function(_0x319213,_0x1e8de1,_0x214375){return db['Campaign'][_0x2be7('0x44')]({'where':{'id':_0x319213['params']['id']}})[_0x2be7('0x24')](handleEntityNotFound(_0x1e8de1,null))[_0x2be7('0x24')](function(_0x2cd476){if(_0x2cd476){return _0x2cd476[_0x2be7('0x86')](_0x319213['query']['ids']);}})[_0x2be7('0x24')](function(_0x3bc67e){if(_0x3bc67e){return db['CmHopperBlack'][_0x2be7('0x23')]({'where':{'ListId':_0x319213['query'][_0x2be7('0x62')],'CampaignId':_0x319213['params']['id']}})[_0x2be7('0x24')](function(){return _0x3bc67e;});}})[_0x2be7('0x24')](respondWithStatusCode(_0x1e8de1,null))[_0x2be7('0x41')](handleError(_0x1e8de1,null));};
\ No newline at end of file
+var _0x53fb=['lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','error','name','send','index','map','Campaign','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','user','get','role','IvrCampaigns','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','push','sequelize','removeLists','getBlackLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xd73c75,_0x2a023b){var _0x1cb520=function(_0x16bff0){while(--_0x16bff0){_0xd73c75['push'](_0xd73c75['shift']());}};_0x1cb520(++_0x2a023b);}(_0x53fb,0x19d));var _0xb53f=function(_0x43ab5f,_0x358ba8){_0x43ab5f=_0x43ab5f-0x0;var _0x1c952b=_0x53fb[_0x43ab5f];return _0x1c952b;};'use strict';var emlformat=require(_0xb53f('0x0'));var rimraf=require(_0xb53f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb53f('0x2'));var rp=require(_0xb53f('0x3'));var moment=require(_0xb53f('0x4'));var BPromise=require(_0xb53f('0x5'));var Mustache=require(_0xb53f('0x6'));var util=require(_0xb53f('0x7'));var path=require(_0xb53f('0x8'));var sox=require(_0xb53f('0x9'));var csv=require(_0xb53f('0xa'));var ejs=require(_0xb53f('0xb'));var fs=require('fs');var fs_extra=require(_0xb53f('0xc'));var _=require(_0xb53f('0xd'));var squel=require(_0xb53f('0xe'));var crypto=require(_0xb53f('0xf'));var jsforce=require(_0xb53f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb53f('0xa'));var querystring=require(_0xb53f('0x11'));var Papa=require(_0xb53f('0x12'));var Redis=require(_0xb53f('0x13'));var authService=require(_0xb53f('0x14'));var qs=require(_0xb53f('0x15'));var as=require(_0xb53f('0x16'));var hardwareService=require(_0xb53f('0x17'));var logger=require(_0xb53f('0x18'))(_0xb53f('0x19'));var utils=require(_0xb53f('0x1a'));var config=require(_0xb53f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xb53f('0x1c'))['db'];function respondWithStatusCode(_0x47b95b,_0x4a16e0){_0x4a16e0=_0x4a16e0||0xcc;return function(_0x1c1210){if(_0x1c1210){return _0x47b95b[_0xb53f('0x1d')](_0x4a16e0);}return _0x47b95b[_0xb53f('0x1e')](_0x4a16e0)[_0xb53f('0x1f')]();};}function respondWithResult(_0x5ac2a3,_0x38c177){_0x38c177=_0x38c177||0xc8;return function(_0x321d3c){if(_0x321d3c){return _0x5ac2a3[_0xb53f('0x1e')](_0x38c177)[_0xb53f('0x20')](_0x321d3c);}};}function respondWithFilteredResult(_0x3065a8,_0x3a8592){return function(_0x42d57a){if(_0x42d57a){var _0x551e99=typeof _0x3a8592[_0xb53f('0x21')]===_0xb53f('0x22')&&typeof _0x3a8592[_0xb53f('0x23')]===_0xb53f('0x22');var _0x2f4101=_0x42d57a['count'];var _0x38b35a=_0x551e99?0x0:_0x3a8592[_0xb53f('0x21')];var _0x142b67=_0x551e99?_0x42d57a[_0xb53f('0x24')]:_0x3a8592['offset']+_0x3a8592[_0xb53f('0x23')];var _0x25d3f0;if(_0x142b67>=_0x2f4101){_0x142b67=_0x2f4101;_0x25d3f0=0xc8;}else{_0x25d3f0=0xce;}_0x3065a8[_0xb53f('0x1e')](_0x25d3f0);return _0x3065a8['set'](_0xb53f('0x25'),_0x38b35a+'-'+_0x142b67+'/'+_0x2f4101)[_0xb53f('0x20')](_0x42d57a);}return null;};}function patchUpdates(_0x44404a){return function(_0x31a676){try{jsonpatch[_0xb53f('0x26')](_0x31a676,_0x44404a,!![]);}catch(_0x5cb9eb){return BPromise[_0xb53f('0x27')](_0x5cb9eb);}return _0x31a676[_0xb53f('0x28')]();};}function saveUpdates(_0x21092c,_0x5d0296){return function(_0x5309ad){if(_0x5309ad){return _0x5309ad[_0xb53f('0x29')](_0x21092c)['then'](function(_0x1e089c){return _0x1e089c;});}return null;};}function removeEntity(_0x4306ee,_0x17190a){return function(_0x2f5327){if(_0x2f5327){return _0x2f5327[_0xb53f('0x2a')]()[_0xb53f('0x2b')](function(){var _0x136618=_0x2f5327['get']({'plain':!![]});var _0x3af620='IvrCampaigns';return db[_0xb53f('0x2c')]['destroy']({'where':{'type':_0x3af620,'resourceId':_0x136618['id']}})[_0xb53f('0x2b')](function(){return _0x2f5327;});})[_0xb53f('0x2b')](function(){_0x4306ee[_0xb53f('0x1e')](0xcc)[_0xb53f('0x1f')]();});}};}function handleEntityNotFound(_0x3aaf50,_0x57c0df){return function(_0x148e10){if(!_0x148e10){_0x3aaf50['sendStatus'](0x194);}return _0x148e10;};}function handleError(_0x2ed22f,_0x2fd439){_0x2fd439=_0x2fd439||0x1f4;return function(_0xfda78b){logger[_0xb53f('0x2d')](_0xfda78b['stack']);if(_0xfda78b[_0xb53f('0x2e')]){delete _0xfda78b[_0xb53f('0x2e')];}_0x2ed22f[_0xb53f('0x1e')](_0x2fd439)[_0xb53f('0x2f')](_0xfda78b);};}exports[_0xb53f('0x30')]=function(_0x53c013,_0x34eea7){var _0x22252e={},_0x589ff5={},_0x2f6e79={'count':0x0,'rows':[]};var _0x49e36b=_[_0xb53f('0x31')](db[_0xb53f('0x32')]['rawAttributes'],function(_0x1731c4){return{'name':_0x1731c4['fieldName'],'type':_0x1731c4[_0xb53f('0x33')][_0xb53f('0x34')]};});_0x589ff5[_0xb53f('0x35')]=_[_0xb53f('0x31')](_0x49e36b,'name');_0x589ff5[_0xb53f('0x36')]=_[_0xb53f('0x37')](_0x53c013[_0xb53f('0x36')]);_0x589ff5[_0xb53f('0x38')]=_[_0xb53f('0x39')](_0x589ff5[_0xb53f('0x35')],_0x589ff5[_0xb53f('0x36')]);_0x22252e['attributes']=_[_0xb53f('0x39')](_0x589ff5[_0xb53f('0x35')],qs[_0xb53f('0x3a')](_0x53c013['query']['fields']));_0x22252e[_0xb53f('0x3b')]=_0x22252e['attributes']['length']?_0x22252e[_0xb53f('0x3b')]:_0x589ff5[_0xb53f('0x35')];if(!_0x53c013['query'][_0xb53f('0x3c')](_0xb53f('0x3d'))){_0x22252e[_0xb53f('0x23')]=qs[_0xb53f('0x23')](_0x53c013[_0xb53f('0x36')][_0xb53f('0x23')]);_0x22252e['offset']=qs[_0xb53f('0x21')](_0x53c013[_0xb53f('0x36')][_0xb53f('0x21')]);}_0x22252e[_0xb53f('0x3e')]=qs[_0xb53f('0x3f')](_0x53c013[_0xb53f('0x36')][_0xb53f('0x3f')]);_0x22252e[_0xb53f('0x40')]=qs[_0xb53f('0x38')](_[_0xb53f('0x41')](_0x53c013[_0xb53f('0x36')],_0x589ff5[_0xb53f('0x38')]),_0x49e36b);if(_0x53c013[_0xb53f('0x36')][_0xb53f('0x42')]){_0x22252e[_0xb53f('0x40')]=_[_0xb53f('0x43')](_0x22252e[_0xb53f('0x40')],{'$or':_['map'](_0x49e36b,function(_0x53d4fc){if(_0x53d4fc['type']!=='VIRTUAL'){var _0x48b760={};_0x48b760[_0x53d4fc['name']]={'$like':'%'+_0x53c013['query']['filter']+'%'};return _0x48b760;}})});}_0x22252e=_['merge']({},_0x22252e,_0x53c013[_0xb53f('0x44')]);var _0xfb058d={'where':_0x22252e[_0xb53f('0x40')]};return db[_0xb53f('0x32')][_0xb53f('0x24')](_0xfb058d)[_0xb53f('0x2b')](function(_0xced5d2){_0x2f6e79[_0xb53f('0x24')]=_0xced5d2;if(_0x53c013['query'][_0xb53f('0x45')]){_0x22252e[_0xb53f('0x46')]=[{'all':!![]}];}return db[_0xb53f('0x32')][_0xb53f('0x47')](_0x22252e);})[_0xb53f('0x2b')](function(_0x4bf8ea){_0x2f6e79[_0xb53f('0x48')]=_0x4bf8ea;return _0x2f6e79;})[_0xb53f('0x2b')](respondWithFilteredResult(_0x34eea7,_0x22252e))[_0xb53f('0x49')](handleError(_0x34eea7,null));};exports[_0xb53f('0x4a')]=function(_0x980d4e,_0x4b6473){var _0x8079e5={'raw':![],'where':{'id':_0x980d4e[_0xb53f('0x4b')]['id']}},_0x45ce4e={};_0x45ce4e[_0xb53f('0x35')]=_[_0xb53f('0x37')](db[_0xb53f('0x32')][_0xb53f('0x4c')]);_0x45ce4e[_0xb53f('0x36')]=_[_0xb53f('0x37')](_0x980d4e[_0xb53f('0x36')]);_0x45ce4e[_0xb53f('0x38')]=_[_0xb53f('0x39')](_0x45ce4e[_0xb53f('0x35')],_0x45ce4e['query']);_0x8079e5[_0xb53f('0x3b')]=_[_0xb53f('0x39')](_0x45ce4e['model'],qs['fields'](_0x980d4e[_0xb53f('0x36')]['fields']));_0x8079e5[_0xb53f('0x3b')]=_0x8079e5[_0xb53f('0x3b')][_0xb53f('0x4d')]?_0x8079e5[_0xb53f('0x3b')]:_0x45ce4e[_0xb53f('0x35')];if(_0x980d4e[_0xb53f('0x36')][_0xb53f('0x45')]){_0x8079e5[_0xb53f('0x46')]=[{'all':!![]}];}_0x8079e5=_[_0xb53f('0x43')]({},_0x8079e5,_0x980d4e[_0xb53f('0x44')]);return db['Campaign'][_0xb53f('0x4e')](_0x8079e5)[_0xb53f('0x2b')](handleEntityNotFound(_0x4b6473,null))[_0xb53f('0x2b')](respondWithResult(_0x4b6473,null))[_0xb53f('0x49')](handleError(_0x4b6473,null));};exports[_0xb53f('0x4f')]=function(_0x2983ce,_0x116a3d){return db[_0xb53f('0x32')]['create'](_0x2983ce[_0xb53f('0x50')],{})[_0xb53f('0x2b')](function(_0x320b28){var _0x284a81=_0x2983ce[_0xb53f('0x51')][_0xb53f('0x52')]({'plain':!![]});if(!_0x284a81)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x284a81[_0xb53f('0x53')]==='user'){var _0x3461c9=_0x320b28[_0xb53f('0x52')]({'plain':!![]});var _0x519574=_0xb53f('0x54');return db['UserProfileSection'][_0xb53f('0x4e')]({'where':{'name':_0x519574,'userProfileId':_0x284a81[_0xb53f('0x55')]},'raw':!![]})[_0xb53f('0x2b')](function(_0x4cea40){if(_0x4cea40&&_0x4cea40[_0xb53f('0x56')]===0x0){return db[_0xb53f('0x2c')]['create']({'name':_0x3461c9[_0xb53f('0x2e')],'resourceId':_0x3461c9['id'],'type':_0x4cea40[_0xb53f('0x2e')],'sectionId':_0x4cea40['id']},{})[_0xb53f('0x2b')](function(){return _0x320b28;});}else{return _0x320b28;}})['catch'](function(_0x384410){logger[_0xb53f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x384410);throw _0x384410;});}return _0x320b28;})[_0xb53f('0x2b')](respondWithResult(_0x116a3d,0xc9))['catch'](handleError(_0x116a3d,null));};exports[_0xb53f('0x57')]=function(_0x549ac3,_0x4c3ee1){var _0x1b47a5={'where':{'id':_0x549ac3[_0xb53f('0x4b')]['id']}},_0x274d15={};_0x274d15['model']=_[_0xb53f('0x37')](db[_0xb53f('0x32')][_0xb53f('0x4c')]);_0x1b47a5[_0xb53f('0x3b')]=_['intersection'](_0x274d15[_0xb53f('0x35')],qs[_0xb53f('0x3a')](_0x549ac3['query'][_0xb53f('0x3a')]));_0x1b47a5[_0xb53f('0x3b')]=_0x1b47a5['attributes'][_0xb53f('0x4d')]?_0x1b47a5['attributes']:_0x274d15[_0xb53f('0x35')];if(_0x549ac3[_0xb53f('0x36')]['includeAll']){_0x1b47a5[_0xb53f('0x46')]=[{'all':!![]}];}_0x1b47a5=_[_0xb53f('0x43')]({},_0x1b47a5,_0x549ac3[_0xb53f('0x44')]);return db[_0xb53f('0x32')][_0xb53f('0x4e')](_0x1b47a5)[_0xb53f('0x2b')](handleEntityNotFound(_0x4c3ee1,null))[_0xb53f('0x2b')](function(_0x39b5f6){if(_0x39b5f6){var _0x2f08fb=_0x39b5f6[_0xb53f('0x52')]({'plain':!![]});_0x2f08fb=qs[_0xb53f('0x58')](_0x2f08fb,['id','createdAt',_0xb53f('0x59')]);_0x549ac3['body']=_[_0xb53f('0x58')](_0x549ac3[_0xb53f('0x50')],['id',_0xb53f('0x5a'),_0xb53f('0x59')]);return db[_0xb53f('0x32')][_0xb53f('0x4f')](_[_0xb53f('0x43')](_0x2f08fb,_0x549ac3[_0xb53f('0x50')]),{'include':_0x549ac3['query'][_0xb53f('0x45')]?[{'all':!![]}]:undefined})[_0xb53f('0x2b')](function(_0x3bc5dd){var _0x599e5e=_0x549ac3[_0xb53f('0x51')][_0xb53f('0x52')]({'plain':!![]});if(!_0x599e5e)throw new Error(_0xb53f('0x5b'));if(_0x599e5e[_0xb53f('0x53')]===_0xb53f('0x51')){var _0x43c7c1=_0x3bc5dd[_0xb53f('0x52')]({'plain':!![]});var _0x5c255b=_0xb53f('0x54');return db[_0xb53f('0x5c')][_0xb53f('0x4e')]({'where':{'name':_0x5c255b,'userProfileId':_0x599e5e[_0xb53f('0x55')]},'raw':!![]})[_0xb53f('0x2b')](function(_0x22e578){if(_0x22e578&&_0x22e578[_0xb53f('0x56')]===0x0){return db[_0xb53f('0x2c')][_0xb53f('0x4f')]({'name':_0x43c7c1[_0xb53f('0x2e')],'resourceId':_0x43c7c1['id'],'type':_0x22e578[_0xb53f('0x2e')],'sectionId':_0x22e578['id']},{})[_0xb53f('0x2b')](function(){return _0x3bc5dd;});}else{return _0x3bc5dd;}})[_0xb53f('0x49')](function(_0x5937ee){logger['error'](_0xb53f('0x5d'),_0x5937ee);throw _0x5937ee;});}return _0x3bc5dd;});}})[_0xb53f('0x2b')](respondWithResult(_0x4c3ee1,0xc9))[_0xb53f('0x49')](handleError(_0x4c3ee1,null));};exports['update']=function(_0x555ce1,_0x5049b5){if(_0x555ce1[_0xb53f('0x50')]['id']){delete _0x555ce1['body']['id'];}return db[_0xb53f('0x32')][_0xb53f('0x4e')]({'where':{'id':_0x555ce1[_0xb53f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5049b5,null))[_0xb53f('0x2b')](saveUpdates(_0x555ce1[_0xb53f('0x50')],null))[_0xb53f('0x2b')](respondWithResult(_0x5049b5,null))[_0xb53f('0x49')](handleError(_0x5049b5,null));};exports[_0xb53f('0x2a')]=function(_0x244568,_0x2f8673){return db['Campaign'][_0xb53f('0x4e')]({'where':{'id':_0x244568[_0xb53f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f8673,null))[_0xb53f('0x2b')](removeEntity(_0x2f8673,null))['catch'](handleError(_0x2f8673,null));};exports[_0xb53f('0x5e')]=function(_0x442009,_0x3fe48a,_0x1c1890){var _0x18072f={'raw':!![],'where':{}};var _0x5db9ca={};var _0x408378={'count':0x0,'rows':[]};return db[_0xb53f('0x32')][_0xb53f('0x5f')]({'where':{'id':_0x442009[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0x3fe48a,null))[_0xb53f('0x2b')](function(_0xc2b1a){if(_0xc2b1a){_0x5db9ca[_0xb53f('0x35')]=_[_0xb53f('0x37')](db[_0xb53f('0x60')][_0xb53f('0x4c')]);_0x5db9ca[_0xb53f('0x36')]=_[_0xb53f('0x37')](_0x442009[_0xb53f('0x36')]);_0x5db9ca[_0xb53f('0x38')]=_[_0xb53f('0x39')](_0x5db9ca[_0xb53f('0x35')],_0x5db9ca[_0xb53f('0x36')]);_0x18072f[_0xb53f('0x3b')]=_['intersection'](_0x5db9ca[_0xb53f('0x35')],qs[_0xb53f('0x3a')](_0x442009[_0xb53f('0x36')][_0xb53f('0x3a')]));_0x18072f[_0xb53f('0x3b')]=_0x18072f[_0xb53f('0x3b')][_0xb53f('0x4d')]?_0x18072f[_0xb53f('0x3b')]:_0x5db9ca[_0xb53f('0x35')];if(!_0x442009[_0xb53f('0x36')]['hasOwnProperty'](_0xb53f('0x3d'))){_0x18072f[_0xb53f('0x23')]=qs[_0xb53f('0x23')](_0x442009[_0xb53f('0x36')][_0xb53f('0x23')]);_0x18072f[_0xb53f('0x21')]=qs['offset'](_0x442009['query'][_0xb53f('0x21')]);}_0x18072f[_0xb53f('0x3e')]=qs[_0xb53f('0x3f')](_0x442009[_0xb53f('0x36')][_0xb53f('0x3f')]);_0x18072f[_0xb53f('0x40')]=qs[_0xb53f('0x38')](_['pick'](_0x442009[_0xb53f('0x36')],_0x5db9ca[_0xb53f('0x38')]));_0x18072f[_0xb53f('0x40')][_0xb53f('0x61')]=_0xc2b1a['id'];if(_0x442009[_0xb53f('0x36')][_0xb53f('0x42')]){_0x18072f[_0xb53f('0x40')]=_['merge'](_0x18072f[_0xb53f('0x40')],{'$or':_[_0xb53f('0x31')](_0x18072f['attributes'],function(_0x1bd915){var _0x343bf3={};_0x343bf3[_0x1bd915]={'$like':'%'+_0x442009['query'][_0xb53f('0x42')]+'%'};return _0x343bf3;})});}_0x18072f=_[_0xb53f('0x43')]({},_0x18072f,_0x442009[_0xb53f('0x44')]);return db[_0xb53f('0x60')][_0xb53f('0x24')]({'where':_0x18072f['where']})['then'](function(_0x13321a){_0x408378[_0xb53f('0x24')]=_0x13321a;if(_0x442009[_0xb53f('0x36')][_0xb53f('0x45')]){_0x18072f['include']=[{'all':!![]}];}return db['CmHopper'][_0xb53f('0x47')](_0x18072f);})[_0xb53f('0x2b')](function(_0x3a2323){_0x408378['rows']=_0x3a2323;return _0x408378;});}})[_0xb53f('0x2b')](respondWithFilteredResult(_0x3fe48a,_0x18072f))[_0xb53f('0x49')](handleError(_0x3fe48a,null));};exports[_0xb53f('0x62')]=function(_0x59faef,_0x4f17ad,_0x165940){var _0xf947cc={'raw':!![],'where':{}};var _0x87f27f={};var _0xbc14d6={'count':0x0,'rows':[]};return db['Campaign'][_0xb53f('0x5f')]({'where':{'id':_0x59faef[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0x4f17ad,null))['then'](function(_0x42fb9b){if(_0x42fb9b){_0x87f27f['model']=_['keys'](db['CmHopperHistory'][_0xb53f('0x4c')]);_0x87f27f[_0xb53f('0x36')]=_['keys'](_0x59faef['query']);_0x87f27f[_0xb53f('0x38')]=_[_0xb53f('0x39')](_0x87f27f['model'],_0x87f27f[_0xb53f('0x36')]);_0xf947cc[_0xb53f('0x3b')]=_[_0xb53f('0x39')](_0x87f27f['model'],qs[_0xb53f('0x3a')](_0x59faef['query'][_0xb53f('0x3a')]));_0xf947cc['attributes']=_0xf947cc[_0xb53f('0x3b')][_0xb53f('0x4d')]?_0xf947cc[_0xb53f('0x3b')]:_0x87f27f[_0xb53f('0x35')];if(!_0x59faef[_0xb53f('0x36')][_0xb53f('0x3c')](_0xb53f('0x3d'))){_0xf947cc[_0xb53f('0x23')]=qs[_0xb53f('0x23')](_0x59faef['query'][_0xb53f('0x23')]);_0xf947cc[_0xb53f('0x21')]=qs['offset'](_0x59faef[_0xb53f('0x36')][_0xb53f('0x21')]);}_0xf947cc['order']=qs['sort'](_0x59faef[_0xb53f('0x36')][_0xb53f('0x3f')]);_0xf947cc[_0xb53f('0x40')]=qs['filters'](_[_0xb53f('0x41')](_0x59faef[_0xb53f('0x36')],_0x87f27f[_0xb53f('0x38')]));_0xf947cc[_0xb53f('0x40')]['CampaignId']=_0x42fb9b['id'];if(_0x59faef[_0xb53f('0x36')]['filter']){_0xf947cc[_0xb53f('0x40')]=_['merge'](_0xf947cc[_0xb53f('0x40')],{'$or':_[_0xb53f('0x31')](_0xf947cc[_0xb53f('0x3b')],function(_0x2e0d53){var _0x177e74={};_0x177e74[_0x2e0d53]={'$like':'%'+_0x59faef[_0xb53f('0x36')][_0xb53f('0x42')]+'%'};return _0x177e74;})});}_0xf947cc=_['merge']({},_0xf947cc,_0x59faef['options']);return db[_0xb53f('0x63')][_0xb53f('0x24')]({'where':_0xf947cc['where']})[_0xb53f('0x2b')](function(_0xce3fb8){_0xbc14d6[_0xb53f('0x24')]=_0xce3fb8;if(_0x59faef[_0xb53f('0x36')]['includeAll']){_0xf947cc[_0xb53f('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xb53f('0x47')](_0xf947cc);})[_0xb53f('0x2b')](function(_0x47cc3d){_0xbc14d6['rows']=_0x47cc3d;return _0xbc14d6;});}})[_0xb53f('0x2b')](respondWithFilteredResult(_0x4f17ad,_0xf947cc))[_0xb53f('0x49')](handleError(_0x4f17ad,null));};exports['getHopperFinals']=function(_0x516c37,_0x3d7f03,_0x5ef47f){var _0x1e56f4={'raw':!![],'where':{}};var _0x8f4185={};var _0x1feaed={'count':0x0,'rows':[]};return db['Campaign'][_0xb53f('0x5f')]({'where':{'id':_0x516c37[_0xb53f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d7f03,null))[_0xb53f('0x2b')](function(_0x2caa2d){if(_0x2caa2d){_0x8f4185['model']=_[_0xb53f('0x37')](db[_0xb53f('0x64')][_0xb53f('0x4c')]);_0x8f4185[_0xb53f('0x36')]=_['keys'](_0x516c37[_0xb53f('0x36')]);_0x8f4185[_0xb53f('0x38')]=_[_0xb53f('0x39')](_0x8f4185[_0xb53f('0x35')],_0x8f4185[_0xb53f('0x36')]);_0x1e56f4[_0xb53f('0x3b')]=_['intersection'](_0x8f4185[_0xb53f('0x35')],qs['fields'](_0x516c37[_0xb53f('0x36')][_0xb53f('0x3a')]));_0x1e56f4['attributes']=_0x1e56f4[_0xb53f('0x3b')]['length']?_0x1e56f4[_0xb53f('0x3b')]:_0x8f4185[_0xb53f('0x35')];if(!_0x516c37[_0xb53f('0x36')][_0xb53f('0x3c')](_0xb53f('0x3d'))){_0x1e56f4[_0xb53f('0x23')]=qs[_0xb53f('0x23')](_0x516c37[_0xb53f('0x36')][_0xb53f('0x23')]);_0x1e56f4[_0xb53f('0x21')]=qs['offset'](_0x516c37['query'][_0xb53f('0x21')]);}_0x1e56f4['order']=qs[_0xb53f('0x3f')](_0x516c37[_0xb53f('0x36')]['sort']);_0x1e56f4[_0xb53f('0x40')]=qs['filters'](_[_0xb53f('0x41')](_0x516c37['query'],_0x8f4185[_0xb53f('0x38')]));_0x1e56f4[_0xb53f('0x40')][_0xb53f('0x61')]=_0x2caa2d['id'];if(_0x516c37[_0xb53f('0x36')][_0xb53f('0x42')]){_0x1e56f4[_0xb53f('0x40')]=_['merge'](_0x1e56f4[_0xb53f('0x40')],{'$or':_[_0xb53f('0x31')](_0x1e56f4[_0xb53f('0x3b')],function(_0x4c9475){var _0x2d483e={};_0x2d483e[_0x4c9475]={'$like':'%'+_0x516c37[_0xb53f('0x36')]['filter']+'%'};return _0x2d483e;})});}_0x1e56f4=_['merge']({},_0x1e56f4,_0x516c37[_0xb53f('0x44')]);return db[_0xb53f('0x64')]['count']({'where':_0x1e56f4[_0xb53f('0x40')]})[_0xb53f('0x2b')](function(_0x57188e){_0x1feaed[_0xb53f('0x24')]=_0x57188e;if(_0x516c37[_0xb53f('0x36')][_0xb53f('0x45')]){_0x1e56f4[_0xb53f('0x46')]=[{'all':!![]}];}return db[_0xb53f('0x64')][_0xb53f('0x47')](_0x1e56f4);})[_0xb53f('0x2b')](function(_0x11ba83){_0x1feaed['rows']=_0x11ba83;return _0x1feaed;});}})['then'](respondWithFilteredResult(_0x3d7f03,_0x1e56f4))[_0xb53f('0x49')](handleError(_0x3d7f03,null));};exports[_0xb53f('0x65')]=function(_0x55eef6,_0x4849ba,_0x25c979){var _0x3c2627={'raw':!![],'where':{}};var _0x52892a={};var _0x22ac6d={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x55eef6[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0x4849ba,null))[_0xb53f('0x2b')](function(_0x182bd2){if(_0x182bd2){_0x52892a['model']=_['keys'](db[_0xb53f('0x66')]['rawAttributes']);_0x52892a[_0xb53f('0x36')]=_['keys'](_0x55eef6[_0xb53f('0x36')]);_0x52892a['filters']=_[_0xb53f('0x39')](_0x52892a[_0xb53f('0x35')],_0x52892a[_0xb53f('0x36')]);_0x3c2627[_0xb53f('0x3b')]=_[_0xb53f('0x39')](_0x52892a[_0xb53f('0x35')],qs['fields'](_0x55eef6['query'][_0xb53f('0x3a')]));_0x3c2627[_0xb53f('0x3b')]=_0x3c2627[_0xb53f('0x3b')][_0xb53f('0x4d')]?_0x3c2627[_0xb53f('0x3b')]:_0x52892a[_0xb53f('0x35')];if(!_0x55eef6['query']['hasOwnProperty'](_0xb53f('0x3d'))){_0x3c2627[_0xb53f('0x23')]=qs['limit'](_0x55eef6[_0xb53f('0x36')][_0xb53f('0x23')]);_0x3c2627[_0xb53f('0x21')]=qs[_0xb53f('0x21')](_0x55eef6['query'][_0xb53f('0x21')]);}_0x3c2627[_0xb53f('0x3e')]=qs[_0xb53f('0x3f')](_0x55eef6[_0xb53f('0x36')][_0xb53f('0x3f')]);_0x3c2627[_0xb53f('0x40')]=qs[_0xb53f('0x38')](_[_0xb53f('0x41')](_0x55eef6[_0xb53f('0x36')],_0x52892a[_0xb53f('0x38')]));_0x3c2627[_0xb53f('0x40')][_0xb53f('0x61')]=_0x182bd2['id'];if(_0x55eef6['query'][_0xb53f('0x42')]){_0x3c2627['where']=_['merge'](_0x3c2627[_0xb53f('0x40')],{'$or':_['map'](_0x3c2627[_0xb53f('0x3b')],function(_0x5d1924){var _0x557f6c={};_0x557f6c[_0x5d1924]={'$like':'%'+_0x55eef6[_0xb53f('0x36')][_0xb53f('0x42')]+'%'};return _0x557f6c;})});}_0x3c2627=_['merge']({},_0x3c2627,_0x55eef6[_0xb53f('0x44')]);return db[_0xb53f('0x66')][_0xb53f('0x24')]({'where':_0x3c2627[_0xb53f('0x40')]})[_0xb53f('0x2b')](function(_0x7319f6){_0x22ac6d[_0xb53f('0x24')]=_0x7319f6;if(_0x55eef6[_0xb53f('0x36')][_0xb53f('0x45')]){_0x3c2627[_0xb53f('0x46')]=[{'all':!![]}];}return db[_0xb53f('0x66')][_0xb53f('0x47')](_0x3c2627);})['then'](function(_0x4048b0){_0x22ac6d[_0xb53f('0x48')]=_0x4048b0;return _0x22ac6d;});}})[_0xb53f('0x2b')](respondWithFilteredResult(_0x4849ba,_0x3c2627))[_0xb53f('0x49')](handleError(_0x4849ba,null));};exports[_0xb53f('0x67')]=function(_0x49706d,_0x1aae49,_0x3ac2ba){var _0x1edd75={};var _0x431b70={};var _0x50672e;var _0x43036c;return db['Campaign'][_0xb53f('0x5f')]({'where':{'id':_0x49706d[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0x1aae49,null))['then'](function(_0xc7e389){if(_0xc7e389){_0x50672e=_0xc7e389;_0x431b70[_0xb53f('0x35')]=_[_0xb53f('0x37')](db[_0xb53f('0x68')][_0xb53f('0x4c')]);_0x431b70[_0xb53f('0x36')]=_[_0xb53f('0x37')](_0x49706d[_0xb53f('0x36')]);_0x431b70[_0xb53f('0x38')]=_[_0xb53f('0x39')](_0x431b70[_0xb53f('0x35')],_0x431b70[_0xb53f('0x36')]);_0x1edd75[_0xb53f('0x3b')]=_[_0xb53f('0x39')](_0x431b70[_0xb53f('0x35')],qs[_0xb53f('0x3a')](_0x49706d['query']['fields']));_0x1edd75[_0xb53f('0x3b')]=_0x1edd75['attributes'][_0xb53f('0x4d')]?_0x1edd75[_0xb53f('0x3b')]:_0x431b70[_0xb53f('0x35')];_0x1edd75[_0xb53f('0x3e')]=qs[_0xb53f('0x3f')](_0x49706d['query'][_0xb53f('0x3f')]);_0x1edd75[_0xb53f('0x40')]=qs[_0xb53f('0x38')](_['pick'](_0x49706d[_0xb53f('0x36')],_0x431b70[_0xb53f('0x38')]));if(_0x49706d[_0xb53f('0x36')][_0xb53f('0x42')]){_0x1edd75[_0xb53f('0x40')]=_[_0xb53f('0x43')](_0x1edd75[_0xb53f('0x40')],{'$or':_[_0xb53f('0x31')](_0x1edd75['attributes'],function(_0x35d8de){var _0x155562={};_0x155562[_0x35d8de]={'$like':'%'+_0x49706d['query']['filter']+'%'};return _0x155562;})});}_0x1edd75=_[_0xb53f('0x43')]({},_0x1edd75,_0x49706d['options']);return _0x50672e[_0xb53f('0x67')](_0x1edd75);}})[_0xb53f('0x2b')](function(_0xef8012){if(_0xef8012){_0x43036c=_0xef8012[_0xb53f('0x4d')];if(!_0x49706d['query'][_0xb53f('0x3c')]('nolimit')){_0x1edd75[_0xb53f('0x23')]=qs[_0xb53f('0x23')](_0x49706d[_0xb53f('0x36')][_0xb53f('0x23')]);_0x1edd75[_0xb53f('0x21')]=qs[_0xb53f('0x21')](_0x49706d[_0xb53f('0x36')][_0xb53f('0x21')]);}return _0x50672e[_0xb53f('0x67')](_0x1edd75);}})[_0xb53f('0x2b')](function(_0x2483ad){if(_0x2483ad){return _0x2483ad?{'count':_0x43036c,'rows':_0x2483ad}:null;}})[_0xb53f('0x2b')](respondWithResult(_0x1aae49,null))['catch'](handleError(_0x1aae49,null));};exports['addLists']=function(_0x28df97,_0x28e85b,_0x18d26d){var _0x1ddb0a,_0x1e2ea7;return db[_0xb53f('0x32')][_0xb53f('0x4e')]({'where':{'id':_0x28df97['params']['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0x28e85b,null))[_0xb53f('0x2b')](function(_0x287278){if(_0x287278){_0x1e2ea7=_0x287278;return _0x287278[_0xb53f('0x69')](_0x28df97[_0xb53f('0x50')]['ids'],_[_0xb53f('0x58')](_0x28df97[_0xb53f('0x50')],[_0xb53f('0x6a'),'id'])||{});}return null;})[_0xb53f('0x6b')](function(_0x22239f){var _0x5ef379;_0x1ddb0a=_0x22239f||[];var _0x896b53=[];if(_0x22239f){for(var _0x375cb2=0x0;_0x375cb2<_0x22239f[_0xb53f('0x4d')];_0x375cb2+=0x1){var _0x5e7d67=_0x22239f[_0x375cb2][_0xb53f('0x52')]({'plain':!![]});_0x1e2ea7['dialCheckDuplicateType']=_0x28df97['body'][_0xb53f('0x6c')]?_0x28df97[_0xb53f('0x50')][_0xb53f('0x6c')]:_0x1e2ea7[_0xb53f('0x6c')];switch(_0x1e2ea7[_0xb53f('0x6c')]){case _0xb53f('0x6d'):_0x5ef379=squel[_0xb53f('0x6e')]()[_0xb53f('0x6f')](_0xb53f('0x70'))[_0xb53f('0x71')]([_0xb53f('0x72'),_0xb53f('0x73'),_0xb53f('0x74'),_0xb53f('0x75'),_0xb53f('0x61'),_0xb53f('0x5a'),'updatedAt'],squel[_0xb53f('0x76')]()['field'](_0xb53f('0x72'),_0xb53f('0x72'))[_0xb53f('0x77')](_0xb53f('0x78'),'scheduledAt')[_0xb53f('0x77')]('id',_0xb53f('0x74'))[_0xb53f('0x77')](_0x5e7d67[_0xb53f('0x79')][_0xb53f('0x7a')](),_0xb53f('0x75'))['field'](_0x28df97[_0xb53f('0x4b')]['id'][_0xb53f('0x7a')](),_0xb53f('0x61'))[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x5a'))[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x59'))[_0xb53f('0x7b')]('cm_contacts')[_0xb53f('0x40')](_0xb53f('0x7c'))['where'](_0xb53f('0x7d'),_0x5e7d67[_0xb53f('0x79')]['toString']())[_0xb53f('0x40')](_0xb53f('0x7e'))['where'](_0xb53f('0x7f'),squel['select']()[_0xb53f('0x77')](_0xb53f('0x80'))[_0xb53f('0x7b')](_0xb53f('0x81'))['where'](_0xb53f('0x82'),_0x28df97[_0xb53f('0x4b')]['id'][_0xb53f('0x7a')]()))[_0xb53f('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb53f('0x76')]()['field'](_0xb53f('0x83'))[_0xb53f('0x7b')](_0xb53f('0x70'))[_0xb53f('0x40')]('CampaignId\x20=\x20?',_0x28df97[_0xb53f('0x4b')]['id'][_0xb53f('0x7a')]())))['toString']();break;case _0xb53f('0x84'):_0x5ef379=squel['insert']()[_0xb53f('0x6f')](_0xb53f('0x70'))[_0xb53f('0x71')]([_0xb53f('0x72'),_0xb53f('0x73'),_0xb53f('0x74'),_0xb53f('0x75'),_0xb53f('0x61'),'createdAt',_0xb53f('0x59')],squel[_0xb53f('0x76')]()[_0xb53f('0x77')](_0xb53f('0x72'),'phone')[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x73'))[_0xb53f('0x77')]('id',_0xb53f('0x74'))[_0xb53f('0x77')](_0x5e7d67['CmListId'][_0xb53f('0x7a')](),_0xb53f('0x75'))['field'](_0x28df97[_0xb53f('0x4b')]['id'][_0xb53f('0x7a')](),'CampaignId')[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x5a'))['field']('NOW()',_0xb53f('0x59'))[_0xb53f('0x7b')]('cm_contacts')[_0xb53f('0x40')](_0xb53f('0x7c'))['where'](_0xb53f('0x7d'),_0x5e7d67[_0xb53f('0x79')][_0xb53f('0x7a')]())[_0xb53f('0x40')](_0xb53f('0x7e'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xb53f('0x76')]()['field']('COALESCE(phone,\x27\x27)')[_0xb53f('0x7b')](_0xb53f('0x70'))['where'](_0xb53f('0x82'),_0x28df97[_0xb53f('0x4b')]['id'][_0xb53f('0x7a')]())))['toString']();break;default:_0x5ef379=squel['insert']()[_0xb53f('0x6f')](_0xb53f('0x70'))['fromQuery']([_0xb53f('0x72'),_0xb53f('0x73'),_0xb53f('0x74'),_0xb53f('0x75'),_0xb53f('0x61'),_0xb53f('0x5a'),_0xb53f('0x59')],squel[_0xb53f('0x76')]()[_0xb53f('0x77')](_0xb53f('0x72'),'phone')['field'](_0xb53f('0x78'),_0xb53f('0x73'))[_0xb53f('0x77')]('id',_0xb53f('0x74'))[_0xb53f('0x77')](_0x5e7d67[_0xb53f('0x79')][_0xb53f('0x7a')](),_0xb53f('0x75'))[_0xb53f('0x77')](_0x28df97[_0xb53f('0x4b')]['id'][_0xb53f('0x7a')](),_0xb53f('0x61'))[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x5a'))[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x59'))['from'](_0xb53f('0x85'))[_0xb53f('0x40')](_0xb53f('0x7c'))[_0xb53f('0x40')]('ListId\x20=\x20?',_0x5e7d67[_0xb53f('0x79')][_0xb53f('0x7a')]())[_0xb53f('0x40')](_0xb53f('0x7e')))[_0xb53f('0x7a')]();}_0x896b53[_0xb53f('0x86')](db[_0xb53f('0x87')][_0xb53f('0x36')](_0x5ef379));}return BPromise['all'](_0x896b53);}})['then'](function(){return _0x1ddb0a;})[_0xb53f('0x2b')](respondWithResult(_0x28e85b,null))['catch'](handleError(_0x28e85b,null));};exports[_0xb53f('0x88')]=function(_0x544144,_0xd4cfd2,_0x4f7e43){return db[_0xb53f('0x32')][_0xb53f('0x4e')]({'where':{'id':_0x544144[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0xd4cfd2,null))['then'](function(_0x2460c7){if(_0x2460c7){return _0x2460c7['removeLists'](_0x544144[_0xb53f('0x36')][_0xb53f('0x6a')]);}})[_0xb53f('0x2b')](function(_0x41ff7d){if(_0x41ff7d){return db[_0xb53f('0x60')]['destroy']({'where':{'ListId':_0x544144['query']['ids'],'CampaignId':_0x544144[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](function(){return _0x41ff7d;});}})['then'](respondWithStatusCode(_0xd4cfd2,null))['catch'](handleError(_0xd4cfd2,null));};exports[_0xb53f('0x89')]=function(_0x35c752,_0x8e0bdf,_0x1d6847){var _0x3b4dac={};var _0x1ca6fe={};var _0x44fbb4;var _0x34acb6;return db[_0xb53f('0x32')]['findOne']({'where':{'id':_0x35c752[_0xb53f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x8e0bdf,null))[_0xb53f('0x2b')](function(_0x42f5ce){if(_0x42f5ce){_0x44fbb4=_0x42f5ce;_0x1ca6fe[_0xb53f('0x35')]=_[_0xb53f('0x37')](db[_0xb53f('0x68')][_0xb53f('0x4c')]);_0x1ca6fe['query']=_['keys'](_0x35c752[_0xb53f('0x36')]);_0x1ca6fe['filters']=_[_0xb53f('0x39')](_0x1ca6fe[_0xb53f('0x35')],_0x1ca6fe['query']);_0x3b4dac[_0xb53f('0x3b')]=_['intersection'](_0x1ca6fe[_0xb53f('0x35')],qs[_0xb53f('0x3a')](_0x35c752[_0xb53f('0x36')][_0xb53f('0x3a')]));_0x3b4dac['attributes']=_0x3b4dac[_0xb53f('0x3b')][_0xb53f('0x4d')]?_0x3b4dac[_0xb53f('0x3b')]:_0x1ca6fe['model'];_0x3b4dac['order']=qs[_0xb53f('0x3f')](_0x35c752[_0xb53f('0x36')]['sort']);_0x3b4dac['where']=qs[_0xb53f('0x38')](_['pick'](_0x35c752[_0xb53f('0x36')],_0x1ca6fe[_0xb53f('0x38')]));if(_0x35c752[_0xb53f('0x36')][_0xb53f('0x42')]){_0x3b4dac['where']=_[_0xb53f('0x43')](_0x3b4dac[_0xb53f('0x40')],{'$or':_[_0xb53f('0x31')](_0x3b4dac[_0xb53f('0x3b')],function(_0x2497e3){var _0x1052d5={};_0x1052d5[_0x2497e3]={'$like':'%'+_0x35c752[_0xb53f('0x36')]['filter']+'%'};return _0x1052d5;})});}_0x3b4dac=_[_0xb53f('0x43')]({},_0x3b4dac,_0x35c752['options']);return _0x44fbb4[_0xb53f('0x89')](_0x3b4dac);}})['then'](function(_0xa95323){if(_0xa95323){_0x34acb6=_0xa95323[_0xb53f('0x4d')];if(!_0x35c752[_0xb53f('0x36')]['hasOwnProperty'](_0xb53f('0x3d'))){_0x3b4dac[_0xb53f('0x23')]=qs[_0xb53f('0x23')](_0x35c752['query']['limit']);_0x3b4dac[_0xb53f('0x21')]=qs[_0xb53f('0x21')](_0x35c752[_0xb53f('0x36')][_0xb53f('0x21')]);}return _0x44fbb4[_0xb53f('0x89')](_0x3b4dac);}})['then'](function(_0x378ace){if(_0x378ace){return _0x378ace?{'count':_0x34acb6,'rows':_0x378ace}:null;}})['then'](respondWithResult(_0x8e0bdf,null))[_0xb53f('0x49')](handleError(_0x8e0bdf,null));};exports[_0xb53f('0x8a')]=function(_0x3e88c3,_0x2cc85f,_0x59b615){var _0x1ab7eb,_0x3b91ce;return db[_0xb53f('0x32')][_0xb53f('0x4e')]({'where':{'id':_0x3e88c3[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](handleEntityNotFound(_0x2cc85f,null))['then'](function(_0x133c47){if(_0x133c47){_0x3b91ce=_0x133c47;return _0x133c47[_0xb53f('0x8a')](_0x3e88c3[_0xb53f('0x50')][_0xb53f('0x6a')],_[_0xb53f('0x58')](_0x3e88c3[_0xb53f('0x50')],[_0xb53f('0x6a'),'id'])||{});}return null;})[_0xb53f('0x6b')](function(_0x12a4e7){var _0x1838b9;_0x1ab7eb=_0x12a4e7||[];var _0x2542e4=[];if(_0x12a4e7){for(var _0x2e147c=0x0;_0x2e147c<_0x12a4e7[_0xb53f('0x4d')];_0x2e147c+=0x1){var _0x484e73=_0x12a4e7[_0x2e147c][_0xb53f('0x52')]({'plain':!![]});_0x1838b9=squel[_0xb53f('0x6e')]()[_0xb53f('0x6f')](_0xb53f('0x8b'))[_0xb53f('0x71')]([_0xb53f('0x72'),_0xb53f('0x74'),_0xb53f('0x75'),'CampaignId',_0xb53f('0x5a'),_0xb53f('0x59')],squel[_0xb53f('0x76')]()['field'](_0xb53f('0x72'),_0xb53f('0x72'))['field']('id',_0xb53f('0x74'))['field'](_0x484e73[_0xb53f('0x79')][_0xb53f('0x7a')](),_0xb53f('0x75'))[_0xb53f('0x77')](_0x3e88c3['params']['id'][_0xb53f('0x7a')](),_0xb53f('0x61'))[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x5a'))[_0xb53f('0x77')](_0xb53f('0x78'),_0xb53f('0x59'))[_0xb53f('0x7b')](_0xb53f('0x85'))[_0xb53f('0x40')](_0xb53f('0x7c'))[_0xb53f('0x40')](_0xb53f('0x7d'),_0x484e73[_0xb53f('0x79')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xb53f('0x7a')]();_0x2542e4['push'](db[_0xb53f('0x87')][_0xb53f('0x36')](_0x1838b9));}return BPromise[_0xb53f('0x8c')](_0x2542e4);}})['then'](function(){return _0x1ab7eb;})['then'](respondWithResult(_0x2cc85f,null))['catch'](handleError(_0x2cc85f,null));};exports[_0xb53f('0x8d')]=function(_0x2c9787,_0x108c83,_0x494538){return db[_0xb53f('0x32')][_0xb53f('0x4e')]({'where':{'id':_0x2c9787[_0xb53f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x108c83,null))[_0xb53f('0x2b')](function(_0x4e6da9){if(_0x4e6da9){return _0x4e6da9['removeBlackLists'](_0x2c9787[_0xb53f('0x36')][_0xb53f('0x6a')]);}})[_0xb53f('0x2b')](function(_0x24e14b){if(_0x24e14b){return db[_0xb53f('0x66')]['destroy']({'where':{'ListId':_0x2c9787[_0xb53f('0x36')][_0xb53f('0x6a')],'CampaignId':_0x2c9787[_0xb53f('0x4b')]['id']}})[_0xb53f('0x2b')](function(){return _0x24e14b;});}})[_0xb53f('0x2b')](respondWithStatusCode(_0x108c83,null))[_0xb53f('0x49')](handleError(_0x108c83,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index d97db0f..ae624ea 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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2fe457,_0x1c58d6){var _0x40dac7=function(_0x29839b){while(--_0x29839b){_0x2fe457['push'](_0x2fe457['shift']());}};_0x40dac7(++_0x1c58d6);}(_0x7a54,0x106));var _0x47a5=function(_0x132b80,_0x5d1fa7){_0x132b80=_0x132b80-0x0;var _0x23b2cf=_0x7a54[_0x132b80];return _0x23b2cf;};'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
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 9fe1161..cb5b41d 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 _0xb18e=['attributes','moment','randomstring','../../mysqldb','../../config/utils','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','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xb18e,0x181));var _0xeb18=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0xb18e[_0x385eb1];return _0x5d40eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xeb18('0x0'));var BPromise=require('bluebird');var rs=require(_0xeb18('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb18('0x2'))['db'];var utils=require(_0xeb18('0x3'));var logger=require('../../config/logger')(_0xeb18('0x4'));var config=require(_0xeb18('0x5'));var jayson=require(_0xeb18('0x6'));var client=jayson[_0xeb18('0x7')][_0xeb18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x183bdf,_0x4a9ddd,_0x1bc3ee){return new BPromise(function(_0x131389,_0x534358){return client[_0xeb18('0x9')](_0x183bdf,_0x1bc3ee)[_0xeb18('0xa')](function(_0x942945){logger[_0xeb18('0xb')](_0xeb18('0xc'),_0x4a9ddd,_0xeb18('0xd'));logger[_0xeb18('0xe')](_0xeb18('0xf'),_0x4a9ddd,_0xeb18('0xd'),JSON[_0xeb18('0x10')](_0x942945));if(_0x942945['error']){if(_0x942945[_0xeb18('0x11')][_0xeb18('0x12')]===0x1f4){logger['error'](_0xeb18('0xc'),_0x4a9ddd,_0x942945['error']['message']);return _0x534358(_0x942945[_0xeb18('0x11')][_0xeb18('0x13')]);}logger[_0xeb18('0x11')]('Campaign,\x20%s,\x20%s',_0x4a9ddd,_0x942945['error'][_0xeb18('0x13')]);return _0x131389(_0x942945[_0xeb18('0x11')]['message']);}else{logger[_0xeb18('0xb')](_0xeb18('0xc'),_0x4a9ddd,_0xeb18('0xd'));_0x131389(_0x942945['result'][_0xeb18('0x13')]);}})[_0xeb18('0x14')](function(_0x318043){logger[_0xeb18('0x11')](_0xeb18('0xc'),_0x4a9ddd,_0x318043);_0x534358(_0x318043);});});}exports[_0xeb18('0x15')]=function(_0x284733){var _0x5bc586=this;return new Promise(function(_0x30f706,_0x5c4adc){return db[_0xeb18('0x16')][_0xeb18('0x17')]({'raw':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')][_0xeb18('0x19')]===undefined?!![]:![]:!![],'where':_0x284733['options']?_0x284733[_0xeb18('0x18')][_0xeb18('0x1a')]||null:null,'attributes':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')]['attributes']||null:null,'limit':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')][_0xeb18('0x1b')]||null:null,'include':_0x284733[_0xeb18('0x18')]?_0x284733[_0xeb18('0x18')][_0xeb18('0x1c')]?_[_0xeb18('0x1d')](_0x284733[_0xeb18('0x18')][_0xeb18('0x1c')],function(_0x7464fd){return{'model':db[_0x7464fd[_0xeb18('0x1e')]],'as':_0x7464fd['as'],'attributes':_0x7464fd[_0xeb18('0x1f')],'include':_0x7464fd['include']?_[_0xeb18('0x1d')](_0x7464fd['include'],function(_0x51867f){return{'model':db[_0x51867f[_0xeb18('0x1e')]],'as':_0x51867f['as'],'attributes':_0x51867f[_0xeb18('0x1f')],'include':_0x51867f[_0xeb18('0x1c')]?_[_0xeb18('0x1d')](_0x51867f[_0xeb18('0x1c')],function(_0x48d10b){return{'model':db[_0x48d10b['model']],'as':_0x48d10b['as'],'attributes':_0x48d10b[_0xeb18('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xeb18('0xa')](function(_0x3312d8){logger['info'](_0xeb18('0x15'),_0x284733);logger[_0xeb18('0xe')]('GetCampaign',_0x284733,JSON[_0xeb18('0x10')](_0x3312d8));_0x30f706(_0x3312d8);})['catch'](function(_0x54e62b){logger['error']('GetCampaign',_0x54e62b['message'],_0x284733);_0x5c4adc(_0x5bc586[_0xeb18('0x11')](0x1f4,_0x54e62b[_0xeb18('0x13')]));});});};
\ No newline at end of file
+var _0x3dd5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','options','attributes','limit','map','model','include','GetCampaign','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3dd5,0x73));var _0x53dd=function(_0x372974,_0x3faaaf){_0x372974=_0x372974-0x0;var _0x47f05=_0x3dd5[_0x372974];return _0x47f05;};'use strict';var _=require(_0x53dd('0x0'));var util=require('util');var moment=require(_0x53dd('0x1'));var BPromise=require(_0x53dd('0x2'));var rs=require(_0x53dd('0x3'));var fs=require('fs');var Redis=require(_0x53dd('0x4'));var db=require(_0x53dd('0x5'))['db'];var utils=require(_0x53dd('0x6'));var logger=require(_0x53dd('0x7'))(_0x53dd('0x8'));var config=require(_0x53dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x53dd('0xa')][_0x53dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37e012,_0x264e7b,_0x4d3132){return new BPromise(function(_0x561ded,_0x3e1512){return client['request'](_0x37e012,_0x4d3132)[_0x53dd('0xc')](function(_0x1f9ce3){logger[_0x53dd('0xd')](_0x53dd('0xe'),_0x264e7b,_0x53dd('0xf'));logger['debug'](_0x53dd('0x10'),_0x264e7b,_0x53dd('0xf'),JSON[_0x53dd('0x11')](_0x1f9ce3));if(_0x1f9ce3[_0x53dd('0x12')]){if(_0x1f9ce3['error']['code']===0x1f4){logger[_0x53dd('0x12')](_0x53dd('0xe'),_0x264e7b,_0x1f9ce3[_0x53dd('0x12')]['message']);return _0x3e1512(_0x1f9ce3[_0x53dd('0x12')][_0x53dd('0x13')]);}logger[_0x53dd('0x12')]('Campaign,\x20%s,\x20%s',_0x264e7b,_0x1f9ce3[_0x53dd('0x12')][_0x53dd('0x13')]);return _0x561ded(_0x1f9ce3[_0x53dd('0x12')]['message']);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x264e7b,'request\x20sent');_0x561ded(_0x1f9ce3[_0x53dd('0x14')][_0x53dd('0x13')]);}})[_0x53dd('0x15')](function(_0x30052e){logger[_0x53dd('0x12')]('Campaign,\x20%s,\x20%s',_0x264e7b,_0x30052e);_0x3e1512(_0x30052e);});});}exports['GetCampaign']=function(_0x45765e){var _0x193c99=this;return new Promise(function(_0x350d03,_0x464eb8){return db[_0x53dd('0x16')]['findAll']({'raw':_0x45765e['options']?_0x45765e['options']['raw']===undefined?!![]:![]:!![],'where':_0x45765e['options']?_0x45765e[_0x53dd('0x17')]['where']||null:null,'attributes':_0x45765e['options']?_0x45765e[_0x53dd('0x17')][_0x53dd('0x18')]||null:null,'limit':_0x45765e[_0x53dd('0x17')]?_0x45765e[_0x53dd('0x17')][_0x53dd('0x19')]||null:null,'include':_0x45765e['options']?_0x45765e[_0x53dd('0x17')]['include']?_[_0x53dd('0x1a')](_0x45765e[_0x53dd('0x17')]['include'],function(_0x42e72e){return{'model':db[_0x42e72e[_0x53dd('0x1b')]],'as':_0x42e72e['as'],'attributes':_0x42e72e['attributes'],'include':_0x42e72e[_0x53dd('0x1c')]?_['map'](_0x42e72e[_0x53dd('0x1c')],function(_0x3506cc){return{'model':db[_0x3506cc[_0x53dd('0x1b')]],'as':_0x3506cc['as'],'attributes':_0x3506cc[_0x53dd('0x18')],'include':_0x3506cc[_0x53dd('0x1c')]?_[_0x53dd('0x1a')](_0x3506cc[_0x53dd('0x1c')],function(_0x1c6d36){return{'model':db[_0x1c6d36[_0x53dd('0x1b')]],'as':_0x1c6d36['as'],'attributes':_0x1c6d36[_0x53dd('0x18')]};}):[]};}):[]};}):[]:[]})[_0x53dd('0xc')](function(_0x57c3e9){logger[_0x53dd('0xd')]('GetCampaign',_0x45765e);logger['debug'](_0x53dd('0x1d'),_0x45765e,JSON[_0x53dd('0x11')](_0x57c3e9));_0x350d03(_0x57c3e9);})['catch'](function(_0x24403d){logger['error'](_0x53dd('0x1d'),_0x24403d[_0x53dd('0x13')],_0x45765e);_0x464eb8(_0x193c99['error'](0x1f4,_0x24403d[_0x53dd('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 76d04d6..ed31728 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 _0xc770=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','isAuthenticated','/:id/hoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','getBlackLists','create','/:id/clone','/:id/lists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists'];(function(_0x169877,_0x282159){var _0x220d3d=function(_0x34b6b2){while(--_0x34b6b2){_0x169877['push'](_0x169877['shift']());}};_0x220d3d(++_0x282159);}(_0xc770,0xd3));var _0x0c77=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc770[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0c77('0x0'));var util=require(_0x0c77('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c77('0x2'));var router=express[_0x0c77('0x3')]();var fs_extra=require(_0x0c77('0x4'));var auth=require(_0x0c77('0x5'));var interaction=require(_0x0c77('0x6'));var config=require(_0x0c77('0x7'));var controller=require(_0x0c77('0x8'));router[_0x0c77('0x9')]('/',auth['isAuthenticated'](),controller[_0x0c77('0xa')]);router[_0x0c77('0x9')]('/:id',auth[_0x0c77('0xb')](),controller['show']);router[_0x0c77('0x9')](_0x0c77('0xc'),auth[_0x0c77('0xb')](),controller['getHoppers']);router[_0x0c77('0x9')](_0x0c77('0xd'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x0c77('0x9')]('/:id/hopper_finals',auth[_0x0c77('0xb')](),controller[_0x0c77('0xe')]);router['get'](_0x0c77('0xf'),auth[_0x0c77('0xb')](),controller[_0x0c77('0x10')]);router[_0x0c77('0x9')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x0c77('0x9')](_0x0c77('0x11'),auth[_0x0c77('0xb')](),controller[_0x0c77('0x12')]);router['post']('/',auth[_0x0c77('0xb')](),controller[_0x0c77('0x13')]);router['post'](_0x0c77('0x14'),auth[_0x0c77('0xb')](),controller['clone']);router['post'](_0x0c77('0x15'),auth[_0x0c77('0xb')](),controller['addLists']);router['post'](_0x0c77('0x11'),auth[_0x0c77('0xb')](),controller[_0x0c77('0x16')]);router[_0x0c77('0x17')]('/:id',auth[_0x0c77('0xb')](),controller[_0x0c77('0x18')]);router[_0x0c77('0x19')]('/:id',auth[_0x0c77('0xb')](),controller[_0x0c77('0x1a')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x0c77('0x1b')]);router[_0x0c77('0x19')](_0x0c77('0x11'),auth[_0x0c77('0xb')](),controller[_0x0c77('0x1c')]);module[_0x0c77('0x1d')]=router;
\ No newline at end of file
+var _0x3678=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x54e14b,_0x4476a1){var _0x129ae0=function(_0x504426){while(--_0x504426){_0x54e14b['push'](_0x54e14b['shift']());}};_0x129ae0(++_0x4476a1);}(_0x3678,0x81));var _0x8367=function(_0x1aa049,_0x9ae13c){_0x1aa049=_0x1aa049-0x0;var _0x357f29=_0x3678[_0x1aa049];return _0x357f29;};'use strict';var multer=require(_0x8367('0x0'));var util=require(_0x8367('0x1'));var path=require(_0x8367('0x2'));var timeout=require(_0x8367('0x3'));var express=require(_0x8367('0x4'));var router=express[_0x8367('0x5')]();var fs_extra=require(_0x8367('0x6'));var auth=require(_0x8367('0x7'));var interaction=require(_0x8367('0x8'));var config=require(_0x8367('0x9'));var controller=require(_0x8367('0xa'));router[_0x8367('0xb')]('/',auth[_0x8367('0xc')](),controller[_0x8367('0xd')]);router[_0x8367('0xb')](_0x8367('0xe'),auth['isAuthenticated'](),controller[_0x8367('0xf')]);router[_0x8367('0xb')](_0x8367('0x10'),auth[_0x8367('0xc')](),controller[_0x8367('0x11')]);router[_0x8367('0xb')](_0x8367('0x12'),auth[_0x8367('0xc')](),controller['getHopperHistories']);router[_0x8367('0xb')](_0x8367('0x13'),auth[_0x8367('0xc')](),controller['getHopperFinals']);router[_0x8367('0xb')](_0x8367('0x14'),auth[_0x8367('0xc')](),controller['getHopperBlacks']);router[_0x8367('0xb')](_0x8367('0x15'),auth['isAuthenticated'](),controller['getLists']);router[_0x8367('0xb')](_0x8367('0x16'),auth['isAuthenticated'](),controller[_0x8367('0x17')]);router[_0x8367('0x18')]('/',auth[_0x8367('0xc')](),controller['create']);router['post'](_0x8367('0x19'),auth[_0x8367('0xc')](),controller[_0x8367('0x1a')]);router[_0x8367('0x18')](_0x8367('0x15'),auth[_0x8367('0xc')](),controller[_0x8367('0x1b')]);router[_0x8367('0x18')](_0x8367('0x16'),auth[_0x8367('0xc')](),controller[_0x8367('0x1c')]);router[_0x8367('0x1d')](_0x8367('0xe'),auth[_0x8367('0xc')](),controller['update']);router[_0x8367('0x1e')](_0x8367('0xe'),auth['isAuthenticated'](),controller[_0x8367('0x1f')]);router[_0x8367('0x1e')](_0x8367('0x15'),auth[_0x8367('0xc')](),controller[_0x8367('0x20')]);router[_0x8367('0x1e')]('/:id/blacklists',auth[_0x8367('0xc')](),controller['removeBlackLists']);module[_0x8367('0x21')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index c414e21..f738d3a 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 _0xd87a=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x4de86b,_0x5eb642){var _0x306c57=function(_0x20ab50){while(--_0x20ab50){_0x4de86b['push'](_0x4de86b['shift']());}};_0x306c57(++_0x5eb642);}(_0xd87a,0x8b));var _0xad87=function(_0x1663ae,_0x10484a){_0x1663ae=_0x1663ae-0x0;var _0x30ffb8=_0xd87a[_0x1663ae];return _0x30ffb8;};'use strict';var Sequelize=require(_0xad87('0x0'));module[_0xad87('0x1')]={'key':{'type':Sequelize[_0xad87('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xad87('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xad87('0x2')]},'name':{'type':Sequelize[_0xad87('0x4')],'get':function(){return this[_0xad87('0x5')](_0xad87('0x6'));}}};
\ No newline at end of file
+var _0xfb58=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfb58,0x19b));var _0x8fb5=function(_0x404b7a,_0xe3a16c){_0x404b7a=_0x404b7a-0x0;var _0x35a076=_0xfb58[_0x404b7a];return _0x35a076;};'use strict';var Sequelize=require(_0x8fb5('0x0'));module[_0x8fb5('0x1')]={'key':{'type':Sequelize[_0x8fb5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x8fb5('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8fb5('0x4')](_0x8fb5('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 73d46be..a19aa50 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 _0x91df=['stack','name','send','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','apply','save','update','then','destroy','get','CannedAnswers','end','sendStatus','error'];(function(_0xf501f3,_0x29979a){var _0x390b76=function(_0x4369b7){while(--_0x4369b7){_0xf501f3['push'](_0xf501f3['shift']());}};_0x390b76(++_0x29979a);}(_0x91df,0x132));var _0xf91d=function(_0x3fbe58,_0x264f56){_0x3fbe58=_0x3fbe58-0x0;var _0x459187=_0x91df[_0x3fbe58];return _0x459187;};'use strict';var emlformat=require(_0xf91d('0x0'));var rimraf=require(_0xf91d('0x1'));var zipdir=require(_0xf91d('0x2'));var jsonpatch=require(_0xf91d('0x3'));var rp=require('request-promise');var moment=require(_0xf91d('0x4'));var BPromise=require(_0xf91d('0x5'));var Mustache=require(_0xf91d('0x6'));var util=require(_0xf91d('0x7'));var path=require('path');var sox=require(_0xf91d('0x8'));var csv=require(_0xf91d('0x9'));var ejs=require(_0xf91d('0xa'));var fs=require('fs');var fs_extra=require(_0xf91d('0xb'));var _=require('lodash');var squel=require(_0xf91d('0xc'));var crypto=require(_0xf91d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf91d('0xe'));var toCsv=require(_0xf91d('0x9'));var querystring=require(_0xf91d('0xf'));var Papa=require(_0xf91d('0x10'));var Redis=require('ioredis');var authService=require(_0xf91d('0x11'));var qs=require(_0xf91d('0x12'));var as=require(_0xf91d('0x13'));var hardwareService=require(_0xf91d('0x14'));var logger=require(_0xf91d('0x15'))(_0xf91d('0x16'));var utils=require('../../config/utils');var config=require(_0xf91d('0x17'));var licenseUtil=require(_0xf91d('0x18'));var db=require(_0xf91d('0x19'))['db'];function respondWithStatusCode(_0x33084b,_0x47986e){_0x47986e=_0x47986e||0xcc;return function(_0x169791){if(_0x169791){return _0x33084b['sendStatus'](_0x47986e);}return _0x33084b[_0xf91d('0x1a')](_0x47986e)['end']();};}function respondWithResult(_0x57ca28,_0xe6afd1){_0xe6afd1=_0xe6afd1||0xc8;return function(_0x4cbb8d){if(_0x4cbb8d){return _0x57ca28['status'](_0xe6afd1)[_0xf91d('0x1b')](_0x4cbb8d);}};}function respondWithFilteredResult(_0x15c651,_0x1c1976){return function(_0x1c0610){if(_0x1c0610){var _0x190e69=typeof _0x1c1976['offset']==='undefined'&&typeof _0x1c1976[_0xf91d('0x1c')]===_0xf91d('0x1d');var _0x2acd16=_0x1c0610[_0xf91d('0x1e')];var _0x55de53=_0x190e69?0x0:_0x1c1976[_0xf91d('0x1f')];var _0x57b6e6=_0x190e69?_0x1c0610[_0xf91d('0x1e')]:_0x1c1976['offset']+_0x1c1976[_0xf91d('0x1c')];var _0x4f422a;if(_0x57b6e6>=_0x2acd16){_0x57b6e6=_0x2acd16;_0x4f422a=0xc8;}else{_0x4f422a=0xce;}_0x15c651[_0xf91d('0x1a')](_0x4f422a);return _0x15c651['set']('Content-Range',_0x55de53+'-'+_0x57b6e6+'/'+_0x2acd16)['json'](_0x1c0610);}return null;};}function patchUpdates(_0x24e211){return function(_0x43eec7){try{jsonpatch[_0xf91d('0x20')](_0x43eec7,_0x24e211,!![]);}catch(_0x2ca2c9){return BPromise['reject'](_0x2ca2c9);}return _0x43eec7[_0xf91d('0x21')]();};}function saveUpdates(_0x1fbf62,_0x46c284){return function(_0x83b660){if(_0x83b660){return _0x83b660[_0xf91d('0x22')](_0x1fbf62)[_0xf91d('0x23')](function(_0x3411db){return _0x3411db;});}return null;};}function removeEntity(_0x275a7a,_0x1338f2){return function(_0x1408d0){if(_0x1408d0){return _0x1408d0[_0xf91d('0x24')]()[_0xf91d('0x23')](function(){var _0x46c869=_0x1408d0[_0xf91d('0x25')]({'plain':!![]});var _0x3a57c3=_0xf91d('0x26');return db['UserProfileResource'][_0xf91d('0x24')]({'where':{'type':_0x3a57c3,'resourceId':_0x46c869['id']}})['then'](function(){return _0x1408d0;});})[_0xf91d('0x23')](function(){_0x275a7a[_0xf91d('0x1a')](0xcc)[_0xf91d('0x27')]();});}};}function handleEntityNotFound(_0x264307,_0xa55d1){return function(_0x581470){if(!_0x581470){_0x264307[_0xf91d('0x28')](0x194);}return _0x581470;};}function handleError(_0x11260f,_0x44a756){_0x44a756=_0x44a756||0x1f4;return function(_0x5738c4){logger[_0xf91d('0x29')](_0x5738c4[_0xf91d('0x2a')]);if(_0x5738c4[_0xf91d('0x2b')]){delete _0x5738c4['name'];}_0x11260f[_0xf91d('0x1a')](_0x44a756)[_0xf91d('0x2c')](_0x5738c4);};}exports['index']=function(_0xb59615,_0x39a1bc){var _0x3dfdf3={},_0x5ab102={},_0x57c1d8={'count':0x0,'rows':[]};var _0x41e94b=_[_0xf91d('0x2d')](db[_0xf91d('0x2e')][_0xf91d('0x2f')],function(_0x5a4c3f){return{'name':_0x5a4c3f[_0xf91d('0x30')],'type':_0x5a4c3f['type'][_0xf91d('0x31')]};});_0x5ab102[_0xf91d('0x32')]=_[_0xf91d('0x2d')](_0x41e94b,_0xf91d('0x2b'));_0x5ab102[_0xf91d('0x33')]=_[_0xf91d('0x34')](_0xb59615[_0xf91d('0x33')]);_0x5ab102[_0xf91d('0x35')]=_[_0xf91d('0x36')](_0x5ab102['model'],_0x5ab102[_0xf91d('0x33')]);_0x3dfdf3[_0xf91d('0x37')]=_[_0xf91d('0x36')](_0x5ab102[_0xf91d('0x32')],qs[_0xf91d('0x38')](_0xb59615[_0xf91d('0x33')][_0xf91d('0x38')]));_0x3dfdf3[_0xf91d('0x37')]=_0x3dfdf3['attributes'][_0xf91d('0x39')]?_0x3dfdf3[_0xf91d('0x37')]:_0x5ab102[_0xf91d('0x32')];if(!_0xb59615[_0xf91d('0x33')][_0xf91d('0x3a')](_0xf91d('0x3b'))){_0x3dfdf3[_0xf91d('0x1c')]=qs[_0xf91d('0x1c')](_0xb59615[_0xf91d('0x33')][_0xf91d('0x1c')]);_0x3dfdf3[_0xf91d('0x1f')]=qs['offset'](_0xb59615[_0xf91d('0x33')][_0xf91d('0x1f')]);}_0x3dfdf3[_0xf91d('0x3c')]=qs[_0xf91d('0x3d')](_0xb59615[_0xf91d('0x33')]['sort']);_0x3dfdf3[_0xf91d('0x3e')]=qs['filters'](_[_0xf91d('0x3f')](_0xb59615[_0xf91d('0x33')],_0x5ab102['filters']),_0x41e94b);if(_0xb59615['query']['filter']){_0x3dfdf3['where']=_[_0xf91d('0x40')](_0x3dfdf3[_0xf91d('0x3e')],{'$or':[{'key':{'$like':'%'+_0xb59615[_0xf91d('0x33')]['filter']+'%'}},{'value':{'$like':'%'+_0xb59615[_0xf91d('0x33')][_0xf91d('0x41')]+'%'}}]});}_0x3dfdf3=_[_0xf91d('0x40')]({},_0x3dfdf3,_0xb59615[_0xf91d('0x42')]);var _0x4002b0={'where':_0x3dfdf3[_0xf91d('0x3e')]};return db[_0xf91d('0x2e')][_0xf91d('0x1e')](_0x4002b0)[_0xf91d('0x23')](function(_0x17592a){_0x57c1d8[_0xf91d('0x1e')]=_0x17592a;if(_0xb59615[_0xf91d('0x33')][_0xf91d('0x43')]){_0x3dfdf3[_0xf91d('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf91d('0x45')](_0x3dfdf3);})[_0xf91d('0x23')](function(_0x3044e7){_0x57c1d8[_0xf91d('0x46')]=_0x3044e7;return _0x57c1d8;})[_0xf91d('0x23')](respondWithFilteredResult(_0x39a1bc,_0x3dfdf3))[_0xf91d('0x47')](handleError(_0x39a1bc,null));};exports['show']=function(_0x3d3c11,_0x119376){var _0x1a8dca={'raw':!![],'where':{'id':_0x3d3c11[_0xf91d('0x48')]['id']}},_0x3fd697={};_0x3fd697[_0xf91d('0x32')]=_[_0xf91d('0x34')](db['CannedAnswer']['rawAttributes']);_0x3fd697[_0xf91d('0x33')]=_[_0xf91d('0x34')](_0x3d3c11[_0xf91d('0x33')]);_0x3fd697['filters']=_[_0xf91d('0x36')](_0x3fd697[_0xf91d('0x32')],_0x3fd697['query']);_0x1a8dca[_0xf91d('0x37')]=_[_0xf91d('0x36')](_0x3fd697[_0xf91d('0x32')],qs[_0xf91d('0x38')](_0x3d3c11[_0xf91d('0x33')][_0xf91d('0x38')]));_0x1a8dca[_0xf91d('0x37')]=_0x1a8dca[_0xf91d('0x37')][_0xf91d('0x39')]?_0x1a8dca[_0xf91d('0x37')]:_0x3fd697[_0xf91d('0x32')];if(_0x3d3c11[_0xf91d('0x33')]['includeAll']){_0x1a8dca[_0xf91d('0x44')]=[{'all':!![]}];}_0x1a8dca=_[_0xf91d('0x40')]({},_0x1a8dca,_0x3d3c11[_0xf91d('0x42')]);return db['CannedAnswer'][_0xf91d('0x49')](_0x1a8dca)[_0xf91d('0x23')](handleEntityNotFound(_0x119376,null))[_0xf91d('0x23')](respondWithResult(_0x119376,null))['catch'](handleError(_0x119376,null));};exports['update']=function(_0x7eefca,_0x13f3b6){if(_0x7eefca['body']['id']){delete _0x7eefca[_0xf91d('0x4a')]['id'];}return db[_0xf91d('0x2e')]['find']({'where':{'id':_0x7eefca['params']['id']}})['then'](handleEntityNotFound(_0x13f3b6,null))['then'](saveUpdates(_0x7eefca[_0xf91d('0x4a')],null))['then'](respondWithResult(_0x13f3b6,null))[_0xf91d('0x47')](handleError(_0x13f3b6,null));};exports[_0xf91d('0x24')]=function(_0xca0820,_0x2e3a9f){return db[_0xf91d('0x2e')][_0xf91d('0x49')]({'where':{'id':_0xca0820[_0xf91d('0x48')]['id']}})[_0xf91d('0x23')](handleEntityNotFound(_0x2e3a9f,null))['then'](removeEntity(_0x2e3a9f,null))[_0xf91d('0x47')](handleError(_0x2e3a9f,null));};exports['create']=function(_0x2de373,_0x431424){var _0x3d8518={'key':_0x2de373[_0xf91d('0x4a')][_0xf91d('0x31')]};if(_0x2de373[_0xf91d('0x4a')]['MailAccountId']){_0x3d8518['MailAccountId']=_0x2de373[_0xf91d('0x4a')][_0xf91d('0x4b')];}else if(_0x2de373['body'][_0xf91d('0x4c')]){_0x3d8518[_0xf91d('0x4c')]=_0x2de373[_0xf91d('0x4a')][_0xf91d('0x4c')];}else if(_0x2de373[_0xf91d('0x4a')][_0xf91d('0x4d')]){_0x3d8518[_0xf91d('0x4d')]=_0x2de373['body'][_0xf91d('0x4d')];}else if(_0x2de373['body'][_0xf91d('0x4e')]){_0x3d8518[_0xf91d('0x4e')]=_0x2de373[_0xf91d('0x4a')][_0xf91d('0x4e')];}return db[_0xf91d('0x2e')][_0xf91d('0x49')]({'where':_0x3d8518})[_0xf91d('0x23')](function(_0x406f02){if(_0x406f02){throw new db[(_0xf91d('0x4f'))]['ValidationError'](_0xf91d('0x50'));}return db[_0xf91d('0x2e')][_0xf91d('0x51')](_0x2de373[_0xf91d('0x4a')]);})[_0xf91d('0x23')](function(_0xcd4d01){var _0x3a5109=_0x2de373[_0xf91d('0x52')][_0xf91d('0x25')]({'plain':!![]});if(!_0x3a5109)throw new Error(_0xf91d('0x53'));if(_0x3a5109[_0xf91d('0x54')]===_0xf91d('0x52')){var _0x20fc57=_0xcd4d01[_0xf91d('0x25')]({'plain':!![]});return db[_0xf91d('0x55')][_0xf91d('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3a5109[_0xf91d('0x56')]},'raw':!![]})[_0xf91d('0x23')](function(_0x5a8e02){if(_0x5a8e02&&_0x5a8e02['autoAssociation']===0x0){return db['UserProfileResource'][_0xf91d('0x51')]({'name':_0x20fc57['name'],'resourceId':_0x20fc57['id'],'type':_0x5a8e02[_0xf91d('0x2b')],'sectionId':_0x5a8e02['id']},{})[_0xf91d('0x23')](function(){return _0xcd4d01;});}else{return _0xcd4d01;}})['catch'](function(_0x2b4dc1){logger[_0xf91d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b4dc1);throw _0x2b4dc1;});}return _0xcd4d01;})['then'](respondWithResult(_0x431424,0xc9))['catch'](handleError(_0x431424,null));};
\ No newline at end of file
+var _0x4c21=['CannedAnswer','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','name','index'];(function(_0x1fd0c2,_0xc20d9b){var _0x57ccaa=function(_0xfe186d){while(--_0xfe186d){_0x1fd0c2['push'](_0x1fd0c2['shift']());}};_0x57ccaa(++_0xc20d9b);}(_0x4c21,0x88));var _0x14c2=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0x4c21[_0x65c0bb];return _0x320bd5;};'use strict';var emlformat=require(_0x14c2('0x0'));var rimraf=require(_0x14c2('0x1'));var zipdir=require(_0x14c2('0x2'));var jsonpatch=require(_0x14c2('0x3'));var rp=require(_0x14c2('0x4'));var moment=require(_0x14c2('0x5'));var BPromise=require(_0x14c2('0x6'));var Mustache=require(_0x14c2('0x7'));var util=require(_0x14c2('0x8'));var path=require('path');var sox=require(_0x14c2('0x9'));var csv=require('to-csv');var ejs=require(_0x14c2('0xa'));var fs=require('fs');var fs_extra=require(_0x14c2('0xb'));var _=require(_0x14c2('0xc'));var squel=require(_0x14c2('0xd'));var crypto=require('crypto');var jsforce=require(_0x14c2('0xe'));var deskjs=require(_0x14c2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x14c2('0x10'));var Redis=require(_0x14c2('0x11'));var authService=require(_0x14c2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x14c2('0x13'));var logger=require(_0x14c2('0x14'))(_0x14c2('0x15'));var utils=require(_0x14c2('0x16'));var config=require(_0x14c2('0x17'));var licenseUtil=require(_0x14c2('0x18'));var db=require(_0x14c2('0x19'))['db'];function respondWithStatusCode(_0x46b7c6,_0x247b8d){_0x247b8d=_0x247b8d||0xcc;return function(_0x2c8506){if(_0x2c8506){return _0x46b7c6[_0x14c2('0x1a')](_0x247b8d);}return _0x46b7c6[_0x14c2('0x1b')](_0x247b8d)[_0x14c2('0x1c')]();};}function respondWithResult(_0x2a75a2,_0x240b2c){_0x240b2c=_0x240b2c||0xc8;return function(_0x3ab0d8){if(_0x3ab0d8){return _0x2a75a2[_0x14c2('0x1b')](_0x240b2c)[_0x14c2('0x1d')](_0x3ab0d8);}};}function respondWithFilteredResult(_0x2e9215,_0x593b67){return function(_0x47c1ae){if(_0x47c1ae){var _0x2e562d=typeof _0x593b67['offset']==='undefined'&&typeof _0x593b67[_0x14c2('0x1e')]==='undefined';var _0x3e6512=_0x47c1ae[_0x14c2('0x1f')];var _0x2621a0=_0x2e562d?0x0:_0x593b67[_0x14c2('0x20')];var _0x2e7590=_0x2e562d?_0x47c1ae['count']:_0x593b67[_0x14c2('0x20')]+_0x593b67['limit'];var _0x54915e;if(_0x2e7590>=_0x3e6512){_0x2e7590=_0x3e6512;_0x54915e=0xc8;}else{_0x54915e=0xce;}_0x2e9215[_0x14c2('0x1b')](_0x54915e);return _0x2e9215['set'](_0x14c2('0x21'),_0x2621a0+'-'+_0x2e7590+'/'+_0x3e6512)[_0x14c2('0x1d')](_0x47c1ae);}return null;};}function patchUpdates(_0x5cfb0e){return function(_0x319061){try{jsonpatch[_0x14c2('0x22')](_0x319061,_0x5cfb0e,!![]);}catch(_0x2b239b){return BPromise[_0x14c2('0x23')](_0x2b239b);}return _0x319061[_0x14c2('0x24')]();};}function saveUpdates(_0x470b56,_0x3f561c){return function(_0x1f8ab9){if(_0x1f8ab9){return _0x1f8ab9[_0x14c2('0x25')](_0x470b56)[_0x14c2('0x26')](function(_0x23bebe){return _0x23bebe;});}return null;};}function removeEntity(_0x1611cf,_0x3ebb53){return function(_0x54032c){if(_0x54032c){return _0x54032c[_0x14c2('0x27')]()['then'](function(){var _0xe15fa9=_0x54032c['get']({'plain':!![]});var _0x5be4ab=_0x14c2('0x28');return db[_0x14c2('0x29')][_0x14c2('0x27')]({'where':{'type':_0x5be4ab,'resourceId':_0xe15fa9['id']}})[_0x14c2('0x26')](function(){return _0x54032c;});})[_0x14c2('0x26')](function(){_0x1611cf[_0x14c2('0x1b')](0xcc)[_0x14c2('0x1c')]();});}};}function handleEntityNotFound(_0x25144d,_0xe65e8c){return function(_0x5bd827){if(!_0x5bd827){_0x25144d[_0x14c2('0x1a')](0x194);}return _0x5bd827;};}function handleError(_0x23c834,_0xddef23){_0xddef23=_0xddef23||0x1f4;return function(_0x2c98ea){logger[_0x14c2('0x2a')](_0x2c98ea[_0x14c2('0x2b')]);if(_0x2c98ea['name']){delete _0x2c98ea[_0x14c2('0x2c')];}_0x23c834['status'](_0xddef23)['send'](_0x2c98ea);};}exports[_0x14c2('0x2d')]=function(_0x4c0bc1,_0x3fddcb){var _0x1bdb62={},_0x4e9718={},_0x3332e0={'count':0x0,'rows':[]};var _0x2dcb78=_['map'](db[_0x14c2('0x2e')]['rawAttributes'],function(_0x4fa764){return{'name':_0x4fa764[_0x14c2('0x2f')],'type':_0x4fa764[_0x14c2('0x30')][_0x14c2('0x31')]};});_0x4e9718[_0x14c2('0x32')]=_[_0x14c2('0x33')](_0x2dcb78,_0x14c2('0x2c'));_0x4e9718[_0x14c2('0x34')]=_[_0x14c2('0x35')](_0x4c0bc1['query']);_0x4e9718[_0x14c2('0x36')]=_[_0x14c2('0x37')](_0x4e9718[_0x14c2('0x32')],_0x4e9718['query']);_0x1bdb62['attributes']=_[_0x14c2('0x37')](_0x4e9718[_0x14c2('0x32')],qs[_0x14c2('0x38')](_0x4c0bc1[_0x14c2('0x34')][_0x14c2('0x38')]));_0x1bdb62[_0x14c2('0x39')]=_0x1bdb62['attributes'][_0x14c2('0x3a')]?_0x1bdb62['attributes']:_0x4e9718[_0x14c2('0x32')];if(!_0x4c0bc1[_0x14c2('0x34')][_0x14c2('0x3b')](_0x14c2('0x3c'))){_0x1bdb62[_0x14c2('0x1e')]=qs[_0x14c2('0x1e')](_0x4c0bc1['query'][_0x14c2('0x1e')]);_0x1bdb62[_0x14c2('0x20')]=qs[_0x14c2('0x20')](_0x4c0bc1[_0x14c2('0x34')][_0x14c2('0x20')]);}_0x1bdb62[_0x14c2('0x3d')]=qs['sort'](_0x4c0bc1[_0x14c2('0x34')]['sort']);_0x1bdb62[_0x14c2('0x3e')]=qs[_0x14c2('0x36')](_[_0x14c2('0x3f')](_0x4c0bc1[_0x14c2('0x34')],_0x4e9718['filters']),_0x2dcb78);if(_0x4c0bc1[_0x14c2('0x34')][_0x14c2('0x40')]){_0x1bdb62[_0x14c2('0x3e')]=_['merge'](_0x1bdb62[_0x14c2('0x3e')],{'$or':[{'key':{'$like':'%'+_0x4c0bc1['query'][_0x14c2('0x40')]+'%'}},{'value':{'$like':'%'+_0x4c0bc1['query'][_0x14c2('0x40')]+'%'}}]});}_0x1bdb62=_[_0x14c2('0x41')]({},_0x1bdb62,_0x4c0bc1[_0x14c2('0x42')]);var _0x8ce2cd={'where':_0x1bdb62[_0x14c2('0x3e')]};return db[_0x14c2('0x2e')]['count'](_0x8ce2cd)['then'](function(_0x28e59e){_0x3332e0['count']=_0x28e59e;if(_0x4c0bc1['query'][_0x14c2('0x43')]){_0x1bdb62[_0x14c2('0x44')]=[{'all':!![]}];}return db[_0x14c2('0x2e')][_0x14c2('0x45')](_0x1bdb62);})[_0x14c2('0x26')](function(_0x459ec5){_0x3332e0[_0x14c2('0x46')]=_0x459ec5;return _0x3332e0;})[_0x14c2('0x26')](respondWithFilteredResult(_0x3fddcb,_0x1bdb62))[_0x14c2('0x47')](handleError(_0x3fddcb,null));};exports[_0x14c2('0x48')]=function(_0x376358,_0x2030b5){var _0x147f20={'raw':!![],'where':{'id':_0x376358['params']['id']}},_0x2f6a06={};_0x2f6a06['model']=_[_0x14c2('0x35')](db['CannedAnswer'][_0x14c2('0x49')]);_0x2f6a06[_0x14c2('0x34')]=_[_0x14c2('0x35')](_0x376358[_0x14c2('0x34')]);_0x2f6a06[_0x14c2('0x36')]=_[_0x14c2('0x37')](_0x2f6a06[_0x14c2('0x32')],_0x2f6a06[_0x14c2('0x34')]);_0x147f20[_0x14c2('0x39')]=_['intersection'](_0x2f6a06['model'],qs[_0x14c2('0x38')](_0x376358[_0x14c2('0x34')][_0x14c2('0x38')]));_0x147f20['attributes']=_0x147f20[_0x14c2('0x39')][_0x14c2('0x3a')]?_0x147f20[_0x14c2('0x39')]:_0x2f6a06[_0x14c2('0x32')];if(_0x376358['query'][_0x14c2('0x43')]){_0x147f20[_0x14c2('0x44')]=[{'all':!![]}];}_0x147f20=_[_0x14c2('0x41')]({},_0x147f20,_0x376358[_0x14c2('0x42')]);return db[_0x14c2('0x2e')][_0x14c2('0x4a')](_0x147f20)[_0x14c2('0x26')](handleEntityNotFound(_0x2030b5,null))['then'](respondWithResult(_0x2030b5,null))[_0x14c2('0x47')](handleError(_0x2030b5,null));};exports[_0x14c2('0x25')]=function(_0xc02a6,_0x2d168e){if(_0xc02a6[_0x14c2('0x4b')]['id']){delete _0xc02a6[_0x14c2('0x4b')]['id'];}return db[_0x14c2('0x2e')][_0x14c2('0x4a')]({'where':{'id':_0xc02a6[_0x14c2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2d168e,null))[_0x14c2('0x26')](saveUpdates(_0xc02a6[_0x14c2('0x4b')],null))[_0x14c2('0x26')](respondWithResult(_0x2d168e,null))['catch'](handleError(_0x2d168e,null));};exports['destroy']=function(_0x426abd,_0x74450d){return db[_0x14c2('0x2e')][_0x14c2('0x4a')]({'where':{'id':_0x426abd[_0x14c2('0x4c')]['id']}})['then'](handleEntityNotFound(_0x74450d,null))[_0x14c2('0x26')](removeEntity(_0x74450d,null))['catch'](handleError(_0x74450d,null));};exports[_0x14c2('0x4d')]=function(_0x535147,_0x101321){var _0x5a54cc={'key':_0x535147[_0x14c2('0x4b')][_0x14c2('0x31')]};if(_0x535147['body'][_0x14c2('0x4e')]){_0x5a54cc[_0x14c2('0x4e')]=_0x535147['body'][_0x14c2('0x4e')];}else if(_0x535147['body']['SmsAccountId']){_0x5a54cc[_0x14c2('0x4f')]=_0x535147[_0x14c2('0x4b')]['SmsAccountId'];}else if(_0x535147[_0x14c2('0x4b')][_0x14c2('0x50')]){_0x5a54cc[_0x14c2('0x50')]=_0x535147[_0x14c2('0x4b')][_0x14c2('0x50')];}else if(_0x535147[_0x14c2('0x4b')][_0x14c2('0x51')]){_0x5a54cc[_0x14c2('0x51')]=_0x535147[_0x14c2('0x4b')][_0x14c2('0x51')];}return db[_0x14c2('0x2e')][_0x14c2('0x4a')]({'where':_0x5a54cc})['then'](function(_0x67ca86){if(_0x67ca86){throw new db[(_0x14c2('0x52'))]['ValidationError'](_0x14c2('0x53'));}return db['CannedAnswer']['create'](_0x535147[_0x14c2('0x4b')]);})['then'](function(_0x399618){var _0x4b271a=_0x535147[_0x14c2('0x54')]['get']({'plain':!![]});if(!_0x4b271a)throw new Error(_0x14c2('0x55'));if(_0x4b271a[_0x14c2('0x56')]===_0x14c2('0x54')){var _0x5bb13b=_0x399618[_0x14c2('0x57')]({'plain':!![]});return db[_0x14c2('0x58')][_0x14c2('0x4a')]({'where':{'name':_0x14c2('0x28'),'userProfileId':_0x4b271a[_0x14c2('0x59')]},'raw':!![]})['then'](function(_0x263b9d){if(_0x263b9d&&_0x263b9d[_0x14c2('0x5a')]===0x0){return db['UserProfileResource'][_0x14c2('0x4d')]({'name':_0x5bb13b['name'],'resourceId':_0x5bb13b['id'],'type':_0x263b9d[_0x14c2('0x2c')],'sectionId':_0x263b9d['id']},{})[_0x14c2('0x26')](function(){return _0x399618;});}else{return _0x399618;}})[_0x14c2('0x47')](function(_0x2256bd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2256bd);throw _0x2256bd;});}return _0x399618;})[_0x14c2('0x26')](respondWithResult(_0x101321,0xc9))[_0x14c2('0x47')](handleError(_0x101321,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index f6f959f..554f24e 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 _0xf35d=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x3b0413,_0xd316dd){var _0x4e8dd5=function(_0x205a11){while(--_0x205a11){_0x3b0413['push'](_0x3b0413['shift']());}};_0x4e8dd5(++_0xd316dd);}(_0xf35d,0x17c));var _0xdf35=function(_0x35be98,_0x533d82){_0x35be98=_0x35be98-0x0;var _0x5e2f45=_0xf35d[_0x35be98];return _0x5e2f45;};'use strict';var _=require(_0xdf35('0x0'));var util=require('util');var logger=require(_0xdf35('0x1'))('api');var moment=require(_0xdf35('0x2'));var BPromise=require(_0xdf35('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf35('0x4'));var rimraf=require('rimraf');var config=require(_0xdf35('0x5'));var attributes=require(_0xdf35('0x6'));module[_0xdf35('0x7')]=function(_0x7cfe71,_0x41036b){return _0x7cfe71[_0xdf35('0x8')](_0xdf35('0x9'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc953=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x4b826e,_0x33b6b){var _0x10e06c=function(_0x842a7b){while(--_0x842a7b){_0x4b826e['push'](_0x4b826e['shift']());}};_0x10e06c(++_0x33b6b);}(_0xc953,0x195));var _0x3c95=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xc953[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x3c95('0x0'));var util=require(_0x3c95('0x1'));var logger=require(_0x3c95('0x2'))(_0x3c95('0x3'));var moment=require(_0x3c95('0x4'));var BPromise=require('bluebird');var rp=require(_0x3c95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c95('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x3c95('0x7')]=function(_0x1fe09b,_0x31b33d){return _0x1fe09b[_0x3c95('0x8')](_0x3c95('0x9'),attributes,{'tableName':_0x3c95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c95('0xb'),'collate':_0x3c95('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 37be577..84e41bc 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(_0x4f097d,_0x588037){var _0x141bc3=function(_0x40ae17){while(--_0x40ae17){_0x4f097d['push'](_0x4f097d['shift']());}};_0x141bc3(++_0x588037);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x3ecd13,_0x13cc21){var _0x8b5c09=function(_0x288244){while(--_0x288244){_0x3ecd13['push'](_0x3ecd13['shift']());}};_0x8b5c09(++_0x13cc21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 000deb5..68ea2af 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 _0x7f26=['/:id','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','post','create','put'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x7f26,0x1f1));var _0x67f2=function(_0x22a481,_0x512770){_0x22a481=_0x22a481-0x0;var _0x5a4a04=_0x7f26[_0x22a481];return _0x5a4a04;};'use strict';var multer=require(_0x67f2('0x0'));var util=require('util');var path=require(_0x67f2('0x1'));var timeout=require(_0x67f2('0x2'));var express=require(_0x67f2('0x3'));var router=express[_0x67f2('0x4')]();var fs_extra=require(_0x67f2('0x5'));var auth=require(_0x67f2('0x6'));var interaction=require(_0x67f2('0x7'));var config=require(_0x67f2('0x8'));var controller=require(_0x67f2('0x9'));router[_0x67f2('0xa')]('/',auth[_0x67f2('0xb')](),controller[_0x67f2('0xc')]);router[_0x67f2('0xa')]('/:id',auth[_0x67f2('0xb')](),controller['show']);router[_0x67f2('0xd')]('/',auth[_0x67f2('0xb')](),controller[_0x67f2('0xe')]);router[_0x67f2('0xf')](_0x67f2('0x10'),auth[_0x67f2('0xb')](),controller[_0x67f2('0x11')]);router['delete'](_0x67f2('0x10'),auth[_0x67f2('0xb')](),controller[_0x67f2('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xa458=['isAuthenticated','show','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','index','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa458,0x195));var _0x8a45=function(_0x4fa23c,_0x120df9){_0x4fa23c=_0x4fa23c-0x0;var _0x516487=_0xa458[_0x4fa23c];return _0x516487;};'use strict';var multer=require(_0x8a45('0x0'));var util=require(_0x8a45('0x1'));var path=require(_0x8a45('0x2'));var timeout=require(_0x8a45('0x3'));var express=require('express');var router=express[_0x8a45('0x4')]();var fs_extra=require(_0x8a45('0x5'));var auth=require(_0x8a45('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8a45('0x7'));router[_0x8a45('0x8')]('/',auth['isAuthenticated'](),controller[_0x8a45('0x9')]);router['get'](_0x8a45('0xa'),auth[_0x8a45('0xb')](),controller[_0x8a45('0xc')]);router['post']('/',auth[_0x8a45('0xb')](),controller['create']);router['put']('/:id',auth[_0x8a45('0xb')](),controller[_0x8a45('0xd')]);router[_0x8a45('0xe')](_0x8a45('0xa'),auth[_0x8a45('0xb')](),controller[_0x8a45('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 52978ac..ea78381 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 _0xe74e=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x26db6a,_0x3cff3c){var _0x5ac65f=function(_0x2f4e1e){while(--_0x2f4e1e){_0x26db6a['push'](_0x26db6a['shift']());}};_0x5ac65f(++_0x3cff3c);}(_0xe74e,0x10a));var _0xee74=function(_0x291e6a,_0x94ec18){_0x291e6a=_0x291e6a-0x0;var _0x579e40=_0xe74e[_0x291e6a];return _0x579e40;};'use strict';var Sequelize=require('sequelize');module[_0xee74('0x0')]={'calldate':{'type':Sequelize[_0xee74('0x1')],'allowNull':![],'defaultValue':_0xee74('0x2')},'clid':{'type':Sequelize[_0xee74('0x3')]},'src':{'type':Sequelize[_0xee74('0x3')]},'dst':{'type':Sequelize[_0xee74('0x3')]},'dcontext':{'type':Sequelize[_0xee74('0x3')]},'channel':{'type':Sequelize[_0xee74('0x3')]},'dstchannel':{'type':Sequelize[_0xee74('0x3')]},'lastapp':{'type':Sequelize[_0xee74('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xee74('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xee74('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xee74('0x3')]},'uniqueid':{'type':Sequelize[_0xee74('0x3')]},'linkedid':{'type':Sequelize[_0xee74('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xee74('0x3')]},'tag':{'type':Sequelize[_0xee74('0x3')]}};
\ No newline at end of file
+var _0x61ea=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x1000a5,_0x238386){var _0x4d3077=function(_0x5dcce6){while(--_0x5dcce6){_0x1000a5['push'](_0x1000a5['shift']());}};_0x4d3077(++_0x238386);}(_0x61ea,0x1d5));var _0xa61e=function(_0x3cb09c,_0x43849e){_0x3cb09c=_0x3cb09c-0x0;var _0x2be7cc=_0x61ea[_0x3cb09c];return _0x2be7cc;};'use strict';var Sequelize=require(_0xa61e('0x0'));module[_0xa61e('0x1')]={'calldate':{'type':Sequelize[_0xa61e('0x2')],'allowNull':![],'defaultValue':_0xa61e('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xa61e('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa61e('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xa61e('0x4')]},'lastdata':{'type':Sequelize[_0xa61e('0x4')]},'duration':{'type':Sequelize[_0xa61e('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa61e('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa61e('0x4')]},'amaflags':{'type':Sequelize[_0xa61e('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa61e('0x4')]},'userfield':{'type':Sequelize[_0xa61e('0x4')]},'uniqueid':{'type':Sequelize[_0xa61e('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa61e('0x4')]},'tag':{'type':Sequelize[_0xa61e('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 5eb877d..8593a87 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 _0x1af3=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x77b86d,_0x200223){var _0x4e84b0=function(_0x7fc3f3){while(--_0x7fc3f3){_0x77b86d['push'](_0x77b86d['shift']());}};_0x4e84b0(++_0x200223);}(_0x1af3,0x1ca));var _0x31af=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x1af3[_0xf34b0a];return _0x5021e1;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require(_0x31af('0x3'));var rp=require(_0x31af('0x4'));var moment=require(_0x31af('0x5'));var BPromise=require(_0x31af('0x6'));var Mustache=require(_0x31af('0x7'));var util=require(_0x31af('0x8'));var path=require(_0x31af('0x9'));var sox=require('sox');var csv=require(_0x31af('0xa'));var ejs=require(_0x31af('0xb'));var fs=require('fs');var fs_extra=require(_0x31af('0xc'));var _=require(_0x31af('0xd'));var squel=require('squel');var crypto=require(_0x31af('0xe'));var jsforce=require(_0x31af('0xf'));var deskjs=require(_0x31af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x31af('0x11'));var Papa=require(_0x31af('0x12'));var Redis=require(_0x31af('0x13'));var authService=require(_0x31af('0x14'));var qs=require(_0x31af('0x15'));var as=require(_0x31af('0x16'));var hardwareService=require(_0x31af('0x17'));var logger=require(_0x31af('0x18'))('api');var utils=require(_0x31af('0x19'));var config=require(_0x31af('0x1a'));var licenseUtil=require(_0x31af('0x1b'));var db=require(_0x31af('0x1c'))['db'];function respondWithStatusCode(_0x144406,_0x481f20){_0x481f20=_0x481f20||0xcc;return function(_0x358fb4){if(_0x358fb4){return _0x144406[_0x31af('0x1d')](_0x481f20);}return _0x144406['status'](_0x481f20)['end']();};}function respondWithResult(_0x2a4727,_0x46a494){_0x46a494=_0x46a494||0xc8;return function(_0x14c57e){if(_0x14c57e){return _0x2a4727[_0x31af('0x1e')](_0x46a494)[_0x31af('0x1f')](_0x14c57e);}};}function respondWithFilteredResult(_0x1d35fa,_0x369934){return function(_0x37c275){if(_0x37c275){var _0xd431e4=typeof _0x369934[_0x31af('0x20')]===_0x31af('0x21')&&typeof _0x369934['limit']===_0x31af('0x21');var _0xd33b3f=_0x37c275[_0x31af('0x22')];var _0x477ada=_0xd431e4?0x0:_0x369934[_0x31af('0x20')];var _0x30a112=_0xd431e4?_0x37c275[_0x31af('0x22')]:_0x369934[_0x31af('0x20')]+_0x369934[_0x31af('0x23')];var _0x550870;if(_0x30a112>=_0xd33b3f){_0x30a112=_0xd33b3f;_0x550870=0xc8;}else{_0x550870=0xce;}_0x1d35fa[_0x31af('0x1e')](_0x550870);return _0x1d35fa[_0x31af('0x24')](_0x31af('0x25'),_0x477ada+'-'+_0x30a112+'/'+_0xd33b3f)[_0x31af('0x1f')](_0x37c275);}return null;};}function patchUpdates(_0x414ad8){return function(_0x5d96ca){try{jsonpatch[_0x31af('0x26')](_0x5d96ca,_0x414ad8,!![]);}catch(_0x46b03e){return BPromise[_0x31af('0x27')](_0x46b03e);}return _0x5d96ca[_0x31af('0x28')]();};}function saveUpdates(_0x394d13,_0x14c3f9){return function(_0x1ddfba){if(_0x1ddfba){return _0x1ddfba[_0x31af('0x29')](_0x394d13)[_0x31af('0x2a')](function(_0x6634e3){return _0x6634e3;});}return null;};}function removeEntity(_0x40aa32,_0x1a67e3){return function(_0x3a98d3){if(_0x3a98d3){return _0x3a98d3[_0x31af('0x2b')]()[_0x31af('0x2a')](function(){_0x40aa32['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d3832,_0x20a50c){return function(_0x2b3bad){if(!_0x2b3bad){_0x5d3832['sendStatus'](0x194);}return _0x2b3bad;};}function handleError(_0x4c958,_0x8f9f60){_0x8f9f60=_0x8f9f60||0x1f4;return function(_0x49812a){logger[_0x31af('0x2c')](_0x49812a[_0x31af('0x2d')]);if(_0x49812a['name']){delete _0x49812a[_0x31af('0x2e')];}_0x4c958[_0x31af('0x1e')](_0x8f9f60)[_0x31af('0x2f')](_0x49812a);};}exports[_0x31af('0x30')]=function(_0x3326a7,_0x5a1f41){var _0xb1f5b1={},_0x3eb61f={},_0x1e6df8={'count':0x0,'rows':[]};var _0x1f4eae=_[_0x31af('0x31')](db[_0x31af('0x32')][_0x31af('0x33')],function(_0x231438){return{'name':_0x231438[_0x31af('0x34')],'type':_0x231438[_0x31af('0x35')][_0x31af('0x36')]};});_0x3eb61f[_0x31af('0x37')]=_['map'](_0x1f4eae,_0x31af('0x2e'));_0x3eb61f[_0x31af('0x38')]=_['keys'](_0x3326a7['query']);_0x3eb61f['filters']=_[_0x31af('0x39')](_0x3eb61f['model'],_0x3eb61f[_0x31af('0x38')]);_0xb1f5b1[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x3eb61f[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x3326a7[_0x31af('0x38')]['fields']));_0xb1f5b1[_0x31af('0x3a')]=_0xb1f5b1[_0x31af('0x3a')][_0x31af('0x3c')]?_0xb1f5b1[_0x31af('0x3a')]:_0x3eb61f[_0x31af('0x37')];if(!_0x3326a7[_0x31af('0x38')][_0x31af('0x3d')](_0x31af('0x3e'))){_0xb1f5b1['limit']=qs[_0x31af('0x23')](_0x3326a7['query'][_0x31af('0x23')]);_0xb1f5b1[_0x31af('0x20')]=qs[_0x31af('0x20')](_0x3326a7[_0x31af('0x38')][_0x31af('0x20')]);}_0xb1f5b1['order']=qs['sort'](_0x3326a7['query'][_0x31af('0x3f')]);_0xb1f5b1[_0x31af('0x40')]=qs[_0x31af('0x41')](_[_0x31af('0x42')](_0x3326a7[_0x31af('0x38')],_0x3eb61f[_0x31af('0x41')]),_0x1f4eae);if(_0x3326a7[_0x31af('0x38')][_0x31af('0x43')]){_0xb1f5b1['where']=_[_0x31af('0x44')](_0xb1f5b1[_0x31af('0x40')],{'$or':_[_0x31af('0x31')](_0x1f4eae,function(_0x2a5cde){if(_0x2a5cde[_0x31af('0x35')]!==_0x31af('0x45')){var _0x32d1b9={};_0x32d1b9[_0x2a5cde[_0x31af('0x2e')]]={'$like':'%'+_0x3326a7[_0x31af('0x38')]['filter']+'%'};return _0x32d1b9;}})});}_0xb1f5b1=_[_0x31af('0x44')]({},_0xb1f5b1,_0x3326a7['options']);var _0x447a01={'where':_0xb1f5b1['where']};return db['Cdr'][_0x31af('0x22')](_0x447a01)[_0x31af('0x2a')](function(_0x110f38){_0x1e6df8[_0x31af('0x22')]=_0x110f38;if(_0x3326a7[_0x31af('0x38')][_0x31af('0x46')]){_0xb1f5b1[_0x31af('0x47')]=[{'all':!![]}];}return db['Cdr'][_0x31af('0x48')](_0xb1f5b1);})[_0x31af('0x2a')](function(_0xb53565){_0x1e6df8['rows']=_0xb53565;return _0x1e6df8;})[_0x31af('0x2a')](respondWithFilteredResult(_0x5a1f41,_0xb1f5b1))[_0x31af('0x49')](handleError(_0x5a1f41,null));};exports[_0x31af('0x4a')]=function(_0x23942b,_0x34205a){var _0x57da2c={'raw':!![],'where':{'id':_0x23942b[_0x31af('0x4b')]['id']}},_0x12357c={};_0x12357c[_0x31af('0x37')]=_[_0x31af('0x4c')](db['Cdr'][_0x31af('0x33')]);_0x12357c[_0x31af('0x38')]=_['keys'](_0x23942b[_0x31af('0x38')]);_0x12357c[_0x31af('0x41')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],_0x12357c[_0x31af('0x38')]);_0x57da2c[_0x31af('0x3a')]=_[_0x31af('0x39')](_0x12357c[_0x31af('0x37')],qs[_0x31af('0x3b')](_0x23942b[_0x31af('0x38')]['fields']));_0x57da2c['attributes']=_0x57da2c[_0x31af('0x3a')]['length']?_0x57da2c[_0x31af('0x3a')]:_0x12357c[_0x31af('0x37')];if(_0x23942b[_0x31af('0x38')]['includeAll']){_0x57da2c['include']=[{'all':!![]}];}_0x57da2c=_[_0x31af('0x44')]({},_0x57da2c,_0x23942b['options']);return db[_0x31af('0x32')][_0x31af('0x4d')](_0x57da2c)[_0x31af('0x2a')](handleEntityNotFound(_0x34205a,null))[_0x31af('0x2a')](respondWithResult(_0x34205a,null))['catch'](handleError(_0x34205a,null));};exports['create']=function(_0x407386,_0x3acff1){return db[_0x31af('0x32')][_0x31af('0x4e')](_0x407386['body'],{})[_0x31af('0x2a')](respondWithResult(_0x3acff1,0xc9))[_0x31af('0x49')](handleError(_0x3acff1,null));};exports[_0x31af('0x29')]=function(_0x4ad7a6,_0x5a1cbe){if(_0x4ad7a6[_0x31af('0x4f')]['id']){delete _0x4ad7a6[_0x31af('0x4f')]['id'];}return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x4ad7a6[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x5a1cbe,null))[_0x31af('0x2a')](saveUpdates(_0x4ad7a6[_0x31af('0x4f')],null))[_0x31af('0x2a')](respondWithResult(_0x5a1cbe,null))[_0x31af('0x49')](handleError(_0x5a1cbe,null));};exports['destroy']=function(_0x441362,_0x29de7e){return db[_0x31af('0x32')][_0x31af('0x4d')]({'where':{'id':_0x441362[_0x31af('0x4b')]['id']}})[_0x31af('0x2a')](handleEntityNotFound(_0x29de7e,null))[_0x31af('0x2a')](removeEntity(_0x29de7e,null))[_0x31af('0x49')](handleError(_0x29de7e,null));};exports[_0x31af('0x50')]=function(_0x25369b,_0x3bfbae){return db[_0x31af('0x32')][_0x31af('0x50')]()[_0x31af('0x2a')](respondWithResult(_0x3bfbae,null))['catch'](handleError(_0x3bfbae,null));};
\ No newline at end of file
+var _0x8ce1=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','send','index','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x8ce1,0x183));var _0x18ce=function(_0x3d1c96,_0x526df2){_0x3d1c96=_0x3d1c96-0x0;var _0x17f4d9=_0x8ce1[_0x3d1c96];return _0x17f4d9;};'use strict';var emlformat=require(_0x18ce('0x0'));var rimraf=require(_0x18ce('0x1'));var zipdir=require(_0x18ce('0x2'));var jsonpatch=require(_0x18ce('0x3'));var rp=require(_0x18ce('0x4'));var moment=require(_0x18ce('0x5'));var BPromise=require(_0x18ce('0x6'));var Mustache=require(_0x18ce('0x7'));var util=require(_0x18ce('0x8'));var path=require(_0x18ce('0x9'));var sox=require(_0x18ce('0xa'));var csv=require(_0x18ce('0xb'));var ejs=require(_0x18ce('0xc'));var fs=require('fs');var fs_extra=require(_0x18ce('0xd'));var _=require(_0x18ce('0xe'));var squel=require(_0x18ce('0xf'));var crypto=require('crypto');var jsforce=require(_0x18ce('0x10'));var deskjs=require(_0x18ce('0x11'));var toCsv=require(_0x18ce('0xb'));var querystring=require(_0x18ce('0x12'));var Papa=require('papaparse');var Redis=require(_0x18ce('0x13'));var authService=require(_0x18ce('0x14'));var qs=require(_0x18ce('0x15'));var as=require(_0x18ce('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x18ce('0x17'));var utils=require(_0x18ce('0x18'));var config=require(_0x18ce('0x19'));var licenseUtil=require(_0x18ce('0x1a'));var db=require(_0x18ce('0x1b'))['db'];function respondWithStatusCode(_0x5e8c23,_0xbd514b){_0xbd514b=_0xbd514b||0xcc;return function(_0x402ba4){if(_0x402ba4){return _0x5e8c23[_0x18ce('0x1c')](_0xbd514b);}return _0x5e8c23[_0x18ce('0x1d')](_0xbd514b)[_0x18ce('0x1e')]();};}function respondWithResult(_0x5daf04,_0x176797){_0x176797=_0x176797||0xc8;return function(_0xdd4626){if(_0xdd4626){return _0x5daf04[_0x18ce('0x1d')](_0x176797)[_0x18ce('0x1f')](_0xdd4626);}};}function respondWithFilteredResult(_0x46e346,_0x36b5da){return function(_0x17460e){if(_0x17460e){var _0x4a934f=typeof _0x36b5da[_0x18ce('0x20')]===_0x18ce('0x21')&&typeof _0x36b5da[_0x18ce('0x22')]===_0x18ce('0x21');var _0x1edc10=_0x17460e[_0x18ce('0x23')];var _0x482458=_0x4a934f?0x0:_0x36b5da[_0x18ce('0x20')];var _0x29c691=_0x4a934f?_0x17460e[_0x18ce('0x23')]:_0x36b5da['offset']+_0x36b5da[_0x18ce('0x22')];var _0x2fa3d4;if(_0x29c691>=_0x1edc10){_0x29c691=_0x1edc10;_0x2fa3d4=0xc8;}else{_0x2fa3d4=0xce;}_0x46e346[_0x18ce('0x1d')](_0x2fa3d4);return _0x46e346['set'](_0x18ce('0x24'),_0x482458+'-'+_0x29c691+'/'+_0x1edc10)[_0x18ce('0x1f')](_0x17460e);}return null;};}function patchUpdates(_0x5d22cd){return function(_0x29c1ab){try{jsonpatch[_0x18ce('0x25')](_0x29c1ab,_0x5d22cd,!![]);}catch(_0x16802e){return BPromise[_0x18ce('0x26')](_0x16802e);}return _0x29c1ab[_0x18ce('0x27')]();};}function saveUpdates(_0xd41f29,_0x35abf9){return function(_0x545459){if(_0x545459){return _0x545459[_0x18ce('0x28')](_0xd41f29)['then'](function(_0x482c90){return _0x482c90;});}return null;};}function removeEntity(_0x5d2299,_0x32e910){return function(_0x576ecc){if(_0x576ecc){return _0x576ecc[_0x18ce('0x29')]()[_0x18ce('0x2a')](function(){_0x5d2299[_0x18ce('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53abbd,_0x55e17c){return function(_0x317812){if(!_0x317812){_0x53abbd[_0x18ce('0x1c')](0x194);}return _0x317812;};}function handleError(_0x12dbd2,_0x461113){_0x461113=_0x461113||0x1f4;return function(_0x62b2bd){logger[_0x18ce('0x2b')](_0x62b2bd['stack']);if(_0x62b2bd['name']){delete _0x62b2bd['name'];}_0x12dbd2[_0x18ce('0x1d')](_0x461113)[_0x18ce('0x2c')](_0x62b2bd);};}exports[_0x18ce('0x2d')]=function(_0x5f3ec2,_0x1a87f6){var _0xf2683f={},_0x1988e4={},_0x5ef96c={'count':0x0,'rows':[]};var _0x56d296=_['map'](db[_0x18ce('0x2e')][_0x18ce('0x2f')],function(_0x5c2d96){return{'name':_0x5c2d96['fieldName'],'type':_0x5c2d96[_0x18ce('0x30')][_0x18ce('0x31')]};});_0x1988e4[_0x18ce('0x32')]=_['map'](_0x56d296,'name');_0x1988e4[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x5f3ec2[_0x18ce('0x33')]);_0x1988e4[_0x18ce('0x35')]=_[_0x18ce('0x36')](_0x1988e4[_0x18ce('0x32')],_0x1988e4[_0x18ce('0x33')]);_0xf2683f[_0x18ce('0x37')]=_['intersection'](_0x1988e4['model'],qs[_0x18ce('0x38')](_0x5f3ec2[_0x18ce('0x33')]['fields']));_0xf2683f[_0x18ce('0x37')]=_0xf2683f['attributes'][_0x18ce('0x39')]?_0xf2683f['attributes']:_0x1988e4[_0x18ce('0x32')];if(!_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3a')]('nolimit')){_0xf2683f['limit']=qs[_0x18ce('0x22')](_0x5f3ec2[_0x18ce('0x33')]['limit']);_0xf2683f['offset']=qs[_0x18ce('0x20')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x20')]);}_0xf2683f[_0x18ce('0x3b')]=qs[_0x18ce('0x3c')](_0x5f3ec2[_0x18ce('0x33')][_0x18ce('0x3c')]);_0xf2683f[_0x18ce('0x3d')]=qs[_0x18ce('0x35')](_[_0x18ce('0x3e')](_0x5f3ec2[_0x18ce('0x33')],_0x1988e4[_0x18ce('0x35')]),_0x56d296);if(_0x5f3ec2[_0x18ce('0x33')]['filter']){_0xf2683f[_0x18ce('0x3d')]=_[_0x18ce('0x3f')](_0xf2683f[_0x18ce('0x3d')],{'$or':_[_0x18ce('0x40')](_0x56d296,function(_0x1e67dd){if(_0x1e67dd[_0x18ce('0x30')]!==_0x18ce('0x41')){var _0x27c55a={};_0x27c55a[_0x1e67dd[_0x18ce('0x42')]]={'$like':'%'+_0x5f3ec2[_0x18ce('0x33')]['filter']+'%'};return _0x27c55a;}})});}_0xf2683f=_['merge']({},_0xf2683f,_0x5f3ec2[_0x18ce('0x43')]);var _0x23486c={'where':_0xf2683f[_0x18ce('0x3d')]};return db[_0x18ce('0x2e')][_0x18ce('0x23')](_0x23486c)[_0x18ce('0x2a')](function(_0x2eba88){_0x5ef96c['count']=_0x2eba88;if(_0x5f3ec2['query'][_0x18ce('0x44')]){_0xf2683f[_0x18ce('0x45')]=[{'all':!![]}];}return db['Cdr'][_0x18ce('0x46')](_0xf2683f);})[_0x18ce('0x2a')](function(_0x2941ce){_0x5ef96c[_0x18ce('0x47')]=_0x2941ce;return _0x5ef96c;})[_0x18ce('0x2a')](respondWithFilteredResult(_0x1a87f6,_0xf2683f))[_0x18ce('0x48')](handleError(_0x1a87f6,null));};exports[_0x18ce('0x49')]=function(_0x2a96a7,_0x33b409){var _0x1d6d5f={'raw':!![],'where':{'id':_0x2a96a7[_0x18ce('0x4a')]['id']}},_0x3885e6={};_0x3885e6['model']=_[_0x18ce('0x34')](db[_0x18ce('0x2e')][_0x18ce('0x2f')]);_0x3885e6[_0x18ce('0x33')]=_[_0x18ce('0x34')](_0x2a96a7[_0x18ce('0x33')]);_0x3885e6[_0x18ce('0x35')]=_['intersection'](_0x3885e6['model'],_0x3885e6[_0x18ce('0x33')]);_0x1d6d5f[_0x18ce('0x37')]=_[_0x18ce('0x36')](_0x3885e6[_0x18ce('0x32')],qs['fields'](_0x2a96a7[_0x18ce('0x33')][_0x18ce('0x38')]));_0x1d6d5f[_0x18ce('0x37')]=_0x1d6d5f['attributes']['length']?_0x1d6d5f[_0x18ce('0x37')]:_0x3885e6[_0x18ce('0x32')];if(_0x2a96a7['query'][_0x18ce('0x44')]){_0x1d6d5f[_0x18ce('0x45')]=[{'all':!![]}];}_0x1d6d5f=_[_0x18ce('0x3f')]({},_0x1d6d5f,_0x2a96a7[_0x18ce('0x43')]);return db[_0x18ce('0x2e')][_0x18ce('0x4b')](_0x1d6d5f)[_0x18ce('0x2a')](handleEntityNotFound(_0x33b409,null))['then'](respondWithResult(_0x33b409,null))[_0x18ce('0x48')](handleError(_0x33b409,null));};exports[_0x18ce('0x4c')]=function(_0x476c6a,_0x1e445d){return db[_0x18ce('0x2e')][_0x18ce('0x4c')](_0x476c6a[_0x18ce('0x4d')],{})[_0x18ce('0x2a')](respondWithResult(_0x1e445d,0xc9))[_0x18ce('0x48')](handleError(_0x1e445d,null));};exports[_0x18ce('0x28')]=function(_0x1211d0,_0x3f9960){if(_0x1211d0[_0x18ce('0x4d')]['id']){delete _0x1211d0[_0x18ce('0x4d')]['id'];}return db['Cdr'][_0x18ce('0x4b')]({'where':{'id':_0x1211d0[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f9960,null))[_0x18ce('0x2a')](saveUpdates(_0x1211d0['body'],null))[_0x18ce('0x2a')](respondWithResult(_0x3f9960,null))['catch'](handleError(_0x3f9960,null));};exports[_0x18ce('0x29')]=function(_0x188f57,_0x3d5b1b){return db[_0x18ce('0x2e')]['find']({'where':{'id':_0x188f57[_0x18ce('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d5b1b,null))['then'](removeEntity(_0x3d5b1b,null))[_0x18ce('0x48')](handleError(_0x3d5b1b,null));};exports[_0x18ce('0x4e')]=function(_0x8aa4a7,_0x5f164a){return db['Cdr'][_0x18ce('0x4e')]()[_0x18ce('0x2a')](respondWithResult(_0x5f164a,null))[_0x18ce('0x48')](handleError(_0x5f164a,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 3feac5a..1e81156 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(_0x3bc4f4,_0x1e2b47){var _0x9f4cea=function(_0x4080cb){while(--_0x4080cb){_0x3bc4f4['push'](_0x3bc4f4['shift']());}};_0x9f4cea(++_0x1e2b47);}(_0x7a54,0x106));var _0x47a5=function(_0x39ef4a,_0x5c17f4){_0x39ef4a=_0x39ef4a-0x0;var _0x2ef9b8=_0x7a54[_0x39ef4a];return _0x2ef9b8;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x271a66,_0x232cf3){var _0x500259=function(_0x3f55b1){while(--_0x3f55b1){_0x271a66['push'](_0x271a66['shift']());}};_0x500259(++_0x232cf3);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 38fe41d..d3715eb 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 _0x24d6=['error','message','catch','Cdr,\x20%s,\x20%s','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify'];(function(_0x5affa4,_0x4ba102){var _0x4eb0f3=function(_0x274bbb){while(--_0x274bbb){_0x5affa4['push'](_0x5affa4['shift']());}};_0x4eb0f3(++_0x4ba102);}(_0x24d6,0x17e));var _0x624d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x24d6[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x624d('0x0'));var fs=require('fs');var Redis=require(_0x624d('0x1'));var db=require(_0x624d('0x2'))['db'];var utils=require(_0x624d('0x3'));var logger=require(_0x624d('0x4'))(_0x624d('0x5'));var config=require(_0x624d('0x6'));var jayson=require(_0x624d('0x7'));var client=jayson[_0x624d('0x8')][_0x624d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8773,_0x58dc93,_0x4d5a48){return new BPromise(function(_0xe56aee,_0x20737d){return client['request'](_0x2c8773,_0x4d5a48)[_0x624d('0xa')](function(_0x55ec28){logger[_0x624d('0xb')]('Cdr,\x20%s,\x20%s',_0x58dc93,_0x624d('0xc'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x58dc93,_0x624d('0xc'),JSON[_0x624d('0xd')](_0x55ec28));if(_0x55ec28[_0x624d('0xe')]){if(_0x55ec28[_0x624d('0xe')]['code']===0x1f4){logger[_0x624d('0xe')]('Cdr,\x20%s,\x20%s',_0x58dc93,_0x55ec28[_0x624d('0xe')][_0x624d('0xf')]);return _0x20737d(_0x55ec28[_0x624d('0xe')]['message']);}logger[_0x624d('0xe')]('Cdr,\x20%s,\x20%s',_0x58dc93,_0x55ec28['error'][_0x624d('0xf')]);return _0xe56aee(_0x55ec28[_0x624d('0xe')][_0x624d('0xf')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x58dc93,_0x624d('0xc'));_0xe56aee(_0x55ec28['result'][_0x624d('0xf')]);}})[_0x624d('0x10')](function(_0x471e69){logger['error'](_0x624d('0x11'),_0x58dc93,_0x471e69);_0x20737d(_0x471e69);});});}
\ No newline at end of file
+var _0x454a=['http','request','then','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x454a,0xbb));var _0xa454=function(_0x2ab3b1,_0x1a4a5c){_0x2ab3b1=_0x2ab3b1-0x0;var _0x29ae68=_0x454a[_0x2ab3b1];return _0x29ae68;};'use strict';var _=require(_0xa454('0x0'));var util=require(_0xa454('0x1'));var moment=require(_0xa454('0x2'));var BPromise=require('bluebird');var rs=require(_0xa454('0x3'));var fs=require('fs');var Redis=require(_0xa454('0x4'));var db=require(_0xa454('0x5'))['db'];var utils=require(_0xa454('0x6'));var logger=require(_0xa454('0x7'))(_0xa454('0x8'));var config=require(_0xa454('0x9'));var jayson=require(_0xa454('0xa'));var client=jayson['client'][_0xa454('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bff92,_0x2455f5,_0x219bbf){return new BPromise(function(_0x4934d0,_0x2e30ee){return client[_0xa454('0xc')](_0x4bff92,_0x219bbf)[_0xa454('0xd')](function(_0xee4f22){logger['info'](_0xa454('0xe'),_0x2455f5,'request\x20sent');logger[_0xa454('0xf')](_0xa454('0x10'),_0x2455f5,_0xa454('0x11'),JSON['stringify'](_0xee4f22));if(_0xee4f22['error']){if(_0xee4f22[_0xa454('0x12')]['code']===0x1f4){logger[_0xa454('0x12')](_0xa454('0xe'),_0x2455f5,_0xee4f22[_0xa454('0x12')][_0xa454('0x13')]);return _0x2e30ee(_0xee4f22['error']['message']);}logger[_0xa454('0x12')](_0xa454('0xe'),_0x2455f5,_0xee4f22[_0xa454('0x12')]['message']);return _0x4934d0(_0xee4f22['error'][_0xa454('0x13')]);}else{logger['info'](_0xa454('0xe'),_0x2455f5,_0xa454('0x11'));_0x4934d0(_0xee4f22[_0xa454('0x14')][_0xa454('0x13')]);}})[_0xa454('0x15')](function(_0xf861ef){logger['error'](_0xa454('0xe'),_0x2455f5,_0xf861ef);_0x2e30ee(_0xf861ef);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 161566d..40a4725 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 _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1eed52,_0x1bb3c1){var _0x57782a=function(_0x2cb894){while(--_0x2cb894){_0x1eed52['push'](_0x1eed52['shift']());}};_0x57782a(++_0x1bb3c1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('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(_0x53cf52,_0x3040a3){var _0xe1f7c7=function(_0x54dcf0){while(--_0x54dcf0){_0x53cf52['push'](_0x53cf52['shift']());}};_0xe1f7c7(++_0x3040a3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2e30d8,_0x344b2c){_0x2e30d8=_0x2e30d8-0x0;var _0x347234=_0xb10b[_0x2e30d8];return _0x347234;};'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 254c12b..64c18d6 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 _0x2925=['noop','TEXT','*,*,*,*','exports','STRING'];(function(_0x23d075,_0x341f61){var _0x205e13=function(_0x2246b5){while(--_0x2246b5){_0x23d075['push'](_0x23d075['shift']());}};_0x205e13(++_0x341f61);}(_0x2925,0x1d9));var _0x5292=function(_0x1ebdd0,_0x346a06){_0x1ebdd0=_0x1ebdd0-0x0;var _0x38829e=_0x2925[_0x1ebdd0];return _0x38829e;};'use strict';var Sequelize=require('sequelize');module[_0x5292('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5292('0x1')],'allowNull':![],'defaultValue':_0x5292('0x2')},'appdata':{'type':Sequelize[_0x5292('0x3')]()},'description':{'type':Sequelize[_0x5292('0x1')]},'interval':{'type':Sequelize[_0x5292('0x1')],'defaultValue':_0x5292('0x4')}};
\ No newline at end of file
+var _0xc1e3=['STRING','noop','TEXT','sequelize','INTEGER'];(function(_0x249a86,_0x1a7e3c){var _0x264d34=function(_0x38f8ea){while(--_0x38f8ea){_0x249a86['push'](_0x249a86['shift']());}};_0x264d34(++_0x1a7e3c);}(_0xc1e3,0x148));var _0x3c1e=function(_0x1de6cb,_0x532a6c){_0x1de6cb=_0x1de6cb-0x0;var _0x1dd289=_0xc1e3[_0x1de6cb];return _0x1dd289;};'use strict';var Sequelize=require(_0x3c1e('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3c1e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3c1e('0x2')],'allowNull':![],'defaultValue':_0x3c1e('0x3')},'appdata':{'type':Sequelize[_0x3c1e('0x4')]()},'description':{'type':Sequelize[_0x3c1e('0x2')]},'interval':{'type':Sequelize[_0x3c1e('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5b62ff6..3b8f774 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 _0x4156=['options','find','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','stack','name','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','length','includeAll','include','merge'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x4156,0xf1));var _0x6415=function(_0x55e007,_0xa44bac){_0x55e007=_0x55e007-0x0;var _0xe6c2a=_0x4156[_0x55e007];return _0xe6c2a;};'use strict';var emlformat=require(_0x6415('0x0'));var rimraf=require(_0x6415('0x1'));var zipdir=require(_0x6415('0x2'));var jsonpatch=require(_0x6415('0x3'));var rp=require(_0x6415('0x4'));var moment=require('moment');var BPromise=require(_0x6415('0x5'));var Mustache=require(_0x6415('0x6'));var util=require(_0x6415('0x7'));var path=require(_0x6415('0x8'));var sox=require(_0x6415('0x9'));var csv=require(_0x6415('0xa'));var ejs=require(_0x6415('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6415('0xc'));var squel=require('squel');var crypto=require(_0x6415('0xd'));var jsforce=require(_0x6415('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6415('0xa'));var querystring=require(_0x6415('0xf'));var Papa=require(_0x6415('0x10'));var Redis=require(_0x6415('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6415('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6415('0x13'))(_0x6415('0x14'));var utils=require(_0x6415('0x15'));var config=require(_0x6415('0x16'));var licenseUtil=require(_0x6415('0x17'));var db=require(_0x6415('0x18'))['db'];function respondWithStatusCode(_0x455f44,_0x596b97){_0x596b97=_0x596b97||0xcc;return function(_0x5b3493){if(_0x5b3493){return _0x455f44[_0x6415('0x19')](_0x596b97);}return _0x455f44[_0x6415('0x1a')](_0x596b97)[_0x6415('0x1b')]();};}function respondWithResult(_0xf75bec,_0x21ae74){_0x21ae74=_0x21ae74||0xc8;return function(_0x5b2a26){if(_0x5b2a26){return _0xf75bec['status'](_0x21ae74)[_0x6415('0x1c')](_0x5b2a26);}};}function respondWithFilteredResult(_0x780643,_0x48017d){return function(_0x1d540c){if(_0x1d540c){var _0x41f9b0=typeof _0x48017d['offset']==='undefined'&&typeof _0x48017d[_0x6415('0x1d')]===_0x6415('0x1e');var _0x3f739d=_0x1d540c[_0x6415('0x1f')];var _0x2ef73b=_0x41f9b0?0x0:_0x48017d[_0x6415('0x20')];var _0x2c74c6=_0x41f9b0?_0x1d540c[_0x6415('0x1f')]:_0x48017d[_0x6415('0x20')]+_0x48017d['limit'];var _0x551985;if(_0x2c74c6>=_0x3f739d){_0x2c74c6=_0x3f739d;_0x551985=0xc8;}else{_0x551985=0xce;}_0x780643['status'](_0x551985);return _0x780643[_0x6415('0x21')](_0x6415('0x22'),_0x2ef73b+'-'+_0x2c74c6+'/'+_0x3f739d)[_0x6415('0x1c')](_0x1d540c);}return null;};}function patchUpdates(_0x1e58f2){return function(_0x551632){try{jsonpatch[_0x6415('0x23')](_0x551632,_0x1e58f2,!![]);}catch(_0x3f4400){return BPromise[_0x6415('0x24')](_0x3f4400);}return _0x551632['save']();};}function saveUpdates(_0x287ac9,_0x266f97){return function(_0x7c567f){if(_0x7c567f){return _0x7c567f[_0x6415('0x25')](_0x287ac9)[_0x6415('0x26')](function(_0x3e33d3){return _0x3e33d3;});}return null;};}function removeEntity(_0x339c50,_0x41c266){return function(_0x1496c1){if(_0x1496c1){return _0x1496c1['destroy']()[_0x6415('0x26')](function(){_0x339c50[_0x6415('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15be31,_0x2b202c){return function(_0x2a936f){if(!_0x2a936f){_0x15be31[_0x6415('0x19')](0x194);}return _0x2a936f;};}function handleError(_0x31dabc,_0x5b5f39){_0x5b5f39=_0x5b5f39||0x1f4;return function(_0x30d857){logger['error'](_0x30d857[_0x6415('0x27')]);if(_0x30d857[_0x6415('0x28')]){delete _0x30d857[_0x6415('0x28')];}_0x31dabc['status'](_0x5b5f39)['send'](_0x30d857);};}exports['show']=function(_0x61e827,_0x31f717){var _0x581bc7={'raw':!![],'where':{'id':_0x61e827[_0x6415('0x29')]['id']}},_0x5bf08d={};_0x5bf08d[_0x6415('0x2a')]=_[_0x6415('0x2b')](db[_0x6415('0x2c')][_0x6415('0x2d')]);_0x5bf08d[_0x6415('0x2e')]=_['keys'](_0x61e827[_0x6415('0x2e')]);_0x5bf08d[_0x6415('0x2f')]=_[_0x6415('0x30')](_0x5bf08d[_0x6415('0x2a')],_0x5bf08d['query']);_0x581bc7['attributes']=_['intersection'](_0x5bf08d[_0x6415('0x2a')],qs['fields'](_0x61e827[_0x6415('0x2e')]['fields']));_0x581bc7[_0x6415('0x31')]=_0x581bc7[_0x6415('0x31')][_0x6415('0x32')]?_0x581bc7[_0x6415('0x31')]:_0x5bf08d['model'];if(_0x61e827['query'][_0x6415('0x33')]){_0x581bc7[_0x6415('0x34')]=[{'all':!![]}];}_0x581bc7=_[_0x6415('0x35')]({},_0x581bc7,_0x61e827[_0x6415('0x36')]);return db[_0x6415('0x2c')][_0x6415('0x37')](_0x581bc7)['then'](handleEntityNotFound(_0x31f717,null))[_0x6415('0x26')](respondWithResult(_0x31f717,null))['catch'](handleError(_0x31f717,null));};exports['update']=function(_0x4e07c6,_0x587b47){if(_0x4e07c6[_0x6415('0x38')]['id']){delete _0x4e07c6[_0x6415('0x38')]['id'];}return db[_0x6415('0x2c')]['find']({'where':{'id':_0x4e07c6[_0x6415('0x29')]['id']}})[_0x6415('0x26')](handleEntityNotFound(_0x587b47,null))['then'](saveUpdates(_0x4e07c6[_0x6415('0x38')],null))[_0x6415('0x26')](respondWithResult(_0x587b47,null))[_0x6415('0x39')](handleError(_0x587b47,null));};exports[_0x6415('0x3a')]=function(_0x248a5e,_0x59d828){return db[_0x6415('0x2c')]['find']({'where':{'id':_0x248a5e[_0x6415('0x29')]['id']}})[_0x6415('0x26')](handleEntityNotFound(_0x59d828,null))['then'](removeEntity(_0x59d828,null))[_0x6415('0x39')](handleError(_0x59d828,null));};
\ No newline at end of file
+var _0xcbe1=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','set','apply','save','update','then','destroy','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','find','catch','body','rimraf','bluebird','mustache','path','to-csv','ejs'];(function(_0x2e35a6,_0x5ef737){var _0x450c20=function(_0x4c68cf){while(--_0x4c68cf){_0x2e35a6['push'](_0x2e35a6['shift']());}};_0x450c20(++_0x5ef737);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x114e6a,_0x3dc9d2){_0x114e6a=_0x114e6a-0x0;var _0x423189=_0xcbe1[_0x114e6a];return _0x423189;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cbe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1cbe('0x1'));var Mustache=require(_0x1cbe('0x2'));var util=require('util');var path=require(_0x1cbe('0x3'));var sox=require('sox');var csv=require(_0x1cbe('0x4'));var ejs=require(_0x1cbe('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cbe('0x6'));var squel=require(_0x1cbe('0x7'));var crypto=require(_0x1cbe('0x8'));var jsforce=require(_0x1cbe('0x9'));var deskjs=require(_0x1cbe('0xa'));var toCsv=require(_0x1cbe('0x4'));var querystring=require(_0x1cbe('0xb'));var Papa=require(_0x1cbe('0xc'));var Redis=require('ioredis');var authService=require(_0x1cbe('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1cbe('0xe'));var hardwareService=require(_0x1cbe('0xf'));var logger=require(_0x1cbe('0x10'))(_0x1cbe('0x11'));var utils=require('../../config/utils');var config=require(_0x1cbe('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x1cbe('0x13'))['db'];function respondWithStatusCode(_0x15f8a9,_0x4959a8){_0x4959a8=_0x4959a8||0xcc;return function(_0x42da0e){if(_0x42da0e){return _0x15f8a9[_0x1cbe('0x14')](_0x4959a8);}return _0x15f8a9[_0x1cbe('0x15')](_0x4959a8)['end']();};}function respondWithResult(_0x244e61,_0x42a345){_0x42a345=_0x42a345||0xc8;return function(_0x2304c2){if(_0x2304c2){return _0x244e61[_0x1cbe('0x15')](_0x42a345)[_0x1cbe('0x16')](_0x2304c2);}};}function respondWithFilteredResult(_0x14784f,_0x3eb11f){return function(_0x25093a){if(_0x25093a){var _0x109cd7=typeof _0x3eb11f[_0x1cbe('0x17')]==='undefined'&&typeof _0x3eb11f[_0x1cbe('0x18')]===_0x1cbe('0x19');var _0x244a1d=_0x25093a['count'];var _0x1836a7=_0x109cd7?0x0:_0x3eb11f[_0x1cbe('0x17')];var _0x45268b=_0x109cd7?_0x25093a['count']:_0x3eb11f['offset']+_0x3eb11f[_0x1cbe('0x18')];var _0x75e87a;if(_0x45268b>=_0x244a1d){_0x45268b=_0x244a1d;_0x75e87a=0xc8;}else{_0x75e87a=0xce;}_0x14784f[_0x1cbe('0x15')](_0x75e87a);return _0x14784f[_0x1cbe('0x1a')]('Content-Range',_0x1836a7+'-'+_0x45268b+'/'+_0x244a1d)['json'](_0x25093a);}return null;};}function patchUpdates(_0x3f2d7d){return function(_0x3bf29c){try{jsonpatch[_0x1cbe('0x1b')](_0x3bf29c,_0x3f2d7d,!![]);}catch(_0x56f3c6){return BPromise['reject'](_0x56f3c6);}return _0x3bf29c[_0x1cbe('0x1c')]();};}function saveUpdates(_0x4aff8d,_0x33b678){return function(_0x192a76){if(_0x192a76){return _0x192a76[_0x1cbe('0x1d')](_0x4aff8d)[_0x1cbe('0x1e')](function(_0x19b93f){return _0x19b93f;});}return null;};}function removeEntity(_0x1e175b,_0x2aedba){return function(_0x23495c){if(_0x23495c){return _0x23495c[_0x1cbe('0x1f')]()['then'](function(){_0x1e175b[_0x1cbe('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb6aa,_0x2208bd){return function(_0x384845){if(!_0x384845){_0x1fb6aa['sendStatus'](0x194);}return _0x384845;};}function handleError(_0x26a5b7,_0x17066a){_0x17066a=_0x17066a||0x1f4;return function(_0x1b391d){logger[_0x1cbe('0x20')](_0x1b391d[_0x1cbe('0x21')]);if(_0x1b391d[_0x1cbe('0x22')]){delete _0x1b391d['name'];}_0x26a5b7[_0x1cbe('0x15')](_0x17066a)[_0x1cbe('0x23')](_0x1b391d);};}exports[_0x1cbe('0x24')]=function(_0x5d781d,_0x4c840e){var _0xa30ec5={'raw':!![],'where':{'id':_0x5d781d[_0x1cbe('0x25')]['id']}},_0x52d0d5={};_0x52d0d5['model']=_[_0x1cbe('0x26')](db[_0x1cbe('0x27')][_0x1cbe('0x28')]);_0x52d0d5[_0x1cbe('0x29')]=_['keys'](_0x5d781d[_0x1cbe('0x29')]);_0x52d0d5[_0x1cbe('0x2a')]=_[_0x1cbe('0x2b')](_0x52d0d5[_0x1cbe('0x2c')],_0x52d0d5[_0x1cbe('0x29')]);_0xa30ec5[_0x1cbe('0x2d')]=_['intersection'](_0x52d0d5['model'],qs[_0x1cbe('0x2e')](_0x5d781d['query'][_0x1cbe('0x2e')]));_0xa30ec5[_0x1cbe('0x2d')]=_0xa30ec5['attributes'][_0x1cbe('0x2f')]?_0xa30ec5['attributes']:_0x52d0d5[_0x1cbe('0x2c')];if(_0x5d781d[_0x1cbe('0x29')][_0x1cbe('0x30')]){_0xa30ec5[_0x1cbe('0x31')]=[{'all':!![]}];}_0xa30ec5=_['merge']({},_0xa30ec5,_0x5d781d['options']);return db[_0x1cbe('0x27')][_0x1cbe('0x32')](_0xa30ec5)[_0x1cbe('0x1e')](handleEntityNotFound(_0x4c840e,null))[_0x1cbe('0x1e')](respondWithResult(_0x4c840e,null))[_0x1cbe('0x33')](handleError(_0x4c840e,null));};exports['update']=function(_0x431f13,_0x1602fd){if(_0x431f13['body']['id']){delete _0x431f13[_0x1cbe('0x34')]['id'];}return db[_0x1cbe('0x27')][_0x1cbe('0x32')]({'where':{'id':_0x431f13['params']['id']}})['then'](handleEntityNotFound(_0x1602fd,null))[_0x1cbe('0x1e')](saveUpdates(_0x431f13[_0x1cbe('0x34')],null))[_0x1cbe('0x1e')](respondWithResult(_0x1602fd,null))[_0x1cbe('0x33')](handleError(_0x1602fd,null));};exports[_0x1cbe('0x1f')]=function(_0x42d45b,_0x2bdc30){return db[_0x1cbe('0x27')]['find']({'where':{'id':_0x42d45b[_0x1cbe('0x25')]['id']}})['then'](handleEntityNotFound(_0x2bdc30,null))[_0x1cbe('0x1e')](removeEntity(_0x2bdc30,null))['catch'](handleError(_0x2bdc30,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 622f98a..7ef5011 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 _0xde7f=['rimraf','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xde7f,0xa4));var _0xfde7=function(_0x10769a,_0xfd36d2){_0x10769a=_0x10769a-0x0;var _0x176daf=_0xde7f[_0x10769a];return _0x176daf;};'use strict';var _=require(_0xfde7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde7('0x1'));var moment=require('moment');var BPromise=require(_0xfde7('0x2'));var rp=require(_0xfde7('0x3'));var fs=require('fs');var path=require(_0xfde7('0x4'));var rimraf=require(_0xfde7('0x5'));var config=require(_0xfde7('0x6'));var attributes=require(_0xfde7('0x7'));module[_0xfde7('0x8')]=function(_0x13ffe1,_0x54edd6){return _0x13ffe1['define'](_0xfde7('0x9'),attributes,{'tableName':_0xfde7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfde7('0xb'),'collate':_0xfde7('0xc')});};
\ No newline at end of file
+var _0xc7e9=['ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x82c774,_0x518cd2){var _0x48cfaf=function(_0x1a1f81){while(--_0x1a1f81){_0x82c774['push'](_0x82c774['shift']());}};_0x48cfaf(++_0x518cd2);}(_0xc7e9,0x1ef));var _0x9c7e=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc7e9[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x9c7e('0x0'));var util=require(_0x9c7e('0x1'));var logger=require('../../config/logger')(_0x9c7e('0x2'));var moment=require(_0x9c7e('0x3'));var BPromise=require(_0x9c7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c7e('0x5'));var rimraf=require(_0x9c7e('0x6'));var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x9c7e('0x7')]=function(_0x4e4ccc,_0x1e5135){return _0x4e4ccc[_0x9c7e('0x8')](_0x9c7e('0x9'),attributes,{'tableName':_0x9c7e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9c7e('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index f523e4f..0b429d4 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 _0x5780=['../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x5620c1,_0x18a353){var _0x91169c=function(_0x4121c4){while(--_0x4121c4){_0x5620c1['push'](_0x5620c1['shift']());}};_0x91169c(++_0x18a353);}(_0x5780,0x9a));var _0x0578=function(_0x240ddc,_0x13f4b6){_0x240ddc=_0x240ddc-0x0;var _0x35464=_0x5780[_0x240ddc];return _0x35464;};'use strict';var _=require(_0x0578('0x0'));var util=require(_0x0578('0x1'));var moment=require(_0x0578('0x2'));var BPromise=require(_0x0578('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0578('0x4'));var logger=require(_0x0578('0x5'))(_0x0578('0x6'));var config=require(_0x0578('0x7'));var jayson=require(_0x0578('0x8'));var client=jayson[_0x0578('0x9')][_0x0578('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a61c6,_0x3114a1,_0x1ec9ac){return new BPromise(function(_0x21a2fe,_0x534bb3){return client[_0x0578('0xb')](_0x5a61c6,_0x1ec9ac)['then'](function(_0x303ad1){logger[_0x0578('0xc')](_0x0578('0xd'),_0x3114a1,_0x0578('0xe'));logger[_0x0578('0xf')](_0x0578('0x10'),_0x3114a1,_0x0578('0xe'),JSON[_0x0578('0x11')](_0x303ad1));if(_0x303ad1[_0x0578('0x12')]){if(_0x303ad1[_0x0578('0x12')][_0x0578('0x13')]===0x1f4){logger['error'](_0x0578('0xd'),_0x3114a1,_0x303ad1[_0x0578('0x12')][_0x0578('0x14')]);return _0x534bb3(_0x303ad1[_0x0578('0x12')][_0x0578('0x14')]);}logger[_0x0578('0x12')](_0x0578('0xd'),_0x3114a1,_0x303ad1['error']['message']);return _0x21a2fe(_0x303ad1['error'][_0x0578('0x14')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x3114a1,_0x0578('0xe'));_0x21a2fe(_0x303ad1[_0x0578('0x15')][_0x0578('0x14')]);}})[_0x0578('0x16')](function(_0x3a2771){logger[_0x0578('0x12')]('ChatApplication,\x20%s,\x20%s',_0x3114a1,_0x3a2771);_0x534bb3(_0x3a2771);});});}
\ No newline at end of file
+var _0xa2d8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result'];(function(_0x2b668b,_0x373cd3){var _0x5ac01a=function(_0x1ada5b){while(--_0x1ada5b){_0x2b668b['push'](_0x2b668b['shift']());}};_0x5ac01a(++_0x373cd3);}(_0xa2d8,0x114));var _0x8a2d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa2d8[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x8a2d('0x0'));var util=require(_0x8a2d('0x1'));var moment=require(_0x8a2d('0x2'));var BPromise=require(_0x8a2d('0x3'));var rs=require(_0x8a2d('0x4'));var fs=require('fs');var Redis=require(_0x8a2d('0x5'));var db=require(_0x8a2d('0x6'))['db'];var utils=require(_0x8a2d('0x7'));var logger=require(_0x8a2d('0x8'))('rpc');var config=require(_0x8a2d('0x9'));var jayson=require(_0x8a2d('0xa'));var client=jayson['client'][_0x8a2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c6f11,_0x5b3fbf,_0x40b18f){return new BPromise(function(_0x292b24,_0x4ad7f9){return client[_0x8a2d('0xc')](_0x5c6f11,_0x40b18f)[_0x8a2d('0xd')](function(_0x2405e8){logger['info'](_0x8a2d('0xe'),_0x5b3fbf,_0x8a2d('0xf'));logger[_0x8a2d('0x10')](_0x8a2d('0x11'),_0x5b3fbf,'request\x20sent',JSON[_0x8a2d('0x12')](_0x2405e8));if(_0x2405e8['error']){if(_0x2405e8['error'][_0x8a2d('0x13')]===0x1f4){logger['error'](_0x8a2d('0xe'),_0x5b3fbf,_0x2405e8['error']['message']);return _0x4ad7f9(_0x2405e8[_0x8a2d('0x14')]['message']);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x5b3fbf,_0x2405e8[_0x8a2d('0x14')][_0x8a2d('0x15')]);return _0x292b24(_0x2405e8[_0x8a2d('0x14')][_0x8a2d('0x15')]);}else{logger[_0x8a2d('0x16')](_0x8a2d('0xe'),_0x5b3fbf,_0x8a2d('0xf'));_0x292b24(_0x2405e8[_0x8a2d('0x17')][_0x8a2d('0x15')]);}})[_0x8a2d('0x18')](function(_0x23fe37){logger[_0x8a2d('0x14')](_0x8a2d('0xe'),_0x5b3fbf,_0x23fe37);_0x4ad7f9(_0x23fe37);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 508e463..a823311 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 _0xd16f=['isAuthenticated','put','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../config/environment','./chatApplication.controller'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xd16f,0x1e6));var _0xfd16=function(_0x1496ec,_0x2f81e3){_0x1496ec=_0x1496ec-0x0;var _0x5e2b99=_0xd16f[_0x1496ec];return _0x5e2b99;};'use strict';var multer=require(_0xfd16('0x0'));var util=require(_0xfd16('0x1'));var path=require(_0xfd16('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd16('0x3'));var router=express[_0xfd16('0x4')]();var fs_extra=require(_0xfd16('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfd16('0x6'));var controller=require(_0xfd16('0x7'));router['get']('/:id',auth[_0xfd16('0x8')](),controller['show']);router[_0xfd16('0x9')](_0xfd16('0xa'),auth[_0xfd16('0x8')](),controller[_0xfd16('0xb')]);router[_0xfd16('0xc')]('/:id',auth[_0xfd16('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0a18=['get','isAuthenticated','show','put','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x0a18,0xcb));var _0x80a1=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x0a18[_0x4dc7b9];return _0x3ab114;};'use strict';var multer=require(_0x80a1('0x0'));var util=require(_0x80a1('0x1'));var path=require(_0x80a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x80a1('0x3'));var router=express[_0x80a1('0x4')]();var fs_extra=require(_0x80a1('0x5'));var auth=require(_0x80a1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x80a1('0x7')]('/:id',auth[_0x80a1('0x8')](),controller[_0x80a1('0x9')]);router[_0x80a1('0xa')](_0x80a1('0xb'),auth[_0x80a1('0x8')](),controller[_0x80a1('0xc')]);router[_0x80a1('0xd')]('/:id',auth[_0x80a1('0x8')](),controller[_0x80a1('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 2fa0195..836acd2 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 _0xcc13=['STRING','BOOLEAN'];(function(_0x1acdb0,_0x148326){var _0x45652e=function(_0x556532){while(--_0x556532){_0x1acdb0['push'](_0x1acdb0['shift']());}};_0x45652e(++_0x148326);}(_0xcc13,0x190));var _0x3cc1=function(_0x36b821,_0x386805){_0x36b821=_0x36b821-0x0;var _0x38608e=_0xcc13[_0x36b821];return _0x38608e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3cc1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x3cc1('0x0')]},'write':{'type':Sequelize[_0x3cc1('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x7880=['BOOLEAN','sequelize','STRING'];(function(_0xa7a827,_0x152be9){var _0x4fa7e2=function(_0x29ff4d){while(--_0x29ff4d){_0xa7a827['push'](_0xa7a827['shift']());}};_0x4fa7e2(++_0x152be9);}(_0x7880,0x10f));var _0x0788=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x7880[_0x44a3b0];return _0x39e6f6;};'use strict';var Sequelize=require(_0x0788('0x0'));module['exports']={'name':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0788('0x1')]},'write':{'type':Sequelize[_0x0788('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 dfe2651..5341ce2 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 _0x325c=['where','pick','VIRTUAL','filter','merge','options','ChatGroup','includeAll','rows','catch','show','find','create','body','params','destroy','describe','getUnread','user','toInteger','addMembers','ids','getMembers','findOne','User','hasOwnProperty','nolimit','removeMembers','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','order','sort'];(function(_0x4c6dbb,_0x228c81){var _0x1deceb=function(_0x550622){while(--_0x550622){_0x4c6dbb['push'](_0x4c6dbb['shift']());}};_0x1deceb(++_0x228c81);}(_0x325c,0xdb));var _0xc325=function(_0x5f03f4,_0x71be0){_0x5f03f4=_0x5f03f4-0x0;var _0x3a4d47=_0x325c[_0x5f03f4];return _0x3a4d47;};'use strict';var emlformat=require(_0xc325('0x0'));var rimraf=require(_0xc325('0x1'));var zipdir=require(_0xc325('0x2'));var jsonpatch=require(_0xc325('0x3'));var rp=require(_0xc325('0x4'));var moment=require('moment');var BPromise=require(_0xc325('0x5'));var Mustache=require('mustache');var util=require(_0xc325('0x6'));var path=require(_0xc325('0x7'));var sox=require(_0xc325('0x8'));var csv=require(_0xc325('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc325('0xa'));var _=require('lodash');var squel=require(_0xc325('0xb'));var crypto=require('crypto');var jsforce=require(_0xc325('0xc'));var deskjs=require(_0xc325('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc325('0xe'));var Papa=require(_0xc325('0xf'));var Redis=require(_0xc325('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc325('0x11'));var as=require(_0xc325('0x12'));var hardwareService=require(_0xc325('0x13'));var logger=require(_0xc325('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xc325('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc325('0x16'))['db'];config['redis']=_[_0xc325('0x17')](config[_0xc325('0x18')],{'host':_0xc325('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc325('0x18')]));require(_0xc325('0x1a'))[_0xc325('0x1b')](socket);function respondWithStatusCode(_0x26cfdc,_0xdfab9f){_0xdfab9f=_0xdfab9f||0xcc;return function(_0x16a5ad){if(_0x16a5ad){return _0x26cfdc[_0xc325('0x1c')](_0xdfab9f);}return _0x26cfdc['status'](_0xdfab9f)[_0xc325('0x1d')]();};}function respondWithResult(_0x100390,_0x655b2f){_0x655b2f=_0x655b2f||0xc8;return function(_0x1c493f){if(_0x1c493f){return _0x100390[_0xc325('0x1e')](_0x655b2f)[_0xc325('0x1f')](_0x1c493f);}};}function respondWithFilteredResult(_0x23a7ae,_0x2df6b7){return function(_0x5a6cf1){if(_0x5a6cf1){var _0x346943=typeof _0x2df6b7[_0xc325('0x20')]==='undefined'&&typeof _0x2df6b7[_0xc325('0x21')]===_0xc325('0x22');var _0x39fac7=_0x5a6cf1[_0xc325('0x23')];var _0x252e8b=_0x346943?0x0:_0x2df6b7[_0xc325('0x20')];var _0x2b24e3=_0x346943?_0x5a6cf1[_0xc325('0x23')]:_0x2df6b7[_0xc325('0x20')]+_0x2df6b7[_0xc325('0x21')];var _0x40cc92;if(_0x2b24e3>=_0x39fac7){_0x2b24e3=_0x39fac7;_0x40cc92=0xc8;}else{_0x40cc92=0xce;}_0x23a7ae[_0xc325('0x1e')](_0x40cc92);return _0x23a7ae[_0xc325('0x24')](_0xc325('0x25'),_0x252e8b+'-'+_0x2b24e3+'/'+_0x39fac7)[_0xc325('0x1f')](_0x5a6cf1);}return null;};}function patchUpdates(_0x4e9073){return function(_0x583e8c){try{jsonpatch['apply'](_0x583e8c,_0x4e9073,!![]);}catch(_0x1f16ac){return BPromise['reject'](_0x1f16ac);}return _0x583e8c['save']();};}function saveUpdates(_0x1efc6e,_0x3218c2){return function(_0x263b3e){if(_0x263b3e){return _0x263b3e[_0xc325('0x26')](_0x1efc6e)[_0xc325('0x27')](function(_0xdc17ca){return _0xdc17ca;});}return null;};}function removeEntity(_0x4a9440,_0x4fb164){return function(_0x678c41){if(_0x678c41){return _0x678c41['destroy']()[_0xc325('0x27')](function(){_0x4a9440[_0xc325('0x1e')](0xcc)[_0xc325('0x1d')]();});}};}function handleEntityNotFound(_0x4849b3,_0x493a8e){return function(_0x5a115a){if(!_0x5a115a){_0x4849b3[_0xc325('0x1c')](0x194);}return _0x5a115a;};}function handleError(_0x3d2011,_0x5a4c45){_0x5a4c45=_0x5a4c45||0x1f4;return function(_0x28bb83){logger[_0xc325('0x28')](_0x28bb83[_0xc325('0x29')]);if(_0x28bb83[_0xc325('0x2a')]){delete _0x28bb83['name'];}_0x3d2011[_0xc325('0x1e')](_0x5a4c45)[_0xc325('0x2b')](_0x28bb83);};}exports[_0xc325('0x2c')]=function(_0x1f37bb,_0xfd0f10){var _0x304976={},_0xb189ba={},_0x29582d={'count':0x0,'rows':[]};var _0x3e4c38=_[_0xc325('0x2d')](db['ChatGroup'][_0xc325('0x2e')],function(_0x5d065a){return{'name':_0x5d065a[_0xc325('0x2f')],'type':_0x5d065a[_0xc325('0x30')][_0xc325('0x31')]};});_0xb189ba[_0xc325('0x32')]=_['map'](_0x3e4c38,_0xc325('0x2a'));_0xb189ba[_0xc325('0x33')]=_[_0xc325('0x34')](_0x1f37bb[_0xc325('0x33')]);_0xb189ba[_0xc325('0x35')]=_[_0xc325('0x36')](_0xb189ba['model'],_0xb189ba[_0xc325('0x33')]);_0x304976['attributes']=_[_0xc325('0x36')](_0xb189ba[_0xc325('0x32')],qs[_0xc325('0x37')](_0x1f37bb[_0xc325('0x33')]['fields']));_0x304976[_0xc325('0x38')]=_0x304976[_0xc325('0x38')][_0xc325('0x39')]?_0x304976['attributes']:_0xb189ba['model'];if(!_0x1f37bb['query']['hasOwnProperty']('nolimit')){_0x304976[_0xc325('0x21')]=qs[_0xc325('0x21')](_0x1f37bb[_0xc325('0x33')]['limit']);_0x304976['offset']=qs[_0xc325('0x20')](_0x1f37bb[_0xc325('0x33')][_0xc325('0x20')]);}_0x304976[_0xc325('0x3a')]=qs['sort'](_0x1f37bb[_0xc325('0x33')][_0xc325('0x3b')]);_0x304976[_0xc325('0x3c')]=qs[_0xc325('0x35')](_[_0xc325('0x3d')](_0x1f37bb[_0xc325('0x33')],_0xb189ba[_0xc325('0x35')]),_0x3e4c38);if(_0x1f37bb[_0xc325('0x33')]['filter']){_0x304976['where']=_['merge'](_0x304976[_0xc325('0x3c')],{'$or':_['map'](_0x3e4c38,function(_0x496257){if(_0x496257[_0xc325('0x30')]!==_0xc325('0x3e')){var _0xbd4301={};_0xbd4301[_0x496257[_0xc325('0x2a')]]={'$like':'%'+_0x1f37bb['query'][_0xc325('0x3f')]+'%'};return _0xbd4301;}})});}_0x304976=_[_0xc325('0x40')]({},_0x304976,_0x1f37bb[_0xc325('0x41')]);var _0x1f23ac={'where':_0x304976[_0xc325('0x3c')]};return db[_0xc325('0x42')][_0xc325('0x23')](_0x1f23ac)[_0xc325('0x27')](function(_0x43c5ab){_0x29582d[_0xc325('0x23')]=_0x43c5ab;if(_0x1f37bb[_0xc325('0x33')][_0xc325('0x43')]){_0x304976['include']=[{'all':!![]}];}return db[_0xc325('0x42')]['findAll'](_0x304976);})[_0xc325('0x27')](function(_0x19f78c){_0x29582d[_0xc325('0x44')]=_0x19f78c;return _0x29582d;})['then'](respondWithFilteredResult(_0xfd0f10,_0x304976))[_0xc325('0x45')](handleError(_0xfd0f10,null));};exports[_0xc325('0x46')]=function(_0x52069b,_0x5742e1){var _0x581098={'raw':!![],'where':{'id':_0x52069b['params']['id']}},_0x4f036d={};_0x4f036d[_0xc325('0x32')]=_[_0xc325('0x34')](db[_0xc325('0x42')][_0xc325('0x2e')]);_0x4f036d[_0xc325('0x33')]=_[_0xc325('0x34')](_0x52069b[_0xc325('0x33')]);_0x4f036d['filters']=_[_0xc325('0x36')](_0x4f036d[_0xc325('0x32')],_0x4f036d[_0xc325('0x33')]);_0x581098[_0xc325('0x38')]=_[_0xc325('0x36')](_0x4f036d[_0xc325('0x32')],qs[_0xc325('0x37')](_0x52069b[_0xc325('0x33')][_0xc325('0x37')]));_0x581098[_0xc325('0x38')]=_0x581098[_0xc325('0x38')][_0xc325('0x39')]?_0x581098[_0xc325('0x38')]:_0x4f036d['model'];if(_0x52069b[_0xc325('0x33')]['includeAll']){_0x581098['include']=[{'all':!![]}];}_0x581098=_['merge']({},_0x581098,_0x52069b[_0xc325('0x41')]);return db[_0xc325('0x42')][_0xc325('0x47')](_0x581098)[_0xc325('0x27')](handleEntityNotFound(_0x5742e1,null))[_0xc325('0x27')](respondWithResult(_0x5742e1,null))[_0xc325('0x45')](handleError(_0x5742e1,null));};exports[_0xc325('0x48')]=function(_0x1aa145,_0x1deffb){return db['ChatGroup'][_0xc325('0x48')](_0x1aa145['body'],{})[_0xc325('0x27')](respondWithResult(_0x1deffb,0xc9))[_0xc325('0x45')](handleError(_0x1deffb,null));};exports[_0xc325('0x26')]=function(_0x4e67f6,_0x422b73){if(_0x4e67f6[_0xc325('0x49')]['id']){delete _0x4e67f6[_0xc325('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4e67f6[_0xc325('0x4a')]['id']}})[_0xc325('0x27')](handleEntityNotFound(_0x422b73,null))[_0xc325('0x27')](saveUpdates(_0x4e67f6[_0xc325('0x49')],null))[_0xc325('0x27')](respondWithResult(_0x422b73,null))[_0xc325('0x45')](handleError(_0x422b73,null));};exports[_0xc325('0x4b')]=function(_0x244b64,_0x3d1366){return db[_0xc325('0x42')][_0xc325('0x47')]({'where':{'id':_0x244b64[_0xc325('0x4a')]['id']}})[_0xc325('0x27')](handleEntityNotFound(_0x3d1366,null))[_0xc325('0x27')](removeEntity(_0x3d1366,null))[_0xc325('0x45')](handleError(_0x3d1366,null));};exports[_0xc325('0x4c')]=function(_0x363988,_0x26b877){return db[_0xc325('0x42')][_0xc325('0x4c')]()[_0xc325('0x27')](respondWithResult(_0x26b877,null))[_0xc325('0x45')](handleError(_0x26b877,null));};exports[_0xc325('0x4d')]=function(_0x31fe6f,_0x2a60f9,_0x767a98){return db['ChatInternalMessage'][_0xc325('0x23')]({'where':{'ChatGroupId':_0x31fe6f[_0xc325('0x4a')]['id'],'ToId':_0x31fe6f[_0xc325('0x4e')]['id'],'read':![]}})[_0xc325('0x27')](function(_0x3de0ed){return{'id':_[_0xc325('0x4f')](_0x31fe6f[_0xc325('0x4a')]['id']),'count':_0x3de0ed};})['then'](respondWithResult(_0x2a60f9,null))[_0xc325('0x45')](handleError(_0x2a60f9,null));};exports['addMembers']=function(_0x457823,_0x19cf5e,_0x292e10){return db[_0xc325('0x42')]['find']({'where':{'id':_0x457823[_0xc325('0x4a')]['id']}})[_0xc325('0x27')](handleEntityNotFound(_0x19cf5e,null))[_0xc325('0x27')](function(_0x460a04){if(_0x460a04){return _0x460a04[_0xc325('0x50')](_0x457823[_0xc325('0x49')][_0xc325('0x51')],_['omit'](_0x457823['body'],[_0xc325('0x51'),'id'])||{});}})['then'](respondWithResult(_0x19cf5e,null))[_0xc325('0x45')](handleError(_0x19cf5e,null));};exports[_0xc325('0x52')]=function(_0x523e73,_0x34c8a9,_0xb3dd69){var _0x269039={};var _0x285da4={};var _0x1fc690;var _0x185e0f;return db[_0xc325('0x42')][_0xc325('0x53')]({'where':{'id':_0x523e73[_0xc325('0x4a')]['id']}})[_0xc325('0x27')](handleEntityNotFound(_0x34c8a9,null))[_0xc325('0x27')](function(_0x5c8c35){if(_0x5c8c35){_0x1fc690=_0x5c8c35;_0x285da4[_0xc325('0x32')]=_[_0xc325('0x34')](db[_0xc325('0x54')][_0xc325('0x2e')]);_0x285da4['query']=_[_0xc325('0x34')](_0x523e73[_0xc325('0x33')]);_0x285da4[_0xc325('0x35')]=_[_0xc325('0x36')](_0x285da4['model'],_0x285da4[_0xc325('0x33')]);_0x269039[_0xc325('0x38')]=_['intersection'](_0x285da4[_0xc325('0x32')],qs[_0xc325('0x37')](_0x523e73[_0xc325('0x33')][_0xc325('0x37')]));_0x269039[_0xc325('0x38')]=_0x269039[_0xc325('0x38')][_0xc325('0x39')]?_0x269039['attributes']:_0x285da4[_0xc325('0x32')];_0x269039['order']=qs[_0xc325('0x3b')](_0x523e73[_0xc325('0x33')][_0xc325('0x3b')]);_0x269039[_0xc325('0x3c')]=qs['filters'](_[_0xc325('0x3d')](_0x523e73[_0xc325('0x33')],_0x285da4[_0xc325('0x35')]));if(_0x523e73['query'][_0xc325('0x3f')]){_0x269039[_0xc325('0x3c')]=_[_0xc325('0x40')](_0x269039[_0xc325('0x3c')],{'$or':_[_0xc325('0x2d')](_0x269039['attributes'],function(_0x1aab7b){var _0x488b56={};_0x488b56[_0x1aab7b]={'$like':'%'+_0x523e73[_0xc325('0x33')][_0xc325('0x3f')]+'%'};return _0x488b56;})});}_0x269039=_[_0xc325('0x40')]({},_0x269039,_0x523e73[_0xc325('0x41')]);return _0x1fc690[_0xc325('0x52')](_0x269039);}})[_0xc325('0x27')](function(_0x7225e4){if(_0x7225e4){_0x185e0f=_0x7225e4['length'];if(!_0x523e73['query'][_0xc325('0x55')](_0xc325('0x56'))){_0x269039[_0xc325('0x21')]=qs[_0xc325('0x21')](_0x523e73[_0xc325('0x33')][_0xc325('0x21')]);_0x269039[_0xc325('0x20')]=qs[_0xc325('0x20')](_0x523e73[_0xc325('0x33')]['offset']);}return _0x1fc690[_0xc325('0x52')](_0x269039);}})[_0xc325('0x27')](function(_0x33f710){if(_0x33f710){return _0x33f710?{'count':_0x185e0f,'rows':_0x33f710}:null;}})[_0xc325('0x27')](respondWithResult(_0x34c8a9,null))[_0xc325('0x45')](handleError(_0x34c8a9,null));};exports['removeMembers']=function(_0x130aed,_0x94d139,_0x311e5d){return db['ChatGroup'][_0xc325('0x47')]({'where':{'id':_0x130aed[_0xc325('0x4a')]['id']}})[_0xc325('0x27')](handleEntityNotFound(_0x94d139,null))['then'](function(_0x442571){if(_0x442571){return _0x442571[_0xc325('0x57')](_0x130aed['query']['ids']);}})[_0xc325('0x27')](respondWithStatusCode(_0x94d139,null))[_0xc325('0x45')](handleError(_0x94d139,null));};exports['addMessage']=function(_0x54092a,_0x24d5ef,_0x5b6593){if(_0x54092a[_0xc325('0x49')]['id']){delete _0x54092a['body']['id'];}return db['ChatGroup'][_0xc325('0x47')]({'where':{'id':_0x54092a[_0xc325('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24d5ef,null))['then'](function(_0x525504){if(_0x525504){_0x54092a[_0xc325('0x49')]['ChatGroupId']=_0x525504['id'];return db[_0xc325('0x58')][_0xc325('0x48')](_0x54092a['body']);}})[_0xc325('0x27')](respondWithResult(_0x24d5ef,null))['catch'](handleError(_0x24d5ef,null));};exports[_0xc325('0x59')]=function(_0x2bb21f,_0x4ead27,_0x405e47){var _0x525f85={};var _0x5eec10={};var _0x205440;var _0x5a43c7;return db[_0xc325('0x42')][_0xc325('0x53')]({'where':{'id':_0x2bb21f[_0xc325('0x4a')]['id']}})[_0xc325('0x27')](handleEntityNotFound(_0x4ead27,null))[_0xc325('0x27')](function(_0x2d5bde){if(_0x2d5bde){_0x205440=_0x2d5bde;_0x5eec10['model']=_['keys'](db[_0xc325('0x58')][_0xc325('0x2e')]);_0x5eec10[_0xc325('0x33')]=_[_0xc325('0x34')](_0x2bb21f[_0xc325('0x33')]);_0x5eec10[_0xc325('0x35')]=_[_0xc325('0x36')](_0x5eec10[_0xc325('0x32')],_0x5eec10[_0xc325('0x33')]);_0x525f85[_0xc325('0x38')]=_[_0xc325('0x36')](_0x5eec10[_0xc325('0x32')],qs[_0xc325('0x37')](_0x2bb21f[_0xc325('0x33')][_0xc325('0x37')]));_0x525f85[_0xc325('0x38')]=_0x525f85[_0xc325('0x38')]['length']?_0x525f85[_0xc325('0x38')]:_0x5eec10[_0xc325('0x32')];_0x525f85[_0xc325('0x3a')]=qs[_0xc325('0x3b')](_0x2bb21f[_0xc325('0x33')][_0xc325('0x3b')]);_0x525f85[_0xc325('0x3c')]=qs[_0xc325('0x35')](_[_0xc325('0x3d')](_0x2bb21f[_0xc325('0x33')],_0x5eec10[_0xc325('0x35')]));if(_0x2bb21f[_0xc325('0x33')][_0xc325('0x3f')]){_0x525f85[_0xc325('0x3c')]=_[_0xc325('0x40')](_0x525f85[_0xc325('0x3c')],{'$or':_[_0xc325('0x2d')](_0x525f85[_0xc325('0x38')],function(_0x22f902){var _0x5d55bd={};_0x5d55bd[_0x22f902]={'$like':'%'+_0x2bb21f[_0xc325('0x33')][_0xc325('0x3f')]+'%'};return _0x5d55bd;})});}if(_0x2bb21f[_0xc325('0x33')][_0xc325('0x5a')]){var _0x732538=_0x2bb21f[_0xc325('0x33')][_0xc325('0x5a')]['split'](',');var _0x2ee34b={};_0x2ee34b[_0x732538[0x0]]={'$gte':moment(_0x732538[0x1])[_0xc325('0x5b')](_0xc325('0x5c'))};_0x525f85['where']=_[_0xc325('0x40')](_0x525f85['where'],_0x2ee34b);}_0x525f85=_[_0xc325('0x40')]({},_0x525f85,_0x2bb21f['options']);return _0x205440[_0xc325('0x59')](_0x525f85);}})[_0xc325('0x27')](function(_0x3e6503){if(_0x3e6503){_0x5a43c7=_0x3e6503['length'];if(!_0x2bb21f[_0xc325('0x33')][_0xc325('0x55')](_0xc325('0x56'))){_0x525f85['limit']=qs[_0xc325('0x21')](_0x2bb21f[_0xc325('0x33')][_0xc325('0x21')]);_0x525f85[_0xc325('0x20')]=qs['offset'](_0x2bb21f[_0xc325('0x33')]['offset']);}return _0x205440['getMessages'](_0x525f85);}})[_0xc325('0x27')](function(_0x5a6599){if(_0x5a6599){return _0x5a6599?{'count':_0x5a43c7,'rows':_0x5a6599}:null;}})[_0xc325('0x27')](respondWithResult(_0x4ead27,null))['catch'](handleError(_0x4ead27,null));};
\ No newline at end of file
+var _0x893e=['stack','name','send','index','map','ChatGroup','type','key','model','keys','filters','intersection','attributes','query','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','update','find','describe','user','toInteger','addMembers','ids','getMembers','findOne','User','fields','hasOwnProperty','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus'];(function(_0x19429a,_0x59c591){var _0x1a3390=function(_0x39f931){while(--_0x39f931){_0x19429a['push'](_0x19429a['shift']());}};_0x1a3390(++_0x59c591);}(_0x893e,0x1b6));var _0xe893=function(_0x50eefa,_0x11f515){_0x50eefa=_0x50eefa-0x0;var _0x27a7db=_0x893e[_0x50eefa];return _0x27a7db;};'use strict';var emlformat=require(_0xe893('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe893('0x1'));var jsonpatch=require(_0xe893('0x2'));var rp=require(_0xe893('0x3'));var moment=require(_0xe893('0x4'));var BPromise=require(_0xe893('0x5'));var Mustache=require(_0xe893('0x6'));var util=require(_0xe893('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe893('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe893('0x9'));var squel=require(_0xe893('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe893('0x8'));var querystring=require(_0xe893('0xb'));var Papa=require(_0xe893('0xc'));var Redis=require(_0xe893('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe893('0xe'));var as=require(_0xe893('0xf'));var hardwareService=require(_0xe893('0x10'));var logger=require(_0xe893('0x11'))(_0xe893('0x12'));var utils=require(_0xe893('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe893('0x14'));var db=require(_0xe893('0x15'))['db'];config[_0xe893('0x16')]=_[_0xe893('0x17')](config[_0xe893('0x16')],{'host':_0xe893('0x18'),'port':0x18eb});var socket=require(_0xe893('0x19'))(new Redis(config[_0xe893('0x16')]));require(_0xe893('0x1a'))['register'](socket);function respondWithStatusCode(_0x4beeab,_0x381953){_0x381953=_0x381953||0xcc;return function(_0x4bdd45){if(_0x4bdd45){return _0x4beeab['sendStatus'](_0x381953);}return _0x4beeab[_0xe893('0x1b')](_0x381953)[_0xe893('0x1c')]();};}function respondWithResult(_0x3f3e78,_0x557e80){_0x557e80=_0x557e80||0xc8;return function(_0x1270fe){if(_0x1270fe){return _0x3f3e78[_0xe893('0x1b')](_0x557e80)[_0xe893('0x1d')](_0x1270fe);}};}function respondWithFilteredResult(_0x488127,_0x5c83d2){return function(_0x711670){if(_0x711670){var _0x5cd25e=typeof _0x5c83d2[_0xe893('0x1e')]==='undefined'&&typeof _0x5c83d2[_0xe893('0x1f')]===_0xe893('0x20');var _0x45f9fc=_0x711670[_0xe893('0x21')];var _0x288c50=_0x5cd25e?0x0:_0x5c83d2['offset'];var _0x2688d4=_0x5cd25e?_0x711670[_0xe893('0x21')]:_0x5c83d2[_0xe893('0x1e')]+_0x5c83d2[_0xe893('0x1f')];var _0x4f3570;if(_0x2688d4>=_0x45f9fc){_0x2688d4=_0x45f9fc;_0x4f3570=0xc8;}else{_0x4f3570=0xce;}_0x488127['status'](_0x4f3570);return _0x488127[_0xe893('0x22')](_0xe893('0x23'),_0x288c50+'-'+_0x2688d4+'/'+_0x45f9fc)[_0xe893('0x1d')](_0x711670);}return null;};}function patchUpdates(_0x9ba058){return function(_0x4e4655){try{jsonpatch[_0xe893('0x24')](_0x4e4655,_0x9ba058,!![]);}catch(_0x3e9b22){return BPromise[_0xe893('0x25')](_0x3e9b22);}return _0x4e4655[_0xe893('0x26')]();};}function saveUpdates(_0x4bf7c6,_0x42ab0c){return function(_0x5a0d3c){if(_0x5a0d3c){return _0x5a0d3c['update'](_0x4bf7c6)['then'](function(_0x9cfd86){return _0x9cfd86;});}return null;};}function removeEntity(_0x53cf56,_0xa25d9b){return function(_0x9f327b){if(_0x9f327b){return _0x9f327b[_0xe893('0x27')]()[_0xe893('0x28')](function(){_0x53cf56[_0xe893('0x1b')](0xcc)[_0xe893('0x1c')]();});}};}function handleEntityNotFound(_0x280cd3,_0x2f402e){return function(_0x243279){if(!_0x243279){_0x280cd3[_0xe893('0x29')](0x194);}return _0x243279;};}function handleError(_0x5d2157,_0x10d9a8){_0x10d9a8=_0x10d9a8||0x1f4;return function(_0x48245a){logger['error'](_0x48245a[_0xe893('0x2a')]);if(_0x48245a[_0xe893('0x2b')]){delete _0x48245a[_0xe893('0x2b')];}_0x5d2157[_0xe893('0x1b')](_0x10d9a8)[_0xe893('0x2c')](_0x48245a);};}exports[_0xe893('0x2d')]=function(_0x142684,_0x589325){var _0x5d9ec1={},_0x5d46d8={},_0x341888={'count':0x0,'rows':[]};var _0x5ec8ce=_[_0xe893('0x2e')](db[_0xe893('0x2f')]['rawAttributes'],function(_0x25aeff){return{'name':_0x25aeff['fieldName'],'type':_0x25aeff[_0xe893('0x30')][_0xe893('0x31')]};});_0x5d46d8[_0xe893('0x32')]=_[_0xe893('0x2e')](_0x5ec8ce,_0xe893('0x2b'));_0x5d46d8['query']=_[_0xe893('0x33')](_0x142684['query']);_0x5d46d8[_0xe893('0x34')]=_[_0xe893('0x35')](_0x5d46d8[_0xe893('0x32')],_0x5d46d8['query']);_0x5d9ec1[_0xe893('0x36')]=_[_0xe893('0x35')](_0x5d46d8[_0xe893('0x32')],qs['fields'](_0x142684[_0xe893('0x37')]['fields']));_0x5d9ec1[_0xe893('0x36')]=_0x5d9ec1[_0xe893('0x36')][_0xe893('0x38')]?_0x5d9ec1[_0xe893('0x36')]:_0x5d46d8[_0xe893('0x32')];if(!_0x142684[_0xe893('0x37')]['hasOwnProperty'](_0xe893('0x39'))){_0x5d9ec1[_0xe893('0x1f')]=qs[_0xe893('0x1f')](_0x142684['query']['limit']);_0x5d9ec1[_0xe893('0x1e')]=qs[_0xe893('0x1e')](_0x142684['query'][_0xe893('0x1e')]);}_0x5d9ec1[_0xe893('0x3a')]=qs[_0xe893('0x3b')](_0x142684[_0xe893('0x37')][_0xe893('0x3b')]);_0x5d9ec1[_0xe893('0x3c')]=qs[_0xe893('0x34')](_[_0xe893('0x3d')](_0x142684[_0xe893('0x37')],_0x5d46d8[_0xe893('0x34')]),_0x5ec8ce);if(_0x142684[_0xe893('0x37')][_0xe893('0x3e')]){_0x5d9ec1[_0xe893('0x3c')]=_[_0xe893('0x3f')](_0x5d9ec1[_0xe893('0x3c')],{'$or':_[_0xe893('0x2e')](_0x5ec8ce,function(_0x2ced2e){if(_0x2ced2e[_0xe893('0x30')]!==_0xe893('0x40')){var _0x39f387={};_0x39f387[_0x2ced2e[_0xe893('0x2b')]]={'$like':'%'+_0x142684[_0xe893('0x37')][_0xe893('0x3e')]+'%'};return _0x39f387;}})});}_0x5d9ec1=_[_0xe893('0x3f')]({},_0x5d9ec1,_0x142684[_0xe893('0x41')]);var _0x53a889={'where':_0x5d9ec1[_0xe893('0x3c')]};return db[_0xe893('0x2f')][_0xe893('0x21')](_0x53a889)[_0xe893('0x28')](function(_0x51d795){_0x341888['count']=_0x51d795;if(_0x142684[_0xe893('0x37')][_0xe893('0x42')]){_0x5d9ec1[_0xe893('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0xe893('0x44')](_0x5d9ec1);})['then'](function(_0x14ae62){_0x341888[_0xe893('0x45')]=_0x14ae62;return _0x341888;})['then'](respondWithFilteredResult(_0x589325,_0x5d9ec1))[_0xe893('0x46')](handleError(_0x589325,null));};exports['show']=function(_0x3a6caf,_0x5e6157){var _0x86e299={'raw':!![],'where':{'id':_0x3a6caf[_0xe893('0x47')]['id']}},_0x1b04d5={};_0x1b04d5[_0xe893('0x32')]=_[_0xe893('0x33')](db['ChatGroup'][_0xe893('0x48')]);_0x1b04d5[_0xe893('0x37')]=_[_0xe893('0x33')](_0x3a6caf['query']);_0x1b04d5[_0xe893('0x34')]=_[_0xe893('0x35')](_0x1b04d5[_0xe893('0x32')],_0x1b04d5[_0xe893('0x37')]);_0x86e299[_0xe893('0x36')]=_[_0xe893('0x35')](_0x1b04d5[_0xe893('0x32')],qs['fields'](_0x3a6caf[_0xe893('0x37')]['fields']));_0x86e299['attributes']=_0x86e299[_0xe893('0x36')][_0xe893('0x38')]?_0x86e299[_0xe893('0x36')]:_0x1b04d5[_0xe893('0x32')];if(_0x3a6caf[_0xe893('0x37')]['includeAll']){_0x86e299[_0xe893('0x43')]=[{'all':!![]}];}_0x86e299=_[_0xe893('0x3f')]({},_0x86e299,_0x3a6caf[_0xe893('0x41')]);return db['ChatGroup']['find'](_0x86e299)[_0xe893('0x28')](handleEntityNotFound(_0x5e6157,null))[_0xe893('0x28')](respondWithResult(_0x5e6157,null))['catch'](handleError(_0x5e6157,null));};exports['create']=function(_0x4b4728,_0x240c25){return db['ChatGroup'][_0xe893('0x49')](_0x4b4728[_0xe893('0x4a')],{})[_0xe893('0x28')](respondWithResult(_0x240c25,0xc9))[_0xe893('0x46')](handleError(_0x240c25,null));};exports[_0xe893('0x4b')]=function(_0x1ffb66,_0x1df3e6){if(_0x1ffb66[_0xe893('0x4a')]['id']){delete _0x1ffb66['body']['id'];}return db[_0xe893('0x2f')]['find']({'where':{'id':_0x1ffb66[_0xe893('0x47')]['id']}})[_0xe893('0x28')](handleEntityNotFound(_0x1df3e6,null))[_0xe893('0x28')](saveUpdates(_0x1ffb66[_0xe893('0x4a')],null))['then'](respondWithResult(_0x1df3e6,null))[_0xe893('0x46')](handleError(_0x1df3e6,null));};exports[_0xe893('0x27')]=function(_0x34287,_0x5c2194){return db[_0xe893('0x2f')][_0xe893('0x4c')]({'where':{'id':_0x34287['params']['id']}})[_0xe893('0x28')](handleEntityNotFound(_0x5c2194,null))[_0xe893('0x28')](removeEntity(_0x5c2194,null))[_0xe893('0x46')](handleError(_0x5c2194,null));};exports[_0xe893('0x4d')]=function(_0x5ba46e,_0x2670b1){return db[_0xe893('0x2f')][_0xe893('0x4d')]()[_0xe893('0x28')](respondWithResult(_0x2670b1,null))[_0xe893('0x46')](handleError(_0x2670b1,null));};exports['getUnread']=function(_0x1e1b8e,_0x7951a9,_0x4016e0){return db['ChatInternalMessage'][_0xe893('0x21')]({'where':{'ChatGroupId':_0x1e1b8e[_0xe893('0x47')]['id'],'ToId':_0x1e1b8e[_0xe893('0x4e')]['id'],'read':![]}})[_0xe893('0x28')](function(_0x21641b){return{'id':_[_0xe893('0x4f')](_0x1e1b8e[_0xe893('0x47')]['id']),'count':_0x21641b};})['then'](respondWithResult(_0x7951a9,null))['catch'](handleError(_0x7951a9,null));};exports[_0xe893('0x50')]=function(_0x7500b8,_0x5c8af3,_0x2203cf){return db[_0xe893('0x2f')][_0xe893('0x4c')]({'where':{'id':_0x7500b8[_0xe893('0x47')]['id']}})[_0xe893('0x28')](handleEntityNotFound(_0x5c8af3,null))[_0xe893('0x28')](function(_0x5764a8){if(_0x5764a8){return _0x5764a8[_0xe893('0x50')](_0x7500b8['body'][_0xe893('0x51')],_['omit'](_0x7500b8[_0xe893('0x4a')],[_0xe893('0x51'),'id'])||{});}})[_0xe893('0x28')](respondWithResult(_0x5c8af3,null))[_0xe893('0x46')](handleError(_0x5c8af3,null));};exports[_0xe893('0x52')]=function(_0x35b1a6,_0x4903e4,_0x2b3d8a){var _0x40f2f4={};var _0xa91c71={};var _0xcc0c31;var _0x3ac79d;return db['ChatGroup'][_0xe893('0x53')]({'where':{'id':_0x35b1a6[_0xe893('0x47')]['id']}})[_0xe893('0x28')](handleEntityNotFound(_0x4903e4,null))['then'](function(_0x561c4b){if(_0x561c4b){_0xcc0c31=_0x561c4b;_0xa91c71[_0xe893('0x32')]=_[_0xe893('0x33')](db[_0xe893('0x54')][_0xe893('0x48')]);_0xa91c71[_0xe893('0x37')]=_['keys'](_0x35b1a6[_0xe893('0x37')]);_0xa91c71[_0xe893('0x34')]=_[_0xe893('0x35')](_0xa91c71[_0xe893('0x32')],_0xa91c71['query']);_0x40f2f4[_0xe893('0x36')]=_[_0xe893('0x35')](_0xa91c71[_0xe893('0x32')],qs[_0xe893('0x55')](_0x35b1a6[_0xe893('0x37')][_0xe893('0x55')]));_0x40f2f4[_0xe893('0x36')]=_0x40f2f4[_0xe893('0x36')]['length']?_0x40f2f4[_0xe893('0x36')]:_0xa91c71[_0xe893('0x32')];_0x40f2f4[_0xe893('0x3a')]=qs['sort'](_0x35b1a6['query'][_0xe893('0x3b')]);_0x40f2f4[_0xe893('0x3c')]=qs['filters'](_[_0xe893('0x3d')](_0x35b1a6[_0xe893('0x37')],_0xa91c71[_0xe893('0x34')]));if(_0x35b1a6[_0xe893('0x37')][_0xe893('0x3e')]){_0x40f2f4[_0xe893('0x3c')]=_[_0xe893('0x3f')](_0x40f2f4[_0xe893('0x3c')],{'$or':_['map'](_0x40f2f4['attributes'],function(_0x4f3682){var _0x47eb96={};_0x47eb96[_0x4f3682]={'$like':'%'+_0x35b1a6[_0xe893('0x37')][_0xe893('0x3e')]+'%'};return _0x47eb96;})});}_0x40f2f4=_[_0xe893('0x3f')]({},_0x40f2f4,_0x35b1a6[_0xe893('0x41')]);return _0xcc0c31[_0xe893('0x52')](_0x40f2f4);}})[_0xe893('0x28')](function(_0xea3d93){if(_0xea3d93){_0x3ac79d=_0xea3d93[_0xe893('0x38')];if(!_0x35b1a6[_0xe893('0x37')][_0xe893('0x56')](_0xe893('0x39'))){_0x40f2f4[_0xe893('0x1f')]=qs[_0xe893('0x1f')](_0x35b1a6[_0xe893('0x37')][_0xe893('0x1f')]);_0x40f2f4[_0xe893('0x1e')]=qs[_0xe893('0x1e')](_0x35b1a6[_0xe893('0x37')][_0xe893('0x1e')]);}return _0xcc0c31[_0xe893('0x52')](_0x40f2f4);}})['then'](function(_0x12d32c){if(_0x12d32c){return _0x12d32c?{'count':_0x3ac79d,'rows':_0x12d32c}:null;}})[_0xe893('0x28')](respondWithResult(_0x4903e4,null))[_0xe893('0x46')](handleError(_0x4903e4,null));};exports[_0xe893('0x57')]=function(_0x488773,_0x56b05f,_0x319882){return db[_0xe893('0x2f')][_0xe893('0x4c')]({'where':{'id':_0x488773['params']['id']}})['then'](handleEntityNotFound(_0x56b05f,null))[_0xe893('0x28')](function(_0x4aa3c3){if(_0x4aa3c3){return _0x4aa3c3['removeMembers'](_0x488773[_0xe893('0x37')][_0xe893('0x51')]);}})['then'](respondWithStatusCode(_0x56b05f,null))[_0xe893('0x46')](handleError(_0x56b05f,null));};exports[_0xe893('0x58')]=function(_0x20d4e1,_0xc7928e,_0x4aeafb){if(_0x20d4e1[_0xe893('0x4a')]['id']){delete _0x20d4e1[_0xe893('0x4a')]['id'];}return db[_0xe893('0x2f')]['find']({'where':{'id':_0x20d4e1[_0xe893('0x47')]['id']}})[_0xe893('0x28')](handleEntityNotFound(_0xc7928e,null))['then'](function(_0x5ed117){if(_0x5ed117){_0x20d4e1['body'][_0xe893('0x59')]=_0x5ed117['id'];return db[_0xe893('0x5a')][_0xe893('0x49')](_0x20d4e1[_0xe893('0x4a')]);}})[_0xe893('0x28')](respondWithResult(_0xc7928e,null))['catch'](handleError(_0xc7928e,null));};exports[_0xe893('0x5b')]=function(_0x252169,_0x546189,_0x1b62ae){var _0x26274b={};var _0xf36339={};var _0x8dc997;var _0x1f20bd;return db['ChatGroup'][_0xe893('0x53')]({'where':{'id':_0x252169[_0xe893('0x47')]['id']}})[_0xe893('0x28')](handleEntityNotFound(_0x546189,null))[_0xe893('0x28')](function(_0x48e42c){if(_0x48e42c){_0x8dc997=_0x48e42c;_0xf36339[_0xe893('0x32')]=_[_0xe893('0x33')](db[_0xe893('0x5a')]['rawAttributes']);_0xf36339[_0xe893('0x37')]=_['keys'](_0x252169[_0xe893('0x37')]);_0xf36339[_0xe893('0x34')]=_[_0xe893('0x35')](_0xf36339['model'],_0xf36339['query']);_0x26274b['attributes']=_[_0xe893('0x35')](_0xf36339[_0xe893('0x32')],qs[_0xe893('0x55')](_0x252169['query'][_0xe893('0x55')]));_0x26274b[_0xe893('0x36')]=_0x26274b[_0xe893('0x36')][_0xe893('0x38')]?_0x26274b[_0xe893('0x36')]:_0xf36339[_0xe893('0x32')];_0x26274b['order']=qs['sort'](_0x252169[_0xe893('0x37')][_0xe893('0x3b')]);_0x26274b[_0xe893('0x3c')]=qs[_0xe893('0x34')](_[_0xe893('0x3d')](_0x252169[_0xe893('0x37')],_0xf36339[_0xe893('0x34')]));if(_0x252169['query']['filter']){_0x26274b[_0xe893('0x3c')]=_[_0xe893('0x3f')](_0x26274b[_0xe893('0x3c')],{'$or':_['map'](_0x26274b[_0xe893('0x36')],function(_0xa39c2b){var _0x17b8e9={};_0x17b8e9[_0xa39c2b]={'$like':'%'+_0x252169['query'][_0xe893('0x3e')]+'%'};return _0x17b8e9;})});}if(_0x252169[_0xe893('0x37')][_0xe893('0x5c')]){var _0x352c39=_0x252169[_0xe893('0x37')][_0xe893('0x5c')][_0xe893('0x5d')](',');var _0x3f8883={};_0x3f8883[_0x352c39[0x0]]={'$gte':moment(_0x352c39[0x1])[_0xe893('0x5e')](_0xe893('0x5f'))};_0x26274b[_0xe893('0x3c')]=_[_0xe893('0x3f')](_0x26274b['where'],_0x3f8883);}_0x26274b=_[_0xe893('0x3f')]({},_0x26274b,_0x252169[_0xe893('0x41')]);return _0x8dc997['getMessages'](_0x26274b);}})[_0xe893('0x28')](function(_0x195a1d){if(_0x195a1d){_0x1f20bd=_0x195a1d[_0xe893('0x38')];if(!_0x252169['query']['hasOwnProperty'](_0xe893('0x39'))){_0x26274b[_0xe893('0x1f')]=qs['limit'](_0x252169[_0xe893('0x37')][_0xe893('0x1f')]);_0x26274b['offset']=qs[_0xe893('0x1e')](_0x252169[_0xe893('0x37')]['offset']);}return _0x8dc997[_0xe893('0x5b')](_0x26274b);}})[_0xe893('0x28')](function(_0x1da3a7){if(_0x1da3a7){return _0x1da3a7?{'count':_0x1f20bd,'rows':_0x1da3a7}:null;}})[_0xe893('0x28')](respondWithResult(_0x546189,null))[_0xe893('0x46')](handleError(_0x546189,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index a451f73..e9700ea 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 _0x6d3f=['ChatGroup','setMaxListeners','save','update','emit','hook','events','../../mysqldb'];(function(_0x473e31,_0x18eeaf){var _0x5a831f=function(_0x26fbfd){while(--_0x26fbfd){_0x473e31['push'](_0x473e31['shift']());}};_0x5a831f(++_0x18eeaf);}(_0x6d3f,0xe6));var _0xf6d3=function(_0x26d5d5,_0x14084e){_0x26d5d5=_0x26d5d5-0x0;var _0x3a8a8b=_0x6d3f[_0x26d5d5];return _0x3a8a8b;};'use strict';var EventEmitter=require(_0xf6d3('0x0'));var ChatGroup=require(_0xf6d3('0x1'))['db'][_0xf6d3('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xf6d3('0x3')](0x0);var events={'afterCreate':_0xf6d3('0x4'),'afterUpdate':_0xf6d3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ae390){return function(_0xcaecfe,_0xa2efe5,_0x4070dd){ChatGroupEvents[_0xf6d3('0x6')](_0x1ae390+':'+_0xcaecfe['id'],_0xcaecfe);ChatGroupEvents[_0xf6d3('0x6')](_0x1ae390,_0xcaecfe);_0x4070dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xf6d3('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x3b64=['update','remove','emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save'];(function(_0x26cc4d,_0x32f706){var _0x3d52c8=function(_0x3e9e38){while(--_0x3e9e38){_0x26cc4d['push'](_0x26cc4d['shift']());}};_0x3d52c8(++_0x32f706);}(_0x3b64,0x1bd));var _0x43b6=function(_0x5a5534,_0x57e666){_0x5a5534=_0x5a5534-0x0;var _0x298ead=_0x3b64[_0x5a5534];return _0x298ead;};'use strict';var EventEmitter=require(_0x43b6('0x0'));var ChatGroup=require(_0x43b6('0x1'))['db'][_0x43b6('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x43b6('0x3')](0x0);var events={'afterCreate':_0x43b6('0x4'),'afterUpdate':_0x43b6('0x5'),'afterDestroy':_0x43b6('0x6')};function emitEvent(_0x5def73){return function(_0x35953b,_0x5bc35d,_0xd9c446){ChatGroupEvents[_0x43b6('0x7')](_0x5def73+':'+_0x35953b['id'],_0x35953b);ChatGroupEvents[_0x43b6('0x7')](_0x5def73,_0x35953b);_0xd9c446(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x43b6('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 20cdf6d..5fb5e5b 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 _0x5797=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util'];(function(_0x380eca,_0x3a1430){var _0x32b500=function(_0x48df42){while(--_0x48df42){_0x380eca['push'](_0x380eca['shift']());}};_0x32b500(++_0x3a1430);}(_0x5797,0x1d2));var _0x7579=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x5797[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x7579('0x0'));var util=require(_0x7579('0x1'));var logger=require(_0x7579('0x2'))(_0x7579('0x3'));var moment=require(_0x7579('0x4'));var BPromise=require(_0x7579('0x5'));var rp=require(_0x7579('0x6'));var fs=require('fs');var path=require(_0x7579('0x7'));var rimraf=require(_0x7579('0x8'));var config=require('../../config/environment');var attributes=require(_0x7579('0x9'));module['exports']=function(_0x152db4,_0xb30bc4){return _0x152db4[_0x7579('0xa')](_0x7579('0xb'),attributes,{'tableName':_0x7579('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x771e=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','chat_groups','lodash'];(function(_0x442c23,_0x2d8c52){var _0x165b59=function(_0x4608b4){while(--_0x4608b4){_0x442c23['push'](_0x442c23['shift']());}};_0x165b59(++_0x2d8c52);}(_0x771e,0x14c));var _0xe771=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x771e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xe771('0x0'));var util=require('util');var logger=require(_0xe771('0x1'))('api');var moment=require(_0xe771('0x2'));var BPromise=require(_0xe771('0x3'));var rp=require(_0xe771('0x4'));var fs=require('fs');var path=require(_0xe771('0x5'));var rimraf=require('rimraf');var config=require(_0xe771('0x6'));var attributes=require('./chatGroup.attributes');module[_0xe771('0x7')]=function(_0x519b2a,_0x317c38){return _0x519b2a['define']('ChatGroup',attributes,{'tableName':_0xe771('0x8'),'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 fdcbbba..cac9c23 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 _0xb717=['message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x48c6a8,_0x11e119){var _0x23456b=function(_0x1317e9){while(--_0x1317e9){_0x48c6a8['push'](_0x48c6a8['shift']());}};_0x23456b(++_0x11e119);}(_0xb717,0x1b4));var _0x7b71=function(_0x30ac25,_0x3999a9){_0x30ac25=_0x30ac25-0x0;var _0x1f8da3=_0xb717[_0x30ac25];return _0x1f8da3;};'use strict';var _=require(_0x7b71('0x0'));var util=require('util');var moment=require(_0x7b71('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b71('0x2'));var fs=require('fs');var Redis=require(_0x7b71('0x3'));var db=require(_0x7b71('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b71('0x5'))(_0x7b71('0x6'));var config=require(_0x7b71('0x7'));var jayson=require(_0x7b71('0x8'));var client=jayson[_0x7b71('0x9')]['http']({'port':0x232a});config[_0x7b71('0xa')]=_[_0x7b71('0xb')](config[_0x7b71('0xa')],{'host':_0x7b71('0xc'),'port':0x18eb});var socket=require(_0x7b71('0xd'))(new Redis(config['redis']));require(_0x7b71('0xe'))[_0x7b71('0xf')](socket);function respondWithRpcPromise(_0x53857a,_0x1b7a5b,_0x45bbcd){return new BPromise(function(_0x179fab,_0x55c72a){return client[_0x7b71('0x10')](_0x53857a,_0x45bbcd)['then'](function(_0x470f77){logger['info'](_0x7b71('0x11'),_0x1b7a5b,_0x7b71('0x12'));logger[_0x7b71('0x13')](_0x7b71('0x14'),_0x1b7a5b,_0x7b71('0x12'),JSON['stringify'](_0x470f77));if(_0x470f77[_0x7b71('0x15')]){if(_0x470f77['error'][_0x7b71('0x16')]===0x1f4){logger[_0x7b71('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1b7a5b,_0x470f77[_0x7b71('0x15')][_0x7b71('0x17')]);return _0x55c72a(_0x470f77[_0x7b71('0x15')]['message']);}logger['error'](_0x7b71('0x11'),_0x1b7a5b,_0x470f77[_0x7b71('0x15')][_0x7b71('0x17')]);return _0x179fab(_0x470f77[_0x7b71('0x15')]['message']);}else{logger[_0x7b71('0x18')]('ChatGroup,\x20%s,\x20%s',_0x1b7a5b,'request\x20sent');_0x179fab(_0x470f77[_0x7b71('0x19')][_0x7b71('0x17')]);}})[_0x7b71('0x1a')](function(_0x46c47d){logger[_0x7b71('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1b7a5b,_0x46c47d);_0x55c72a(_0x46c47d);});});}
\ No newline at end of file
+var _0xb38e=['rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x11d553,_0x17e7f4){var _0x374ad5=function(_0x49dd1b){while(--_0x49dd1b){_0x11d553['push'](_0x11d553['shift']());}};_0x374ad5(++_0x17e7f4);}(_0xb38e,0xa7));var _0xeb38=function(_0x48f2a1,_0x41e0ba){_0x48f2a1=_0x48f2a1-0x0;var _0x5414a1=_0xb38e[_0x48f2a1];return _0x5414a1;};'use strict';var _=require(_0xeb38('0x0'));var util=require(_0xeb38('0x1'));var moment=require(_0xeb38('0x2'));var BPromise=require(_0xeb38('0x3'));var rs=require(_0xeb38('0x4'));var fs=require('fs');var Redis=require(_0xeb38('0x5'));var db=require(_0xeb38('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xeb38('0x7'))(_0xeb38('0x8'));var config=require('../../config/environment');var jayson=require(_0xeb38('0x9'));var client=jayson[_0xeb38('0xa')][_0xeb38('0xb')]({'port':0x232a});config[_0xeb38('0xc')]=_['defaults'](config[_0xeb38('0xc')],{'host':_0xeb38('0xd'),'port':0x18eb});var socket=require(_0xeb38('0xe'))(new Redis(config[_0xeb38('0xc')]));require('./chatGroup.socket')[_0xeb38('0xf')](socket);function respondWithRpcPromise(_0x34c438,_0x8a6144,_0xa54e19){return new BPromise(function(_0xfbd120,_0x1542f4){return client[_0xeb38('0x10')](_0x34c438,_0xa54e19)['then'](function(_0x170e47){logger['info'](_0xeb38('0x11'),_0x8a6144,_0xeb38('0x12'));logger['debug'](_0xeb38('0x13'),_0x8a6144,_0xeb38('0x12'),JSON[_0xeb38('0x14')](_0x170e47));if(_0x170e47[_0xeb38('0x15')]){if(_0x170e47[_0xeb38('0x15')][_0xeb38('0x16')]===0x1f4){logger['error'](_0xeb38('0x11'),_0x8a6144,_0x170e47[_0xeb38('0x15')][_0xeb38('0x17')]);return _0x1542f4(_0x170e47[_0xeb38('0x15')][_0xeb38('0x17')]);}logger[_0xeb38('0x15')](_0xeb38('0x11'),_0x8a6144,_0x170e47['error'][_0xeb38('0x17')]);return _0xfbd120(_0x170e47[_0xeb38('0x15')][_0xeb38('0x17')]);}else{logger['info'](_0xeb38('0x11'),_0x8a6144,'request\x20sent');_0xfbd120(_0x170e47['result'][_0xeb38('0x17')]);}})[_0xeb38('0x18')](function(_0x95a29){logger['error']('ChatGroup,\x20%s,\x20%s',_0x8a6144,_0x95a29);_0x1542f4(_0x95a29);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index fcad6c3..93ce986 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 _0xe8da=['length','./chatGroup.events','save','update','emit','removeListener','register'];(function(_0x38a999,_0x50ebc3){var _0x5e7f35=function(_0x5cc0e5){while(--_0x5cc0e5){_0x38a999['push'](_0x38a999['shift']());}};_0x5e7f35(++_0x50ebc3);}(_0xe8da,0xef));var _0xae8d=function(_0x2116f5,_0x327df2){_0x2116f5=_0x2116f5-0x0;var _0x35e37c=_0xe8da[_0x2116f5];return _0x35e37c;};'use strict';var ChatGroupEvents=require(_0xae8d('0x0'));var events=[_0xae8d('0x1'),'remove',_0xae8d('0x2')];function createListener(_0x122666,_0x438812){return function(_0x19bae2){_0x438812[_0xae8d('0x3')](_0x122666,_0x19bae2);};}function removeListener(_0x566055,_0x2bd7f3){return function(){ChatGroupEvents[_0xae8d('0x4')](_0x566055,_0x2bd7f3);};}exports[_0xae8d('0x5')]=function(_0x49bbcd){for(var _0xd1a2cd=0x0,_0x4e4ee0=events[_0xae8d('0x6')];_0xd1a2cd<_0x4e4ee0;_0xd1a2cd++){var _0x1a8af0=events[_0xd1a2cd];var _0x5388a4=createListener('chatGroup:'+_0x1a8af0,_0x49bbcd);ChatGroupEvents['on'](_0x1a8af0,_0x5388a4);}};
\ No newline at end of file
+var _0xa850=['length','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0xa850,0xc1));var _0x0a85=function(_0x248dfb,_0x5bd780){_0x248dfb=_0x248dfb-0x0;var _0x168f8f=_0xa850[_0x248dfb];return _0x168f8f;};'use strict';var ChatGroupEvents=require(_0x0a85('0x0'));var events=[_0x0a85('0x1'),_0x0a85('0x2'),_0x0a85('0x3')];function createListener(_0x2dc27a,_0x27ef13){return function(_0x3917f6){_0x27ef13[_0x0a85('0x4')](_0x2dc27a,_0x3917f6);};}function removeListener(_0xb5778e,_0x4c64bc){return function(){ChatGroupEvents[_0x0a85('0x5')](_0xb5778e,_0x4c64bc);};}exports[_0x0a85('0x6')]=function(_0x3e44d0){for(var _0x7ce8a7=0x0,_0x120b8a=events[_0x0a85('0x7')];_0x7ce8a7<_0x120b8a;_0x7ce8a7++){var _0x4826cb=events[_0x7ce8a7];var _0x1e887f=createListener('chatGroup:'+_0x4826cb,_0x3e44d0);ChatGroupEvents['on'](_0x4826cb,_0x1e887f);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 29e73dd..d112d90 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 _0x0f96=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','getMessages','post','/:id/members','addMembers','/:id/messages','addMessage','put','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x306f56,_0x47efc7){var _0x564730=function(_0x9eb039){while(--_0x9eb039){_0x306f56['push'](_0x306f56['shift']());}};_0x564730(++_0x47efc7);}(_0x0f96,0x8e));var _0x60f9=function(_0x3eac71,_0x1169cf){_0x3eac71=_0x3eac71-0x0;var _0x292b16=_0x0f96[_0x3eac71];return _0x292b16;};'use strict';var multer=require(_0x60f9('0x0'));var util=require(_0x60f9('0x1'));var path=require(_0x60f9('0x2'));var timeout=require(_0x60f9('0x3'));var express=require(_0x60f9('0x4'));var router=express[_0x60f9('0x5')]();var fs_extra=require(_0x60f9('0x6'));var auth=require(_0x60f9('0x7'));var interaction=require(_0x60f9('0x8'));var config=require(_0x60f9('0x9'));var controller=require(_0x60f9('0xa'));router[_0x60f9('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x60f9('0xb')](_0x60f9('0xc'),auth[_0x60f9('0xd')](),controller[_0x60f9('0xe')]);router[_0x60f9('0xb')](_0x60f9('0xf'),auth['isAuthenticated'](),controller[_0x60f9('0x10')]);router[_0x60f9('0xb')](_0x60f9('0x11'),auth['isAuthenticated'](),controller[_0x60f9('0x12')]);router[_0x60f9('0xb')]('/:id/members',auth[_0x60f9('0xd')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x60f9('0xd')](),controller[_0x60f9('0x13')]);router[_0x60f9('0x14')]('/',auth[_0x60f9('0xd')](),controller['create']);router[_0x60f9('0x14')](_0x60f9('0x15'),auth['isAuthenticated'](),controller[_0x60f9('0x16')]);router[_0x60f9('0x14')](_0x60f9('0x17'),auth['isAuthenticated'](),controller[_0x60f9('0x18')]);router[_0x60f9('0x19')](_0x60f9('0xf'),auth[_0x60f9('0xd')](),controller[_0x60f9('0x1a')]);router[_0x60f9('0x1b')](_0x60f9('0xf'),auth[_0x60f9('0xd')](),controller[_0x60f9('0x1c')]);router[_0x60f9('0x1b')](_0x60f9('0x15'),auth[_0x60f9('0xd')](),controller[_0x60f9('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0x6f1d=['/:id/messages','create','post','/:id/members','addMembers','delete','destroy','removeMembers','exports','multer','path','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','getMembers'];(function(_0x57c02c,_0x52a409){var _0x5c42e9=function(_0x58f289){while(--_0x58f289){_0x57c02c['push'](_0x57c02c['shift']());}};_0x5c42e9(++_0x52a409);}(_0x6f1d,0xd8));var _0xd6f1=function(_0x34362f,_0x57e762){_0x34362f=_0x34362f-0x0;var _0x24c0b6=_0x6f1d[_0x34362f];return _0x24c0b6;};'use strict';var multer=require(_0xd6f1('0x0'));var util=require('util');var path=require(_0xd6f1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd6f1('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd6f1('0x3'));var config=require(_0xd6f1('0x4'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0xd6f1('0x5')](),controller[_0xd6f1('0x6')]);router['get'](_0xd6f1('0x7'),auth[_0xd6f1('0x5')](),controller[_0xd6f1('0x8')]);router[_0xd6f1('0x9')](_0xd6f1('0xa'),auth[_0xd6f1('0x5')](),controller[_0xd6f1('0xb')]);router['get'](_0xd6f1('0xc'),auth[_0xd6f1('0x5')](),controller['getUnread']);router[_0xd6f1('0x9')]('/:id/members',auth[_0xd6f1('0x5')](),controller[_0xd6f1('0xd')]);router[_0xd6f1('0x9')](_0xd6f1('0xe'),auth[_0xd6f1('0x5')](),controller['getMessages']);router['post']('/',auth[_0xd6f1('0x5')](),controller[_0xd6f1('0xf')]);router[_0xd6f1('0x10')](_0xd6f1('0x11'),auth[_0xd6f1('0x5')](),controller[_0xd6f1('0x12')]);router[_0xd6f1('0x10')](_0xd6f1('0xe'),auth[_0xd6f1('0x5')](),controller['addMessage']);router['put'](_0xd6f1('0xa'),auth[_0xd6f1('0x5')](),controller['update']);router[_0xd6f1('0x13')](_0xd6f1('0xa'),auth[_0xd6f1('0x5')](),controller[_0xd6f1('0x14')]);router[_0xd6f1('0x13')]('/:id/members',auth[_0xd6f1('0x5')](),controller[_0xd6f1('0x15')]);module[_0xd6f1('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 74a9489..63a460c 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 _0x48bc=['BOOLEAN','ENUM','star','thumb','TEXT','STRING','long','DATE','out','sequelize','exports'];(function(_0x1cd43b,_0x2ac627){var _0x21de30=function(_0x375b26){while(--_0x375b26){_0x1cd43b['push'](_0x1cd43b['shift']());}};_0x21de30(++_0x2ac627);}(_0x48bc,0x1b6));var _0xc48b=function(_0x18589b,_0x50ebfb){_0x18589b=_0x18589b-0x0;var _0xef4858=_0x48bc[_0x18589b];return _0xef4858;};'use strict';var Sequelize=require(_0xc48b('0x0'));module[_0xc48b('0x1')]={'closed':{'type':Sequelize[_0xc48b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xc48b('0x3')](_0xc48b('0x4'),_0xc48b('0x5')),'defaultValue':_0xc48b('0x4')},'ratingMessage':{'type':Sequelize[_0xc48b('0x6')]},'pathTranscript':{'type':Sequelize[_0xc48b('0x6')]},'mailTranscript':{'type':Sequelize[_0xc48b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc48b('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc48b('0x7')]},'note':{'type':Sequelize[_0xc48b('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xc48b('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xc48b('0x7')]},'deviceModel':{'type':Sequelize[_0xc48b('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xc48b('0x7')]},'referer':{'type':Sequelize[_0xc48b('0x6')]},'customerIp':{'type':Sequelize[_0xc48b('0x7')]},'formData':{'type':Sequelize[_0xc48b('0x6')](_0xc48b('0x8'))},'read1stAt':{'type':Sequelize[_0xc48b('0x9')]},'lastMsgAt':{'type':Sequelize[_0xc48b('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xc48b('0x3')]('in',_0xc48b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc48b('0x7')]},'customerPort':{'type':Sequelize[_0xc48b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xc48b('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1ba2=['sequelize','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x4c216c,_0x43f2cd){var _0x10f6de=function(_0x4f62b9){while(--_0x4f62b9){_0x4c216c['push'](_0x4c216c['shift']());}};_0x10f6de(++_0x43f2cd);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x21ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x21ba('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x21ba('0x2')](_0x21ba('0x3'),_0x21ba('0x4')),'defaultValue':_0x21ba('0x3')},'ratingMessage':{'type':Sequelize[_0x21ba('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x21ba('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x21ba('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x21ba('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x21ba('0x6')]},'browserName':{'type':Sequelize[_0x21ba('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x21ba('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x21ba('0x6')]},'deviceVendor':{'type':Sequelize[_0x21ba('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x21ba('0x5')]},'customerIp':{'type':Sequelize[_0x21ba('0x6')]},'formData':{'type':Sequelize[_0x21ba('0x5')](_0x21ba('0x8'))},'read1stAt':{'type':Sequelize[_0x21ba('0x7')]},'lastMsgAt':{'type':Sequelize[_0x21ba('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x21ba('0x2')]('in',_0x21ba('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x21ba('0x6')]},'customerPort':{'type':Sequelize[_0x21ba('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x21ba('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x21ba('0x1')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index b8900f1..01476f2 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 _0x66fa=['error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','body','contact','agent','interaction','TagIds','Tags','split','forEach','push','map','ChatInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','params','includeAll','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','account','https://api-vidaoo.xcally.com/api/v1/meetings','follow','isNull','metadata','ValidationError','join_url','out','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','root','offline-chat/','join','basename','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','MailServerOut','Smtp','service','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','merge','YYYY-MM-DD\x20HH:mm:ss','options','getMyMessages','include','includeAgent','alias','addTags','setTags','findAll','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','secret','read','Account','Owner','mkdirSync','Chat','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','renderFile','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42f48d,_0x8d0d10){var _0x103cc9=function(_0x30861c){while(--_0x30861c){_0x42f48d['push'](_0x42f48d['shift']());}};_0x103cc9(++_0x8d0d10);}(_0x66fa,0x117));var _0xa66f=function(_0x5a782d,_0x5d0bee){_0x5a782d=_0x5a782d-0x0;var _0xa4e463=_0x66fa[_0x5a782d];return _0xa4e463;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xa66f('0x11'));var hardwareService=require(_0xa66f('0x12'));var logger=require('../../config/logger')(_0xa66f('0x13'));var utils=require('../../config/utils');var config=require(_0xa66f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa66f('0x15'))['db'];config[_0xa66f('0x16')]=_[_0xa66f('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0x18'))(new Redis(config['redis']));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xa66f('0x19'));var client=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232b});var client9004=jayson[_0xa66f('0x1a')][_0xa66f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x567d4f,_0x5510dc,_0x19b5ac,_0x32d338){return new BPromise(function(_0x295acf,_0x403f4d){var _0x5c67f5=_0x32d338||client;return _0x5c67f5[_0xa66f('0x1c')](_0x567d4f,_0x19b5ac)['then'](function(_0x4a28d4){logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));logger[_0xa66f('0x20')](_0xa66f('0x21'),_0x5510dc,_0xa66f('0x1f'),JSON[_0xa66f('0x22')](_0x4a28d4));if(_0x4a28d4[_0xa66f('0x23')]){if(_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x24')]===0x1f4){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x403f4d(_0x4a28d4[_0xa66f('0x23')]['message']);}logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x4a28d4[_0xa66f('0x23')][_0xa66f('0x25')]);return _0x295acf(_0x4a28d4['error'][_0xa66f('0x25')]);}else{logger[_0xa66f('0x1d')](_0xa66f('0x1e'),_0x5510dc,_0xa66f('0x1f'));_0x295acf(_0x4a28d4['result']['message']);}})[_0xa66f('0x26')](function(_0x598942){logger[_0xa66f('0x23')](_0xa66f('0x1e'),_0x5510dc,_0x598942);_0x403f4d(_0x598942);});});}function respondWithStatusCode(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0xcc;return function(_0x4683c7){if(_0x4683c7){return _0x384164[_0xa66f('0x27')](_0x57da7f);}return _0x384164[_0xa66f('0x28')](_0x57da7f)[_0xa66f('0x29')]();};}function respondWithResult(_0x17c103,_0x236046){_0x236046=_0x236046||0xc8;return function(_0x1eb86a){if(_0x1eb86a){return _0x17c103[_0xa66f('0x28')](_0x236046)[_0xa66f('0x2a')](_0x1eb86a);}};}function respondWithFilteredResult(_0x117d03,_0x45f71c){return function(_0x63650b){if(_0x63650b){var _0x42b966=typeof _0x45f71c[_0xa66f('0x2b')]==='undefined'&&typeof _0x45f71c['limit']===_0xa66f('0x2c');var _0x27ceae=_0x63650b['count'];var _0x44c79a=_0x42b966?0x0:_0x45f71c[_0xa66f('0x2b')];var _0x4cd7f2=_0x42b966?_0x63650b[_0xa66f('0x2d')]:_0x45f71c[_0xa66f('0x2b')]+_0x45f71c[_0xa66f('0x2e')];var _0x2c2ace;if(_0x4cd7f2>=_0x27ceae){_0x4cd7f2=_0x27ceae;_0x2c2ace=0xc8;}else{_0x2c2ace=0xce;}_0x117d03[_0xa66f('0x28')](_0x2c2ace);return _0x117d03['set'](_0xa66f('0x2f'),_0x44c79a+'-'+_0x4cd7f2+'/'+_0x27ceae)['json'](_0x63650b);}return null;};}function patchUpdates(_0x306b35){return function(_0x35a0a7){try{jsonpatch[_0xa66f('0x30')](_0x35a0a7,_0x306b35,!![]);}catch(_0x486e4e){return BPromise[_0xa66f('0x31')](_0x486e4e);}return _0x35a0a7[_0xa66f('0x32')]();};}function saveUpdates(_0x4f1668,_0x1a5d4a){return function(_0x35a847){if(_0x35a847){return _0x35a847[_0xa66f('0x33')](_0x4f1668)[_0xa66f('0x34')](function(_0x10a782){return _0x10a782;});}return null;};}function removeEntity(_0x2452d2,_0x25c74c){return function(_0x41303c){if(_0x41303c){return _0x41303c[_0xa66f('0x35')]()[_0xa66f('0x34')](function(){_0x2452d2['status'](0xcc)[_0xa66f('0x29')]();});}};}function handleEntityNotFound(_0x5bf736,_0x1c7eda){return function(_0x46f6cc){if(!_0x46f6cc){_0x5bf736[_0xa66f('0x27')](0x194);}return _0x46f6cc;};}function handleError(_0x3b9261,_0x3722d3){_0x3722d3=_0x3722d3||0x1f4;return function(_0x201432){logger[_0xa66f('0x23')](_0x201432[_0xa66f('0x36')]);if(_0x201432['name']){delete _0x201432[_0xa66f('0x37')];}_0x3b9261['status'](_0x3722d3)[_0xa66f('0x38')](_0x201432);};}function getMustacheRender(_0x45eeb8,_0x2ed1fb){return Mustache['render'](_0x45eeb8,_['merge'](_0x2ed1fb[_0xa66f('0x39')],{'contact':_0x2ed1fb[_0xa66f('0x3a')],'message':_0x2ed1fb[_0xa66f('0x25')],'agent':_0x2ed1fb[_0xa66f('0x3b')],'interaction':_0x2ed1fb[_0xa66f('0x3c')],'account':_0x2ed1fb['account']}))||'';}function getInteractionUsers(_0x5cb0a9,_0x49b869){return new BPromise(function(_0x30f7de,_0x4aeeb4){try{if(_0x49b869[_0x5cb0a9['id']]){_0x5cb0a9['Users']=_['map'](_0x49b869[_0x5cb0a9['id']],function(_0x5fdc3e){return{'id':_0x5fdc3e['id'],'fullname':_0x5fdc3e['fullname']};});}}catch(_0x8965d3){_0x4aeeb4(_0x8965d3);}_0x30f7de(_0x5cb0a9);});}function getInteractionTags(_0x17d942,_0x23a546){return new BPromise(function(_0x1647a0,_0xd65c5d){try{if(_0x17d942[_0xa66f('0x3d')]){_0x17d942[_0xa66f('0x3e')]=[];_0x17d942[_0xa66f('0x3d')][_0xa66f('0x3f')](',')[_0xa66f('0x40')](function(_0x3a7929){_0x17d942[_0xa66f('0x3e')][_0xa66f('0x41')](_0x23a546[_0x3a7929]);});}delete _0x17d942[_0xa66f('0x3d')];}catch(_0x4f01b9){_0xd65c5d(_0x4f01b9);}_0x1647a0(_0x17d942);});}function updateChatInteraction(_0x36037c,_0x25c2cb,_0x58c1f2){return new BPromise(function(_0x248587,_0x4b6e6b){return getInteractionUsers(_0x36037c,_0x58c1f2)[_0xa66f('0x34')](function(_0x27adf4){return getInteractionTags(_0x27adf4,_0x25c2cb);})['then'](function(_0x1ddd2f){_0x248587(_0x1ddd2f);})[_0xa66f('0x26')](function(_0x2126e8){_0x4b6e6b(_0x2126e8);});});}exports['index']=function(_0x394b1e,_0x5cdfe2){var _0x276cd5={},_0x33ed23={},_0xb52cc6={'count':0x0,'rows':[]};var _0x3a499e=_[_0xa66f('0x42')](db[_0xa66f('0x43')][_0xa66f('0x44')],function(_0x50cc47){return{'name':_0x50cc47[_0xa66f('0x45')],'type':_0x50cc47[_0xa66f('0x46')][_0xa66f('0x47')]};});_0x33ed23[_0xa66f('0x48')]=_[_0xa66f('0x42')](_0x3a499e,'name');_0x33ed23['query']=_[_0xa66f('0x49')](_0x394b1e[_0xa66f('0x4a')]);_0x33ed23[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],_0x33ed23[_0xa66f('0x4a')]);_0x276cd5['attributes']=_[_0xa66f('0x4c')](_0x33ed23[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x394b1e['query']['fields']));_0x276cd5[_0xa66f('0x4e')]=_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x276cd5['attributes']:_0x33ed23['model'];if(!_0x394b1e['query'][_0xa66f('0x50')](_0xa66f('0x51'))){_0x276cd5[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x2e')]);_0x276cd5[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x394b1e['query'][_0xa66f('0x2b')]);}_0x276cd5[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x276cd5[_0xa66f('0x54')]=qs['filters'](_[_0xa66f('0x55')](_0x394b1e[_0xa66f('0x4a')],_0x33ed23[_0xa66f('0x4b')]),_0x3a499e);var _0x13848d=[];var _0x20d6be=squel['select']()[_0xa66f('0x56')]('id')['field'](_0xa66f('0x37'))['field']('color')[_0xa66f('0x57')](_0xa66f('0x58'));var _0x12271d=squel[_0xa66f('0x59')]()[_0xa66f('0x56')](_0xa66f('0x5a'))['field'](_0xa66f('0x5b'))[_0xa66f('0x56')](_0xa66f('0x5c'))[_0xa66f('0x57')]('user_has_chat_interactions','ui')[_0xa66f('0x5d')]('users','u',_0xa66f('0x5e'));var _0x10fc75=squel[_0xa66f('0x59')]()[_0xa66f('0x57')](_0xa66f('0x5f'),'i')[_0xa66f('0x5d')](_0xa66f('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa66f('0x5d')](_0xa66f('0x61'),'o',_0xa66f('0x62'))[_0xa66f('0x5d')](_0xa66f('0x63'),'a',_0xa66f('0x64'))[_0xa66f('0x5d')](_0xa66f('0x65'),'me',_0xa66f('0x66'))['left_join']('chat_interaction_has_tags','it',_0xa66f('0x67'))[_0xa66f('0x5d')](_0xa66f('0x58'),'t',_0xa66f('0x68'));var _0x2f1f1e=squel[_0xa66f('0x69')]();var _0x8bea2b=[];var _0x4b10cf=squel[_0xa66f('0x69')]();var _0x11c89e;if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]){_0x11c89e=as['parseSearch'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x6a')]);var _0x19ff30=_0x11c89e[_0xa66f('0x6b')];for(var _0x19f4b5=0x0;_0x19f4b5<_0x11c89e[_0xa66f('0x6c')]['length'];_0x19f4b5++){var _0x4b31f7=_0x11c89e[_0xa66f('0x6c')][_0x19f4b5];var _0x31b81b='i';var _0x174aad=_['find'](_0x3a499e,[_0xa66f('0x37'),_0x4b31f7[_0xa66f('0x56')]]);if(!_0x174aad){switch(_0x4b31f7[_0xa66f('0x56')]){case _0xa66f('0x6d'):if(_0x4b31f7[_0xa66f('0x6e')]==0x1){_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7[_0xa66f('0x56')]+_0xa66f('0x70'));}else{_0x10fc75[_0xa66f('0x6f')]('`'+_0x4b31f7['field']+_0xa66f('0x71'));}break;case _0xa66f('0x72'):if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){if(_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')]('\x20')[_0xa66f('0x4f')]>0x1){_0x2f1f1e[_0x19ff30](_0xa66f('0x75'),qs['getFullTextValue'](_0x4b31f7['value']),null);}else{var _0x46327d='%'+_0x4b31f7[_0xa66f('0x6e')]+'%';_0x2f1f1e[_0x19ff30](_0xa66f('0x76'),_0x46327d,_0x46327d,_0x46327d);}}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),'ContactId']);_0x4b31f7[_0xa66f('0x56')]='ContactId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x7a'):var _0x46ea11=_0x4b31f7[_0xa66f('0x6e')][_0xa66f('0x3f')](',')[_0xa66f('0x42')](function(_0x2bdb18){return Number(_0x2bdb18);});_0x46ea11[_0xa66f('0x40')](function(_0x36b92f){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x36b92f+',%');});_0x8bea2b=_[_0xa66f('0x7c')](_0x8bea2b,_0x46ea11);break;case'User':if(_0x4b31f7[_0xa66f('0x73')]===_0xa66f('0x74')){_0x2f1f1e[_0x19ff30](_0xa66f('0x7d'),'%'+_0x4b31f7[_0xa66f('0x6e')]+'%',null);}else{_0x174aad=_[_0xa66f('0x77')](_0x3a499e,[_0xa66f('0x37'),_0xa66f('0x7e')]);_0x4b31f7[_0xa66f('0x56')]='UserId';_0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}break;case _0xa66f('0x39'):_0x53b01b=as['buildExpression']('me',null,_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b['text'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x7f')],_0x53b01b[_0xa66f('0x6e')]['end']);break;}}else{var _0x53b01b=as[_0xa66f('0x78')](_0x31b81b,_0x174aad[_0xa66f('0x46')],_0x4b31f7);_0x2f1f1e[_0x19ff30](_0x53b01b[_0xa66f('0x79')],_0x53b01b[_0xa66f('0x6e')]['start'],_0x53b01b[_0xa66f('0x6e')][_0xa66f('0x29')]);}}}else{var _0x1d4642=_(_0x394b1e[_0xa66f('0x4a')])[_0xa66f('0x49')]()[_0xa66f('0x42')](function(_0x218128){return _[_0xa66f('0x80')](_0x3a499e,['name',_0x218128])?_0x218128:undefined;})[_0xa66f('0x81')]()[_0xa66f('0x6e')]();if(!_['isEmpty'](_0x1d4642)){_0x1d4642['forEach'](function(_0x183155){if(_0x183155===_0xa66f('0x82')){_0x10fc75['where'](_0xa66f('0x83'),[]['concat'](_0x394b1e[_0xa66f('0x4a')][_0x183155]));}else if(_0x183155==='createdAt'){var _0x4feda0=JSON['parse'](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x84')];var _0x1f05bb=JSON[_0xa66f('0x85')](_0x394b1e[_0xa66f('0x4a')][_0x183155])[_0xa66f('0x86')];_0x10fc75[_0xa66f('0x54')](_0xa66f('0x87'),_0x4feda0,_0x1f05bb);}else{if(_0x394b1e[_0xa66f('0x4a')][_0x183155]===_0xa66f('0x88')){_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x89'));}else{_0x10fc75[_0xa66f('0x54')]('i.'+_0x183155+_0xa66f('0x8a'),_0x394b1e[_0xa66f('0x4a')][_0x183155]);}}});}if(_0x394b1e[_0xa66f('0x4a')]['read']){if(_0x394b1e[_0xa66f('0x4a')]['read']==0x1){_0x10fc75[_0xa66f('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x10fc75[_0xa66f('0x6f')](_0xa66f('0x8b'));}}if(_0x394b1e[_0xa66f('0x4a')]['tag']){_0x8bea2b=_['isArray'](_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')])?_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]:new Array(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8c')]);_0x8bea2b[_0xa66f('0x40')](function(_0x578bff){_0x4b10cf['or'](_0xa66f('0x7b'),'%,'+_0x578bff+',%');});}if(_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')]){var _0x4426d2=_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x8d')][_0xa66f('0x8e')]('\x5c','\x5c\x5c')[_0xa66f('0x8e')](/'/g,'\x27\x27');if(qs[_0xa66f('0x8f')](_0x4426d2)){_0x2f1f1e['or'](_0xa66f('0x90'),_0x4426d2+'%');}else{_0x2f1f1e['or'](_0xa66f('0x91'),qs[_0xa66f('0x92')](_0x4426d2))['or'](_0xa66f('0x93'),_0x4426d2+'%');}}}_0x10fc75['where'](_0x2f1f1e);_0x10fc75[_0xa66f('0x94')](_0xa66f('0x95'));var _0x34ebfd={'type':db[_0xa66f('0x96')][_0xa66f('0x97')][_0xa66f('0x98')],'raw':!![]};var _0x3058aa=_0x10fc75[_0xa66f('0x99')]();_0x3058aa[_0xa66f('0x56')]('i.id');_0x3058aa[_0xa66f('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa66f('0x6d'));if(_0x276cd5['order']){_0x276cd5[_0xa66f('0x52')]['forEach'](function(_0x298bd8){var _0x5a1750=_0x298bd8[0x0]===_0xa66f('0x9a')?_0x298bd8[0x0]:'i.'+_0x298bd8[0x0];_0x10fc75[_0xa66f('0x52')](_0x5a1750,_0x298bd8[0x1]===_0xa66f('0x9b')?![]:!![]);});}if(!_[_0xa66f('0x9c')](_0x8bea2b)){_0x10fc75[_0xa66f('0x6f')](_0x4b10cf);_0x3058aa[_0xa66f('0x54')]('t.id\x20IN\x20?',_0x8bea2b);}BPromise[_0xa66f('0x9d')]()[_0xa66f('0x34')](function(){if(!_0x11c89e){if(_0x394b1e[_0xa66f('0x4a')]['ChatWebsiteId'])return;_0x3058aa[_0xa66f('0x54')](_0xa66f('0x9e'));_0x10fc75['where'](_0xa66f('0x9e'));return;}if(_0x394b1e[_0xa66f('0x9f')]['role']!=='agent')return;return _0x394b1e[_0xa66f('0x9f')][_0xa66f('0xa0')]({'attributes':['id'],'raw':!![]})[_0xa66f('0x34')](function(_0x2929fe){if(_[_0xa66f('0x9c')](_0x2929fe)){_0x3058aa['where'](_0xa66f('0xa1'));_0x10fc75[_0xa66f('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x3058aa[_0xa66f('0x54')](_0xa66f('0x83'),_['map'](_0x2929fe,'id'));_0x10fc75[_0xa66f('0x54')](_0xa66f('0x83'),_[_0xa66f('0x42')](_0x2929fe,'id'));}});})[_0xa66f('0x34')](function(){if(_0x394b1e[_0xa66f('0x9f')]['role']===_0xa66f('0x3b')&&!_0x11c89e&&!_0x394b1e[_0xa66f('0x4a')][_0xa66f('0x82')])return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x3058aa[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x2b2c54){_0xb52cc6[_0xa66f('0x2d')]=_0x2b2c54[_0xa66f('0x4f')];if(_0xb52cc6[_0xa66f('0x2d')]===0x0)return[];return db[_0xa66f('0xa2')][_0xa66f('0x4a')](_0x20d6be[_0xa66f('0xa3')](),_0x34ebfd)['then'](function(_0x5ec355){_0x13848d=_[_0xa66f('0xa4')](_0x5ec355,'id');_0x34ebfd=_['merge'](_0x34ebfd,{'model':db[_0xa66f('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x394b1e[_0xa66f('0x4a')]['fields']){_0x276cd5[_0xa66f('0x4e')][_0xa66f('0x40')](function(_0x3f84f9){_0x10fc75['field']('i.'+_0x3f84f9);});}else{_0x10fc75['field'](_0xa66f('0xa5'),'unreadMessages');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa6'),_0xa66f('0xa7'));_0x10fc75['field'](_0xa66f('0xa8'),'Account.mandatoryDisposition');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xa9'),_0xa66f('0x9a'));_0x10fc75[_0xa66f('0x56')]('i.*');_0x10fc75[_0xa66f('0x56')](_0xa66f('0xaa'),_0xa66f('0xab'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xac'),_0xa66f('0xad'));_0x10fc75['field'](_0xa66f('0xae'),_0xa66f('0xaf'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb0'),_0xa66f('0xb1'));_0x10fc75['field']('c.mobile',_0xa66f('0xb2'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb3'),_0xa66f('0xb4'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb5'),_0xa66f('0xb6'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb7'),_0xa66f('0xb8'));_0x10fc75[_0xa66f('0x56')](_0xa66f('0xb9'),'TagIds');}if(_0x276cd5[_0xa66f('0x2e')])_0x10fc75[_0xa66f('0x2e')](_0x276cd5['limit']);if(_0x276cd5[_0xa66f('0x2b')])_0x10fc75[_0xa66f('0x2b')](_0x276cd5[_0xa66f('0x2b')]);return db['sequelize']['query'](_0x10fc75[_0xa66f('0xa3')](),_0x34ebfd);})['then'](function(_0x3520e1){if(_0x3520e1[_0xa66f('0x4f')]>0x0)_0x12271d['where'](_0xa66f('0xba'),_[_0xa66f('0x42')](_0x3520e1,'id'));return db['sequelize'][_0xa66f('0x4a')](_0x12271d[_0xa66f('0xa3')](),_0x34ebfd)[_0xa66f('0x34')](function(_0x176b30){var _0x4bc36d=_['groupBy'](_0x176b30,_0xa66f('0xbb'));var _0xdd2d09=[];_0x3520e1[_0xa66f('0x40')](function(_0x1bab2b){_0xdd2d09[_0xa66f('0x41')](updateChatInteraction(_0x1bab2b,_0x13848d,_0x4bc36d));});return BPromise[_0xa66f('0xbc')](_0xdd2d09);});});})[_0xa66f('0x34')](function(_0xac0e98){_0xb52cc6[_0xa66f('0xbd')]=_0xac0e98;return _0xb52cc6;})[_0xa66f('0x34')](respondWithFilteredResult(_0x5cdfe2,_0x276cd5))['catch'](handleError(_0x5cdfe2,null));};exports['show']=function(_0x1d472d,_0x3cbbb6){var _0x3cf40f={'raw':![],'where':{'id':_0x1d472d[_0xa66f('0xbe')]['id']}},_0x4298ca={};_0x4298ca['model']=_[_0xa66f('0x49')](db[_0xa66f('0x43')][_0xa66f('0x44')]);_0x4298ca['query']=_['keys'](_0x1d472d['query']);_0x4298ca[_0xa66f('0x4b')]=_['intersection'](_0x4298ca[_0xa66f('0x48')],_0x4298ca[_0xa66f('0x4a')]);_0x3cf40f[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x4298ca['model'],qs[_0xa66f('0x4d')](_0x1d472d[_0xa66f('0x4a')]['fields']));_0x3cf40f[_0xa66f('0x4e')]=_0x3cf40f[_0xa66f('0x4e')]['length']?_0x3cf40f['attributes']:_0x4298ca[_0xa66f('0x48')];if(_0x1d472d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3cf40f['include']=[{'all':!![]}];}_0x3cf40f=_['merge']({},_0x3cf40f,_0x1d472d['options']);return db['ChatInteraction'][_0xa66f('0x77')](_0x3cf40f)[_0xa66f('0x34')](handleEntityNotFound(_0x3cbbb6,null))[_0xa66f('0x34')](respondWithResult(_0x3cbbb6,null))[_0xa66f('0x26')](handleError(_0x3cbbb6,null));};exports[_0xa66f('0xc0')]=function(_0x46c9b2,_0x580eb7){return db[_0xa66f('0x43')][_0xa66f('0xc0')](_0x46c9b2[_0xa66f('0x39')],{})[_0xa66f('0x34')](respondWithResult(_0x580eb7,0xc9))['catch'](handleError(_0x580eb7,null));};exports['update']=function(_0xd78ede,_0xe11c2d){if(_0xd78ede[_0xa66f('0x39')]['id']){delete _0xd78ede[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd78ede[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0xe11c2d,null))[_0xa66f('0x34')](saveUpdates(_0xd78ede[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0xe11c2d,null))['catch'](handleError(_0xe11c2d,null));};exports[_0xa66f('0x35')]=function(_0x597ae3,_0x1b93e0){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x597ae3[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x1b93e0,null))['then'](removeEntity(_0x1b93e0,null))['catch'](handleError(_0x1b93e0,null));};exports['describe']=function(_0x484c8e,_0x728faa){return db[_0xa66f('0x43')][_0xa66f('0xc1')]()[_0xa66f('0x34')](respondWithResult(_0x728faa,null))['catch'](handleError(_0x728faa,null));};exports[_0xa66f('0xc2')]=function(_0x174510,_0x4f3985){var _0x348e6b=_0x174510[_0xa66f('0xbe')]['id'];var _0x4ed950;var _0xe43d63;var _0x3c2367;return db['ChatInteraction'][_0xa66f('0xc3')]({'where':{'id':_0x348e6b}})[_0xa66f('0x34')](function(_0x32bea5){_0x4ed950=_0x32bea5;return db[_0xa66f('0xc4')][_0xa66f('0xc3')]({'where':{'id':_0x32bea5[_0xa66f('0x82')]},'attributes':['id',_0xa66f('0xc5'),_0xa66f('0xc6'),_0xa66f('0xc7'),_0xa66f('0xc8'),_0xa66f('0xc9')],'raw':!![]});})['then'](function(_0x4c8386){if(_0x4c8386&&_0x4c8386[_0xa66f('0xc5')]&&_0x4c8386[_0xa66f('0xc6')]){_0xe43d63=_0x4c8386;var _0x12278e={'interaction':{'id':_0x348e6b},'agent':{'id':_0x174510['user']['id'],'name':_0x174510['user'][_0xa66f('0x37')],'fullname':_0x174510[_0xa66f('0x9f')][_0xa66f('0xca')],'email':_0x174510[_0xa66f('0x9f')][_0xa66f('0xcb')]},'contact':_0x174510['body'][_0xa66f('0x3a')],'account':_0x174510[_0xa66f('0x39')][_0xa66f('0xcc')]};var _0xfc01d7={'rejectUnauthorized':![],'method':'POST','url':_0xa66f('0xcd'),'headers':{'X-APIKEY':_0x4c8386[_0xa66f('0xc5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x174510['user'][_0xa66f('0xcb')]],'buttons':null,'topic':_0xe43d63[_0xa66f('0xc7')],'note':_['isNull'](_0xe43d63[_0xa66f('0xc8')])?null:getMustacheRender(_0xe43d63[_0xa66f('0xc8')],_0x12278e),'metadata':null},'redirect':_0xa66f('0xce'),'json':!![]};try{if(!_[_0xa66f('0xcf')](_0xe43d63[_0xa66f('0xc9')])){var _0x3c73cc=getMustacheRender(_0xe43d63[_0xa66f('0xc9')],_0x12278e);var _0x4885bb=JSON['parse'](_0x3c73cc);_0xfc01d7[_0xa66f('0x39')][_0xa66f('0xd0')]=_0x4885bb;}}catch(_0x2e7c26){throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xfc01d7);}else{throw new db[(_0xa66f('0x96'))][(_0xa66f('0xd1'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa66f('0x34')](function(_0x56198a){_0x3c2367=_0x56198a;if(_0x3c2367['id']){var _0x41ef9a={'body':_0x3c2367[_0xa66f('0xd2')],'ChatWebsiteId':_0xe43d63['id'],'ChatInteractionId':_0x4ed950['id'],'direction':_0xa66f('0xd3'),'UserId':_0x174510[_0xa66f('0x9f')]['id']};return db['ChatMessage']['create'](_0x41ef9a,{});}else{throw new db['Sequelize'][(_0xa66f('0xd1'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa66f('0x34')](function(){return _0x4ed950['updateAttributes']({'vidaooSessionId':_0x3c2367['id']});})[_0xa66f('0x34')](respondWithResult(_0x4f3985,null))[_0xa66f('0x26')](handleError(_0x4f3985,null));};exports['customUpdate']=function(_0x35a2ce,_0x2d3bca){if(_0x35a2ce[_0xa66f('0x39')]['id']){delete _0x35a2ce[_0xa66f('0x39')]['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x35a2ce[_0xa66f('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xa66f('0x72')}]})[_0xa66f('0x34')](handleEntityNotFound(_0x2d3bca,null))[_0xa66f('0x34')](saveUpdates(_0x35a2ce[_0xa66f('0x39')],null))[_0xa66f('0x34')](respondWithResult(_0x2d3bca,null))[_0xa66f('0x26')](handleError(_0x2d3bca,null));};exports[_0xa66f('0xd4')]=function(_0x3a2c2c,_0x179953,_0x5dcf9d){if(_0x3a2c2c[_0xa66f('0x39')]['id']){delete _0x3a2c2c['body']['id'];}return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x3a2c2c[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](function(_0x1f4bc4){if(!_0x1f4bc4){logger['error'](_0xa66f('0xd5'),_0xa66f('0xd4'),0x194,_0xa66f('0xd6'));_0x179953[_0xa66f('0x27')](0x194);}else{if(_0x1f4bc4['UserId']){throw new db['Sequelize']['ValidationError'](_0xa66f('0xd7'));}}return _0x1f4bc4;})[_0xa66f('0x34')](function(_0x4be9ae){if(_0x4be9ae){return _0x4be9ae['update']({'closed':_0x3a2c2c[_0xa66f('0x39')][_0xa66f('0xd8')],'disposition':_0x3a2c2c['body'][_0xa66f('0xd9')]})[_0xa66f('0x34')](function(_0x17dc7d){return _0x17dc7d;});}})[_0xa66f('0x34')](function(_0x551c09){return respondWithRpcPromise('AbandonInteraction','abandon',_0x3a2c2c[_0xa66f('0x39')],client9004);})[_0xa66f('0x34')](respondWithResult(_0x179953,null))[_0xa66f('0x26')](handleError(_0x179953,null));};exports[_0xa66f('0xda')]=function(_0x377764,_0x434764,_0x315b27){_0x377764[_0xa66f('0x39')]['name']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdc')];_0x377764[_0xa66f('0x39')]['basename']=_0x377764[_0xa66f('0xdb')][_0xa66f('0xdd')];_0x377764[_0xa66f('0x39')]['type']=_0x377764['file'][_0xa66f('0xde')];return db[_0xa66f('0xdf')][_0xa66f('0xc0')](_0x377764[_0xa66f('0x39')])[_0xa66f('0x34')](respondWithResult(_0x434764,0xc9))[_0xa66f('0x26')](handleError(_0x434764,null));};exports[_0xa66f('0xe0')]=function(_0x5c5550,_0x383ce6,_0x4b2702){return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550[_0xa66f('0xbe')]['id']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null))[_0xa66f('0x34')](function(_0x32f7ab){if(_0x32f7ab){if(_0x32f7ab[_0xa66f('0xd8')]){return _0x383ce6[_0xa66f('0x28')](0x193)[_0xa66f('0x2a')]({'status':0x193,'message':_0xa66f('0xe1')});}return db[_0xa66f('0xdf')][_0xa66f('0xc3')]({'where':{'id':_0x5c5550['query']['attachId']},'raw':!![]})[_0xa66f('0x34')](handleEntityNotFound(_0x383ce6,null));}})[_0xa66f('0x34')](function(_0x29ce7f){if(_0x29ce7f){var _0x1248c9=_0x29ce7f[_0xa66f('0xe2')]!==null;var _0x13948a=path['join'](config[_0xa66f('0xe3')],'server/files/attachments/');if(_0x1248c9){_0x13948a=path['join'](_0x13948a,_0xa66f('0xe4'));}var _0x1ce936=path[_0xa66f('0xe5')](_0x13948a,_0x29ce7f[_0xa66f('0xe6')]);return _0x383ce6['download'](_0x1ce936);}})[_0xa66f('0x26')](handleError(_0x383ce6,null));};exports[_0xa66f('0xe7')]=function(_0x1686df,_0x1889f4){var _0x2a03c8=null;var _0x48b16d=null;var _0x5a05e4=null;var _0x1b78fa=null;if(_0x1686df[_0xa66f('0x39')]['id']){delete _0x1686df[_0xa66f('0x39')]['id'];}if(_0x1686df[_0xa66f('0x39')]['mailTranscript']){_0x1b78fa=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0xe8'),util[_0xa66f('0xe9')](_0xa66f('0xea'),Date[_0xa66f('0xeb')]()));_0x1686df[_0xa66f('0x39')][_0xa66f('0xec')]=_0x1b78fa;}return db['ChatInteraction'][_0xa66f('0x77')]({'where':{'id':_0x1686df[_0xa66f('0xbe')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66f('0xed'),'include':[{'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee')}]}]})[_0xa66f('0x34')](handleEntityNotFound(_0x1889f4,null))[_0xa66f('0x34')](saveUpdates(_0x1686df['body'],null))[_0xa66f('0x34')](function(_0x4153a0){if(_0x4153a0){_0x2a03c8=_0x4153a0;return db[_0xa66f('0xc4')][_0xa66f('0x77')]({'where':{'id':_0x2a03c8[_0xa66f('0x82')]}});}})['then'](function(_0x820ac1){if(_0x820ac1){_0x5a05e4=_0x820ac1;return db[_0xa66f('0xef')]['find']({'where':{'id':_0x2a03c8[_0xa66f('0xf0')]}});}})[_0xa66f('0x34')](function(_0x22d154){if(_0x22d154){_0x48b16d=_0x22d154;if(_0x1b78fa){var _0x31959f=null;for(var _0x2d3123=0x1;_0x2d3123<_0x2a03c8['Messages'][_0xa66f('0x4f')];++_0x2d3123){_0x31959f=_0x2a03c8[_0xa66f('0xed')][_0x2d3123];var _0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f['UserId']):_0xa66f('0xf3');var _0x19fabd=_0x1686df[_0xa66f('0x39')][_0xa66f('0xf4')]||util['format'](_0xa66f('0xf1'),_0xa66f('0xf5'),_0x31959f['ContactId']);switch(_0x5a05e4[_0xa66f('0xf6')]){case _0xa66f('0xf7'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?util['format'](_0xa66f('0xf1'),_0x5a05e4[_0xa66f('0xf2')],_0x31959f[_0xa66f('0x7e')]):'System';break;case _0xa66f('0xf8'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f['User']['alias']||_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:'System';break;case _0xa66f('0xf9'):_0x207ea2=_0x31959f[_0xa66f('0x7e')]?_0x31959f[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3');break;default:_0x207ea2=_0x31959f['UserId']?util[_0xa66f('0xe9')](_0xa66f('0xf1'),_0x5a05e4['agentAlias'],_0x31959f[_0xa66f('0x7e')]):'System';}var _0x506797=util[_0xa66f('0xe9')](_0xa66f('0xfa'),moment(_0x31959f['createdAt'])[_0xa66f('0xe9')]('MM/DD/YYYY\x20HH:mm:ss'),_0x31959f[_0xa66f('0xfb')]==='in'?_0x19fabd:_0x207ea2,_0x31959f[_0xa66f('0x39')]);if(!_0x31959f['secret']){fs['appendFileSync'](_0x1b78fa,_0x506797);}}return db['MailAccount'][_0xa66f('0xc3')]({'where':{'service':!![]},'include':[{'model':db[_0xa66f('0xfc')],'as':_0xa66f('0xfd'),'raw':!![]}]});}}})[_0xa66f('0x34')](function(_0x168d31){if(_0x168d31&&_0x168d31[_0xa66f('0xfd')]&&_0x1686df[_0xa66f('0x39')]){var _0x5a762d={'tls':{'rejectUnauthorized':![]}};if(_0x168d31['Smtp'][_0xa66f('0xfe')]){_0x5a762d[_0xa66f('0xfe')]=_0x168d31[_0xa66f('0xfd')][_0xa66f('0xfe')];}else{_0x5a762d[_0xa66f('0xff')]=_0x168d31[_0xa66f('0xfd')]['host'];_0x5a762d[_0xa66f('0x100')]=_0x168d31[_0xa66f('0xfd')]['port'];_0x5a762d[_0xa66f('0x101')]=_0x168d31['Smtp'][_0xa66f('0x101')];}if(_0x168d31['Smtp']['authentication']){_0x5a762d[_0xa66f('0x102')]={'user':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x9f')],'pass':_0x168d31[_0xa66f('0xfd')][_0xa66f('0x103')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x5a762d,'message':{'from':util[_0xa66f('0xe9')](_0xa66f('0x104'),_0x168d31[_0xa66f('0x37')],_0x168d31['email']||_0x168d31['Smtp']['user']),'to':_0x1686df[_0xa66f('0x39')][_0xa66f('0x105')],'subject':_0xa66f('0x106'),'text':util[_0xa66f('0xe9')](_0xa66f('0x107'),_0x1686df[_0xa66f('0x39')]['mailTranscript']),'attachments':[{'path':_0x1b78fa}]}})[_0xa66f('0x34')](function(){return _0x2a03c8;})[_0xa66f('0x26')](function(_0x3215af){console['error'](_0x3215af);});}else{return _0x2a03c8;}})[_0xa66f('0x34')](respondWithStatusCode(_0x1889f4,0xc8))[_0xa66f('0x26')](handleError(_0x1889f4,null));};exports['addMessage']=function(_0x4e4b66,_0x2aaaab,_0x75d882){return db[_0xa66f('0x108')][_0xa66f('0x77')]({'where':{'id':_0x4e4b66['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x2aaaab,null))[_0xa66f('0x34')](function(_0x21e1d1){if(_0x21e1d1){return _0x21e1d1[_0xa66f('0x109')](_0x4e4b66[_0xa66f('0x39')]['ids'],_[_0xa66f('0x10a')](_0x4e4b66[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{});}})['then'](respondWithResult(_0x2aaaab,null))[_0xa66f('0x26')](handleError(_0x2aaaab,null));};exports[_0xa66f('0x10c')]=function(_0x53170d,_0x5d1e51,_0x3c3aff){var _0x3fb295={'raw':![],'where':{}};var _0x57c403={};var _0x31832f={'count':0x0,'rows':[]};return db[_0xa66f('0x43')][_0xa66f('0xc3')]({'where':{'id':_0x53170d[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x5d1e51,null))[_0xa66f('0x34')](function(_0x43cc99){if(_0x43cc99){_0x57c403['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x57c403['query']=_['keys'](_0x53170d[_0xa66f('0x4a')]);_0x57c403[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],_0x57c403[_0xa66f('0x4a')]);_0x3fb295['attributes']=_[_0xa66f('0x4c')](_0x57c403[_0xa66f('0x48')],qs['fields'](_0x53170d['query']['fields']));_0x3fb295[_0xa66f('0x4e')]=_0x3fb295[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x3fb295['attributes']:_0x57c403[_0xa66f('0x48')];if(!_0x53170d[_0xa66f('0x4a')][_0xa66f('0x50')]('nolimit')){_0x3fb295[_0xa66f('0x2e')]=qs[_0xa66f('0x2e')](_0x53170d[_0xa66f('0x4a')]['limit']);_0x3fb295[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x3fb295[_0xa66f('0x52')]=qs[_0xa66f('0x53')](_0x53170d[_0xa66f('0x4a')][_0xa66f('0x53')]);_0x3fb295['where']=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x53170d[_0xa66f('0x4a')],_0x57c403[_0xa66f('0x4b')]));_0x3fb295[_0xa66f('0x54')][_0xa66f('0xbb')]=_0x43cc99['id'];if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]){_0x3fb295[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x3fb295[_0xa66f('0x54')],{'$or':_[_0xa66f('0x42')](_0x3fb295[_0xa66f('0x4e')],function(_0x2b9a3c){var _0x1d688a={};_0x1d688a[_0x2b9a3c]={'$like':'%'+_0x53170d[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x1d688a;})});}if(_0x53170d['query'][_0xa66f('0x84')]){var _0x570a01=_0x53170d['query']['$gte'][_0xa66f('0x3f')](',');var _0x35919e={};_0x35919e[_0x570a01[0x0]]={'$gte':moment(_0x570a01[0x1])[_0xa66f('0xe9')](_0xa66f('0x10e'))};_0x3fb295[_0xa66f('0x54')]=_['merge'](_0x3fb295[_0xa66f('0x54')],_0x35919e);}_0x3fb295=_['merge']({},_0x3fb295,_0x53170d[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x3fb295['where']})[_0xa66f('0x34')](function(_0x3517eb){_0x31832f[_0xa66f('0x2d')]=_0x3517eb;if(_0x53170d[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x3fb295['include']=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x3fb295);})[_0xa66f('0x34')](function(_0x24c209){_0x31832f[_0xa66f('0xbd')]=_0x24c209;return _0x31832f;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x5d1e51,_0x3fb295))[_0xa66f('0x26')](handleError(_0x5d1e51,null));};exports[_0xa66f('0x110')]=function(_0x1ef4c2,_0x21ec7f,_0x32b1c1){var _0x4ee9a3={'where':{}},_0x12889f={},_0xc813ad={'count':0x0,'rows':[]};return db[_0xa66f('0x43')]['findOne']({'where':{'id':_0x1ef4c2['params']['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x21ec7f,null))[_0xa66f('0x34')](function(_0x3a1e4a){if(_0x3a1e4a){_0x12889f['model']=_[_0xa66f('0x49')](db[_0xa66f('0x108')]['rawAttributes']);_0x12889f[_0xa66f('0x4a')]=_[_0xa66f('0x49')](_0x1ef4c2[_0xa66f('0x4a')]);_0x12889f[_0xa66f('0x4b')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],_0x12889f[_0xa66f('0x4a')]);_0x4ee9a3[_0xa66f('0x4e')]=_[_0xa66f('0x4c')](_0x12889f[_0xa66f('0x48')],qs[_0xa66f('0x4d')](_0x1ef4c2[_0xa66f('0x4a')]['fields']));_0x4ee9a3[_0xa66f('0x4e')]=_0x4ee9a3[_0xa66f('0x4e')][_0xa66f('0x4f')]?_0x4ee9a3[_0xa66f('0x4e')]:_0x12889f['model'];if(!_0x1ef4c2[_0xa66f('0x4a')]['hasOwnProperty'](_0xa66f('0x51'))){_0x4ee9a3[_0xa66f('0x2e')]=qs['limit'](_0x1ef4c2['query'][_0xa66f('0x2e')]);_0x4ee9a3[_0xa66f('0x2b')]=qs[_0xa66f('0x2b')](_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x2b')]);}_0x4ee9a3[_0xa66f('0x52')]=qs['sort'](_0x1ef4c2['query']['sort']);_0x4ee9a3[_0xa66f('0x54')]=qs[_0xa66f('0x4b')](_[_0xa66f('0x55')](_0x1ef4c2[_0xa66f('0x4a')],_0x12889f[_0xa66f('0x4b')]));_0x4ee9a3['where'][_0xa66f('0xbb')]=_0x3a1e4a['id'];if(_0x1ef4c2['query'][_0xa66f('0x8d')]){_0x4ee9a3[_0xa66f('0x54')]=_[_0xa66f('0x10d')](_0x4ee9a3['where'],{'$or':_['map'](_0x4ee9a3[_0xa66f('0x4e')],function(_0x2bf349){var _0x211ac6={};_0x211ac6[_0x2bf349]={'$like':'%'+_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x8d')]+'%'};return _0x211ac6;})});}_0x4ee9a3[_0xa66f('0x54')]['secret']=![];if(_0x1ef4c2[_0xa66f('0x4a')]['id']){_0x4ee9a3['where']['id']={'$gt':_0x1ef4c2['query']['id']};}_0x4ee9a3=_[_0xa66f('0x10d')]({},_0x4ee9a3,_0x1ef4c2[_0xa66f('0x10f')]);return db[_0xa66f('0x108')]['count']({'where':_0x4ee9a3['where']})['then'](function(_0x533dc1){_0xc813ad[_0xa66f('0x2d')]=_0x533dc1;_0x4ee9a3[_0xa66f('0x111')]=[];if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0x112')]){_0x4ee9a3[_0xa66f('0x111')][_0xa66f('0x41')]({'model':db[_0xa66f('0xee')],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca'),_0xa66f('0x113')]});}if(_0x1ef4c2[_0xa66f('0x4a')][_0xa66f('0xbf')]){_0x4ee9a3[_0xa66f('0x111')]=[{'all':!![]}];}return db[_0xa66f('0x108')]['findAll'](_0x4ee9a3);})['then'](function(_0x554ba6){_0xc813ad[_0xa66f('0xbd')]=_0x554ba6;return _0xc813ad;});}})[_0xa66f('0x34')](respondWithFilteredResult(_0x21ec7f,_0x4ee9a3))[_0xa66f('0x26')](handleError(_0x21ec7f,null));};exports[_0xa66f('0x114')]=function(_0x1a3bac,_0x44649c,_0x5e4fbc){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x1a3bac[_0xa66f('0xbe')]['id']}})['then'](handleEntityNotFound(_0x44649c,null))[_0xa66f('0x34')](function(_0x1d2967){if(_0x1d2967){return _0x1d2967[_0xa66f('0x115')](_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')],_[_0xa66f('0x10a')](_0x1a3bac[_0xa66f('0x39')],[_0xa66f('0x10b'),'id'])||{})['spread'](function(){return db[_0xa66f('0x7a')][_0xa66f('0x116')]({'attributes':['id','name',_0xa66f('0x117')],'where':{'id':_0x1a3bac[_0xa66f('0x39')][_0xa66f('0x10b')]}});})['then'](function(_0x367549){socket[_0xa66f('0x118')](_0xa66f('0x119'),{'id':Number(_0x1a3bac['params']['id']),'tags':_0x367549||[]});return{'id':Number(_0x1a3bac[_0xa66f('0xbe')]['id']),'tags':_0x367549||[]};});}})[_0xa66f('0x34')](respondWithResult(_0x44649c,null))[_0xa66f('0x26')](handleError(_0x44649c,null));};exports[_0xa66f('0x11a')]=function(_0x4a1613,_0x324b7e,_0x1d3395){return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0x4a1613[_0xa66f('0xbe')]['id']}})[_0xa66f('0x34')](handleEntityNotFound(_0x324b7e,null))[_0xa66f('0x34')](function(_0x33f1ea){if(_0x33f1ea){return _0x33f1ea[_0xa66f('0x11a')](_0x4a1613[_0xa66f('0x4a')]['ids']);}})[_0xa66f('0x34')](respondWithStatusCode(_0x324b7e,null))['catch'](handleError(_0x324b7e,null));};exports[_0xa66f('0x11b')]=function(_0xd7dccf,_0x2b4238){var _0x321fa1=moment()['unix']()['toString']();var _0x254599=path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),_0xa66f('0x11d'),_0xa66f('0x11e'));var _0x3b9ff3=path['join'](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'files',_0xa66f('0x11f'));var _0x5206a5=path['join'](_0x254599,_0x321fa1);var _0x6b60bd=util[_0xa66f('0xe9')](_0xa66f('0x120'),_0xd7dccf['params']['id'],_0x321fa1);var _0x3709b6=path['join'](_0x254599,_0x6b60bd);var _0x21bda3=[];_0x21bda3[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0xee'),'attributes':['id',_0xa66f('0xca')],'raw':!![]});_0x21bda3[_0xa66f('0x41')]({'model':db[_0xa66f('0xef')],'as':_0xa66f('0x72'),'attributes':['id',_0xa66f('0x121'),_0xa66f('0x122')],'raw':!![]});if(_0xd7dccf['query'][_0xa66f('0x11f')]){_0x21bda3[_0xa66f('0x41')]({'model':db['Attachment'],'as':_0xa66f('0xdf'),'raw':!![]});}var _0x22e7a6=[{'model':db[_0xa66f('0x108')],'as':_0xa66f('0xed'),'attributes':['id',_0xa66f('0x39'),_0xa66f('0x123'),_0xa66f('0xfb'),_0xa66f('0x124'),_0xa66f('0x125')],'include':_0x21bda3}];_0x22e7a6[_0xa66f('0x41')]({'model':db[_0xa66f('0xc4')],'as':_0xa66f('0x126'),'attributes':['id','name']});_0x22e7a6[_0xa66f('0x41')]({'model':db['User'],'as':_0xa66f('0x127'),'attributes':['id',_0xa66f('0xca')]});return db[_0xa66f('0x43')][_0xa66f('0x77')]({'where':{'id':_0xd7dccf[_0xa66f('0xbe')]['id']},'include':_0x22e7a6})[_0xa66f('0x34')](handleEntityNotFound(_0x2b4238,null))[_0xa66f('0x34')](function(_0x5efd6c){if(_0x5efd6c){var _0x24ee72=_0x5efd6c['get']({'plain':!![]});fs[_0xa66f('0x128')](_0x5206a5);var _0xdbb792={'channel':_0xa66f('0x129'),'account':_0x24ee72['Account'][_0xa66f('0x37')],'agent':_0x24ee72[_0xa66f('0x127')]?_0x24ee72['Owner']['fullname']:_0xa66f('0x12a'),'createdAt':moment(_0x24ee72[_0xa66f('0x123')])[_0xa66f('0xe9')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa66f('0xa3')](),'closedAt':_0x24ee72[_0xa66f('0xd8')]?moment(_0x24ee72[_0xa66f('0x12b')])['format'](_0xa66f('0x10e'))[_0xa66f('0xa3')]():'','disposition':_0x24ee72[_0xa66f('0xd9')],'chatInfo':{'browser':_0x24ee72[_0xa66f('0x12c')],'os':_0x24ee72[_0xa66f('0x12d')],'referer':_0x24ee72['referer'],'customerIp':_0x24ee72[_0xa66f('0x12e')],'customerPort':_0x24ee72[_0xa66f('0x12f')]?_0x24ee72[_0xa66f('0x12f')]:_0xa66f('0x12a')},'messages':_(_0x24ee72[_0xa66f('0xed')])[_0xa66f('0x130')]()['filter']({'secret':![]})[_0xa66f('0x42')](function(_0x31cc20){if(_0x31cc20['Attachment']){var _0x10a611=path[_0xa66f('0xe5')](_0x3b9ff3,_0x31cc20['Attachment'][_0xa66f('0xe6')]);if(fs[_0xa66f('0x131')](_0x10a611)){fs[_0xa66f('0x132')](_0x10a611)['pipe'](fs[_0xa66f('0x133')](path['join'](_0x5206a5,_0x31cc20['Attachment']['basename'])));}}return{'date':moment(_0x31cc20['createdAt'])['format'](_0xa66f('0x10e'))['toString'](),'sender':_0x31cc20[_0xa66f('0xfb')]===_0xa66f('0xd3')?_0x31cc20[_0xa66f('0xee')]?_0x31cc20[_0xa66f('0xee')][_0xa66f('0xca')]:_0xa66f('0xf3'):_0x31cc20[_0xa66f('0x72')][_0xa66f('0x121')]+(_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]?'\x20'+_0x31cc20[_0xa66f('0x72')][_0xa66f('0x122')]:''),'body':_0x31cc20[_0xa66f('0xdf')]?_0x31cc20[_0xa66f('0xdf')][_0xa66f('0xe6')]:_0x31cc20[_0xa66f('0x39')],'direction':_0x31cc20[_0xa66f('0xfb')]==='out'?'A':'C','secret':_0x31cc20['secret'],'read':_0x31cc20[_0xa66f('0x125')],'attachment':_0x31cc20[_0xa66f('0xdf')]};})[_0xa66f('0x6e')]()};return ejs[_0xa66f('0x134')](path[_0xa66f('0xe5')](config[_0xa66f('0xe3')],_0xa66f('0x11c'),'views',_0xa66f('0x135')),{'interaction':_0xdbb792})['then'](function(_0x12024d){var _0x4baf59=path[_0xa66f('0xe5')](_0x5206a5,_0xa66f('0x136')+_0x24ee72['id']+'-'+_0x321fa1+'.pdf');var _0x33198c={'path':_0x4baf59,'channel':_0xa66f('0x129'),'interactionId':_0x24ee72['id']};return pdf[_0xa66f('0x137')](_0x12024d,_0x33198c);})[_0xa66f('0x34')](function(){return new BPromise(function(_0x3792b2,_0x5101f8){zipdir(_0x5206a5,{'saveTo':_0x3709b6},function(_0x4ac4b4,_0x171111){if(_0x4ac4b4)return _0x5101f8(_0x4ac4b4);return _0x3792b2(_0x171111);});})[_0xa66f('0x34')](function(){return new BPromise(function(_0x46691d,_0x136518){rimraf(_0x5206a5,function(_0x1404df){if(_0x1404df)_0x136518(_0x1404df);return _0x46691d();});});})[_0xa66f('0x34')](function(){return _0x2b4238[_0xa66f('0x11b')](_0x3709b6,_0x6b60bd,function(_0x58f445){if(_0x58f445){console[_0xa66f('0x138')](_0xa66f('0x139'),_0x58f445);}else{fs['unlinkSync'](_0x3709b6);}});});});}else{return _0x2b4238[_0xa66f('0x27')](0xc8);}})['catch'](handleError(_0x2b4238,null));};
\ No newline at end of file
+var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x39874a,_0x3e9340){_0x39874a=_0x39874a-0x0;var _0x12a8fe=_0x9ffd[_0x39874a];return _0x12a8fe;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 5fc6faa..94ef663 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 _0x915c=['update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x915c,0xa5));var _0xc915=function(_0x1bfc42,_0x56e7fc){_0x1bfc42=_0x1bfc42-0x0;var _0x3f7592=_0x915c[_0x1bfc42];return _0x3f7592;};'use strict';var EventEmitter=require(_0xc915('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xc915('0x1')];var ChatMessage=require(_0xc915('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xc915('0x3')](0x0);var events={'afterCreate':_0xc915('0x4'),'afterUpdate':_0xc915('0x5'),'afterDestroy':_0xc915('0x6')};function emitEvent(_0x20ff5b){return function(_0x449dd9,_0x9feaff,_0x559354){_0x449dd9[_0xc915('0x7')]({'attributes':['id'],'raw':!![]})[_0xc915('0x8')](function(_0x1253f0){_0x449dd9[_0xc915('0x9')](_0xc915('0xa'),_0x1253f0[_0xc915('0xb')](function(_0x27b230){return{'id':_0x27b230['id']};}));return ChatMessage[_0xc915('0xc')]({'where':{'ChatInteractionId':_0x449dd9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc915('0x8')](function(_0x94a767){_0x449dd9['setDataValue']('unreadMessages',_0x94a767[_0xc915('0xd')]);ChatInteractionEvents[_0xc915('0xe')](_0x20ff5b+':'+_0x449dd9['id'],_0x449dd9);ChatInteractionEvents['emit'](_0x20ff5b,_0x449dd9);_0x559354(null);})[_0xc915('0xf')](_0x559354(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xc915('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x6155=['ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4160e4,_0x14484b){var _0x5cc04e=function(_0x18f387){while(--_0x18f387){_0x4160e4['push'](_0x4160e4['shift']());}};_0x5cc04e(++_0x14484b);}(_0x6155,0xc4));var _0x5615=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x6155[_0x46e363];return _0x3fb059;};'use strict';var EventEmitter=require(_0x5615('0x0'));var ChatInteraction=require(_0x5615('0x1'))['db'][_0x5615('0x2')];var ChatMessage=require(_0x5615('0x1'))['db'][_0x5615('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5615('0x4')](0x0);var events={'afterCreate':_0x5615('0x5'),'afterUpdate':'update','afterDestroy':_0x5615('0x6')};function emitEvent(_0x176f3b){return function(_0x1cba76,_0x4c8c0c,_0x5d491c){_0x1cba76['getUsers']({'attributes':['id'],'raw':!![]})[_0x5615('0x7')](function(_0x1952e1){_0x1cba76[_0x5615('0x8')]('Users',_0x1952e1[_0x5615('0x9')](function(_0x4398d8){return{'id':_0x4398d8['id']};}));return ChatMessage[_0x5615('0xa')]({'where':{'ChatInteractionId':_0x1cba76['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5615('0x7')](function(_0xda388){_0x1cba76['setDataValue'](_0x5615('0xb'),_0xda388[_0x5615('0xc')]);ChatInteractionEvents['emit'](_0x176f3b+':'+_0x1cba76['id'],_0x1cba76);ChatInteractionEvents[_0x5615('0xd')](_0x176f3b,_0x1cba76);_0x5d491c(null);})[_0x5615('0xe')](_0x5d491c(null));};}for(var e in events){if(events[_0x5615('0xf')](e)){var event=events[e];ChatInteraction[_0x5615('0x10')](e,emitEvent(event));}}module[_0x5615('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index e221149..af196dc 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 _0x4609=['utf8mb4','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4609,0x199));var _0x9460=function(_0x2b003c,_0x21b39b){_0x2b003c=_0x2b003c-0x0;var _0x3aff56=_0x4609[_0x2b003c];return _0x3aff56;};'use strict';var _=require('lodash');var util=require(_0x9460('0x0'));var logger=require(_0x9460('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9460('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9460('0x3'));var rimraf=require(_0x9460('0x4'));var config=require(_0x9460('0x5'));var attributes=require(_0x9460('0x6'));module[_0x9460('0x7')]=function(_0x558c59,_0x32a5c3){return _0x558c59[_0x9460('0x8')](_0x9460('0x9'),attributes,{'tableName':_0x9460('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5243f7,_0x405e80,_0x3fad96){if(_0x5243f7[_0x9460('0xb')](_0x9460('0xc'))){_0x5243f7[_0x9460('0xd')]=moment()[_0x9460('0xe')](_0x9460('0xf'));}_0x3fad96(null,_0x5243f7);}},'charset':_0x9460('0x10'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xb81c=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','../../config/environment','exports','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x264492,_0x56838b){var _0x2ecbe4=function(_0x3deb03){while(--_0x3deb03){_0x264492['push'](_0x264492['shift']());}};_0x2ecbe4(++_0x56838b);}(_0xb81c,0xd3));var _0xcb81=function(_0x34ebb8,_0x441691){_0x34ebb8=_0x34ebb8-0x0;var _0x3cd254=_0xb81c[_0x34ebb8];return _0x3cd254;};'use strict';var _=require(_0xcb81('0x0'));var util=require(_0xcb81('0x1'));var logger=require(_0xcb81('0x2'))('api');var moment=require(_0xcb81('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcb81('0x5'));var attributes=require('./chatInteraction.attributes');module[_0xcb81('0x6')]=function(_0x9fb7c7,_0xb6ebd5){return _0x9fb7c7['define']('ChatInteraction',attributes,{'tableName':_0xcb81('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1cc91b,_0xfca7b6,_0x2f4831){if(_0x1cc91b['changed'](_0xcb81('0x8'))){_0x1cc91b[_0xcb81('0x9')]=moment()[_0xcb81('0xa')](_0xcb81('0xb'));}_0x2f4831(null,_0x1cc91b);}},'charset':_0xcb81('0xc'),'collate':_0xcb81('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 99385f2..7cea969 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 _0x771f=['attributes','limit','stringify','AddTagsToChatInteraction','find','body','ids','spread','AddTags','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where'];(function(_0x58dd03,_0x10ad3b){var _0x3d94bb=function(_0x5df1c8){while(--_0x5df1c8){_0x58dd03['push'](_0x58dd03['shift']());}};_0x3d94bb(++_0x10ad3b);}(_0x771f,0x151));var _0xf771=function(_0x1deee5,_0x1d4485){_0x1deee5=_0x1deee5-0x0;var _0x1d6c3a=_0x771f[_0x1deee5];return _0x1d6c3a;};'use strict';var _=require(_0xf771('0x0'));var util=require('util');var moment=require(_0xf771('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf771('0x2'));var db=require(_0xf771('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf771('0x4'));var config=require(_0xf771('0x5'));var jayson=require(_0xf771('0x6'));var client=jayson[_0xf771('0x7')][_0xf771('0x8')]({'port':0x232a});config['redis']=_[_0xf771('0x9')](config['redis'],{'host':_0xf771('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf771('0xb')]));require(_0xf771('0xc'))[_0xf771('0xd')](socket);function respondWithRpcPromise(_0x26c399,_0x5bce59,_0x47a3bb){return new BPromise(function(_0x24d2a5,_0x4f1766){return client[_0xf771('0xe')](_0x26c399,_0x47a3bb)[_0xf771('0xf')](function(_0x314420){logger[_0xf771('0x10')](_0xf771('0x11'),_0x5bce59,_0xf771('0x12'));logger[_0xf771('0x13')](_0xf771('0x14'),_0x5bce59,_0xf771('0x12'),JSON['stringify'](_0x314420));if(_0x314420[_0xf771('0x15')]){if(_0x314420['error'][_0xf771('0x16')]===0x1f4){logger[_0xf771('0x15')](_0xf771('0x11'),_0x5bce59,_0x314420['error']['message']);return _0x4f1766(_0x314420[_0xf771('0x15')][_0xf771('0x17')]);}logger[_0xf771('0x15')](_0xf771('0x11'),_0x5bce59,_0x314420[_0xf771('0x15')][_0xf771('0x17')]);return _0x24d2a5(_0x314420[_0xf771('0x15')][_0xf771('0x17')]);}else{logger['info'](_0xf771('0x11'),_0x5bce59,_0xf771('0x12'));_0x24d2a5(_0x314420[_0xf771('0x18')]['message']);}})[_0xf771('0x19')](function(_0x555e0e){logger[_0xf771('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x5bce59,_0x555e0e);_0x4f1766(_0x555e0e);});});}exports[_0xf771('0x1a')]=function(_0xf2d310){var _0x1aa6d6=this;return new Promise(function(_0x44ea2f,_0xc0942f){return db[_0xf771('0x1b')][_0xf771('0x1c')](_0xf2d310['body'],{'raw':_0xf2d310[_0xf771('0x1d')]?_0xf2d310['options'][_0xf771('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf2d310[_0xf771('0x1d')]?_0xf2d310['options'][_0xf771('0x1f')]||null:null,'attributes':_0xf2d310[_0xf771('0x1d')]?_0xf2d310['options'][_0xf771('0x20')]||null:null,'limit':_0xf2d310[_0xf771('0x1d')]?_0xf2d310[_0xf771('0x1d')][_0xf771('0x21')]||null:null})[_0xf771('0xf')](function(_0xa18258){logger[_0xf771('0x10')](_0xf771('0x1a'),_0xf2d310);logger[_0xf771('0x13')]('UpdateChatInteraction',_0xf2d310,JSON[_0xf771('0x22')](_0xa18258));_0x44ea2f(_0xa18258);})['catch'](function(_0x488015){logger[_0xf771('0x15')]('UpdateChatInteraction',_0x488015['message'],_0xf2d310);_0xc0942f(_0x1aa6d6[_0xf771('0x15')](0x1f4,_0x488015[_0xf771('0x17')]));});});};exports[_0xf771('0x23')]=function(_0x37dbd0){return new Promise(function(_0x47bb1f,_0x118159){return db['ChatInteraction'][_0xf771('0x24')]({'where':_0x37dbd0['options']?_0x37dbd0[_0xf771('0x1d')]['where']||null:null})[_0xf771('0xf')](function(_0x224d09){if(_0x224d09){return _0x224d09['addTags'](_0x37dbd0[_0xf771('0x25')][_0xf771('0x26')],_['omit'](_0x37dbd0['body'],[_0xf771('0x26'),'id'])||{});}})[_0xf771('0x27')](function(_0x33e959){logger[_0xf771('0x10')](_0xf771('0x28'),_0x37dbd0);logger[_0xf771('0x13')](_0xf771('0x28'),_0x37dbd0,JSON['stringify'](_0x33e959));_0x47bb1f(_0x33e959);})[_0xf771('0x19')](function(_0x1c5136){logger[_0xf771('0x15')](_0xf771('0x28'),_0x1c5136['message'],_0x37dbd0);_0x118159(_this[_0xf771('0x15')](0x1f4,_0x1c5136[_0xf771('0x17')]));});});};
\ No newline at end of file
+var _0x18f4=['ChatInteraction','where','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateChatInteraction','update','options','raw','then','stringify','AddTagsToChatInteraction'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x18f4,0x150));var _0x418f=function(_0xf6031,_0x895009){_0xf6031=_0xf6031-0x0;var _0x535425=_0x18f4[_0xf6031];return _0x535425;};'use strict';var _=require(_0x418f('0x0'));var util=require(_0x418f('0x1'));var moment=require('moment');var BPromise=require(_0x418f('0x2'));var rs=require(_0x418f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x418f('0x4'))['db'];var utils=require(_0x418f('0x5'));var logger=require('../../config/logger')(_0x418f('0x6'));var config=require(_0x418f('0x7'));var jayson=require(_0x418f('0x8'));var client=jayson[_0x418f('0x9')]['http']({'port':0x232a});config['redis']=_[_0x418f('0xa')](config[_0x418f('0xb')],{'host':_0x418f('0xc'),'port':0x18eb});var socket=require(_0x418f('0xd'))(new Redis(config[_0x418f('0xb')]));require(_0x418f('0xe'))[_0x418f('0xf')](socket);function respondWithRpcPromise(_0x3b77c3,_0x3a9eab,_0x1eb321){return new BPromise(function(_0x416765,_0x1d43f7){return client[_0x418f('0x10')](_0x3b77c3,_0x1eb321)['then'](function(_0x1c1785){logger[_0x418f('0x11')](_0x418f('0x12'),_0x3a9eab,_0x418f('0x13'));logger[_0x418f('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3a9eab,_0x418f('0x13'),JSON['stringify'](_0x1c1785));if(_0x1c1785[_0x418f('0x15')]){if(_0x1c1785[_0x418f('0x15')][_0x418f('0x16')]===0x1f4){logger[_0x418f('0x15')](_0x418f('0x12'),_0x3a9eab,_0x1c1785[_0x418f('0x15')][_0x418f('0x17')]);return _0x1d43f7(_0x1c1785[_0x418f('0x15')][_0x418f('0x17')]);}logger[_0x418f('0x15')](_0x418f('0x12'),_0x3a9eab,_0x1c1785['error']['message']);return _0x416765(_0x1c1785[_0x418f('0x15')][_0x418f('0x17')]);}else{logger[_0x418f('0x11')](_0x418f('0x12'),_0x3a9eab,'request\x20sent');_0x416765(_0x1c1785[_0x418f('0x18')][_0x418f('0x17')]);}})[_0x418f('0x19')](function(_0x365302){logger[_0x418f('0x15')](_0x418f('0x12'),_0x3a9eab,_0x365302);_0x1d43f7(_0x365302);});});}exports[_0x418f('0x1a')]=function(_0x5be689){var _0x390cbf=this;return new Promise(function(_0x51720c,_0x47923b){return db['ChatInteraction'][_0x418f('0x1b')](_0x5be689['body'],{'raw':_0x5be689['options']?_0x5be689[_0x418f('0x1c')][_0x418f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be689['options']?_0x5be689[_0x418f('0x1c')]['where']||null:null,'attributes':_0x5be689[_0x418f('0x1c')]?_0x5be689['options']['attributes']||null:null,'limit':_0x5be689['options']?_0x5be689[_0x418f('0x1c')]['limit']||null:null})[_0x418f('0x1e')](function(_0x4894ac){logger['info']('UpdateChatInteraction',_0x5be689);logger[_0x418f('0x14')](_0x418f('0x1a'),_0x5be689,JSON[_0x418f('0x1f')](_0x4894ac));_0x51720c(_0x4894ac);})[_0x418f('0x19')](function(_0x9b68dd){logger[_0x418f('0x15')](_0x418f('0x1a'),_0x9b68dd[_0x418f('0x17')],_0x5be689);_0x47923b(_0x390cbf[_0x418f('0x15')](0x1f4,_0x9b68dd['message']));});});};exports[_0x418f('0x20')]=function(_0x2ce10c){return new Promise(function(_0x2002fb,_0x1aade4){return db[_0x418f('0x21')]['find']({'where':_0x2ce10c[_0x418f('0x1c')]?_0x2ce10c[_0x418f('0x1c')][_0x418f('0x22')]||null:null})[_0x418f('0x1e')](function(_0x171e1c){if(_0x171e1c){return _0x171e1c[_0x418f('0x23')](_0x2ce10c[_0x418f('0x24')][_0x418f('0x25')],_[_0x418f('0x26')](_0x2ce10c[_0x418f('0x24')],[_0x418f('0x25'),'id'])||{});}})[_0x418f('0x27')](function(_0x5974cf){logger[_0x418f('0x11')](_0x418f('0x28'),_0x2ce10c);logger[_0x418f('0x14')](_0x418f('0x28'),_0x2ce10c,JSON[_0x418f('0x1f')](_0x5974cf));_0x2002fb(_0x5974cf);})[_0x418f('0x19')](function(_0x108cce){logger['error'](_0x418f('0x28'),_0x108cce['message'],_0x2ce10c);_0x1aade4(_this[_0x418f('0x15')](0x1f4,_0x108cce[_0x418f('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 51a6511..9c1768c 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 _0x7be5=['./chatInteraction.events','remove','emit','register','length','chatInteraction:'];(function(_0x57c5e0,_0x46441f){var _0x512049=function(_0x223209){while(--_0x223209){_0x57c5e0['push'](_0x57c5e0['shift']());}};_0x512049(++_0x46441f);}(_0x7be5,0x11a));var _0x57be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7be5[_0x321bb2];return _0x9c12ed;};'use strict';var ChatInteractionEvents=require(_0x57be('0x0'));var events=['save',_0x57be('0x1'),'update'];function createListener(_0x4aeabb,_0x42207e){return function(_0x1c51b6){_0x42207e[_0x57be('0x2')](_0x4aeabb,_0x1c51b6);};}function removeListener(_0x23583a,_0x24974a){return function(){ChatInteractionEvents['removeListener'](_0x23583a,_0x24974a);};}exports[_0x57be('0x3')]=function(_0xa9c6da){for(var _0xacf95a=0x0,_0x3bfbd3=events[_0x57be('0x4')];_0xacf95a<_0x3bfbd3;_0xacf95a++){var _0x4184ab=events[_0xacf95a];var _0x1ac835=createListener(_0x57be('0x5')+_0x4184ab,_0xa9c6da);ChatInteractionEvents['on'](_0x4184ab,_0x1ac835);}};
\ No newline at end of file
+var _0xe4eb=['chatInteraction:','./chatInteraction.events','save','update','emit','register','length'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xe4eb,0x9b));var _0xbe4e=function(_0xf034a4,_0x522919){_0xf034a4=_0xf034a4-0x0;var _0x37b357=_0xe4eb[_0xf034a4];return _0x37b357;};'use strict';var ChatInteractionEvents=require(_0xbe4e('0x0'));var events=[_0xbe4e('0x1'),'remove',_0xbe4e('0x2')];function createListener(_0x39b18b,_0x14646b){return function(_0x5b63fb){_0x14646b[_0xbe4e('0x3')](_0x39b18b,_0x5b63fb);};}function removeListener(_0x9a14a9,_0x3b2b21){return function(){ChatInteractionEvents['removeListener'](_0x9a14a9,_0x3b2b21);};}exports[_0xbe4e('0x4')]=function(_0x15aa50){for(var _0x2e4bd6=0x0,_0x1e9580=events[_0xbe4e('0x5')];_0x2e4bd6<_0x1e9580;_0x2e4bd6++){var _0x1bffa2=events[_0x2e4bd6];var _0x3ad104=createListener(_0xbe4e('0x6')+_0x1bffa2,_0x15aa50);ChatInteractionEvents['on'](_0x1bffa2,_0x3ad104);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index a22c96a..7286cfa 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 _0x87be=['format','%s-%s','originalname','replace','/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/'];(function(_0x44b346,_0xeb097d){var _0x1c2f2b=function(_0x4e1f23){while(--_0x4e1f23){_0x44b346['push'](_0x44b346['shift']());}};_0x1c2f2b(++_0xeb097d);}(_0x87be,0x151));var _0xe87b=function(_0x17b9b6,_0xc24214){_0x17b9b6=_0x17b9b6-0x0;var _0x159874=_0x87be[_0x17b9b6];return _0x159874;};'use strict';var multer=require(_0xe87b('0x0'));var util=require(_0xe87b('0x1'));var path=require('path');var timeout=require(_0xe87b('0x2'));var express=require(_0xe87b('0x3'));var router=express[_0xe87b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe87b('0x5'));var controller=require('./chatInteraction.controller');router[_0xe87b('0x6')]('/',auth[_0xe87b('0x7')](),controller[_0xe87b('0x8')]);router[_0xe87b('0x6')](_0xe87b('0x9'),auth[_0xe87b('0x7')](),controller['describe']);router['get'](_0xe87b('0xa'),auth[_0xe87b('0xb')](),controller[_0xe87b('0xc')]);router[_0xe87b('0x6')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xe87b('0xd')]);router[_0xe87b('0x6')]('/:id/messages',auth[_0xe87b('0x7')](),controller[_0xe87b('0xe')]);router[_0xe87b('0x6')](_0xe87b('0xf'),auth[_0xe87b('0xb')](),controller[_0xe87b('0x10')]);router[_0xe87b('0x6')](_0xe87b('0x11'),auth['isAuthenticated'](),controller[_0xe87b('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe87b('0x13')]);router[_0xe87b('0x14')](_0xe87b('0x15'),auth[_0xe87b('0x7')](),controller[_0xe87b('0x16')]);var upload=multer({'storage':multer[_0xe87b('0x17')]({'destination':function(_0x59568e,_0x788468,_0x397302){_0x397302(null,path[_0xe87b('0x18')](config[_0xe87b('0x19')],_0xe87b('0x1a')));},'filename':function(_0x7b3a5a,_0x151af3,_0x28d37d){_0x28d37d(null,util[_0xe87b('0x1b')](_0xe87b('0x1c'),Date['now'](),_0x151af3[_0xe87b('0x1d')][_0xe87b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xe87b('0x1f'),upload[_0xe87b('0x20')]('file'),controller[_0xe87b('0x21')]);router['post'](_0xe87b('0x22'),auth['isChatInteractionAuthorized'](),controller[_0xe87b('0x23')]);router['post']('/:id/tags',auth[_0xe87b('0x7')](),interaction[_0xe87b('0x24')](_0xe87b('0x25'),_0xe87b('0x26')),controller['addTags']);router[_0xe87b('0x27')](_0xe87b('0xa'),auth['isAuthenticated'](),interaction[_0xe87b('0x24')](_0xe87b('0x25'),_0xe87b('0x28')),controller['update']);router['put'](_0xe87b('0x29'),controller[_0xe87b('0x2a')]);router[_0xe87b('0x27')](_0xe87b('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xe87b('0x2c')]);router[_0xe87b('0x27')](_0xe87b('0x2d'),controller[_0xe87b('0x2e')]);router['delete'](_0xe87b('0xa'),auth[_0xe87b('0x7')](),interaction[_0xe87b('0x24')](_0xe87b('0x25'),_0xe87b('0x2f')),controller[_0xe87b('0x30')]);router['delete'](_0xe87b('0x31'),auth[_0xe87b('0x7')](),controller[_0xe87b('0x32')]);module[_0xe87b('0x33')]=router;
\ No newline at end of file
+var _0xad24=['removeTags','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','get','describe','/:id','show','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','chatinteraction:destroy','destroy','/:id/tags'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xad24,0x65));var _0x4ad2=function(_0xf6760f,_0xe9e7a5){_0xf6760f=_0xf6760f-0x0;var _0x19a2b6=_0xad24[_0xf6760f];return _0x19a2b6;};'use strict';var multer=require(_0x4ad2('0x0'));var util=require(_0x4ad2('0x1'));var path=require(_0x4ad2('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ad2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ad2('0x4'));var interaction=require(_0x4ad2('0x5'));var config=require(_0x4ad2('0x6'));var controller=require(_0x4ad2('0x7'));router['get']('/',auth[_0x4ad2('0x8')](),controller['index']);router[_0x4ad2('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x4ad2('0xa')]);router[_0x4ad2('0x9')](_0x4ad2('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x4ad2('0xc')]);router['get']('/:id/attachment_download',auth[_0x4ad2('0xd')](),controller[_0x4ad2('0xe')]);router[_0x4ad2('0x9')](_0x4ad2('0xf'),auth[_0x4ad2('0x8')](),controller[_0x4ad2('0x10')]);router[_0x4ad2('0x9')]('/:id/my_messages',auth[_0x4ad2('0xd')](),controller['getMyMessages']);router['get'](_0x4ad2('0x11'),auth[_0x4ad2('0x8')](),controller[_0x4ad2('0x12')]);router[_0x4ad2('0x13')]('/',auth['isAuthenticated'](),controller[_0x4ad2('0x14')]);router[_0x4ad2('0x13')](_0x4ad2('0x15'),auth[_0x4ad2('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x4ad2('0x16')]({'destination':function(_0x13cbd9,_0x461a28,_0xdd6da0){_0xdd6da0(null,path[_0x4ad2('0x17')](config[_0x4ad2('0x18')],_0x4ad2('0x19')));},'filename':function(_0x244929,_0x535a63,_0x389c07){_0x389c07(null,util['format'](_0x4ad2('0x1a'),Date[_0x4ad2('0x1b')](),_0x535a63[_0x4ad2('0x1c')][_0x4ad2('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4ad2('0x13')](_0x4ad2('0x1e'),upload['single'](_0x4ad2('0x1f')),controller[_0x4ad2('0x20')]);router[_0x4ad2('0x13')](_0x4ad2('0xf'),auth[_0x4ad2('0xd')](),controller[_0x4ad2('0x21')]);router[_0x4ad2('0x13')]('/:id/tags',auth[_0x4ad2('0x8')](),interaction[_0x4ad2('0x22')](_0x4ad2('0x23'),_0x4ad2('0x24')),controller[_0x4ad2('0x25')]);router[_0x4ad2('0x26')](_0x4ad2('0xb'),auth[_0x4ad2('0x8')](),interaction[_0x4ad2('0x22')](_0x4ad2('0x23'),_0x4ad2('0x27')),controller[_0x4ad2('0x28')]);router[_0x4ad2('0x26')](_0x4ad2('0x29'),controller[_0x4ad2('0x2a')]);router[_0x4ad2('0x26')](_0x4ad2('0x2b'),auth[_0x4ad2('0xd')](),controller[_0x4ad2('0x2c')]);router[_0x4ad2('0x26')]('/:id/close',controller['close']);router[_0x4ad2('0x2d')](_0x4ad2('0xb'),auth[_0x4ad2('0x8')](),interaction[_0x4ad2('0x22')](_0x4ad2('0x23'),_0x4ad2('0x2e')),controller[_0x4ad2('0x2f')]);router[_0x4ad2('0x2d')](_0x4ad2('0x30'),auth[_0x4ad2('0x8')](),controller[_0x4ad2('0x31')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 8c67b06..0086ced 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 _0x261a=['BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x239cca,_0x4d807b){var _0x57675a=function(_0x161741){while(--_0x161741){_0x239cca['push'](_0x239cca['shift']());}};_0x57675a(++_0x4d807b);}(_0x261a,0x66));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa261('0x0'));module[_0xa261('0x1')]={'body':{'type':Sequelize[_0xa261('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa261('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa261('0x4')]}};
\ No newline at end of file
+var _0x783f=['TEXT','medium','INTEGER','sequelize'];(function(_0x31fac4,_0x261e72){var _0x189743=function(_0x2a4da1){while(--_0x2a4da1){_0x31fac4['push'](_0x31fac4['shift']());}};_0x189743(++_0x261e72);}(_0x783f,0x1a3));var _0xf783=function(_0x2fd0f6,_0x2176fe){_0x2fd0f6=_0x2fd0f6-0x0;var _0x2d723f=_0x783f[_0x2fd0f6];return _0x2d723f;};'use strict';var Sequelize=require(_0xf783('0x0'));module['exports']={'body':{'type':Sequelize[_0xf783('0x1')](_0xf783('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf783('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 50b2759..3e57cba 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 _0xa98a=['includeAll','include','findAll','params','options','find','catch','create','body','describe','get','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','isEmpty','filter','resourceId','push','messages','FromId','ToId','read','all','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','update','then','destroy','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','merge','VIRTUAL','ChatInternalMessage','count'];(function(_0x12a554,_0x3d7ef8){var _0x244ba0=function(_0x5eb5ff){while(--_0x5eb5ff){_0x12a554['push'](_0x12a554['shift']());}};_0x244ba0(++_0x3d7ef8);}(_0xa98a,0x103));var _0xaa98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaa98('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa98('0x1'));var moment=require(_0xaa98('0x2'));var BPromise=require(_0xaa98('0x3'));var Mustache=require(_0xaa98('0x4'));var util=require(_0xaa98('0x5'));var path=require(_0xaa98('0x6'));var sox=require(_0xaa98('0x7'));var csv=require(_0xaa98('0x8'));var ejs=require(_0xaa98('0x9'));var fs=require('fs');var fs_extra=require(_0xaa98('0xa'));var _=require(_0xaa98('0xb'));var squel=require('squel');var crypto=require(_0xaa98('0xc'));var jsforce=require(_0xaa98('0xd'));var deskjs=require(_0xaa98('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa98('0xf'));var Redis=require(_0xaa98('0x10'));var authService=require(_0xaa98('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaa98('0x12'));var hardwareService=require(_0xaa98('0x13'));var logger=require(_0xaa98('0x14'))(_0xaa98('0x15'));var utils=require('../../config/utils');var config=require(_0xaa98('0x16'));var licenseUtil=require(_0xaa98('0x17'));var db=require(_0xaa98('0x18'))['db'];config[_0xaa98('0x19')]=_[_0xaa98('0x1a')](config['redis'],{'host':_0xaa98('0x1b'),'port':0x18eb});var socket=require(_0xaa98('0x1c'))(new Redis(config['redis']));require(_0xaa98('0x1d'))[_0xaa98('0x1e')](socket);function respondWithStatusCode(_0x5e3893,_0x247957){_0x247957=_0x247957||0xcc;return function(_0x3cfda1){if(_0x3cfda1){return _0x5e3893[_0xaa98('0x1f')](_0x247957);}return _0x5e3893[_0xaa98('0x20')](_0x247957)[_0xaa98('0x21')]();};}function respondWithResult(_0x140a20,_0x1ed1b9){_0x1ed1b9=_0x1ed1b9||0xc8;return function(_0x32d535){if(_0x32d535){return _0x140a20[_0xaa98('0x20')](_0x1ed1b9)[_0xaa98('0x22')](_0x32d535);}};}function respondWithFilteredResult(_0x38572c,_0x258178){return function(_0x252a4e){if(_0x252a4e){var _0x3b9e1b=typeof _0x258178['offset']==='undefined'&&typeof _0x258178[_0xaa98('0x23')]===_0xaa98('0x24');var _0x148532=_0x252a4e['count'];var _0x99d02f=_0x3b9e1b?0x0:_0x258178['offset'];var _0x12cb17=_0x3b9e1b?_0x252a4e['count']:_0x258178[_0xaa98('0x25')]+_0x258178['limit'];var _0x481d7b;if(_0x12cb17>=_0x148532){_0x12cb17=_0x148532;_0x481d7b=0xc8;}else{_0x481d7b=0xce;}_0x38572c[_0xaa98('0x20')](_0x481d7b);return _0x38572c[_0xaa98('0x26')](_0xaa98('0x27'),_0x99d02f+'-'+_0x12cb17+'/'+_0x148532)[_0xaa98('0x22')](_0x252a4e);}return null;};}function patchUpdates(_0x1b311d){return function(_0x702bc7){try{jsonpatch[_0xaa98('0x28')](_0x702bc7,_0x1b311d,!![]);}catch(_0x49f76b){return BPromise[_0xaa98('0x29')](_0x49f76b);}return _0x702bc7['save']();};}function saveUpdates(_0x18e1f7,_0x18edf6){return function(_0x188cca){if(_0x188cca){return _0x188cca[_0xaa98('0x2a')](_0x18e1f7)[_0xaa98('0x2b')](function(_0x169e21){return _0x169e21;});}return null;};}function removeEntity(_0xa5446b,_0x50132d){return function(_0xe96d58){if(_0xe96d58){return _0xe96d58[_0xaa98('0x2c')]()[_0xaa98('0x2b')](function(){_0xa5446b[_0xaa98('0x20')](0xcc)[_0xaa98('0x21')]();});}};}function handleEntityNotFound(_0x3795b8,_0x4aa479){return function(_0x5970e3){if(!_0x5970e3){_0x3795b8['sendStatus'](0x194);}return _0x5970e3;};}function handleError(_0x5f3836,_0xb7d4a4){_0xb7d4a4=_0xb7d4a4||0x1f4;return function(_0x4335c4){logger['error'](_0x4335c4['stack']);if(_0x4335c4[_0xaa98('0x2d')]){delete _0x4335c4[_0xaa98('0x2d')];}_0x5f3836[_0xaa98('0x20')](_0xb7d4a4)[_0xaa98('0x2e')](_0x4335c4);};}exports['index']=function(_0x1e748c,_0x5f2bb3){var _0x4ccb9e={},_0x3d5b3a={},_0x47771c={'count':0x0,'rows':[]};var _0x1e2a9a=_[_0xaa98('0x2f')](db['ChatInternalMessage'][_0xaa98('0x30')],function(_0x437017){return{'name':_0x437017[_0xaa98('0x31')],'type':_0x437017[_0xaa98('0x32')][_0xaa98('0x33')]};});_0x3d5b3a['model']=_[_0xaa98('0x2f')](_0x1e2a9a,'name');_0x3d5b3a[_0xaa98('0x34')]=_[_0xaa98('0x35')](_0x1e748c[_0xaa98('0x34')]);_0x3d5b3a['filters']=_[_0xaa98('0x36')](_0x3d5b3a[_0xaa98('0x37')],_0x3d5b3a[_0xaa98('0x34')]);_0x4ccb9e[_0xaa98('0x38')]=_[_0xaa98('0x36')](_0x3d5b3a['model'],qs[_0xaa98('0x39')](_0x1e748c[_0xaa98('0x34')][_0xaa98('0x39')]));_0x4ccb9e[_0xaa98('0x38')]=_0x4ccb9e[_0xaa98('0x38')][_0xaa98('0x3a')]?_0x4ccb9e[_0xaa98('0x38')]:_0x3d5b3a[_0xaa98('0x37')];if(!_0x1e748c['query']['hasOwnProperty'](_0xaa98('0x3b'))){_0x4ccb9e[_0xaa98('0x23')]=qs[_0xaa98('0x23')](_0x1e748c[_0xaa98('0x34')]['limit']);_0x4ccb9e[_0xaa98('0x25')]=qs['offset'](_0x1e748c[_0xaa98('0x34')][_0xaa98('0x25')]);}_0x4ccb9e[_0xaa98('0x3c')]=qs[_0xaa98('0x3d')](_0x1e748c['query'][_0xaa98('0x3d')]);_0x4ccb9e[_0xaa98('0x3e')]=qs[_0xaa98('0x3f')](_['pick'](_0x1e748c[_0xaa98('0x34')],_0x3d5b3a[_0xaa98('0x3f')]),_0x1e2a9a);if(_0x1e748c[_0xaa98('0x34')]['filter']){_0x4ccb9e[_0xaa98('0x3e')]=_[_0xaa98('0x40')](_0x4ccb9e[_0xaa98('0x3e')],{'$or':_[_0xaa98('0x2f')](_0x1e2a9a,function(_0x9476f6){if(_0x9476f6['type']!==_0xaa98('0x41')){var _0x436e8c={};_0x436e8c[_0x9476f6[_0xaa98('0x2d')]]={'$like':'%'+_0x1e748c[_0xaa98('0x34')]['filter']+'%'};return _0x436e8c;}})});}_0x4ccb9e=_['merge']({},_0x4ccb9e,_0x1e748c['options']);var _0x53627a={'where':_0x4ccb9e[_0xaa98('0x3e')]};return db[_0xaa98('0x42')]['count'](_0x53627a)[_0xaa98('0x2b')](function(_0x355f4b){_0x47771c[_0xaa98('0x43')]=_0x355f4b;if(_0x1e748c['query'][_0xaa98('0x44')]){_0x4ccb9e[_0xaa98('0x45')]=[{'all':!![]}];}return db[_0xaa98('0x42')][_0xaa98('0x46')](_0x4ccb9e);})['then'](function(_0x3363b6){_0x47771c['rows']=_0x3363b6;return _0x47771c;})['then'](respondWithFilteredResult(_0x5f2bb3,_0x4ccb9e))['catch'](handleError(_0x5f2bb3,null));};exports['show']=function(_0x538c83,_0x197eaa){var _0x5d93fd={'raw':!![],'where':{'id':_0x538c83[_0xaa98('0x47')]['id']}},_0x3d112d={};_0x3d112d[_0xaa98('0x37')]=_[_0xaa98('0x35')](db[_0xaa98('0x42')][_0xaa98('0x30')]);_0x3d112d[_0xaa98('0x34')]=_[_0xaa98('0x35')](_0x538c83[_0xaa98('0x34')]);_0x3d112d[_0xaa98('0x3f')]=_[_0xaa98('0x36')](_0x3d112d[_0xaa98('0x37')],_0x3d112d[_0xaa98('0x34')]);_0x5d93fd[_0xaa98('0x38')]=_['intersection'](_0x3d112d[_0xaa98('0x37')],qs[_0xaa98('0x39')](_0x538c83[_0xaa98('0x34')]['fields']));_0x5d93fd[_0xaa98('0x38')]=_0x5d93fd[_0xaa98('0x38')]['length']?_0x5d93fd[_0xaa98('0x38')]:_0x3d112d[_0xaa98('0x37')];if(_0x538c83[_0xaa98('0x34')]['includeAll']){_0x5d93fd[_0xaa98('0x45')]=[{'all':!![]}];}_0x5d93fd=_[_0xaa98('0x40')]({},_0x5d93fd,_0x538c83[_0xaa98('0x48')]);return db['ChatInternalMessage'][_0xaa98('0x49')](_0x5d93fd)[_0xaa98('0x2b')](handleEntityNotFound(_0x197eaa,null))['then'](respondWithResult(_0x197eaa,null))[_0xaa98('0x4a')](handleError(_0x197eaa,null));};exports[_0xaa98('0x4b')]=function(_0x2bf1ce,_0x3bc077){return db['ChatInternalMessage'][_0xaa98('0x4b')](_0x2bf1ce[_0xaa98('0x4c')],{})[_0xaa98('0x2b')](respondWithResult(_0x3bc077,0xc9))[_0xaa98('0x4a')](handleError(_0x3bc077,null));};exports[_0xaa98('0x2a')]=function(_0x30e573,_0x13873b){if(_0x30e573[_0xaa98('0x4c')]['id']){delete _0x30e573[_0xaa98('0x4c')]['id'];}return db[_0xaa98('0x42')][_0xaa98('0x49')]({'where':{'id':_0x30e573['params']['id']}})[_0xaa98('0x2b')](handleEntityNotFound(_0x13873b,null))[_0xaa98('0x2b')](saveUpdates(_0x30e573[_0xaa98('0x4c')],null))['then'](respondWithResult(_0x13873b,null))[_0xaa98('0x4a')](handleError(_0x13873b,null));};exports['destroy']=function(_0x46d0cc,_0xab3390){return db[_0xaa98('0x42')][_0xaa98('0x49')]({'where':{'id':_0x46d0cc[_0xaa98('0x47')]['id']}})['then'](handleEntityNotFound(_0xab3390,null))[_0xaa98('0x2b')](removeEntity(_0xab3390,null))[_0xaa98('0x4a')](handleError(_0xab3390,null));};exports[_0xaa98('0x4d')]=function(_0x40857c,_0x34b6f8){return db[_0xaa98('0x42')][_0xaa98('0x4d')]()['then'](respondWithResult(_0x34b6f8,null))[_0xaa98('0x4a')](handleError(_0x34b6f8,null));};function wrapUser(_0x49183b){return function(_0x3c8189){var _0x2c2c25=_0x49183b[_0xaa98('0x4e')]({'plain':!![]});_0x2c2c25['messages']=[];if(_0x3c8189){_0x2c2c25['lastMessageAt']=_0x3c8189[_0xaa98('0x4f')];_0x2c2c25[_0xaa98('0x50')]=_0x3c8189;}else{_0x2c2c25['lastMessageAt']=moment(0x0)['format'](_0xaa98('0x51'));_0x2c2c25[_0xaa98('0x50')]={};}return _0x2c2c25;};}exports[_0xaa98('0x52')]=function(_0x2f8279,_0x3ba7cb,_0x3231ac){var _0x1e589c=[];return db[_0xaa98('0x53')][_0xaa98('0x46')]({'where':{'role':[_0xaa98('0x54'),_0xaa98('0x55'),_0xaa98('0x56')]},'attributes':['id',_0xaa98('0x57'),_0xaa98('0x2d'),'role',_0xaa98('0x58'),_0xaa98('0x59'),_0xaa98('0x5a'),_0xaa98('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0xaa98('0x3d')](_0xaa98('0x5c')),'include':[{'model':db[_0xaa98('0x5d')],'as':_0xaa98('0x5e'),'attributes':['id',_0xaa98('0x2d'),'type'],'through':{'attributes':[]}}]})[_0xaa98('0x2b')](function(_0x3d90be){if(_0x3d90be){var _0x362b41=_0x2f8279['user'][_0xaa98('0x4e')]({'plain':!![]});if(!_0x362b41)throw new Error(_0xaa98('0x5f'));if(_0x362b41[_0xaa98('0x60')]===_0xaa98('0x56')){return db[_0xaa98('0x61')][_0xaa98('0x49')]({'where':{'name':'Agents','userProfileId':_0x362b41[_0xaa98('0x62')]},'raw':!![]})[_0xaa98('0x2b')](function(_0x4cbcc0){if(_0x4cbcc0){if(_0x4cbcc0['autoAssociation']===0x0){return db[_0xaa98('0x63')][_0xaa98('0x46')]({'where':{'sectionId':_0x4cbcc0['id']},'raw':!![]})['then'](function(_0x4a8df3){var _0x3a397a=[];if(_[_0xaa98('0x64')](_0x4a8df3)){_0x3a397a=_[_0xaa98('0x65')](_0x3d90be,function(_0x5c426e){if(_0x5c426e[_0xaa98('0x60')]!=='agent'){return _0x5c426e;}});return _0x3a397a;}else{for(var _0x4e12c8=0x0;_0x4e12c8<_0x3d90be[_0xaa98('0x3a')];_0x4e12c8++){var _0x1bc428=_0x3d90be[_0x4e12c8];if(_0x1bc428[_0xaa98('0x60')]==='agent'){var _0x5147ac=_['find'](_0x4a8df3,function(_0x4eca29){return _0x4eca29[_0xaa98('0x66')]===_0x1bc428['id'];});if(_0x5147ac)_0x3a397a['push'](_0x1bc428);}else{_0x3a397a[_0xaa98('0x67')](_0x1bc428);}}return _0x3a397a;}});}else{return _0x3d90be;}}else{var _0x3cb72d=_['filter'](_0x3d90be,function(_0x45393b){if(_0x45393b[_0xaa98('0x60')]!==_0xaa98('0x54')){return _0x45393b;}});return _0x3cb72d;}});}else{return _0x3d90be;}}})[_0xaa98('0x2b')](function(_0xc410f0){var _0x122b24=[];if(_0xc410f0){_0x1e589c=_0xc410f0;for(var _0x5e38a7=0x0;_0x5e38a7<_0xc410f0['length'];_0x5e38a7+=0x1){_0x1e589c[_0x5e38a7][_0xaa98('0x68')]=[];_0x122b24[_0xaa98('0x67')](db[_0xaa98('0x42')][_0xaa98('0x49')]({'where':{'FromId':[_0x2f8279[_0xaa98('0x56')]['id'],_0xc410f0[_0x5e38a7]['id']],'ToId':[_0x2f8279['user']['id'],_0xc410f0[_0x5e38a7]['id']],'ChatGroupId':null},'attributes':['id',_0xaa98('0x4f'),_0xaa98('0x69'),_0xaa98('0x6a'),_0xaa98('0x6b'),_0xaa98('0x4c')],'order':qs[_0xaa98('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xaa98('0x2b')](wrapUser(_0xc410f0[_0x5e38a7])));}return BPromise[_0xaa98('0x6c')](_0x122b24);}return[];})[_0xaa98('0x2b')](function(_0x3c70b9){return{'rows':_0x3c70b9,'count':_0x3c70b9['length']};})[_0xaa98('0x2b')](respondWithResult(_0x3ba7cb,null))[_0xaa98('0x4a')](handleError(_0x3ba7cb,null));};
\ No newline at end of file
+var _0x651a=['attributes','fields','length','nolimit','offset','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','role','userpic','internal','lastLoginAt','allowmessenger','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','read','all','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ChatInternalMessage','fieldName','key','model','map','query','filters','intersection'];(function(_0x45aa4e,_0x4c0c61){var _0x38420e=function(_0x50cdc8){while(--_0x50cdc8){_0x45aa4e['push'](_0x45aa4e['shift']());}};_0x38420e(++_0x4c0c61);}(_0x651a,0x1ee));var _0xa651=function(_0x2a87e9,_0x25c03e){_0x2a87e9=_0x2a87e9-0x0;var _0x5de0e6=_0x651a[_0x2a87e9];return _0x5de0e6;};'use strict';var emlformat=require(_0xa651('0x0'));var rimraf=require(_0xa651('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa651('0x2'));var rp=require('request-promise');var moment=require(_0xa651('0x3'));var BPromise=require(_0xa651('0x4'));var Mustache=require(_0xa651('0x5'));var util=require('util');var path=require(_0xa651('0x6'));var sox=require(_0xa651('0x7'));var csv=require(_0xa651('0x8'));var ejs=require(_0xa651('0x9'));var fs=require('fs');var fs_extra=require(_0xa651('0xa'));var _=require(_0xa651('0xb'));var squel=require(_0xa651('0xc'));var crypto=require(_0xa651('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa651('0xe'));var toCsv=require(_0xa651('0x8'));var querystring=require(_0xa651('0xf'));var Papa=require(_0xa651('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa651('0x11'));var as=require(_0xa651('0x12'));var hardwareService=require(_0xa651('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xa651('0x14'));var config=require(_0xa651('0x15'));var licenseUtil=require(_0xa651('0x16'));var db=require(_0xa651('0x17'))['db'];config[_0xa651('0x18')]=_[_0xa651('0x19')](config[_0xa651('0x18')],{'host':_0xa651('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa651('0x1b'))[_0xa651('0x1c')](socket);function respondWithStatusCode(_0x98a95d,_0x30ec80){_0x30ec80=_0x30ec80||0xcc;return function(_0x3c38dd){if(_0x3c38dd){return _0x98a95d[_0xa651('0x1d')](_0x30ec80);}return _0x98a95d[_0xa651('0x1e')](_0x30ec80)[_0xa651('0x1f')]();};}function respondWithResult(_0x1e143a,_0x4be07d){_0x4be07d=_0x4be07d||0xc8;return function(_0x5943bb){if(_0x5943bb){return _0x1e143a['status'](_0x4be07d)[_0xa651('0x20')](_0x5943bb);}};}function respondWithFilteredResult(_0x418336,_0x52cecd){return function(_0xacde6e){if(_0xacde6e){var _0x1d68f8=typeof _0x52cecd['offset']===_0xa651('0x21')&&typeof _0x52cecd[_0xa651('0x22')]===_0xa651('0x21');var _0x4cf22f=_0xacde6e[_0xa651('0x23')];var _0x91f73d=_0x1d68f8?0x0:_0x52cecd['offset'];var _0x56e351=_0x1d68f8?_0xacde6e['count']:_0x52cecd['offset']+_0x52cecd['limit'];var _0x2225fb;if(_0x56e351>=_0x4cf22f){_0x56e351=_0x4cf22f;_0x2225fb=0xc8;}else{_0x2225fb=0xce;}_0x418336['status'](_0x2225fb);return _0x418336[_0xa651('0x24')](_0xa651('0x25'),_0x91f73d+'-'+_0x56e351+'/'+_0x4cf22f)[_0xa651('0x20')](_0xacde6e);}return null;};}function patchUpdates(_0x50e9cd){return function(_0x37c057){try{jsonpatch[_0xa651('0x26')](_0x37c057,_0x50e9cd,!![]);}catch(_0x995b6){return BPromise[_0xa651('0x27')](_0x995b6);}return _0x37c057[_0xa651('0x28')]();};}function saveUpdates(_0x4acdc1,_0x2199b9){return function(_0x2258d8){if(_0x2258d8){return _0x2258d8[_0xa651('0x29')](_0x4acdc1)[_0xa651('0x2a')](function(_0x2b3e22){return _0x2b3e22;});}return null;};}function removeEntity(_0x46cb2d,_0x4068ca){return function(_0x281ff4){if(_0x281ff4){return _0x281ff4[_0xa651('0x2b')]()[_0xa651('0x2a')](function(){_0x46cb2d[_0xa651('0x1e')](0xcc)[_0xa651('0x1f')]();});}};}function handleEntityNotFound(_0xf5d7f0,_0x3f825a){return function(_0x562c23){if(!_0x562c23){_0xf5d7f0['sendStatus'](0x194);}return _0x562c23;};}function handleError(_0x168452,_0x330e6f){_0x330e6f=_0x330e6f||0x1f4;return function(_0x265d16){logger[_0xa651('0x2c')](_0x265d16[_0xa651('0x2d')]);if(_0x265d16[_0xa651('0x2e')]){delete _0x265d16[_0xa651('0x2e')];}_0x168452[_0xa651('0x1e')](_0x330e6f)[_0xa651('0x2f')](_0x265d16);};}exports['index']=function(_0x20133f,_0x576cfe){var _0x1f268a={},_0x22e062={},_0x4a6062={'count':0x0,'rows':[]};var _0x1649f5=_['map'](db[_0xa651('0x30')]['rawAttributes'],function(_0x51cb6e){return{'name':_0x51cb6e[_0xa651('0x31')],'type':_0x51cb6e['type'][_0xa651('0x32')]};});_0x22e062[_0xa651('0x33')]=_[_0xa651('0x34')](_0x1649f5,_0xa651('0x2e'));_0x22e062[_0xa651('0x35')]=_['keys'](_0x20133f[_0xa651('0x35')]);_0x22e062[_0xa651('0x36')]=_[_0xa651('0x37')](_0x22e062[_0xa651('0x33')],_0x22e062[_0xa651('0x35')]);_0x1f268a[_0xa651('0x38')]=_[_0xa651('0x37')](_0x22e062[_0xa651('0x33')],qs[_0xa651('0x39')](_0x20133f['query']['fields']));_0x1f268a[_0xa651('0x38')]=_0x1f268a[_0xa651('0x38')][_0xa651('0x3a')]?_0x1f268a[_0xa651('0x38')]:_0x22e062[_0xa651('0x33')];if(!_0x20133f[_0xa651('0x35')]['hasOwnProperty'](_0xa651('0x3b'))){_0x1f268a['limit']=qs[_0xa651('0x22')](_0x20133f[_0xa651('0x35')][_0xa651('0x22')]);_0x1f268a[_0xa651('0x3c')]=qs[_0xa651('0x3c')](_0x20133f[_0xa651('0x35')][_0xa651('0x3c')]);}_0x1f268a['order']=qs[_0xa651('0x3d')](_0x20133f[_0xa651('0x35')][_0xa651('0x3d')]);_0x1f268a['where']=qs[_0xa651('0x36')](_[_0xa651('0x3e')](_0x20133f['query'],_0x22e062[_0xa651('0x36')]),_0x1649f5);if(_0x20133f['query'][_0xa651('0x3f')]){_0x1f268a['where']=_[_0xa651('0x40')](_0x1f268a[_0xa651('0x41')],{'$or':_['map'](_0x1649f5,function(_0x140917){if(_0x140917[_0xa651('0x42')]!==_0xa651('0x43')){var _0x422047={};_0x422047[_0x140917[_0xa651('0x2e')]]={'$like':'%'+_0x20133f[_0xa651('0x35')][_0xa651('0x3f')]+'%'};return _0x422047;}})});}_0x1f268a=_[_0xa651('0x40')]({},_0x1f268a,_0x20133f[_0xa651('0x44')]);var _0x5e1eaa={'where':_0x1f268a['where']};return db[_0xa651('0x30')][_0xa651('0x23')](_0x5e1eaa)['then'](function(_0x5dbd39){_0x4a6062[_0xa651('0x23')]=_0x5dbd39;if(_0x20133f[_0xa651('0x35')][_0xa651('0x45')]){_0x1f268a['include']=[{'all':!![]}];}return db[_0xa651('0x30')][_0xa651('0x46')](_0x1f268a);})[_0xa651('0x2a')](function(_0x2e719d){_0x4a6062[_0xa651('0x47')]=_0x2e719d;return _0x4a6062;})['then'](respondWithFilteredResult(_0x576cfe,_0x1f268a))[_0xa651('0x48')](handleError(_0x576cfe,null));};exports[_0xa651('0x49')]=function(_0x381934,_0x533607){var _0x15fbc2={'raw':!![],'where':{'id':_0x381934[_0xa651('0x4a')]['id']}},_0x2fb4b7={};_0x2fb4b7['model']=_[_0xa651('0x4b')](db[_0xa651('0x30')][_0xa651('0x4c')]);_0x2fb4b7[_0xa651('0x35')]=_['keys'](_0x381934['query']);_0x2fb4b7[_0xa651('0x36')]=_[_0xa651('0x37')](_0x2fb4b7[_0xa651('0x33')],_0x2fb4b7[_0xa651('0x35')]);_0x15fbc2[_0xa651('0x38')]=_[_0xa651('0x37')](_0x2fb4b7[_0xa651('0x33')],qs[_0xa651('0x39')](_0x381934[_0xa651('0x35')][_0xa651('0x39')]));_0x15fbc2[_0xa651('0x38')]=_0x15fbc2['attributes']['length']?_0x15fbc2[_0xa651('0x38')]:_0x2fb4b7['model'];if(_0x381934[_0xa651('0x35')]['includeAll']){_0x15fbc2['include']=[{'all':!![]}];}_0x15fbc2=_[_0xa651('0x40')]({},_0x15fbc2,_0x381934[_0xa651('0x44')]);return db[_0xa651('0x30')][_0xa651('0x4d')](_0x15fbc2)[_0xa651('0x2a')](handleEntityNotFound(_0x533607,null))[_0xa651('0x2a')](respondWithResult(_0x533607,null))[_0xa651('0x48')](handleError(_0x533607,null));};exports[_0xa651('0x4e')]=function(_0x5e05ae,_0x46351a){return db[_0xa651('0x30')][_0xa651('0x4e')](_0x5e05ae[_0xa651('0x4f')],{})['then'](respondWithResult(_0x46351a,0xc9))[_0xa651('0x48')](handleError(_0x46351a,null));};exports[_0xa651('0x29')]=function(_0x5a3b18,_0x4a420e){if(_0x5a3b18[_0xa651('0x4f')]['id']){delete _0x5a3b18['body']['id'];}return db[_0xa651('0x30')]['find']({'where':{'id':_0x5a3b18['params']['id']}})[_0xa651('0x2a')](handleEntityNotFound(_0x4a420e,null))[_0xa651('0x2a')](saveUpdates(_0x5a3b18['body'],null))[_0xa651('0x2a')](respondWithResult(_0x4a420e,null))[_0xa651('0x48')](handleError(_0x4a420e,null));};exports[_0xa651('0x2b')]=function(_0x1f4977,_0x2cf097){return db['ChatInternalMessage'][_0xa651('0x4d')]({'where':{'id':_0x1f4977[_0xa651('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2cf097,null))[_0xa651('0x2a')](removeEntity(_0x2cf097,null))['catch'](handleError(_0x2cf097,null));};exports[_0xa651('0x50')]=function(_0x1aa091,_0x3ed22c){return db[_0xa651('0x30')]['describe']()[_0xa651('0x2a')](respondWithResult(_0x3ed22c,null))[_0xa651('0x48')](handleError(_0x3ed22c,null));};function wrapUser(_0x5a290d){return function(_0x54a4cb){var _0x3a4d9a=_0x5a290d[_0xa651('0x51')]({'plain':!![]});_0x3a4d9a[_0xa651('0x52')]=[];if(_0x54a4cb){_0x3a4d9a[_0xa651('0x53')]=_0x54a4cb['createdAt'];_0x3a4d9a['lastMessage']=_0x54a4cb;}else{_0x3a4d9a[_0xa651('0x53')]=moment(0x0)[_0xa651('0x54')](_0xa651('0x55'));_0x3a4d9a['lastMessage']={};}return _0x3a4d9a;};}exports['getUsers']=function(_0x40baad,_0x227d6a,_0x466318){var _0x3705cc=[];return db[_0xa651('0x56')][_0xa651('0x46')]({'where':{'role':[_0xa651('0x57'),_0xa651('0x58'),_0xa651('0x59')]},'attributes':['id',_0xa651('0x5a'),'name',_0xa651('0x5b'),_0xa651('0x5c'),_0xa651('0x5d'),'online',_0xa651('0x5e'),_0xa651('0x5f'),'showWebBar'],'order':qs[_0xa651('0x3d')](_0xa651('0x60')),'include':[{'model':db['VoiceQueue'],'as':_0xa651('0x61'),'attributes':['id',_0xa651('0x2e'),_0xa651('0x42')],'through':{'attributes':[]}}]})[_0xa651('0x2a')](function(_0xe4f151){if(_0xe4f151){var _0x46d778=_0x40baad[_0xa651('0x59')][_0xa651('0x51')]({'plain':!![]});if(!_0x46d778)throw new Error(_0xa651('0x62'));if(_0x46d778['role']===_0xa651('0x59')){return db[_0xa651('0x63')][_0xa651('0x4d')]({'where':{'name':'Agents','userProfileId':_0x46d778[_0xa651('0x64')]},'raw':!![]})[_0xa651('0x2a')](function(_0x49ff37){if(_0x49ff37){if(_0x49ff37[_0xa651('0x65')]===0x0){return db[_0xa651('0x66')]['findAll']({'where':{'sectionId':_0x49ff37['id']},'raw':!![]})[_0xa651('0x2a')](function(_0xf34aac){var _0x363a84=[];if(_[_0xa651('0x67')](_0xf34aac)){_0x363a84=_[_0xa651('0x3f')](_0xe4f151,function(_0x4822d0){if(_0x4822d0[_0xa651('0x5b')]!=='agent'){return _0x4822d0;}});return _0x363a84;}else{for(var _0x2758e0=0x0;_0x2758e0<_0xe4f151['length'];_0x2758e0++){var _0x1f63b8=_0xe4f151[_0x2758e0];if(_0x1f63b8[_0xa651('0x5b')]===_0xa651('0x57')){var _0x549403=_['find'](_0xf34aac,function(_0x365b65){return _0x365b65[_0xa651('0x68')]===_0x1f63b8['id'];});if(_0x549403)_0x363a84[_0xa651('0x69')](_0x1f63b8);}else{_0x363a84[_0xa651('0x69')](_0x1f63b8);}}return _0x363a84;}});}else{return _0xe4f151;}}else{var _0x863a64=_[_0xa651('0x3f')](_0xe4f151,function(_0x3182bd){if(_0x3182bd['role']!==_0xa651('0x57')){return _0x3182bd;}});return _0x863a64;}});}else{return _0xe4f151;}}})[_0xa651('0x2a')](function(_0x260f27){var _0x3847a0=[];if(_0x260f27){_0x3705cc=_0x260f27;for(var _0x8e33fe=0x0;_0x8e33fe<_0x260f27['length'];_0x8e33fe+=0x1){_0x3705cc[_0x8e33fe]['messages']=[];_0x3847a0[_0xa651('0x69')](db[_0xa651('0x30')]['find']({'where':{'FromId':[_0x40baad[_0xa651('0x59')]['id'],_0x260f27[_0x8e33fe]['id']],'ToId':[_0x40baad['user']['id'],_0x260f27[_0x8e33fe]['id']],'ChatGroupId':null},'attributes':['id',_0xa651('0x6a'),_0xa651('0x6b'),'ToId',_0xa651('0x6c'),_0xa651('0x4f')],'order':qs[_0xa651('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa651('0x2a')](wrapUser(_0x260f27[_0x8e33fe])));}return BPromise[_0xa651('0x6d')](_0x3847a0);}return[];})[_0xa651('0x2a')](function(_0x61352a){return{'rows':_0x61352a,'count':_0x61352a['length']};})[_0xa651('0x2a')](respondWithResult(_0x227d6a,null))[_0xa651('0x48')](handleError(_0x227d6a,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 1e463f7..0cf0ad0 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 _0x623d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x623d,0x109));var _0xd623=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x623d[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require(_0xd623('0x0'));var ChatInternalMessage=require(_0xd623('0x1'))['db'][_0xd623('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd623('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd623('0x4'),'afterDestroy':_0xd623('0x5')};function emitEvent(_0x42a6cd){return function(_0x3474cb,_0x468397,_0x233ff4){ChatInternalMessageEvents['emit'](_0x42a6cd+':'+_0x3474cb['id'],_0x3474cb);ChatInternalMessageEvents[_0xd623('0x6')](_0x42a6cd,_0x3474cb);_0x233ff4(null);};}for(var e in events){if(events[_0xd623('0x7')](e)){var event=events[e];ChatInternalMessage[_0xd623('0x8')](e,emitEvent(event));}}module[_0xd623('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x71f6=['exports','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x148308,_0x59b441){var _0x2d3675=function(_0x7b3c6a){while(--_0x7b3c6a){_0x148308['push'](_0x148308['shift']());}};_0x2d3675(++_0x59b441);}(_0x71f6,0x1ac));var _0x671f=function(_0x255626,_0x18521f){_0x255626=_0x255626-0x0;var _0x135359=_0x71f6[_0x255626];return _0x135359;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x671f('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x671f('0x1')](0x0);var events={'afterCreate':_0x671f('0x2'),'afterUpdate':_0x671f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b869f){return function(_0x19fefa,_0x43682b,_0x20f576){ChatInternalMessageEvents[_0x671f('0x4')](_0x3b869f+':'+_0x19fefa['id'],_0x19fefa);ChatInternalMessageEvents[_0x671f('0x4')](_0x3b869f,_0x19fefa);_0x20f576(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x671f('0x5')](e,emitEvent(event));}}module[_0x671f('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index cbd4a00..57379d3 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 _0xcc8e=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','exports','define','ChatInternalMessage','chat_internal_messages'];(function(_0x4b5187,_0x547048){var _0x4c164f=function(_0x4c666e){while(--_0x4c666e){_0x4b5187['push'](_0x4b5187['shift']());}};_0x4c164f(++_0x547048);}(_0xcc8e,0x16a));var _0xecc8=function(_0x1297e0,_0x1eb8de){_0x1297e0=_0x1297e0-0x0;var _0x12c8b3=_0xcc8e[_0x1297e0];return _0x12c8b3;};'use strict';var _=require(_0xecc8('0x0'));var util=require(_0xecc8('0x1'));var logger=require('../../config/logger')(_0xecc8('0x2'));var moment=require(_0xecc8('0x3'));var BPromise=require(_0xecc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecc8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xecc8('0x6')]=function(_0x232b0a,_0x412231){return _0x232b0a[_0xecc8('0x7')](_0xecc8('0x8'),attributes,{'tableName':_0xecc8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xecc8('0xa'),'collate':_0xecc8('0xb')});};
\ No newline at end of file
+var _0xa030=['api','moment','bluebird','request-promise','path','rimraf','exports','define','chat_internal_messages','utf8mb4','lodash','util','../../config/logger'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xa030,0x169));var _0x0a03=function(_0x116578,_0x337863){_0x116578=_0x116578-0x0;var _0x85a2da=_0xa030[_0x116578];return _0x85a2da;};'use strict';var _=require(_0x0a03('0x0'));var util=require(_0x0a03('0x1'));var logger=require(_0x0a03('0x2'))(_0x0a03('0x3'));var moment=require(_0x0a03('0x4'));var BPromise=require(_0x0a03('0x5'));var rp=require(_0x0a03('0x6'));var fs=require('fs');var path=require(_0x0a03('0x7'));var rimraf=require(_0x0a03('0x8'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x0a03('0x9')]=function(_0x361eec,_0x4496fc){return _0x361eec[_0x0a03('0xa')]('ChatInternalMessage',attributes,{'tableName':_0x0a03('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0a03('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 6c90e3e..5e25aa5 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 _0x4891=['ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','request\x20sent'];(function(_0x11af2b,_0x41538f){var _0x4a0e43=function(_0x4ae1df){while(--_0x4ae1df){_0x11af2b['push'](_0x11af2b['shift']());}};_0x4a0e43(++_0x41538f);}(_0x4891,0x166));var _0x1489=function(_0x1bbef9,_0x27aafc){_0x1bbef9=_0x1bbef9-0x0;var _0x23c45c=_0x4891[_0x1bbef9];return _0x23c45c;};'use strict';var _=require(_0x1489('0x0'));var util=require(_0x1489('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1489('0x2'));var db=require(_0x1489('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1489('0x4'))('rpc');var config=require(_0x1489('0x5'));var jayson=require(_0x1489('0x6'));var client=jayson[_0x1489('0x7')]['http']({'port':0x232a});config[_0x1489('0x8')]=_['defaults'](config[_0x1489('0x8')],{'host':_0x1489('0x9'),'port':0x18eb});var socket=require(_0x1489('0xa'))(new Redis(config[_0x1489('0x8')]));require(_0x1489('0xb'))[_0x1489('0xc')](socket);function respondWithRpcPromise(_0x109fea,_0x48805c,_0x550283){return new BPromise(function(_0x243644,_0x423118){return client[_0x1489('0xd')](_0x109fea,_0x550283)[_0x1489('0xe')](function(_0x321df5){logger[_0x1489('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x48805c,_0x1489('0x10'));logger['debug'](_0x1489('0x11'),_0x48805c,_0x1489('0x10'),JSON[_0x1489('0x12')](_0x321df5));if(_0x321df5[_0x1489('0x13')]){if(_0x321df5[_0x1489('0x13')][_0x1489('0x14')]===0x1f4){logger[_0x1489('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x48805c,_0x321df5['error'][_0x1489('0x15')]);return _0x423118(_0x321df5['error'][_0x1489('0x15')]);}logger[_0x1489('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x48805c,_0x321df5[_0x1489('0x13')][_0x1489('0x15')]);return _0x243644(_0x321df5[_0x1489('0x13')][_0x1489('0x15')]);}else{logger[_0x1489('0xf')](_0x1489('0x16'),_0x48805c,'request\x20sent');_0x243644(_0x321df5[_0x1489('0x17')][_0x1489('0x15')]);}})[_0x1489('0x18')](function(_0x597b4f){logger[_0x1489('0x13')](_0x1489('0x16'),_0x48805c,_0x597b4f);_0x423118(_0x597b4f);});});}
\ No newline at end of file
+var _0xa62e=['util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInternalMessage.socket','register','request','then','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash'];(function(_0x7578bc,_0x27fe04){var _0x32a1c1=function(_0x470741){while(--_0x470741){_0x7578bc['push'](_0x7578bc['shift']());}};_0x32a1c1(++_0x27fe04);}(_0xa62e,0x128));var _0xea62=function(_0x2575ed,_0x8c52f0){_0x2575ed=_0x2575ed-0x0;var _0x3d11f2=_0xa62e[_0x2575ed];return _0x3d11f2;};'use strict';var _=require(_0xea62('0x0'));var util=require(_0xea62('0x1'));var moment=require(_0xea62('0x2'));var BPromise=require('bluebird');var rs=require(_0xea62('0x3'));var fs=require('fs');var Redis=require(_0xea62('0x4'));var db=require(_0xea62('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea62('0x6'));var config=require(_0xea62('0x7'));var jayson=require(_0xea62('0x8'));var client=jayson[_0xea62('0x9')][_0xea62('0xa')]({'port':0x232a});config[_0xea62('0xb')]=_['defaults'](config[_0xea62('0xb')],{'host':_0xea62('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xea62('0xd'))[_0xea62('0xe')](socket);function respondWithRpcPromise(_0x15d17c,_0x464c24,_0x48b9a4){return new BPromise(function(_0x18292c,_0x54015b){return client[_0xea62('0xf')](_0x15d17c,_0x48b9a4)[_0xea62('0x10')](function(_0x561b7c){logger['info'](_0xea62('0x11'),_0x464c24,'request\x20sent');logger[_0xea62('0x12')](_0xea62('0x13'),_0x464c24,_0xea62('0x14'),JSON[_0xea62('0x15')](_0x561b7c));if(_0x561b7c[_0xea62('0x16')]){if(_0x561b7c[_0xea62('0x16')]['code']===0x1f4){logger['error'](_0xea62('0x11'),_0x464c24,_0x561b7c[_0xea62('0x16')][_0xea62('0x17')]);return _0x54015b(_0x561b7c['error'][_0xea62('0x17')]);}logger[_0xea62('0x16')](_0xea62('0x11'),_0x464c24,_0x561b7c[_0xea62('0x16')][_0xea62('0x17')]);return _0x18292c(_0x561b7c[_0xea62('0x16')][_0xea62('0x17')]);}else{logger[_0xea62('0x18')](_0xea62('0x11'),_0x464c24,'request\x20sent');_0x18292c(_0x561b7c[_0xea62('0x19')][_0xea62('0x17')]);}})[_0xea62('0x1a')](function(_0x5802a6){logger[_0xea62('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x464c24,_0x5802a6);_0x54015b(_0x5802a6);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 83eff4d..282fda3 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 _0x54dc=['remove','update','removeListener','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x3e5bc8,_0x457d89){var _0xfd84bc=function(_0x1a766c){while(--_0x1a766c){_0x3e5bc8['push'](_0x3e5bc8['shift']());}};_0xfd84bc(++_0x457d89);}(_0x54dc,0x16c));var _0xc54d=function(_0x42b707,_0x22e9c4){_0x42b707=_0x42b707-0x0;var _0x343135=_0x54dc[_0x42b707];return _0x343135;};'use strict';var ChatInternalMessageEvents=require(_0xc54d('0x0'));var events=[_0xc54d('0x1'),_0xc54d('0x2'),_0xc54d('0x3')];function createListener(_0x1eea9a,_0x31ae87){return function(_0x4e7712){_0x31ae87['emit'](_0x1eea9a,_0x4e7712);};}function removeListener(_0x182edd,_0x314d1e){return function(){ChatInternalMessageEvents[_0xc54d('0x4')](_0x182edd,_0x314d1e);};}exports['register']=function(_0x115c51){for(var _0x1ba142=0x0,_0x399a1c=events['length'];_0x1ba142<_0x399a1c;_0x1ba142++){var _0x36d332=events[_0x1ba142];var _0x4189a8=createListener(_0xc54d('0x5')+_0x36d332,_0x115c51);ChatInternalMessageEvents['on'](_0x36d332,_0x4189a8);}};
\ No newline at end of file
+var _0xc923=['save','update','removeListener','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0xc923,0x68));var _0x3c92=function(_0x2c43bb,_0x1138d7){_0x2c43bb=_0x2c43bb-0x0;var _0x2a0fd3=_0xc923[_0x2c43bb];return _0x2a0fd3;};'use strict';var ChatInternalMessageEvents=require(_0x3c92('0x0'));var events=[_0x3c92('0x1'),'remove',_0x3c92('0x2')];function createListener(_0x3e412f,_0x5a1d63){return function(_0x38815f){_0x5a1d63['emit'](_0x3e412f,_0x38815f);};}function removeListener(_0xb8733a,_0x82bc56){return function(){ChatInternalMessageEvents[_0x3c92('0x3')](_0xb8733a,_0x82bc56);};}exports['register']=function(_0x1558f7){for(var _0x31a0ac=0x0,_0x15f314=events['length'];_0x31a0ac<_0x15f314;_0x31a0ac++){var _0x5af013=events[_0x31a0ac];var _0x156e12=createListener(_0x3c92('0x4')+_0x5af013,_0x1558f7);ChatInternalMessageEvents['on'](_0x5af013,_0x156e12);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index e9f1754..aee3aa2 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 _0x88f2=['index','/describe','describe','/users','getUsers','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x231b2e,_0x2a33f9){var _0x3feb2a=function(_0x5aa472){while(--_0x5aa472){_0x231b2e['push'](_0x231b2e['shift']());}};_0x3feb2a(++_0x2a33f9);}(_0x88f2,0xd5));var _0x288f=function(_0x56ef39,_0x37ecee){_0x56ef39=_0x56ef39-0x0;var _0x2477e6=_0x88f2[_0x56ef39];return _0x2477e6;};'use strict';var multer=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var path=require(_0x288f('0x2'));var timeout=require(_0x288f('0x3'));var express=require(_0x288f('0x4'));var router=express[_0x288f('0x5')]();var fs_extra=require(_0x288f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x288f('0x7'));var config=require(_0x288f('0x8'));var controller=require(_0x288f('0x9'));router[_0x288f('0xa')]('/',auth[_0x288f('0xb')](),controller[_0x288f('0xc')]);router[_0x288f('0xa')](_0x288f('0xd'),auth[_0x288f('0xb')](),controller[_0x288f('0xe')]);router[_0x288f('0xa')](_0x288f('0xf'),auth[_0x288f('0xb')](),controller[_0x288f('0x10')]);router[_0x288f('0xa')]('/:id',auth[_0x288f('0xb')](),controller['show']);router[_0x288f('0x11')]('/',auth[_0x288f('0xb')](),controller[_0x288f('0x12')]);router[_0x288f('0x13')](_0x288f('0x14'),controller[_0x288f('0x15')]);router[_0x288f('0x16')](_0x288f('0x14'),auth[_0x288f('0xb')](),controller[_0x288f('0x17')]);module[_0x288f('0x18')]=router;
\ No newline at end of file
+var _0xbc09=['describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get'];(function(_0x269293,_0x5d02c9){var _0x28a9cf=function(_0x6c0494){while(--_0x6c0494){_0x269293['push'](_0x269293['shift']());}};_0x28a9cf(++_0x5d02c9);}(_0xbc09,0xe7));var _0x9bc0=function(_0x87793c,_0x45f454){_0x87793c=_0x87793c-0x0;var _0x4637b3=_0xbc09[_0x87793c];return _0x4637b3;};'use strict';var multer=require('multer');var util=require(_0x9bc0('0x0'));var path=require(_0x9bc0('0x1'));var timeout=require(_0x9bc0('0x2'));var express=require(_0x9bc0('0x3'));var router=express[_0x9bc0('0x4')]();var fs_extra=require(_0x9bc0('0x5'));var auth=require(_0x9bc0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9bc0('0x7'));var controller=require(_0x9bc0('0x8'));router['get']('/',auth[_0x9bc0('0x9')](),controller['index']);router[_0x9bc0('0xa')]('/describe',auth[_0x9bc0('0x9')](),controller[_0x9bc0('0xb')]);router['get'](_0x9bc0('0xc'),auth['isAuthenticated'](),controller[_0x9bc0('0xd')]);router[_0x9bc0('0xa')](_0x9bc0('0xe'),auth[_0x9bc0('0x9')](),controller[_0x9bc0('0xf')]);router[_0x9bc0('0x10')]('/',auth[_0x9bc0('0x9')](),controller['create']);router[_0x9bc0('0x11')](_0x9bc0('0xe'),controller[_0x9bc0('0x12')]);router[_0x9bc0('0x13')]('/:id',auth[_0x9bc0('0x9')](),controller[_0x9bc0('0x14')]);module[_0x9bc0('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 9481f52..d1e70c6 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 _0x3f72=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0xc34616,_0x487250){var _0x1221ba=function(_0x531a90){while(--_0x531a90){_0xc34616['push'](_0xc34616['shift']());}};_0x1221ba(++_0x487250);}(_0x3f72,0xaf));var _0x23f7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3f72[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x23f7('0x0'));module[_0x23f7('0x1')]={'body':{'type':Sequelize[_0x23f7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x23f7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x23f7('0x4')]('in',_0x23f7('0x5')),'defaultValue':_0x23f7('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x23f7('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x23f7('0x2')]}};
\ No newline at end of file
+var _0x082b=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x3fa285,_0x49e62d){var _0x29bf11=function(_0x224a71){while(--_0x224a71){_0x3fa285['push'](_0x3fa285['shift']());}};_0x29bf11(++_0x49e62d);}(_0x082b,0x1ec));var _0xb082=function(_0x137e81,_0x3541c4){_0x137e81=_0x137e81-0x0;var _0x5f14e1=_0x082b[_0x137e81];return _0x5f14e1;};'use strict';var Sequelize=require(_0xb082('0x0'));module[_0xb082('0x1')]={'body':{'type':Sequelize[_0xb082('0x2')](_0xb082('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xb082('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb082('0x5')]('in','out'),'defaultValue':_0xb082('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb082('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb082('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 06b6842..b5c2335 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 _0x1e42=['QueryTypes','contact','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./chatMessage.socket','register','http','client','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','update','destroy','name','index','map','ChatMessage','fieldName','type','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','then','includeAll','include','findAll','rows','show','params','rawAttributes','body','find','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage'];(function(_0x768458,_0x3d0933){var _0x31385c=function(_0xf11dad){while(--_0xf11dad){_0x768458['push'](_0x768458['shift']());}};_0x31385c(++_0x3d0933);}(_0x1e42,0x10c));var _0x21e4=function(_0xcceb55,_0x7bcceb){_0xcceb55=_0xcceb55-0x0;var _0x45e9e6=_0x1e42[_0xcceb55];return _0x45e9e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21e4('0x0'));var zipdir=require(_0x21e4('0x1'));var jsonpatch=require(_0x21e4('0x2'));var rp=require(_0x21e4('0x3'));var moment=require(_0x21e4('0x4'));var BPromise=require(_0x21e4('0x5'));var Mustache=require(_0x21e4('0x6'));var util=require(_0x21e4('0x7'));var path=require(_0x21e4('0x8'));var sox=require(_0x21e4('0x9'));var csv=require('to-csv');var ejs=require(_0x21e4('0xa'));var fs=require('fs');var fs_extra=require(_0x21e4('0xb'));var _=require(_0x21e4('0xc'));var squel=require('squel');var crypto=require(_0x21e4('0xd'));var jsforce=require(_0x21e4('0xe'));var deskjs=require(_0x21e4('0xf'));var toCsv=require(_0x21e4('0x10'));var querystring=require(_0x21e4('0x11'));var Papa=require(_0x21e4('0x12'));var Redis=require(_0x21e4('0x13'));var authService=require(_0x21e4('0x14'));var qs=require(_0x21e4('0x15'));var as=require(_0x21e4('0x16'));var hardwareService=require(_0x21e4('0x17'));var logger=require(_0x21e4('0x18'))('api');var utils=require(_0x21e4('0x19'));var config=require(_0x21e4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x21e4('0x1b'))['db'];config[_0x21e4('0x1c')]=_['defaults'](config['redis'],{'host':_0x21e4('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21e4('0x1c')]));require(_0x21e4('0x1e'))[_0x21e4('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x21e4('0x20')]({'port':0x232c});var client9002=jayson[_0x21e4('0x21')][_0x21e4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4a2827,_0x28ca38,_0x22af7f,_0x352955){return new BPromise(function(_0x1c1ac5,_0x16d505){var _0x5db604=_0x352955||client;return _0x5db604[_0x21e4('0x22')](_0x4a2827,_0x22af7f)['then'](function(_0x576a63){logger[_0x21e4('0x23')](_0x21e4('0x24'),_0x28ca38,'request\x20sent');logger[_0x21e4('0x25')](_0x21e4('0x26'),_0x28ca38,_0x21e4('0x27'),JSON['stringify'](_0x576a63));if(_0x576a63[_0x21e4('0x28')]){if(_0x576a63['error']['code']===0x1f4){logger[_0x21e4('0x28')](_0x21e4('0x24'),_0x28ca38,_0x576a63[_0x21e4('0x28')][_0x21e4('0x29')]);return _0x16d505(_0x576a63[_0x21e4('0x28')][_0x21e4('0x29')]);}logger['error'](_0x21e4('0x24'),_0x28ca38,_0x576a63['error'][_0x21e4('0x29')]);return _0x1c1ac5(_0x576a63[_0x21e4('0x28')][_0x21e4('0x29')]);}else{logger[_0x21e4('0x23')](_0x21e4('0x24'),_0x28ca38,_0x21e4('0x27'));_0x1c1ac5(_0x576a63[_0x21e4('0x2a')]['message']);}})[_0x21e4('0x2b')](function(_0x589c5a){logger[_0x21e4('0x28')](_0x21e4('0x24'),_0x28ca38,_0x589c5a);_0x16d505(_0x589c5a);});});}function respondWithStatusCode(_0x5f1a30,_0x322825){_0x322825=_0x322825||0xcc;return function(_0x5c7519){if(_0x5c7519){return _0x5f1a30[_0x21e4('0x2c')](_0x322825);}return _0x5f1a30['status'](_0x322825)['end']();};}function respondWithResult(_0xf0a96d,_0x193a0a){_0x193a0a=_0x193a0a||0xc8;return function(_0xd44ffe){if(_0xd44ffe){return _0xf0a96d['status'](_0x193a0a)[_0x21e4('0x2d')](_0xd44ffe);}};}function respondWithFilteredResult(_0x14ec1b,_0x168213){return function(_0x5183e3){if(_0x5183e3){var _0x5513af=typeof _0x168213[_0x21e4('0x2e')]===_0x21e4('0x2f')&&typeof _0x168213[_0x21e4('0x30')]===_0x21e4('0x2f');var _0x395caf=_0x5183e3[_0x21e4('0x31')];var _0x524468=_0x5513af?0x0:_0x168213[_0x21e4('0x2e')];var _0x37ce03=_0x5513af?_0x5183e3['count']:_0x168213['offset']+_0x168213['limit'];var _0x48d8c7;if(_0x37ce03>=_0x395caf){_0x37ce03=_0x395caf;_0x48d8c7=0xc8;}else{_0x48d8c7=0xce;}_0x14ec1b[_0x21e4('0x32')](_0x48d8c7);return _0x14ec1b[_0x21e4('0x33')]('Content-Range',_0x524468+'-'+_0x37ce03+'/'+_0x395caf)[_0x21e4('0x2d')](_0x5183e3);}return null;};}function patchUpdates(_0x9a6968){return function(_0x4d0a20){try{jsonpatch[_0x21e4('0x34')](_0x4d0a20,_0x9a6968,!![]);}catch(_0x19d8a7){return BPromise[_0x21e4('0x35')](_0x19d8a7);}return _0x4d0a20['save']();};}function saveUpdates(_0x1d6c05,_0x443958){return function(_0x171c72){if(_0x171c72){return _0x171c72[_0x21e4('0x36')](_0x1d6c05)['then'](function(_0x2d44b0){return _0x2d44b0;});}return null;};}function removeEntity(_0x4eff4e,_0x35817d){return function(_0x6bd0a){if(_0x6bd0a){return _0x6bd0a[_0x21e4('0x37')]()['then'](function(){_0x4eff4e[_0x21e4('0x32')](0xcc)['end']();});}};}function handleEntityNotFound(_0x407b6e,_0x4f23a8){return function(_0x37c70b){if(!_0x37c70b){_0x407b6e['sendStatus'](0x194);}return _0x37c70b;};}function handleError(_0x45183b,_0x332ff1){_0x332ff1=_0x332ff1||0x1f4;return function(_0x2e7064){logger['error'](_0x2e7064['stack']);if(_0x2e7064['name']){delete _0x2e7064[_0x21e4('0x38')];}_0x45183b[_0x21e4('0x32')](_0x332ff1)['send'](_0x2e7064);};}exports[_0x21e4('0x39')]=function(_0x478ae4,_0x260f51){var _0x5041db={},_0x46f6d1={},_0x136745={'count':0x0,'rows':[]};var _0x1237b7=_[_0x21e4('0x3a')](db[_0x21e4('0x3b')]['rawAttributes'],function(_0x450d61){return{'name':_0x450d61[_0x21e4('0x3c')],'type':_0x450d61[_0x21e4('0x3d')]['key']};});_0x46f6d1['model']=_[_0x21e4('0x3a')](_0x1237b7,_0x21e4('0x38'));_0x46f6d1['query']=_[_0x21e4('0x3e')](_0x478ae4[_0x21e4('0x3f')]);_0x46f6d1['filters']=_[_0x21e4('0x40')](_0x46f6d1['model'],_0x46f6d1[_0x21e4('0x3f')]);_0x5041db[_0x21e4('0x41')]=_[_0x21e4('0x40')](_0x46f6d1[_0x21e4('0x42')],qs['fields'](_0x478ae4[_0x21e4('0x3f')][_0x21e4('0x43')]));_0x5041db[_0x21e4('0x41')]=_0x5041db[_0x21e4('0x41')][_0x21e4('0x44')]?_0x5041db['attributes']:_0x46f6d1['model'];if(!_0x478ae4[_0x21e4('0x3f')][_0x21e4('0x45')](_0x21e4('0x46'))){_0x5041db[_0x21e4('0x30')]=qs['limit'](_0x478ae4['query'][_0x21e4('0x30')]);_0x5041db[_0x21e4('0x2e')]=qs['offset'](_0x478ae4[_0x21e4('0x3f')][_0x21e4('0x2e')]);}_0x5041db[_0x21e4('0x47')]=qs[_0x21e4('0x48')](_0x478ae4[_0x21e4('0x3f')][_0x21e4('0x48')]);_0x5041db[_0x21e4('0x49')]=qs[_0x21e4('0x4a')](_[_0x21e4('0x4b')](_0x478ae4[_0x21e4('0x3f')],_0x46f6d1[_0x21e4('0x4a')]),_0x1237b7);if(_0x478ae4[_0x21e4('0x3f')]['filter']){_0x5041db[_0x21e4('0x49')]=_[_0x21e4('0x4c')](_0x5041db[_0x21e4('0x49')],{'$or':_[_0x21e4('0x3a')](_0x1237b7,function(_0x28ad43){if(_0x28ad43[_0x21e4('0x3d')]!==_0x21e4('0x4d')){var _0x2ff756={};_0x2ff756[_0x28ad43[_0x21e4('0x38')]]={'$like':'%'+_0x478ae4[_0x21e4('0x3f')][_0x21e4('0x4e')]+'%'};return _0x2ff756;}})});}_0x5041db=_[_0x21e4('0x4c')]({},_0x5041db,_0x478ae4['options']);var _0x1b75d7={'where':_0x5041db[_0x21e4('0x49')]};return db[_0x21e4('0x3b')][_0x21e4('0x31')](_0x1b75d7)[_0x21e4('0x4f')](function(_0x5a6633){_0x136745[_0x21e4('0x31')]=_0x5a6633;if(_0x478ae4['query'][_0x21e4('0x50')]){_0x5041db[_0x21e4('0x51')]=[{'all':!![]}];}return db[_0x21e4('0x3b')][_0x21e4('0x52')](_0x5041db);})[_0x21e4('0x4f')](function(_0x27f1ca){_0x136745[_0x21e4('0x53')]=_0x27f1ca;return _0x136745;})[_0x21e4('0x4f')](respondWithFilteredResult(_0x260f51,_0x5041db))['catch'](handleError(_0x260f51,null));};exports[_0x21e4('0x54')]=function(_0x16659e,_0x1d69b1){var _0x541e51={'raw':!![],'where':{'id':_0x16659e[_0x21e4('0x55')]['id']}},_0x5b37ed={};_0x5b37ed['model']=_['keys'](db['ChatMessage'][_0x21e4('0x56')]);_0x5b37ed[_0x21e4('0x3f')]=_[_0x21e4('0x3e')](_0x16659e['query']);_0x5b37ed['filters']=_[_0x21e4('0x40')](_0x5b37ed[_0x21e4('0x42')],_0x5b37ed[_0x21e4('0x3f')]);_0x541e51[_0x21e4('0x41')]=_['intersection'](_0x5b37ed[_0x21e4('0x42')],qs['fields'](_0x16659e[_0x21e4('0x3f')][_0x21e4('0x43')]));_0x541e51[_0x21e4('0x41')]=_0x541e51[_0x21e4('0x41')][_0x21e4('0x44')]?_0x541e51['attributes']:_0x5b37ed['model'];if(_0x16659e['query']['includeAll']){_0x541e51['include']=[{'all':!![]}];}_0x541e51=_[_0x21e4('0x4c')]({},_0x541e51,_0x16659e['options']);return db['ChatMessage']['find'](_0x541e51)[_0x21e4('0x4f')](handleEntityNotFound(_0x1d69b1,null))['then'](respondWithResult(_0x1d69b1,null))[_0x21e4('0x2b')](handleError(_0x1d69b1,null));};exports['create']=function(_0x41c2e1,_0x7b114d){return db[_0x21e4('0x3b')]['create'](_0x41c2e1['body'],{})[_0x21e4('0x4f')](respondWithResult(_0x7b114d,0xc9))[_0x21e4('0x2b')](handleError(_0x7b114d,null));};exports[_0x21e4('0x36')]=function(_0x5740f4,_0x433b19){if(_0x5740f4[_0x21e4('0x57')]['id']){delete _0x5740f4[_0x21e4('0x57')]['id'];}return db[_0x21e4('0x3b')]['find']({'where':{'id':_0x5740f4[_0x21e4('0x55')]['id']}})[_0x21e4('0x4f')](handleEntityNotFound(_0x433b19,null))[_0x21e4('0x4f')](saveUpdates(_0x5740f4['body'],null))['then'](respondWithResult(_0x433b19,null))[_0x21e4('0x2b')](handleError(_0x433b19,null));};exports[_0x21e4('0x37')]=function(_0x2b6960,_0x49f092){return db[_0x21e4('0x3b')][_0x21e4('0x58')]({'where':{'id':_0x2b6960[_0x21e4('0x55')]['id']}})[_0x21e4('0x4f')](handleEntityNotFound(_0x49f092,null))[_0x21e4('0x4f')](removeEntity(_0x49f092,null))[_0x21e4('0x2b')](handleError(_0x49f092,null));};exports[_0x21e4('0x59')]=function(_0x2a22e4,_0x341ae8){return db['ChatMessage'][_0x21e4('0x59')]()[_0x21e4('0x4f')](respondWithResult(_0x341ae8,null))['catch'](handleError(_0x341ae8,null));};var interaction_log=require(_0x21e4('0x18'))('chat-interactions');exports[_0x21e4('0x5a')]=function(_0x33f9f1,_0x192f69,_0x4ee2a1){var _0xc58cda={'agent':{},'channel':_0x21e4('0x5b')};if(_0x33f9f1[_0x21e4('0x57')]['id']){delete _0x33f9f1[_0x21e4('0x57')]['id'];}_0x33f9f1[_0x21e4('0x57')][_0x21e4('0x5c')]=!![];_0x33f9f1[_0x21e4('0x57')][_0x21e4('0x5d')]=moment()[_0x21e4('0x5e')](_0x21e4('0x5f'));_0x33f9f1['body']['UserId']=_0x33f9f1[_0x21e4('0x57')][_0x21e4('0x60')]||_0x33f9f1[_0x21e4('0x61')]['id'];_0xc58cda[_0x21e4('0x62')]['id']=_0x33f9f1[_0x21e4('0x57')][_0x21e4('0x60')];return db[_0x21e4('0x3b')][_0x21e4('0x58')]({'where':{'id':_0x33f9f1[_0x21e4('0x55')]['id'],'UserId':null}})[_0x21e4('0x4f')](handleEntityNotFound(_0x192f69,null))[_0x21e4('0x4f')](saveUpdates(_0x33f9f1[_0x21e4('0x57')],null))[_0x21e4('0x4f')](function(_0x1f6594){if(_0x1f6594){_0xc58cda[_0x21e4('0x29')]=_0x1f6594[_0x21e4('0x63')]({'plain':!![]});return db[_0x21e4('0x64')]['find']({'where':{'id':_0x1f6594[_0x21e4('0x65')]}});}return null;})[_0x21e4('0x4f')](handleEntityNotFound(_0x192f69,null))['then'](function(_0x5a71a0){if(_0x5a71a0){return _0x5a71a0[_0x21e4('0x36')]({'UserId':_0x33f9f1[_0x21e4('0x57')][_0x21e4('0x60')],'read1stAt':_[_0x21e4('0x66')](_0x5a71a0[_0x21e4('0x67')])?moment()[_0x21e4('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x39c536){if(_0x39c536){_0xc58cda['interaction']=_0x39c536[_0x21e4('0x63')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33f9f1[_0x21e4('0x61')]['id'],_0x33f9f1[_0x21e4('0x61')][_0x21e4('0x38')],_0x33f9f1[_0x21e4('0x61')][_0x21e4('0x68')],_0xc58cda[_0x21e4('0x69')]['id'],_0x33f9f1['body']?JSON['stringify'](_0x33f9f1[_0x21e4('0x57')]):_0x21e4('0x6a'));return respondWithRpcPromise(_0x21e4('0x6b'),_0x21e4('0x6c'),_0xc58cda);}return null;})[_0x21e4('0x4f')](function(_0x36e1a4){var _0x5576d1=_0x21e4('0x6d')+_0x36e1a4[_0x21e4('0x29')][_0x21e4('0x6e')];return db[_0x21e4('0x6f')][_0x21e4('0x3f')](_0x5576d1,{'type':db[_0x21e4('0x70')]['QueryTypes'][_0x21e4('0x71')],'raw':!![]})[_0x21e4('0x4f')](function(_0x1ffe14){return _0x1ffe14;});})[_0x21e4('0x4f')](function(_0x2caaeb){if(_0x2caaeb){_0xc58cda[_0x21e4('0x29')]['contact']=_0x2caaeb[0x0];if(!_0x33f9f1['body'][_0x21e4('0x60')])return;return db[_0x21e4('0x72')][_0x21e4('0x58')]({'where':{'id':_0x33f9f1['body']['UserId'],'role':_0x21e4('0x62')},'attributes':['id',_0x21e4('0x38'),_0x21e4('0x73'),_0x21e4('0x74'),_0x21e4('0x75')],'raw':!![]});}return null;})['then'](function(_0xa1aee3){if(!_0xa1aee3)return null;_0xc58cda[_0x21e4('0x29')]['agent']=_0xa1aee3;return _0xc58cda;})['then'](function(_0x53a7aa){if(_0x53a7aa){if(_0x33f9f1[_0x21e4('0x57')][_0x21e4('0x76')]){_0xc58cda[_0x21e4('0x29')]['interface']=util['format'](_0x21e4('0x77'),_0x33f9f1[_0x21e4('0x61')][_0x21e4('0x38')]);_0xc58cda[_0x21e4('0x29')][_0x21e4('0x78')]=_0xc58cda[_0x21e4('0x78')];_0xc58cda['message'][_0x21e4('0x79')]=_0xc58cda[_0x21e4('0x78')];_0xc58cda[_0x21e4('0x29')][_0x21e4('0x7a')]=_0x21e4('0x5a');return respondWithRpcPromise('EventManager',_0x21e4('0x7b'),{'event':_0x21e4('0x7c'),'message':_['merge'](_0xc58cda['message'],JSON[_0x21e4('0x7d')](_0xc58cda[_0x21e4('0x69')][_0x21e4('0x7e')]))},client9002)['then'](function(){return _0xc58cda;});}return _0xc58cda;}return null;})[_0x21e4('0x4f')](respondWithResult(_0x192f69,null))[_0x21e4('0x2b')](handleError(_0x192f69,null));};var interaction_log=require(_0x21e4('0x18'))(_0x21e4('0x7f'));exports['reject']=function(_0x4c33eb,_0x41e572,_0x323c5b){var _0x52e2ad={'agent':{},'channel':_0x21e4('0x5b')};if(_0x4c33eb['body']['id']){delete _0x4c33eb['body']['id'];}_0x4c33eb['body'][_0x21e4('0x60')]=_0x4c33eb[_0x21e4('0x57')][_0x21e4('0x60')]||_0x4c33eb[_0x21e4('0x61')]['id'];_0x52e2ad[_0x21e4('0x62')]['id']=_0x4c33eb['body'][_0x21e4('0x60')];return db[_0x21e4('0x3b')][_0x21e4('0x58')]({'where':{'id':_0x4c33eb[_0x21e4('0x55')]['id'],'UserId':null}})[_0x21e4('0x4f')](handleEntityNotFound(_0x41e572,null))['then'](function(_0x12fad4){if(_0x12fad4){_0x52e2ad[_0x21e4('0x29')]=_0x12fad4[_0x21e4('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x21e4('0x58')]({'where':{'id':_0x12fad4[_0x21e4('0x65')]}});}return null;})[_0x21e4('0x4f')](handleEntityNotFound(_0x41e572,null))[_0x21e4('0x4f')](function(_0x1efd43){if(_0x1efd43){_0x52e2ad[_0x21e4('0x69')]=_0x1efd43[_0x21e4('0x63')]({'plain':!![]});interaction_log[_0x21e4('0x23')](_0x21e4('0x80'),_0x4c33eb[_0x21e4('0x61')]['id'],_0x4c33eb[_0x21e4('0x61')][_0x21e4('0x38')],_0x4c33eb[_0x21e4('0x61')][_0x21e4('0x68')],_0x52e2ad[_0x21e4('0x69')]['id'],_0x4c33eb[_0x21e4('0x57')]?JSON[_0x21e4('0x81')](_0x4c33eb[_0x21e4('0x57')]):_0x21e4('0x6a'));return respondWithRpcPromise('RejectMessage',_0x21e4('0x82'),_0x52e2ad);}return null;})[_0x21e4('0x4f')](function(_0x12fe3c){var _0x5bb018=_0x21e4('0x6d')+_0x12fe3c[_0x21e4('0x29')]['ContactId'];return db['sequelize'][_0x21e4('0x3f')](_0x5bb018,{'type':db['Sequelize'][_0x21e4('0x83')][_0x21e4('0x71')],'raw':!![]})[_0x21e4('0x4f')](function(_0x1d6c92){return _0x1d6c92;});})[_0x21e4('0x4f')](function(_0x2ed983){if(_0x2ed983){_0x52e2ad[_0x21e4('0x29')][_0x21e4('0x84')]=_0x2ed983[0x0];if(!_0x4c33eb[_0x21e4('0x57')][_0x21e4('0x60')])return;return db['User'][_0x21e4('0x58')]({'where':{'id':_0x4c33eb['body'][_0x21e4('0x60')],'role':'agent'},'attributes':['id','name',_0x21e4('0x73'),_0x21e4('0x74'),_0x21e4('0x75')],'raw':!![]});}return null;})[_0x21e4('0x4f')](function(_0x43069b){if(!_0x43069b)return null;_0x52e2ad['message'][_0x21e4('0x62')]=_0x43069b;return _0x52e2ad;})[_0x21e4('0x4f')](function(_0x1faea7){if(_0x1faea7){_0x1faea7['message']['interface']=util[_0x21e4('0x5e')](_0x21e4('0x77'),_0x4c33eb[_0x21e4('0x61')]['name']);_0x1faea7[_0x21e4('0x29')]['channel']=_0x52e2ad[_0x21e4('0x78')];_0x1faea7[_0x21e4('0x29')][_0x21e4('0x79')]=_0x52e2ad[_0x21e4('0x78')];_0x1faea7['message']['event']=_0x21e4('0x35');respondWithRpcPromise(_0x21e4('0x7b'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x52e2ad[_0x21e4('0x29')],JSON[_0x21e4('0x7d')](_0x52e2ad['interaction']['formData']))},client9002);return _0x52e2ad;}return null;})[_0x21e4('0x4f')](respondWithResult(_0x41e572,null))[_0x21e4('0x2b')](handleError(_0x41e572,null));};
\ No newline at end of file
+var _0xc7e3=['end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','findAll','rows','show','length','include','find','create','body','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','channel','event','acceptmessage','parse','formData','chat-interactions','chat','params','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','sequelize','QueryTypes','SIP/%s','motionChannel','reject','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status'];(function(_0x204665,_0x4b7744){var _0x16fa00=function(_0x26f6b8){while(--_0x26f6b8){_0x204665['push'](_0x204665['shift']());}};_0x16fa00(++_0x4b7744);}(_0xc7e3,0xe3));var _0x3c7e=function(_0x3ec432,_0x2e773e){_0x3ec432=_0x3ec432-0x0;var _0x520a5a=_0xc7e3[_0x3ec432];return _0x520a5a;};'use strict';var emlformat=require(_0x3c7e('0x0'));var rimraf=require(_0x3c7e('0x1'));var zipdir=require(_0x3c7e('0x2'));var jsonpatch=require(_0x3c7e('0x3'));var rp=require(_0x3c7e('0x4'));var moment=require(_0x3c7e('0x5'));var BPromise=require(_0x3c7e('0x6'));var Mustache=require(_0x3c7e('0x7'));var util=require(_0x3c7e('0x8'));var path=require(_0x3c7e('0x9'));var sox=require('sox');var csv=require(_0x3c7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c7e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3c7e('0xc'));var jsforce=require(_0x3c7e('0xd'));var deskjs=require(_0x3c7e('0xe'));var toCsv=require(_0x3c7e('0xa'));var querystring=require(_0x3c7e('0xf'));var Papa=require(_0x3c7e('0x10'));var Redis=require('ioredis');var authService=require(_0x3c7e('0x11'));var qs=require(_0x3c7e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c7e('0x13'));var logger=require(_0x3c7e('0x14'))(_0x3c7e('0x15'));var utils=require('../../config/utils');var config=require(_0x3c7e('0x16'));var licenseUtil=require(_0x3c7e('0x17'));var db=require(_0x3c7e('0x18'))['db'];config[_0x3c7e('0x19')]=_[_0x3c7e('0x1a')](config['redis'],{'host':_0x3c7e('0x1b'),'port':0x18eb});var socket=require(_0x3c7e('0x1c'))(new Redis(config[_0x3c7e('0x19')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x3c7e('0x1d'));var client=jayson[_0x3c7e('0x1e')][_0x3c7e('0x1f')]({'port':0x232c});var client9002=jayson[_0x3c7e('0x1e')][_0x3c7e('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2dfaa9,_0x5d8b53,_0x50c352,_0x278db2){return new BPromise(function(_0x8f0f83,_0x4dc991){var _0x5b0b62=_0x278db2||client;return _0x5b0b62[_0x3c7e('0x20')](_0x2dfaa9,_0x50c352)[_0x3c7e('0x21')](function(_0x3d7fd4){logger[_0x3c7e('0x22')](_0x3c7e('0x23'),_0x5d8b53,_0x3c7e('0x24'));logger[_0x3c7e('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5d8b53,_0x3c7e('0x24'),JSON[_0x3c7e('0x26')](_0x3d7fd4));if(_0x3d7fd4[_0x3c7e('0x27')]){if(_0x3d7fd4[_0x3c7e('0x27')][_0x3c7e('0x28')]===0x1f4){logger[_0x3c7e('0x27')](_0x3c7e('0x23'),_0x5d8b53,_0x3d7fd4[_0x3c7e('0x27')]['message']);return _0x4dc991(_0x3d7fd4[_0x3c7e('0x27')][_0x3c7e('0x29')]);}logger[_0x3c7e('0x27')](_0x3c7e('0x23'),_0x5d8b53,_0x3d7fd4['error'][_0x3c7e('0x29')]);return _0x8f0f83(_0x3d7fd4['error'][_0x3c7e('0x29')]);}else{logger[_0x3c7e('0x22')](_0x3c7e('0x23'),_0x5d8b53,_0x3c7e('0x24'));_0x8f0f83(_0x3d7fd4['result'][_0x3c7e('0x29')]);}})[_0x3c7e('0x2a')](function(_0x2ef267){logger['error'](_0x3c7e('0x23'),_0x5d8b53,_0x2ef267);_0x4dc991(_0x2ef267);});});}function respondWithStatusCode(_0x1345c4,_0x2a9598){_0x2a9598=_0x2a9598||0xcc;return function(_0x28069b){if(_0x28069b){return _0x1345c4[_0x3c7e('0x2b')](_0x2a9598);}return _0x1345c4[_0x3c7e('0x2c')](_0x2a9598)[_0x3c7e('0x2d')]();};}function respondWithResult(_0xa78ede,_0x7455a5){_0x7455a5=_0x7455a5||0xc8;return function(_0x3a1463){if(_0x3a1463){return _0xa78ede[_0x3c7e('0x2c')](_0x7455a5)[_0x3c7e('0x2e')](_0x3a1463);}};}function respondWithFilteredResult(_0x44324c,_0x2ec0ad){return function(_0x167726){if(_0x167726){var _0x7abe0=typeof _0x2ec0ad[_0x3c7e('0x2f')]==='undefined'&&typeof _0x2ec0ad[_0x3c7e('0x30')]===_0x3c7e('0x31');var _0x1da9d2=_0x167726[_0x3c7e('0x32')];var _0x144b00=_0x7abe0?0x0:_0x2ec0ad['offset'];var _0x1a6884=_0x7abe0?_0x167726[_0x3c7e('0x32')]:_0x2ec0ad[_0x3c7e('0x2f')]+_0x2ec0ad[_0x3c7e('0x30')];var _0x509a7a;if(_0x1a6884>=_0x1da9d2){_0x1a6884=_0x1da9d2;_0x509a7a=0xc8;}else{_0x509a7a=0xce;}_0x44324c[_0x3c7e('0x2c')](_0x509a7a);return _0x44324c[_0x3c7e('0x33')](_0x3c7e('0x34'),_0x144b00+'-'+_0x1a6884+'/'+_0x1da9d2)[_0x3c7e('0x2e')](_0x167726);}return null;};}function patchUpdates(_0x16905c){return function(_0x1aae0c){try{jsonpatch[_0x3c7e('0x35')](_0x1aae0c,_0x16905c,!![]);}catch(_0x5e1b0c){return BPromise['reject'](_0x5e1b0c);}return _0x1aae0c[_0x3c7e('0x36')]();};}function saveUpdates(_0xf91945,_0x29445f){return function(_0x16007c){if(_0x16007c){return _0x16007c[_0x3c7e('0x37')](_0xf91945)[_0x3c7e('0x21')](function(_0x3a6ddd){return _0x3a6ddd;});}return null;};}function removeEntity(_0x41ec4f,_0x4aa768){return function(_0x1ea373){if(_0x1ea373){return _0x1ea373[_0x3c7e('0x38')]()[_0x3c7e('0x21')](function(){_0x41ec4f['status'](0xcc)[_0x3c7e('0x2d')]();});}};}function handleEntityNotFound(_0x1dce58,_0x414b1a){return function(_0x5ee8f8){if(!_0x5ee8f8){_0x1dce58[_0x3c7e('0x2b')](0x194);}return _0x5ee8f8;};}function handleError(_0x2e4145,_0x58a6f3){_0x58a6f3=_0x58a6f3||0x1f4;return function(_0x35d5f8){logger[_0x3c7e('0x27')](_0x35d5f8[_0x3c7e('0x39')]);if(_0x35d5f8['name']){delete _0x35d5f8[_0x3c7e('0x3a')];}_0x2e4145['status'](_0x58a6f3)[_0x3c7e('0x3b')](_0x35d5f8);};}exports['index']=function(_0x421d9f,_0x77d83a){var _0x3aa1b1={},_0x5f4e2e={},_0x123462={'count':0x0,'rows':[]};var _0x23bdfa=_[_0x3c7e('0x3c')](db[_0x3c7e('0x3d')][_0x3c7e('0x3e')],function(_0x442e8d){return{'name':_0x442e8d[_0x3c7e('0x3f')],'type':_0x442e8d[_0x3c7e('0x40')]['key']};});_0x5f4e2e['model']=_[_0x3c7e('0x3c')](_0x23bdfa,_0x3c7e('0x3a'));_0x5f4e2e[_0x3c7e('0x41')]=_[_0x3c7e('0x42')](_0x421d9f['query']);_0x5f4e2e['filters']=_[_0x3c7e('0x43')](_0x5f4e2e['model'],_0x5f4e2e[_0x3c7e('0x41')]);_0x3aa1b1[_0x3c7e('0x44')]=_['intersection'](_0x5f4e2e[_0x3c7e('0x45')],qs['fields'](_0x421d9f[_0x3c7e('0x41')]['fields']));_0x3aa1b1[_0x3c7e('0x44')]=_0x3aa1b1['attributes']['length']?_0x3aa1b1[_0x3c7e('0x44')]:_0x5f4e2e[_0x3c7e('0x45')];if(!_0x421d9f[_0x3c7e('0x41')]['hasOwnProperty'](_0x3c7e('0x46'))){_0x3aa1b1[_0x3c7e('0x30')]=qs['limit'](_0x421d9f[_0x3c7e('0x41')]['limit']);_0x3aa1b1['offset']=qs[_0x3c7e('0x2f')](_0x421d9f['query']['offset']);}_0x3aa1b1[_0x3c7e('0x47')]=qs[_0x3c7e('0x48')](_0x421d9f[_0x3c7e('0x41')][_0x3c7e('0x48')]);_0x3aa1b1[_0x3c7e('0x49')]=qs['filters'](_[_0x3c7e('0x4a')](_0x421d9f['query'],_0x5f4e2e[_0x3c7e('0x4b')]),_0x23bdfa);if(_0x421d9f['query'][_0x3c7e('0x4c')]){_0x3aa1b1[_0x3c7e('0x49')]=_[_0x3c7e('0x4d')](_0x3aa1b1[_0x3c7e('0x49')],{'$or':_[_0x3c7e('0x3c')](_0x23bdfa,function(_0x22bf83){if(_0x22bf83[_0x3c7e('0x40')]!=='VIRTUAL'){var _0x49f286={};_0x49f286[_0x22bf83[_0x3c7e('0x3a')]]={'$like':'%'+_0x421d9f[_0x3c7e('0x41')][_0x3c7e('0x4c')]+'%'};return _0x49f286;}})});}_0x3aa1b1=_[_0x3c7e('0x4d')]({},_0x3aa1b1,_0x421d9f[_0x3c7e('0x4e')]);var _0x5f8519={'where':_0x3aa1b1[_0x3c7e('0x49')]};return db[_0x3c7e('0x3d')][_0x3c7e('0x32')](_0x5f8519)[_0x3c7e('0x21')](function(_0x20486d){_0x123462[_0x3c7e('0x32')]=_0x20486d;if(_0x421d9f['query'][_0x3c7e('0x4f')]){_0x3aa1b1['include']=[{'all':!![]}];}return db[_0x3c7e('0x3d')][_0x3c7e('0x50')](_0x3aa1b1);})[_0x3c7e('0x21')](function(_0x4042c4){_0x123462[_0x3c7e('0x51')]=_0x4042c4;return _0x123462;})['then'](respondWithFilteredResult(_0x77d83a,_0x3aa1b1))['catch'](handleError(_0x77d83a,null));};exports[_0x3c7e('0x52')]=function(_0x9dd27a,_0x2b72d3){var _0x346de0={'raw':!![],'where':{'id':_0x9dd27a['params']['id']}},_0x5b4971={};_0x5b4971['model']=_[_0x3c7e('0x42')](db[_0x3c7e('0x3d')]['rawAttributes']);_0x5b4971[_0x3c7e('0x41')]=_['keys'](_0x9dd27a[_0x3c7e('0x41')]);_0x5b4971[_0x3c7e('0x4b')]=_[_0x3c7e('0x43')](_0x5b4971[_0x3c7e('0x45')],_0x5b4971['query']);_0x346de0[_0x3c7e('0x44')]=_[_0x3c7e('0x43')](_0x5b4971[_0x3c7e('0x45')],qs['fields'](_0x9dd27a[_0x3c7e('0x41')]['fields']));_0x346de0[_0x3c7e('0x44')]=_0x346de0['attributes'][_0x3c7e('0x53')]?_0x346de0[_0x3c7e('0x44')]:_0x5b4971[_0x3c7e('0x45')];if(_0x9dd27a[_0x3c7e('0x41')]['includeAll']){_0x346de0[_0x3c7e('0x54')]=[{'all':!![]}];}_0x346de0=_[_0x3c7e('0x4d')]({},_0x346de0,_0x9dd27a[_0x3c7e('0x4e')]);return db[_0x3c7e('0x3d')][_0x3c7e('0x55')](_0x346de0)['then'](handleEntityNotFound(_0x2b72d3,null))[_0x3c7e('0x21')](respondWithResult(_0x2b72d3,null))[_0x3c7e('0x2a')](handleError(_0x2b72d3,null));};exports[_0x3c7e('0x56')]=function(_0x3c61d5,_0x44a4a7){return db['ChatMessage'][_0x3c7e('0x56')](_0x3c61d5[_0x3c7e('0x57')],{})[_0x3c7e('0x21')](respondWithResult(_0x44a4a7,0xc9))[_0x3c7e('0x2a')](handleError(_0x44a4a7,null));};exports[_0x3c7e('0x37')]=function(_0x373067,_0x5969e5){if(_0x373067[_0x3c7e('0x57')]['id']){delete _0x373067[_0x3c7e('0x57')]['id'];}return db['ChatMessage'][_0x3c7e('0x55')]({'where':{'id':_0x373067['params']['id']}})[_0x3c7e('0x21')](handleEntityNotFound(_0x5969e5,null))[_0x3c7e('0x21')](saveUpdates(_0x373067[_0x3c7e('0x57')],null))[_0x3c7e('0x21')](respondWithResult(_0x5969e5,null))[_0x3c7e('0x2a')](handleError(_0x5969e5,null));};exports[_0x3c7e('0x38')]=function(_0x2371e9,_0x5212d3){return db[_0x3c7e('0x3d')][_0x3c7e('0x55')]({'where':{'id':_0x2371e9['params']['id']}})[_0x3c7e('0x21')](handleEntityNotFound(_0x5212d3,null))['then'](removeEntity(_0x5212d3,null))[_0x3c7e('0x2a')](handleError(_0x5212d3,null));};exports[_0x3c7e('0x58')]=function(_0x49c0df,_0x5eaccd){return db[_0x3c7e('0x3d')][_0x3c7e('0x58')]()[_0x3c7e('0x21')](respondWithResult(_0x5eaccd,null))[_0x3c7e('0x2a')](handleError(_0x5eaccd,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x3c7e('0x59')]=function(_0x1cc5f5,_0x366e3e,_0x326ea4){var _0x4fc38e={'agent':{},'channel':'chat'};if(_0x1cc5f5[_0x3c7e('0x57')]['id']){delete _0x1cc5f5[_0x3c7e('0x57')]['id'];}_0x1cc5f5[_0x3c7e('0x57')][_0x3c7e('0x5a')]=!![];_0x1cc5f5[_0x3c7e('0x57')][_0x3c7e('0x5b')]=moment()[_0x3c7e('0x5c')](_0x3c7e('0x5d'));_0x1cc5f5[_0x3c7e('0x57')][_0x3c7e('0x5e')]=_0x1cc5f5[_0x3c7e('0x57')]['UserId']||_0x1cc5f5[_0x3c7e('0x5f')]['id'];_0x4fc38e[_0x3c7e('0x60')]['id']=_0x1cc5f5[_0x3c7e('0x57')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x1cc5f5['params']['id'],'UserId':null}})[_0x3c7e('0x21')](handleEntityNotFound(_0x366e3e,null))[_0x3c7e('0x21')](saveUpdates(_0x1cc5f5[_0x3c7e('0x57')],null))[_0x3c7e('0x21')](function(_0x185156){if(_0x185156){_0x4fc38e[_0x3c7e('0x29')]=_0x185156[_0x3c7e('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x3c7e('0x55')]({'where':{'id':_0x185156[_0x3c7e('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x366e3e,null))[_0x3c7e('0x21')](function(_0xf6309e){if(_0xf6309e){return _0xf6309e[_0x3c7e('0x37')]({'UserId':_0x1cc5f5['body']['UserId'],'read1stAt':_[_0x3c7e('0x63')](_0xf6309e[_0x3c7e('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5b4246){if(_0x5b4246){_0x4fc38e[_0x3c7e('0x65')]=_0x5b4246[_0x3c7e('0x61')]({'plain':!![]});interaction_log['info'](_0x3c7e('0x66'),_0x1cc5f5[_0x3c7e('0x5f')]['id'],_0x1cc5f5['user']['name'],_0x1cc5f5[_0x3c7e('0x5f')][_0x3c7e('0x67')],_0x4fc38e[_0x3c7e('0x65')]['id'],_0x1cc5f5[_0x3c7e('0x57')]?JSON[_0x3c7e('0x26')](_0x1cc5f5[_0x3c7e('0x57')]):_0x3c7e('0x68'));return respondWithRpcPromise(_0x3c7e('0x69'),_0x3c7e('0x6a'),_0x4fc38e);}return null;})[_0x3c7e('0x21')](function(_0x13bb05){var _0x38922f=_0x3c7e('0x6b')+_0x13bb05[_0x3c7e('0x29')]['ContactId'];return db['sequelize'][_0x3c7e('0x41')](_0x38922f,{'type':db[_0x3c7e('0x6c')]['QueryTypes'][_0x3c7e('0x6d')],'raw':!![]})[_0x3c7e('0x21')](function(_0x59d09d){return _0x59d09d;});})[_0x3c7e('0x21')](function(_0x42b28e){if(_0x42b28e){_0x4fc38e[_0x3c7e('0x29')][_0x3c7e('0x6e')]=_0x42b28e[0x0];if(!_0x1cc5f5[_0x3c7e('0x57')][_0x3c7e('0x5e')])return;return db[_0x3c7e('0x6f')]['find']({'where':{'id':_0x1cc5f5[_0x3c7e('0x57')][_0x3c7e('0x5e')],'role':'agent'},'attributes':['id','name',_0x3c7e('0x70'),_0x3c7e('0x71'),_0x3c7e('0x72')],'raw':!![]});}return null;})[_0x3c7e('0x21')](function(_0x49d871){if(!_0x49d871)return null;_0x4fc38e[_0x3c7e('0x29')][_0x3c7e('0x60')]=_0x49d871;return _0x4fc38e;})['then'](function(_0x1b369a){if(_0x1b369a){if(_0x1cc5f5[_0x3c7e('0x57')][_0x3c7e('0x73')]){_0x4fc38e['message'][_0x3c7e('0x74')]=util[_0x3c7e('0x5c')]('SIP/%s',_0x1cc5f5['user'][_0x3c7e('0x3a')]);_0x4fc38e[_0x3c7e('0x29')]['channel']=_0x4fc38e[_0x3c7e('0x75')];_0x4fc38e['message']['motionChannel']=_0x4fc38e[_0x3c7e('0x75')];_0x4fc38e['message'][_0x3c7e('0x76')]=_0x3c7e('0x59');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x3c7e('0x77'),'message':_[_0x3c7e('0x4d')](_0x4fc38e[_0x3c7e('0x29')],JSON[_0x3c7e('0x78')](_0x4fc38e[_0x3c7e('0x65')][_0x3c7e('0x79')]))},client9002)[_0x3c7e('0x21')](function(){return _0x4fc38e;});}return _0x4fc38e;}return null;})[_0x3c7e('0x21')](respondWithResult(_0x366e3e,null))['catch'](handleError(_0x366e3e,null));};var interaction_log=require(_0x3c7e('0x14'))(_0x3c7e('0x7a'));exports['reject']=function(_0x428c06,_0x2bd52f,_0x37cb84){var _0x111a40={'agent':{},'channel':_0x3c7e('0x7b')};if(_0x428c06[_0x3c7e('0x57')]['id']){delete _0x428c06[_0x3c7e('0x57')]['id'];}_0x428c06[_0x3c7e('0x57')][_0x3c7e('0x5e')]=_0x428c06[_0x3c7e('0x57')][_0x3c7e('0x5e')]||_0x428c06[_0x3c7e('0x5f')]['id'];_0x111a40['agent']['id']=_0x428c06[_0x3c7e('0x57')][_0x3c7e('0x5e')];return db[_0x3c7e('0x3d')][_0x3c7e('0x55')]({'where':{'id':_0x428c06[_0x3c7e('0x7c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2bd52f,null))[_0x3c7e('0x21')](function(_0x268756){if(_0x268756){_0x111a40[_0x3c7e('0x29')]=_0x268756[_0x3c7e('0x61')]({'plain':!![]});return db[_0x3c7e('0x7d')][_0x3c7e('0x55')]({'where':{'id':_0x268756['ChatInteractionId']}});}return null;})[_0x3c7e('0x21')](handleEntityNotFound(_0x2bd52f,null))['then'](function(_0x54cd15){if(_0x54cd15){_0x111a40[_0x3c7e('0x65')]=_0x54cd15['get']({'plain':!![]});interaction_log['info'](_0x3c7e('0x7e'),_0x428c06[_0x3c7e('0x5f')]['id'],_0x428c06[_0x3c7e('0x5f')][_0x3c7e('0x3a')],_0x428c06['user'][_0x3c7e('0x67')],_0x111a40[_0x3c7e('0x65')]['id'],_0x428c06[_0x3c7e('0x57')]?JSON[_0x3c7e('0x26')](_0x428c06[_0x3c7e('0x57')]):'null');return respondWithRpcPromise('RejectMessage',_0x3c7e('0x7f'),_0x111a40);}return null;})[_0x3c7e('0x21')](function(_0x1f7fa5){var _0x174988=_0x3c7e('0x6b')+_0x1f7fa5[_0x3c7e('0x29')][_0x3c7e('0x80')];return db[_0x3c7e('0x81')][_0x3c7e('0x41')](_0x174988,{'type':db[_0x3c7e('0x6c')][_0x3c7e('0x82')][_0x3c7e('0x6d')],'raw':!![]})[_0x3c7e('0x21')](function(_0x4574dc){return _0x4574dc;});})['then'](function(_0x48ee11){if(_0x48ee11){_0x111a40['message']['contact']=_0x48ee11[0x0];if(!_0x428c06[_0x3c7e('0x57')]['UserId'])return;return db[_0x3c7e('0x6f')][_0x3c7e('0x55')]({'where':{'id':_0x428c06[_0x3c7e('0x57')][_0x3c7e('0x5e')],'role':_0x3c7e('0x60')},'attributes':['id',_0x3c7e('0x3a'),_0x3c7e('0x70'),_0x3c7e('0x71'),_0x3c7e('0x72')],'raw':!![]});}return null;})[_0x3c7e('0x21')](function(_0x44e227){if(!_0x44e227)return null;_0x111a40[_0x3c7e('0x29')][_0x3c7e('0x60')]=_0x44e227;return _0x111a40;})['then'](function(_0xd60c41){if(_0xd60c41){_0xd60c41[_0x3c7e('0x29')][_0x3c7e('0x74')]=util[_0x3c7e('0x5c')](_0x3c7e('0x83'),_0x428c06['user']['name']);_0xd60c41[_0x3c7e('0x29')][_0x3c7e('0x75')]=_0x111a40[_0x3c7e('0x75')];_0xd60c41['message'][_0x3c7e('0x84')]=_0x111a40[_0x3c7e('0x75')];_0xd60c41[_0x3c7e('0x29')][_0x3c7e('0x76')]=_0x3c7e('0x85');respondWithRpcPromise(_0x3c7e('0x86'),_0x3c7e('0x86'),{'event':_0x3c7e('0x87'),'message':_[_0x3c7e('0x4d')](_0x111a40['message'],JSON[_0x3c7e('0x78')](_0x111a40['interaction'][_0x3c7e('0x79')]))},client9002);return _0x111a40;}return null;})[_0x3c7e('0x21')](respondWithResult(_0x2bd52f,null))[_0x3c7e('0x2a')](handleError(_0x2bd52f,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 8177348..8a52273 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 _0x1838=['../../mysqldb','ChatMessage','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1838,0x1e0));var _0x8183=function(_0x2d1e29,_0x22f87b){_0x2d1e29=_0x2d1e29-0x0;var _0x238fca=_0x1838[_0x2d1e29];return _0x238fca;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x8183('0x0'))['db'][_0x8183('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8183('0x2'),'afterUpdate':_0x8183('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5f55a5){return function(_0x39abd6,_0x5c26fb,_0xcd7070){ChatMessageEvents[_0x8183('0x4')](_0x5f55a5+':'+_0x39abd6['id'],_0x39abd6);ChatMessageEvents[_0x8183('0x4')](_0x5f55a5,_0x39abd6);_0xcd7070(null);};}for(var e in events){if(events[_0x8183('0x5')](e)){var event=events[e];ChatMessage[_0x8183('0x6')](e,emitEvent(event));}}module[_0x8183('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6da5=['hasOwnProperty','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit'];(function(_0x2e748c,_0x55ec8e){var _0x37e219=function(_0x38c784){while(--_0x38c784){_0x2e748c['push'](_0x2e748c['shift']());}};_0x37e219(++_0x55ec8e);}(_0x6da5,0x1bb));var _0x56da=function(_0x54bf1d,_0x96319e){_0x54bf1d=_0x54bf1d-0x0;var _0x4e9ae6=_0x6da5[_0x54bf1d];return _0x4e9ae6;};'use strict';var EventEmitter=require(_0x56da('0x0'));var ChatMessage=require(_0x56da('0x1'))['db'][_0x56da('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x56da('0x3')](0x0);var events={'afterCreate':_0x56da('0x4'),'afterUpdate':'update','afterDestroy':_0x56da('0x5')};function emitEvent(_0x2daff2){return function(_0x2ade35,_0x3f057c,_0x398bfb){ChatMessageEvents['emit'](_0x2daff2+':'+_0x2ade35['id'],_0x2ade35);ChatMessageEvents[_0x56da('0x6')](_0x2daff2,_0x2ade35);_0x398bfb(null);};}for(var e in events){if(events[_0x56da('0x7')](e)){var event=events[e];ChatMessage[_0x56da('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 7591151..3604978 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 _0xdab2=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','UserId','ChatInteraction','ChatInteractionId','then','createdAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var logger=require('../../config/logger')(_0x2dab('0x2'));var moment=require(_0x2dab('0x3'));var BPromise=require(_0x2dab('0x4'));var rp=require(_0x2dab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var attributes=require(_0x2dab('0x8'));module[_0x2dab('0x9')]=function(_0x4562bb,_0x1421d5){return _0x4562bb[_0x2dab('0xa')](_0x2dab('0xb'),attributes,{'tableName':_0x2dab('0xc'),'paranoid':![],'indexes':[{'name':_0x2dab('0xd'),'fields':[_0x2dab('0xe')],'type':_0x2dab('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x317c59,_0x533046,_0x596950){var _0x26852f=_0x4562bb[_0x2dab('0x10')];var _0x1e258e=_0x317c59['get']({'plain':!![]});if(_0x1e258e['direction'][_0x2dab('0x11')]()==='in'||_0x1e258e[_0x2dab('0x12')][_0x2dab('0x11')]()===_0x2dab('0x13')&&!_0x1e258e[_0x2dab('0x14')]&&!_['isNil'](_0x1e258e[_0x2dab('0x15')])){_0x26852f[_0x2dab('0x16')]['findOne']({'where':{'id':_0x1e258e[_0x2dab('0x17')]}})[_0x2dab('0x18')](function(_0x1b5161){if(_0x1b5161){_0x1b5161['update']({'lastMsgAt':_0x1e258e[_0x2dab('0x19')],'lastMsgDirection':_0x1e258e[_0x2dab('0x12')]['toLowerCase']()});}})[_0x2dab('0x1a')](function(_0x15a9e7){console[_0x2dab('0x1b')](_0x15a9e7);});}_0x596950();}},'charset':_0x2dab('0x1c'),'collate':_0x2dab('0x1d')});};
\ No newline at end of file
+var _0xfe5e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','ChatInteraction','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x2a4144,_0xdd438f){var _0x26722b=function(_0x1634f3){while(--_0x1634f3){_0x2a4144['push'](_0x2a4144['shift']());}};_0x26722b(++_0xdd438f);}(_0xfe5e,0x186));var _0xefe5=function(_0x340c13,_0x595d66){_0x340c13=_0x340c13-0x0;var _0x5a7d96=_0xfe5e[_0x340c13];return _0x5a7d96;};'use strict';var _=require(_0xefe5('0x0'));var util=require('util');var logger=require(_0xefe5('0x1'))('api');var moment=require(_0xefe5('0x2'));var BPromise=require(_0xefe5('0x3'));var rp=require(_0xefe5('0x4'));var fs=require('fs');var path=require(_0xefe5('0x5'));var rimraf=require(_0xefe5('0x6'));var config=require(_0xefe5('0x7'));var attributes=require(_0xefe5('0x8'));module[_0xefe5('0x9')]=function(_0x3b6107,_0x1f3989){return _0x3b6107[_0xefe5('0xa')](_0xefe5('0xb'),attributes,{'tableName':_0xefe5('0xc'),'paranoid':![],'indexes':[{'name':_0xefe5('0xd'),'fields':[_0xefe5('0xe')],'type':_0xefe5('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a7cad,_0x59a9b0,_0x5372ad){var _0x45ddc6=_0x3b6107['models'];var _0x5bcbfc=_0x5a7cad['get']({'plain':!![]});if(_0x5bcbfc[_0xefe5('0x10')][_0xefe5('0x11')]()==='in'||_0x5bcbfc['direction'][_0xefe5('0x11')]()===_0xefe5('0x12')&&!_0x5bcbfc[_0xefe5('0x13')]&&!_[_0xefe5('0x14')](_0x5bcbfc['UserId'])){_0x45ddc6[_0xefe5('0x15')]['findOne']({'where':{'id':_0x5bcbfc['ChatInteractionId']}})[_0xefe5('0x16')](function(_0x18dc3a){if(_0x18dc3a){_0x18dc3a[_0xefe5('0x17')]({'lastMsgAt':_0x5bcbfc[_0xefe5('0x18')],'lastMsgDirection':_0x5bcbfc[_0xefe5('0x10')][_0xefe5('0x11')]()});}})['catch'](function(_0x2de34e){console[_0xefe5('0x19')](_0x2de34e);});}_0x5372ad();}},'charset':_0xefe5('0x1a'),'collate':_0xefe5('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 4ae2ffc..12ccec1 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 _0xfc4f=['create','body','options','raw','then','CreateChatMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatMessage'];(function(_0x22e69a,_0x464f63){var _0x16f52f=function(_0x47918c){while(--_0x47918c){_0x22e69a['push'](_0x22e69a['shift']());}};_0x16f52f(++_0x464f63);}(_0xfc4f,0x192));var _0xffc4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfc4f[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xffc4('0x0'));var moment=require(_0xffc4('0x1'));var BPromise=require(_0xffc4('0x2'));var rs=require(_0xffc4('0x3'));var fs=require('fs');var Redis=require(_0xffc4('0x4'));var db=require(_0xffc4('0x5'))['db'];var utils=require(_0xffc4('0x6'));var logger=require('../../config/logger')(_0xffc4('0x7'));var config=require(_0xffc4('0x8'));var jayson=require(_0xffc4('0x9'));var client=jayson[_0xffc4('0xa')]['http']({'port':0x232a});config[_0xffc4('0xb')]=_[_0xffc4('0xc')](config['redis'],{'host':_0xffc4('0xd'),'port':0x18eb});var socket=require(_0xffc4('0xe'))(new Redis(config[_0xffc4('0xb')]));require(_0xffc4('0xf'))['register'](socket);function respondWithRpcPromise(_0x22daf5,_0x22d03a,_0x2539cd){return new BPromise(function(_0x1718c3,_0x3705a7){return client[_0xffc4('0x10')](_0x22daf5,_0x2539cd)['then'](function(_0x4136dd){logger[_0xffc4('0x11')](_0xffc4('0x12'),_0x22d03a,_0xffc4('0x13'));logger[_0xffc4('0x14')](_0xffc4('0x15'),_0x22d03a,_0xffc4('0x13'),JSON['stringify'](_0x4136dd));if(_0x4136dd[_0xffc4('0x16')]){if(_0x4136dd[_0xffc4('0x16')]['code']===0x1f4){logger[_0xffc4('0x16')](_0xffc4('0x12'),_0x22d03a,_0x4136dd['error'][_0xffc4('0x17')]);return _0x3705a7(_0x4136dd[_0xffc4('0x16')][_0xffc4('0x17')]);}logger[_0xffc4('0x16')]('ChatMessage,\x20%s,\x20%s',_0x22d03a,_0x4136dd[_0xffc4('0x16')][_0xffc4('0x17')]);return _0x1718c3(_0x4136dd[_0xffc4('0x16')][_0xffc4('0x17')]);}else{logger[_0xffc4('0x11')](_0xffc4('0x12'),_0x22d03a,_0xffc4('0x13'));_0x1718c3(_0x4136dd[_0xffc4('0x18')][_0xffc4('0x17')]);}})[_0xffc4('0x19')](function(_0x51a9ba){logger[_0xffc4('0x16')]('ChatMessage,\x20%s,\x20%s',_0x22d03a,_0x51a9ba);_0x3705a7(_0x51a9ba);});});}exports['CreateChatMessage']=function(_0x6a0096){var _0xd48851=this;return new Promise(function(_0x25b521,_0x5eb1c1){return db[_0xffc4('0x1a')][_0xffc4('0x1b')](_0x6a0096[_0xffc4('0x1c')],{'raw':_0x6a0096[_0xffc4('0x1d')]?_0x6a0096[_0xffc4('0x1d')][_0xffc4('0x1e')]===undefined?!![]:![]:!![]})[_0xffc4('0x1f')](function(_0x5957f2){logger[_0xffc4('0x11')](_0xffc4('0x20'),_0x6a0096);logger[_0xffc4('0x14')](_0xffc4('0x20'),_0x6a0096,JSON['stringify'](_0x5957f2));_0x25b521(_0x5957f2);})['catch'](function(_0x39d808){logger[_0xffc4('0x16')]('CreateChatMessage',_0x39d808[_0xffc4('0x17')],_0x6a0096);_0x5eb1c1(_0xd48851[_0xffc4('0x16')](0x1f4,_0x39d808[_0xffc4('0x17')]));});});};
\ No newline at end of file
+var _0xfbbc=['message','result','catch','ChatMessage','create','body','options','raw','info','CreateChatMessage','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x11a0b0,_0x13077c){var _0x1382e6=function(_0x562ed0){while(--_0x562ed0){_0x11a0b0['push'](_0x11a0b0['shift']());}};_0x1382e6(++_0x13077c);}(_0xfbbc,0x86));var _0xcfbb=function(_0x1f3b06,_0xffc69a){_0x1f3b06=_0x1f3b06-0x0;var _0x4f198e=_0xfbbc[_0x1f3b06];return _0x4f198e;};'use strict';var _=require(_0xcfbb('0x0'));var util=require(_0xcfbb('0x1'));var moment=require(_0xcfbb('0x2'));var BPromise=require(_0xcfbb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfbb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfbb('0x5'))('rpc');var config=require(_0xcfbb('0x6'));var jayson=require(_0xcfbb('0x7'));var client=jayson['client'][_0xcfbb('0x8')]({'port':0x232a});config['redis']=_[_0xcfbb('0x9')](config[_0xcfbb('0xa')],{'host':_0xcfbb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfbb('0xa')]));require(_0xcfbb('0xc'))[_0xcfbb('0xd')](socket);function respondWithRpcPromise(_0x1f08c6,_0x3a0a4a,_0x384e19){return new BPromise(function(_0x4003d4,_0x5ee8c2){return client['request'](_0x1f08c6,_0x384e19)[_0xcfbb('0xe')](function(_0x2ac18e){logger['info'](_0xcfbb('0xf'),_0x3a0a4a,_0xcfbb('0x10'));logger[_0xcfbb('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3a0a4a,_0xcfbb('0x10'),JSON[_0xcfbb('0x12')](_0x2ac18e));if(_0x2ac18e[_0xcfbb('0x13')]){if(_0x2ac18e['error'][_0xcfbb('0x14')]===0x1f4){logger[_0xcfbb('0x13')](_0xcfbb('0xf'),_0x3a0a4a,_0x2ac18e[_0xcfbb('0x13')]['message']);return _0x5ee8c2(_0x2ac18e[_0xcfbb('0x13')][_0xcfbb('0x15')]);}logger[_0xcfbb('0x13')]('ChatMessage,\x20%s,\x20%s',_0x3a0a4a,_0x2ac18e[_0xcfbb('0x13')]['message']);return _0x4003d4(_0x2ac18e[_0xcfbb('0x13')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3a0a4a,_0xcfbb('0x10'));_0x4003d4(_0x2ac18e[_0xcfbb('0x16')][_0xcfbb('0x15')]);}})[_0xcfbb('0x17')](function(_0x4183f7){logger['error'](_0xcfbb('0xf'),_0x3a0a4a,_0x4183f7);_0x5ee8c2(_0x4183f7);});});}exports['CreateChatMessage']=function(_0xa4404a){var _0x3d2715=this;return new Promise(function(_0x1322ac,_0x2a63c5){return db[_0xcfbb('0x18')][_0xcfbb('0x19')](_0xa4404a[_0xcfbb('0x1a')],{'raw':_0xa4404a[_0xcfbb('0x1b')]?_0xa4404a[_0xcfbb('0x1b')][_0xcfbb('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x283aed){logger[_0xcfbb('0x1d')](_0xcfbb('0x1e'),_0xa4404a);logger[_0xcfbb('0x11')](_0xcfbb('0x1e'),_0xa4404a,JSON[_0xcfbb('0x12')](_0x283aed));_0x1322ac(_0x283aed);})[_0xcfbb('0x17')](function(_0x20c045){logger[_0xcfbb('0x13')]('CreateChatMessage',_0x20c045['message'],_0xa4404a);_0x2a63c5(_0x3d2715[_0xcfbb('0x13')](0x1f4,_0x20c045[_0xcfbb('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 0275f91..fae2f7a 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 _0x0960=['update','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x44361c,_0x310ea4){var _0x59adb0=function(_0x4d0b42){while(--_0x4d0b42){_0x44361c['push'](_0x44361c['shift']());}};_0x59adb0(++_0x310ea4);}(_0x0960,0xc2));var _0x0096=function(_0x440e0f,_0x47a9c1){_0x440e0f=_0x440e0f-0x0;var _0x216b2b=_0x0960[_0x440e0f];return _0x216b2b;};'use strict';var ChatMessageEvents=require(_0x0096('0x0'));var events=[_0x0096('0x1'),'remove',_0x0096('0x2')];function createListener(_0x1078f3,_0x41a86e){return function(_0x136f7a){_0x41a86e[_0x0096('0x3')](_0x1078f3,_0x136f7a);};}function removeListener(_0xd0d4c6,_0x3ee9fb){return function(){ChatMessageEvents[_0x0096('0x4')](_0xd0d4c6,_0x3ee9fb);};}exports[_0x0096('0x5')]=function(_0x6ea572){for(var _0x59b3cc=0x0,_0x81cc41=events['length'];_0x59b3cc<_0x81cc41;_0x59b3cc++){var _0x1d35f1=events[_0x59b3cc];var _0x44e168=createListener(_0x0096('0x6')+_0x1d35f1,_0x6ea572);ChatMessageEvents['on'](_0x1d35f1,_0x44e168);}};
\ No newline at end of file
+var _0x3831=['removeListener','chatMessage:','./chatMessage.events','remove','update'];(function(_0x14bd4e,_0x57d937){var _0x95efc0=function(_0x3ba244){while(--_0x3ba244){_0x14bd4e['push'](_0x14bd4e['shift']());}};_0x95efc0(++_0x57d937);}(_0x3831,0x14c));var _0x1383=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0x3831[_0x281e5e];return _0x5a22d2;};'use strict';var ChatMessageEvents=require(_0x1383('0x0'));var events=['save',_0x1383('0x1'),_0x1383('0x2')];function createListener(_0x3a25fd,_0x15e6b5){return function(_0x391bef){_0x15e6b5['emit'](_0x3a25fd,_0x391bef);};}function removeListener(_0x2fdf72,_0x573874){return function(){ChatMessageEvents[_0x1383('0x3')](_0x2fdf72,_0x573874);};}exports['register']=function(_0x5b64b1){for(var _0x5eb4d8=0x0,_0x45a030=events['length'];_0x5eb4d8<_0x45a030;_0x5eb4d8++){var _0x187027=events[_0x5eb4d8];var _0x1ddd4c=createListener(_0x1383('0x4')+_0x187027,_0x5b64b1);ChatMessageEvents['on'](_0x187027,_0x1ddd4c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 37403a8..fc00800 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 _0x3749=['delete','destroy','multer','util','connect-timeout','fs-extra','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','/:id','post','tracked','chat','create','put','update','/:id/accept','/:id/reject','reject'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x3749,0x1d0));var _0x9374=function(_0x3f9d5d,_0x4ee8dd){_0x3f9d5d=_0x3f9d5d-0x0;var _0x1b2cd7=_0x3749[_0x3f9d5d];return _0x1b2cd7;};'use strict';var multer=require(_0x9374('0x0'));var util=require(_0x9374('0x1'));var path=require('path');var timeout=require(_0x9374('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9374('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9374('0x4'));var config=require('../../config/environment');var controller=require(_0x9374('0x5'));router[_0x9374('0x6')]('/',auth[_0x9374('0x7')](),controller['index']);router[_0x9374('0x6')](_0x9374('0x8'),auth[_0x9374('0x7')](),controller['describe']);router[_0x9374('0x6')](_0x9374('0x9'),auth[_0x9374('0x7')](),controller['show']);router[_0x9374('0xa')]('/',auth[_0x9374('0x7')](),interaction[_0x9374('0xb')](_0x9374('0xc'),'chatmessage:create'),controller[_0x9374('0xd')]);router[_0x9374('0xe')](_0x9374('0x9'),controller[_0x9374('0xf')]);router[_0x9374('0xe')](_0x9374('0x10'),auth[_0x9374('0x7')](),controller['accept']);router[_0x9374('0xe')](_0x9374('0x11'),auth[_0x9374('0x7')](),controller[_0x9374('0x12')]);router[_0x9374('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x9374('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xb87d=['chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','tracked','chat'];(function(_0x584ef7,_0x53af65){var _0x4fb297=function(_0x4ace4b){while(--_0x4ace4b){_0x584ef7['push'](_0x584ef7['shift']());}};_0x4fb297(++_0x53af65);}(_0xb87d,0x14b));var _0xdb87=function(_0x18b208,_0xc61865){_0x18b208=_0x18b208-0x0;var _0x51c026=_0xb87d[_0x18b208];return _0x51c026;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdb87('0x0'));var timeout=require(_0xdb87('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xdb87('0x2'));var auth=require(_0xdb87('0x3'));var interaction=require(_0xdb87('0x4'));var config=require(_0xdb87('0x5'));var controller=require('./chatMessage.controller');router[_0xdb87('0x6')]('/',auth['isAuthenticated'](),controller[_0xdb87('0x7')]);router[_0xdb87('0x6')](_0xdb87('0x8'),auth[_0xdb87('0x9')](),controller[_0xdb87('0xa')]);router[_0xdb87('0x6')](_0xdb87('0xb'),auth[_0xdb87('0x9')](),controller['show']);router['post']('/',auth[_0xdb87('0x9')](),interaction[_0xdb87('0xc')](_0xdb87('0xd'),_0xdb87('0xe')),controller[_0xdb87('0xf')]);router[_0xdb87('0x10')]('/:id',controller[_0xdb87('0x11')]);router['put'](_0xdb87('0x12'),auth['isAuthenticated'](),controller[_0xdb87('0x13')]);router[_0xdb87('0x10')](_0xdb87('0x14'),auth[_0xdb87('0x9')](),controller['reject']);router[_0xdb87('0x15')](_0xdb87('0xb'),auth[_0xdb87('0x9')](),controller[_0xdb87('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 1a3a530..b3fc340 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 _0xa34a=['medium','sequelize','TEXT'];(function(_0x18fa33,_0xe5bc0b){var _0x460cde=function(_0x557af1){while(--_0x557af1){_0x18fa33['push'](_0x18fa33['shift']());}};_0x460cde(++_0xe5bc0b);}(_0xa34a,0xac));var _0xaa34=function(_0x5c26ab,_0x327f54){_0x5c26ab=_0x5c26ab-0x0;var _0x5b64f3=_0xa34a[_0x5c26ab];return _0x5b64f3;};'use strict';var Sequelize=require(_0xaa34('0x0'));module['exports']={'body':{'type':Sequelize[_0xaa34('0x1')](_0xaa34('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x76b3=['TEXT','sequelize','exports'];(function(_0x27a25c,_0x36f490){var _0x1e8b09=function(_0x43de11){while(--_0x43de11){_0x27a25c['push'](_0x27a25c['shift']());}};_0x1e8b09(++_0x36f490);}(_0x76b3,0x142));var _0x376b=function(_0x27cdf5,_0x46509c){_0x27cdf5=_0x27cdf5-0x0;var _0x530a75=_0x76b3[_0x27cdf5];return _0x530a75;};'use strict';var Sequelize=require(_0x376b('0x0'));module[_0x376b('0x1')]={'body':{'type':Sequelize[_0x376b('0x2')]('medium'),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 0756b8d..bd7f0be 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 _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xf7471d,_0x24bb2b){var _0x3a1ce8=function(_0x42d69d){while(--_0x42d69d){_0xf7471d['push'](_0xf7471d['shift']());}};_0x3a1ce8(++_0x24bb2b);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,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(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x7a54,0x106));var _0x47a5=function(_0x7811e2,_0x5940bc){_0x7811e2=_0x7811e2-0x0;var _0x5493ec=_0x7a54[_0x7811e2];return _0x5493ec;};'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.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 60ad9b3..f403a14 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 _0x243b=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','define','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x20def7,_0x2caec4){var _0xdc6a3e=function(_0x274412){while(--_0x274412){_0x20def7['push'](_0x20def7['shift']());}};_0xdc6a3e(++_0x2caec4);}(_0x243b,0xb3));var _0xb243=function(_0x49eb84,_0x20f3a7){_0x49eb84=_0x49eb84-0x0;var _0x3a5733=_0x243b[_0x49eb84];return _0x3a5733;};'use strict';var _=require(_0xb243('0x0'));var util=require(_0xb243('0x1'));var logger=require(_0xb243('0x2'))('api');var moment=require(_0xb243('0x3'));var BPromise=require(_0xb243('0x4'));var rp=require(_0xb243('0x5'));var fs=require('fs');var path=require(_0xb243('0x6'));var rimraf=require('rimraf');var config=require(_0xb243('0x7'));var attributes=require(_0xb243('0x8'));module['exports']=function(_0x3db848,_0x370c1d){return _0x3db848[_0xb243('0x9')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb243('0xa'),'collate':_0xb243('0xb')});};
\ No newline at end of file
+var _0x87f6=['bluebird','path','rimraf','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x87f6,0xed));var _0x687f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x87f6[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x687f('0x0'))(_0x687f('0x1'));var moment=require(_0x687f('0x2'));var BPromise=require(_0x687f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x687f('0x4'));var rimraf=require(_0x687f('0x5'));var config=require('../../config/environment');var attributes=require(_0x687f('0x6'));module['exports']=function(_0x1111d3,_0x213e56){return _0x1111d3[_0x687f('0x7')](_0x687f('0x8'),attributes,{'tableName':_0x687f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x687f('0xa'),'collate':_0x687f('0xb')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7516954..b51c9f3 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 _0x9de1=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x9de1,0x1ea));var _0x19de=function(_0x38999c,_0x45edd0){_0x38999c=_0x38999c-0x0;var _0x302301=_0x9de1[_0x38999c];return _0x302301;};'use strict';var _=require(_0x19de('0x0'));var util=require(_0x19de('0x1'));var moment=require('moment');var BPromise=require(_0x19de('0x2'));var rs=require(_0x19de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19de('0x4'))['db'];var utils=require(_0x19de('0x5'));var logger=require(_0x19de('0x6'))(_0x19de('0x7'));var config=require('../../config/environment');var jayson=require(_0x19de('0x8'));var client=jayson[_0x19de('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xda6e81,_0x34325d,_0x3588ce){return new BPromise(function(_0xb16bc7,_0xdee01f){return client[_0x19de('0xa')](_0xda6e81,_0x3588ce)[_0x19de('0xb')](function(_0x1acf99){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x34325d,_0x19de('0xc'));logger[_0x19de('0xd')](_0x19de('0xe'),_0x34325d,_0x19de('0xc'),JSON[_0x19de('0xf')](_0x1acf99));if(_0x1acf99['error']){if(_0x1acf99[_0x19de('0x10')]['code']===0x1f4){logger[_0x19de('0x10')](_0x19de('0x11'),_0x34325d,_0x1acf99[_0x19de('0x10')][_0x19de('0x12')]);return _0xdee01f(_0x1acf99['error']['message']);}logger[_0x19de('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x34325d,_0x1acf99[_0x19de('0x10')][_0x19de('0x12')]);return _0xb16bc7(_0x1acf99[_0x19de('0x10')][_0x19de('0x12')]);}else{logger[_0x19de('0x13')](_0x19de('0x11'),_0x34325d,_0x19de('0xc'));_0xb16bc7(_0x1acf99[_0x19de('0x14')][_0x19de('0x12')]);}})['catch'](function(_0x51a70b){logger['error'](_0x19de('0x11'),_0x34325d,_0x51a70b);_0xdee01f(_0x51a70b);});});}
\ No newline at end of file
+var _0x8524=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d8789,_0x3fdff1){var _0x404e41=function(_0x33d5a6){while(--_0x33d5a6){_0x4d8789['push'](_0x4d8789['shift']());}};_0x404e41(++_0x3fdff1);}(_0x8524,0x1d4));var _0x4852=function(_0x39ba93,_0x2b4e10){_0x39ba93=_0x39ba93-0x0;var _0x2986d0=_0x8524[_0x39ba93];return _0x2986d0;};'use strict';var _=require(_0x4852('0x0'));var util=require(_0x4852('0x1'));var moment=require(_0x4852('0x2'));var BPromise=require(_0x4852('0x3'));var rs=require(_0x4852('0x4'));var fs=require('fs');var Redis=require(_0x4852('0x5'));var db=require(_0x4852('0x6'))['db'];var utils=require(_0x4852('0x7'));var logger=require(_0x4852('0x8'))(_0x4852('0x9'));var config=require(_0x4852('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4852('0xb')][_0x4852('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x936949,_0x2d05cd,_0x44cc6b){return new BPromise(function(_0x1e9273,_0x479d9c){return client[_0x4852('0xd')](_0x936949,_0x44cc6b)[_0x4852('0xe')](function(_0x2973f1){logger[_0x4852('0xf')](_0x4852('0x10'),_0x2d05cd,_0x4852('0x11'));logger[_0x4852('0x12')](_0x4852('0x13'),_0x2d05cd,_0x4852('0x11'),JSON['stringify'](_0x2973f1));if(_0x2973f1['error']){if(_0x2973f1[_0x4852('0x14')][_0x4852('0x15')]===0x1f4){logger[_0x4852('0x14')](_0x4852('0x10'),_0x2d05cd,_0x2973f1[_0x4852('0x14')]['message']);return _0x479d9c(_0x2973f1[_0x4852('0x14')]['message']);}logger[_0x4852('0x14')]('ChatOfflineMessage,\x20%s,\x20%s',_0x2d05cd,_0x2973f1[_0x4852('0x14')][_0x4852('0x16')]);return _0x1e9273(_0x2973f1[_0x4852('0x14')][_0x4852('0x16')]);}else{logger[_0x4852('0xf')](_0x4852('0x10'),_0x2d05cd,_0x4852('0x11'));_0x1e9273(_0x2973f1[_0x4852('0x17')][_0x4852('0x16')]);}})[_0x4852('0x18')](function(_0x12f131){logger[_0x4852('0x14')](_0x4852('0x10'),_0x2d05cd,_0x12f131);_0x479d9c(_0x12f131);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index fc5eea9..fd5876f 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 _0x0a2b=['create','put','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','show','post'];(function(_0x5c1a38,_0x1784a2){var _0x35d5fb=function(_0x2bea10){while(--_0x2bea10){_0x5c1a38['push'](_0x5c1a38['shift']());}};_0x35d5fb(++_0x1784a2);}(_0x0a2b,0x81));var _0xb0a2=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x0a2b[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require(_0xb0a2('0x0'));var path=require(_0xb0a2('0x1'));var timeout=require(_0xb0a2('0x2'));var express=require(_0xb0a2('0x3'));var router=express[_0xb0a2('0x4')]();var fs_extra=require(_0xb0a2('0x5'));var auth=require(_0xb0a2('0x6'));var interaction=require(_0xb0a2('0x7'));var config=require(_0xb0a2('0x8'));var controller=require(_0xb0a2('0x9'));router[_0xb0a2('0xa')]('/',auth[_0xb0a2('0xb')](),controller['index']);router[_0xb0a2('0xa')]('/describe',auth[_0xb0a2('0xb')](),controller[_0xb0a2('0xc')]);router['get']('/:id',auth[_0xb0a2('0xb')](),controller[_0xb0a2('0xd')]);router[_0xb0a2('0xe')]('/',auth[_0xb0a2('0xb')](),controller[_0xb0a2('0xf')]);router[_0xb0a2('0x10')]('/:id',auth[_0xb0a2('0xb')](),controller['update']);router['delete']('/:id',auth[_0xb0a2('0xb')](),controller[_0xb0a2('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x126e=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','post','create','put'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x126e,0x1a6));var _0xe126=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x126e[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xe126('0x0'));var util=require(_0xe126('0x1'));var path=require(_0xe126('0x2'));var timeout=require(_0xe126('0x3'));var express=require(_0xe126('0x4'));var router=express[_0xe126('0x5')]();var fs_extra=require(_0xe126('0x6'));var auth=require(_0xe126('0x7'));var interaction=require(_0xe126('0x8'));var config=require(_0xe126('0x9'));var controller=require('./chatOfflineMessage.controller');router[_0xe126('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe126('0xa')](_0xe126('0xb'),auth[_0xe126('0xc')](),controller[_0xe126('0xd')]);router[_0xe126('0xa')](_0xe126('0xe'),auth[_0xe126('0xc')](),controller['show']);router[_0xe126('0xf')]('/',auth[_0xe126('0xc')](),controller[_0xe126('0x10')]);router[_0xe126('0x11')](_0xe126('0xe'),auth[_0xe126('0xc')](),controller['update']);router['delete'](_0xe126('0xe'),auth[_0xe126('0xc')](),controller[_0xe126('0x12')]);module[_0xe126('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 2b1697d..8823285 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 _0x3b39=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x12443d,_0x19d2b2){var _0x24d6e0=function(_0x44e06d){while(--_0x44e06d){_0x12443d['push'](_0x12443d['shift']());}};_0x24d6e0(++_0x19d2b2);}(_0x3b39,0x1c1));var _0x93b3=function(_0x1d0cba,_0x2731b1){_0x1d0cba=_0x1d0cba-0x0;var _0xdc3278=_0x3b39[_0x1d0cba];return _0xdc3278;};'use strict';var Sequelize=require(_0x93b3('0x0'));module['exports']={'name':{'type':Sequelize[_0x93b3('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x93b3('0x2')](_0x93b3('0x3'),_0x93b3('0x4')),'defaultValue':_0x93b3('0x3')},'selector':{'type':Sequelize[_0x93b3('0x1')]},'timeout':{'type':Sequelize[_0x93b3('0x5')]}};
\ No newline at end of file
+var _0x950d=['mouseOver','timeout','STRING','INTEGER','sequelize','ENUM'];(function(_0x51186f,_0x4ddd3f){var _0x2605ff=function(_0x414584){while(--_0x414584){_0x51186f['push'](_0x51186f['shift']());}};_0x2605ff(++_0x4ddd3f);}(_0x950d,0x1e4));var _0xd950=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x950d[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0xd950('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd950('0x1')](_0xd950('0x2'),_0xd950('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xd950('0x4')]},'timeout':{'type':Sequelize[_0xd950('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7b8afdf..16f9e97 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 _0xab86=['end','json','offset','undefined','count','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','include','merge','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status'];(function(_0x31fcb9,_0x350d71){var _0xb1eee9=function(_0x47226f){while(--_0x47226f){_0x31fcb9['push'](_0x31fcb9['shift']());}};_0xb1eee9(++_0x350d71);}(_0xab86,0x13e));var _0x6ab8=function(_0x13d991,_0x1ec93f){_0x13d991=_0x13d991-0x0;var _0x47d0ca=_0xab86[_0x13d991];return _0x47d0ca;};'use strict';var emlformat=require(_0x6ab8('0x0'));var rimraf=require(_0x6ab8('0x1'));var zipdir=require(_0x6ab8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ab8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ab8('0x4'));var util=require('util');var path=require(_0x6ab8('0x5'));var sox=require(_0x6ab8('0x6'));var csv=require(_0x6ab8('0x7'));var ejs=require(_0x6ab8('0x8'));var fs=require('fs');var fs_extra=require(_0x6ab8('0x9'));var _=require(_0x6ab8('0xa'));var squel=require(_0x6ab8('0xb'));var crypto=require(_0x6ab8('0xc'));var jsforce=require(_0x6ab8('0xd'));var deskjs=require(_0x6ab8('0xe'));var toCsv=require(_0x6ab8('0x7'));var querystring=require(_0x6ab8('0xf'));var Papa=require(_0x6ab8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ab8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ab8('0x12'));var logger=require(_0x6ab8('0x13'))(_0x6ab8('0x14'));var utils=require('../../config/utils');var config=require(_0x6ab8('0x15'));var licenseUtil=require(_0x6ab8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44d1d9,_0x1b9b34){_0x1b9b34=_0x1b9b34||0xcc;return function(_0x408ce1){if(_0x408ce1){return _0x44d1d9['sendStatus'](_0x1b9b34);}return _0x44d1d9[_0x6ab8('0x17')](_0x1b9b34)[_0x6ab8('0x18')]();};}function respondWithResult(_0x60b50,_0x968bac){_0x968bac=_0x968bac||0xc8;return function(_0x1c83a1){if(_0x1c83a1){return _0x60b50[_0x6ab8('0x17')](_0x968bac)[_0x6ab8('0x19')](_0x1c83a1);}};}function respondWithFilteredResult(_0x2043bb,_0x293389){return function(_0x5218e9){if(_0x5218e9){var _0x1f64a3=typeof _0x293389[_0x6ab8('0x1a')]===_0x6ab8('0x1b')&&typeof _0x293389['limit']===_0x6ab8('0x1b');var _0x35b790=_0x5218e9['count'];var _0x543726=_0x1f64a3?0x0:_0x293389[_0x6ab8('0x1a')];var _0x57cd18=_0x1f64a3?_0x5218e9[_0x6ab8('0x1c')]:_0x293389[_0x6ab8('0x1a')]+_0x293389[_0x6ab8('0x1d')];var _0x4e0fbd;if(_0x57cd18>=_0x35b790){_0x57cd18=_0x35b790;_0x4e0fbd=0xc8;}else{_0x4e0fbd=0xce;}_0x2043bb[_0x6ab8('0x17')](_0x4e0fbd);return _0x2043bb[_0x6ab8('0x1e')](_0x6ab8('0x1f'),_0x543726+'-'+_0x57cd18+'/'+_0x35b790)[_0x6ab8('0x19')](_0x5218e9);}return null;};}function patchUpdates(_0x5227c6){return function(_0x301004){try{jsonpatch[_0x6ab8('0x20')](_0x301004,_0x5227c6,!![]);}catch(_0x520cd8){return BPromise['reject'](_0x520cd8);}return _0x301004['save']();};}function saveUpdates(_0x190af2,_0x46cfdc){return function(_0xe2d5d8){if(_0xe2d5d8){return _0xe2d5d8['update'](_0x190af2)[_0x6ab8('0x21')](function(_0x433f37){return _0x433f37;});}return null;};}function removeEntity(_0x50fc50,_0x503f94){return function(_0x8af7e9){if(_0x8af7e9){return _0x8af7e9[_0x6ab8('0x22')]()['then'](function(){_0x50fc50[_0x6ab8('0x17')](0xcc)[_0x6ab8('0x18')]();});}};}function handleEntityNotFound(_0x24e400,_0x3d614b){return function(_0x3ddaeb){if(!_0x3ddaeb){_0x24e400[_0x6ab8('0x23')](0x194);}return _0x3ddaeb;};}function handleError(_0x2e098f,_0x1e26ed){_0x1e26ed=_0x1e26ed||0x1f4;return function(_0x5a1be3){logger['error'](_0x5a1be3[_0x6ab8('0x24')]);if(_0x5a1be3['name']){delete _0x5a1be3[_0x6ab8('0x25')];}_0x2e098f[_0x6ab8('0x17')](_0x1e26ed)[_0x6ab8('0x26')](_0x5a1be3);};}exports['show']=function(_0x525687,_0x4871e3){var _0x79dbd3={'raw':!![],'where':{'id':_0x525687[_0x6ab8('0x27')]['id']}},_0x14e822={};_0x14e822[_0x6ab8('0x28')]=_[_0x6ab8('0x29')](db[_0x6ab8('0x2a')][_0x6ab8('0x2b')]);_0x14e822[_0x6ab8('0x2c')]=_[_0x6ab8('0x29')](_0x525687[_0x6ab8('0x2c')]);_0x14e822[_0x6ab8('0x2d')]=_[_0x6ab8('0x2e')](_0x14e822[_0x6ab8('0x28')],_0x14e822['query']);_0x79dbd3['attributes']=_[_0x6ab8('0x2e')](_0x14e822['model'],qs['fields'](_0x525687[_0x6ab8('0x2c')][_0x6ab8('0x2f')]));_0x79dbd3['attributes']=_0x79dbd3[_0x6ab8('0x30')]['length']?_0x79dbd3[_0x6ab8('0x30')]:_0x14e822[_0x6ab8('0x28')];if(_0x525687['query']['includeAll']){_0x79dbd3[_0x6ab8('0x31')]=[{'all':!![]}];}_0x79dbd3=_[_0x6ab8('0x32')]({},_0x79dbd3,_0x525687[_0x6ab8('0x33')]);return db[_0x6ab8('0x2a')][_0x6ab8('0x34')](_0x79dbd3)[_0x6ab8('0x21')](handleEntityNotFound(_0x4871e3,null))[_0x6ab8('0x21')](respondWithResult(_0x4871e3,null))[_0x6ab8('0x35')](handleError(_0x4871e3,null));};exports['create']=function(_0x3f7fa0,_0x3ca7cc){return db[_0x6ab8('0x2a')][_0x6ab8('0x36')](_0x3f7fa0[_0x6ab8('0x37')],{})[_0x6ab8('0x21')](respondWithResult(_0x3ca7cc,0xc9))['catch'](handleError(_0x3ca7cc,null));};exports[_0x6ab8('0x38')]=function(_0x127ceb,_0x29321d){if(_0x127ceb['body']['id']){delete _0x127ceb['body']['id'];}return db[_0x6ab8('0x2a')][_0x6ab8('0x34')]({'where':{'id':_0x127ceb[_0x6ab8('0x27')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0x29321d,null))[_0x6ab8('0x21')](saveUpdates(_0x127ceb['body'],null))['then'](respondWithResult(_0x29321d,null))[_0x6ab8('0x35')](handleError(_0x29321d,null));};exports['destroy']=function(_0x404ff4,_0x9ca6ed){return db['ChatProactiveAction']['find']({'where':{'id':_0x404ff4[_0x6ab8('0x27')]['id']}})[_0x6ab8('0x21')](handleEntityNotFound(_0x9ca6ed,null))[_0x6ab8('0x21')](removeEntity(_0x9ca6ed,null))[_0x6ab8('0x35')](handleError(_0x9ca6ed,null));};
\ No newline at end of file
+var _0xf483=['query','attributes','intersection','model','fields','length','includeAll','merge','options','find','catch','update','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','stack','name','show','params','keys','ChatProactiveAction'];(function(_0x7a595d,_0x4a2711){var _0xa23362=function(_0x12ffa8){while(--_0x12ffa8){_0x7a595d['push'](_0x7a595d['shift']());}};_0xa23362(++_0x4a2711);}(_0xf483,0xf2));var _0x3f48=function(_0x57997d,_0x31ff84){_0x57997d=_0x57997d-0x0;var _0x5f2156=_0xf483[_0x57997d];return _0x5f2156;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f48('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f48('0x1'));var rp=require(_0x3f48('0x2'));var moment=require(_0x3f48('0x3'));var BPromise=require(_0x3f48('0x4'));var Mustache=require(_0x3f48('0x5'));var util=require(_0x3f48('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3f48('0x7'));var fs=require('fs');var fs_extra=require(_0x3f48('0x8'));var _=require('lodash');var squel=require(_0x3f48('0x9'));var crypto=require(_0x3f48('0xa'));var jsforce=require(_0x3f48('0xb'));var deskjs=require(_0x3f48('0xc'));var toCsv=require(_0x3f48('0xd'));var querystring=require(_0x3f48('0xe'));var Papa=require(_0x3f48('0xf'));var Redis=require('ioredis');var authService=require(_0x3f48('0x10'));var qs=require(_0x3f48('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f48('0x12'));var logger=require('../../config/logger')(_0x3f48('0x13'));var utils=require(_0x3f48('0x14'));var config=require(_0x3f48('0x15'));var licenseUtil=require(_0x3f48('0x16'));var db=require(_0x3f48('0x17'))['db'];function respondWithStatusCode(_0x1e9563,_0x38502b){_0x38502b=_0x38502b||0xcc;return function(_0x5867db){if(_0x5867db){return _0x1e9563[_0x3f48('0x18')](_0x38502b);}return _0x1e9563[_0x3f48('0x19')](_0x38502b)['end']();};}function respondWithResult(_0x27ca72,_0x4e1f66){_0x4e1f66=_0x4e1f66||0xc8;return function(_0x101139){if(_0x101139){return _0x27ca72['status'](_0x4e1f66)[_0x3f48('0x1a')](_0x101139);}};}function respondWithFilteredResult(_0x57c489,_0x2a2083){return function(_0x2013b9){if(_0x2013b9){var _0x364032=typeof _0x2a2083['offset']===_0x3f48('0x1b')&&typeof _0x2a2083[_0x3f48('0x1c')]===_0x3f48('0x1b');var _0x6b97bf=_0x2013b9['count'];var _0x211b22=_0x364032?0x0:_0x2a2083[_0x3f48('0x1d')];var _0x14133f=_0x364032?_0x2013b9[_0x3f48('0x1e')]:_0x2a2083[_0x3f48('0x1d')]+_0x2a2083[_0x3f48('0x1c')];var _0x7a962f;if(_0x14133f>=_0x6b97bf){_0x14133f=_0x6b97bf;_0x7a962f=0xc8;}else{_0x7a962f=0xce;}_0x57c489[_0x3f48('0x19')](_0x7a962f);return _0x57c489[_0x3f48('0x1f')](_0x3f48('0x20'),_0x211b22+'-'+_0x14133f+'/'+_0x6b97bf)[_0x3f48('0x1a')](_0x2013b9);}return null;};}function patchUpdates(_0x353a23){return function(_0x108c6e){try{jsonpatch[_0x3f48('0x21')](_0x108c6e,_0x353a23,!![]);}catch(_0x323230){return BPromise[_0x3f48('0x22')](_0x323230);}return _0x108c6e[_0x3f48('0x23')]();};}function saveUpdates(_0x285462,_0x12fcde){return function(_0x12ef86){if(_0x12ef86){return _0x12ef86['update'](_0x285462)['then'](function(_0x3c9d93){return _0x3c9d93;});}return null;};}function removeEntity(_0xa85425,_0x2e569d){return function(_0x56ad7b){if(_0x56ad7b){return _0x56ad7b['destroy']()[_0x3f48('0x24')](function(){_0xa85425[_0x3f48('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30a5f1,_0x2e101d){return function(_0xe2bcb0){if(!_0xe2bcb0){_0x30a5f1[_0x3f48('0x18')](0x194);}return _0xe2bcb0;};}function handleError(_0xd01529,_0x108852){_0x108852=_0x108852||0x1f4;return function(_0x2cf7a9){logger['error'](_0x2cf7a9[_0x3f48('0x25')]);if(_0x2cf7a9[_0x3f48('0x26')]){delete _0x2cf7a9[_0x3f48('0x26')];}_0xd01529[_0x3f48('0x19')](_0x108852)['send'](_0x2cf7a9);};}exports[_0x3f48('0x27')]=function(_0x1e6297,_0x562001){var _0x2a5e3f={'raw':!![],'where':{'id':_0x1e6297[_0x3f48('0x28')]['id']}},_0x33201e={};_0x33201e['model']=_[_0x3f48('0x29')](db[_0x3f48('0x2a')]['rawAttributes']);_0x33201e[_0x3f48('0x2b')]=_[_0x3f48('0x29')](_0x1e6297[_0x3f48('0x2b')]);_0x33201e['filters']=_['intersection'](_0x33201e['model'],_0x33201e[_0x3f48('0x2b')]);_0x2a5e3f[_0x3f48('0x2c')]=_[_0x3f48('0x2d')](_0x33201e[_0x3f48('0x2e')],qs[_0x3f48('0x2f')](_0x1e6297[_0x3f48('0x2b')][_0x3f48('0x2f')]));_0x2a5e3f[_0x3f48('0x2c')]=_0x2a5e3f[_0x3f48('0x2c')][_0x3f48('0x30')]?_0x2a5e3f[_0x3f48('0x2c')]:_0x33201e[_0x3f48('0x2e')];if(_0x1e6297[_0x3f48('0x2b')][_0x3f48('0x31')]){_0x2a5e3f['include']=[{'all':!![]}];}_0x2a5e3f=_[_0x3f48('0x32')]({},_0x2a5e3f,_0x1e6297[_0x3f48('0x33')]);return db['ChatProactiveAction'][_0x3f48('0x34')](_0x2a5e3f)['then'](handleEntityNotFound(_0x562001,null))['then'](respondWithResult(_0x562001,null))['catch'](handleError(_0x562001,null));};exports['create']=function(_0x54d1c8,_0x54a59c){return db[_0x3f48('0x2a')]['create'](_0x54d1c8['body'],{})[_0x3f48('0x24')](respondWithResult(_0x54a59c,0xc9))[_0x3f48('0x35')](handleError(_0x54a59c,null));};exports[_0x3f48('0x36')]=function(_0x2b7935,_0x49d885){if(_0x2b7935[_0x3f48('0x37')]['id']){delete _0x2b7935['body']['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2b7935[_0x3f48('0x28')]['id']}})[_0x3f48('0x24')](handleEntityNotFound(_0x49d885,null))['then'](saveUpdates(_0x2b7935[_0x3f48('0x37')],null))[_0x3f48('0x24')](respondWithResult(_0x49d885,null))[_0x3f48('0x35')](handleError(_0x49d885,null));};exports[_0x3f48('0x38')]=function(_0x4779af,_0x481b82){return db[_0x3f48('0x2a')][_0x3f48('0x34')]({'where':{'id':_0x4779af[_0x3f48('0x28')]['id']}})[_0x3f48('0x24')](handleEntityNotFound(_0x481b82,null))[_0x3f48('0x24')](removeEntity(_0x481b82,null))[_0x3f48('0x35')](handleError(_0x481b82,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 99d9f0c..8e2d29a 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 _0xaf9d=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf9d,0xb0));var _0xdaf9=function(_0x3b575d,_0x12d43f){_0x3b575d=_0x3b575d-0x0;var _0x3972e8=_0xaf9d[_0x3b575d];return _0x3972e8;};'use strict';var _=require(_0xdaf9('0x0'));var util=require(_0xdaf9('0x1'));var logger=require(_0xdaf9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdaf9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaf9('0x4'));var config=require(_0xdaf9('0x5'));var attributes=require(_0xdaf9('0x6'));module[_0xdaf9('0x7')]=function(_0x589e6f,_0x19da50){return _0x589e6f[_0xdaf9('0x8')](_0xdaf9('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x26bd=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x351619,_0xa300e4){var _0x4794b6=function(_0xb270bd){while(--_0xb270bd){_0x351619['push'](_0x351619['shift']());}};_0x4794b6(++_0xa300e4);}(_0x26bd,0x1af));var _0xd26b=function(_0x5d730,_0x560c39){_0x5d730=_0x5d730-0x0;var _0x34d557=_0x26bd[_0x5d730];return _0x34d557;};'use strict';var _=require(_0xd26b('0x0'));var util=require(_0xd26b('0x1'));var logger=require(_0xd26b('0x2'))(_0xd26b('0x3'));var moment=require(_0xd26b('0x4'));var BPromise=require(_0xd26b('0x5'));var rp=require(_0xd26b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd26b('0x7'));var config=require('../../config/environment');var attributes=require(_0xd26b('0x8'));module[_0xd26b('0x9')]=function(_0x6db9b9,_0x13e1e1){return _0x6db9b9[_0xd26b('0xa')](_0xd26b('0xb'),attributes,{'tableName':_0xd26b('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 456c91e..8dd5232 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 _0x3655=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x45cdf1,_0x22ca1a){var _0xbeea4b=function(_0x1939b5){while(--_0x1939b5){_0x45cdf1['push'](_0x45cdf1['shift']());}};_0xbeea4b(++_0x22ca1a);}(_0x3655,0x152));var _0x5365=function(_0x1496bc,_0x369cd5){_0x1496bc=_0x1496bc-0x0;var _0x4f8978=_0x3655[_0x1496bc];return _0x4f8978;};'use strict';var _=require(_0x5365('0x0'));var util=require(_0x5365('0x1'));var moment=require(_0x5365('0x2'));var BPromise=require(_0x5365('0x3'));var rs=require(_0x5365('0x4'));var fs=require('fs');var Redis=require(_0x5365('0x5'));var db=require(_0x5365('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5365('0x7'))(_0x5365('0x8'));var config=require('../../config/environment');var jayson=require(_0x5365('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3259a9,_0x4e0096,_0x17072a){return new BPromise(function(_0x1df10a,_0x5444e6){return client['request'](_0x3259a9,_0x17072a)[_0x5365('0xa')](function(_0x4ce0db){logger[_0x5365('0xb')](_0x5365('0xc'),_0x4e0096,'request\x20sent');logger[_0x5365('0xd')](_0x5365('0xe'),_0x4e0096,_0x5365('0xf'),JSON[_0x5365('0x10')](_0x4ce0db));if(_0x4ce0db[_0x5365('0x11')]){if(_0x4ce0db['error'][_0x5365('0x12')]===0x1f4){logger[_0x5365('0x11')](_0x5365('0xc'),_0x4e0096,_0x4ce0db[_0x5365('0x11')][_0x5365('0x13')]);return _0x5444e6(_0x4ce0db['error']['message']);}logger[_0x5365('0x11')](_0x5365('0xc'),_0x4e0096,_0x4ce0db['error']['message']);return _0x1df10a(_0x4ce0db[_0x5365('0x11')]['message']);}else{logger[_0x5365('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4e0096,_0x5365('0xf'));_0x1df10a(_0x4ce0db[_0x5365('0x14')][_0x5365('0x13')]);}})['catch'](function(_0x162f74){logger[_0x5365('0x11')](_0x5365('0xc'),_0x4e0096,_0x162f74);_0x5444e6(_0x162f74);});});}
\ No newline at end of file
+var _0x4841=['code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error'];(function(_0x189bb0,_0x2b9e11){var _0x5304f2=function(_0x4e0765){while(--_0x4e0765){_0x189bb0['push'](_0x189bb0['shift']());}};_0x5304f2(++_0x2b9e11);}(_0x4841,0xab));var _0x1484=function(_0xda07b2,_0x36b1cb){_0xda07b2=_0xda07b2-0x0;var _0x59bd78=_0x4841[_0xda07b2];return _0x59bd78;};'use strict';var _=require(_0x1484('0x0'));var util=require('util');var moment=require(_0x1484('0x1'));var BPromise=require('bluebird');var rs=require(_0x1484('0x2'));var fs=require('fs');var Redis=require(_0x1484('0x3'));var db=require(_0x1484('0x4'))['db'];var utils=require(_0x1484('0x5'));var logger=require(_0x1484('0x6'))(_0x1484('0x7'));var config=require(_0x1484('0x8'));var jayson=require(_0x1484('0x9'));var client=jayson[_0x1484('0xa')][_0x1484('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52bcdf,_0x32e7fe,_0x4e5d78){return new BPromise(function(_0x1d376f,_0xc65ac3){return client['request'](_0x52bcdf,_0x4e5d78)['then'](function(_0x1e1b2b){logger[_0x1484('0xc')](_0x1484('0xd'),_0x32e7fe,_0x1484('0xe'));logger[_0x1484('0xf')](_0x1484('0x10'),_0x32e7fe,_0x1484('0xe'),JSON['stringify'](_0x1e1b2b));if(_0x1e1b2b[_0x1484('0x11')]){if(_0x1e1b2b[_0x1484('0x11')][_0x1484('0x12')]===0x1f4){logger[_0x1484('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x32e7fe,_0x1e1b2b[_0x1484('0x11')]['message']);return _0xc65ac3(_0x1e1b2b['error'][_0x1484('0x13')]);}logger[_0x1484('0x11')](_0x1484('0xd'),_0x32e7fe,_0x1e1b2b['error'][_0x1484('0x13')]);return _0x1d376f(_0x1e1b2b['error']['message']);}else{logger[_0x1484('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x32e7fe,_0x1484('0xe'));_0x1d376f(_0x1e1b2b['result'][_0x1484('0x13')]);}})[_0x1484('0x14')](function(_0x36c05d){logger['error'](_0x1484('0xd'),_0x32e7fe,_0x36c05d);_0xc65ac3(_0x36c05d);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 8822750..792af3f 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 _0xee14=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x1deb37,_0x378557){var _0x50a1b0=function(_0x4c5baf){while(--_0x4c5baf){_0x1deb37['push'](_0x1deb37['shift']());}};_0x50a1b0(++_0x378557);}(_0xee14,0x13a));var _0x4ee1=function(_0x245de5,_0x14c67b){_0x245de5=_0x245de5-0x0;var _0x36cc78=_0xee14[_0x245de5];return _0x36cc78;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get'](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xa')]);router[_0x4ee1('0xb')]('/',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0xd')]);router[_0x4ee1('0xe')](_0x4ee1('0x9'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')]('/:id',auth[_0x4ee1('0xc')](),controller[_0x4ee1('0x11')]);module[_0x4ee1('0x12')]=router;
\ No newline at end of file
+var _0x2bd8=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','exports'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x2bd8,0x130));var _0x82bd=function(_0x494725,_0xd7e5cf){_0x494725=_0x494725-0x0;var _0x234759=_0x2bd8[_0x494725];return _0x234759;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var fs_extra=require(_0x82bd('0x5'));var auth=require(_0x82bd('0x6'));var interaction=require(_0x82bd('0x7'));var config=require('../../config/environment');var controller=require(_0x82bd('0x8'));router[_0x82bd('0x9')](_0x82bd('0xa'),auth['isAuthenticated'](),controller[_0x82bd('0xb')]);router[_0x82bd('0xc')]('/',auth[_0x82bd('0xd')](),controller[_0x82bd('0xe')]);router['put'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x82bd('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82bd('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 4a393d0..9e853ee 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 _0xfa5f=['roundrobin','exports','STRING','INTEGER','rrmemory'];(function(_0x36f349,_0x895395){var _0xde9e3=function(_0x55c18a){while(--_0x55c18a){_0x36f349['push'](_0x36f349['shift']());}};_0xde9e3(++_0x895395);}(_0xfa5f,0x88));var _0xffa5=function(_0x5bcf88,_0x2ed091){_0x5bcf88=_0x5bcf88-0x0;var _0x5525be=_0xfa5f[_0x5bcf88];return _0x5525be;};'use strict';var Sequelize=require('sequelize');module[_0xffa5('0x0')]={'name':{'type':Sequelize[_0xffa5('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xffa5('0x1')]},'timeout':{'type':Sequelize[_0xffa5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xffa5('0x3'),'beepall',_0xffa5('0x4'))}};
\ No newline at end of file
+var _0x415a=['INTEGER','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x370c3e,_0x399884){var _0x859aff=function(_0x597d86){while(--_0x597d86){_0x370c3e['push'](_0x370c3e['shift']());}};_0x859aff(++_0x399884);}(_0x415a,0x15f));var _0xa415=function(_0xd72856,_0x337fed){_0xd72856=_0xd72856-0x0;var _0x27acf1=_0x415a[_0xd72856];return _0x27acf1;};'use strict';var Sequelize=require(_0xa415('0x0'));module[_0xa415('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa415('0x2')]},'timeout':{'type':Sequelize[_0xa415('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa415('0x4'),'beepall',_0xa415('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index e646eaf..48910ce 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 _0x8c97=['save','destroy','get','ChatQueues','UserProfileResource','stack','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','ChatQueueId','UserChatQueue','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Agents','online','voicePause','interface','each','findOrCreate','userChatQueue:save','removeTeams','Team','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','forEach','emit','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x23c4ca,_0x9f4e93){var _0x279593=function(_0x213f3a){while(--_0x213f3a){_0x23c4ca['push'](_0x23c4ca['shift']());}};_0x279593(++_0x9f4e93);}(_0x8c97,0x19a));var _0x78c9=function(_0x21fb51,_0x2fdd60){_0x21fb51=_0x21fb51-0x0;var _0x340896=_0x8c97[_0x21fb51];return _0x340896;};'use strict';var emlformat=require(_0x78c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x78c9('0x1'));var jsonpatch=require(_0x78c9('0x2'));var rp=require(_0x78c9('0x3'));var moment=require('moment');var BPromise=require(_0x78c9('0x4'));var Mustache=require(_0x78c9('0x5'));var util=require(_0x78c9('0x6'));var path=require('path');var sox=require(_0x78c9('0x7'));var csv=require(_0x78c9('0x8'));var ejs=require(_0x78c9('0x9'));var fs=require('fs');var fs_extra=require(_0x78c9('0xa'));var _=require(_0x78c9('0xb'));var squel=require(_0x78c9('0xc'));var crypto=require('crypto');var jsforce=require(_0x78c9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x78c9('0x8'));var querystring=require(_0x78c9('0xe'));var Papa=require(_0x78c9('0xf'));var Redis=require(_0x78c9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x78c9('0x11'));var as=require(_0x78c9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x78c9('0x13'))(_0x78c9('0x14'));var utils=require(_0x78c9('0x15'));var config=require(_0x78c9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x78c9('0x17')]=_[_0x78c9('0x18')](config[_0x78c9('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x78c9('0x19'))(new Redis(config[_0x78c9('0x17')]));require(_0x78c9('0x1a'))[_0x78c9('0x1b')](socket);var jayson=require(_0x78c9('0x1c'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2a46ab,_0x4facff,_0xfc38f,_0x3bbd8e){return new BPromise(function(_0x19234a,_0x591847){var _0x200bbc=_0x3bbd8e||client;return _0x200bbc[_0x78c9('0x1d')](_0x2a46ab,_0xfc38f)[_0x78c9('0x1e')](function(_0x68243c){logger[_0x78c9('0x1f')]('ChatQueue,\x20%s,\x20%s',_0x4facff,_0x78c9('0x20'));logger[_0x78c9('0x21')](_0x78c9('0x22'),_0x4facff,_0x78c9('0x20'),JSON['stringify'](_0x68243c));if(_0x68243c[_0x78c9('0x23')]){if(_0x68243c[_0x78c9('0x23')][_0x78c9('0x24')]===0x1f4){logger[_0x78c9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4facff,_0x68243c[_0x78c9('0x23')]['message']);return _0x591847(_0x68243c[_0x78c9('0x23')]['message']);}logger[_0x78c9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4facff,_0x68243c['error'][_0x78c9('0x25')]);return _0x19234a(_0x68243c[_0x78c9('0x23')][_0x78c9('0x25')]);}else{logger['info'](_0x78c9('0x26'),_0x4facff,'request\x20sent');_0x19234a(_0x68243c[_0x78c9('0x27')][_0x78c9('0x25')]);}})[_0x78c9('0x28')](function(_0x1490b8){logger[_0x78c9('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4facff,_0x1490b8);_0x591847(_0x1490b8);});});}function respondWithStatusCode(_0xad8756,_0x1fa762){_0x1fa762=_0x1fa762||0xcc;return function(_0x1b0594){if(_0x1b0594){return _0xad8756[_0x78c9('0x29')](_0x1fa762);}return _0xad8756['status'](_0x1fa762)[_0x78c9('0x2a')]();};}function respondWithResult(_0x341b1a,_0x31795f){_0x31795f=_0x31795f||0xc8;return function(_0x32d557){if(_0x32d557){return _0x341b1a[_0x78c9('0x2b')](_0x31795f)[_0x78c9('0x2c')](_0x32d557);}};}function respondWithFilteredResult(_0x442e9b,_0xc4261f){return function(_0x47cd98){if(_0x47cd98){var _0x702c0d=typeof _0xc4261f[_0x78c9('0x2d')]===_0x78c9('0x2e')&&typeof _0xc4261f[_0x78c9('0x2f')]===_0x78c9('0x2e');var _0x43a090=_0x47cd98['count'];var _0x50b01b=_0x702c0d?0x0:_0xc4261f[_0x78c9('0x2d')];var _0x3bd0c4=_0x702c0d?_0x47cd98[_0x78c9('0x30')]:_0xc4261f[_0x78c9('0x2d')]+_0xc4261f[_0x78c9('0x2f')];var _0x590a07;if(_0x3bd0c4>=_0x43a090){_0x3bd0c4=_0x43a090;_0x590a07=0xc8;}else{_0x590a07=0xce;}_0x442e9b[_0x78c9('0x2b')](_0x590a07);return _0x442e9b['set'](_0x78c9('0x31'),_0x50b01b+'-'+_0x3bd0c4+'/'+_0x43a090)['json'](_0x47cd98);}return null;};}function patchUpdates(_0x1f533a){return function(_0xdf267f){try{jsonpatch[_0x78c9('0x32')](_0xdf267f,_0x1f533a,!![]);}catch(_0x50f164){return BPromise[_0x78c9('0x33')](_0x50f164);}return _0xdf267f[_0x78c9('0x34')]();};}function saveUpdates(_0x171fb2,_0x2adf97){return function(_0x1853da){if(_0x1853da){return _0x1853da['update'](_0x171fb2)[_0x78c9('0x1e')](function(_0x1368fa){return _0x1368fa;});}return null;};}function removeEntity(_0xd6d3ff,_0x3ef774){return function(_0x1deea8){if(_0x1deea8){return _0x1deea8[_0x78c9('0x35')]()[_0x78c9('0x1e')](function(){var _0x5b9827=_0x1deea8[_0x78c9('0x36')]({'plain':!![]});var _0x2a9528=_0x78c9('0x37');return db[_0x78c9('0x38')][_0x78c9('0x35')]({'where':{'type':_0x2a9528,'resourceId':_0x5b9827['id']}})[_0x78c9('0x1e')](function(){return _0x1deea8;});})[_0x78c9('0x1e')](function(){_0xd6d3ff[_0x78c9('0x2b')](0xcc)[_0x78c9('0x2a')]();});}};}function handleEntityNotFound(_0x5448eb,_0x174b5e){return function(_0x546c59){if(!_0x546c59){_0x5448eb[_0x78c9('0x29')](0x194);}return _0x546c59;};}function handleError(_0xdb8338,_0x367c91){_0x367c91=_0x367c91||0x1f4;return function(_0x41b809){logger[_0x78c9('0x23')](_0x41b809[_0x78c9('0x39')]);if(_0x41b809['name']){delete _0x41b809['name'];}_0xdb8338[_0x78c9('0x2b')](_0x367c91)['send'](_0x41b809);};}exports['index']=function(_0x4c3c6b,_0x568962){var _0x2c06bc={},_0x35e0c6={},_0x20ff18={'count':0x0,'rows':[]};var _0x14568a=_[_0x78c9('0x3a')](db[_0x78c9('0x3b')][_0x78c9('0x3c')],function(_0x291f09){return{'name':_0x291f09[_0x78c9('0x3d')],'type':_0x291f09[_0x78c9('0x3e')][_0x78c9('0x3f')]};});_0x35e0c6['model']=_['map'](_0x14568a,'name');_0x35e0c6[_0x78c9('0x40')]=_[_0x78c9('0x41')](_0x4c3c6b[_0x78c9('0x40')]);_0x35e0c6[_0x78c9('0x42')]=_[_0x78c9('0x43')](_0x35e0c6[_0x78c9('0x44')],_0x35e0c6[_0x78c9('0x40')]);_0x2c06bc[_0x78c9('0x45')]=_['intersection'](_0x35e0c6[_0x78c9('0x44')],qs[_0x78c9('0x46')](_0x4c3c6b[_0x78c9('0x40')]['fields']));_0x2c06bc[_0x78c9('0x45')]=_0x2c06bc[_0x78c9('0x45')][_0x78c9('0x47')]?_0x2c06bc['attributes']:_0x35e0c6[_0x78c9('0x44')];if(!_0x4c3c6b[_0x78c9('0x40')][_0x78c9('0x48')]('nolimit')){_0x2c06bc[_0x78c9('0x2f')]=qs[_0x78c9('0x2f')](_0x4c3c6b['query'][_0x78c9('0x2f')]);_0x2c06bc[_0x78c9('0x2d')]=qs[_0x78c9('0x2d')](_0x4c3c6b[_0x78c9('0x40')][_0x78c9('0x2d')]);}_0x2c06bc[_0x78c9('0x49')]=qs['sort'](_0x4c3c6b['query'][_0x78c9('0x4a')]);_0x2c06bc['where']=qs[_0x78c9('0x42')](_[_0x78c9('0x4b')](_0x4c3c6b[_0x78c9('0x40')],_0x35e0c6['filters']),_0x14568a);if(_0x4c3c6b[_0x78c9('0x40')]['filter']){_0x2c06bc[_0x78c9('0x4c')]=_[_0x78c9('0x4d')](_0x2c06bc[_0x78c9('0x4c')],{'$or':_[_0x78c9('0x3a')](_0x14568a,function(_0x332c35){if(_0x332c35['type']!=='VIRTUAL'){var _0x45aae0={};_0x45aae0[_0x332c35['name']]={'$like':'%'+_0x4c3c6b[_0x78c9('0x40')][_0x78c9('0x4e')]+'%'};return _0x45aae0;}})});}_0x2c06bc=_[_0x78c9('0x4d')]({},_0x2c06bc,_0x4c3c6b[_0x78c9('0x4f')]);var _0xbae307={'where':_0x2c06bc['where']};return db[_0x78c9('0x3b')]['count'](_0xbae307)[_0x78c9('0x1e')](function(_0x305fac){_0x20ff18[_0x78c9('0x30')]=_0x305fac;if(_0x4c3c6b[_0x78c9('0x40')][_0x78c9('0x50')]){_0x2c06bc[_0x78c9('0x51')]=[{'all':!![]}];}return db[_0x78c9('0x3b')][_0x78c9('0x52')](_0x2c06bc);})[_0x78c9('0x1e')](function(_0x578a4e){_0x20ff18[_0x78c9('0x53')]=_0x578a4e;return _0x20ff18;})[_0x78c9('0x1e')](respondWithFilteredResult(_0x568962,_0x2c06bc))[_0x78c9('0x28')](handleError(_0x568962,null));};exports[_0x78c9('0x54')]=function(_0x28718e,_0x43bd78){var _0x1afb35={'raw':!![],'where':{'id':_0x28718e[_0x78c9('0x55')]['id']}},_0x568515={};_0x568515[_0x78c9('0x44')]=_['keys'](db[_0x78c9('0x3b')][_0x78c9('0x3c')]);_0x568515['query']=_[_0x78c9('0x41')](_0x28718e[_0x78c9('0x40')]);_0x568515[_0x78c9('0x42')]=_[_0x78c9('0x43')](_0x568515[_0x78c9('0x44')],_0x568515[_0x78c9('0x40')]);_0x1afb35[_0x78c9('0x45')]=_[_0x78c9('0x43')](_0x568515[_0x78c9('0x44')],qs['fields'](_0x28718e[_0x78c9('0x40')][_0x78c9('0x46')]));_0x1afb35[_0x78c9('0x45')]=_0x1afb35[_0x78c9('0x45')][_0x78c9('0x47')]?_0x1afb35[_0x78c9('0x45')]:_0x568515[_0x78c9('0x44')];if(_0x28718e[_0x78c9('0x40')][_0x78c9('0x50')]){_0x1afb35[_0x78c9('0x51')]=[{'all':!![]}];}_0x1afb35=_[_0x78c9('0x4d')]({},_0x1afb35,_0x28718e['options']);return db[_0x78c9('0x3b')][_0x78c9('0x56')](_0x1afb35)[_0x78c9('0x1e')](handleEntityNotFound(_0x43bd78,null))[_0x78c9('0x1e')](respondWithResult(_0x43bd78,null))[_0x78c9('0x28')](handleError(_0x43bd78,null));};exports[_0x78c9('0x57')]=function(_0x374808,_0xf831ec){return db[_0x78c9('0x3b')][_0x78c9('0x57')](_0x374808[_0x78c9('0x58')],{})[_0x78c9('0x1e')](function(_0x52f772){var _0x127dc8=_0x374808[_0x78c9('0x59')][_0x78c9('0x36')]({'plain':!![]});if(!_0x127dc8)throw new Error(_0x78c9('0x5a'));if(_0x127dc8['role']===_0x78c9('0x59')){var _0x2e8cf0=_0x52f772[_0x78c9('0x36')]({'plain':!![]});var _0x3f849d=_0x78c9('0x37');return db[_0x78c9('0x5b')]['find']({'where':{'name':_0x3f849d,'userProfileId':_0x127dc8['userProfileId']},'raw':!![]})[_0x78c9('0x1e')](function(_0x3d58f6){if(_0x3d58f6&&_0x3d58f6[_0x78c9('0x5c')]===0x0){return db[_0x78c9('0x38')][_0x78c9('0x57')]({'name':_0x2e8cf0['name'],'resourceId':_0x2e8cf0['id'],'type':_0x3d58f6[_0x78c9('0x5d')],'sectionId':_0x3d58f6['id']},{})[_0x78c9('0x1e')](function(){return _0x52f772;});}else{return _0x52f772;}})[_0x78c9('0x28')](function(_0x4464c9){logger['error'](_0x78c9('0x5e'),_0x4464c9);throw _0x4464c9;});}return _0x52f772;})[_0x78c9('0x1e')](respondWithResult(_0xf831ec,0xc9))[_0x78c9('0x28')](handleError(_0xf831ec,null));};exports[_0x78c9('0x5f')]=function(_0x3d8eec,_0x166d0d){if(_0x3d8eec[_0x78c9('0x58')]['id']){delete _0x3d8eec[_0x78c9('0x58')]['id'];}return db[_0x78c9('0x3b')][_0x78c9('0x56')]({'where':{'id':_0x3d8eec[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](handleEntityNotFound(_0x166d0d,null))[_0x78c9('0x1e')](saveUpdates(_0x3d8eec[_0x78c9('0x58')],null))[_0x78c9('0x1e')](respondWithResult(_0x166d0d,null))[_0x78c9('0x28')](handleError(_0x166d0d,null));};exports['destroy']=function(_0x58032d,_0x32b7e8){return db[_0x78c9('0x3b')][_0x78c9('0x56')]({'where':{'id':_0x58032d[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](handleEntityNotFound(_0x32b7e8,null))[_0x78c9('0x1e')](removeEntity(_0x32b7e8,null))[_0x78c9('0x28')](handleError(_0x32b7e8,null));};exports[_0x78c9('0x60')]=function(_0x12bad1,_0x5c6230){return db[_0x78c9('0x3b')][_0x78c9('0x60')]()[_0x78c9('0x1e')](respondWithResult(_0x5c6230,null))[_0x78c9('0x28')](handleError(_0x5c6230,null));};exports[_0x78c9('0x61')]=function(_0x2f4756,_0xe64bec,_0x52565e){var _0x5c8245={'raw':!![],'where':{}},_0x48138d={},_0x31d4a0;return db['ChatQueue'][_0x78c9('0x62')]({'where':{'id':_0x2f4756[_0x78c9('0x55')]['id']}})['then'](handleEntityNotFound(_0xe64bec,null))['then'](function(_0xba7264){if(_0xba7264){_0x31d4a0=_0xba7264[_0x78c9('0x36')]({'plain':!![]});_0x48138d[_0x78c9('0x44')]=_[_0x78c9('0x41')](db['UserChatQueue']['rawAttributes']);_0x48138d[_0x78c9('0x40')]=_['keys'](_0x2f4756[_0x78c9('0x40')]);_0x48138d[_0x78c9('0x42')]=_[_0x78c9('0x43')](_0x48138d[_0x78c9('0x44')],_0x48138d['query']);_0x5c8245['attributes']=_[_0x78c9('0x43')](_0x48138d[_0x78c9('0x44')],qs[_0x78c9('0x46')](_0x2f4756[_0x78c9('0x40')]['fields']));_0x5c8245['attributes']=_0x5c8245[_0x78c9('0x45')][_0x78c9('0x47')]?_0x5c8245['attributes']:_0x48138d[_0x78c9('0x44')];if(!_0x2f4756[_0x78c9('0x40')][_0x78c9('0x48')]('nolimit')){_0x5c8245[_0x78c9('0x2f')]=qs[_0x78c9('0x2f')](_0x2f4756[_0x78c9('0x40')][_0x78c9('0x2f')]);_0x5c8245[_0x78c9('0x2d')]=qs[_0x78c9('0x2d')](_0x2f4756[_0x78c9('0x40')][_0x78c9('0x2d')]);}_0x5c8245['order']=qs[_0x78c9('0x4a')](_0x2f4756[_0x78c9('0x40')][_0x78c9('0x4a')]);_0x5c8245[_0x78c9('0x4c')]=qs[_0x78c9('0x42')](_[_0x78c9('0x4b')](_0x2f4756[_0x78c9('0x40')],_0x48138d[_0x78c9('0x42')]));_0x5c8245['where'][_0x78c9('0x63')]=_0xba7264['id'];if(_0x2f4756['query'][_0x78c9('0x4e')]){_0x5c8245['where']=_[_0x78c9('0x4d')](_0x5c8245[_0x78c9('0x4c')],{'$or':_['map'](_0x5c8245[_0x78c9('0x45')],function(_0xb40684){var _0x17ad45={};_0x17ad45[_0xb40684]={'$like':'%'+_0x2f4756['query']['filter']+'%'};return _0x17ad45;})});}_0x5c8245=_[_0x78c9('0x4d')]({},_0x5c8245,_0x2f4756[_0x78c9('0x4f')]);return db[_0x78c9('0x64')][_0x78c9('0x52')](_0x5c8245);}})[_0x78c9('0x1e')](function(_0x57df47){if(_0x57df47){return db['User'][_0x78c9('0x65')]({'where':{'id':_['map'](_0x57df47,_0x78c9('0x66')),'role':_0x78c9('0x67')},'attributes':['id',_0x78c9('0x5d'),_0x78c9('0x68'),_0x78c9('0x69'),_0x78c9('0x6a')]});}})[_0x78c9('0x1e')](function(_0x473a41){if(_0x473a41){return{'count':_0x473a41[_0x78c9('0x30')],'rows':_[_0x78c9('0x3a')](_0x473a41[_0x78c9('0x53')],function(_0xe8bb6d){return{'membername':_0xe8bb6d[_0x78c9('0x5d')],'UserId':_0xe8bb6d['id'],'queue_name':_0x31d4a0[_0x78c9('0x5d')],'ChatQueueId':_0x31d4a0['id'],'interface':util[_0x78c9('0x6b')](_0x78c9('0x6c'),_0x78c9('0x6d'),_0xe8bb6d['name']),'penalty':0x0,'paused':_0xe8bb6d['chatPause'],'createdAt':_0xe8bb6d[_0x78c9('0x6a')],'updatedAt':_0xe8bb6d[_0x78c9('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x78c9('0x1e')](respondWithFilteredResult(_0xe64bec,_0x5c8245))[_0x78c9('0x28')](handleError(_0xe64bec,null));};exports[_0x78c9('0x6e')]=function(_0x512ec9,_0x23bf7b,_0x2e33c5){var _0x2cc75a={};var _0x562a34={};var _0x7c4182;var _0x2b42cb;return db[_0x78c9('0x3b')][_0x78c9('0x62')]({'where':{'id':_0x512ec9[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](handleEntityNotFound(_0x23bf7b,null))[_0x78c9('0x1e')](function(_0x3ff031){if(_0x3ff031){_0x7c4182=_0x3ff031;_0x562a34[_0x78c9('0x44')]=_[_0x78c9('0x41')](db['Team']['rawAttributes']);_0x562a34[_0x78c9('0x40')]=_[_0x78c9('0x41')](_0x512ec9['query']);_0x562a34[_0x78c9('0x42')]=_[_0x78c9('0x43')](_0x562a34[_0x78c9('0x44')],_0x562a34[_0x78c9('0x40')]);_0x2cc75a[_0x78c9('0x45')]=_['intersection'](_0x562a34[_0x78c9('0x44')],qs['fields'](_0x512ec9['query']['fields']));_0x2cc75a[_0x78c9('0x45')]=_0x2cc75a[_0x78c9('0x45')][_0x78c9('0x47')]?_0x2cc75a[_0x78c9('0x45')]:_0x562a34[_0x78c9('0x44')];_0x2cc75a[_0x78c9('0x49')]=qs[_0x78c9('0x4a')](_0x512ec9[_0x78c9('0x40')]['sort']);_0x2cc75a[_0x78c9('0x4c')]=qs[_0x78c9('0x42')](_[_0x78c9('0x4b')](_0x512ec9[_0x78c9('0x40')],_0x562a34[_0x78c9('0x42')]));if(_0x512ec9[_0x78c9('0x40')]['filter']){_0x2cc75a[_0x78c9('0x4c')]=_[_0x78c9('0x4d')](_0x2cc75a[_0x78c9('0x4c')],{'$or':_['map'](_0x2cc75a[_0x78c9('0x45')],function(_0x145d6d){var _0x3dde07={};_0x3dde07[_0x145d6d]={'$like':'%'+_0x512ec9[_0x78c9('0x40')][_0x78c9('0x4e')]+'%'};return _0x3dde07;})});}_0x2cc75a=_[_0x78c9('0x4d')]({},_0x2cc75a,_0x512ec9[_0x78c9('0x4f')]);return _0x7c4182[_0x78c9('0x6e')](_0x2cc75a);}})[_0x78c9('0x1e')](function(_0x45de49){if(_0x45de49){_0x2b42cb=_0x45de49[_0x78c9('0x47')];if(!_0x512ec9[_0x78c9('0x40')]['hasOwnProperty']('nolimit')){_0x2cc75a[_0x78c9('0x2f')]=qs[_0x78c9('0x2f')](_0x512ec9['query'][_0x78c9('0x2f')]);_0x2cc75a[_0x78c9('0x2d')]=qs['offset'](_0x512ec9[_0x78c9('0x40')][_0x78c9('0x2d')]);}return _0x7c4182[_0x78c9('0x6e')](_0x2cc75a);}})['then'](function(_0x55c378){if(_0x55c378){return _0x55c378?{'count':_0x2b42cb,'rows':_0x55c378}:null;}})[_0x78c9('0x1e')](respondWithResult(_0x23bf7b,null))[_0x78c9('0x28')](handleError(_0x23bf7b,null));};exports[_0x78c9('0x6f')]=function(_0x1683e0,_0x120385,_0x4258fe){var _0x5c61c9=_0x1683e0[_0x78c9('0x58')][_0x78c9('0x70')];return db['Team'][_0x78c9('0x52')]({'where':{'id':_0x5c61c9},'attributes':['id'],'include':[{'model':db['User'],'as':_0x78c9('0x71'),'attributes':['id',_0x78c9('0x5d'),_0x78c9('0x72'),_0x78c9('0x73'),_0x78c9('0x74')],'raw':!![]}]})[_0x78c9('0x1e')](function(_0x1b342b){if(_0x1b342b){var _0x3e6a25=_['flatMap'](_0x1b342b,function(_0x2ae828){var _0x1623d6=_0x2ae828[_0x78c9('0x36')]({'plain':!![]});return _0x1623d6['Agents'];});return db[_0x78c9('0x3b')][_0x78c9('0x56')]({'where':{'id':_0x1683e0[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](function(_0x3ff5be){return db['sequelize']['transaction'](function(_0x49a1a8){return _0x3ff5be[_0x78c9('0x6f')](_0x5c61c9,{'transaction':_0x49a1a8})[_0x78c9('0x1e')](function(){return BPromise[_0x78c9('0x75')](_0x3e6a25,function(_0xb4b42d){return db[_0x78c9('0x64')][_0x78c9('0x76')]({'where':{'UserId':_0xb4b42d['id'],'ChatQueueId':_0x1683e0[_0x78c9('0x55')]['id']},'transaction':_0x49a1a8});});})['then'](function(){_0x3e6a25['forEach'](function(_0x4c3850){socket['emit'](_0x78c9('0x77'),{'UserId':_0x4c3850['id'],'ChatQueueId':_0x3ff5be['id']});});});});});}})['then'](respondWithStatusCode(_0x120385,null))[_0x78c9('0x28')](handleError(_0x120385,null));};exports[_0x78c9('0x78')]=function(_0x955563,_0x4d625d,_0x1cf7ed){return db[_0x78c9('0x79')][_0x78c9('0x52')]({'where':{'id':_0x955563[_0x78c9('0x40')][_0x78c9('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d625d,null))['then'](function(_0x5426d8){var _0xb085ab=_[_0x78c9('0x3a')](_0x5426d8,'id');var _0x2c5c2a=[];var _0x2d9bac=[];var _0x58f6b8=squel[_0x78c9('0x7a')]();_0x58f6b8[_0x78c9('0x7b')]('tq.TeamId')[_0x78c9('0x7c')](_0x78c9('0x7d'),'tq')[_0x78c9('0x7e')](_0x78c9('0x7f'),'ut',_0x78c9('0x80'))[_0x78c9('0x4c')](_0x78c9('0x81'),_0x955563['params']['id']);for(var _0x23cc0b=0x0;_0x23cc0b<_0x5426d8[_0x78c9('0x47')];_0x23cc0b+=0x1){let _0x25d5bb=_0x5426d8[_0x23cc0b];for(var _0x2d1985=0x0;_0x2d1985<_0x25d5bb[_0x78c9('0x71')][_0x78c9('0x47')];_0x2d1985+=0x1){let _0x52b839=_0x25d5bb[_0x78c9('0x71')][_0x2d1985];var _0x13f288=_0x58f6b8[_0x78c9('0x82')]();_0x13f288[_0x78c9('0x4c')](_0x78c9('0x83'),_0x52b839['id']);_0x2d9bac[_0x78c9('0x84')](db[_0x78c9('0x85')][_0x78c9('0x40')](_0x13f288['toString'](),{'type':db['sequelize'][_0x78c9('0x86')][_0x78c9('0x87')]})['then'](function(_0x4039fc){if(_0x4039fc[_0x78c9('0x47')]===0x1){return _0x52b839['id'];}else{var _0x438699=_[_0x78c9('0x88')](_['map'](_0x4039fc,_0x78c9('0x89')),function(_0x228944){return _[_0x78c9('0x8a')](_0xb085ab,_0x228944);});if(_0x438699){return _0x52b839['id'];}}}));}}return BPromise[_0x78c9('0x8b')](_0x2d9bac)[_0x78c9('0x1e')](function(_0x114574){_0x2c5c2a=_(_0x2c5c2a)[_0x78c9('0x8c')](_0x114574)[_0x78c9('0x8d')]()['value']();return db[_0x78c9('0x3b')]['find']({'where':{'id':_0x955563[_0x78c9('0x55')]['id']}})['then'](function(_0x25d7ad){return db[_0x78c9('0x85')][_0x78c9('0x8e')](function(_0xbab405){return _0x25d7ad['removeTeams'](_0x955563[_0x78c9('0x40')][_0x78c9('0x70')],{'transaction':_0xbab405})['then'](function(){if(!_[_0x78c9('0x8f')](_0x2c5c2a)){return _0x25d7ad['removeAgents'](_0x2c5c2a,{'transaction':_0xbab405});}})[_0x78c9('0x1e')](function(){_0x2c5c2a[_0x78c9('0x90')](function(_0x4eb4b0){socket[_0x78c9('0x91')](_0x78c9('0x92'),{'UserId':_0x4eb4b0,'ChatQueueId':_0x25d7ad['id']});});});});});});})['then'](respondWithStatusCode(_0x4d625d,null))[_0x78c9('0x28')](handleError(_0x4d625d,null));};exports['addAgents']=function(_0x56a706,_0x3e437d,_0x18cbfe){return db[_0x78c9('0x3b')][_0x78c9('0x56')]({'where':{'id':_0x56a706[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](handleEntityNotFound(_0x3e437d,null))[_0x78c9('0x1e')](function(_0x16bc4e){if(_0x16bc4e){return _0x16bc4e[_0x78c9('0x93')](_0x56a706[_0x78c9('0x58')][_0x78c9('0x70')],_[_0x78c9('0x94')](_0x56a706[_0x78c9('0x58')],[_0x78c9('0x70'),'id'])||{})[_0x78c9('0x95')](function(_0x587cf8){for(var _0x66523e=0x0;_0x66523e<_0x56a706[_0x78c9('0x58')]['ids']['length'];_0x66523e+=0x1){socket[_0x78c9('0x91')](_0x78c9('0x77'),{'UserId':Number(_0x56a706[_0x78c9('0x58')][_0x78c9('0x70')][_0x66523e]),'ChatQueueId':Number(_0x56a706[_0x78c9('0x55')]['id'])});}return _0x587cf8;});}})['then'](respondWithResult(_0x3e437d,null))['catch'](handleError(_0x3e437d,null));};exports[_0x78c9('0x96')]=function(_0x5e13d3,_0xe593eb,_0x3f41c6){return db[_0x78c9('0x3b')][_0x78c9('0x56')]({'where':{'id':_0x5e13d3[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](handleEntityNotFound(_0xe593eb,null))[_0x78c9('0x1e')](function(_0x19f2b5){if(_0x19f2b5){return _0x19f2b5[_0x78c9('0x96')](_0x5e13d3[_0x78c9('0x40')]['ids'])[_0x78c9('0x1e')](function(){if(_[_0x78c9('0x97')](_0x5e13d3[_0x78c9('0x40')]['ids'])){for(var _0x756add=0x0;_0x756add<_0x5e13d3[_0x78c9('0x40')]['ids'][_0x78c9('0x47')];_0x756add+=0x1){socket[_0x78c9('0x91')]('userChatQueue:remove',{'UserId':Number(_0x5e13d3[_0x78c9('0x40')][_0x78c9('0x70')][_0x756add]),'ChatQueueId':Number(_0x5e13d3['params']['id'])});}}else{socket[_0x78c9('0x91')](_0x78c9('0x92'),{'UserId':Number(_0x5e13d3[_0x78c9('0x40')][_0x78c9('0x70')]),'ChatQueueId':Number(_0x5e13d3[_0x78c9('0x55')]['id'])});}});}})[_0x78c9('0x1e')](respondWithStatusCode(_0xe593eb,null))[_0x78c9('0x28')](handleError(_0xe593eb,null));};exports[_0x78c9('0x98')]=function(_0x1474a3,_0x37d341,_0x125b69){var _0x149481={};var _0x5083ec={};var _0x4f9fd2;var _0x1df709;return db[_0x78c9('0x3b')][_0x78c9('0x62')]({'where':{'id':_0x1474a3[_0x78c9('0x55')]['id']}})[_0x78c9('0x1e')](handleEntityNotFound(_0x37d341,null))[_0x78c9('0x1e')](function(_0x10414d){if(_0x10414d){_0x4f9fd2=_0x10414d;_0x5083ec[_0x78c9('0x44')]=_[_0x78c9('0x41')](db[_0x78c9('0x99')][_0x78c9('0x3c')]);_0x5083ec[_0x78c9('0x40')]=_[_0x78c9('0x41')](_0x1474a3[_0x78c9('0x40')]);_0x5083ec[_0x78c9('0x42')]=_[_0x78c9('0x43')](_0x5083ec[_0x78c9('0x44')],_0x5083ec[_0x78c9('0x40')]);_0x149481[_0x78c9('0x45')]=_[_0x78c9('0x43')](_0x5083ec[_0x78c9('0x44')],qs['fields'](_0x1474a3[_0x78c9('0x40')][_0x78c9('0x46')]));_0x149481['attributes']=_0x149481[_0x78c9('0x45')]['length']?_0x149481[_0x78c9('0x45')]:_0x5083ec[_0x78c9('0x44')];_0x149481[_0x78c9('0x49')]=qs[_0x78c9('0x4a')](_0x1474a3['query'][_0x78c9('0x4a')]);_0x149481[_0x78c9('0x4c')]=qs[_0x78c9('0x42')](_[_0x78c9('0x4b')](_0x1474a3[_0x78c9('0x40')],_0x5083ec[_0x78c9('0x42')]));if(_0x1474a3[_0x78c9('0x40')][_0x78c9('0x4e')]){_0x149481['where']=_[_0x78c9('0x4d')](_0x149481['where'],{'$or':_[_0x78c9('0x3a')](_0x149481[_0x78c9('0x45')],function(_0xc65269){var _0x348b23={};_0x348b23[_0xc65269]={'$like':'%'+_0x1474a3[_0x78c9('0x40')][_0x78c9('0x4e')]+'%'};return _0x348b23;})});}_0x149481=_['merge']({},_0x149481,_0x1474a3['options']);return _0x4f9fd2[_0x78c9('0x98')](_0x149481);}})[_0x78c9('0x1e')](function(_0x1c37e2){if(_0x1c37e2){_0x1df709=_0x1c37e2['length'];if(!_0x1474a3[_0x78c9('0x40')][_0x78c9('0x48')]('nolimit')){_0x149481[_0x78c9('0x2f')]=qs['limit'](_0x1474a3[_0x78c9('0x40')][_0x78c9('0x2f')]);_0x149481['offset']=qs[_0x78c9('0x2d')](_0x1474a3[_0x78c9('0x40')][_0x78c9('0x2d')]);}return _0x4f9fd2[_0x78c9('0x98')](_0x149481);}})['then'](function(_0x4712f1){if(_0x4712f1){return _0x4712f1?{'count':_0x1df709,'rows':_0x4712f1}:null;}})[_0x78c9('0x1e')](respondWithResult(_0x37d341,null))['catch'](handleError(_0x37d341,null));};
\ No newline at end of file
+var _0x18ac=['describe','getMembers','findOne','hasOwnProperty','order','UserChatQueue','findAndCountAll','UserId','agent','updatedAt','format','SIP','createdAt','getTeams','addTeams','ids','Team','online','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','removeTeams','User','field','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','sendStatus','status','end','offset','limit','count','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','find','create','body','user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x117ab9,_0x45c7b6){var _0x258a48=function(_0xe6e07c){while(--_0xe6e07c){_0x117ab9['push'](_0x117ab9['shift']());}};_0x258a48(++_0x45c7b6);}(_0x18ac,0x1f1));var _0xc18a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x18ac[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xc18a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc18a('0x1'));var jsonpatch=require(_0xc18a('0x2'));var rp=require(_0xc18a('0x3'));var moment=require('moment');var BPromise=require(_0xc18a('0x4'));var Mustache=require(_0xc18a('0x5'));var util=require(_0xc18a('0x6'));var path=require(_0xc18a('0x7'));var sox=require('sox');var csv=require(_0xc18a('0x8'));var ejs=require(_0xc18a('0x9'));var fs=require('fs');var fs_extra=require(_0xc18a('0xa'));var _=require('lodash');var squel=require(_0xc18a('0xb'));var crypto=require(_0xc18a('0xc'));var jsforce=require(_0xc18a('0xd'));var deskjs=require(_0xc18a('0xe'));var toCsv=require(_0xc18a('0x8'));var querystring=require(_0xc18a('0xf'));var Papa=require(_0xc18a('0x10'));var Redis=require(_0xc18a('0x11'));var authService=require(_0xc18a('0x12'));var qs=require(_0xc18a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc18a('0x14'));var logger=require(_0xc18a('0x15'))(_0xc18a('0x16'));var utils=require(_0xc18a('0x17'));var config=require(_0xc18a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc18a('0x19'))['db'];config[_0xc18a('0x1a')]=_[_0xc18a('0x1b')](config[_0xc18a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc18a('0x1c'))(new Redis(config['redis']));require('./chatQueue.socket')[_0xc18a('0x1d')](socket);var jayson=require(_0xc18a('0x1e'));var client=jayson[_0xc18a('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45e434,_0x828e85,_0x28621e,_0x2e788c){return new BPromise(function(_0x251a6e,_0x5757b0){var _0x2d1e47=_0x2e788c||client;return _0x2d1e47[_0xc18a('0x20')](_0x45e434,_0x28621e)['then'](function(_0x2185b7){logger['info'](_0xc18a('0x21'),_0x828e85,_0xc18a('0x22'));logger[_0xc18a('0x23')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x828e85,_0xc18a('0x22'),JSON[_0xc18a('0x24')](_0x2185b7));if(_0x2185b7[_0xc18a('0x25')]){if(_0x2185b7['error']['code']===0x1f4){logger[_0xc18a('0x25')](_0xc18a('0x21'),_0x828e85,_0x2185b7[_0xc18a('0x25')][_0xc18a('0x26')]);return _0x5757b0(_0x2185b7[_0xc18a('0x25')][_0xc18a('0x26')]);}logger[_0xc18a('0x25')]('ChatQueue,\x20%s,\x20%s',_0x828e85,_0x2185b7['error'][_0xc18a('0x26')]);return _0x251a6e(_0x2185b7[_0xc18a('0x25')][_0xc18a('0x26')]);}else{logger[_0xc18a('0x27')]('ChatQueue,\x20%s,\x20%s',_0x828e85,_0xc18a('0x22'));_0x251a6e(_0x2185b7['result'][_0xc18a('0x26')]);}})[_0xc18a('0x28')](function(_0x27067e){logger[_0xc18a('0x25')](_0xc18a('0x21'),_0x828e85,_0x27067e);_0x5757b0(_0x27067e);});});}function respondWithStatusCode(_0x39ee50,_0x2cc7f0){_0x2cc7f0=_0x2cc7f0||0xcc;return function(_0x3d6422){if(_0x3d6422){return _0x39ee50[_0xc18a('0x29')](_0x2cc7f0);}return _0x39ee50[_0xc18a('0x2a')](_0x2cc7f0)[_0xc18a('0x2b')]();};}function respondWithResult(_0x3fd083,_0x2dab78){_0x2dab78=_0x2dab78||0xc8;return function(_0x1bf8bd){if(_0x1bf8bd){return _0x3fd083['status'](_0x2dab78)['json'](_0x1bf8bd);}};}function respondWithFilteredResult(_0x39f525,_0x403b5b){return function(_0x25b69f){if(_0x25b69f){var _0x1cf78b=typeof _0x403b5b[_0xc18a('0x2c')]==='undefined'&&typeof _0x403b5b[_0xc18a('0x2d')]==='undefined';var _0x318f6d=_0x25b69f[_0xc18a('0x2e')];var _0x1d34c5=_0x1cf78b?0x0:_0x403b5b[_0xc18a('0x2c')];var _0x37b8e4=_0x1cf78b?_0x25b69f[_0xc18a('0x2e')]:_0x403b5b[_0xc18a('0x2c')]+_0x403b5b['limit'];var _0x10aaa4;if(_0x37b8e4>=_0x318f6d){_0x37b8e4=_0x318f6d;_0x10aaa4=0xc8;}else{_0x10aaa4=0xce;}_0x39f525['status'](_0x10aaa4);return _0x39f525[_0xc18a('0x2f')](_0xc18a('0x30'),_0x1d34c5+'-'+_0x37b8e4+'/'+_0x318f6d)['json'](_0x25b69f);}return null;};}function patchUpdates(_0xf1e85e){return function(_0x5047f5){try{jsonpatch['apply'](_0x5047f5,_0xf1e85e,!![]);}catch(_0x3da81a){return BPromise[_0xc18a('0x31')](_0x3da81a);}return _0x5047f5['save']();};}function saveUpdates(_0x2c249a,_0x4b76d9){return function(_0x5e39b4){if(_0x5e39b4){return _0x5e39b4[_0xc18a('0x32')](_0x2c249a)['then'](function(_0x98b006){return _0x98b006;});}return null;};}function removeEntity(_0x3f1ad0,_0x31967f){return function(_0x2880c5){if(_0x2880c5){return _0x2880c5[_0xc18a('0x33')]()[_0xc18a('0x34')](function(){var _0x14a79b=_0x2880c5[_0xc18a('0x35')]({'plain':!![]});var _0x2eb3b2='ChatQueues';return db[_0xc18a('0x36')]['destroy']({'where':{'type':_0x2eb3b2,'resourceId':_0x14a79b['id']}})[_0xc18a('0x34')](function(){return _0x2880c5;});})['then'](function(){_0x3f1ad0[_0xc18a('0x2a')](0xcc)[_0xc18a('0x2b')]();});}};}function handleEntityNotFound(_0x27f41c,_0x36996e){return function(_0x2fe8e6){if(!_0x2fe8e6){_0x27f41c['sendStatus'](0x194);}return _0x2fe8e6;};}function handleError(_0x226230,_0xf2904c){_0xf2904c=_0xf2904c||0x1f4;return function(_0x10c88a){logger['error'](_0x10c88a[_0xc18a('0x37')]);if(_0x10c88a[_0xc18a('0x38')]){delete _0x10c88a[_0xc18a('0x38')];}_0x226230[_0xc18a('0x2a')](_0xf2904c)[_0xc18a('0x39')](_0x10c88a);};}exports[_0xc18a('0x3a')]=function(_0x200484,_0x3a1f00){var _0x487b7b={},_0x2ec37f={},_0x1e561e={'count':0x0,'rows':[]};var _0x3700e6=_[_0xc18a('0x3b')](db[_0xc18a('0x3c')][_0xc18a('0x3d')],function(_0x541a50){return{'name':_0x541a50[_0xc18a('0x3e')],'type':_0x541a50[_0xc18a('0x3f')][_0xc18a('0x40')]};});_0x2ec37f['model']=_[_0xc18a('0x3b')](_0x3700e6,_0xc18a('0x38'));_0x2ec37f[_0xc18a('0x41')]=_[_0xc18a('0x42')](_0x200484['query']);_0x2ec37f[_0xc18a('0x43')]=_[_0xc18a('0x44')](_0x2ec37f[_0xc18a('0x45')],_0x2ec37f[_0xc18a('0x41')]);_0x487b7b[_0xc18a('0x46')]=_[_0xc18a('0x44')](_0x2ec37f[_0xc18a('0x45')],qs['fields'](_0x200484[_0xc18a('0x41')][_0xc18a('0x47')]));_0x487b7b['attributes']=_0x487b7b['attributes'][_0xc18a('0x48')]?_0x487b7b[_0xc18a('0x46')]:_0x2ec37f['model'];if(!_0x200484[_0xc18a('0x41')]['hasOwnProperty'](_0xc18a('0x49'))){_0x487b7b[_0xc18a('0x2d')]=qs['limit'](_0x200484[_0xc18a('0x41')][_0xc18a('0x2d')]);_0x487b7b[_0xc18a('0x2c')]=qs[_0xc18a('0x2c')](_0x200484[_0xc18a('0x41')][_0xc18a('0x2c')]);}_0x487b7b['order']=qs[_0xc18a('0x4a')](_0x200484[_0xc18a('0x41')]['sort']);_0x487b7b[_0xc18a('0x4b')]=qs[_0xc18a('0x43')](_[_0xc18a('0x4c')](_0x200484[_0xc18a('0x41')],_0x2ec37f[_0xc18a('0x43')]),_0x3700e6);if(_0x200484['query'][_0xc18a('0x4d')]){_0x487b7b[_0xc18a('0x4b')]=_[_0xc18a('0x4e')](_0x487b7b[_0xc18a('0x4b')],{'$or':_[_0xc18a('0x3b')](_0x3700e6,function(_0x181769){if(_0x181769[_0xc18a('0x3f')]!=='VIRTUAL'){var _0x560d92={};_0x560d92[_0x181769['name']]={'$like':'%'+_0x200484[_0xc18a('0x41')][_0xc18a('0x4d')]+'%'};return _0x560d92;}})});}_0x487b7b=_[_0xc18a('0x4e')]({},_0x487b7b,_0x200484[_0xc18a('0x4f')]);var _0x149470={'where':_0x487b7b[_0xc18a('0x4b')]};return db[_0xc18a('0x3c')][_0xc18a('0x2e')](_0x149470)[_0xc18a('0x34')](function(_0x4d2459){_0x1e561e[_0xc18a('0x2e')]=_0x4d2459;if(_0x200484['query']['includeAll']){_0x487b7b[_0xc18a('0x50')]=[{'all':!![]}];}return db[_0xc18a('0x3c')][_0xc18a('0x51')](_0x487b7b);})['then'](function(_0x2a20ff){_0x1e561e[_0xc18a('0x52')]=_0x2a20ff;return _0x1e561e;})[_0xc18a('0x34')](respondWithFilteredResult(_0x3a1f00,_0x487b7b))['catch'](handleError(_0x3a1f00,null));};exports[_0xc18a('0x53')]=function(_0x14d365,_0x5f03fc){var _0x51f092={'raw':!![],'where':{'id':_0x14d365[_0xc18a('0x54')]['id']}},_0x5ad1d8={};_0x5ad1d8[_0xc18a('0x45')]=_[_0xc18a('0x42')](db[_0xc18a('0x3c')]['rawAttributes']);_0x5ad1d8[_0xc18a('0x41')]=_[_0xc18a('0x42')](_0x14d365[_0xc18a('0x41')]);_0x5ad1d8[_0xc18a('0x43')]=_[_0xc18a('0x44')](_0x5ad1d8[_0xc18a('0x45')],_0x5ad1d8[_0xc18a('0x41')]);_0x51f092['attributes']=_[_0xc18a('0x44')](_0x5ad1d8[_0xc18a('0x45')],qs[_0xc18a('0x47')](_0x14d365[_0xc18a('0x41')][_0xc18a('0x47')]));_0x51f092[_0xc18a('0x46')]=_0x51f092['attributes'][_0xc18a('0x48')]?_0x51f092[_0xc18a('0x46')]:_0x5ad1d8[_0xc18a('0x45')];if(_0x14d365[_0xc18a('0x41')]['includeAll']){_0x51f092['include']=[{'all':!![]}];}_0x51f092=_[_0xc18a('0x4e')]({},_0x51f092,_0x14d365[_0xc18a('0x4f')]);return db[_0xc18a('0x3c')][_0xc18a('0x55')](_0x51f092)['then'](handleEntityNotFound(_0x5f03fc,null))['then'](respondWithResult(_0x5f03fc,null))['catch'](handleError(_0x5f03fc,null));};exports[_0xc18a('0x56')]=function(_0x1c32c0,_0x533dd5){return db[_0xc18a('0x3c')][_0xc18a('0x56')](_0x1c32c0[_0xc18a('0x57')],{})['then'](function(_0x3a46ec){var _0x105ce0=_0x1c32c0[_0xc18a('0x58')][_0xc18a('0x35')]({'plain':!![]});if(!_0x105ce0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x105ce0[_0xc18a('0x59')]===_0xc18a('0x58')){var _0xe0da19=_0x3a46ec[_0xc18a('0x35')]({'plain':!![]});var _0xaa4314=_0xc18a('0x5a');return db[_0xc18a('0x5b')]['find']({'where':{'name':_0xaa4314,'userProfileId':_0x105ce0[_0xc18a('0x5c')]},'raw':!![]})[_0xc18a('0x34')](function(_0x1f5d43){if(_0x1f5d43&&_0x1f5d43[_0xc18a('0x5d')]===0x0){return db['UserProfileResource'][_0xc18a('0x56')]({'name':_0xe0da19['name'],'resourceId':_0xe0da19['id'],'type':_0x1f5d43[_0xc18a('0x38')],'sectionId':_0x1f5d43['id']},{})['then'](function(){return _0x3a46ec;});}else{return _0x3a46ec;}})[_0xc18a('0x28')](function(_0x22b294){logger[_0xc18a('0x25')](_0xc18a('0x5e'),_0x22b294);throw _0x22b294;});}return _0x3a46ec;})[_0xc18a('0x34')](respondWithResult(_0x533dd5,0xc9))[_0xc18a('0x28')](handleError(_0x533dd5,null));};exports[_0xc18a('0x32')]=function(_0x3b2ed3,_0x25c500){if(_0x3b2ed3[_0xc18a('0x57')]['id']){delete _0x3b2ed3[_0xc18a('0x57')]['id'];}return db[_0xc18a('0x3c')][_0xc18a('0x55')]({'where':{'id':_0x3b2ed3[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](handleEntityNotFound(_0x25c500,null))['then'](saveUpdates(_0x3b2ed3[_0xc18a('0x57')],null))[_0xc18a('0x34')](respondWithResult(_0x25c500,null))[_0xc18a('0x28')](handleError(_0x25c500,null));};exports[_0xc18a('0x33')]=function(_0xebf0f1,_0x498628){return db['ChatQueue']['find']({'where':{'id':_0xebf0f1[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](handleEntityNotFound(_0x498628,null))[_0xc18a('0x34')](removeEntity(_0x498628,null))[_0xc18a('0x28')](handleError(_0x498628,null));};exports[_0xc18a('0x5f')]=function(_0x3e1ea6,_0x47ef0f){return db[_0xc18a('0x3c')][_0xc18a('0x5f')]()[_0xc18a('0x34')](respondWithResult(_0x47ef0f,null))['catch'](handleError(_0x47ef0f,null));};exports[_0xc18a('0x60')]=function(_0x1e0cc9,_0x46cc7d,_0x878500){var _0x5da8a4={'raw':!![],'where':{}},_0x580070={},_0x51579b;return db[_0xc18a('0x3c')][_0xc18a('0x61')]({'where':{'id':_0x1e0cc9[_0xc18a('0x54')]['id']}})['then'](handleEntityNotFound(_0x46cc7d,null))[_0xc18a('0x34')](function(_0x14a66c){if(_0x14a66c){_0x51579b=_0x14a66c['get']({'plain':!![]});_0x580070[_0xc18a('0x45')]=_[_0xc18a('0x42')](db['UserChatQueue'][_0xc18a('0x3d')]);_0x580070[_0xc18a('0x41')]=_['keys'](_0x1e0cc9[_0xc18a('0x41')]);_0x580070['filters']=_['intersection'](_0x580070[_0xc18a('0x45')],_0x580070['query']);_0x5da8a4[_0xc18a('0x46')]=_[_0xc18a('0x44')](_0x580070[_0xc18a('0x45')],qs[_0xc18a('0x47')](_0x1e0cc9['query']['fields']));_0x5da8a4[_0xc18a('0x46')]=_0x5da8a4[_0xc18a('0x46')]['length']?_0x5da8a4[_0xc18a('0x46')]:_0x580070[_0xc18a('0x45')];if(!_0x1e0cc9[_0xc18a('0x41')][_0xc18a('0x62')](_0xc18a('0x49'))){_0x5da8a4[_0xc18a('0x2d')]=qs[_0xc18a('0x2d')](_0x1e0cc9[_0xc18a('0x41')]['limit']);_0x5da8a4[_0xc18a('0x2c')]=qs[_0xc18a('0x2c')](_0x1e0cc9['query'][_0xc18a('0x2c')]);}_0x5da8a4[_0xc18a('0x63')]=qs[_0xc18a('0x4a')](_0x1e0cc9['query'][_0xc18a('0x4a')]);_0x5da8a4[_0xc18a('0x4b')]=qs[_0xc18a('0x43')](_[_0xc18a('0x4c')](_0x1e0cc9[_0xc18a('0x41')],_0x580070['filters']));_0x5da8a4[_0xc18a('0x4b')]['ChatQueueId']=_0x14a66c['id'];if(_0x1e0cc9[_0xc18a('0x41')][_0xc18a('0x4d')]){_0x5da8a4[_0xc18a('0x4b')]=_[_0xc18a('0x4e')](_0x5da8a4[_0xc18a('0x4b')],{'$or':_['map'](_0x5da8a4[_0xc18a('0x46')],function(_0x3a921c){var _0x360f56={};_0x360f56[_0x3a921c]={'$like':'%'+_0x1e0cc9['query'][_0xc18a('0x4d')]+'%'};return _0x360f56;})});}_0x5da8a4=_['merge']({},_0x5da8a4,_0x1e0cc9[_0xc18a('0x4f')]);return db[_0xc18a('0x64')][_0xc18a('0x51')](_0x5da8a4);}})['then'](function(_0xedcf58){if(_0xedcf58){return db['User'][_0xc18a('0x65')]({'where':{'id':_[_0xc18a('0x3b')](_0xedcf58,_0xc18a('0x66')),'role':_0xc18a('0x67')},'attributes':['id','name','chatPause',_0xc18a('0x68'),'createdAt']});}})[_0xc18a('0x34')](function(_0x214c4e){if(_0x214c4e){return{'count':_0x214c4e['count'],'rows':_[_0xc18a('0x3b')](_0x214c4e[_0xc18a('0x52')],function(_0xf49886){return{'membername':_0xf49886[_0xc18a('0x38')],'UserId':_0xf49886['id'],'queue_name':_0x51579b[_0xc18a('0x38')],'ChatQueueId':_0x51579b['id'],'interface':util[_0xc18a('0x69')]('%s/%s',_0xc18a('0x6a'),_0xf49886['name']),'penalty':0x0,'paused':_0xf49886['chatPause'],'createdAt':_0xf49886[_0xc18a('0x6b')],'updatedAt':_0xf49886[_0xc18a('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc18a('0x34')](respondWithFilteredResult(_0x46cc7d,_0x5da8a4))[_0xc18a('0x28')](handleError(_0x46cc7d,null));};exports[_0xc18a('0x6c')]=function(_0x3f060d,_0x4588c3,_0x48169a){var _0x2bdcf3={};var _0x2ff530={};var _0x2a554b;var _0x3ac6a9;return db['ChatQueue']['findOne']({'where':{'id':_0x3f060d['params']['id']}})['then'](handleEntityNotFound(_0x4588c3,null))['then'](function(_0x206298){if(_0x206298){_0x2a554b=_0x206298;_0x2ff530[_0xc18a('0x45')]=_[_0xc18a('0x42')](db['Team'][_0xc18a('0x3d')]);_0x2ff530[_0xc18a('0x41')]=_['keys'](_0x3f060d[_0xc18a('0x41')]);_0x2ff530[_0xc18a('0x43')]=_[_0xc18a('0x44')](_0x2ff530[_0xc18a('0x45')],_0x2ff530['query']);_0x2bdcf3[_0xc18a('0x46')]=_['intersection'](_0x2ff530[_0xc18a('0x45')],qs[_0xc18a('0x47')](_0x3f060d[_0xc18a('0x41')][_0xc18a('0x47')]));_0x2bdcf3['attributes']=_0x2bdcf3[_0xc18a('0x46')]['length']?_0x2bdcf3[_0xc18a('0x46')]:_0x2ff530[_0xc18a('0x45')];_0x2bdcf3[_0xc18a('0x63')]=qs[_0xc18a('0x4a')](_0x3f060d['query'][_0xc18a('0x4a')]);_0x2bdcf3[_0xc18a('0x4b')]=qs[_0xc18a('0x43')](_[_0xc18a('0x4c')](_0x3f060d[_0xc18a('0x41')],_0x2ff530['filters']));if(_0x3f060d[_0xc18a('0x41')]['filter']){_0x2bdcf3[_0xc18a('0x4b')]=_['merge'](_0x2bdcf3[_0xc18a('0x4b')],{'$or':_['map'](_0x2bdcf3[_0xc18a('0x46')],function(_0x252fae){var _0x4b1fd0={};_0x4b1fd0[_0x252fae]={'$like':'%'+_0x3f060d[_0xc18a('0x41')][_0xc18a('0x4d')]+'%'};return _0x4b1fd0;})});}_0x2bdcf3=_[_0xc18a('0x4e')]({},_0x2bdcf3,_0x3f060d[_0xc18a('0x4f')]);return _0x2a554b[_0xc18a('0x6c')](_0x2bdcf3);}})['then'](function(_0x5ba05f){if(_0x5ba05f){_0x3ac6a9=_0x5ba05f[_0xc18a('0x48')];if(!_0x3f060d['query'][_0xc18a('0x62')](_0xc18a('0x49'))){_0x2bdcf3['limit']=qs[_0xc18a('0x2d')](_0x3f060d[_0xc18a('0x41')][_0xc18a('0x2d')]);_0x2bdcf3['offset']=qs[_0xc18a('0x2c')](_0x3f060d[_0xc18a('0x41')]['offset']);}return _0x2a554b[_0xc18a('0x6c')](_0x2bdcf3);}})[_0xc18a('0x34')](function(_0x2ee54a){if(_0x2ee54a){return _0x2ee54a?{'count':_0x3ac6a9,'rows':_0x2ee54a}:null;}})[_0xc18a('0x34')](respondWithResult(_0x4588c3,null))['catch'](handleError(_0x4588c3,null));};exports[_0xc18a('0x6d')]=function(_0x526d03,_0x171453,_0x25b07e){var _0x2f4d3b=_0x526d03[_0xc18a('0x57')][_0xc18a('0x6e')];return db[_0xc18a('0x6f')][_0xc18a('0x51')]({'where':{'id':_0x2f4d3b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xc18a('0x38'),_0xc18a('0x70'),'voicePause','interface'],'raw':!![]}]})[_0xc18a('0x34')](function(_0x3d38bc){if(_0x3d38bc){var _0x312ba0=_[_0xc18a('0x71')](_0x3d38bc,function(_0x31cf57){var _0x2d1782=_0x31cf57[_0xc18a('0x35')]({'plain':!![]});return _0x2d1782[_0xc18a('0x72')];});return db[_0xc18a('0x3c')][_0xc18a('0x55')]({'where':{'id':_0x526d03[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](function(_0x50107c){return db[_0xc18a('0x73')][_0xc18a('0x74')](function(_0x2d17e7){return _0x50107c[_0xc18a('0x6d')](_0x2f4d3b,{'transaction':_0x2d17e7})[_0xc18a('0x34')](function(){return BPromise[_0xc18a('0x75')](_0x312ba0,function(_0x378c25){return db['UserChatQueue'][_0xc18a('0x76')]({'where':{'UserId':_0x378c25['id'],'ChatQueueId':_0x526d03['params']['id']},'transaction':_0x2d17e7});});})[_0xc18a('0x34')](function(){_0x312ba0['forEach'](function(_0x35e966){socket[_0xc18a('0x77')]('userChatQueue:save',{'UserId':_0x35e966['id'],'ChatQueueId':_0x50107c['id']});});});});});}})[_0xc18a('0x34')](respondWithStatusCode(_0x171453,null))[_0xc18a('0x28')](handleError(_0x171453,null));};exports[_0xc18a('0x78')]=function(_0x52568d,_0x54b1ce,_0x3d3e8e){return db['Team'][_0xc18a('0x51')]({'where':{'id':_0x52568d[_0xc18a('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0xc18a('0x79')],'as':_0xc18a('0x72'),'attributes':['id'],'raw':!![]}]})[_0xc18a('0x34')](handleEntityNotFound(_0x54b1ce,null))[_0xc18a('0x34')](function(_0x5094f1){var _0x364c1c=_[_0xc18a('0x3b')](_0x5094f1,'id');var _0x290484=[];var _0x3a9bc5=[];var _0x4cf789=squel['select']();_0x4cf789[_0xc18a('0x7a')]('tq.TeamId')['from'](_0xc18a('0x7b'),'tq')[_0xc18a('0x7c')](_0xc18a('0x7d'),'ut',_0xc18a('0x7e'))['where'](_0xc18a('0x7f'),_0x52568d[_0xc18a('0x54')]['id']);for(var _0x1a096e=0x0;_0x1a096e<_0x5094f1[_0xc18a('0x48')];_0x1a096e+=0x1){let _0x1868dd=_0x5094f1[_0x1a096e];for(var _0x27889b=0x0;_0x27889b<_0x1868dd[_0xc18a('0x72')][_0xc18a('0x48')];_0x27889b+=0x1){let _0x3c3c04=_0x1868dd['Agents'][_0x27889b];var _0x363477=_0x4cf789['clone']();_0x363477[_0xc18a('0x4b')](_0xc18a('0x80'),_0x3c3c04['id']);_0x3a9bc5[_0xc18a('0x81')](db[_0xc18a('0x73')][_0xc18a('0x41')](_0x363477[_0xc18a('0x82')](),{'type':db['sequelize'][_0xc18a('0x83')][_0xc18a('0x84')]})[_0xc18a('0x34')](function(_0x10ca5c){if(_0x10ca5c[_0xc18a('0x48')]===0x1){return _0x3c3c04['id'];}else{var _0x3b2a17=_[_0xc18a('0x85')](_[_0xc18a('0x3b')](_0x10ca5c,_0xc18a('0x86')),function(_0x615a31){return _[_0xc18a('0x87')](_0x364c1c,_0x615a31);});if(_0x3b2a17){return _0x3c3c04['id'];}}}));}}return BPromise['all'](_0x3a9bc5)[_0xc18a('0x34')](function(_0x130efb){_0x290484=_(_0x290484)[_0xc18a('0x88')](_0x130efb)[_0xc18a('0x89')]()[_0xc18a('0x8a')]();return db[_0xc18a('0x3c')][_0xc18a('0x55')]({'where':{'id':_0x52568d[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](function(_0x372bdb){return db[_0xc18a('0x73')]['transaction'](function(_0x15871b){return _0x372bdb[_0xc18a('0x78')](_0x52568d[_0xc18a('0x41')][_0xc18a('0x6e')],{'transaction':_0x15871b})[_0xc18a('0x34')](function(){if(!_[_0xc18a('0x8b')](_0x290484)){return _0x372bdb[_0xc18a('0x8c')](_0x290484,{'transaction':_0x15871b});}})[_0xc18a('0x34')](function(){_0x290484[_0xc18a('0x8d')](function(_0x43e2e2){socket[_0xc18a('0x77')]('userChatQueue:remove',{'UserId':_0x43e2e2,'ChatQueueId':_0x372bdb['id']});});});});});});})['then'](respondWithStatusCode(_0x54b1ce,null))[_0xc18a('0x28')](handleError(_0x54b1ce,null));};exports[_0xc18a('0x8e')]=function(_0x302117,_0x2ee8c4,_0x53df15){return db[_0xc18a('0x3c')][_0xc18a('0x55')]({'where':{'id':_0x302117[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](handleEntityNotFound(_0x2ee8c4,null))[_0xc18a('0x34')](function(_0xfc052d){if(_0xfc052d){return _0xfc052d[_0xc18a('0x8e')](_0x302117[_0xc18a('0x57')]['ids'],_[_0xc18a('0x8f')](_0x302117['body'],[_0xc18a('0x6e'),'id'])||{})['spread'](function(_0x47ba23){for(var _0x37707b=0x0;_0x37707b<_0x302117[_0xc18a('0x57')][_0xc18a('0x6e')][_0xc18a('0x48')];_0x37707b+=0x1){socket[_0xc18a('0x77')](_0xc18a('0x90'),{'UserId':Number(_0x302117[_0xc18a('0x57')]['ids'][_0x37707b]),'ChatQueueId':Number(_0x302117[_0xc18a('0x54')]['id'])});}return _0x47ba23;});}})[_0xc18a('0x34')](respondWithResult(_0x2ee8c4,null))[_0xc18a('0x28')](handleError(_0x2ee8c4,null));};exports[_0xc18a('0x8c')]=function(_0x23571d,_0x1e2938,_0x4feb11){return db['ChatQueue'][_0xc18a('0x55')]({'where':{'id':_0x23571d[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](handleEntityNotFound(_0x1e2938,null))[_0xc18a('0x34')](function(_0x5e621f){if(_0x5e621f){return _0x5e621f[_0xc18a('0x8c')](_0x23571d[_0xc18a('0x41')]['ids'])[_0xc18a('0x34')](function(){if(_[_0xc18a('0x91')](_0x23571d[_0xc18a('0x41')][_0xc18a('0x6e')])){for(var _0x16d8d2=0x0;_0x16d8d2<_0x23571d['query']['ids'][_0xc18a('0x48')];_0x16d8d2+=0x1){socket[_0xc18a('0x77')](_0xc18a('0x92'),{'UserId':Number(_0x23571d[_0xc18a('0x41')][_0xc18a('0x6e')][_0x16d8d2]),'ChatQueueId':Number(_0x23571d[_0xc18a('0x54')]['id'])});}}else{socket['emit'](_0xc18a('0x92'),{'UserId':Number(_0x23571d[_0xc18a('0x41')][_0xc18a('0x6e')]),'ChatQueueId':Number(_0x23571d['params']['id'])});}});}})[_0xc18a('0x34')](respondWithStatusCode(_0x1e2938,null))[_0xc18a('0x28')](handleError(_0x1e2938,null));};exports[_0xc18a('0x93')]=function(_0x541eef,_0x2deb4c,_0x2065a4){var _0x28912f={};var _0x513495={};var _0x38c4ef;var _0x49be50;return db[_0xc18a('0x3c')][_0xc18a('0x61')]({'where':{'id':_0x541eef[_0xc18a('0x54')]['id']}})[_0xc18a('0x34')](handleEntityNotFound(_0x2deb4c,null))['then'](function(_0xdeacc1){if(_0xdeacc1){_0x38c4ef=_0xdeacc1;_0x513495['model']=_['keys'](db[_0xc18a('0x79')][_0xc18a('0x3d')]);_0x513495[_0xc18a('0x41')]=_[_0xc18a('0x42')](_0x541eef[_0xc18a('0x41')]);_0x513495[_0xc18a('0x43')]=_[_0xc18a('0x44')](_0x513495['model'],_0x513495[_0xc18a('0x41')]);_0x28912f[_0xc18a('0x46')]=_[_0xc18a('0x44')](_0x513495[_0xc18a('0x45')],qs[_0xc18a('0x47')](_0x541eef[_0xc18a('0x41')]['fields']));_0x28912f[_0xc18a('0x46')]=_0x28912f['attributes'][_0xc18a('0x48')]?_0x28912f['attributes']:_0x513495['model'];_0x28912f[_0xc18a('0x63')]=qs[_0xc18a('0x4a')](_0x541eef[_0xc18a('0x41')][_0xc18a('0x4a')]);_0x28912f[_0xc18a('0x4b')]=qs[_0xc18a('0x43')](_['pick'](_0x541eef[_0xc18a('0x41')],_0x513495['filters']));if(_0x541eef['query'][_0xc18a('0x4d')]){_0x28912f[_0xc18a('0x4b')]=_[_0xc18a('0x4e')](_0x28912f['where'],{'$or':_['map'](_0x28912f['attributes'],function(_0x71093e){var _0x2d4e85={};_0x2d4e85[_0x71093e]={'$like':'%'+_0x541eef[_0xc18a('0x41')][_0xc18a('0x4d')]+'%'};return _0x2d4e85;})});}_0x28912f=_['merge']({},_0x28912f,_0x541eef['options']);return _0x38c4ef[_0xc18a('0x93')](_0x28912f);}})['then'](function(_0x2ead44){if(_0x2ead44){_0x49be50=_0x2ead44['length'];if(!_0x541eef[_0xc18a('0x41')][_0xc18a('0x62')](_0xc18a('0x49'))){_0x28912f['limit']=qs['limit'](_0x541eef[_0xc18a('0x41')][_0xc18a('0x2d')]);_0x28912f[_0xc18a('0x2c')]=qs['offset'](_0x541eef[_0xc18a('0x41')][_0xc18a('0x2c')]);}return _0x38c4ef[_0xc18a('0x93')](_0x28912f);}})[_0xc18a('0x34')](function(_0x4ac78e){if(_0x4ac78e){return _0x4ac78e?{'count':_0x49be50,'rows':_0x4ac78e}:null;}})[_0xc18a('0x34')](respondWithResult(_0x2deb4c,null))[_0xc18a('0x28')](handleError(_0x2deb4c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index ec5010a..5f9cbcd 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 _0x9ff2=['save','update','remove','emit','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x3468a7,_0x277414){var _0x3c567b=function(_0x3ae5e7){while(--_0x3ae5e7){_0x3468a7['push'](_0x3468a7['shift']());}};_0x3c567b(++_0x277414);}(_0x9ff2,0x14a));var _0x29ff=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x9ff2[_0x5c3c0b];return _0x52ecd2;};'use strict';var EventEmitter=require(_0x29ff('0x0'));var ChatQueue=require(_0x29ff('0x1'))['db'][_0x29ff('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29ff('0x3'),'afterUpdate':_0x29ff('0x4'),'afterDestroy':_0x29ff('0x5')};function emitEvent(_0x5804ba){return function(_0x5b573f,_0x5d681c,_0xee1ae3){ChatQueueEvents[_0x29ff('0x6')](_0x5804ba+':'+_0x5b573f['id'],_0x5b573f);ChatQueueEvents['emit'](_0x5804ba,_0x5b573f);_0xee1ae3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x29ff('0x7')](e,emitEvent(event));}}module[_0x29ff('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xa4d3=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4d3,0x1d3));var _0x3a4d=function(_0x32d950,_0xb49e40){_0x32d950=_0x32d950-0x0;var _0x4ce275=_0xa4d3[_0x32d950];return _0x4ce275;};'use strict';var EventEmitter=require(_0x3a4d('0x0'));var ChatQueue=require(_0x3a4d('0x1'))['db'][_0x3a4d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3a4d('0x3'),'afterUpdate':_0x3a4d('0x4'),'afterDestroy':_0x3a4d('0x5')};function emitEvent(_0x34b3cf){return function(_0x565bd0,_0xd0ad79,_0x2391b0){ChatQueueEvents['emit'](_0x34b3cf+':'+_0x565bd0['id'],_0x565bd0);ChatQueueEvents[_0x3a4d('0x6')](_0x34b3cf,_0x565bd0);_0x2391b0(null);};}for(var e in events){if(events[_0x3a4d('0x7')](e)){var event=events[e];ChatQueue[_0x3a4d('0x8')](e,emitEvent(event));}}module[_0x3a4d('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index a40f1c0..d667d5a 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 _0x90ae=['ChatQueue','chat_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x9d2bdc,_0x4f2b6a){var _0x410615=function(_0x56b661){while(--_0x56b661){_0x9d2bdc['push'](_0x9d2bdc['shift']());}};_0x410615(++_0x4f2b6a);}(_0x90ae,0x106));var _0xe90a=function(_0x3ed4da,_0x2a4fdd){_0x3ed4da=_0x3ed4da-0x0;var _0x5b7f61=_0x90ae[_0x3ed4da];return _0x5b7f61;};'use strict';var _=require('lodash');var util=require(_0xe90a('0x0'));var logger=require(_0xe90a('0x1'))(_0xe90a('0x2'));var moment=require('moment');var BPromise=require(_0xe90a('0x3'));var rp=require(_0xe90a('0x4'));var fs=require('fs');var path=require(_0xe90a('0x5'));var rimraf=require(_0xe90a('0x6'));var config=require(_0xe90a('0x7'));var attributes=require(_0xe90a('0x8'));module[_0xe90a('0x9')]=function(_0xb69bf4,_0x2e6cfd){return _0xb69bf4[_0xe90a('0xa')](_0xe90a('0xb'),attributes,{'tableName':_0xe90a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4dab=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util'];(function(_0x7fdad7,_0xe88c38){var _0x26e175=function(_0x49ea5c){while(--_0x49ea5c){_0x7fdad7['push'](_0x7fdad7['shift']());}};_0x26e175(++_0xe88c38);}(_0x4dab,0x1a3));var _0xb4da=function(_0x3b037b,_0x1be37a){_0x3b037b=_0x3b037b-0x0;var _0x4ece31=_0x4dab[_0x3b037b];return _0x4ece31;};'use strict';var _=require('lodash');var util=require(_0xb4da('0x0'));var logger=require(_0xb4da('0x1'))('api');var moment=require(_0xb4da('0x2'));var BPromise=require(_0xb4da('0x3'));var rp=require(_0xb4da('0x4'));var fs=require('fs');var path=require(_0xb4da('0x5'));var rimraf=require(_0xb4da('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4da('0x7'));module[_0xb4da('0x8')]=function(_0x281e76,_0x8bafc7){return _0x281e76[_0xb4da('0x9')](_0xb4da('0xa'),attributes,{'tableName':_0xb4da('0xb'),'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 b1307ff..ae25fa4 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 _0x0419=['socket.io-emitter','./chatQueue.socket','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','limit','include','model','attributes','map','then','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x4e1d7d,_0x5a7761){var _0x53f086=function(_0x3bd510){while(--_0x3bd510){_0x4e1d7d['push'](_0x4e1d7d['shift']());}};_0x53f086(++_0x5a7761);}(_0x0419,0x153));var _0x9041=function(_0x39f237,_0x20c4be){_0x39f237=_0x39f237-0x0;var _0x3fb158=_0x0419[_0x39f237];return _0x3fb158;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9041('0x0'));var BPromise=require(_0x9041('0x1'));var rs=require(_0x9041('0x2'));var fs=require('fs');var Redis=require(_0x9041('0x3'));var db=require(_0x9041('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9041('0x5'));var config=require(_0x9041('0x6'));var jayson=require(_0x9041('0x7'));var client=jayson[_0x9041('0x8')]['http']({'port':0x232a});config[_0x9041('0x9')]=_[_0x9041('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9041('0xb'))(new Redis(config[_0x9041('0x9')]));require(_0x9041('0xc'))['register'](socket);function respondWithRpcPromise(_0x33b812,_0x4d0aaf,_0x22487){return new BPromise(function(_0x2964e9,_0x992570){return client['request'](_0x33b812,_0x22487)['then'](function(_0x473271){logger[_0x9041('0xd')]('ChatQueue,\x20%s,\x20%s',_0x4d0aaf,'request\x20sent');logger[_0x9041('0xe')](_0x9041('0xf'),_0x4d0aaf,_0x9041('0x10'),JSON[_0x9041('0x11')](_0x473271));if(_0x473271[_0x9041('0x12')]){if(_0x473271[_0x9041('0x12')][_0x9041('0x13')]===0x1f4){logger[_0x9041('0x12')](_0x9041('0x14'),_0x4d0aaf,_0x473271[_0x9041('0x12')][_0x9041('0x15')]);return _0x992570(_0x473271['error']['message']);}logger['error'](_0x9041('0x14'),_0x4d0aaf,_0x473271[_0x9041('0x12')][_0x9041('0x15')]);return _0x2964e9(_0x473271['error'][_0x9041('0x15')]);}else{logger[_0x9041('0xd')](_0x9041('0x14'),_0x4d0aaf,'request\x20sent');_0x2964e9(_0x473271[_0x9041('0x16')][_0x9041('0x15')]);}})[_0x9041('0x17')](function(_0x36a5c2){logger[_0x9041('0x12')](_0x9041('0x14'),_0x4d0aaf,_0x36a5c2);_0x992570(_0x36a5c2);});});}exports[_0x9041('0x18')]=function(_0x2f52e0){var _0x5cff96=this;return new Promise(function(_0x3d527b,_0xa8ee07){return db[_0x9041('0x19')]['findAll']({'raw':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1b')]===undefined?!![]:![]:!![],'where':_0x2f52e0['options']?_0x2f52e0[_0x9041('0x1a')]['where']||null:null,'attributes':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')]['attributes']||null:null,'limit':_0x2f52e0['options']?_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1c')]||null:null,'include':_0x2f52e0[_0x9041('0x1a')]?_0x2f52e0[_0x9041('0x1a')]['include']?_['map'](_0x2f52e0[_0x9041('0x1a')][_0x9041('0x1d')],function(_0x11401a){return{'model':db[_0x11401a[_0x9041('0x1e')]],'as':_0x11401a['as'],'attributes':_0x11401a[_0x9041('0x1f')],'include':_0x11401a['include']?_[_0x9041('0x20')](_0x11401a[_0x9041('0x1d')],function(_0x57a1db){return{'model':db[_0x57a1db[_0x9041('0x1e')]],'as':_0x57a1db['as'],'attributes':_0x57a1db[_0x9041('0x1f')],'include':_0x57a1db[_0x9041('0x1d')]?_[_0x9041('0x20')](_0x57a1db[_0x9041('0x1d')],function(_0x462620){return{'model':db[_0x462620[_0x9041('0x1e')]],'as':_0x462620['as'],'attributes':_0x462620[_0x9041('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9041('0x21')](function(_0xd3861e){logger[_0x9041('0xd')](_0x9041('0x18'),_0x2f52e0);logger[_0x9041('0xe')](_0x9041('0x18'),_0x2f52e0,JSON[_0x9041('0x11')](_0xd3861e));_0x3d527b(_0xd3861e);})[_0x9041('0x17')](function(_0x4fee5f){logger[_0x9041('0x12')](_0x9041('0x18'),_0x4fee5f[_0x9041('0x15')],_0x2f52e0);_0xa8ee07(_0x5cff96['error'](0x1f4,_0x4fee5f[_0x9041('0x15')]));});});};exports[_0x9041('0x22')]=function(_0x21c3d5){var _0x3c31e8=this;return new Promise(function(_0x2ea40a,_0x3370b0){return db['ChatQueue']['find']({'raw':_0x21c3d5['options']?_0x21c3d5['options'][_0x9041('0x1b')]===undefined?!![]:![]:!![],'where':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5['options']['where']||null:null,'attributes':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5[_0x9041('0x1a')][_0x9041('0x1f')]||null:null,'include':_0x21c3d5[_0x9041('0x1a')]?_0x21c3d5[_0x9041('0x1a')][_0x9041('0x1d')]?_['map'](_0x21c3d5['options']['include'],function(_0x152b15){return{'model':db[_0x152b15['model']],'as':_0x152b15['as'],'attributes':_0x152b15['attributes'],'include':_0x152b15[_0x9041('0x1d')]?_[_0x9041('0x20')](_0x152b15[_0x9041('0x1d')],function(_0xc22135){return{'model':db[_0xc22135[_0x9041('0x1e')]],'as':_0xc22135['as'],'attributes':_0xc22135[_0x9041('0x1f')],'include':_0xc22135[_0x9041('0x1d')]?_['map'](_0xc22135[_0x9041('0x1d')],function(_0x23b91e){return{'model':db[_0x23b91e[_0x9041('0x1e')]],'as':_0x23b91e['as'],'attributes':_0x23b91e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9041('0x21')](function(_0xe21f3){logger[_0x9041('0xd')]('ShowChatQueue',_0x21c3d5);logger[_0x9041('0xe')](_0x9041('0x22'),_0x21c3d5,JSON[_0x9041('0x11')](_0xe21f3));_0x2ea40a(_0xe21f3);})['catch'](function(_0x3745c0){logger[_0x9041('0x12')](_0x9041('0x22'),_0x3745c0[_0x9041('0x15')],_0x21c3d5);_0x3370b0(_0x3c31e8[_0x9041('0x12')](0x1f4,_0x3745c0[_0x9041('0x15')]));});});};
\ No newline at end of file
+var _0x34b7=['code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4204b0,_0xb1d9c4){var _0x2afcce=function(_0x682d04){while(--_0x682d04){_0x4204b0['push'](_0x4204b0['shift']());}};_0x2afcce(++_0xb1d9c4);}(_0x34b7,0x196));var _0x734b=function(_0xc80702,_0x18ef50){_0xc80702=_0xc80702-0x0;var _0x4c4c76=_0x34b7[_0xc80702];return _0x4c4c76;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});config[_0x734b('0xa')]=_[_0x734b('0xb')](config['redis'],{'host':_0x734b('0xc'),'port':0x18eb});var socket=require(_0x734b('0xd'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x19a88e,_0x598dee,_0x43c5e0){return new BPromise(function(_0x333738,_0x2860a2){return client[_0x734b('0xe')](_0x19a88e,_0x43c5e0)[_0x734b('0xf')](function(_0x16e451){logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));logger[_0x734b('0x13')](_0x734b('0x14'),_0x598dee,_0x734b('0x12'),JSON[_0x734b('0x15')](_0x16e451));if(_0x16e451[_0x734b('0x16')]){if(_0x16e451['error'][_0x734b('0x17')]===0x1f4){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x2860a2(_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);}logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x16e451[_0x734b('0x16')][_0x734b('0x18')]);return _0x333738(_0x16e451['error'][_0x734b('0x18')]);}else{logger[_0x734b('0x10')](_0x734b('0x11'),_0x598dee,_0x734b('0x12'));_0x333738(_0x16e451['result']['message']);}})[_0x734b('0x19')](function(_0x3033cd){logger[_0x734b('0x16')](_0x734b('0x11'),_0x598dee,_0x3033cd);_0x2860a2(_0x3033cd);});});}exports[_0x734b('0x1a')]=function(_0xfe567d){var _0x1c68c4=this;return new Promise(function(_0x6572ee,_0x67eed){return db[_0x734b('0x1b')][_0x734b('0x1c')]({'raw':_0xfe567d[_0x734b('0x1d')]?_0xfe567d[_0x734b('0x1d')][_0x734b('0x1e')]===undefined?!![]:![]:!![],'where':_0xfe567d['options']?_0xfe567d[_0x734b('0x1d')][_0x734b('0x1f')]||null:null,'attributes':_0xfe567d['options']?_0xfe567d[_0x734b('0x1d')][_0x734b('0x20')]||null:null,'limit':_0xfe567d[_0x734b('0x1d')]?_0xfe567d[_0x734b('0x1d')][_0x734b('0x21')]||null:null,'include':_0xfe567d[_0x734b('0x1d')]?_0xfe567d[_0x734b('0x1d')][_0x734b('0x22')]?_[_0x734b('0x23')](_0xfe567d[_0x734b('0x1d')][_0x734b('0x22')],function(_0x148abe){return{'model':db[_0x148abe[_0x734b('0x24')]],'as':_0x148abe['as'],'attributes':_0x148abe['attributes'],'include':_0x148abe['include']?_[_0x734b('0x23')](_0x148abe[_0x734b('0x22')],function(_0x47a0a9){return{'model':db[_0x47a0a9[_0x734b('0x24')]],'as':_0x47a0a9['as'],'attributes':_0x47a0a9[_0x734b('0x20')],'include':_0x47a0a9[_0x734b('0x22')]?_[_0x734b('0x23')](_0x47a0a9[_0x734b('0x22')],function(_0x1b8295){return{'model':db[_0x1b8295[_0x734b('0x24')]],'as':_0x1b8295['as'],'attributes':_0x1b8295['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0xf')](function(_0x436efe){logger[_0x734b('0x10')](_0x734b('0x1a'),_0xfe567d);logger[_0x734b('0x13')](_0x734b('0x1a'),_0xfe567d,JSON[_0x734b('0x15')](_0x436efe));_0x6572ee(_0x436efe);})[_0x734b('0x19')](function(_0x371ead){logger[_0x734b('0x16')]('GetChatQueue',_0x371ead[_0x734b('0x18')],_0xfe567d);_0x67eed(_0x1c68c4[_0x734b('0x16')](0x1f4,_0x371ead['message']));});});};exports[_0x734b('0x25')]=function(_0x3cfce2){var _0xf4ef21=this;return new Promise(function(_0x2fe7d5,_0x21cb04){return db[_0x734b('0x1b')][_0x734b('0x26')]({'raw':_0x3cfce2[_0x734b('0x1d')]?_0x3cfce2[_0x734b('0x1d')][_0x734b('0x1e')]===undefined?!![]:![]:!![],'where':_0x3cfce2[_0x734b('0x1d')]?_0x3cfce2[_0x734b('0x1d')][_0x734b('0x1f')]||null:null,'attributes':_0x3cfce2[_0x734b('0x1d')]?_0x3cfce2[_0x734b('0x1d')]['attributes']||null:null,'include':_0x3cfce2[_0x734b('0x1d')]?_0x3cfce2['options'][_0x734b('0x22')]?_[_0x734b('0x23')](_0x3cfce2[_0x734b('0x1d')][_0x734b('0x22')],function(_0x19f94d){return{'model':db[_0x19f94d[_0x734b('0x24')]],'as':_0x19f94d['as'],'attributes':_0x19f94d['attributes'],'include':_0x19f94d['include']?_[_0x734b('0x23')](_0x19f94d['include'],function(_0x3cc627){return{'model':db[_0x3cc627['model']],'as':_0x3cc627['as'],'attributes':_0x3cc627[_0x734b('0x20')],'include':_0x3cc627['include']?_[_0x734b('0x23')](_0x3cc627['include'],function(_0x37d891){return{'model':db[_0x37d891[_0x734b('0x24')]],'as':_0x37d891['as'],'attributes':_0x37d891[_0x734b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x734b('0xf')](function(_0x37876a){logger[_0x734b('0x10')](_0x734b('0x25'),_0x3cfce2);logger['debug'](_0x734b('0x25'),_0x3cfce2,JSON[_0x734b('0x15')](_0x37876a));_0x2fe7d5(_0x37876a);})['catch'](function(_0x3752c5){logger[_0x734b('0x16')](_0x734b('0x25'),_0x3752c5[_0x734b('0x18')],_0x3cfce2);_0x21cb04(_0xf4ef21['error'](0x1f4,_0x3752c5[_0x734b('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 4adac29..c361fd6 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 _0x4b84=['./chatQueue.events','save','emit','length'];(function(_0x44995f,_0x532a52){var _0x4476a2=function(_0x4aa0f6){while(--_0x4aa0f6){_0x44995f['push'](_0x44995f['shift']());}};_0x4476a2(++_0x532a52);}(_0x4b84,0x1cc));var _0x44b8=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x4b84[_0x408e38];return _0x426b0e;};'use strict';var ChatQueueEvents=require(_0x44b8('0x0'));var events=[_0x44b8('0x1'),'remove','update'];function createListener(_0x765943,_0x519db3){return function(_0x4b8ad8){_0x519db3[_0x44b8('0x2')](_0x765943,_0x4b8ad8);};}function removeListener(_0x31282a,_0x39ad16){return function(){ChatQueueEvents['removeListener'](_0x31282a,_0x39ad16);};}exports['register']=function(_0x55f25d){for(var _0x996a8b=0x0,_0x54274b=events[_0x44b8('0x3')];_0x996a8b<_0x54274b;_0x996a8b++){var _0x5947f7=events[_0x996a8b];var _0x3e87c5=createListener('chatQueue:'+_0x5947f7,_0x55f25d);ChatQueueEvents['on'](_0x5947f7,_0x3e87c5);}};
\ No newline at end of file
+var _0xe14d=['update','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x4e363a,_0x1d8602){var _0xd1aedd=function(_0x3b5a3a){while(--_0x3b5a3a){_0x4e363a['push'](_0x4e363a['shift']());}};_0xd1aedd(++_0x1d8602);}(_0xe14d,0x1ee));var _0xde14=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xe14d[_0x13ce0c];return _0x4388fb;};'use strict';var ChatQueueEvents=require(_0xde14('0x0'));var events=[_0xde14('0x1'),_0xde14('0x2'),_0xde14('0x3')];function createListener(_0x48b392,_0x1c5b4){return function(_0x28965b){_0x1c5b4['emit'](_0x48b392,_0x28965b);};}function removeListener(_0x1c3e94,_0x13c24e){return function(){ChatQueueEvents[_0xde14('0x4')](_0x1c3e94,_0x13c24e);};}exports[_0xde14('0x5')]=function(_0x461af3){for(var _0xba1514=0x0,_0x4b1f6b=events['length'];_0xba1514<_0x4b1f6b;_0xba1514++){var _0x1bd49d=events[_0xba1514];var _0x115b7d=createListener(_0xde14('0x6')+_0x1bd49d,_0x461af3);ChatQueueEvents['on'](_0x1bd49d,_0x115b7d);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 8215463..580c045 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x30bcf1,_0x30c2db){var _0x150883=function(_0x130930){while(--_0x130930){_0x30bcf1['push'](_0x30bcf1['shift']());}};_0x150883(++_0x30c2db);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+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(_0x2b50be,_0x4e3d61){var _0x212cd4=function(_0x1a7b87){while(--_0x1a7b87){_0x2b50be['push'](_0x2b50be['shift']());}};_0x212cd4(++_0x4e3d61);}(_0xe14b,0x93));var _0xbe14=function(_0x5a4f92,_0x484a7c){_0x5a4f92=_0x5a4f92-0x0;var _0x427813=_0xe14b[_0x5a4f92];return _0x427813;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b2dc50e..3449c43 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 _0x890f=['DATE','sequelize','exports','STRING'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x890f,0x1a1));var _0xf890=function(_0x42225e,_0x1164f2){_0x42225e=_0x42225e-0x0;var _0x2bf9e5=_0x890f[_0x42225e];return _0x2bf9e5;};'use strict';var moment=require('moment');var Sequelize=require(_0xf890('0x0'));module[_0xf890('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf890('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf890('0x3')]},'acceptAt':{'type':Sequelize[_0xf890('0x3')]},'exitAt':{'type':Sequelize[_0xf890('0x3')]},'reason':{'type':Sequelize[_0xf890('0x2')]}};
\ No newline at end of file
+var _0x77b7=['moment','exports','STRING','DATE'];(function(_0x4879c8,_0x560eba){var _0x56661d=function(_0x5a830b){while(--_0x5a830b){_0x4879c8['push'](_0x4879c8['shift']());}};_0x56661d(++_0x560eba);}(_0x77b7,0x178));var _0x777b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x77b7[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x777b('0x0'));var Sequelize=require('sequelize');module[_0x777b('0x1')]={'uniqueid':{'type':Sequelize[_0x777b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x777b('0x2')]},'joinAt':{'type':Sequelize[_0x777b('0x3')]},'leaveAt':{'type':Sequelize[_0x777b('0x3')]},'acceptAt':{'type':Sequelize[_0x777b('0x3')]},'exitAt':{'type':Sequelize[_0x777b('0x3')]},'reason':{'type':Sequelize[_0x777b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index bfec721..aebbf4e 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 _0xa24d=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','ChatQueueReport','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format'];(function(_0x505bfb,_0xe48938){var _0x3bca12=function(_0x1fb16f){while(--_0x1fb16f){_0x505bfb['push'](_0x505bfb['shift']());}};_0x3bca12(++_0xe48938);}(_0xa24d,0x1c1));var _0xda24=function(_0x1d38e0,_0x23dcaf){_0x1d38e0=_0x1d38e0-0x0;var _0x26e31b=_0xa24d[_0x1d38e0];return _0x26e31b;};'use strict';var emlformat=require(_0xda24('0x0'));var rimraf=require(_0xda24('0x1'));var zipdir=require(_0xda24('0x2'));var jsonpatch=require(_0xda24('0x3'));var rp=require(_0xda24('0x4'));var moment=require(_0xda24('0x5'));var BPromise=require(_0xda24('0x6'));var Mustache=require('mustache');var util=require(_0xda24('0x7'));var path=require(_0xda24('0x8'));var sox=require(_0xda24('0x9'));var csv=require(_0xda24('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda24('0xb'));var _=require(_0xda24('0xc'));var squel=require('squel');var crypto=require(_0xda24('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda24('0xe'));var toCsv=require(_0xda24('0xa'));var querystring=require(_0xda24('0xf'));var Papa=require(_0xda24('0x10'));var Redis=require('ioredis');var authService=require(_0xda24('0x11'));var qs=require(_0xda24('0x12'));var as=require(_0xda24('0x13'));var hardwareService=require(_0xda24('0x14'));var logger=require(_0xda24('0x15'))('api');var utils=require(_0xda24('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda24('0x17'));var db=require(_0xda24('0x18'))['db'];function respondWithStatusCode(_0x519fb9,_0x54b23d){_0x54b23d=_0x54b23d||0xcc;return function(_0x2e3505){if(_0x2e3505){return _0x519fb9[_0xda24('0x19')](_0x54b23d);}return _0x519fb9[_0xda24('0x1a')](_0x54b23d)[_0xda24('0x1b')]();};}function respondWithResult(_0x4f34a4,_0xef067b){_0xef067b=_0xef067b||0xc8;return function(_0x53dadc){if(_0x53dadc){return _0x4f34a4[_0xda24('0x1a')](_0xef067b)[_0xda24('0x1c')](_0x53dadc);}};}function respondWithFilteredResult(_0x57f4d6,_0x547e1c){return function(_0x53749f){if(_0x53749f){var _0x26764=typeof _0x547e1c[_0xda24('0x1d')]===_0xda24('0x1e')&&typeof _0x547e1c[_0xda24('0x1f')]===_0xda24('0x1e');var _0x8f6c65=_0x53749f[_0xda24('0x20')];var _0x847878=_0x26764?0x0:_0x547e1c['offset'];var _0x22b57d=_0x26764?_0x53749f[_0xda24('0x20')]:_0x547e1c['offset']+_0x547e1c[_0xda24('0x1f')];var _0x510b07;if(_0x22b57d>=_0x8f6c65){_0x22b57d=_0x8f6c65;_0x510b07=0xc8;}else{_0x510b07=0xce;}_0x57f4d6['status'](_0x510b07);return _0x57f4d6[_0xda24('0x21')](_0xda24('0x22'),_0x847878+'-'+_0x22b57d+'/'+_0x8f6c65)[_0xda24('0x1c')](_0x53749f);}return null;};}function patchUpdates(_0x46cb50){return function(_0x3cdeb5){try{jsonpatch[_0xda24('0x23')](_0x3cdeb5,_0x46cb50,!![]);}catch(_0xc7fab5){return BPromise['reject'](_0xc7fab5);}return _0x3cdeb5[_0xda24('0x24')]();};}function saveUpdates(_0x5f53a3,_0x232df2){return function(_0x2fdf18){if(_0x2fdf18){return _0x2fdf18[_0xda24('0x25')](_0x5f53a3)[_0xda24('0x26')](function(_0x17c573){return _0x17c573;});}return null;};}function removeEntity(_0x2f9ae2,_0x454d04){return function(_0xd74f8d){if(_0xd74f8d){return _0xd74f8d[_0xda24('0x27')]()[_0xda24('0x26')](function(){_0x2f9ae2[_0xda24('0x1a')](0xcc)[_0xda24('0x1b')]();});}};}function handleEntityNotFound(_0x5edfc0,_0x468647){return function(_0x30e886){if(!_0x30e886){_0x5edfc0[_0xda24('0x19')](0x194);}return _0x30e886;};}function handleError(_0x35ff0f,_0x196304){_0x196304=_0x196304||0x1f4;return function(_0x3f666b){logger['error'](_0x3f666b[_0xda24('0x28')]);if(_0x3f666b['name']){delete _0x3f666b[_0xda24('0x29')];}_0x35ff0f[_0xda24('0x1a')](_0x196304)['send'](_0x3f666b);};}exports[_0xda24('0x2a')]=function(_0xd6d60f,_0x49a311){var _0x40487d={},_0xc98aa2={},_0x9a6911={'count':0x0,'rows':[]};var _0x11ffb5=_[_0xda24('0x2b')](db['ChatQueueReport']['rawAttributes'],function(_0x20f60d){return{'name':_0x20f60d['fieldName'],'type':_0x20f60d['type'][_0xda24('0x2c')]};});_0xc98aa2[_0xda24('0x2d')]=_['map'](_0x11ffb5,'name');_0xc98aa2[_0xda24('0x2e')]=_[_0xda24('0x2f')](_0xd6d60f['query']);_0xc98aa2['filters']=_[_0xda24('0x30')](_0xc98aa2[_0xda24('0x2d')],_0xc98aa2[_0xda24('0x2e')]);_0x40487d[_0xda24('0x31')]=_[_0xda24('0x30')](_0xc98aa2['model'],qs[_0xda24('0x32')](_0xd6d60f[_0xda24('0x2e')][_0xda24('0x32')]));_0x40487d[_0xda24('0x31')]=_0x40487d['attributes'][_0xda24('0x33')]?_0x40487d['attributes']:_0xc98aa2[_0xda24('0x2d')];if(!_0xd6d60f[_0xda24('0x2e')][_0xda24('0x34')](_0xda24('0x35'))){_0x40487d[_0xda24('0x1f')]=qs['limit'](_0xd6d60f[_0xda24('0x2e')][_0xda24('0x1f')]);_0x40487d[_0xda24('0x1d')]=qs[_0xda24('0x1d')](_0xd6d60f[_0xda24('0x2e')]['offset']);}_0x40487d[_0xda24('0x36')]=qs[_0xda24('0x37')](_0xd6d60f['query']['sort']);_0x40487d['where']=qs[_0xda24('0x38')](_[_0xda24('0x39')](_0xd6d60f[_0xda24('0x2e')],_0xc98aa2[_0xda24('0x38')]),_0x11ffb5);if(_0xd6d60f[_0xda24('0x2e')][_0xda24('0x3a')]){_0x40487d['where']=_[_0xda24('0x3b')](_0x40487d[_0xda24('0x3c')],{'$or':_[_0xda24('0x2b')](_0x11ffb5,function(_0x5aa0aa){if(_0x5aa0aa[_0xda24('0x3d')]!=='VIRTUAL'){var _0x25d0cd={};_0x25d0cd[_0x5aa0aa['name']]={'$like':'%'+_0xd6d60f[_0xda24('0x2e')]['filter']+'%'};return _0x25d0cd;}})});}_0x40487d=_[_0xda24('0x3b')]({},_0x40487d,_0xd6d60f['options']);var _0x5e81e8={'where':_0x40487d[_0xda24('0x3c')]};return db[_0xda24('0x3e')][_0xda24('0x20')](_0x5e81e8)[_0xda24('0x26')](function(_0x46c18b){_0x9a6911[_0xda24('0x20')]=_0x46c18b;if(_0xd6d60f[_0xda24('0x2e')]['includeAll']){_0x40487d[_0xda24('0x3f')]=[{'all':!![]}];}return db[_0xda24('0x3e')][_0xda24('0x40')](_0x40487d);})[_0xda24('0x26')](function(_0xe42050){_0x9a6911[_0xda24('0x41')]=_0xe42050;return _0x9a6911;})[_0xda24('0x26')](respondWithFilteredResult(_0x49a311,_0x40487d))[_0xda24('0x42')](handleError(_0x49a311,null));};exports[_0xda24('0x43')]=function(_0x1aa0eb,_0x4aea76){var _0x3e6597={'raw':!![],'where':{'id':_0x1aa0eb[_0xda24('0x44')]['id']}},_0x61f885={};_0x61f885[_0xda24('0x2d')]=_['keys'](db[_0xda24('0x3e')][_0xda24('0x45')]);_0x61f885['query']=_['keys'](_0x1aa0eb['query']);_0x61f885['filters']=_['intersection'](_0x61f885['model'],_0x61f885[_0xda24('0x2e')]);_0x3e6597[_0xda24('0x31')]=_[_0xda24('0x30')](_0x61f885[_0xda24('0x2d')],qs[_0xda24('0x32')](_0x1aa0eb['query'][_0xda24('0x32')]));_0x3e6597[_0xda24('0x31')]=_0x3e6597[_0xda24('0x31')][_0xda24('0x33')]?_0x3e6597['attributes']:_0x61f885[_0xda24('0x2d')];if(_0x1aa0eb[_0xda24('0x2e')][_0xda24('0x46')]){_0x3e6597[_0xda24('0x3f')]=[{'all':!![]}];}_0x3e6597=_[_0xda24('0x3b')]({},_0x3e6597,_0x1aa0eb['options']);return db['ChatQueueReport'][_0xda24('0x47')](_0x3e6597)[_0xda24('0x26')](handleEntityNotFound(_0x4aea76,null))[_0xda24('0x26')](respondWithResult(_0x4aea76,null))[_0xda24('0x42')](handleError(_0x4aea76,null));};exports[_0xda24('0x48')]=function(_0x37a834,_0xcfcbd5){return db['ChatQueueReport'][_0xda24('0x48')](_0x37a834[_0xda24('0x49')],{})['then'](respondWithResult(_0xcfcbd5,0xc9))['catch'](handleError(_0xcfcbd5,null));};exports[_0xda24('0x25')]=function(_0x2eb12b,_0x302e2b){if(_0x2eb12b['body']['id']){delete _0x2eb12b[_0xda24('0x49')]['id'];}return db[_0xda24('0x3e')][_0xda24('0x47')]({'where':{'id':_0x2eb12b['params']['id']}})[_0xda24('0x26')](handleEntityNotFound(_0x302e2b,null))[_0xda24('0x26')](saveUpdates(_0x2eb12b['body'],null))[_0xda24('0x26')](respondWithResult(_0x302e2b,null))[_0xda24('0x42')](handleError(_0x302e2b,null));};exports[_0xda24('0x27')]=function(_0x264eb0,_0x2f87b7){return db['ChatQueueReport'][_0xda24('0x47')]({'where':{'id':_0x264eb0[_0xda24('0x44')]['id']}})[_0xda24('0x26')](handleEntityNotFound(_0x2f87b7,null))[_0xda24('0x26')](removeEntity(_0x2f87b7,null))['catch'](handleError(_0x2f87b7,null));};exports[_0xda24('0x4a')]=function(_0x73a1f3,_0x4de9ad){return db[_0xda24('0x3e')][_0xda24('0x4a')]()['then'](respondWithResult(_0x4de9ad,null))[_0xda24('0x42')](handleError(_0x4de9ad,null));};
\ No newline at end of file
+var _0x2d2c=['name','index','map','ChatQueueReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','keys','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x2d2c[_0x23b655];return _0x364b32;};'use strict';var emlformat=require(_0xc2d2('0x0'));var rimraf=require(_0xc2d2('0x1'));var zipdir=require(_0xc2d2('0x2'));var jsonpatch=require(_0xc2d2('0x3'));var rp=require(_0xc2d2('0x4'));var moment=require(_0xc2d2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc2d2('0x6'));var util=require('util');var path=require(_0xc2d2('0x7'));var sox=require(_0xc2d2('0x8'));var csv=require(_0xc2d2('0x9'));var ejs=require(_0xc2d2('0xa'));var fs=require('fs');var fs_extra=require(_0xc2d2('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc2d2('0xc'));var jsforce=require(_0xc2d2('0xd'));var deskjs=require(_0xc2d2('0xe'));var toCsv=require(_0xc2d2('0x9'));var querystring=require(_0xc2d2('0xf'));var Papa=require(_0xc2d2('0x10'));var Redis=require(_0xc2d2('0x11'));var authService=require(_0xc2d2('0x12'));var qs=require(_0xc2d2('0x13'));var as=require(_0xc2d2('0x14'));var hardwareService=require(_0xc2d2('0x15'));var logger=require(_0xc2d2('0x16'))('api');var utils=require(_0xc2d2('0x17'));var config=require(_0xc2d2('0x18'));var licenseUtil=require(_0xc2d2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273269,_0x738877){_0x738877=_0x738877||0xcc;return function(_0x4c2b12){if(_0x4c2b12){return _0x273269[_0xc2d2('0x1a')](_0x738877);}return _0x273269[_0xc2d2('0x1b')](_0x738877)['end']();};}function respondWithResult(_0xa6f836,_0x4de52a){_0x4de52a=_0x4de52a||0xc8;return function(_0x5a1d24){if(_0x5a1d24){return _0xa6f836[_0xc2d2('0x1b')](_0x4de52a)[_0xc2d2('0x1c')](_0x5a1d24);}};}function respondWithFilteredResult(_0xf6bc66,_0x4006f3){return function(_0x2c42a6){if(_0x2c42a6){var _0x37552b=typeof _0x4006f3[_0xc2d2('0x1d')]===_0xc2d2('0x1e')&&typeof _0x4006f3[_0xc2d2('0x1f')]===_0xc2d2('0x1e');var _0x403d51=_0x2c42a6['count'];var _0x2d4ec4=_0x37552b?0x0:_0x4006f3[_0xc2d2('0x1d')];var _0x34f750=_0x37552b?_0x2c42a6[_0xc2d2('0x20')]:_0x4006f3['offset']+_0x4006f3[_0xc2d2('0x1f')];var _0x18cef7;if(_0x34f750>=_0x403d51){_0x34f750=_0x403d51;_0x18cef7=0xc8;}else{_0x18cef7=0xce;}_0xf6bc66['status'](_0x18cef7);return _0xf6bc66[_0xc2d2('0x21')](_0xc2d2('0x22'),_0x2d4ec4+'-'+_0x34f750+'/'+_0x403d51)[_0xc2d2('0x1c')](_0x2c42a6);}return null;};}function patchUpdates(_0xb14bc3){return function(_0x603323){try{jsonpatch['apply'](_0x603323,_0xb14bc3,!![]);}catch(_0x100d5b){return BPromise[_0xc2d2('0x23')](_0x100d5b);}return _0x603323['save']();};}function saveUpdates(_0x2cac91,_0x4e3cb5){return function(_0x5ecf78){if(_0x5ecf78){return _0x5ecf78['update'](_0x2cac91)[_0xc2d2('0x24')](function(_0x1bdcb5){return _0x1bdcb5;});}return null;};}function removeEntity(_0x7ffb28,_0x4b3449){return function(_0x2dbc46){if(_0x2dbc46){return _0x2dbc46[_0xc2d2('0x25')]()[_0xc2d2('0x24')](function(){_0x7ffb28[_0xc2d2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25b201,_0x25e6af){return function(_0xf2ba15){if(!_0xf2ba15){_0x25b201[_0xc2d2('0x1a')](0x194);}return _0xf2ba15;};}function handleError(_0x1a11d2,_0x1c14e5){_0x1c14e5=_0x1c14e5||0x1f4;return function(_0x49e955){logger[_0xc2d2('0x26')](_0x49e955[_0xc2d2('0x27')]);if(_0x49e955[_0xc2d2('0x28')]){delete _0x49e955[_0xc2d2('0x28')];}_0x1a11d2['status'](_0x1c14e5)['send'](_0x49e955);};}exports[_0xc2d2('0x29')]=function(_0x7b75f4,_0x1f3b66){var _0x21ca37={},_0x402337={},_0x460379={'count':0x0,'rows':[]};var _0x4d4af2=_[_0xc2d2('0x2a')](db[_0xc2d2('0x2b')]['rawAttributes'],function(_0x29cae5){return{'name':_0x29cae5[_0xc2d2('0x2c')],'type':_0x29cae5[_0xc2d2('0x2d')][_0xc2d2('0x2e')]};});_0x402337[_0xc2d2('0x2f')]=_['map'](_0x4d4af2,'name');_0x402337[_0xc2d2('0x30')]=_['keys'](_0x7b75f4[_0xc2d2('0x30')]);_0x402337[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],_0x402337[_0xc2d2('0x30')]);_0x21ca37['attributes']=_[_0xc2d2('0x32')](_0x402337[_0xc2d2('0x2f')],qs[_0xc2d2('0x33')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x21ca37[_0xc2d2('0x34')]=_0x21ca37['attributes'][_0xc2d2('0x35')]?_0x21ca37[_0xc2d2('0x34')]:_0x402337['model'];if(!_0x7b75f4[_0xc2d2('0x30')]['hasOwnProperty'](_0xc2d2('0x36'))){_0x21ca37[_0xc2d2('0x1f')]=qs[_0xc2d2('0x1f')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x1f')]);_0x21ca37[_0xc2d2('0x1d')]=qs[_0xc2d2('0x1d')](_0x7b75f4[_0xc2d2('0x30')]['offset']);}_0x21ca37[_0xc2d2('0x37')]=qs[_0xc2d2('0x38')](_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x38')]);_0x21ca37['where']=qs[_0xc2d2('0x31')](_[_0xc2d2('0x39')](_0x7b75f4[_0xc2d2('0x30')],_0x402337[_0xc2d2('0x31')]),_0x4d4af2);if(_0x7b75f4['query'][_0xc2d2('0x3a')]){_0x21ca37['where']=_[_0xc2d2('0x3b')](_0x21ca37[_0xc2d2('0x3c')],{'$or':_['map'](_0x4d4af2,function(_0xdbdce0){if(_0xdbdce0[_0xc2d2('0x2d')]!==_0xc2d2('0x3d')){var _0x29d04b={};_0x29d04b[_0xdbdce0[_0xc2d2('0x28')]]={'$like':'%'+_0x7b75f4[_0xc2d2('0x30')][_0xc2d2('0x3a')]+'%'};return _0x29d04b;}})});}_0x21ca37=_[_0xc2d2('0x3b')]({},_0x21ca37,_0x7b75f4[_0xc2d2('0x3e')]);var _0x49d900={'where':_0x21ca37['where']};return db[_0xc2d2('0x2b')][_0xc2d2('0x20')](_0x49d900)['then'](function(_0xfd3ad4){_0x460379[_0xc2d2('0x20')]=_0xfd3ad4;if(_0x7b75f4[_0xc2d2('0x30')]['includeAll']){_0x21ca37['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0xc2d2('0x3f')](_0x21ca37);})[_0xc2d2('0x24')](function(_0x4031d0){_0x460379[_0xc2d2('0x40')]=_0x4031d0;return _0x460379;})['then'](respondWithFilteredResult(_0x1f3b66,_0x21ca37))[_0xc2d2('0x41')](handleError(_0x1f3b66,null));};exports['show']=function(_0x582edb,_0x24544e){var _0x2a987a={'raw':!![],'where':{'id':_0x582edb['params']['id']}},_0x386a39={};_0x386a39[_0xc2d2('0x2f')]=_[_0xc2d2('0x42')](db[_0xc2d2('0x2b')]['rawAttributes']);_0x386a39[_0xc2d2('0x30')]=_['keys'](_0x582edb[_0xc2d2('0x30')]);_0x386a39[_0xc2d2('0x31')]=_[_0xc2d2('0x32')](_0x386a39[_0xc2d2('0x2f')],_0x386a39[_0xc2d2('0x30')]);_0x2a987a[_0xc2d2('0x34')]=_['intersection'](_0x386a39[_0xc2d2('0x2f')],qs['fields'](_0x582edb[_0xc2d2('0x30')][_0xc2d2('0x33')]));_0x2a987a[_0xc2d2('0x34')]=_0x2a987a[_0xc2d2('0x34')][_0xc2d2('0x35')]?_0x2a987a['attributes']:_0x386a39[_0xc2d2('0x2f')];if(_0x582edb[_0xc2d2('0x30')]['includeAll']){_0x2a987a['include']=[{'all':!![]}];}_0x2a987a=_['merge']({},_0x2a987a,_0x582edb['options']);return db[_0xc2d2('0x2b')][_0xc2d2('0x43')](_0x2a987a)[_0xc2d2('0x24')](handleEntityNotFound(_0x24544e,null))[_0xc2d2('0x24')](respondWithResult(_0x24544e,null))[_0xc2d2('0x41')](handleError(_0x24544e,null));};exports[_0xc2d2('0x44')]=function(_0x1146cb,_0x3b795a){return db[_0xc2d2('0x2b')][_0xc2d2('0x44')](_0x1146cb[_0xc2d2('0x45')],{})[_0xc2d2('0x24')](respondWithResult(_0x3b795a,0xc9))['catch'](handleError(_0x3b795a,null));};exports[_0xc2d2('0x46')]=function(_0x4181dc,_0x572764){if(_0x4181dc[_0xc2d2('0x45')]['id']){delete _0x4181dc['body']['id'];}return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x4181dc[_0xc2d2('0x47')]['id']}})[_0xc2d2('0x24')](handleEntityNotFound(_0x572764,null))['then'](saveUpdates(_0x4181dc[_0xc2d2('0x45')],null))[_0xc2d2('0x24')](respondWithResult(_0x572764,null))[_0xc2d2('0x41')](handleError(_0x572764,null));};exports[_0xc2d2('0x25')]=function(_0x3b61ef,_0x4765f9){return db[_0xc2d2('0x2b')][_0xc2d2('0x43')]({'where':{'id':_0x3b61ef[_0xc2d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x4765f9,null))['then'](removeEntity(_0x4765f9,null))[_0xc2d2('0x41')](handleError(_0x4765f9,null));};exports[_0xc2d2('0x48')]=function(_0x472299,_0x1827c3){return db[_0xc2d2('0x2b')]['describe']()[_0xc2d2('0x24')](respondWithResult(_0x1827c3,null))[_0xc2d2('0x41')](handleError(_0x1827c3,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 5b7da1e..e0d464a 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0xe706,0xa3));var _0x6e70=function(_0x16270b,_0x4ff120){_0x16270b=_0x16270b-0x0;var _0x2cd122=_0xe706[_0x16270b];return _0x2cd122;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 3dd3c57..d8b501e 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 _0x988c=['CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','body','raw','where','attributes','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x988c,0x19e));var _0xc988=function(_0x2e7c21,_0x461843){_0x2e7c21=_0x2e7c21-0x0;var _0x23d22f=_0x988c[_0x2e7c21];return _0x23d22f;};'use strict';var _=require(_0xc988('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc988('0x1'));var fs=require('fs');var Redis=require(_0xc988('0x2'));var db=require(_0xc988('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xc988('0x4'));var jayson=require(_0xc988('0x5'));var client=jayson[_0xc988('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26e109,_0x14b586,_0x4e6f38){return new BPromise(function(_0x4e48db,_0x2a96ab){return client[_0xc988('0x7')](_0x26e109,_0x4e6f38)[_0xc988('0x8')](function(_0x271d0f){logger[_0xc988('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x14b586,_0xc988('0xa'));logger[_0xc988('0xb')](_0xc988('0xc'),_0x14b586,_0xc988('0xa'),JSON[_0xc988('0xd')](_0x271d0f));if(_0x271d0f['error']){if(_0x271d0f[_0xc988('0xe')][_0xc988('0xf')]===0x1f4){logger[_0xc988('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x14b586,_0x271d0f[_0xc988('0xe')]['message']);return _0x2a96ab(_0x271d0f[_0xc988('0xe')]['message']);}logger[_0xc988('0xe')](_0xc988('0x10'),_0x14b586,_0x271d0f[_0xc988('0xe')][_0xc988('0x11')]);return _0x4e48db(_0x271d0f['error'][_0xc988('0x11')]);}else{logger[_0xc988('0x9')](_0xc988('0x10'),_0x14b586,_0xc988('0xa'));_0x4e48db(_0x271d0f[_0xc988('0x12')][_0xc988('0x11')]);}})[_0xc988('0x13')](function(_0x35aebb){logger[_0xc988('0xe')](_0xc988('0x10'),_0x14b586,_0x35aebb);_0x2a96ab(_0x35aebb);});});}exports[_0xc988('0x14')]=function(_0x49738a){var _0x314a24=this;return new Promise(function(_0x23677f,_0x32319c){return db[_0xc988('0x15')][_0xc988('0x16')](_0x49738a['body'],{'raw':_0x49738a['options']?_0x49738a[_0xc988('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc988('0x8')](function(_0x3cad71){logger['info']('CreateChatQueueReport',_0x49738a);logger[_0xc988('0xb')](_0xc988('0x14'),_0x49738a,JSON[_0xc988('0xd')](_0x3cad71));_0x23677f(_0x3cad71);})['catch'](function(_0xc5754d){logger[_0xc988('0xe')](_0xc988('0x14'),_0xc5754d['message'],_0x49738a);_0x32319c(_0x314a24[_0xc988('0xe')](0x1f4,_0xc5754d[_0xc988('0x11')]));});});};exports[_0xc988('0x18')]=function(_0x5b4555){var _0x5444a5=this;return new Promise(function(_0x343ac3,_0x3ca571){return db[_0xc988('0x15')][_0xc988('0x19')](_0x5b4555[_0xc988('0x1a')],{'raw':_0x5b4555[_0xc988('0x17')]?_0x5b4555[_0xc988('0x17')][_0xc988('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b4555['options']?_0x5b4555[_0xc988('0x17')][_0xc988('0x1c')]||null:null,'attributes':_0x5b4555[_0xc988('0x17')]?_0x5b4555[_0xc988('0x17')][_0xc988('0x1d')]||null:null,'limit':_0x5b4555[_0xc988('0x17')]?_0x5b4555[_0xc988('0x17')][_0xc988('0x1e')]||null:null})['then'](function(_0x2a0d6f){logger[_0xc988('0x9')](_0xc988('0x18'),_0x5b4555);logger[_0xc988('0xb')]('UpdateChatQueueReport',_0x5b4555,JSON['stringify'](_0x2a0d6f));_0x343ac3(_0x2a0d6f);})[_0xc988('0x13')](function(_0x11d51f){logger[_0xc988('0xe')]('UpdateChatQueueReport',_0x11d51f[_0xc988('0x11')],_0x5b4555);_0x3ca571(_0x5444a5[_0xc988('0xe')](0x1f4,_0x11d51f[_0xc988('0x11')]));});});};
\ No newline at end of file
+var _0xf93d=['result','CreateChatQueueReport','create','body','options','raw','then','debug','catch','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0xf93d,0x11f));var _0xdf93=function(_0x361b2f,_0x4f8972){_0x361b2f=_0x361b2f-0x0;var _0x23b8e5=_0xf93d[_0x361b2f];return _0x23b8e5;};'use strict';var _=require('lodash');var util=require(_0xdf93('0x0'));var moment=require(_0xdf93('0x1'));var BPromise=require(_0xdf93('0x2'));var rs=require(_0xdf93('0x3'));var fs=require('fs');var Redis=require(_0xdf93('0x4'));var db=require(_0xdf93('0x5'))['db'];var utils=require(_0xdf93('0x6'));var logger=require(_0xdf93('0x7'))(_0xdf93('0x8'));var config=require(_0xdf93('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xdf93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d356e,_0x5bde50,_0x3cb77b){return new BPromise(function(_0x3cbd61,_0x5b0828){return client[_0xdf93('0xb')](_0x4d356e,_0x3cb77b)['then'](function(_0x5837e6){logger[_0xdf93('0xc')](_0xdf93('0xd'),_0x5bde50,_0xdf93('0xe'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x5bde50,_0xdf93('0xe'),JSON[_0xdf93('0xf')](_0x5837e6));if(_0x5837e6[_0xdf93('0x10')]){if(_0x5837e6[_0xdf93('0x10')][_0xdf93('0x11')]===0x1f4){logger[_0xdf93('0x10')](_0xdf93('0xd'),_0x5bde50,_0x5837e6[_0xdf93('0x10')]['message']);return _0x5b0828(_0x5837e6[_0xdf93('0x10')][_0xdf93('0x12')]);}logger[_0xdf93('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x5bde50,_0x5837e6[_0xdf93('0x10')][_0xdf93('0x12')]);return _0x3cbd61(_0x5837e6['error']['message']);}else{logger[_0xdf93('0xc')](_0xdf93('0xd'),_0x5bde50,_0xdf93('0xe'));_0x3cbd61(_0x5837e6[_0xdf93('0x13')]['message']);}})['catch'](function(_0x541e5e){logger['error'](_0xdf93('0xd'),_0x5bde50,_0x541e5e);_0x5b0828(_0x541e5e);});});}exports[_0xdf93('0x14')]=function(_0x261035){var _0x490824=this;return new Promise(function(_0x44555d,_0x5f149f){return db['ChatQueueReport'][_0xdf93('0x15')](_0x261035[_0xdf93('0x16')],{'raw':_0x261035[_0xdf93('0x17')]?_0x261035['options'][_0xdf93('0x18')]===undefined?!![]:![]:!![]})[_0xdf93('0x19')](function(_0x184201){logger['info'](_0xdf93('0x14'),_0x261035);logger[_0xdf93('0x1a')](_0xdf93('0x14'),_0x261035,JSON[_0xdf93('0xf')](_0x184201));_0x44555d(_0x184201);})[_0xdf93('0x1b')](function(_0x1c4776){logger[_0xdf93('0x10')](_0xdf93('0x14'),_0x1c4776[_0xdf93('0x12')],_0x261035);_0x5f149f(_0x490824['error'](0x1f4,_0x1c4776['message']));});});};exports[_0xdf93('0x1c')]=function(_0x24a136){var _0x420622=this;return new Promise(function(_0x1f2cf0,_0x2528d9){return db[_0xdf93('0x1d')][_0xdf93('0x1e')](_0x24a136[_0xdf93('0x16')],{'raw':_0x24a136['options']?_0x24a136['options'][_0xdf93('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24a136[_0xdf93('0x17')]?_0x24a136[_0xdf93('0x17')][_0xdf93('0x1f')]||null:null,'attributes':_0x24a136[_0xdf93('0x17')]?_0x24a136[_0xdf93('0x17')][_0xdf93('0x20')]||null:null,'limit':_0x24a136[_0xdf93('0x17')]?_0x24a136[_0xdf93('0x17')][_0xdf93('0x21')]||null:null})['then'](function(_0xe3e7b1){logger[_0xdf93('0xc')](_0xdf93('0x1c'),_0x24a136);logger[_0xdf93('0x1a')](_0xdf93('0x1c'),_0x24a136,JSON[_0xdf93('0xf')](_0xe3e7b1));_0x1f2cf0(_0xe3e7b1);})[_0xdf93('0x1b')](function(_0x2d0e05){logger[_0xdf93('0x10')](_0xdf93('0x1c'),_0x2d0e05[_0xdf93('0x12')],_0x24a136);_0x2528d9(_0x420622[_0xdf93('0x10')](0x1f4,_0x2d0e05[_0xdf93('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 396737e..db29750 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 _0xc0a9=['post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0a9,0xf8));var _0x9c0a=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0xc0a9[_0x286bfb];return _0x52b683;};'use strict';var multer=require(_0x9c0a('0x0'));var util=require(_0x9c0a('0x1'));var path=require(_0x9c0a('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c0a('0x3'));var router=express[_0x9c0a('0x4')]();var fs_extra=require(_0x9c0a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c0a('0x6'));var config=require(_0x9c0a('0x7'));var controller=require(_0x9c0a('0x8'));router[_0x9c0a('0x9')]('/',auth[_0x9c0a('0xa')](),controller[_0x9c0a('0xb')]);router[_0x9c0a('0x9')](_0x9c0a('0xc'),auth[_0x9c0a('0xa')](),controller[_0x9c0a('0xd')]);router[_0x9c0a('0x9')](_0x9c0a('0xe'),auth[_0x9c0a('0xa')](),controller[_0x9c0a('0xf')]);router[_0x9c0a('0x10')]('/',auth[_0x9c0a('0xa')](),controller['create']);router[_0x9c0a('0x11')](_0x9c0a('0xe'),auth['isAuthenticated'](),controller[_0x9c0a('0x12')]);router[_0x9c0a('0x13')](_0x9c0a('0xe'),auth[_0x9c0a('0xa')](),controller[_0x9c0a('0x14')]);module[_0x9c0a('0x15')]=router;
\ No newline at end of file
+var _0x0055=['index','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x5dba16,_0x53efef){var _0x395e95=function(_0x10f469){while(--_0x10f469){_0x5dba16['push'](_0x5dba16['shift']());}};_0x395e95(++_0x53efef);}(_0x0055,0xda));var _0x5005=function(_0x2d1b06,_0x2bedf1){_0x2d1b06=_0x2d1b06-0x0;var _0x4fca05=_0x0055[_0x2d1b06];return _0x4fca05;};'use strict';var multer=require(_0x5005('0x0'));var util=require(_0x5005('0x1'));var path=require(_0x5005('0x2'));var timeout=require(_0x5005('0x3'));var express=require('express');var router=express[_0x5005('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5005('0x5'));var config=require(_0x5005('0x6'));var controller=require(_0x5005('0x7'));router[_0x5005('0x8')]('/',auth[_0x5005('0x9')](),controller[_0x5005('0xa')]);router[_0x5005('0x8')]('/describe',auth[_0x5005('0x9')](),controller[_0x5005('0xb')]);router[_0x5005('0x8')](_0x5005('0xc'),auth[_0x5005('0x9')](),controller[_0x5005('0xd')]);router[_0x5005('0xe')]('/',auth[_0x5005('0x9')](),controller['create']);router[_0x5005('0xf')](_0x5005('0xc'),auth['isAuthenticated'](),controller[_0x5005('0x10')]);router[_0x5005('0x11')](_0x5005('0xc'),auth[_0x5005('0x9')](),controller[_0x5005('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 1989bc0..6befdf6 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4d521e,_0x58ba39){var _0x3beb42=function(_0x1a7bd2){while(--_0x1a7bd2){_0x4d521e['push'](_0x4d521e['shift']());}};_0x3beb42(++_0x58ba39);}(_0x9bde,0xe1));var _0xe9bd=function(_0x35d5ab,_0x5722a8){_0x35d5ab=_0x35d5ab-0x0;var _0x22b054=_0x9bde[_0x35d5ab];return _0x22b054;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5ec45f,_0x43afd7){_0x5ec45f=_0x5ec45f-0x0;var _0x511659=_0x9bde[_0x5ec45f];return _0x511659;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index a181244..886c483 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 _0x7c53=['request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir'];(function(_0x5cbce6,_0x5492b0){var _0x59732a=function(_0x38bebc){while(--_0x38bebc){_0x5cbce6['push'](_0x5cbce6['shift']());}};_0x59732a(++_0x5492b0);}(_0x7c53,0x1dd));var _0x37c5=function(_0x43419a,_0x5b5768){_0x43419a=_0x43419a-0x0;var _0x493bb9=_0x7c53[_0x43419a];return _0x493bb9;};'use strict';var emlformat=require(_0x37c5('0x0'));var rimraf=require(_0x37c5('0x1'));var zipdir=require(_0x37c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37c5('0x3'));var moment=require(_0x37c5('0x4'));var BPromise=require(_0x37c5('0x5'));var Mustache=require(_0x37c5('0x6'));var util=require('util');var path=require('path');var sox=require(_0x37c5('0x7'));var csv=require('to-csv');var ejs=require(_0x37c5('0x8'));var fs=require('fs');var fs_extra=require(_0x37c5('0x9'));var _=require(_0x37c5('0xa'));var squel=require(_0x37c5('0xb'));var crypto=require('crypto');var jsforce=require(_0x37c5('0xc'));var deskjs=require(_0x37c5('0xd'));var toCsv=require(_0x37c5('0xe'));var querystring=require(_0x37c5('0xf'));var Papa=require('papaparse');var Redis=require(_0x37c5('0x10'));var authService=require(_0x37c5('0x11'));var qs=require(_0x37c5('0x12'));var as=require(_0x37c5('0x13'));var hardwareService=require(_0x37c5('0x14'));var logger=require(_0x37c5('0x15'))(_0x37c5('0x16'));var utils=require(_0x37c5('0x17'));var config=require(_0x37c5('0x18'));var licenseUtil=require(_0x37c5('0x19'));var db=require(_0x37c5('0x1a'))['db'];function respondWithStatusCode(_0x1bd6e2,_0x15f458){_0x15f458=_0x15f458||0xcc;return function(_0x17c6a7){if(_0x17c6a7){return _0x1bd6e2[_0x37c5('0x1b')](_0x15f458);}return _0x1bd6e2[_0x37c5('0x1c')](_0x15f458)[_0x37c5('0x1d')]();};}function respondWithResult(_0x1c3aa7,_0x39259c){_0x39259c=_0x39259c||0xc8;return function(_0x1623e8){if(_0x1623e8){return _0x1c3aa7['status'](_0x39259c)[_0x37c5('0x1e')](_0x1623e8);}};}function respondWithFilteredResult(_0xadec39,_0x52f5b2){return function(_0xa3942e){if(_0xa3942e){var _0x31ffd3=typeof _0x52f5b2[_0x37c5('0x1f')]===_0x37c5('0x20')&&typeof _0x52f5b2[_0x37c5('0x21')]==='undefined';var _0x3f258a=_0xa3942e['count'];var _0x2ceefb=_0x31ffd3?0x0:_0x52f5b2[_0x37c5('0x1f')];var _0x256152=_0x31ffd3?_0xa3942e[_0x37c5('0x22')]:_0x52f5b2[_0x37c5('0x1f')]+_0x52f5b2[_0x37c5('0x21')];var _0x16e02c;if(_0x256152>=_0x3f258a){_0x256152=_0x3f258a;_0x16e02c=0xc8;}else{_0x16e02c=0xce;}_0xadec39[_0x37c5('0x1c')](_0x16e02c);return _0xadec39[_0x37c5('0x23')](_0x37c5('0x24'),_0x2ceefb+'-'+_0x256152+'/'+_0x3f258a)[_0x37c5('0x1e')](_0xa3942e);}return null;};}function patchUpdates(_0x57b54e){return function(_0x55fd5f){try{jsonpatch[_0x37c5('0x25')](_0x55fd5f,_0x57b54e,!![]);}catch(_0x35cd83){return BPromise[_0x37c5('0x26')](_0x35cd83);}return _0x55fd5f['save']();};}function saveUpdates(_0x42c9b1,_0x5827b5){return function(_0xeaf79e){if(_0xeaf79e){return _0xeaf79e[_0x37c5('0x27')](_0x42c9b1)[_0x37c5('0x28')](function(_0x14288c){return _0x14288c;});}return null;};}function removeEntity(_0xa2e2e3,_0x4a6b5e){return function(_0x2d5241){if(_0x2d5241){return _0x2d5241['destroy']()[_0x37c5('0x28')](function(){_0xa2e2e3[_0x37c5('0x1c')](0xcc)[_0x37c5('0x1d')]();});}};}function handleEntityNotFound(_0x3a6b7c,_0xdf5738){return function(_0x1808e6){if(!_0x1808e6){_0x3a6b7c[_0x37c5('0x1b')](0x194);}return _0x1808e6;};}function handleError(_0x11252f,_0x2e9546){_0x2e9546=_0x2e9546||0x1f4;return function(_0x240464){logger['error'](_0x240464['stack']);if(_0x240464[_0x37c5('0x29')]){delete _0x240464[_0x37c5('0x29')];}_0x11252f['status'](_0x2e9546)[_0x37c5('0x2a')](_0x240464);};}exports[_0x37c5('0x2b')]=function(_0x3644f7,_0x19f408){var _0x2510aa={},_0x5061ac={},_0x59a246={'count':0x0,'rows':[]};var _0x226bb9=_[_0x37c5('0x2c')](db[_0x37c5('0x2d')][_0x37c5('0x2e')],function(_0xb373ab){return{'name':_0xb373ab[_0x37c5('0x2f')],'type':_0xb373ab['type'][_0x37c5('0x30')]};});_0x5061ac[_0x37c5('0x31')]=_[_0x37c5('0x2c')](_0x226bb9,'name');_0x5061ac[_0x37c5('0x32')]=_[_0x37c5('0x33')](_0x3644f7[_0x37c5('0x32')]);_0x5061ac[_0x37c5('0x34')]=_[_0x37c5('0x35')](_0x5061ac[_0x37c5('0x31')],_0x5061ac[_0x37c5('0x32')]);_0x2510aa['attributes']=_['intersection'](_0x5061ac[_0x37c5('0x31')],qs[_0x37c5('0x36')](_0x3644f7['query']['fields']));_0x2510aa['attributes']=_0x2510aa[_0x37c5('0x37')][_0x37c5('0x38')]?_0x2510aa['attributes']:_0x5061ac[_0x37c5('0x31')];if(!_0x3644f7[_0x37c5('0x32')][_0x37c5('0x39')](_0x37c5('0x3a'))){_0x2510aa[_0x37c5('0x21')]=qs[_0x37c5('0x21')](_0x3644f7[_0x37c5('0x32')][_0x37c5('0x21')]);_0x2510aa['offset']=qs[_0x37c5('0x1f')](_0x3644f7['query'][_0x37c5('0x1f')]);}_0x2510aa[_0x37c5('0x3b')]=qs['sort'](_0x3644f7[_0x37c5('0x32')][_0x37c5('0x3c')]);_0x2510aa['where']=qs[_0x37c5('0x34')](_[_0x37c5('0x3d')](_0x3644f7['query'],_0x5061ac[_0x37c5('0x34')]),_0x226bb9);if(_0x3644f7['query'][_0x37c5('0x3e')]){_0x2510aa[_0x37c5('0x3f')]=_[_0x37c5('0x40')](_0x2510aa[_0x37c5('0x3f')],{'$or':_[_0x37c5('0x2c')](_0x226bb9,function(_0x129bcf){if(_0x129bcf[_0x37c5('0x41')]!==_0x37c5('0x42')){var _0x285b7a={};_0x285b7a[_0x129bcf[_0x37c5('0x29')]]={'$like':'%'+_0x3644f7['query']['filter']+'%'};return _0x285b7a;}})});}_0x2510aa=_[_0x37c5('0x40')]({},_0x2510aa,_0x3644f7[_0x37c5('0x43')]);var _0x1779b2={'where':_0x2510aa[_0x37c5('0x3f')]};return db[_0x37c5('0x2d')][_0x37c5('0x22')](_0x1779b2)['then'](function(_0x2951f4){_0x59a246[_0x37c5('0x22')]=_0x2951f4;if(_0x3644f7[_0x37c5('0x32')][_0x37c5('0x44')]){_0x2510aa[_0x37c5('0x45')]=[{'all':!![]}];}return db[_0x37c5('0x2d')][_0x37c5('0x46')](_0x2510aa);})[_0x37c5('0x28')](function(_0x18d9be){_0x59a246[_0x37c5('0x47')]=_0x18d9be;return _0x59a246;})[_0x37c5('0x28')](respondWithFilteredResult(_0x19f408,_0x2510aa))['catch'](handleError(_0x19f408,null));};exports[_0x37c5('0x48')]=function(_0x5b45d8,_0x100be1){var _0x20f575={'raw':!![],'where':{'id':_0x5b45d8[_0x37c5('0x49')]['id']}},_0x1886d9={};_0x1886d9[_0x37c5('0x31')]=_[_0x37c5('0x33')](db['ChatTransferReport'][_0x37c5('0x2e')]);_0x1886d9[_0x37c5('0x32')]=_[_0x37c5('0x33')](_0x5b45d8['query']);_0x1886d9[_0x37c5('0x34')]=_[_0x37c5('0x35')](_0x1886d9['model'],_0x1886d9['query']);_0x20f575[_0x37c5('0x37')]=_[_0x37c5('0x35')](_0x1886d9[_0x37c5('0x31')],qs['fields'](_0x5b45d8[_0x37c5('0x32')][_0x37c5('0x36')]));_0x20f575[_0x37c5('0x37')]=_0x20f575[_0x37c5('0x37')][_0x37c5('0x38')]?_0x20f575['attributes']:_0x1886d9[_0x37c5('0x31')];if(_0x5b45d8[_0x37c5('0x32')][_0x37c5('0x44')]){_0x20f575[_0x37c5('0x45')]=[{'all':!![]}];}_0x20f575=_[_0x37c5('0x40')]({},_0x20f575,_0x5b45d8['options']);return db['ChatTransferReport'][_0x37c5('0x4a')](_0x20f575)['then'](handleEntityNotFound(_0x100be1,null))[_0x37c5('0x28')](respondWithResult(_0x100be1,null))[_0x37c5('0x4b')](handleError(_0x100be1,null));};exports[_0x37c5('0x4c')]=function(_0x379c05,_0x58a6ab){return db[_0x37c5('0x2d')][_0x37c5('0x4c')](_0x379c05[_0x37c5('0x4d')],{})[_0x37c5('0x28')](respondWithResult(_0x58a6ab,0xc9))[_0x37c5('0x4b')](handleError(_0x58a6ab,null));};exports['update']=function(_0x4990be,_0x389c4d){if(_0x4990be[_0x37c5('0x4d')]['id']){delete _0x4990be[_0x37c5('0x4d')]['id'];}return db[_0x37c5('0x2d')][_0x37c5('0x4a')]({'where':{'id':_0x4990be[_0x37c5('0x49')]['id']}})['then'](handleEntityNotFound(_0x389c4d,null))[_0x37c5('0x28')](saveUpdates(_0x4990be[_0x37c5('0x4d')],null))[_0x37c5('0x28')](respondWithResult(_0x389c4d,null))['catch'](handleError(_0x389c4d,null));};exports[_0x37c5('0x4e')]=function(_0x5c4abe,_0x31065d){return db['ChatTransferReport'][_0x37c5('0x4a')]({'where':{'id':_0x5c4abe[_0x37c5('0x49')]['id']}})[_0x37c5('0x28')](handleEntityNotFound(_0x31065d,null))['then'](removeEntity(_0x31065d,null))[_0x37c5('0x4b')](handleError(_0x31065d,null));};exports[_0x37c5('0x4f')]=function(_0x30a20b,_0x2fd266){return db['ChatTransferReport'][_0x37c5('0x4f')]()[_0x37c5('0x28')](respondWithResult(_0x2fd266,null))[_0x37c5('0x4b')](handleError(_0x2fd266,null));};
\ No newline at end of file
+var _0x4e9f=['params','keys','length','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','end','sendStatus','error','name','index','map','ChatTransferReport','rawAttributes','type','model','query','intersection','fields','attributes','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','catch','show'];(function(_0x52723d,_0x204a82){var _0x4c81fa=function(_0x2bff29){while(--_0x2bff29){_0x52723d['push'](_0x52723d['shift']());}};_0x4c81fa(++_0x204a82);}(_0x4e9f,0x16b));var _0xf4e9=function(_0x4e121b,_0x3a821f){_0x4e121b=_0x4e121b-0x0;var _0x518683=_0x4e9f[_0x4e121b];return _0x518683;};'use strict';var emlformat=require(_0xf4e9('0x0'));var rimraf=require(_0xf4e9('0x1'));var zipdir=require(_0xf4e9('0x2'));var jsonpatch=require(_0xf4e9('0x3'));var rp=require(_0xf4e9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf4e9('0x5'));var util=require('util');var path=require(_0xf4e9('0x6'));var sox=require(_0xf4e9('0x7'));var csv=require(_0xf4e9('0x8'));var ejs=require(_0xf4e9('0x9'));var fs=require('fs');var fs_extra=require(_0xf4e9('0xa'));var _=require(_0xf4e9('0xb'));var squel=require(_0xf4e9('0xc'));var crypto=require(_0xf4e9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf4e9('0xe'));var toCsv=require(_0xf4e9('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf4e9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf4e9('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4e9('0x11'));var logger=require(_0xf4e9('0x12'))(_0xf4e9('0x13'));var utils=require(_0xf4e9('0x14'));var config=require(_0xf4e9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf4e9('0x16'))['db'];function respondWithStatusCode(_0x4a6a08,_0x5aa4d7){_0x5aa4d7=_0x5aa4d7||0xcc;return function(_0x6d4b73){if(_0x6d4b73){return _0x4a6a08['sendStatus'](_0x5aa4d7);}return _0x4a6a08[_0xf4e9('0x17')](_0x5aa4d7)['end']();};}function respondWithResult(_0x10b7f9,_0x5135bb){_0x5135bb=_0x5135bb||0xc8;return function(_0x43cf88){if(_0x43cf88){return _0x10b7f9[_0xf4e9('0x17')](_0x5135bb)['json'](_0x43cf88);}};}function respondWithFilteredResult(_0x28b5b8,_0x486380){return function(_0x2908bd){if(_0x2908bd){var _0xcd41b2=typeof _0x486380['offset']==='undefined'&&typeof _0x486380[_0xf4e9('0x18')]===_0xf4e9('0x19');var _0x761b03=_0x2908bd[_0xf4e9('0x1a')];var _0x11c1d2=_0xcd41b2?0x0:_0x486380['offset'];var _0x2ee4ea=_0xcd41b2?_0x2908bd[_0xf4e9('0x1a')]:_0x486380['offset']+_0x486380[_0xf4e9('0x18')];var _0x2526c6;if(_0x2ee4ea>=_0x761b03){_0x2ee4ea=_0x761b03;_0x2526c6=0xc8;}else{_0x2526c6=0xce;}_0x28b5b8[_0xf4e9('0x17')](_0x2526c6);return _0x28b5b8[_0xf4e9('0x1b')](_0xf4e9('0x1c'),_0x11c1d2+'-'+_0x2ee4ea+'/'+_0x761b03)[_0xf4e9('0x1d')](_0x2908bd);}return null;};}function patchUpdates(_0x52f9dc){return function(_0x33f2d8){try{jsonpatch[_0xf4e9('0x1e')](_0x33f2d8,_0x52f9dc,!![]);}catch(_0x2684f0){return BPromise['reject'](_0x2684f0);}return _0x33f2d8[_0xf4e9('0x1f')]();};}function saveUpdates(_0x1355d7,_0x491874){return function(_0x68417c){if(_0x68417c){return _0x68417c['update'](_0x1355d7)[_0xf4e9('0x20')](function(_0x106ca3){return _0x106ca3;});}return null;};}function removeEntity(_0x40a10c,_0x1aed7a){return function(_0x2b3116){if(_0x2b3116){return _0x2b3116[_0xf4e9('0x21')]()[_0xf4e9('0x20')](function(){_0x40a10c[_0xf4e9('0x17')](0xcc)[_0xf4e9('0x22')]();});}};}function handleEntityNotFound(_0x12e95b,_0x5a41cd){return function(_0x3e2121){if(!_0x3e2121){_0x12e95b[_0xf4e9('0x23')](0x194);}return _0x3e2121;};}function handleError(_0x1544b9,_0x34fc0d){_0x34fc0d=_0x34fc0d||0x1f4;return function(_0x2405c0){logger[_0xf4e9('0x24')](_0x2405c0['stack']);if(_0x2405c0['name']){delete _0x2405c0[_0xf4e9('0x25')];}_0x1544b9[_0xf4e9('0x17')](_0x34fc0d)['send'](_0x2405c0);};}exports[_0xf4e9('0x26')]=function(_0x218bf6,_0x41de85){var _0x77d0ff={},_0x48a042={},_0x2449f7={'count':0x0,'rows':[]};var _0x1d8b3b=_[_0xf4e9('0x27')](db[_0xf4e9('0x28')][_0xf4e9('0x29')],function(_0x2d9261){return{'name':_0x2d9261['fieldName'],'type':_0x2d9261[_0xf4e9('0x2a')]['key']};});_0x48a042[_0xf4e9('0x2b')]=_[_0xf4e9('0x27')](_0x1d8b3b,_0xf4e9('0x25'));_0x48a042[_0xf4e9('0x2c')]=_['keys'](_0x218bf6[_0xf4e9('0x2c')]);_0x48a042['filters']=_['intersection'](_0x48a042['model'],_0x48a042[_0xf4e9('0x2c')]);_0x77d0ff['attributes']=_[_0xf4e9('0x2d')](_0x48a042[_0xf4e9('0x2b')],qs[_0xf4e9('0x2e')](_0x218bf6[_0xf4e9('0x2c')][_0xf4e9('0x2e')]));_0x77d0ff[_0xf4e9('0x2f')]=_0x77d0ff['attributes']['length']?_0x77d0ff[_0xf4e9('0x2f')]:_0x48a042[_0xf4e9('0x2b')];if(!_0x218bf6[_0xf4e9('0x2c')][_0xf4e9('0x30')]('nolimit')){_0x77d0ff['limit']=qs['limit'](_0x218bf6[_0xf4e9('0x2c')][_0xf4e9('0x18')]);_0x77d0ff[_0xf4e9('0x31')]=qs[_0xf4e9('0x31')](_0x218bf6[_0xf4e9('0x2c')][_0xf4e9('0x31')]);}_0x77d0ff[_0xf4e9('0x32')]=qs[_0xf4e9('0x33')](_0x218bf6[_0xf4e9('0x2c')]['sort']);_0x77d0ff[_0xf4e9('0x34')]=qs[_0xf4e9('0x35')](_[_0xf4e9('0x36')](_0x218bf6[_0xf4e9('0x2c')],_0x48a042[_0xf4e9('0x35')]),_0x1d8b3b);if(_0x218bf6[_0xf4e9('0x2c')][_0xf4e9('0x37')]){_0x77d0ff[_0xf4e9('0x34')]=_[_0xf4e9('0x38')](_0x77d0ff[_0xf4e9('0x34')],{'$or':_['map'](_0x1d8b3b,function(_0x40ee73){if(_0x40ee73[_0xf4e9('0x2a')]!=='VIRTUAL'){var _0x3d9c86={};_0x3d9c86[_0x40ee73[_0xf4e9('0x25')]]={'$like':'%'+_0x218bf6[_0xf4e9('0x2c')]['filter']+'%'};return _0x3d9c86;}})});}_0x77d0ff=_[_0xf4e9('0x38')]({},_0x77d0ff,_0x218bf6[_0xf4e9('0x39')]);var _0x3ff54f={'where':_0x77d0ff[_0xf4e9('0x34')]};return db[_0xf4e9('0x28')][_0xf4e9('0x1a')](_0x3ff54f)[_0xf4e9('0x20')](function(_0x22790d){_0x2449f7[_0xf4e9('0x1a')]=_0x22790d;if(_0x218bf6[_0xf4e9('0x2c')]['includeAll']){_0x77d0ff[_0xf4e9('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xf4e9('0x3b')](_0x77d0ff);})[_0xf4e9('0x20')](function(_0xb63921){_0x2449f7[_0xf4e9('0x3c')]=_0xb63921;return _0x2449f7;})[_0xf4e9('0x20')](respondWithFilteredResult(_0x41de85,_0x77d0ff))[_0xf4e9('0x3d')](handleError(_0x41de85,null));};exports[_0xf4e9('0x3e')]=function(_0x32af0e,_0x10e9cb){var _0x42b91c={'raw':!![],'where':{'id':_0x32af0e[_0xf4e9('0x3f')]['id']}},_0x23ca6={};_0x23ca6[_0xf4e9('0x2b')]=_[_0xf4e9('0x40')](db[_0xf4e9('0x28')][_0xf4e9('0x29')]);_0x23ca6[_0xf4e9('0x2c')]=_[_0xf4e9('0x40')](_0x32af0e[_0xf4e9('0x2c')]);_0x23ca6['filters']=_[_0xf4e9('0x2d')](_0x23ca6['model'],_0x23ca6[_0xf4e9('0x2c')]);_0x42b91c[_0xf4e9('0x2f')]=_[_0xf4e9('0x2d')](_0x23ca6[_0xf4e9('0x2b')],qs['fields'](_0x32af0e[_0xf4e9('0x2c')][_0xf4e9('0x2e')]));_0x42b91c['attributes']=_0x42b91c[_0xf4e9('0x2f')][_0xf4e9('0x41')]?_0x42b91c[_0xf4e9('0x2f')]:_0x23ca6[_0xf4e9('0x2b')];if(_0x32af0e[_0xf4e9('0x2c')]['includeAll']){_0x42b91c[_0xf4e9('0x3a')]=[{'all':!![]}];}_0x42b91c=_[_0xf4e9('0x38')]({},_0x42b91c,_0x32af0e[_0xf4e9('0x39')]);return db[_0xf4e9('0x28')]['find'](_0x42b91c)[_0xf4e9('0x20')](handleEntityNotFound(_0x10e9cb,null))[_0xf4e9('0x20')](respondWithResult(_0x10e9cb,null))[_0xf4e9('0x3d')](handleError(_0x10e9cb,null));};exports[_0xf4e9('0x42')]=function(_0x4b9497,_0x31d08f){return db[_0xf4e9('0x28')][_0xf4e9('0x42')](_0x4b9497[_0xf4e9('0x43')],{})['then'](respondWithResult(_0x31d08f,0xc9))['catch'](handleError(_0x31d08f,null));};exports[_0xf4e9('0x44')]=function(_0x1182e8,_0x5385c3){if(_0x1182e8[_0xf4e9('0x43')]['id']){delete _0x1182e8[_0xf4e9('0x43')]['id'];}return db[_0xf4e9('0x28')][_0xf4e9('0x45')]({'where':{'id':_0x1182e8[_0xf4e9('0x3f')]['id']}})[_0xf4e9('0x20')](handleEntityNotFound(_0x5385c3,null))[_0xf4e9('0x20')](saveUpdates(_0x1182e8[_0xf4e9('0x43')],null))[_0xf4e9('0x20')](respondWithResult(_0x5385c3,null))[_0xf4e9('0x3d')](handleError(_0x5385c3,null));};exports[_0xf4e9('0x21')]=function(_0x4f07c6,_0x4cbae3){return db[_0xf4e9('0x28')][_0xf4e9('0x45')]({'where':{'id':_0x4f07c6[_0xf4e9('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4cbae3,null))[_0xf4e9('0x20')](removeEntity(_0x4cbae3,null))[_0xf4e9('0x3d')](handleError(_0x4cbae3,null));};exports[_0xf4e9('0x46')]=function(_0xc52199,_0x244017){return db[_0xf4e9('0x28')][_0xf4e9('0x46')]()[_0xf4e9('0x20')](respondWithResult(_0x244017,null))[_0xf4e9('0x3d')](handleError(_0x244017,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 309adce..8569435 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 _0xd3bc=['report_chat_transfer','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0xd3bc,0x9e));var _0xcd3b=function(_0x1f3708,_0x57266e){_0x1f3708=_0x1f3708-0x0;var _0x36f290=_0xd3bc[_0x1f3708];return _0x36f290;};'use strict';var _=require(_0xcd3b('0x0'));var util=require('util');var logger=require(_0xcd3b('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcd3b('0x2'));var rp=require(_0xcd3b('0x3'));var fs=require('fs');var path=require(_0xcd3b('0x4'));var rimraf=require(_0xcd3b('0x5'));var config=require(_0xcd3b('0x6'));var attributes=require(_0xcd3b('0x7'));module['exports']=function(_0x18bd94,_0x422b86){return _0x18bd94[_0xcd3b('0x8')](_0xcd3b('0x9'),attributes,{'tableName':_0xcd3b('0xa'),'paranoid':![],'indexes':[{'name':_0xcd3b('0xb'),'fields':[_0xcd3b('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x285f=['./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','util','api','moment','request-promise','../../config/environment'];(function(_0x284f11,_0x3b822a){var _0x3777d3=function(_0x4b29f3){while(--_0x4b29f3){_0x284f11['push'](_0x284f11['shift']());}};_0x3777d3(++_0x3b822a);}(_0x285f,0x195));var _0xf285=function(_0xe5c56d,_0x262b10){_0xe5c56d=_0xe5c56d-0x0;var _0x35d3b8=_0x285f[_0xe5c56d];return _0x35d3b8;};'use strict';var _=require('lodash');var util=require(_0xf285('0x0'));var logger=require('../../config/logger')(_0xf285('0x1'));var moment=require(_0xf285('0x2'));var BPromise=require('bluebird');var rp=require(_0xf285('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf285('0x4'));var attributes=require(_0xf285('0x5'));module[_0xf285('0x6')]=function(_0x2966a0,_0x1c1f03){return _0x2966a0[_0xf285('0x7')]('ChatTransferReport',attributes,{'tableName':_0xf285('0x8'),'paranoid':![],'indexes':[{'name':_0xf285('0x9'),'fields':[_0xf285('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 5d9d41f..cfe58b8 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 _0x4ec6=['error','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x4ec6,0x1e6));var _0x64ec=function(_0x2d1fe6,_0x280692){_0x2d1fe6=_0x2d1fe6-0x0;var _0x56d315=_0x4ec6[_0x2d1fe6];return _0x56d315;};'use strict';var _=require(_0x64ec('0x0'));var util=require(_0x64ec('0x1'));var moment=require('moment');var BPromise=require(_0x64ec('0x2'));var rs=require(_0x64ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64ec('0x4'))['db'];var utils=require(_0x64ec('0x5'));var logger=require(_0x64ec('0x6'))(_0x64ec('0x7'));var config=require('../../config/environment');var jayson=require(_0x64ec('0x8'));var client=jayson[_0x64ec('0x9')][_0x64ec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd2aa42,_0x4b3795,_0x198dbe){return new BPromise(function(_0x42d081,_0xbcf74a){return client[_0x64ec('0xb')](_0xd2aa42,_0x198dbe)[_0x64ec('0xc')](function(_0x45dabf){logger[_0x64ec('0xd')](_0x64ec('0xe'),_0x4b3795,_0x64ec('0xf'));logger[_0x64ec('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4b3795,_0x64ec('0xf'),JSON[_0x64ec('0x11')](_0x45dabf));if(_0x45dabf[_0x64ec('0x12')]){if(_0x45dabf[_0x64ec('0x12')]['code']===0x1f4){logger['error'](_0x64ec('0xe'),_0x4b3795,_0x45dabf['error'][_0x64ec('0x13')]);return _0xbcf74a(_0x45dabf['error'][_0x64ec('0x13')]);}logger[_0x64ec('0x12')](_0x64ec('0xe'),_0x4b3795,_0x45dabf['error'][_0x64ec('0x13')]);return _0x42d081(_0x45dabf['error']['message']);}else{logger[_0x64ec('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4b3795,_0x64ec('0xf'));_0x42d081(_0x45dabf['result']['message']);}})[_0x64ec('0x14')](function(_0x504d20){logger[_0x64ec('0x12')](_0x64ec('0xe'),_0x4b3795,_0x504d20);_0xbcf74a(_0x504d20);});});}
\ No newline at end of file
+var _0x1be4=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x49dd7c,_0x5cbdd7){var _0x565117=function(_0x3ef347){while(--_0x3ef347){_0x49dd7c['push'](_0x49dd7c['shift']());}};_0x565117(++_0x5cbdd7);}(_0x1be4,0x1f2));var _0x41be=function(_0x555c17,_0x2e6c2a){_0x555c17=_0x555c17-0x0;var _0x15a073=_0x1be4[_0x555c17];return _0x15a073;};'use strict';var _=require(_0x41be('0x0'));var util=require(_0x41be('0x1'));var moment=require(_0x41be('0x2'));var BPromise=require(_0x41be('0x3'));var rs=require(_0x41be('0x4'));var fs=require('fs');var Redis=require(_0x41be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x41be('0x6'));var logger=require(_0x41be('0x7'))(_0x41be('0x8'));var config=require(_0x41be('0x9'));var jayson=require(_0x41be('0xa'));var client=jayson[_0x41be('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x221c36,_0x41fcdb,_0x4b16f9){return new BPromise(function(_0x24b241,_0x4d2398){return client[_0x41be('0xc')](_0x221c36,_0x4b16f9)[_0x41be('0xd')](function(_0x503229){logger[_0x41be('0xe')](_0x41be('0xf'),_0x41fcdb,_0x41be('0x10'));logger[_0x41be('0x11')](_0x41be('0x12'),_0x41fcdb,'request\x20sent',JSON[_0x41be('0x13')](_0x503229));if(_0x503229[_0x41be('0x14')]){if(_0x503229['error'][_0x41be('0x15')]===0x1f4){logger[_0x41be('0x14')](_0x41be('0xf'),_0x41fcdb,_0x503229[_0x41be('0x14')]['message']);return _0x4d2398(_0x503229[_0x41be('0x14')]['message']);}logger[_0x41be('0x14')](_0x41be('0xf'),_0x41fcdb,_0x503229[_0x41be('0x14')][_0x41be('0x16')]);return _0x24b241(_0x503229['error'][_0x41be('0x16')]);}else{logger[_0x41be('0xe')](_0x41be('0xf'),_0x41fcdb,_0x41be('0x10'));_0x24b241(_0x503229[_0x41be('0x17')][_0x41be('0x16')]);}})[_0x41be('0x18')](function(_0x4026ee){logger[_0x41be('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x41fcdb,_0x4026ee);_0x4d2398(_0x4026ee);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index a961300..0c62bb6 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 _0xe100=['post','create','put','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x258777,_0x3b6a9e){var _0x541ec9=function(_0x2371d1){while(--_0x2371d1){_0x258777['push'](_0x258777['shift']());}};_0x541ec9(++_0x3b6a9e);}(_0xe100,0x193));var _0x0e10=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe100[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0e10('0x0'));var util=require(_0x0e10('0x1'));var path=require(_0x0e10('0x2'));var timeout=require('connect-timeout');var express=require(_0x0e10('0x3'));var router=express[_0x0e10('0x4')]();var fs_extra=require(_0x0e10('0x5'));var auth=require(_0x0e10('0x6'));var interaction=require(_0x0e10('0x7'));var config=require(_0x0e10('0x8'));var controller=require(_0x0e10('0x9'));router['get']('/',auth[_0x0e10('0xa')](),controller[_0x0e10('0xb')]);router[_0x0e10('0xc')](_0x0e10('0xd'),auth[_0x0e10('0xa')](),controller[_0x0e10('0xe')]);router[_0x0e10('0xc')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0e10('0xf')]('/',auth[_0x0e10('0xa')](),controller[_0x0e10('0x10')]);router[_0x0e10('0x11')]('/:id',auth[_0x0e10('0xa')](),controller['update']);router[_0x0e10('0x12')](_0x0e10('0x13'),auth[_0x0e10('0xa')](),controller[_0x0e10('0x14')]);module[_0x0e10('0x15')]=router;
\ No newline at end of file
+var _0x7323=['/describe','describe','get','show','post','create','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../config/environment','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x21c006,_0x3fc31b){var _0xcf5698=function(_0x4168fb){while(--_0x4168fb){_0x21c006['push'](_0x21c006['shift']());}};_0xcf5698(++_0x3fc31b);}(_0x7323,0x1bf));var _0x3732=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7323[_0x2bf141];return _0x48277b;};'use strict';var multer=require('multer');var util=require(_0x3732('0x0'));var path=require(_0x3732('0x1'));var timeout=require(_0x3732('0x2'));var express=require(_0x3732('0x3'));var router=express['Router']();var fs_extra=require(_0x3732('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3732('0x5'));var controller=require(_0x3732('0x6'));router['get']('/',auth[_0x3732('0x7')](),controller[_0x3732('0x8')]);router['get'](_0x3732('0x9'),auth['isAuthenticated'](),controller[_0x3732('0xa')]);router[_0x3732('0xb')]('/:id',auth[_0x3732('0x7')](),controller[_0x3732('0xc')]);router[_0x3732('0xd')]('/',auth[_0x3732('0x7')](),controller[_0x3732('0xe')]);router['put']('/:id',auth[_0x3732('0x7')](),controller['update']);router[_0x3732('0xf')](_0x3732('0x10'),auth[_0x3732('0x7')](),controller[_0x3732('0x11')]);module[_0x3732('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 558cdf5..ed031bb 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 _0x1216=['We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','ENUM','thumb','stringify','input','name','getDataValue','onlineForm','parse','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:','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared'];(function(_0x58b19d,_0x160b9e){var _0x3a77b8=function(_0x2640e9){while(--_0x2640e9){_0x58b19d['push'](_0x58b19d['shift']());}};_0x3a77b8(++_0x160b9e);}(_0x1216,0x1c9));var _0x6121=function(_0x590ef7,_0x175f08){_0x590ef7=_0x590ef7-0x0;var _0x4c2634=_0x1216[_0x590ef7];return _0x4c2634;};'use strict';var Sequelize=require(_0x6121('0x0'));var rs=require('randomstring');module[_0x6121('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6121('0x2')],'allowNull':![],'unique':_0x6121('0x3')},'description':{'type':Sequelize[_0x6121('0x2')]},'mapKey':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x4')},'key':{'type':Sequelize[_0x6121('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6121('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x6121('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6121('0x2')],'allowNull':![],'defaultValue':_0x6121('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6121('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6121('0x2')],'allowNull':![],'defaultValue':_0x6121('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6121('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6121('0x2')]},'animation':{'type':Sequelize[_0x6121('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x6121('0x9'),_0x6121('0xa')),'defaultValue':_0x6121('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0xb')},'start_chat_button':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x6121('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x6121('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6121('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x6121('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6121('0xe')]},'closingQuestion':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x11')},'noteTitle':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x13')},'closingMessage':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x16')},'conditionAgreement':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x17')},'ratingType':{'type':Sequelize[_0x6121('0x18')]('star',_0x6121('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6121('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6121('0xe')],'defaultValue':function(){return JSON[_0x6121('0x1a')]({'items':[{'type':_0x6121('0x1b'),'variable':null,'config':{'placeholder':_0x6121('0x1c'),'type':'text','required':!![]},'props':{'title':_0x6121('0x1c'),'helpText':''}},{'type':'input','props':{'title':_0x6121('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6121('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6121('0x1d')](_0x6121('0x1e'))?JSON[_0x6121('0x1f')](this['getDataValue'](_0x6121('0x1e'))):{};},'set':function(_0x1a48ad){return this['setDataValue'](_0x6121('0x1e'),JSON[_0x6121('0x1a')](_0x1a48ad));}},'offlineForm':{'type':Sequelize[_0x6121('0xe')],'defaultValue':function(){return JSON[_0x6121('0x1a')]({'items':[{'type':'input','props':{'title':_0x6121('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6121('0x4')},'variable':null},{'type':_0x6121('0x20'),'config':{'placeholder':_0x6121('0x21')},'props':{'title':'Comments','helpText':_0x6121('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6121('0x23'))?JSON['parse'](this[_0x6121('0x1d')](_0x6121('0x23'))):{};},'set':function(_0x56b866){return this['setDataValue'](_0x6121('0x23'),JSON[_0x6121('0x1a')](_0x56b866));}},'token':{'type':Sequelize[_0x6121('0x2')],'defaultValue':function(){return rs[_0x6121('0x24')]();}},'autoclose':{'type':Sequelize[_0x6121('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x27')},'offlineMessageBody':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x6121('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6121('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x16')},'sendUnmanaged':{'type':Sequelize[_0x6121('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6121('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6121('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6121('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6121('0x2')],'defaultValue':_0x6121('0x2a')},'verticalAlignment':{'type':Sequelize[_0x6121('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x2b')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6121('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6121('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6121('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6121('0x7')],'comment':_0x6121('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6121('0x2e'),'set':function(_0x498505){if(!_0x498505)this[_0x6121('0x2f')](_0x6121('0x30'),null);this[_0x6121('0x2f')](_0x6121('0x31'),_0x498505);}},'vidaooEscalation':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x6121('0x2')],'allowNull':![],'defaultValue':_0x6121('0x32')},'vidaooNote':{'type':Sequelize[_0x6121('0x2')],'defaultValue':function(){return _0x6121('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x6121('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6121('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6121('0xe')]}};
\ No newline at end of file
+var _0xdba0=['INTEGER','name','text','input','email','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','#fafafa','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}}','exports','STRING','address','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xdba0,0xe7));var _0x0dba=function(_0x43b584,_0x20a6bd){_0x43b584=_0x43b584-0x0;var _0x48f27b=_0xdba0[_0x43b584];return _0x48f27b;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x0dba('0x0')]={'name':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![],'unique':_0x0dba('0x2')},'description':{'type':Sequelize[_0x0dba('0x1')]},'mapKey':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x3')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![],'defaultValue':_0x0dba('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![],'defaultValue':_0x0dba('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![],'defaultValue':_0x0dba('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0dba('0x1')]},'animation':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0dba('0x7')](_0x0dba('0x8'),_0x0dba('0x9')),'defaultValue':_0x0dba('0x8')},'header_online':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0xa')},'start_chat_button':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0xb')},'offline_chat_button':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0xc')},'header_offline':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0xd')},'download_transcript':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x0dba('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0dba('0xf')]},'closingQuestion':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0dba('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0dba('0x13')},'closingMessage':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x14')},'closingMessageButton':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x15')},'ratingType':{'type':Sequelize[_0x0dba('0x7')](_0x0dba('0x16'),_0x0dba('0x17')),'defaultValue':_0x0dba('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x0dba('0x18')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0dba('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0dba('0x19'),'type':_0x0dba('0x1a'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x0dba('0x1b'),'props':{'title':_0x0dba('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':_0x0dba('0x1c'),'type':_0x0dba('0x1c')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0dba('0x1d')](_0x0dba('0x1e'))?JSON[_0x0dba('0x1f')](this[_0x0dba('0x1d')](_0x0dba('0x1e'))):{};},'set':function(_0x4ce202){return this[_0x0dba('0x20')](_0x0dba('0x1e'),JSON[_0x0dba('0x21')](_0x4ce202));}},'offlineForm':{'type':Sequelize[_0x0dba('0xf')],'defaultValue':function(){return JSON[_0x0dba('0x21')]({'items':[{'type':_0x0dba('0x1b'),'props':{'title':_0x0dba('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0dba('0x1c')},'variable':null},{'type':'textarea','config':{'placeholder':_0x0dba('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x0dba('0x1d')](_0x0dba('0x23'))?JSON[_0x0dba('0x1f')](this[_0x0dba('0x1d')](_0x0dba('0x23'))):{};},'set':function(_0x5d719e){return this['setDataValue'](_0x0dba('0x23'),JSON[_0x0dba('0x21')](_0x5d719e));}},'token':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':function(){return rs[_0x0dba('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0dba('0x1')]},'forwardOffline':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0dba('0x1')]},'waitingTitle':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0dba('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x27')},'offlineMessageBody':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0dba('0x29')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':_0x0dba('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0dba('0x1')]},'notificationTemplate':{'type':Sequelize[_0x0dba('0xf')],'defaultValue':function(){return _0x0dba('0x2a');}},'notificationSound':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x0dba('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0dba('0x2b')},'verticalAlignment':{'type':Sequelize[_0x0dba('0x18')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x0dba('0x1')]},'customerAvatar':{'type':Sequelize[_0x0dba('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0dba('0x18')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0dba('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0dba('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0dba('0x18')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x0dba('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0dba('0x18')],'comment':_0x0dba('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x0dba('0x6')],'defaultValue':![],'comment':_0x0dba('0x2e'),'set':function(_0xb6db55){if(!_0xb6db55)this[_0x0dba('0x20')](_0x0dba('0x2f'),null);this[_0x0dba('0x20')](_0x0dba('0x30'),_0xb6db55);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0dba('0x1')],'allowNull':![],'defaultValue':_0x0dba('0x31')},'vidaooNote':{'type':Sequelize[_0x0dba('0x1')],'defaultValue':function(){return _0x0dba('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x0dba('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0dba('0xf')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 0018935..ae2ef36 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 _0x0529=['defaults','contact','customerIp','cf-connecting-ip','first','split','lastName','x-real-port','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','firstName','messageId','created','autoclose','push','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','offline','files','CompanyId','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','utf8','render','offlineMessageBody','ChatOfflineMessage','mimetype','server','offline-chat','basename','openNewInteraction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','offlineMessageSubject','MailAccountId','originalname','subjectOffline','mapValues','email','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','nolimit','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','../../config/license/util','getLicense','virtual','License','increment','all','some','server/files/chat/iframe.ejs','remote','x-forwarded-for','x-real-ip','connection','remoteAddress','referer','replace','alignment','textColor','color_button','backgroundColor','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','limit','count','set','json','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','ChatWebsite','rows','show','params','Pause','keys','find','create','user','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','ChatWebsiteId','Disposition','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','priority','asc','account'];(function(_0x22844d,_0x1c7353){var _0x3528d0=function(_0x126dcb){while(--_0x126dcb){_0x22844d['push'](_0x22844d['shift']());}};_0x3528d0(++_0x1c7353);}(_0x0529,0x1bd));var _0x9052=function(_0x3f0a31,_0x593f0a){_0x3f0a31=_0x3f0a31-0x0;var _0x330ca9=_0x0529[_0x3f0a31];return _0x330ca9;};'use strict';var BPromise=require(_0x9052('0x0'));var Mustache=require(_0x9052('0x1'));var util=require(_0x9052('0x2'));var path=require(_0x9052('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9052('0x4'));var _=require('lodash');var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x9052('0x5'));var logger=require(_0x9052('0x6'))(_0x9052('0x7'));var config=require('../../config/environment');var db=require(_0x9052('0x8'))['db'];config[_0x9052('0x9')]=_['defaults'](config[_0x9052('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9052('0x9')]));require(_0x9052('0xa'))[_0x9052('0xb')](socket);var jayson=require(_0x9052('0xc'));var client=jayson[_0x9052('0xd')][_0x9052('0xe')]({'port':0x232c});var client9002=jayson[_0x9052('0xd')][_0x9052('0xe')]({'port':0x232a});var client9003=jayson[_0x9052('0xd')][_0x9052('0xe')]({'port':0x232b});var client9001=jayson[_0x9052('0xd')][_0x9052('0xe')]({'port':0x2329});function respondWithRpcPromise(_0x484196,_0x37fb40,_0x5b4c01,_0x3b31bc){return new BPromise(function(_0x252b5c,_0x17bfd9){var _0xc7134=_0x3b31bc||client;return _0xc7134[_0x9052('0xf')](_0x484196,_0x5b4c01)[_0x9052('0x10')](function(_0x46e60f){logger[_0x9052('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x37fb40,_0x9052('0x12'));logger[_0x9052('0x13')](_0x9052('0x14'),_0x37fb40,_0x9052('0x12'),JSON[_0x9052('0x15')](_0x46e60f));if(_0x46e60f[_0x9052('0x16')]){if(_0x46e60f[_0x9052('0x16')][_0x9052('0x17')]===0x1f4){logger[_0x9052('0x16')](_0x9052('0x18'),_0x37fb40,_0x46e60f['error'][_0x9052('0x19')]);return _0x17bfd9(_0x46e60f['error'][_0x9052('0x19')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x37fb40,_0x46e60f[_0x9052('0x16')]['message']);return _0x252b5c(_0x46e60f['error'][_0x9052('0x19')]);}else{logger[_0x9052('0x11')](_0x9052('0x18'),_0x37fb40,'request\x20sent');_0x252b5c(_0x46e60f[_0x9052('0x1a')]['message']);}})[_0x9052('0x1b')](function(_0x5f4262){logger['error'](_0x9052('0x18'),_0x37fb40,_0x5f4262);_0x17bfd9(_0x5f4262);});});}function respondWithStatusCode(_0x15d442,_0x1b17f6){_0x1b17f6=_0x1b17f6||0xcc;return function(_0x1f0313){if(_0x1f0313){return _0x15d442['sendStatus'](_0x1b17f6);}return _0x15d442[_0x9052('0x1c')](_0x1b17f6)[_0x9052('0x1d')]();};}function respondWithResult(_0x31e06f,_0x3a6110){_0x3a6110=_0x3a6110||0xc8;return function(_0x856a04){if(_0x856a04){return _0x31e06f[_0x9052('0x1c')](_0x3a6110)['json'](_0x856a04);}};}function respondWithFilteredResult(_0x232efb,_0x6bc510){return function(_0x4a31ba){if(_0x4a31ba){var _0x2cc00d=typeof _0x6bc510[_0x9052('0x1e')]===_0x9052('0x1f')&&typeof _0x6bc510[_0x9052('0x20')]===_0x9052('0x1f');var _0x1482c3=_0x4a31ba[_0x9052('0x21')];var _0x2be53a=_0x2cc00d?0x0:_0x6bc510[_0x9052('0x1e')];var _0x5de84d=_0x2cc00d?_0x4a31ba['count']:_0x6bc510[_0x9052('0x1e')]+_0x6bc510[_0x9052('0x20')];var _0x4fcf5b;if(_0x5de84d>=_0x1482c3){_0x5de84d=_0x1482c3;_0x4fcf5b=0xc8;}else{_0x4fcf5b=0xce;}_0x232efb[_0x9052('0x1c')](_0x4fcf5b);return _0x232efb[_0x9052('0x22')]('Content-Range',_0x2be53a+'-'+_0x5de84d+'/'+_0x1482c3)[_0x9052('0x23')](_0x4a31ba);}return null;};}function saveUpdates(_0x7fb396){return function(_0x4fbb2d){if(_0x4fbb2d){return _0x4fbb2d[_0x9052('0x24')](_0x7fb396)['then'](function(_0x19098f){return _0x19098f;});}return null;};}function removeEntity(_0x3cfe02){return function(_0x3189c3){if(_0x3189c3){return _0x3189c3['destroy']()['then'](function(){var _0x1a988b=_0x3189c3[_0x9052('0x25')]({'plain':!![]});var _0x58c2b4=_0x9052('0x26');return db[_0x9052('0x27')][_0x9052('0x28')]({'where':{'type':_0x58c2b4,'resourceId':_0x1a988b['id']}})['then'](function(){return _0x3189c3;});})[_0x9052('0x10')](function(){_0x3cfe02[_0x9052('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fd768){return function(_0x2ed5de){if(!_0x2ed5de){_0x4fd768[_0x9052('0x29')](0x194);}return _0x2ed5de;};}function handleError(_0x20d648,_0x7cedb5){_0x7cedb5=_0x7cedb5||0x1f4;return function(_0x18579d){logger[_0x9052('0x16')](_0x18579d[_0x9052('0x2a')]);if(_0x18579d[_0x9052('0x2b')]){delete _0x18579d['name'];}_0x20d648['status'](_0x7cedb5)[_0x9052('0x2c')](_0x18579d);};}exports[_0x9052('0x2d')]=function(_0x580519,_0x135706){var _0x1b0caf={'include':[{'model':db['Pause'],'as':_0x9052('0x2e')}]},_0x4027ac={},_0x9f40a8={'count':0x0,'rows':[]};var _0x59a18f=_[_0x9052('0x2f')](db['ChatWebsite'][_0x9052('0x30')],function(_0x4dc9be){return{'name':_0x4dc9be[_0x9052('0x31')],'type':_0x4dc9be[_0x9052('0x32')]['key']};});_0x4027ac[_0x9052('0x33')]=_[_0x9052('0x2f')](_0x59a18f,_0x9052('0x2b'));_0x4027ac[_0x9052('0x34')]=_['keys'](_0x580519[_0x9052('0x34')]);_0x4027ac[_0x9052('0x35')]=_[_0x9052('0x36')](_0x4027ac[_0x9052('0x33')],_0x4027ac[_0x9052('0x34')]);_0x1b0caf[_0x9052('0x37')]=_[_0x9052('0x36')](_0x4027ac[_0x9052('0x33')],qs[_0x9052('0x38')](_0x580519['query']['fields']));_0x1b0caf[_0x9052('0x37')]=_0x1b0caf[_0x9052('0x37')][_0x9052('0x39')]?_0x1b0caf[_0x9052('0x37')]:_0x4027ac[_0x9052('0x33')];if(!_0x580519[_0x9052('0x34')][_0x9052('0x3a')]('nolimit')){_0x1b0caf['limit']=qs[_0x9052('0x20')](_0x580519['query']['limit']);_0x1b0caf[_0x9052('0x1e')]=qs[_0x9052('0x1e')](_0x580519['query'][_0x9052('0x1e')]);}_0x1b0caf[_0x9052('0x3b')]=qs['sort'](_0x580519[_0x9052('0x34')][_0x9052('0x3c')]);_0x1b0caf['where']=qs[_0x9052('0x35')](_[_0x9052('0x3d')](_0x580519[_0x9052('0x34')],_0x4027ac[_0x9052('0x35')]),_0x59a18f);if(_0x580519[_0x9052('0x34')][_0x9052('0x3e')]){_0x1b0caf[_0x9052('0x3f')]=_[_0x9052('0x40')](_0x1b0caf[_0x9052('0x3f')],{'$or':_[_0x9052('0x2f')](_0x59a18f,function(_0x257868){if(_0x257868[_0x9052('0x32')]!==_0x9052('0x41')){var _0x29e692={};_0x29e692[_0x257868[_0x9052('0x2b')]]={'$like':'%'+_0x580519[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x29e692;}})});}_0x1b0caf=_[_0x9052('0x40')]({},_0x1b0caf,_0x580519[_0x9052('0x42')]);var _0x4a6b56={'where':_0x1b0caf[_0x9052('0x3f')]};return db['ChatWebsite']['count'](_0x4a6b56)[_0x9052('0x10')](function(_0x27abe5){_0x9f40a8[_0x9052('0x21')]=_0x27abe5;if(_0x580519[_0x9052('0x34')][_0x9052('0x43')]){_0x1b0caf[_0x9052('0x44')]=[{'all':!![]}];}return db[_0x9052('0x45')]['findAll'](_0x1b0caf);})['then'](function(_0x4fd7f4){_0x9f40a8[_0x9052('0x46')]=_0x4fd7f4;return _0x9f40a8;})['then'](respondWithFilteredResult(_0x135706,_0x1b0caf))[_0x9052('0x1b')](handleError(_0x135706,null));};exports[_0x9052('0x47')]=function(_0x1ae15e,_0xb6c929){var _0xe5bae1={'raw':![],'where':{'id':_0x1ae15e[_0x9052('0x48')]['id']},'include':[{'model':db[_0x9052('0x49')],'as':_0x9052('0x2e')}]},_0xd30c17={};_0xd30c17[_0x9052('0x33')]=_[_0x9052('0x4a')](db[_0x9052('0x45')][_0x9052('0x30')]);_0xd30c17[_0x9052('0x34')]=_[_0x9052('0x4a')](_0x1ae15e[_0x9052('0x34')]);_0xd30c17['filters']=_[_0x9052('0x36')](_0xd30c17[_0x9052('0x33')],_0xd30c17[_0x9052('0x34')]);_0xe5bae1['attributes']=_[_0x9052('0x36')](_0xd30c17[_0x9052('0x33')],qs['fields'](_0x1ae15e['query'][_0x9052('0x38')]));_0xe5bae1[_0x9052('0x37')]=_0xe5bae1['attributes']['length']?_0xe5bae1[_0x9052('0x37')]:_0xd30c17['model'];if(_0x1ae15e['query']['includeAll']){_0xe5bae1[_0x9052('0x44')]=[{'all':!![]}];}_0xe5bae1=_[_0x9052('0x40')]({},_0xe5bae1,_0x1ae15e[_0x9052('0x42')]);return db[_0x9052('0x45')][_0x9052('0x4b')](_0xe5bae1)[_0x9052('0x10')](handleEntityNotFound(_0xb6c929,null))[_0x9052('0x10')](respondWithResult(_0xb6c929,null))[_0x9052('0x1b')](handleError(_0xb6c929,null));};exports['create']=function(_0x4267b1,_0x41c86e){return db[_0x9052('0x45')][_0x9052('0x4c')](_0x4267b1['body'],{})[_0x9052('0x10')](function(_0x21baef){var _0x1abe59=_0x4267b1[_0x9052('0x4d')][_0x9052('0x25')]({'plain':!![]});if(!_0x1abe59)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1abe59['role']===_0x9052('0x4d')){var _0x41d480=_0x21baef[_0x9052('0x25')]({'plain':!![]});var _0x1e3f09='ChatWebsites';return db[_0x9052('0x4e')][_0x9052('0x4b')]({'where':{'name':_0x1e3f09,'userProfileId':_0x1abe59[_0x9052('0x4f')]},'raw':!![]})[_0x9052('0x10')](function(_0x169484){if(_0x169484&&_0x169484[_0x9052('0x50')]===0x0){return db[_0x9052('0x27')][_0x9052('0x4c')]({'name':_0x41d480[_0x9052('0x2b')],'resourceId':_0x41d480['id'],'type':_0x169484['name'],'sectionId':_0x169484['id']},{})[_0x9052('0x10')](function(){return _0x21baef;});}else{return _0x21baef;}})['catch'](function(_0x447b85){logger[_0x9052('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x447b85);throw _0x447b85;});}return _0x21baef;})[_0x9052('0x10')](respondWithResult(_0x41c86e,0xc9))[_0x9052('0x1b')](handleError(_0x41c86e,null));};exports['update']=function(_0x5bc591,_0x581978){if(_0x5bc591[_0x9052('0x51')]['id']){delete _0x5bc591['body']['id'];}return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0x5bc591[_0x9052('0x48')]['id']},'include':[{'model':db[_0x9052('0x49')],'as':_0x9052('0x2e')}]})[_0x9052('0x10')](handleEntityNotFound(_0x581978,null))['then'](saveUpdates(_0x5bc591['body'],null))[_0x9052('0x10')](respondWithResult(_0x581978,null))[_0x9052('0x1b')](handleError(_0x581978,null));};exports['destroy']=function(_0x5821cf,_0x2c3550){return db[_0x9052('0x45')]['find']({'where':{'id':_0x5821cf[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x2c3550,null))[_0x9052('0x10')](removeEntity(_0x2c3550,null))[_0x9052('0x1b')](handleError(_0x2c3550,null));};exports[_0x9052('0x52')]=function(_0x53fc6f,_0x4841c6){return db[_0x9052('0x45')][_0x9052('0x52')]()['then'](respondWithResult(_0x4841c6,null))['catch'](handleError(_0x4841c6,null));};exports[_0x9052('0x53')]=function(_0x4ddea0,_0xa557bf){if(_0x4ddea0[_0x9052('0x51')]['id']){delete _0x4ddea0[_0x9052('0x51')]['id'];}return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0x4ddea0[_0x9052('0x48')]['id']}})['then'](handleEntityNotFound(_0xa557bf,null))['then'](function(_0x2b88df){if(_0x2b88df){_0x4ddea0[_0x9052('0x51')][_0x9052('0x54')]=_0x2b88df['id'];return db[_0x9052('0x55')][_0x9052('0x4c')](_0x4ddea0[_0x9052('0x51')]);}})[_0x9052('0x10')](respondWithResult(_0xa557bf,null))[_0x9052('0x1b')](handleError(_0xa557bf,null));};exports['getDispositions']=function(_0xa87d46,_0x525254){var _0x14e327={'raw':![],'where':{}};var _0x2389bd={};var _0x35ae68={'count':0x0,'rows':[]};return db[_0x9052('0x45')]['findOne']({'where':{'id':_0xa87d46[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x525254,null))['then'](function(_0x4bd0f9){if(_0x4bd0f9){_0x2389bd['model']=_[_0x9052('0x4a')](db[_0x9052('0x55')][_0x9052('0x30')]);_0x2389bd[_0x9052('0x34')]=_[_0x9052('0x4a')](_0xa87d46[_0x9052('0x34')]);_0x2389bd[_0x9052('0x35')]=_[_0x9052('0x36')](_0x2389bd[_0x9052('0x33')],_0x2389bd[_0x9052('0x34')]);_0x14e327[_0x9052('0x37')]=_[_0x9052('0x36')](_0x2389bd[_0x9052('0x33')],qs['fields'](_0xa87d46['query'][_0x9052('0x38')]));_0x14e327[_0x9052('0x37')]=_0x14e327['attributes']['length']?_0x14e327[_0x9052('0x37')]:_0x2389bd[_0x9052('0x33')];if(!_0xa87d46[_0x9052('0x34')][_0x9052('0x3a')]('nolimit')){_0x14e327[_0x9052('0x20')]=qs[_0x9052('0x20')](_0xa87d46['query'][_0x9052('0x20')]);_0x14e327[_0x9052('0x1e')]=qs['offset'](_0xa87d46['query'][_0x9052('0x1e')]);}_0x14e327[_0x9052('0x3b')]=qs[_0x9052('0x3c')](_0xa87d46['query']['sort']);_0x14e327[_0x9052('0x3f')]=qs[_0x9052('0x35')](_[_0x9052('0x3d')](_0xa87d46['query'],_0x2389bd[_0x9052('0x35')]));_0x14e327[_0x9052('0x3f')][_0x9052('0x54')]=_0x4bd0f9['id'];if(_0xa87d46['query'][_0x9052('0x3e')]){_0x14e327[_0x9052('0x3f')]=_[_0x9052('0x40')](_0x14e327['where'],{'$or':_[_0x9052('0x2f')](_0x14e327['attributes'],function(_0x17e50a){var _0x5b2491={};_0x5b2491[_0x17e50a]={'$like':'%'+_0xa87d46[_0x9052('0x34')]['filter']+'%'};return _0x5b2491;})});}_0x14e327=_['merge']({},_0x14e327,_0xa87d46[_0x9052('0x42')]);return db['Disposition'][_0x9052('0x21')]({'where':_0x14e327[_0x9052('0x3f')]})[_0x9052('0x10')](function(_0x37afb5){_0x35ae68[_0x9052('0x21')]=_0x37afb5;if(_0xa87d46[_0x9052('0x34')][_0x9052('0x43')]){_0x14e327[_0x9052('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x9052('0x56')](_0x14e327);})[_0x9052('0x10')](function(_0x1a2018){_0x35ae68['rows']=_0x1a2018;return _0x35ae68;});}})[_0x9052('0x10')](respondWithFilteredResult(_0x525254,_0x14e327))[_0x9052('0x1b')](handleError(_0x525254,null));};exports['removeDispositions']=function(_0xebc64f,_0x33c694){return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0xebc64f['params']['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x33c694,null))['then'](function(_0x33bee1){if(_0x33bee1){return _0x33bee1[_0x9052('0x57')](_0xebc64f[_0x9052('0x34')][_0x9052('0x58')]);}})['then'](respondWithStatusCode(_0x33c694,null))[_0x9052('0x1b')](handleError(_0x33c694,null));};exports[_0x9052('0x59')]=function(_0x4fddda,_0x28b9f3){if(_0x4fddda[_0x9052('0x51')]['id']){delete _0x4fddda[_0x9052('0x51')]['id'];}return db[_0x9052('0x45')][_0x9052('0x4b')]({'where':{'id':_0x4fddda['params']['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x28b9f3,null))['then'](function(_0xa213a0){if(_0xa213a0){_0x4fddda[_0x9052('0x51')][_0x9052('0x54')]=_0xa213a0['id'];return db['CannedAnswer'][_0x9052('0x4c')](_0x4fddda['body']);}})[_0x9052('0x10')](respondWithResult(_0x28b9f3,null))['catch'](handleError(_0x28b9f3,null));};exports[_0x9052('0x5a')]=function(_0x537e5d,_0x31607d){var _0x5e801e={'raw':![],'where':{}};var _0x58c840={};var _0x1ed90f={'count':0x0,'rows':[]};return db[_0x9052('0x45')][_0x9052('0x5b')]({'where':{'id':_0x537e5d['params']['id']}})['then'](handleEntityNotFound(_0x31607d,null))[_0x9052('0x10')](function(_0x32c8ae){if(_0x32c8ae){_0x58c840[_0x9052('0x33')]=_[_0x9052('0x4a')](db[_0x9052('0x5c')][_0x9052('0x30')]);_0x58c840[_0x9052('0x34')]=_[_0x9052('0x4a')](_0x537e5d[_0x9052('0x34')]);_0x58c840['filters']=_['intersection'](_0x58c840[_0x9052('0x33')],_0x58c840['query']);_0x5e801e[_0x9052('0x37')]=_[_0x9052('0x36')](_0x58c840[_0x9052('0x33')],qs[_0x9052('0x38')](_0x537e5d[_0x9052('0x34')]['fields']));_0x5e801e[_0x9052('0x37')]=_0x5e801e[_0x9052('0x37')][_0x9052('0x39')]?_0x5e801e[_0x9052('0x37')]:_0x58c840['model'];if(!_0x537e5d[_0x9052('0x34')][_0x9052('0x3a')]('nolimit')){_0x5e801e[_0x9052('0x20')]=qs['limit'](_0x537e5d[_0x9052('0x34')][_0x9052('0x20')]);_0x5e801e[_0x9052('0x1e')]=qs[_0x9052('0x1e')](_0x537e5d[_0x9052('0x34')][_0x9052('0x1e')]);}_0x5e801e[_0x9052('0x3b')]=qs['sort'](_0x537e5d['query'][_0x9052('0x3c')]);_0x5e801e[_0x9052('0x3f')]=qs['filters'](_[_0x9052('0x3d')](_0x537e5d['query'],_0x58c840[_0x9052('0x35')]));_0x5e801e[_0x9052('0x3f')][_0x9052('0x54')]=_0x32c8ae['id'];if(_0x537e5d[_0x9052('0x34')][_0x9052('0x3e')]){_0x5e801e[_0x9052('0x3f')]=_[_0x9052('0x40')](_0x5e801e[_0x9052('0x3f')],{'$or':_[_0x9052('0x2f')](_0x5e801e['attributes'],function(_0x231ab5){var _0x198ee1={};_0x198ee1[_0x231ab5]={'$like':'%'+_0x537e5d[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x198ee1;})});}_0x5e801e=_[_0x9052('0x40')]({},_0x5e801e,_0x537e5d[_0x9052('0x42')]);return db[_0x9052('0x5c')][_0x9052('0x21')]({'where':_0x5e801e[_0x9052('0x3f')]})['then'](function(_0x2d21fa){_0x1ed90f[_0x9052('0x21')]=_0x2d21fa;if(_0x537e5d[_0x9052('0x34')][_0x9052('0x43')]){_0x5e801e[_0x9052('0x44')]=[{'all':!![]}];}return db[_0x9052('0x5c')]['findAll'](_0x5e801e);})[_0x9052('0x10')](function(_0x20ef26){_0x1ed90f['rows']=_0x20ef26;return _0x1ed90f;});}})['then'](respondWithFilteredResult(_0x31607d,_0x5e801e))[_0x9052('0x1b')](handleError(_0x31607d,null));};exports[_0x9052('0x5d')]=function(_0x2084bc,_0x3ffb00){return db[_0x9052('0x45')][_0x9052('0x4b')]({'where':{'id':_0x2084bc['params']['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x3ffb00,null))[_0x9052('0x10')](function(_0x18412d){if(_0x18412d){return _0x18412d[_0x9052('0x5d')](_0x2084bc[_0x9052('0x34')][_0x9052('0x58')]);}})[_0x9052('0x10')](respondWithStatusCode(_0x3ffb00,null))[_0x9052('0x1b')](handleError(_0x3ffb00,null));};exports[_0x9052('0x5e')]=function(_0x1f0d20,_0x1ae958){_0x1f0d20[_0x9052('0x51')][_0x9052('0x5f')]=_0x1f0d20[_0x9052('0x60')][_0x9052('0x61')];return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0x1f0d20[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x1ae958,null))[_0x9052('0x10')](saveUpdates(_0x1f0d20[_0x9052('0x51')],null))[_0x9052('0x10')](respondWithResult(_0x1ae958,null))[_0x9052('0x1b')](handleError(_0x1ae958,null));};exports['addAvatar']=function(_0x3d09ad,_0x47a360){_0x3d09ad[_0x9052('0x51')]['agentAvatar']=_0x3d09ad['file'][_0x9052('0x61')];return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0x3d09ad[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x47a360,null))['then'](saveUpdates(_0x3d09ad[_0x9052('0x51')],null))[_0x9052('0x10')](respondWithResult(_0x47a360,null))[_0x9052('0x1b')](handleError(_0x47a360,null));};exports['addCustomerAvatar']=function(_0x2288e2,_0x2f418d){_0x2288e2[_0x9052('0x51')][_0x9052('0x62')]=_0x2288e2['file'][_0x9052('0x61')];return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0x2288e2[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x2f418d,null))[_0x9052('0x10')](saveUpdates(_0x2288e2['body'],null))[_0x9052('0x10')](respondWithResult(_0x2f418d,null))[_0x9052('0x1b')](handleError(_0x2f418d,null));};exports[_0x9052('0x63')]=function(_0x2cec6e,_0x4fb222){_0x2cec6e['body'][_0x9052('0x64')]=_0x2cec6e['file']['filename'];return db[_0x9052('0x45')]['find']({'where':{'id':_0x2cec6e[_0x9052('0x48')]['id']}})['then'](handleEntityNotFound(_0x4fb222,null))['then'](saveUpdates(_0x2cec6e['body'],null))[_0x9052('0x10')](respondWithResult(_0x4fb222,null))[_0x9052('0x1b')](handleError(_0x4fb222,null));};exports[_0x9052('0x65')]=function(_0x3d61ea,_0x39c876){var _0x463b5e=path[_0x9052('0x66')](config[_0x9052('0x67')],_0x9052('0x68'));var _0xba6b4b={'where':{'id':_0x3d61ea['params']['id']},'attributes':['id',_0x9052('0x5f')],'raw':!![]};var _0x842868=![];return require('../../config/license/util')['getLicense']()[_0x9052('0x10')](function(_0x20f70a){if(_0x20f70a){_0x842868=_0x20f70a[_0x9052('0x69')];}})[_0x9052('0x10')](function(){return db[_0x9052('0x45')][_0x9052('0x4b')](_0xba6b4b);})[_0x9052('0x10')](handleEntityNotFound(_0x39c876,null))[_0x9052('0x10')](function(_0xf31a29){if(_0xf31a29){if(!_['isNil'](_0xf31a29[_0x9052('0x5f')])){if(fs['existsSync'](path[_0x9052('0x66')](config['root'],_0x9052('0x6a'),_0xf31a29['sitepic']))&&_0x842868){_0x463b5e=path['join'](config[_0x9052('0x67')],_0x9052('0x6a'),_0xf31a29[_0x9052('0x5f')]);}}return _0x39c876[_0x9052('0x6b')](_0x463b5e);}})['catch'](handleError(_0x39c876,null));};exports[_0x9052('0x6c')]=function(_0xa50056,_0x412466){var _0x96f7ec=path[_0x9052('0x66')](config[_0x9052('0x67')],_0x9052('0x6d'));var _0xc6f83e={'where':{'id':_0xa50056[_0x9052('0x48')]['id']},'attributes':['id',_0x9052('0x6e')],'raw':!![]};return db['ChatWebsite'][_0x9052('0x4b')](_0xc6f83e)['then'](handleEntityNotFound(_0x412466,null))[_0x9052('0x10')](function(_0x2a6509){if(_0x2a6509){if(!_[_0x9052('0x6f')](_0x2a6509[_0x9052('0x6e')])){if(fs[_0x9052('0x70')](path[_0x9052('0x66')](config[_0x9052('0x67')],_0x9052('0x71'),_0x2a6509[_0x9052('0x6e')]))){_0x96f7ec=path[_0x9052('0x66')](config['root'],_0x9052('0x71'),_0x2a6509['agentAvatar']);}}return _0x412466[_0x9052('0x6b')](_0x96f7ec);}})[_0x9052('0x1b')](handleError(_0x412466,null));};exports[_0x9052('0x72')]=function(_0x753760,_0x28b045){var _0xebed41=path[_0x9052('0x66')](config['root'],_0x9052('0x73'));var _0x54411b={'where':{'id':_0x753760[_0x9052('0x48')]['id']},'attributes':['id','customerAvatar',_0x9052('0x74')],'raw':!![]};return db[_0x9052('0x45')][_0x9052('0x4b')](_0x54411b)['then'](handleEntityNotFound(_0x28b045,null))[_0x9052('0x10')](function(_0x2e990e){if(_0x2e990e){if(!_[_0x9052('0x6f')](_0x2e990e[_0x9052('0x62')])){if(fs['existsSync'](path[_0x9052('0x66')](config['root'],_0x9052('0x71'),_0x2e990e[_0x9052('0x62')]))&&_0x2e990e[_0x9052('0x74')]){_0xebed41=path[_0x9052('0x66')](config['root'],_0x9052('0x71'),_0x2e990e[_0x9052('0x62')]);}}return _0x28b045[_0x9052('0x6b')](_0xebed41);}})[_0x9052('0x1b')](handleError(_0x28b045,null));};exports[_0x9052('0x75')]=function(_0x1482b8,_0x56a431){var _0x363dcc=path[_0x9052('0x66')](config[_0x9052('0x67')],_0x9052('0x76'));var _0x3bd7ed={'where':{'id':_0x1482b8[_0x9052('0x48')]['id']},'attributes':['id',_0x9052('0x64')],'raw':!![]};return db[_0x9052('0x45')][_0x9052('0x4b')](_0x3bd7ed)[_0x9052('0x10')](handleEntityNotFound(_0x56a431,null))[_0x9052('0x10')](function(_0x297047){if(_0x297047){if(!_[_0x9052('0x6f')](_0x297047[_0x9052('0x64')])){if(fs[_0x9052('0x70')](path[_0x9052('0x66')](config[_0x9052('0x67')],_0x9052('0x71'),_0x297047['systemAvatar']))){_0x363dcc=path[_0x9052('0x66')](config[_0x9052('0x67')],_0x9052('0x71'),_0x297047[_0x9052('0x64')]);}}return _0x56a431[_0x9052('0x6b')](_0x363dcc);}})[_0x9052('0x1b')](handleError(_0x56a431,null));};exports[_0x9052('0x77')]=function(_0x3b5718,_0x76e119){var _0x215dd5=require('user-agent-parser');var _0x4c3d03=new _0x215dd5();var _0x32af25=_0x4c3d03[_0x9052('0x78')](_0x3b5718[_0x9052('0x79')][_0x9052('0x7a')])[_0x9052('0x7b')]();var _0x32e3dd={'body':_0x3b5718[_0x9052('0x51')],'channel':'chat'};var _0x36b5e2=[];var _0x312949=[];var _0x668951={};var _0x444228=![];return db[_0x9052('0x7c')][_0x9052('0x52')]()[_0x9052('0x10')](function(_0x427dc4){if(!_0x427dc4){throw new db[(_0x9052('0x7d'))][(_0x9052('0x7e'))](_0x9052('0x7f'));}_0x36b5e2=_[_0x9052('0x80')](_[_0x9052('0x4a')](_0x427dc4),[_0x9052('0x81'),_0x9052('0x82')]);_0x312949=_[_0x9052('0x80')](_[_0x9052('0x4a')](_0x427dc4),['createdAt','updatedAt','CompanyId',_0x9052('0x83')]);if(_0x3b5718[_0x9052('0x51')]['id']){delete _0x3b5718[_0x9052('0x51')]['id'];}if(_[_0x9052('0x6f')](_0x3b5718[_0x9052('0x51')][_0x9052('0x84')])){throw new db[(_0x9052('0x7d'))][(_0x9052('0x7e'))](_0x9052('0x85'));}if(_[_0x9052('0x6f')](_0x3b5718[_0x9052('0x51')][_0x9052('0x51')])||_0x3b5718[_0x9052('0x51')][_0x9052('0x51')]===''){throw new db[(_0x9052('0x7d'))][(_0x9052('0x7e'))](_0x9052('0x86'));}if(_[_0x9052('0x6f')](_0x3b5718['body']['mapKey'])){throw new db['Sequelize'][(_0x9052('0x7e'))](_0x9052('0x87')+_0x312949);}if(!_[_0x9052('0x88')](_0x312949,_0x3b5718[_0x9052('0x51')][_0x9052('0x89')])){throw new db['Sequelize'][(_0x9052('0x7e'))](_0x9052('0x8a')+_0x312949);}_0x668951[_0x3b5718[_0x9052('0x51')][_0x9052('0x89')]]=_0x3b5718[_0x9052('0x51')][_0x9052('0x84')];})['then'](function(){return db['ChatWebsite'][_0x9052('0x4b')]({'where':{'id':_0x3b5718[_0x9052('0x48')]['id']},'include':[{'model':db[_0x9052('0x8b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9052('0x8c'),'where':_0x668951,'limit':0x1,'order':[[_0x9052('0x82'),_0x9052('0x8d')]]}]},{'model':db[_0x9052('0x8e')],'as':_0x9052('0x8f')}]});})[_0x9052('0x10')](handleEntityNotFound(_0x76e119,null))['then'](function(_0x2a27a9){if(_0x2a27a9&&_0x2a27a9[_0x9052('0x90')]){_0x32e3dd['account']=_0x2a27a9;_0x32e3dd[_0x9052('0x91')]=_0x2a27a9[_0x9052('0x8f')];_0x32e3dd[_0x9052('0x92')]=_0x2a27a9[_0x9052('0x90')];_0x32e3dd['applications']=_[_0x9052('0x93')](_0x32e3dd[_0x9052('0x91')],[_0x9052('0x94')],[_0x9052('0x95')]);if(_0x32e3dd[_0x9052('0x96')][_0x9052('0x8f')]){delete _0x32e3dd['account'][_0x9052('0x8f')];}if(_0x32e3dd[_0x9052('0x96')][_0x9052('0x90')]&&_0x32e3dd[_0x9052('0x96')][_0x9052('0x90')][_0x9052('0x8c')][_0x9052('0x39')]){return _0x32e3dd[_0x9052('0x96')][_0x9052('0x90')]['Contacts'][0x0];}var _0xe210a0=_[_0x9052('0x97')](_0x3b5718['body'],{'firstName':_0x3b5718[_0x9052('0x51')][_0x9052('0x84')],'ListId':_0x2a27a9[_0x9052('0x83')]});_0xe210a0[_0x3b5718[_0x9052('0x51')][_0x9052('0x89')]]=_0x3b5718[_0x9052('0x51')]['from'];return db[_0x9052('0x7c')]['create'](_0xe210a0,{'fields':_0x36b5e2,'raw':!![]});}})[_0x9052('0x10')](handleEntityNotFound(_0x76e119,null))[_0x9052('0x10')](function(_0xf3f697){_0x32e3dd[_0x9052('0x98')]=_0xf3f697;var _0x518450=_0x3b5718[_0x9052('0x51')][_0x9052('0x99')];if(_0x3b5718[_0x9052('0x79')][_0x9052('0x9a')]){_0x518450=_0x3b5718[_0x9052('0x79')][_0x9052('0x9a')];}else if(_0x3b5718[_0x9052('0x79')]['x-forwarded-for']){_0x518450=_[_0x9052('0x9b')](_0x3b5718[_0x9052('0x79')]['x-forwarded-for'][_0x9052('0x9c')](','));}if(_0xf3f697){var _0x3e8af5={'ContactId':_0xf3f697['id'],'ChatWebsiteId':_0x3b5718[_0x9052('0x48')]['id'],'from':(_0xf3f697['firstName']||'')+'\x20'+(_0xf3f697[_0x9052('0x9d')]||''),'customerIp':_0x518450,'customerPort':_0x3b5718[_0x9052('0x79')][_0x9052('0x9e')]?_0x3b5718[_0x9052('0x79')][_0x9052('0x9e')]:null,'referer':_0x3b5718[_0x9052('0x51')]['referer'],'browserName':_0x32af25[_0x9052('0x9f')][_0x9052('0x2b')]&&_0x32af25[_0x9052('0x9f')]['version']?util[_0x9052('0xa0')](_0x9052('0xa1'),_0x32af25['browser'][_0x9052('0x2b')],_0x32af25[_0x9052('0x9f')][_0x9052('0xa2')]):_0x9052('0xa3'),'browserVersion':_0x32af25['browser'][_0x9052('0xa2')]||_0x9052('0xa3'),'osName':util['format'](_0x9052('0xa1'),_0x32af25['os']['name'],_0x32af25['os']['version']),'osVersion':_0x32af25['os'][_0x9052('0xa2')],'deviceModel':_0x32af25[_0x9052('0xa4')]['model']&&_0x32af25['device'][_0x9052('0xa5')]?util['format'](_0x9052('0xa6'),_0x32af25[_0x9052('0xa4')][_0x9052('0x33')],_0x32af25[_0x9052('0xa4')][_0x9052('0xa5')],_0x32af25[_0x9052('0xa4')]['type']):null,'deviceVendor':_0x32af25['device'][_0x9052('0xa5')],'deviceType':_0x32af25['device']['type'],'formData':JSON[_0x9052('0x15')](_0x3b5718[_0x9052('0x51')])};var _0x38de54={'ChatWebsiteId':_0x3b5718['params']['id'],'closed':![]};if(_0x3b5718[_0x9052('0x51')][_0x9052('0xa7')]){_0x38de54['threadId']=_0x3b5718[_0x9052('0x51')][_0x9052('0xa7')];return db['ChatInteraction'][_0x9052('0x4b')]({'where':_0x38de54})['then'](function(_0x360b94){if(_0x360b94){return[_0x360b94,![]];}_0x3e8af5[_0x9052('0xa7')]=_0x3b5718[_0x9052('0x51')][_0x9052('0xa7')];_0x3e8af5['externalUrl']=_0x3b5718[_0x9052('0x51')][_0x9052('0xa8')];return db[_0x9052('0xa9')][_0x9052('0x4c')](_0x3e8af5)['then'](function(_0x3ba578){return[_0x3ba578,!![]];});});}_0x38de54['ContactId']=_0xf3f697['id'];if(_0x3b5718[_0x9052('0x51')][_0x9052('0xaa')]&&_0x3b5718[_0x9052('0x51')][_0x9052('0xaa')]['id']){_0x38de54['id']=_0x3b5718[_0x9052('0x51')][_0x9052('0xaa')]['id'];return db[_0x9052('0xa9')][_0x9052('0x4b')]({'where':_0x38de54})[_0x9052('0x10')](function(_0xddfdd){if(_0xddfdd){return[_0xddfdd,![]];}return db[_0x9052('0xa9')][_0x9052('0x4c')](_0x3e8af5)[_0x9052('0x10')](function(_0x13bcc8){return[_0x13bcc8,!![]];});});}return db[_0x9052('0xa9')][_0x9052('0x4c')](_0x3e8af5)[_0x9052('0x10')](function(_0x282354){return[_0x282354,!![]];});}})[_0x9052('0xab')](function(_0x5ae82c,_0x4a0a76){if(_0x5ae82c){_0x444228=_0x4a0a76;if(!_0x4a0a76){var _0x398893={'from':(_0x32e3dd[_0x9052('0x98')][_0x9052('0xac')]||'')+'\x20'+(_0x32e3dd[_0x9052('0x98')][_0x9052('0x9d')]||'')};if(_0x3b5718[_0x9052('0x51')]['threadId']&&_0x3b5718[_0x9052('0x51')][_0x9052('0xad')]&&_0x3b5718['body'][_0x9052('0xa7')]!=_0x3b5718['body'][_0x9052('0xad')]){_0x398893[_0x9052('0xa7')]=_0x3b5718['body'][_0x9052('0xad')];}return _0x5ae82c[_0x9052('0x24')](_0x398893);}else{return _0x5ae82c;}}})['then'](function(_0x1f847d){_0x32e3dd[_0x9052('0xaa')]=_0x1f847d[_0x9052('0x25')]({'plain':!![]});_0x32e3dd['interaction']['created']=_0x444228;if(_0x32e3dd['interaction'][_0x9052('0xae')]){if(_0x32e3dd[_0x9052('0x96')][_0x9052('0xaf')]){_0x32e3dd['applications'][_0x9052('0xb0')]({'id':0x0,'priority':_0x32e3dd[_0x9052('0x91')][_0x9052('0x39')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x9052('0xb1')][_0x9052('0x4c')]({'body':_0x3b5718[_0x9052('0x51')][_0x9052('0x51')],'ChatWebsiteId':_0x3b5718[_0x9052('0x48')]['id'],'ChatInteractionId':_0x1f847d['id'],'direction':'in','ContactId':_0x32e3dd[_0x9052('0x98')]['id'],'AttachmentId':_0x3b5718[_0x9052('0x51')][_0x9052('0xb2')]});})[_0x9052('0x10')](function(_0x5cb116){_0x32e3dd[_0x9052('0x19')]=_0x5cb116;if(_0x32e3dd['interaction'][_0x9052('0xb3')]){return db[_0x9052('0xb4')][_0x9052('0x4b')]({'attributes':['id',_0x9052('0x2b')],'where':{'id':_0x32e3dd[_0x9052('0xaa')]['UserId']}})['then'](function(_0x4f0e99){if(_0x4f0e99){_0x32e3dd['applications'][_0x9052('0xb5')]({'id':0x0,'priority':0x0,'app':_0x9052('0xb6'),'appdata':_0x4f0e99[_0x9052('0x2b')]+','+(_0x32e3dd['account'][_0x9052('0xb7')]||0xa),'interval':_0x9052('0xb8')});_0x32e3dd[_0x9052('0xb9')]=!![];}return respondWithRpcPromise(_0x9052('0xba'),'startRouting',_0x32e3dd);});}return respondWithRpcPromise('Start','startRouting',_0x32e3dd);})[_0x9052('0x10')](function(_0x629e91){respondWithRpcPromise('EventManager','EventManager',{'event':_0x9052('0x77'),'message':_0x629e91},client9002);return _0x629e91;})[_0x9052('0x10')](respondWithResult(_0x76e119,null))['catch'](handleError(_0x76e119,null));};exports[_0x9052('0xbb')]=function(_0x336ce4,_0x154ebb){var _0x379462,_0x4263c1,_0x5290a0;var _0x3a134=[];var _0x3b187e={};var _0x262867=_0x336ce4[_0x9052('0xbc')]||[];var _0x6ded2b=[];var _0x1c4d8e;return db[_0x9052('0x7c')][_0x9052('0x52')]()[_0x9052('0x10')](function(_0x51bd13){if(!_0x51bd13){throw new db[(_0x9052('0x7d'))]['ValidationError']('no\x20available\x20attributes');}_0x3a134=_['difference'](_[_0x9052('0x4a')](_0x51bd13),['createdAt',_0x9052('0x82'),_0x9052('0xbd'),_0x9052('0x83')]);if(_0x336ce4['body']['id']){delete _0x336ce4[_0x9052('0x51')]['id'];}if(_[_0x9052('0x6f')](_0x336ce4[_0x9052('0x51')][_0x9052('0x84')])){throw _0x154ebb['status'](0x1f4)[_0x9052('0x2c')](new db[(_0x9052('0x7d'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x9052('0x6f')](_0x336ce4[_0x9052('0x51')]['body'])||_0x336ce4[_0x9052('0x51')][_0x9052('0x51')]===''){throw _0x154ebb[_0x9052('0x1c')](0x1f4)['send'](new db[(_0x9052('0x7d'))][(_0x9052('0x7e'))](_0x9052('0x86')));}if(_['isNil'](_0x336ce4[_0x9052('0x51')][_0x9052('0xbe')])){throw _0x154ebb['status'](0x1f4)[_0x9052('0x2c')](new db[(_0x9052('0x7d'))][(_0x9052('0x7e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a134));}if(!_[_0x9052('0x88')](_0x3a134,_0x336ce4[_0x9052('0x51')][_0x9052('0xbe')])){throw _0x154ebb['status'](0x1f4)[_0x9052('0x2c')](new db[(_0x9052('0x7d'))]['ValidationError'](_0x9052('0xbf')+_0x3a134));}_0x3b187e[_0x336ce4[_0x9052('0x51')]['mapKeyOffline']]=_0x336ce4['body'][_0x9052('0x84')];})[_0x9052('0x10')](function(){return db[_0x9052('0x45')][_0x9052('0x4b')]({'where':{'id':_0x336ce4[_0x9052('0x48')]['id']},'include':[{'model':db[_0x9052('0x8b')],'as':_0x9052('0x90')},{'model':db['MailAccount'],'as':_0x9052('0xc0')}]});})[_0x9052('0x10')](handleEntityNotFound(_0x154ebb,null))[_0x9052('0x10')](function(_0x312894){if(_0x312894&&_0x312894[_0x9052('0x90')]){_0x4263c1=_0x312894;var _0x2bd8e1=_[_0x9052('0x97')](_0x336ce4[_0x9052('0x51')],{'firstName':_0x336ce4[_0x9052('0x51')][_0x9052('0x84')],'phone':_0x336ce4[_0x9052('0x51')][_0x9052('0x84')],'ListId':_0x312894[_0x9052('0x83')]});_0x2bd8e1[_0x336ce4[_0x9052('0x51')][_0x9052('0xbe')]]=_0x336ce4[_0x9052('0x51')]['from'];return db[_0x9052('0x7c')][_0x9052('0xc1')]({'where':_0x3b187e,'defaults':_0x2bd8e1});}})[_0x9052('0xab')](function(_0x11e6a7){if(_0x11e6a7){_0x5290a0=_0x11e6a7;var _0x1279c8=fs['readFileSync'](path[_0x9052('0x66')](config[_0x9052('0x67')],'server/files/templates/chatOfflineMessage.ejs'),_0x9052('0xc2'));var _0x47cbc6=ejs[_0x9052('0xc3')](_0x1279c8,{'body':_['toPairs'](_0x336ce4[_0x9052('0x51')][_0x9052('0x51')]),'bodyTitle':_0x4263c1[_0x9052('0xc4')]});return db[_0x9052('0xc5')][_0x9052('0x4c')]({'body':_0x47cbc6,'ContactId':_0x11e6a7['id'],'ChatWebsiteId':_0x4263c1['id']});}})[_0x9052('0x10')](function(_0x2ed39f){_0x1c4d8e=_0x2ed39f;if(_0x262867[_0x9052('0x39')]){var _0x416ab5=_0x262867[_0x9052('0x2f')](function(_0x251bfb){return{'name':_0x251bfb['originalname'],'basename':_0x251bfb[_0x9052('0x61')],'type':_0x251bfb[_0x9052('0xc6')],'ChatOfflineMessageId':_0x2ed39f['id']};});_0x6ded2b=_0x416ab5[_0x9052('0x2f')](_0x247073=>{var _0x2d50c9={'filename':_0x247073[_0x9052('0x2b')],'path':path['join'](config['root'],_0x9052('0xc7'),'files','attachments',_0x9052('0xc8'),_0x247073[_0x9052('0xc9')])};return _0x2d50c9;});if(!_0x4263c1[_0x9052('0xca')]){return db['sequelize']['transaction'](function(_0x311efb){return db[_0x9052('0xcb')][_0x9052('0xcc')](_0x416ab5,{'transaction':_0x311efb});});}}})['then'](function(){if(_0x1c4d8e){_0x379462=_0x1c4d8e;return db['MailAccount'][_0x9052('0x5b')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})[_0x9052('0x10')](function(_0x140b4e){if(_0x140b4e&&_0x140b4e[_0x9052('0xcd')]&&_0x4263c1[_0x9052('0xce')]&&_0x4263c1[_0x9052('0xcf')]){var _0x5e60b1={'tls':{'rejectUnauthorized':![]}};if(_0x140b4e[_0x9052('0xcd')]['service']){_0x5e60b1[_0x9052('0xd0')]=_0x140b4e[_0x9052('0xcd')]['service'];}else{_0x5e60b1[_0x9052('0xd1')]=_0x140b4e['Smtp'][_0x9052('0xd1')];_0x5e60b1[_0x9052('0xd2')]=_0x140b4e[_0x9052('0xcd')][_0x9052('0xd2')];_0x5e60b1[_0x9052('0xd3')]=_0x140b4e[_0x9052('0xcd')][_0x9052('0xd3')];}if(_0x140b4e['Smtp'][_0x9052('0xd4')]){_0x5e60b1[_0x9052('0xd5')]={'user':_0x140b4e[_0x9052('0xcd')][_0x9052('0x4d')],'pass':_0x140b4e[_0x9052('0xcd')][_0x9052('0xd6')]};}return respondWithRpcPromise(_0x9052('0xd7'),_0x9052('0xd8'),{'account':_0x5e60b1,'message':{'from':util[_0x9052('0xa0')]('\x22%s\x22\x20<%s>',_0x140b4e[_0x9052('0x2b')],_0x140b4e['email']||_0x140b4e[_0x9052('0xcd')][_0x9052('0x4d')]),'to':_0x4263c1[_0x9052('0xcf')],'subject':_0x4263c1[_0x9052('0xd9')],'html':_0x379462['body'],'attachments':_0x6ded2b}},client9003)[_0x9052('0x10')](function(){return _0x379462;})[_0x9052('0x1b')](function(_0x5d8392){console[_0x9052('0x16')](_0x5d8392);});}})[_0x9052('0x10')](function(){if(_0x4263c1&&_0x4263c1[_0x9052('0xca')]&&_0x4263c1[_0x9052('0xda')]){var _0x4dbc00=[];if(_0x262867[_0x9052('0x39')]){_0x4dbc00=_0x262867[_0x9052('0x2f')](function(_0x5da56b){return{'name':_0x5da56b[_0x9052('0xdb')],'basename':_0x5da56b['filename'],'type':_0x5da56b[_0x9052('0xc6')],'ChatOfflineMessageId':_0x1c4d8e['id']};});}var _0x4584c1;if(!_[_0x9052('0x6f')](_0x4263c1[_0x9052('0xdc')])){var _0x55c04a=_[_0x9052('0x2f')](_0x336ce4[_0x9052('0x51')],function(_0x233b6d){return _0x233b6d;});var _0xa42761=_['toPairsIn'](_0x55c04a)[0x0];var _0x5d35b7=_[_0x9052('0xdd')](_0xa42761,function(_0x492c8c){return _0x492c8c;});_0x4584c1=_0x5d35b7[0x1][_0x4263c1[_0x9052('0xdc')]];}var _0x5c4f43={'from':_0x5290a0[_0x9052('0xde')],'firstName':_0x5290a0['firstName'],'lastName':_0x5290a0[_0x9052('0x9d')],'mapKey':_0x9052('0xde'),'message':{'from':_0x5290a0[_0x9052('0xde')],'to':_0x4263c1['MailAccount'][_0x9052('0xde')],'cc':'','subject':_[_0x9052('0x6f')](_0x4584c1)?_0x4263c1[_0x9052('0xd9')]:_0x4584c1,'messageId':'','sentAt':new Date(),'attach':_0x4dbc00[_0x9052('0x39')],'attachments':_0x4dbc00,'originChannel':_0x9052('0xdf'),'ChatWebsiteId':_0x4263c1['id'],'ChatOfflineMessageId':_0x379462['id'],'originTo':_0x4263c1[_0x9052('0xc0')][_0x9052('0xde')]},'body':_0x379462['body']};var _0x492e75={'account':{'id':_0x4263c1[_0x9052('0xda')]},'body':_0x5c4f43,'log':_0x9052('0xe0')};return respondWithRpcPromise(_0x9052('0xe0'),_0x9052('0xe1'),_0x492e75,client9001)[_0x9052('0x10')](function(){return _0x379462;})[_0x9052('0x1b')](function(_0x5911e7){console[_0x9052('0x16')](_0x5911e7);});}return;})[_0x9052('0x10')](function(){if(_0x379462){return _0x379462;}})[_0x9052('0x10')](respondWithResult(_0x154ebb,null))[_0x9052('0x1b')](function(_0x270fae){console[_0x9052('0x16')](_0x9052('0x1b'),_0x270fae);for(var _0x1d3f22 of _0x262867){var _0x31bc31=path[_0x9052('0x66')](config['root'],'server',_0x9052('0xbc'),'attachments',_0x9052('0xc8'),_0x1d3f22[_0x9052('0x61')]);fs_extra[_0x9052('0xe2')](_0x31bc31)[_0x9052('0x1b')](function(_0x2b57a3){console[_0x9052('0x16')](_0x9052('0xe3'),_0x31bc31,_0x2b57a3);});}});};exports['addInteraction']=function(_0x557b87,_0x1eec94){return db[_0x9052('0xa9')][_0x9052('0x4b')]({'where':{'id':_0x557b87[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x1eec94,null))[_0x9052('0x10')](function(_0x2a0aab){if(_0x2a0aab){return _0x2a0aab[_0x9052('0xe4')](_0x557b87[_0x9052('0x51')]['ids'],_[_0x9052('0xe5')](_0x557b87[_0x9052('0x51')],[_0x9052('0x58'),'id'])||{});}})[_0x9052('0x10')](respondWithResult(_0x1eec94,null))['catch'](handleError(_0x1eec94,null));};exports['getInteractions']=function(_0x5110ee,_0x537240){var _0x18083d={'raw':![],'where':{}};var _0x25ec1a={};var _0x3b33da={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9052('0x5b')]({'where':{'id':_0x5110ee[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x537240,null))[_0x9052('0x10')](function(_0x585e96){if(_0x585e96){_0x25ec1a['model']=_['keys'](db[_0x9052('0xa9')][_0x9052('0x30')]);_0x25ec1a[_0x9052('0x34')]=_['keys'](_0x5110ee[_0x9052('0x34')]);_0x25ec1a[_0x9052('0x35')]=_[_0x9052('0x36')](_0x25ec1a['model'],_0x25ec1a[_0x9052('0x34')]);_0x18083d[_0x9052('0x37')]=_[_0x9052('0x36')](_0x25ec1a[_0x9052('0x33')],qs[_0x9052('0x38')](_0x5110ee['query']['fields']));_0x18083d[_0x9052('0x37')]=_0x18083d['attributes']['length']?_0x18083d[_0x9052('0x37')]:_0x25ec1a[_0x9052('0x33')];if(!_0x5110ee['query']['hasOwnProperty'](_0x9052('0xe6'))){_0x18083d[_0x9052('0x20')]=qs[_0x9052('0x20')](_0x5110ee['query'][_0x9052('0x20')]);_0x18083d[_0x9052('0x1e')]=qs[_0x9052('0x1e')](_0x5110ee[_0x9052('0x34')][_0x9052('0x1e')]);}_0x18083d[_0x9052('0x3b')]=qs[_0x9052('0x3c')](_0x5110ee[_0x9052('0x34')][_0x9052('0x3c')]);_0x18083d[_0x9052('0x3f')]=qs[_0x9052('0x35')](_[_0x9052('0x3d')](_0x5110ee[_0x9052('0x34')],_0x25ec1a['filters']));_0x18083d[_0x9052('0x3f')][_0x9052('0x54')]=_0x585e96['id'];if(_0x5110ee[_0x9052('0x34')][_0x9052('0x3e')]){_0x18083d[_0x9052('0x3f')]=_['merge'](_0x18083d[_0x9052('0x3f')],{'$or':_['map'](_0x18083d[_0x9052('0x37')],function(_0x5d8d83){var _0x2724f6={};_0x2724f6[_0x5d8d83]={'$like':'%'+_0x5110ee[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x2724f6;})});}_0x18083d=_[_0x9052('0x40')]({},_0x18083d,_0x5110ee[_0x9052('0x42')]);return db[_0x9052('0xa9')][_0x9052('0x21')]({'where':_0x18083d['where']})[_0x9052('0x10')](function(_0x2d38e7){_0x3b33da[_0x9052('0x21')]=_0x2d38e7;if(_0x5110ee[_0x9052('0x34')]['includeAll']){_0x18083d[_0x9052('0x44')]=[{'model':db['CmContact'],'as':_0x9052('0xe7'),'required':![]},{'model':db[_0x9052('0xb4')],'as':'Owner','attributes':[_0x9052('0x2b'),_0x9052('0xe8'),_0x9052('0xe9')],'required':![]},{'model':db[_0x9052('0xea')],'as':_0x9052('0xeb'),'attributes':['id',_0x9052('0x2b'),_0x9052('0xec')],'where':_0x5110ee[_0x9052('0x34')][_0x9052('0xed')]?{'id':_0x5110ee[_0x9052('0x34')][_0x9052('0xed')]}:undefined,'required':_0x5110ee[_0x9052('0x34')][_0x9052('0xed')]?!![]:![]}];}return db[_0x9052('0xa9')]['findAll'](_0x18083d);})[_0x9052('0x10')](function(_0x48a490){_0x3b33da[_0x9052('0x46')]=_0x48a490;return _0x3b33da;});}})['then'](respondWithFilteredResult(_0x537240,_0x18083d))[_0x9052('0x1b')](handleError(_0x537240,null));};function iftimePromise(_0x2e1c4e,_0x184706){return respondWithRpcPromise(_0x9052('0xee'),_0x9052('0xef'),{'command':_0x184706['timezone']?util['format'](_0x9052('0xf0'),_0x2e1c4e[_0x9052('0xf1')],_0x184706['timezone']):util[_0x9052('0xa0')](_0x9052('0xf2'),_0x2e1c4e[_0x9052('0xf1')])},client9002)[_0x9052('0x10')](function(_0x3df066){var _0x5d32b4=_0x3df066&&_0x3df066[_0x9052('0xf3')](_0x9052('0xf4'))>=0x0?!![]:![];logger['info'](_0x9052('0xf5'),_0x184706['id'],_0x2e1c4e['id'],_0x2e1c4e[_0x9052('0xf1')],_0x5d32b4?_0x9052('0xf6'):_0x9052('0xf7'),_0x184706['timezone']?_0x184706[_0x9052('0xf8')]:_0x9052('0xf9'));return _0x5d32b4;})[_0x9052('0x1b')](function(_0x5789da){logger['error'](_0x9052('0xf5'),_0x184706['id'],_0x2e1c4e['id'],_0x2e1c4e[_0x9052('0xf1')],util[_0x9052('0xfa')](_0x5789da,{'showHidden':![],'depth':null}),_0x184706['timezone']?_0x184706[_0x9052('0xf8')]:_0x9052('0xf9'));return![];});}exports['getSnippet']=function(_0x7cc975,_0xfa55bd){var _0x1501b4=0x0;var _0x219f9a=0x0;var _0x3d780e=![];var _0xa1b09;var _0x4a2596;return db[_0x9052('0x45')][_0x9052('0x4b')]({'where':{'id':_0x7cc975['params']['id']},'include':[{'model':db[_0x9052('0xfb')],'as':'Interval','include':[{'model':db[_0x9052('0xfb')],'as':_0x9052('0xfc'),'attributes':['id',_0x9052('0xf1')],'raw':!![]}]}]})[_0x9052('0x10')](handleEntityNotFound(_0xfa55bd,null))[_0x9052('0x10')](function(_0x4d193f){if(_0x4d193f){_0xa1b09=_0x4d193f;return _0x4d193f[_0x9052('0xfd')]({'raw':!![]});}})[_0x9052('0x10')](function(_0x23cf4f){if(_0xa1b09){if(_0x23cf4f){_0x4a2596=_0x23cf4f;}}return require(_0x9052('0xfe'))[_0x9052('0xff')]();})[_0x9052('0x10')](function(_0x17562d){if(_0x17562d){_0x219f9a=_0x17562d[_0x9052('0x100')];_0x3d780e=_0x17562d['custom'];}})['then'](function(){return db[_0x9052('0xa9')][_0x9052('0x21')]({'where':{'closed':![]}});})[_0x9052('0x10')](function(_0x4bd124){_0x1501b4=_0x4bd124;if(_0x219f9a&&_0x4bd124>_0x219f9a){return db[_0x9052('0x101')][_0x9052('0x5b')]({'where':{'id':0x1}})['then'](function(_0xe10450){if(_0xe10450){_0xe10450[_0x9052('0x102')]('chatLicenseExceeded');}});}})['then'](function(){if(_0xa1b09['Interval']&&_0xa1b09[_0x9052('0xfb')]['Intervals']){var _0x201d88=[];for(var _0x454580=0x0;_0x454580<_0xa1b09['Interval'][_0x9052('0xfc')][_0x9052('0x39')];_0x454580++){var _0x1c4ba5=_0xa1b09[_0x9052('0xfb')][_0x9052('0xfc')][_0x454580][_0x9052('0x25')]({'plain':!![]});_0x201d88[_0x9052('0xb0')](iftimePromise(_0x1c4ba5,_0xa1b09));}return BPromise[_0x9052('0x103')](_0x201d88)['then'](function(_0x44e8dd){return _[_0x9052('0x104')](_0x44e8dd);});}else{return!![];}})[_0x9052('0x10')](function(_0x5b62b4){var _0x5f1b93=fs['readFileSync'](path[_0x9052('0x66')](config['root'],_0x9052('0x105')),_0x9052('0xc2'));var _0x1185e8={'remote':_0xa1b09[_0x9052('0x106')],'query':querystring['stringify'](_[_0x9052('0x40')](_0xa1b09[_0x9052('0x25')]({'plain':!![]}),{'customerIp':_0x7cc975['headers'][_0x9052('0x107')]||_0x7cc975[_0x9052('0x79')][_0x9052('0x108')]||_0x7cc975[_0x9052('0x109')][_0x9052('0x10a')]||_0x7cc975['ip'],'referer':_0x7cc975[_0x9052('0x79')][_0x9052('0x10b')],'openedInteractions':_0x1501b4,'maxInteractions':_0x219f9a,'virtual':_0x3d780e[_0x9052('0x100')],'online':_0x5b62b4,'custom':_0x3d780e}))[_0x9052('0x10c')](/'/g,'\x5c\x27')};_0xfa55bd[_0x9052('0x2c')](ejs[_0x9052('0xc3')](Mustache['render'](_0x5f1b93,_0x1185e8),{'proactiveActions':_0x4a2596,'alignment':_0xa1b09[_0x9052('0x10d')],'verticalAlignment':_0xa1b09['verticalAlignment'],'div_color':_0xa1b09[_0x9052('0xec')],'text_color':_0xa1b09[_0x9052('0x10e')],'button_color':_0xa1b09[_0x9052('0x10f')],'background_color':_0xa1b09[_0x9052('0x110')]}));})[_0x9052('0x1b')](handleError(_0xfa55bd,null));};exports[_0x9052('0x111')]=function(_0x19c9b5,_0x31a01a){var _0x41800e=_0x19c9b5['params']['id'];var _0x525147=_0x19c9b5[_0x9052('0x51')];var _0x3a8f4b=0xc8;var _0x5cf6e5=null;return db[_0x9052('0x112')][_0x9052('0x113')]({'isolationLevel':db['sequelize'][_0x9052('0x114')][_0x9052('0x115')][_0x9052('0x116')]},function(_0x420e6d){return db[_0x9052('0x45')][_0x9052('0x5b')]({'where':{'id':_0x41800e},'transaction':_0x420e6d})['then'](function(_0x729e4f){if(_0x729e4f){return db[_0x9052('0x8e')]['destroy']({'where':{'ChatWebsiteId':_0x41800e},'transaction':_0x420e6d})[_0x9052('0x10')](function(){var _0x404d19=_[_0x9052('0x2f')](_0x525147,function(_0x11147f){_0x11147f[_0x9052('0x54')]=_0x41800e;return _0x11147f;});return db[_0x9052('0x8e')]['bulkCreate'](_0x404d19,{'transaction':_0x420e6d});});}else{_0x3a8f4b=0x194;_0x5cf6e5=[];}});})[_0x9052('0x10')](function(){if(_0x3a8f4b!==0x194){return db['ChatApplication'][_0x9052('0x117')]({'where':{'ChatWebsiteId':_0x41800e},'order':'priority'})[_0x9052('0x10')](function(_0xc7b6ff){_0x5cf6e5=_0xc7b6ff;});}})[_0x9052('0x1b')](function(_0x3a27d0){_0x3a8f4b=0x1f4;logger[_0x9052('0x16')](_0x3a27d0[_0x9052('0x2a')]);if(_0x3a27d0['name']){delete _0x3a27d0[_0x9052('0x2b')];}_0x5cf6e5=_0x3a27d0;})[_0x9052('0x118')](function(){if(_0x5cf6e5===null){_0x31a01a[_0x9052('0x29')](_0x3a8f4b);}else{if(_0x3a8f4b===0x1f4){_0x31a01a[_0x9052('0x1c')](_0x3a8f4b)[_0x9052('0x2c')](_0x5cf6e5);}else{_0x31a01a[_0x9052('0x1c')](_0x3a8f4b)[_0x9052('0x23')](_0x5cf6e5);}}});};exports[_0x9052('0x119')]=function(_0x10e055,_0x4682df){var _0x34cabc={};var _0x3cd9fa={};var _0x1a9c69;var _0x20f09d;return db['ChatWebsite'][_0x9052('0x5b')]({'where':{'id':_0x10e055[_0x9052('0x48')]['id']}})['then'](handleEntityNotFound(_0x4682df,null))[_0x9052('0x10')](function(_0x1e2dee){if(_0x1e2dee){_0x1a9c69=_0x1e2dee;_0x3cd9fa[_0x9052('0x33')]=_[_0x9052('0x4a')](db[_0x9052('0x8e')][_0x9052('0x30')]);_0x3cd9fa['query']=_[_0x9052('0x4a')](_0x10e055['query']);_0x3cd9fa['filters']=_[_0x9052('0x36')](_0x3cd9fa['model'],_0x3cd9fa[_0x9052('0x34')]);_0x34cabc[_0x9052('0x37')]=_['intersection'](_0x3cd9fa[_0x9052('0x33')],qs[_0x9052('0x38')](_0x10e055[_0x9052('0x34')][_0x9052('0x38')]));_0x34cabc['attributes']=_0x34cabc[_0x9052('0x37')]['length']?_0x34cabc[_0x9052('0x37')]:_0x3cd9fa[_0x9052('0x33')];_0x34cabc[_0x9052('0x3b')]=qs[_0x9052('0x3c')](_0x10e055['query']['sort']);_0x34cabc['where']=qs[_0x9052('0x35')](_[_0x9052('0x3d')](_0x10e055[_0x9052('0x34')],_0x3cd9fa[_0x9052('0x35')]));if(_0x10e055['query'][_0x9052('0x3e')]){_0x34cabc['where']=_[_0x9052('0x40')](_0x34cabc[_0x9052('0x3f')],{'$or':_['map'](_0x34cabc[_0x9052('0x37')],function(_0x2a592d){var _0x415f8e={};_0x415f8e[_0x2a592d]={'$like':'%'+_0x10e055[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x415f8e;})});}_0x34cabc=_['merge']({},_0x34cabc,_0x10e055[_0x9052('0x42')]);return _0x1a9c69[_0x9052('0x119')](_0x34cabc);}})['then'](function(_0x80aade){if(_0x80aade){_0x20f09d=_0x80aade[_0x9052('0x39')];if(!_0x10e055['query']['hasOwnProperty'](_0x9052('0xe6'))){_0x34cabc['limit']=qs[_0x9052('0x20')](_0x10e055[_0x9052('0x34')][_0x9052('0x20')]);_0x34cabc['offset']=qs[_0x9052('0x1e')](_0x10e055[_0x9052('0x34')]['offset']);}return _0x1a9c69[_0x9052('0x119')](_0x34cabc);}})[_0x9052('0x10')](function(_0x5ea77d){if(_0x5ea77d){return _0x5ea77d?{'count':_0x20f09d,'rows':_0x5ea77d}:null;}})['then'](respondWithResult(_0x4682df,null))[_0x9052('0x1b')](handleError(_0x4682df,null));};exports[_0x9052('0x11a')]=function(_0x165085,_0x332a5a){return db['chatProactiveAction'][_0x9052('0x4b')]({'where':{'id':_0x165085[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x332a5a,null))[_0x9052('0x10')](function(_0xe3ebb0){if(_0xe3ebb0){return _0xe3ebb0[_0x9052('0x11a')](_0x165085['body'][_0x9052('0x58')],_['omit'](_0x165085[_0x9052('0x51')],[_0x9052('0x58'),'id'])||{});}})[_0x9052('0x10')](respondWithResult(_0x332a5a,null))[_0x9052('0x1b')](handleError(_0x332a5a,null));};exports[_0x9052('0xfd')]=function(_0x248359,_0xcd6d3b){var _0x18e9b6={};var _0x269e26={};var _0x53a6c4;var _0x2b9660;return db[_0x9052('0x45')][_0x9052('0x5b')]({'where':{'id':_0x248359['params']['id']}})[_0x9052('0x10')](handleEntityNotFound(_0xcd6d3b,null))[_0x9052('0x10')](function(_0x3f2243){if(_0x3f2243){_0x53a6c4=_0x3f2243;_0x269e26[_0x9052('0x33')]=_[_0x9052('0x4a')](db[_0x9052('0x11b')]['rawAttributes']);_0x269e26[_0x9052('0x34')]=_['keys'](_0x248359[_0x9052('0x34')]);_0x269e26[_0x9052('0x35')]=_[_0x9052('0x36')](_0x269e26[_0x9052('0x33')],_0x269e26['query']);_0x18e9b6['attributes']=_[_0x9052('0x36')](_0x269e26['model'],qs[_0x9052('0x38')](_0x248359[_0x9052('0x34')]['fields']));_0x18e9b6[_0x9052('0x37')]=_0x18e9b6[_0x9052('0x37')][_0x9052('0x39')]?_0x18e9b6[_0x9052('0x37')]:_0x269e26[_0x9052('0x33')];_0x18e9b6[_0x9052('0x3b')]=qs[_0x9052('0x3c')](_0x248359['query'][_0x9052('0x3c')]);_0x18e9b6['where']=qs[_0x9052('0x35')](_[_0x9052('0x3d')](_0x248359[_0x9052('0x34')],_0x269e26[_0x9052('0x35')]));if(_0x248359['query']['filter']){_0x18e9b6[_0x9052('0x3f')]=_[_0x9052('0x40')](_0x18e9b6[_0x9052('0x3f')],{'$or':_['map'](_0x18e9b6[_0x9052('0x37')],function(_0x5b959c){var _0x5c4d9d={};_0x5c4d9d[_0x5b959c]={'$like':'%'+_0x248359[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x5c4d9d;})});}_0x18e9b6=_['merge']({},_0x18e9b6,_0x248359[_0x9052('0x42')]);return _0x53a6c4['getProactiveActions'](_0x18e9b6);}})[_0x9052('0x10')](function(_0xd5884a){if(_0xd5884a){_0x2b9660=_0xd5884a[_0x9052('0x39')];if(!_0x248359['query'][_0x9052('0x3a')](_0x9052('0xe6'))){_0x18e9b6[_0x9052('0x20')]=qs[_0x9052('0x20')](_0x248359[_0x9052('0x34')][_0x9052('0x20')]);_0x18e9b6[_0x9052('0x1e')]=qs[_0x9052('0x1e')](_0x248359[_0x9052('0x34')][_0x9052('0x1e')]);}return _0x53a6c4['getProactiveActions'](_0x18e9b6);}})[_0x9052('0x10')](function(_0x104a30){if(_0x104a30){return _0x104a30?{'count':_0x2b9660,'rows':_0x104a30}:null;}})[_0x9052('0x10')](respondWithResult(_0xcd6d3b,null))[_0x9052('0x1b')](handleError(_0xcd6d3b,null));};exports[_0x9052('0x11c')]=function(_0x59c647,_0x140be2){var _0x478c65=_0x59c647[_0x9052('0x34')][_0x9052('0x11d')]==='false'?_0x9052('0x11e'):_0x9052('0x11f');return db[_0x9052('0x45')][_0x9052('0x4b')]({'attributes':['id',_0x478c65],'where':{'id':_0x59c647[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x140be2,null))[_0x9052('0x10')](function(_0x3154ac){if(_0x3154ac){var _0x512522=_0x3154ac[_0x478c65];var _0x3e911f=_0x512522&&_0x512522[_0x9052('0x120')]?_0x512522[_0x9052('0x120')]:[];_0x140be2[_0x9052('0x2c')]({'fromKey':_['isNil'](_0x512522[_0x9052('0x121')])?undefined:_0x512522[_0x9052('0x121')],'count':_0x3e911f[_0x9052('0x39')],'rows':_0x3e911f});}})[_0x9052('0x1b')](handleError(_0x140be2,null));};exports['getOfflineMessages']=function(_0x49ece8,_0x8ebe2c){var _0x5edc49={'raw':![],'where':{}};var _0x111adf={};var _0xbf7e2={'count':0x0,'rows':[]};return db[_0x9052('0x45')][_0x9052('0x5b')]({'where':{'id':_0x49ece8[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x8ebe2c,null))['then'](function(_0x5ef88f){if(_0x5ef88f){_0x111adf['model']=_[_0x9052('0x4a')](db[_0x9052('0xc5')]['rawAttributes']);_0x111adf[_0x9052('0x34')]=_[_0x9052('0x4a')](_0x49ece8[_0x9052('0x34')]);_0x111adf[_0x9052('0x35')]=_['intersection'](_0x111adf[_0x9052('0x33')],_0x111adf[_0x9052('0x34')]);_0x5edc49[_0x9052('0x37')]=_['intersection'](_0x111adf[_0x9052('0x33')],qs[_0x9052('0x38')](_0x49ece8[_0x9052('0x34')]['fields']));_0x5edc49[_0x9052('0x37')]=_0x5edc49[_0x9052('0x37')]['length']?_0x5edc49[_0x9052('0x37')]:_0x111adf['model'];if(!_0x49ece8['query'][_0x9052('0x3a')](_0x9052('0xe6'))){_0x5edc49[_0x9052('0x20')]=qs[_0x9052('0x20')](_0x49ece8[_0x9052('0x34')][_0x9052('0x20')]);_0x5edc49[_0x9052('0x1e')]=qs[_0x9052('0x1e')](_0x49ece8[_0x9052('0x34')][_0x9052('0x1e')]);}_0x5edc49[_0x9052('0x3b')]=qs['sort'](_0x49ece8[_0x9052('0x34')][_0x9052('0x3c')]);_0x5edc49[_0x9052('0x3f')]=qs[_0x9052('0x35')](_[_0x9052('0x3d')](_0x49ece8['query'],_0x111adf[_0x9052('0x35')]));_0x5edc49['where']['ChatWebsiteId']=_0x5ef88f['id'];if(_0x49ece8[_0x9052('0x34')][_0x9052('0x3e')]){_0x5edc49[_0x9052('0x3f')]=_[_0x9052('0x40')](_0x5edc49[_0x9052('0x3f')],{'$or':_[_0x9052('0x2f')](_0x5edc49[_0x9052('0x37')],function(_0x225bfd){var _0x393502={};_0x393502[_0x225bfd]={'$like':'%'+_0x49ece8[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x393502;})});}_0x5edc49=_[_0x9052('0x40')]({},_0x5edc49,_0x49ece8[_0x9052('0x42')]);return db['ChatOfflineMessage']['count']({'where':_0x5edc49[_0x9052('0x3f')]})[_0x9052('0x10')](function(_0x2670dc){_0xbf7e2['count']=_0x2670dc;if(_0x49ece8['query'][_0x9052('0x43')]){_0x5edc49[_0x9052('0x44')]=[{'all':!![]}];}else{_0x5edc49[_0x9052('0x44')]=[{'model':db['CmContact'],'as':_0x9052('0xe7'),'required':![]},{'model':db['Attachment'],'as':_0x9052('0x122'),'required':![]}];}return db['ChatOfflineMessage'][_0x9052('0x56')](_0x5edc49);})[_0x9052('0x10')](function(_0x137412){_0xbf7e2[_0x9052('0x46')]=_0x137412;return _0xbf7e2;});}})[_0x9052('0x10')](respondWithFilteredResult(_0x8ebe2c,_0x5edc49))['catch'](handleError(_0x8ebe2c,null));};exports[_0x9052('0x123')]=function(_0x4d7197,_0x4e89b6){return db[_0x9052('0x45')][_0x9052('0x4b')]({'where':{'id':_0x4d7197[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x4e89b6,null))['then'](function(_0x555ddf){if(_0x555ddf){return _0x555ddf['addAgents'](_0x4d7197[_0x9052('0x51')][_0x9052('0x58')],_['omit'](_0x4d7197[_0x9052('0x51')],[_0x9052('0x58'),'id'])||{})[_0x9052('0xab')](function(_0x15fb69){for(var _0x13d8e1=0x0;_0x13d8e1<_0x4d7197['body'][_0x9052('0x58')]['length'];_0x13d8e1+=0x1){socket[_0x9052('0x124')](_0x9052('0x125'),{'UserId':Number(_0x4d7197[_0x9052('0x51')][_0x9052('0x58')][_0x13d8e1]),'ChatWebsiteId':Number(_0x4d7197[_0x9052('0x48')]['id'])});}return _0x15fb69;});}})[_0x9052('0x10')](respondWithResult(_0x4e89b6,null))[_0x9052('0x1b')](handleError(_0x4e89b6,null));};exports[_0x9052('0x126')]=function(_0x547de7,_0x146d73){return db[_0x9052('0x45')][_0x9052('0x4b')]({'where':{'id':_0x547de7['params']['id']}})[_0x9052('0x10')](handleEntityNotFound(_0x146d73,null))['then'](function(_0x55a36f){if(_0x55a36f){return _0x55a36f[_0x9052('0x126')](_0x547de7[_0x9052('0x34')][_0x9052('0x58')])[_0x9052('0x10')](function(){if(_[_0x9052('0x127')](_0x547de7[_0x9052('0x34')][_0x9052('0x58')])){for(var _0x4e2722=0x0;_0x4e2722<_0x547de7['query'][_0x9052('0x58')][_0x9052('0x39')];_0x4e2722+=0x1){socket[_0x9052('0x124')](_0x9052('0x128'),{'UserId':Number(_0x547de7[_0x9052('0x34')][_0x9052('0x58')][_0x4e2722]),'ChatWebsiteId':Number(_0x547de7[_0x9052('0x48')]['id'])});}}else{socket['emit'](_0x9052('0x128'),{'UserId':Number(_0x547de7[_0x9052('0x34')]['ids']),'ChatWebsiteId':Number(_0x547de7['params']['id'])});}});}})[_0x9052('0x10')](respondWithStatusCode(_0x146d73,null))[_0x9052('0x1b')](handleError(_0x146d73,null));};exports[_0x9052('0x129')]=function(_0x437209,_0xe4dea6){var _0x454805={};var _0x2f0c8c={};var _0x26dcd3;var _0x42a223;return db[_0x9052('0x45')]['findOne']({'where':{'id':_0x437209[_0x9052('0x48')]['id']}})[_0x9052('0x10')](handleEntityNotFound(_0xe4dea6,null))['then'](function(_0x3577c7){if(_0x3577c7){_0x26dcd3=_0x3577c7;_0x2f0c8c[_0x9052('0x33')]=_['keys'](db['User'][_0x9052('0x30')]);_0x2f0c8c[_0x9052('0x34')]=_[_0x9052('0x4a')](_0x437209[_0x9052('0x34')]);_0x2f0c8c['filters']=_[_0x9052('0x36')](_0x2f0c8c[_0x9052('0x33')],_0x2f0c8c[_0x9052('0x34')]);_0x454805[_0x9052('0x37')]=_[_0x9052('0x36')](_0x2f0c8c[_0x9052('0x33')],qs[_0x9052('0x38')](_0x437209[_0x9052('0x34')][_0x9052('0x38')]));_0x454805['attributes']=_0x454805[_0x9052('0x37')]['length']?_0x454805[_0x9052('0x37')]:_0x2f0c8c[_0x9052('0x33')];_0x454805[_0x9052('0x3b')]=qs[_0x9052('0x3c')](_0x437209[_0x9052('0x34')][_0x9052('0x3c')]);_0x454805['where']=qs['filters'](_[_0x9052('0x3d')](_0x437209[_0x9052('0x34')],_0x2f0c8c['filters']));if(_0x437209[_0x9052('0x34')][_0x9052('0x3e')]){_0x454805[_0x9052('0x3f')]=_[_0x9052('0x40')](_0x454805[_0x9052('0x3f')],{'$or':_[_0x9052('0x2f')](_0x454805[_0x9052('0x37')],function(_0x1c41a9){var _0x244216={};_0x244216[_0x1c41a9]={'$like':'%'+_0x437209[_0x9052('0x34')][_0x9052('0x3e')]+'%'};return _0x244216;})});}_0x454805=_[_0x9052('0x40')]({},_0x454805,_0x437209[_0x9052('0x42')]);return _0x26dcd3[_0x9052('0x129')](_0x454805);}})[_0x9052('0x10')](function(_0x4805e0){if(_0x4805e0){_0x42a223=_0x4805e0[_0x9052('0x39')];if(!_0x437209[_0x9052('0x34')][_0x9052('0x3a')](_0x9052('0xe6'))){_0x454805[_0x9052('0x20')]=qs[_0x9052('0x20')](_0x437209[_0x9052('0x34')][_0x9052('0x20')]);_0x454805['offset']=qs['offset'](_0x437209[_0x9052('0x34')]['offset']);}return _0x26dcd3[_0x9052('0x129')](_0x454805);}})['then'](function(_0x5ad324){if(_0x5ad324){return _0x5ad324?{'count':_0x42a223,'rows':_0x5ad324}:null;}})['then'](respondWithResult(_0xe4dea6,null))[_0x9052('0x1b')](handleError(_0xe4dea6,null));};
\ No newline at end of file
+var _0x96bb=['customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','push','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','files','no\x20available\x20attributes','createdAt','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','MailServerOut','forwardOffline','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','NotifyMailAccount','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','ids','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','getProactiveActions','increment','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','virtual','replace','verticalAlignment','textColor','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','lodash','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','stack','name','send','index','Pause','map','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','CannedAnswer','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','sitepic','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','difference','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','Applications','List','account','applications','list','orderBy','asc','contact'];(function(_0x1170a9,_0x4d9a17){var _0x516985=function(_0x359349){while(--_0x359349){_0x1170a9['push'](_0x1170a9['shift']());}};_0x516985(++_0x4d9a17);}(_0x96bb,0x93));var _0xb96b=function(_0x568b73,_0x403347){_0x568b73=_0x568b73-0x0;var _0x2ff268=_0x96bb[_0x568b73];return _0x2ff268;};'use strict';var BPromise=require(_0xb96b('0x0'));var Mustache=require(_0xb96b('0x1'));var util=require(_0xb96b('0x2'));var path=require(_0xb96b('0x3'));var ejs=require(_0xb96b('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb96b('0x5'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xb96b('0x6'));var db=require('../../mysqldb')['db'];config[_0xb96b('0x7')]=_[_0xb96b('0x8')](config[_0xb96b('0x7')],{'host':_0xb96b('0x9'),'port':0x18eb});var socket=require(_0xb96b('0xa'))(new Redis(config[_0xb96b('0x7')]));require(_0xb96b('0xb'))[_0xb96b('0xc')](socket);var jayson=require(_0xb96b('0xd'));var client=jayson[_0xb96b('0xe')][_0xb96b('0xf')]({'port':0x232c});var client9002=jayson[_0xb96b('0xe')][_0xb96b('0xf')]({'port':0x232a});var client9003=jayson[_0xb96b('0xe')]['http']({'port':0x232b});var client9001=jayson['client'][_0xb96b('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x451a9f,_0x39bbd7,_0x46ef4f,_0x2b213d){return new BPromise(function(_0x3aab83,_0x390f16){var _0x34bdd9=_0x2b213d||client;return _0x34bdd9['request'](_0x451a9f,_0x46ef4f)[_0xb96b('0x10')](function(_0x8ca70e){logger['info'](_0xb96b('0x11'),_0x39bbd7,_0xb96b('0x12'));logger[_0xb96b('0x13')](_0xb96b('0x14'),_0x39bbd7,_0xb96b('0x12'),JSON[_0xb96b('0x15')](_0x8ca70e));if(_0x8ca70e[_0xb96b('0x16')]){if(_0x8ca70e['error']['code']===0x1f4){logger[_0xb96b('0x16')](_0xb96b('0x11'),_0x39bbd7,_0x8ca70e[_0xb96b('0x16')][_0xb96b('0x17')]);return _0x390f16(_0x8ca70e[_0xb96b('0x16')][_0xb96b('0x17')]);}logger[_0xb96b('0x16')](_0xb96b('0x11'),_0x39bbd7,_0x8ca70e[_0xb96b('0x16')][_0xb96b('0x17')]);return _0x3aab83(_0x8ca70e['error']['message']);}else{logger[_0xb96b('0x18')](_0xb96b('0x11'),_0x39bbd7,_0xb96b('0x12'));_0x3aab83(_0x8ca70e[_0xb96b('0x19')][_0xb96b('0x17')]);}})['catch'](function(_0x1f8736){logger[_0xb96b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x39bbd7,_0x1f8736);_0x390f16(_0x1f8736);});});}function respondWithStatusCode(_0x3f65e3,_0x3e7827){_0x3e7827=_0x3e7827||0xcc;return function(_0xdaeb03){if(_0xdaeb03){return _0x3f65e3['sendStatus'](_0x3e7827);}return _0x3f65e3[_0xb96b('0x1a')](_0x3e7827)['end']();};}function respondWithResult(_0x2bedb8,_0x15747f){_0x15747f=_0x15747f||0xc8;return function(_0x580b4f){if(_0x580b4f){return _0x2bedb8['status'](_0x15747f)[_0xb96b('0x1b')](_0x580b4f);}};}function respondWithFilteredResult(_0x22af0a,_0x9a0b70){return function(_0x321d95){if(_0x321d95){var _0x1c6f94=typeof _0x9a0b70['offset']===_0xb96b('0x1c')&&typeof _0x9a0b70[_0xb96b('0x1d')]===_0xb96b('0x1c');var _0x47431b=_0x321d95[_0xb96b('0x1e')];var _0x42567c=_0x1c6f94?0x0:_0x9a0b70[_0xb96b('0x1f')];var _0x340344=_0x1c6f94?_0x321d95[_0xb96b('0x1e')]:_0x9a0b70[_0xb96b('0x1f')]+_0x9a0b70['limit'];var _0x572158;if(_0x340344>=_0x47431b){_0x340344=_0x47431b;_0x572158=0xc8;}else{_0x572158=0xce;}_0x22af0a['status'](_0x572158);return _0x22af0a[_0xb96b('0x20')](_0xb96b('0x21'),_0x42567c+'-'+_0x340344+'/'+_0x47431b)['json'](_0x321d95);}return null;};}function saveUpdates(_0x4a455f){return function(_0x5bb419){if(_0x5bb419){return _0x5bb419[_0xb96b('0x22')](_0x4a455f)[_0xb96b('0x10')](function(_0x44fa39){return _0x44fa39;});}return null;};}function removeEntity(_0x2ad318){return function(_0x3baed1){if(_0x3baed1){return _0x3baed1[_0xb96b('0x23')]()[_0xb96b('0x10')](function(){var _0x39615f=_0x3baed1[_0xb96b('0x24')]({'plain':!![]});var _0x4a78ee=_0xb96b('0x25');return db[_0xb96b('0x26')][_0xb96b('0x23')]({'where':{'type':_0x4a78ee,'resourceId':_0x39615f['id']}})['then'](function(){return _0x3baed1;});})[_0xb96b('0x10')](function(){_0x2ad318[_0xb96b('0x1a')](0xcc)[_0xb96b('0x27')]();});}};}function handleEntityNotFound(_0x58d800){return function(_0x19b463){if(!_0x19b463){_0x58d800[_0xb96b('0x28')](0x194);}return _0x19b463;};}function handleError(_0x4903ba,_0xd10e09){_0xd10e09=_0xd10e09||0x1f4;return function(_0xae0dc5){logger[_0xb96b('0x16')](_0xae0dc5[_0xb96b('0x29')]);if(_0xae0dc5['name']){delete _0xae0dc5[_0xb96b('0x2a')];}_0x4903ba[_0xb96b('0x1a')](_0xd10e09)[_0xb96b('0x2b')](_0xae0dc5);};}exports[_0xb96b('0x2c')]=function(_0x156e21,_0x3b5878){var _0x35eba3={'include':[{'model':db[_0xb96b('0x2d')],'as':'mandatoryDispositionPause'}]},_0x262109={},_0x3f3b35={'count':0x0,'rows':[]};var _0x23daf7=_[_0xb96b('0x2e')](db['ChatWebsite']['rawAttributes'],function(_0x4509d5){return{'name':_0x4509d5['fieldName'],'type':_0x4509d5['type'][_0xb96b('0x2f')]};});_0x262109['model']=_[_0xb96b('0x2e')](_0x23daf7,'name');_0x262109[_0xb96b('0x30')]=_[_0xb96b('0x31')](_0x156e21['query']);_0x262109['filters']=_[_0xb96b('0x32')](_0x262109['model'],_0x262109[_0xb96b('0x30')]);_0x35eba3[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0x262109[_0xb96b('0x34')],qs[_0xb96b('0x35')](_0x156e21['query'][_0xb96b('0x35')]));_0x35eba3[_0xb96b('0x33')]=_0x35eba3[_0xb96b('0x33')][_0xb96b('0x36')]?_0x35eba3[_0xb96b('0x33')]:_0x262109[_0xb96b('0x34')];if(!_0x156e21[_0xb96b('0x30')][_0xb96b('0x37')](_0xb96b('0x38'))){_0x35eba3[_0xb96b('0x1d')]=qs['limit'](_0x156e21[_0xb96b('0x30')]['limit']);_0x35eba3[_0xb96b('0x1f')]=qs[_0xb96b('0x1f')](_0x156e21[_0xb96b('0x30')]['offset']);}_0x35eba3[_0xb96b('0x39')]=qs[_0xb96b('0x3a')](_0x156e21[_0xb96b('0x30')][_0xb96b('0x3a')]);_0x35eba3[_0xb96b('0x3b')]=qs[_0xb96b('0x3c')](_[_0xb96b('0x3d')](_0x156e21[_0xb96b('0x30')],_0x262109[_0xb96b('0x3c')]),_0x23daf7);if(_0x156e21[_0xb96b('0x30')][_0xb96b('0x3e')]){_0x35eba3[_0xb96b('0x3b')]=_[_0xb96b('0x3f')](_0x35eba3['where'],{'$or':_[_0xb96b('0x2e')](_0x23daf7,function(_0x4798ac){if(_0x4798ac['type']!==_0xb96b('0x40')){var _0x111157={};_0x111157[_0x4798ac[_0xb96b('0x2a')]]={'$like':'%'+_0x156e21[_0xb96b('0x30')][_0xb96b('0x3e')]+'%'};return _0x111157;}})});}_0x35eba3=_[_0xb96b('0x3f')]({},_0x35eba3,_0x156e21[_0xb96b('0x41')]);var _0x535aa1={'where':_0x35eba3[_0xb96b('0x3b')]};return db[_0xb96b('0x42')][_0xb96b('0x1e')](_0x535aa1)['then'](function(_0x8d30ce){_0x3f3b35[_0xb96b('0x1e')]=_0x8d30ce;if(_0x156e21[_0xb96b('0x30')][_0xb96b('0x43')]){_0x35eba3[_0xb96b('0x44')]=[{'all':!![]}];}return db['ChatWebsite'][_0xb96b('0x45')](_0x35eba3);})[_0xb96b('0x10')](function(_0x469359){_0x3f3b35[_0xb96b('0x46')]=_0x469359;return _0x3f3b35;})[_0xb96b('0x10')](respondWithFilteredResult(_0x3b5878,_0x35eba3))['catch'](handleError(_0x3b5878,null));};exports[_0xb96b('0x47')]=function(_0x590c52,_0x200e8c){var _0x12c784={'raw':![],'where':{'id':_0x590c52['params']['id']},'include':[{'model':db[_0xb96b('0x2d')],'as':'mandatoryDispositionPause'}]},_0xb28f84={};_0xb28f84[_0xb96b('0x34')]=_[_0xb96b('0x31')](db['ChatWebsite'][_0xb96b('0x48')]);_0xb28f84[_0xb96b('0x30')]=_[_0xb96b('0x31')](_0x590c52['query']);_0xb28f84[_0xb96b('0x3c')]=_[_0xb96b('0x32')](_0xb28f84['model'],_0xb28f84[_0xb96b('0x30')]);_0x12c784[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0xb28f84[_0xb96b('0x34')],qs['fields'](_0x590c52[_0xb96b('0x30')][_0xb96b('0x35')]));_0x12c784[_0xb96b('0x33')]=_0x12c784[_0xb96b('0x33')][_0xb96b('0x36')]?_0x12c784[_0xb96b('0x33')]:_0xb28f84['model'];if(_0x590c52[_0xb96b('0x30')][_0xb96b('0x43')]){_0x12c784[_0xb96b('0x44')]=[{'all':!![]}];}_0x12c784=_[_0xb96b('0x3f')]({},_0x12c784,_0x590c52['options']);return db['ChatWebsite'][_0xb96b('0x49')](_0x12c784)[_0xb96b('0x10')](handleEntityNotFound(_0x200e8c,null))[_0xb96b('0x10')](respondWithResult(_0x200e8c,null))[_0xb96b('0x4a')](handleError(_0x200e8c,null));};exports[_0xb96b('0x4b')]=function(_0x50792b,_0x5c00f7){return db[_0xb96b('0x42')][_0xb96b('0x4b')](_0x50792b[_0xb96b('0x4c')],{})[_0xb96b('0x10')](function(_0x7e3639){var _0x26b1d3=_0x50792b[_0xb96b('0x4d')]['get']({'plain':!![]});if(!_0x26b1d3)throw new Error(_0xb96b('0x4e'));if(_0x26b1d3[_0xb96b('0x4f')]===_0xb96b('0x4d')){var _0x8f551b=_0x7e3639['get']({'plain':!![]});var _0x4f9033=_0xb96b('0x25');return db[_0xb96b('0x50')][_0xb96b('0x49')]({'where':{'name':_0x4f9033,'userProfileId':_0x26b1d3['userProfileId']},'raw':!![]})[_0xb96b('0x10')](function(_0x3fb6e8){if(_0x3fb6e8&&_0x3fb6e8[_0xb96b('0x51')]===0x0){return db[_0xb96b('0x26')][_0xb96b('0x4b')]({'name':_0x8f551b[_0xb96b('0x2a')],'resourceId':_0x8f551b['id'],'type':_0x3fb6e8[_0xb96b('0x2a')],'sectionId':_0x3fb6e8['id']},{})['then'](function(){return _0x7e3639;});}else{return _0x7e3639;}})[_0xb96b('0x4a')](function(_0x253f94){logger['error'](_0xb96b('0x52'),_0x253f94);throw _0x253f94;});}return _0x7e3639;})['then'](respondWithResult(_0x5c00f7,0xc9))[_0xb96b('0x4a')](handleError(_0x5c00f7,null));};exports[_0xb96b('0x22')]=function(_0x67009b,_0x274660){if(_0x67009b[_0xb96b('0x4c')]['id']){delete _0x67009b[_0xb96b('0x4c')]['id'];}return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x67009b[_0xb96b('0x53')]['id']},'include':[{'model':db[_0xb96b('0x2d')],'as':_0xb96b('0x54')}]})['then'](handleEntityNotFound(_0x274660,null))[_0xb96b('0x10')](saveUpdates(_0x67009b[_0xb96b('0x4c')],null))['then'](respondWithResult(_0x274660,null))[_0xb96b('0x4a')](handleError(_0x274660,null));};exports[_0xb96b('0x23')]=function(_0x22b349,_0x13d1f6){return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x22b349['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x13d1f6,null))[_0xb96b('0x10')](removeEntity(_0x13d1f6,null))['catch'](handleError(_0x13d1f6,null));};exports[_0xb96b('0x55')]=function(_0xdb7f8f,_0x22d69d){return db[_0xb96b('0x42')][_0xb96b('0x55')]()['then'](respondWithResult(_0x22d69d,null))[_0xb96b('0x4a')](handleError(_0x22d69d,null));};exports[_0xb96b('0x56')]=function(_0x19be08,_0x577d22){if(_0x19be08[_0xb96b('0x4c')]['id']){delete _0x19be08['body']['id'];}return db[_0xb96b('0x42')]['find']({'where':{'id':_0x19be08[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x577d22,null))[_0xb96b('0x10')](function(_0x506b6f){if(_0x506b6f){_0x19be08['body'][_0xb96b('0x57')]=_0x506b6f['id'];return db[_0xb96b('0x58')][_0xb96b('0x4b')](_0x19be08[_0xb96b('0x4c')]);}})[_0xb96b('0x10')](respondWithResult(_0x577d22,null))[_0xb96b('0x4a')](handleError(_0x577d22,null));};exports['getDispositions']=function(_0x3040e7,_0x575196){var _0x45d3ea={'raw':![],'where':{}};var _0x2d03bb={};var _0x3aab19={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb96b('0x59')]({'where':{'id':_0x3040e7['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x575196,null))[_0xb96b('0x10')](function(_0x5f5ced){if(_0x5f5ced){_0x2d03bb['model']=_[_0xb96b('0x31')](db['Disposition']['rawAttributes']);_0x2d03bb['query']=_[_0xb96b('0x31')](_0x3040e7[_0xb96b('0x30')]);_0x2d03bb[_0xb96b('0x3c')]=_[_0xb96b('0x32')](_0x2d03bb['model'],_0x2d03bb[_0xb96b('0x30')]);_0x45d3ea[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0x2d03bb['model'],qs[_0xb96b('0x35')](_0x3040e7[_0xb96b('0x30')][_0xb96b('0x35')]));_0x45d3ea['attributes']=_0x45d3ea[_0xb96b('0x33')][_0xb96b('0x36')]?_0x45d3ea['attributes']:_0x2d03bb[_0xb96b('0x34')];if(!_0x3040e7[_0xb96b('0x30')][_0xb96b('0x37')](_0xb96b('0x38'))){_0x45d3ea[_0xb96b('0x1d')]=qs[_0xb96b('0x1d')](_0x3040e7[_0xb96b('0x30')][_0xb96b('0x1d')]);_0x45d3ea[_0xb96b('0x1f')]=qs[_0xb96b('0x1f')](_0x3040e7[_0xb96b('0x30')]['offset']);}_0x45d3ea['order']=qs[_0xb96b('0x3a')](_0x3040e7[_0xb96b('0x30')][_0xb96b('0x3a')]);_0x45d3ea[_0xb96b('0x3b')]=qs[_0xb96b('0x3c')](_[_0xb96b('0x3d')](_0x3040e7[_0xb96b('0x30')],_0x2d03bb['filters']));_0x45d3ea['where'][_0xb96b('0x57')]=_0x5f5ced['id'];if(_0x3040e7[_0xb96b('0x30')][_0xb96b('0x3e')]){_0x45d3ea['where']=_['merge'](_0x45d3ea[_0xb96b('0x3b')],{'$or':_['map'](_0x45d3ea[_0xb96b('0x33')],function(_0x1ba74a){var _0x2b9604={};_0x2b9604[_0x1ba74a]={'$like':'%'+_0x3040e7[_0xb96b('0x30')]['filter']+'%'};return _0x2b9604;})});}_0x45d3ea=_['merge']({},_0x45d3ea,_0x3040e7[_0xb96b('0x41')]);return db[_0xb96b('0x58')][_0xb96b('0x1e')]({'where':_0x45d3ea['where']})[_0xb96b('0x10')](function(_0xc0919){_0x3aab19[_0xb96b('0x1e')]=_0xc0919;if(_0x3040e7[_0xb96b('0x30')]['includeAll']){_0x45d3ea['include']=[{'all':!![]}];}return db[_0xb96b('0x58')][_0xb96b('0x45')](_0x45d3ea);})[_0xb96b('0x10')](function(_0x327ef5){_0x3aab19['rows']=_0x327ef5;return _0x3aab19;});}})[_0xb96b('0x10')](respondWithFilteredResult(_0x575196,_0x45d3ea))[_0xb96b('0x4a')](handleError(_0x575196,null));};exports[_0xb96b('0x5a')]=function(_0x26cc32,_0x5b53ed){return db['ChatWebsite'][_0xb96b('0x49')]({'where':{'id':_0x26cc32['params']['id']}})['then'](handleEntityNotFound(_0x5b53ed,null))[_0xb96b('0x10')](function(_0x26a0d4){if(_0x26a0d4){return _0x26a0d4[_0xb96b('0x5a')](_0x26cc32[_0xb96b('0x30')]['ids']);}})[_0xb96b('0x10')](respondWithStatusCode(_0x5b53ed,null))[_0xb96b('0x4a')](handleError(_0x5b53ed,null));};exports['addAnswer']=function(_0x31be2c,_0x9e27fd){if(_0x31be2c[_0xb96b('0x4c')]['id']){delete _0x31be2c[_0xb96b('0x4c')]['id'];}return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x31be2c['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x9e27fd,null))[_0xb96b('0x10')](function(_0x1e6721){if(_0x1e6721){_0x31be2c[_0xb96b('0x4c')][_0xb96b('0x57')]=_0x1e6721['id'];return db['CannedAnswer'][_0xb96b('0x4b')](_0x31be2c[_0xb96b('0x4c')]);}})['then'](respondWithResult(_0x9e27fd,null))[_0xb96b('0x4a')](handleError(_0x9e27fd,null));};exports['getAnswers']=function(_0x303f8c,_0x1760ac){var _0x87ba0f={'raw':![],'where':{}};var _0x4bd78e={};var _0x2b367e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xb96b('0x59')]({'where':{'id':_0x303f8c['params']['id']}})['then'](handleEntityNotFound(_0x1760ac,null))['then'](function(_0x41b3e7){if(_0x41b3e7){_0x4bd78e[_0xb96b('0x34')]=_[_0xb96b('0x31')](db[_0xb96b('0x5b')][_0xb96b('0x48')]);_0x4bd78e[_0xb96b('0x30')]=_[_0xb96b('0x31')](_0x303f8c[_0xb96b('0x30')]);_0x4bd78e[_0xb96b('0x3c')]=_[_0xb96b('0x32')](_0x4bd78e[_0xb96b('0x34')],_0x4bd78e['query']);_0x87ba0f['attributes']=_[_0xb96b('0x32')](_0x4bd78e[_0xb96b('0x34')],qs[_0xb96b('0x35')](_0x303f8c['query'][_0xb96b('0x35')]));_0x87ba0f['attributes']=_0x87ba0f[_0xb96b('0x33')]['length']?_0x87ba0f[_0xb96b('0x33')]:_0x4bd78e[_0xb96b('0x34')];if(!_0x303f8c['query']['hasOwnProperty'](_0xb96b('0x38'))){_0x87ba0f[_0xb96b('0x1d')]=qs[_0xb96b('0x1d')](_0x303f8c[_0xb96b('0x30')][_0xb96b('0x1d')]);_0x87ba0f['offset']=qs[_0xb96b('0x1f')](_0x303f8c[_0xb96b('0x30')][_0xb96b('0x1f')]);}_0x87ba0f[_0xb96b('0x39')]=qs[_0xb96b('0x3a')](_0x303f8c[_0xb96b('0x30')][_0xb96b('0x3a')]);_0x87ba0f[_0xb96b('0x3b')]=qs[_0xb96b('0x3c')](_[_0xb96b('0x3d')](_0x303f8c[_0xb96b('0x30')],_0x4bd78e[_0xb96b('0x3c')]));_0x87ba0f['where']['ChatWebsiteId']=_0x41b3e7['id'];if(_0x303f8c[_0xb96b('0x30')][_0xb96b('0x3e')]){_0x87ba0f[_0xb96b('0x3b')]=_[_0xb96b('0x3f')](_0x87ba0f[_0xb96b('0x3b')],{'$or':_['map'](_0x87ba0f['attributes'],function(_0x240a0c){var _0x13d19a={};_0x13d19a[_0x240a0c]={'$like':'%'+_0x303f8c['query'][_0xb96b('0x3e')]+'%'};return _0x13d19a;})});}_0x87ba0f=_[_0xb96b('0x3f')]({},_0x87ba0f,_0x303f8c[_0xb96b('0x41')]);return db[_0xb96b('0x5b')][_0xb96b('0x1e')]({'where':_0x87ba0f[_0xb96b('0x3b')]})[_0xb96b('0x10')](function(_0x385c54){_0x2b367e[_0xb96b('0x1e')]=_0x385c54;if(_0x303f8c[_0xb96b('0x30')][_0xb96b('0x43')]){_0x87ba0f['include']=[{'all':!![]}];}return db[_0xb96b('0x5b')][_0xb96b('0x45')](_0x87ba0f);})['then'](function(_0xd87e06){_0x2b367e[_0xb96b('0x46')]=_0xd87e06;return _0x2b367e;});}})[_0xb96b('0x10')](respondWithFilteredResult(_0x1760ac,_0x87ba0f))[_0xb96b('0x4a')](handleError(_0x1760ac,null));};exports[_0xb96b('0x5c')]=function(_0x5d5c9d,_0xfad5a){return db[_0xb96b('0x42')]['find']({'where':{'id':_0x5d5c9d['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0xfad5a,null))[_0xb96b('0x10')](function(_0x326dbc){if(_0x326dbc){return _0x326dbc[_0xb96b('0x5c')](_0x5d5c9d['query']['ids']);}})['then'](respondWithStatusCode(_0xfad5a,null))[_0xb96b('0x4a')](handleError(_0xfad5a,null));};exports['addLogo']=function(_0x5bdf18,_0x2c24db){_0x5bdf18[_0xb96b('0x4c')]['sitepic']=_0x5bdf18[_0xb96b('0x5d')][_0xb96b('0x5e')];return db[_0xb96b('0x42')]['find']({'where':{'id':_0x5bdf18[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x2c24db,null))['then'](saveUpdates(_0x5bdf18['body'],null))[_0xb96b('0x10')](respondWithResult(_0x2c24db,null))['catch'](handleError(_0x2c24db,null));};exports[_0xb96b('0x5f')]=function(_0x5ee943,_0x564f63){_0x5ee943[_0xb96b('0x4c')][_0xb96b('0x60')]=_0x5ee943[_0xb96b('0x5d')][_0xb96b('0x5e')];return db['ChatWebsite'][_0xb96b('0x49')]({'where':{'id':_0x5ee943[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x564f63,null))[_0xb96b('0x10')](saveUpdates(_0x5ee943[_0xb96b('0x4c')],null))[_0xb96b('0x10')](respondWithResult(_0x564f63,null))[_0xb96b('0x4a')](handleError(_0x564f63,null));};exports[_0xb96b('0x61')]=function(_0x164d83,_0x3f864f){_0x164d83[_0xb96b('0x4c')][_0xb96b('0x62')]=_0x164d83[_0xb96b('0x5d')]['filename'];return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x164d83[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x3f864f,null))[_0xb96b('0x10')](saveUpdates(_0x164d83[_0xb96b('0x4c')],null))['then'](respondWithResult(_0x3f864f,null))[_0xb96b('0x4a')](handleError(_0x3f864f,null));};exports[_0xb96b('0x63')]=function(_0x40a25e,_0x1ddcdb){_0x40a25e['body'][_0xb96b('0x64')]=_0x40a25e[_0xb96b('0x5d')][_0xb96b('0x5e')];return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x40a25e['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x1ddcdb,null))[_0xb96b('0x10')](saveUpdates(_0x40a25e[_0xb96b('0x4c')],null))[_0xb96b('0x10')](respondWithResult(_0x1ddcdb,null))[_0xb96b('0x4a')](handleError(_0x1ddcdb,null));};exports['getLogo']=function(_0x541658,_0x41eb2a){var _0x27418e=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x67'));var _0x1b3fe3={'where':{'id':_0x541658[_0xb96b('0x53')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x58bba6=![];return require(_0xb96b('0x68'))[_0xb96b('0x69')]()[_0xb96b('0x10')](function(_0x4b954e){if(_0x4b954e){_0x58bba6=_0x4b954e[_0xb96b('0x6a')];}})[_0xb96b('0x10')](function(){return db[_0xb96b('0x42')][_0xb96b('0x49')](_0x1b3fe3);})['then'](handleEntityNotFound(_0x41eb2a,null))[_0xb96b('0x10')](function(_0x59a69a){if(_0x59a69a){if(!_['isNil'](_0x59a69a[_0xb96b('0x6b')])){if(fs['existsSync'](path[_0xb96b('0x65')](config['root'],_0xb96b('0x6c'),_0x59a69a['sitepic']))&&_0x58bba6){_0x27418e=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x6c'),_0x59a69a[_0xb96b('0x6b')]);}}return _0x41eb2a[_0xb96b('0x6d')](_0x27418e);}})[_0xb96b('0x4a')](handleError(_0x41eb2a,null));};exports[_0xb96b('0x6e')]=function(_0x4acb7f,_0x503e89){var _0x440bc1=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x6f'));var _0x2e233d={'where':{'id':_0x4acb7f[_0xb96b('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xb96b('0x42')][_0xb96b('0x49')](_0x2e233d)[_0xb96b('0x10')](handleEntityNotFound(_0x503e89,null))[_0xb96b('0x10')](function(_0x2b7e01){if(_0x2b7e01){if(!_[_0xb96b('0x70')](_0x2b7e01[_0xb96b('0x60')])){if(fs[_0xb96b('0x71')](path['join'](config[_0xb96b('0x66')],_0xb96b('0x72'),_0x2b7e01[_0xb96b('0x60')]))){_0x440bc1=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x72'),_0x2b7e01[_0xb96b('0x60')]);}}return _0x503e89[_0xb96b('0x6d')](_0x440bc1);}})['catch'](handleError(_0x503e89,null));};exports[_0xb96b('0x73')]=function(_0xc4b445,_0x4d016c){var _0x5df5f4=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x74'));var _0x5f04ab={'where':{'id':_0xc4b445[_0xb96b('0x53')]['id']},'attributes':['id',_0xb96b('0x62'),_0xb96b('0x75')],'raw':!![]};return db[_0xb96b('0x42')][_0xb96b('0x49')](_0x5f04ab)[_0xb96b('0x10')](handleEntityNotFound(_0x4d016c,null))['then'](function(_0x4e7852){if(_0x4e7852){if(!_[_0xb96b('0x70')](_0x4e7852[_0xb96b('0x62')])){if(fs[_0xb96b('0x71')](path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x72'),_0x4e7852[_0xb96b('0x62')]))&&_0x4e7852[_0xb96b('0x75')]){_0x5df5f4=path['join'](config[_0xb96b('0x66')],_0xb96b('0x72'),_0x4e7852[_0xb96b('0x62')]);}}return _0x4d016c['download'](_0x5df5f4);}})[_0xb96b('0x4a')](handleError(_0x4d016c,null));};exports[_0xb96b('0x76')]=function(_0x4d93e2,_0x4d7e36){var _0x374a91=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x77'));var _0x401edb={'where':{'id':_0x4d93e2['params']['id']},'attributes':['id',_0xb96b('0x64')],'raw':!![]};return db[_0xb96b('0x42')][_0xb96b('0x49')](_0x401edb)[_0xb96b('0x10')](handleEntityNotFound(_0x4d7e36,null))['then'](function(_0x5615ec){if(_0x5615ec){if(!_[_0xb96b('0x70')](_0x5615ec[_0xb96b('0x64')])){if(fs[_0xb96b('0x71')](path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x72'),_0x5615ec['systemAvatar']))){_0x374a91=path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0x72'),_0x5615ec['systemAvatar']);}}return _0x4d7e36[_0xb96b('0x6d')](_0x374a91);}})['catch'](handleError(_0x4d7e36,null));};exports[_0xb96b('0x78')]=function(_0x18d2c0,_0x120fe9){var _0x238a4f=require('user-agent-parser');var _0x59224b=new _0x238a4f();var _0x1ee479=_0x59224b[_0xb96b('0x79')](_0x18d2c0['headers'][_0xb96b('0x7a')])[_0xb96b('0x7b')]();var _0x3c0875={'body':_0x18d2c0[_0xb96b('0x4c')],'channel':_0xb96b('0x7c')};var _0x3e7cf7=[];var _0x1193c1=[];var _0x1b921a={};var _0x3ed93b=![];return db[_0xb96b('0x7d')][_0xb96b('0x55')]()[_0xb96b('0x10')](function(_0xc3bf40){if(!_0xc3bf40){throw new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))]('no\x20available\x20attributes');}_0x3e7cf7=_[_0xb96b('0x80')](_[_0xb96b('0x31')](_0xc3bf40),['createdAt',_0xb96b('0x81')]);_0x1193c1=_[_0xb96b('0x80')](_[_0xb96b('0x31')](_0xc3bf40),['createdAt',_0xb96b('0x81'),_0xb96b('0x82'),_0xb96b('0x83')]);if(_0x18d2c0[_0xb96b('0x4c')]['id']){delete _0x18d2c0[_0xb96b('0x4c')]['id'];}if(_[_0xb96b('0x70')](_0x18d2c0[_0xb96b('0x4c')]['from'])){throw new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))](_0xb96b('0x84'));}if(_[_0xb96b('0x70')](_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x4c')])||_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x4c')]===''){throw new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x85')])){throw new db[(_0xb96b('0x7e'))]['ValidationError'](_0xb96b('0x86')+_0x1193c1);}if(!_[_0xb96b('0x87')](_0x1193c1,_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x85')])){throw new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))](_0xb96b('0x88')+_0x1193c1);}_0x1b921a[_0x18d2c0['body']['mapKey']]=_0x18d2c0['body'][_0xb96b('0x89')];})[_0xb96b('0x10')](function(){return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x18d2c0[_0xb96b('0x53')]['id']},'include':[{'model':db[_0xb96b('0x8a')],'as':'List','include':[{'model':db[_0xb96b('0x7d')],'as':_0xb96b('0x8b'),'where':_0x1b921a,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0xb96b('0x8c')}]});})['then'](handleEntityNotFound(_0x120fe9,null))[_0xb96b('0x10')](function(_0x5063ca){if(_0x5063ca&&_0x5063ca[_0xb96b('0x8d')]){_0x3c0875[_0xb96b('0x8e')]=_0x5063ca;_0x3c0875[_0xb96b('0x8f')]=_0x5063ca[_0xb96b('0x8c')];_0x3c0875[_0xb96b('0x90')]=_0x5063ca['List'];_0x3c0875[_0xb96b('0x8f')]=_[_0xb96b('0x91')](_0x3c0875[_0xb96b('0x8f')],['priority'],[_0xb96b('0x92')]);if(_0x3c0875['account'][_0xb96b('0x8c')]){delete _0x3c0875['account'][_0xb96b('0x8c')];}if(_0x3c0875[_0xb96b('0x8e')][_0xb96b('0x8d')]&&_0x3c0875['account']['List'][_0xb96b('0x8b')]['length']){return _0x3c0875[_0xb96b('0x8e')][_0xb96b('0x8d')]['Contacts'][0x0];}var _0x3d27a0=_[_0xb96b('0x8')](_0x18d2c0[_0xb96b('0x4c')],{'firstName':_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x89')],'ListId':_0x5063ca[_0xb96b('0x83')]});_0x3d27a0[_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x85')]]=_0x18d2c0['body'][_0xb96b('0x89')];return db[_0xb96b('0x7d')][_0xb96b('0x4b')](_0x3d27a0,{'fields':_0x3e7cf7,'raw':!![]});}})[_0xb96b('0x10')](handleEntityNotFound(_0x120fe9,null))[_0xb96b('0x10')](function(_0xc459b4){_0x3c0875[_0xb96b('0x93')]=_0xc459b4;var _0x41db7e=_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x94')];if(_0x18d2c0[_0xb96b('0x95')][_0xb96b('0x96')]){_0x41db7e=_0x18d2c0['headers'][_0xb96b('0x96')];}else if(_0x18d2c0['headers'][_0xb96b('0x97')]){_0x41db7e=_[_0xb96b('0x98')](_0x18d2c0['headers'][_0xb96b('0x97')][_0xb96b('0x99')](','));}if(_0xc459b4){var _0x1c95ee={'ContactId':_0xc459b4['id'],'ChatWebsiteId':_0x18d2c0[_0xb96b('0x53')]['id'],'from':(_0xc459b4[_0xb96b('0x9a')]||'')+'\x20'+(_0xc459b4['lastName']||''),'customerIp':_0x41db7e,'customerPort':_0x18d2c0[_0xb96b('0x95')][_0xb96b('0x9b')]?_0x18d2c0[_0xb96b('0x95')][_0xb96b('0x9b')]:null,'referer':_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x9c')],'browserName':_0x1ee479['browser'][_0xb96b('0x2a')]&&_0x1ee479[_0xb96b('0x9d')][_0xb96b('0x9e')]?util[_0xb96b('0x9f')](_0xb96b('0xa0'),_0x1ee479[_0xb96b('0x9d')][_0xb96b('0x2a')],_0x1ee479[_0xb96b('0x9d')]['version']):_0xb96b('0xa1'),'browserVersion':_0x1ee479[_0xb96b('0x9d')][_0xb96b('0x9e')]||'unknown','osName':util[_0xb96b('0x9f')](_0xb96b('0xa0'),_0x1ee479['os'][_0xb96b('0x2a')],_0x1ee479['os'][_0xb96b('0x9e')]),'osVersion':_0x1ee479['os']['version'],'deviceModel':_0x1ee479[_0xb96b('0xa2')][_0xb96b('0x34')]&&_0x1ee479[_0xb96b('0xa2')][_0xb96b('0xa3')]?util['format'](_0xb96b('0xa4'),_0x1ee479['device'][_0xb96b('0x34')],_0x1ee479[_0xb96b('0xa2')][_0xb96b('0xa3')],_0x1ee479[_0xb96b('0xa2')][_0xb96b('0xa5')]):null,'deviceVendor':_0x1ee479['device'][_0xb96b('0xa3')],'deviceType':_0x1ee479['device']['type'],'formData':JSON['stringify'](_0x18d2c0[_0xb96b('0x4c')])};var _0x5cc90e={'ChatWebsiteId':_0x18d2c0[_0xb96b('0x53')]['id'],'closed':![]};if(_0x18d2c0['body']['threadId']){_0x5cc90e[_0xb96b('0xa6')]=_0x18d2c0[_0xb96b('0x4c')]['threadId'];return db[_0xb96b('0xa7')]['find']({'where':_0x5cc90e})['then'](function(_0x513c94){if(_0x513c94){return[_0x513c94,![]];}_0x1c95ee[_0xb96b('0xa6')]=_0x18d2c0[_0xb96b('0x4c')]['threadId'];_0x1c95ee[_0xb96b('0xa8')]=_0x18d2c0['body'][_0xb96b('0xa8')];return db[_0xb96b('0xa7')][_0xb96b('0x4b')](_0x1c95ee)[_0xb96b('0x10')](function(_0x52bcde){return[_0x52bcde,!![]];});});}_0x5cc90e[_0xb96b('0xa9')]=_0xc459b4['id'];if(_0x18d2c0['body']['interaction']&&_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0xaa')]['id']){_0x5cc90e['id']=_0x18d2c0[_0xb96b('0x4c')]['interaction']['id'];return db['ChatInteraction'][_0xb96b('0x49')]({'where':_0x5cc90e})[_0xb96b('0x10')](function(_0x1a5cd4){if(_0x1a5cd4){return[_0x1a5cd4,![]];}return db[_0xb96b('0xa7')][_0xb96b('0x4b')](_0x1c95ee)[_0xb96b('0x10')](function(_0x350da3){return[_0x350da3,!![]];});});}return db[_0xb96b('0xa7')]['create'](_0x1c95ee)['then'](function(_0x4121e9){return[_0x4121e9,!![]];});}})['spread'](function(_0x37d7b0,_0x174887){if(_0x37d7b0){_0x3ed93b=_0x174887;if(!_0x174887){var _0x26560c={'from':(_0x3c0875['contact'][_0xb96b('0x9a')]||'')+'\x20'+(_0x3c0875[_0xb96b('0x93')][_0xb96b('0xab')]||'')};if(_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0xa6')]&&_0x18d2c0[_0xb96b('0x4c')]['messageId']&&_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0xa6')]!=_0x18d2c0['body']['messageId']){_0x26560c[_0xb96b('0xa6')]=_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0xac')];}return _0x37d7b0[_0xb96b('0x22')](_0x26560c);}else{return _0x37d7b0;}}})[_0xb96b('0x10')](function(_0x4259c0){_0x3c0875[_0xb96b('0xaa')]=_0x4259c0[_0xb96b('0x24')]({'plain':!![]});_0x3c0875[_0xb96b('0xaa')]['created']=_0x3ed93b;if(_0x3c0875[_0xb96b('0xaa')][_0xb96b('0xad')]){if(_0x3c0875[_0xb96b('0x8e')][_0xb96b('0xae')]){_0x3c0875[_0xb96b('0x8f')][_0xb96b('0xaf')]({'id':0x0,'priority':_0x3c0875[_0xb96b('0x8f')][_0xb96b('0x36')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xb96b('0xb0')});}}return db['ChatMessage'][_0xb96b('0x4b')]({'body':_0x18d2c0[_0xb96b('0x4c')][_0xb96b('0x4c')],'ChatWebsiteId':_0x18d2c0[_0xb96b('0x53')]['id'],'ChatInteractionId':_0x4259c0['id'],'direction':'in','ContactId':_0x3c0875[_0xb96b('0x93')]['id'],'AttachmentId':_0x18d2c0[_0xb96b('0x4c')]['AttachmentId']});})[_0xb96b('0x10')](function(_0x1dee7e){_0x3c0875[_0xb96b('0x17')]=_0x1dee7e;if(_0x3c0875['interaction'][_0xb96b('0xb1')]){return db[_0xb96b('0xb2')][_0xb96b('0x49')]({'attributes':['id',_0xb96b('0x2a')],'where':{'id':_0x3c0875[_0xb96b('0xaa')][_0xb96b('0xb1')]}})[_0xb96b('0x10')](function(_0x33424e){if(_0x33424e){_0x3c0875[_0xb96b('0x8f')][_0xb96b('0xb3')]({'id':0x0,'priority':0x0,'app':_0xb96b('0xb4'),'appdata':_0x33424e[_0xb96b('0x2a')]+','+(_0x3c0875[_0xb96b('0x8e')][_0xb96b('0xb5')]||0xa),'interval':_0xb96b('0xb0')});_0x3c0875[_0xb96b('0xb6')]=!![];}return respondWithRpcPromise(_0xb96b('0xb7'),_0xb96b('0xb8'),_0x3c0875);});}return respondWithRpcPromise(_0xb96b('0xb7'),_0xb96b('0xb8'),_0x3c0875);})[_0xb96b('0x10')](function(_0x35a07c){respondWithRpcPromise(_0xb96b('0xb9'),_0xb96b('0xb9'),{'event':_0xb96b('0x78'),'message':_0x35a07c},client9002);return _0x35a07c;})['then'](respondWithResult(_0x120fe9,null))[_0xb96b('0x4a')](handleError(_0x120fe9,null));};exports['offline']=function(_0x5d8468,_0x1a02db){var _0x12e9dc,_0x1a7607,_0x5a1495;var _0x34f9d0=[];var _0x2f6af5={};var _0xd8eb74=_0x5d8468[_0xb96b('0xba')]||[];var _0x2c2807=[];var _0x159e0e;return db[_0xb96b('0x7d')][_0xb96b('0x55')]()[_0xb96b('0x10')](function(_0x2867e4){if(!_0x2867e4){throw new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))](_0xb96b('0xbb'));}_0x34f9d0=_['difference'](_[_0xb96b('0x31')](_0x2867e4),[_0xb96b('0xbc'),_0xb96b('0x81'),'CompanyId','ListId']);if(_0x5d8468[_0xb96b('0x4c')]['id']){delete _0x5d8468[_0xb96b('0x4c')]['id'];}if(_['isNil'](_0x5d8468[_0xb96b('0x4c')]['from'])){throw _0x1a02db['status'](0x1f4)['send'](new db['Sequelize'][(_0xb96b('0x7f'))](_0xb96b('0x84')));}if(_[_0xb96b('0x70')](_0x5d8468[_0xb96b('0x4c')][_0xb96b('0x4c')])||_0x5d8468[_0xb96b('0x4c')][_0xb96b('0x4c')]===''){throw _0x1a02db[_0xb96b('0x1a')](0x1f4)[_0xb96b('0x2b')](new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))](_0xb96b('0xbd')));}if(_[_0xb96b('0x70')](_0x5d8468[_0xb96b('0x4c')][_0xb96b('0xbe')])){throw _0x1a02db[_0xb96b('0x1a')](0x1f4)[_0xb96b('0x2b')](new db[(_0xb96b('0x7e'))][(_0xb96b('0x7f'))](_0xb96b('0xbf')+_0x34f9d0));}if(!_['includes'](_0x34f9d0,_0x5d8468['body'][_0xb96b('0xbe')])){throw _0x1a02db[_0xb96b('0x1a')](0x1f4)[_0xb96b('0x2b')](new db['Sequelize'][(_0xb96b('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x34f9d0));}_0x2f6af5[_0x5d8468[_0xb96b('0x4c')][_0xb96b('0xbe')]]=_0x5d8468[_0xb96b('0x4c')][_0xb96b('0x89')];})[_0xb96b('0x10')](function(){return db[_0xb96b('0x42')]['find']({'where':{'id':_0x5d8468[_0xb96b('0x53')]['id']},'include':[{'model':db[_0xb96b('0x8a')],'as':_0xb96b('0x8d')},{'model':db[_0xb96b('0xc0')],'as':'MailAccount'}]});})[_0xb96b('0x10')](handleEntityNotFound(_0x1a02db,null))['then'](function(_0x3c8f9c){if(_0x3c8f9c&&_0x3c8f9c[_0xb96b('0x8d')]){_0x1a7607=_0x3c8f9c;var _0x3056ba=_[_0xb96b('0x8')](_0x5d8468['body'],{'firstName':_0x5d8468[_0xb96b('0x4c')][_0xb96b('0x89')],'phone':_0x5d8468['body'][_0xb96b('0x89')],'ListId':_0x3c8f9c[_0xb96b('0x83')]});_0x3056ba[_0x5d8468[_0xb96b('0x4c')][_0xb96b('0xbe')]]=_0x5d8468[_0xb96b('0x4c')][_0xb96b('0x89')];return db[_0xb96b('0x7d')][_0xb96b('0xc1')]({'where':_0x2f6af5,'defaults':_0x3056ba});}})[_0xb96b('0xc2')](function(_0xfe8430){if(_0xfe8430){_0x5a1495=_0xfe8430;var _0x5b16e6=fs[_0xb96b('0xc3')](path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0xc4')),_0xb96b('0xc5'));var _0x382876=ejs[_0xb96b('0xc6')](_0x5b16e6,{'body':_[_0xb96b('0xc7')](_0x5d8468[_0xb96b('0x4c')][_0xb96b('0x4c')]),'bodyTitle':_0x1a7607[_0xb96b('0xc8')]});return db[_0xb96b('0xc9')][_0xb96b('0x4b')]({'body':_0x382876,'ContactId':_0xfe8430['id'],'ChatWebsiteId':_0x1a7607['id']});}})[_0xb96b('0x10')](function(_0xf26e8d){_0x159e0e=_0xf26e8d;if(_0xd8eb74[_0xb96b('0x36')]){var _0x49ab3e=_0xd8eb74[_0xb96b('0x2e')](function(_0x18c898){return{'name':_0x18c898[_0xb96b('0xca')],'basename':_0x18c898[_0xb96b('0x5e')],'type':_0x18c898[_0xb96b('0xcb')],'ChatOfflineMessageId':_0xf26e8d['id']};});_0x2c2807=_0x49ab3e[_0xb96b('0x2e')](_0x30ff1b=>{var _0x3cf188={'filename':_0x30ff1b['name'],'path':path[_0xb96b('0x65')](config[_0xb96b('0x66')],_0xb96b('0xcc'),_0xb96b('0xba'),_0xb96b('0xcd'),'offline-chat',_0x30ff1b[_0xb96b('0xce')])};return _0x3cf188;});if(!_0x1a7607[_0xb96b('0xcf')]){return db['sequelize'][_0xb96b('0xd0')](function(_0x3117ae){return db['Attachment']['bulkCreate'](_0x49ab3e,{'transaction':_0x3117ae});});}}})[_0xb96b('0x10')](function(){if(_0x159e0e){_0x12e9dc=_0x159e0e;return db['MailAccount'][_0xb96b('0x59')]({'where':{'active':!![]},'include':[{'model':db[_0xb96b('0xd1')],'as':'Smtp','raw':!![]}]});}})[_0xb96b('0x10')](function(_0x29ab06){if(_0x29ab06&&_0x29ab06['Smtp']&&_0x1a7607[_0xb96b('0xd2')]&&_0x1a7607['forwardOfflineAddress']){var _0x3a2c96={'tls':{'rejectUnauthorized':![]}};if(_0x29ab06[_0xb96b('0xd3')][_0xb96b('0xd4')]){_0x3a2c96[_0xb96b('0xd4')]=_0x29ab06[_0xb96b('0xd3')][_0xb96b('0xd4')];}else{_0x3a2c96[_0xb96b('0xd5')]=_0x29ab06['Smtp']['host'];_0x3a2c96[_0xb96b('0xd6')]=_0x29ab06[_0xb96b('0xd3')][_0xb96b('0xd6')];_0x3a2c96[_0xb96b('0xd7')]=_0x29ab06[_0xb96b('0xd3')]['secure'];}if(_0x29ab06[_0xb96b('0xd3')][_0xb96b('0xd8')]){_0x3a2c96[_0xb96b('0xd9')]={'user':_0x29ab06[_0xb96b('0xd3')][_0xb96b('0x4d')],'pass':_0x29ab06[_0xb96b('0xd3')][_0xb96b('0xda')]};}return respondWithRpcPromise('SendMail',_0xb96b('0xdb'),{'account':_0x3a2c96,'message':{'from':util[_0xb96b('0x9f')](_0xb96b('0xdc'),_0x29ab06['name'],_0x29ab06[_0xb96b('0xdd')]||_0x29ab06[_0xb96b('0xd3')]['user']),'to':_0x1a7607[_0xb96b('0xde')],'subject':_0x1a7607['offlineMessageSubject'],'html':_0x12e9dc[_0xb96b('0x4c')],'attachments':_0x2c2807}},client9003)[_0xb96b('0x10')](function(){return _0x12e9dc;})['catch'](function(_0x5c6a2b){console[_0xb96b('0x16')](_0x5c6a2b);});}})[_0xb96b('0x10')](function(){if(_0x1a7607&&_0x1a7607[_0xb96b('0xcf')]&&_0x1a7607[_0xb96b('0xdf')]){var _0x14869d=[];if(_0xd8eb74['length']){_0x14869d=_0xd8eb74[_0xb96b('0x2e')](function(_0x33b196){return{'name':_0x33b196[_0xb96b('0xca')],'basename':_0x33b196['filename'],'type':_0x33b196[_0xb96b('0xcb')],'ChatOfflineMessageId':_0x159e0e['id']};});}var _0x2af217;if(!_[_0xb96b('0x70')](_0x1a7607[_0xb96b('0xe0')])){var _0xfc91c1=_[_0xb96b('0x2e')](_0x5d8468['body'],function(_0x110282){return _0x110282;});var _0x4ea206=_[_0xb96b('0xe1')](_0xfc91c1)[0x0];var _0x3d63a3=_['mapValues'](_0x4ea206,function(_0x57dfef){return _0x57dfef;});_0x2af217=_0x3d63a3[0x1][_0x1a7607[_0xb96b('0xe0')]];}var _0x5afbad={'from':_0x5a1495[_0xb96b('0xdd')],'firstName':_0x5a1495[_0xb96b('0x9a')],'lastName':_0x5a1495[_0xb96b('0xab')],'mapKey':_0xb96b('0xdd'),'message':{'from':_0x5a1495[_0xb96b('0xdd')],'to':_0x1a7607[_0xb96b('0xc0')][_0xb96b('0xdd')],'cc':'','subject':_[_0xb96b('0x70')](_0x2af217)?_0x1a7607[_0xb96b('0xe2')]:_0x2af217,'messageId':'','sentAt':new Date(),'attach':_0x14869d[_0xb96b('0x36')],'attachments':_0x14869d,'originChannel':'Chat','ChatWebsiteId':_0x1a7607['id'],'ChatOfflineMessageId':_0x12e9dc['id'],'originTo':_0x1a7607['MailAccount'][_0xb96b('0xdd')]},'body':_0x12e9dc['body']};var _0x256376={'account':{'id':_0x1a7607['MailAccountId']},'body':_0x5afbad,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xb96b('0xe3'),'notifyMail',_0x256376,client9001)['then'](function(){return _0x12e9dc;})['catch'](function(_0x1cfee1){console['error'](_0x1cfee1);});}return;})[_0xb96b('0x10')](function(){if(_0x12e9dc){return _0x12e9dc;}})[_0xb96b('0x10')](respondWithResult(_0x1a02db,null))[_0xb96b('0x4a')](function(_0x45c29b){console[_0xb96b('0x16')]('catch',_0x45c29b);for(var _0x4b18f5 of _0xd8eb74){var _0x2e77e4=path[_0xb96b('0x65')](config['root'],_0xb96b('0xcc'),_0xb96b('0xba'),_0xb96b('0xcd'),_0xb96b('0xe4'),_0x4b18f5[_0xb96b('0x5e')]);fs_extra['remove'](_0x2e77e4)['catch'](function(_0xf3023b){console[_0xb96b('0x16')](_0xb96b('0xe5'),_0x2e77e4,_0xf3023b);});}});};exports[_0xb96b('0xe6')]=function(_0x8b68a,_0x14ba47){return db['ChatInteraction'][_0xb96b('0x49')]({'where':{'id':_0x8b68a[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x14ba47,null))['then'](function(_0x4d69e6){if(_0x4d69e6){return _0x4d69e6['addInteraction'](_0x8b68a[_0xb96b('0x4c')][_0xb96b('0xe7')],_['omit'](_0x8b68a[_0xb96b('0x4c')],['ids','id'])||{});}})[_0xb96b('0x10')](respondWithResult(_0x14ba47,null))[_0xb96b('0x4a')](handleError(_0x14ba47,null));};exports[_0xb96b('0xe8')]=function(_0xe837fd,_0x4a6724){var _0x386e9c={'raw':![],'where':{}};var _0x32a947={};var _0xb5cce8={'count':0x0,'rows':[]};return db[_0xb96b('0x42')][_0xb96b('0x59')]({'where':{'id':_0xe837fd[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x4a6724,null))[_0xb96b('0x10')](function(_0xdaf84f){if(_0xdaf84f){_0x32a947[_0xb96b('0x34')]=_['keys'](db[_0xb96b('0xa7')][_0xb96b('0x48')]);_0x32a947['query']=_[_0xb96b('0x31')](_0xe837fd[_0xb96b('0x30')]);_0x32a947[_0xb96b('0x3c')]=_[_0xb96b('0x32')](_0x32a947[_0xb96b('0x34')],_0x32a947[_0xb96b('0x30')]);_0x386e9c[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0x32a947[_0xb96b('0x34')],qs[_0xb96b('0x35')](_0xe837fd['query'][_0xb96b('0x35')]));_0x386e9c[_0xb96b('0x33')]=_0x386e9c[_0xb96b('0x33')][_0xb96b('0x36')]?_0x386e9c[_0xb96b('0x33')]:_0x32a947['model'];if(!_0xe837fd['query']['hasOwnProperty'](_0xb96b('0x38'))){_0x386e9c[_0xb96b('0x1d')]=qs[_0xb96b('0x1d')](_0xe837fd[_0xb96b('0x30')][_0xb96b('0x1d')]);_0x386e9c[_0xb96b('0x1f')]=qs[_0xb96b('0x1f')](_0xe837fd[_0xb96b('0x30')]['offset']);}_0x386e9c[_0xb96b('0x39')]=qs[_0xb96b('0x3a')](_0xe837fd['query'][_0xb96b('0x3a')]);_0x386e9c[_0xb96b('0x3b')]=qs[_0xb96b('0x3c')](_[_0xb96b('0x3d')](_0xe837fd[_0xb96b('0x30')],_0x32a947['filters']));_0x386e9c[_0xb96b('0x3b')][_0xb96b('0x57')]=_0xdaf84f['id'];if(_0xe837fd[_0xb96b('0x30')][_0xb96b('0x3e')]){_0x386e9c['where']=_[_0xb96b('0x3f')](_0x386e9c[_0xb96b('0x3b')],{'$or':_['map'](_0x386e9c[_0xb96b('0x33')],function(_0x201a1f){var _0x4ff09e={};_0x4ff09e[_0x201a1f]={'$like':'%'+_0xe837fd[_0xb96b('0x30')]['filter']+'%'};return _0x4ff09e;})});}_0x386e9c=_['merge']({},_0x386e9c,_0xe837fd[_0xb96b('0x41')]);return db[_0xb96b('0xa7')][_0xb96b('0x1e')]({'where':_0x386e9c['where']})[_0xb96b('0x10')](function(_0x493fee){_0xb5cce8[_0xb96b('0x1e')]=_0x493fee;if(_0xe837fd[_0xb96b('0x30')]['includeAll']){_0x386e9c[_0xb96b('0x44')]=[{'model':db[_0xb96b('0x7d')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xb96b('0xe9'),'attributes':[_0xb96b('0x2a'),_0xb96b('0xea'),_0xb96b('0xeb')],'required':![]},{'model':db[_0xb96b('0xec')],'as':_0xb96b('0xed'),'attributes':['id',_0xb96b('0x2a'),_0xb96b('0xee')],'where':_0xe837fd[_0xb96b('0x30')][_0xb96b('0xef')]?{'id':_0xe837fd['query'][_0xb96b('0xef')]}:undefined,'required':_0xe837fd[_0xb96b('0x30')][_0xb96b('0xef')]?!![]:![]}];}return db[_0xb96b('0xa7')][_0xb96b('0x45')](_0x386e9c);})[_0xb96b('0x10')](function(_0x5d722f){_0xb5cce8[_0xb96b('0x46')]=_0x5d722f;return _0xb5cce8;});}})[_0xb96b('0x10')](respondWithFilteredResult(_0x4a6724,_0x386e9c))[_0xb96b('0x4a')](handleError(_0x4a6724,null));};function iftimePromise(_0x55b800,_0x5d14d3){return respondWithRpcPromise(_0xb96b('0xf0'),_0xb96b('0xf1'),{'command':_0x5d14d3[_0xb96b('0xf2')]?util['format'](_0xb96b('0xf3'),_0x55b800[_0xb96b('0xf4')],_0x5d14d3['timezone']):util[_0xb96b('0x9f')](_0xb96b('0xf5'),_0x55b800[_0xb96b('0xf4')])},client9002)['then'](function(_0x114962){var _0x2aa99c=_0x114962&&_0x114962[_0xb96b('0xf6')]('true')>=0x0?!![]:![];logger[_0xb96b('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5d14d3['id'],_0x55b800['id'],_0x55b800[_0xb96b('0xf4')],_0x2aa99c?_0xb96b('0xf7'):_0xb96b('0xf8'),_0x5d14d3[_0xb96b('0xf2')]?_0x5d14d3[_0xb96b('0xf2')]:_0xb96b('0xf9'));return _0x2aa99c;})[_0xb96b('0x4a')](function(_0xea627f){logger[_0xb96b('0x16')](_0xb96b('0xfa'),_0x5d14d3['id'],_0x55b800['id'],_0x55b800[_0xb96b('0xf4')],util[_0xb96b('0xfb')](_0xea627f,{'showHidden':![],'depth':null}),_0x5d14d3[_0xb96b('0xf2')]?_0x5d14d3['timezone']:_0xb96b('0xf9'));return![];});}exports[_0xb96b('0xf1')]=function(_0x3c69d2,_0x48f30b){var _0x35d769=0x0;var _0x5bdbec=0x0;var _0x1fc2e2=![];var _0x1ae3f0;var _0x549cc7;return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x3c69d2[_0xb96b('0x53')]['id']},'include':[{'model':db[_0xb96b('0xfc')],'as':_0xb96b('0xfc'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xb96b('0xf4')],'raw':!![]}]}]})[_0xb96b('0x10')](handleEntityNotFound(_0x48f30b,null))[_0xb96b('0x10')](function(_0x4b79cd){if(_0x4b79cd){_0x1ae3f0=_0x4b79cd;return _0x4b79cd[_0xb96b('0xfd')]({'raw':!![]});}})[_0xb96b('0x10')](function(_0x30afe3){if(_0x1ae3f0){if(_0x30afe3){_0x549cc7=_0x30afe3;}}return require(_0xb96b('0x68'))[_0xb96b('0x69')]();})[_0xb96b('0x10')](function(_0x45bc8a){if(_0x45bc8a){_0x5bdbec=_0x45bc8a['virtual'];_0x1fc2e2=_0x45bc8a[_0xb96b('0x6a')];}})[_0xb96b('0x10')](function(){return db[_0xb96b('0xa7')][_0xb96b('0x1e')]({'where':{'closed':![]}});})['then'](function(_0x11292a){_0x35d769=_0x11292a;if(_0x5bdbec&&_0x11292a>_0x5bdbec){return db['License'][_0xb96b('0x59')]({'where':{'id':0x1}})[_0xb96b('0x10')](function(_0x323cb6){if(_0x323cb6){_0x323cb6[_0xb96b('0xfe')](_0xb96b('0xff'));}});}})['then'](function(){if(_0x1ae3f0[_0xb96b('0xfc')]&&_0x1ae3f0[_0xb96b('0xfc')][_0xb96b('0x100')]){var _0x252494=[];for(var _0x47792e=0x0;_0x47792e<_0x1ae3f0[_0xb96b('0xfc')][_0xb96b('0x100')][_0xb96b('0x36')];_0x47792e++){var _0x201c72=_0x1ae3f0['Interval'][_0xb96b('0x100')][_0x47792e][_0xb96b('0x24')]({'plain':!![]});_0x252494[_0xb96b('0xaf')](iftimePromise(_0x201c72,_0x1ae3f0));}return BPromise[_0xb96b('0x101')](_0x252494)['then'](function(_0x537cbb){return _['some'](_0x537cbb);});}else{return!![];}})['then'](function(_0x5cd39e){var _0x29c877=fs['readFileSync'](path['join'](config[_0xb96b('0x66')],_0xb96b('0x102')),_0xb96b('0xc5'));var _0x568771={'remote':_0x1ae3f0[_0xb96b('0x103')],'query':querystring[_0xb96b('0x15')](_['merge'](_0x1ae3f0[_0xb96b('0x24')]({'plain':!![]}),{'customerIp':_0x3c69d2[_0xb96b('0x95')][_0xb96b('0x97')]||_0x3c69d2[_0xb96b('0x95')][_0xb96b('0x104')]||_0x3c69d2[_0xb96b('0x105')][_0xb96b('0x106')]||_0x3c69d2['ip'],'referer':_0x3c69d2[_0xb96b('0x95')]['referer'],'openedInteractions':_0x35d769,'maxInteractions':_0x5bdbec,'virtual':_0x1fc2e2[_0xb96b('0x107')],'online':_0x5cd39e,'custom':_0x1fc2e2}))[_0xb96b('0x108')](/'/g,'\x5c\x27')};_0x48f30b[_0xb96b('0x2b')](ejs[_0xb96b('0xc6')](Mustache['render'](_0x29c877,_0x568771),{'proactiveActions':_0x549cc7,'alignment':_0x1ae3f0['alignment'],'verticalAlignment':_0x1ae3f0[_0xb96b('0x109')],'div_color':_0x1ae3f0[_0xb96b('0xee')],'text_color':_0x1ae3f0[_0xb96b('0x10a')],'button_color':_0x1ae3f0['color_button'],'background_color':_0x1ae3f0['backgroundColor']}));})['catch'](handleError(_0x48f30b,null));};exports[_0xb96b('0x10b')]=function(_0x23a72b,_0x12b93c){var _0x314778=_0x23a72b['params']['id'];var _0x50ddbd=_0x23a72b[_0xb96b('0x4c')];var _0x46df6e=0xc8;var _0x1e07f7=null;return db[_0xb96b('0x10c')][_0xb96b('0xd0')]({'isolationLevel':db[_0xb96b('0x10c')]['Transaction'][_0xb96b('0x10d')][_0xb96b('0x10e')]},function(_0x37de11){return db[_0xb96b('0x42')][_0xb96b('0x59')]({'where':{'id':_0x314778},'transaction':_0x37de11})[_0xb96b('0x10')](function(_0xecc770){if(_0xecc770){return db[_0xb96b('0x10f')][_0xb96b('0x23')]({'where':{'ChatWebsiteId':_0x314778},'transaction':_0x37de11})[_0xb96b('0x10')](function(){var _0x4192c8=_['map'](_0x50ddbd,function(_0x36b302){_0x36b302[_0xb96b('0x57')]=_0x314778;return _0x36b302;});return db[_0xb96b('0x10f')][_0xb96b('0x110')](_0x4192c8,{'transaction':_0x37de11});});}else{_0x46df6e=0x194;_0x1e07f7=[];}});})[_0xb96b('0x10')](function(){if(_0x46df6e!==0x194){return db[_0xb96b('0x10f')][_0xb96b('0x111')]({'where':{'ChatWebsiteId':_0x314778},'order':_0xb96b('0x112')})['then'](function(_0x4c8666){_0x1e07f7=_0x4c8666;});}})['catch'](function(_0x74deaf){_0x46df6e=0x1f4;logger[_0xb96b('0x16')](_0x74deaf[_0xb96b('0x29')]);if(_0x74deaf[_0xb96b('0x2a')]){delete _0x74deaf[_0xb96b('0x2a')];}_0x1e07f7=_0x74deaf;})['finally'](function(){if(_0x1e07f7===null){_0x12b93c['sendStatus'](_0x46df6e);}else{if(_0x46df6e===0x1f4){_0x12b93c[_0xb96b('0x1a')](_0x46df6e)[_0xb96b('0x2b')](_0x1e07f7);}else{_0x12b93c[_0xb96b('0x1a')](_0x46df6e)[_0xb96b('0x1b')](_0x1e07f7);}}});};exports['getApplications']=function(_0x480cfa,_0x878ecb){var _0xfc62b3={};var _0x18401b={};var _0x259fee;var _0x5c2861;return db['ChatWebsite'][_0xb96b('0x59')]({'where':{'id':_0x480cfa[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x878ecb,null))[_0xb96b('0x10')](function(_0x2069e2){if(_0x2069e2){_0x259fee=_0x2069e2;_0x18401b[_0xb96b('0x34')]=_[_0xb96b('0x31')](db[_0xb96b('0x10f')][_0xb96b('0x48')]);_0x18401b[_0xb96b('0x30')]=_[_0xb96b('0x31')](_0x480cfa['query']);_0x18401b[_0xb96b('0x3c')]=_[_0xb96b('0x32')](_0x18401b[_0xb96b('0x34')],_0x18401b[_0xb96b('0x30')]);_0xfc62b3[_0xb96b('0x33')]=_['intersection'](_0x18401b['model'],qs[_0xb96b('0x35')](_0x480cfa[_0xb96b('0x30')][_0xb96b('0x35')]));_0xfc62b3[_0xb96b('0x33')]=_0xfc62b3[_0xb96b('0x33')]['length']?_0xfc62b3[_0xb96b('0x33')]:_0x18401b[_0xb96b('0x34')];_0xfc62b3[_0xb96b('0x39')]=qs[_0xb96b('0x3a')](_0x480cfa[_0xb96b('0x30')]['sort']);_0xfc62b3[_0xb96b('0x3b')]=qs[_0xb96b('0x3c')](_['pick'](_0x480cfa['query'],_0x18401b['filters']));if(_0x480cfa[_0xb96b('0x30')]['filter']){_0xfc62b3[_0xb96b('0x3b')]=_['merge'](_0xfc62b3[_0xb96b('0x3b')],{'$or':_['map'](_0xfc62b3[_0xb96b('0x33')],function(_0x156747){var _0xf7665d={};_0xf7665d[_0x156747]={'$like':'%'+_0x480cfa['query'][_0xb96b('0x3e')]+'%'};return _0xf7665d;})});}_0xfc62b3=_[_0xb96b('0x3f')]({},_0xfc62b3,_0x480cfa[_0xb96b('0x41')]);return _0x259fee[_0xb96b('0x113')](_0xfc62b3);}})[_0xb96b('0x10')](function(_0x4cad3c){if(_0x4cad3c){_0x5c2861=_0x4cad3c[_0xb96b('0x36')];if(!_0x480cfa[_0xb96b('0x30')]['hasOwnProperty'](_0xb96b('0x38'))){_0xfc62b3[_0xb96b('0x1d')]=qs[_0xb96b('0x1d')](_0x480cfa[_0xb96b('0x30')][_0xb96b('0x1d')]);_0xfc62b3['offset']=qs[_0xb96b('0x1f')](_0x480cfa[_0xb96b('0x30')][_0xb96b('0x1f')]);}return _0x259fee[_0xb96b('0x113')](_0xfc62b3);}})[_0xb96b('0x10')](function(_0x569981){if(_0x569981){return _0x569981?{'count':_0x5c2861,'rows':_0x569981}:null;}})['then'](respondWithResult(_0x878ecb,null))[_0xb96b('0x4a')](handleError(_0x878ecb,null));};exports[_0xb96b('0x114')]=function(_0x2cc62d,_0x417c7b){return db[_0xb96b('0x115')][_0xb96b('0x49')]({'where':{'id':_0x2cc62d[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x417c7b,null))[_0xb96b('0x10')](function(_0x2982d1){if(_0x2982d1){return _0x2982d1['addProactiveActions'](_0x2cc62d['body'][_0xb96b('0xe7')],_[_0xb96b('0x116')](_0x2cc62d['body'],['ids','id'])||{});}})[_0xb96b('0x10')](respondWithResult(_0x417c7b,null))[_0xb96b('0x4a')](handleError(_0x417c7b,null));};exports[_0xb96b('0xfd')]=function(_0x4416bc,_0xe9ea28){var _0x444348={};var _0x223c89={};var _0x399dc9;var _0x2dffd9;return db['ChatWebsite'][_0xb96b('0x59')]({'where':{'id':_0x4416bc[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0xe9ea28,null))[_0xb96b('0x10')](function(_0xf3d056){if(_0xf3d056){_0x399dc9=_0xf3d056;_0x223c89[_0xb96b('0x34')]=_['keys'](db[_0xb96b('0x117')][_0xb96b('0x48')]);_0x223c89[_0xb96b('0x30')]=_[_0xb96b('0x31')](_0x4416bc['query']);_0x223c89['filters']=_[_0xb96b('0x32')](_0x223c89[_0xb96b('0x34')],_0x223c89[_0xb96b('0x30')]);_0x444348[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0x223c89[_0xb96b('0x34')],qs[_0xb96b('0x35')](_0x4416bc['query'][_0xb96b('0x35')]));_0x444348[_0xb96b('0x33')]=_0x444348[_0xb96b('0x33')][_0xb96b('0x36')]?_0x444348[_0xb96b('0x33')]:_0x223c89[_0xb96b('0x34')];_0x444348[_0xb96b('0x39')]=qs['sort'](_0x4416bc[_0xb96b('0x30')][_0xb96b('0x3a')]);_0x444348[_0xb96b('0x3b')]=qs['filters'](_[_0xb96b('0x3d')](_0x4416bc[_0xb96b('0x30')],_0x223c89['filters']));if(_0x4416bc[_0xb96b('0x30')]['filter']){_0x444348[_0xb96b('0x3b')]=_['merge'](_0x444348[_0xb96b('0x3b')],{'$or':_[_0xb96b('0x2e')](_0x444348[_0xb96b('0x33')],function(_0x143cba){var _0x2d85c3={};_0x2d85c3[_0x143cba]={'$like':'%'+_0x4416bc['query'][_0xb96b('0x3e')]+'%'};return _0x2d85c3;})});}_0x444348=_[_0xb96b('0x3f')]({},_0x444348,_0x4416bc[_0xb96b('0x41')]);return _0x399dc9[_0xb96b('0xfd')](_0x444348);}})[_0xb96b('0x10')](function(_0x9e4fc0){if(_0x9e4fc0){_0x2dffd9=_0x9e4fc0[_0xb96b('0x36')];if(!_0x4416bc[_0xb96b('0x30')][_0xb96b('0x37')]('nolimit')){_0x444348[_0xb96b('0x1d')]=qs['limit'](_0x4416bc[_0xb96b('0x30')][_0xb96b('0x1d')]);_0x444348['offset']=qs[_0xb96b('0x1f')](_0x4416bc[_0xb96b('0x30')][_0xb96b('0x1f')]);}return _0x399dc9[_0xb96b('0xfd')](_0x444348);}})['then'](function(_0x27db4c){if(_0x27db4c){return _0x27db4c?{'count':_0x2dffd9,'rows':_0x27db4c}:null;}})[_0xb96b('0x10')](respondWithResult(_0xe9ea28,null))[_0xb96b('0x4a')](handleError(_0xe9ea28,null));};exports[_0xb96b('0x118')]=function(_0xe25152,_0x176660){var _0x125250=_0xe25152[_0xb96b('0x30')]['online']===_0xb96b('0x119')?_0xb96b('0x11a'):_0xb96b('0x11b');return db[_0xb96b('0x42')][_0xb96b('0x49')]({'attributes':['id',_0x125250],'where':{'id':_0xe25152['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x176660,null))['then'](function(_0x5274d9){if(_0x5274d9){var _0x3ce53e=_0x5274d9[_0x125250];var _0x2073d2=_0x3ce53e&&_0x3ce53e[_0xb96b('0x11c')]?_0x3ce53e[_0xb96b('0x11c')]:[];_0x176660[_0xb96b('0x2b')]({'fromKey':_[_0xb96b('0x70')](_0x3ce53e[_0xb96b('0x11d')])?undefined:_0x3ce53e[_0xb96b('0x11d')],'count':_0x2073d2[_0xb96b('0x36')],'rows':_0x2073d2});}})[_0xb96b('0x4a')](handleError(_0x176660,null));};exports[_0xb96b('0x11e')]=function(_0x42a990,_0x39c85f){var _0x332f85={'raw':![],'where':{}};var _0x204aa9={};var _0x596500={'count':0x0,'rows':[]};return db[_0xb96b('0x42')]['findOne']({'where':{'id':_0x42a990[_0xb96b('0x53')]['id']}})['then'](handleEntityNotFound(_0x39c85f,null))[_0xb96b('0x10')](function(_0x3cd994){if(_0x3cd994){_0x204aa9[_0xb96b('0x34')]=_['keys'](db[_0xb96b('0xc9')]['rawAttributes']);_0x204aa9[_0xb96b('0x30')]=_['keys'](_0x42a990[_0xb96b('0x30')]);_0x204aa9[_0xb96b('0x3c')]=_[_0xb96b('0x32')](_0x204aa9[_0xb96b('0x34')],_0x204aa9[_0xb96b('0x30')]);_0x332f85[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0x204aa9[_0xb96b('0x34')],qs['fields'](_0x42a990[_0xb96b('0x30')][_0xb96b('0x35')]));_0x332f85[_0xb96b('0x33')]=_0x332f85['attributes'][_0xb96b('0x36')]?_0x332f85[_0xb96b('0x33')]:_0x204aa9['model'];if(!_0x42a990[_0xb96b('0x30')]['hasOwnProperty'](_0xb96b('0x38'))){_0x332f85[_0xb96b('0x1d')]=qs[_0xb96b('0x1d')](_0x42a990[_0xb96b('0x30')][_0xb96b('0x1d')]);_0x332f85[_0xb96b('0x1f')]=qs[_0xb96b('0x1f')](_0x42a990[_0xb96b('0x30')][_0xb96b('0x1f')]);}_0x332f85[_0xb96b('0x39')]=qs['sort'](_0x42a990['query'][_0xb96b('0x3a')]);_0x332f85[_0xb96b('0x3b')]=qs[_0xb96b('0x3c')](_['pick'](_0x42a990[_0xb96b('0x30')],_0x204aa9[_0xb96b('0x3c')]));_0x332f85[_0xb96b('0x3b')][_0xb96b('0x57')]=_0x3cd994['id'];if(_0x42a990['query'][_0xb96b('0x3e')]){_0x332f85['where']=_['merge'](_0x332f85['where'],{'$or':_[_0xb96b('0x2e')](_0x332f85[_0xb96b('0x33')],function(_0x3441b7){var _0x503b61={};_0x503b61[_0x3441b7]={'$like':'%'+_0x42a990[_0xb96b('0x30')][_0xb96b('0x3e')]+'%'};return _0x503b61;})});}_0x332f85=_[_0xb96b('0x3f')]({},_0x332f85,_0x42a990[_0xb96b('0x41')]);return db[_0xb96b('0xc9')][_0xb96b('0x1e')]({'where':_0x332f85[_0xb96b('0x3b')]})[_0xb96b('0x10')](function(_0x4cf49a){_0x596500[_0xb96b('0x1e')]=_0x4cf49a;if(_0x42a990[_0xb96b('0x30')][_0xb96b('0x43')]){_0x332f85[_0xb96b('0x44')]=[{'all':!![]}];}else{_0x332f85['include']=[{'model':db[_0xb96b('0x7d')],'as':_0xb96b('0x11f'),'required':![]},{'model':db['Attachment'],'as':_0xb96b('0x120'),'required':![]}];}return db[_0xb96b('0xc9')][_0xb96b('0x45')](_0x332f85);})[_0xb96b('0x10')](function(_0x1740ab){_0x596500[_0xb96b('0x46')]=_0x1740ab;return _0x596500;});}})[_0xb96b('0x10')](respondWithFilteredResult(_0x39c85f,_0x332f85))[_0xb96b('0x4a')](handleError(_0x39c85f,null));};exports['addAgents']=function(_0x277804,_0xfb761c){return db['ChatWebsite'][_0xb96b('0x49')]({'where':{'id':_0x277804[_0xb96b('0x53')]['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0xfb761c,null))[_0xb96b('0x10')](function(_0x209dba){if(_0x209dba){return _0x209dba[_0xb96b('0x121')](_0x277804['body']['ids'],_[_0xb96b('0x116')](_0x277804[_0xb96b('0x4c')],[_0xb96b('0xe7'),'id'])||{})['spread'](function(_0x1c9545){for(var _0x4b2c50=0x0;_0x4b2c50<_0x277804[_0xb96b('0x4c')][_0xb96b('0xe7')][_0xb96b('0x36')];_0x4b2c50+=0x1){socket[_0xb96b('0x122')](_0xb96b('0x123'),{'UserId':Number(_0x277804['body']['ids'][_0x4b2c50]),'ChatWebsiteId':Number(_0x277804[_0xb96b('0x53')]['id'])});}return _0x1c9545;});}})[_0xb96b('0x10')](respondWithResult(_0xfb761c,null))[_0xb96b('0x4a')](handleError(_0xfb761c,null));};exports[_0xb96b('0x124')]=function(_0x172e75,_0x92782b){return db[_0xb96b('0x42')][_0xb96b('0x49')]({'where':{'id':_0x172e75[_0xb96b('0x53')]['id']}})['then'](handleEntityNotFound(_0x92782b,null))[_0xb96b('0x10')](function(_0x404b75){if(_0x404b75){return _0x404b75[_0xb96b('0x124')](_0x172e75[_0xb96b('0x30')][_0xb96b('0xe7')])[_0xb96b('0x10')](function(){if(_['isArray'](_0x172e75[_0xb96b('0x30')][_0xb96b('0xe7')])){for(var _0x1c19ea=0x0;_0x1c19ea<_0x172e75[_0xb96b('0x30')][_0xb96b('0xe7')]['length'];_0x1c19ea+=0x1){socket[_0xb96b('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x172e75['query'][_0xb96b('0xe7')][_0x1c19ea]),'ChatWebsiteId':Number(_0x172e75[_0xb96b('0x53')]['id'])});}}else{socket[_0xb96b('0x122')](_0xb96b('0x125'),{'UserId':Number(_0x172e75['query'][_0xb96b('0xe7')]),'ChatWebsiteId':Number(_0x172e75['params']['id'])});}});}})[_0xb96b('0x10')](respondWithStatusCode(_0x92782b,null))[_0xb96b('0x4a')](handleError(_0x92782b,null));};exports[_0xb96b('0x126')]=function(_0x364639,_0x8e5dda){var _0xd4dace={};var _0x42a7c9={};var _0x321718;var _0x27e8ac;return db['ChatWebsite'][_0xb96b('0x59')]({'where':{'id':_0x364639['params']['id']}})[_0xb96b('0x10')](handleEntityNotFound(_0x8e5dda,null))[_0xb96b('0x10')](function(_0x5cdad9){if(_0x5cdad9){_0x321718=_0x5cdad9;_0x42a7c9[_0xb96b('0x34')]=_[_0xb96b('0x31')](db[_0xb96b('0xb2')][_0xb96b('0x48')]);_0x42a7c9[_0xb96b('0x30')]=_[_0xb96b('0x31')](_0x364639['query']);_0x42a7c9[_0xb96b('0x3c')]=_['intersection'](_0x42a7c9[_0xb96b('0x34')],_0x42a7c9[_0xb96b('0x30')]);_0xd4dace[_0xb96b('0x33')]=_[_0xb96b('0x32')](_0x42a7c9[_0xb96b('0x34')],qs[_0xb96b('0x35')](_0x364639[_0xb96b('0x30')]['fields']));_0xd4dace[_0xb96b('0x33')]=_0xd4dace[_0xb96b('0x33')]['length']?_0xd4dace[_0xb96b('0x33')]:_0x42a7c9[_0xb96b('0x34')];_0xd4dace['order']=qs[_0xb96b('0x3a')](_0x364639['query'][_0xb96b('0x3a')]);_0xd4dace[_0xb96b('0x3b')]=qs['filters'](_[_0xb96b('0x3d')](_0x364639[_0xb96b('0x30')],_0x42a7c9[_0xb96b('0x3c')]));if(_0x364639[_0xb96b('0x30')][_0xb96b('0x3e')]){_0xd4dace['where']=_[_0xb96b('0x3f')](_0xd4dace[_0xb96b('0x3b')],{'$or':_['map'](_0xd4dace[_0xb96b('0x33')],function(_0x10cefd){var _0x24e677={};_0x24e677[_0x10cefd]={'$like':'%'+_0x364639[_0xb96b('0x30')]['filter']+'%'};return _0x24e677;})});}_0xd4dace=_[_0xb96b('0x3f')]({},_0xd4dace,_0x364639['options']);return _0x321718['getAgents'](_0xd4dace);}})[_0xb96b('0x10')](function(_0x970daf){if(_0x970daf){_0x27e8ac=_0x970daf[_0xb96b('0x36')];if(!_0x364639[_0xb96b('0x30')][_0xb96b('0x37')]('nolimit')){_0xd4dace[_0xb96b('0x1d')]=qs['limit'](_0x364639[_0xb96b('0x30')]['limit']);_0xd4dace[_0xb96b('0x1f')]=qs[_0xb96b('0x1f')](_0x364639['query'][_0xb96b('0x1f')]);}return _0x321718['getAgents'](_0xd4dace);}})[_0xb96b('0x10')](function(_0x59e9c5){if(_0x59e9c5){return _0x59e9c5?{'count':_0x27e8ac,'rows':_0x59e9c5}:null;}})[_0xb96b('0x10')](respondWithResult(_0x8e5dda,null))[_0xb96b('0x4a')](handleError(_0x8e5dda,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 96d9ede..495ea5e 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 _0x17ba=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xf82d0f,_0x59cc40){var _0x5937c5=function(_0x25449d){while(--_0x25449d){_0xf82d0f['push'](_0xf82d0f['shift']());}};_0x5937c5(++_0x59cc40);}(_0x17ba,0xab));var _0xa17b=function(_0x3a076e,_0x2216ed){_0x3a076e=_0x3a076e-0x0;var _0x433648=_0x17ba[_0x3a076e];return _0x433648;};'use strict';var EventEmitter=require(_0xa17b('0x0'));var ChatWebsite=require(_0xa17b('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa17b('0x2')](0x0);var events={'afterCreate':_0xa17b('0x3'),'afterUpdate':_0xa17b('0x4'),'afterDestroy':_0xa17b('0x5')};function emitEvent(_0x106b5b){return function(_0x38c13c,_0x11d7b7,_0x2f64d0){ChatWebsiteEvents[_0xa17b('0x6')](_0x106b5b+':'+_0x38c13c['id'],_0x38c13c);ChatWebsiteEvents[_0xa17b('0x6')](_0x106b5b,_0x38c13c);_0x2f64d0(null);};}for(var e in events){if(events[_0xa17b('0x7')](e)){var event=events[e];ChatWebsite[_0xa17b('0x8')](e,emitEvent(event));}}module[_0xa17b('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x31af=['ChatWebsite','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x128bef,_0xc7a0af){var _0x1ba862=function(_0x4858e8){while(--_0x4858e8){_0x128bef['push'](_0x128bef['shift']());}};_0x1ba862(++_0xc7a0af);}(_0x31af,0xde));var _0xf31a=function(_0x456a1,_0x30c640){_0x456a1=_0x456a1-0x0;var _0x10df95=_0x31af[_0x456a1];return _0x10df95;};'use strict';var EventEmitter=require(_0xf31a('0x0'));var ChatWebsite=require(_0xf31a('0x1'))['db'][_0xf31a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xf31a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b7976){return function(_0x1853d7,_0x820362,_0x245db8){ChatWebsiteEvents['emit'](_0x3b7976+':'+_0x1853d7['id'],_0x1853d7);ChatWebsiteEvents[_0xf31a('0x4')](_0x3b7976,_0x1853d7);_0x245db8(null);};}for(var e in events){if(events[_0xf31a('0x5')](e)){var event=events[e];ChatWebsite[_0xf31a('0x6')](e,emitEvent(event));}}module[_0xf31a('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 369f268..2f4ee70 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 _0xc066=['bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','lodash','util','../../config/logger'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0xc066,0x7b));var _0x6c06=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc066[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6c06('0x0'));var util=require(_0x6c06('0x1'));var logger=require(_0x6c06('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c06('0x3'));var rp=require(_0x6c06('0x4'));var fs=require('fs');var path=require(_0x6c06('0x5'));var rimraf=require('rimraf');var config=require(_0x6c06('0x6'));var attributes=require(_0x6c06('0x7'));module[_0x6c06('0x8')]=function(_0x5d4c97,_0x4854d1){return _0x5d4c97['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2604=['request-promise','path','./chatWebsite.attributes','define','chat_websites','lodash','api','moment','bluebird'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x2604,0x19a));var _0x4260=function(_0x112a38,_0x147691){_0x112a38=_0x112a38-0x0;var _0x23b207=_0x2604[_0x112a38];return _0x23b207;};'use strict';var _=require(_0x4260('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4260('0x1'));var moment=require(_0x4260('0x2'));var BPromise=require(_0x4260('0x3'));var rp=require(_0x4260('0x4'));var fs=require('fs');var path=require(_0x4260('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4260('0x6'));module['exports']=function(_0x56e70c,_0x266bab){return _0x56e70c[_0x4260('0x7')]('ChatWebsite',attributes,{'tableName':_0x4260('0x8'),'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 2451e25..84fbab3 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 _0x3ab8=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x15ebad,_0x1ac8e0){var _0x56818d=function(_0x2f468d){while(--_0x2f468d){_0x15ebad['push'](_0x15ebad['shift']());}};_0x56818d(++_0x1ac8e0);}(_0x3ab8,0x8f));var _0x83ab=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x3ab8[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x83ab('0x0'));var util=require(_0x83ab('0x1'));var moment=require('moment');var BPromise=require(_0x83ab('0x2'));var rs=require(_0x83ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x83ab('0x4'));var logger=require('../../config/logger')(_0x83ab('0x5'));var config=require(_0x83ab('0x6'));var jayson=require(_0x83ab('0x7'));var client=jayson[_0x83ab('0x8')]['http']({'port':0x232a});config[_0x83ab('0x9')]=_[_0x83ab('0xa')](config['redis'],{'host':_0x83ab('0xb'),'port':0x18eb});var socket=require(_0x83ab('0xc'))(new Redis(config[_0x83ab('0x9')]));require(_0x83ab('0xd'))[_0x83ab('0xe')](socket);function respondWithRpcPromise(_0x11b879,_0x43b1ef,_0x25e2b5){return new BPromise(function(_0x21e0fe,_0x5e9c53){return client[_0x83ab('0xf')](_0x11b879,_0x25e2b5)[_0x83ab('0x10')](function(_0x42b0b4){logger[_0x83ab('0x11')](_0x83ab('0x12'),_0x43b1ef,'request\x20sent');logger[_0x83ab('0x13')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x43b1ef,_0x83ab('0x14'),JSON[_0x83ab('0x15')](_0x42b0b4));if(_0x42b0b4['error']){if(_0x42b0b4[_0x83ab('0x16')][_0x83ab('0x17')]===0x1f4){logger[_0x83ab('0x16')](_0x83ab('0x12'),_0x43b1ef,_0x42b0b4[_0x83ab('0x16')][_0x83ab('0x18')]);return _0x5e9c53(_0x42b0b4[_0x83ab('0x16')][_0x83ab('0x18')]);}logger[_0x83ab('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x43b1ef,_0x42b0b4[_0x83ab('0x16')]['message']);return _0x21e0fe(_0x42b0b4[_0x83ab('0x16')][_0x83ab('0x18')]);}else{logger['info'](_0x83ab('0x12'),_0x43b1ef,_0x83ab('0x14'));_0x21e0fe(_0x42b0b4[_0x83ab('0x19')]['message']);}})[_0x83ab('0x1a')](function(_0x5990d9){logger[_0x83ab('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x43b1ef,_0x5990d9);_0x5e9c53(_0x5990d9);});});}
\ No newline at end of file
+var _0x4de0=['defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis'];(function(_0x4beb7a,_0x246983){var _0x50c7dd=function(_0x4c006c){while(--_0x4c006c){_0x4beb7a['push'](_0x4beb7a['shift']());}};_0x50c7dd(++_0x246983);}(_0x4de0,0x7b));var _0x04de=function(_0x25a681,_0x2d5cf5){_0x25a681=_0x25a681-0x0;var _0x2b76bf=_0x4de0[_0x25a681];return _0x2b76bf;};'use strict';var _=require(_0x04de('0x0'));var util=require(_0x04de('0x1'));var moment=require(_0x04de('0x2'));var BPromise=require('bluebird');var rs=require(_0x04de('0x3'));var fs=require('fs');var Redis=require(_0x04de('0x4'));var db=require(_0x04de('0x5'))['db'];var utils=require(_0x04de('0x6'));var logger=require(_0x04de('0x7'))(_0x04de('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x04de('0x9')][_0x04de('0xa')]({'port':0x232a});config[_0x04de('0xb')]=_[_0x04de('0xc')](config[_0x04de('0xb')],{'host':_0x04de('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04de('0xb')]));require(_0x04de('0xe'))[_0x04de('0xf')](socket);function respondWithRpcPromise(_0x3c11b0,_0x3b76dd,_0x2fcd29){return new BPromise(function(_0x3ab1e0,_0x31b577){return client[_0x04de('0x10')](_0x3c11b0,_0x2fcd29)[_0x04de('0x11')](function(_0x193836){logger[_0x04de('0x12')](_0x04de('0x13'),_0x3b76dd,_0x04de('0x14'));logger[_0x04de('0x15')](_0x04de('0x16'),_0x3b76dd,_0x04de('0x14'),JSON[_0x04de('0x17')](_0x193836));if(_0x193836[_0x04de('0x18')]){if(_0x193836['error']['code']===0x1f4){logger[_0x04de('0x18')](_0x04de('0x13'),_0x3b76dd,_0x193836['error']['message']);return _0x31b577(_0x193836[_0x04de('0x18')]['message']);}logger[_0x04de('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x3b76dd,_0x193836[_0x04de('0x18')]['message']);return _0x3ab1e0(_0x193836[_0x04de('0x18')][_0x04de('0x19')]);}else{logger[_0x04de('0x12')](_0x04de('0x13'),_0x3b76dd,_0x04de('0x14'));_0x3ab1e0(_0x193836[_0x04de('0x1a')]['message']);}})['catch'](function(_0x1900f3){logger['error'](_0x04de('0x13'),_0x3b76dd,_0x1900f3);_0x31b577(_0x1900f3);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index dde5d27..fcd89f7 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 _0xd7b5=['length','chatWebsite:','./chatWebsite.events','remove','update','emit','register'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd7b5,0x6b));var _0x5d7b=function(_0x2a0e90,_0x161a7d){_0x2a0e90=_0x2a0e90-0x0;var _0x229b02=_0xd7b5[_0x2a0e90];return _0x229b02;};'use strict';var ChatWebsiteEvents=require(_0x5d7b('0x0'));var events=['save',_0x5d7b('0x1'),_0x5d7b('0x2')];function createListener(_0x2c2cb9,_0x4cede7){return function(_0x336bc3){_0x4cede7[_0x5d7b('0x3')](_0x2c2cb9,_0x336bc3);};}function removeListener(_0x42489a,_0x36ed59){return function(){ChatWebsiteEvents['removeListener'](_0x42489a,_0x36ed59);};}exports[_0x5d7b('0x4')]=function(_0x36ba6b){for(var _0x47ea54=0x0,_0x5e4398=events[_0x5d7b('0x5')];_0x47ea54<_0x5e4398;_0x47ea54++){var _0x5f2967=events[_0x47ea54];var _0x2cf4d4=createListener(_0x5d7b('0x6')+_0x5f2967,_0x36ba6b);ChatWebsiteEvents['on'](_0x5f2967,_0x2cf4d4);}};
\ No newline at end of file
+var _0x5670=['length','./chatWebsite.events','update','emit','register'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x5670,0x8d));var _0x0567=function(_0x2fc7ee,_0x1bb152){_0x2fc7ee=_0x2fc7ee-0x0;var _0x174721=_0x5670[_0x2fc7ee];return _0x174721;};'use strict';var ChatWebsiteEvents=require(_0x0567('0x0'));var events=['save','remove',_0x0567('0x1')];function createListener(_0x2ee9ec,_0x37afb5){return function(_0x1ca03a){_0x37afb5[_0x0567('0x2')](_0x2ee9ec,_0x1ca03a);};}function removeListener(_0x4e6fab,_0x9dc2d2){return function(){ChatWebsiteEvents['removeListener'](_0x4e6fab,_0x9dc2d2);};}exports[_0x0567('0x3')]=function(_0x1df157){for(var _0x5dbe7b=0x0,_0x3138ab=events[_0x0567('0x4')];_0x5dbe7b<_0x3138ab;_0x5dbe7b++){var _0x4509f6=events[_0x5dbe7b];var _0xc15373=createListener('chatWebsite:'+_0x4509f6,_0x1df157);ChatWebsiteEvents['on'](_0x4509f6,_0xc15373);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index cfdb955..e289505 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 _0x69bd=['./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addCustomerAvatar','/:id/notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x30ab37,_0x467f7b){var _0x55624a=function(_0x52a2ac){while(--_0x52a2ac){_0x30ab37['push'](_0x30ab37['shift']());}};_0x55624a(++_0x467f7b);}(_0x69bd,0x14e));var _0xd69b=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x69bd[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require('multer');var util=require(_0xd69b('0x0'));var path=require(_0xd69b('0x1'));var timeout=require(_0xd69b('0x2'));var express=require(_0xd69b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd69b('0x4'));var config=require(_0xd69b('0x5'));var controller=require(_0xd69b('0x6'));router['get']('/',auth[_0xd69b('0x7')](),controller[_0xd69b('0x8')]);router[_0xd69b('0x9')](_0xd69b('0xa'),auth[_0xd69b('0x7')](),controller[_0xd69b('0xb')]);router[_0xd69b('0x9')](_0xd69b('0xc'),auth[_0xd69b('0x7')](),controller[_0xd69b('0xd')]);router[_0xd69b('0x9')](_0xd69b('0xe'),auth[_0xd69b('0x7')](),controller[_0xd69b('0xf')]);router[_0xd69b('0x9')](_0xd69b('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xd69b('0x9')](_0xd69b('0x11'),controller['getLogo']);router[_0xd69b('0x9')]('/:id/avatar',controller[_0xd69b('0x12')]);router[_0xd69b('0x9')](_0xd69b('0x13'),controller['getCustomerAvatar']);router[_0xd69b('0x9')](_0xd69b('0x14'),controller[_0xd69b('0x15')]);router[_0xd69b('0x9')](_0xd69b('0x16'),auth[_0xd69b('0x7')](),controller['getInteractions']);router[_0xd69b('0x9')]('/:id/snippet',controller[_0xd69b('0x17')]);router[_0xd69b('0x9')]('/:id/applications',auth[_0xd69b('0x7')](),controller[_0xd69b('0x18')]);router['get'](_0xd69b('0x19'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0xd69b('0x1a'),controller[_0xd69b('0x1b')]);router[_0xd69b('0x9')](_0xd69b('0x1c'),auth[_0xd69b('0x7')](),controller['getOfflineMessages']);router['get'](_0xd69b('0x1d'),auth[_0xd69b('0x7')](),controller[_0xd69b('0x1e')]);router[_0xd69b('0x1f')]('/',auth[_0xd69b('0x7')](),controller[_0xd69b('0x20')]);router[_0xd69b('0x1f')](_0xd69b('0xe'),auth[_0xd69b('0x7')](),controller[_0xd69b('0x21')]);router[_0xd69b('0x1f')](_0xd69b('0x10'),auth[_0xd69b('0x7')](),controller[_0xd69b('0x22')]);var upload=multer({'storage':multer[_0xd69b('0x23')]({'destination':function(_0x10bbaa,_0x22a39d,_0x54f66b){_0x54f66b(null,path[_0xd69b('0x24')](config[_0xd69b('0x25')],_0xd69b('0x26')));},'filename':function(_0x27f3f2,_0x17ab71,_0x388328){_0x388328(null,util[_0xd69b('0x27')](_0xd69b('0x28'),Date[_0xd69b('0x29')](),_0x17ab71[_0xd69b('0x2a')]));}})});router[_0xd69b('0x1f')](_0xd69b('0x11'),upload[_0xd69b('0x2b')](_0xd69b('0x2c')),controller[_0xd69b('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x7cae48,_0x5abf5e,_0x220d62){_0x220d62(null,path[_0xd69b('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x4622cc,_0x4a6888,_0x2d2c49){_0x2d2c49(null,util[_0xd69b('0x27')](_0xd69b('0x28'),Date[_0xd69b('0x29')](),_0x4a6888[_0xd69b('0x2a')]));}})});router[_0xd69b('0x1f')]('/:id/avatar',upload[_0xd69b('0x2b')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xd69b('0x23')]({'destination':function(_0x3ea48d,_0x4c7be5,_0x9a5680){_0x9a5680(null,path[_0xd69b('0x24')](config[_0xd69b('0x25')],_0xd69b('0x2e')));},'filename':function(_0xeac85d,_0xa386b8,_0x356bc4){_0x356bc4(null,util['format']('%s-%s',Date[_0xd69b('0x29')](),_0xa386b8['originalname']));}})});router[_0xd69b('0x1f')](_0xd69b('0x13'),upload[_0xd69b('0x2b')]('file'),controller[_0xd69b('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15a185,_0x4c347d,_0x48fe66){_0x48fe66(null,path[_0xd69b('0x24')](config['root'],_0xd69b('0x2e')));},'filename':function(_0x114336,_0x508c74,_0x5e806e){_0x5e806e(null,util[_0xd69b('0x27')]('%s-%s',Date['now'](),_0x508c74['originalname']));}})});router[_0xd69b('0x1f')](_0xd69b('0x14'),upload[_0xd69b('0x2b')](_0xd69b('0x2c')),controller['addSystemAvatar']);router[_0xd69b('0x1f')](_0xd69b('0x30'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xd69b('0x23')]({'destination':function(_0x533514,_0x5565f6,_0xc2ab8f){const _0x51f1eb=path[_0xd69b('0x24')](config['root'],_0xd69b('0x31'),'attachments',_0xd69b('0x32'));fs_extra[_0xd69b('0x33')](_0x51f1eb,function(){_0xc2ab8f(null,_0x51f1eb);});},'filename':function(_0x5b29c4,_0xd434f6,_0x47b25f){const _0x5180eb=_0xd434f6[_0xd69b('0x2a')][_0xd69b('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1dc1ca=path[_0xd69b('0x35')](_0x5180eb);const _0xb548fe=Date[_0xd69b('0x29')]()+'-'+_0x5180eb['replace'](_0x1dc1ca,'')+_0x1dc1ca;_0x47b25f(null,_0xb548fe);}})});router['post'](_0xd69b('0x36'),offlineUploadMulter[_0xd69b('0x37')](),controller[_0xd69b('0x38')]);router[_0xd69b('0x1f')](_0xd69b('0x16'),auth[_0xd69b('0x7')](),controller[_0xd69b('0x39')]);router['post']('/:id/applications',auth[_0xd69b('0x7')](),controller[_0xd69b('0x3a')]);router[_0xd69b('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xd69b('0x3b')]);router[_0xd69b('0x1f')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xd69b('0x3c')]('/:id',auth['isAuthenticated'](),controller[_0xd69b('0x3d')]);router[_0xd69b('0x3e')](_0xd69b('0xc'),auth['isAuthenticated'](),controller[_0xd69b('0x3f')]);router[_0xd69b('0x3e')]('/:id/dispositions',auth[_0xd69b('0x7')](),controller[_0xd69b('0x40')]);router[_0xd69b('0x3e')](_0xd69b('0x10'),auth[_0xd69b('0x7')](),controller[_0xd69b('0x41')]);router[_0xd69b('0x3e')](_0xd69b('0x1d'),auth[_0xd69b('0x7')](),controller[_0xd69b('0x42')]);module[_0xd69b('0x43')]=router;
\ No newline at end of file
+var _0xda2c=['addInteraction','/:id/applications','addApplications','put','/:id','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','/:id/snippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','post','addCustomerAvatar','/:id/system_avatar','notify','server/files','replace','extname','/:id/offline','offline'];(function(_0x33ed8e,_0x1c42b3){var _0x2c34ec=function(_0x56b57d){while(--_0x56b57d){_0x33ed8e['push'](_0x33ed8e['shift']());}};_0x2c34ec(++_0x1c42b3);}(_0xda2c,0x169));var _0xcda2=function(_0x3418b3,_0x3b8a3f){_0x3418b3=_0x3418b3-0x0;var _0x1c9186=_0xda2c[_0x3418b3];return _0x1c9186;};'use strict';var multer=require(_0xcda2('0x0'));var util=require(_0xcda2('0x1'));var path=require(_0xcda2('0x2'));var timeout=require(_0xcda2('0x3'));var express=require(_0xcda2('0x4'));var router=express['Router']();var fs_extra=require(_0xcda2('0x5'));var auth=require(_0xcda2('0x6'));var interaction=require(_0xcda2('0x7'));var config=require(_0xcda2('0x8'));var controller=require(_0xcda2('0x9'));router[_0xcda2('0xa')]('/',auth[_0xcda2('0xb')](),controller['index']);router[_0xcda2('0xa')](_0xcda2('0xc'),auth[_0xcda2('0xb')](),controller[_0xcda2('0xd')]);router[_0xcda2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xcda2('0xe')]);router[_0xcda2('0xa')](_0xcda2('0xf'),auth['isAuthenticated'](),controller[_0xcda2('0x10')]);router[_0xcda2('0xa')]('/:id/canned_answers',auth[_0xcda2('0xb')](),controller[_0xcda2('0x11')]);router[_0xcda2('0xa')]('/:id/logo',controller[_0xcda2('0x12')]);router[_0xcda2('0xa')](_0xcda2('0x13'),controller[_0xcda2('0x14')]);router[_0xcda2('0xa')](_0xcda2('0x15'),controller[_0xcda2('0x16')]);router['get']('/:id/system_avatar',controller[_0xcda2('0x17')]);router[_0xcda2('0xa')](_0xcda2('0x18'),auth[_0xcda2('0xb')](),controller['getInteractions']);router[_0xcda2('0xa')](_0xcda2('0x19'),controller['getSnippet']);router[_0xcda2('0xa')]('/:id/applications',auth['isAuthenticated'](),controller[_0xcda2('0x1a')]);router[_0xcda2('0xa')](_0xcda2('0x1b'),auth[_0xcda2('0xb')](),controller[_0xcda2('0x1c')]);router[_0xcda2('0xa')](_0xcda2('0x1d'),controller[_0xcda2('0x1e')]);router[_0xcda2('0xa')](_0xcda2('0x1f'),auth['isAuthenticated'](),controller[_0xcda2('0x20')]);router[_0xcda2('0xa')](_0xcda2('0x21'),auth[_0xcda2('0xb')](),controller[_0xcda2('0x22')]);router['post']('/',auth[_0xcda2('0xb')](),controller[_0xcda2('0x23')]);router['post'](_0xcda2('0xf'),auth[_0xcda2('0xb')](),controller['addDisposition']);router['post'](_0xcda2('0x24'),auth[_0xcda2('0xb')](),controller[_0xcda2('0x25')]);var upload=multer({'storage':multer[_0xcda2('0x26')]({'destination':function(_0x385225,_0x5887e2,_0x2b7dc6){_0x2b7dc6(null,path[_0xcda2('0x27')](config[_0xcda2('0x28')],_0xcda2('0x29')));},'filename':function(_0x17cfd0,_0x5a922e,_0x1f0722){_0x1f0722(null,util[_0xcda2('0x2a')](_0xcda2('0x2b'),Date[_0xcda2('0x2c')](),_0x5a922e[_0xcda2('0x2d')]));}})});router['post']('/:id/logo',upload[_0xcda2('0x2e')](_0xcda2('0x2f')),controller[_0xcda2('0x30')]);var upload=multer({'storage':multer[_0xcda2('0x26')]({'destination':function(_0x3ab7af,_0x10efee,_0x47fb30){_0x47fb30(null,path[_0xcda2('0x27')](config[_0xcda2('0x28')],_0xcda2('0x31')));},'filename':function(_0x4d5bdc,_0x57f20e,_0x5daf5d){_0x5daf5d(null,util['format'](_0xcda2('0x2b'),Date[_0xcda2('0x2c')](),_0x57f20e[_0xcda2('0x2d')]));}})});router['post']('/:id/avatar',upload['single'](_0xcda2('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0xcda2('0x26')]({'destination':function(_0xb22382,_0x2beba4,_0x4353c2){_0x4353c2(null,path['join'](config[_0xcda2('0x28')],'server/files/images/avatars/'));},'filename':function(_0x193821,_0x3eff18,_0x5cb231){_0x5cb231(null,util[_0xcda2('0x2a')](_0xcda2('0x2b'),Date[_0xcda2('0x2c')](),_0x3eff18[_0xcda2('0x2d')]));}})});router[_0xcda2('0x32')]('/:id/customer_avatar',upload[_0xcda2('0x2e')]('file'),controller[_0xcda2('0x33')]);var upload=multer({'storage':multer[_0xcda2('0x26')]({'destination':function(_0x55ead7,_0x5387b6,_0x2c8425){_0x2c8425(null,path[_0xcda2('0x27')](config[_0xcda2('0x28')],_0xcda2('0x31')));},'filename':function(_0x4ba25f,_0x3ba6a5,_0x2edb8c){_0x2edb8c(null,util['format'](_0xcda2('0x2b'),Date['now'](),_0x3ba6a5['originalname']));}})});router[_0xcda2('0x32')](_0xcda2('0x34'),upload[_0xcda2('0x2e')]('file'),controller['addSystemAvatar']);router[_0xcda2('0x32')]('/:id/notify',controller[_0xcda2('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xcda2('0x26')]({'destination':function(_0x7b6d8f,_0x425f2f,_0x15efe1){const _0x34dc08=path[_0xcda2('0x27')](config['root'],_0xcda2('0x36'),'attachments','offline-chat');fs_extra['ensureDir'](_0x34dc08,function(){_0x15efe1(null,_0x34dc08);});},'filename':function(_0x5f1cfd,_0x3892e6,_0x2ad04a){const _0x174d4e=_0x3892e6[_0xcda2('0x2d')][_0xcda2('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x405423=path[_0xcda2('0x38')](_0x174d4e);const _0x4e0db9=Date['now']()+'-'+_0x174d4e[_0xcda2('0x37')](_0x405423,'')+_0x405423;_0x2ad04a(null,_0x4e0db9);}})});router['post'](_0xcda2('0x39'),offlineUploadMulter['any'](),controller[_0xcda2('0x3a')]);router[_0xcda2('0x32')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xcda2('0x3b')]);router[_0xcda2('0x32')](_0xcda2('0x3c'),auth[_0xcda2('0xb')](),controller[_0xcda2('0x3d')]);router[_0xcda2('0x32')](_0xcda2('0x1b'),auth[_0xcda2('0xb')](),controller['addProactiveActions']);router[_0xcda2('0x32')](_0xcda2('0x21'),auth[_0xcda2('0xb')](),controller['addAgents']);router[_0xcda2('0x3e')](_0xcda2('0x3f'),auth[_0xcda2('0xb')](),controller['update']);router[_0xcda2('0x40')](_0xcda2('0x3f'),auth[_0xcda2('0xb')](),controller[_0xcda2('0x41')]);router['delete'](_0xcda2('0xf'),auth['isAuthenticated'](),controller[_0xcda2('0x42')]);router[_0xcda2('0x40')](_0xcda2('0x24'),auth[_0xcda2('0xb')](),controller[_0xcda2('0x43')]);router[_0xcda2('0x40')]('/:id/users',auth[_0xcda2('0xb')](),controller[_0xcda2('0x44')]);module[_0xcda2('0x45')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 18a6835..185c07e 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 _0x3831=['AmazonAWS','Google','sequelize','STRING','ENUM'];(function(_0x38c1f8,_0x52803d){var _0x3e8954=function(_0x84a865){while(--_0x84a865){_0x38c1f8['push'](_0x38c1f8['shift']());}};_0x3e8954(++_0x52803d);}(_0x3831,0x14c));var _0x1383=function(_0x29975a,_0x2ca253){_0x29975a=_0x29975a-0x0;var _0x41bcac=_0x3831[_0x29975a];return _0x41bcac;};'use strict';var Sequelize=require(_0x1383('0x0'));module['exports']={'name':{'type':Sequelize[_0x1383('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1383('0x2')](_0x1383('0x3'),_0x1383('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x1383('0x1')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa6bb=['exports','STRING','ENUM','AmazonAWS','Google'];(function(_0x42d516,_0x24b87f){var _0x53b87a=function(_0x14e070){while(--_0x14e070){_0x42d516['push'](_0x42d516['shift']());}};_0x53b87a(++_0x24b87f);}(_0xa6bb,0x12c));var _0xba6b=function(_0x334833,_0x5f58a5){_0x334833=_0x334833-0x0;var _0x70cf60=_0xa6bb[_0x334833];return _0x70cf60;};'use strict';var Sequelize=require('sequelize');module[_0xba6b('0x0')]={'name':{'type':Sequelize[_0xba6b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xba6b('0x2')](_0xba6b('0x3'),_0xba6b('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 8ac5116..fe169a5 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x932e4c,_0x140353){var _0x5184d4=function(_0x3af828){while(--_0x3af828){_0x932e4c['push'](_0x932e4c['shift']());}};_0x5184d4(++_0x140353);}(_0x2ef3,0xba));var _0x32ef=function(_0x459bb5,_0xc59a0a){_0x459bb5=_0x459bb5-0x0;var _0x19728e=_0x2ef3[_0x459bb5];return _0x19728e;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};
\ No newline at end of file
+var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x32b02a,_0x246a96){var _0x3f20cb=function(_0x2efc95){while(--_0x2efc95){_0x32b02a['push'](_0x32b02a['shift']());}};_0x3f20cb(++_0x246a96);}(_0xdb28,0x106));var _0x8db2=function(_0x455c6f,_0x109cac){_0x455c6f=_0x455c6f-0x0;var _0x41d448=_0xdb28[_0x455c6f];return _0x41d448;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index c3f463f..137a6a4 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 _0x835f=['rimraf','./cloudProvider.attributes','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2d9fa4,_0x91dcce){var _0x26f5d0=function(_0x5bcb2f){while(--_0x5bcb2f){_0x2d9fa4['push'](_0x2d9fa4['shift']());}};_0x26f5d0(++_0x91dcce);}(_0x835f,0x121));var _0xf835=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x835f[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0xf835('0x0'));var util=require(_0xf835('0x1'));var logger=require(_0xf835('0x2'))(_0xf835('0x3'));var moment=require(_0xf835('0x4'));var BPromise=require(_0xf835('0x5'));var rp=require(_0xf835('0x6'));var fs=require('fs');var path=require(_0xf835('0x7'));var rimraf=require(_0xf835('0x8'));var config=require('../../config/environment');var attributes=require(_0xf835('0x9'));module['exports']=function(_0x44fc71,_0x22ffb5){return _0x44fc71['define']('CloudProvider',attributes,{'tableName':_0xf835('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cef=['define','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x32bdae,_0x20dd64){var _0x5ceb9d=function(_0x4fae45){while(--_0x4fae45){_0x32bdae['push'](_0x32bdae['shift']());}};_0x5ceb9d(++_0x20dd64);}(_0x3cef,0x1a9));var _0xf3ce=function(_0x2e0ac5,_0x58a84c){_0x2e0ac5=_0x2e0ac5-0x0;var _0x12dea5=_0x3cef[_0x2e0ac5];return _0x12dea5;};'use strict';var _=require(_0xf3ce('0x0'));var util=require(_0xf3ce('0x1'));var logger=require(_0xf3ce('0x2'))(_0xf3ce('0x3'));var moment=require(_0xf3ce('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3ce('0x5'));var rimraf=require('rimraf');var config=require(_0xf3ce('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x21b4d1,_0x62c418){return _0x21b4d1[_0xf3ce('0x7')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index a5d9087..a58b25a 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 _0x6db4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird'];(function(_0x48a1ad,_0x2f2934){var _0x21cbc8=function(_0x280916){while(--_0x280916){_0x48a1ad['push'](_0x48a1ad['shift']());}};_0x21cbc8(++_0x2f2934);}(_0x6db4,0x111));var _0x46db=function(_0x4a3434,_0x166642){_0x4a3434=_0x4a3434-0x0;var _0x1ec429=_0x6db4[_0x4a3434];return _0x1ec429;};'use strict';var _=require('lodash');var util=require(_0x46db('0x0'));var moment=require(_0x46db('0x1'));var BPromise=require(_0x46db('0x2'));var rs=require(_0x46db('0x3'));var fs=require('fs');var Redis=require(_0x46db('0x4'));var db=require(_0x46db('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46db('0x6'))(_0x46db('0x7'));var config=require(_0x46db('0x8'));var jayson=require(_0x46db('0x9'));var client=jayson[_0x46db('0xa')][_0x46db('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23de32,_0x5409cd,_0x3a2dcb){return new BPromise(function(_0x2a597d,_0x27b949){return client[_0x46db('0xc')](_0x23de32,_0x3a2dcb)[_0x46db('0xd')](function(_0x427c62){logger[_0x46db('0xe')](_0x46db('0xf'),_0x5409cd,_0x46db('0x10'));logger[_0x46db('0x11')](_0x46db('0x12'),_0x5409cd,_0x46db('0x10'),JSON['stringify'](_0x427c62));if(_0x427c62[_0x46db('0x13')]){if(_0x427c62[_0x46db('0x13')][_0x46db('0x14')]===0x1f4){logger[_0x46db('0x13')](_0x46db('0xf'),_0x5409cd,_0x427c62[_0x46db('0x13')][_0x46db('0x15')]);return _0x27b949(_0x427c62[_0x46db('0x13')][_0x46db('0x15')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x5409cd,_0x427c62['error'][_0x46db('0x15')]);return _0x2a597d(_0x427c62[_0x46db('0x13')]['message']);}else{logger[_0x46db('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5409cd,_0x46db('0x10'));_0x2a597d(_0x427c62['result'][_0x46db('0x15')]);}})[_0x46db('0x16')](function(_0x5a75fb){logger[_0x46db('0x13')](_0x46db('0xf'),_0x5409cd,_0x5a75fb);_0x27b949(_0x5a75fb);});});}
\ No newline at end of file
+var _0x34bd=['code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2e30b0,_0x3be40e){var _0x5167d4=function(_0x24d1db){while(--_0x24d1db){_0x2e30b0['push'](_0x2e30b0['shift']());}};_0x5167d4(++_0x3be40e);}(_0x34bd,0x1d2));var _0xd34b=function(_0x2af276,_0xb15ec5){_0x2af276=_0x2af276-0x0;var _0x4c586e=_0x34bd[_0x2af276];return _0x4c586e;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd34b('0x1'));var rs=require(_0xd34b('0x2'));var fs=require('fs');var Redis=require(_0xd34b('0x3'));var db=require(_0xd34b('0x4'))['db'];var utils=require(_0xd34b('0x5'));var logger=require(_0xd34b('0x6'))(_0xd34b('0x7'));var config=require('../../config/environment');var jayson=require(_0xd34b('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x56e3eb,_0x30d93b,_0x3654a5){return new BPromise(function(_0xf51a08,_0x25bce7){return client[_0xd34b('0x9')](_0x56e3eb,_0x3654a5)[_0xd34b('0xa')](function(_0x738328){logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,_0xd34b('0xd'));logger[_0xd34b('0xe')](_0xd34b('0xf'),_0x30d93b,'request\x20sent',JSON[_0xd34b('0x10')](_0x738328));if(_0x738328['error']){if(_0x738328[_0xd34b('0x11')][_0xd34b('0x12')]===0x1f4){logger[_0xd34b('0x11')](_0xd34b('0xc'),_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0x25bce7(_0x738328['error'][_0xd34b('0x13')]);}logger[_0xd34b('0x11')]('CloudProvider,\x20%s,\x20%s',_0x30d93b,_0x738328[_0xd34b('0x11')][_0xd34b('0x13')]);return _0xf51a08(_0x738328[_0xd34b('0x11')]['message']);}else{logger[_0xd34b('0xb')](_0xd34b('0xc'),_0x30d93b,'request\x20sent');_0xf51a08(_0x738328[_0xd34b('0x14')]['message']);}})[_0xd34b('0x15')](function(_0x438b61){logger[_0xd34b('0x11')]('CloudProvider,\x20%s,\x20%s',_0x30d93b,_0x438b61);_0x25bce7(_0x438b61);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 72ab0fc..1e49cb8 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 _0x5a14=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy'];(function(_0x21cd1c,_0x21c2b3){var _0x2c2b6a=function(_0x499978){while(--_0x499978){_0x21cd1c['push'](_0x21cd1c['shift']());}};_0x2c2b6a(++_0x21c2b3);}(_0x5a14,0x73));var _0x45a1=function(_0x18936e,_0x4cab2e){_0x18936e=_0x18936e-0x0;var _0x5d85f2=_0x5a14[_0x18936e];return _0x5d85f2;};'use strict';var multer=require(_0x45a1('0x0'));var util=require(_0x45a1('0x1'));var path=require('path');var timeout=require(_0x45a1('0x2'));var express=require('express');var router=express[_0x45a1('0x3')]();var fs_extra=require(_0x45a1('0x4'));var auth=require(_0x45a1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x45a1('0x6'));router[_0x45a1('0x7')]('/',auth['isAuthenticated'](),controller[_0x45a1('0x8')]);router[_0x45a1('0x7')]('/:id',auth[_0x45a1('0x9')](),controller[_0x45a1('0xa')]);router[_0x45a1('0xb')]('/',auth['isAuthenticated'](),controller[_0x45a1('0xc')]);router[_0x45a1('0xd')](_0x45a1('0xe'),auth['isAuthenticated'](),controller[_0x45a1('0xf')]);router[_0x45a1('0x10')](_0x45a1('0xe'),auth[_0x45a1('0x9')](),controller[_0x45a1('0x11')]);module[_0x45a1('0x12')]=router;
\ No newline at end of file
+var _0x8545=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','path','connect-timeout'];(function(_0x1b92a6,_0x14444b){var _0x24be5b=function(_0x3a5fb5){while(--_0x3a5fb5){_0x1b92a6['push'](_0x1b92a6['shift']());}};_0x24be5b(++_0x14444b);}(_0x8545,0xa9));var _0x5854=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x8545[_0x1da527];return _0x40fc7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5854('0x0'));var timeout=require(_0x5854('0x1'));var express=require(_0x5854('0x2'));var router=express[_0x5854('0x3')]();var fs_extra=require(_0x5854('0x4'));var auth=require(_0x5854('0x5'));var interaction=require(_0x5854('0x6'));var config=require('../../config/environment');var controller=require(_0x5854('0x7'));router[_0x5854('0x8')]('/',auth['isAuthenticated'](),controller[_0x5854('0x9')]);router['get'](_0x5854('0xa'),auth[_0x5854('0xb')](),controller[_0x5854('0xc')]);router[_0x5854('0xd')]('/',auth[_0x5854('0xb')](),controller[_0x5854('0xe')]);router[_0x5854('0xf')](_0x5854('0xa'),auth[_0x5854('0xb')](),controller['update']);router[_0x5854('0x10')](_0x5854('0xa'),auth[_0x5854('0xb')](),controller[_0x5854('0x11')]);module[_0x5854('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index d765688..b99a1aa 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 _0x2da2=['exports','STRING','name'];(function(_0x1dd505,_0x72c2a9){var _0x14104a=function(_0xd44bc5){while(--_0xd44bc5){_0x1dd505['push'](_0x1dd505['shift']());}};_0x14104a(++_0x72c2a9);}(_0x2da2,0x108));var _0x22da=function(_0xa52b25,_0x488427){_0xa52b25=_0xa52b25-0x0;var _0x112a63=_0x2da2[_0xa52b25];return _0x112a63;};'use strict';var Sequelize=require('sequelize');module[_0x22da('0x0')]={'name':{'type':Sequelize[_0x22da('0x1')],'unique':_0x22da('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x22da('0x1')]},'companyId':{'type':Sequelize[_0x22da('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x22da('0x1')]},'fax':{'type':Sequelize[_0x22da('0x1')]},'type':{'type':Sequelize[_0x22da('0x1')]},'street':{'type':Sequelize[_0x22da('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x22da('0x1')]},'country':{'type':Sequelize[_0x22da('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x22da('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x22da('0x1')]},'sCountry':{'type':Sequelize[_0x22da('0x1')]},'description':{'type':Sequelize[_0x22da('0x1')]}};
\ No newline at end of file
+var _0x41d2=['sequelize','exports','STRING','name'];(function(_0x6dd9bb,_0x4eed27){var _0x1ea414=function(_0x35cb90){while(--_0x35cb90){_0x6dd9bb['push'](_0x6dd9bb['shift']());}};_0x1ea414(++_0x4eed27);}(_0x41d2,0x138));var _0x241d=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x41d2[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x241d('0x0'));module[_0x241d('0x1')]={'name':{'type':Sequelize[_0x241d('0x2')],'unique':_0x241d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x241d('0x2')]},'companyId':{'type':Sequelize[_0x241d('0x2')]},'website':{'type':Sequelize[_0x241d('0x2')]},'phone':{'type':Sequelize[_0x241d('0x2')]},'fax':{'type':Sequelize[_0x241d('0x2')]},'type':{'type':Sequelize[_0x241d('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x241d('0x2')]},'city':{'type':Sequelize[_0x241d('0x2')]},'country':{'type':Sequelize[_0x241d('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x241d('0x2')]},'sStreet':{'type':Sequelize[_0x241d('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x241d('0x2')]},'sCountry':{'type':Sequelize[_0x241d('0x2')]},'description':{'type':Sequelize[_0x241d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2d3703d..ab925ea 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 _0x21e1=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','get','Companies','UserProfileResource','destroy','then','error','stack','name','send','index','CmCompany','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','includeAll','findAll','catch','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','ids','getContacts','findOne','sort'];(function(_0x4c2c40,_0x337dcd){var _0xa1e0ac=function(_0x28d215){while(--_0x28d215){_0x4c2c40['push'](_0x4c2c40['shift']());}};_0xa1e0ac(++_0x337dcd);}(_0x21e1,0x9e));var _0x121e=function(_0x27c2f2,_0x256d40){_0x27c2f2=_0x27c2f2-0x0;var _0x3425d6=_0x21e1[_0x27c2f2];return _0x3425d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x121e('0x0'));var zipdir=require(_0x121e('0x1'));var jsonpatch=require(_0x121e('0x2'));var rp=require(_0x121e('0x3'));var moment=require('moment');var BPromise=require(_0x121e('0x4'));var Mustache=require(_0x121e('0x5'));var util=require('util');var path=require(_0x121e('0x6'));var sox=require(_0x121e('0x7'));var csv=require(_0x121e('0x8'));var ejs=require(_0x121e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x121e('0xa'));var squel=require(_0x121e('0xb'));var crypto=require(_0x121e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x121e('0xd'));var Redis=require(_0x121e('0xe'));var authService=require(_0x121e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x121e('0x10'));var hardwareService=require(_0x121e('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x121e('0x12'));var db=require(_0x121e('0x13'))['db'];function respondWithStatusCode(_0x2e225d,_0x15bd2c){_0x15bd2c=_0x15bd2c||0xcc;return function(_0x5d81d1){if(_0x5d81d1){return _0x2e225d[_0x121e('0x14')](_0x15bd2c);}return _0x2e225d[_0x121e('0x15')](_0x15bd2c)[_0x121e('0x16')]();};}function respondWithResult(_0x14e342,_0x5241fa){_0x5241fa=_0x5241fa||0xc8;return function(_0x42ec76){if(_0x42ec76){return _0x14e342[_0x121e('0x15')](_0x5241fa)[_0x121e('0x17')](_0x42ec76);}};}function respondWithFilteredResult(_0x9dbb87,_0x2468c6){return function(_0x417b68){if(_0x417b68){var _0x210ae5=typeof _0x2468c6[_0x121e('0x18')]===_0x121e('0x19')&&typeof _0x2468c6[_0x121e('0x1a')]===_0x121e('0x19');var _0x192b7e=_0x417b68[_0x121e('0x1b')];var _0x2c56b3=_0x210ae5?0x0:_0x2468c6[_0x121e('0x18')];var _0x2ca479=_0x210ae5?_0x417b68[_0x121e('0x1b')]:_0x2468c6[_0x121e('0x18')]+_0x2468c6[_0x121e('0x1a')];var _0x52d9ed;if(_0x2ca479>=_0x192b7e){_0x2ca479=_0x192b7e;_0x52d9ed=0xc8;}else{_0x52d9ed=0xce;}_0x9dbb87[_0x121e('0x15')](_0x52d9ed);return _0x9dbb87[_0x121e('0x1c')](_0x121e('0x1d'),_0x2c56b3+'-'+_0x2ca479+'/'+_0x192b7e)['json'](_0x417b68);}return null;};}function patchUpdates(_0xab268){return function(_0x268457){try{jsonpatch[_0x121e('0x1e')](_0x268457,_0xab268,!![]);}catch(_0x5dca76){return BPromise['reject'](_0x5dca76);}return _0x268457['save']();};}function saveUpdates(_0x598fb4,_0x357110){return function(_0x2d1566){if(_0x2d1566){return _0x2d1566[_0x121e('0x1f')](_0x598fb4)['then'](function(_0x1cd9fd){return _0x1cd9fd;});}return null;};}function removeEntity(_0x8b667f,_0x175cda){return function(_0x21366e){if(_0x21366e){return _0x21366e['destroy']()['then'](function(){var _0x268b14=_0x21366e[_0x121e('0x20')]({'plain':!![]});var _0x998831=_0x121e('0x21');return db[_0x121e('0x22')][_0x121e('0x23')]({'where':{'type':_0x998831,'resourceId':_0x268b14['id']}})[_0x121e('0x24')](function(){return _0x21366e;});})[_0x121e('0x24')](function(){_0x8b667f[_0x121e('0x15')](0xcc)[_0x121e('0x16')]();});}};}function handleEntityNotFound(_0x1b74bd,_0x4d76b7){return function(_0x8a4ab0){if(!_0x8a4ab0){_0x1b74bd['sendStatus'](0x194);}return _0x8a4ab0;};}function handleError(_0x36c305,_0xec36bc){_0xec36bc=_0xec36bc||0x1f4;return function(_0x1d5349){logger[_0x121e('0x25')](_0x1d5349[_0x121e('0x26')]);if(_0x1d5349['name']){delete _0x1d5349[_0x121e('0x27')];}_0x36c305[_0x121e('0x15')](_0xec36bc)[_0x121e('0x28')](_0x1d5349);};}exports[_0x121e('0x29')]=function(_0x5ab5b1,_0x5be233){var _0x306bee={},_0x30c33a={},_0xd58107={'count':0x0,'rows':[]};return db[_0x121e('0x2a')]['describe']()[_0x121e('0x24')](function(_0x28d90b){_0x30c33a[_0x121e('0x2b')]=_['keys'](_0x28d90b);_0x30c33a[_0x121e('0x2c')]=_['keys'](_0x5ab5b1[_0x121e('0x2c')]);_0x30c33a[_0x121e('0x2d')]=_[_0x121e('0x2e')](_0x30c33a[_0x121e('0x2b')],_0x30c33a[_0x121e('0x2c')]);_0x306bee[_0x121e('0x2f')]=_[_0x121e('0x2e')](_0x30c33a['model'],qs[_0x121e('0x30')](_0x5ab5b1['query']['fields']));_0x306bee['attributes']=_0x306bee['attributes'][_0x121e('0x31')]?_0x306bee[_0x121e('0x2f')]:_0x30c33a[_0x121e('0x2b')];if(!_0x5ab5b1['query'][_0x121e('0x32')](_0x121e('0x33'))){_0x306bee[_0x121e('0x1a')]=qs[_0x121e('0x1a')](_0x5ab5b1[_0x121e('0x2c')]['limit']);_0x306bee[_0x121e('0x18')]=qs[_0x121e('0x18')](_0x5ab5b1['query']['offset']);}_0x306bee[_0x121e('0x34')]=qs['sort'](_0x5ab5b1[_0x121e('0x2c')]['sort']);_0x306bee['where']=qs[_0x121e('0x2d')](_[_0x121e('0x35')](_0x5ab5b1[_0x121e('0x2c')],_0x30c33a['filters']),_0x28d90b);if(_0x5ab5b1[_0x121e('0x2c')][_0x121e('0x36')]){_0x306bee[_0x121e('0x37')]=_[_0x121e('0x38')](_0x306bee['where'],{'$or':_['map'](_0x306bee['attributes'],function(_0xc59642){var _0x3e6c86={};_0x3e6c86[_0xc59642]={'$like':'%'+_0x5ab5b1['query'][_0x121e('0x36')]+'%'};return _0x3e6c86;})});}_0x306bee=_[_0x121e('0x38')]({},_0x306bee,_0x5ab5b1[_0x121e('0x39')]);var _0x2406b6={'where':_0x306bee[_0x121e('0x37')]};return db[_0x121e('0x2a')][_0x121e('0x1b')](_0x2406b6)[_0x121e('0x24')](function(_0x48e1af){_0xd58107[_0x121e('0x1b')]=_0x48e1af;if(_0x5ab5b1[_0x121e('0x2c')][_0x121e('0x3a')]){_0x306bee['include']=[{'all':!![]}];}return db['CmCompany'][_0x121e('0x3b')](_0x306bee);})[_0x121e('0x24')](function(_0x1d29c0){_0xd58107['rows']=_0x1d29c0;return _0xd58107;})[_0x121e('0x24')](respondWithFilteredResult(_0x5be233,_0x306bee))[_0x121e('0x3c')](handleError(_0x5be233,null));})[_0x121e('0x3c')](handleError(_0x5be233,null));};exports['show']=function(_0x134814,_0x20d37f){var _0x3e9884={'raw':![],'where':{'id':_0x134814['params']['id']}},_0x148f83={};_0x148f83[_0x121e('0x2b')]=_[_0x121e('0x3d')](db[_0x121e('0x2a')][_0x121e('0x3e')]);_0x148f83[_0x121e('0x2c')]=_[_0x121e('0x3d')](_0x134814[_0x121e('0x2c')]);_0x148f83['filters']=_[_0x121e('0x2e')](_0x148f83[_0x121e('0x2b')],_0x148f83[_0x121e('0x2c')]);_0x3e9884[_0x121e('0x2f')]=_[_0x121e('0x2e')](_0x148f83['model'],qs[_0x121e('0x30')](_0x134814[_0x121e('0x2c')]['fields']));_0x3e9884[_0x121e('0x2f')]=_0x3e9884[_0x121e('0x2f')][_0x121e('0x31')]?_0x3e9884[_0x121e('0x2f')]:_0x148f83[_0x121e('0x2b')];if(_0x134814[_0x121e('0x2c')][_0x121e('0x3a')]){_0x3e9884['include']=[{'all':!![]}];}_0x3e9884=_[_0x121e('0x38')]({},_0x3e9884,_0x134814[_0x121e('0x39')]);return db[_0x121e('0x2a')][_0x121e('0x3f')](_0x3e9884)['then'](handleEntityNotFound(_0x20d37f,null))['then'](respondWithResult(_0x20d37f,null))[_0x121e('0x3c')](handleError(_0x20d37f,null));};exports[_0x121e('0x40')]=function(_0x3d6a7b,_0x2c33d5){return db[_0x121e('0x2a')][_0x121e('0x40')](_0x3d6a7b['body'],{})[_0x121e('0x24')](function(_0x2bd298){var _0x4d56d8=_0x3d6a7b[_0x121e('0x41')]['get']({'plain':!![]});if(!_0x4d56d8)throw new Error(_0x121e('0x42'));if(_0x4d56d8[_0x121e('0x43')]==='user'){var _0x29f31c=_0x2bd298[_0x121e('0x20')]({'plain':!![]});var _0x5e7eec=_0x121e('0x21');return db[_0x121e('0x44')][_0x121e('0x3f')]({'where':{'name':_0x5e7eec,'userProfileId':_0x4d56d8['userProfileId']},'raw':!![]})[_0x121e('0x24')](function(_0x375de1){if(_0x375de1&&_0x375de1[_0x121e('0x45')]===0x0){return db[_0x121e('0x22')][_0x121e('0x40')]({'name':_0x29f31c[_0x121e('0x27')],'resourceId':_0x29f31c['id'],'type':_0x375de1['name'],'sectionId':_0x375de1['id']},{})[_0x121e('0x24')](function(){return _0x2bd298;});}else{return _0x2bd298;}})[_0x121e('0x3c')](function(_0x243f12){logger[_0x121e('0x25')](_0x121e('0x46'),_0x243f12);throw _0x243f12;});}return _0x2bd298;})[_0x121e('0x24')](respondWithResult(_0x2c33d5,0xc9))[_0x121e('0x3c')](handleError(_0x2c33d5,null));};exports['update']=function(_0x4f6d9c,_0x57a7ce){if(_0x4f6d9c[_0x121e('0x47')]['id']){delete _0x4f6d9c[_0x121e('0x47')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x4f6d9c[_0x121e('0x48')]['id']}})[_0x121e('0x24')](handleEntityNotFound(_0x57a7ce,null))[_0x121e('0x24')](saveUpdates(_0x4f6d9c[_0x121e('0x47')],null))['then'](respondWithResult(_0x57a7ce,null))[_0x121e('0x3c')](handleError(_0x57a7ce,null));};exports[_0x121e('0x23')]=function(_0x5c73fc,_0x2b3de5){return db[_0x121e('0x2a')][_0x121e('0x3f')]({'where':{'id':_0x5c73fc[_0x121e('0x48')]['id']}})[_0x121e('0x24')](handleEntityNotFound(_0x2b3de5,null))[_0x121e('0x24')](removeEntity(_0x2b3de5,null))[_0x121e('0x3c')](handleError(_0x2b3de5,null));};exports['describe']=function(_0x338cb2,_0x531c65){return db[_0x121e('0x2a')]['describe']()[_0x121e('0x24')](respondWithResult(_0x531c65,null))[_0x121e('0x3c')](handleError(_0x531c65,null));};exports[_0x121e('0x49')]=function(_0x1ad829,_0x4ffbbd,_0x504d88){return db[_0x121e('0x4a')][_0x121e('0x3f')]({'where':{'id':_0x1ad829[_0x121e('0x48')]['id']}})[_0x121e('0x24')](handleEntityNotFound(_0x4ffbbd,null))[_0x121e('0x24')](function(_0x55cb5e){if(_0x55cb5e){return _0x55cb5e[_0x121e('0x49')](_0x1ad829[_0x121e('0x47')][_0x121e('0x4b')],_['omit'](_0x1ad829[_0x121e('0x47')],[_0x121e('0x4b'),'id'])||{});}})[_0x121e('0x24')](respondWithResult(_0x4ffbbd,null))[_0x121e('0x3c')](handleError(_0x4ffbbd,null));};exports[_0x121e('0x4c')]=function(_0x4947db,_0x3e820d,_0x3e323c){var _0x5081a5={};var _0x3afe4a={};var _0x3e0e99;var _0x44260c;return db['CmCompany'][_0x121e('0x4d')]({'where':{'id':_0x4947db[_0x121e('0x48')]['id']}})[_0x121e('0x24')](handleEntityNotFound(_0x3e820d,null))[_0x121e('0x24')](function(_0x46dfe6){if(_0x46dfe6){_0x3e0e99=_0x46dfe6;_0x3afe4a[_0x121e('0x2b')]=_['keys'](db['CmContact']['rawAttributes']);_0x3afe4a['query']=_['keys'](_0x4947db[_0x121e('0x2c')]);_0x3afe4a[_0x121e('0x2d')]=_[_0x121e('0x2e')](_0x3afe4a[_0x121e('0x2b')],_0x3afe4a[_0x121e('0x2c')]);_0x5081a5['attributes']=_[_0x121e('0x2e')](_0x3afe4a[_0x121e('0x2b')],qs[_0x121e('0x30')](_0x4947db[_0x121e('0x2c')][_0x121e('0x30')]));_0x5081a5[_0x121e('0x2f')]=_0x5081a5[_0x121e('0x2f')]['length']?_0x5081a5[_0x121e('0x2f')]:_0x3afe4a['model'];_0x5081a5['order']=qs['sort'](_0x4947db[_0x121e('0x2c')][_0x121e('0x4e')]);_0x5081a5[_0x121e('0x37')]=qs['filters'](_[_0x121e('0x35')](_0x4947db[_0x121e('0x2c')],_0x3afe4a[_0x121e('0x2d')]));if(_0x4947db[_0x121e('0x2c')][_0x121e('0x36')]){_0x5081a5['where']=_['merge'](_0x5081a5[_0x121e('0x37')],{'$or':_['map'](_0x5081a5[_0x121e('0x2f')],function(_0x4fe72e){var _0x5f44e3={};_0x5f44e3[_0x4fe72e]={'$like':'%'+_0x4947db['query'][_0x121e('0x36')]+'%'};return _0x5f44e3;})});}_0x5081a5=_[_0x121e('0x38')]({},_0x5081a5,_0x4947db['options']);return _0x3e0e99[_0x121e('0x4c')](_0x5081a5);}})[_0x121e('0x24')](function(_0x287dc3){if(_0x287dc3){_0x44260c=_0x287dc3['length'];if(!_0x4947db[_0x121e('0x2c')][_0x121e('0x32')](_0x121e('0x33'))){_0x5081a5[_0x121e('0x1a')]=qs['limit'](_0x4947db[_0x121e('0x2c')][_0x121e('0x1a')]);_0x5081a5[_0x121e('0x18')]=qs[_0x121e('0x18')](_0x4947db['query'][_0x121e('0x18')]);}return _0x3e0e99[_0x121e('0x4c')](_0x5081a5);}})[_0x121e('0x24')](function(_0x220fdf){if(_0x220fdf){return _0x220fdf?{'count':_0x44260c,'rows':_0x220fdf}:null;}})['then'](respondWithResult(_0x3e820d,null))[_0x121e('0x3c')](handleError(_0x3e820d,null));};
\ No newline at end of file
+var _0x6862=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','sendStatus','error','stack','name','send','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','map','options','includeAll','catch','params','include','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','findOne','rawAttributes','where','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x6862,0x13a));var _0x2686=function(_0x48f4ed,_0x2d10c5){_0x48f4ed=_0x48f4ed-0x0;var _0x766915=_0x6862[_0x48f4ed];return _0x766915;};'use strict';var emlformat=require(_0x2686('0x0'));var rimraf=require(_0x2686('0x1'));var zipdir=require(_0x2686('0x2'));var jsonpatch=require(_0x2686('0x3'));var rp=require(_0x2686('0x4'));var moment=require(_0x2686('0x5'));var BPromise=require(_0x2686('0x6'));var Mustache=require('mustache');var util=require(_0x2686('0x7'));var path=require('path');var sox=require(_0x2686('0x8'));var csv=require('to-csv');var ejs=require(_0x2686('0x9'));var fs=require('fs');var fs_extra=require(_0x2686('0xa'));var _=require(_0x2686('0xb'));var squel=require('squel');var crypto=require(_0x2686('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2686('0xd'));var toCsv=require(_0x2686('0xe'));var querystring=require(_0x2686('0xf'));var Papa=require(_0x2686('0x10'));var Redis=require('ioredis');var authService=require(_0x2686('0x11'));var qs=require(_0x2686('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2686('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x2686('0x14'));var config=require(_0x2686('0x15'));var licenseUtil=require(_0x2686('0x16'));var db=require(_0x2686('0x17'))['db'];function respondWithStatusCode(_0x972e46,_0x36f553){_0x36f553=_0x36f553||0xcc;return function(_0x11c0d7){if(_0x11c0d7){return _0x972e46['sendStatus'](_0x36f553);}return _0x972e46[_0x2686('0x18')](_0x36f553)[_0x2686('0x19')]();};}function respondWithResult(_0x1e5fb8,_0x358c77){_0x358c77=_0x358c77||0xc8;return function(_0x2690fe){if(_0x2690fe){return _0x1e5fb8['status'](_0x358c77)[_0x2686('0x1a')](_0x2690fe);}};}function respondWithFilteredResult(_0x42e11a,_0x3019eb){return function(_0x96fe0b){if(_0x96fe0b){var _0x5d74b6=typeof _0x3019eb[_0x2686('0x1b')]===_0x2686('0x1c')&&typeof _0x3019eb[_0x2686('0x1d')]===_0x2686('0x1c');var _0x4aeb62=_0x96fe0b[_0x2686('0x1e')];var _0x6e3f5e=_0x5d74b6?0x0:_0x3019eb[_0x2686('0x1b')];var _0x5c5e8b=_0x5d74b6?_0x96fe0b[_0x2686('0x1e')]:_0x3019eb[_0x2686('0x1b')]+_0x3019eb[_0x2686('0x1d')];var _0x1e653d;if(_0x5c5e8b>=_0x4aeb62){_0x5c5e8b=_0x4aeb62;_0x1e653d=0xc8;}else{_0x1e653d=0xce;}_0x42e11a[_0x2686('0x18')](_0x1e653d);return _0x42e11a[_0x2686('0x1f')](_0x2686('0x20'),_0x6e3f5e+'-'+_0x5c5e8b+'/'+_0x4aeb62)[_0x2686('0x1a')](_0x96fe0b);}return null;};}function patchUpdates(_0x395666){return function(_0x190b2a){try{jsonpatch[_0x2686('0x21')](_0x190b2a,_0x395666,!![]);}catch(_0x467db9){return BPromise['reject'](_0x467db9);}return _0x190b2a[_0x2686('0x22')]();};}function saveUpdates(_0x299a1f,_0x2cd18a){return function(_0x5a987d){if(_0x5a987d){return _0x5a987d[_0x2686('0x23')](_0x299a1f)[_0x2686('0x24')](function(_0x40ea2d){return _0x40ea2d;});}return null;};}function removeEntity(_0x28622e,_0x4af4fe){return function(_0x45570d){if(_0x45570d){return _0x45570d[_0x2686('0x25')]()[_0x2686('0x24')](function(){var _0x18aaef=_0x45570d[_0x2686('0x26')]({'plain':!![]});var _0x27c5ce=_0x2686('0x27');return db[_0x2686('0x28')][_0x2686('0x25')]({'where':{'type':_0x27c5ce,'resourceId':_0x18aaef['id']}})[_0x2686('0x24')](function(){return _0x45570d;});})[_0x2686('0x24')](function(){_0x28622e['status'](0xcc)[_0x2686('0x19')]();});}};}function handleEntityNotFound(_0x371ff3,_0x4abd0f){return function(_0x18a4fc){if(!_0x18a4fc){_0x371ff3[_0x2686('0x29')](0x194);}return _0x18a4fc;};}function handleError(_0x3c9db4,_0x181b61){_0x181b61=_0x181b61||0x1f4;return function(_0x41b664){logger[_0x2686('0x2a')](_0x41b664[_0x2686('0x2b')]);if(_0x41b664['name']){delete _0x41b664[_0x2686('0x2c')];}_0x3c9db4[_0x2686('0x18')](_0x181b61)[_0x2686('0x2d')](_0x41b664);};}exports['index']=function(_0x2e8cb4,_0x3b9334){var _0x132ee7={},_0x59e5cc={},_0x558c89={'count':0x0,'rows':[]};return db[_0x2686('0x2e')][_0x2686('0x2f')]()[_0x2686('0x24')](function(_0x5ce91e){_0x59e5cc['model']=_[_0x2686('0x30')](_0x5ce91e);_0x59e5cc[_0x2686('0x31')]=_[_0x2686('0x30')](_0x2e8cb4['query']);_0x59e5cc[_0x2686('0x32')]=_['intersection'](_0x59e5cc[_0x2686('0x33')],_0x59e5cc['query']);_0x132ee7[_0x2686('0x34')]=_[_0x2686('0x35')](_0x59e5cc['model'],qs['fields'](_0x2e8cb4['query'][_0x2686('0x36')]));_0x132ee7[_0x2686('0x34')]=_0x132ee7[_0x2686('0x34')][_0x2686('0x37')]?_0x132ee7[_0x2686('0x34')]:_0x59e5cc['model'];if(!_0x2e8cb4[_0x2686('0x31')]['hasOwnProperty'](_0x2686('0x38'))){_0x132ee7[_0x2686('0x1d')]=qs[_0x2686('0x1d')](_0x2e8cb4[_0x2686('0x31')][_0x2686('0x1d')]);_0x132ee7[_0x2686('0x1b')]=qs['offset'](_0x2e8cb4[_0x2686('0x31')][_0x2686('0x1b')]);}_0x132ee7[_0x2686('0x39')]=qs[_0x2686('0x3a')](_0x2e8cb4[_0x2686('0x31')][_0x2686('0x3a')]);_0x132ee7['where']=qs['filters'](_[_0x2686('0x3b')](_0x2e8cb4[_0x2686('0x31')],_0x59e5cc[_0x2686('0x32')]),_0x5ce91e);if(_0x2e8cb4[_0x2686('0x31')][_0x2686('0x3c')]){_0x132ee7['where']=_[_0x2686('0x3d')](_0x132ee7['where'],{'$or':_[_0x2686('0x3e')](_0x132ee7['attributes'],function(_0x1af4ae){var _0x355fa4={};_0x355fa4[_0x1af4ae]={'$like':'%'+_0x2e8cb4[_0x2686('0x31')]['filter']+'%'};return _0x355fa4;})});}_0x132ee7=_['merge']({},_0x132ee7,_0x2e8cb4[_0x2686('0x3f')]);var _0x2a605e={'where':_0x132ee7['where']};return db['CmCompany'][_0x2686('0x1e')](_0x2a605e)[_0x2686('0x24')](function(_0xfe8b8b){_0x558c89[_0x2686('0x1e')]=_0xfe8b8b;if(_0x2e8cb4['query'][_0x2686('0x40')]){_0x132ee7['include']=[{'all':!![]}];}return db[_0x2686('0x2e')]['findAll'](_0x132ee7);})[_0x2686('0x24')](function(_0xfd62cd){_0x558c89['rows']=_0xfd62cd;return _0x558c89;})['then'](respondWithFilteredResult(_0x3b9334,_0x132ee7))[_0x2686('0x41')](handleError(_0x3b9334,null));})['catch'](handleError(_0x3b9334,null));};exports['show']=function(_0x242b53,_0x349f83){var _0x570f8e={'raw':![],'where':{'id':_0x242b53[_0x2686('0x42')]['id']}},_0x4eae82={};_0x4eae82[_0x2686('0x33')]=_[_0x2686('0x30')](db[_0x2686('0x2e')]['rawAttributes']);_0x4eae82[_0x2686('0x31')]=_[_0x2686('0x30')](_0x242b53[_0x2686('0x31')]);_0x4eae82[_0x2686('0x32')]=_[_0x2686('0x35')](_0x4eae82[_0x2686('0x33')],_0x4eae82[_0x2686('0x31')]);_0x570f8e['attributes']=_[_0x2686('0x35')](_0x4eae82[_0x2686('0x33')],qs[_0x2686('0x36')](_0x242b53[_0x2686('0x31')]['fields']));_0x570f8e[_0x2686('0x34')]=_0x570f8e['attributes'][_0x2686('0x37')]?_0x570f8e[_0x2686('0x34')]:_0x4eae82[_0x2686('0x33')];if(_0x242b53[_0x2686('0x31')]['includeAll']){_0x570f8e[_0x2686('0x43')]=[{'all':!![]}];}_0x570f8e=_['merge']({},_0x570f8e,_0x242b53['options']);return db[_0x2686('0x2e')][_0x2686('0x44')](_0x570f8e)['then'](handleEntityNotFound(_0x349f83,null))[_0x2686('0x24')](respondWithResult(_0x349f83,null))[_0x2686('0x41')](handleError(_0x349f83,null));};exports['create']=function(_0x7439e9,_0x2c4fd1){return db[_0x2686('0x2e')][_0x2686('0x45')](_0x7439e9[_0x2686('0x46')],{})[_0x2686('0x24')](function(_0x59dca4){var _0x44dc04=_0x7439e9[_0x2686('0x47')][_0x2686('0x26')]({'plain':!![]});if(!_0x44dc04)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x44dc04['role']==='user'){var _0x140bbc=_0x59dca4[_0x2686('0x26')]({'plain':!![]});var _0x237fad=_0x2686('0x27');return db[_0x2686('0x48')][_0x2686('0x44')]({'where':{'name':_0x237fad,'userProfileId':_0x44dc04['userProfileId']},'raw':!![]})['then'](function(_0x2d1ab5){if(_0x2d1ab5&&_0x2d1ab5[_0x2686('0x49')]===0x0){return db[_0x2686('0x28')][_0x2686('0x45')]({'name':_0x140bbc[_0x2686('0x2c')],'resourceId':_0x140bbc['id'],'type':_0x2d1ab5[_0x2686('0x2c')],'sectionId':_0x2d1ab5['id']},{})[_0x2686('0x24')](function(){return _0x59dca4;});}else{return _0x59dca4;}})['catch'](function(_0x48df80){logger[_0x2686('0x2a')](_0x2686('0x4a'),_0x48df80);throw _0x48df80;});}return _0x59dca4;})[_0x2686('0x24')](respondWithResult(_0x2c4fd1,0xc9))['catch'](handleError(_0x2c4fd1,null));};exports[_0x2686('0x23')]=function(_0x2e49b9,_0x1efdf7){if(_0x2e49b9[_0x2686('0x46')]['id']){delete _0x2e49b9['body']['id'];}return db['CmCompany'][_0x2686('0x44')]({'where':{'id':_0x2e49b9['params']['id']}})[_0x2686('0x24')](handleEntityNotFound(_0x1efdf7,null))[_0x2686('0x24')](saveUpdates(_0x2e49b9[_0x2686('0x46')],null))[_0x2686('0x24')](respondWithResult(_0x1efdf7,null))[_0x2686('0x41')](handleError(_0x1efdf7,null));};exports['destroy']=function(_0x2b4cae,_0x1c38e3){return db[_0x2686('0x2e')][_0x2686('0x44')]({'where':{'id':_0x2b4cae[_0x2686('0x42')]['id']}})[_0x2686('0x24')](handleEntityNotFound(_0x1c38e3,null))[_0x2686('0x24')](removeEntity(_0x1c38e3,null))[_0x2686('0x41')](handleError(_0x1c38e3,null));};exports[_0x2686('0x2f')]=function(_0xdfd617,_0x5e522f){return db[_0x2686('0x2e')]['describe']()['then'](respondWithResult(_0x5e522f,null))['catch'](handleError(_0x5e522f,null));};exports[_0x2686('0x4b')]=function(_0xbf4b5,_0x15fd43,_0x48e907){return db[_0x2686('0x4c')][_0x2686('0x44')]({'where':{'id':_0xbf4b5[_0x2686('0x42')]['id']}})[_0x2686('0x24')](handleEntityNotFound(_0x15fd43,null))[_0x2686('0x24')](function(_0x4b9f5d){if(_0x4b9f5d){return _0x4b9f5d[_0x2686('0x4b')](_0xbf4b5[_0x2686('0x46')]['ids'],_['omit'](_0xbf4b5[_0x2686('0x46')],[_0x2686('0x4d'),'id'])||{});}})[_0x2686('0x24')](respondWithResult(_0x15fd43,null))[_0x2686('0x41')](handleError(_0x15fd43,null));};exports['getContacts']=function(_0x5e5de3,_0x1f340a,_0x174859){var _0x2d1891={};var _0x19355c={};var _0x59f283;var _0x379ffd;return db['CmCompany'][_0x2686('0x4e')]({'where':{'id':_0x5e5de3['params']['id']}})[_0x2686('0x24')](handleEntityNotFound(_0x1f340a,null))[_0x2686('0x24')](function(_0x5dea00){if(_0x5dea00){_0x59f283=_0x5dea00;_0x19355c[_0x2686('0x33')]=_[_0x2686('0x30')](db['CmContact'][_0x2686('0x4f')]);_0x19355c['query']=_['keys'](_0x5e5de3[_0x2686('0x31')]);_0x19355c['filters']=_[_0x2686('0x35')](_0x19355c['model'],_0x19355c[_0x2686('0x31')]);_0x2d1891[_0x2686('0x34')]=_['intersection'](_0x19355c['model'],qs[_0x2686('0x36')](_0x5e5de3[_0x2686('0x31')][_0x2686('0x36')]));_0x2d1891['attributes']=_0x2d1891[_0x2686('0x34')][_0x2686('0x37')]?_0x2d1891[_0x2686('0x34')]:_0x19355c[_0x2686('0x33')];_0x2d1891[_0x2686('0x39')]=qs[_0x2686('0x3a')](_0x5e5de3[_0x2686('0x31')][_0x2686('0x3a')]);_0x2d1891[_0x2686('0x50')]=qs['filters'](_[_0x2686('0x3b')](_0x5e5de3[_0x2686('0x31')],_0x19355c[_0x2686('0x32')]));if(_0x5e5de3['query'][_0x2686('0x3c')]){_0x2d1891[_0x2686('0x50')]=_['merge'](_0x2d1891[_0x2686('0x50')],{'$or':_[_0x2686('0x3e')](_0x2d1891['attributes'],function(_0x4f46e1){var _0x1b5b20={};_0x1b5b20[_0x4f46e1]={'$like':'%'+_0x5e5de3[_0x2686('0x31')][_0x2686('0x3c')]+'%'};return _0x1b5b20;})});}_0x2d1891=_['merge']({},_0x2d1891,_0x5e5de3[_0x2686('0x3f')]);return _0x59f283[_0x2686('0x51')](_0x2d1891);}})[_0x2686('0x24')](function(_0x1f694f){if(_0x1f694f){_0x379ffd=_0x1f694f[_0x2686('0x37')];if(!_0x5e5de3[_0x2686('0x31')][_0x2686('0x52')](_0x2686('0x38'))){_0x2d1891['limit']=qs[_0x2686('0x1d')](_0x5e5de3['query'][_0x2686('0x1d')]);_0x2d1891['offset']=qs['offset'](_0x5e5de3[_0x2686('0x31')]['offset']);}return _0x59f283[_0x2686('0x51')](_0x2d1891);}})['then'](function(_0xbdba89){if(_0xbdba89){return _0xbdba89?{'count':_0x379ffd,'rows':_0xbdba89}:null;}})[_0x2686('0x24')](respondWithResult(_0x1f340a,null))['catch'](handleError(_0x1f340a,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 5ad2c34..ecc8586 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 _0x221f=['exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x1f8af6,_0x53d3d4){var _0x571552=function(_0x23b4cb){while(--_0x23b4cb){_0x1f8af6['push'](_0x1f8af6['shift']());}};_0x571552(++_0x53d3d4);}(_0x221f,0x6c));var _0xf221=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x221f[_0xe7d07d];return _0x229e46;};'use strict';var _=require(_0xf221('0x0'));var util=require(_0xf221('0x1'));var logger=require(_0xf221('0x2'))(_0xf221('0x3'));var moment=require('moment');var BPromise=require(_0xf221('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf221('0x5'));var rimraf=require(_0xf221('0x6'));var config=require(_0xf221('0x7'));var attributes=require(_0xf221('0x8'));module[_0xf221('0x9')]=function(_0x3c1d27,_0x470e3e){return _0x3c1d27[_0xf221('0xa')](_0xf221('0xb'),attributes,{'tableName':_0xf221('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9dc1=['cm_companies','lodash','util','../../config/logger','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x5d3feb,_0x17eeb9){var _0x59d181=function(_0x119238){while(--_0x119238){_0x5d3feb['push'](_0x5d3feb['shift']());}};_0x59d181(++_0x17eeb9);}(_0x9dc1,0xc9));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x19dc('0x0'));var util=require(_0x19dc('0x1'));var logger=require(_0x19dc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x19dc('0x3'));var fs=require('fs');var path=require(_0x19dc('0x4'));var rimraf=require('rimraf');var config=require(_0x19dc('0x5'));var attributes=require(_0x19dc('0x6'));module[_0x19dc('0x7')]=function(_0x1af49b,_0x384ad5){return _0x1af49b[_0x19dc('0x8')]('CmCompany',attributes,{'tableName':_0x19dc('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 8ac0c9f..8c16ae3 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 _0x0495=['info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0x0495,0x16f));var _0x5049=function(_0x2180eb,_0x1f17dd){_0x2180eb=_0x2180eb-0x0;var _0x2dcbdd=_0x0495[_0x2180eb];return _0x2dcbdd;};'use strict';var _=require(_0x5049('0x0'));var util=require('util');var moment=require(_0x5049('0x1'));var BPromise=require(_0x5049('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5049('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5049('0x4'))(_0x5049('0x5'));var config=require(_0x5049('0x6'));var jayson=require(_0x5049('0x7'));var client=jayson[_0x5049('0x8')][_0x5049('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad12e,_0x5ab252,_0x1978a5){return new BPromise(function(_0x218a57,_0x25aa9d){return client['request'](_0x4ad12e,_0x1978a5)[_0x5049('0xa')](function(_0x386207){logger[_0x5049('0xb')](_0x5049('0xc'),_0x5ab252,'request\x20sent');logger['debug'](_0x5049('0xd'),_0x5ab252,_0x5049('0xe'),JSON[_0x5049('0xf')](_0x386207));if(_0x386207[_0x5049('0x10')]){if(_0x386207[_0x5049('0x10')][_0x5049('0x11')]===0x1f4){logger[_0x5049('0x10')](_0x5049('0xc'),_0x5ab252,_0x386207[_0x5049('0x10')]['message']);return _0x25aa9d(_0x386207['error']['message']);}logger[_0x5049('0x10')](_0x5049('0xc'),_0x5ab252,_0x386207[_0x5049('0x10')][_0x5049('0x12')]);return _0x218a57(_0x386207['error'][_0x5049('0x12')]);}else{logger[_0x5049('0xb')]('CmCompany,\x20%s,\x20%s',_0x5ab252,'request\x20sent');_0x218a57(_0x386207[_0x5049('0x13')]['message']);}})[_0x5049('0x14')](function(_0x1c05aa){logger[_0x5049('0x10')]('CmCompany,\x20%s,\x20%s',_0x5ab252,_0x1c05aa);_0x25aa9d(_0x1c05aa);});});}
\ No newline at end of file
+var _0x5079=['catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5079,0x1ef));var _0x9507=function(_0x1fd5eb,_0x235203){_0x1fd5eb=_0x1fd5eb-0x0;var _0x102365=_0x5079[_0x1fd5eb];return _0x102365;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9507('0x0'));var BPromise=require('bluebird');var rs=require(_0x9507('0x1'));var fs=require('fs');var Redis=require(_0x9507('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x9507('0x3'));var logger=require(_0x9507('0x4'))('rpc');var config=require(_0x9507('0x5'));var jayson=require(_0x9507('0x6'));var client=jayson[_0x9507('0x7')][_0x9507('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326745,_0x5bc32d,_0x1af99f){return new BPromise(function(_0x415c2c,_0x1fcebd){return client[_0x9507('0x9')](_0x326745,_0x1af99f)['then'](function(_0x30b7b9){logger[_0x9507('0xa')](_0x9507('0xb'),_0x5bc32d,_0x9507('0xc'));logger[_0x9507('0xd')](_0x9507('0xe'),_0x5bc32d,'request\x20sent',JSON['stringify'](_0x30b7b9));if(_0x30b7b9[_0x9507('0xf')]){if(_0x30b7b9[_0x9507('0xf')][_0x9507('0x10')]===0x1f4){logger[_0x9507('0xf')](_0x9507('0xb'),_0x5bc32d,_0x30b7b9['error'][_0x9507('0x11')]);return _0x1fcebd(_0x30b7b9[_0x9507('0xf')][_0x9507('0x11')]);}logger[_0x9507('0xf')](_0x9507('0xb'),_0x5bc32d,_0x30b7b9['error'][_0x9507('0x11')]);return _0x415c2c(_0x30b7b9[_0x9507('0xf')][_0x9507('0x11')]);}else{logger[_0x9507('0xa')](_0x9507('0xb'),_0x5bc32d,_0x9507('0xc'));_0x415c2c(_0x30b7b9['result'][_0x9507('0x11')]);}})[_0x9507('0x12')](function(_0x157f2e){logger[_0x9507('0xf')](_0x9507('0xb'),_0x5bc32d,_0x157f2e);_0x1fcebd(_0x157f2e);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 2440d77..aab4719 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 _0x311d=['get','isAuthenticated','index','/describe','describe','/:id','show','getContacts','post','create','addContacts','update','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller'];(function(_0x521ec1,_0x21951d){var _0x22aba7=function(_0x43bafe){while(--_0x43bafe){_0x521ec1['push'](_0x521ec1['shift']());}};_0x22aba7(++_0x21951d);}(_0x311d,0x120));var _0xd311=function(_0x4dbb3c,_0x9767a9){_0x4dbb3c=_0x4dbb3c-0x0;var _0x4feeff=_0x311d[_0x4dbb3c];return _0x4feeff;};'use strict';var multer=require(_0xd311('0x0'));var util=require(_0xd311('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd311('0x2'));var auth=require(_0xd311('0x3'));var interaction=require(_0xd311('0x4'));var config=require('../../config/environment');var controller=require(_0xd311('0x5'));router[_0xd311('0x6')]('/',auth[_0xd311('0x7')](),controller[_0xd311('0x8')]);router[_0xd311('0x6')](_0xd311('0x9'),auth[_0xd311('0x7')](),controller[_0xd311('0xa')]);router['get'](_0xd311('0xb'),auth[_0xd311('0x7')](),controller[_0xd311('0xc')]);router[_0xd311('0x6')]('/:id/contacts',auth[_0xd311('0x7')](),controller[_0xd311('0xd')]);router[_0xd311('0xe')]('/',auth[_0xd311('0x7')](),controller[_0xd311('0xf')]);router['post']('/:id/contacts',auth[_0xd311('0x7')](),controller[_0xd311('0x10')]);router['put'](_0xd311('0xb'),auth[_0xd311('0x7')](),controller[_0xd311('0x11')]);router[_0xd311('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd311('0x13')]);module[_0xd311('0x14')]=router;
\ No newline at end of file
+var _0x6e0c=['/:id/contacts','getContacts','create','addContacts','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x9eeac9,_0x1ee22d){var _0x357669=function(_0x1aa5fe){while(--_0x1aa5fe){_0x9eeac9['push'](_0x9eeac9['shift']());}};_0x357669(++_0x1ee22d);}(_0x6e0c,0x1a6));var _0xc6e0=function(_0x542e14,_0x5dfd4b){_0x542e14=_0x542e14-0x0;var _0xe3bbb=_0x6e0c[_0x542e14];return _0xe3bbb;};'use strict';var multer=require(_0xc6e0('0x0'));var util=require(_0xc6e0('0x1'));var path=require(_0xc6e0('0x2'));var timeout=require(_0xc6e0('0x3'));var express=require(_0xc6e0('0x4'));var router=express['Router']();var fs_extra=require(_0xc6e0('0x5'));var auth=require(_0xc6e0('0x6'));var interaction=require(_0xc6e0('0x7'));var config=require(_0xc6e0('0x8'));var controller=require(_0xc6e0('0x9'));router[_0xc6e0('0xa')]('/',auth[_0xc6e0('0xb')](),controller['index']);router['get'](_0xc6e0('0xc'),auth[_0xc6e0('0xb')](),controller['describe']);router[_0xc6e0('0xa')](_0xc6e0('0xd'),auth[_0xc6e0('0xb')](),controller[_0xc6e0('0xe')]);router[_0xc6e0('0xa')](_0xc6e0('0xf'),auth[_0xc6e0('0xb')](),controller[_0xc6e0('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc6e0('0x11')]);router['post'](_0xc6e0('0xf'),auth['isAuthenticated'](),controller[_0xc6e0('0x12')]);router[_0xc6e0('0x13')](_0xc6e0('0xd'),auth[_0xc6e0('0xb')](),controller[_0xc6e0('0x14')]);router[_0xc6e0('0x15')](_0xc6e0('0xd'),auth['isAuthenticated'](),controller[_0xc6e0('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 453d0a7..b62dc5f 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 _0x2438=['sequelize','exports','STRING','TEXT','INTEGER','lodash'];(function(_0x40d60f,_0x396a00){var _0xa52e4=function(_0x1f8bf5){while(--_0x1f8bf5){_0x40d60f['push'](_0x40d60f['shift']());}};_0xa52e4(++_0x396a00);}(_0x2438,0x1c7));var _0x8243=function(_0x65f140,_0x45cbc7){_0x65f140=_0x65f140-0x0;var _0x18fbda=_0x2438[_0x65f140];return _0x18fbda;};'use strict';var _=require(_0x8243('0x0'));var Sequelize=require(_0x8243('0x1'));module[_0x8243('0x2')]={'firstName':{'type':Sequelize[_0x8243('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8243('0x3')]},'city':{'type':Sequelize[_0x8243('0x3')]},'country':{'type':Sequelize[_0x8243('0x3')]},'dateOfBirth':{'type':Sequelize[_0x8243('0x3')]},'description':{'type':Sequelize[_0x8243('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x8243('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x8243('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x8243('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x8243('0x3')]},'telegram':{'type':Sequelize[_0x8243('0x3')]},'UserId':{'type':Sequelize[_0x8243('0x5')]},'priority':{'type':Sequelize[_0x8243('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x103e=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports'];(function(_0xdba5f4,_0x226baa){var _0x497bdf=function(_0x2ef7d9){while(--_0x2ef7d9){_0xdba5f4['push'](_0xdba5f4['shift']());}};_0x497bdf(++_0x226baa);}(_0x103e,0x1c8));var _0xe103=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x103e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xe103('0x0'));var Sequelize=require(_0xe103('0x1'));module[_0xe103('0x2')]={'firstName':{'type':Sequelize[_0xe103('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe103('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xe103('0x3')]},'country':{'type':Sequelize[_0xe103('0x3')]},'dateOfBirth':{'type':Sequelize[_0xe103('0x3')]},'description':{'type':Sequelize[_0xe103('0x4')]},'phone':{'type':Sequelize[_0xe103('0x3')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xe103('0x3')]},'email':{'type':Sequelize[_0xe103('0x3')]},'url':{'type':Sequelize[_0xe103('0x3')]},'facebook':{'type':Sequelize[_0xe103('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xe103('0x3')]},'line':{'type':Sequelize[_0xe103('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xe103('0x3')]},'UserId':{'type':Sequelize[_0xe103('0x5')]},'priority':{'type':Sequelize[_0xe103('0x5')](0x2)[_0xe103('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe103('0x7')],'defaultValue':Sequelize[_0xe103('0x8')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 32b9db1..851a47b 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 _0xa2ea=['ChatOfflineMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','FaxQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','spread','show','Tag','omit','cf_%d','$and','format','table','id\x20=\x20?','toParam','values','phone','rawAttributes','pick','options','setTags','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','mail','chat','sms','openchannel','fax','whatsapp','-createdAt','channel','includes','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','destination','note','createdAt','UserId','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','Owner','fullname','browserName','customerIp','osName','ratingMessage','ratingType','subject','threadId','findAndCountAll','flatten','sortBy','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','defaults','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','then','keys','length','startsWith','push','CmCustomField','findOne','trimStart','cf_','all','fieldType','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','select','field','color','tools_tags','from','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','DATE','buildExpression','type','text','filter','isNil','Contact','forEach','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','isEmpty','having','user','role','some','User','getLists','c.ListId\x20IS\x20NULL','agent','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','columnName','displayName','findAll','alias','body','get','mergeWith','isArray','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0xa2ea,0x180));var _0xaa2e=function(_0xce2ee4,_0x3fe1e1){_0xce2ee4=_0xce2ee4-0x0;var _0x3fd000=_0xa2ea[_0xce2ee4];return _0x3fd000;};'use strict';var moment=require(_0xaa2e('0x0'));var BPromise=require(_0xaa2e('0x1'));var util=require(_0xaa2e('0x2'));var path=require(_0xaa2e('0x3'));var fs=require('fs');var _=require(_0xaa2e('0x4'));var squel=require(_0xaa2e('0x5'));var Papa=require('papaparse');var Redis=require(_0xaa2e('0x6'));var qs=require(_0xaa2e('0x7'));var as=require(_0xaa2e('0x8'));var logger=require(_0xaa2e('0x9'))(_0xaa2e('0xa'));var config=require('../../config/environment');var db=require(_0xaa2e('0xb'))['db'];config[_0xaa2e('0xc')]=_[_0xaa2e('0xd')](config[_0xaa2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaa2e('0xc')]));require(_0xaa2e('0xe'))[_0xaa2e('0xf')](socket);function respondWithResult(_0xb3c5ac,_0x3c7315){_0x3c7315=_0x3c7315||0xc8;return function(_0x34efdd){if(_0x34efdd){return _0xb3c5ac[_0xaa2e('0x10')](_0x3c7315)[_0xaa2e('0x11')](_0x34efdd);}};}function respondWithFilteredResult(_0x4e9c22,_0x48558b){return function(_0x17c059){if(_0x17c059){var _0x4d1870=typeof _0x48558b[_0xaa2e('0x12')]===_0xaa2e('0x13')&&typeof _0x48558b[_0xaa2e('0x14')]===_0xaa2e('0x13');var _0xe5e1b7=_0x17c059['count'];var _0x32b31d=_0x4d1870?0x0:_0x48558b[_0xaa2e('0x12')];var _0x460292=_0x4d1870?_0x17c059[_0xaa2e('0x15')]:_0x48558b[_0xaa2e('0x12')]+_0x48558b[_0xaa2e('0x14')];var _0x583601;if(_0x460292>=_0xe5e1b7){_0x460292=_0xe5e1b7;_0x583601=0xc8;}else{_0x583601=0xce;}_0x4e9c22[_0xaa2e('0x10')](_0x583601);return _0x4e9c22[_0xaa2e('0x16')](_0xaa2e('0x17'),_0x32b31d+'-'+_0x460292+'/'+_0xe5e1b7)[_0xaa2e('0x11')](_0x17c059);}return null;};}function saveUpdates(_0x4b81b3){return function(_0x8704ab){if(_0x8704ab){return _0x8704ab[_0xaa2e('0x18')](_0x4b81b3)['then'](function(_0x599905){return _0x599905;});}return null;};}function removeEntity(_0x58a09a){return function(_0x399b2f){if(_0x399b2f){return _0x399b2f[_0xaa2e('0x19')]()['then'](function(){_0x58a09a[_0xaa2e('0x10')](0xcc)[_0xaa2e('0x1a')]();});}};}function handleEntityNotFound(_0x585560){return function(_0x2e62c8){if(!_0x2e62c8){_0x585560[_0xaa2e('0x1b')](0x194);}return _0x2e62c8;};}function handleError(_0x3334dd,_0x271290){_0x271290=_0x271290||0x1f4;return function(_0x549427){logger[_0xaa2e('0x1c')](_0x549427[_0xaa2e('0x1d')]);if(_0x549427['name']){delete _0x549427[_0xaa2e('0x1e')];}_0x3334dd['status'](_0x271290)[_0xaa2e('0x1f')](_0x549427);};}exports[_0xaa2e('0x20')]=function(_0x23fe74,_0x3c6e07){var _0x154464={},_0x3b8f9e={},_0x16d1cb={'count':0x0,'rows':[]};return db[_0xaa2e('0x21')][_0xaa2e('0x22')]()[_0xaa2e('0x23')](function(_0x2b18ad){var _0x9d6228=[];for(var _0x494b1e=0x0;_0x494b1e
','Attachments','Title','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc029,0x1df));var _0x9c02=function(_0x3d9557,_0x5d09d2){_0x3d9557=_0x3d9557-0x0;var _0x359ff8=_0xc029[_0x3d9557];return _0x359ff8;};'use strict';var _=require(_0x9c02('0x0'));var moment=require(_0x9c02('0x1'));var random=require(_0x9c02('0x2'));var fs=require('fs');var path=require(_0x9c02('0x3'));var util=require(_0x9c02('0x4'));var tnef=require(_0x9c02('0x5'));var logger=require(_0x9c02('0x6'))(_0x9c02('0x7'));var config=require(_0x9c02('0x8'));function getAddress(_0x2a96cd){var _0x283c37=_[_0x9c02('0x9')](_0x2a96cd[_0x9c02('0xa')]);return _0x283c37&&_0x283c37[_0x9c02('0xb')]?_0x283c37[_0x9c02('0xb')]:_0x9c02('0xc')+random[_0x9c02('0xd')](0x6)+_0x9c02('0xe');}function getFirstName(_0x4a8202){var _0x30fc9c=_['head'](_0x4a8202[_0x9c02('0xa')]);if(_0x30fc9c&&_0x30fc9c[_0x9c02('0xf')]){if(_0x30fc9c[_0x9c02('0xf')]==_0x30fc9c[_0x9c02('0xb')]){return _0x30fc9c['name'][_0x9c02('0x10')](0x0,_0x30fc9c['name'][_0x9c02('0x11')]('@'));}var _0x54221d=_0x30fc9c[_0x9c02('0xf')][_0x9c02('0x12')](/\s+/);return _0x54221d['length']>0x1?_0x54221d[_0x9c02('0x13')](0x0,-0x1)[_0x9c02('0x14')]('\x20'):_0x30fc9c['name'];}return _0x9c02('0x15');}function getLastName(_0x2d7d32){var _0x30677e=_['head'](_0x2d7d32['value']);if(_0x30677e&&_0x30677e[_0x9c02('0xf')]){var _0x26735e=_0x30677e[_0x9c02('0xf')][_0x9c02('0x12')](/\s+/);return _0x26735e['length']>0x1?_0x26735e[_0x9c02('0x16')]():'';}return'';}function getMails(_0x38602c,_0xa6f21e){var _0x729f45='';for(var _0x134cab=0x0;_0x134cab<_0xa6f21e['value'][_0x9c02('0x17')];_0x134cab+=0x1){if(_0xa6f21e[_0x9c02('0xa')][_0x134cab][_0x9c02('0xb')]!==_0x38602c){if(!_[_0x9c02('0x18')](_0x729f45)){_0x729f45+=',';}_0x729f45+=_0xa6f21e[_0x9c02('0xa')][_0x134cab][_0x9c02('0xf')]||_0xa6f21e['value'][_0x134cab][_0x9c02('0xb')]||'';_0x729f45+='\x20<';_0x729f45+=_0xa6f21e[_0x9c02('0xa')][_0x134cab][_0x9c02('0xb')]?_0xa6f21e[_0x9c02('0xa')][_0x134cab][_0x9c02('0xb')]:_0x9c02('0xc')+random[_0x9c02('0xd')](0x6)+_0x9c02('0xe');_0x729f45+='>';}}return _0x729f45;}function parseEmail(_0x314275,_0x5a2097,_0x54fdf4){if(_0x5a2097['html']){var _0x2c5a9c=/