From ae263337477e8df9f846663f7f1890c2f44ff69f Mon Sep 17 00:00:00 2001
From: Andrea Bianco
Date: Fri, 26 Nov 2021 00:28:46 +0100
Subject: [PATCH] Built motion from commit 82bb2304.|2.5.39
---
apidoc/api_project.js | 2 +-
apidoc/api_project.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 +-
1156 files changed, 1156 insertions(+), 1156 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 2334198..f713f46 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-11-22T22:49:29.449Z",
+ "time": "2021-11-25T23:22:09.766Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 4dbb209..2decd9c 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-11-22T22:49:29.449Z",
+ "time": "2021-11-25T23:22:09.766Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index f024053..f738d41 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 _0xb8d9=['STRING','contactManager','integration','motionbar','jscripty','bot','script','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[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','exports','VIRTUAL','getDataValue','action'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0xb8d9,0x175));var _0x9b8d=function(_0x7f6a19,_0x4e1ec7){_0x7f6a19=_0x7f6a19-0x0;var _0x3a995b=_0xb8d9[_0x7f6a19];return _0x3a995b;};'use strict';var Sequelize=require(_0x9b8d('0x0'));module[_0x9b8d('0x1')]={'name':{'type':Sequelize[_0x9b8d('0x2')],'get':function(_0x2e174c){return this[_0x9b8d('0x3')](_0x9b8d('0x4'));}},'action':{'type':Sequelize[_0x9b8d('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9b8d('0x6'),_0x9b8d('0x7'),_0x9b8d('0x8'),_0x9b8d('0x9'),'urlForward','browser',_0x9b8d('0xa'),_0x9b8d('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x9b8d('0x5')](0x1000),'comment':_0x9b8d('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x9b8d('0xd')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x9b8d('0xe')},'data6':{'type':Sequelize[_0x9b8d('0x5')],'comments':_0x9b8d('0xf')},'data7':{'type':Sequelize[_0x9b8d('0x10')],'comments':_0x9b8d('0x11')}};
\ No newline at end of file
+var _0xf901=['exports','action','contactManager','motionbar','jscripty','browser','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)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize'];(function(_0x3b929b,_0x12eb50){var _0x2592a9=function(_0x5254e7){while(--_0x5254e7){_0x3b929b['push'](_0x3b929b['shift']());}};_0x2592a9(++_0x12eb50);}(_0xf901,0xa4));var _0x1f90=function(_0x57a43f,_0x2bde86){_0x57a43f=_0x57a43f-0x0;var _0x4a51a2=_0xf901[_0x57a43f];return _0x4a51a2;};'use strict';var Sequelize=require(_0x1f90('0x0'));module[_0x1f90('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f5c51){return this['getDataValue'](_0x1f90('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x1f90('0x3'),'integration',_0x1f90('0x4'),_0x1f90('0x5'),'urlForward',_0x1f90('0x6'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x1f90('0x7')](0x1000),'comment':_0x1f90('0x8')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x1f90('0x9')},'data3':{'type':Sequelize[_0x1f90('0x7')](0x1000),'comment':_0x1f90('0xa')},'data4':{'type':Sequelize[_0x1f90('0x7')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x1f90('0xb')},'data6':{'type':Sequelize[_0x1f90('0x7')],'comments':_0x1f90('0xc')},'data7':{'type':Sequelize[_0x1f90('0xd')],'comments':_0x1f90('0xe')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 608a6e0..739ddad 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 _0x84a5=['set','Content-Range','apply','reject','save','update','then','destroy','stack','name','body','Action','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count'];(function(_0x1399d6,_0x2c1661){var _0x4a9db4=function(_0x4666b8){while(--_0x4666b8){_0x1399d6['push'](_0x1399d6['shift']());}};_0x4a9db4(++_0x2c1661);}(_0x84a5,0x16e));var _0x584a=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x84a5[_0x7e2eb0];return _0xd92de4;};'use strict';var emlformat=require(_0x584a('0x0'));var rimraf=require(_0x584a('0x1'));var zipdir=require(_0x584a('0x2'));var jsonpatch=require(_0x584a('0x3'));var rp=require('request-promise');var moment=require(_0x584a('0x4'));var BPromise=require(_0x584a('0x5'));var Mustache=require(_0x584a('0x6'));var util=require(_0x584a('0x7'));var path=require(_0x584a('0x8'));var sox=require(_0x584a('0x9'));var csv=require(_0x584a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x584a('0xb'));var _=require(_0x584a('0xc'));var squel=require(_0x584a('0xd'));var crypto=require(_0x584a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x584a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x584a('0x10'));var Papa=require(_0x584a('0x11'));var Redis=require(_0x584a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x584a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x584a('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x584a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x584a('0x16'));var db=require(_0x584a('0x17'))['db'];function respondWithStatusCode(_0x2a8c95,_0x2bcbe5){_0x2bcbe5=_0x2bcbe5||0xcc;return function(_0x2ebbcc){if(_0x2ebbcc){return _0x2a8c95[_0x584a('0x18')](_0x2bcbe5);}return _0x2a8c95[_0x584a('0x19')](_0x2bcbe5)[_0x584a('0x1a')]();};}function respondWithResult(_0xd7fc0d,_0x190114){_0x190114=_0x190114||0xc8;return function(_0x405806){if(_0x405806){return _0xd7fc0d[_0x584a('0x19')](_0x190114)[_0x584a('0x1b')](_0x405806);}};}function respondWithFilteredResult(_0x309603,_0x385e21){return function(_0x43e071){if(_0x43e071){var _0x47ca43=typeof _0x385e21['offset']===_0x584a('0x1c')&&typeof _0x385e21['limit']===_0x584a('0x1c');var _0x146442=_0x43e071[_0x584a('0x1d')];var _0x127b57=_0x47ca43?0x0:_0x385e21['offset'];var _0x4df604=_0x47ca43?_0x43e071[_0x584a('0x1d')]:_0x385e21['offset']+_0x385e21['limit'];var _0x211f70;if(_0x4df604>=_0x146442){_0x4df604=_0x146442;_0x211f70=0xc8;}else{_0x211f70=0xce;}_0x309603['status'](_0x211f70);return _0x309603[_0x584a('0x1e')](_0x584a('0x1f'),_0x127b57+'-'+_0x4df604+'/'+_0x146442)[_0x584a('0x1b')](_0x43e071);}return null;};}function patchUpdates(_0x1e690b){return function(_0x2de9b9){try{jsonpatch[_0x584a('0x20')](_0x2de9b9,_0x1e690b,!![]);}catch(_0x930798){return BPromise[_0x584a('0x21')](_0x930798);}return _0x2de9b9[_0x584a('0x22')]();};}function saveUpdates(_0x28807d,_0x1b39dd){return function(_0x3c1feb){if(_0x3c1feb){return _0x3c1feb[_0x584a('0x23')](_0x28807d)[_0x584a('0x24')](function(_0x41a743){return _0x41a743;});}return null;};}function removeEntity(_0x474753,_0x4f17f1){return function(_0x1d2a8d){if(_0x1d2a8d){return _0x1d2a8d[_0x584a('0x25')]()[_0x584a('0x24')](function(){_0x474753[_0x584a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d0d45,_0x457d08){return function(_0xf301f5){if(!_0xf301f5){_0x3d0d45[_0x584a('0x18')](0x194);}return _0xf301f5;};}function handleError(_0x58e09e,_0x29e1c8){_0x29e1c8=_0x29e1c8||0x1f4;return function(_0xb7534b){logger['error'](_0xb7534b[_0x584a('0x26')]);if(_0xb7534b[_0x584a('0x27')]){delete _0xb7534b[_0x584a('0x27')];}_0x58e09e[_0x584a('0x19')](_0x29e1c8)['send'](_0xb7534b);};}exports['update']=function(_0x393ffe,_0x3e6eca){if(_0x393ffe[_0x584a('0x28')]['id']){delete _0x393ffe[_0x584a('0x28')]['id'];}return db[_0x584a('0x29')]['find']({'where':{'id':_0x393ffe[_0x584a('0x2a')]['id']}})[_0x584a('0x24')](handleEntityNotFound(_0x3e6eca,null))[_0x584a('0x24')](saveUpdates(_0x393ffe['body'],null))['then'](respondWithResult(_0x3e6eca,null))[_0x584a('0x2b')](handleError(_0x3e6eca,null));};exports[_0x584a('0x25')]=function(_0x31c620,_0x47cac0){return db[_0x584a('0x29')]['find']({'where':{'id':_0x31c620[_0x584a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x47cac0,null))[_0x584a('0x24')](removeEntity(_0x47cac0,null))[_0x584a('0x2b')](handleError(_0x47cac0,null));};
\ No newline at end of file
+var _0x7722=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','update','destroy','then','end','name','send','Action','find','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel'];(function(_0x27c9a8,_0x1fe732){var _0x6666e8=function(_0x4c09cf){while(--_0x4c09cf){_0x27c9a8['push'](_0x27c9a8['shift']());}};_0x6666e8(++_0x1fe732);}(_0x7722,0x1cf));var _0x2772=function(_0x4c5ec3,_0x2f88ed){_0x4c5ec3=_0x4c5ec3-0x0;var _0x53d432=_0x7722[_0x4c5ec3];return _0x53d432;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2772('0x0'));var zipdir=require(_0x2772('0x1'));var jsonpatch=require(_0x2772('0x2'));var rp=require(_0x2772('0x3'));var moment=require(_0x2772('0x4'));var BPromise=require(_0x2772('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2772('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2772('0x7'));var _=require(_0x2772('0x8'));var squel=require(_0x2772('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2772('0xa'));var toCsv=require(_0x2772('0xb'));var querystring=require(_0x2772('0xc'));var Papa=require(_0x2772('0xd'));var Redis=require(_0x2772('0xe'));var authService=require(_0x2772('0xf'));var qs=require(_0x2772('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2772('0x11'));var logger=require(_0x2772('0x12'))(_0x2772('0x13'));var utils=require(_0x2772('0x14'));var config=require(_0x2772('0x15'));var licenseUtil=require(_0x2772('0x16'));var db=require(_0x2772('0x17'))['db'];function respondWithStatusCode(_0x53479e,_0x23bc93){_0x23bc93=_0x23bc93||0xcc;return function(_0x491eb2){if(_0x491eb2){return _0x53479e[_0x2772('0x18')](_0x23bc93);}return _0x53479e['status'](_0x23bc93)['end']();};}function respondWithResult(_0x4b6c37,_0x2da38a){_0x2da38a=_0x2da38a||0xc8;return function(_0x29a4c8){if(_0x29a4c8){return _0x4b6c37[_0x2772('0x19')](_0x2da38a)[_0x2772('0x1a')](_0x29a4c8);}};}function respondWithFilteredResult(_0x52718d,_0xaed3cf){return function(_0x3a3e8b){if(_0x3a3e8b){var _0x48d72e=typeof _0xaed3cf['offset']==='undefined'&&typeof _0xaed3cf[_0x2772('0x1b')]===_0x2772('0x1c');var _0x2e59ad=_0x3a3e8b[_0x2772('0x1d')];var _0x39b455=_0x48d72e?0x0:_0xaed3cf[_0x2772('0x1e')];var _0xc1f23b=_0x48d72e?_0x3a3e8b[_0x2772('0x1d')]:_0xaed3cf[_0x2772('0x1e')]+_0xaed3cf['limit'];var _0x331faf;if(_0xc1f23b>=_0x2e59ad){_0xc1f23b=_0x2e59ad;_0x331faf=0xc8;}else{_0x331faf=0xce;}_0x52718d[_0x2772('0x19')](_0x331faf);return _0x52718d['set'](_0x2772('0x1f'),_0x39b455+'-'+_0xc1f23b+'/'+_0x2e59ad)[_0x2772('0x1a')](_0x3a3e8b);}return null;};}function patchUpdates(_0x47b115){return function(_0x503b3a){try{jsonpatch['apply'](_0x503b3a,_0x47b115,!![]);}catch(_0x51eafa){return BPromise[_0x2772('0x20')](_0x51eafa);}return _0x503b3a['save']();};}function saveUpdates(_0x54fca4,_0x5c16fb){return function(_0x296e8e){if(_0x296e8e){return _0x296e8e[_0x2772('0x21')](_0x54fca4)['then'](function(_0x394af8){return _0x394af8;});}return null;};}function removeEntity(_0x359d2f,_0x571512){return function(_0x52f41d){if(_0x52f41d){return _0x52f41d[_0x2772('0x22')]()[_0x2772('0x23')](function(){_0x359d2f[_0x2772('0x19')](0xcc)[_0x2772('0x24')]();});}};}function handleEntityNotFound(_0xa88ae7,_0xca3c99){return function(_0x229a71){if(!_0x229a71){_0xa88ae7[_0x2772('0x18')](0x194);}return _0x229a71;};}function handleError(_0x51982,_0x47b7af){_0x47b7af=_0x47b7af||0x1f4;return function(_0x1e78e7){logger['error'](_0x1e78e7['stack']);if(_0x1e78e7[_0x2772('0x25')]){delete _0x1e78e7['name'];}_0x51982[_0x2772('0x19')](_0x47b7af)[_0x2772('0x26')](_0x1e78e7);};}exports['update']=function(_0x320146,_0x57f6fb){if(_0x320146['body']['id']){delete _0x320146['body']['id'];}return db[_0x2772('0x27')][_0x2772('0x28')]({'where':{'id':_0x320146[_0x2772('0x29')]['id']}})[_0x2772('0x23')](handleEntityNotFound(_0x57f6fb,null))[_0x2772('0x23')](saveUpdates(_0x320146['body'],null))[_0x2772('0x23')](respondWithResult(_0x57f6fb,null))[_0x2772('0x2a')](handleError(_0x57f6fb,null));};exports[_0x2772('0x22')]=function(_0x1e5425,_0x3a817d){return db[_0x2772('0x27')][_0x2772('0x28')]({'where':{'id':_0x1e5425[_0x2772('0x29')]['id']}})[_0x2772('0x23')](handleEntityNotFound(_0x3a817d,null))[_0x2772('0x23')](removeEntity(_0x3a817d,null))[_0x2772('0x2a')](handleError(_0x3a817d,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index df55594..6aa2052 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 _0xd3be=['request-promise','rimraf','../../config/environment','./action.attributes','tools_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xd3be,0x195));var _0xed3b=function(_0x38fb45,_0x2e9de8){_0x38fb45=_0x38fb45-0x0;var _0x14b7de=_0xd3be[_0x38fb45];return _0x14b7de;};'use strict';var _=require('lodash');var util=require(_0xed3b('0x0'));var logger=require(_0xed3b('0x1'))(_0xed3b('0x2'));var moment=require(_0xed3b('0x3'));var BPromise=require(_0xed3b('0x4'));var rp=require(_0xed3b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed3b('0x6'));var config=require(_0xed3b('0x7'));var attributes=require(_0xed3b('0x8'));module['exports']=function(_0x511353,_0x4fcdc5){return _0x511353['define']('Action',attributes,{'tableName':_0xed3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x10aa=['tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0xcfdcc,_0x530128){var _0x2bd084=function(_0x244591){while(--_0x244591){_0xcfdcc['push'](_0xcfdcc['shift']());}};_0x2bd084(++_0x530128);}(_0x10aa,0x14b));var _0xa10a=function(_0x4c672a,_0x560653){_0x4c672a=_0x4c672a-0x0;var _0x2c8ad7=_0x10aa[_0x4c672a];return _0x2c8ad7;};'use strict';var _=require(_0xa10a('0x0'));var util=require(_0xa10a('0x1'));var logger=require(_0xa10a('0x2'))(_0xa10a('0x3'));var moment=require(_0xa10a('0x4'));var BPromise=require(_0xa10a('0x5'));var rp=require(_0xa10a('0x6'));var fs=require('fs');var path=require(_0xa10a('0x7'));var rimraf=require(_0xa10a('0x8'));var config=require(_0xa10a('0x9'));var attributes=require(_0xa10a('0xa'));module[_0xa10a('0xb')]=function(_0x147a35,_0xe3e13a){return _0x147a35[_0xa10a('0xc')](_0xa10a('0xd'),attributes,{'tableName':_0xa10a('0xe'),'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 d9cef5d..2cebb8c 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x37d8d8,_0x36fe2a){var _0x53b10a=function(_0x49b197){while(--_0x49b197){_0x37d8d8['push'](_0x37d8d8['shift']());}};_0x53b10a(++_0x36fe2a);}(_0xabce,0x103));var _0xeabc=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xabce[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7217,0x19e));var _0x7721=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x7217[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Action,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index d85a942..f8fcb4e 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 _0xff69=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xff69,0x16c));var _0x9ff6=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xff69[_0x19b84f];return _0x18067b;};'use strict';var multer=require('multer');var util=require(_0x9ff6('0x0'));var path=require(_0x9ff6('0x1'));var timeout=require(_0x9ff6('0x2'));var express=require('express');var router=express[_0x9ff6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9ff6('0x4'));var interaction=require(_0x9ff6('0x5'));var config=require(_0x9ff6('0x6'));var controller=require('./action.controller');router[_0x9ff6('0x7')](_0x9ff6('0x8'),auth[_0x9ff6('0x9')](),controller[_0x9ff6('0xa')]);router[_0x9ff6('0xb')]('/:id',auth[_0x9ff6('0x9')](),controller[_0x9ff6('0xc')]);module[_0x9ff6('0xd')]=router;
\ No newline at end of file
+var _0xd3df=['Router','fs-extra','../../components/interaction/service','./action.controller','put','isAuthenticated','/:id','destroy','exports','multer','path'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xd3df,0x1ed));var _0xfd3d=function(_0xc5a490,_0x217ba9){_0xc5a490=_0xc5a490-0x0;var _0x20e3e5=_0xd3df[_0xc5a490];return _0x20e3e5;};'use strict';var multer=require(_0xfd3d('0x0'));var util=require('util');var path=require(_0xfd3d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfd3d('0x2')]();var fs_extra=require(_0xfd3d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd3d('0x4'));var config=require('../../config/environment');var controller=require(_0xfd3d('0x5'));router[_0xfd3d('0x6')]('/:id',auth[_0xfd3d('0x7')](),controller['update']);router['delete'](_0xfd3d('0x8'),auth['isAuthenticated'](),controller[_0xfd3d('0x9')]);module[_0xfd3d('0xa')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 22d5872..845e3ab 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 _0x8958=['TEXT','exports'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0x8958,0x93));var _0x8895=function(_0x38b0a1,_0x29da11){_0x38b0a1=_0x38b0a1-0x0;var _0x27d217=_0x8958[_0x38b0a1];return _0x27d217;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xbd51=['sequelize','STRING'];(function(_0xda6d0f,_0x35e271){var _0x244540=function(_0x30f643){while(--_0x30f643){_0xda6d0f['push'](_0xda6d0f['shift']());}};_0x244540(++_0x35e271);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x4b3358,_0x526165){_0x4b3358=_0x4b3358-0x0;var _0x4be311=_0xbd51[_0x4b3358];return _0x4be311;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index f600a85..b9ba1ac 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 _0xcc1f=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','params','preview','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','metric','field','replace','format','groupBy','DESC','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','function','orderBy','web','fullPath','%s-%s.%s','randomstring','generate','output','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','savename','countTable','COUNT(*)','SELECT','run','runReport','HOUR(%s)','IS\x20EMPTY','rimraf','zip-dir','fast-json-patch','moment','bluebird','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','CustomReports','UserProfileResource','error','stack','map','AnalyticCustomReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x530c53,_0x546020){var _0x5408ca=function(_0x1de646){while(--_0x1de646){_0x530c53['push'](_0x530c53['shift']());}};_0x5408ca(++_0x546020);}(_0xcc1f,0x1b8));var _0xfcc1=function(_0x40aa42,_0x1e6c0c){_0x40aa42=_0x40aa42-0x0;var _0x5391e4=_0xcc1f[_0x40aa42];return _0x5391e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcc1('0x0'));var zipdir=require(_0xfcc1('0x1'));var jsonpatch=require(_0xfcc1('0x2'));var rp=require('request-promise');var moment=require(_0xfcc1('0x3'));var BPromise=require(_0xfcc1('0x4'));var Mustache=require('mustache');var util=require(_0xfcc1('0x5'));var path=require(_0xfcc1('0x6'));var sox=require(_0xfcc1('0x7'));var csv=require(_0xfcc1('0x8'));var ejs=require(_0xfcc1('0x9'));var fs=require('fs');var fs_extra=require(_0xfcc1('0xa'));var _=require(_0xfcc1('0xb'));var squel=require(_0xfcc1('0xc'));var crypto=require(_0xfcc1('0xd'));var jsforce=require(_0xfcc1('0xe'));var deskjs=require(_0xfcc1('0xf'));var toCsv=require(_0xfcc1('0x8'));var querystring=require(_0xfcc1('0x10'));var Papa=require(_0xfcc1('0x11'));var Redis=require(_0xfcc1('0x12'));var authService=require(_0xfcc1('0x13'));var qs=require(_0xfcc1('0x14'));var as=require(_0xfcc1('0x15'));var hardwareService=require(_0xfcc1('0x16'));var logger=require(_0xfcc1('0x17'))(_0xfcc1('0x18'));var utils=require(_0xfcc1('0x19'));var config=require(_0xfcc1('0x1a'));var licenseUtil=require(_0xfcc1('0x1b'));var db=require('../../mysqldb')['db'];var dbH=require(_0xfcc1('0x1c'))[_0xfcc1('0x1d')];function respondWithStatusCode(_0x15bc45,_0x3b2c2b){_0x3b2c2b=_0x3b2c2b||0xcc;return function(_0x18b3fe){if(_0x18b3fe){return _0x15bc45[_0xfcc1('0x1e')](_0x3b2c2b);}return _0x15bc45[_0xfcc1('0x1f')](_0x3b2c2b)[_0xfcc1('0x20')]();};}function respondWithResult(_0x131024,_0x29aac9){_0x29aac9=_0x29aac9||0xc8;return function(_0x52698c){if(_0x52698c){return _0x131024[_0xfcc1('0x1f')](_0x29aac9)[_0xfcc1('0x21')](_0x52698c);}};}function respondWithFilteredResult(_0x10eb6d,_0x3d0410){return function(_0x686c0e){if(_0x686c0e){var _0xcba70=typeof _0x3d0410[_0xfcc1('0x22')]===_0xfcc1('0x23')&&typeof _0x3d0410[_0xfcc1('0x24')]===_0xfcc1('0x23');var _0x3730ff=_0x686c0e[_0xfcc1('0x25')];var _0x4f1cad=_0xcba70?0x0:_0x3d0410[_0xfcc1('0x22')];var _0x31fdf7=_0xcba70?_0x686c0e['count']:_0x3d0410[_0xfcc1('0x22')]+_0x3d0410['limit'];var _0x5e6326;if(_0x31fdf7>=_0x3730ff){_0x31fdf7=_0x3730ff;_0x5e6326=0xc8;}else{_0x5e6326=0xce;}_0x10eb6d[_0xfcc1('0x1f')](_0x5e6326);return _0x10eb6d['set'](_0xfcc1('0x26'),_0x4f1cad+'-'+_0x31fdf7+'/'+_0x3730ff)['json'](_0x686c0e);}return null;};}function patchUpdates(_0x5209c5){return function(_0x127538){try{jsonpatch[_0xfcc1('0x27')](_0x127538,_0x5209c5,!![]);}catch(_0x4b01cb){return BPromise[_0xfcc1('0x28')](_0x4b01cb);}return _0x127538[_0xfcc1('0x29')]();};}function saveUpdates(_0x378139,_0x3e88f1){return function(_0x259e9d){if(_0x259e9d){return _0x259e9d['update'](_0x378139)[_0xfcc1('0x2a')](function(_0x55e433){return _0x55e433;});}return null;};}function removeEntity(_0x24344f,_0x11c925){return function(_0x1d89ae){if(_0x1d89ae){return _0x1d89ae['destroy']()[_0xfcc1('0x2a')](function(){var _0x54a7f0=_0x1d89ae[_0xfcc1('0x2b')]({'plain':!![]});var _0x5f0aaa=_0xfcc1('0x2c');return db[_0xfcc1('0x2d')]['destroy']({'where':{'type':_0x5f0aaa,'resourceId':_0x54a7f0['id']}})['then'](function(){return _0x1d89ae;});})['then'](function(){_0x24344f[_0xfcc1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x394941,_0x940a7b){return function(_0x44360a){if(!_0x44360a){_0x394941[_0xfcc1('0x1e')](0x194);}return _0x44360a;};}function handleError(_0x2c4375,_0x5ab54e){_0x5ab54e=_0x5ab54e||0x1f4;return function(_0x15b2df){logger[_0xfcc1('0x2e')](_0x15b2df[_0xfcc1('0x2f')]);if(_0x15b2df['name']){delete _0x15b2df['name'];}_0x2c4375['status'](_0x5ab54e)['send'](_0x15b2df);};}exports['index']=function(_0x491aa7,_0x3e83af){var _0x40a3fb={},_0x3096ea={},_0x55fca1={'count':0x0,'rows':[]};var _0x4cc34c=_[_0xfcc1('0x30')](db[_0xfcc1('0x31')][_0xfcc1('0x32')],function(_0x5874ae){return{'name':_0x5874ae[_0xfcc1('0x33')],'type':_0x5874ae['type'][_0xfcc1('0x34')]};});_0x3096ea[_0xfcc1('0x35')]=_[_0xfcc1('0x30')](_0x4cc34c,_0xfcc1('0x36'));_0x3096ea[_0xfcc1('0x37')]=_[_0xfcc1('0x38')](_0x491aa7[_0xfcc1('0x37')]);_0x3096ea[_0xfcc1('0x39')]=_[_0xfcc1('0x3a')](_0x3096ea[_0xfcc1('0x35')],_0x3096ea[_0xfcc1('0x37')]);_0x40a3fb[_0xfcc1('0x3b')]=_[_0xfcc1('0x3a')](_0x3096ea[_0xfcc1('0x35')],qs[_0xfcc1('0x3c')](_0x491aa7[_0xfcc1('0x37')]['fields']));_0x40a3fb['attributes']=_0x40a3fb[_0xfcc1('0x3b')][_0xfcc1('0x3d')]?_0x40a3fb[_0xfcc1('0x3b')]:_0x3096ea['model'];if(!_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x3e')](_0xfcc1('0x3f'))){_0x40a3fb[_0xfcc1('0x24')]=qs[_0xfcc1('0x24')](_0x491aa7['query'][_0xfcc1('0x24')]);_0x40a3fb[_0xfcc1('0x22')]=qs[_0xfcc1('0x22')](_0x491aa7['query']['offset']);}_0x40a3fb[_0xfcc1('0x40')]=qs[_0xfcc1('0x41')](_0x491aa7['query'][_0xfcc1('0x41')]);_0x40a3fb[_0xfcc1('0x42')]=qs['filters'](_['pick'](_0x491aa7[_0xfcc1('0x37')],_0x3096ea['filters']),_0x4cc34c);if(_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x43')]){_0x40a3fb[_0xfcc1('0x42')]=_[_0xfcc1('0x44')](_0x40a3fb[_0xfcc1('0x42')],{'$or':_[_0xfcc1('0x30')](_0x4cc34c,function(_0x383490){if(_0x383490[_0xfcc1('0x45')]!==_0xfcc1('0x46')){var _0x408b1d={};_0x408b1d[_0x383490[_0xfcc1('0x36')]]={'$like':'%'+_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x43')]+'%'};return _0x408b1d;}})});}_0x40a3fb=_[_0xfcc1('0x44')]({},_0x40a3fb,_0x491aa7[_0xfcc1('0x47')]);var _0x4ec3ce={'where':_0x40a3fb[_0xfcc1('0x42')]};return db[_0xfcc1('0x31')]['count'](_0x4ec3ce)[_0xfcc1('0x2a')](function(_0x51ea33){_0x55fca1['count']=_0x51ea33;if(_0x491aa7[_0xfcc1('0x37')][_0xfcc1('0x48')]){_0x40a3fb[_0xfcc1('0x49')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xfcc1('0x4a')](_0x40a3fb);})[_0xfcc1('0x2a')](function(_0x3c31ff){_0x55fca1[_0xfcc1('0x4b')]=_0x3c31ff;return _0x55fca1;})[_0xfcc1('0x2a')](respondWithFilteredResult(_0x3e83af,_0x40a3fb))[_0xfcc1('0x4c')](handleError(_0x3e83af,null));};exports[_0xfcc1('0x4d')]=function(_0x18fe03,_0x4da709){var _0x11524d={'raw':![],'where':{'id':_0x18fe03['params']['id']}},_0xffa833={};_0xffa833[_0xfcc1('0x35')]=_['keys'](db[_0xfcc1('0x31')]['rawAttributes']);_0xffa833[_0xfcc1('0x37')]=_['keys'](_0x18fe03['query']);_0xffa833['filters']=_[_0xfcc1('0x3a')](_0xffa833[_0xfcc1('0x35')],_0xffa833[_0xfcc1('0x37')]);_0x11524d[_0xfcc1('0x3b')]=_[_0xfcc1('0x3a')](_0xffa833[_0xfcc1('0x35')],qs[_0xfcc1('0x3c')](_0x18fe03[_0xfcc1('0x37')][_0xfcc1('0x3c')]));_0x11524d['attributes']=_0x11524d[_0xfcc1('0x3b')][_0xfcc1('0x3d')]?_0x11524d[_0xfcc1('0x3b')]:_0xffa833[_0xfcc1('0x35')];if(_0x18fe03[_0xfcc1('0x37')]['includeAll']){_0x11524d[_0xfcc1('0x49')]=[{'all':!![]}];}_0x11524d=_[_0xfcc1('0x44')]({},_0x11524d,_0x18fe03[_0xfcc1('0x47')]);return db[_0xfcc1('0x31')][_0xfcc1('0x4e')](_0x11524d)['then'](handleEntityNotFound(_0x4da709,null))[_0xfcc1('0x2a')](respondWithResult(_0x4da709,null))['catch'](handleError(_0x4da709,null));};exports[_0xfcc1('0x4f')]=function(_0x2ab082,_0x281e7b){return db['AnalyticCustomReport'][_0xfcc1('0x4f')](_0x2ab082[_0xfcc1('0x50')],{})[_0xfcc1('0x2a')](function(_0x283001){var _0x84b826=_0x2ab082[_0xfcc1('0x51')]['get']({'plain':!![]});if(!_0x84b826)throw new Error(_0xfcc1('0x52'));if(_0x84b826[_0xfcc1('0x53')]===_0xfcc1('0x51')){var _0x2fcd30=_0x283001[_0xfcc1('0x2b')]({'plain':!![]});var _0x4c654d=_0xfcc1('0x54');return db[_0xfcc1('0x55')][_0xfcc1('0x4e')]({'where':{'name':_0x4c654d,'userProfileId':_0x84b826[_0xfcc1('0x56')]},'raw':!![]})[_0xfcc1('0x2a')](function(_0x14684a){if(_0x14684a&&_0x14684a[_0xfcc1('0x57')]===0x0){return db[_0xfcc1('0x2d')][_0xfcc1('0x4f')]({'name':_0x2fcd30[_0xfcc1('0x36')],'resourceId':_0x2fcd30['id'],'type':'CustomReports','sectionId':_0x14684a['id']},{})[_0xfcc1('0x2a')](function(){return _0x283001;});}else{return _0x283001;}})[_0xfcc1('0x4c')](function(_0x371d4e){logger[_0xfcc1('0x2e')](_0xfcc1('0x58'),_0x371d4e);throw _0x371d4e;});}return _0x283001;})[_0xfcc1('0x2a')](respondWithResult(_0x281e7b,0xc9))[_0xfcc1('0x4c')](handleError(_0x281e7b,null));};exports[_0xfcc1('0x59')]=function(_0x344754,_0x4f647a){if(_0x344754[_0xfcc1('0x50')]['id']){delete _0x344754['body']['id'];}return db['AnalyticCustomReport'][_0xfcc1('0x4e')]({'where':{'id':_0x344754['params']['id']}})['then'](handleEntityNotFound(_0x4f647a,null))['then'](saveUpdates(_0x344754[_0xfcc1('0x50')],null))[_0xfcc1('0x2a')](respondWithResult(_0x4f647a,null))[_0xfcc1('0x4c')](handleError(_0x4f647a,null));};exports[_0xfcc1('0x5a')]=function(_0x2319d9,_0x1c905a){return db[_0xfcc1('0x31')][_0xfcc1('0x4e')]({'where':{'id':_0x2319d9[_0xfcc1('0x5b')]['id']}})[_0xfcc1('0x2a')](handleEntityNotFound(_0x1c905a,null))[_0xfcc1('0x2a')](removeEntity(_0x1c905a,null))[_0xfcc1('0x4c')](handleError(_0x1c905a,null));};exports[_0xfcc1('0x5c')]=function(_0x4ad1e4,_0x29680a){var _0x49696=0xa;var _0x21739c=['join',_0xfcc1('0x5d'),_0xfcc1('0x5e'),'cross_join'];var _0x58785d={'SUM':_0xfcc1('0x5f'),'COUNT':_0xfcc1('0x60'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfcc1('0x61'),'MIN':_0xfcc1('0x62'),'AVG':_0xfcc1('0x63'),'GROUP_CONCAT':_0xfcc1('0x64'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfcc1('0x65')};var _0x4f5d77={'SEC_TO_TIME':_0xfcc1('0x66'),'DATE':_0xfcc1('0x67'),'HOUR':'HOUR(%s)','ROUND':_0xfcc1('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5b418a=function(_0x5d5470){return!_[_0xfcc1('0x69')]([_0xfcc1('0x6a'),_0xfcc1('0x6b'),'IS\x20EMPTY',_0xfcc1('0x6c')],_0x5d5470);};var _0x179362=function(_0x3a6419){if(!_0x3a6419||!_0x3a6419[_0xfcc1('0x6d')][_0xfcc1('0x3d')]){return'';}for(var _0x4237a0='(',_0x368ad1=0x0;_0x368ad1<_0x3a6419[_0xfcc1('0x6d')][_0xfcc1('0x3d')];_0x368ad1+=0x1){_0x368ad1>0x0&&(_0x4237a0+='\x20'+_0x3a6419[_0xfcc1('0x6e')]+'\x20');_0x4237a0+=_0x3a6419['rules'][_0x368ad1][_0xfcc1('0x6f')]?_0x179362(_0x3a6419[_0xfcc1('0x6d')][_0x368ad1][_0xfcc1('0x6f')]):_0x3a6419[_0xfcc1('0x6d')][_0x368ad1]['field']+'\x20'+_0x3a6419[_0xfcc1('0x6d')][_0x368ad1]['condition']+(_0x5b418a(_0x3a6419['rules'][_0x368ad1][_0xfcc1('0x70')])?'\x20'+_0x3a6419[_0xfcc1('0x6d')][_0x368ad1][_0xfcc1('0x71')]:'');}return _0x4237a0+')';};var _0x42b7e9={'where':{'id':_0x4ad1e4[_0xfcc1('0x5b')]['id']}},_0x15f714,_0x40a4e2,_0x40f66c,_0xdc8413,_0x24528b;_0x42b7e9=_['merge']({},_0x42b7e9,_0x4ad1e4[_0xfcc1('0x47')]);return db[_0xfcc1('0x31')]['find'](_0x42b7e9)[_0xfcc1('0x2a')](function(_0x32bb66){if(_0x32bb66){_0x15f714=_0x32bb66;return _0x32bb66['getFields']();}return null;})[_0xfcc1('0x2a')](function(_0x441032){if(_0x441032){if(!_0x441032[_0xfcc1('0x3d')]){throw new db[(_0xfcc1('0x72'))][(_0xfcc1('0x73'))](_0xfcc1('0x74'),0x193);}_0x40a4e2=_0x441032;return db[_0xfcc1('0x75')]['findAll']({'raw':!![]});}return null;})[_0xfcc1('0x2a')](function(_0x1c1675){if(_0x1c1675){_0x40f66c=_['keyBy'](_0x1c1675,'id');var _0x1e4927;var _0x1b937a=squel[_0xfcc1('0x76')]();_0x1b937a[_0xfcc1('0x77')](_0x15f714[_0xfcc1('0x78')]);for(var _0xee713e=0x0;_0xee713e<_0x40a4e2[_0xfcc1('0x3d')];_0xee713e+=0x1){_0x1e4927=_0x40a4e2[_0xee713e][_0xfcc1('0x79')]?_0x40f66c[_0x40a4e2[_0xee713e]['MetricId']][_0xfcc1('0x7a')]:_0x40a4e2[_0xee713e][_0xfcc1('0x7b')];_0x1e4927=_0x40a4e2[_0xee713e]['function']?_[_0xfcc1('0x7c')](_0x58785d[_0x40a4e2[_0xee713e]['function']],'%s',_0x1e4927):_0x1e4927;_0x1e4927=_0x40a4e2[_0xee713e][_0xfcc1('0x7d')]?_[_0xfcc1('0x7c')](_0x4f5d77[_0x40a4e2[_0xee713e][_0xfcc1('0x7d')]],'%s',_0x1e4927):_0x1e4927;if(_0x40a4e2[_0xee713e][_0xfcc1('0x7e')]){_0x1b937a[_0xfcc1('0x6f')](_0x1e4927);}_0x40a4e2[_0xee713e]['orderBy']&&_0x1b937a['order'](_0x1e4927,_0x40a4e2[_0xee713e]['orderBy']===_0xfcc1('0x7f')?![]:!![]);_0x1b937a[_0xfcc1('0x7b')](_0x1e4927,_0x40a4e2[_0xee713e]['alias']||_0x1e4927);}if(_0x15f714[_0xfcc1('0x80')]){_0x15f714[_0xfcc1('0x80')]=JSON[_0xfcc1('0x81')](_0x15f714[_0xfcc1('0x80')]);for(var _0x4b4674=0x0;_0x4b4674<_0x15f714['joins'][_0xfcc1('0x3d')];_0x4b4674+=0x1){if(_0x15f714['joins'][_0x4b4674][_0xfcc1('0x45')]&&_[_0xfcc1('0x69')](_0x21739c,_0x15f714[_0xfcc1('0x80')][_0x4b4674]['type'])&&_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x82')]&&_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x83')]&&_0x15f714[_0xfcc1('0x80')][_0x4b4674]['foreignKey']){_0x1b937a[_0x15f714[_0xfcc1('0x80')][_0x4b4674]['type']](_0x15f714['joins'][_0x4b4674][_0xfcc1('0x83')],null,util['format'](_0xfcc1('0x84'),_0x15f714[_0xfcc1('0x78')],_0x15f714[_0xfcc1('0x80')][_0x4b4674]['parentKey'],_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x83')],_0x15f714[_0xfcc1('0x80')][_0x4b4674][_0xfcc1('0x85')]));}}}if(_0x15f714[_0xfcc1('0x86')]){_0x15f714['conditions']=JSON[_0xfcc1('0x81')](_0x15f714['conditions']);_0x1b937a[_0xfcc1('0x42')](_0x179362(_0x15f714['conditions']['group']));}_0x24528b=_0x1b937a[_0xfcc1('0x87')]();_0x1b937a[_0xfcc1('0x24')](_0x49696);_0x1b937a['offset'](0x0);logger[_0xfcc1('0x88')](_0xfcc1('0x89'),_0x1b937a[_0xfcc1('0x8a')]());return dbH['sequelize'][_0xfcc1('0x37')](_0x1b937a[_0xfcc1('0x8a')](),{'type':dbH[_0xfcc1('0x8b')][_0xfcc1('0x8c')]['SELECT']});}})[_0xfcc1('0x2a')](respondWithResult(_0x29680a,null))[_0xfcc1('0x4c')](handleError(_0x29680a,null));};function runReport(_0x3dc63f,_0x3e40fc,_0x31ba6c){var _0x3e0fd3=_0x3e40fc[_0xfcc1('0x36')];var _0x3eeb67=0xa;var _0xbd2ee3=[_0xfcc1('0x8d'),_0xfcc1('0x5d'),_0xfcc1('0x5e'),_0xfcc1('0x8e')];var _0x4bceeb={'SUM':_0xfcc1('0x5f'),'COUNT':_0xfcc1('0x60'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfcc1('0x61'),'MIN':_0xfcc1('0x62'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfcc1('0x8f'),'GROUP_CONCAT DESC':_0xfcc1('0x65')};var _0x2aafe3={'SEC_TO_TIME':_0xfcc1('0x66'),'DATE':_0xfcc1('0x67'),'HOUR':'HOUR(%s)','ROUND':_0xfcc1('0x68'),'UNIX_TIMESTAMP':_0xfcc1('0x90')};var _0x5e3616=function(_0xe1f176){return!_[_0xfcc1('0x69')]([_0xfcc1('0x6a'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xe1f176);};var _0x5197aa=function(_0x15b70b){if(!_0x15b70b||!_0x15b70b[_0xfcc1('0x6d')][_0xfcc1('0x3d')]){return'';}for(var _0x407304='(',_0x31c5da=0x0;_0x31c5da<_0x15b70b['rules']['length'];_0x31c5da+=0x1){_0x31c5da>0x0&&(_0x407304+='\x20'+_0x15b70b[_0xfcc1('0x6e')]+'\x20');_0x407304+=_0x15b70b[_0xfcc1('0x6d')][_0x31c5da]['group']?_0x5197aa(_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x6f')]):_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x7b')]+'\x20'+_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x70')]+(_0x5e3616(_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x70')])?'\x20'+_0x15b70b[_0xfcc1('0x6d')][_0x31c5da][_0xfcc1('0x71')]:'');}return _0x407304+')';};var _0x237ee1={'where':{'id':_0x3dc63f['id']}},_0x4cba87,_0x3f79ca,_0x4321dd,_0x1e54d8,_0x29aa1a;_0x237ee1=_[_0xfcc1('0x44')]({},_0x237ee1,_0x31ba6c);return db['AnalyticCustomReport'][_0xfcc1('0x4e')](_0x237ee1)['then'](function(_0x162042){if(_0x162042){_0x4cba87=_0x162042;return _0x162042['getFields']();}return null;})['then'](function(_0x4b556a){if(_0x4b556a){if(!_0x4b556a[_0xfcc1('0x3d')]){throw new db[(_0xfcc1('0x72'))][(_0xfcc1('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3f79ca=_0x4b556a;return db[_0xfcc1('0x75')][_0xfcc1('0x4a')]({'raw':!![]});}return null;})[_0xfcc1('0x2a')](function(_0x101741){if(_0x101741){_0x4321dd=_['keyBy'](_0x101741,'id');var _0x52244f;var _0x3c263e=squel[_0xfcc1('0x76')]();_0x3c263e[_0xfcc1('0x77')](_0x4cba87[_0xfcc1('0x78')]);for(var _0x12d744=0x0;_0x12d744<_0x3f79ca[_0xfcc1('0x3d')];_0x12d744+=0x1){_0x52244f=_0x3f79ca[_0x12d744][_0xfcc1('0x79')]?_0x4321dd[_0x3f79ca[_0x12d744][_0xfcc1('0x79')]][_0xfcc1('0x7a')]:_0x3f79ca[_0x12d744][_0xfcc1('0x7b')];_0x52244f=_0x3f79ca[_0x12d744][_0xfcc1('0x91')]?_['replace'](_0x4bceeb[_0x3f79ca[_0x12d744][_0xfcc1('0x91')]],'%s',_0x52244f):_0x52244f;_0x52244f=_0x3f79ca[_0x12d744][_0xfcc1('0x7d')]?_['replace'](_0x2aafe3[_0x3f79ca[_0x12d744][_0xfcc1('0x7d')]],'%s',_0x52244f):_0x52244f;if(_0x3f79ca[_0x12d744][_0xfcc1('0x7e')]){_0x3c263e[_0xfcc1('0x6f')](_0x52244f);}_0x3f79ca[_0x12d744][_0xfcc1('0x92')]&&_0x3c263e[_0xfcc1('0x40')](_0x52244f,_0x3f79ca[_0x12d744][_0xfcc1('0x92')]==='DESC'?![]:!![]);_0x3c263e['field'](_0x52244f,_0x3f79ca[_0x12d744]['alias']||_0x52244f);}if(_0x4cba87[_0xfcc1('0x80')]){_0x4cba87['joins']=JSON[_0xfcc1('0x81')](_0x4cba87[_0xfcc1('0x80')]);for(var _0x1fc59c=0x0;_0x1fc59c<_0x4cba87['joins']['length'];_0x1fc59c+=0x1){if(_0x4cba87[_0xfcc1('0x80')][_0x1fc59c]['type']&&_[_0xfcc1('0x69')](_0xbd2ee3,_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x45')])&&_0x4cba87[_0xfcc1('0x80')][_0x1fc59c]['parentKey']&&_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x83')]&&_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x85')]){_0x3c263e[_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x45')]](_0x4cba87['joins'][_0x1fc59c][_0xfcc1('0x83')],null,util[_0xfcc1('0x7d')](_0xfcc1('0x84'),_0x4cba87[_0xfcc1('0x78')],_0x4cba87['joins'][_0x1fc59c]['parentKey'],_0x4cba87['joins'][_0x1fc59c][_0xfcc1('0x83')],_0x4cba87[_0xfcc1('0x80')][_0x1fc59c][_0xfcc1('0x85')]));}}}if(_0x4cba87[_0xfcc1('0x86')]){_0x4cba87[_0xfcc1('0x86')]=JSON[_0xfcc1('0x81')](_0x4cba87['conditions']);_0x3c263e[_0xfcc1('0x42')](_0x5197aa(_0x4cba87[_0xfcc1('0x86')][_0xfcc1('0x6f')]));}_0x29aa1a=_0x3c263e[_0xfcc1('0x87')]();_0x3c263e[_0xfcc1('0x24')](_0x3eeb67);_0x3c263e[_0xfcc1('0x22')](0x0);return;}})[_0xfcc1('0x2a')](function(){if(_0x3e40fc['output']===_0xfcc1('0x93')){return null;}var _0xd98c9=_[_0xfcc1('0x44')](_0x3e40fc,{'name':_0x3e40fc[_0xfcc1('0x94')]||_0x3e40fc[_0xfcc1('0x36')]||_0x4cba87[_0xfcc1('0x36')],'basename':_0x3e0fd3,'savename':util['format'](_0xfcc1('0x95'),_0x3e40fc[_0xfcc1('0x36')]||_0x4cba87['name'],require(_0xfcc1('0x96'))[_0xfcc1('0x97')](0x4),_0x3e40fc[_0xfcc1('0x98')]||'csv'),'reportId':_0x4cba87['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xfcc1('0x4f')](_0xd98c9,{'raw':!![]});})[_0xfcc1('0x2a')](function(_0x63dd2b){if(_0x4cba87[_0xfcc1('0x78')]===_0xfcc1('0x99')){_0x29aa1a[_0xfcc1('0x42')](_0x4cba87[_0xfcc1('0x78')]+_0xfcc1('0x9a'),_0x3e40fc['startDate'],_0x3e40fc[_0xfcc1('0x9b')]);}else{_0x29aa1a[_0xfcc1('0x42')](_0x4cba87['table']+_0xfcc1('0x9c'),_0x3e40fc['startDate'],_0x3e40fc[_0xfcc1('0x9b')]);}if(_0x63dd2b){logger[_0xfcc1('0x9d')]('Run\x20Query:',_0x29aa1a['toString']());require(_0xfcc1('0x9e'))['fork'](path['join'](__dirname,'../../components/export/',_0x63dd2b[_0xfcc1('0x98')]),[_0x63dd2b['id'],_0x29aa1a['toString'](),path[_0xfcc1('0x8d')](__dirname,'../../files/reports',_0x63dd2b[_0xfcc1('0x9f')]),_0x3e0fd3]);return _0x63dd2b;}else{var _0x3ae6bd=squel[_0xfcc1('0x76')]();_0x3ae6bd[_0xfcc1('0x77')]('('+_0x29aa1a[_0xfcc1('0x8a')]()+')',_0xfcc1('0xa0'));_0x3ae6bd['field'](_0xfcc1('0xa1'),_0xfcc1('0x25'));_0x29aa1a[_0xfcc1('0x24')](_0x3e40fc['limit']||_0x3eeb67);_0x29aa1a[_0xfcc1('0x22')](_0x3e40fc[_0xfcc1('0x22')]||0x0);return dbH[_0xfcc1('0x8b')][_0xfcc1('0x37')](_0x3ae6bd[_0xfcc1('0x8a')](),{'type':dbH['sequelize'][_0xfcc1('0x8c')][_0xfcc1('0xa2')]})[_0xfcc1('0x2a')](function(_0x1541c5){if(!_0x1541c5[_0xfcc1('0x3d')]){_0x1e54d8=0x0;}else{_0x1e54d8=_0x1541c5[0x0][_0xfcc1('0x25')]||0x0;}return dbH[_0xfcc1('0x8b')][_0xfcc1('0x37')](_0x29aa1a[_0xfcc1('0x8a')](),{'type':dbH[_0xfcc1('0x8b')]['QueryTypes']['SELECT']});})['then'](function(_0x56884c){return{'rows':_0x56884c||[],'count':_0x1e54d8};});}});}exports[_0xfcc1('0xa3')]=function(_0x58e18e,_0x16dad4){return runReport(_0x58e18e['params'],_0x58e18e[_0xfcc1('0x37')],_0x58e18e[_0xfcc1('0x47')])[_0xfcc1('0x2a')](respondWithResult(_0x16dad4,null))[_0xfcc1('0x4c')](handleError(_0x16dad4,null));};exports[_0xfcc1('0xa4')]=runReport;exports[_0xfcc1('0x37')]=function(_0x56cb4f,_0x2ad7db){var _0x5262ce=0xa;var _0x5a89f8=[_0xfcc1('0x8d'),_0xfcc1('0x5d'),_0xfcc1('0x5e'),_0xfcc1('0x8e')];var _0x26dccb={'SUM':_0xfcc1('0x5f'),'COUNT':_0xfcc1('0x60'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfcc1('0x61'),'MIN':'MIN(%s)','AVG':_0xfcc1('0x63'),'GROUP_CONCAT':_0xfcc1('0x64'),'GROUP_CONCAT ASC':_0xfcc1('0x8f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4206d3={'SEC_TO_TIME':_0xfcc1('0x66'),'DATE':_0xfcc1('0x67'),'HOUR':_0xfcc1('0xa5'),'ROUND':_0xfcc1('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x39cb76=function(_0x59ffa4){return!_['includes']([_0xfcc1('0x6a'),_0xfcc1('0x6b'),_0xfcc1('0xa6'),'IS\x20NOT\x20EMPTY'],_0x59ffa4);};var _0xd310ae=function(_0x112a8d){if(!_0x112a8d||!_0x112a8d['rules'][_0xfcc1('0x3d')]){return'';}for(var _0x127161='(',_0x58432f=0x0;_0x58432f<_0x112a8d[_0xfcc1('0x6d')][_0xfcc1('0x3d')];_0x58432f+=0x1){_0x58432f>0x0&&(_0x127161+='\x20'+_0x112a8d['operator']+'\x20');_0x127161+=_0x112a8d[_0xfcc1('0x6d')][_0x58432f]['group']?_0xd310ae(_0x112a8d['rules'][_0x58432f][_0xfcc1('0x6f')]):_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x7b')]+'\x20'+_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x70')]+(_0x39cb76(_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x70')])?'\x20'+_0x112a8d[_0xfcc1('0x6d')][_0x58432f][_0xfcc1('0x71')]:'');}return _0x127161+')';};var _0x5b8ffc={'where':{'id':_0x56cb4f['params']['id']}},_0x52880c,_0x45e946,_0x56dba2,_0x4200c3,_0x3b21e3;_0x5b8ffc=_[_0xfcc1('0x44')]({},_0x5b8ffc,_0x56cb4f[_0xfcc1('0x47')]);return db['AnalyticCustomReport'][_0xfcc1('0x4e')](_0x5b8ffc)['then'](function(_0x8224a8){if(_0x8224a8){_0x52880c=_0x8224a8;return _0x8224a8['getFields']();}return null;})[_0xfcc1('0x2a')](function(_0x499e4f){if(_0x499e4f){if(!_0x499e4f[_0xfcc1('0x3d')]){throw new db[(_0xfcc1('0x72'))][(_0xfcc1('0x73'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x45e946=_0x499e4f;return db[_0xfcc1('0x75')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xc47aa3){if(_0xc47aa3){_0x56dba2=_['keyBy'](_0xc47aa3,'id');var _0xea0055;var _0x812750=squel[_0xfcc1('0x76')]();_0x812750[_0xfcc1('0x77')](_0x52880c['table']);for(var _0x512e89=0x0;_0x512e89<_0x45e946['length'];_0x512e89+=0x1){_0xea0055=_0x45e946[_0x512e89]['MetricId']?_0x56dba2[_0x45e946[_0x512e89][_0xfcc1('0x79')]][_0xfcc1('0x7a')]:_0x45e946[_0x512e89]['field'];_0xea0055=_0x45e946[_0x512e89][_0xfcc1('0x91')]?_['replace'](_0x26dccb[_0x45e946[_0x512e89][_0xfcc1('0x91')]],'%s',_0xea0055):_0xea0055;_0xea0055=_0x45e946[_0x512e89][_0xfcc1('0x7d')]?_[_0xfcc1('0x7c')](_0x4206d3[_0x45e946[_0x512e89]['format']],'%s',_0xea0055):_0xea0055;if(_0x45e946[_0x512e89]['groupBy']){_0x812750[_0xfcc1('0x6f')](_0xea0055);}_0x45e946[_0x512e89][_0xfcc1('0x92')]&&_0x812750[_0xfcc1('0x40')](_0xea0055,_0x45e946[_0x512e89]['orderBy']===_0xfcc1('0x7f')?![]:!![]);_0x812750['field'](_0xea0055,_0x45e946[_0x512e89]['alias']||_0xea0055);}if(_0x52880c['joins']){_0x52880c[_0xfcc1('0x80')]=JSON[_0xfcc1('0x81')](_0x52880c[_0xfcc1('0x80')]);for(var _0x5d7a04=0x0;_0x5d7a04<_0x52880c[_0xfcc1('0x80')]['length'];_0x5d7a04+=0x1){if(_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x45')]&&_[_0xfcc1('0x69')](_0x5a89f8,_0x52880c[_0xfcc1('0x80')][_0x5d7a04]['type'])&&_0x52880c['joins'][_0x5d7a04][_0xfcc1('0x82')]&&_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x83')]&&_0x52880c['joins'][_0x5d7a04]['foreignKey']){_0x812750[_0x52880c['joins'][_0x5d7a04]['type']](_0x52880c['joins'][_0x5d7a04][_0xfcc1('0x83')],null,util[_0xfcc1('0x7d')](_0xfcc1('0x84'),_0x52880c[_0xfcc1('0x78')],_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x82')],_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x83')],_0x52880c[_0xfcc1('0x80')][_0x5d7a04][_0xfcc1('0x85')]));}}}if(_0x52880c[_0xfcc1('0x86')]){_0x52880c[_0xfcc1('0x86')]=JSON[_0xfcc1('0x81')](_0x52880c[_0xfcc1('0x86')]);_0x812750['where'](_0xd310ae(_0x52880c[_0xfcc1('0x86')][_0xfcc1('0x6f')]));}_0x3b21e3=_0x812750[_0xfcc1('0x87')]();_0x812750['limit'](_0x5262ce);_0x812750['offset'](0x0);logger[_0xfcc1('0x88')](_0xfcc1('0x89'),_0x812750['toString']());return dbH[_0xfcc1('0x8b')]['query'](_0x812750[_0xfcc1('0x8a')](),{'type':dbH[_0xfcc1('0x8b')]['QueryTypes']['SELECT']});}})[_0xfcc1('0x2a')](function(){return{'sql':_0x3b21e3[_0xfcc1('0x8a')]()};})[_0xfcc1('0x2a')](respondWithResult(_0x2ad7db,null))[_0xfcc1('0x4c')](handleError(_0x2ad7db,null));};
\ No newline at end of file
+var _0xf1d3=['MAX(%s)','MIN(%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\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','field','function','replace','orderBy','alias','joins','foreignKey','foreignTable','format','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','cross_join','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20NULL','getFields','select','groupBy','DESC','parentKey','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','savename','COUNT(*)','QueryTypes','COUNT(DISTINCT\x20%s)','AVG(%s)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','options','AnalyticCustomReport','count','includeAll','include','findAll','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)'];(function(_0x14677d,_0x55cbc4){var _0x5cb603=function(_0x150f67){while(--_0x150f67){_0x14677d['push'](_0x14677d['shift']());}};_0x5cb603(++_0x55cbc4);}(_0xf1d3,0xee));var _0x3f1d=function(_0x959f15,_0x395007){_0x959f15=_0x959f15-0x0;var _0x1547c4=_0xf1d3[_0x959f15];return _0x1547c4;};'use strict';var emlformat=require(_0x3f1d('0x0'));var rimraf=require(_0x3f1d('0x1'));var zipdir=require(_0x3f1d('0x2'));var jsonpatch=require(_0x3f1d('0x3'));var rp=require(_0x3f1d('0x4'));var moment=require(_0x3f1d('0x5'));var BPromise=require(_0x3f1d('0x6'));var Mustache=require(_0x3f1d('0x7'));var util=require(_0x3f1d('0x8'));var path=require(_0x3f1d('0x9'));var sox=require(_0x3f1d('0xa'));var csv=require(_0x3f1d('0xb'));var ejs=require(_0x3f1d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f1d('0xd'));var squel=require(_0x3f1d('0xe'));var crypto=require(_0x3f1d('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3f1d('0xb'));var querystring=require(_0x3f1d('0x10'));var Papa=require(_0x3f1d('0x11'));var Redis=require(_0x3f1d('0x12'));var authService=require(_0x3f1d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3f1d('0x14'));var hardwareService=require(_0x3f1d('0x15'));var logger=require(_0x3f1d('0x16'))(_0x3f1d('0x17'));var utils=require(_0x3f1d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x3f1d('0x19'));var db=require(_0x3f1d('0x1a'))['db'];var dbH=require(_0x3f1d('0x1a'))['dbH'];function respondWithStatusCode(_0x360705,_0x2b6674){_0x2b6674=_0x2b6674||0xcc;return function(_0x1b7e7f){if(_0x1b7e7f){return _0x360705[_0x3f1d('0x1b')](_0x2b6674);}return _0x360705[_0x3f1d('0x1c')](_0x2b6674)[_0x3f1d('0x1d')]();};}function respondWithResult(_0x2c8f49,_0x40158e){_0x40158e=_0x40158e||0xc8;return function(_0x391448){if(_0x391448){return _0x2c8f49['status'](_0x40158e)[_0x3f1d('0x1e')](_0x391448);}};}function respondWithFilteredResult(_0x4ce5c9,_0x1773f5){return function(_0x2fcd14){if(_0x2fcd14){var _0x43d63b=typeof _0x1773f5[_0x3f1d('0x1f')]===_0x3f1d('0x20')&&typeof _0x1773f5['limit']===_0x3f1d('0x20');var _0x9ae762=_0x2fcd14['count'];var _0x4fa624=_0x43d63b?0x0:_0x1773f5[_0x3f1d('0x1f')];var _0x3cb03e=_0x43d63b?_0x2fcd14['count']:_0x1773f5[_0x3f1d('0x1f')]+_0x1773f5[_0x3f1d('0x21')];var _0x34ac5b;if(_0x3cb03e>=_0x9ae762){_0x3cb03e=_0x9ae762;_0x34ac5b=0xc8;}else{_0x34ac5b=0xce;}_0x4ce5c9[_0x3f1d('0x1c')](_0x34ac5b);return _0x4ce5c9[_0x3f1d('0x22')](_0x3f1d('0x23'),_0x4fa624+'-'+_0x3cb03e+'/'+_0x9ae762)[_0x3f1d('0x1e')](_0x2fcd14);}return null;};}function patchUpdates(_0x492fb6){return function(_0x48f5d7){try{jsonpatch[_0x3f1d('0x24')](_0x48f5d7,_0x492fb6,!![]);}catch(_0xc8875d){return BPromise[_0x3f1d('0x25')](_0xc8875d);}return _0x48f5d7[_0x3f1d('0x26')]();};}function saveUpdates(_0xc3bae3,_0x42a132){return function(_0x4404fb){if(_0x4404fb){return _0x4404fb[_0x3f1d('0x27')](_0xc3bae3)[_0x3f1d('0x28')](function(_0x4785dd){return _0x4785dd;});}return null;};}function removeEntity(_0x1dd5f4,_0x4fc0e6){return function(_0x12f812){if(_0x12f812){return _0x12f812[_0x3f1d('0x29')]()[_0x3f1d('0x28')](function(){var _0x27908f=_0x12f812['get']({'plain':!![]});var _0x30f216=_0x3f1d('0x2a');return db[_0x3f1d('0x2b')][_0x3f1d('0x29')]({'where':{'type':_0x30f216,'resourceId':_0x27908f['id']}})[_0x3f1d('0x28')](function(){return _0x12f812;});})['then'](function(){_0x1dd5f4[_0x3f1d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x929c2a,_0x222f3b){return function(_0x7949d){if(!_0x7949d){_0x929c2a[_0x3f1d('0x1b')](0x194);}return _0x7949d;};}function handleError(_0x491253,_0x489af6){_0x489af6=_0x489af6||0x1f4;return function(_0x5d6b5d){logger[_0x3f1d('0x2c')](_0x5d6b5d[_0x3f1d('0x2d')]);if(_0x5d6b5d[_0x3f1d('0x2e')]){delete _0x5d6b5d[_0x3f1d('0x2e')];}_0x491253[_0x3f1d('0x1c')](_0x489af6)[_0x3f1d('0x2f')](_0x5d6b5d);};}exports['index']=function(_0x27cd32,_0xd4a7b6){var _0x2f4f26={},_0x3c1470={},_0x5325b2={'count':0x0,'rows':[]};var _0x37b590=_[_0x3f1d('0x30')](db['AnalyticCustomReport'][_0x3f1d('0x31')],function(_0x43795f){return{'name':_0x43795f[_0x3f1d('0x32')],'type':_0x43795f[_0x3f1d('0x33')][_0x3f1d('0x34')]};});_0x3c1470[_0x3f1d('0x35')]=_[_0x3f1d('0x30')](_0x37b590,_0x3f1d('0x2e'));_0x3c1470['query']=_[_0x3f1d('0x36')](_0x27cd32[_0x3f1d('0x37')]);_0x3c1470[_0x3f1d('0x38')]=_['intersection'](_0x3c1470['model'],_0x3c1470[_0x3f1d('0x37')]);_0x2f4f26['attributes']=_[_0x3f1d('0x39')](_0x3c1470[_0x3f1d('0x35')],qs[_0x3f1d('0x3a')](_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x3a')]));_0x2f4f26[_0x3f1d('0x3b')]=_0x2f4f26['attributes'][_0x3f1d('0x3c')]?_0x2f4f26[_0x3f1d('0x3b')]:_0x3c1470[_0x3f1d('0x35')];if(!_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x3d')]('nolimit')){_0x2f4f26['limit']=qs[_0x3f1d('0x21')](_0x27cd32['query'][_0x3f1d('0x21')]);_0x2f4f26['offset']=qs[_0x3f1d('0x1f')](_0x27cd32['query']['offset']);}_0x2f4f26[_0x3f1d('0x3e')]=qs['sort'](_0x27cd32[_0x3f1d('0x37')]['sort']);_0x2f4f26[_0x3f1d('0x3f')]=qs[_0x3f1d('0x38')](_[_0x3f1d('0x40')](_0x27cd32[_0x3f1d('0x37')],_0x3c1470[_0x3f1d('0x38')]),_0x37b590);if(_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x41')]){_0x2f4f26[_0x3f1d('0x3f')]=_[_0x3f1d('0x42')](_0x2f4f26[_0x3f1d('0x3f')],{'$or':_[_0x3f1d('0x30')](_0x37b590,function(_0x3935cc){if(_0x3935cc['type']!=='VIRTUAL'){var _0x16eb67={};_0x16eb67[_0x3935cc['name']]={'$like':'%'+_0x27cd32['query'][_0x3f1d('0x41')]+'%'};return _0x16eb67;}})});}_0x2f4f26=_[_0x3f1d('0x42')]({},_0x2f4f26,_0x27cd32[_0x3f1d('0x43')]);var _0x10e684={'where':_0x2f4f26[_0x3f1d('0x3f')]};return db[_0x3f1d('0x44')][_0x3f1d('0x45')](_0x10e684)[_0x3f1d('0x28')](function(_0xd8efa5){_0x5325b2[_0x3f1d('0x45')]=_0xd8efa5;if(_0x27cd32[_0x3f1d('0x37')][_0x3f1d('0x46')]){_0x2f4f26[_0x3f1d('0x47')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x3f1d('0x48')](_0x2f4f26);})[_0x3f1d('0x28')](function(_0x496783){_0x5325b2['rows']=_0x496783;return _0x5325b2;})[_0x3f1d('0x28')](respondWithFilteredResult(_0xd4a7b6,_0x2f4f26))[_0x3f1d('0x49')](handleError(_0xd4a7b6,null));};exports[_0x3f1d('0x4a')]=function(_0xad9d8f,_0x1bd937){var _0x3d8652={'raw':![],'where':{'id':_0xad9d8f[_0x3f1d('0x4b')]['id']}},_0x2269f7={};_0x2269f7['model']=_['keys'](db['AnalyticCustomReport'][_0x3f1d('0x31')]);_0x2269f7['query']=_[_0x3f1d('0x36')](_0xad9d8f[_0x3f1d('0x37')]);_0x2269f7['filters']=_[_0x3f1d('0x39')](_0x2269f7[_0x3f1d('0x35')],_0x2269f7['query']);_0x3d8652[_0x3f1d('0x3b')]=_[_0x3f1d('0x39')](_0x2269f7[_0x3f1d('0x35')],qs[_0x3f1d('0x3a')](_0xad9d8f['query'][_0x3f1d('0x3a')]));_0x3d8652['attributes']=_0x3d8652[_0x3f1d('0x3b')][_0x3f1d('0x3c')]?_0x3d8652[_0x3f1d('0x3b')]:_0x2269f7[_0x3f1d('0x35')];if(_0xad9d8f[_0x3f1d('0x37')][_0x3f1d('0x46')]){_0x3d8652['include']=[{'all':!![]}];}_0x3d8652=_[_0x3f1d('0x42')]({},_0x3d8652,_0xad9d8f['options']);return db[_0x3f1d('0x44')][_0x3f1d('0x4c')](_0x3d8652)[_0x3f1d('0x28')](handleEntityNotFound(_0x1bd937,null))[_0x3f1d('0x28')](respondWithResult(_0x1bd937,null))[_0x3f1d('0x49')](handleError(_0x1bd937,null));};exports['create']=function(_0x4a17ba,_0x281954){return db[_0x3f1d('0x44')][_0x3f1d('0x4d')](_0x4a17ba['body'],{})[_0x3f1d('0x28')](function(_0x159e6a){var _0x329952=_0x4a17ba['user']['get']({'plain':!![]});if(!_0x329952)throw new Error(_0x3f1d('0x4e'));if(_0x329952[_0x3f1d('0x4f')]===_0x3f1d('0x50')){var _0xafb74e=_0x159e6a['get']({'plain':!![]});var _0x29a100=_0x3f1d('0x51');return db[_0x3f1d('0x52')][_0x3f1d('0x4c')]({'where':{'name':_0x29a100,'userProfileId':_0x329952[_0x3f1d('0x53')]},'raw':!![]})[_0x3f1d('0x28')](function(_0xb0897){if(_0xb0897&&_0xb0897[_0x3f1d('0x54')]===0x0){return db['UserProfileResource'][_0x3f1d('0x4d')]({'name':_0xafb74e[_0x3f1d('0x2e')],'resourceId':_0xafb74e['id'],'type':_0x3f1d('0x2a'),'sectionId':_0xb0897['id']},{})[_0x3f1d('0x28')](function(){return _0x159e6a;});}else{return _0x159e6a;}})[_0x3f1d('0x49')](function(_0x36e7b6){logger[_0x3f1d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36e7b6);throw _0x36e7b6;});}return _0x159e6a;})[_0x3f1d('0x28')](respondWithResult(_0x281954,0xc9))[_0x3f1d('0x49')](handleError(_0x281954,null));};exports[_0x3f1d('0x27')]=function(_0x540cdf,_0x51ab04){if(_0x540cdf['body']['id']){delete _0x540cdf[_0x3f1d('0x55')]['id'];}return db[_0x3f1d('0x44')][_0x3f1d('0x4c')]({'where':{'id':_0x540cdf[_0x3f1d('0x4b')]['id']}})[_0x3f1d('0x28')](handleEntityNotFound(_0x51ab04,null))['then'](saveUpdates(_0x540cdf['body'],null))[_0x3f1d('0x28')](respondWithResult(_0x51ab04,null))[_0x3f1d('0x49')](handleError(_0x51ab04,null));};exports['destroy']=function(_0x2268b3,_0x1037a9){return db['AnalyticCustomReport'][_0x3f1d('0x4c')]({'where':{'id':_0x2268b3[_0x3f1d('0x4b')]['id']}})[_0x3f1d('0x28')](handleEntityNotFound(_0x1037a9,null))['then'](removeEntity(_0x1037a9,null))[_0x3f1d('0x49')](handleError(_0x1037a9,null));};exports[_0x3f1d('0x56')]=function(_0x1ee3ab,_0x3359ab){var _0x319626=0xa;var _0x111d3a=[_0x3f1d('0x57'),_0x3f1d('0x58'),_0x3f1d('0x59'),'cross_join'];var _0x19ea8a={'SUM':_0x3f1d('0x5a'),'COUNT':_0x3f1d('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3f1d('0x5c'),'MIN':_0x3f1d('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3f1d('0x5e'),'GROUP_CONCAT DESC':_0x3f1d('0x5f')};var _0x4b1c75={'SEC_TO_TIME':_0x3f1d('0x60'),'DATE':_0x3f1d('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x3f1d('0x62'),'UNIX_TIMESTAMP':_0x3f1d('0x63')};var _0x273210=function(_0x39293c){return!_[_0x3f1d('0x64')]([_0x3f1d('0x65'),'IS\x20NOT\x20NULL',_0x3f1d('0x66'),_0x3f1d('0x67')],_0x39293c);};var _0x12c735=function(_0x87511d){if(!_0x87511d||!_0x87511d['rules'][_0x3f1d('0x3c')]){return'';}for(var _0x10aa37='(',_0x53adab=0x0;_0x53adab<_0x87511d[_0x3f1d('0x68')][_0x3f1d('0x3c')];_0x53adab+=0x1){_0x53adab>0x0&&(_0x10aa37+='\x20'+_0x87511d[_0x3f1d('0x69')]+'\x20');_0x10aa37+=_0x87511d[_0x3f1d('0x68')][_0x53adab][_0x3f1d('0x6a')]?_0x12c735(_0x87511d['rules'][_0x53adab][_0x3f1d('0x6a')]):_0x87511d[_0x3f1d('0x68')][_0x53adab]['field']+'\x20'+_0x87511d[_0x3f1d('0x68')][_0x53adab]['condition']+(_0x273210(_0x87511d[_0x3f1d('0x68')][_0x53adab][_0x3f1d('0x6b')])?'\x20'+_0x87511d[_0x3f1d('0x68')][_0x53adab][_0x3f1d('0x6c')]:'');}return _0x10aa37+')';};var _0x11ea15={'where':{'id':_0x1ee3ab[_0x3f1d('0x4b')]['id']}},_0x110f98,_0x2c556b,_0x155466,_0x3b031d,_0x55a0f2;_0x11ea15=_[_0x3f1d('0x42')]({},_0x11ea15,_0x1ee3ab['options']);return db['AnalyticCustomReport']['find'](_0x11ea15)['then'](function(_0x218b0d){if(_0x218b0d){_0x110f98=_0x218b0d;return _0x218b0d['getFields']();}return null;})[_0x3f1d('0x28')](function(_0x3acc95){if(_0x3acc95){if(!_0x3acc95[_0x3f1d('0x3c')]){throw new db[(_0x3f1d('0x6d'))][(_0x3f1d('0x6e'))](_0x3f1d('0x6f'),0x193);}_0x2c556b=_0x3acc95;return db[_0x3f1d('0x70')][_0x3f1d('0x48')]({'raw':!![]});}return null;})['then'](function(_0x3be026){if(_0x3be026){_0x155466=_[_0x3f1d('0x71')](_0x3be026,'id');var _0x53e507;var _0x324c66=squel['select']();_0x324c66[_0x3f1d('0x72')](_0x110f98[_0x3f1d('0x73')]);for(var _0x2c4107=0x0;_0x2c4107<_0x2c556b[_0x3f1d('0x3c')];_0x2c4107+=0x1){_0x53e507=_0x2c556b[_0x2c4107][_0x3f1d('0x74')]?_0x155466[_0x2c556b[_0x2c4107][_0x3f1d('0x74')]][_0x3f1d('0x75')]:_0x2c556b[_0x2c4107][_0x3f1d('0x76')];_0x53e507=_0x2c556b[_0x2c4107][_0x3f1d('0x77')]?_[_0x3f1d('0x78')](_0x19ea8a[_0x2c556b[_0x2c4107][_0x3f1d('0x77')]],'%s',_0x53e507):_0x53e507;_0x53e507=_0x2c556b[_0x2c4107]['format']?_[_0x3f1d('0x78')](_0x4b1c75[_0x2c556b[_0x2c4107]['format']],'%s',_0x53e507):_0x53e507;if(_0x2c556b[_0x2c4107]['groupBy']){_0x324c66[_0x3f1d('0x6a')](_0x53e507);}_0x2c556b[_0x2c4107][_0x3f1d('0x79')]&&_0x324c66[_0x3f1d('0x3e')](_0x53e507,_0x2c556b[_0x2c4107][_0x3f1d('0x79')]==='DESC'?![]:!![]);_0x324c66[_0x3f1d('0x76')](_0x53e507,_0x2c556b[_0x2c4107][_0x3f1d('0x7a')]||_0x53e507);}if(_0x110f98[_0x3f1d('0x7b')]){_0x110f98[_0x3f1d('0x7b')]=JSON['parse'](_0x110f98['joins']);for(var _0x284bbc=0x0;_0x284bbc<_0x110f98[_0x3f1d('0x7b')][_0x3f1d('0x3c')];_0x284bbc+=0x1){if(_0x110f98[_0x3f1d('0x7b')][_0x284bbc]['type']&&_[_0x3f1d('0x64')](_0x111d3a,_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x33')])&&_0x110f98['joins'][_0x284bbc]['parentKey']&&_0x110f98[_0x3f1d('0x7b')][_0x284bbc]['foreignTable']&&_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x7c')]){_0x324c66[_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x33')]](_0x110f98['joins'][_0x284bbc][_0x3f1d('0x7d')],null,util[_0x3f1d('0x7e')](_0x3f1d('0x7f'),_0x110f98['table'],_0x110f98['joins'][_0x284bbc]['parentKey'],_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x7d')],_0x110f98[_0x3f1d('0x7b')][_0x284bbc][_0x3f1d('0x7c')]));}}}if(_0x110f98[_0x3f1d('0x80')]){_0x110f98['conditions']=JSON[_0x3f1d('0x81')](_0x110f98[_0x3f1d('0x80')]);_0x324c66['where'](_0x12c735(_0x110f98[_0x3f1d('0x80')][_0x3f1d('0x6a')]));}_0x55a0f2=_0x324c66[_0x3f1d('0x82')]();_0x324c66['limit'](_0x319626);_0x324c66['offset'](0x0);logger[_0x3f1d('0x83')](_0x3f1d('0x84'),_0x324c66['toString']());return dbH[_0x3f1d('0x85')]['query'](_0x324c66[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')]['QueryTypes'][_0x3f1d('0x87')]});}})[_0x3f1d('0x28')](respondWithResult(_0x3359ab,null))[_0x3f1d('0x49')](handleError(_0x3359ab,null));};function runReport(_0x5dc6c5,_0x5ab052,_0x4a44d4){var _0x43612d=_0x5ab052[_0x3f1d('0x2e')];var _0x5791a4=0xa;var _0x2db3d2=['join',_0x3f1d('0x58'),_0x3f1d('0x59'),_0x3f1d('0x88')];var _0x3b4b7c={'SUM':_0x3f1d('0x5a'),'COUNT':_0x3f1d('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3f1d('0x5c'),'MIN':_0x3f1d('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3f1d('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3f1d('0x5f')};var _0x51123d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3f1d('0x61'),'HOUR':_0x3f1d('0x8a'),'ROUND':_0x3f1d('0x62'),'UNIX_TIMESTAMP':_0x3f1d('0x63')};var _0xe575bb=function(_0x5a9958){return!_[_0x3f1d('0x64')]([_0x3f1d('0x65'),_0x3f1d('0x8b'),_0x3f1d('0x66'),'IS\x20NOT\x20EMPTY'],_0x5a9958);};var _0x1d6f87=function(_0x406d46){if(!_0x406d46||!_0x406d46['rules']['length']){return'';}for(var _0x1488da='(',_0x4bdc71=0x0;_0x4bdc71<_0x406d46[_0x3f1d('0x68')][_0x3f1d('0x3c')];_0x4bdc71+=0x1){_0x4bdc71>0x0&&(_0x1488da+='\x20'+_0x406d46['operator']+'\x20');_0x1488da+=_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6a')]?_0x1d6f87(_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6a')]):_0x406d46['rules'][_0x4bdc71][_0x3f1d('0x76')]+'\x20'+_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6b')]+(_0xe575bb(_0x406d46[_0x3f1d('0x68')][_0x4bdc71]['condition'])?'\x20'+_0x406d46[_0x3f1d('0x68')][_0x4bdc71][_0x3f1d('0x6c')]:'');}return _0x1488da+')';};var _0x4cde99={'where':{'id':_0x5dc6c5['id']}},_0xd1d4ec,_0x596ed5,_0x3830f9,_0x2f1b86,_0xdb5a3f;_0x4cde99=_[_0x3f1d('0x42')]({},_0x4cde99,_0x4a44d4);return db[_0x3f1d('0x44')][_0x3f1d('0x4c')](_0x4cde99)[_0x3f1d('0x28')](function(_0x416d39){if(_0x416d39){_0xd1d4ec=_0x416d39;return _0x416d39[_0x3f1d('0x8c')]();}return null;})[_0x3f1d('0x28')](function(_0x51d47e){if(_0x51d47e){if(!_0x51d47e[_0x3f1d('0x3c')]){throw new db[(_0x3f1d('0x6d'))][(_0x3f1d('0x6e'))](_0x3f1d('0x6f'),0x193);}_0x596ed5=_0x51d47e;return db[_0x3f1d('0x70')][_0x3f1d('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1d2030){if(_0x1d2030){_0x3830f9=_[_0x3f1d('0x71')](_0x1d2030,'id');var _0x18638f;var _0x96dd86=squel[_0x3f1d('0x8d')]();_0x96dd86[_0x3f1d('0x72')](_0xd1d4ec['table']);for(var _0x3752a2=0x0;_0x3752a2<_0x596ed5[_0x3f1d('0x3c')];_0x3752a2+=0x1){_0x18638f=_0x596ed5[_0x3752a2][_0x3f1d('0x74')]?_0x3830f9[_0x596ed5[_0x3752a2][_0x3f1d('0x74')]][_0x3f1d('0x75')]:_0x596ed5[_0x3752a2][_0x3f1d('0x76')];_0x18638f=_0x596ed5[_0x3752a2][_0x3f1d('0x77')]?_[_0x3f1d('0x78')](_0x3b4b7c[_0x596ed5[_0x3752a2][_0x3f1d('0x77')]],'%s',_0x18638f):_0x18638f;_0x18638f=_0x596ed5[_0x3752a2][_0x3f1d('0x7e')]?_[_0x3f1d('0x78')](_0x51123d[_0x596ed5[_0x3752a2][_0x3f1d('0x7e')]],'%s',_0x18638f):_0x18638f;if(_0x596ed5[_0x3752a2][_0x3f1d('0x8e')]){_0x96dd86[_0x3f1d('0x6a')](_0x18638f);}_0x596ed5[_0x3752a2][_0x3f1d('0x79')]&&_0x96dd86['order'](_0x18638f,_0x596ed5[_0x3752a2]['orderBy']===_0x3f1d('0x8f')?![]:!![]);_0x96dd86['field'](_0x18638f,_0x596ed5[_0x3752a2]['alias']||_0x18638f);}if(_0xd1d4ec[_0x3f1d('0x7b')]){_0xd1d4ec['joins']=JSON[_0x3f1d('0x81')](_0xd1d4ec[_0x3f1d('0x7b')]);for(var _0x4d64f9=0x0;_0x4d64f9<_0xd1d4ec[_0x3f1d('0x7b')][_0x3f1d('0x3c')];_0x4d64f9+=0x1){if(_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x33')]&&_[_0x3f1d('0x64')](_0x2db3d2,_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x33')])&&_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x90')]&&_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x7d')]&&_0xd1d4ec['joins'][_0x4d64f9]['foreignKey']){_0x96dd86[_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9]['type']](_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x7d')],null,util['format'](_0x3f1d('0x7f'),_0xd1d4ec['table'],_0xd1d4ec['joins'][_0x4d64f9][_0x3f1d('0x90')],_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9][_0x3f1d('0x7d')],_0xd1d4ec[_0x3f1d('0x7b')][_0x4d64f9]['foreignKey']));}}}if(_0xd1d4ec[_0x3f1d('0x80')]){_0xd1d4ec[_0x3f1d('0x80')]=JSON[_0x3f1d('0x81')](_0xd1d4ec[_0x3f1d('0x80')]);_0x96dd86['where'](_0x1d6f87(_0xd1d4ec['conditions'][_0x3f1d('0x6a')]));}_0xdb5a3f=_0x96dd86[_0x3f1d('0x82')]();_0x96dd86[_0x3f1d('0x21')](_0x5791a4);_0x96dd86[_0x3f1d('0x1f')](0x0);return;}})['then'](function(){if(_0x5ab052[_0x3f1d('0x91')]===_0x3f1d('0x92')){return null;}var _0x57a5b8=_[_0x3f1d('0x42')](_0x5ab052,{'name':_0x5ab052[_0x3f1d('0x93')]||_0x5ab052[_0x3f1d('0x2e')]||_0xd1d4ec[_0x3f1d('0x2e')],'basename':_0x43612d,'savename':util[_0x3f1d('0x7e')](_0x3f1d('0x94'),_0x5ab052[_0x3f1d('0x2e')]||_0xd1d4ec[_0x3f1d('0x2e')],require(_0x3f1d('0x95'))[_0x3f1d('0x96')](0x4),_0x5ab052[_0x3f1d('0x91')]||_0x3f1d('0x97')),'reportId':_0xd1d4ec['id'],'reportType':_0x3f1d('0x98')});return db[_0x3f1d('0x99')][_0x3f1d('0x4d')](_0x57a5b8,{'raw':!![]});})[_0x3f1d('0x28')](function(_0x3ab577){if(_0xd1d4ec[_0x3f1d('0x73')]==='cdr'){_0xdb5a3f[_0x3f1d('0x3f')](_0xd1d4ec['table']+_0x3f1d('0x9a'),_0x5ab052[_0x3f1d('0x9b')],_0x5ab052['endDate']);}else{_0xdb5a3f[_0x3f1d('0x3f')](_0xd1d4ec[_0x3f1d('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5ab052[_0x3f1d('0x9b')],_0x5ab052[_0x3f1d('0x9c')]);}if(_0x3ab577){logger[_0x3f1d('0x9d')]('Run\x20Query:',_0xdb5a3f[_0x3f1d('0x86')]());require('child_process')[_0x3f1d('0x9e')](path[_0x3f1d('0x57')](__dirname,_0x3f1d('0x9f'),_0x3ab577[_0x3f1d('0x91')]),[_0x3ab577['id'],_0xdb5a3f[_0x3f1d('0x86')](),path[_0x3f1d('0x57')](__dirname,'../../files/reports',_0x3ab577[_0x3f1d('0xa0')]),_0x43612d]);return _0x3ab577;}else{var _0x27c6b8=squel[_0x3f1d('0x8d')]();_0x27c6b8['from']('('+_0xdb5a3f['toString']()+')','countTable');_0x27c6b8[_0x3f1d('0x76')](_0x3f1d('0xa1'),_0x3f1d('0x45'));_0xdb5a3f[_0x3f1d('0x21')](_0x5ab052[_0x3f1d('0x21')]||_0x5791a4);_0xdb5a3f[_0x3f1d('0x1f')](_0x5ab052[_0x3f1d('0x1f')]||0x0);return dbH[_0x3f1d('0x85')][_0x3f1d('0x37')](_0x27c6b8[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')][_0x3f1d('0xa2')]['SELECT']})[_0x3f1d('0x28')](function(_0x44dc06){if(!_0x44dc06[_0x3f1d('0x3c')]){_0x2f1b86=0x0;}else{_0x2f1b86=_0x44dc06[0x0][_0x3f1d('0x45')]||0x0;}return dbH['sequelize'][_0x3f1d('0x37')](_0xdb5a3f[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')][_0x3f1d('0xa2')]['SELECT']});})['then'](function(_0x495729){return{'rows':_0x495729||[],'count':_0x2f1b86};});}});}exports['run']=function(_0x28f1a6,_0x5e384f){return runReport(_0x28f1a6[_0x3f1d('0x4b')],_0x28f1a6[_0x3f1d('0x37')],_0x28f1a6[_0x3f1d('0x43')])[_0x3f1d('0x28')](respondWithResult(_0x5e384f,null))['catch'](handleError(_0x5e384f,null));};exports['runReport']=runReport;exports['query']=function(_0x211118,_0x2f0925){var _0x12b210=0xa;var _0x432ccd=[_0x3f1d('0x57'),_0x3f1d('0x58'),_0x3f1d('0x59'),_0x3f1d('0x88')];var _0x48d348={'SUM':_0x3f1d('0x5a'),'COUNT':_0x3f1d('0x5b'),'COUNT DISTINCT':_0x3f1d('0xa3'),'MAX':_0x3f1d('0x5c'),'MIN':_0x3f1d('0x5d'),'AVG':_0x3f1d('0xa4'),'GROUP_CONCAT':_0x3f1d('0x89'),'GROUP_CONCAT ASC':_0x3f1d('0x5e'),'GROUP_CONCAT DESC':_0x3f1d('0x5f')};var _0xdff638={'SEC_TO_TIME':_0x3f1d('0x60'),'DATE':_0x3f1d('0x61'),'HOUR':_0x3f1d('0x8a'),'ROUND':_0x3f1d('0x62'),'UNIX_TIMESTAMP':_0x3f1d('0x63')};var _0x33fe41=function(_0x44f32f){return!_[_0x3f1d('0x64')]([_0x3f1d('0x65'),'IS\x20NOT\x20NULL',_0x3f1d('0x66'),_0x3f1d('0x67')],_0x44f32f);};var _0x1ca754=function(_0xd24586){if(!_0xd24586||!_0xd24586[_0x3f1d('0x68')][_0x3f1d('0x3c')]){return'';}for(var _0x4bc64c='(',_0x9070e9=0x0;_0x9070e9<_0xd24586[_0x3f1d('0x68')][_0x3f1d('0x3c')];_0x9070e9+=0x1){_0x9070e9>0x0&&(_0x4bc64c+='\x20'+_0xd24586[_0x3f1d('0x69')]+'\x20');_0x4bc64c+=_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6a')]?_0x1ca754(_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6a')]):_0xd24586['rules'][_0x9070e9][_0x3f1d('0x76')]+'\x20'+_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6b')]+(_0x33fe41(_0xd24586[_0x3f1d('0x68')][_0x9070e9][_0x3f1d('0x6b')])?'\x20'+_0xd24586[_0x3f1d('0x68')][_0x9070e9]['value']:'');}return _0x4bc64c+')';};var _0x2f189c={'where':{'id':_0x211118[_0x3f1d('0x4b')]['id']}},_0x2bb032,_0x46729d,_0x2fa8bc,_0x533be6,_0x53ce93;_0x2f189c=_[_0x3f1d('0x42')]({},_0x2f189c,_0x211118[_0x3f1d('0x43')]);return db['AnalyticCustomReport'][_0x3f1d('0x4c')](_0x2f189c)[_0x3f1d('0x28')](function(_0x3fe887){if(_0x3fe887){_0x2bb032=_0x3fe887;return _0x3fe887[_0x3f1d('0x8c')]();}return null;})['then'](function(_0x4f37fc){if(_0x4f37fc){if(!_0x4f37fc['length']){throw new db[(_0x3f1d('0x6d'))][(_0x3f1d('0x6e'))](_0x3f1d('0x6f'),0x193);}_0x46729d=_0x4f37fc;return db[_0x3f1d('0x70')][_0x3f1d('0x48')]({'raw':!![]});}return null;})[_0x3f1d('0x28')](function(_0x3b6aff){if(_0x3b6aff){_0x2fa8bc=_['keyBy'](_0x3b6aff,'id');var _0x26e8c4;var _0x5e6168=squel[_0x3f1d('0x8d')]();_0x5e6168[_0x3f1d('0x72')](_0x2bb032[_0x3f1d('0x73')]);for(var _0x2aa1e2=0x0;_0x2aa1e2<_0x46729d[_0x3f1d('0x3c')];_0x2aa1e2+=0x1){_0x26e8c4=_0x46729d[_0x2aa1e2]['MetricId']?_0x2fa8bc[_0x46729d[_0x2aa1e2]['MetricId']]['metric']:_0x46729d[_0x2aa1e2][_0x3f1d('0x76')];_0x26e8c4=_0x46729d[_0x2aa1e2][_0x3f1d('0x77')]?_[_0x3f1d('0x78')](_0x48d348[_0x46729d[_0x2aa1e2][_0x3f1d('0x77')]],'%s',_0x26e8c4):_0x26e8c4;_0x26e8c4=_0x46729d[_0x2aa1e2][_0x3f1d('0x7e')]?_[_0x3f1d('0x78')](_0xdff638[_0x46729d[_0x2aa1e2][_0x3f1d('0x7e')]],'%s',_0x26e8c4):_0x26e8c4;if(_0x46729d[_0x2aa1e2][_0x3f1d('0x8e')]){_0x5e6168['group'](_0x26e8c4);}_0x46729d[_0x2aa1e2][_0x3f1d('0x79')]&&_0x5e6168[_0x3f1d('0x3e')](_0x26e8c4,_0x46729d[_0x2aa1e2][_0x3f1d('0x79')]===_0x3f1d('0x8f')?![]:!![]);_0x5e6168[_0x3f1d('0x76')](_0x26e8c4,_0x46729d[_0x2aa1e2]['alias']||_0x26e8c4);}if(_0x2bb032[_0x3f1d('0x7b')]){_0x2bb032['joins']=JSON['parse'](_0x2bb032[_0x3f1d('0x7b')]);for(var _0x2c891f=0x0;_0x2c891f<_0x2bb032['joins']['length'];_0x2c891f+=0x1){if(_0x2bb032['joins'][_0x2c891f][_0x3f1d('0x33')]&&_[_0x3f1d('0x64')](_0x432ccd,_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x33')])&&_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x90')]&&_0x2bb032[_0x3f1d('0x7b')][_0x2c891f]['foreignTable']&&_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x7c')]){_0x5e6168[_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x33')]](_0x2bb032['joins'][_0x2c891f][_0x3f1d('0x7d')],null,util[_0x3f1d('0x7e')](_0x3f1d('0x7f'),_0x2bb032[_0x3f1d('0x73')],_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x90')],_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x7d')],_0x2bb032[_0x3f1d('0x7b')][_0x2c891f][_0x3f1d('0x7c')]));}}}if(_0x2bb032[_0x3f1d('0x80')]){_0x2bb032[_0x3f1d('0x80')]=JSON['parse'](_0x2bb032[_0x3f1d('0x80')]);_0x5e6168[_0x3f1d('0x3f')](_0x1ca754(_0x2bb032['conditions']['group']));}_0x53ce93=_0x5e6168[_0x3f1d('0x82')]();_0x5e6168[_0x3f1d('0x21')](_0x12b210);_0x5e6168['offset'](0x0);logger[_0x3f1d('0x83')](_0x3f1d('0x84'),_0x5e6168[_0x3f1d('0x86')]());return dbH[_0x3f1d('0x85')][_0x3f1d('0x37')](_0x5e6168[_0x3f1d('0x86')](),{'type':dbH[_0x3f1d('0x85')][_0x3f1d('0xa2')][_0x3f1d('0x87')]});}})[_0x3f1d('0x28')](function(){return{'sql':_0x53ce93[_0x3f1d('0x86')]()};})[_0x3f1d('0x28')](respondWithResult(_0x2f0925,null))[_0x3f1d('0x49')](handleError(_0x2f0925,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index aa2d97e..340607c 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 _0xb1a6=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','lodash'];(function(_0x423b87,_0x2a1b40){var _0xe4851b=function(_0x1d7009){while(--_0x1d7009){_0x423b87['push'](_0x423b87['shift']());}};_0xe4851b(++_0x2a1b40);}(_0xb1a6,0x180));var _0x6b1a=function(_0x34440f,_0x13fcc6){_0x34440f=_0x34440f-0x0;var _0x2d7813=_0xb1a6[_0x34440f];return _0x2d7813;};'use strict';var _=require(_0x6b1a('0x0'));var util=require(_0x6b1a('0x1'));var logger=require(_0x6b1a('0x2'))(_0x6b1a('0x3'));var moment=require(_0x6b1a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b1a('0x5'));var fs=require('fs');var path=require(_0x6b1a('0x6'));var rimraf=require(_0x6b1a('0x7'));var config=require(_0x6b1a('0x8'));var attributes=require(_0x6b1a('0x9'));module['exports']=function(_0x4cb354,_0x3e9d44){return _0x4cb354['define'](_0x6b1a('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0ff=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','api','moment'];(function(_0x254eb4,_0x8b207f){var _0x46c368=function(_0x418cad){while(--_0x418cad){_0x254eb4['push'](_0x254eb4['shift']());}};_0x46c368(++_0x8b207f);}(_0xa0ff,0x129));var _0xfa0f=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xa0ff[_0x3bf925];return _0x2128a1;};'use strict';var _=require(_0xfa0f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfa0f('0x1'));var moment=require(_0xfa0f('0x2'));var BPromise=require(_0xfa0f('0x3'));var rp=require(_0xfa0f('0x4'));var fs=require('fs');var path=require(_0xfa0f('0x5'));var rimraf=require(_0xfa0f('0x6'));var config=require(_0xfa0f('0x7'));var attributes=require(_0xfa0f('0x8'));module[_0xfa0f('0x9')]=function(_0x2b98d2,_0x1cea37){return _0x2b98d2['define'](_0xfa0f('0xa'),attributes,{'tableName':_0xfa0f('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 31e603a..366c9a2 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 _0x46b5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x317188,_0x538bbf){var _0x32354a=function(_0x145174){while(--_0x145174){_0x317188['push'](_0x317188['shift']());}};_0x32354a(++_0x538bbf);}(_0x46b5,0x18c));var _0x546b=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x46b5[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x546b('0x0'));var util=require(_0x546b('0x1'));var moment=require(_0x546b('0x2'));var BPromise=require(_0x546b('0x3'));var rs=require(_0x546b('0x4'));var fs=require('fs');var Redis=require(_0x546b('0x5'));var db=require(_0x546b('0x6'))['db'];var utils=require(_0x546b('0x7'));var logger=require(_0x546b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x546b('0x9')][_0x546b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bfcd0,_0x2c469b,_0x247a98){return new BPromise(function(_0x3facd8,_0x172a2b){return client['request'](_0x1bfcd0,_0x247a98)['then'](function(_0x36651e){logger[_0x546b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2c469b,_0x546b('0xc'));logger[_0x546b('0xd')](_0x546b('0xe'),_0x2c469b,_0x546b('0xc'),JSON[_0x546b('0xf')](_0x36651e));if(_0x36651e[_0x546b('0x10')]){if(_0x36651e[_0x546b('0x10')]['code']===0x1f4){logger[_0x546b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2c469b,_0x36651e['error'][_0x546b('0x11')]);return _0x172a2b(_0x36651e[_0x546b('0x10')][_0x546b('0x11')]);}logger[_0x546b('0x10')](_0x546b('0x12'),_0x2c469b,_0x36651e['error'][_0x546b('0x11')]);return _0x3facd8(_0x36651e['error'][_0x546b('0x11')]);}else{logger[_0x546b('0xb')](_0x546b('0x12'),_0x2c469b,'request\x20sent');_0x3facd8(_0x36651e[_0x546b('0x13')][_0x546b('0x11')]);}})[_0x546b('0x14')](function(_0x4dd0bf){logger['error'](_0x546b('0x12'),_0x2c469b,_0x4dd0bf);_0x172a2b(_0x4dd0bf);});});}
\ No newline at end of file
+var _0x7058=['request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x3c20ee,_0x703766){var _0x5c952f=function(_0x3268b0){while(--_0x3268b0){_0x3c20ee['push'](_0x3c20ee['shift']());}};_0x5c952f(++_0x703766);}(_0x7058,0x13b));var _0x8705=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7058[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x8705('0x0'));var util=require(_0x8705('0x1'));var moment=require(_0x8705('0x2'));var BPromise=require(_0x8705('0x3'));var rs=require(_0x8705('0x4'));var fs=require('fs');var Redis=require(_0x8705('0x5'));var db=require(_0x8705('0x6'))['db'];var utils=require(_0x8705('0x7'));var logger=require(_0x8705('0x8'))('rpc');var config=require(_0x8705('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8705('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x398e41,_0x15dbb2,_0x1e0eac){return new BPromise(function(_0x2503cd,_0x427a54){return client[_0x8705('0xb')](_0x398e41,_0x1e0eac)[_0x8705('0xc')](function(_0x19680b){logger[_0x8705('0xd')](_0x8705('0xe'),_0x15dbb2,_0x8705('0xf'));logger[_0x8705('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x15dbb2,'request\x20sent',JSON[_0x8705('0x11')](_0x19680b));if(_0x19680b['error']){if(_0x19680b[_0x8705('0x12')][_0x8705('0x13')]===0x1f4){logger[_0x8705('0x12')](_0x8705('0xe'),_0x15dbb2,_0x19680b[_0x8705('0x12')]['message']);return _0x427a54(_0x19680b[_0x8705('0x12')]['message']);}logger[_0x8705('0x12')](_0x8705('0xe'),_0x15dbb2,_0x19680b[_0x8705('0x12')][_0x8705('0x14')]);return _0x2503cd(_0x19680b[_0x8705('0x12')]['message']);}else{logger['info'](_0x8705('0xe'),_0x15dbb2,_0x8705('0xf'));_0x2503cd(_0x19680b['result'][_0x8705('0x14')]);}})[_0x8705('0x15')](function(_0x2d8d24){logger[_0x8705('0x12')](_0x8705('0xe'),_0x15dbb2,_0x2d8d24);_0x427a54(_0x2d8d24);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 414736b..a584858 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 _0x6f03=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index','get','show','/:id/run','/:id/query','query','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f03,0x1db));var _0x36f0=function(_0x14ec9d,_0x5b19f4){_0x14ec9d=_0x14ec9d-0x0;var _0x521174=_0x6f03[_0x14ec9d];return _0x521174;};'use strict';var multer=require(_0x36f0('0x0'));var util=require(_0x36f0('0x1'));var path=require('path');var timeout=require(_0x36f0('0x2'));var express=require(_0x36f0('0x3'));var router=express[_0x36f0('0x4')]();var fs_extra=require(_0x36f0('0x5'));var auth=require(_0x36f0('0x6'));var interaction=require(_0x36f0('0x7'));var config=require(_0x36f0('0x8'));var controller=require(_0x36f0('0x9'));router['get']('/',auth[_0x36f0('0xa')](),controller[_0x36f0('0xb')]);router[_0x36f0('0xc')]('/:id',auth[_0x36f0('0xa')](),controller[_0x36f0('0xd')]);router[_0x36f0('0xc')]('/:id/preview',auth[_0x36f0('0xa')](),controller['preview']);router['get'](_0x36f0('0xe'),auth[_0x36f0('0xa')](),controller['run']);router[_0x36f0('0xc')](_0x36f0('0xf'),auth[_0x36f0('0xa')](),controller[_0x36f0('0x10')]);router[_0x36f0('0x11')]('/',auth['isAuthenticated'](),controller[_0x36f0('0x12')]);router[_0x36f0('0x13')](_0x36f0('0x14'),auth[_0x36f0('0xa')](),controller[_0x36f0('0x15')]);router[_0x36f0('0x16')]('/:id',auth[_0x36f0('0xa')](),controller[_0x36f0('0x17')]);module[_0x36f0('0x18')]=router;
\ No newline at end of file
+var _0xb335=['../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','/:id/query','post','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x4ab4c7,_0x1eb4f5){var _0x5d38a8=function(_0x598a92){while(--_0x598a92){_0x4ab4c7['push'](_0x4ab4c7['shift']());}};_0x5d38a8(++_0x1eb4f5);}(_0xb335,0xf4));var _0x5b33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb335[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5b33('0x0'));var util=require(_0x5b33('0x1'));var path=require('path');var timeout=require(_0x5b33('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5b33('0x3'));var config=require(_0x5b33('0x4'));var controller=require(_0x5b33('0x5'));router[_0x5b33('0x6')]('/',auth[_0x5b33('0x7')](),controller[_0x5b33('0x8')]);router[_0x5b33('0x6')](_0x5b33('0x9'),auth[_0x5b33('0x7')](),controller[_0x5b33('0xa')]);router[_0x5b33('0x6')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0x5b33('0x6')](_0x5b33('0xb'),auth[_0x5b33('0x7')](),controller[_0x5b33('0xc')]);router[_0x5b33('0x6')](_0x5b33('0xd'),auth['isAuthenticated'](),controller['query']);router[_0x5b33('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5b33('0xf')](_0x5b33('0x9'),auth[_0x5b33('0x7')](),controller[_0x5b33('0x10')]);router['delete'](_0x5b33('0x9'),auth['isAuthenticated'](),controller[_0x5b33('0x11')]);module[_0x5b33('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 7284127..52d24f4 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 _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x4e7ae5,_0x407167){var _0x14d181=function(_0x45b7d0){while(--_0x45b7d0){_0x4e7ae5['push'](_0x4e7ae5['shift']());}};_0x14d181(++_0x407167);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0xf2ca[_0xef4ef0];return _0x39b60b;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
+var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x7da7[_0x31a37b];return _0x49ae16;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index f51ab66..3a9f2f8 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x3f8001,_0x57445a){var _0x799a1b=function(_0x145000){while(--_0x145000){_0x3f8001['push'](_0x3f8001['shift']());}};_0x799a1b(++_0x57445a);}(_0xf494,0x1c6));var _0x4f49=function(_0x3ad88c,_0x3e6fb0){_0x3ad88c=_0x3ad88c-0x0;var _0x44b377=_0xf494[_0x3ad88c];return _0x44b377;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
+var _0xda19=['ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','field','function','replace','groupBy','orderBy','order','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','operator','Sequelize','metric','format','DESC','parse','parentKey','web','output','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','run','runReport','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','apply','update','then','DefaultReports','destroy','end','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','merge','includeAll','include','findAll','show','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','options','find','getFields'];(function(_0x1229df,_0x39bc91){var _0x28301f=function(_0x4bbebb){while(--_0x4bbebb){_0x1229df['push'](_0x1229df['shift']());}};_0x28301f(++_0x39bc91);}(_0xda19,0xd5));var _0x9da1=function(_0x375bbf,_0x556cdb){_0x375bbf=_0x375bbf-0x0;var _0x255aed=_0xda19[_0x375bbf];return _0x255aed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];var dbH=require('../../mysqldb')[_0x9da1('0x17')];function respondWithStatusCode(_0x1d93f8,_0xd2d225){_0xd2d225=_0xd2d225||0xcc;return function(_0x1ffa2a){if(_0x1ffa2a){return _0x1d93f8['sendStatus'](_0xd2d225);}return _0x1d93f8[_0x9da1('0x18')](_0xd2d225)['end']();};}function respondWithResult(_0x4d17e1,_0x40ba9d){_0x40ba9d=_0x40ba9d||0xc8;return function(_0x479ccd){if(_0x479ccd){return _0x4d17e1[_0x9da1('0x18')](_0x40ba9d)[_0x9da1('0x19')](_0x479ccd);}};}function respondWithFilteredResult(_0x37653d,_0x1a1a6b){return function(_0x7f1a64){if(_0x7f1a64){var _0x514d8e=typeof _0x1a1a6b[_0x9da1('0x1a')]===_0x9da1('0x1b')&&typeof _0x1a1a6b[_0x9da1('0x1c')]===_0x9da1('0x1b');var _0xfb278d=_0x7f1a64[_0x9da1('0x1d')];var _0x497676=_0x514d8e?0x0:_0x1a1a6b['offset'];var _0x17205d=_0x514d8e?_0x7f1a64[_0x9da1('0x1d')]:_0x1a1a6b[_0x9da1('0x1a')]+_0x1a1a6b[_0x9da1('0x1c')];var _0x40a967;if(_0x17205d>=_0xfb278d){_0x17205d=_0xfb278d;_0x40a967=0xc8;}else{_0x40a967=0xce;}_0x37653d[_0x9da1('0x18')](_0x40a967);return _0x37653d[_0x9da1('0x1e')]('Content-Range',_0x497676+'-'+_0x17205d+'/'+_0xfb278d)[_0x9da1('0x19')](_0x7f1a64);}return null;};}function patchUpdates(_0x554845){return function(_0x9c3b37){try{jsonpatch[_0x9da1('0x1f')](_0x9c3b37,_0x554845,!![]);}catch(_0x1fc065){return BPromise['reject'](_0x1fc065);}return _0x9c3b37['save']();};}function saveUpdates(_0x14793b,_0x3e6f85){return function(_0x16ee0c){if(_0x16ee0c){return _0x16ee0c[_0x9da1('0x20')](_0x14793b)[_0x9da1('0x21')](function(_0x165b73){return _0x165b73;});}return null;};}function removeEntity(_0x4c60aa,_0x2413fe){return function(_0x3bfa40){if(_0x3bfa40){return _0x3bfa40['destroy']()[_0x9da1('0x21')](function(){var _0x3f5680=_0x3bfa40['get']({'plain':!![]});var _0x2fd49c=_0x9da1('0x22');return db['UserProfileResource'][_0x9da1('0x23')]({'where':{'type':_0x2fd49c,'resourceId':_0x3f5680['id']}})[_0x9da1('0x21')](function(){return _0x3bfa40;});})['then'](function(){_0x4c60aa['status'](0xcc)[_0x9da1('0x24')]();});}};}function handleEntityNotFound(_0x47055e,_0x5eca5b){return function(_0x27c6e2){if(!_0x27c6e2){_0x47055e['sendStatus'](0x194);}return _0x27c6e2;};}function handleError(_0x5a6f2d,_0x5a59c2){_0x5a59c2=_0x5a59c2||0x1f4;return function(_0x31b826){logger[_0x9da1('0x25')](_0x31b826[_0x9da1('0x26')]);if(_0x31b826[_0x9da1('0x27')]){delete _0x31b826[_0x9da1('0x27')];}_0x5a6f2d['status'](_0x5a59c2)[_0x9da1('0x28')](_0x31b826);};}exports['index']=function(_0x1feae0,_0x235ced){var _0x5b38b3={},_0xc29ba8={},_0x2eb48f={'count':0x0,'rows':[]};var _0x4f318b=_[_0x9da1('0x29')](db[_0x9da1('0x2a')][_0x9da1('0x2b')],function(_0x2b2b48){return{'name':_0x2b2b48['fieldName'],'type':_0x2b2b48['type'][_0x9da1('0x2c')]};});_0xc29ba8[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x4f318b,_0x9da1('0x27'));_0xc29ba8[_0x9da1('0x2e')]=_['keys'](_0x1feae0[_0x9da1('0x2e')]);_0xc29ba8[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xc29ba8[_0x9da1('0x2d')],_0xc29ba8[_0x9da1('0x2e')]);_0x5b38b3[_0x9da1('0x31')]=_['intersection'](_0xc29ba8[_0x9da1('0x2d')],qs['fields'](_0x1feae0['query'][_0x9da1('0x32')]));_0x5b38b3['attributes']=_0x5b38b3[_0x9da1('0x31')][_0x9da1('0x33')]?_0x5b38b3[_0x9da1('0x31')]:_0xc29ba8[_0x9da1('0x2d')];if(!_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x34')](_0x9da1('0x35'))){_0x5b38b3[_0x9da1('0x1c')]=qs['limit'](_0x1feae0[_0x9da1('0x2e')]['limit']);_0x5b38b3[_0x9da1('0x1a')]=qs['offset'](_0x1feae0['query'][_0x9da1('0x1a')]);}_0x5b38b3['order']=qs[_0x9da1('0x36')](_0x1feae0[_0x9da1('0x2e')]['sort']);_0x5b38b3[_0x9da1('0x37')]=qs[_0x9da1('0x2f')](_[_0x9da1('0x38')](_0x1feae0[_0x9da1('0x2e')],_0xc29ba8['filters']),_0x4f318b);if(_0x1feae0[_0x9da1('0x2e')]['filter']){_0x5b38b3[_0x9da1('0x37')]=_['merge'](_0x5b38b3[_0x9da1('0x37')],{'$or':_[_0x9da1('0x29')](_0x4f318b,function(_0x58e165){if(_0x58e165[_0x9da1('0x39')]!==_0x9da1('0x3a')){var _0x394acf={};_0x394acf[_0x58e165['name']]={'$like':'%'+_0x1feae0['query']['filter']+'%'};return _0x394acf;}})});}_0x5b38b3=_[_0x9da1('0x3b')]({},_0x5b38b3,_0x1feae0['options']);var _0x5b215c={'where':_0x5b38b3[_0x9da1('0x37')]};return db[_0x9da1('0x2a')][_0x9da1('0x1d')](_0x5b215c)['then'](function(_0x42dbd8){_0x2eb48f[_0x9da1('0x1d')]=_0x42dbd8;if(_0x1feae0[_0x9da1('0x2e')][_0x9da1('0x3c')]){_0x5b38b3[_0x9da1('0x3d')]=[{'all':!![]}];}return db[_0x9da1('0x2a')][_0x9da1('0x3e')](_0x5b38b3);})['then'](function(_0x467350){_0x2eb48f['rows']=_0x467350;return _0x2eb48f;})[_0x9da1('0x21')](respondWithFilteredResult(_0x235ced,_0x5b38b3))['catch'](handleError(_0x235ced,null));};exports[_0x9da1('0x3f')]=function(_0x40d848,_0x599211){var _0x265366={'raw':!![],'where':{'id':_0x40d848['params']['id']}},_0xfeec5f={};_0xfeec5f[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x2a')][_0x9da1('0x2b')]);_0xfeec5f['query']=_['keys'](_0x40d848[_0x9da1('0x2e')]);_0xfeec5f[_0x9da1('0x2f')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],_0xfeec5f[_0x9da1('0x2e')]);_0x265366[_0x9da1('0x31')]=_[_0x9da1('0x30')](_0xfeec5f[_0x9da1('0x2d')],qs['fields'](_0x40d848[_0x9da1('0x2e')][_0x9da1('0x32')]));_0x265366[_0x9da1('0x31')]=_0x265366['attributes'][_0x9da1('0x33')]?_0x265366[_0x9da1('0x31')]:_0xfeec5f[_0x9da1('0x2d')];if(_0x40d848['query'][_0x9da1('0x3c')]){_0x265366[_0x9da1('0x3d')]=[{'all':!![]}];}_0x265366=_[_0x9da1('0x3b')]({},_0x265366,_0x40d848['options']);return db[_0x9da1('0x2a')]['find'](_0x265366)['then'](handleEntityNotFound(_0x599211,null))[_0x9da1('0x21')](respondWithResult(_0x599211,null))[_0x9da1('0x40')](handleError(_0x599211,null));};exports['create']=function(_0x712d10,_0x2066d2){return db['AnalyticDefaultReport'][_0x9da1('0x41')](_0x712d10[_0x9da1('0x42')],{})[_0x9da1('0x21')](function(_0x3a529d){var _0x4780ca=_0x712d10[_0x9da1('0x43')][_0x9da1('0x44')]({'plain':!![]});if(!_0x4780ca)throw new Error(_0x9da1('0x45'));if(_0x4780ca[_0x9da1('0x46')]==='user'){var _0x147c65=_0x3a529d[_0x9da1('0x44')]({'plain':!![]});var _0x34a203=_0x9da1('0x47');return db['UserProfileSection']['find']({'where':{'name':_0x34a203,'userProfileId':_0x4780ca[_0x9da1('0x48')]},'raw':!![]})[_0x9da1('0x21')](function(_0x3870dd){if(_0x3870dd&&_0x3870dd[_0x9da1('0x49')]===0x0){return db[_0x9da1('0x4a')][_0x9da1('0x41')]({'name':_0x147c65[_0x9da1('0x27')],'resourceId':_0x147c65['id'],'type':_0x9da1('0x22'),'sectionId':_0x3870dd['id']},{})[_0x9da1('0x21')](function(){return _0x3a529d;});}else{return _0x3a529d;}})[_0x9da1('0x40')](function(_0x868167){logger[_0x9da1('0x25')](_0x9da1('0x4b'),_0x868167);throw _0x868167;});}return _0x3a529d;})[_0x9da1('0x21')](respondWithResult(_0x2066d2,0xc9))['catch'](handleError(_0x2066d2,null));};exports[_0x9da1('0x20')]=function(_0x1fbb5d,_0x4d241a){if(_0x1fbb5d[_0x9da1('0x42')]['id']){delete _0x1fbb5d['body']['id'];}return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x1fbb5d[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x4d241a,null))[_0x9da1('0x21')](saveUpdates(_0x1fbb5d[_0x9da1('0x42')],null))[_0x9da1('0x21')](respondWithResult(_0x4d241a,null))[_0x9da1('0x40')](handleError(_0x4d241a,null));};exports[_0x9da1('0x23')]=function(_0x343b05,_0x170351){return db[_0x9da1('0x2a')]['find']({'where':{'id':_0x343b05[_0x9da1('0x4c')]['id']}})[_0x9da1('0x21')](handleEntityNotFound(_0x170351,null))[_0x9da1('0x21')](removeEntity(_0x170351,null))[_0x9da1('0x40')](handleError(_0x170351,null));};exports[_0x9da1('0x4d')]=function(_0x4607a9,_0x2020d0){var _0x3c01c3=0xa;var _0xfa8d3f=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),_0x9da1('0x50')];var _0x5bda2a={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0xc27b00={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ac84=function(_0x10ebc9){return!_[_0x9da1('0x5c')]([_0x9da1('0x5d'),_0x9da1('0x5e'),_0x9da1('0x5f'),'IS\x20NOT\x20EMPTY'],_0x10ebc9);};var _0x5f5dc2=function(_0x454a68){if(!_0x454a68||!_0x454a68['rules']['length']){return'';}for(var _0x5b4a05='(',_0x6f86c3=0x0;_0x6f86c3<_0x454a68['rules'][_0x9da1('0x33')];_0x6f86c3+=0x1){_0x6f86c3>0x0&&(_0x5b4a05+='\x20'+_0x454a68['operator']+'\x20');_0x5b4a05+=_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x61')]?_0x5f5dc2(_0x454a68['rules'][_0x6f86c3][_0x9da1('0x61')]):_0x454a68[_0x9da1('0x60')][_0x6f86c3]['field']+'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x62')]+(_0x27ac84(_0x454a68['rules'][_0x6f86c3]['condition'])?'\x20'+_0x454a68[_0x9da1('0x60')][_0x6f86c3][_0x9da1('0x63')]:'');}return _0x5b4a05+')';};var _0x21d00c={'where':{'id':_0x4607a9['params']['id']}},_0x3ca531,_0x236b01,_0x44d7fe,_0x5cb102,_0x3d2c25;_0x21d00c=_['merge']({},_0x21d00c,_0x4607a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0x21d00c)[_0x9da1('0x21')](function(_0x3382b1){if(_0x3382b1){_0x3ca531=_0x3382b1;return _0x3382b1[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x1f2a4b){if(_0x1f2a4b){if(!_0x1f2a4b[_0x9da1('0x33')]){throw new db['Sequelize'][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x236b01=_0x1f2a4b;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x491fcb){if(_0x491fcb){_0x44d7fe=_[_0x9da1('0x6a')](_0x491fcb,'id');var _0x13fadd;var _0x419f78=squel[_0x9da1('0x6b')]();_0x419f78[_0x9da1('0x6c')](_0x3ca531[_0x9da1('0x6d')]);for(var _0x55a6d2=0x0;_0x55a6d2<_0x236b01[_0x9da1('0x33')];_0x55a6d2+=0x1){_0x13fadd=_0x236b01[_0x55a6d2]['MetricId']?_0x44d7fe[_0x236b01[_0x55a6d2][_0x9da1('0x6e')]]['metric']:_0x236b01[_0x55a6d2][_0x9da1('0x6f')];_0x13fadd=_0x236b01[_0x55a6d2][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x5bda2a[_0x236b01[_0x55a6d2][_0x9da1('0x70')]],'%s',_0x13fadd):_0x13fadd;_0x13fadd=_0x236b01[_0x55a6d2]['format']?_['replace'](_0xc27b00[_0x236b01[_0x55a6d2]['format']],'%s',_0x13fadd):_0x13fadd;if(_0x236b01[_0x55a6d2][_0x9da1('0x72')]){_0x419f78[_0x9da1('0x61')](_0x13fadd);}_0x236b01[_0x55a6d2][_0x9da1('0x73')]&&_0x419f78[_0x9da1('0x74')](_0x13fadd,_0x236b01[_0x55a6d2]['orderBy']==='DESC'?![]:!![]);_0x419f78[_0x9da1('0x6f')](_0x13fadd,_0x236b01[_0x55a6d2][_0x9da1('0x75')]||_0x13fadd);}if(_0x3ca531[_0x9da1('0x76')]){_0x3ca531['joins']=JSON['parse'](_0x3ca531[_0x9da1('0x76')]);for(var _0x1deb93=0x0;_0x1deb93<_0x3ca531[_0x9da1('0x76')]['length'];_0x1deb93+=0x1){if(_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0xfa8d3f,_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x39')])&&_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey']&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')]&&_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x78')]){_0x419f78[_0x3ca531['joins'][_0x1deb93][_0x9da1('0x39')]](_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0x3ca531[_0x9da1('0x6d')],_0x3ca531[_0x9da1('0x76')][_0x1deb93]['parentKey'],_0x3ca531[_0x9da1('0x76')][_0x1deb93][_0x9da1('0x77')],_0x3ca531['joins'][_0x1deb93][_0x9da1('0x78')]));}}}if(_0x3ca531['conditions']){_0x3ca531[_0x9da1('0x7a')]=JSON['parse'](_0x3ca531[_0x9da1('0x7a')]);_0x419f78[_0x9da1('0x37')](_0x5f5dc2(_0x3ca531[_0x9da1('0x7a')][_0x9da1('0x61')]));}_0x3d2c25=_0x419f78[_0x9da1('0x7b')]();_0x419f78[_0x9da1('0x1c')](_0x3c01c3);_0x419f78[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x419f78[_0x9da1('0x7e')]());return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x419f78[_0x9da1('0x7e')](),{'type':dbH['sequelize'][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](respondWithResult(_0x2020d0,null))[_0x9da1('0x40')](handleError(_0x2020d0,null));};function runReport(_0x162597,_0x4f39bc,_0x1ca102){var _0x2eb5e6=_0x4f39bc['name'];var _0x4a4cda=0xa;var _0x84f8d8=[_0x9da1('0x4e'),_0x9da1('0x82'),_0x9da1('0x4f'),_0x9da1('0x50')];var _0x4701b3={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x3a0a84={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':_0x9da1('0x5a'),'HOUR':_0x9da1('0x83'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9da1('0x84')};var _0x354c5a=function(_0x53ab6a){return!_[_0x9da1('0x5c')](['IS\x20NULL',_0x9da1('0x5e'),'IS\x20EMPTY',_0x9da1('0x85')],_0x53ab6a);};var _0x106bd9=function(_0x347cb8){if(!_0x347cb8||!_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x3e331a='(',_0x1f785c=0x0;_0x1f785c<_0x347cb8[_0x9da1('0x60')][_0x9da1('0x33')];_0x1f785c+=0x1){_0x1f785c>0x0&&(_0x3e331a+='\x20'+_0x347cb8[_0x9da1('0x86')]+'\x20');_0x3e331a+=_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x61')]?_0x106bd9(_0x347cb8['rules'][_0x1f785c][_0x9da1('0x61')]):_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x6f')]+'\x20'+_0x347cb8[_0x9da1('0x60')][_0x1f785c][_0x9da1('0x62')]+(_0x354c5a(_0x347cb8[_0x9da1('0x60')][_0x1f785c]['condition'])?'\x20'+_0x347cb8['rules'][_0x1f785c][_0x9da1('0x63')]:'');}return _0x3e331a+')';};var _0xdecc82={'where':{'id':_0x162597['id']}},_0xe12dd7,_0x4cd85f,_0x4bf74c,_0x28335d,_0x175b4b;_0xdecc82=_[_0x9da1('0x3b')]({},_0xdecc82,_0x1ca102);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xdecc82)[_0x9da1('0x21')](function(_0x5561f0){if(_0x5561f0){_0xe12dd7=_0x5561f0;return _0x5561f0[_0x9da1('0x66')]();}return null;})[_0x9da1('0x21')](function(_0x5a64fd){if(_0x5a64fd){if(!_0x5a64fd['length']){throw new db[(_0x9da1('0x87'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cd85f=_0x5a64fd;return db[_0x9da1('0x69')][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x18ae08){if(_0x18ae08){_0x4bf74c=_[_0x9da1('0x6a')](_0x18ae08,'id');var _0x30065d;var _0x40a2ef=squel[_0x9da1('0x6b')]();_0x40a2ef['from'](_0xe12dd7['table']);for(var _0xd10ba4=0x0;_0xd10ba4<_0x4cd85f[_0x9da1('0x33')];_0xd10ba4+=0x1){_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]?_0x4bf74c[_0x4cd85f[_0xd10ba4][_0x9da1('0x6e')]][_0x9da1('0x88')]:_0x4cd85f[_0xd10ba4][_0x9da1('0x6f')];_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x70')]?_[_0x9da1('0x71')](_0x4701b3[_0x4cd85f[_0xd10ba4]['function']],'%s',_0x30065d):_0x30065d;_0x30065d=_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]?_['replace'](_0x3a0a84[_0x4cd85f[_0xd10ba4][_0x9da1('0x89')]],'%s',_0x30065d):_0x30065d;if(_0x4cd85f[_0xd10ba4][_0x9da1('0x72')]){_0x40a2ef[_0x9da1('0x61')](_0x30065d);}_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]&&_0x40a2ef[_0x9da1('0x74')](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x73')]===_0x9da1('0x8a')?![]:!![]);_0x40a2ef['field'](_0x30065d,_0x4cd85f[_0xd10ba4][_0x9da1('0x75')]||_0x30065d);}if(_0xe12dd7['joins']){_0xe12dd7[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0xe12dd7[_0x9da1('0x76')]);for(var _0x22b679=0x0;_0x22b679<_0xe12dd7['joins'][_0x9da1('0x33')];_0x22b679+=0x1){if(_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]&&_[_0x9da1('0x5c')](_0x84f8d8,_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')])&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')]&&_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]){_0x40a2ef[_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x39')]](_0xe12dd7['joins'][_0x22b679][_0x9da1('0x77')],null,util['format'](_0x9da1('0x79'),_0xe12dd7['table'],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x8c')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x77')],_0xe12dd7[_0x9da1('0x76')][_0x22b679][_0x9da1('0x78')]));}}}if(_0xe12dd7[_0x9da1('0x7a')]){_0xe12dd7[_0x9da1('0x7a')]=JSON['parse'](_0xe12dd7[_0x9da1('0x7a')]);_0x40a2ef[_0x9da1('0x37')](_0x106bd9(_0xe12dd7['conditions'][_0x9da1('0x61')]));}_0x175b4b=_0x40a2ef[_0x9da1('0x7b')]();_0x40a2ef[_0x9da1('0x1c')](_0x4a4cda);_0x40a2ef['offset'](0x0);return;}})['then'](function(){if(_0x4f39bc['output']===_0x9da1('0x8d')){return null;}var _0x3b17aa=_[_0x9da1('0x3b')](_0x4f39bc,{'name':_0x4f39bc['fullPath']||_0x4f39bc['name']||_0xe12dd7[_0x9da1('0x27')],'basename':_0x2eb5e6,'savename':util[_0x9da1('0x89')]('%s-%s.%s',_0x4f39bc[_0x9da1('0x27')]||_0xe12dd7['name'],require('randomstring')['generate'](0x4),_0x4f39bc[_0x9da1('0x8e')]||_0x9da1('0x8f')),'reportId':_0xe12dd7['id'],'reportType':_0x9da1('0x90')});return db[_0x9da1('0x91')][_0x9da1('0x41')](_0x3b17aa,{'raw':!![]});})[_0x9da1('0x21')](function(_0x2aac99){if(_0xe12dd7[_0x9da1('0x6d')]===_0x9da1('0x92')){_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc['startDate'],_0x4f39bc['endDate']);}else{_0x175b4b[_0x9da1('0x37')](_0xe12dd7[_0x9da1('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f39bc[_0x9da1('0x93')],_0x4f39bc[_0x9da1('0x94')]);}if(_0x2aac99){logger[_0x9da1('0x95')](_0x9da1('0x96'),_0x175b4b[_0x9da1('0x7e')]());require(_0x9da1('0x97'))[_0x9da1('0x98')](path[_0x9da1('0x4e')](__dirname,'../../components/export/',_0x2aac99[_0x9da1('0x8e')]),[_0x2aac99['id'],_0x175b4b[_0x9da1('0x7e')](),path[_0x9da1('0x4e')](__dirname,_0x9da1('0x99'),_0x2aac99[_0x9da1('0x9a')]),_0x2eb5e6]);return _0x2aac99;}else{var _0x5ad3f8=squel[_0x9da1('0x6b')]();_0x5ad3f8['from']('('+_0x175b4b[_0x9da1('0x7e')]()+')',_0x9da1('0x9b'));_0x5ad3f8[_0x9da1('0x6f')]('COUNT(*)','count');_0x175b4b[_0x9da1('0x1c')](_0x4f39bc[_0x9da1('0x1c')]||_0x4a4cda);_0x175b4b[_0x9da1('0x1a')](_0x4f39bc['offset']||0x0);return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x5ad3f8['toString'](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')]['SELECT']})['then'](function(_0x489b3f){if(!_0x489b3f[_0x9da1('0x33')]){_0x28335d=0x0;}else{_0x28335d=_0x489b3f[0x0]['count']||0x0;}return dbH[_0x9da1('0x7f')][_0x9da1('0x2e')](_0x175b4b[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});})['then'](function(_0x355a71){return{'rows':_0x355a71||[],'count':_0x28335d};});}});}exports[_0x9da1('0x9c')]=function(_0x492e1a,_0x449a17){return runReport(_0x492e1a[_0x9da1('0x4c')],_0x492e1a[_0x9da1('0x2e')],_0x492e1a[_0x9da1('0x64')])['then'](respondWithResult(_0x449a17,null))[_0x9da1('0x40')](handleError(_0x449a17,null));};exports[_0x9da1('0x9d')]=runReport;exports[_0x9da1('0x2e')]=function(_0x8280a9,_0x374754){var _0x1e466a=0xa;var _0x3f9133=[_0x9da1('0x4e'),'left_join',_0x9da1('0x4f'),'cross_join'];var _0x3dd3e0={'SUM':_0x9da1('0x51'),'COUNT':_0x9da1('0x52'),'COUNT DISTINCT':_0x9da1('0x53'),'MAX':_0x9da1('0x54'),'MIN':_0x9da1('0x55'),'AVG':_0x9da1('0x56'),'GROUP_CONCAT':_0x9da1('0x57'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9da1('0x58')};var _0x52e4a6={'SEC_TO_TIME':_0x9da1('0x59'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x9da1('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4aa903=function(_0x55d7f2){return!_['includes'](['IS\x20NULL',_0x9da1('0x5e'),_0x9da1('0x5f'),_0x9da1('0x85')],_0x55d7f2);};var _0x3212ad=function(_0x5ac65b){if(!_0x5ac65b||!_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')]){return'';}for(var _0x21a99d='(',_0xd19a7c=0x0;_0xd19a7c<_0x5ac65b[_0x9da1('0x60')][_0x9da1('0x33')];_0xd19a7c+=0x1){_0xd19a7c>0x0&&(_0x21a99d+='\x20'+_0x5ac65b[_0x9da1('0x86')]+'\x20');_0x21a99d+=_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]?_0x3212ad(_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x61')]):_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x6f')]+'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c]['condition']+(_0x4aa903(_0x5ac65b['rules'][_0xd19a7c][_0x9da1('0x62')])?'\x20'+_0x5ac65b[_0x9da1('0x60')][_0xd19a7c][_0x9da1('0x63')]:'');}return _0x21a99d+')';};var _0xb14af1={'where':{'id':_0x8280a9[_0x9da1('0x4c')]['id']}},_0x245566,_0x5b2591,_0x3c51e3,_0x54b83d,_0x23bf86;_0xb14af1=_['merge']({},_0xb14af1,_0x8280a9[_0x9da1('0x64')]);return db[_0x9da1('0x2a')][_0x9da1('0x65')](_0xb14af1)[_0x9da1('0x21')](function(_0x4bb140){if(_0x4bb140){_0x245566=_0x4bb140;return _0x4bb140[_0x9da1('0x66')]();}return null;})['then'](function(_0x47cbdd){if(_0x47cbdd){if(!_0x47cbdd['length']){throw new db[(_0x9da1('0x87'))][(_0x9da1('0x67'))](_0x9da1('0x68'),0x193);}_0x5b2591=_0x47cbdd;return db['AnalyticMetric'][_0x9da1('0x3e')]({'raw':!![]});}return null;})[_0x9da1('0x21')](function(_0x5e1e24){if(_0x5e1e24){_0x3c51e3=_[_0x9da1('0x6a')](_0x5e1e24,'id');var _0x49ddec;var _0x407218=squel['select']();_0x407218['from'](_0x245566['table']);for(var _0x316fee=0x0;_0x316fee<_0x5b2591['length'];_0x316fee+=0x1){_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x6e')]?_0x3c51e3[_0x5b2591[_0x316fee][_0x9da1('0x6e')]]['metric']:_0x5b2591[_0x316fee]['field'];_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x70')]?_['replace'](_0x3dd3e0[_0x5b2591[_0x316fee][_0x9da1('0x70')]],'%s',_0x49ddec):_0x49ddec;_0x49ddec=_0x5b2591[_0x316fee][_0x9da1('0x89')]?_['replace'](_0x52e4a6[_0x5b2591[_0x316fee]['format']],'%s',_0x49ddec):_0x49ddec;if(_0x5b2591[_0x316fee][_0x9da1('0x72')]){_0x407218[_0x9da1('0x61')](_0x49ddec);}_0x5b2591[_0x316fee][_0x9da1('0x73')]&&_0x407218[_0x9da1('0x74')](_0x49ddec,_0x5b2591[_0x316fee]['orderBy']==='DESC'?![]:!![]);_0x407218[_0x9da1('0x6f')](_0x49ddec,_0x5b2591[_0x316fee][_0x9da1('0x75')]||_0x49ddec);}if(_0x245566[_0x9da1('0x76')]){_0x245566[_0x9da1('0x76')]=JSON[_0x9da1('0x8b')](_0x245566['joins']);for(var _0x56ec7d=0x0;_0x56ec7d<_0x245566[_0x9da1('0x76')][_0x9da1('0x33')];_0x56ec7d+=0x1){if(_0x245566['joins'][_0x56ec7d][_0x9da1('0x39')]&&_['includes'](_0x3f9133,_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')])&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x8c')]&&_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')]&&_0x245566['joins'][_0x56ec7d][_0x9da1('0x78')]){_0x407218[_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x39')]](_0x245566[_0x9da1('0x76')][_0x56ec7d]['foreignTable'],null,util[_0x9da1('0x89')](_0x9da1('0x79'),_0x245566[_0x9da1('0x6d')],_0x245566['joins'][_0x56ec7d]['parentKey'],_0x245566[_0x9da1('0x76')][_0x56ec7d][_0x9da1('0x77')],_0x245566['joins'][_0x56ec7d]['foreignKey']));}}}if(_0x245566[_0x9da1('0x7a')]){_0x245566[_0x9da1('0x7a')]=JSON[_0x9da1('0x8b')](_0x245566[_0x9da1('0x7a')]);_0x407218[_0x9da1('0x37')](_0x3212ad(_0x245566['conditions'][_0x9da1('0x61')]));}_0x23bf86=_0x407218['clone']();_0x407218[_0x9da1('0x1c')](_0x1e466a);_0x407218[_0x9da1('0x1a')](0x0);logger[_0x9da1('0x7c')](_0x9da1('0x7d'),_0x407218['toString']());return dbH['sequelize'][_0x9da1('0x2e')](_0x407218[_0x9da1('0x7e')](),{'type':dbH[_0x9da1('0x7f')][_0x9da1('0x80')][_0x9da1('0x81')]});}})[_0x9da1('0x21')](function(){return{'sql':_0x23bf86['toString']()};})[_0x9da1('0x21')](respondWithResult(_0x374754,null))[_0x9da1('0x40')](handleError(_0x374754,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 933aa62..71f1263 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 _0x53cd=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','../../config/logger','api'];(function(_0x42a027,_0x6c9c55){var _0x4d486d=function(_0x3a2e43){while(--_0x3a2e43){_0x42a027['push'](_0x42a027['shift']());}};_0x4d486d(++_0x6c9c55);}(_0x53cd,0x1ee));var _0xd53c=function(_0x5ec78e,_0x51da72){_0x5ec78e=_0x5ec78e-0x0;var _0x3c4901=_0x53cd[_0x5ec78e];return _0x3c4901;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd53c('0x0'))(_0xd53c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd53c('0x2'));var config=require(_0xd53c('0x3'));var attributes=require(_0xd53c('0x4'));module[_0xd53c('0x5')]=function(_0x261a1e,_0x30a207){return _0x261a1e[_0xd53c('0x6')](_0xd53c('0x7'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbde=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x29de7c,_0x5bc2bf){var _0x29c03f=function(_0x2659b7){while(--_0x2659b7){_0x29de7c['push'](_0x29de7c['shift']());}};_0x29c03f(++_0x5bc2bf);}(_0xfbde,0x1d9));var _0xefbd=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xfbde[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xefbd('0x0'));var util=require(_0xefbd('0x1'));var logger=require(_0xefbd('0x2'))(_0xefbd('0x3'));var moment=require('moment');var BPromise=require(_0xefbd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefbd('0x5'));var rimraf=require(_0xefbd('0x6'));var config=require(_0xefbd('0x7'));var attributes=require(_0xefbd('0x8'));module[_0xefbd('0x9')]=function(_0x1a9041,_0x2eeecd){return _0x1a9041[_0xefbd('0xa')](_0xefbd('0xb'),attributes,{'tableName':_0xefbd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 9edc1f5..b87d8c0 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 _0xd026=['AnalyticDefaultReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x45f55c,_0x48e11b){var _0x1f3400=function(_0x5002b2){while(--_0x5002b2){_0x45f55c['push'](_0x45f55c['shift']());}};_0x1f3400(++_0x48e11b);}(_0xd026,0x16f));var _0x6d02=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd026[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x6d02('0x0'));var util=require(_0x6d02('0x1'));var moment=require(_0x6d02('0x2'));var BPromise=require(_0x6d02('0x3'));var rs=require(_0x6d02('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6d02('0x5'));var logger=require(_0x6d02('0x6'))(_0x6d02('0x7'));var config=require(_0x6d02('0x8'));var jayson=require(_0x6d02('0x9'));var client=jayson['client'][_0x6d02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cc9cb,_0x4b187c,_0x511b69){return new BPromise(function(_0x52b688,_0x2fcaf3){return client['request'](_0x3cc9cb,_0x511b69)['then'](function(_0x4fce9d){logger['info'](_0x6d02('0xb'),_0x4b187c,'request\x20sent');logger[_0x6d02('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4b187c,_0x6d02('0xd'),JSON['stringify'](_0x4fce9d));if(_0x4fce9d[_0x6d02('0xe')]){if(_0x4fce9d[_0x6d02('0xe')][_0x6d02('0xf')]===0x1f4){logger[_0x6d02('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b187c,_0x4fce9d[_0x6d02('0xe')][_0x6d02('0x10')]);return _0x2fcaf3(_0x4fce9d[_0x6d02('0xe')][_0x6d02('0x10')]);}logger[_0x6d02('0xe')](_0x6d02('0xb'),_0x4b187c,_0x4fce9d[_0x6d02('0xe')]['message']);return _0x52b688(_0x4fce9d[_0x6d02('0xe')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b187c,'request\x20sent');_0x52b688(_0x4fce9d[_0x6d02('0x11')]['message']);}})['catch'](function(_0x3993f5){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4b187c,_0x3993f5);_0x2fcaf3(_0x3993f5);});});}
\ No newline at end of file
+var _0xdb36=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xdb36,0x18a));var _0x6db3=function(_0x3e4ffb,_0x2660b7){_0x3e4ffb=_0x3e4ffb-0x0;var _0x2a0f23=_0xdb36[_0x3e4ffb];return _0x2a0f23;};'use strict';var _=require(_0x6db3('0x0'));var util=require('util');var moment=require(_0x6db3('0x1'));var BPromise=require(_0x6db3('0x2'));var rs=require(_0x6db3('0x3'));var fs=require('fs');var Redis=require(_0x6db3('0x4'));var db=require(_0x6db3('0x5'))['db'];var utils=require(_0x6db3('0x6'));var logger=require(_0x6db3('0x7'))(_0x6db3('0x8'));var config=require(_0x6db3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6db3('0xa')][_0x6db3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3951d7,_0x111a95,_0x42cbcb){return new BPromise(function(_0x292b23,_0x420dfb){return client[_0x6db3('0xc')](_0x3951d7,_0x42cbcb)[_0x6db3('0xd')](function(_0x2ff1bf){logger[_0x6db3('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x111a95,_0x6db3('0xf'));logger[_0x6db3('0x10')](_0x6db3('0x11'),_0x111a95,_0x6db3('0xf'),JSON[_0x6db3('0x12')](_0x2ff1bf));if(_0x2ff1bf[_0x6db3('0x13')]){if(_0x2ff1bf['error'][_0x6db3('0x14')]===0x1f4){logger['error'](_0x6db3('0x15'),_0x111a95,_0x2ff1bf[_0x6db3('0x13')][_0x6db3('0x16')]);return _0x420dfb(_0x2ff1bf[_0x6db3('0x13')][_0x6db3('0x16')]);}logger['error'](_0x6db3('0x15'),_0x111a95,_0x2ff1bf[_0x6db3('0x13')][_0x6db3('0x16')]);return _0x292b23(_0x2ff1bf[_0x6db3('0x13')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x111a95,_0x6db3('0xf'));_0x292b23(_0x2ff1bf[_0x6db3('0x17')]['message']);}})[_0x6db3('0x18')](function(_0x43778c){logger[_0x6db3('0x13')](_0x6db3('0x15'),_0x111a95,_0x43778c);_0x420dfb(_0x43778c);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 2d180c2..1f22238 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 _0xda98=['exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy'];(function(_0x1beb3c,_0x382881){var _0x21cc34=function(_0x13a312){while(--_0x13a312){_0x1beb3c['push'](_0x1beb3c['shift']());}};_0x21cc34(++_0x382881);}(_0xda98,0x1cd));var _0x8da9=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xda98[_0x485201];return _0x9ca98a;};'use strict';var multer=require(_0x8da9('0x0'));var util=require(_0x8da9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8da9('0x2'));var router=express[_0x8da9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8da9('0x4'));var config=require(_0x8da9('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x8da9('0x6')](),controller['index']);router[_0x8da9('0x7')](_0x8da9('0x8'),auth[_0x8da9('0x6')](),controller[_0x8da9('0x9')]);router[_0x8da9('0x7')]('/:id/preview',auth[_0x8da9('0x6')](),controller[_0x8da9('0xa')]);router[_0x8da9('0x7')](_0x8da9('0xb'),auth[_0x8da9('0x6')](),controller[_0x8da9('0xc')]);router[_0x8da9('0x7')](_0x8da9('0xd'),auth['isAuthenticated'](),controller[_0x8da9('0xe')]);router[_0x8da9('0xf')]('/',auth[_0x8da9('0x6')](),controller['create']);router[_0x8da9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8da9('0x11')](_0x8da9('0x8'),auth[_0x8da9('0x6')](),controller[_0x8da9('0x12')]);module[_0x8da9('0x13')]=router;
\ No newline at end of file
+var _0xeb47=['delete','exports','util','express','Router','fs-extra','../../components/auth/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','create','update'];(function(_0x25eec7,_0x545e27){var _0x4ec8c8=function(_0xd243f4){while(--_0xd243f4){_0x25eec7['push'](_0x25eec7['shift']());}};_0x4ec8c8(++_0x545e27);}(_0xeb47,0x1b7));var _0x7eb4=function(_0x56b16a,_0x134321){_0x56b16a=_0x56b16a-0x0;var _0x59fa56=_0xeb47[_0x56b16a];return _0x59fa56;};'use strict';var multer=require('multer');var util=require(_0x7eb4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7eb4('0x1'));var router=express[_0x7eb4('0x2')]();var fs_extra=require(_0x7eb4('0x3'));var auth=require(_0x7eb4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7eb4('0x5'));router[_0x7eb4('0x6')]('/',auth[_0x7eb4('0x7')](),controller[_0x7eb4('0x8')]);router[_0x7eb4('0x6')](_0x7eb4('0x9'),auth[_0x7eb4('0x7')](),controller['show']);router[_0x7eb4('0x6')](_0x7eb4('0xa'),auth[_0x7eb4('0x7')](),controller[_0x7eb4('0xb')]);router[_0x7eb4('0x6')](_0x7eb4('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x7eb4('0x6')](_0x7eb4('0xd'),auth[_0x7eb4('0x7')](),controller[_0x7eb4('0xe')]);router['post']('/',auth[_0x7eb4('0x7')](),controller[_0x7eb4('0xf')]);router['put'](_0x7eb4('0x9'),auth[_0x7eb4('0x7')](),controller[_0x7eb4('0x10')]);router[_0x7eb4('0x11')](_0x7eb4('0x9'),auth[_0x7eb4('0x7')](),controller['destroy']);module[_0x7eb4('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 9ae251c..902fea3 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 _0x1600=['xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM'];(function(_0x1414cd,_0x51f303){var _0xf72873=function(_0x3f074d){while(--_0x3f074d){_0x1414cd['push'](_0x1414cd['shift']());}};_0xf72873(++_0x51f303);}(_0x1600,0x1df));var _0x0160=function(_0xcf5c6c,_0x567c7c){_0xcf5c6c=_0xcf5c6c-0x0;var _0x18f5c2=_0x1600[_0xcf5c6c];return _0x18f5c2;};'use strict';var Sequelize=require(_0x0160('0x0'));var moment=require(_0x0160('0x1'));module[_0x0160('0x2')]={'name':{'type':Sequelize[_0x0160('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x0160('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x0160('0x4')]('csv','pdf',_0x0160('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x0160('0x6')]},'status':{'type':Sequelize[_0x0160('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x0160('0x4')](_0x0160('0x7'),_0x0160('0x8')),'allowNull':![],'defaultValue':_0x0160('0x7')},'reportId':{'type':Sequelize[_0x0160('0x9')](0xb)[_0x0160('0xa')]},'reportType':{'type':Sequelize[_0x0160('0x3')]}};
\ No newline at end of file
+var _0xa7e5=['manual','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xa7e5,0xf3));var _0x5a7e=function(_0x29423f,_0x587511){_0x29423f=_0x29423f-0x0;var _0xb914e3=_0xa7e5[_0x29423f];return _0xb914e3;};'use strict';var Sequelize=require(_0x5a7e('0x0'));var moment=require(_0x5a7e('0x1'));module[_0x5a7e('0x2')]={'name':{'type':Sequelize[_0x5a7e('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x5a7e('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x5a7e('0x4')](_0x5a7e('0x5'),_0x5a7e('0x6'),_0x5a7e('0x7')),'allowNull':![],'defaultValue':_0x5a7e('0x5')},'savename':{'type':Sequelize[_0x5a7e('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5a7e('0x8')]},'endDate':{'type':Sequelize[_0x5a7e('0x8')]},'status':{'type':Sequelize[_0x5a7e('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x5a7e('0x4')](_0x5a7e('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x5a7e('0x9')},'reportId':{'type':Sequelize[_0x5a7e('0xa')](0xb)[_0x5a7e('0xb')]},'reportType':{'type':Sequelize[_0x5a7e('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 83cea94..59d662e 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 _0xf429=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','error','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','AnalyticExtractedReport','count','include','findAll','rows','catch','show','params','keys','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','ValidationError','exists','download','server/files/reports','%s.%s','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x39157f,_0x3d8c1e){var _0x1ae4e2=function(_0x3429af){while(--_0x3429af){_0x39157f['push'](_0x39157f['shift']());}};_0x1ae4e2(++_0x3d8c1e);}(_0xf429,0x10c));var _0x9f42=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xf429[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9f42('0x0'));var jsonpatch=require(_0x9f42('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f42('0x2'));var Mustache=require(_0x9f42('0x3'));var util=require(_0x9f42('0x4'));var path=require(_0x9f42('0x5'));var sox=require(_0x9f42('0x6'));var csv=require(_0x9f42('0x7'));var ejs=require(_0x9f42('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f42('0x9'));var squel=require(_0x9f42('0xa'));var crypto=require('crypto');var jsforce=require(_0x9f42('0xb'));var deskjs=require(_0x9f42('0xc'));var toCsv=require(_0x9f42('0x7'));var querystring=require(_0x9f42('0xd'));var Papa=require(_0x9f42('0xe'));var Redis=require(_0x9f42('0xf'));var authService=require(_0x9f42('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f42('0x11'));var logger=require(_0x9f42('0x12'))(_0x9f42('0x13'));var utils=require(_0x9f42('0x14'));var config=require(_0x9f42('0x15'));var licenseUtil=require(_0x9f42('0x16'));var db=require(_0x9f42('0x17'))['db'];function respondWithStatusCode(_0x2574fb,_0xb09028){_0xb09028=_0xb09028||0xcc;return function(_0x146acf){if(_0x146acf){return _0x2574fb[_0x9f42('0x18')](_0xb09028);}return _0x2574fb['status'](_0xb09028)[_0x9f42('0x19')]();};}function respondWithResult(_0x4765b9,_0x517bf1){_0x517bf1=_0x517bf1||0xc8;return function(_0x5bcbdf){if(_0x5bcbdf){return _0x4765b9['status'](_0x517bf1)[_0x9f42('0x1a')](_0x5bcbdf);}};}function respondWithFilteredResult(_0x4263c0,_0x222669){return function(_0x21d071){if(_0x21d071){var _0x4124df=typeof _0x222669[_0x9f42('0x1b')]===_0x9f42('0x1c')&&typeof _0x222669[_0x9f42('0x1d')]===_0x9f42('0x1c');var _0x365897=_0x21d071['count'];var _0x41cff9=_0x4124df?0x0:_0x222669[_0x9f42('0x1b')];var _0x184715=_0x4124df?_0x21d071['count']:_0x222669[_0x9f42('0x1b')]+_0x222669[_0x9f42('0x1d')];var _0x3832d6;if(_0x184715>=_0x365897){_0x184715=_0x365897;_0x3832d6=0xc8;}else{_0x3832d6=0xce;}_0x4263c0[_0x9f42('0x1e')](_0x3832d6);return _0x4263c0[_0x9f42('0x1f')](_0x9f42('0x20'),_0x41cff9+'-'+_0x184715+'/'+_0x365897)[_0x9f42('0x1a')](_0x21d071);}return null;};}function patchUpdates(_0x4771e5){return function(_0x1a080b){try{jsonpatch[_0x9f42('0x21')](_0x1a080b,_0x4771e5,!![]);}catch(_0x4ccc77){return BPromise[_0x9f42('0x22')](_0x4ccc77);}return _0x1a080b[_0x9f42('0x23')]();};}function saveUpdates(_0x41a80b,_0x67c98e){return function(_0x34fc75){if(_0x34fc75){return _0x34fc75[_0x9f42('0x24')](_0x41a80b)['then'](function(_0x5ce0cd){return _0x5ce0cd;});}return null;};}function removeEntity(_0x3636f2,_0x2482fc){return function(_0x3a99e7){if(_0x3a99e7){return _0x3a99e7[_0x9f42('0x25')]()[_0x9f42('0x26')](function(){var _0x484731=_0x3a99e7['get']({'plain':!![]});var _0x44c221='ExtractedReports';return db['UserProfileResource'][_0x9f42('0x25')]({'where':{'type':_0x44c221,'resourceId':_0x484731['id']}})['then'](function(){return _0x3a99e7;});})[_0x9f42('0x26')](function(){_0x3636f2[_0x9f42('0x1e')](0xcc)[_0x9f42('0x19')]();});}};}function handleEntityNotFound(_0x5981b3,_0x136dc6){return function(_0x86bae9){if(!_0x86bae9){_0x5981b3[_0x9f42('0x18')](0x194);}return _0x86bae9;};}function handleError(_0x44f289,_0xf220f4){_0xf220f4=_0xf220f4||0x1f4;return function(_0x4ab4c4){logger[_0x9f42('0x27')](_0x4ab4c4['stack']);if(_0x4ab4c4[_0x9f42('0x28')]){delete _0x4ab4c4[_0x9f42('0x28')];}_0x44f289[_0x9f42('0x1e')](_0xf220f4)['send'](_0x4ab4c4);};}exports['index']=function(_0x2d6685,_0x3be8a3){var _0x19d0f6={},_0x216d07={},_0x724b8d={'count':0x0,'rows':[]};var _0x3d989c=_[_0x9f42('0x29')](db['AnalyticExtractedReport'][_0x9f42('0x2a')],function(_0x197eb6){return{'name':_0x197eb6[_0x9f42('0x2b')],'type':_0x197eb6['type'][_0x9f42('0x2c')]};});_0x216d07[_0x9f42('0x2d')]=_[_0x9f42('0x29')](_0x3d989c,_0x9f42('0x28'));_0x216d07[_0x9f42('0x2e')]=_['keys'](_0x2d6685[_0x9f42('0x2e')]);_0x216d07[_0x9f42('0x2f')]=_[_0x9f42('0x30')](_0x216d07[_0x9f42('0x2d')],_0x216d07[_0x9f42('0x2e')]);_0x19d0f6[_0x9f42('0x31')]=_[_0x9f42('0x30')](_0x216d07[_0x9f42('0x2d')],qs['fields'](_0x2d6685[_0x9f42('0x2e')][_0x9f42('0x32')]));_0x19d0f6[_0x9f42('0x31')]=_0x19d0f6['attributes']['length']?_0x19d0f6[_0x9f42('0x31')]:_0x216d07[_0x9f42('0x2d')];if(!_0x2d6685[_0x9f42('0x2e')][_0x9f42('0x33')](_0x9f42('0x34'))){_0x19d0f6[_0x9f42('0x1d')]=qs[_0x9f42('0x1d')](_0x2d6685['query'][_0x9f42('0x1d')]);_0x19d0f6['offset']=qs[_0x9f42('0x1b')](_0x2d6685[_0x9f42('0x2e')]['offset']);}_0x19d0f6[_0x9f42('0x35')]=qs['sort'](_0x2d6685[_0x9f42('0x2e')]['sort']);_0x19d0f6[_0x9f42('0x36')]=qs['filters'](_[_0x9f42('0x37')](_0x2d6685['query'],_0x216d07[_0x9f42('0x2f')]),_0x3d989c);if(_0x2d6685[_0x9f42('0x2e')]['filter']){_0x19d0f6['where']=_[_0x9f42('0x38')](_0x19d0f6[_0x9f42('0x36')],{'$or':_['map'](_0x3d989c,function(_0x76d32f){if(_0x76d32f['type']!==_0x9f42('0x39')){var _0x449f39={};_0x449f39[_0x76d32f['name']]={'$like':'%'+_0x2d6685[_0x9f42('0x2e')][_0x9f42('0x3a')]+'%'};return _0x449f39;}})});}_0x19d0f6=_[_0x9f42('0x38')]({},_0x19d0f6,_0x2d6685[_0x9f42('0x3b')]);var _0x2aaf2c={'where':_0x19d0f6[_0x9f42('0x36')]};return db[_0x9f42('0x3c')][_0x9f42('0x3d')](_0x2aaf2c)[_0x9f42('0x26')](function(_0x2f7e33){_0x724b8d['count']=_0x2f7e33;if(_0x2d6685[_0x9f42('0x2e')]['includeAll']){_0x19d0f6[_0x9f42('0x3e')]=[{'all':!![]}];}return db[_0x9f42('0x3c')][_0x9f42('0x3f')](_0x19d0f6);})[_0x9f42('0x26')](function(_0x40ddc7){_0x724b8d[_0x9f42('0x40')]=_0x40ddc7;return _0x724b8d;})[_0x9f42('0x26')](respondWithFilteredResult(_0x3be8a3,_0x19d0f6))[_0x9f42('0x41')](handleError(_0x3be8a3,null));};exports[_0x9f42('0x42')]=function(_0x1efb38,_0x745a13){var _0x163667={'raw':!![],'where':{'id':_0x1efb38[_0x9f42('0x43')]['id']}},_0x2b39cb={};_0x2b39cb[_0x9f42('0x2d')]=_[_0x9f42('0x44')](db['AnalyticExtractedReport'][_0x9f42('0x2a')]);_0x2b39cb[_0x9f42('0x2e')]=_[_0x9f42('0x44')](_0x1efb38[_0x9f42('0x2e')]);_0x2b39cb['filters']=_[_0x9f42('0x30')](_0x2b39cb[_0x9f42('0x2d')],_0x2b39cb[_0x9f42('0x2e')]);_0x163667[_0x9f42('0x31')]=_[_0x9f42('0x30')](_0x2b39cb[_0x9f42('0x2d')],qs['fields'](_0x1efb38['query'][_0x9f42('0x32')]));_0x163667[_0x9f42('0x31')]=_0x163667[_0x9f42('0x31')][_0x9f42('0x45')]?_0x163667[_0x9f42('0x31')]:_0x2b39cb['model'];if(_0x1efb38[_0x9f42('0x2e')][_0x9f42('0x46')]){_0x163667[_0x9f42('0x3e')]=[{'all':!![]}];}_0x163667=_[_0x9f42('0x38')]({},_0x163667,_0x1efb38[_0x9f42('0x3b')]);return db[_0x9f42('0x3c')][_0x9f42('0x47')](_0x163667)[_0x9f42('0x26')](handleEntityNotFound(_0x745a13,null))[_0x9f42('0x26')](respondWithResult(_0x745a13,null))[_0x9f42('0x41')](handleError(_0x745a13,null));};exports[_0x9f42('0x48')]=function(_0x2babc9,_0x229c92){return db[_0x9f42('0x3c')][_0x9f42('0x48')](_0x2babc9[_0x9f42('0x49')],{})['then'](function(_0x29f41b){var _0x9446fd=_0x2babc9['user'][_0x9f42('0x4a')]({'plain':!![]});if(!_0x9446fd)throw new Error(_0x9f42('0x4b'));if(_0x9446fd[_0x9f42('0x4c')]===_0x9f42('0x4d')){var _0x533214=_0x29f41b['get']({'plain':!![]});var _0x32fc44='ExtractedReports';return db[_0x9f42('0x4e')][_0x9f42('0x47')]({'where':{'name':_0x32fc44,'userProfileId':_0x9446fd[_0x9f42('0x4f')]},'raw':!![]})[_0x9f42('0x26')](function(_0x3a3aa6){if(_0x3a3aa6&&_0x3a3aa6[_0x9f42('0x50')]===0x0){return db[_0x9f42('0x51')][_0x9f42('0x48')]({'name':_0x533214['name'],'resourceId':_0x533214['id'],'type':_0x3a3aa6[_0x9f42('0x28')],'sectionId':_0x3a3aa6['id']},{})[_0x9f42('0x26')](function(){return _0x29f41b;});}else{return _0x29f41b;}})['catch'](function(_0x4e1725){logger[_0x9f42('0x27')](_0x9f42('0x52'),_0x4e1725);throw _0x4e1725;});}return _0x29f41b;})[_0x9f42('0x26')](respondWithResult(_0x229c92,0xc9))[_0x9f42('0x41')](handleError(_0x229c92,null));};exports['update']=function(_0x18af84,_0x4c4cc0){if(_0x18af84[_0x9f42('0x49')]['id']){delete _0x18af84[_0x9f42('0x49')]['id'];}return db[_0x9f42('0x3c')]['find']({'where':{'id':_0x18af84['params']['id']}})[_0x9f42('0x26')](handleEntityNotFound(_0x4c4cc0,null))[_0x9f42('0x26')](saveUpdates(_0x18af84[_0x9f42('0x49')],null))['then'](respondWithResult(_0x4c4cc0,null))['catch'](handleError(_0x4c4cc0,null));};exports[_0x9f42('0x25')]=function(_0x94f732,_0x3204dd){return db[_0x9f42('0x3c')][_0x9f42('0x47')]({'where':{'id':_0x94f732[_0x9f42('0x43')]['id']}})['then'](handleEntityNotFound(_0x3204dd,null))[_0x9f42('0x26')](removeEntity(_0x3204dd,null))[_0x9f42('0x41')](handleError(_0x3204dd,null));};exports['download']=function(_0x3d11be,_0x48ab4e,_0x162c83){return db[_0x9f42('0x3c')][_0x9f42('0x47')]({'where':{'id':_0x3d11be['params']['id']},'attributes':[_0x9f42('0x28'),_0x9f42('0x53'),_0x9f42('0x54'),_0x9f42('0x55')],'raw':!![]})[_0x9f42('0x26')](handleEntityNotFound(_0x48ab4e,null))[_0x9f42('0x26')](function(_0x260a98){if(_0x260a98){if(!fs[_0x9f42('0x56')](path[_0x9f42('0x57')](config[_0x9f42('0x58')],'server/files/reports',_0x260a98[_0x9f42('0x54')]))){throw new db['Sequelize'][(_0x9f42('0x59'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x3d11be[_0x9f42('0x2e')][_0x9f42('0x5a')]){return _0x48ab4e['sendStatus'](0xc8);}return _0x48ab4e[_0x9f42('0x5b')](path[_0x9f42('0x57')](config[_0x9f42('0x58')],_0x9f42('0x5c'),_0x260a98[_0x9f42('0x54')]),util['format'](_0x9f42('0x5d'),_0x260a98[_0x9f42('0x53')]||_0x260a98[_0x9f42('0x28')],_0x260a98[_0x9f42('0x55')]['toLowerCase']()));}})[_0x9f42('0x41')](handleError(_0x48ab4e,null));};
\ No newline at end of file
+var _0x869b=['key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','findAll','rows','show','params','keys','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','get','ExtractedReports','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x869b,0x152));var _0xb869=function(_0x31131a,_0x4d32b8){_0x31131a=_0x31131a-0x0;var _0x25988f=_0x869b[_0x31131a];return _0x25988f;};'use strict';var emlformat=require(_0xb869('0x0'));var rimraf=require(_0xb869('0x1'));var zipdir=require(_0xb869('0x2'));var jsonpatch=require(_0xb869('0x3'));var rp=require(_0xb869('0x4'));var moment=require('moment');var BPromise=require(_0xb869('0x5'));var Mustache=require(_0xb869('0x6'));var util=require(_0xb869('0x7'));var path=require('path');var sox=require(_0xb869('0x8'));var csv=require(_0xb869('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb869('0xa'));var _=require(_0xb869('0xb'));var squel=require(_0xb869('0xc'));var crypto=require('crypto');var jsforce=require(_0xb869('0xd'));var deskjs=require(_0xb869('0xe'));var toCsv=require(_0xb869('0x9'));var querystring=require('querystring');var Papa=require(_0xb869('0xf'));var Redis=require('ioredis');var authService=require(_0xb869('0x10'));var qs=require(_0xb869('0x11'));var as=require(_0xb869('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb869('0x13'))(_0xb869('0x14'));var utils=require(_0xb869('0x15'));var config=require(_0xb869('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd3ca6b,_0x2dc526){_0x2dc526=_0x2dc526||0xcc;return function(_0xb6422b){if(_0xb6422b){return _0xd3ca6b[_0xb869('0x17')](_0x2dc526);}return _0xd3ca6b[_0xb869('0x18')](_0x2dc526)[_0xb869('0x19')]();};}function respondWithResult(_0x51bafc,_0x4b5b80){_0x4b5b80=_0x4b5b80||0xc8;return function(_0xf88f23){if(_0xf88f23){return _0x51bafc[_0xb869('0x18')](_0x4b5b80)['json'](_0xf88f23);}};}function respondWithFilteredResult(_0x56f5cf,_0x4c2819){return function(_0x1ddb5b){if(_0x1ddb5b){var _0x59122e=typeof _0x4c2819['offset']===_0xb869('0x1a')&&typeof _0x4c2819[_0xb869('0x1b')]===_0xb869('0x1a');var _0x350ee9=_0x1ddb5b[_0xb869('0x1c')];var _0x4f93fd=_0x59122e?0x0:_0x4c2819[_0xb869('0x1d')];var _0x2de6d9=_0x59122e?_0x1ddb5b['count']:_0x4c2819[_0xb869('0x1d')]+_0x4c2819[_0xb869('0x1b')];var _0x339fb4;if(_0x2de6d9>=_0x350ee9){_0x2de6d9=_0x350ee9;_0x339fb4=0xc8;}else{_0x339fb4=0xce;}_0x56f5cf[_0xb869('0x18')](_0x339fb4);return _0x56f5cf[_0xb869('0x1e')](_0xb869('0x1f'),_0x4f93fd+'-'+_0x2de6d9+'/'+_0x350ee9)[_0xb869('0x20')](_0x1ddb5b);}return null;};}function patchUpdates(_0x4e6a17){return function(_0x347b99){try{jsonpatch['apply'](_0x347b99,_0x4e6a17,!![]);}catch(_0x2b20be){return BPromise[_0xb869('0x21')](_0x2b20be);}return _0x347b99[_0xb869('0x22')]();};}function saveUpdates(_0x584f77,_0x4eed56){return function(_0x4a5268){if(_0x4a5268){return _0x4a5268[_0xb869('0x23')](_0x584f77)[_0xb869('0x24')](function(_0x379040){return _0x379040;});}return null;};}function removeEntity(_0x5550f1,_0x4777c5){return function(_0x53ea95){if(_0x53ea95){return _0x53ea95['destroy']()[_0xb869('0x24')](function(){var _0x3e0a39=_0x53ea95[_0xb869('0x25')]({'plain':!![]});var _0x387ed1=_0xb869('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x387ed1,'resourceId':_0x3e0a39['id']}})['then'](function(){return _0x53ea95;});})[_0xb869('0x24')](function(){_0x5550f1[_0xb869('0x18')](0xcc)[_0xb869('0x19')]();});}};}function handleEntityNotFound(_0x1b397e,_0x49a076){return function(_0x2f41fe){if(!_0x2f41fe){_0x1b397e[_0xb869('0x17')](0x194);}return _0x2f41fe;};}function handleError(_0x5ff7fa,_0x5792c9){_0x5792c9=_0x5792c9||0x1f4;return function(_0x1fdaf4){logger['error'](_0x1fdaf4[_0xb869('0x27')]);if(_0x1fdaf4[_0xb869('0x28')]){delete _0x1fdaf4['name'];}_0x5ff7fa[_0xb869('0x18')](_0x5792c9)[_0xb869('0x29')](_0x1fdaf4);};}exports[_0xb869('0x2a')]=function(_0x34453c,_0x12b6a1){var _0x2cabc6={},_0x1712c6={},_0x2575ec={'count':0x0,'rows':[]};var _0x570a0d=_['map'](db[_0xb869('0x2b')][_0xb869('0x2c')],function(_0x20c7f2){return{'name':_0x20c7f2[_0xb869('0x2d')],'type':_0x20c7f2['type'][_0xb869('0x2e')]};});_0x1712c6[_0xb869('0x2f')]=_[_0xb869('0x30')](_0x570a0d,_0xb869('0x28'));_0x1712c6[_0xb869('0x31')]=_['keys'](_0x34453c[_0xb869('0x31')]);_0x1712c6[_0xb869('0x32')]=_[_0xb869('0x33')](_0x1712c6[_0xb869('0x2f')],_0x1712c6[_0xb869('0x31')]);_0x2cabc6[_0xb869('0x34')]=_[_0xb869('0x33')](_0x1712c6[_0xb869('0x2f')],qs[_0xb869('0x35')](_0x34453c[_0xb869('0x31')][_0xb869('0x35')]));_0x2cabc6[_0xb869('0x34')]=_0x2cabc6['attributes'][_0xb869('0x36')]?_0x2cabc6[_0xb869('0x34')]:_0x1712c6['model'];if(!_0x34453c['query']['hasOwnProperty'](_0xb869('0x37'))){_0x2cabc6['limit']=qs[_0xb869('0x1b')](_0x34453c[_0xb869('0x31')][_0xb869('0x1b')]);_0x2cabc6[_0xb869('0x1d')]=qs[_0xb869('0x1d')](_0x34453c[_0xb869('0x31')][_0xb869('0x1d')]);}_0x2cabc6[_0xb869('0x38')]=qs[_0xb869('0x39')](_0x34453c[_0xb869('0x31')]['sort']);_0x2cabc6[_0xb869('0x3a')]=qs[_0xb869('0x32')](_['pick'](_0x34453c[_0xb869('0x31')],_0x1712c6['filters']),_0x570a0d);if(_0x34453c['query']['filter']){_0x2cabc6[_0xb869('0x3a')]=_[_0xb869('0x3b')](_0x2cabc6[_0xb869('0x3a')],{'$or':_['map'](_0x570a0d,function(_0x29478c){if(_0x29478c[_0xb869('0x3c')]!=='VIRTUAL'){var _0x2bd20a={};_0x2bd20a[_0x29478c[_0xb869('0x28')]]={'$like':'%'+_0x34453c[_0xb869('0x31')][_0xb869('0x3d')]+'%'};return _0x2bd20a;}})});}_0x2cabc6=_['merge']({},_0x2cabc6,_0x34453c[_0xb869('0x3e')]);var _0x170935={'where':_0x2cabc6[_0xb869('0x3a')]};return db[_0xb869('0x2b')][_0xb869('0x1c')](_0x170935)[_0xb869('0x24')](function(_0x2f4571){_0x2575ec[_0xb869('0x1c')]=_0x2f4571;if(_0x34453c['query'][_0xb869('0x3f')]){_0x2cabc6[_0xb869('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xb869('0x41')](_0x2cabc6);})[_0xb869('0x24')](function(_0x546d97){_0x2575ec[_0xb869('0x42')]=_0x546d97;return _0x2575ec;})[_0xb869('0x24')](respondWithFilteredResult(_0x12b6a1,_0x2cabc6))['catch'](handleError(_0x12b6a1,null));};exports[_0xb869('0x43')]=function(_0x384550,_0xdc17d6){var _0x5acef8={'raw':!![],'where':{'id':_0x384550[_0xb869('0x44')]['id']}},_0x59cb5b={};_0x59cb5b['model']=_[_0xb869('0x45')](db['AnalyticExtractedReport']['rawAttributes']);_0x59cb5b[_0xb869('0x31')]=_[_0xb869('0x45')](_0x384550[_0xb869('0x31')]);_0x59cb5b[_0xb869('0x32')]=_['intersection'](_0x59cb5b[_0xb869('0x2f')],_0x59cb5b[_0xb869('0x31')]);_0x5acef8[_0xb869('0x34')]=_[_0xb869('0x33')](_0x59cb5b['model'],qs[_0xb869('0x35')](_0x384550['query']['fields']));_0x5acef8[_0xb869('0x34')]=_0x5acef8['attributes'][_0xb869('0x36')]?_0x5acef8[_0xb869('0x34')]:_0x59cb5b[_0xb869('0x2f')];if(_0x384550['query'][_0xb869('0x3f')]){_0x5acef8[_0xb869('0x40')]=[{'all':!![]}];}_0x5acef8=_[_0xb869('0x3b')]({},_0x5acef8,_0x384550[_0xb869('0x3e')]);return db[_0xb869('0x2b')][_0xb869('0x46')](_0x5acef8)[_0xb869('0x24')](handleEntityNotFound(_0xdc17d6,null))[_0xb869('0x24')](respondWithResult(_0xdc17d6,null))[_0xb869('0x47')](handleError(_0xdc17d6,null));};exports['create']=function(_0x1bbdd5,_0x422861){return db[_0xb869('0x2b')]['create'](_0x1bbdd5['body'],{})[_0xb869('0x24')](function(_0x2f859d){var _0x31292d=_0x1bbdd5[_0xb869('0x48')]['get']({'plain':!![]});if(!_0x31292d)throw new Error(_0xb869('0x49'));if(_0x31292d[_0xb869('0x4a')]===_0xb869('0x48')){var _0x4dbca9=_0x2f859d[_0xb869('0x25')]({'plain':!![]});var _0x28cb71=_0xb869('0x26');return db[_0xb869('0x4b')]['find']({'where':{'name':_0x28cb71,'userProfileId':_0x31292d[_0xb869('0x4c')]},'raw':!![]})['then'](function(_0x4b5a32){if(_0x4b5a32&&_0x4b5a32[_0xb869('0x4d')]===0x0){return db['UserProfileResource'][_0xb869('0x4e')]({'name':_0x4dbca9[_0xb869('0x28')],'resourceId':_0x4dbca9['id'],'type':_0x4b5a32[_0xb869('0x28')],'sectionId':_0x4b5a32['id']},{})['then'](function(){return _0x2f859d;});}else{return _0x2f859d;}})[_0xb869('0x47')](function(_0x5f514d){logger[_0xb869('0x4f')](_0xb869('0x50'),_0x5f514d);throw _0x5f514d;});}return _0x2f859d;})['then'](respondWithResult(_0x422861,0xc9))[_0xb869('0x47')](handleError(_0x422861,null));};exports[_0xb869('0x23')]=function(_0x57b865,_0x48021a){if(_0x57b865[_0xb869('0x51')]['id']){delete _0x57b865['body']['id'];}return db[_0xb869('0x2b')][_0xb869('0x46')]({'where':{'id':_0x57b865[_0xb869('0x44')]['id']}})['then'](handleEntityNotFound(_0x48021a,null))[_0xb869('0x24')](saveUpdates(_0x57b865[_0xb869('0x51')],null))[_0xb869('0x24')](respondWithResult(_0x48021a,null))[_0xb869('0x47')](handleError(_0x48021a,null));};exports['destroy']=function(_0x1b0007,_0x322d49){return db[_0xb869('0x2b')][_0xb869('0x46')]({'where':{'id':_0x1b0007['params']['id']}})[_0xb869('0x24')](handleEntityNotFound(_0x322d49,null))[_0xb869('0x24')](removeEntity(_0x322d49,null))['catch'](handleError(_0x322d49,null));};exports[_0xb869('0x52')]=function(_0xbc3d2b,_0x445264,_0x217ff5){return db[_0xb869('0x2b')]['find']({'where':{'id':_0xbc3d2b['params']['id']},'attributes':['name',_0xb869('0x53'),_0xb869('0x54'),_0xb869('0x55')],'raw':!![]})[_0xb869('0x24')](handleEntityNotFound(_0x445264,null))[_0xb869('0x24')](function(_0x180103){if(_0x180103){if(!fs[_0xb869('0x56')](path[_0xb869('0x57')](config['root'],_0xb869('0x58'),_0x180103['savename']))){throw new db[(_0xb869('0x59'))][(_0xb869('0x5a'))](_0xb869('0x5b'));}if(_0xbc3d2b['query'][_0xb869('0x5c')]){return _0x445264['sendStatus'](0xc8);}return _0x445264[_0xb869('0x52')](path['join'](config['root'],_0xb869('0x58'),_0x180103['savename']),util[_0xb869('0x5d')](_0xb869('0x5e'),_0x180103['basename']||_0x180103['name'],_0x180103['output'][_0xb869('0x5f')]()));}})[_0xb869('0x47')](handleError(_0x445264,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 20edaaf..14dd132 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 _0xf2d5=['request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x11975f,_0x41f438){var _0x1ecee8=function(_0x377330){while(--_0x377330){_0x11975f['push'](_0x11975f['shift']());}};_0x1ecee8(++_0x41f438);}(_0xf2d5,0x108));var _0x5f2d=function(_0x138880,_0x29e3fc){_0x138880=_0x138880-0x0;var _0x3860f5=_0xf2d5[_0x138880];return _0x3860f5;};'use strict';var _=require(_0x5f2d('0x0'));var util=require(_0x5f2d('0x1'));var logger=require(_0x5f2d('0x2'))(_0x5f2d('0x3'));var moment=require(_0x5f2d('0x4'));var BPromise=require(_0x5f2d('0x5'));var rp=require(_0x5f2d('0x6'));var fs=require('fs');var path=require(_0x5f2d('0x7'));var rimraf=require(_0x5f2d('0x8'));var config=require(_0x5f2d('0x9'));var attributes=require(_0x5f2d('0xa'));module[_0x5f2d('0xb')]=function(_0xddd385,_0x32bcb2){return _0xddd385[_0x5f2d('0xc')](_0x5f2d('0xd'),attributes,{'tableName':_0x5f2d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa92b=['AnalyticExtractedReport','../../config/logger','api','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x478a3b,_0x68172){var _0x1d3cf6=function(_0x52e9e0){while(--_0x52e9e0){_0x478a3b['push'](_0x478a3b['shift']());}};_0x1d3cf6(++_0x68172);}(_0xa92b,0x19f));var _0xba92=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xa92b[_0x1fd675];return _0x16b554;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba92('0x0'))(_0xba92('0x1'));var moment=require(_0xba92('0x2'));var BPromise=require('bluebird');var rp=require(_0xba92('0x3'));var fs=require('fs');var path=require(_0xba92('0x4'));var rimraf=require(_0xba92('0x5'));var config=require('../../config/environment');var attributes=require(_0xba92('0x6'));module[_0xba92('0x7')]=function(_0x314c2e,_0x583ea3){return _0x314c2e['define'](_0xba92('0x8'),attributes,{'tableName':'analytics_extracted_reports','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 efc1bd2..c4b3b8a 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 _0x1b1b=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e10a1,_0x3dd6c2){var _0x43a79b=function(_0x405b32){while(--_0x405b32){_0x4e10a1['push'](_0x4e10a1['shift']());}};_0x43a79b(++_0x3dd6c2);}(_0x1b1b,0x1be));var _0xb1b1=function(_0x2dae0c,_0x3b578c){_0x2dae0c=_0x2dae0c-0x0;var _0x36c35b=_0x1b1b[_0x2dae0c];return _0x36c35b;};'use strict';var _=require(_0xb1b1('0x0'));var util=require(_0xb1b1('0x1'));var moment=require(_0xb1b1('0x2'));var BPromise=require(_0xb1b1('0x3'));var rs=require(_0xb1b1('0x4'));var fs=require('fs');var Redis=require(_0xb1b1('0x5'));var db=require(_0xb1b1('0x6'))['db'];var utils=require(_0xb1b1('0x7'));var logger=require(_0xb1b1('0x8'))(_0xb1b1('0x9'));var config=require(_0xb1b1('0xa'));var jayson=require(_0xb1b1('0xb'));var client=jayson[_0xb1b1('0xc')][_0xb1b1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x13b731,_0x35479f,_0x1bf2af){return new BPromise(function(_0x3007a2,_0x43557c){return client[_0xb1b1('0xe')](_0x13b731,_0x1bf2af)['then'](function(_0x41eac8){logger['info'](_0xb1b1('0xf'),_0x35479f,_0xb1b1('0x10'));logger[_0xb1b1('0x11')](_0xb1b1('0x12'),_0x35479f,_0xb1b1('0x10'),JSON[_0xb1b1('0x13')](_0x41eac8));if(_0x41eac8[_0xb1b1('0x14')]){if(_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x15')]===0x1f4){logger[_0xb1b1('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x35479f,_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x16')]);return _0x43557c(_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x16')]);}logger[_0xb1b1('0x14')](_0xb1b1('0xf'),_0x35479f,_0x41eac8[_0xb1b1('0x14')][_0xb1b1('0x16')]);return _0x3007a2(_0x41eac8['error']['message']);}else{logger[_0xb1b1('0x17')](_0xb1b1('0xf'),_0x35479f,_0xb1b1('0x10'));_0x3007a2(_0x41eac8[_0xb1b1('0x18')]['message']);}})[_0xb1b1('0x19')](function(_0x2e9c6d){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x35479f,_0x2e9c6d);_0x43557c(_0x2e9c6d);});});}
\ No newline at end of file
+var _0xed91=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x483888,_0x2ff778){var _0x4be161=function(_0x1c1915){while(--_0x1c1915){_0x483888['push'](_0x483888['shift']());}};_0x4be161(++_0x2ff778);}(_0xed91,0x185));var _0x1ed9=function(_0x1af1af,_0x4f2cb5){_0x1af1af=_0x1af1af-0x0;var _0x431458=_0xed91[_0x1af1af];return _0x431458;};'use strict';var _=require('lodash');var util=require(_0x1ed9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1ed9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ed9('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1ed9('0x3'));var config=require(_0x1ed9('0x4'));var jayson=require(_0x1ed9('0x5'));var client=jayson[_0x1ed9('0x6')][_0x1ed9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b880f,_0x24eb98,_0x2cd480){return new BPromise(function(_0x11d588,_0x36a14f){return client[_0x1ed9('0x8')](_0x1b880f,_0x2cd480)[_0x1ed9('0x9')](function(_0x513dbc){logger[_0x1ed9('0xa')](_0x1ed9('0xb'),_0x24eb98,_0x1ed9('0xc'));logger['debug'](_0x1ed9('0xd'),_0x24eb98,_0x1ed9('0xc'),JSON[_0x1ed9('0xe')](_0x513dbc));if(_0x513dbc['error']){if(_0x513dbc[_0x1ed9('0xf')][_0x1ed9('0x10')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x24eb98,_0x513dbc[_0x1ed9('0xf')]['message']);return _0x36a14f(_0x513dbc['error'][_0x1ed9('0x11')]);}logger[_0x1ed9('0xf')](_0x1ed9('0xb'),_0x24eb98,_0x513dbc['error'][_0x1ed9('0x11')]);return _0x11d588(_0x513dbc['error']['message']);}else{logger[_0x1ed9('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x24eb98,_0x1ed9('0xc'));_0x11d588(_0x513dbc[_0x1ed9('0x12')]['message']);}})['catch'](function(_0x1afba2){logger[_0x1ed9('0xf')](_0x1ed9('0xb'),_0x24eb98,_0x1afba2);_0x36a14f(_0x1afba2);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 84174a9..a65016c 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 _0x5433=['./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x5433,0x9c));var _0x3543=function(_0x5b22b7,_0x54986f){_0x5b22b7=_0x5b22b7-0x0;var _0xc92d7c=_0x5433[_0x5b22b7];return _0xc92d7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3543('0x0'));var timeout=require(_0x3543('0x1'));var express=require(_0x3543('0x2'));var router=express[_0x3543('0x3')]();var fs_extra=require(_0x3543('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3543('0x5'));var config=require('../../config/environment');var controller=require(_0x3543('0x6'));router[_0x3543('0x7')]('/',auth[_0x3543('0x8')](),controller[_0x3543('0x9')]);router[_0x3543('0x7')](_0x3543('0xa'),auth[_0x3543('0x8')](),controller[_0x3543('0xb')]);router[_0x3543('0x7')](_0x3543('0xc'),auth[_0x3543('0x8')](),controller[_0x3543('0xd')]);router[_0x3543('0xe')]('/',auth[_0x3543('0x8')](),controller[_0x3543('0xf')]);router['put'](_0x3543('0xa'),auth[_0x3543('0x8')](),controller[_0x3543('0x10')]);router['delete'](_0x3543('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x3543('0x11')]=router;
\ No newline at end of file
+var _0x54ef=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','/:id/download','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2d02bd,_0x55e476){var _0x82d9a2=function(_0x1001b9){while(--_0x1001b9){_0x2d02bd['push'](_0x2d02bd['shift']());}};_0x82d9a2(++_0x55e476);}(_0x54ef,0xff));var _0xf54e=function(_0x554b10,_0xd88236){_0x554b10=_0x554b10-0x0;var _0x350b54=_0x54ef[_0x554b10];return _0x350b54;};'use strict';var multer=require('multer');var util=require(_0xf54e('0x0'));var path=require('path');var timeout=require(_0xf54e('0x1'));var express=require(_0xf54e('0x2'));var router=express[_0xf54e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf54e('0x4'));var interaction=require(_0xf54e('0x5'));var config=require(_0xf54e('0x6'));var controller=require(_0xf54e('0x7'));router['get']('/',auth[_0xf54e('0x8')](),controller[_0xf54e('0x9')]);router[_0xf54e('0xa')](_0xf54e('0xb'),auth[_0xf54e('0x8')](),controller['show']);router[_0xf54e('0xa')](_0xf54e('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xf54e('0xd')]('/',auth[_0xf54e('0x8')](),controller[_0xf54e('0xe')]);router[_0xf54e('0xf')]('/:id',auth[_0xf54e('0x8')](),controller[_0xf54e('0x10')]);router[_0xf54e('0x11')]('/:id',auth[_0xf54e('0x8')](),controller[_0xf54e('0x12')]);module[_0xf54e('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index c372de2..9cd7f74 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 _0x0212=['STRING','BOOLEAN','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0212,0x1f1));var _0x2021=function(_0x411069,_0x16ae05){_0x411069=_0x411069-0x0;var _0x68c645=_0x0212[_0x411069];return _0x68c645;};'use strict';var Sequelize=require('sequelize');module[_0x2021('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x2021('0x1')]},'function':{'type':Sequelize[_0x2021('0x1')]},'format':{'type':Sequelize[_0x2021('0x1')]},'groupBy':{'type':Sequelize[_0x2021('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2021('0x1')]},'custom':{'type':Sequelize[_0x2021('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb234=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3a3c17,_0x5b7b7e){var _0xd07f21=function(_0xeaad44){while(--_0xeaad44){_0x3a3c17['push'](_0x3a3c17['shift']());}};_0xd07f21(++_0x5b7b7e);}(_0xb234,0x136));var _0x4b23=function(_0x5bd2e2,_0x246980){_0x5bd2e2=_0x5bd2e2-0x0;var _0x7ceb33=_0xb234[_0x5bd2e2];return _0x7ceb33;};'use strict';var Sequelize=require(_0x4b23('0x0'));module[_0x4b23('0x1')]={'field':{'type':Sequelize[_0x4b23('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4b23('0x3')]},'custom':{'type':Sequelize[_0x4b23('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 93061f8..ea2211c 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 _0x31ec=['mustache','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','AnalyticFieldReport','then','includeAll','include','rows','catch','show','params','options','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x322719,_0x16b381){var _0x30cb6f=function(_0x1e5698){while(--_0x1e5698){_0x322719['push'](_0x322719['shift']());}};_0x30cb6f(++_0x16b381);}(_0x31ec,0x13a));var _0xc31e=function(_0x441b5e,_0x2a8ce8){_0x441b5e=_0x441b5e-0x0;var _0xe75f16=_0x31ec[_0x441b5e];return _0xe75f16;};'use strict';var emlformat=require(_0xc31e('0x0'));var rimraf=require(_0xc31e('0x1'));var zipdir=require(_0xc31e('0x2'));var jsonpatch=require(_0xc31e('0x3'));var rp=require(_0xc31e('0x4'));var moment=require(_0xc31e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc31e('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc31e('0x7'));var csv=require(_0xc31e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc31e('0x9'));var squel=require(_0xc31e('0xa'));var crypto=require(_0xc31e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc31e('0x8'));var querystring=require(_0xc31e('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc31e('0xd'));var qs=require(_0xc31e('0xe'));var as=require(_0xc31e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc31e('0x10'))(_0xc31e('0x11'));var utils=require('../../config/utils');var config=require(_0xc31e('0x12'));var licenseUtil=require(_0xc31e('0x13'));var db=require(_0xc31e('0x14'))['db'];function respondWithStatusCode(_0x806e6e,_0xa6b5bd){_0xa6b5bd=_0xa6b5bd||0xcc;return function(_0x561ad5){if(_0x561ad5){return _0x806e6e[_0xc31e('0x15')](_0xa6b5bd);}return _0x806e6e[_0xc31e('0x16')](_0xa6b5bd)[_0xc31e('0x17')]();};}function respondWithResult(_0x408161,_0x4a89cc){_0x4a89cc=_0x4a89cc||0xc8;return function(_0x312e89){if(_0x312e89){return _0x408161[_0xc31e('0x16')](_0x4a89cc)[_0xc31e('0x18')](_0x312e89);}};}function respondWithFilteredResult(_0x569b6e,_0x29ab3a){return function(_0x417e23){if(_0x417e23){var _0x5cd3d5=typeof _0x29ab3a[_0xc31e('0x19')]===_0xc31e('0x1a')&&typeof _0x29ab3a['limit']===_0xc31e('0x1a');var _0x140e1f=_0x417e23[_0xc31e('0x1b')];var _0x478d93=_0x5cd3d5?0x0:_0x29ab3a[_0xc31e('0x19')];var _0x59f698=_0x5cd3d5?_0x417e23['count']:_0x29ab3a[_0xc31e('0x19')]+_0x29ab3a[_0xc31e('0x1c')];var _0x455fdf;if(_0x59f698>=_0x140e1f){_0x59f698=_0x140e1f;_0x455fdf=0xc8;}else{_0x455fdf=0xce;}_0x569b6e[_0xc31e('0x16')](_0x455fdf);return _0x569b6e['set'](_0xc31e('0x1d'),_0x478d93+'-'+_0x59f698+'/'+_0x140e1f)['json'](_0x417e23);}return null;};}function patchUpdates(_0x3e96cd){return function(_0x4d1c3d){try{jsonpatch[_0xc31e('0x1e')](_0x4d1c3d,_0x3e96cd,!![]);}catch(_0x3b42a7){return BPromise[_0xc31e('0x1f')](_0x3b42a7);}return _0x4d1c3d[_0xc31e('0x20')]();};}function saveUpdates(_0x4881ee,_0x39102e){return function(_0x7d4cde){if(_0x7d4cde){return _0x7d4cde['update'](_0x4881ee)['then'](function(_0x1a09b2){return _0x1a09b2;});}return null;};}function removeEntity(_0x38a9dc,_0x771a2a){return function(_0x216e7c){if(_0x216e7c){return _0x216e7c[_0xc31e('0x21')]()['then'](function(){_0x38a9dc[_0xc31e('0x16')](0xcc)[_0xc31e('0x17')]();});}};}function handleEntityNotFound(_0x391d8f,_0x3d13f2){return function(_0x3ca83e){if(!_0x3ca83e){_0x391d8f['sendStatus'](0x194);}return _0x3ca83e;};}function handleError(_0x48e926,_0x5f5a93){_0x5f5a93=_0x5f5a93||0x1f4;return function(_0x19af49){logger['error'](_0x19af49[_0xc31e('0x22')]);if(_0x19af49[_0xc31e('0x23')]){delete _0x19af49[_0xc31e('0x23')];}_0x48e926[_0xc31e('0x16')](_0x5f5a93)[_0xc31e('0x24')](_0x19af49);};}exports[_0xc31e('0x25')]=function(_0x2ece8f,_0x12562d){var _0x2fa0cb={},_0x42711b={},_0x17da49={'count':0x0,'rows':[]};var _0x50b23f=_['map'](db['AnalyticFieldReport'][_0xc31e('0x26')],function(_0x25172c){return{'name':_0x25172c[_0xc31e('0x27')],'type':_0x25172c[_0xc31e('0x28')][_0xc31e('0x29')]};});_0x42711b[_0xc31e('0x2a')]=_[_0xc31e('0x2b')](_0x50b23f,_0xc31e('0x23'));_0x42711b['query']=_[_0xc31e('0x2c')](_0x2ece8f[_0xc31e('0x2d')]);_0x42711b['filters']=_[_0xc31e('0x2e')](_0x42711b[_0xc31e('0x2a')],_0x42711b[_0xc31e('0x2d')]);_0x2fa0cb[_0xc31e('0x2f')]=_[_0xc31e('0x2e')](_0x42711b['model'],qs[_0xc31e('0x30')](_0x2ece8f['query'][_0xc31e('0x30')]));_0x2fa0cb[_0xc31e('0x2f')]=_0x2fa0cb[_0xc31e('0x2f')][_0xc31e('0x31')]?_0x2fa0cb[_0xc31e('0x2f')]:_0x42711b[_0xc31e('0x2a')];if(!_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x32')](_0xc31e('0x33'))){_0x2fa0cb[_0xc31e('0x1c')]=qs[_0xc31e('0x1c')](_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x1c')]);_0x2fa0cb[_0xc31e('0x19')]=qs[_0xc31e('0x19')](_0x2ece8f[_0xc31e('0x2d')]['offset']);}_0x2fa0cb['order']=qs['sort'](_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x34')]);_0x2fa0cb[_0xc31e('0x35')]=qs[_0xc31e('0x36')](_[_0xc31e('0x37')](_0x2ece8f['query'],_0x42711b[_0xc31e('0x36')]),_0x50b23f);if(_0x2ece8f['query'][_0xc31e('0x38')]){_0x2fa0cb[_0xc31e('0x35')]=_['merge'](_0x2fa0cb[_0xc31e('0x35')],{'$or':_[_0xc31e('0x2b')](_0x50b23f,function(_0x4d07bf){if(_0x4d07bf['type']!==_0xc31e('0x39')){var _0x3ad445={};_0x3ad445[_0x4d07bf['name']]={'$like':'%'+_0x2ece8f['query'][_0xc31e('0x38')]+'%'};return _0x3ad445;}})});}_0x2fa0cb=_[_0xc31e('0x3a')]({},_0x2fa0cb,_0x2ece8f['options']);var _0x43c823={'where':_0x2fa0cb['where']};return db[_0xc31e('0x3b')]['count'](_0x43c823)[_0xc31e('0x3c')](function(_0x4d1015){_0x17da49['count']=_0x4d1015;if(_0x2ece8f[_0xc31e('0x2d')][_0xc31e('0x3d')]){_0x2fa0cb[_0xc31e('0x3e')]=[{'all':!![]}];}return db[_0xc31e('0x3b')]['findAll'](_0x2fa0cb);})[_0xc31e('0x3c')](function(_0x20fe30){_0x17da49[_0xc31e('0x3f')]=_0x20fe30;return _0x17da49;})[_0xc31e('0x3c')](respondWithFilteredResult(_0x12562d,_0x2fa0cb))[_0xc31e('0x40')](handleError(_0x12562d,null));};exports[_0xc31e('0x41')]=function(_0x1e7edc,_0x13ef83){var _0x116936={'raw':![],'where':{'id':_0x1e7edc[_0xc31e('0x42')]['id']}},_0x59bd5c={};_0x59bd5c[_0xc31e('0x2a')]=_[_0xc31e('0x2c')](db['AnalyticFieldReport'][_0xc31e('0x26')]);_0x59bd5c[_0xc31e('0x2d')]=_[_0xc31e('0x2c')](_0x1e7edc[_0xc31e('0x2d')]);_0x59bd5c[_0xc31e('0x36')]=_[_0xc31e('0x2e')](_0x59bd5c[_0xc31e('0x2a')],_0x59bd5c[_0xc31e('0x2d')]);_0x116936[_0xc31e('0x2f')]=_['intersection'](_0x59bd5c['model'],qs[_0xc31e('0x30')](_0x1e7edc[_0xc31e('0x2d')][_0xc31e('0x30')]));_0x116936[_0xc31e('0x2f')]=_0x116936[_0xc31e('0x2f')][_0xc31e('0x31')]?_0x116936[_0xc31e('0x2f')]:_0x59bd5c['model'];if(_0x1e7edc[_0xc31e('0x2d')][_0xc31e('0x3d')]){_0x116936['include']=[{'all':!![]}];}_0x116936=_[_0xc31e('0x3a')]({},_0x116936,_0x1e7edc[_0xc31e('0x43')]);return db[_0xc31e('0x3b')][_0xc31e('0x44')](_0x116936)['then'](handleEntityNotFound(_0x13ef83,null))[_0xc31e('0x3c')](respondWithResult(_0x13ef83,null))['catch'](handleError(_0x13ef83,null));};exports['create']=function(_0x5d687a,_0x1494cc){return db[_0xc31e('0x3b')][_0xc31e('0x45')](_0x5d687a[_0xc31e('0x46')],{})[_0xc31e('0x3c')](respondWithResult(_0x1494cc,0xc9))[_0xc31e('0x40')](handleError(_0x1494cc,null));};exports[_0xc31e('0x47')]=function(_0x3c9da8,_0x38a796){return db[_0xc31e('0x3b')][_0xc31e('0x47')](_0x3c9da8[_0xc31e('0x46')],{'raw':![],'individualHooks':!![]})[_0xc31e('0x3c')](respondWithResult(_0x38a796,0xc9))[_0xc31e('0x40')](handleError(_0x38a796,null));};exports['update']=function(_0x4b92fe,_0x39059a){if(_0x4b92fe[_0xc31e('0x46')]['id']){delete _0x4b92fe['body']['id'];}return db[_0xc31e('0x3b')][_0xc31e('0x44')]({'where':{'id':_0x4b92fe['params']['id']}})[_0xc31e('0x3c')](handleEntityNotFound(_0x39059a,null))[_0xc31e('0x3c')](saveUpdates(_0x4b92fe[_0xc31e('0x46')],null))[_0xc31e('0x3c')](respondWithResult(_0x39059a,null))[_0xc31e('0x40')](handleError(_0x39059a,null));};exports[_0xc31e('0x21')]=function(_0x4fc1f8,_0xfe6bd4){return db['AnalyticFieldReport'][_0xc31e('0x44')]({'where':{'id':_0x4fc1f8[_0xc31e('0x42')]['id']}})[_0xc31e('0x3c')](handleEntityNotFound(_0xfe6bd4,null))['then'](removeEntity(_0xfe6bd4,null))[_0xc31e('0x40')](handleError(_0xfe6bd4,null));};exports[_0xc31e('0x48')]=function(_0x231cb6,_0x15a0bc){return db[_0xc31e('0x3b')]['destroy']({'where':{'id':_0x231cb6[_0xc31e('0x2d')][_0xc31e('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xc31e('0x3c')](respondWithResult(_0x15a0bc,0xcc))[_0xc31e('0x40')](handleError(_0x15a0bc,null));};exports[_0xc31e('0x4a')]=function(_0x4c33fc,_0x229fe6,_0x302078){return db[_0xc31e('0x4b')]['findOne']({'where':{'id':_0x4c33fc[_0xc31e('0x42')]['id']}})[_0xc31e('0x3c')](handleEntityNotFound(_0x229fe6,null))['then'](function(_0x58d559){if(_0x58d559){return db[_0xc31e('0x4c')][_0xc31e('0x4d')](function(_0x518736){return db[_0xc31e('0x3b')][_0xc31e('0x21')]({'where':{'CustomReportId':_0x4c33fc['params']['id']},'transaction':_0x518736})[_0xc31e('0x3c')](function(_0x26ae08){var _0xe240cc=_[_0xc31e('0x2b')](_0x4c33fc[_0xc31e('0x46')],function(_0x208fbb){delete _0x208fbb['id'];_0x208fbb[_0xc31e('0x4e')]=_0x4c33fc['params']['id'];return _0x208fbb;});return db['AnalyticFieldReport'][_0xc31e('0x47')](_0xe240cc,{'transaction':_0x518736});});})[_0xc31e('0x3c')](function(){return db[_0xc31e('0x3b')][_0xc31e('0x4f')]({'where':{'CustomReportId':_0x4c33fc[_0xc31e('0x42')]['id']}});});}})[_0xc31e('0x3c')](respondWithResult(_0x229fe6,null))[_0xc31e('0x40')](handleError(_0x229fe6,null));};
\ No newline at end of file
+var _0xca56=['model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','bulkCreate','body','destroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','AnalyticFieldReport','rawAttributes','fieldName','key'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xca56,0x119));var _0x6ca5=function(_0x206887,_0x10d42d){_0x206887=_0x206887-0x0;var _0x2032e6=_0xca56[_0x206887];return _0x2032e6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6ca5('0x0'));var jsonpatch=require(_0x6ca5('0x1'));var rp=require(_0x6ca5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6ca5('0x3'));var util=require(_0x6ca5('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x6ca5('0x5'));var ejs=require(_0x6ca5('0x6'));var fs=require('fs');var fs_extra=require(_0x6ca5('0x7'));var _=require('lodash');var squel=require(_0x6ca5('0x8'));var crypto=require(_0x6ca5('0x9'));var jsforce=require(_0x6ca5('0xa'));var deskjs=require(_0x6ca5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6ca5('0xc'));var Papa=require('papaparse');var Redis=require(_0x6ca5('0xd'));var authService=require(_0x6ca5('0xe'));var qs=require(_0x6ca5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca5('0x10'))(_0x6ca5('0x11'));var utils=require(_0x6ca5('0x12'));var config=require(_0x6ca5('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca5('0x14'))['db'];function respondWithStatusCode(_0x2b0598,_0x11fc2b){_0x11fc2b=_0x11fc2b||0xcc;return function(_0x446d1b){if(_0x446d1b){return _0x2b0598['sendStatus'](_0x11fc2b);}return _0x2b0598[_0x6ca5('0x15')](_0x11fc2b)['end']();};}function respondWithResult(_0x3c4309,_0x378a9a){_0x378a9a=_0x378a9a||0xc8;return function(_0x1bfa37){if(_0x1bfa37){return _0x3c4309[_0x6ca5('0x15')](_0x378a9a)[_0x6ca5('0x16')](_0x1bfa37);}};}function respondWithFilteredResult(_0x2d57fa,_0x25d812){return function(_0x38417a){if(_0x38417a){var _0x3c4b5b=typeof _0x25d812[_0x6ca5('0x17')]===_0x6ca5('0x18')&&typeof _0x25d812[_0x6ca5('0x19')]==='undefined';var _0x3f4b42=_0x38417a[_0x6ca5('0x1a')];var _0x1b1530=_0x3c4b5b?0x0:_0x25d812[_0x6ca5('0x17')];var _0xe530f5=_0x3c4b5b?_0x38417a[_0x6ca5('0x1a')]:_0x25d812[_0x6ca5('0x17')]+_0x25d812[_0x6ca5('0x19')];var _0x2f7d67;if(_0xe530f5>=_0x3f4b42){_0xe530f5=_0x3f4b42;_0x2f7d67=0xc8;}else{_0x2f7d67=0xce;}_0x2d57fa[_0x6ca5('0x15')](_0x2f7d67);return _0x2d57fa[_0x6ca5('0x1b')](_0x6ca5('0x1c'),_0x1b1530+'-'+_0xe530f5+'/'+_0x3f4b42)['json'](_0x38417a);}return null;};}function patchUpdates(_0x2bcd56){return function(_0x2c9e97){try{jsonpatch[_0x6ca5('0x1d')](_0x2c9e97,_0x2bcd56,!![]);}catch(_0x35cfa0){return BPromise[_0x6ca5('0x1e')](_0x35cfa0);}return _0x2c9e97[_0x6ca5('0x1f')]();};}function saveUpdates(_0xdda910,_0x259dba){return function(_0x254d05){if(_0x254d05){return _0x254d05[_0x6ca5('0x20')](_0xdda910)[_0x6ca5('0x21')](function(_0x3e8a25){return _0x3e8a25;});}return null;};}function removeEntity(_0x1913ec,_0x17de8f){return function(_0x477888){if(_0x477888){return _0x477888['destroy']()['then'](function(){_0x1913ec[_0x6ca5('0x15')](0xcc)[_0x6ca5('0x22')]();});}};}function handleEntityNotFound(_0x47cede,_0x39d324){return function(_0x5a3311){if(!_0x5a3311){_0x47cede[_0x6ca5('0x23')](0x194);}return _0x5a3311;};}function handleError(_0x1241e7,_0x59fb57){_0x59fb57=_0x59fb57||0x1f4;return function(_0x1e1afe){logger[_0x6ca5('0x24')](_0x1e1afe[_0x6ca5('0x25')]);if(_0x1e1afe[_0x6ca5('0x26')]){delete _0x1e1afe[_0x6ca5('0x26')];}_0x1241e7[_0x6ca5('0x15')](_0x59fb57)['send'](_0x1e1afe);};}exports['index']=function(_0xcd30f3,_0x156dee){var _0x345922={},_0x456381={},_0x123e5c={'count':0x0,'rows':[]};var _0x2890cc=_['map'](db[_0x6ca5('0x27')][_0x6ca5('0x28')],function(_0x22ef40){return{'name':_0x22ef40[_0x6ca5('0x29')],'type':_0x22ef40['type'][_0x6ca5('0x2a')]};});_0x456381[_0x6ca5('0x2b')]=_[_0x6ca5('0x2c')](_0x2890cc,_0x6ca5('0x26'));_0x456381[_0x6ca5('0x2d')]=_[_0x6ca5('0x2e')](_0xcd30f3[_0x6ca5('0x2d')]);_0x456381['filters']=_[_0x6ca5('0x2f')](_0x456381[_0x6ca5('0x2b')],_0x456381[_0x6ca5('0x2d')]);_0x345922[_0x6ca5('0x30')]=_['intersection'](_0x456381[_0x6ca5('0x2b')],qs[_0x6ca5('0x31')](_0xcd30f3[_0x6ca5('0x2d')]['fields']));_0x345922['attributes']=_0x345922[_0x6ca5('0x30')][_0x6ca5('0x32')]?_0x345922[_0x6ca5('0x30')]:_0x456381['model'];if(!_0xcd30f3['query'][_0x6ca5('0x33')](_0x6ca5('0x34'))){_0x345922['limit']=qs['limit'](_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x19')]);_0x345922['offset']=qs[_0x6ca5('0x17')](_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x17')]);}_0x345922[_0x6ca5('0x35')]=qs[_0x6ca5('0x36')](_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x36')]);_0x345922['where']=qs[_0x6ca5('0x37')](_[_0x6ca5('0x38')](_0xcd30f3[_0x6ca5('0x2d')],_0x456381[_0x6ca5('0x37')]),_0x2890cc);if(_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x39')]){_0x345922[_0x6ca5('0x3a')]=_[_0x6ca5('0x3b')](_0x345922['where'],{'$or':_['map'](_0x2890cc,function(_0x8e627e){if(_0x8e627e[_0x6ca5('0x3c')]!==_0x6ca5('0x3d')){var _0x555def={};_0x555def[_0x8e627e[_0x6ca5('0x26')]]={'$like':'%'+_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x39')]+'%'};return _0x555def;}})});}_0x345922=_[_0x6ca5('0x3b')]({},_0x345922,_0xcd30f3[_0x6ca5('0x3e')]);var _0x1b0fa9={'where':_0x345922[_0x6ca5('0x3a')]};return db[_0x6ca5('0x27')]['count'](_0x1b0fa9)[_0x6ca5('0x21')](function(_0x61f9c6){_0x123e5c[_0x6ca5('0x1a')]=_0x61f9c6;if(_0xcd30f3[_0x6ca5('0x2d')][_0x6ca5('0x3f')]){_0x345922[_0x6ca5('0x40')]=[{'all':!![]}];}return db[_0x6ca5('0x27')][_0x6ca5('0x41')](_0x345922);})['then'](function(_0x553904){_0x123e5c[_0x6ca5('0x42')]=_0x553904;return _0x123e5c;})[_0x6ca5('0x21')](respondWithFilteredResult(_0x156dee,_0x345922))[_0x6ca5('0x43')](handleError(_0x156dee,null));};exports[_0x6ca5('0x44')]=function(_0x4d0e52,_0x348e52){var _0x37350e={'raw':![],'where':{'id':_0x4d0e52[_0x6ca5('0x45')]['id']}},_0x2b0d1a={};_0x2b0d1a['model']=_['keys'](db[_0x6ca5('0x27')][_0x6ca5('0x28')]);_0x2b0d1a[_0x6ca5('0x2d')]=_[_0x6ca5('0x2e')](_0x4d0e52[_0x6ca5('0x2d')]);_0x2b0d1a[_0x6ca5('0x37')]=_[_0x6ca5('0x2f')](_0x2b0d1a['model'],_0x2b0d1a[_0x6ca5('0x2d')]);_0x37350e[_0x6ca5('0x30')]=_[_0x6ca5('0x2f')](_0x2b0d1a[_0x6ca5('0x2b')],qs[_0x6ca5('0x31')](_0x4d0e52[_0x6ca5('0x2d')][_0x6ca5('0x31')]));_0x37350e[_0x6ca5('0x30')]=_0x37350e['attributes'][_0x6ca5('0x32')]?_0x37350e[_0x6ca5('0x30')]:_0x2b0d1a[_0x6ca5('0x2b')];if(_0x4d0e52['query'][_0x6ca5('0x3f')]){_0x37350e[_0x6ca5('0x40')]=[{'all':!![]}];}_0x37350e=_[_0x6ca5('0x3b')]({},_0x37350e,_0x4d0e52['options']);return db[_0x6ca5('0x27')][_0x6ca5('0x46')](_0x37350e)[_0x6ca5('0x21')](handleEntityNotFound(_0x348e52,null))[_0x6ca5('0x21')](respondWithResult(_0x348e52,null))[_0x6ca5('0x43')](handleError(_0x348e52,null));};exports[_0x6ca5('0x47')]=function(_0x36c5e6,_0xdd0626){return db[_0x6ca5('0x27')]['create'](_0x36c5e6['body'],{})[_0x6ca5('0x21')](respondWithResult(_0xdd0626,0xc9))['catch'](handleError(_0xdd0626,null));};exports[_0x6ca5('0x48')]=function(_0x2e9b3f,_0x2c6c8c){return db[_0x6ca5('0x27')][_0x6ca5('0x48')](_0x2e9b3f[_0x6ca5('0x49')],{'raw':![],'individualHooks':!![]})[_0x6ca5('0x21')](respondWithResult(_0x2c6c8c,0xc9))[_0x6ca5('0x43')](handleError(_0x2c6c8c,null));};exports[_0x6ca5('0x20')]=function(_0x14f077,_0x44a908){if(_0x14f077[_0x6ca5('0x49')]['id']){delete _0x14f077['body']['id'];}return db['AnalyticFieldReport'][_0x6ca5('0x46')]({'where':{'id':_0x14f077[_0x6ca5('0x45')]['id']}})[_0x6ca5('0x21')](handleEntityNotFound(_0x44a908,null))[_0x6ca5('0x21')](saveUpdates(_0x14f077['body'],null))['then'](respondWithResult(_0x44a908,null))['catch'](handleError(_0x44a908,null));};exports[_0x6ca5('0x4a')]=function(_0x4f4ce8,_0x1c5aaa){return db[_0x6ca5('0x27')][_0x6ca5('0x46')]({'where':{'id':_0x4f4ce8['params']['id']}})['then'](handleEntityNotFound(_0x1c5aaa,null))[_0x6ca5('0x21')](removeEntity(_0x1c5aaa,null))[_0x6ca5('0x43')](handleError(_0x1c5aaa,null));};exports['bulkDestroy']=function(_0x4de63f,_0x43cc8d){return db[_0x6ca5('0x27')][_0x6ca5('0x4a')]({'where':{'id':_0x4de63f[_0x6ca5('0x2d')][_0x6ca5('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x6ca5('0x21')](respondWithResult(_0x43cc8d,0xcc))['catch'](handleError(_0x43cc8d,null));};exports['addFields']=function(_0x11e8db,_0x3fb72b,_0x5a521a){return db[_0x6ca5('0x4c')][_0x6ca5('0x4d')]({'where':{'id':_0x11e8db[_0x6ca5('0x45')]['id']}})[_0x6ca5('0x21')](handleEntityNotFound(_0x3fb72b,null))[_0x6ca5('0x21')](function(_0x21a493){if(_0x21a493){return db[_0x6ca5('0x4e')][_0x6ca5('0x4f')](function(_0x12817c){return db[_0x6ca5('0x27')]['destroy']({'where':{'CustomReportId':_0x11e8db[_0x6ca5('0x45')]['id']},'transaction':_0x12817c})[_0x6ca5('0x21')](function(_0x4d8568){var _0x5bfcbb=_[_0x6ca5('0x2c')](_0x11e8db[_0x6ca5('0x49')],function(_0x4e5483){delete _0x4e5483['id'];_0x4e5483[_0x6ca5('0x50')]=_0x11e8db[_0x6ca5('0x45')]['id'];return _0x4e5483;});return db[_0x6ca5('0x27')]['bulkCreate'](_0x5bfcbb,{'transaction':_0x12817c});});})[_0x6ca5('0x21')](function(){return db[_0x6ca5('0x27')][_0x6ca5('0x41')]({'where':{'CustomReportId':_0x11e8db[_0x6ca5('0x45')]['id']}});});}})[_0x6ca5('0x21')](respondWithResult(_0x3fb72b,null))['catch'](handleError(_0x3fb72b,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 7b01e65..35fa074 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 _0x6694=['analytics_report_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x219935,_0x5b7d02){var _0x130409=function(_0x56409e){while(--_0x56409e){_0x219935['push'](_0x219935['shift']());}};_0x130409(++_0x5b7d02);}(_0x6694,0x1a1));var _0x4669=function(_0x4be8a9,_0x47c045){_0x4be8a9=_0x4be8a9-0x0;var _0x73ccf8=_0x6694[_0x4be8a9];return _0x73ccf8;};'use strict';var _=require('lodash');var util=require(_0x4669('0x0'));var logger=require(_0x4669('0x1'))(_0x4669('0x2'));var moment=require(_0x4669('0x3'));var BPromise=require(_0x4669('0x4'));var rp=require(_0x4669('0x5'));var fs=require('fs');var path=require(_0x4669('0x6'));var rimraf=require(_0x4669('0x7'));var config=require(_0x4669('0x8'));var attributes=require(_0x4669('0x9'));module[_0x4669('0xa')]=function(_0x5961aa,_0x4200fd){return _0x5961aa[_0x4669('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x4669('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcdc=['AnalyticFieldReport','analytics_report_fields','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xfcdc,0x178));var _0xcfcd=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xfcdc[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xcfcd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcfcd('0x1'));var moment=require(_0xcfcd('0x2'));var BPromise=require(_0xcfcd('0x3'));var rp=require(_0xcfcd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcfcd('0x5'));var config=require(_0xcfcd('0x6'));var attributes=require(_0xcfcd('0x7'));module[_0xcfcd('0x8')]=function(_0xa361d5,_0x1502fa){return _0xa361d5['define'](_0xcfcd('0x9'),attributes,{'tableName':_0xcfcd('0xa'),'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 2e99cd4..a079063 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 _0x9454=['util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash'];(function(_0x49d0bb,_0x9206dc){var _0xf9c534=function(_0x53e76f){while(--_0x53e76f){_0x49d0bb['push'](_0x49d0bb['shift']());}};_0xf9c534(++_0x9206dc);}(_0x9454,0x1e2));var _0x4945=function(_0x5071bf,_0x82000e){_0x5071bf=_0x5071bf-0x0;var _0xc68643=_0x9454[_0x5071bf];return _0xc68643;};'use strict';var _=require(_0x4945('0x0'));var util=require(_0x4945('0x1'));var moment=require('moment');var BPromise=require(_0x4945('0x2'));var rs=require(_0x4945('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4945('0x4'))['db'];var utils=require(_0x4945('0x5'));var logger=require('../../config/logger')(_0x4945('0x6'));var config=require(_0x4945('0x7'));var jayson=require(_0x4945('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x474aa8,_0x32e4ce,_0x5d8cf2){return new BPromise(function(_0x4b8271,_0x1f1768){return client[_0x4945('0x9')](_0x474aa8,_0x5d8cf2)[_0x4945('0xa')](function(_0x68bb9b){logger[_0x4945('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x32e4ce,'request\x20sent');logger[_0x4945('0xc')](_0x4945('0xd'),_0x32e4ce,'request\x20sent',JSON[_0x4945('0xe')](_0x68bb9b));if(_0x68bb9b[_0x4945('0xf')]){if(_0x68bb9b[_0x4945('0xf')]['code']===0x1f4){logger['error'](_0x4945('0x10'),_0x32e4ce,_0x68bb9b[_0x4945('0xf')][_0x4945('0x11')]);return _0x1f1768(_0x68bb9b[_0x4945('0xf')][_0x4945('0x11')]);}logger[_0x4945('0xf')](_0x4945('0x10'),_0x32e4ce,_0x68bb9b[_0x4945('0xf')][_0x4945('0x11')]);return _0x4b8271(_0x68bb9b['error']['message']);}else{logger[_0x4945('0xb')](_0x4945('0x10'),_0x32e4ce,_0x4945('0x12'));_0x4b8271(_0x68bb9b[_0x4945('0x13')][_0x4945('0x11')]);}})[_0x4945('0x14')](function(_0x25548b){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x32e4ce,_0x25548b);_0x1f1768(_0x25548b);});});}
\ No newline at end of file
+var _0x99e3=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x2db6f5,_0x49485c){var _0x2a1a93=function(_0x495873){while(--_0x495873){_0x2db6f5['push'](_0x2db6f5['shift']());}};_0x2a1a93(++_0x49485c);}(_0x99e3,0x12f));var _0x399e=function(_0x2e1ea4,_0x1181cc){_0x2e1ea4=_0x2e1ea4-0x0;var _0x39f643=_0x99e3[_0x2e1ea4];return _0x39f643;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x399e('0x0'));var BPromise=require(_0x399e('0x1'));var rs=require(_0x399e('0x2'));var fs=require('fs');var Redis=require(_0x399e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x399e('0x4'));var logger=require('../../config/logger')(_0x399e('0x5'));var config=require(_0x399e('0x6'));var jayson=require(_0x399e('0x7'));var client=jayson[_0x399e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x129ea6,_0x19e1e4,_0x3af2e6){return new BPromise(function(_0x5b45e1,_0x40ced3){return client['request'](_0x129ea6,_0x3af2e6)['then'](function(_0x435626){logger[_0x399e('0x9')](_0x399e('0xa'),_0x19e1e4,_0x399e('0xb'));logger['debug'](_0x399e('0xc'),_0x19e1e4,_0x399e('0xb'),JSON[_0x399e('0xd')](_0x435626));if(_0x435626[_0x399e('0xe')]){if(_0x435626['error'][_0x399e('0xf')]===0x1f4){logger['error'](_0x399e('0xa'),_0x19e1e4,_0x435626['error']['message']);return _0x40ced3(_0x435626[_0x399e('0xe')][_0x399e('0x10')]);}logger[_0x399e('0xe')](_0x399e('0xa'),_0x19e1e4,_0x435626[_0x399e('0xe')]['message']);return _0x5b45e1(_0x435626[_0x399e('0xe')][_0x399e('0x10')]);}else{logger[_0x399e('0x9')]('AnalyticFieldReport,\x20%s,\x20%s',_0x19e1e4,'request\x20sent');_0x5b45e1(_0x435626[_0x399e('0x11')][_0x399e('0x10')]);}})[_0x399e('0x12')](function(_0x2c2a45){logger[_0x399e('0xe')](_0x399e('0xa'),_0x19e1e4,_0x2c2a45);_0x40ced3(_0x2c2a45);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 9840e20..87099c2 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(_0x4039b2,_0x3c25bf){var _0x3f0ca8=function(_0x5e6d20){while(--_0x5e6d20){_0x4039b2['push'](_0x4039b2['shift']());}};_0x3f0ca8(++_0x3c25bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x4db06e,_0x218860){var _0x3c32a6=function(_0x1b95d8){while(--_0x1b95d8){_0x4db06e['push'](_0x4db06e['shift']());}};_0x3c32a6(++_0x218860);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 f2157c0..92553af 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 _0x3a79=['TEXT','exports','STRING'];(function(_0x5b6356,_0x388828){var _0x3d0cbf=function(_0x3564ce){while(--_0x3564ce){_0x5b6356['push'](_0x5b6356['shift']());}};_0x3d0cbf(++_0x388828);}(_0x3a79,0xca));var _0x93a7=function(_0x50547c,_0x3bfef0){_0x50547c=_0x50547c-0x0;var _0x4a3b93=_0x3a79[_0x50547c];return _0x4a3b93;};'use strict';var Sequelize=require('sequelize');module[_0x93a7('0x0')]={'name':{'type':Sequelize[_0x93a7('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x93a7('0x1')]},'metric':{'type':Sequelize[_0x93a7('0x2')]},'description':{'type':Sequelize[_0x93a7('0x1')]}};
\ No newline at end of file
+var _0x32d5=['TEXT','sequelize','exports','STRING','name'];(function(_0x3fdd6a,_0x3f1222){var _0x23694a=function(_0x496dde){while(--_0x496dde){_0x3fdd6a['push'](_0x3fdd6a['shift']());}};_0x23694a(++_0x3f1222);}(_0x32d5,0x1aa));var _0x532d=function(_0x12e5d9,_0x28bced){_0x12e5d9=_0x12e5d9-0x0;var _0x46a7b1=_0x32d5[_0x12e5d9];return _0x46a7b1;};'use strict';var Sequelize=require(_0x532d('0x0'));module[_0x532d('0x1')]={'name':{'type':Sequelize[_0x532d('0x2')],'allowNull':![],'unique':_0x532d('0x3')},'table':{'type':Sequelize[_0x532d('0x2')]},'metric':{'type':Sequelize[_0x532d('0x4')]},'description':{'type':Sequelize[_0x532d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index efd16d3..2cc7735 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 _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x532d72,_0x5ae436){var _0x415525=function(_0x2e569a){while(--_0x2e569a){_0x532d72['push'](_0x532d72['shift']());}};_0x415525(++_0x5ae436);}(_0x7217,0x19e));var _0x7721=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x7217[_0x21aec3];return _0x288bbc;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));};
\ No newline at end of file
+var _0x9957=['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','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index e21a8bc..bbd55f3 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 _0xe574=['../../config/environment','./analyticMetric.attributes','exports','analytics_metrics','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe574,0x100));var _0x4e57=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe574[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4e57('0x0'));var util=require('util');var logger=require(_0x4e57('0x1'))(_0x4e57('0x2'));var moment=require(_0x4e57('0x3'));var BPromise=require(_0x4e57('0x4'));var rp=require(_0x4e57('0x5'));var fs=require('fs');var path=require(_0x4e57('0x6'));var rimraf=require(_0x4e57('0x7'));var config=require(_0x4e57('0x8'));var attributes=require(_0x4e57('0x9'));module[_0x4e57('0xa')]=function(_0x436174,_0x2825a9){return _0x436174['define']('AnalyticMetric',attributes,{'tableName':_0x4e57('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x24ce=['analytics_metrics','util','../../config/logger','api','moment','path','./analyticMetric.attributes','exports','define'];(function(_0x18c657,_0x4c1b87){var _0x298ed2=function(_0x220442){while(--_0x220442){_0x18c657['push'](_0x18c657['shift']());}};_0x298ed2(++_0x4c1b87);}(_0x24ce,0x1de));var _0xe24c=function(_0x1f0365,_0x38560c){_0x1f0365=_0x1f0365-0x0;var _0x54d0c7=_0x24ce[_0x1f0365];return _0x54d0c7;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var logger=require(_0xe24c('0x1'))(_0xe24c('0x2'));var moment=require(_0xe24c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe24c('0x5'));module[_0xe24c('0x6')]=function(_0x6f92e0,_0x1ac59c){return _0x6f92e0[_0xe24c('0x7')]('AnalyticMetric',attributes,{'tableName':_0xe24c('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 4617076..431969d 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 _0xa8d6=['catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2c24df,_0x2e46a3){var _0x309b15=function(_0x5d525b){while(--_0x5d525b){_0x2c24df['push'](_0x2c24df['shift']());}};_0x309b15(++_0x2e46a3);}(_0xa8d6,0x144));var _0x6a8d=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xa8d6[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require(_0x6a8d('0x0'));var moment=require('moment');var BPromise=require(_0x6a8d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a8d('0x2'));var db=require(_0x6a8d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a8d('0x4'))(_0x6a8d('0x5'));var config=require('../../config/environment');var jayson=require(_0x6a8d('0x6'));var client=jayson[_0x6a8d('0x7')][_0x6a8d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39bece,_0x18abf,_0x2e02f6){return new BPromise(function(_0x2456bf,_0x559076){return client['request'](_0x39bece,_0x2e02f6)['then'](function(_0xab9ba){logger[_0x6a8d('0x9')](_0x6a8d('0xa'),_0x18abf,_0x6a8d('0xb'));logger['debug'](_0x6a8d('0xc'),_0x18abf,_0x6a8d('0xb'),JSON[_0x6a8d('0xd')](_0xab9ba));if(_0xab9ba[_0x6a8d('0xe')]){if(_0xab9ba[_0x6a8d('0xe')][_0x6a8d('0xf')]===0x1f4){logger[_0x6a8d('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x18abf,_0xab9ba[_0x6a8d('0xe')][_0x6a8d('0x10')]);return _0x559076(_0xab9ba[_0x6a8d('0xe')]['message']);}logger[_0x6a8d('0xe')](_0x6a8d('0xa'),_0x18abf,_0xab9ba[_0x6a8d('0xe')]['message']);return _0x2456bf(_0xab9ba[_0x6a8d('0xe')][_0x6a8d('0x10')]);}else{logger[_0x6a8d('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x18abf,_0x6a8d('0xb'));_0x2456bf(_0xab9ba[_0x6a8d('0x11')][_0x6a8d('0x10')]);}})[_0x6a8d('0x12')](function(_0x5d8c3c){logger['error'](_0x6a8d('0xa'),_0x18abf,_0x5d8c3c);_0x559076(_0x5d8c3c);});});}
\ No newline at end of file
+var _0x5a74=['request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x299214,_0x2bab88){var _0x4d89c1=function(_0x34a13b){while(--_0x34a13b){_0x299214['push'](_0x299214['shift']());}};_0x4d89c1(++_0x2bab88);}(_0x5a74,0xfd));var _0x45a7=function(_0x2d0953,_0x30bcf9){_0x2d0953=_0x2d0953-0x0;var _0x1e824a=_0x5a74[_0x2d0953];return _0x1e824a;};'use strict';var _=require(_0x45a7('0x0'));var util=require(_0x45a7('0x1'));var moment=require(_0x45a7('0x2'));var BPromise=require(_0x45a7('0x3'));var rs=require(_0x45a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x45a7('0x5'));var logger=require(_0x45a7('0x6'))('rpc');var config=require(_0x45a7('0x7'));var jayson=require(_0x45a7('0x8'));var client=jayson[_0x45a7('0x9')][_0x45a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1246d4,_0x320863,_0x17abb6){return new BPromise(function(_0x1c4b89,_0x16665a){return client[_0x45a7('0xb')](_0x1246d4,_0x17abb6)[_0x45a7('0xc')](function(_0x450e04){logger['info'](_0x45a7('0xd'),_0x320863,_0x45a7('0xe'));logger[_0x45a7('0xf')](_0x45a7('0x10'),_0x320863,_0x45a7('0xe'),JSON[_0x45a7('0x11')](_0x450e04));if(_0x450e04[_0x45a7('0x12')]){if(_0x450e04[_0x45a7('0x12')][_0x45a7('0x13')]===0x1f4){logger[_0x45a7('0x12')](_0x45a7('0xd'),_0x320863,_0x450e04[_0x45a7('0x12')][_0x45a7('0x14')]);return _0x16665a(_0x450e04['error'][_0x45a7('0x14')]);}logger[_0x45a7('0x12')](_0x45a7('0xd'),_0x320863,_0x450e04[_0x45a7('0x12')][_0x45a7('0x14')]);return _0x1c4b89(_0x450e04['error'][_0x45a7('0x14')]);}else{logger[_0x45a7('0x15')](_0x45a7('0xd'),_0x320863,_0x45a7('0xe'));_0x1c4b89(_0x450e04[_0x45a7('0x16')][_0x45a7('0x14')]);}})[_0x45a7('0x17')](function(_0x337669){logger[_0x45a7('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x320863,_0x337669);_0x16665a(_0x337669);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 0411ab3..52e5ae8 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 _0x92bc=['/:id','post','create','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated'];(function(_0x4db561,_0x521d0d){var _0x299980=function(_0x56f5c1){while(--_0x56f5c1){_0x4db561['push'](_0x4db561['shift']());}};_0x299980(++_0x521d0d);}(_0x92bc,0x106));var _0xc92b=function(_0x180ec6,_0x2c8b69){_0x180ec6=_0x180ec6-0x0;var _0xb7ca0d=_0x92bc[_0x180ec6];return _0xb7ca0d;};'use strict';var multer=require(_0xc92b('0x0'));var util=require(_0xc92b('0x1'));var path=require(_0xc92b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc92b('0x3')]();var fs_extra=require(_0xc92b('0x4'));var auth=require(_0xc92b('0x5'));var interaction=require(_0xc92b('0x6'));var config=require('../../config/environment');var controller=require(_0xc92b('0x7'));router[_0xc92b('0x8')]('/',auth[_0xc92b('0x9')](),controller['index']);router['get'](_0xc92b('0xa'),auth[_0xc92b('0x9')](),controller['show']);router[_0xc92b('0xb')]('/',auth[_0xc92b('0x9')](),controller[_0xc92b('0xc')]);router['put'](_0xc92b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc92b('0xd')]('/:id',auth[_0xc92b('0x9')](),controller[_0xc92b('0xe')]);module[_0xc92b('0xf')]=router;
\ No newline at end of file
+var _0x1134=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xf840f7,_0x29fe47){var _0x3e27b0=function(_0x320e7e){while(--_0x320e7e){_0xf840f7['push'](_0xf840f7['shift']());}};_0x3e27b0(++_0x29fe47);}(_0x1134,0x19c));var _0x4113=function(_0x2cfe7e,_0x151321){_0x2cfe7e=_0x2cfe7e-0x0;var _0x467836=_0x1134[_0x2cfe7e];return _0x467836;};'use strict';var multer=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var path=require('path');var timeout=require(_0x4113('0x2'));var express=require(_0x4113('0x3'));var router=express['Router']();var fs_extra=require(_0x4113('0x4'));var auth=require(_0x4113('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4113('0x6'));var controller=require('./analyticMetric.controller');router[_0x4113('0x7')]('/',auth['isAuthenticated'](),controller[_0x4113('0x8')]);router['get'](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0xb')]);router[_0x4113('0xc')]('/',auth[_0x4113('0xa')](),controller[_0x4113('0xd')]);router[_0x4113('0xe')](_0x4113('0x9'),auth['isAuthenticated'](),controller[_0x4113('0xf')]);router[_0x4113('0x10')](_0x4113('0x9'),auth[_0x4113('0xa')](),controller[_0x4113('0x11')]);module[_0x4113('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 aa86a3c..ec1755a 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 _0x138a=['exports','sequelize'];(function(_0x1b5c51,_0x3dd1c2){var _0x58d6ab=function(_0x491494){while(--_0x491494){_0x1b5c51['push'](_0x1b5c51['shift']());}};_0x58d6ab(++_0x3dd1c2);}(_0x138a,0x19f));var _0xa138=function(_0x1533f7,_0x1a338a){_0x1533f7=_0x1533f7-0x0;var _0x38e1f9=_0x138a[_0x1533f7];return _0x38e1f9;};'use strict';var Sequelize=require(_0xa138('0x0'));module[_0xa138('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x1e31=['sequelize','exports','TEXT'];(function(_0x4c8cf2,_0x93c235){var _0xc0237d=function(_0x409871){while(--_0x409871){_0x4c8cf2['push'](_0x4c8cf2['shift']());}};_0xc0237d(++_0x93c235);}(_0x1e31,0x1dd));var _0x11e3=function(_0x3573b2,_0x37b3ec){_0x3573b2=_0x3573b2-0x0;var _0x2494a4=_0x1e31[_0x3573b2];return _0x2494a4;};'use strict';var Sequelize=require(_0x11e3('0x0'));module[_0x11e3('0x1')]={'tree':{'type':Sequelize[_0x11e3('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 4766cf5..c9d6bf6 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 _0xaa6c=['attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','catch','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','end','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0xaa6c,0x17a));var _0xcaa6=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xaa6c[_0x13ce0c];return _0x4388fb;};'use strict';var emlformat=require(_0xcaa6('0x0'));var rimraf=require(_0xcaa6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaa6('0x2'));var rp=require(_0xcaa6('0x3'));var moment=require(_0xcaa6('0x4'));var BPromise=require(_0xcaa6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcaa6('0x6'));var csv=require(_0xcaa6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa6('0x8'));var squel=require(_0xcaa6('0x9'));var crypto=require(_0xcaa6('0xa'));var jsforce=require(_0xcaa6('0xb'));var deskjs=require(_0xcaa6('0xc'));var toCsv=require(_0xcaa6('0x7'));var querystring=require('querystring');var Papa=require(_0xcaa6('0xd'));var Redis=require(_0xcaa6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcaa6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcaa6('0x10'));var logger=require(_0xcaa6('0x11'))('api');var utils=require(_0xcaa6('0x12'));var config=require(_0xcaa6('0x13'));var licenseUtil=require(_0xcaa6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcf3506,_0x297066){_0x297066=_0x297066||0xcc;return function(_0x27daf1){if(_0x27daf1){return _0xcf3506[_0xcaa6('0x15')](_0x297066);}return _0xcf3506[_0xcaa6('0x16')](_0x297066)['end']();};}function respondWithResult(_0x53c375,_0x4827f7){_0x4827f7=_0x4827f7||0xc8;return function(_0x2548ed){if(_0x2548ed){return _0x53c375[_0xcaa6('0x16')](_0x4827f7)[_0xcaa6('0x17')](_0x2548ed);}};}function respondWithFilteredResult(_0x2110d0,_0x2915d6){return function(_0x11814a){if(_0x11814a){var _0x4c67a8=typeof _0x2915d6[_0xcaa6('0x18')]===_0xcaa6('0x19')&&typeof _0x2915d6['limit']==='undefined';var _0x2fa950=_0x11814a['count'];var _0x4e1eb5=_0x4c67a8?0x0:_0x2915d6['offset'];var _0x4732f9=_0x4c67a8?_0x11814a[_0xcaa6('0x1a')]:_0x2915d6[_0xcaa6('0x18')]+_0x2915d6['limit'];var _0x2378ac;if(_0x4732f9>=_0x2fa950){_0x4732f9=_0x2fa950;_0x2378ac=0xc8;}else{_0x2378ac=0xce;}_0x2110d0[_0xcaa6('0x16')](_0x2378ac);return _0x2110d0[_0xcaa6('0x1b')](_0xcaa6('0x1c'),_0x4e1eb5+'-'+_0x4732f9+'/'+_0x2fa950)[_0xcaa6('0x17')](_0x11814a);}return null;};}function patchUpdates(_0x4eaab3){return function(_0x26e60c){try{jsonpatch['apply'](_0x26e60c,_0x4eaab3,!![]);}catch(_0x5921ee){return BPromise[_0xcaa6('0x1d')](_0x5921ee);}return _0x26e60c[_0xcaa6('0x1e')]();};}function saveUpdates(_0x6818ed,_0x3e788d){return function(_0x108944){if(_0x108944){return _0x108944[_0xcaa6('0x1f')](_0x6818ed)[_0xcaa6('0x20')](function(_0x5271eb){return _0x5271eb;});}return null;};}function removeEntity(_0x5d510a,_0x5567bb){return function(_0x4086e3){if(_0x4086e3){return _0x4086e3[_0xcaa6('0x21')]()[_0xcaa6('0x20')](function(){_0x5d510a[_0xcaa6('0x16')](0xcc)[_0xcaa6('0x22')]();});}};}function handleEntityNotFound(_0x4a776e,_0x534229){return function(_0x1af403){if(!_0x1af403){_0x4a776e[_0xcaa6('0x15')](0x194);}return _0x1af403;};}function handleError(_0x26d6f6,_0x113160){_0x113160=_0x113160||0x1f4;return function(_0x3653ca){logger['error'](_0x3653ca[_0xcaa6('0x23')]);if(_0x3653ca[_0xcaa6('0x24')]){delete _0x3653ca[_0xcaa6('0x24')];}_0x26d6f6['status'](_0x113160)[_0xcaa6('0x25')](_0x3653ca);};}exports['index']=function(_0xda11af,_0xeac590){var _0x222cfc={},_0x189ec9={},_0x338ed1={'count':0x0,'rows':[]};var _0x4dfbe6=_[_0xcaa6('0x26')](db[_0xcaa6('0x27')][_0xcaa6('0x28')],function(_0x361fa1){return{'name':_0x361fa1[_0xcaa6('0x29')],'type':_0x361fa1[_0xcaa6('0x2a')][_0xcaa6('0x2b')]};});_0x189ec9[_0xcaa6('0x2c')]=_[_0xcaa6('0x26')](_0x4dfbe6,_0xcaa6('0x24'));_0x189ec9[_0xcaa6('0x2d')]=_[_0xcaa6('0x2e')](_0xda11af[_0xcaa6('0x2d')]);_0x189ec9[_0xcaa6('0x2f')]=_['intersection'](_0x189ec9['model'],_0x189ec9[_0xcaa6('0x2d')]);_0x222cfc[_0xcaa6('0x30')]=_[_0xcaa6('0x31')](_0x189ec9[_0xcaa6('0x2c')],qs[_0xcaa6('0x32')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x32')]));_0x222cfc[_0xcaa6('0x30')]=_0x222cfc[_0xcaa6('0x30')][_0xcaa6('0x33')]?_0x222cfc['attributes']:_0x189ec9[_0xcaa6('0x2c')];if(!_0xda11af[_0xcaa6('0x2d')]['hasOwnProperty'](_0xcaa6('0x34'))){_0x222cfc['limit']=qs[_0xcaa6('0x35')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x35')]);_0x222cfc['offset']=qs[_0xcaa6('0x18')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x18')]);}_0x222cfc[_0xcaa6('0x36')]=qs[_0xcaa6('0x37')](_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x37')]);_0x222cfc[_0xcaa6('0x38')]=qs[_0xcaa6('0x2f')](_[_0xcaa6('0x39')](_0xda11af[_0xcaa6('0x2d')],_0x189ec9[_0xcaa6('0x2f')]),_0x4dfbe6);if(_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x3a')]){_0x222cfc[_0xcaa6('0x38')]=_[_0xcaa6('0x3b')](_0x222cfc[_0xcaa6('0x38')],{'$or':_[_0xcaa6('0x26')](_0x4dfbe6,function(_0x14af9f){if(_0x14af9f[_0xcaa6('0x2a')]!==_0xcaa6('0x3c')){var _0x2fee8e={};_0x2fee8e[_0x14af9f[_0xcaa6('0x24')]]={'$like':'%'+_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x3a')]+'%'};return _0x2fee8e;}})});}_0x222cfc=_['merge']({},_0x222cfc,_0xda11af[_0xcaa6('0x3d')]);var _0x1b6473={'where':_0x222cfc['where']};return db[_0xcaa6('0x27')][_0xcaa6('0x1a')](_0x1b6473)[_0xcaa6('0x20')](function(_0x2a3b4c){_0x338ed1[_0xcaa6('0x1a')]=_0x2a3b4c;if(_0xda11af[_0xcaa6('0x2d')][_0xcaa6('0x3e')]){_0x222cfc[_0xcaa6('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xcaa6('0x40')](_0x222cfc);})[_0xcaa6('0x20')](function(_0x297780){_0x338ed1['rows']=_0x297780;return _0x338ed1;})[_0xcaa6('0x20')](respondWithFilteredResult(_0xeac590,_0x222cfc))['catch'](handleError(_0xeac590,null));};exports[_0xcaa6('0x41')]=function(_0x1bf756,_0x2af87f){var _0x3068d9={'raw':!![],'where':{'id':_0x1bf756['params']['id']}},_0x4bd3ec={};_0x4bd3ec[_0xcaa6('0x2c')]=_[_0xcaa6('0x2e')](db['AnalyticTreeReport'][_0xcaa6('0x28')]);_0x4bd3ec[_0xcaa6('0x2d')]=_[_0xcaa6('0x2e')](_0x1bf756[_0xcaa6('0x2d')]);_0x4bd3ec[_0xcaa6('0x2f')]=_[_0xcaa6('0x31')](_0x4bd3ec[_0xcaa6('0x2c')],_0x4bd3ec[_0xcaa6('0x2d')]);_0x3068d9['attributes']=_[_0xcaa6('0x31')](_0x4bd3ec[_0xcaa6('0x2c')],qs['fields'](_0x1bf756[_0xcaa6('0x2d')][_0xcaa6('0x32')]));_0x3068d9['attributes']=_0x3068d9[_0xcaa6('0x30')][_0xcaa6('0x33')]?_0x3068d9[_0xcaa6('0x30')]:_0x4bd3ec[_0xcaa6('0x2c')];if(_0x1bf756[_0xcaa6('0x2d')]['includeAll']){_0x3068d9[_0xcaa6('0x3f')]=[{'all':!![]}];}_0x3068d9=_[_0xcaa6('0x3b')]({},_0x3068d9,_0x1bf756[_0xcaa6('0x3d')]);return db[_0xcaa6('0x27')][_0xcaa6('0x42')](_0x3068d9)['then'](handleEntityNotFound(_0x2af87f,null))[_0xcaa6('0x20')](respondWithResult(_0x2af87f,null))['catch'](handleError(_0x2af87f,null));};exports[_0xcaa6('0x43')]=function(_0x4f2d02,_0xdbf79a){return db[_0xcaa6('0x27')][_0xcaa6('0x43')](_0x4f2d02[_0xcaa6('0x44')],{})['then'](respondWithResult(_0xdbf79a,0xc9))[_0xcaa6('0x45')](handleError(_0xdbf79a,null));};exports[_0xcaa6('0x1f')]=function(_0x43ffb6,_0x468fc6){if(_0x43ffb6[_0xcaa6('0x44')]['id']){delete _0x43ffb6['body']['id'];}return db[_0xcaa6('0x27')][_0xcaa6('0x42')]({'where':{'id':_0x43ffb6[_0xcaa6('0x46')]['id']}})[_0xcaa6('0x20')](handleEntityNotFound(_0x468fc6,null))[_0xcaa6('0x20')](saveUpdates(_0x43ffb6[_0xcaa6('0x44')],null))['then'](respondWithResult(_0x468fc6,null))[_0xcaa6('0x45')](handleError(_0x468fc6,null));};exports[_0xcaa6('0x21')]=function(_0x329812,_0x79f88c){return db[_0xcaa6('0x27')][_0xcaa6('0x42')]({'where':{'id':_0x329812[_0xcaa6('0x46')]['id']}})[_0xcaa6('0x20')](handleEntityNotFound(_0x79f88c,null))[_0xcaa6('0x20')](removeEntity(_0x79f88c,null))['catch'](handleError(_0x79f88c,null));};
\ No newline at end of file
+var _0xc82a=['VIRTUAL','options','includeAll','include','AnalyticTreeReport','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','type','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x42fddd,_0xd397da){var _0x5b763d=function(_0xf19854){while(--_0xf19854){_0x42fddd['push'](_0x42fddd['shift']());}};_0x5b763d(++_0xd397da);}(_0xc82a,0xa9));var _0xac82=function(_0x332985,_0x216420){_0x332985=_0x332985-0x0;var _0x1a77c1=_0xc82a[_0x332985];return _0x1a77c1;};'use strict';var emlformat=require(_0xac82('0x0'));var rimraf=require(_0xac82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac82('0x2'));var rp=require(_0xac82('0x3'));var moment=require(_0xac82('0x4'));var BPromise=require(_0xac82('0x5'));var Mustache=require('mustache');var util=require(_0xac82('0x6'));var path=require(_0xac82('0x7'));var sox=require(_0xac82('0x8'));var csv=require('to-csv');var ejs=require(_0xac82('0x9'));var fs=require('fs');var fs_extra=require(_0xac82('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xac82('0xc'));var querystring=require(_0xac82('0xd'));var Papa=require(_0xac82('0xe'));var Redis=require(_0xac82('0xf'));var authService=require(_0xac82('0x10'));var qs=require(_0xac82('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac82('0x12'));var logger=require(_0xac82('0x13'))('api');var utils=require(_0xac82('0x14'));var config=require(_0xac82('0x15'));var licenseUtil=require(_0xac82('0x16'));var db=require(_0xac82('0x17'))['db'];function respondWithStatusCode(_0x589e00,_0x4662cb){_0x4662cb=_0x4662cb||0xcc;return function(_0x21ffa3){if(_0x21ffa3){return _0x589e00[_0xac82('0x18')](_0x4662cb);}return _0x589e00['status'](_0x4662cb)[_0xac82('0x19')]();};}function respondWithResult(_0x38b393,_0x4f3e9a){_0x4f3e9a=_0x4f3e9a||0xc8;return function(_0x23a18e){if(_0x23a18e){return _0x38b393[_0xac82('0x1a')](_0x4f3e9a)[_0xac82('0x1b')](_0x23a18e);}};}function respondWithFilteredResult(_0x127d72,_0x277fa2){return function(_0x442ce8){if(_0x442ce8){var _0x528dcb=typeof _0x277fa2[_0xac82('0x1c')]===_0xac82('0x1d')&&typeof _0x277fa2[_0xac82('0x1e')]===_0xac82('0x1d');var _0x4133ed=_0x442ce8[_0xac82('0x1f')];var _0x1c25c1=_0x528dcb?0x0:_0x277fa2['offset'];var _0x276894=_0x528dcb?_0x442ce8[_0xac82('0x1f')]:_0x277fa2[_0xac82('0x1c')]+_0x277fa2[_0xac82('0x1e')];var _0x30b400;if(_0x276894>=_0x4133ed){_0x276894=_0x4133ed;_0x30b400=0xc8;}else{_0x30b400=0xce;}_0x127d72[_0xac82('0x1a')](_0x30b400);return _0x127d72[_0xac82('0x20')](_0xac82('0x21'),_0x1c25c1+'-'+_0x276894+'/'+_0x4133ed)[_0xac82('0x1b')](_0x442ce8);}return null;};}function patchUpdates(_0x27da3b){return function(_0x581196){try{jsonpatch[_0xac82('0x22')](_0x581196,_0x27da3b,!![]);}catch(_0x2f807a){return BPromise['reject'](_0x2f807a);}return _0x581196[_0xac82('0x23')]();};}function saveUpdates(_0x4692f9,_0x16f39f){return function(_0xa9e3fc){if(_0xa9e3fc){return _0xa9e3fc[_0xac82('0x24')](_0x4692f9)[_0xac82('0x25')](function(_0x1bf348){return _0x1bf348;});}return null;};}function removeEntity(_0x3e52e4,_0x44ce12){return function(_0x259878){if(_0x259878){return _0x259878['destroy']()['then'](function(){_0x3e52e4[_0xac82('0x1a')](0xcc)[_0xac82('0x19')]();});}};}function handleEntityNotFound(_0x55f062,_0x225251){return function(_0x198c59){if(!_0x198c59){_0x55f062[_0xac82('0x18')](0x194);}return _0x198c59;};}function handleError(_0x5f461d,_0x48da25){_0x48da25=_0x48da25||0x1f4;return function(_0x321d76){logger[_0xac82('0x26')](_0x321d76[_0xac82('0x27')]);if(_0x321d76[_0xac82('0x28')]){delete _0x321d76[_0xac82('0x28')];}_0x5f461d['status'](_0x48da25)[_0xac82('0x29')](_0x321d76);};}exports[_0xac82('0x2a')]=function(_0x303f62,_0x4145e7){var _0x2c51ca={},_0x11a738={},_0x1e116d={'count':0x0,'rows':[]};var _0x3c1c7f=_[_0xac82('0x2b')](db['AnalyticTreeReport']['rawAttributes'],function(_0x469102){return{'name':_0x469102['fieldName'],'type':_0x469102[_0xac82('0x2c')]['key']};});_0x11a738['model']=_[_0xac82('0x2b')](_0x3c1c7f,_0xac82('0x28'));_0x11a738[_0xac82('0x2d')]=_[_0xac82('0x2e')](_0x303f62[_0xac82('0x2d')]);_0x11a738[_0xac82('0x2f')]=_[_0xac82('0x30')](_0x11a738[_0xac82('0x31')],_0x11a738[_0xac82('0x2d')]);_0x2c51ca[_0xac82('0x32')]=_[_0xac82('0x30')](_0x11a738['model'],qs[_0xac82('0x33')](_0x303f62[_0xac82('0x2d')][_0xac82('0x33')]));_0x2c51ca[_0xac82('0x32')]=_0x2c51ca[_0xac82('0x32')]['length']?_0x2c51ca['attributes']:_0x11a738[_0xac82('0x31')];if(!_0x303f62[_0xac82('0x2d')][_0xac82('0x34')](_0xac82('0x35'))){_0x2c51ca[_0xac82('0x1e')]=qs[_0xac82('0x1e')](_0x303f62[_0xac82('0x2d')][_0xac82('0x1e')]);_0x2c51ca[_0xac82('0x1c')]=qs[_0xac82('0x1c')](_0x303f62[_0xac82('0x2d')][_0xac82('0x1c')]);}_0x2c51ca[_0xac82('0x36')]=qs[_0xac82('0x37')](_0x303f62['query'][_0xac82('0x37')]);_0x2c51ca['where']=qs[_0xac82('0x2f')](_[_0xac82('0x38')](_0x303f62[_0xac82('0x2d')],_0x11a738[_0xac82('0x2f')]),_0x3c1c7f);if(_0x303f62[_0xac82('0x2d')][_0xac82('0x39')]){_0x2c51ca[_0xac82('0x3a')]=_['merge'](_0x2c51ca[_0xac82('0x3a')],{'$or':_[_0xac82('0x2b')](_0x3c1c7f,function(_0xc646ff){if(_0xc646ff['type']!==_0xac82('0x3b')){var _0x2fae9c={};_0x2fae9c[_0xc646ff[_0xac82('0x28')]]={'$like':'%'+_0x303f62[_0xac82('0x2d')][_0xac82('0x39')]+'%'};return _0x2fae9c;}})});}_0x2c51ca=_['merge']({},_0x2c51ca,_0x303f62[_0xac82('0x3c')]);var _0x498dba={'where':_0x2c51ca[_0xac82('0x3a')]};return db['AnalyticTreeReport'][_0xac82('0x1f')](_0x498dba)[_0xac82('0x25')](function(_0x1e5742){_0x1e116d[_0xac82('0x1f')]=_0x1e5742;if(_0x303f62[_0xac82('0x2d')][_0xac82('0x3d')]){_0x2c51ca[_0xac82('0x3e')]=[{'all':!![]}];}return db[_0xac82('0x3f')][_0xac82('0x40')](_0x2c51ca);})[_0xac82('0x25')](function(_0x3c3f03){_0x1e116d[_0xac82('0x41')]=_0x3c3f03;return _0x1e116d;})['then'](respondWithFilteredResult(_0x4145e7,_0x2c51ca))[_0xac82('0x42')](handleError(_0x4145e7,null));};exports[_0xac82('0x43')]=function(_0x558a3b,_0x57f86b){var _0x16a17d={'raw':!![],'where':{'id':_0x558a3b[_0xac82('0x44')]['id']}},_0x48642a={};_0x48642a[_0xac82('0x31')]=_[_0xac82('0x2e')](db[_0xac82('0x3f')][_0xac82('0x45')]);_0x48642a[_0xac82('0x2d')]=_['keys'](_0x558a3b['query']);_0x48642a['filters']=_[_0xac82('0x30')](_0x48642a[_0xac82('0x31')],_0x48642a[_0xac82('0x2d')]);_0x16a17d[_0xac82('0x32')]=_['intersection'](_0x48642a[_0xac82('0x31')],qs[_0xac82('0x33')](_0x558a3b[_0xac82('0x2d')][_0xac82('0x33')]));_0x16a17d[_0xac82('0x32')]=_0x16a17d[_0xac82('0x32')][_0xac82('0x46')]?_0x16a17d['attributes']:_0x48642a[_0xac82('0x31')];if(_0x558a3b[_0xac82('0x2d')][_0xac82('0x3d')]){_0x16a17d[_0xac82('0x3e')]=[{'all':!![]}];}_0x16a17d=_[_0xac82('0x47')]({},_0x16a17d,_0x558a3b[_0xac82('0x3c')]);return db[_0xac82('0x3f')][_0xac82('0x48')](_0x16a17d)['then'](handleEntityNotFound(_0x57f86b,null))[_0xac82('0x25')](respondWithResult(_0x57f86b,null))['catch'](handleError(_0x57f86b,null));};exports[_0xac82('0x49')]=function(_0x1eae80,_0x229b5b){return db[_0xac82('0x3f')][_0xac82('0x49')](_0x1eae80['body'],{})['then'](respondWithResult(_0x229b5b,0xc9))[_0xac82('0x42')](handleError(_0x229b5b,null));};exports[_0xac82('0x24')]=function(_0x3f44fb,_0x426151){if(_0x3f44fb[_0xac82('0x4a')]['id']){delete _0x3f44fb['body']['id'];}return db[_0xac82('0x3f')][_0xac82('0x48')]({'where':{'id':_0x3f44fb[_0xac82('0x44')]['id']}})[_0xac82('0x25')](handleEntityNotFound(_0x426151,null))[_0xac82('0x25')](saveUpdates(_0x3f44fb[_0xac82('0x4a')],null))[_0xac82('0x25')](respondWithResult(_0x426151,null))[_0xac82('0x42')](handleError(_0x426151,null));};exports[_0xac82('0x4b')]=function(_0x4e8aa4,_0x48bd37){return db['AnalyticTreeReport'][_0xac82('0x48')]({'where':{'id':_0x4e8aa4[_0xac82('0x44')]['id']}})['then'](handleEntityNotFound(_0x48bd37,null))[_0xac82('0x25')](removeEntity(_0x48bd37,null))[_0xac82('0x42')](handleError(_0x48bd37,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 64c9803..9324408 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 _0x4968=['rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b0fd6,_0x51a24c){var _0x2f6b80=function(_0x54e710){while(--_0x54e710){_0x5b0fd6['push'](_0x5b0fd6['shift']());}};_0x2f6b80(++_0x51a24c);}(_0x4968,0x13d));var _0x8496=function(_0x1e11e9,_0x42df78){_0x1e11e9=_0x1e11e9-0x0;var _0x3e10b8=_0x4968[_0x1e11e9];return _0x3e10b8;};'use strict';var _=require(_0x8496('0x0'));var util=require(_0x8496('0x1'));var logger=require(_0x8496('0x2'))(_0x8496('0x3'));var moment=require(_0x8496('0x4'));var BPromise=require(_0x8496('0x5'));var rp=require(_0x8496('0x6'));var fs=require('fs');var path=require(_0x8496('0x7'));var rimraf=require(_0x8496('0x8'));var config=require(_0x8496('0x9'));var attributes=require(_0x8496('0xa'));module[_0x8496('0xb')]=function(_0x104025,_0x37e8b8){return _0x104025[_0x8496('0xc')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa5ba=['../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5799ad,_0x8cf2fe){var _0x4b26fa=function(_0x17b8dd){while(--_0x17b8dd){_0x5799ad['push'](_0x5799ad['shift']());}};_0x4b26fa(++_0x8cf2fe);}(_0xa5ba,0x1d9));var _0xaa5b=function(_0x32d0c5,_0x339ced){_0x32d0c5=_0x32d0c5-0x0;var _0x99e80=_0xa5ba[_0x32d0c5];return _0x99e80;};'use strict';var _=require('lodash');var util=require(_0xaa5b('0x0'));var logger=require(_0xaa5b('0x1'))(_0xaa5b('0x2'));var moment=require(_0xaa5b('0x3'));var BPromise=require(_0xaa5b('0x4'));var rp=require(_0xaa5b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa5b('0x6'));var config=require(_0xaa5b('0x7'));var attributes=require(_0xaa5b('0x8'));module[_0xaa5b('0x9')]=function(_0x54dd33,_0x3d846e){return _0x54dd33[_0xaa5b('0xa')](_0xaa5b('0xb'),attributes,{'tableName':'analytics_report_trees','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 cd72dd3..57ef74a 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2dd8b1,_0xbfeabb){var _0x5f1eac=function(_0x32ac04){while(--_0x32ac04){_0x2dd8b1['push'](_0x2dd8b1['shift']());}};_0x5f1eac(++_0xbfeabb);}(_0x1261,0x144));var _0x1126=function(_0x43d604,_0x38a6d3){_0x43d604=_0x43d604-0x0;var _0x2f0f74=_0x1261[_0x43d604];return _0x2f0f74;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x59de2a,_0x264f62){var _0x1d18d2=function(_0x5c1a5a){while(--_0x5c1a5a){_0x59de2a['push'](_0x59de2a['shift']());}};_0x1d18d2(++_0x264f62);}(_0xadb5,0xad));var _0x5adb=function(_0x49a0ae,_0x1a4959){_0x49a0ae=_0x49a0ae-0x0;var _0x454b05=_0xadb5[_0x49a0ae];return _0x454b05;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index e0cb398..0723158 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 _0xb51e=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x3132dd,_0x20d1ed){var _0x23a4a1=function(_0x2a78f1){while(--_0x2a78f1){_0x3132dd['push'](_0x3132dd['shift']());}};_0x23a4a1(++_0x20d1ed);}(_0xb51e,0x134));var _0xeb51=function(_0xae1292,_0x51ef78){_0xae1292=_0xae1292-0x0;var _0x51d997=_0xb51e[_0xae1292];return _0x51d997;};'use strict';var multer=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var path=require('path');var timeout=require(_0xeb51('0x2'));var express=require(_0xeb51('0x3'));var router=express[_0xeb51('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xeb51('0x5'));var config=require(_0xeb51('0x6'));var controller=require(_0xeb51('0x7'));router[_0xeb51('0x8')]('/',auth[_0xeb51('0x9')](),controller[_0xeb51('0xa')]);router[_0xeb51('0x8')](_0xeb51('0xb'),auth[_0xeb51('0x9')](),controller[_0xeb51('0xc')]);router[_0xeb51('0xd')]('/',auth[_0xeb51('0x9')](),controller[_0xeb51('0xe')]);router[_0xeb51('0xf')](_0xeb51('0xb'),auth[_0xeb51('0x9')](),controller[_0xeb51('0x10')]);router[_0xeb51('0x11')]('/:id',auth[_0xeb51('0x9')](),controller['destroy']);module[_0xeb51('0x12')]=router;
\ No newline at end of file
+var _0x0da0=['./analyticTreeReport.controller','index','get','isAuthenticated','show','post','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x0da0,0x14d));var _0x00da=function(_0x554b5b,_0x5466fc){_0x554b5b=_0x554b5b-0x0;var _0x50d223=_0x0da0[_0x554b5b];return _0x50d223;};'use strict';var multer=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var path=require('path');var timeout=require(_0x00da('0x2'));var express=require(_0x00da('0x3'));var router=express[_0x00da('0x4')]();var fs_extra=require(_0x00da('0x5'));var auth=require(_0x00da('0x6'));var interaction=require(_0x00da('0x7'));var config=require(_0x00da('0x8'));var controller=require(_0x00da('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x00da('0xa')]);router[_0x00da('0xb')]('/:id',auth[_0x00da('0xc')](),controller[_0x00da('0xd')]);router[_0x00da('0xe')]('/',auth[_0x00da('0xc')](),controller['create']);router['put'](_0x00da('0xf'),auth[_0x00da('0xc')](),controller[_0x00da('0x10')]);router[_0x00da('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x00da('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 3dd9a16..98118d6 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 _0xaa19=['STRING','sequelize','exports'];(function(_0x5b45da,_0x52bb87){var _0x2327f7=function(_0x35c430){while(--_0x35c430){_0x5b45da['push'](_0x5b45da['shift']());}};_0x2327f7(++_0x52bb87);}(_0xaa19,0x79));var _0x9aa1=function(_0x2dc444,_0x5ef1ff){_0x2dc444=_0x2dc444-0x0;var _0x3205ef=_0xaa19[_0x2dc444];return _0x3205ef;};'use strict';var Sequelize=require(_0x9aa1('0x0'));module[_0x9aa1('0x1')]={'name':{'type':Sequelize[_0x9aa1('0x2')]},'basename':{'type':Sequelize[_0x9aa1('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd493=['STRING','sequelize'];(function(_0x13effa,_0xc7f14a){var _0x3ab647=function(_0x2d97bd){while(--_0x2d97bd){_0x13effa['push'](_0x13effa['shift']());}};_0x3ab647(++_0xc7f14a);}(_0xd493,0x1bd));var _0x3d49=function(_0x2068ae,_0x455540){_0x2068ae=_0x2068ae-0x0;var _0x37d844=_0xd493[_0x2068ae];return _0x37d844;};'use strict';var Sequelize=require(_0x3d49('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d49('0x1')]},'basename':{'type':Sequelize[_0x3d49('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index c10cbf8..73eae2b 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 _0xdd9a=['type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','options','include','catch','params','rawAttributes','merge','find','includeAll','get','updatedAt','body','create','originalname','file','mimetype','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','index','Attachment','fieldName'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0xdd9a,0x1bf));var _0xadd9=function(_0x5cc09d,_0x5a7735){_0x5cc09d=_0x5cc09d-0x0;var _0x306a29=_0xdd9a[_0x5cc09d];return _0x306a29;};'use strict';var emlformat=require(_0xadd9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xadd9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadd9('0x2'));var moment=require(_0xadd9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xadd9('0x4'));var util=require(_0xadd9('0x5'));var path=require(_0xadd9('0x6'));var sox=require(_0xadd9('0x7'));var csv=require(_0xadd9('0x8'));var ejs=require(_0xadd9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadd9('0xa'));var squel=require(_0xadd9('0xb'));var crypto=require(_0xadd9('0xc'));var jsforce=require(_0xadd9('0xd'));var deskjs=require(_0xadd9('0xe'));var toCsv=require(_0xadd9('0x8'));var querystring=require(_0xadd9('0xf'));var Papa=require('papaparse');var Redis=require(_0xadd9('0x10'));var authService=require(_0xadd9('0x11'));var qs=require(_0xadd9('0x12'));var as=require(_0xadd9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xadd9('0x14'));var config=require(_0xadd9('0x15'));var licenseUtil=require(_0xadd9('0x16'));var db=require(_0xadd9('0x17'))['db'];function respondWithStatusCode(_0x15382d,_0x20dcf9){_0x20dcf9=_0x20dcf9||0xcc;return function(_0x3d7b25){if(_0x3d7b25){return _0x15382d[_0xadd9('0x18')](_0x20dcf9);}return _0x15382d[_0xadd9('0x19')](_0x20dcf9)[_0xadd9('0x1a')]();};}function respondWithResult(_0x4414b2,_0x2d8395){_0x2d8395=_0x2d8395||0xc8;return function(_0x22e0c8){if(_0x22e0c8){return _0x4414b2[_0xadd9('0x19')](_0x2d8395)['json'](_0x22e0c8);}};}function respondWithFilteredResult(_0x53fb71,_0xe09e70){return function(_0x4faf55){if(_0x4faf55){var _0x117ca9=typeof _0xe09e70[_0xadd9('0x1b')]==='undefined'&&typeof _0xe09e70[_0xadd9('0x1c')]===_0xadd9('0x1d');var _0x5aa50a=_0x4faf55[_0xadd9('0x1e')];var _0x20d1b4=_0x117ca9?0x0:_0xe09e70[_0xadd9('0x1b')];var _0x19f992=_0x117ca9?_0x4faf55[_0xadd9('0x1e')]:_0xe09e70[_0xadd9('0x1b')]+_0xe09e70[_0xadd9('0x1c')];var _0x26e59e;if(_0x19f992>=_0x5aa50a){_0x19f992=_0x5aa50a;_0x26e59e=0xc8;}else{_0x26e59e=0xce;}_0x53fb71['status'](_0x26e59e);return _0x53fb71[_0xadd9('0x1f')](_0xadd9('0x20'),_0x20d1b4+'-'+_0x19f992+'/'+_0x5aa50a)[_0xadd9('0x21')](_0x4faf55);}return null;};}function patchUpdates(_0x39121e){return function(_0x544b17){try{jsonpatch[_0xadd9('0x22')](_0x544b17,_0x39121e,!![]);}catch(_0x45f93f){return BPromise[_0xadd9('0x23')](_0x45f93f);}return _0x544b17[_0xadd9('0x24')]();};}function saveUpdates(_0x1559e5,_0xfd9373){return function(_0x606b0f){if(_0x606b0f){return _0x606b0f[_0xadd9('0x25')](_0x1559e5)[_0xadd9('0x26')](function(_0x536101){return _0x536101;});}return null;};}function removeEntity(_0x2532a9,_0x2be88e){return function(_0x48af35){if(_0x48af35){return _0x48af35[_0xadd9('0x27')]()[_0xadd9('0x26')](function(){_0x2532a9[_0xadd9('0x19')](0xcc)[_0xadd9('0x1a')]();});}};}function handleEntityNotFound(_0x1d2c77,_0x658fc2){return function(_0x307887){if(!_0x307887){_0x1d2c77[_0xadd9('0x18')](0x194);}return _0x307887;};}function handleError(_0x5b81fd,_0x1744e4){_0x1744e4=_0x1744e4||0x1f4;return function(_0x5cf251){logger['error'](_0x5cf251[_0xadd9('0x28')]);if(_0x5cf251[_0xadd9('0x29')]){delete _0x5cf251['name'];}_0x5b81fd['status'](_0x1744e4)['send'](_0x5cf251);};}exports[_0xadd9('0x2a')]=function(_0x376532,_0x53d435){var _0x5d538c={},_0x127652={},_0x3daf66={'count':0x0,'rows':[]};var _0x39253d=_['map'](db[_0xadd9('0x2b')]['rawAttributes'],function(_0x56c4bb){return{'name':_0x56c4bb[_0xadd9('0x2c')],'type':_0x56c4bb[_0xadd9('0x2d')][_0xadd9('0x2e')]};});_0x127652['model']=_['map'](_0x39253d,_0xadd9('0x29'));_0x127652['query']=_[_0xadd9('0x2f')](_0x376532[_0xadd9('0x30')]);_0x127652['filters']=_[_0xadd9('0x31')](_0x127652[_0xadd9('0x32')],_0x127652[_0xadd9('0x30')]);_0x5d538c[_0xadd9('0x33')]=_[_0xadd9('0x31')](_0x127652['model'],qs[_0xadd9('0x34')](_0x376532[_0xadd9('0x30')][_0xadd9('0x34')]));_0x5d538c[_0xadd9('0x33')]=_0x5d538c['attributes'][_0xadd9('0x35')]?_0x5d538c[_0xadd9('0x33')]:_0x127652[_0xadd9('0x32')];if(!_0x376532[_0xadd9('0x30')][_0xadd9('0x36')]('nolimit')){_0x5d538c[_0xadd9('0x1c')]=qs[_0xadd9('0x1c')](_0x376532[_0xadd9('0x30')][_0xadd9('0x1c')]);_0x5d538c[_0xadd9('0x1b')]=qs[_0xadd9('0x1b')](_0x376532['query'][_0xadd9('0x1b')]);}_0x5d538c[_0xadd9('0x37')]=qs['sort'](_0x376532[_0xadd9('0x30')][_0xadd9('0x38')]);_0x5d538c[_0xadd9('0x39')]=qs['filters'](_['pick'](_0x376532['query'],_0x127652[_0xadd9('0x3a')]),_0x39253d);if(_0x376532['query'][_0xadd9('0x3b')]){_0x5d538c[_0xadd9('0x39')]=_['merge'](_0x5d538c[_0xadd9('0x39')],{'$or':_['map'](_0x39253d,function(_0x36612c){if(_0x36612c['type']!=='VIRTUAL'){var _0x2607d2={};_0x2607d2[_0x36612c['name']]={'$like':'%'+_0x376532[_0xadd9('0x30')][_0xadd9('0x3b')]+'%'};return _0x2607d2;}})});}_0x5d538c=_['merge']({},_0x5d538c,_0x376532[_0xadd9('0x3c')]);var _0x27bdbb={'where':_0x5d538c[_0xadd9('0x39')]};return db[_0xadd9('0x2b')][_0xadd9('0x1e')](_0x27bdbb)[_0xadd9('0x26')](function(_0x28a448){_0x3daf66[_0xadd9('0x1e')]=_0x28a448;if(_0x376532[_0xadd9('0x30')]['includeAll']){_0x5d538c[_0xadd9('0x3d')]=[{'all':!![]}];}return db[_0xadd9('0x2b')]['findAll'](_0x5d538c);})[_0xadd9('0x26')](function(_0x3cec83){_0x3daf66['rows']=_0x3cec83;return _0x3daf66;})[_0xadd9('0x26')](respondWithFilteredResult(_0x53d435,_0x5d538c))[_0xadd9('0x3e')](handleError(_0x53d435,null));};exports['show']=function(_0x6f68f8,_0x3ff4c5){var _0x1381d4={'raw':!![],'where':{'id':_0x6f68f8[_0xadd9('0x3f')]['id']}},_0x8612b={};_0x8612b['model']=_[_0xadd9('0x2f')](db[_0xadd9('0x2b')][_0xadd9('0x40')]);_0x8612b['query']=_[_0xadd9('0x2f')](_0x6f68f8['query']);_0x8612b['filters']=_[_0xadd9('0x31')](_0x8612b[_0xadd9('0x32')],_0x8612b[_0xadd9('0x30')]);_0x1381d4[_0xadd9('0x33')]=_[_0xadd9('0x31')](_0x8612b[_0xadd9('0x32')],qs[_0xadd9('0x34')](_0x6f68f8[_0xadd9('0x30')][_0xadd9('0x34')]));_0x1381d4[_0xadd9('0x33')]=_0x1381d4[_0xadd9('0x33')][_0xadd9('0x35')]?_0x1381d4[_0xadd9('0x33')]:_0x8612b[_0xadd9('0x32')];if(_0x6f68f8[_0xadd9('0x30')]['includeAll']){_0x1381d4['include']=[{'all':!![]}];}_0x1381d4=_[_0xadd9('0x41')]({},_0x1381d4,_0x6f68f8[_0xadd9('0x3c')]);return db[_0xadd9('0x2b')][_0xadd9('0x42')](_0x1381d4)['then'](handleEntityNotFound(_0x3ff4c5,null))['then'](respondWithResult(_0x3ff4c5,null))[_0xadd9('0x3e')](handleError(_0x3ff4c5,null));};exports['clone']=function(_0x5d3b75,_0x4097cd){var _0x493cf0={'where':{'id':_0x5d3b75[_0xadd9('0x3f')]['id']}},_0x3a3cb3={};_0x3a3cb3[_0xadd9('0x32')]=_[_0xadd9('0x2f')](db[_0xadd9('0x2b')]['rawAttributes']);_0x493cf0[_0xadd9('0x33')]=_[_0xadd9('0x31')](_0x3a3cb3[_0xadd9('0x32')],qs[_0xadd9('0x34')](_0x5d3b75[_0xadd9('0x30')]['fields']));_0x493cf0[_0xadd9('0x33')]=_0x493cf0[_0xadd9('0x33')]['length']?_0x493cf0['attributes']:_0x3a3cb3[_0xadd9('0x32')];if(_0x5d3b75[_0xadd9('0x30')][_0xadd9('0x43')]){_0x493cf0[_0xadd9('0x3d')]=[{'all':!![]}];}_0x493cf0=_[_0xadd9('0x41')]({},_0x493cf0,_0x5d3b75['options']);return db[_0xadd9('0x2b')][_0xadd9('0x42')](_0x493cf0)[_0xadd9('0x26')](handleEntityNotFound(_0x4097cd,null))[_0xadd9('0x26')](function(_0x5bdcd7){if(_0x5bdcd7){var _0x169312=_0x5bdcd7[_0xadd9('0x44')]({'plain':!![]});_0x169312=qs['omit'](_0x169312,['id','createdAt',_0xadd9('0x45')]);_0x5d3b75[_0xadd9('0x46')]=_['omit'](_0x5d3b75[_0xadd9('0x46')],['id','createdAt',_0xadd9('0x45')]);return db[_0xadd9('0x2b')][_0xadd9('0x47')](_[_0xadd9('0x41')](_0x169312,_0x5d3b75[_0xadd9('0x46')]),{'include':_0x5d3b75[_0xadd9('0x30')][_0xadd9('0x43')]?[{'all':!![]}]:undefined});}})[_0xadd9('0x26')](respondWithResult(_0x4097cd,0xc9))[_0xadd9('0x3e')](handleError(_0x4097cd,null));};exports['update']=function(_0x25ad40,_0x1986f6){if(_0x25ad40[_0xadd9('0x46')]['id']){delete _0x25ad40[_0xadd9('0x46')]['id'];}return db[_0xadd9('0x2b')][_0xadd9('0x42')]({'where':{'id':_0x25ad40[_0xadd9('0x3f')]['id']}})[_0xadd9('0x26')](handleEntityNotFound(_0x1986f6,null))['then'](saveUpdates(_0x25ad40[_0xadd9('0x46')],null))[_0xadd9('0x26')](respondWithResult(_0x1986f6,null))[_0xadd9('0x3e')](handleError(_0x1986f6,null));};exports[_0xadd9('0x27')]=function(_0x5a4c4a,_0x363b97){return db[_0xadd9('0x2b')][_0xadd9('0x42')]({'where':{'id':_0x5a4c4a['params']['id']}})[_0xadd9('0x26')](handleEntityNotFound(_0x363b97,null))[_0xadd9('0x26')](removeEntity(_0x363b97,null))[_0xadd9('0x3e')](handleError(_0x363b97,null));};exports[_0xadd9('0x47')]=function(_0x14b496,_0x1da7c6,_0x5a513f){_0x14b496['body'][_0xadd9('0x29')]=_0x14b496['file'][_0xadd9('0x48')];_0x14b496[_0xadd9('0x46')]['basename']=_0x14b496[_0xadd9('0x49')]['filename'];_0x14b496[_0xadd9('0x46')][_0xadd9('0x2d')]=_0x14b496[_0xadd9('0x49')][_0xadd9('0x4a')];return db[_0xadd9('0x2b')]['create'](_0x14b496[_0xadd9('0x46')])[_0xadd9('0x26')](respondWithResult(_0x1da7c6,0xc9))[_0xadd9('0x3e')](handleError(_0x1da7c6,null));};exports['download']=function(_0x4b4a1a,_0x1ac11a,_0x453056){return db['Attachment'][_0xadd9('0x4b')]({'where':{'id':_0x4b4a1a[_0xadd9('0x3f')]['id']},'raw':!![]})[_0xadd9('0x26')](handleEntityNotFound(_0x1ac11a,null))[_0xadd9('0x26')](function(_0x20fcaa){if(_0x20fcaa){var _0x2ebddd=_0x20fcaa[_0xadd9('0x4c')]!==null;var _0x49e96f=path[_0xadd9('0x4d')](config[_0xadd9('0x4e')],_0xadd9('0x4f'));if(_0x2ebddd){_0x49e96f=path[_0xadd9('0x4d')](_0x49e96f,_0xadd9('0x50'));}var _0x12df6d=path['join'](_0x49e96f,_0x20fcaa['basename']);return _0x1ac11a[_0xadd9('0x51')](_0x12df6d);}})[_0xadd9('0x3e')](handleError(_0x1ac11a,null));};
\ No newline at end of file
+var _0xb0b2=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','Attachment','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','clone','options','get','omit','body','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf'];(function(_0x4a8c03,_0x3fe458){var _0x243608=function(_0x513803){while(--_0x513803){_0x4a8c03['push'](_0x4a8c03['shift']());}};_0x243608(++_0x3fe458);}(_0xb0b2,0xb4));var _0x2b0b=function(_0x5b39e6,_0x3f3d77){_0x5b39e6=_0x5b39e6-0x0;var _0x26709a=_0xb0b2[_0x5b39e6];return _0x26709a;};'use strict';var emlformat=require(_0x2b0b('0x0'));var rimraf=require(_0x2b0b('0x1'));var zipdir=require(_0x2b0b('0x2'));var jsonpatch=require(_0x2b0b('0x3'));var rp=require('request-promise');var moment=require(_0x2b0b('0x4'));var BPromise=require(_0x2b0b('0x5'));var Mustache=require(_0x2b0b('0x6'));var util=require(_0x2b0b('0x7'));var path=require(_0x2b0b('0x8'));var sox=require(_0x2b0b('0x9'));var csv=require(_0x2b0b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b0b('0xb'));var squel=require('squel');var crypto=require(_0x2b0b('0xc'));var jsforce=require(_0x2b0b('0xd'));var deskjs=require(_0x2b0b('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2b0b('0xf'));var Redis=require('ioredis');var authService=require(_0x2b0b('0x10'));var qs=require(_0x2b0b('0x11'));var as=require(_0x2b0b('0x12'));var hardwareService=require(_0x2b0b('0x13'));var logger=require(_0x2b0b('0x14'))(_0x2b0b('0x15'));var utils=require(_0x2b0b('0x16'));var config=require(_0x2b0b('0x17'));var licenseUtil=require(_0x2b0b('0x18'));var db=require(_0x2b0b('0x19'))['db'];function respondWithStatusCode(_0x31af67,_0x481fbc){_0x481fbc=_0x481fbc||0xcc;return function(_0x369cfb){if(_0x369cfb){return _0x31af67[_0x2b0b('0x1a')](_0x481fbc);}return _0x31af67['status'](_0x481fbc)[_0x2b0b('0x1b')]();};}function respondWithResult(_0x27f37c,_0x28be1c){_0x28be1c=_0x28be1c||0xc8;return function(_0x35ded5){if(_0x35ded5){return _0x27f37c[_0x2b0b('0x1c')](_0x28be1c)[_0x2b0b('0x1d')](_0x35ded5);}};}function respondWithFilteredResult(_0x134a26,_0x232247){return function(_0x639dd7){if(_0x639dd7){var _0x5b0a8b=typeof _0x232247[_0x2b0b('0x1e')]===_0x2b0b('0x1f')&&typeof _0x232247[_0x2b0b('0x20')]===_0x2b0b('0x1f');var _0x57443a=_0x639dd7[_0x2b0b('0x21')];var _0x2d7208=_0x5b0a8b?0x0:_0x232247[_0x2b0b('0x1e')];var _0x4933ce=_0x5b0a8b?_0x639dd7[_0x2b0b('0x21')]:_0x232247[_0x2b0b('0x1e')]+_0x232247[_0x2b0b('0x20')];var _0x1cdc9f;if(_0x4933ce>=_0x57443a){_0x4933ce=_0x57443a;_0x1cdc9f=0xc8;}else{_0x1cdc9f=0xce;}_0x134a26[_0x2b0b('0x1c')](_0x1cdc9f);return _0x134a26[_0x2b0b('0x22')](_0x2b0b('0x23'),_0x2d7208+'-'+_0x4933ce+'/'+_0x57443a)['json'](_0x639dd7);}return null;};}function patchUpdates(_0x337f1e){return function(_0x5e1e84){try{jsonpatch[_0x2b0b('0x24')](_0x5e1e84,_0x337f1e,!![]);}catch(_0x493183){return BPromise['reject'](_0x493183);}return _0x5e1e84['save']();};}function saveUpdates(_0x2c230c,_0x2dbde5){return function(_0x5b57e1){if(_0x5b57e1){return _0x5b57e1[_0x2b0b('0x25')](_0x2c230c)[_0x2b0b('0x26')](function(_0x615e8b){return _0x615e8b;});}return null;};}function removeEntity(_0x34a6f6,_0x5c1d0d){return function(_0x546392){if(_0x546392){return _0x546392[_0x2b0b('0x27')]()[_0x2b0b('0x26')](function(){_0x34a6f6[_0x2b0b('0x1c')](0xcc)[_0x2b0b('0x1b')]();});}};}function handleEntityNotFound(_0x35cd59,_0x51f58b){return function(_0x291194){if(!_0x291194){_0x35cd59[_0x2b0b('0x1a')](0x194);}return _0x291194;};}function handleError(_0x5af92f,_0x2e140f){_0x2e140f=_0x2e140f||0x1f4;return function(_0x2434a4){logger[_0x2b0b('0x28')](_0x2434a4[_0x2b0b('0x29')]);if(_0x2434a4['name']){delete _0x2434a4[_0x2b0b('0x2a')];}_0x5af92f['status'](_0x2e140f)[_0x2b0b('0x2b')](_0x2434a4);};}exports[_0x2b0b('0x2c')]=function(_0x118bbf,_0x453a53){var _0x302f0f={},_0x558774={},_0x3fdb4f={'count':0x0,'rows':[]};var _0x277153=_[_0x2b0b('0x2d')](db[_0x2b0b('0x2e')]['rawAttributes'],function(_0x2df8dc){return{'name':_0x2df8dc[_0x2b0b('0x2f')],'type':_0x2df8dc[_0x2b0b('0x30')][_0x2b0b('0x31')]};});_0x558774[_0x2b0b('0x32')]=_[_0x2b0b('0x2d')](_0x277153,_0x2b0b('0x2a'));_0x558774['query']=_[_0x2b0b('0x33')](_0x118bbf[_0x2b0b('0x34')]);_0x558774['filters']=_['intersection'](_0x558774[_0x2b0b('0x32')],_0x558774[_0x2b0b('0x34')]);_0x302f0f[_0x2b0b('0x35')]=_[_0x2b0b('0x36')](_0x558774[_0x2b0b('0x32')],qs[_0x2b0b('0x37')](_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x37')]));_0x302f0f[_0x2b0b('0x35')]=_0x302f0f['attributes'][_0x2b0b('0x38')]?_0x302f0f[_0x2b0b('0x35')]:_0x558774[_0x2b0b('0x32')];if(!_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x39')](_0x2b0b('0x3a'))){_0x302f0f[_0x2b0b('0x20')]=qs[_0x2b0b('0x20')](_0x118bbf[_0x2b0b('0x34')]['limit']);_0x302f0f[_0x2b0b('0x1e')]=qs[_0x2b0b('0x1e')](_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x1e')]);}_0x302f0f[_0x2b0b('0x3b')]=qs[_0x2b0b('0x3c')](_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x3c')]);_0x302f0f[_0x2b0b('0x3d')]=qs[_0x2b0b('0x3e')](_[_0x2b0b('0x3f')](_0x118bbf[_0x2b0b('0x34')],_0x558774[_0x2b0b('0x3e')]),_0x277153);if(_0x118bbf[_0x2b0b('0x34')][_0x2b0b('0x40')]){_0x302f0f[_0x2b0b('0x3d')]=_['merge'](_0x302f0f[_0x2b0b('0x3d')],{'$or':_[_0x2b0b('0x2d')](_0x277153,function(_0xc966f1){if(_0xc966f1[_0x2b0b('0x30')]!=='VIRTUAL'){var _0x30abe9={};_0x30abe9[_0xc966f1[_0x2b0b('0x2a')]]={'$like':'%'+_0x118bbf[_0x2b0b('0x34')]['filter']+'%'};return _0x30abe9;}})});}_0x302f0f=_['merge']({},_0x302f0f,_0x118bbf['options']);var _0xcd942c={'where':_0x302f0f[_0x2b0b('0x3d')]};return db[_0x2b0b('0x2e')]['count'](_0xcd942c)[_0x2b0b('0x26')](function(_0x6dd43e){_0x3fdb4f[_0x2b0b('0x21')]=_0x6dd43e;if(_0x118bbf['query'][_0x2b0b('0x41')]){_0x302f0f[_0x2b0b('0x42')]=[{'all':!![]}];}return db[_0x2b0b('0x2e')][_0x2b0b('0x43')](_0x302f0f);})[_0x2b0b('0x26')](function(_0x3d0b9f){_0x3fdb4f['rows']=_0x3d0b9f;return _0x3fdb4f;})[_0x2b0b('0x26')](respondWithFilteredResult(_0x453a53,_0x302f0f))[_0x2b0b('0x44')](handleError(_0x453a53,null));};exports[_0x2b0b('0x45')]=function(_0x3f0256,_0x375624){var _0x8ab93c={'raw':!![],'where':{'id':_0x3f0256[_0x2b0b('0x46')]['id']}},_0x19b5e8={};_0x19b5e8[_0x2b0b('0x32')]=_[_0x2b0b('0x33')](db['Attachment'][_0x2b0b('0x47')]);_0x19b5e8['query']=_[_0x2b0b('0x33')](_0x3f0256['query']);_0x19b5e8[_0x2b0b('0x3e')]=_[_0x2b0b('0x36')](_0x19b5e8['model'],_0x19b5e8[_0x2b0b('0x34')]);_0x8ab93c[_0x2b0b('0x35')]=_[_0x2b0b('0x36')](_0x19b5e8[_0x2b0b('0x32')],qs['fields'](_0x3f0256[_0x2b0b('0x34')][_0x2b0b('0x37')]));_0x8ab93c[_0x2b0b('0x35')]=_0x8ab93c[_0x2b0b('0x35')][_0x2b0b('0x38')]?_0x8ab93c[_0x2b0b('0x35')]:_0x19b5e8[_0x2b0b('0x32')];if(_0x3f0256['query']['includeAll']){_0x8ab93c[_0x2b0b('0x42')]=[{'all':!![]}];}_0x8ab93c=_[_0x2b0b('0x48')]({},_0x8ab93c,_0x3f0256['options']);return db[_0x2b0b('0x2e')][_0x2b0b('0x49')](_0x8ab93c)[_0x2b0b('0x26')](handleEntityNotFound(_0x375624,null))['then'](respondWithResult(_0x375624,null))[_0x2b0b('0x44')](handleError(_0x375624,null));};exports[_0x2b0b('0x4a')]=function(_0xc9a1d6,_0x26eae5){var _0x580982={'where':{'id':_0xc9a1d6[_0x2b0b('0x46')]['id']}},_0x6ae8d3={};_0x6ae8d3['model']=_[_0x2b0b('0x33')](db[_0x2b0b('0x2e')]['rawAttributes']);_0x580982['attributes']=_[_0x2b0b('0x36')](_0x6ae8d3[_0x2b0b('0x32')],qs['fields'](_0xc9a1d6[_0x2b0b('0x34')][_0x2b0b('0x37')]));_0x580982['attributes']=_0x580982['attributes'][_0x2b0b('0x38')]?_0x580982['attributes']:_0x6ae8d3[_0x2b0b('0x32')];if(_0xc9a1d6['query'][_0x2b0b('0x41')]){_0x580982[_0x2b0b('0x42')]=[{'all':!![]}];}_0x580982=_['merge']({},_0x580982,_0xc9a1d6[_0x2b0b('0x4b')]);return db['Attachment'][_0x2b0b('0x49')](_0x580982)['then'](handleEntityNotFound(_0x26eae5,null))[_0x2b0b('0x26')](function(_0x214bbd){if(_0x214bbd){var _0x213a7d=_0x214bbd[_0x2b0b('0x4c')]({'plain':!![]});_0x213a7d=qs[_0x2b0b('0x4d')](_0x213a7d,['id','createdAt','updatedAt']);_0xc9a1d6[_0x2b0b('0x4e')]=_['omit'](_0xc9a1d6[_0x2b0b('0x4e')],['id','createdAt','updatedAt']);return db['Attachment'][_0x2b0b('0x4f')](_[_0x2b0b('0x48')](_0x213a7d,_0xc9a1d6[_0x2b0b('0x4e')]),{'include':_0xc9a1d6[_0x2b0b('0x34')]['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x26eae5,0xc9))['catch'](handleError(_0x26eae5,null));};exports[_0x2b0b('0x25')]=function(_0x4ca0b4,_0x2864a9){if(_0x4ca0b4['body']['id']){delete _0x4ca0b4[_0x2b0b('0x4e')]['id'];}return db['Attachment']['find']({'where':{'id':_0x4ca0b4[_0x2b0b('0x46')]['id']}})['then'](handleEntityNotFound(_0x2864a9,null))[_0x2b0b('0x26')](saveUpdates(_0x4ca0b4[_0x2b0b('0x4e')],null))['then'](respondWithResult(_0x2864a9,null))['catch'](handleError(_0x2864a9,null));};exports[_0x2b0b('0x27')]=function(_0x41d150,_0x4bdbcd){return db[_0x2b0b('0x2e')][_0x2b0b('0x49')]({'where':{'id':_0x41d150[_0x2b0b('0x46')]['id']}})[_0x2b0b('0x26')](handleEntityNotFound(_0x4bdbcd,null))[_0x2b0b('0x26')](removeEntity(_0x4bdbcd,null))[_0x2b0b('0x44')](handleError(_0x4bdbcd,null));};exports[_0x2b0b('0x4f')]=function(_0xa11432,_0x58e11f,_0x2d6418){_0xa11432[_0x2b0b('0x4e')][_0x2b0b('0x2a')]=_0xa11432[_0x2b0b('0x50')][_0x2b0b('0x51')];_0xa11432[_0x2b0b('0x4e')][_0x2b0b('0x52')]=_0xa11432[_0x2b0b('0x50')][_0x2b0b('0x53')];_0xa11432[_0x2b0b('0x4e')][_0x2b0b('0x30')]=_0xa11432['file'][_0x2b0b('0x54')];return db['Attachment'][_0x2b0b('0x4f')](_0xa11432['body'])[_0x2b0b('0x26')](respondWithResult(_0x58e11f,0xc9))['catch'](handleError(_0x58e11f,null));};exports[_0x2b0b('0x55')]=function(_0x1ff537,_0x82758a,_0x4cb996){return db[_0x2b0b('0x2e')][_0x2b0b('0x56')]({'where':{'id':_0x1ff537[_0x2b0b('0x46')]['id']},'raw':!![]})[_0x2b0b('0x26')](handleEntityNotFound(_0x82758a,null))['then'](function(_0x24a216){if(_0x24a216){var _0x224ccc=_0x24a216['ChatOfflineMessageId']!==null;var _0x24616d=path[_0x2b0b('0x57')](config[_0x2b0b('0x58')],_0x2b0b('0x59'));if(_0x224ccc){_0x24616d=path['join'](_0x24616d,_0x2b0b('0x5a'));}var _0x40bf3e=path[_0x2b0b('0x57')](_0x24616d,_0x24a216['basename']);return _0x82758a[_0x2b0b('0x55')](_0x40bf3e);}})['catch'](handleError(_0x82758a,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 7d04dee..622ce23 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 _0xc973=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments'];(function(_0x28e4ed,_0x29241f){var _0x45cf01=function(_0x44427c){while(--_0x44427c){_0x28e4ed['push'](_0x28e4ed['shift']());}};_0x45cf01(++_0x29241f);}(_0xc973,0xb6));var _0x3c97=function(_0x22d2c0,_0x46ec64){_0x22d2c0=_0x22d2c0-0x0;var _0x235585=_0xc973[_0x22d2c0];return _0x235585;};'use strict';var _=require(_0x3c97('0x0'));var util=require(_0x3c97('0x1'));var logger=require('../../config/logger')(_0x3c97('0x2'));var moment=require(_0x3c97('0x3'));var BPromise=require(_0x3c97('0x4'));var rp=require(_0x3c97('0x5'));var fs=require('fs');var path=require(_0x3c97('0x6'));var rimraf=require(_0x3c97('0x7'));var config=require(_0x3c97('0x8'));var attributes=require(_0x3c97('0x9'));module['exports']=function(_0x4f868f,_0x117677){return _0x4f868f[_0x3c97('0xa')](_0x3c97('0xb'),attributes,{'tableName':_0x3c97('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc4c=['lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./attachment.attributes','define','attachments'];(function(_0x59eeeb,_0x317f1c){var _0x51ea47=function(_0x412952){while(--_0x412952){_0x59eeeb['push'](_0x59eeeb['shift']());}};_0x51ea47(++_0x317f1c);}(_0xfc4c,0x104));var _0xcfc4=function(_0x77f18f,_0x51c0bd){_0x77f18f=_0x77f18f-0x0;var _0x4199b5=_0xfc4c[_0x77f18f];return _0x4199b5;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var logger=require(_0xcfc4('0x2'))(_0xcfc4('0x3'));var moment=require('moment');var BPromise=require(_0xcfc4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfc4('0x5'));var rimraf=require('rimraf');var config=require(_0xcfc4('0x6'));var attributes=require(_0xcfc4('0x7'));module['exports']=function(_0x19e8e4,_0x412340){return _0x19e8e4[_0xcfc4('0x8')]('Attachment',attributes,{'tableName':_0xcfc4('0x9'),'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 34618e0..7364264 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 _0x6c76=['request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateAttachment','debug','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s'];(function(_0x3f7d30,_0x288d25){var _0x220b4b=function(_0x4806fe){while(--_0x4806fe){_0x3f7d30['push'](_0x3f7d30['shift']());}};_0x220b4b(++_0x288d25);}(_0x6c76,0x184));var _0x66c7=function(_0x169124,_0x2d98b5){_0x169124=_0x169124-0x0;var _0x3ee0d3=_0x6c76[_0x169124];return _0x3ee0d3;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('Attachment,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['CreateAttachment']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['Attachment'][_0x66c7('0x14')](_0x5129f6[_0x66c7('0x15')],{'raw':_0x5129f6[_0x66c7('0x16')]?_0x5129f6[_0x66c7('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1853b2){logger[_0x66c7('0xa')](_0x66c7('0x17'),_0x5129f6);logger[_0x66c7('0x18')](_0x66c7('0x17'),_0x5129f6,JSON[_0x66c7('0xe')](_0x1853b2));_0x19f29d(_0x1853b2);})['catch'](function(_0x4ddbd2){logger[_0x66c7('0xf')]('CreateAttachment',_0x4ddbd2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0x4ddbd2[_0x66c7('0x11')]));});});};
\ No newline at end of file
+var _0xb377=['catch','CreateAttachment','Attachment','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0xb377,0x1b6));var _0x7b37=function(_0x5dd1d1,_0x54f22d){_0x5dd1d1=_0x5dd1d1-0x0;var _0x44d903=_0xb377[_0x5dd1d1];return _0x44d903;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var moment=require(_0x7b37('0x2'));var BPromise=require(_0x7b37('0x3'));var rs=require(_0x7b37('0x4'));var fs=require('fs');var Redis=require(_0x7b37('0x5'));var db=require(_0x7b37('0x6'))['db'];var utils=require(_0x7b37('0x7'));var logger=require(_0x7b37('0x8'))(_0x7b37('0x9'));var config=require(_0x7b37('0xa'));var jayson=require(_0x7b37('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x409d34,_0x4cb89b,_0x5afdb8){return new BPromise(function(_0x3de992,_0x3df40f){return client[_0x7b37('0xc')](_0x409d34,_0x5afdb8)[_0x7b37('0xd')](function(_0x1d435b){logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));logger['debug'](_0x7b37('0x11'),_0x4cb89b,_0x7b37('0x10'),JSON['stringify'](_0x1d435b));if(_0x1d435b['error']){if(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x13')]===0x1f4){logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3df40f(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}logger[_0x7b37('0x12')](_0x7b37('0xf'),_0x4cb89b,_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);return _0x3de992(_0x1d435b[_0x7b37('0x12')][_0x7b37('0x14')]);}else{logger[_0x7b37('0xe')](_0x7b37('0xf'),_0x4cb89b,_0x7b37('0x10'));_0x3de992(_0x1d435b['result']['message']);}})[_0x7b37('0x15')](function(_0x5b06f9){logger['error'](_0x7b37('0xf'),_0x4cb89b,_0x5b06f9);_0x3df40f(_0x5b06f9);});});}exports[_0x7b37('0x16')]=function(_0x1447aa){var _0x487f5c=this;return new Promise(function(_0x29a9dd,_0x46955a){return db[_0x7b37('0x17')]['create'](_0x1447aa['body'],{'raw':_0x1447aa[_0x7b37('0x18')]?_0x1447aa[_0x7b37('0x18')][_0x7b37('0x19')]===undefined?!![]:![]:!![]})[_0x7b37('0xd')](function(_0x30bf66){logger['info']('CreateAttachment',_0x1447aa);logger['debug'](_0x7b37('0x16'),_0x1447aa,JSON[_0x7b37('0x1a')](_0x30bf66));_0x29a9dd(_0x30bf66);})[_0x7b37('0x15')](function(_0x200f17){logger[_0x7b37('0x12')](_0x7b37('0x16'),_0x200f17[_0x7b37('0x14')],_0x1447aa);_0x46955a(_0x487f5c['error'](0x1f4,_0x200f17[_0x7b37('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2539656..a1390c1 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x280da7,_0x3859c5){var _0x1a5fde=function(_0x11d1a2){while(--_0x11d1a2){_0x280da7['push'](_0x280da7['shift']());}};_0x1a5fde(++_0x3859c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x32db89,_0x38e63e){_0x32db89=_0x32db89-0x0;var _0x786fe8=_0x5f2f[_0x32db89];return _0x786fe8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xa652a0,_0x560051){var _0xcec0f8=function(_0x1b2ceb){while(--_0x1b2ceb){_0xa652a0['push'](_0xa652a0['shift']());}};_0xcec0f8(++_0x560051);}(_0x2032,0xd9));var _0x2203=function(_0x336345,_0xac19ac){_0x336345=_0x336345-0x0;var _0x491db1=_0x2032[_0x336345];return _0x491db1;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 748bc01..c445352 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 _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(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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
+var _0x4192=['inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','blockedAt','admin','user','name','add','blockDuration','minutes','clearBlockUser','getLicense','catch','status','send','message','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','User','passport','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s'];(function(_0x34ed72,_0x5ad61f){var _0x369ddf=function(_0x3739d4){while(--_0x3739d4){_0x34ed72['push'](_0x34ed72['shift']());}};_0x369ddf(++_0x5ad61f);}(_0x4192,0x167));var _0x2419=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0x4192[_0x141486];return _0x1b5fb9;};'use strict';var passport=require(_0x2419('0x0'));var LocalStrategy=require(_0x2419('0x1'))[_0x2419('0x2')];var moment=require(_0x2419('0x3'));var ActiveDirectory=require(_0x2419('0x4'));var BPromise=require('bluebird');var util=require(_0x2419('0x5'));var db=require(_0x2419('0x6'))['db'];var authService=require(_0x2419('0x7'));var utils=require('../../config/utils');var config=require(_0x2419('0x8'));var logger=require(_0x2419('0x9'))(_0x2419('0xa'));function isActiveDirectoryConfigured(_0x4edefb){var _0x24fead=![];if(typeof _0x4edefb[_0x2419('0xb')]!=='undefined'){_0x24fead=_0x4edefb['activedirectory'][_0x2419('0xc')]&&_0x4edefb[_0x2419('0xb')][_0x2419('0xd')]&&_0x4edefb[_0x2419('0xb')]['domain'];}return _0x24fead;}function adAuthenticate(_0x168770,_0x233429,_0x3b3669){return new BPromise(function(_0x2712a2,_0x50cbb7){try{var _0xb4b8=new ActiveDirectory(_0x168770);_0xb4b8[_0x2419('0xe')](_0x233429,_0x3b3669,function(_0x58802b,_0x1a869e){if(_0x58802b){logger[_0x2419('0xf')](_0x2419('0x10'),_0x233429,util[_0x2419('0x11')](_0x58802b,{'showHidden':![],'depth':null}));_0x50cbb7(_0x2419('0x12'));}else if(!_0x1a869e){logger['error'](_0x2419('0x13'),_0x233429);_0x50cbb7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2712a2(_0x1a869e);}});}catch(_0x47d49c){_0x50cbb7(_0x47d49c);}});}function ActiveDirectoryAuthenticate(_0x3af846,_0x349249,_0x31538e,_0x4456ac){var _0x122d5e,_0x1e829e;if(!isActiveDirectoryConfigured(config)){logger[_0x2419('0xf')](_0x2419('0x14'),_0x349249);return _0x4456ac(null,![],{'message':_0x2419('0x12')});}return db[_0x2419('0x15')][_0x2419('0x16')]({'where':{'id':0x1},'attributes':[_0x2419('0x17'),'blockDuration'],'raw':!![]})[_0x2419('0x18')](function(_0x12a854){_0x122d5e=_0x12a854;if(!_0x122d5e[_0x2419('0x17')]){logger[_0x2419('0xf')](_0x2419('0x19'),_0x349249);throw new Error(_0x2419('0x12'));}return _0x3af846[_0x2419('0x16')]({'logging':!![],'attributes':['id','name',_0x2419('0x1a'),_0x2419('0x1b'),'role','disabled',_0x2419('0x1c'),_0x2419('0x1d'),'online'],'where':{'name':_0x349249,'role':{'$or':[_0x2419('0x1e'),_0x2419('0x1f'),'agent']},'adSsoEnabled':!![]}});})[_0x2419('0x18')](function(_0x5c30a6){if(!_0x5c30a6||_0x5c30a6&&_0x5c30a6[_0x2419('0x20')]!==_0x349249){throw new Error(_0x2419('0x12'));}_0x1e829e=_0x5c30a6;var _0x28c9ba=_0x1e829e[_0x2419('0x20')]+'@'+config[_0x2419('0xb')]['domain'];return adAuthenticate(config['activedirectory'],_0x28c9ba,_0x31538e);})['then'](function(_0x1c1c43){if(_0x1e829e['disabled']){throw new Error(_0x2419('0x12'));}if(_0x122d5e['blockDuration']>0x0){if(_0x1e829e[_0x2419('0x1c')]){if(moment(_0x1e829e['blockedAt'])[_0x2419('0x21')](_0x122d5e[_0x2419('0x22')],_0x2419('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x2419('0x24')](_0x1e829e,0x0,![],null)[_0x2419('0x18')](function(){return utils[_0x2419('0x25')](_0x1e829e);})[_0x2419('0x18')](function(){return _0x4456ac(null,_0x1e829e);});}else{return utils[_0x2419('0x25')](_0x1e829e)['then'](function(){return _0x4456ac(null,_0x1e829e);});}}else{return utils[_0x2419('0x25')](_0x1e829e)['then'](function(){return _0x4456ac(null,_0x1e829e);});}})[_0x2419('0x26')](function(_0x1fafb8){return _0x4456ac(null,![],_0x1fafb8);});}function handleError(_0x49955a,_0xef8fac,_0x534b97){return _0x49955a[_0x2419('0x27')](_0xef8fac||0x1f4)[_0x2419('0x28')]({'message':_0x534b97?_0x534b97[_0x2419('0x29')]||_0x534b97:''});}exports['login']=function(_0x171472,_0x2daad9,_0x1972d9){passport[_0x2419('0xe')](_0x2419('0x2a'),function(_0x597ec3,_0xc58eba,_0x42c18d){var _0x3e1bdb=_0x597ec3||_0x42c18d;if(_0x3e1bdb){return handleError(_0x2daad9,0x191,_0x3e1bdb);}if(!_0xc58eba){return handleError(_0x2daad9,0x194,{'message':_0x2419('0x2b')});}else{var _0x568129={'payload':{'id':_0xc58eba['id'],'role':_0xc58eba['role']},'options':{'expiresIn':0x15180}};return authService[_0x2419('0x2c')](_0x568129)[_0x2419('0x18')](function(_0x34a321){_0x2daad9['json']({'id':_0xc58eba['id'],'token':_0x34a321,'statusCall':'','isAlreadyLogged':_0xc58eba['online']});});}})(_0x171472,_0x2daad9,_0x1972d9);};passport[_0x2419('0x2d')](_0x2419('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x2419('0x1a')},function(_0x5d19e2,_0x431a12,_0x3a3210){return ActiveDirectoryAuthenticate(db[_0x2419('0x2e')],_0x5d19e2,_0x431a12,_0x3a3210);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 53ea4b2..4d431d2 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 _0xd3a6=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0x3aa902,_0x5bd67f){var _0x1719a1=function(_0x292a06){while(--_0x292a06){_0x3aa902['push'](_0x3aa902['shift']());}};_0x1719a1(++_0x5bd67f);}(_0xd3a6,0xcb));var _0x6d3a=function(_0x73024a,_0x1de560){_0x73024a=_0x73024a-0x0;var _0x4fba7a=_0xd3a6[_0x73024a];return _0x4fba7a;};'use strict';var express=require('express');var router=express[_0x6d3a('0x0')]();var controller=require(_0x6d3a('0x1'));router[_0x6d3a('0x2')]('/',controller[_0x6d3a('0x3')]);module[_0x6d3a('0x4')]=router;
\ No newline at end of file
+var _0x4650=['login','Router','./authActiveDirectory.controller','post'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4650,0xc1));var _0x0465=function(_0x510a7a,_0x40c4b5){_0x510a7a=_0x510a7a-0x0;var _0x4c999f=_0x4650[_0x510a7a];return _0x4c999f;};'use strict';var express=require('express');var router=express[_0x0465('0x0')]();var controller=require(_0x0465('0x1'));router[_0x0465('0x2')]('/',controller[_0x0465('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 82fc533..a1a7ebb 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(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x29ac1e,_0x3f02cc){_0x29ac1e=_0x29ac1e-0x0;var _0x29f918=_0x7a54[_0x29ac1e];return _0x29f918;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x3fda1e,_0x3f8d30){var _0x1126bc=function(_0x42774d){while(--_0x42774d){_0x3fda1e['push'](_0x3fda1e['shift']());}};_0x1126bc(++_0x3f8d30);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 5847e81..dc2da59 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 _0x8d0e=['Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback','setTokenCookie','exports','express','passport'];(function(_0x2d685c,_0x1fd061){var _0x5c5170=function(_0x1e8fe1){while(--_0x1e8fe1){_0x2d685c['push'](_0x2d685c['shift']());}};_0x5c5170(++_0x1fd061);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1d27a7,_0x43d21f){_0x1d27a7=_0x1d27a7-0x0;var _0x23d69e=_0x8d0e[_0x1d27a7];return _0x23d69e;};'use strict';var express=require(_0xe8d0('0x0'));var passport=require(_0xe8d0('0x1'));var router=express[_0xe8d0('0x2')]();var controller=require(_0xe8d0('0x3'));var userController=require(_0xe8d0('0x4'));var authService=require(_0xe8d0('0x5'));router[_0xe8d0('0x6')]('/',controller[_0xe8d0('0x7')]);router[_0xe8d0('0x6')]('/callback',controller[_0xe8d0('0x8')],authService['isMiddleware'],userController['login'],authService[_0xe8d0('0x9')]);module[_0xe8d0('0xa')]=router;
\ No newline at end of file
+var _0xadeb=['../../components/auth/service','get','/callback','isMiddleware','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xadeb,0x1bd));var _0xbade=function(_0x27757e,_0xb8d04c){_0x27757e=_0x27757e-0x0;var _0x59d3e4=_0xadeb[_0x27757e];return _0x59d3e4;};'use strict';var express=require('express');var passport=require(_0xbade('0x0'));var router=express['Router']();var controller=require(_0xbade('0x1'));var userController=require(_0xbade('0x2'));var authService=require(_0xbade('0x3'));router[_0xbade('0x4')]('/',controller['login']);router[_0xbade('0x4')](_0xbade('0x5'),controller['callback'],authService[_0xbade('0x6')],userController['login'],authService['setTokenCookie']);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 d233ace..7a84e75 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 _0x3f4e=['disabled','minutes','getLicense','catch','find','email','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','merge','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','local-login','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','securePassword','enforcePasswordHistory','password','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','User','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','blocked','blockedAt','admin','user','then','add','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser'];(function(_0xb5c596,_0x418482){var _0xbfb7b9=function(_0x53d143){while(--_0x53d143){_0xb5c596['push'](_0xb5c596['shift']());}};_0xbfb7b9(++_0x418482);}(_0x3f4e,0x17b));var _0xe3f4=function(_0xdded02,_0x385f97){_0xdded02=_0xdded02-0x0;var _0x132d3f=_0x3f4e[_0xdded02];return _0x132d3f;};'use strict';var util=require(_0xe3f4('0x0'));var passport=require('passport');var LocalStrategy=require(_0xe3f4('0x1'))[_0xe3f4('0x2')];var jayson=require(_0xe3f4('0x3'));var _=require(_0xe3f4('0x4'));var rs=require(_0xe3f4('0x5'));var moment=require(_0xe3f4('0x6'));var db=require(_0xe3f4('0x7'))['db'];var authService=require(_0xe3f4('0x8'));var utils=require(_0xe3f4('0x9'));var client=jayson['client'][_0xe3f4('0xa')]({'port':0x232b});function localAuthenticate(_0x5476ab,_0x12da80,_0x5970e8,_0x29d0a9){var _0x3c9831,_0x54884f;return db[_0xe3f4('0xb')][_0xe3f4('0xc')]({'where':{'id':0x1},'attributes':[_0xe3f4('0xd'),_0xe3f4('0xe')],'raw':!![]})['then'](function(_0x22b6d6){_0x3c9831=_0x22b6d6;return _0x5476ab[_0xe3f4('0xc')]({'attributes':['id',_0xe3f4('0xf'),'password',_0xe3f4('0x10'),_0xe3f4('0x11'),'disabled',_0xe3f4('0x12'),_0xe3f4('0x13'),'loginAttempts'],'where':{'name':_0x12da80,'role':{'$or':[_0xe3f4('0x14'),_0xe3f4('0x15'),'agent']}}});})[_0xe3f4('0x16')](function(_0x2226ab){if(!_0x2226ab||_0x2226ab&&_0x2226ab['name']!==_0x12da80){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x54884f=_0x2226ab;return _0x54884f;}})[_0xe3f4('0x16')](function(){_0x54884f['authenticate'](_0x5970e8,function(_0x29aac6,_0x4190f6){var _0x1c166e=_0x54884f['loginAttempts']+0x1;if(_0x29aac6){return _0x29d0a9(_0x29aac6);}else if(!_0x4190f6){if(_0x54884f['disabled']){return _0x29d0a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3c9831[_0xe3f4('0xd')]>0x0){if(_0x54884f[_0xe3f4('0x12')]){if(_0x3c9831['blockDuration']>0x0){if(moment(_0x54884f['blockedAt'])[_0xe3f4('0x17')](_0x3c9831[_0xe3f4('0xe')],'minutes')>moment()){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else{return utils[_0xe3f4('0x19')](_0x54884f,_0x1c166e,![],null)[_0xe3f4('0x16')](function(){return _0x29d0a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}}else{if(_0x1c166e>=_0x3c9831['allowedLoginAttempts']){return utils[_0xe3f4('0x19')](_0x54884f,0x0,!![],moment())['then'](function(){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});});}else{return utils[_0xe3f4('0x19')](_0x54884f,_0x1c166e,![],null)[_0xe3f4('0x16')](function(){return _0x29d0a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}}else{if(_0x54884f[_0xe3f4('0x1a')]){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else if(_0x3c9831[_0xe3f4('0xd')]>0x0){if(_0x54884f['blocked']){if(_0x3c9831[_0xe3f4('0xe')]>0x0){if(moment(_0x54884f[_0xe3f4('0x13')])['add'](_0x3c9831[_0xe3f4('0xe')],_0xe3f4('0x1b'))>moment()){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else{return utils[_0xe3f4('0x19')](_0x54884f,0x0,![],null)[_0xe3f4('0x16')](function(){return utils[_0xe3f4('0x1c')](_0x54884f);})[_0xe3f4('0x16')](function(){return _0x29d0a9(null,_0x54884f);});}}else{return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}}else{return utils[_0xe3f4('0x19')](_0x54884f,0x0,![],null)[_0xe3f4('0x16')](function(){return utils[_0xe3f4('0x1c')](_0x54884f);})['then'](function(){return _0x29d0a9(null,_0x54884f);})[_0xe3f4('0x1d')](function(_0x1c0929){return _0x29d0a9(null,![],_0x1c0929);});}}else{if(_0x54884f[_0xe3f4('0x12')]){return _0x29d0a9(null,![],{'message':_0xe3f4('0x18')});}else{return utils[_0xe3f4('0x1c')](_0x54884f)[_0xe3f4('0x16')](function(){return _0x29d0a9(null,_0x54884f);});}}}});})[_0xe3f4('0x1d')](function(_0x2bbe21){return _0x29d0a9(null,![],_0x2bbe21);});}function sendServiceMail(_0x13eb5b){return db['MailAccount'][_0xe3f4('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xe3f4('0xf'),_0xe3f4('0x1f')],'include':[{'model':db[_0xe3f4('0x20')],'as':_0xe3f4('0x21')}]})[_0xe3f4('0x16')](function(_0x146073){if(!_0x146073){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x191e6b={'tls':{'rejectUnauthorized':![]}};if(_0x146073['Smtp'][_0xe3f4('0x22')]){_0x191e6b[_0xe3f4('0x22')]=_0x146073[_0xe3f4('0x21')][_0xe3f4('0x22')];}else{_0x191e6b['host']=_0x146073['Smtp']['host'];_0x191e6b['port']=_0x146073['Smtp'][_0xe3f4('0x23')];_0x191e6b[_0xe3f4('0x24')]=_0x146073['Smtp']['secure'];}if(_0x146073[_0xe3f4('0x21')][_0xe3f4('0x25')]){_0x191e6b[_0xe3f4('0x26')]={'user':_0x146073[_0xe3f4('0x21')][_0xe3f4('0x15')],'pass':_0x146073[_0xe3f4('0x21')][_0xe3f4('0x27')]};}var _0x257f2b={'account':_0x191e6b,'message':_[_0xe3f4('0x28')]({'from':util['format'](_0xe3f4('0x29'),_0x146073[_0xe3f4('0xf')],_0x146073['email']||_0x146073[_0xe3f4('0x21')][_0xe3f4('0x15')])},_0x13eb5b)};return client[_0xe3f4('0x2a')]('SendMail',_0x257f2b);})[_0xe3f4('0x16')](function(_0xa8d8c3){if(_0xa8d8c3[_0xe3f4('0x2b')]){throw new Error(util[_0xe3f4('0x2c')](_0xe3f4('0x2d'),_0xa8d8c3[_0xe3f4('0x2b')][_0xe3f4('0x2e')]||JSON['stringify'](_0xa8d8c3[_0xe3f4('0x2b')])));}return!![];});}function handleError(_0x5643a0,_0x58cc72,_0x545d56){return _0x5643a0['status'](_0x58cc72||0x1f4)[_0xe3f4('0x2f')]({'message':_0x545d56?_0x545d56[_0xe3f4('0x2e')]||_0x545d56:''});}exports['login']=function(_0x1aa41a,_0x4ca3ec,_0x1fe892){passport[_0xe3f4('0x30')](_0xe3f4('0x31'),function(_0x115394,_0x4ba6f3,_0x4b85d2){var _0x32d686=_0x115394||_0x4b85d2;if(_0x32d686){return handleError(_0x4ca3ec,0x191,_0x32d686);}if(!_0x4ba6f3){return handleError(_0x4ca3ec,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1bde56={'payload':{'id':_0x4ba6f3['id'],'role':_0x4ba6f3[_0xe3f4('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0xe3f4('0x32')](_0x1bde56)['then'](function(_0x31b804){_0x4ca3ec[_0xe3f4('0x33')]({'id':_0x4ba6f3['id'],'token':_0x31b804,'statusCall':'','isAlreadyLogged':_0x4ba6f3[_0xe3f4('0x34')]});});}})(_0x1aa41a,_0x4ca3ec,_0x1fe892);};exports[_0xe3f4('0x35')]=function(_0xffba60,_0x51983c,_0x1b5643){if(!_0xffba60['body'][_0xe3f4('0x1f')]){return handleError(_0x51983c,0x1f4,{'message':_0xe3f4('0x36')});}var _0xf1c96d=rs[_0xe3f4('0x37')]();_0xffba60[_0xe3f4('0x38')][_0xe3f4('0x1f')]=_0xffba60[_0xe3f4('0x38')][_0xe3f4('0x1f')][_0xe3f4('0x39')]()['toLowerCase']();var _0x294b7d;return db[_0xe3f4('0xb')][_0xe3f4('0xc')]({'where':{'id':0x1},'attributes':[_0xe3f4('0xd'),'blockDuration'],'raw':!![]})[_0xe3f4('0x16')](function(_0x1602d4){_0x294b7d=_0x1602d4;return db['User']['find']({'where':{'email':_0xffba60[_0xe3f4('0x38')][_0xe3f4('0x1f')]}});})['then'](function(_0x5b8c2f){if(!_0x5b8c2f){throw new Error(_0xe3f4('0x3a'));}if(_0x5b8c2f['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5b8c2f['blocked']){if(moment(_0x5b8c2f['blockedAt'])[_0xe3f4('0x17')](_0x294b7d['blockDuration'],'minutes')>moment()){throw new Error(_0xe3f4('0x3b'));}else{_0x5b8c2f[_0xe3f4('0x12')]=![];_0x5b8c2f[_0xe3f4('0x13')]=null;}}_0x5b8c2f[_0xe3f4('0x3c')]=_0xf1c96d;_0x5b8c2f['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x5b8c2f['save']();})['then'](function(){return sendServiceMail({'to':_0xffba60['body']['email'],'subject':_0xe3f4('0x3d'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xe3f4('0x3e')+_0xe3f4('0x3f')+_0xffba60[_0xe3f4('0x40')][_0xe3f4('0x41')]+_0xe3f4('0x42')+_0xf1c96d+'\x0a\x0a'+_0xe3f4('0x43')});})[_0xe3f4('0x16')](function(){_0x51983c[_0xe3f4('0x44')](0xc8)[_0xe3f4('0x2f')]({'message':'Reset\x20Email\x20sent!'});})[_0xe3f4('0x1d')](function(_0xf19cd7){return handleError(_0x51983c,0x1f4,_0xf19cd7);});};exports['reset']=function(_0x502690,_0x58b46d,_0x56af9d){return db['User'][_0xe3f4('0x1e')]({'where':{'resetPasswordToken':_0x502690[_0xe3f4('0x45')][_0xe3f4('0x46')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x4a87e9){if(!_0x4a87e9){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xe3f4('0xb')][_0xe3f4('0xc')]({'attributes':['id',_0xe3f4('0x47'),_0xe3f4('0x48'),'passwordHistoryLimit']})[_0xe3f4('0x16')](function(_0x461a38){if(_0x461a38['securePassword'])authService['validatePasswordPattern'](_0x502690['body'][_0xe3f4('0x49')]);if(!_0x461a38[_0xe3f4('0x48')]||!_0x4a87e9[_0xe3f4('0x4a')])return _0x4a87e9;authService[_0xe3f4('0x4b')](_0x502690[_0xe3f4('0x38')]['password'],_0x4a87e9[_0xe3f4('0x4a')],_0x461a38[_0xe3f4('0x4c')]);return _0x4a87e9;})[_0xe3f4('0x16')](function(){_0x4a87e9[_0xe3f4('0x49')]=_0x502690[_0xe3f4('0x38')][_0xe3f4('0x49')];_0x4a87e9[_0xe3f4('0x3c')]=null;_0x4a87e9['resetPasswordExpires']=null;return _0x4a87e9[_0xe3f4('0x4d')]();});})[_0xe3f4('0x16')](function(){_0x58b46d[_0xe3f4('0x44')](0xc8)[_0xe3f4('0x2f')]({'message':_0xe3f4('0x4e')});})[_0xe3f4('0x1d')](function(_0x46331e){return handleError(_0x58b46d,0x1f4,_0x46331e);});};passport[_0xe3f4('0x4f')](_0xe3f4('0x31'),new LocalStrategy({'usernameField':_0xe3f4('0xf'),'passwordField':'password'},function(_0x3daca3,_0x320346,_0x5d882f){return localAuthenticate(db[_0xe3f4('0x50')],_0x3daca3,_0x320346,_0x5d882f);}));
\ No newline at end of file
+var _0x0590=['\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','login','local-login','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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://','headers','host','status','send','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','User','passport-local','Strategy','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','secure','auth','pass','merge','format'];(function(_0x38c987,_0x32d09c){var _0xc6c966=function(_0x2ee84e){while(--_0x2ee84e){_0x38c987['push'](_0x38c987['shift']());}};_0xc6c966(++_0x32d09c);}(_0x0590,0x166));var _0x0059=function(_0x49de06,_0x525321){_0x49de06=_0x49de06-0x0;var _0x59fda1=_0x0590[_0x49de06];return _0x59fda1;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x0059('0x0'))[_0x0059('0x1')];var jayson=require(_0x0059('0x2'));var _=require('lodash');var rs=require(_0x0059('0x3'));var moment=require('moment');var db=require(_0x0059('0x4'))['db'];var authService=require(_0x0059('0x5'));var utils=require('../../config/utils');var client=jayson[_0x0059('0x6')][_0x0059('0x7')]({'port':0x232b});function localAuthenticate(_0x489111,_0x21767b,_0x57b16e,_0xca9f50){var _0x23c5f5,_0x4c001f;return db[_0x0059('0x8')][_0x0059('0x9')]({'where':{'id':0x1},'attributes':[_0x0059('0xa'),'blockDuration'],'raw':!![]})[_0x0059('0xb')](function(_0x36121d){_0x23c5f5=_0x36121d;return _0x489111[_0x0059('0x9')]({'attributes':['id','name',_0x0059('0xc'),_0x0059('0xd'),_0x0059('0xe'),_0x0059('0xf'),_0x0059('0x10'),_0x0059('0x11'),_0x0059('0x12')],'where':{'name':_0x21767b,'role':{'$or':['admin',_0x0059('0x13'),_0x0059('0x14')]}}});})[_0x0059('0xb')](function(_0x341329){if(!_0x341329||_0x341329&&_0x341329[_0x0059('0x15')]!==_0x21767b){throw new Error(_0x0059('0x16'));}else{_0x4c001f=_0x341329;return _0x4c001f;}})['then'](function(){_0x4c001f[_0x0059('0x17')](_0x57b16e,function(_0x1c59dd,_0x4a1a22){var _0x2d3c82=_0x4c001f[_0x0059('0x12')]+0x1;if(_0x1c59dd){return _0xca9f50(_0x1c59dd);}else if(!_0x4a1a22){if(_0x4c001f[_0x0059('0xf')]){return _0xca9f50(null,![],{'message':_0x0059('0x16')});}else if(_0x23c5f5[_0x0059('0xa')]>0x0){if(_0x4c001f['blocked']){if(_0x23c5f5[_0x0059('0x18')]>0x0){if(moment(_0x4c001f['blockedAt'])[_0x0059('0x19')](_0x23c5f5['blockDuration'],'minutes')>moment()){return _0xca9f50(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x0059('0x1a')](_0x4c001f,_0x2d3c82,![],null)[_0x0059('0xb')](function(){return _0xca9f50(null,![],{'message':_0x0059('0x16')});});}}else{return _0xca9f50(null,![],{'message':_0x0059('0x16')});}}else{if(_0x2d3c82>=_0x23c5f5[_0x0059('0xa')]){return utils['clearBlockUser'](_0x4c001f,0x0,!![],moment())[_0x0059('0xb')](function(){return _0xca9f50(null,![],{'message':_0x0059('0x16')});});}else{return utils[_0x0059('0x1a')](_0x4c001f,_0x2d3c82,![],null)[_0x0059('0xb')](function(){return _0xca9f50(null,![],{'message':_0x0059('0x16')});});}}}else{return _0xca9f50(null,![],{'message':_0x0059('0x16')});}}else{if(_0x4c001f['disabled']){return _0xca9f50(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x23c5f5[_0x0059('0xa')]>0x0){if(_0x4c001f[_0x0059('0x10')]){if(_0x23c5f5[_0x0059('0x18')]>0x0){if(moment(_0x4c001f[_0x0059('0x11')])['add'](_0x23c5f5[_0x0059('0x18')],_0x0059('0x1b'))>moment()){return _0xca9f50(null,![],{'message':_0x0059('0x16')});}else{return utils[_0x0059('0x1a')](_0x4c001f,0x0,![],null)[_0x0059('0xb')](function(){return utils[_0x0059('0x1c')](_0x4c001f);})['then'](function(){return _0xca9f50(null,_0x4c001f);});}}else{return _0xca9f50(null,![],{'message':_0x0059('0x16')});}}else{return utils[_0x0059('0x1a')](_0x4c001f,0x0,![],null)[_0x0059('0xb')](function(){return utils[_0x0059('0x1c')](_0x4c001f);})[_0x0059('0xb')](function(){return _0xca9f50(null,_0x4c001f);})[_0x0059('0x1d')](function(_0x2029dd){return _0xca9f50(null,![],_0x2029dd);});}}else{if(_0x4c001f[_0x0059('0x10')]){return _0xca9f50(null,![],{'message':_0x0059('0x16')});}else{return utils['getLicense'](_0x4c001f)[_0x0059('0xb')](function(){return _0xca9f50(null,_0x4c001f);});}}}});})[_0x0059('0x1d')](function(_0x55ce4a){return _0xca9f50(null,![],_0x55ce4a);});}function sendServiceMail(_0x3f2fd6){return db[_0x0059('0x1e')][_0x0059('0x1f')]({'where':{'service':!![]},'attributes':['id','name',_0x0059('0x20')],'include':[{'model':db[_0x0059('0x21')],'as':_0x0059('0x22')}]})[_0x0059('0xb')](function(_0xa00528){if(!_0xa00528){throw new Error(_0x0059('0x23'));}var _0x3a1e3a={'tls':{'rejectUnauthorized':![]}};if(_0xa00528[_0x0059('0x22')][_0x0059('0x24')]){_0x3a1e3a[_0x0059('0x24')]=_0xa00528[_0x0059('0x22')]['service'];}else{_0x3a1e3a['host']=_0xa00528[_0x0059('0x22')]['host'];_0x3a1e3a['port']=_0xa00528['Smtp']['port'];_0x3a1e3a['secure']=_0xa00528[_0x0059('0x22')][_0x0059('0x25')];}if(_0xa00528[_0x0059('0x22')]['authentication']){_0x3a1e3a[_0x0059('0x26')]={'user':_0xa00528[_0x0059('0x22')][_0x0059('0x13')],'pass':_0xa00528[_0x0059('0x22')][_0x0059('0x27')]};}var _0x69983={'account':_0x3a1e3a,'message':_[_0x0059('0x28')]({'from':util[_0x0059('0x29')](_0x0059('0x2a'),_0xa00528['name'],_0xa00528[_0x0059('0x20')]||_0xa00528[_0x0059('0x22')][_0x0059('0x13')])},_0x3f2fd6)};return client[_0x0059('0x2b')](_0x0059('0x2c'),_0x69983);})['then'](function(_0x255dbc){if(_0x255dbc[_0x0059('0x2d')]){throw new Error(util[_0x0059('0x29')](_0x0059('0x2e'),_0x255dbc[_0x0059('0x2d')][_0x0059('0x2f')]||JSON[_0x0059('0x30')](_0x255dbc[_0x0059('0x2d')])));}return!![];});}function handleError(_0x2b55f3,_0x4ed6f3,_0x516e1d){return _0x2b55f3['status'](_0x4ed6f3||0x1f4)['send']({'message':_0x516e1d?_0x516e1d[_0x0059('0x2f')]||_0x516e1d:''});}exports[_0x0059('0x31')]=function(_0x7f62ec,_0xb8bcdc,_0x220974){passport[_0x0059('0x17')](_0x0059('0x32'),function(_0x1cf95b,_0x8bc798,_0x1e0510){var _0x352699=_0x1cf95b||_0x1e0510;if(_0x352699){return handleError(_0xb8bcdc,0x191,_0x352699);}if(!_0x8bc798){return handleError(_0xb8bcdc,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x27b656={'payload':{'id':_0x8bc798['id'],'role':_0x8bc798[_0x0059('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x0059('0x33')](_0x27b656)[_0x0059('0xb')](function(_0x425657){_0xb8bcdc[_0x0059('0x34')]({'id':_0x8bc798['id'],'token':_0x425657,'statusCall':'','isAlreadyLogged':_0x8bc798[_0x0059('0x35')]});});}})(_0x7f62ec,_0xb8bcdc,_0x220974);};exports['forgot']=function(_0x4a4b4d,_0x4978f4,_0x432409){if(!_0x4a4b4d['body'][_0x0059('0x20')]){return handleError(_0x4978f4,0x1f4,{'message':_0x0059('0x36')});}var _0x4e5a54=rs[_0x0059('0x37')]();_0x4a4b4d[_0x0059('0x38')]['email']=_0x4a4b4d[_0x0059('0x38')]['email']['trim']()[_0x0059('0x39')]();var _0x5895d1;return db[_0x0059('0x8')][_0x0059('0x9')]({'where':{'id':0x1},'attributes':[_0x0059('0xa'),'blockDuration'],'raw':!![]})[_0x0059('0xb')](function(_0x7f5cb0){_0x5895d1=_0x7f5cb0;return db['User'][_0x0059('0x1f')]({'where':{'email':_0x4a4b4d[_0x0059('0x38')][_0x0059('0x20')]}});})[_0x0059('0xb')](function(_0x23342d){if(!_0x23342d){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x23342d[_0x0059('0xf')]){throw new Error(_0x0059('0x3a'));}if(_0x23342d[_0x0059('0x10')]){if(moment(_0x23342d[_0x0059('0x11')])[_0x0059('0x19')](_0x5895d1[_0x0059('0x18')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x23342d[_0x0059('0x10')]=![];_0x23342d[_0x0059('0x11')]=null;}}_0x23342d[_0x0059('0x3b')]=_0x4e5a54;_0x23342d[_0x0059('0x3c')]=Date[_0x0059('0x3d')]()+0x36ee80;return _0x23342d['save']();})[_0x0059('0xb')](function(){return sendServiceMail({'to':_0x4a4b4d['body']['email'],'subject':_0x0059('0x3e'),'text':_0x0059('0x3f')+_0x0059('0x40')+_0x0059('0x41')+_0x4a4b4d[_0x0059('0x42')][_0x0059('0x43')]+'/reset/'+_0x4e5a54+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0059('0xb')](function(){_0x4978f4[_0x0059('0x44')](0xc8)[_0x0059('0x45')]({'message':'Reset\x20Email\x20sent!'});})[_0x0059('0x1d')](function(_0x5c2043){return handleError(_0x4978f4,0x1f4,_0x5c2043);});};exports['reset']=function(_0x523d90,_0x5b4cf7,_0x2e5370){return db['User']['find']({'where':{'resetPasswordToken':_0x523d90['params'][_0x0059('0x46')],'resetPasswordExpires':{'$gt':Date[_0x0059('0x3d')]()}}})[_0x0059('0xb')](function(_0x2693d0){if(!_0x2693d0){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x0059('0x9')]({'attributes':['id',_0x0059('0x47'),'enforcePasswordHistory',_0x0059('0x48')]})['then'](function(_0x3bc28d){if(_0x3bc28d[_0x0059('0x47')])authService[_0x0059('0x49')](_0x523d90[_0x0059('0x38')][_0x0059('0xc')]);if(!_0x3bc28d[_0x0059('0x4a')]||!_0x2693d0[_0x0059('0x4b')])return _0x2693d0;authService[_0x0059('0x4c')](_0x523d90[_0x0059('0x38')][_0x0059('0xc')],_0x2693d0[_0x0059('0x4b')],_0x3bc28d[_0x0059('0x48')]);return _0x2693d0;})['then'](function(){_0x2693d0[_0x0059('0xc')]=_0x523d90['body'][_0x0059('0xc')];_0x2693d0['resetPasswordToken']=null;_0x2693d0[_0x0059('0x3c')]=null;return _0x2693d0['save']();});})[_0x0059('0xb')](function(){_0x5b4cf7[_0x0059('0x44')](0xc8)[_0x0059('0x45')]({'message':_0x0059('0x4d')});})[_0x0059('0x1d')](function(_0x3cf2a6){return handleError(_0x5b4cf7,0x1f4,_0x3cf2a6);});};passport[_0x0059('0x4e')]('local-login',new LocalStrategy({'usernameField':_0x0059('0x15'),'passwordField':'password'},function(_0x2cb021,_0x5c324a,_0x1dcb19){return localAuthenticate(db[_0x0059('0x4f')],_0x2cb021,_0x5c324a,_0x1dcb19);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index dd59489..a1a95c9 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 _0x3607=['./authLocal.controller','post','/forgot','/reset/:token','reset','exports','express'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3607,0x117));var _0x7360=function(_0x3fa3da,_0xe049d2){_0x3fa3da=_0x3fa3da-0x0;var _0x420157=_0x3607[_0x3fa3da];return _0x420157;};'use strict';var express=require(_0x7360('0x0'));var router=express['Router']();var controller=require(_0x7360('0x1'));router['post']('/',controller['login']);router[_0x7360('0x2')](_0x7360('0x3'),controller['forgot']);router['post'](_0x7360('0x4'),controller[_0x7360('0x5')]);module[_0x7360('0x6')]=router;
\ No newline at end of file
+var _0x9d42=['post','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9d42,0x17e));var _0x29d4=function(_0x51eb77,_0x436673){_0x51eb77=_0x51eb77-0x0;var _0x4b26fe=_0x9d42[_0x51eb77];return _0x4b26fe;};'use strict';var express=require(_0x29d4('0x0'));var router=express['Router']();var controller=require(_0x29d4('0x1'));router[_0x29d4('0x2')]('/',controller['login']);router['post'](_0x29d4('0x3'),controller[_0x29d4('0x4')]);router[_0x29d4('0x2')](_0x29d4('0x5'),controller[_0x29d4('0x6')]);module[_0x29d4('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 608b0f3..8b1cc4d 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 _0x76ce=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x3d793c,_0x234c37){var _0x4a7ae3=function(_0x3009ab){while(--_0x3009ab){_0x3d793c['push'](_0x3d793c['shift']());}};_0x4a7ae3(++_0x234c37);}(_0x76ce,0x65));var _0xe76c=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x76ce[_0x2cfb58];return _0xd99951;};'use strict';var Sequelize=require(_0xe76c('0x0'));module[_0xe76c('0x1')]={'name':{'type':Sequelize[_0xe76c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe76c('0x2')]},'description':{'type':Sequelize[_0xe76c('0x2')]},'status':{'type':Sequelize[_0xe76c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe76c('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xc49a=['sequelize','STRING','BOOLEAN'];(function(_0x36072d,_0x24f414){var _0x32a52c=function(_0x19834c){while(--_0x19834c){_0x36072d['push'](_0x36072d['shift']());}};_0x32a52c(++_0x24f414);}(_0xc49a,0xf9));var _0xac49=function(_0x26e548,_0x419f69){_0x26e548=_0x26e548-0x0;var _0x1aa3f8=_0xc49a[_0x26e548];return _0x1aa3f8;};'use strict';var Sequelize=require(_0xac49('0x0'));module['exports']={'name':{'type':Sequelize[_0xac49('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xac49('0x1')]},'status':{'type':Sequelize[_0xac49('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 ffcda46..ec2da02 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 _0xa6a0=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','reject','save','then','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','Action','getActions','eml-format','zip-dir','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xa6a0,0x187));var _0x0a6a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xa6a0[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0x0a6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a6a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a6a('0x2'));var moment=require(_0x0a6a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a6a('0x4'));var util=require(_0x0a6a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0a6a('0x6'));var ejs=require(_0x0a6a('0x7'));var fs=require('fs');var fs_extra=require(_0x0a6a('0x8'));var _=require(_0x0a6a('0x9'));var squel=require(_0x0a6a('0xa'));var crypto=require('crypto');var jsforce=require(_0x0a6a('0xb'));var deskjs=require(_0x0a6a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0a6a('0xd'));var Papa=require('papaparse');var Redis=require(_0x0a6a('0xe'));var authService=require(_0x0a6a('0xf'));var qs=require(_0x0a6a('0x10'));var as=require(_0x0a6a('0x11'));var hardwareService=require(_0x0a6a('0x12'));var logger=require(_0x0a6a('0x13'))(_0x0a6a('0x14'));var utils=require(_0x0a6a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0a6a('0x16'));var db=require(_0x0a6a('0x17'))['db'];function respondWithStatusCode(_0x13bb6a,_0x4da05a){_0x4da05a=_0x4da05a||0xcc;return function(_0x49fdac){if(_0x49fdac){return _0x13bb6a[_0x0a6a('0x18')](_0x4da05a);}return _0x13bb6a['status'](_0x4da05a)[_0x0a6a('0x19')]();};}function respondWithResult(_0x392df2,_0x4c2ee8){_0x4c2ee8=_0x4c2ee8||0xc8;return function(_0x30e30d){if(_0x30e30d){return _0x392df2[_0x0a6a('0x1a')](_0x4c2ee8)[_0x0a6a('0x1b')](_0x30e30d);}};}function respondWithFilteredResult(_0x531952,_0x357877){return function(_0x68d434){if(_0x68d434){var _0x1f167e=typeof _0x357877['offset']===_0x0a6a('0x1c')&&typeof _0x357877[_0x0a6a('0x1d')]===_0x0a6a('0x1c');var _0x36bc68=_0x68d434[_0x0a6a('0x1e')];var _0x44f859=_0x1f167e?0x0:_0x357877[_0x0a6a('0x1f')];var _0x3e3c8b=_0x1f167e?_0x68d434[_0x0a6a('0x1e')]:_0x357877['offset']+_0x357877[_0x0a6a('0x1d')];var _0x2e8d38;if(_0x3e3c8b>=_0x36bc68){_0x3e3c8b=_0x36bc68;_0x2e8d38=0xc8;}else{_0x2e8d38=0xce;}_0x531952[_0x0a6a('0x1a')](_0x2e8d38);return _0x531952['set'](_0x0a6a('0x20'),_0x44f859+'-'+_0x3e3c8b+'/'+_0x36bc68)[_0x0a6a('0x1b')](_0x68d434);}return null;};}function patchUpdates(_0x1691d8){return function(_0xf4c204){try{jsonpatch['apply'](_0xf4c204,_0x1691d8,!![]);}catch(_0x2f93e8){return BPromise[_0x0a6a('0x21')](_0x2f93e8);}return _0xf4c204[_0x0a6a('0x22')]();};}function saveUpdates(_0x9ea62b,_0x556ff9){return function(_0x4234b6){if(_0x4234b6){return _0x4234b6['update'](_0x9ea62b)[_0x0a6a('0x23')](function(_0x59c8fb){return _0x59c8fb;});}return null;};}function removeEntity(_0x543f75,_0x47e534){return function(_0x469fbc){if(_0x469fbc){return _0x469fbc['destroy']()['then'](function(){_0x543f75['status'](0xcc)[_0x0a6a('0x19')]();});}};}function handleEntityNotFound(_0xaf6eda,_0x1562ae){return function(_0x219d79){if(!_0x219d79){_0xaf6eda[_0x0a6a('0x18')](0x194);}return _0x219d79;};}function handleError(_0x9f9188,_0x4c9f66){_0x4c9f66=_0x4c9f66||0x1f4;return function(_0x9fac42){logger[_0x0a6a('0x24')](_0x9fac42[_0x0a6a('0x25')]);if(_0x9fac42['name']){delete _0x9fac42[_0x0a6a('0x26')];}_0x9f9188[_0x0a6a('0x1a')](_0x4c9f66)[_0x0a6a('0x27')](_0x9fac42);};}exports[_0x0a6a('0x28')]=function(_0x5b5a45,_0x1b194c){var _0x3b3eb6={},_0x35e49d={},_0x4ad278={'count':0x0,'rows':[]};var _0x4e8845=_[_0x0a6a('0x29')](db[_0x0a6a('0x2a')]['rawAttributes'],function(_0x20b5b7){return{'name':_0x20b5b7[_0x0a6a('0x2b')],'type':_0x20b5b7[_0x0a6a('0x2c')][_0x0a6a('0x2d')]};});_0x35e49d[_0x0a6a('0x2e')]=_[_0x0a6a('0x29')](_0x4e8845,_0x0a6a('0x26'));_0x35e49d[_0x0a6a('0x2f')]=_['keys'](_0x5b5a45['query']);_0x35e49d[_0x0a6a('0x30')]=_['intersection'](_0x35e49d['model'],_0x35e49d[_0x0a6a('0x2f')]);_0x3b3eb6['attributes']=_[_0x0a6a('0x31')](_0x35e49d[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x32')]));_0x3b3eb6[_0x0a6a('0x33')]=_0x3b3eb6[_0x0a6a('0x33')][_0x0a6a('0x34')]?_0x3b3eb6['attributes']:_0x35e49d['model'];if(!_0x5b5a45['query'][_0x0a6a('0x35')](_0x0a6a('0x36'))){_0x3b3eb6[_0x0a6a('0x1d')]=qs[_0x0a6a('0x1d')](_0x5b5a45[_0x0a6a('0x2f')]['limit']);_0x3b3eb6[_0x0a6a('0x1f')]=qs[_0x0a6a('0x1f')](_0x5b5a45[_0x0a6a('0x2f')]['offset']);}_0x3b3eb6[_0x0a6a('0x37')]=qs[_0x0a6a('0x38')](_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x38')]);_0x3b3eb6[_0x0a6a('0x39')]=qs[_0x0a6a('0x30')](_[_0x0a6a('0x3a')](_0x5b5a45[_0x0a6a('0x2f')],_0x35e49d[_0x0a6a('0x30')]),_0x4e8845);if(_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x3b')]){_0x3b3eb6[_0x0a6a('0x39')]=_['merge'](_0x3b3eb6[_0x0a6a('0x39')],{'$or':_[_0x0a6a('0x29')](_0x4e8845,function(_0x2a9134){if(_0x2a9134[_0x0a6a('0x2c')]!==_0x0a6a('0x3c')){var _0x55b485={};_0x55b485[_0x2a9134[_0x0a6a('0x26')]]={'$like':'%'+_0x5b5a45['query']['filter']+'%'};return _0x55b485;}})});}_0x3b3eb6=_[_0x0a6a('0x3d')]({},_0x3b3eb6,_0x5b5a45[_0x0a6a('0x3e')]);var _0x44ca80={'where':_0x3b3eb6['where']};return db['Automation'][_0x0a6a('0x1e')](_0x44ca80)['then'](function(_0x23964b){_0x4ad278[_0x0a6a('0x1e')]=_0x23964b;if(_0x5b5a45[_0x0a6a('0x2f')][_0x0a6a('0x3f')]){_0x3b3eb6[_0x0a6a('0x40')]=[{'all':!![]}];}return db[_0x0a6a('0x2a')][_0x0a6a('0x41')](_0x3b3eb6);})['then'](function(_0x1e29b7){_0x4ad278[_0x0a6a('0x42')]=_0x1e29b7;return _0x4ad278;})[_0x0a6a('0x23')](respondWithFilteredResult(_0x1b194c,_0x3b3eb6))[_0x0a6a('0x43')](handleError(_0x1b194c,null));};exports['show']=function(_0xd68c21,_0x9c571d){var _0x19848a={'raw':![],'where':{'id':_0xd68c21[_0x0a6a('0x44')]['id']}},_0x683bb8={};_0x683bb8[_0x0a6a('0x2e')]=_['keys'](db[_0x0a6a('0x2a')][_0x0a6a('0x45')]);_0x683bb8[_0x0a6a('0x2f')]=_[_0x0a6a('0x46')](_0xd68c21[_0x0a6a('0x2f')]);_0x683bb8['filters']=_[_0x0a6a('0x31')](_0x683bb8['model'],_0x683bb8['query']);_0x19848a['attributes']=_[_0x0a6a('0x31')](_0x683bb8[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0xd68c21[_0x0a6a('0x2f')][_0x0a6a('0x32')]));_0x19848a[_0x0a6a('0x33')]=_0x19848a[_0x0a6a('0x33')]['length']?_0x19848a[_0x0a6a('0x33')]:_0x683bb8[_0x0a6a('0x2e')];if(_0xd68c21[_0x0a6a('0x2f')][_0x0a6a('0x3f')]){_0x19848a[_0x0a6a('0x40')]=[{'all':!![]}];}_0x19848a=_[_0x0a6a('0x3d')]({},_0x19848a,_0xd68c21[_0x0a6a('0x3e')]);return db[_0x0a6a('0x2a')][_0x0a6a('0x47')](_0x19848a)['then'](handleEntityNotFound(_0x9c571d,null))[_0x0a6a('0x23')](respondWithResult(_0x9c571d,null))[_0x0a6a('0x43')](handleError(_0x9c571d,null));};exports[_0x0a6a('0x48')]=function(_0x24d30e,_0x338c14){return db[_0x0a6a('0x2a')][_0x0a6a('0x48')](_0x24d30e[_0x0a6a('0x49')],{})[_0x0a6a('0x23')](respondWithResult(_0x338c14,0xc9))[_0x0a6a('0x43')](handleError(_0x338c14,null));};exports['update']=function(_0x57513c,_0x2bfb6c){if(_0x57513c[_0x0a6a('0x49')]['id']){delete _0x57513c[_0x0a6a('0x49')]['id'];}return db[_0x0a6a('0x2a')]['find']({'where':{'id':_0x57513c[_0x0a6a('0x44')]['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x2bfb6c,null))[_0x0a6a('0x23')](saveUpdates(_0x57513c[_0x0a6a('0x49')],null))[_0x0a6a('0x23')](respondWithResult(_0x2bfb6c,null))[_0x0a6a('0x43')](handleError(_0x2bfb6c,null));};exports['destroy']=function(_0xf0a1da,_0x58e711){return db[_0x0a6a('0x2a')][_0x0a6a('0x47')]({'where':{'id':_0xf0a1da['params']['id']}})['then'](handleEntityNotFound(_0x58e711,null))[_0x0a6a('0x23')](removeEntity(_0x58e711,null))['catch'](handleError(_0x58e711,null));};exports[_0x0a6a('0x4a')]=function(_0x1292e2,_0x281fb8,_0x1d3e81){return db[_0x0a6a('0x4b')][_0x0a6a('0x47')]({'where':{'id':_0x1292e2[_0x0a6a('0x44')]['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x281fb8,null))[_0x0a6a('0x23')](function(_0x434681){if(_0x434681){return _0x434681[_0x0a6a('0x4a')](_0x1292e2[_0x0a6a('0x49')]['ids'],_[_0x0a6a('0x4c')](_0x1292e2[_0x0a6a('0x49')],[_0x0a6a('0x4d'),'id'])||{});}})[_0x0a6a('0x23')](respondWithResult(_0x281fb8,null))['catch'](handleError(_0x281fb8,null));};exports[_0x0a6a('0x4e')]=function(_0x23bc81,_0x795016,_0x5b8e28){var _0x5b6c11={};var _0x498eeb={};var _0x4aead2;var _0x5dd3ba;return db[_0x0a6a('0x2a')][_0x0a6a('0x4f')]({'where':{'id':_0x23bc81['params']['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x795016,null))[_0x0a6a('0x23')](function(_0x508909){if(_0x508909){_0x4aead2=_0x508909;_0x498eeb[_0x0a6a('0x2e')]=_[_0x0a6a('0x46')](db[_0x0a6a('0x4b')][_0x0a6a('0x45')]);_0x498eeb['query']=_[_0x0a6a('0x46')](_0x23bc81[_0x0a6a('0x2f')]);_0x498eeb[_0x0a6a('0x30')]=_['intersection'](_0x498eeb[_0x0a6a('0x2e')],_0x498eeb[_0x0a6a('0x2f')]);_0x5b6c11[_0x0a6a('0x33')]=_['intersection'](_0x498eeb[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0x23bc81['query'][_0x0a6a('0x32')]));_0x5b6c11[_0x0a6a('0x33')]=_0x5b6c11['attributes'][_0x0a6a('0x34')]?_0x5b6c11[_0x0a6a('0x33')]:_0x498eeb[_0x0a6a('0x2e')];_0x5b6c11['order']=qs[_0x0a6a('0x38')](_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x38')]);_0x5b6c11[_0x0a6a('0x39')]=qs[_0x0a6a('0x30')](_[_0x0a6a('0x3a')](_0x23bc81[_0x0a6a('0x2f')],_0x498eeb[_0x0a6a('0x30')]));if(_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x3b')]){_0x5b6c11[_0x0a6a('0x39')]=_[_0x0a6a('0x3d')](_0x5b6c11['where'],{'$or':_[_0x0a6a('0x29')](_0x5b6c11[_0x0a6a('0x33')],function(_0x1f0b19){var _0x4c276e={};_0x4c276e[_0x1f0b19]={'$like':'%'+_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x3b')]+'%'};return _0x4c276e;})});}_0x5b6c11=_['merge']({},_0x5b6c11,_0x23bc81[_0x0a6a('0x3e')]);return _0x4aead2['getConditions'](_0x5b6c11);}})['then'](function(_0x4db455){if(_0x4db455){_0x5dd3ba=_0x4db455['length'];if(!_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x35')](_0x0a6a('0x36'))){_0x5b6c11['limit']=qs[_0x0a6a('0x1d')](_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x1d')]);_0x5b6c11[_0x0a6a('0x1f')]=qs['offset'](_0x23bc81[_0x0a6a('0x2f')][_0x0a6a('0x1f')]);}return _0x4aead2[_0x0a6a('0x4e')](_0x5b6c11);}})[_0x0a6a('0x23')](function(_0x2d50a6){if(_0x2d50a6){return _0x2d50a6?{'count':_0x5dd3ba,'rows':_0x2d50a6}:null;}})[_0x0a6a('0x23')](respondWithResult(_0x795016,null))['catch'](handleError(_0x795016,null));};exports['addActions']=function(_0xefde2a,_0x41c372,_0x11085f){return db[_0x0a6a('0x50')][_0x0a6a('0x47')]({'where':{'id':_0xefde2a['params']['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x41c372,null))[_0x0a6a('0x23')](function(_0x250548){if(_0x250548){return _0x250548['addActions'](_0xefde2a[_0x0a6a('0x49')][_0x0a6a('0x4d')],_[_0x0a6a('0x4c')](_0xefde2a['body'],[_0x0a6a('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x41c372,null))['catch'](handleError(_0x41c372,null));};exports[_0x0a6a('0x51')]=function(_0x16aeed,_0x5c8264,_0x178bf7){var _0x218a6b={};var _0xa7d04b={};var _0x43d047;var _0x433390;return db[_0x0a6a('0x2a')][_0x0a6a('0x4f')]({'where':{'id':_0x16aeed['params']['id']}})[_0x0a6a('0x23')](handleEntityNotFound(_0x5c8264,null))[_0x0a6a('0x23')](function(_0x2cf5f1){if(_0x2cf5f1){_0x43d047=_0x2cf5f1;_0xa7d04b['model']=_[_0x0a6a('0x46')](db[_0x0a6a('0x50')]['rawAttributes']);_0xa7d04b[_0x0a6a('0x2f')]=_[_0x0a6a('0x46')](_0x16aeed[_0x0a6a('0x2f')]);_0xa7d04b[_0x0a6a('0x30')]=_['intersection'](_0xa7d04b['model'],_0xa7d04b[_0x0a6a('0x2f')]);_0x218a6b[_0x0a6a('0x33')]=_[_0x0a6a('0x31')](_0xa7d04b[_0x0a6a('0x2e')],qs[_0x0a6a('0x32')](_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x32')]));_0x218a6b[_0x0a6a('0x33')]=_0x218a6b[_0x0a6a('0x33')][_0x0a6a('0x34')]?_0x218a6b[_0x0a6a('0x33')]:_0xa7d04b[_0x0a6a('0x2e')];_0x218a6b[_0x0a6a('0x37')]=qs[_0x0a6a('0x38')](_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x38')]);_0x218a6b[_0x0a6a('0x39')]=qs[_0x0a6a('0x30')](_['pick'](_0x16aeed[_0x0a6a('0x2f')],_0xa7d04b['filters']));if(_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x3b')]){_0x218a6b[_0x0a6a('0x39')]=_[_0x0a6a('0x3d')](_0x218a6b[_0x0a6a('0x39')],{'$or':_[_0x0a6a('0x29')](_0x218a6b[_0x0a6a('0x33')],function(_0x496024){var _0x414f51={};_0x414f51[_0x496024]={'$like':'%'+_0x16aeed['query']['filter']+'%'};return _0x414f51;})});}_0x218a6b=_['merge']({},_0x218a6b,_0x16aeed['options']);return _0x43d047[_0x0a6a('0x51')](_0x218a6b);}})[_0x0a6a('0x23')](function(_0x40355a){if(_0x40355a){_0x433390=_0x40355a[_0x0a6a('0x34')];if(!_0x16aeed[_0x0a6a('0x2f')]['hasOwnProperty'](_0x0a6a('0x36'))){_0x218a6b[_0x0a6a('0x1d')]=qs['limit'](_0x16aeed[_0x0a6a('0x2f')][_0x0a6a('0x1d')]);_0x218a6b['offset']=qs['offset'](_0x16aeed[_0x0a6a('0x2f')]['offset']);}return _0x43d047['getActions'](_0x218a6b);}})['then'](function(_0x5c9b06){if(_0x5c9b06){return _0x5c9b06?{'count':_0x433390,'rows':_0x5c9b06}:null;}})[_0x0a6a('0x23')](respondWithResult(_0x5c8264,null))[_0x0a6a('0x43')](handleError(_0x5c8264,null));};
\ No newline at end of file
+var _0x2b22=['findAll','rows','catch','show','params','create','body','addConditions','Condition','omit','ids','getConditions','findOne','Action','find','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x2b22,0x68));var _0x22b2=function(_0x2ecd37,_0x17d130){_0x2ecd37=_0x2ecd37-0x0;var _0x70c377=_0x2b22[_0x2ecd37];return _0x70c377;};'use strict';var emlformat=require(_0x22b2('0x0'));var rimraf=require(_0x22b2('0x1'));var zipdir=require(_0x22b2('0x2'));var jsonpatch=require(_0x22b2('0x3'));var rp=require(_0x22b2('0x4'));var moment=require(_0x22b2('0x5'));var BPromise=require(_0x22b2('0x6'));var Mustache=require(_0x22b2('0x7'));var util=require(_0x22b2('0x8'));var path=require(_0x22b2('0x9'));var sox=require(_0x22b2('0xa'));var csv=require(_0x22b2('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x22b2('0xc'));var _=require('lodash');var squel=require(_0x22b2('0xd'));var crypto=require('crypto');var jsforce=require(_0x22b2('0xe'));var deskjs=require(_0x22b2('0xf'));var toCsv=require(_0x22b2('0xb'));var querystring=require(_0x22b2('0x10'));var Papa=require('papaparse');var Redis=require(_0x22b2('0x11'));var authService=require(_0x22b2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x22b2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22b2('0x14'))(_0x22b2('0x15'));var utils=require(_0x22b2('0x16'));var config=require(_0x22b2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x22b2('0x18'))['db'];function respondWithStatusCode(_0x2480db,_0x52f70d){_0x52f70d=_0x52f70d||0xcc;return function(_0x1610e6){if(_0x1610e6){return _0x2480db[_0x22b2('0x19')](_0x52f70d);}return _0x2480db[_0x22b2('0x1a')](_0x52f70d)['end']();};}function respondWithResult(_0x122a2c,_0x5ae0b6){_0x5ae0b6=_0x5ae0b6||0xc8;return function(_0xc64663){if(_0xc64663){return _0x122a2c[_0x22b2('0x1a')](_0x5ae0b6)[_0x22b2('0x1b')](_0xc64663);}};}function respondWithFilteredResult(_0x50856f,_0x55d66d){return function(_0x55ed04){if(_0x55ed04){var _0x2ab4c6=typeof _0x55d66d[_0x22b2('0x1c')]===_0x22b2('0x1d')&&typeof _0x55d66d[_0x22b2('0x1e')]==='undefined';var _0x3f1d05=_0x55ed04['count'];var _0x44bd95=_0x2ab4c6?0x0:_0x55d66d['offset'];var _0x5c608a=_0x2ab4c6?_0x55ed04['count']:_0x55d66d[_0x22b2('0x1c')]+_0x55d66d['limit'];var _0x492124;if(_0x5c608a>=_0x3f1d05){_0x5c608a=_0x3f1d05;_0x492124=0xc8;}else{_0x492124=0xce;}_0x50856f[_0x22b2('0x1a')](_0x492124);return _0x50856f[_0x22b2('0x1f')](_0x22b2('0x20'),_0x44bd95+'-'+_0x5c608a+'/'+_0x3f1d05)[_0x22b2('0x1b')](_0x55ed04);}return null;};}function patchUpdates(_0x2ee779){return function(_0x328166){try{jsonpatch[_0x22b2('0x21')](_0x328166,_0x2ee779,!![]);}catch(_0x987cf3){return BPromise[_0x22b2('0x22')](_0x987cf3);}return _0x328166['save']();};}function saveUpdates(_0x4dedbe,_0x381f51){return function(_0x4c39ef){if(_0x4c39ef){return _0x4c39ef[_0x22b2('0x23')](_0x4dedbe)[_0x22b2('0x24')](function(_0x328068){return _0x328068;});}return null;};}function removeEntity(_0x2417cb,_0x1747e4){return function(_0x1ac0d5){if(_0x1ac0d5){return _0x1ac0d5[_0x22b2('0x25')]()['then'](function(){_0x2417cb[_0x22b2('0x1a')](0xcc)[_0x22b2('0x26')]();});}};}function handleEntityNotFound(_0x561678,_0x285c3c){return function(_0x1f46e7){if(!_0x1f46e7){_0x561678[_0x22b2('0x19')](0x194);}return _0x1f46e7;};}function handleError(_0x400674,_0x30d1a6){_0x30d1a6=_0x30d1a6||0x1f4;return function(_0x4ca0d1){logger[_0x22b2('0x27')](_0x4ca0d1[_0x22b2('0x28')]);if(_0x4ca0d1[_0x22b2('0x29')]){delete _0x4ca0d1['name'];}_0x400674['status'](_0x30d1a6)[_0x22b2('0x2a')](_0x4ca0d1);};}exports[_0x22b2('0x2b')]=function(_0x5a7c90,_0x49013){var _0x5a9352={},_0x2400fc={},_0x2eb4f6={'count':0x0,'rows':[]};var _0x3f6e69=_[_0x22b2('0x2c')](db[_0x22b2('0x2d')][_0x22b2('0x2e')],function(_0x54b834){return{'name':_0x54b834[_0x22b2('0x2f')],'type':_0x54b834[_0x22b2('0x30')][_0x22b2('0x31')]};});_0x2400fc[_0x22b2('0x32')]=_[_0x22b2('0x2c')](_0x3f6e69,_0x22b2('0x29'));_0x2400fc[_0x22b2('0x33')]=_[_0x22b2('0x34')](_0x5a7c90['query']);_0x2400fc['filters']=_['intersection'](_0x2400fc[_0x22b2('0x32')],_0x2400fc[_0x22b2('0x33')]);_0x5a9352[_0x22b2('0x35')]=_[_0x22b2('0x36')](_0x2400fc[_0x22b2('0x32')],qs[_0x22b2('0x37')](_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x37')]));_0x5a9352[_0x22b2('0x35')]=_0x5a9352['attributes'][_0x22b2('0x38')]?_0x5a9352[_0x22b2('0x35')]:_0x2400fc[_0x22b2('0x32')];if(!_0x5a7c90['query'][_0x22b2('0x39')](_0x22b2('0x3a'))){_0x5a9352[_0x22b2('0x1e')]=qs['limit'](_0x5a7c90[_0x22b2('0x33')]['limit']);_0x5a9352[_0x22b2('0x1c')]=qs['offset'](_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x1c')]);}_0x5a9352[_0x22b2('0x3b')]=qs[_0x22b2('0x3c')](_0x5a7c90[_0x22b2('0x33')]['sort']);_0x5a9352[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_[_0x22b2('0x3f')](_0x5a7c90[_0x22b2('0x33')],_0x2400fc[_0x22b2('0x3e')]),_0x3f6e69);if(_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x40')]){_0x5a9352['where']=_[_0x22b2('0x41')](_0x5a9352['where'],{'$or':_[_0x22b2('0x2c')](_0x3f6e69,function(_0x3a132b){if(_0x3a132b[_0x22b2('0x30')]!=='VIRTUAL'){var _0x23a113={};_0x23a113[_0x3a132b[_0x22b2('0x29')]]={'$like':'%'+_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x40')]+'%'};return _0x23a113;}})});}_0x5a9352=_['merge']({},_0x5a9352,_0x5a7c90[_0x22b2('0x42')]);var _0x1f02ee={'where':_0x5a9352[_0x22b2('0x3d')]};return db[_0x22b2('0x2d')][_0x22b2('0x43')](_0x1f02ee)[_0x22b2('0x24')](function(_0x3bb3a7){_0x2eb4f6[_0x22b2('0x43')]=_0x3bb3a7;if(_0x5a7c90[_0x22b2('0x33')][_0x22b2('0x44')]){_0x5a9352[_0x22b2('0x45')]=[{'all':!![]}];}return db['Automation'][_0x22b2('0x46')](_0x5a9352);})[_0x22b2('0x24')](function(_0x39c48c){_0x2eb4f6[_0x22b2('0x47')]=_0x39c48c;return _0x2eb4f6;})[_0x22b2('0x24')](respondWithFilteredResult(_0x49013,_0x5a9352))[_0x22b2('0x48')](handleError(_0x49013,null));};exports[_0x22b2('0x49')]=function(_0x3cfd98,_0x5a7f73){var _0x4241f1={'raw':![],'where':{'id':_0x3cfd98[_0x22b2('0x4a')]['id']}},_0x4845bf={};_0x4845bf[_0x22b2('0x32')]=_['keys'](db[_0x22b2('0x2d')][_0x22b2('0x2e')]);_0x4845bf[_0x22b2('0x33')]=_[_0x22b2('0x34')](_0x3cfd98['query']);_0x4845bf[_0x22b2('0x3e')]=_['intersection'](_0x4845bf['model'],_0x4845bf[_0x22b2('0x33')]);_0x4241f1[_0x22b2('0x35')]=_['intersection'](_0x4845bf['model'],qs['fields'](_0x3cfd98[_0x22b2('0x33')][_0x22b2('0x37')]));_0x4241f1['attributes']=_0x4241f1[_0x22b2('0x35')][_0x22b2('0x38')]?_0x4241f1['attributes']:_0x4845bf[_0x22b2('0x32')];if(_0x3cfd98['query'][_0x22b2('0x44')]){_0x4241f1[_0x22b2('0x45')]=[{'all':!![]}];}_0x4241f1=_[_0x22b2('0x41')]({},_0x4241f1,_0x3cfd98[_0x22b2('0x42')]);return db[_0x22b2('0x2d')]['find'](_0x4241f1)['then'](handleEntityNotFound(_0x5a7f73,null))[_0x22b2('0x24')](respondWithResult(_0x5a7f73,null))[_0x22b2('0x48')](handleError(_0x5a7f73,null));};exports[_0x22b2('0x4b')]=function(_0x559a80,_0x1e3fae){return db[_0x22b2('0x2d')][_0x22b2('0x4b')](_0x559a80[_0x22b2('0x4c')],{})['then'](respondWithResult(_0x1e3fae,0xc9))[_0x22b2('0x48')](handleError(_0x1e3fae,null));};exports[_0x22b2('0x23')]=function(_0x79755a,_0x54d43a){if(_0x79755a[_0x22b2('0x4c')]['id']){delete _0x79755a[_0x22b2('0x4c')]['id'];}return db[_0x22b2('0x2d')]['find']({'where':{'id':_0x79755a[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x54d43a,null))[_0x22b2('0x24')](saveUpdates(_0x79755a[_0x22b2('0x4c')],null))[_0x22b2('0x24')](respondWithResult(_0x54d43a,null))[_0x22b2('0x48')](handleError(_0x54d43a,null));};exports['destroy']=function(_0x53d7d0,_0x235a6d){return db[_0x22b2('0x2d')]['find']({'where':{'id':_0x53d7d0['params']['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x235a6d,null))[_0x22b2('0x24')](removeEntity(_0x235a6d,null))['catch'](handleError(_0x235a6d,null));};exports[_0x22b2('0x4d')]=function(_0x3ca91f,_0x31718d,_0x56588b){return db[_0x22b2('0x4e')]['find']({'where':{'id':_0x3ca91f[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x31718d,null))['then'](function(_0xb58683){if(_0xb58683){return _0xb58683['addConditions'](_0x3ca91f[_0x22b2('0x4c')]['ids'],_[_0x22b2('0x4f')](_0x3ca91f[_0x22b2('0x4c')],[_0x22b2('0x50'),'id'])||{});}})[_0x22b2('0x24')](respondWithResult(_0x31718d,null))[_0x22b2('0x48')](handleError(_0x31718d,null));};exports[_0x22b2('0x51')]=function(_0x577e5f,_0x19f760,_0x32544d){var _0x19c8dc={};var _0x25be83={};var _0x1f1f05;var _0x48406f;return db[_0x22b2('0x2d')][_0x22b2('0x52')]({'where':{'id':_0x577e5f[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x19f760,null))[_0x22b2('0x24')](function(_0x4976b4){if(_0x4976b4){_0x1f1f05=_0x4976b4;_0x25be83['model']=_['keys'](db[_0x22b2('0x4e')][_0x22b2('0x2e')]);_0x25be83[_0x22b2('0x33')]=_['keys'](_0x577e5f[_0x22b2('0x33')]);_0x25be83[_0x22b2('0x3e')]=_['intersection'](_0x25be83[_0x22b2('0x32')],_0x25be83[_0x22b2('0x33')]);_0x19c8dc[_0x22b2('0x35')]=_[_0x22b2('0x36')](_0x25be83[_0x22b2('0x32')],qs[_0x22b2('0x37')](_0x577e5f[_0x22b2('0x33')][_0x22b2('0x37')]));_0x19c8dc['attributes']=_0x19c8dc['attributes']['length']?_0x19c8dc['attributes']:_0x25be83[_0x22b2('0x32')];_0x19c8dc[_0x22b2('0x3b')]=qs[_0x22b2('0x3c')](_0x577e5f[_0x22b2('0x33')][_0x22b2('0x3c')]);_0x19c8dc[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_[_0x22b2('0x3f')](_0x577e5f['query'],_0x25be83[_0x22b2('0x3e')]));if(_0x577e5f[_0x22b2('0x33')][_0x22b2('0x40')]){_0x19c8dc[_0x22b2('0x3d')]=_['merge'](_0x19c8dc[_0x22b2('0x3d')],{'$or':_[_0x22b2('0x2c')](_0x19c8dc[_0x22b2('0x35')],function(_0x541b9f){var _0x4a685c={};_0x4a685c[_0x541b9f]={'$like':'%'+_0x577e5f['query'][_0x22b2('0x40')]+'%'};return _0x4a685c;})});}_0x19c8dc=_['merge']({},_0x19c8dc,_0x577e5f[_0x22b2('0x42')]);return _0x1f1f05[_0x22b2('0x51')](_0x19c8dc);}})[_0x22b2('0x24')](function(_0x51e449){if(_0x51e449){_0x48406f=_0x51e449['length'];if(!_0x577e5f[_0x22b2('0x33')][_0x22b2('0x39')]('nolimit')){_0x19c8dc[_0x22b2('0x1e')]=qs[_0x22b2('0x1e')](_0x577e5f[_0x22b2('0x33')]['limit']);_0x19c8dc[_0x22b2('0x1c')]=qs[_0x22b2('0x1c')](_0x577e5f[_0x22b2('0x33')][_0x22b2('0x1c')]);}return _0x1f1f05['getConditions'](_0x19c8dc);}})[_0x22b2('0x24')](function(_0x3870b7){if(_0x3870b7){return _0x3870b7?{'count':_0x48406f,'rows':_0x3870b7}:null;}})[_0x22b2('0x24')](respondWithResult(_0x19f760,null))['catch'](handleError(_0x19f760,null));};exports['addActions']=function(_0x49ffe6,_0x4a8d33,_0x2b02dc){return db[_0x22b2('0x53')][_0x22b2('0x54')]({'where':{'id':_0x49ffe6[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x4a8d33,null))[_0x22b2('0x24')](function(_0xab0249){if(_0xab0249){return _0xab0249[_0x22b2('0x55')](_0x49ffe6[_0x22b2('0x4c')]['ids'],_[_0x22b2('0x4f')](_0x49ffe6[_0x22b2('0x4c')],[_0x22b2('0x50'),'id'])||{});}})[_0x22b2('0x24')](respondWithResult(_0x4a8d33,null))[_0x22b2('0x48')](handleError(_0x4a8d33,null));};exports[_0x22b2('0x56')]=function(_0x515032,_0x8d21f1,_0xbe7635){var _0x2840c9={};var _0x408148={};var _0x33f83b;var _0x918877;return db[_0x22b2('0x2d')][_0x22b2('0x52')]({'where':{'id':_0x515032[_0x22b2('0x4a')]['id']}})[_0x22b2('0x24')](handleEntityNotFound(_0x8d21f1,null))[_0x22b2('0x24')](function(_0x59036e){if(_0x59036e){_0x33f83b=_0x59036e;_0x408148[_0x22b2('0x32')]=_[_0x22b2('0x34')](db[_0x22b2('0x53')][_0x22b2('0x2e')]);_0x408148[_0x22b2('0x33')]=_[_0x22b2('0x34')](_0x515032['query']);_0x408148[_0x22b2('0x3e')]=_[_0x22b2('0x36')](_0x408148[_0x22b2('0x32')],_0x408148[_0x22b2('0x33')]);_0x2840c9[_0x22b2('0x35')]=_[_0x22b2('0x36')](_0x408148[_0x22b2('0x32')],qs[_0x22b2('0x37')](_0x515032[_0x22b2('0x33')]['fields']));_0x2840c9[_0x22b2('0x35')]=_0x2840c9[_0x22b2('0x35')][_0x22b2('0x38')]?_0x2840c9[_0x22b2('0x35')]:_0x408148[_0x22b2('0x32')];_0x2840c9['order']=qs[_0x22b2('0x3c')](_0x515032[_0x22b2('0x33')][_0x22b2('0x3c')]);_0x2840c9[_0x22b2('0x3d')]=qs[_0x22b2('0x3e')](_[_0x22b2('0x3f')](_0x515032[_0x22b2('0x33')],_0x408148[_0x22b2('0x3e')]));if(_0x515032[_0x22b2('0x33')][_0x22b2('0x40')]){_0x2840c9['where']=_[_0x22b2('0x41')](_0x2840c9['where'],{'$or':_['map'](_0x2840c9[_0x22b2('0x35')],function(_0x542412){var _0x2e5eee={};_0x2e5eee[_0x542412]={'$like':'%'+_0x515032[_0x22b2('0x33')][_0x22b2('0x40')]+'%'};return _0x2e5eee;})});}_0x2840c9=_['merge']({},_0x2840c9,_0x515032['options']);return _0x33f83b['getActions'](_0x2840c9);}})[_0x22b2('0x24')](function(_0x5f1d2d){if(_0x5f1d2d){_0x918877=_0x5f1d2d['length'];if(!_0x515032[_0x22b2('0x33')][_0x22b2('0x39')](_0x22b2('0x3a'))){_0x2840c9[_0x22b2('0x1e')]=qs[_0x22b2('0x1e')](_0x515032[_0x22b2('0x33')][_0x22b2('0x1e')]);_0x2840c9[_0x22b2('0x1c')]=qs[_0x22b2('0x1c')](_0x515032[_0x22b2('0x33')][_0x22b2('0x1c')]);}return _0x33f83b[_0x22b2('0x56')](_0x2840c9);}})[_0x22b2('0x24')](function(_0x2102e5){if(_0x2102e5){return _0x2102e5?{'count':_0x918877,'rows':_0x2102e5}:null;}})[_0x22b2('0x24')](respondWithResult(_0x8d21f1,null))[_0x22b2('0x48')](handleError(_0x8d21f1,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6c87520..b1bffc5 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 _0x2e48=['tools_automations','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./automation.attributes','exports','define'];(function(_0x24d6a2,_0x215264){var _0x3de4f6=function(_0x369d44){while(--_0x369d44){_0x24d6a2['push'](_0x24d6a2['shift']());}};_0x3de4f6(++_0x215264);}(_0x2e48,0x141));var _0x82e4=function(_0x2353fe,_0x4b0bca){_0x2353fe=_0x2353fe-0x0;var _0x4d43f6=_0x2e48[_0x2353fe];return _0x4d43f6;};'use strict';var _=require(_0x82e4('0x0'));var util=require(_0x82e4('0x1'));var logger=require(_0x82e4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x82e4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x82e4('0x4'));var config=require(_0x82e4('0x5'));var attributes=require(_0x82e4('0x6'));module[_0x82e4('0x7')]=function(_0x48a58d,_0x2d24a4){return _0x48a58d[_0x82e4('0x8')]('Automation',attributes,{'tableName':_0x82e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc501=['path','../../config/environment','Automation','tools_automations','lodash','util','../../config/logger','bluebird'];(function(_0x4570f8,_0x358258){var _0x3ed54a=function(_0x1db86e){while(--_0x1db86e){_0x4570f8['push'](_0x4570f8['shift']());}};_0x3ed54a(++_0x358258);}(_0xc501,0x1b4));var _0x1c50=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0xc501[_0xc40b9f];return _0x535b9c;};'use strict';var _=require(_0x1c50('0x0'));var util=require(_0x1c50('0x1'));var logger=require(_0x1c50('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1c50('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1c50('0x4'));var rimraf=require('rimraf');var config=require(_0x1c50('0x5'));var attributes=require('./automation.attributes');module['exports']=function(_0x2a4132,_0x4e8b46){return _0x2a4132['define'](_0x1c50('0x6'),attributes,{'tableName':_0x1c50('0x7'),'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 43eac96..a56f970 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 _0xf3a8=['message','catch','util','moment','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x4f3ce5,_0x3531f3){_0x4f3ce5=_0x4f3ce5-0x0;var _0x49b053=_0xf3a8[_0x4f3ce5];return _0x49b053;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var moment=require(_0x8f3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f3a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f3a('0x3'));var logger=require('../../config/logger')(_0x8f3a('0x4'));var config=require('../../config/environment');var jayson=require(_0x8f3a('0x5'));var client=jayson[_0x8f3a('0x6')][_0x8f3a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32bb3a,_0xc50ed8,_0x2e290d){return new BPromise(function(_0x3dc1ea,_0xcfad11){return client[_0x8f3a('0x8')](_0x32bb3a,_0x2e290d)['then'](function(_0x2164ba){logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));logger[_0x8f3a('0xb')](_0x8f3a('0xc'),_0xc50ed8,_0x8f3a('0xa'),JSON['stringify'](_0x2164ba));if(_0x2164ba[_0x8f3a('0xd')]){if(_0x2164ba[_0x8f3a('0xd')]['code']===0x1f4){logger[_0x8f3a('0xd')]('Automation,\x20%s,\x20%s',_0xc50ed8,_0x2164ba['error'][_0x8f3a('0xe')]);return _0xcfad11(_0x2164ba[_0x8f3a('0xd')]['message']);}logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x2164ba[_0x8f3a('0xd')]['message']);return _0x3dc1ea(_0x2164ba[_0x8f3a('0xd')][_0x8f3a('0xe')]);}else{logger['info'](_0x8f3a('0x9'),_0xc50ed8,_0x8f3a('0xa'));_0x3dc1ea(_0x2164ba['result'][_0x8f3a('0xe')]);}})[_0x8f3a('0xf')](function(_0x9bf803){logger[_0x8f3a('0xd')](_0x8f3a('0x9'),_0xc50ed8,_0x9bf803);_0xcfad11(_0x9bf803);});});}
\ No newline at end of file
+var _0x6582=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6582,0x108));var _0x2658=function(_0x1e2072,_0xe3cc90){_0x1e2072=_0x1e2072-0x0;var _0x22956b=_0x6582[_0x1e2072];return _0x22956b;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cb94f,_0x3f53e7,_0x443df){return new BPromise(function(_0x412a9f,_0x52ef38){return client[_0x2658('0xa')](_0x2cb94f,_0x443df)[_0x2658('0xb')](function(_0x426744){logger[_0x2658('0xc')](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));logger[_0x2658('0xf')](_0x2658('0x10'),_0x3f53e7,_0x2658('0xe'),JSON['stringify'](_0x426744));if(_0x426744[_0x2658('0x11')]){if(_0x426744['error'][_0x2658('0x12')]===0x1f4){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x52ef38(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}logger['error'](_0x2658('0xd'),_0x3f53e7,_0x426744[_0x2658('0x11')][_0x2658('0x13')]);return _0x412a9f(_0x426744[_0x2658('0x11')][_0x2658('0x13')]);}else{logger['info'](_0x2658('0xd'),_0x3f53e7,_0x2658('0xe'));_0x412a9f(_0x426744[_0x2658('0x14')]['message']);}})[_0x2658('0x15')](function(_0x44c6d2){logger[_0x2658('0x11')](_0x2658('0xd'),_0x3f53e7,_0x44c6d2);_0x52ef38(_0x44c6d2);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 69b2840..6131203 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 _0x03cf=['show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addConditions','addActions','put','update','destroy','util','path','Router','../../components/auth/service','../../config/environment','./automation.controller','get','index','/:id','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03cf,0x64));var _0xf03c=function(_0x3bcc4f,_0x3f476b){_0x3bcc4f=_0x3bcc4f-0x0;var _0x2f2654=_0x03cf[_0x3bcc4f];return _0x2f2654;};'use strict';var multer=require('multer');var util=require(_0xf03c('0x0'));var path=require(_0xf03c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf03c('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf03c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf03c('0x4'));var controller=require(_0xf03c('0x5'));router[_0xf03c('0x6')]('/',auth['isAuthenticated'](),controller[_0xf03c('0x7')]);router[_0xf03c('0x6')](_0xf03c('0x8'),auth[_0xf03c('0x9')](),controller[_0xf03c('0xa')]);router[_0xf03c('0x6')]('/:id/conditions',auth[_0xf03c('0x9')](),controller[_0xf03c('0xb')]);router[_0xf03c('0x6')](_0xf03c('0xc'),auth[_0xf03c('0x9')](),controller[_0xf03c('0xd')]);router[_0xf03c('0xe')]('/',auth[_0xf03c('0x9')](),controller[_0xf03c('0xf')]);router[_0xf03c('0xe')](_0xf03c('0x10'),auth[_0xf03c('0x9')](),controller[_0xf03c('0x11')]);router['post'](_0xf03c('0xc'),auth[_0xf03c('0x9')](),controller[_0xf03c('0x12')]);router[_0xf03c('0x13')]('/:id',auth[_0xf03c('0x9')](),controller[_0xf03c('0x14')]);router['delete'](_0xf03c('0x8'),auth[_0xf03c('0x9')](),controller[_0xf03c('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x7fa9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','/:id','show','/:id/conditions','isAuthenticated','getConditions','/:id/actions','getActions','create','post','addActions','put','update','delete','destroy','multer','path'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0x7fa9,0x76));var _0x97fa=function(_0x1e5af8,_0x5c2b3a){_0x1e5af8=_0x1e5af8-0x0;var _0x264c4f=_0x7fa9[_0x1e5af8];return _0x264c4f;};'use strict';var multer=require(_0x97fa('0x0'));var util=require('util');var path=require(_0x97fa('0x1'));var timeout=require(_0x97fa('0x2'));var express=require(_0x97fa('0x3'));var router=express[_0x97fa('0x4')]();var fs_extra=require(_0x97fa('0x5'));var auth=require(_0x97fa('0x6'));var interaction=require(_0x97fa('0x7'));var config=require('../../config/environment');var controller=require(_0x97fa('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97fa('0x9')](_0x97fa('0xa'),auth['isAuthenticated'](),controller[_0x97fa('0xb')]);router[_0x97fa('0x9')](_0x97fa('0xc'),auth[_0x97fa('0xd')](),controller[_0x97fa('0xe')]);router[_0x97fa('0x9')](_0x97fa('0xf'),auth['isAuthenticated'](),controller[_0x97fa('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x97fa('0x11')]);router[_0x97fa('0x12')]('/:id/conditions',auth[_0x97fa('0xd')](),controller['addConditions']);router[_0x97fa('0x12')](_0x97fa('0xf'),auth[_0x97fa('0xd')](),controller[_0x97fa('0x13')]);router[_0x97fa('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x97fa('0x15')]);router[_0x97fa('0x16')](_0x97fa('0xa'),auth[_0x97fa('0xd')](),controller[_0x97fa('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 12f8580..49aa67c 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 _0x0b4b=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x37b792,_0x14b064){var _0xfcd8b=function(_0x28663b){while(--_0x28663b){_0x37b792['push'](_0x37b792['shift']());}};_0xfcd8b(++_0x14b064);}(_0x0b4b,0x16a));var _0xb0b4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x0b4b[_0x5608a3];return _0x1ed50a;};'use strict';var Sequelize=require(_0xb0b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0b4('0x1')],'unique':_0xb0b4('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xb0b4('0x3')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xb0b4('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb0b4('0x4')},'limitCalls':{'type':Sequelize[_0xb0b4('0x5')](0x4)[_0xb0b4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb0b4('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0xb0b4('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb0b4('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x8')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb0b4('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb0b4('0xd')},'dialTimezone':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':_0xb0b4('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xb0b4('0xf')](_0xb0b4('0x10'),_0xb0b4('0x11'),_0xb0b4('0x12')),'defaultValue':_0xb0b4('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb0b4('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb0b4('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb0b4('0x5')](0x9)[_0xb0b4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0b4('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb0b4('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb0b4('0x5')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb0b4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb0b4('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb0b4('0xf')](_0xb0b4('0x18'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb0b4('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0b4('0x19')},'dialCutDigit':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0b4('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)[_0xb0b4('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb0b4('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0b4('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb0b4('0x5')](0x5)[_0xb0b4('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0b4('0x23')}};
\ No newline at end of file
+var _0xcf1c=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','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)','ENUM','always','never','onlyIfOpen','#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)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x5699af,_0x3fb494){var _0x699a79=function(_0x120f04){while(--_0x120f04){_0x5699af['push'](_0x5699af['shift']());}};_0x699a79(++_0x3fb494);}(_0xcf1c,0x1f0));var _0xccf1=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xcf1c[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require(_0xccf1('0x0'));module['exports']={'name':{'type':Sequelize[_0xccf1('0x1')],'unique':_0xccf1('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0xccf1('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xccf1('0x4')],'defaultValue':0x0,'comment':_0xccf1('0x5')},'limitCalls':{'type':Sequelize[_0xccf1('0x6')](0x4)[_0xccf1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xccf1('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xccf1('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xccf1('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xccf1('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xccf1('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xccf1('0xe')](_0xccf1('0xf'),_0xccf1('0x10'),_0xccf1('0x11')),'defaultValue':_0xccf1('0xf')},'dialAMDActive':{'type':Sequelize[_0xccf1('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xccf1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xccf1('0x12')},'dialAMDMinWordLength':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xccf1('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xccf1('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xccf1('0x6')](0x9)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xccf1('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xccf1('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xccf1('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xccf1('0xe')](_0xccf1('0x17'),'ASC'),'defaultValue':_0xccf1('0x17')},'dialPrefix':{'type':Sequelize[_0xccf1('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xccf1('0x18')},'dialCutDigit':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xccf1('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0xccf1('0x6')](0x5)[_0xccf1('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xccf1('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xccf1('0x6')](0x3)[_0xccf1('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xccf1('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 5a35e82..2285344 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 _0x91d5=['ListId','field','phone','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','toString','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Campaign','include','findAll','rows','catch','show','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','findOne','CmHopper','CampaignId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId'];(function(_0x98e634,_0x1b0126){var _0x52fa87=function(_0x3dc45b){while(--_0x3dc45b){_0x98e634['push'](_0x98e634['shift']());}};_0x52fa87(++_0x1b0126);}(_0x91d5,0xa2));var _0x591d=function(_0x2aa12f,_0xa81e42){_0x2aa12f=_0x2aa12f-0x0;var _0x30afdf=_0x91d5[_0x2aa12f];return _0x30afdf;};'use strict';var emlformat=require(_0x591d('0x0'));var rimraf=require(_0x591d('0x1'));var zipdir=require(_0x591d('0x2'));var jsonpatch=require(_0x591d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x591d('0x4'));var Mustache=require('mustache');var util=require(_0x591d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x591d('0x6'));var ejs=require(_0x591d('0x7'));var fs=require('fs');var fs_extra=require(_0x591d('0x8'));var _=require(_0x591d('0x9'));var squel=require(_0x591d('0xa'));var crypto=require(_0x591d('0xb'));var jsforce=require(_0x591d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x591d('0xd'));var Redis=require(_0x591d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x591d('0xf'));var as=require(_0x591d('0x10'));var hardwareService=require(_0x591d('0x11'));var logger=require(_0x591d('0x12'))(_0x591d('0x13'));var utils=require('../../config/utils');var config=require(_0x591d('0x14'));var licenseUtil=require(_0x591d('0x15'));var db=require(_0x591d('0x16'))['db'];function respondWithStatusCode(_0x1a582e,_0x4df13f){_0x4df13f=_0x4df13f||0xcc;return function(_0x25f440){if(_0x25f440){return _0x1a582e[_0x591d('0x17')](_0x4df13f);}return _0x1a582e[_0x591d('0x18')](_0x4df13f)[_0x591d('0x19')]();};}function respondWithResult(_0x299fcd,_0x495369){_0x495369=_0x495369||0xc8;return function(_0x30498d){if(_0x30498d){return _0x299fcd[_0x591d('0x18')](_0x495369)[_0x591d('0x1a')](_0x30498d);}};}function respondWithFilteredResult(_0x5d676f,_0x3a88bb){return function(_0x3cc824){if(_0x3cc824){var _0xd3c185=typeof _0x3a88bb[_0x591d('0x1b')]===_0x591d('0x1c')&&typeof _0x3a88bb['limit']===_0x591d('0x1c');var _0x25ebac=_0x3cc824[_0x591d('0x1d')];var _0x2c88dd=_0xd3c185?0x0:_0x3a88bb[_0x591d('0x1b')];var _0x3abba4=_0xd3c185?_0x3cc824['count']:_0x3a88bb[_0x591d('0x1b')]+_0x3a88bb[_0x591d('0x1e')];var _0x7d0083;if(_0x3abba4>=_0x25ebac){_0x3abba4=_0x25ebac;_0x7d0083=0xc8;}else{_0x7d0083=0xce;}_0x5d676f[_0x591d('0x18')](_0x7d0083);return _0x5d676f[_0x591d('0x1f')](_0x591d('0x20'),_0x2c88dd+'-'+_0x3abba4+'/'+_0x25ebac)[_0x591d('0x1a')](_0x3cc824);}return null;};}function patchUpdates(_0x1284e0){return function(_0x57d08a){try{jsonpatch[_0x591d('0x21')](_0x57d08a,_0x1284e0,!![]);}catch(_0x40f3f6){return BPromise['reject'](_0x40f3f6);}return _0x57d08a[_0x591d('0x22')]();};}function saveUpdates(_0x1277bf,_0x4d013c){return function(_0x278702){if(_0x278702){return _0x278702[_0x591d('0x23')](_0x1277bf)[_0x591d('0x24')](function(_0x3ec033){return _0x3ec033;});}return null;};}function removeEntity(_0x1fa77c,_0x9e8888){return function(_0x210600){if(_0x210600){return _0x210600[_0x591d('0x25')]()[_0x591d('0x24')](function(){var _0x2267df=_0x210600[_0x591d('0x26')]({'plain':!![]});var _0x1ddc8d=_0x591d('0x27');return db['UserProfileResource'][_0x591d('0x25')]({'where':{'type':_0x1ddc8d,'resourceId':_0x2267df['id']}})[_0x591d('0x24')](function(){return _0x210600;});})[_0x591d('0x24')](function(){_0x1fa77c[_0x591d('0x18')](0xcc)[_0x591d('0x19')]();});}};}function handleEntityNotFound(_0x5e4070,_0x534c5d){return function(_0x11e20f){if(!_0x11e20f){_0x5e4070[_0x591d('0x17')](0x194);}return _0x11e20f;};}function handleError(_0x3bf27a,_0x24aa87){_0x24aa87=_0x24aa87||0x1f4;return function(_0x5b78f2){logger[_0x591d('0x28')](_0x5b78f2[_0x591d('0x29')]);if(_0x5b78f2[_0x591d('0x2a')]){delete _0x5b78f2['name'];}_0x3bf27a[_0x591d('0x18')](_0x24aa87)[_0x591d('0x2b')](_0x5b78f2);};}exports[_0x591d('0x2c')]=function(_0x1716a1,_0x2c867d){var _0xaaf8fa={},_0x426042={},_0x42984b={'count':0x0,'rows':[]};var _0x3646f0=_[_0x591d('0x2d')](db['Campaign'][_0x591d('0x2e')],function(_0x49f6b5){return{'name':_0x49f6b5['fieldName'],'type':_0x49f6b5[_0x591d('0x2f')][_0x591d('0x30')]};});_0x426042['model']=_[_0x591d('0x2d')](_0x3646f0,_0x591d('0x2a'));_0x426042['query']=_[_0x591d('0x31')](_0x1716a1[_0x591d('0x32')]);_0x426042['filters']=_[_0x591d('0x33')](_0x426042['model'],_0x426042[_0x591d('0x32')]);_0xaaf8fa[_0x591d('0x34')]=_[_0x591d('0x33')](_0x426042[_0x591d('0x35')],qs[_0x591d('0x36')](_0x1716a1[_0x591d('0x32')][_0x591d('0x36')]));_0xaaf8fa['attributes']=_0xaaf8fa['attributes'][_0x591d('0x37')]?_0xaaf8fa[_0x591d('0x34')]:_0x426042[_0x591d('0x35')];if(!_0x1716a1[_0x591d('0x32')][_0x591d('0x38')](_0x591d('0x39'))){_0xaaf8fa[_0x591d('0x1e')]=qs['limit'](_0x1716a1[_0x591d('0x32')]['limit']);_0xaaf8fa[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x1716a1[_0x591d('0x32')][_0x591d('0x1b')]);}_0xaaf8fa[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x1716a1[_0x591d('0x32')]['sort']);_0xaaf8fa[_0x591d('0x3c')]=qs[_0x591d('0x3d')](_[_0x591d('0x3e')](_0x1716a1[_0x591d('0x32')],_0x426042[_0x591d('0x3d')]),_0x3646f0);if(_0x1716a1[_0x591d('0x32')][_0x591d('0x3f')]){_0xaaf8fa[_0x591d('0x3c')]=_[_0x591d('0x40')](_0xaaf8fa[_0x591d('0x3c')],{'$or':_['map'](_0x3646f0,function(_0x4f6d75){if(_0x4f6d75[_0x591d('0x2f')]!==_0x591d('0x41')){var _0x35c3f6={};_0x35c3f6[_0x4f6d75['name']]={'$like':'%'+_0x1716a1[_0x591d('0x32')][_0x591d('0x3f')]+'%'};return _0x35c3f6;}})});}_0xaaf8fa=_['merge']({},_0xaaf8fa,_0x1716a1[_0x591d('0x42')]);var _0x15c75d={'where':_0xaaf8fa[_0x591d('0x3c')]};return db[_0x591d('0x43')][_0x591d('0x1d')](_0x15c75d)[_0x591d('0x24')](function(_0x4ea7b9){_0x42984b['count']=_0x4ea7b9;if(_0x1716a1['query']['includeAll']){_0xaaf8fa[_0x591d('0x44')]=[{'all':!![]}];}return db[_0x591d('0x43')][_0x591d('0x45')](_0xaaf8fa);})[_0x591d('0x24')](function(_0x280932){_0x42984b[_0x591d('0x46')]=_0x280932;return _0x42984b;})[_0x591d('0x24')](respondWithFilteredResult(_0x2c867d,_0xaaf8fa))[_0x591d('0x47')](handleError(_0x2c867d,null));};exports[_0x591d('0x48')]=function(_0x38185f,_0x22a434){var _0x40e8f6={'raw':![],'where':{'id':_0x38185f[_0x591d('0x49')]['id']}},_0x1e314b={};_0x1e314b[_0x591d('0x35')]=_['keys'](db[_0x591d('0x43')][_0x591d('0x2e')]);_0x1e314b[_0x591d('0x32')]=_[_0x591d('0x31')](_0x38185f[_0x591d('0x32')]);_0x1e314b[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x1e314b[_0x591d('0x35')],_0x1e314b[_0x591d('0x32')]);_0x40e8f6[_0x591d('0x34')]=_[_0x591d('0x33')](_0x1e314b['model'],qs['fields'](_0x38185f[_0x591d('0x32')][_0x591d('0x36')]));_0x40e8f6[_0x591d('0x34')]=_0x40e8f6['attributes']['length']?_0x40e8f6['attributes']:_0x1e314b[_0x591d('0x35')];if(_0x38185f[_0x591d('0x32')][_0x591d('0x4a')]){_0x40e8f6['include']=[{'all':!![]}];}_0x40e8f6=_['merge']({},_0x40e8f6,_0x38185f[_0x591d('0x42')]);return db['Campaign'][_0x591d('0x4b')](_0x40e8f6)[_0x591d('0x24')](handleEntityNotFound(_0x22a434,null))[_0x591d('0x24')](respondWithResult(_0x22a434,null))['catch'](handleError(_0x22a434,null));};exports[_0x591d('0x4c')]=function(_0x58410b,_0x3ef456){return db[_0x591d('0x43')][_0x591d('0x4c')](_0x58410b['body'],{})['then'](function(_0x109739){var _0x4ecf62=_0x58410b['user']['get']({'plain':!![]});if(!_0x4ecf62)throw new Error(_0x591d('0x4d'));if(_0x4ecf62[_0x591d('0x4e')]===_0x591d('0x4f')){var _0x59f201=_0x109739[_0x591d('0x26')]({'plain':!![]});var _0x4c1850=_0x591d('0x27');return db[_0x591d('0x50')][_0x591d('0x4b')]({'where':{'name':_0x4c1850,'userProfileId':_0x4ecf62[_0x591d('0x51')]},'raw':!![]})[_0x591d('0x24')](function(_0x2cc77f){if(_0x2cc77f&&_0x2cc77f[_0x591d('0x52')]===0x0){return db[_0x591d('0x53')][_0x591d('0x4c')]({'name':_0x59f201['name'],'resourceId':_0x59f201['id'],'type':_0x2cc77f[_0x591d('0x2a')],'sectionId':_0x2cc77f['id']},{})[_0x591d('0x24')](function(){return _0x109739;});}else{return _0x109739;}})[_0x591d('0x47')](function(_0x299013){logger['error'](_0x591d('0x54'),_0x299013);throw _0x299013;});}return _0x109739;})[_0x591d('0x24')](respondWithResult(_0x3ef456,0xc9))[_0x591d('0x47')](handleError(_0x3ef456,null));};exports[_0x591d('0x55')]=function(_0x27f125,_0x806783){var _0x5c323d={'where':{'id':_0x27f125[_0x591d('0x49')]['id']}},_0x427ca8={};_0x427ca8[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x43')][_0x591d('0x2e')]);_0x5c323d[_0x591d('0x34')]=_[_0x591d('0x33')](_0x427ca8['model'],qs['fields'](_0x27f125[_0x591d('0x32')][_0x591d('0x36')]));_0x5c323d['attributes']=_0x5c323d['attributes'][_0x591d('0x37')]?_0x5c323d[_0x591d('0x34')]:_0x427ca8['model'];if(_0x27f125[_0x591d('0x32')][_0x591d('0x4a')]){_0x5c323d['include']=[{'all':!![]}];}_0x5c323d=_['merge']({},_0x5c323d,_0x27f125[_0x591d('0x42')]);return db[_0x591d('0x43')][_0x591d('0x4b')](_0x5c323d)['then'](handleEntityNotFound(_0x806783,null))[_0x591d('0x24')](function(_0x2500c7){if(_0x2500c7){var _0x8a800c=_0x2500c7['get']({'plain':!![]});_0x8a800c=qs[_0x591d('0x56')](_0x8a800c,['id',_0x591d('0x57'),'updatedAt']);_0x27f125[_0x591d('0x58')]=_[_0x591d('0x56')](_0x27f125[_0x591d('0x58')],['id',_0x591d('0x57'),_0x591d('0x59')]);return db[_0x591d('0x43')][_0x591d('0x4c')](_[_0x591d('0x40')](_0x8a800c,_0x27f125['body']),{'include':_0x27f125[_0x591d('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x591d('0x24')](function(_0x280c63){var _0x2e4395=_0x27f125['user'][_0x591d('0x26')]({'plain':!![]});if(!_0x2e4395)throw new Error(_0x591d('0x4d'));if(_0x2e4395['role']===_0x591d('0x4f')){var _0x595b08=_0x280c63[_0x591d('0x26')]({'plain':!![]});var _0xd5b009=_0x591d('0x27');return db[_0x591d('0x50')][_0x591d('0x4b')]({'where':{'name':_0xd5b009,'userProfileId':_0x2e4395['userProfileId']},'raw':!![]})[_0x591d('0x24')](function(_0x13341a){if(_0x13341a&&_0x13341a[_0x591d('0x52')]===0x0){return db[_0x591d('0x53')][_0x591d('0x4c')]({'name':_0x595b08[_0x591d('0x2a')],'resourceId':_0x595b08['id'],'type':_0x13341a[_0x591d('0x2a')],'sectionId':_0x13341a['id']},{})[_0x591d('0x24')](function(){return _0x280c63;});}else{return _0x280c63;}})[_0x591d('0x47')](function(_0x3d4d86){logger['error'](_0x591d('0x54'),_0x3d4d86);throw _0x3d4d86;});}return _0x280c63;});}})[_0x591d('0x24')](respondWithResult(_0x806783,0xc9))[_0x591d('0x47')](handleError(_0x806783,null));};exports[_0x591d('0x23')]=function(_0x575724,_0x4aeb5d){if(_0x575724[_0x591d('0x58')]['id']){delete _0x575724[_0x591d('0x58')]['id'];}return db['Campaign'][_0x591d('0x4b')]({'where':{'id':_0x575724[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x4aeb5d,null))[_0x591d('0x24')](saveUpdates(_0x575724[_0x591d('0x58')],null))[_0x591d('0x24')](respondWithResult(_0x4aeb5d,null))[_0x591d('0x47')](handleError(_0x4aeb5d,null));};exports[_0x591d('0x25')]=function(_0x3a1347,_0x5b7ad2){return db[_0x591d('0x43')]['find']({'where':{'id':_0x3a1347[_0x591d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b7ad2,null))[_0x591d('0x24')](removeEntity(_0x5b7ad2,null))['catch'](handleError(_0x5b7ad2,null));};exports['getHoppers']=function(_0x59c9a9,_0x2625a5,_0x1995bb){var _0x23f81a={'raw':!![],'where':{}};var _0x242ac8={};var _0x3be5cb={'count':0x0,'rows':[]};return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x59c9a9[_0x591d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2625a5,null))[_0x591d('0x24')](function(_0x5c616b){if(_0x5c616b){_0x242ac8[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x5b')]['rawAttributes']);_0x242ac8[_0x591d('0x32')]=_[_0x591d('0x31')](_0x59c9a9[_0x591d('0x32')]);_0x242ac8[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x242ac8[_0x591d('0x35')],_0x242ac8[_0x591d('0x32')]);_0x23f81a[_0x591d('0x34')]=_['intersection'](_0x242ac8['model'],qs[_0x591d('0x36')](_0x59c9a9[_0x591d('0x32')][_0x591d('0x36')]));_0x23f81a[_0x591d('0x34')]=_0x23f81a[_0x591d('0x34')][_0x591d('0x37')]?_0x23f81a['attributes']:_0x242ac8[_0x591d('0x35')];if(!_0x59c9a9['query'][_0x591d('0x38')](_0x591d('0x39'))){_0x23f81a[_0x591d('0x1e')]=qs[_0x591d('0x1e')](_0x59c9a9[_0x591d('0x32')][_0x591d('0x1e')]);_0x23f81a[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x59c9a9[_0x591d('0x32')][_0x591d('0x1b')]);}_0x23f81a[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x59c9a9['query']['sort']);_0x23f81a[_0x591d('0x3c')]=qs['filters'](_[_0x591d('0x3e')](_0x59c9a9[_0x591d('0x32')],_0x242ac8[_0x591d('0x3d')]));_0x23f81a[_0x591d('0x3c')][_0x591d('0x5c')]=_0x5c616b['id'];if(_0x59c9a9[_0x591d('0x32')][_0x591d('0x3f')]){_0x23f81a[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x23f81a[_0x591d('0x3c')],{'$or':_['map'](_0x23f81a[_0x591d('0x34')],function(_0x57d420){var _0x1ddd3c={};_0x1ddd3c[_0x57d420]={'$like':'%'+_0x59c9a9[_0x591d('0x32')][_0x591d('0x3f')]+'%'};return _0x1ddd3c;})});}_0x23f81a=_[_0x591d('0x40')]({},_0x23f81a,_0x59c9a9[_0x591d('0x42')]);return db[_0x591d('0x5b')]['count']({'where':_0x23f81a[_0x591d('0x3c')]})[_0x591d('0x24')](function(_0x333c14){_0x3be5cb[_0x591d('0x1d')]=_0x333c14;if(_0x59c9a9[_0x591d('0x32')][_0x591d('0x4a')]){_0x23f81a[_0x591d('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x591d('0x45')](_0x23f81a);})[_0x591d('0x24')](function(_0x1fb782){_0x3be5cb[_0x591d('0x46')]=_0x1fb782;return _0x3be5cb;});}})[_0x591d('0x24')](respondWithFilteredResult(_0x2625a5,_0x23f81a))['catch'](handleError(_0x2625a5,null));};exports['getHopperHistories']=function(_0x26d554,_0xff53d1,_0x2df0bf){var _0x24c88b={'raw':!![],'where':{}};var _0x175879={};var _0xbb6b1d={'count':0x0,'rows':[]};return db[_0x591d('0x43')]['findOne']({'where':{'id':_0x26d554[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0xff53d1,null))[_0x591d('0x24')](function(_0x88b1b6){if(_0x88b1b6){_0x175879[_0x591d('0x35')]=_['keys'](db[_0x591d('0x5d')][_0x591d('0x2e')]);_0x175879[_0x591d('0x32')]=_[_0x591d('0x31')](_0x26d554[_0x591d('0x32')]);_0x175879[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x175879[_0x591d('0x35')],_0x175879[_0x591d('0x32')]);_0x24c88b['attributes']=_[_0x591d('0x33')](_0x175879[_0x591d('0x35')],qs[_0x591d('0x36')](_0x26d554['query'][_0x591d('0x36')]));_0x24c88b['attributes']=_0x24c88b[_0x591d('0x34')]['length']?_0x24c88b[_0x591d('0x34')]:_0x175879[_0x591d('0x35')];if(!_0x26d554[_0x591d('0x32')][_0x591d('0x38')](_0x591d('0x39'))){_0x24c88b[_0x591d('0x1e')]=qs[_0x591d('0x1e')](_0x26d554[_0x591d('0x32')]['limit']);_0x24c88b['offset']=qs[_0x591d('0x1b')](_0x26d554[_0x591d('0x32')][_0x591d('0x1b')]);}_0x24c88b['order']=qs[_0x591d('0x3b')](_0x26d554[_0x591d('0x32')][_0x591d('0x3b')]);_0x24c88b['where']=qs['filters'](_[_0x591d('0x3e')](_0x26d554['query'],_0x175879[_0x591d('0x3d')]));_0x24c88b[_0x591d('0x3c')][_0x591d('0x5c')]=_0x88b1b6['id'];if(_0x26d554['query']['filter']){_0x24c88b[_0x591d('0x3c')]=_['merge'](_0x24c88b['where'],{'$or':_['map'](_0x24c88b[_0x591d('0x34')],function(_0x59c48a){var _0x146257={};_0x146257[_0x59c48a]={'$like':'%'+_0x26d554['query'][_0x591d('0x3f')]+'%'};return _0x146257;})});}_0x24c88b=_[_0x591d('0x40')]({},_0x24c88b,_0x26d554[_0x591d('0x42')]);return db['CmHopperHistory'][_0x591d('0x1d')]({'where':_0x24c88b[_0x591d('0x3c')]})[_0x591d('0x24')](function(_0x280fa6){_0xbb6b1d[_0x591d('0x1d')]=_0x280fa6;if(_0x26d554['query'][_0x591d('0x4a')]){_0x24c88b['include']=[{'all':!![]}];}return db[_0x591d('0x5d')][_0x591d('0x45')](_0x24c88b);})[_0x591d('0x24')](function(_0x5f08b4){_0xbb6b1d[_0x591d('0x46')]=_0x5f08b4;return _0xbb6b1d;});}})[_0x591d('0x24')](respondWithFilteredResult(_0xff53d1,_0x24c88b))[_0x591d('0x47')](handleError(_0xff53d1,null));};exports[_0x591d('0x5e')]=function(_0x5a06b1,_0x5bebd1,_0x5e5f0f){var _0x1dfec2={'raw':!![],'where':{}};var _0x2d7619={};var _0x1ade4c={'count':0x0,'rows':[]};return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x5a06b1[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x5bebd1,null))[_0x591d('0x24')](function(_0x80f5cd){if(_0x80f5cd){_0x2d7619[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x5f')]['rawAttributes']);_0x2d7619[_0x591d('0x32')]=_['keys'](_0x5a06b1[_0x591d('0x32')]);_0x2d7619['filters']=_[_0x591d('0x33')](_0x2d7619['model'],_0x2d7619[_0x591d('0x32')]);_0x1dfec2[_0x591d('0x34')]=_[_0x591d('0x33')](_0x2d7619['model'],qs[_0x591d('0x36')](_0x5a06b1[_0x591d('0x32')][_0x591d('0x36')]));_0x1dfec2[_0x591d('0x34')]=_0x1dfec2[_0x591d('0x34')][_0x591d('0x37')]?_0x1dfec2['attributes']:_0x2d7619[_0x591d('0x35')];if(!_0x5a06b1['query'][_0x591d('0x38')](_0x591d('0x39'))){_0x1dfec2[_0x591d('0x1e')]=qs['limit'](_0x5a06b1[_0x591d('0x32')][_0x591d('0x1e')]);_0x1dfec2[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x5a06b1[_0x591d('0x32')]['offset']);}_0x1dfec2[_0x591d('0x3a')]=qs['sort'](_0x5a06b1['query'][_0x591d('0x3b')]);_0x1dfec2[_0x591d('0x3c')]=qs['filters'](_[_0x591d('0x3e')](_0x5a06b1[_0x591d('0x32')],_0x2d7619['filters']));_0x1dfec2['where']['CampaignId']=_0x80f5cd['id'];if(_0x5a06b1[_0x591d('0x32')][_0x591d('0x3f')]){_0x1dfec2[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x1dfec2[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x1dfec2[_0x591d('0x34')],function(_0x3caaa7){var _0x45842c={};_0x45842c[_0x3caaa7]={'$like':'%'+_0x5a06b1[_0x591d('0x32')]['filter']+'%'};return _0x45842c;})});}_0x1dfec2=_[_0x591d('0x40')]({},_0x1dfec2,_0x5a06b1[_0x591d('0x42')]);return db[_0x591d('0x5f')][_0x591d('0x1d')]({'where':_0x1dfec2['where']})[_0x591d('0x24')](function(_0x1a82bf){_0x1ade4c[_0x591d('0x1d')]=_0x1a82bf;if(_0x5a06b1[_0x591d('0x32')][_0x591d('0x4a')]){_0x1dfec2[_0x591d('0x44')]=[{'all':!![]}];}return db[_0x591d('0x5f')]['findAll'](_0x1dfec2);})[_0x591d('0x24')](function(_0x4184a3){_0x1ade4c['rows']=_0x4184a3;return _0x1ade4c;});}})[_0x591d('0x24')](respondWithFilteredResult(_0x5bebd1,_0x1dfec2))[_0x591d('0x47')](handleError(_0x5bebd1,null));};exports[_0x591d('0x60')]=function(_0x1c7cd7,_0x34e1d7,_0x4d36ac){var _0x188b44={'raw':!![],'where':{}};var _0x51d99f={};var _0x45ba97={'count':0x0,'rows':[]};return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x1c7cd7[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x34e1d7,null))[_0x591d('0x24')](function(_0x2b4122){if(_0x2b4122){_0x51d99f[_0x591d('0x35')]=_[_0x591d('0x31')](db[_0x591d('0x61')]['rawAttributes']);_0x51d99f[_0x591d('0x32')]=_[_0x591d('0x31')](_0x1c7cd7[_0x591d('0x32')]);_0x51d99f[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x51d99f['model'],_0x51d99f['query']);_0x188b44[_0x591d('0x34')]=_[_0x591d('0x33')](_0x51d99f[_0x591d('0x35')],qs[_0x591d('0x36')](_0x1c7cd7[_0x591d('0x32')]['fields']));_0x188b44['attributes']=_0x188b44[_0x591d('0x34')][_0x591d('0x37')]?_0x188b44[_0x591d('0x34')]:_0x51d99f[_0x591d('0x35')];if(!_0x1c7cd7['query'][_0x591d('0x38')](_0x591d('0x39'))){_0x188b44['limit']=qs[_0x591d('0x1e')](_0x1c7cd7['query']['limit']);_0x188b44[_0x591d('0x1b')]=qs['offset'](_0x1c7cd7['query']['offset']);}_0x188b44[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x1c7cd7['query'][_0x591d('0x3b')]);_0x188b44['where']=qs['filters'](_[_0x591d('0x3e')](_0x1c7cd7[_0x591d('0x32')],_0x51d99f['filters']));_0x188b44['where'][_0x591d('0x5c')]=_0x2b4122['id'];if(_0x1c7cd7[_0x591d('0x32')][_0x591d('0x3f')]){_0x188b44[_0x591d('0x3c')]=_['merge'](_0x188b44[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x188b44[_0x591d('0x34')],function(_0x5c6d6e){var _0x5daaa2={};_0x5daaa2[_0x5c6d6e]={'$like':'%'+_0x1c7cd7[_0x591d('0x32')]['filter']+'%'};return _0x5daaa2;})});}_0x188b44=_[_0x591d('0x40')]({},_0x188b44,_0x1c7cd7['options']);return db[_0x591d('0x61')][_0x591d('0x1d')]({'where':_0x188b44[_0x591d('0x3c')]})[_0x591d('0x24')](function(_0x1d558c){_0x45ba97[_0x591d('0x1d')]=_0x1d558c;if(_0x1c7cd7['query'][_0x591d('0x4a')]){_0x188b44['include']=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x188b44);})[_0x591d('0x24')](function(_0x4523bb){_0x45ba97['rows']=_0x4523bb;return _0x45ba97;});}})[_0x591d('0x24')](respondWithFilteredResult(_0x34e1d7,_0x188b44))[_0x591d('0x47')](handleError(_0x34e1d7,null));};exports[_0x591d('0x62')]=function(_0x49698e,_0x541caf,_0x41de07){var _0x17d1d4={};var _0x584946={};var _0x32bc29;var _0x1ffa38;return db[_0x591d('0x43')][_0x591d('0x5a')]({'where':{'id':_0x49698e[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x541caf,null))[_0x591d('0x24')](function(_0x364137){if(_0x364137){_0x32bc29=_0x364137;_0x584946['model']=_[_0x591d('0x31')](db[_0x591d('0x63')][_0x591d('0x2e')]);_0x584946[_0x591d('0x32')]=_[_0x591d('0x31')](_0x49698e[_0x591d('0x32')]);_0x584946[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x584946['model'],_0x584946[_0x591d('0x32')]);_0x17d1d4['attributes']=_[_0x591d('0x33')](_0x584946['model'],qs[_0x591d('0x36')](_0x49698e[_0x591d('0x32')][_0x591d('0x36')]));_0x17d1d4['attributes']=_0x17d1d4['attributes']['length']?_0x17d1d4[_0x591d('0x34')]:_0x584946[_0x591d('0x35')];_0x17d1d4[_0x591d('0x3a')]=qs[_0x591d('0x3b')](_0x49698e[_0x591d('0x32')][_0x591d('0x3b')]);_0x17d1d4[_0x591d('0x3c')]=qs[_0x591d('0x3d')](_['pick'](_0x49698e[_0x591d('0x32')],_0x584946[_0x591d('0x3d')]));if(_0x49698e[_0x591d('0x32')][_0x591d('0x3f')]){_0x17d1d4[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x17d1d4[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x17d1d4['attributes'],function(_0x4f664d){var _0x406a69={};_0x406a69[_0x4f664d]={'$like':'%'+_0x49698e['query']['filter']+'%'};return _0x406a69;})});}_0x17d1d4=_[_0x591d('0x40')]({},_0x17d1d4,_0x49698e[_0x591d('0x42')]);return _0x32bc29['getLists'](_0x17d1d4);}})['then'](function(_0x140d45){if(_0x140d45){_0x1ffa38=_0x140d45[_0x591d('0x37')];if(!_0x49698e[_0x591d('0x32')][_0x591d('0x38')](_0x591d('0x39'))){_0x17d1d4[_0x591d('0x1e')]=qs['limit'](_0x49698e[_0x591d('0x32')][_0x591d('0x1e')]);_0x17d1d4[_0x591d('0x1b')]=qs[_0x591d('0x1b')](_0x49698e[_0x591d('0x32')][_0x591d('0x1b')]);}return _0x32bc29['getLists'](_0x17d1d4);}})[_0x591d('0x24')](function(_0x46b443){if(_0x46b443){return _0x46b443?{'count':_0x1ffa38,'rows':_0x46b443}:null;}})[_0x591d('0x24')](respondWithResult(_0x541caf,null))[_0x591d('0x47')](handleError(_0x541caf,null));};exports[_0x591d('0x64')]=function(_0x4ea093,_0x1dee81,_0xec2e50){var _0x2432f7,_0x441acf;return db[_0x591d('0x43')]['find']({'where':{'id':_0x4ea093[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x1dee81,null))[_0x591d('0x24')](function(_0xc42fa7){if(_0xc42fa7){_0x441acf=_0xc42fa7;return _0xc42fa7[_0x591d('0x64')](_0x4ea093[_0x591d('0x58')][_0x591d('0x65')],_[_0x591d('0x56')](_0x4ea093[_0x591d('0x58')],[_0x591d('0x65'),'id'])||{});}return null;})[_0x591d('0x66')](function(_0x3ca76){var _0x19e070;_0x2432f7=_0x3ca76||[];var _0x276a4f=[];if(_0x3ca76){for(var _0xacb29e=0x0;_0xacb29e<_0x3ca76[_0x591d('0x37')];_0xacb29e+=0x1){var _0x196dc8=_0x3ca76[_0xacb29e]['get']({'plain':!![]});_0x441acf['dialCheckDuplicateType']=_0x4ea093[_0x591d('0x58')][_0x591d('0x67')]?_0x4ea093[_0x591d('0x58')][_0x591d('0x67')]:_0x441acf[_0x591d('0x67')];switch(_0x441acf['dialCheckDuplicateType']){case'always':_0x19e070=squel[_0x591d('0x68')]()[_0x591d('0x69')](_0x591d('0x6a'))[_0x591d('0x6b')](['phone',_0x591d('0x6c'),_0x591d('0x6d'),_0x591d('0x6e'),_0x591d('0x5c'),_0x591d('0x57'),_0x591d('0x59')],squel['select']()[_0x591d('0x6f')]('phone',_0x591d('0x70'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x6c'))[_0x591d('0x6f')]('id',_0x591d('0x6d'))[_0x591d('0x6f')](_0x196dc8[_0x591d('0x72')]['toString'](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x4ea093[_0x591d('0x49')]['id']['toString'](),'CampaignId')[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x57'))['field']('NOW()',_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))[_0x591d('0x3c')](_0x591d('0x75'))[_0x591d('0x3c')]('ListId\x20=\x20?',_0x196dc8['CmListId']['toString']())[_0x591d('0x3c')](_0x591d('0x76'))[_0x591d('0x3c')](_0x591d('0x77'),squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x79'))[_0x591d('0x73')](_0x591d('0x7a'))[_0x591d('0x3c')](_0x591d('0x7b'),_0x4ea093['params']['id'][_0x591d('0x7c')]()))['where'](_0x591d('0x77'),squel['select']()[_0x591d('0x6f')](_0x591d('0x7d'))[_0x591d('0x73')](_0x591d('0x6a'))[_0x591d('0x3c')](_0x591d('0x7b'),_0x4ea093[_0x591d('0x49')]['id'][_0x591d('0x7c')]())))[_0x591d('0x7c')]();break;case _0x591d('0x7e'):_0x19e070=squel[_0x591d('0x68')]()[_0x591d('0x69')](_0x591d('0x6a'))[_0x591d('0x6b')]([_0x591d('0x70'),_0x591d('0x6c'),_0x591d('0x6d'),_0x591d('0x6e'),_0x591d('0x5c'),_0x591d('0x57'),_0x591d('0x59')],squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x70'),_0x591d('0x70'))[_0x591d('0x6f')](_0x591d('0x71'),'scheduledAt')[_0x591d('0x6f')]('id',_0x591d('0x6d'))[_0x591d('0x6f')](_0x196dc8[_0x591d('0x72')]['toString'](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x4ea093['params']['id'][_0x591d('0x7c')](),_0x591d('0x5c'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x57'))['field'](_0x591d('0x71'),_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))['where'](_0x591d('0x75'))[_0x591d('0x3c')](_0x591d('0x7f'),_0x196dc8['CmListId']['toString']())[_0x591d('0x3c')](_0x591d('0x76'))['where'](_0x591d('0x77'),squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x7d'))['from'](_0x591d('0x6a'))[_0x591d('0x3c')](_0x591d('0x7b'),_0x4ea093[_0x591d('0x49')]['id'][_0x591d('0x7c')]())))['toString']();break;default:_0x19e070=squel['insert']()['into'](_0x591d('0x6a'))[_0x591d('0x6b')]([_0x591d('0x70'),_0x591d('0x6c'),'ContactId','ListId',_0x591d('0x5c'),_0x591d('0x57'),'updatedAt'],squel[_0x591d('0x78')]()['field'](_0x591d('0x70'),_0x591d('0x70'))['field'](_0x591d('0x71'),_0x591d('0x6c'))['field']('id','ContactId')['field'](_0x196dc8['CmListId']['toString'](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x4ea093['params']['id'][_0x591d('0x7c')](),_0x591d('0x5c'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x57'))[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))['where'](_0x591d('0x75'))[_0x591d('0x3c')](_0x591d('0x7f'),_0x196dc8[_0x591d('0x72')][_0x591d('0x7c')]())[_0x591d('0x3c')](_0x591d('0x76')))['toString']();}_0x276a4f[_0x591d('0x80')](db[_0x591d('0x81')][_0x591d('0x32')](_0x19e070));}return BPromise[_0x591d('0x82')](_0x276a4f);}})[_0x591d('0x24')](function(){return _0x2432f7;})[_0x591d('0x24')](respondWithResult(_0x1dee81,null))['catch'](handleError(_0x1dee81,null));};exports[_0x591d('0x83')]=function(_0x347971,_0x2b585a,_0x13322e){return db[_0x591d('0x43')][_0x591d('0x4b')]({'where':{'id':_0x347971[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x2b585a,null))['then'](function(_0xa31410){if(_0xa31410){return _0xa31410[_0x591d('0x83')](_0x347971[_0x591d('0x32')][_0x591d('0x65')]);}})[_0x591d('0x24')](function(_0x51f1c4){if(_0x51f1c4){return db[_0x591d('0x5b')][_0x591d('0x25')]({'where':{'ListId':_0x347971[_0x591d('0x32')][_0x591d('0x65')],'CampaignId':_0x347971['params']['id']}})[_0x591d('0x24')](function(){return _0x51f1c4;});}})[_0x591d('0x24')](respondWithStatusCode(_0x2b585a,null))[_0x591d('0x47')](handleError(_0x2b585a,null));};exports[_0x591d('0x84')]=function(_0x541d96,_0xeb1f2,_0x518d6a){var _0x71d2b5={};var _0x2552d6={};var _0x53aaad;var _0x45af5a;return db[_0x591d('0x43')]['findOne']({'where':{'id':_0x541d96[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0xeb1f2,null))[_0x591d('0x24')](function(_0x120c24){if(_0x120c24){_0x53aaad=_0x120c24;_0x2552d6[_0x591d('0x35')]=_[_0x591d('0x31')](db['CmList'][_0x591d('0x2e')]);_0x2552d6[_0x591d('0x32')]=_[_0x591d('0x31')](_0x541d96['query']);_0x2552d6[_0x591d('0x3d')]=_[_0x591d('0x33')](_0x2552d6[_0x591d('0x35')],_0x2552d6[_0x591d('0x32')]);_0x71d2b5[_0x591d('0x34')]=_[_0x591d('0x33')](_0x2552d6[_0x591d('0x35')],qs[_0x591d('0x36')](_0x541d96['query'][_0x591d('0x36')]));_0x71d2b5[_0x591d('0x34')]=_0x71d2b5[_0x591d('0x34')][_0x591d('0x37')]?_0x71d2b5['attributes']:_0x2552d6[_0x591d('0x35')];_0x71d2b5['order']=qs[_0x591d('0x3b')](_0x541d96[_0x591d('0x32')]['sort']);_0x71d2b5[_0x591d('0x3c')]=qs[_0x591d('0x3d')](_[_0x591d('0x3e')](_0x541d96[_0x591d('0x32')],_0x2552d6[_0x591d('0x3d')]));if(_0x541d96[_0x591d('0x32')][_0x591d('0x3f')]){_0x71d2b5[_0x591d('0x3c')]=_[_0x591d('0x40')](_0x71d2b5[_0x591d('0x3c')],{'$or':_[_0x591d('0x2d')](_0x71d2b5[_0x591d('0x34')],function(_0x16d41){var _0x356cf2={};_0x356cf2[_0x16d41]={'$like':'%'+_0x541d96[_0x591d('0x32')][_0x591d('0x3f')]+'%'};return _0x356cf2;})});}_0x71d2b5=_[_0x591d('0x40')]({},_0x71d2b5,_0x541d96[_0x591d('0x42')]);return _0x53aaad['getBlackLists'](_0x71d2b5);}})['then'](function(_0x144c22){if(_0x144c22){_0x45af5a=_0x144c22[_0x591d('0x37')];if(!_0x541d96[_0x591d('0x32')][_0x591d('0x38')]('nolimit')){_0x71d2b5[_0x591d('0x1e')]=qs[_0x591d('0x1e')](_0x541d96[_0x591d('0x32')][_0x591d('0x1e')]);_0x71d2b5['offset']=qs[_0x591d('0x1b')](_0x541d96[_0x591d('0x32')]['offset']);}return _0x53aaad[_0x591d('0x84')](_0x71d2b5);}})[_0x591d('0x24')](function(_0x2df9a7){if(_0x2df9a7){return _0x2df9a7?{'count':_0x45af5a,'rows':_0x2df9a7}:null;}})[_0x591d('0x24')](respondWithResult(_0xeb1f2,null))[_0x591d('0x47')](handleError(_0xeb1f2,null));};exports[_0x591d('0x85')]=function(_0x25ca14,_0x2cf54e,_0x8f6e7){var _0x21f54d,_0x59681b;return db[_0x591d('0x43')][_0x591d('0x4b')]({'where':{'id':_0x25ca14[_0x591d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cf54e,null))['then'](function(_0x1d11de){if(_0x1d11de){_0x59681b=_0x1d11de;return _0x1d11de[_0x591d('0x85')](_0x25ca14[_0x591d('0x58')]['ids'],_[_0x591d('0x56')](_0x25ca14[_0x591d('0x58')],[_0x591d('0x65'),'id'])||{});}return null;})[_0x591d('0x66')](function(_0x338ff9){var _0x13bd81;_0x21f54d=_0x338ff9||[];var _0x1676fb=[];if(_0x338ff9){for(var _0x4ebf73=0x0;_0x4ebf73<_0x338ff9['length'];_0x4ebf73+=0x1){var _0x1f2825=_0x338ff9[_0x4ebf73][_0x591d('0x26')]({'plain':!![]});_0x13bd81=squel[_0x591d('0x68')]()['into'](_0x591d('0x86'))[_0x591d('0x6b')](['phone',_0x591d('0x6d'),_0x591d('0x6e'),_0x591d('0x5c'),_0x591d('0x57'),_0x591d('0x59')],squel[_0x591d('0x78')]()[_0x591d('0x6f')](_0x591d('0x70'),'phone')['field']('id',_0x591d('0x6d'))['field'](_0x1f2825[_0x591d('0x72')][_0x591d('0x7c')](),_0x591d('0x6e'))[_0x591d('0x6f')](_0x25ca14[_0x591d('0x49')]['id']['toString'](),'CampaignId')[_0x591d('0x6f')](_0x591d('0x71'),'createdAt')[_0x591d('0x6f')](_0x591d('0x71'),_0x591d('0x59'))[_0x591d('0x73')](_0x591d('0x74'))[_0x591d('0x3c')](_0x591d('0x75'))[_0x591d('0x3c')]('ListId\x20=\x20?',_0x1f2825[_0x591d('0x72')][_0x591d('0x7c')]())['where'](_0x591d('0x76')))[_0x591d('0x7c')]();_0x1676fb[_0x591d('0x80')](db[_0x591d('0x81')]['query'](_0x13bd81));}return BPromise[_0x591d('0x82')](_0x1676fb);}})['then'](function(){return _0x21f54d;})['then'](respondWithResult(_0x2cf54e,null))[_0x591d('0x47')](handleError(_0x2cf54e,null));};exports[_0x591d('0x87')]=function(_0x5317a6,_0x58788a,_0x21b1c2){return db[_0x591d('0x43')][_0x591d('0x4b')]({'where':{'id':_0x5317a6[_0x591d('0x49')]['id']}})[_0x591d('0x24')](handleEntityNotFound(_0x58788a,null))[_0x591d('0x24')](function(_0x308df8){if(_0x308df8){return _0x308df8['removeBlackLists'](_0x5317a6[_0x591d('0x32')][_0x591d('0x65')]);}})[_0x591d('0x24')](function(_0x566b58){if(_0x566b58){return db[_0x591d('0x61')][_0x591d('0x25')]({'where':{'ListId':_0x5317a6[_0x591d('0x32')][_0x591d('0x65')],'CampaignId':_0x5317a6[_0x591d('0x49')]['id']}})[_0x591d('0x24')](function(){return _0x566b58;});}})['then'](respondWithStatusCode(_0x58788a,null))[_0x591d('0x47')](handleError(_0x58788a,null));};
\ No newline at end of file
+var _0xe768=['CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','push','sequelize','getBlackLists','addBlackLists','omit','all','removeBlackLists','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','end','undefined','limit','count','offset','set','apply','reject','save','then','get','destroy','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','catch','show','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','user','userProfileId','update','getHoppers','findOne','CampaignId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe768,0x1c3));var _0x8e76=function(_0xa30614,_0x617839){_0xa30614=_0xa30614-0x0;var _0x50e61b=_0xe768[_0xa30614];return _0x50e61b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e76('0x0'));var zipdir=require(_0x8e76('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e76('0x2'));var moment=require(_0x8e76('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8e76('0x4'));var util=require(_0x8e76('0x5'));var path=require(_0x8e76('0x6'));var sox=require(_0x8e76('0x7'));var csv=require(_0x8e76('0x8'));var ejs=require(_0x8e76('0x9'));var fs=require('fs');var fs_extra=require(_0x8e76('0xa'));var _=require(_0x8e76('0xb'));var squel=require(_0x8e76('0xc'));var crypto=require(_0x8e76('0xd'));var jsforce=require(_0x8e76('0xe'));var deskjs=require(_0x8e76('0xf'));var toCsv=require(_0x8e76('0x8'));var querystring=require(_0x8e76('0x10'));var Papa=require(_0x8e76('0x11'));var Redis=require(_0x8e76('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e76('0x13'));var as=require(_0x8e76('0x14'));var hardwareService=require(_0x8e76('0x15'));var logger=require(_0x8e76('0x16'))(_0x8e76('0x17'));var utils=require(_0x8e76('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8e76('0x19'));var db=require(_0x8e76('0x1a'))['db'];function respondWithStatusCode(_0x3b3d68,_0x3fadb1){_0x3fadb1=_0x3fadb1||0xcc;return function(_0x4b525f){if(_0x4b525f){return _0x3b3d68[_0x8e76('0x1b')](_0x3fadb1);}return _0x3b3d68[_0x8e76('0x1c')](_0x3fadb1)[_0x8e76('0x1d')]();};}function respondWithResult(_0x17f2cb,_0x3187ae){_0x3187ae=_0x3187ae||0xc8;return function(_0xa40b27){if(_0xa40b27){return _0x17f2cb[_0x8e76('0x1c')](_0x3187ae)['json'](_0xa40b27);}};}function respondWithFilteredResult(_0x53a638,_0x54a71e){return function(_0x5605bc){if(_0x5605bc){var _0x3a637e=typeof _0x54a71e['offset']===_0x8e76('0x1e')&&typeof _0x54a71e[_0x8e76('0x1f')]===_0x8e76('0x1e');var _0x10e777=_0x5605bc[_0x8e76('0x20')];var _0x10722d=_0x3a637e?0x0:_0x54a71e[_0x8e76('0x21')];var _0x4ad113=_0x3a637e?_0x5605bc[_0x8e76('0x20')]:_0x54a71e[_0x8e76('0x21')]+_0x54a71e[_0x8e76('0x1f')];var _0x3c055a;if(_0x4ad113>=_0x10e777){_0x4ad113=_0x10e777;_0x3c055a=0xc8;}else{_0x3c055a=0xce;}_0x53a638['status'](_0x3c055a);return _0x53a638[_0x8e76('0x22')]('Content-Range',_0x10722d+'-'+_0x4ad113+'/'+_0x10e777)['json'](_0x5605bc);}return null;};}function patchUpdates(_0x50dfa8){return function(_0x1476d3){try{jsonpatch[_0x8e76('0x23')](_0x1476d3,_0x50dfa8,!![]);}catch(_0x103c0f){return BPromise[_0x8e76('0x24')](_0x103c0f);}return _0x1476d3[_0x8e76('0x25')]();};}function saveUpdates(_0x294280,_0x1fe63a){return function(_0x38cfc2){if(_0x38cfc2){return _0x38cfc2['update'](_0x294280)[_0x8e76('0x26')](function(_0xf226fe){return _0xf226fe;});}return null;};}function removeEntity(_0xf81942,_0x369470){return function(_0x5ac4ba){if(_0x5ac4ba){return _0x5ac4ba['destroy']()['then'](function(){var _0x4e944a=_0x5ac4ba[_0x8e76('0x27')]({'plain':!![]});var _0x53f9ba='IvrCampaigns';return db['UserProfileResource'][_0x8e76('0x28')]({'where':{'type':_0x53f9ba,'resourceId':_0x4e944a['id']}})[_0x8e76('0x26')](function(){return _0x5ac4ba;});})[_0x8e76('0x26')](function(){_0xf81942[_0x8e76('0x1c')](0xcc)[_0x8e76('0x1d')]();});}};}function handleEntityNotFound(_0x699c04,_0x1c8637){return function(_0x792c86){if(!_0x792c86){_0x699c04['sendStatus'](0x194);}return _0x792c86;};}function handleError(_0x1ceb9e,_0x1dba41){_0x1dba41=_0x1dba41||0x1f4;return function(_0x834913){logger['error'](_0x834913['stack']);if(_0x834913[_0x8e76('0x29')]){delete _0x834913[_0x8e76('0x29')];}_0x1ceb9e[_0x8e76('0x1c')](_0x1dba41)['send'](_0x834913);};}exports[_0x8e76('0x2a')]=function(_0x30b722,_0x1688b2){var _0x1653f4={},_0x97f7e9={},_0x1d21c0={'count':0x0,'rows':[]};var _0x5305a8=_[_0x8e76('0x2b')](db['Campaign'][_0x8e76('0x2c')],function(_0x3aad07){return{'name':_0x3aad07['fieldName'],'type':_0x3aad07[_0x8e76('0x2d')][_0x8e76('0x2e')]};});_0x97f7e9[_0x8e76('0x2f')]=_[_0x8e76('0x2b')](_0x5305a8,_0x8e76('0x29'));_0x97f7e9[_0x8e76('0x30')]=_['keys'](_0x30b722['query']);_0x97f7e9[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0x97f7e9[_0x8e76('0x2f')],_0x97f7e9[_0x8e76('0x30')]);_0x1653f4[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x97f7e9[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x30b722[_0x8e76('0x30')][_0x8e76('0x34')]));_0x1653f4['attributes']=_0x1653f4[_0x8e76('0x33')][_0x8e76('0x35')]?_0x1653f4[_0x8e76('0x33')]:_0x97f7e9['model'];if(!_0x30b722['query'][_0x8e76('0x36')](_0x8e76('0x37'))){_0x1653f4[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x30b722[_0x8e76('0x30')][_0x8e76('0x1f')]);_0x1653f4[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x30b722[_0x8e76('0x30')][_0x8e76('0x21')]);}_0x1653f4[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x30b722[_0x8e76('0x30')]['sort']);_0x1653f4[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x30b722[_0x8e76('0x30')],_0x97f7e9[_0x8e76('0x31')]),_0x5305a8);if(_0x30b722[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x1653f4[_0x8e76('0x3a')]=_[_0x8e76('0x3d')](_0x1653f4[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x5305a8,function(_0x587faf){if(_0x587faf[_0x8e76('0x2d')]!==_0x8e76('0x3e')){var _0x16700c={};_0x16700c[_0x587faf[_0x8e76('0x29')]]={'$like':'%'+_0x30b722[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x16700c;}})});}_0x1653f4=_[_0x8e76('0x3d')]({},_0x1653f4,_0x30b722[_0x8e76('0x3f')]);var _0x55cfaa={'where':_0x1653f4[_0x8e76('0x3a')]};return db[_0x8e76('0x40')][_0x8e76('0x20')](_0x55cfaa)[_0x8e76('0x26')](function(_0x37f4be){_0x1d21c0['count']=_0x37f4be;if(_0x30b722['query'][_0x8e76('0x41')]){_0x1653f4[_0x8e76('0x42')]=[{'all':!![]}];}return db[_0x8e76('0x40')]['findAll'](_0x1653f4);})['then'](function(_0xf3bfa4){_0x1d21c0['rows']=_0xf3bfa4;return _0x1d21c0;})[_0x8e76('0x26')](respondWithFilteredResult(_0x1688b2,_0x1653f4))[_0x8e76('0x43')](handleError(_0x1688b2,null));};exports[_0x8e76('0x44')]=function(_0xf821d0,_0x39846c){var _0x18b6bb={'raw':![],'where':{'id':_0xf821d0['params']['id']}},_0x424c5e={};_0x424c5e['model']=_[_0x8e76('0x45')](db[_0x8e76('0x40')]['rawAttributes']);_0x424c5e[_0x8e76('0x30')]=_['keys'](_0xf821d0[_0x8e76('0x30')]);_0x424c5e['filters']=_[_0x8e76('0x32')](_0x424c5e[_0x8e76('0x2f')],_0x424c5e[_0x8e76('0x30')]);_0x18b6bb[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x424c5e[_0x8e76('0x2f')],qs['fields'](_0xf821d0['query'][_0x8e76('0x34')]));_0x18b6bb[_0x8e76('0x33')]=_0x18b6bb[_0x8e76('0x33')][_0x8e76('0x35')]?_0x18b6bb[_0x8e76('0x33')]:_0x424c5e['model'];if(_0xf821d0[_0x8e76('0x30')][_0x8e76('0x41')]){_0x18b6bb[_0x8e76('0x42')]=[{'all':!![]}];}_0x18b6bb=_[_0x8e76('0x3d')]({},_0x18b6bb,_0xf821d0[_0x8e76('0x3f')]);return db[_0x8e76('0x40')][_0x8e76('0x46')](_0x18b6bb)[_0x8e76('0x26')](handleEntityNotFound(_0x39846c,null))[_0x8e76('0x26')](respondWithResult(_0x39846c,null))[_0x8e76('0x43')](handleError(_0x39846c,null));};exports[_0x8e76('0x47')]=function(_0x5f2897,_0x511ff2){return db[_0x8e76('0x40')][_0x8e76('0x47')](_0x5f2897[_0x8e76('0x48')],{})[_0x8e76('0x26')](function(_0x20e1df){var _0xa5745e=_0x5f2897['user'][_0x8e76('0x27')]({'plain':!![]});if(!_0xa5745e)throw new Error(_0x8e76('0x49'));if(_0xa5745e[_0x8e76('0x4a')]==='user'){var _0x3142b8=_0x20e1df['get']({'plain':!![]});var _0x94c52c=_0x8e76('0x4b');return db['UserProfileSection']['find']({'where':{'name':_0x94c52c,'userProfileId':_0xa5745e['userProfileId']},'raw':!![]})['then'](function(_0xe375b6){if(_0xe375b6&&_0xe375b6[_0x8e76('0x4c')]===0x0){return db[_0x8e76('0x4d')][_0x8e76('0x47')]({'name':_0x3142b8[_0x8e76('0x29')],'resourceId':_0x3142b8['id'],'type':_0xe375b6[_0x8e76('0x29')],'sectionId':_0xe375b6['id']},{})[_0x8e76('0x26')](function(){return _0x20e1df;});}else{return _0x20e1df;}})['catch'](function(_0x5d07ab){logger[_0x8e76('0x4e')](_0x8e76('0x4f'),_0x5d07ab);throw _0x5d07ab;});}return _0x20e1df;})[_0x8e76('0x26')](respondWithResult(_0x511ff2,0xc9))[_0x8e76('0x43')](handleError(_0x511ff2,null));};exports['clone']=function(_0x3aa27c,_0x23aa91){var _0x575a={'where':{'id':_0x3aa27c[_0x8e76('0x50')]['id']}},_0x4171ed={};_0x4171ed[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x40')]['rawAttributes']);_0x575a['attributes']=_['intersection'](_0x4171ed[_0x8e76('0x2f')],qs['fields'](_0x3aa27c[_0x8e76('0x30')][_0x8e76('0x34')]));_0x575a[_0x8e76('0x33')]=_0x575a['attributes'][_0x8e76('0x35')]?_0x575a[_0x8e76('0x33')]:_0x4171ed[_0x8e76('0x2f')];if(_0x3aa27c[_0x8e76('0x30')]['includeAll']){_0x575a[_0x8e76('0x42')]=[{'all':!![]}];}_0x575a=_['merge']({},_0x575a,_0x3aa27c[_0x8e76('0x3f')]);return db[_0x8e76('0x40')][_0x8e76('0x46')](_0x575a)[_0x8e76('0x26')](handleEntityNotFound(_0x23aa91,null))[_0x8e76('0x26')](function(_0x24ff99){if(_0x24ff99){var _0x382525=_0x24ff99[_0x8e76('0x27')]({'plain':!![]});_0x382525=qs['omit'](_0x382525,['id',_0x8e76('0x51'),_0x8e76('0x52')]);_0x3aa27c[_0x8e76('0x48')]=_['omit'](_0x3aa27c[_0x8e76('0x48')],['id',_0x8e76('0x51'),'updatedAt']);return db[_0x8e76('0x40')][_0x8e76('0x47')](_[_0x8e76('0x3d')](_0x382525,_0x3aa27c[_0x8e76('0x48')]),{'include':_0x3aa27c['query']['includeAll']?[{'all':!![]}]:undefined})[_0x8e76('0x26')](function(_0x160b60){var _0x1e38a1=_0x3aa27c[_0x8e76('0x53')][_0x8e76('0x27')]({'plain':!![]});if(!_0x1e38a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e38a1['role']==='user'){var _0x56f2d9=_0x160b60['get']({'plain':!![]});var _0x48d953='IvrCampaigns';return db['UserProfileSection'][_0x8e76('0x46')]({'where':{'name':_0x48d953,'userProfileId':_0x1e38a1[_0x8e76('0x54')]},'raw':!![]})[_0x8e76('0x26')](function(_0x5b1a97){if(_0x5b1a97&&_0x5b1a97[_0x8e76('0x4c')]===0x0){return db['UserProfileResource'][_0x8e76('0x47')]({'name':_0x56f2d9[_0x8e76('0x29')],'resourceId':_0x56f2d9['id'],'type':_0x5b1a97['name'],'sectionId':_0x5b1a97['id']},{})[_0x8e76('0x26')](function(){return _0x160b60;});}else{return _0x160b60;}})[_0x8e76('0x43')](function(_0xc312e2){logger[_0x8e76('0x4e')](_0x8e76('0x4f'),_0xc312e2);throw _0xc312e2;});}return _0x160b60;});}})['then'](respondWithResult(_0x23aa91,0xc9))[_0x8e76('0x43')](handleError(_0x23aa91,null));};exports[_0x8e76('0x55')]=function(_0x1eeb7b,_0x28de34){if(_0x1eeb7b[_0x8e76('0x48')]['id']){delete _0x1eeb7b[_0x8e76('0x48')]['id'];}return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x1eeb7b['params']['id']}})['then'](handleEntityNotFound(_0x28de34,null))[_0x8e76('0x26')](saveUpdates(_0x1eeb7b['body'],null))[_0x8e76('0x26')](respondWithResult(_0x28de34,null))['catch'](handleError(_0x28de34,null));};exports[_0x8e76('0x28')]=function(_0x5ee949,_0x2fab8b){return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x5ee949['params']['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x2fab8b,null))[_0x8e76('0x26')](removeEntity(_0x2fab8b,null))['catch'](handleError(_0x2fab8b,null));};exports[_0x8e76('0x56')]=function(_0x5c8fcd,_0x33bcbc,_0x38e2be){var _0x154605={'raw':!![],'where':{}};var _0x213595={};var _0x5f0b68={'count':0x0,'rows':[]};return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x5c8fcd[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x33bcbc,null))[_0x8e76('0x26')](function(_0x558a95){if(_0x558a95){_0x213595[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db['CmHopper']['rawAttributes']);_0x213595[_0x8e76('0x30')]=_[_0x8e76('0x45')](_0x5c8fcd[_0x8e76('0x30')]);_0x213595[_0x8e76('0x31')]=_['intersection'](_0x213595[_0x8e76('0x2f')],_0x213595[_0x8e76('0x30')]);_0x154605[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x213595[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x5c8fcd['query'][_0x8e76('0x34')]));_0x154605['attributes']=_0x154605[_0x8e76('0x33')][_0x8e76('0x35')]?_0x154605['attributes']:_0x213595[_0x8e76('0x2f')];if(!_0x5c8fcd['query'][_0x8e76('0x36')]('nolimit')){_0x154605[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x1f')]);_0x154605[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x5c8fcd[_0x8e76('0x30')]['offset']);}_0x154605[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x39')]);_0x154605['where']=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x5c8fcd[_0x8e76('0x30')],_0x213595['filters']));_0x154605[_0x8e76('0x3a')][_0x8e76('0x58')]=_0x558a95['id'];if(_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x154605[_0x8e76('0x3a')]=_[_0x8e76('0x3d')](_0x154605[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x154605[_0x8e76('0x33')],function(_0x3e0276){var _0x7f2666={};_0x7f2666[_0x3e0276]={'$like':'%'+_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x7f2666;})});}_0x154605=_[_0x8e76('0x3d')]({},_0x154605,_0x5c8fcd[_0x8e76('0x3f')]);return db[_0x8e76('0x59')]['count']({'where':_0x154605[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x4be46a){_0x5f0b68['count']=_0x4be46a;if(_0x5c8fcd[_0x8e76('0x30')][_0x8e76('0x41')]){_0x154605['include']=[{'all':!![]}];}return db[_0x8e76('0x59')][_0x8e76('0x5a')](_0x154605);})[_0x8e76('0x26')](function(_0x9e48c0){_0x5f0b68[_0x8e76('0x5b')]=_0x9e48c0;return _0x5f0b68;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x33bcbc,_0x154605))[_0x8e76('0x43')](handleError(_0x33bcbc,null));};exports[_0x8e76('0x5c')]=function(_0x56f5b0,_0x37c411,_0x435f87){var _0x4b268a={'raw':!![],'where':{}};var _0x2ae6fb={};var _0xe91b5d={'count':0x0,'rows':[]};return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x56f5b0[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x37c411,null))[_0x8e76('0x26')](function(_0x1b14cd){if(_0x1b14cd){_0x2ae6fb[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x5d')]['rawAttributes']);_0x2ae6fb[_0x8e76('0x30')]=_['keys'](_0x56f5b0[_0x8e76('0x30')]);_0x2ae6fb[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0x2ae6fb[_0x8e76('0x2f')],_0x2ae6fb[_0x8e76('0x30')]);_0x4b268a[_0x8e76('0x33')]=_[_0x8e76('0x32')](_0x2ae6fb[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x34')]));_0x4b268a[_0x8e76('0x33')]=_0x4b268a[_0x8e76('0x33')][_0x8e76('0x35')]?_0x4b268a[_0x8e76('0x33')]:_0x2ae6fb[_0x8e76('0x2f')];if(!_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x36')](_0x8e76('0x37'))){_0x4b268a[_0x8e76('0x1f')]=qs['limit'](_0x56f5b0[_0x8e76('0x30')]['limit']);_0x4b268a[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x21')]);}_0x4b268a[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x39')]);_0x4b268a[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x56f5b0[_0x8e76('0x30')],_0x2ae6fb[_0x8e76('0x31')]));_0x4b268a[_0x8e76('0x3a')]['CampaignId']=_0x1b14cd['id'];if(_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x4b268a['where']=_[_0x8e76('0x3d')](_0x4b268a[_0x8e76('0x3a')],{'$or':_['map'](_0x4b268a[_0x8e76('0x33')],function(_0x35359d){var _0x3daf2d={};_0x3daf2d[_0x35359d]={'$like':'%'+_0x56f5b0['query'][_0x8e76('0x3c')]+'%'};return _0x3daf2d;})});}_0x4b268a=_[_0x8e76('0x3d')]({},_0x4b268a,_0x56f5b0[_0x8e76('0x3f')]);return db[_0x8e76('0x5d')][_0x8e76('0x20')]({'where':_0x4b268a[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x2ea8fe){_0xe91b5d[_0x8e76('0x20')]=_0x2ea8fe;if(_0x56f5b0[_0x8e76('0x30')][_0x8e76('0x41')]){_0x4b268a[_0x8e76('0x42')]=[{'all':!![]}];}return db[_0x8e76('0x5d')]['findAll'](_0x4b268a);})[_0x8e76('0x26')](function(_0x5cca97){_0xe91b5d['rows']=_0x5cca97;return _0xe91b5d;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x37c411,_0x4b268a))[_0x8e76('0x43')](handleError(_0x37c411,null));};exports[_0x8e76('0x5e')]=function(_0x297609,_0x17eb20,_0x2ffc68){var _0x43bb46={'raw':!![],'where':{}};var _0xb305a={};var _0x2cc50c={'count':0x0,'rows':[]};return db[_0x8e76('0x40')]['findOne']({'where':{'id':_0x297609['params']['id']}})['then'](handleEntityNotFound(_0x17eb20,null))['then'](function(_0xd27f82){if(_0xd27f82){_0xb305a['model']=_[_0x8e76('0x45')](db[_0x8e76('0x5f')][_0x8e76('0x2c')]);_0xb305a[_0x8e76('0x30')]=_[_0x8e76('0x45')](_0x297609[_0x8e76('0x30')]);_0xb305a[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0xb305a['model'],_0xb305a[_0x8e76('0x30')]);_0x43bb46[_0x8e76('0x33')]=_['intersection'](_0xb305a['model'],qs['fields'](_0x297609[_0x8e76('0x30')]['fields']));_0x43bb46[_0x8e76('0x33')]=_0x43bb46['attributes']['length']?_0x43bb46['attributes']:_0xb305a['model'];if(!_0x297609['query'][_0x8e76('0x36')]('nolimit')){_0x43bb46['limit']=qs['limit'](_0x297609[_0x8e76('0x30')][_0x8e76('0x1f')]);_0x43bb46[_0x8e76('0x21')]=qs[_0x8e76('0x21')](_0x297609[_0x8e76('0x30')]['offset']);}_0x43bb46['order']=qs['sort'](_0x297609['query'][_0x8e76('0x39')]);_0x43bb46[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x297609[_0x8e76('0x30')],_0xb305a[_0x8e76('0x31')]));_0x43bb46['where'][_0x8e76('0x58')]=_0xd27f82['id'];if(_0x297609[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x43bb46[_0x8e76('0x3a')]=_['merge'](_0x43bb46[_0x8e76('0x3a')],{'$or':_['map'](_0x43bb46[_0x8e76('0x33')],function(_0x4e5d65){var _0x44f800={};_0x44f800[_0x4e5d65]={'$like':'%'+_0x297609[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x44f800;})});}_0x43bb46=_[_0x8e76('0x3d')]({},_0x43bb46,_0x297609[_0x8e76('0x3f')]);return db[_0x8e76('0x5f')][_0x8e76('0x20')]({'where':_0x43bb46[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x5f5a49){_0x2cc50c[_0x8e76('0x20')]=_0x5f5a49;if(_0x297609['query'][_0x8e76('0x41')]){_0x43bb46['include']=[{'all':!![]}];}return db[_0x8e76('0x5f')][_0x8e76('0x5a')](_0x43bb46);})[_0x8e76('0x26')](function(_0x3c7c32){_0x2cc50c[_0x8e76('0x5b')]=_0x3c7c32;return _0x2cc50c;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x17eb20,_0x43bb46))[_0x8e76('0x43')](handleError(_0x17eb20,null));};exports[_0x8e76('0x60')]=function(_0x240448,_0x208394,_0x14cb82){var _0x30c240={'raw':!![],'where':{}};var _0x99ebbd={};var _0x405051={'count':0x0,'rows':[]};return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x240448['params']['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x208394,null))[_0x8e76('0x26')](function(_0xf93e3a){if(_0xf93e3a){_0x99ebbd[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x61')]['rawAttributes']);_0x99ebbd['query']=_[_0x8e76('0x45')](_0x240448[_0x8e76('0x30')]);_0x99ebbd[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0x99ebbd[_0x8e76('0x2f')],_0x99ebbd['query']);_0x30c240['attributes']=_[_0x8e76('0x32')](_0x99ebbd['model'],qs[_0x8e76('0x34')](_0x240448[_0x8e76('0x30')][_0x8e76('0x34')]));_0x30c240[_0x8e76('0x33')]=_0x30c240[_0x8e76('0x33')][_0x8e76('0x35')]?_0x30c240[_0x8e76('0x33')]:_0x99ebbd[_0x8e76('0x2f')];if(!_0x240448[_0x8e76('0x30')]['hasOwnProperty'](_0x8e76('0x37'))){_0x30c240[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x240448[_0x8e76('0x30')]['limit']);_0x30c240['offset']=qs[_0x8e76('0x21')](_0x240448[_0x8e76('0x30')][_0x8e76('0x21')]);}_0x30c240[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x240448[_0x8e76('0x30')][_0x8e76('0x39')]);_0x30c240['where']=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x240448['query'],_0x99ebbd[_0x8e76('0x31')]));_0x30c240['where'][_0x8e76('0x58')]=_0xf93e3a['id'];if(_0x240448['query'][_0x8e76('0x3c')]){_0x30c240[_0x8e76('0x3a')]=_[_0x8e76('0x3d')](_0x30c240[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x30c240[_0x8e76('0x33')],function(_0x3fb6d1){var _0x3c8fa8={};_0x3c8fa8[_0x3fb6d1]={'$like':'%'+_0x240448[_0x8e76('0x30')][_0x8e76('0x3c')]+'%'};return _0x3c8fa8;})});}_0x30c240=_[_0x8e76('0x3d')]({},_0x30c240,_0x240448['options']);return db['CmHopperBlack']['count']({'where':_0x30c240[_0x8e76('0x3a')]})[_0x8e76('0x26')](function(_0x4b02c1){_0x405051[_0x8e76('0x20')]=_0x4b02c1;if(_0x240448[_0x8e76('0x30')][_0x8e76('0x41')]){_0x30c240[_0x8e76('0x42')]=[{'all':!![]}];}return db[_0x8e76('0x61')]['findAll'](_0x30c240);})[_0x8e76('0x26')](function(_0xe38746){_0x405051[_0x8e76('0x5b')]=_0xe38746;return _0x405051;});}})[_0x8e76('0x26')](respondWithFilteredResult(_0x208394,_0x30c240))[_0x8e76('0x43')](handleError(_0x208394,null));};exports[_0x8e76('0x62')]=function(_0x109a66,_0x6b2d77,_0xf1125c){var _0x44ce4b={};var _0xd54609={};var _0x175188;var _0x2a8010;return db[_0x8e76('0x40')]['findOne']({'where':{'id':_0x109a66[_0x8e76('0x50')]['id']}})['then'](handleEntityNotFound(_0x6b2d77,null))[_0x8e76('0x26')](function(_0x11e55a){if(_0x11e55a){_0x175188=_0x11e55a;_0xd54609[_0x8e76('0x2f')]=_['keys'](db[_0x8e76('0x63')][_0x8e76('0x2c')]);_0xd54609[_0x8e76('0x30')]=_['keys'](_0x109a66[_0x8e76('0x30')]);_0xd54609[_0x8e76('0x31')]=_[_0x8e76('0x32')](_0xd54609[_0x8e76('0x2f')],_0xd54609[_0x8e76('0x30')]);_0x44ce4b[_0x8e76('0x33')]=_['intersection'](_0xd54609[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x109a66[_0x8e76('0x30')][_0x8e76('0x34')]));_0x44ce4b[_0x8e76('0x33')]=_0x44ce4b[_0x8e76('0x33')][_0x8e76('0x35')]?_0x44ce4b[_0x8e76('0x33')]:_0xd54609[_0x8e76('0x2f')];_0x44ce4b[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x109a66[_0x8e76('0x30')][_0x8e76('0x39')]);_0x44ce4b[_0x8e76('0x3a')]=qs[_0x8e76('0x31')](_[_0x8e76('0x3b')](_0x109a66[_0x8e76('0x30')],_0xd54609[_0x8e76('0x31')]));if(_0x109a66[_0x8e76('0x30')][_0x8e76('0x3c')]){_0x44ce4b['where']=_[_0x8e76('0x3d')](_0x44ce4b[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x44ce4b[_0x8e76('0x33')],function(_0x4b3ba){var _0x530c84={};_0x530c84[_0x4b3ba]={'$like':'%'+_0x109a66[_0x8e76('0x30')]['filter']+'%'};return _0x530c84;})});}_0x44ce4b=_[_0x8e76('0x3d')]({},_0x44ce4b,_0x109a66[_0x8e76('0x3f')]);return _0x175188['getLists'](_0x44ce4b);}})[_0x8e76('0x26')](function(_0x286679){if(_0x286679){_0x2a8010=_0x286679[_0x8e76('0x35')];if(!_0x109a66[_0x8e76('0x30')][_0x8e76('0x36')](_0x8e76('0x37'))){_0x44ce4b[_0x8e76('0x1f')]=qs[_0x8e76('0x1f')](_0x109a66['query'][_0x8e76('0x1f')]);_0x44ce4b['offset']=qs['offset'](_0x109a66['query']['offset']);}return _0x175188[_0x8e76('0x62')](_0x44ce4b);}})[_0x8e76('0x26')](function(_0x5806be){if(_0x5806be){return _0x5806be?{'count':_0x2a8010,'rows':_0x5806be}:null;}})['then'](respondWithResult(_0x6b2d77,null))[_0x8e76('0x43')](handleError(_0x6b2d77,null));};exports[_0x8e76('0x64')]=function(_0x5ed91d,_0x205c8e,_0x2c37ca){var _0x222c18,_0x40bb8a;return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x5ed91d[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x205c8e,null))[_0x8e76('0x26')](function(_0x2522ac){if(_0x2522ac){_0x40bb8a=_0x2522ac;return _0x2522ac[_0x8e76('0x64')](_0x5ed91d['body']['ids'],_['omit'](_0x5ed91d[_0x8e76('0x48')],[_0x8e76('0x65'),'id'])||{});}return null;})[_0x8e76('0x66')](function(_0x620ec2){var _0x435374;_0x222c18=_0x620ec2||[];var _0x3a308b=[];if(_0x620ec2){for(var _0x38e042=0x0;_0x38e042<_0x620ec2[_0x8e76('0x35')];_0x38e042+=0x1){var _0x105965=_0x620ec2[_0x38e042][_0x8e76('0x27')]({'plain':!![]});_0x40bb8a[_0x8e76('0x67')]=_0x5ed91d['body'][_0x8e76('0x67')]?_0x5ed91d[_0x8e76('0x48')][_0x8e76('0x67')]:_0x40bb8a[_0x8e76('0x67')];switch(_0x40bb8a[_0x8e76('0x67')]){case _0x8e76('0x68'):_0x435374=squel[_0x8e76('0x69')]()[_0x8e76('0x6a')](_0x8e76('0x6b'))['fromQuery']([_0x8e76('0x6c'),'scheduledAt',_0x8e76('0x6d'),_0x8e76('0x6e'),_0x8e76('0x58'),'createdAt',_0x8e76('0x52')],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x6c'),'phone')['field'](_0x8e76('0x71'),_0x8e76('0x72'))[_0x8e76('0x70')]('id',_0x8e76('0x6d'))['field'](_0x105965[_0x8e76('0x73')][_0x8e76('0x74')](),'ListId')[_0x8e76('0x70')](_0x5ed91d[_0x8e76('0x50')]['id'][_0x8e76('0x74')](),_0x8e76('0x58'))[_0x8e76('0x70')](_0x8e76('0x71'),_0x8e76('0x51'))['field'](_0x8e76('0x71'),'updatedAt')[_0x8e76('0x75')](_0x8e76('0x76'))[_0x8e76('0x3a')](_0x8e76('0x77'))[_0x8e76('0x3a')](_0x8e76('0x78'),_0x105965[_0x8e76('0x73')][_0x8e76('0x74')]())[_0x8e76('0x3a')](_0x8e76('0x79'))[_0x8e76('0x3a')](_0x8e76('0x7a'),squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x7b'))[_0x8e76('0x75')]('cm_hopper_final')[_0x8e76('0x3a')](_0x8e76('0x7c'),_0x5ed91d[_0x8e76('0x50')]['id'][_0x8e76('0x74')]()))['where'](_0x8e76('0x7a'),squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x7d'))[_0x8e76('0x75')](_0x8e76('0x6b'))[_0x8e76('0x3a')](_0x8e76('0x7c'),_0x5ed91d[_0x8e76('0x50')]['id']['toString']())))[_0x8e76('0x74')]();break;case _0x8e76('0x7e'):_0x435374=squel[_0x8e76('0x69')]()[_0x8e76('0x6a')](_0x8e76('0x6b'))[_0x8e76('0x7f')]([_0x8e76('0x6c'),_0x8e76('0x72'),_0x8e76('0x6d'),_0x8e76('0x6e'),'CampaignId',_0x8e76('0x51'),_0x8e76('0x52')],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')]('phone','phone')[_0x8e76('0x70')](_0x8e76('0x71'),'scheduledAt')[_0x8e76('0x70')]('id','ContactId')[_0x8e76('0x70')](_0x105965['CmListId'][_0x8e76('0x74')](),_0x8e76('0x6e'))[_0x8e76('0x70')](_0x5ed91d['params']['id'][_0x8e76('0x74')](),_0x8e76('0x58'))[_0x8e76('0x70')]('NOW()',_0x8e76('0x51'))[_0x8e76('0x70')]('NOW()',_0x8e76('0x52'))[_0x8e76('0x75')](_0x8e76('0x76'))[_0x8e76('0x3a')](_0x8e76('0x77'))[_0x8e76('0x3a')]('ListId\x20=\x20?',_0x105965[_0x8e76('0x73')][_0x8e76('0x74')]())[_0x8e76('0x3a')](_0x8e76('0x79'))[_0x8e76('0x3a')](_0x8e76('0x7a'),squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x7d'))[_0x8e76('0x75')](_0x8e76('0x6b'))[_0x8e76('0x3a')]('CampaignId\x20=\x20?',_0x5ed91d['params']['id'][_0x8e76('0x74')]())))[_0x8e76('0x74')]();break;default:_0x435374=squel['insert']()[_0x8e76('0x6a')]('cm_hopper')['fromQuery']([_0x8e76('0x6c'),_0x8e76('0x72'),_0x8e76('0x6d'),_0x8e76('0x6e'),_0x8e76('0x58'),_0x8e76('0x51'),'updatedAt'],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x6c'),_0x8e76('0x6c'))['field'](_0x8e76('0x71'),_0x8e76('0x72'))['field']('id',_0x8e76('0x6d'))['field'](_0x105965[_0x8e76('0x73')][_0x8e76('0x74')](),'ListId')[_0x8e76('0x70')](_0x5ed91d['params']['id']['toString'](),_0x8e76('0x58'))[_0x8e76('0x70')](_0x8e76('0x71'),_0x8e76('0x51'))[_0x8e76('0x70')](_0x8e76('0x71'),_0x8e76('0x52'))[_0x8e76('0x75')]('cm_contacts')[_0x8e76('0x3a')](_0x8e76('0x77'))[_0x8e76('0x3a')](_0x8e76('0x78'),_0x105965['CmListId'][_0x8e76('0x74')]())[_0x8e76('0x3a')](_0x8e76('0x79')))[_0x8e76('0x74')]();}_0x3a308b[_0x8e76('0x80')](db[_0x8e76('0x81')][_0x8e76('0x30')](_0x435374));}return BPromise['all'](_0x3a308b);}})[_0x8e76('0x26')](function(){return _0x222c18;})['then'](respondWithResult(_0x205c8e,null))[_0x8e76('0x43')](handleError(_0x205c8e,null));};exports['removeLists']=function(_0x1f0f8b,_0x47c365,_0x30abce){return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x1f0f8b[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x47c365,null))[_0x8e76('0x26')](function(_0xe29548){if(_0xe29548){return _0xe29548['removeLists'](_0x1f0f8b[_0x8e76('0x30')][_0x8e76('0x65')]);}})['then'](function(_0x5ab76d){if(_0x5ab76d){return db['CmHopper']['destroy']({'where':{'ListId':_0x1f0f8b[_0x8e76('0x30')][_0x8e76('0x65')],'CampaignId':_0x1f0f8b[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](function(){return _0x5ab76d;});}})[_0x8e76('0x26')](respondWithStatusCode(_0x47c365,null))[_0x8e76('0x43')](handleError(_0x47c365,null));};exports[_0x8e76('0x82')]=function(_0x24d7f3,_0x180aaa,_0x41bec1){var _0x5cb487={};var _0x7e84ee={};var _0x40e2e3;var _0x4afe55;return db[_0x8e76('0x40')][_0x8e76('0x57')]({'where':{'id':_0x24d7f3[_0x8e76('0x50')]['id']}})['then'](handleEntityNotFound(_0x180aaa,null))[_0x8e76('0x26')](function(_0x24144b){if(_0x24144b){_0x40e2e3=_0x24144b;_0x7e84ee[_0x8e76('0x2f')]=_[_0x8e76('0x45')](db[_0x8e76('0x63')][_0x8e76('0x2c')]);_0x7e84ee[_0x8e76('0x30')]=_[_0x8e76('0x45')](_0x24d7f3['query']);_0x7e84ee[_0x8e76('0x31')]=_['intersection'](_0x7e84ee[_0x8e76('0x2f')],_0x7e84ee[_0x8e76('0x30')]);_0x5cb487['attributes']=_[_0x8e76('0x32')](_0x7e84ee[_0x8e76('0x2f')],qs[_0x8e76('0x34')](_0x24d7f3['query']['fields']));_0x5cb487[_0x8e76('0x33')]=_0x5cb487['attributes'][_0x8e76('0x35')]?_0x5cb487['attributes']:_0x7e84ee['model'];_0x5cb487[_0x8e76('0x38')]=qs[_0x8e76('0x39')](_0x24d7f3[_0x8e76('0x30')][_0x8e76('0x39')]);_0x5cb487[_0x8e76('0x3a')]=qs['filters'](_['pick'](_0x24d7f3[_0x8e76('0x30')],_0x7e84ee[_0x8e76('0x31')]));if(_0x24d7f3['query'][_0x8e76('0x3c')]){_0x5cb487['where']=_[_0x8e76('0x3d')](_0x5cb487[_0x8e76('0x3a')],{'$or':_[_0x8e76('0x2b')](_0x5cb487[_0x8e76('0x33')],function(_0xad1c4b){var _0x1dc6ed={};_0x1dc6ed[_0xad1c4b]={'$like':'%'+_0x24d7f3['query']['filter']+'%'};return _0x1dc6ed;})});}_0x5cb487=_[_0x8e76('0x3d')]({},_0x5cb487,_0x24d7f3[_0x8e76('0x3f')]);return _0x40e2e3[_0x8e76('0x82')](_0x5cb487);}})[_0x8e76('0x26')](function(_0x48d497){if(_0x48d497){_0x4afe55=_0x48d497[_0x8e76('0x35')];if(!_0x24d7f3[_0x8e76('0x30')]['hasOwnProperty'](_0x8e76('0x37'))){_0x5cb487[_0x8e76('0x1f')]=qs['limit'](_0x24d7f3[_0x8e76('0x30')]['limit']);_0x5cb487[_0x8e76('0x21')]=qs['offset'](_0x24d7f3[_0x8e76('0x30')]['offset']);}return _0x40e2e3['getBlackLists'](_0x5cb487);}})[_0x8e76('0x26')](function(_0x27a4da){if(_0x27a4da){return _0x27a4da?{'count':_0x4afe55,'rows':_0x27a4da}:null;}})[_0x8e76('0x26')](respondWithResult(_0x180aaa,null))[_0x8e76('0x43')](handleError(_0x180aaa,null));};exports['addBlackLists']=function(_0xe01e77,_0x133f80,_0x5b8b0c){var _0x3d5610,_0x38f082;return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0xe01e77[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x133f80,null))[_0x8e76('0x26')](function(_0x5952df){if(_0x5952df){_0x38f082=_0x5952df;return _0x5952df[_0x8e76('0x83')](_0xe01e77[_0x8e76('0x48')]['ids'],_[_0x8e76('0x84')](_0xe01e77['body'],[_0x8e76('0x65'),'id'])||{});}return null;})[_0x8e76('0x66')](function(_0xe8839e){var _0x16cb93;_0x3d5610=_0xe8839e||[];var _0x169dbe=[];if(_0xe8839e){for(var _0x5db63e=0x0;_0x5db63e<_0xe8839e[_0x8e76('0x35')];_0x5db63e+=0x1){var _0x2a1386=_0xe8839e[_0x5db63e]['get']({'plain':!![]});_0x16cb93=squel['insert']()[_0x8e76('0x6a')]('cm_hopper_black')[_0x8e76('0x7f')](['phone',_0x8e76('0x6d'),'ListId',_0x8e76('0x58'),_0x8e76('0x51'),_0x8e76('0x52')],squel[_0x8e76('0x6f')]()[_0x8e76('0x70')](_0x8e76('0x6c'),_0x8e76('0x6c'))['field']('id',_0x8e76('0x6d'))[_0x8e76('0x70')](_0x2a1386['CmListId']['toString'](),'ListId')['field'](_0xe01e77[_0x8e76('0x50')]['id'][_0x8e76('0x74')](),_0x8e76('0x58'))[_0x8e76('0x70')](_0x8e76('0x71'),'createdAt')[_0x8e76('0x70')]('NOW()',_0x8e76('0x52'))[_0x8e76('0x75')]('cm_contacts')[_0x8e76('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x8e76('0x78'),_0x2a1386[_0x8e76('0x73')]['toString']())[_0x8e76('0x3a')](_0x8e76('0x79')))[_0x8e76('0x74')]();_0x169dbe['push'](db[_0x8e76('0x81')]['query'](_0x16cb93));}return BPromise[_0x8e76('0x85')](_0x169dbe);}})[_0x8e76('0x26')](function(){return _0x3d5610;})['then'](respondWithResult(_0x133f80,null))[_0x8e76('0x43')](handleError(_0x133f80,null));};exports['removeBlackLists']=function(_0x230421,_0x4fc4a8,_0xe6b6bd){return db[_0x8e76('0x40')][_0x8e76('0x46')]({'where':{'id':_0x230421[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](handleEntityNotFound(_0x4fc4a8,null))['then'](function(_0x7c276f){if(_0x7c276f){return _0x7c276f[_0x8e76('0x86')](_0x230421['query'][_0x8e76('0x65')]);}})[_0x8e76('0x26')](function(_0x5ee8f4){if(_0x5ee8f4){return db[_0x8e76('0x61')]['destroy']({'where':{'ListId':_0x230421[_0x8e76('0x30')][_0x8e76('0x65')],'CampaignId':_0x230421[_0x8e76('0x50')]['id']}})[_0x8e76('0x26')](function(){return _0x5ee8f4;});}})['then'](respondWithStatusCode(_0x4fc4a8,null))[_0x8e76('0x43')](handleError(_0x4fc4a8,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 9d6f67c..580445e 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x226aea,_0x78e3ed){var _0x229e93=function(_0x2166a9){while(--_0x2166a9){_0x226aea['push'](_0x226aea['shift']());}};_0x229e93(++_0x78e3ed);}(_0x7a54,0x106));var _0x47a5=function(_0x4d2ce4,_0x25c284){_0x4d2ce4=_0x4d2ce4-0x0;var _0x18dc04=_0x7a54[_0x4d2ce4];return _0x18dc04;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x21712c,_0x2dedd8){var _0x3bcfda=function(_0x4c1803){while(--_0x4c1803){_0x21712c['push'](_0x21712c['shift']());}};_0x3bcfda(++_0x2dedd8);}(_0x7a54,0x106));var _0x47a5=function(_0x358a36,_0x4ac4aa){_0x358a36=_0x358a36-0x0;var _0x87f289=_0x7a54[_0x358a36];return _0x87f289;};'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 eb700c7..1db4dd2 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 _0x3ef0=['Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','include','map','model','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info'];(function(_0x2433e0,_0x2db0de){var _0x36cfff=function(_0x52a747){while(--_0x52a747){_0x2433e0['push'](_0x2433e0['shift']());}};_0x36cfff(++_0x2db0de);}(_0x3ef0,0x19a));var _0x03ef=function(_0x164e31,_0x470195){_0x164e31=_0x164e31-0x0;var _0x1d2ad2=_0x3ef0[_0x164e31];return _0x1d2ad2;};'use strict';var _=require(_0x03ef('0x0'));var util=require('util');var moment=require(_0x03ef('0x1'));var BPromise=require('bluebird');var rs=require(_0x03ef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03ef('0x3'))['db'];var utils=require(_0x03ef('0x4'));var logger=require(_0x03ef('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x03ef('0x6'));var client=jayson[_0x03ef('0x7')][_0x03ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47e561,_0x357971,_0x3c06ee){return new BPromise(function(_0x2d54e7,_0x61669){return client['request'](_0x47e561,_0x3c06ee)['then'](function(_0x399e94){logger[_0x03ef('0x9')](_0x03ef('0xa'),_0x357971,'request\x20sent');logger[_0x03ef('0xb')](_0x03ef('0xc'),_0x357971,'request\x20sent',JSON[_0x03ef('0xd')](_0x399e94));if(_0x399e94[_0x03ef('0xe')]){if(_0x399e94[_0x03ef('0xe')]['code']===0x1f4){logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x357971,_0x399e94[_0x03ef('0xe')][_0x03ef('0xf')]);return _0x61669(_0x399e94[_0x03ef('0xe')][_0x03ef('0xf')]);}logger[_0x03ef('0xe')](_0x03ef('0xa'),_0x357971,_0x399e94[_0x03ef('0xe')][_0x03ef('0xf')]);return _0x2d54e7(_0x399e94[_0x03ef('0xe')]['message']);}else{logger['info'](_0x03ef('0xa'),_0x357971,_0x03ef('0x10'));_0x2d54e7(_0x399e94[_0x03ef('0x11')][_0x03ef('0xf')]);}})[_0x03ef('0x12')](function(_0x590152){logger['error'](_0x03ef('0xa'),_0x357971,_0x590152);_0x61669(_0x590152);});});}exports[_0x03ef('0x13')]=function(_0x501d87){var _0x4a4e96=this;return new Promise(function(_0x277f0d,_0xa3ba09){return db[_0x03ef('0x14')][_0x03ef('0x15')]({'raw':_0x501d87[_0x03ef('0x16')]?_0x501d87['options'][_0x03ef('0x17')]===undefined?!![]:![]:!![],'where':_0x501d87[_0x03ef('0x16')]?_0x501d87['options'][_0x03ef('0x18')]||null:null,'attributes':_0x501d87[_0x03ef('0x16')]?_0x501d87[_0x03ef('0x16')][_0x03ef('0x19')]||null:null,'limit':_0x501d87[_0x03ef('0x16')]?_0x501d87['options']['limit']||null:null,'include':_0x501d87[_0x03ef('0x16')]?_0x501d87[_0x03ef('0x16')][_0x03ef('0x1a')]?_['map'](_0x501d87['options'][_0x03ef('0x1a')],function(_0x27ac0d){return{'model':db[_0x27ac0d['model']],'as':_0x27ac0d['as'],'attributes':_0x27ac0d['attributes'],'include':_0x27ac0d[_0x03ef('0x1a')]?_[_0x03ef('0x1b')](_0x27ac0d['include'],function(_0x305829){return{'model':db[_0x305829[_0x03ef('0x1c')]],'as':_0x305829['as'],'attributes':_0x305829[_0x03ef('0x19')],'include':_0x305829['include']?_[_0x03ef('0x1b')](_0x305829[_0x03ef('0x1a')],function(_0x31fd6f){return{'model':db[_0x31fd6f[_0x03ef('0x1c')]],'as':_0x31fd6f['as'],'attributes':_0x31fd6f[_0x03ef('0x19')]};}):[]};}):[]};}):[]:[]})[_0x03ef('0x1d')](function(_0x538a5d){logger['info'](_0x03ef('0x13'),_0x501d87);logger['debug'](_0x03ef('0x13'),_0x501d87,JSON[_0x03ef('0xd')](_0x538a5d));_0x277f0d(_0x538a5d);})[_0x03ef('0x12')](function(_0x4d9e6a){logger[_0x03ef('0xe')](_0x03ef('0x13'),_0x4d9e6a[_0x03ef('0xf')],_0x501d87);_0xa3ba09(_0x4a4e96[_0x03ef('0xe')](0x1f4,_0x4d9e6a['message']));});});};
\ No newline at end of file
+var _0xf430=['limit','include','model','map','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xf430,0x1e4));var _0x0f43=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0xf430[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x0f43('0x0'));var util=require(_0x0f43('0x1'));var moment=require(_0x0f43('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f43('0x3'));var fs=require('fs');var Redis=require(_0x0f43('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0f43('0x5'))(_0x0f43('0x6'));var config=require(_0x0f43('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0f43('0x8')][_0x0f43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x490bc1,_0x562cf2,_0x2e8f68){return new BPromise(function(_0x39bc4c,_0x18e735){return client['request'](_0x490bc1,_0x2e8f68)[_0x0f43('0xa')](function(_0x59508b){logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');logger['debug'](_0x0f43('0xd'),_0x562cf2,_0x0f43('0xe'),JSON[_0x0f43('0xf')](_0x59508b));if(_0x59508b[_0x0f43('0x10')]){if(_0x59508b[_0x0f43('0x10')]['code']===0x1f4){logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x18e735(_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);}logger[_0x0f43('0x10')](_0x0f43('0xc'),_0x562cf2,_0x59508b[_0x0f43('0x10')][_0x0f43('0x11')]);return _0x39bc4c(_0x59508b[_0x0f43('0x10')]['message']);}else{logger[_0x0f43('0xb')](_0x0f43('0xc'),_0x562cf2,'request\x20sent');_0x39bc4c(_0x59508b[_0x0f43('0x12')][_0x0f43('0x11')]);}})[_0x0f43('0x13')](function(_0x5631e1){logger[_0x0f43('0x10')]('Campaign,\x20%s,\x20%s',_0x562cf2,_0x5631e1);_0x18e735(_0x5631e1);});});}exports[_0x0f43('0x14')]=function(_0x5617c3){var _0x4e294b=this;return new Promise(function(_0x3e25fa,_0x5a7351){return db[_0x0f43('0x15')]['findAll']({'raw':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x17')]===undefined?!![]:![]:!![],'where':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x18')]||null:null,'attributes':_0x5617c3['options']?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x19')]||null:null,'limit':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x1a')]||null:null,'include':_0x5617c3[_0x0f43('0x16')]?_0x5617c3[_0x0f43('0x16')][_0x0f43('0x1b')]?_['map'](_0x5617c3['options'][_0x0f43('0x1b')],function(_0x5c4b61){return{'model':db[_0x5c4b61[_0x0f43('0x1c')]],'as':_0x5c4b61['as'],'attributes':_0x5c4b61[_0x0f43('0x19')],'include':_0x5c4b61[_0x0f43('0x1b')]?_[_0x0f43('0x1d')](_0x5c4b61['include'],function(_0x227f03){return{'model':db[_0x227f03[_0x0f43('0x1c')]],'as':_0x227f03['as'],'attributes':_0x227f03[_0x0f43('0x19')],'include':_0x227f03['include']?_['map'](_0x227f03['include'],function(_0x489fe5){return{'model':db[_0x489fe5[_0x0f43('0x1c')]],'as':_0x489fe5['as'],'attributes':_0x489fe5[_0x0f43('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0f43('0xa')](function(_0x1494e4){logger[_0x0f43('0xb')](_0x0f43('0x14'),_0x5617c3);logger['debug'](_0x0f43('0x14'),_0x5617c3,JSON[_0x0f43('0xf')](_0x1494e4));_0x3e25fa(_0x1494e4);})[_0x0f43('0x13')](function(_0x29e89f){logger[_0x0f43('0x10')]('GetCampaign',_0x29e89f[_0x0f43('0x11')],_0x5617c3);_0x5a7351(_0x4e294b[_0x0f43('0x10')](0x1f4,_0x29e89f[_0x0f43('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 130e373..f6bf451 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 _0x0fea=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','addLists','put','update','delete','destroy','removeBlackLists','exports','multer','util','path','connect-timeout'];(function(_0x26b622,_0x237e9e){var _0x58a028=function(_0xde1652){while(--_0xde1652){_0x26b622['push'](_0x26b622['shift']());}};_0x58a028(++_0x237e9e);}(_0x0fea,0x80));var _0xa0fe=function(_0x53a456,_0x1c3d73){_0x53a456=_0x53a456-0x0;var _0x19bf77=_0x0fea[_0x53a456];return _0x19bf77;};'use strict';var multer=require(_0xa0fe('0x0'));var util=require(_0xa0fe('0x1'));var path=require(_0xa0fe('0x2'));var timeout=require(_0xa0fe('0x3'));var express=require(_0xa0fe('0x4'));var router=express[_0xa0fe('0x5')]();var fs_extra=require(_0xa0fe('0x6'));var auth=require(_0xa0fe('0x7'));var interaction=require(_0xa0fe('0x8'));var config=require(_0xa0fe('0x9'));var controller=require(_0xa0fe('0xa'));router['get']('/',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0xc')]);router[_0xa0fe('0xd')](_0xa0fe('0xe'),auth['isAuthenticated'](),controller[_0xa0fe('0xf')]);router[_0xa0fe('0xd')](_0xa0fe('0x10'),auth['isAuthenticated'](),controller[_0xa0fe('0x11')]);router[_0xa0fe('0xd')](_0xa0fe('0x12'),auth[_0xa0fe('0xb')](),controller['getHopperHistories']);router[_0xa0fe('0xd')]('/:id/hopper_finals',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x13')]);router[_0xa0fe('0xd')](_0xa0fe('0x14'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xa0fe('0xd')](_0xa0fe('0x15'),auth[_0xa0fe('0xb')](),controller['getLists']);router[_0xa0fe('0xd')](_0xa0fe('0x16'),auth['isAuthenticated'](),controller[_0xa0fe('0x17')]);router[_0xa0fe('0x18')]('/',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x19')]);router[_0xa0fe('0x18')]('/:id/clone',auth[_0xa0fe('0xb')](),controller['clone']);router['post']('/:id/lists',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x1a')]);router[_0xa0fe('0x18')]('/:id/blacklists',auth[_0xa0fe('0xb')](),controller['addBlackLists']);router[_0xa0fe('0x1b')]('/:id',auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x1c')]);router[_0xa0fe('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xa0fe('0x1e')]);router[_0xa0fe('0x1d')](_0xa0fe('0x15'),auth[_0xa0fe('0xb')](),controller['removeLists']);router[_0xa0fe('0x1d')](_0xa0fe('0x16'),auth[_0xa0fe('0xb')](),controller[_0xa0fe('0x1f')]);module[_0xa0fe('0x20')]=router;
\ No newline at end of file
+var _0xe3e0=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/blacklists','create','post','clone','/:id/lists','addLists','put','/:id','delete','removeLists','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','index','show','isAuthenticated','/:id/hopper_histories'];(function(_0xaa0be9,_0x4506b4){var _0x4e0a8b=function(_0x150b48){while(--_0x150b48){_0xaa0be9['push'](_0xaa0be9['shift']());}};_0x4e0a8b(++_0x4506b4);}(_0xe3e0,0x188));var _0x0e3e=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0xe3e0[_0x1bd323];return _0x13097b;};'use strict';var multer=require('multer');var util=require(_0x0e3e('0x0'));var path=require(_0x0e3e('0x1'));var timeout=require(_0x0e3e('0x2'));var express=require(_0x0e3e('0x3'));var router=express['Router']();var fs_extra=require(_0x0e3e('0x4'));var auth=require(_0x0e3e('0x5'));var interaction=require(_0x0e3e('0x6'));var config=require(_0x0e3e('0x7'));var controller=require(_0x0e3e('0x8'));router[_0x0e3e('0x9')]('/',auth['isAuthenticated'](),controller[_0x0e3e('0xa')]);router[_0x0e3e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0e3e('0xb')]);router[_0x0e3e('0x9')]('/:id/hoppers',auth[_0x0e3e('0xc')](),controller['getHoppers']);router[_0x0e3e('0x9')](_0x0e3e('0xd'),auth['isAuthenticated'](),controller[_0x0e3e('0xe')]);router[_0x0e3e('0x9')](_0x0e3e('0xf'),auth['isAuthenticated'](),controller[_0x0e3e('0x10')]);router[_0x0e3e('0x9')](_0x0e3e('0x11'),auth[_0x0e3e('0xc')](),controller['getHopperBlacks']);router[_0x0e3e('0x9')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x0e3e('0x9')](_0x0e3e('0x12'),auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0x0e3e('0xc')](),controller[_0x0e3e('0x13')]);router[_0x0e3e('0x14')]('/:id/clone',auth[_0x0e3e('0xc')](),controller[_0x0e3e('0x15')]);router[_0x0e3e('0x14')](_0x0e3e('0x16'),auth[_0x0e3e('0xc')](),controller[_0x0e3e('0x17')]);router[_0x0e3e('0x14')](_0x0e3e('0x12'),auth[_0x0e3e('0xc')](),controller['addBlackLists']);router[_0x0e3e('0x18')](_0x0e3e('0x19'),auth[_0x0e3e('0xc')](),controller['update']);router[_0x0e3e('0x1a')](_0x0e3e('0x19'),auth[_0x0e3e('0xc')](),controller['destroy']);router[_0x0e3e('0x1a')]('/:id/lists',auth['isAuthenticated'](),controller[_0x0e3e('0x1b')]);router[_0x0e3e('0x1a')](_0x0e3e('0x12'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x0e3e('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 88ef8e5..4af9a78 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 _0x18f0=['getDataValue','key','STRING','TEXT','VIRTUAL'];(function(_0x237b6a,_0x2ebc92){var _0x93c494=function(_0x4c3f50){while(--_0x4c3f50){_0x237b6a['push'](_0x237b6a['shift']());}};_0x93c494(++_0x2ebc92);}(_0x18f0,0x1d8));var _0x018f=function(_0x1c72ac,_0x380a0e){_0x1c72ac=_0x1c72ac-0x0;var _0x274e46=_0x18f0[_0x1c72ac];return _0x274e46;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x018f('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x018f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x018f('0x0')]},'name':{'type':Sequelize[_0x018f('0x2')],'get':function(){return this[_0x018f('0x3')](_0x018f('0x4'));}}};
\ No newline at end of file
+var _0x0f64=['key','sequelize','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x229383,_0x1408a7){var _0x2eec0=function(_0x360d7e){while(--_0x360d7e){_0x229383['push'](_0x229383['shift']());}};_0x2eec0(++_0x1408a7);}(_0x0f64,0xc1));var _0x40f6=function(_0x2abd90,_0x5178b3){_0x2abd90=_0x2abd90-0x0;var _0x587278=_0x0f64[_0x2abd90];return _0x587278;};'use strict';var Sequelize=require(_0x40f6('0x0'));module['exports']={'key':{'type':Sequelize[_0x40f6('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x40f6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x40f6('0x1')]},'name':{'type':Sequelize[_0x40f6('0x3')],'get':function(){return this[_0x40f6('0x4')](_0x40f6('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index dda30c7..287fd4a 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 _0x4089=['Content-Range','json','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','index','CannedAnswer','rawAttributes','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4089,0x138));var _0x9408=function(_0x29baf6,_0x44f0e0){_0x29baf6=_0x29baf6-0x0;var _0x29e760=_0x4089[_0x29baf6];return _0x29e760;};'use strict';var emlformat=require(_0x9408('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9408('0x1'));var jsonpatch=require(_0x9408('0x2'));var rp=require('request-promise');var moment=require(_0x9408('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9408('0x4'));var util=require('util');var path=require(_0x9408('0x5'));var sox=require(_0x9408('0x6'));var csv=require(_0x9408('0x7'));var ejs=require(_0x9408('0x8'));var fs=require('fs');var fs_extra=require(_0x9408('0x9'));var _=require(_0x9408('0xa'));var squel=require(_0x9408('0xb'));var crypto=require('crypto');var jsforce=require(_0x9408('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9408('0x7'));var querystring=require(_0x9408('0xd'));var Papa=require(_0x9408('0xe'));var Redis=require(_0x9408('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9408('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9408('0x11'))('api');var utils=require(_0x9408('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9408('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa75044,_0x4d8876){_0x4d8876=_0x4d8876||0xcc;return function(_0x334686){if(_0x334686){return _0xa75044[_0x9408('0x14')](_0x4d8876);}return _0xa75044[_0x9408('0x15')](_0x4d8876)[_0x9408('0x16')]();};}function respondWithResult(_0x234c97,_0x292984){_0x292984=_0x292984||0xc8;return function(_0x590d6b){if(_0x590d6b){return _0x234c97['status'](_0x292984)['json'](_0x590d6b);}};}function respondWithFilteredResult(_0x1f1160,_0x526718){return function(_0x12c4c5){if(_0x12c4c5){var _0x455adf=typeof _0x526718[_0x9408('0x17')]===_0x9408('0x18')&&typeof _0x526718[_0x9408('0x19')]==='undefined';var _0x3b66f7=_0x12c4c5[_0x9408('0x1a')];var _0x244978=_0x455adf?0x0:_0x526718['offset'];var _0x46261f=_0x455adf?_0x12c4c5[_0x9408('0x1a')]:_0x526718[_0x9408('0x17')]+_0x526718[_0x9408('0x19')];var _0x20cad4;if(_0x46261f>=_0x3b66f7){_0x46261f=_0x3b66f7;_0x20cad4=0xc8;}else{_0x20cad4=0xce;}_0x1f1160[_0x9408('0x15')](_0x20cad4);return _0x1f1160[_0x9408('0x1b')](_0x9408('0x1c'),_0x244978+'-'+_0x46261f+'/'+_0x3b66f7)[_0x9408('0x1d')](_0x12c4c5);}return null;};}function patchUpdates(_0x360778){return function(_0x3192e9){try{jsonpatch[_0x9408('0x1e')](_0x3192e9,_0x360778,!![]);}catch(_0x4ea92b){return BPromise['reject'](_0x4ea92b);}return _0x3192e9[_0x9408('0x1f')]();};}function saveUpdates(_0xdf8323,_0x54746b){return function(_0x15fca7){if(_0x15fca7){return _0x15fca7[_0x9408('0x20')](_0xdf8323)[_0x9408('0x21')](function(_0x2a8bbb){return _0x2a8bbb;});}return null;};}function removeEntity(_0x5e662c,_0x20faf3){return function(_0x3be715){if(_0x3be715){return _0x3be715[_0x9408('0x22')]()[_0x9408('0x21')](function(){var _0x976859=_0x3be715[_0x9408('0x23')]({'plain':!![]});var _0x34e98a=_0x9408('0x24');return db[_0x9408('0x25')]['destroy']({'where':{'type':_0x34e98a,'resourceId':_0x976859['id']}})[_0x9408('0x21')](function(){return _0x3be715;});})[_0x9408('0x21')](function(){_0x5e662c[_0x9408('0x15')](0xcc)[_0x9408('0x16')]();});}};}function handleEntityNotFound(_0x469e60,_0x3fde40){return function(_0x491bbb){if(!_0x491bbb){_0x469e60[_0x9408('0x14')](0x194);}return _0x491bbb;};}function handleError(_0x1fb27c,_0x3a5213){_0x3a5213=_0x3a5213||0x1f4;return function(_0x30bef){logger[_0x9408('0x26')](_0x30bef[_0x9408('0x27')]);if(_0x30bef['name']){delete _0x30bef['name'];}_0x1fb27c[_0x9408('0x15')](_0x3a5213)['send'](_0x30bef);};}exports[_0x9408('0x28')]=function(_0x53f933,_0xda58d){var _0x528695={},_0x54b88f={},_0x1ec335={'count':0x0,'rows':[]};var _0x4b6e34=_['map'](db[_0x9408('0x29')][_0x9408('0x2a')],function(_0x20368b){return{'name':_0x20368b['fieldName'],'type':_0x20368b[_0x9408('0x2b')]['key']};});_0x54b88f[_0x9408('0x2c')]=_[_0x9408('0x2d')](_0x4b6e34,_0x9408('0x2e'));_0x54b88f[_0x9408('0x2f')]=_[_0x9408('0x30')](_0x53f933[_0x9408('0x2f')]);_0x54b88f[_0x9408('0x31')]=_[_0x9408('0x32')](_0x54b88f[_0x9408('0x2c')],_0x54b88f[_0x9408('0x2f')]);_0x528695[_0x9408('0x33')]=_[_0x9408('0x32')](_0x54b88f[_0x9408('0x2c')],qs[_0x9408('0x34')](_0x53f933['query'][_0x9408('0x34')]));_0x528695[_0x9408('0x33')]=_0x528695[_0x9408('0x33')][_0x9408('0x35')]?_0x528695[_0x9408('0x33')]:_0x54b88f['model'];if(!_0x53f933[_0x9408('0x2f')][_0x9408('0x36')](_0x9408('0x37'))){_0x528695['limit']=qs[_0x9408('0x19')](_0x53f933[_0x9408('0x2f')]['limit']);_0x528695[_0x9408('0x17')]=qs[_0x9408('0x17')](_0x53f933[_0x9408('0x2f')][_0x9408('0x17')]);}_0x528695[_0x9408('0x38')]=qs[_0x9408('0x39')](_0x53f933['query'][_0x9408('0x39')]);_0x528695[_0x9408('0x3a')]=qs[_0x9408('0x31')](_[_0x9408('0x3b')](_0x53f933[_0x9408('0x2f')],_0x54b88f[_0x9408('0x31')]),_0x4b6e34);if(_0x53f933[_0x9408('0x2f')]['filter']){_0x528695[_0x9408('0x3a')]=_['merge'](_0x528695[_0x9408('0x3a')],{'$or':[{'key':{'$like':'%'+_0x53f933[_0x9408('0x2f')][_0x9408('0x3c')]+'%'}},{'value':{'$like':'%'+_0x53f933[_0x9408('0x2f')][_0x9408('0x3c')]+'%'}}]});}_0x528695=_[_0x9408('0x3d')]({},_0x528695,_0x53f933[_0x9408('0x3e')]);var _0xfcedfd={'where':_0x528695[_0x9408('0x3a')]};return db[_0x9408('0x29')][_0x9408('0x1a')](_0xfcedfd)[_0x9408('0x21')](function(_0x80255c){_0x1ec335[_0x9408('0x1a')]=_0x80255c;if(_0x53f933[_0x9408('0x2f')]['includeAll']){_0x528695[_0x9408('0x3f')]=[{'all':!![]}];}return db[_0x9408('0x29')][_0x9408('0x40')](_0x528695);})[_0x9408('0x21')](function(_0x1ade22){_0x1ec335[_0x9408('0x41')]=_0x1ade22;return _0x1ec335;})['then'](respondWithFilteredResult(_0xda58d,_0x528695))[_0x9408('0x42')](handleError(_0xda58d,null));};exports[_0x9408('0x43')]=function(_0x55085d,_0x4ca464){var _0x1afe65={'raw':!![],'where':{'id':_0x55085d[_0x9408('0x44')]['id']}},_0x2c3efa={};_0x2c3efa[_0x9408('0x2c')]=_['keys'](db['CannedAnswer'][_0x9408('0x2a')]);_0x2c3efa[_0x9408('0x2f')]=_[_0x9408('0x30')](_0x55085d[_0x9408('0x2f')]);_0x2c3efa[_0x9408('0x31')]=_[_0x9408('0x32')](_0x2c3efa[_0x9408('0x2c')],_0x2c3efa[_0x9408('0x2f')]);_0x1afe65['attributes']=_[_0x9408('0x32')](_0x2c3efa['model'],qs['fields'](_0x55085d['query'][_0x9408('0x34')]));_0x1afe65[_0x9408('0x33')]=_0x1afe65[_0x9408('0x33')][_0x9408('0x35')]?_0x1afe65[_0x9408('0x33')]:_0x2c3efa[_0x9408('0x2c')];if(_0x55085d['query'][_0x9408('0x45')]){_0x1afe65[_0x9408('0x3f')]=[{'all':!![]}];}_0x1afe65=_[_0x9408('0x3d')]({},_0x1afe65,_0x55085d[_0x9408('0x3e')]);return db[_0x9408('0x29')][_0x9408('0x46')](_0x1afe65)['then'](handleEntityNotFound(_0x4ca464,null))[_0x9408('0x21')](respondWithResult(_0x4ca464,null))[_0x9408('0x42')](handleError(_0x4ca464,null));};exports[_0x9408('0x20')]=function(_0x44e30b,_0x5abb19){if(_0x44e30b[_0x9408('0x47')]['id']){delete _0x44e30b[_0x9408('0x47')]['id'];}return db['CannedAnswer'][_0x9408('0x46')]({'where':{'id':_0x44e30b[_0x9408('0x44')]['id']}})['then'](handleEntityNotFound(_0x5abb19,null))[_0x9408('0x21')](saveUpdates(_0x44e30b[_0x9408('0x47')],null))[_0x9408('0x21')](respondWithResult(_0x5abb19,null))[_0x9408('0x42')](handleError(_0x5abb19,null));};exports[_0x9408('0x22')]=function(_0x2e471e,_0x2f32af){return db['CannedAnswer'][_0x9408('0x46')]({'where':{'id':_0x2e471e[_0x9408('0x44')]['id']}})[_0x9408('0x21')](handleEntityNotFound(_0x2f32af,null))[_0x9408('0x21')](removeEntity(_0x2f32af,null))['catch'](handleError(_0x2f32af,null));};exports[_0x9408('0x48')]=function(_0xe5dde1,_0x3215ee){var _0x3808df={'key':_0xe5dde1['body'][_0x9408('0x49')]};if(_0xe5dde1[_0x9408('0x47')][_0x9408('0x4a')]){_0x3808df[_0x9408('0x4a')]=_0xe5dde1[_0x9408('0x47')][_0x9408('0x4a')];}else if(_0xe5dde1[_0x9408('0x47')]['SmsAccountId']){_0x3808df[_0x9408('0x4b')]=_0xe5dde1['body'][_0x9408('0x4b')];}else if(_0xe5dde1['body']['OpenchannelAccountId']){_0x3808df[_0x9408('0x4c')]=_0xe5dde1[_0x9408('0x47')][_0x9408('0x4c')];}else if(_0xe5dde1['body'][_0x9408('0x4d')]){_0x3808df[_0x9408('0x4d')]=_0xe5dde1['body'][_0x9408('0x4d')];}return db[_0x9408('0x29')][_0x9408('0x46')]({'where':_0x3808df})[_0x9408('0x21')](function(_0x19fcb5){if(_0x19fcb5){throw new db[(_0x9408('0x4e'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0x9408('0x48')](_0xe5dde1['body']);})['then'](function(_0x4256f3){var _0x84f5fd=_0xe5dde1[_0x9408('0x4f')][_0x9408('0x23')]({'plain':!![]});if(!_0x84f5fd)throw new Error(_0x9408('0x50'));if(_0x84f5fd['role']===_0x9408('0x4f')){var _0x2a46c9=_0x4256f3[_0x9408('0x23')]({'plain':!![]});return db[_0x9408('0x51')][_0x9408('0x46')]({'where':{'name':_0x9408('0x24'),'userProfileId':_0x84f5fd[_0x9408('0x52')]},'raw':!![]})['then'](function(_0xd24848){if(_0xd24848&&_0xd24848[_0x9408('0x53')]===0x0){return db[_0x9408('0x25')][_0x9408('0x48')]({'name':_0x2a46c9[_0x9408('0x2e')],'resourceId':_0x2a46c9['id'],'type':_0xd24848[_0x9408('0x2e')],'sectionId':_0xd24848['id']},{})['then'](function(){return _0x4256f3;});}else{return _0x4256f3;}})[_0x9408('0x42')](function(_0x1a4099){logger[_0x9408('0x26')](_0x9408('0x54'),_0x1a4099);throw _0x1a4099;});}return _0x4256f3;})[_0x9408('0x21')](respondWithResult(_0x3215ee,0xc9))['catch'](handleError(_0x3215ee,null));};
\ No newline at end of file
+var _0xccac=['body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xccac,0x171));var _0xccca=function(_0x508ac6,_0x4d9a97){_0x508ac6=_0x508ac6-0x0;var _0x25d22a=_0xccac[_0x508ac6];return _0x25d22a;};'use strict';var emlformat=require(_0xccca('0x0'));var rimraf=require(_0xccca('0x1'));var zipdir=require(_0xccca('0x2'));var jsonpatch=require(_0xccca('0x3'));var rp=require('request-promise');var moment=require(_0xccca('0x4'));var BPromise=require(_0xccca('0x5'));var Mustache=require(_0xccca('0x6'));var util=require(_0xccca('0x7'));var path=require(_0xccca('0x8'));var sox=require(_0xccca('0x9'));var csv=require(_0xccca('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xccca('0xb'));var crypto=require('crypto');var jsforce=require(_0xccca('0xc'));var deskjs=require(_0xccca('0xd'));var toCsv=require(_0xccca('0xa'));var querystring=require(_0xccca('0xe'));var Papa=require(_0xccca('0xf'));var Redis=require('ioredis');var authService=require(_0xccca('0x10'));var qs=require(_0xccca('0x11'));var as=require(_0xccca('0x12'));var hardwareService=require(_0xccca('0x13'));var logger=require(_0xccca('0x14'))(_0xccca('0x15'));var utils=require(_0xccca('0x16'));var config=require(_0xccca('0x17'));var licenseUtil=require(_0xccca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18cb99,_0x443648){_0x443648=_0x443648||0xcc;return function(_0xfb7ac3){if(_0xfb7ac3){return _0x18cb99[_0xccca('0x19')](_0x443648);}return _0x18cb99[_0xccca('0x1a')](_0x443648)[_0xccca('0x1b')]();};}function respondWithResult(_0x472053,_0x2fbbad){_0x2fbbad=_0x2fbbad||0xc8;return function(_0x1d1c9a){if(_0x1d1c9a){return _0x472053[_0xccca('0x1a')](_0x2fbbad)[_0xccca('0x1c')](_0x1d1c9a);}};}function respondWithFilteredResult(_0x1daa8d,_0x5137ba){return function(_0x105806){if(_0x105806){var _0xaa2e98=typeof _0x5137ba[_0xccca('0x1d')]==='undefined'&&typeof _0x5137ba['limit']==='undefined';var _0x1633a8=_0x105806[_0xccca('0x1e')];var _0x119878=_0xaa2e98?0x0:_0x5137ba[_0xccca('0x1d')];var _0x12fd81=_0xaa2e98?_0x105806['count']:_0x5137ba['offset']+_0x5137ba[_0xccca('0x1f')];var _0x4f6665;if(_0x12fd81>=_0x1633a8){_0x12fd81=_0x1633a8;_0x4f6665=0xc8;}else{_0x4f6665=0xce;}_0x1daa8d['status'](_0x4f6665);return _0x1daa8d[_0xccca('0x20')](_0xccca('0x21'),_0x119878+'-'+_0x12fd81+'/'+_0x1633a8)[_0xccca('0x1c')](_0x105806);}return null;};}function patchUpdates(_0x583aeb){return function(_0x242897){try{jsonpatch['apply'](_0x242897,_0x583aeb,!![]);}catch(_0xa0518c){return BPromise[_0xccca('0x22')](_0xa0518c);}return _0x242897[_0xccca('0x23')]();};}function saveUpdates(_0x3b99cc,_0x3a657f){return function(_0x2e59b0){if(_0x2e59b0){return _0x2e59b0[_0xccca('0x24')](_0x3b99cc)['then'](function(_0x10a364){return _0x10a364;});}return null;};}function removeEntity(_0x11d4e0,_0x5b0863){return function(_0x1b6b94){if(_0x1b6b94){return _0x1b6b94[_0xccca('0x25')]()[_0xccca('0x26')](function(){var _0x864e46=_0x1b6b94[_0xccca('0x27')]({'plain':!![]});var _0x4e6327=_0xccca('0x28');return db[_0xccca('0x29')][_0xccca('0x25')]({'where':{'type':_0x4e6327,'resourceId':_0x864e46['id']}})[_0xccca('0x26')](function(){return _0x1b6b94;});})[_0xccca('0x26')](function(){_0x11d4e0[_0xccca('0x1a')](0xcc)[_0xccca('0x1b')]();});}};}function handleEntityNotFound(_0x1df57a,_0x10344c){return function(_0x1161f8){if(!_0x1161f8){_0x1df57a[_0xccca('0x19')](0x194);}return _0x1161f8;};}function handleError(_0x4a4288,_0x2c65ae){_0x2c65ae=_0x2c65ae||0x1f4;return function(_0x57cd15){logger[_0xccca('0x2a')](_0x57cd15[_0xccca('0x2b')]);if(_0x57cd15['name']){delete _0x57cd15[_0xccca('0x2c')];}_0x4a4288[_0xccca('0x1a')](_0x2c65ae)['send'](_0x57cd15);};}exports['index']=function(_0x32c4a5,_0x14cab5){var _0x25e7db={},_0x4ff944={},_0x258208={'count':0x0,'rows':[]};var _0x3bf5ae=_[_0xccca('0x2d')](db['CannedAnswer'][_0xccca('0x2e')],function(_0x4ea0bd){return{'name':_0x4ea0bd[_0xccca('0x2f')],'type':_0x4ea0bd[_0xccca('0x30')][_0xccca('0x31')]};});_0x4ff944[_0xccca('0x32')]=_[_0xccca('0x2d')](_0x3bf5ae,_0xccca('0x2c'));_0x4ff944[_0xccca('0x33')]=_[_0xccca('0x34')](_0x32c4a5['query']);_0x4ff944[_0xccca('0x35')]=_[_0xccca('0x36')](_0x4ff944[_0xccca('0x32')],_0x4ff944[_0xccca('0x33')]);_0x25e7db[_0xccca('0x37')]=_[_0xccca('0x36')](_0x4ff944[_0xccca('0x32')],qs[_0xccca('0x38')](_0x32c4a5[_0xccca('0x33')][_0xccca('0x38')]));_0x25e7db[_0xccca('0x37')]=_0x25e7db[_0xccca('0x37')][_0xccca('0x39')]?_0x25e7db[_0xccca('0x37')]:_0x4ff944[_0xccca('0x32')];if(!_0x32c4a5[_0xccca('0x33')][_0xccca('0x3a')](_0xccca('0x3b'))){_0x25e7db[_0xccca('0x1f')]=qs[_0xccca('0x1f')](_0x32c4a5[_0xccca('0x33')][_0xccca('0x1f')]);_0x25e7db[_0xccca('0x1d')]=qs[_0xccca('0x1d')](_0x32c4a5[_0xccca('0x33')][_0xccca('0x1d')]);}_0x25e7db[_0xccca('0x3c')]=qs[_0xccca('0x3d')](_0x32c4a5['query'][_0xccca('0x3d')]);_0x25e7db['where']=qs['filters'](_[_0xccca('0x3e')](_0x32c4a5[_0xccca('0x33')],_0x4ff944[_0xccca('0x35')]),_0x3bf5ae);if(_0x32c4a5[_0xccca('0x33')][_0xccca('0x3f')]){_0x25e7db[_0xccca('0x40')]=_[_0xccca('0x41')](_0x25e7db[_0xccca('0x40')],{'$or':[{'key':{'$like':'%'+_0x32c4a5[_0xccca('0x33')][_0xccca('0x3f')]+'%'}},{'value':{'$like':'%'+_0x32c4a5['query']['filter']+'%'}}]});}_0x25e7db=_[_0xccca('0x41')]({},_0x25e7db,_0x32c4a5[_0xccca('0x42')]);var _0x5a97df={'where':_0x25e7db[_0xccca('0x40')]};return db[_0xccca('0x43')][_0xccca('0x1e')](_0x5a97df)[_0xccca('0x26')](function(_0xb9bc04){_0x258208['count']=_0xb9bc04;if(_0x32c4a5[_0xccca('0x33')][_0xccca('0x44')]){_0x25e7db['include']=[{'all':!![]}];}return db[_0xccca('0x43')][_0xccca('0x45')](_0x25e7db);})[_0xccca('0x26')](function(_0x4ecf89){_0x258208[_0xccca('0x46')]=_0x4ecf89;return _0x258208;})[_0xccca('0x26')](respondWithFilteredResult(_0x14cab5,_0x25e7db))[_0xccca('0x47')](handleError(_0x14cab5,null));};exports[_0xccca('0x48')]=function(_0x4907cb,_0x232f0d){var _0x1b1849={'raw':!![],'where':{'id':_0x4907cb[_0xccca('0x49')]['id']}},_0x3890e4={};_0x3890e4[_0xccca('0x32')]=_[_0xccca('0x34')](db[_0xccca('0x43')][_0xccca('0x2e')]);_0x3890e4[_0xccca('0x33')]=_[_0xccca('0x34')](_0x4907cb[_0xccca('0x33')]);_0x3890e4[_0xccca('0x35')]=_[_0xccca('0x36')](_0x3890e4['model'],_0x3890e4[_0xccca('0x33')]);_0x1b1849['attributes']=_[_0xccca('0x36')](_0x3890e4['model'],qs['fields'](_0x4907cb['query']['fields']));_0x1b1849['attributes']=_0x1b1849['attributes'][_0xccca('0x39')]?_0x1b1849[_0xccca('0x37')]:_0x3890e4[_0xccca('0x32')];if(_0x4907cb[_0xccca('0x33')][_0xccca('0x44')]){_0x1b1849[_0xccca('0x4a')]=[{'all':!![]}];}_0x1b1849=_[_0xccca('0x41')]({},_0x1b1849,_0x4907cb[_0xccca('0x42')]);return db[_0xccca('0x43')][_0xccca('0x4b')](_0x1b1849)['then'](handleEntityNotFound(_0x232f0d,null))[_0xccca('0x26')](respondWithResult(_0x232f0d,null))[_0xccca('0x47')](handleError(_0x232f0d,null));};exports['update']=function(_0x2331e0,_0x2f7613){if(_0x2331e0[_0xccca('0x4c')]['id']){delete _0x2331e0[_0xccca('0x4c')]['id'];}return db[_0xccca('0x43')][_0xccca('0x4b')]({'where':{'id':_0x2331e0[_0xccca('0x49')]['id']}})['then'](handleEntityNotFound(_0x2f7613,null))[_0xccca('0x26')](saveUpdates(_0x2331e0[_0xccca('0x4c')],null))[_0xccca('0x26')](respondWithResult(_0x2f7613,null))[_0xccca('0x47')](handleError(_0x2f7613,null));};exports[_0xccca('0x25')]=function(_0x5ab9da,_0x537e0d){return db[_0xccca('0x43')][_0xccca('0x4b')]({'where':{'id':_0x5ab9da['params']['id']}})['then'](handleEntityNotFound(_0x537e0d,null))['then'](removeEntity(_0x537e0d,null))[_0xccca('0x47')](handleError(_0x537e0d,null));};exports[_0xccca('0x4d')]=function(_0x5bdb61,_0x523be0){var _0x4bfa50={'key':_0x5bdb61[_0xccca('0x4c')][_0xccca('0x31')]};if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x4e')]){_0x4bfa50[_0xccca('0x4e')]=_0x5bdb61['body'][_0xccca('0x4e')];}else if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x4f')]){_0x4bfa50[_0xccca('0x4f')]=_0x5bdb61[_0xccca('0x4c')]['SmsAccountId'];}else if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x50')]){_0x4bfa50[_0xccca('0x50')]=_0x5bdb61[_0xccca('0x4c')]['OpenchannelAccountId'];}else if(_0x5bdb61[_0xccca('0x4c')][_0xccca('0x51')]){_0x4bfa50[_0xccca('0x51')]=_0x5bdb61[_0xccca('0x4c')][_0xccca('0x51')];}return db['CannedAnswer'][_0xccca('0x4b')]({'where':_0x4bfa50})['then'](function(_0x31a1ec){if(_0x31a1ec){throw new db[(_0xccca('0x52'))][(_0xccca('0x53'))](_0xccca('0x54'));}return db[_0xccca('0x43')][_0xccca('0x4d')](_0x5bdb61[_0xccca('0x4c')]);})[_0xccca('0x26')](function(_0x14ddb9){var _0x42a98e=_0x5bdb61[_0xccca('0x55')][_0xccca('0x27')]({'plain':!![]});if(!_0x42a98e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42a98e[_0xccca('0x56')]===_0xccca('0x55')){var _0x2f4460=_0x14ddb9[_0xccca('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xccca('0x28'),'userProfileId':_0x42a98e[_0xccca('0x57')]},'raw':!![]})[_0xccca('0x26')](function(_0x16c455){if(_0x16c455&&_0x16c455['autoAssociation']===0x0){return db[_0xccca('0x29')]['create']({'name':_0x2f4460[_0xccca('0x2c')],'resourceId':_0x2f4460['id'],'type':_0x16c455[_0xccca('0x2c')],'sectionId':_0x16c455['id']},{})[_0xccca('0x26')](function(){return _0x14ddb9;});}else{return _0x14ddb9;}})[_0xccca('0x47')](function(_0x13b1ad){logger[_0xccca('0x2a')](_0xccca('0x58'),_0x13b1ad);throw _0x13b1ad;});}return _0x14ddb9;})[_0xccca('0x26')](respondWithResult(_0x523be0,0xc9))[_0xccca('0x47')](handleError(_0x523be0,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 3355664..2fbf212 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 _0xe8f5=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','rimraf','../../config/environment','CannedAnswer'];(function(_0x134a29,_0x582b4d){var _0x467d55=function(_0x95b0e5){while(--_0x95b0e5){_0x134a29['push'](_0x134a29['shift']());}};_0x467d55(++_0x582b4d);}(_0xe8f5,0x159));var _0x5e8f=function(_0x1d4944,_0x3a0b91){_0x1d4944=_0x1d4944-0x0;var _0x40b72b=_0xe8f5[_0x1d4944];return _0x40b72b;};'use strict';var _=require(_0x5e8f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5e8f('0x1'));var moment=require(_0x5e8f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5e8f('0x3'));var config=require(_0x5e8f('0x4'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x1011b6,_0x24323b){return _0x1011b6['define'](_0x5e8f('0x5'),attributes,{'tableName':_0x5e8f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e8f('0x7'),'collate':_0x5e8f('0x8')});};
\ No newline at end of file
+var _0x7f97=['utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4'];(function(_0x1dd8bf,_0x99155f){var _0x3ca4b4=function(_0x557813){while(--_0x557813){_0x1dd8bf['push'](_0x1dd8bf['shift']());}};_0x3ca4b4(++_0x99155f);}(_0x7f97,0x11f));var _0x77f9=function(_0x200dee,_0x3259fb){_0x200dee=_0x200dee-0x0;var _0x3f0123=_0x7f97[_0x200dee];return _0x3f0123;};'use strict';var _=require('lodash');var util=require(_0x77f9('0x0'));var logger=require('../../config/logger')(_0x77f9('0x1'));var moment=require(_0x77f9('0x2'));var BPromise=require(_0x77f9('0x3'));var rp=require(_0x77f9('0x4'));var fs=require('fs');var path=require(_0x77f9('0x5'));var rimraf=require(_0x77f9('0x6'));var config=require(_0x77f9('0x7'));var attributes=require(_0x77f9('0x8'));module['exports']=function(_0x17794d,_0x4d562b){return _0x17794d[_0x77f9('0x9')](_0x77f9('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x77f9('0xb'),'collate':_0x77f9('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index d99c6b5..3157029 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(_0x39ff7f,_0x439fe5){var _0x3ef5f=function(_0x2a10e4){while(--_0x2a10e4){_0x39ff7f['push'](_0x39ff7f['shift']());}};_0x3ef5f(++_0x439fe5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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(_0x2b8dfd,_0x16d02f){var _0x3f343f=function(_0x5cbcff){while(--_0x5cbcff){_0x2b8dfd['push'](_0x2b8dfd['shift']());}};_0x3f343f(++_0x16d02f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 ce703cc..845c852 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 _0x3b4b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','/:id','isAuthenticated','show','post','put','destroy','multer','util','path','connect-timeout'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0x3b4b,0x84));var _0xb3b4=function(_0x32fab2,_0x4c3cad){_0x32fab2=_0x32fab2-0x0;var _0x166bf4=_0x3b4b[_0x32fab2];return _0x166bf4;};'use strict';var multer=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var path=require(_0xb3b4('0x2'));var timeout=require(_0xb3b4('0x3'));var express=require(_0xb3b4('0x4'));var router=express[_0xb3b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb3b4('0x6'));var interaction=require(_0xb3b4('0x7'));var config=require(_0xb3b4('0x8'));var controller=require(_0xb3b4('0x9'));router[_0xb3b4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb3b4('0xa')](_0xb3b4('0xb'),auth[_0xb3b4('0xc')](),controller[_0xb3b4('0xd')]);router[_0xb3b4('0xe')]('/',auth[_0xb3b4('0xc')](),controller['create']);router[_0xb3b4('0xf')]('/:id',auth[_0xb3b4('0xc')](),controller['update']);router['delete'](_0xb3b4('0xb'),auth[_0xb3b4('0xc')](),controller[_0xb3b4('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xd3da=['Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x5b262d,_0x27ad12){var _0x238a1b=function(_0x50f3d4){while(--_0x50f3d4){_0x5b262d['push'](_0x5b262d['shift']());}};_0x238a1b(++_0x27ad12);}(_0xd3da,0x12e));var _0xad3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3da[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xad3d('0x0'));var util=require(_0xad3d('0x1'));var path=require(_0xad3d('0x2'));var timeout=require(_0xad3d('0x3'));var express=require('express');var router=express[_0xad3d('0x4')]();var fs_extra=require(_0xad3d('0x5'));var auth=require(_0xad3d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xad3d('0x7'));var controller=require('./cannedAnswer.controller');router[_0xad3d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad3d('0x8')](_0xad3d('0x9'),auth[_0xad3d('0xa')](),controller[_0xad3d('0xb')]);router['post']('/',auth[_0xad3d('0xa')](),controller[_0xad3d('0xc')]);router[_0xad3d('0xd')](_0xad3d('0x9'),auth[_0xad3d('0xa')](),controller[_0xad3d('0xe')]);router[_0xad3d('0xf')](_0xad3d('0x9'),auth[_0xad3d('0xa')](),controller[_0xad3d('0x10')]);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 dccdc43..e296e2c 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 _0x2e3d=['STRING','INTEGER','sequelize','1970-01-01\x2000:00:01'];(function(_0x502417,_0x4d0bf1){var _0x5d0686=function(_0xfd75b3){while(--_0xfd75b3){_0x502417['push'](_0x502417['shift']());}};_0x5d0686(++_0x4d0bf1);}(_0x2e3d,0x1be));var _0xd2e3=function(_0xc99308,_0x194663){_0xc99308=_0xc99308-0x0;var _0x5f4aec=_0x2e3d[_0xc99308];return _0x5f4aec;};'use strict';var Sequelize=require(_0xd2e3('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd2e3('0x1')},'clid':{'type':Sequelize[_0xd2e3('0x2')]},'src':{'type':Sequelize[_0xd2e3('0x2')]},'dst':{'type':Sequelize[_0xd2e3('0x2')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xd2e3('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xd2e3('0x2')]},'duration':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd2e3('0x2')]},'amaflags':{'type':Sequelize[_0xd2e3('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd2e3('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd2e3('0x2')]},'linkedid':{'type':Sequelize[_0xd2e3('0x2')]},'sequence':{'type':Sequelize[_0xd2e3('0x2')]},'peeraccount':{'type':Sequelize[_0xd2e3('0x2')]},'type':{'type':Sequelize[_0xd2e3('0x2')]},'tag':{'type':Sequelize[_0xd2e3('0x2')]}};
\ No newline at end of file
+var _0x6c38=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x969f02,_0x448275){var _0x593798=function(_0x2d291b){while(--_0x2d291b){_0x969f02['push'](_0x969f02['shift']());}};_0x593798(++_0x448275);}(_0x6c38,0x8f));var _0x86c3=function(_0x2c85d4,_0x196197){_0x2c85d4=_0x2c85d4-0x0;var _0x5c1b31=_0x6c38[_0x2c85d4];return _0x5c1b31;};'use strict';var Sequelize=require(_0x86c3('0x0'));module[_0x86c3('0x1')]={'calldate':{'type':Sequelize[_0x86c3('0x2')],'allowNull':![],'defaultValue':_0x86c3('0x3')},'clid':{'type':Sequelize[_0x86c3('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x86c3('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x86c3('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x86c3('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x86c3('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x86c3('0x4')]},'userfield':{'type':Sequelize[_0x86c3('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x86c3('0x4')]},'sequence':{'type':Sequelize[_0x86c3('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 7d8fe9f..d1e9e4f 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 _0xe181=['keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x2de9de,_0xd46ad){var _0x34be8c=function(_0x294df0){while(--_0x294df0){_0x2de9de['push'](_0x2de9de['shift']());}};_0x34be8c(++_0xd46ad);}(_0xe181,0x68));var _0x1e18=function(_0x51d4ee,_0xdead36){_0x51d4ee=_0x51d4ee-0x0;var _0x2939b0=_0xe181[_0x51d4ee];return _0x2939b0;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];function respondWithStatusCode(_0x1743c3,_0x33a98d){_0x33a98d=_0x33a98d||0xcc;return function(_0x531e1b){if(_0x531e1b){return _0x1743c3[_0x1e18('0x1b')](_0x33a98d);}return _0x1743c3['status'](_0x33a98d)[_0x1e18('0x1c')]();};}function respondWithResult(_0x563eff,_0x404b7f){_0x404b7f=_0x404b7f||0xc8;return function(_0x36b583){if(_0x36b583){return _0x563eff[_0x1e18('0x1d')](_0x404b7f)[_0x1e18('0x1e')](_0x36b583);}};}function respondWithFilteredResult(_0x1687ba,_0x1e1ce6){return function(_0x39bc56){if(_0x39bc56){var _0x33fea1=typeof _0x1e1ce6[_0x1e18('0x1f')]===_0x1e18('0x20')&&typeof _0x1e1ce6[_0x1e18('0x21')]===_0x1e18('0x20');var _0x349f3c=_0x39bc56[_0x1e18('0x22')];var _0x21b851=_0x33fea1?0x0:_0x1e1ce6['offset'];var _0x1c91d2=_0x33fea1?_0x39bc56[_0x1e18('0x22')]:_0x1e1ce6[_0x1e18('0x1f')]+_0x1e1ce6[_0x1e18('0x21')];var _0x2834ee;if(_0x1c91d2>=_0x349f3c){_0x1c91d2=_0x349f3c;_0x2834ee=0xc8;}else{_0x2834ee=0xce;}_0x1687ba[_0x1e18('0x1d')](_0x2834ee);return _0x1687ba[_0x1e18('0x23')](_0x1e18('0x24'),_0x21b851+'-'+_0x1c91d2+'/'+_0x349f3c)[_0x1e18('0x1e')](_0x39bc56);}return null;};}function patchUpdates(_0x22baca){return function(_0x2489c3){try{jsonpatch[_0x1e18('0x25')](_0x2489c3,_0x22baca,!![]);}catch(_0x3c4fdf){return BPromise[_0x1e18('0x26')](_0x3c4fdf);}return _0x2489c3[_0x1e18('0x27')]();};}function saveUpdates(_0x975df0,_0x3fd0a7){return function(_0x5eb6b4){if(_0x5eb6b4){return _0x5eb6b4[_0x1e18('0x28')](_0x975df0)[_0x1e18('0x29')](function(_0x3e9b2c){return _0x3e9b2c;});}return null;};}function removeEntity(_0x52d5e2,_0xf74622){return function(_0xdda2ce){if(_0xdda2ce){return _0xdda2ce[_0x1e18('0x2a')]()[_0x1e18('0x29')](function(){_0x52d5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa4db,_0x53f9d7){return function(_0x5bb03c){if(!_0x5bb03c){_0x6fa4db['sendStatus'](0x194);}return _0x5bb03c;};}function handleError(_0x32a196,_0x29cac0){_0x29cac0=_0x29cac0||0x1f4;return function(_0x41b67d){logger[_0x1e18('0x2b')](_0x41b67d[_0x1e18('0x2c')]);if(_0x41b67d[_0x1e18('0x2d')]){delete _0x41b67d[_0x1e18('0x2d')];}_0x32a196[_0x1e18('0x1d')](_0x29cac0)[_0x1e18('0x2e')](_0x41b67d);};}exports[_0x1e18('0x2f')]=function(_0x1015a3,_0x42c638){var _0x40d0af={},_0x1be225={},_0x558d01={'count':0x0,'rows':[]};var _0x57000b=_['map'](db[_0x1e18('0x30')][_0x1e18('0x31')],function(_0x1f75cd){return{'name':_0x1f75cd[_0x1e18('0x32')],'type':_0x1f75cd[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x1be225[_0x1e18('0x35')]=_[_0x1e18('0x36')](_0x57000b,'name');_0x1be225[_0x1e18('0x37')]=_[_0x1e18('0x38')](_0x1015a3['query']);_0x1be225[_0x1e18('0x39')]=_[_0x1e18('0x3a')](_0x1be225[_0x1e18('0x35')],_0x1be225['query']);_0x40d0af[_0x1e18('0x3b')]=_['intersection'](_0x1be225['model'],qs['fields'](_0x1015a3[_0x1e18('0x37')]['fields']));_0x40d0af[_0x1e18('0x3b')]=_0x40d0af[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x40d0af['attributes']:_0x1be225['model'];if(!_0x1015a3[_0x1e18('0x37')][_0x1e18('0x3d')](_0x1e18('0x3e'))){_0x40d0af[_0x1e18('0x21')]=qs[_0x1e18('0x21')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x21')]);_0x40d0af[_0x1e18('0x1f')]=qs[_0x1e18('0x1f')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x1f')]);}_0x40d0af[_0x1e18('0x3f')]=qs['sort'](_0x1015a3['query'][_0x1e18('0x40')]);_0x40d0af[_0x1e18('0x41')]=qs[_0x1e18('0x39')](_['pick'](_0x1015a3[_0x1e18('0x37')],_0x1be225['filters']),_0x57000b);if(_0x1015a3[_0x1e18('0x37')]['filter']){_0x40d0af['where']=_[_0x1e18('0x42')](_0x40d0af[_0x1e18('0x41')],{'$or':_[_0x1e18('0x36')](_0x57000b,function(_0x206b44){if(_0x206b44[_0x1e18('0x33')]!==_0x1e18('0x43')){var _0x4e2ca3={};_0x4e2ca3[_0x206b44[_0x1e18('0x2d')]]={'$like':'%'+_0x1015a3[_0x1e18('0x37')][_0x1e18('0x44')]+'%'};return _0x4e2ca3;}})});}_0x40d0af=_[_0x1e18('0x42')]({},_0x40d0af,_0x1015a3['options']);var _0x11f839={'where':_0x40d0af['where']};return db[_0x1e18('0x30')][_0x1e18('0x22')](_0x11f839)['then'](function(_0x41c2bd){_0x558d01[_0x1e18('0x22')]=_0x41c2bd;if(_0x1015a3['query']['includeAll']){_0x40d0af['include']=[{'all':!![]}];}return db[_0x1e18('0x30')][_0x1e18('0x45')](_0x40d0af);})[_0x1e18('0x29')](function(_0x602a85){_0x558d01[_0x1e18('0x46')]=_0x602a85;return _0x558d01;})[_0x1e18('0x29')](respondWithFilteredResult(_0x42c638,_0x40d0af))[_0x1e18('0x47')](handleError(_0x42c638,null));};exports[_0x1e18('0x48')]=function(_0x1cae7e,_0x354832){var _0x16ee40={'raw':!![],'where':{'id':_0x1cae7e[_0x1e18('0x49')]['id']}},_0x4821f9={};_0x4821f9['model']=_[_0x1e18('0x38')](db[_0x1e18('0x30')]['rawAttributes']);_0x4821f9['query']=_['keys'](_0x1cae7e[_0x1e18('0x37')]);_0x4821f9[_0x1e18('0x39')]=_['intersection'](_0x4821f9[_0x1e18('0x35')],_0x4821f9[_0x1e18('0x37')]);_0x16ee40['attributes']=_['intersection'](_0x4821f9[_0x1e18('0x35')],qs[_0x1e18('0x4a')](_0x1cae7e[_0x1e18('0x37')][_0x1e18('0x4a')]));_0x16ee40[_0x1e18('0x3b')]=_0x16ee40[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x16ee40[_0x1e18('0x3b')]:_0x4821f9[_0x1e18('0x35')];if(_0x1cae7e[_0x1e18('0x37')]['includeAll']){_0x16ee40['include']=[{'all':!![]}];}_0x16ee40=_[_0x1e18('0x42')]({},_0x16ee40,_0x1cae7e[_0x1e18('0x4b')]);return db[_0x1e18('0x30')][_0x1e18('0x4c')](_0x16ee40)[_0x1e18('0x29')](handleEntityNotFound(_0x354832,null))[_0x1e18('0x29')](respondWithResult(_0x354832,null))[_0x1e18('0x47')](handleError(_0x354832,null));};exports['create']=function(_0x54f69b,_0x54cd71){return db[_0x1e18('0x30')][_0x1e18('0x4d')](_0x54f69b[_0x1e18('0x4e')],{})[_0x1e18('0x29')](respondWithResult(_0x54cd71,0xc9))[_0x1e18('0x47')](handleError(_0x54cd71,null));};exports[_0x1e18('0x28')]=function(_0x191c18,_0x190af4){if(_0x191c18[_0x1e18('0x4e')]['id']){delete _0x191c18[_0x1e18('0x4e')]['id'];}return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x191c18[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x190af4,null))[_0x1e18('0x29')](saveUpdates(_0x191c18[_0x1e18('0x4e')],null))[_0x1e18('0x29')](respondWithResult(_0x190af4,null))[_0x1e18('0x47')](handleError(_0x190af4,null));};exports[_0x1e18('0x2a')]=function(_0x11d573,_0x5d4cbb){return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x11d573[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x5d4cbb,null))[_0x1e18('0x29')](removeEntity(_0x5d4cbb,null))['catch'](handleError(_0x5d4cbb,null));};exports['describe']=function(_0x16b51a,_0x30dc06){return db['Cdr'][_0x1e18('0x4f')]()[_0x1e18('0x29')](respondWithResult(_0x30dc06,null))[_0x1e18('0x47')](handleError(_0x30dc06,null));};
\ No newline at end of file
+var _0x236d=['undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','destroy','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4e7b37,_0x33b1fa){var _0x20b707=function(_0x1fb9ff){while(--_0x1fb9ff){_0x4e7b37['push'](_0x4e7b37['shift']());}};_0x20b707(++_0x33b1fa);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd236('0x0'));var rimraf=require(_0xd236('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd236('0x2'));var rp=require('request-promise');var moment=require(_0xd236('0x3'));var BPromise=require(_0xd236('0x4'));var Mustache=require(_0xd236('0x5'));var util=require(_0xd236('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd236('0x7'));var ejs=require(_0xd236('0x8'));var fs=require('fs');var fs_extra=require(_0xd236('0x9'));var _=require(_0xd236('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd236('0xb'));var deskjs=require(_0xd236('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd236('0xd'));var Papa=require(_0xd236('0xe'));var Redis=require('ioredis');var authService=require(_0xd236('0xf'));var qs=require(_0xd236('0x10'));var as=require(_0xd236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd236('0x12'))(_0xd236('0x13'));var utils=require(_0xd236('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd236('0x15'));var db=require(_0xd236('0x16'))['db'];function respondWithStatusCode(_0x3d1076,_0x160cb1){_0x160cb1=_0x160cb1||0xcc;return function(_0x21f27b){if(_0x21f27b){return _0x3d1076[_0xd236('0x17')](_0x160cb1);}return _0x3d1076[_0xd236('0x18')](_0x160cb1)[_0xd236('0x19')]();};}function respondWithResult(_0x22435c,_0x3d7465){_0x3d7465=_0x3d7465||0xc8;return function(_0x348734){if(_0x348734){return _0x22435c[_0xd236('0x18')](_0x3d7465)[_0xd236('0x1a')](_0x348734);}};}function respondWithFilteredResult(_0x3b60a7,_0xd851b5){return function(_0x3b2535){if(_0x3b2535){var _0x2a076d=typeof _0xd851b5[_0xd236('0x1b')]===_0xd236('0x1c')&&typeof _0xd851b5[_0xd236('0x1d')]==='undefined';var _0x4f06c6=_0x3b2535[_0xd236('0x1e')];var _0x1b02a5=_0x2a076d?0x0:_0xd851b5['offset'];var _0x11c6ec=_0x2a076d?_0x3b2535[_0xd236('0x1e')]:_0xd851b5[_0xd236('0x1b')]+_0xd851b5['limit'];var _0x355b65;if(_0x11c6ec>=_0x4f06c6){_0x11c6ec=_0x4f06c6;_0x355b65=0xc8;}else{_0x355b65=0xce;}_0x3b60a7[_0xd236('0x18')](_0x355b65);return _0x3b60a7[_0xd236('0x1f')]('Content-Range',_0x1b02a5+'-'+_0x11c6ec+'/'+_0x4f06c6)[_0xd236('0x1a')](_0x3b2535);}return null;};}function patchUpdates(_0x3b0a27){return function(_0x26c758){try{jsonpatch[_0xd236('0x20')](_0x26c758,_0x3b0a27,!![]);}catch(_0x2f512d){return BPromise['reject'](_0x2f512d);}return _0x26c758[_0xd236('0x21')]();};}function saveUpdates(_0x30e7aa,_0x1e4ddb){return function(_0x3d1e4e){if(_0x3d1e4e){return _0x3d1e4e[_0xd236('0x22')](_0x30e7aa)['then'](function(_0x4a35d0){return _0x4a35d0;});}return null;};}function removeEntity(_0x257f27,_0x4be5ac){return function(_0x22924d){if(_0x22924d){return _0x22924d['destroy']()[_0xd236('0x23')](function(){_0x257f27[_0xd236('0x18')](0xcc)[_0xd236('0x19')]();});}};}function handleEntityNotFound(_0x49d822,_0x41049a){return function(_0x339b08){if(!_0x339b08){_0x49d822[_0xd236('0x17')](0x194);}return _0x339b08;};}function handleError(_0x13ba7a,_0x3a30d8){_0x3a30d8=_0x3a30d8||0x1f4;return function(_0x17f927){logger[_0xd236('0x24')](_0x17f927[_0xd236('0x25')]);if(_0x17f927[_0xd236('0x26')]){delete _0x17f927[_0xd236('0x26')];}_0x13ba7a[_0xd236('0x18')](_0x3a30d8)[_0xd236('0x27')](_0x17f927);};}exports[_0xd236('0x28')]=function(_0x23714d,_0x3108f4){var _0x28175d={},_0x436a19={},_0x471ed6={'count':0x0,'rows':[]};var _0x463fc8=_[_0xd236('0x29')](db[_0xd236('0x2a')][_0xd236('0x2b')],function(_0x3c1617){return{'name':_0x3c1617[_0xd236('0x2c')],'type':_0x3c1617[_0xd236('0x2d')][_0xd236('0x2e')]};});_0x436a19[_0xd236('0x2f')]=_[_0xd236('0x29')](_0x463fc8,_0xd236('0x26'));_0x436a19['query']=_[_0xd236('0x30')](_0x23714d['query']);_0x436a19[_0xd236('0x31')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],_0x436a19['query']);_0x28175d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x23714d[_0xd236('0x35')][_0xd236('0x34')]));_0x28175d[_0xd236('0x33')]=_0x28175d['attributes'][_0xd236('0x36')]?_0x28175d['attributes']:_0x436a19[_0xd236('0x2f')];if(!_0x23714d['query'][_0xd236('0x37')](_0xd236('0x38'))){_0x28175d[_0xd236('0x1d')]=qs[_0xd236('0x1d')](_0x23714d[_0xd236('0x35')][_0xd236('0x1d')]);_0x28175d[_0xd236('0x1b')]=qs[_0xd236('0x1b')](_0x23714d[_0xd236('0x35')][_0xd236('0x1b')]);}_0x28175d[_0xd236('0x39')]=qs[_0xd236('0x3a')](_0x23714d[_0xd236('0x35')]['sort']);_0x28175d[_0xd236('0x3b')]=qs[_0xd236('0x31')](_[_0xd236('0x3c')](_0x23714d['query'],_0x436a19[_0xd236('0x31')]),_0x463fc8);if(_0x23714d[_0xd236('0x35')][_0xd236('0x3d')]){_0x28175d[_0xd236('0x3b')]=_[_0xd236('0x3e')](_0x28175d[_0xd236('0x3b')],{'$or':_['map'](_0x463fc8,function(_0x696bed){if(_0x696bed[_0xd236('0x2d')]!==_0xd236('0x3f')){var _0x3c798f={};_0x3c798f[_0x696bed[_0xd236('0x26')]]={'$like':'%'+_0x23714d[_0xd236('0x35')]['filter']+'%'};return _0x3c798f;}})});}_0x28175d=_[_0xd236('0x3e')]({},_0x28175d,_0x23714d[_0xd236('0x40')]);var _0x2ba3ae={'where':_0x28175d['where']};return db[_0xd236('0x2a')]['count'](_0x2ba3ae)[_0xd236('0x23')](function(_0x5793bf){_0x471ed6['count']=_0x5793bf;if(_0x23714d[_0xd236('0x35')][_0xd236('0x41')]){_0x28175d[_0xd236('0x42')]=[{'all':!![]}];}return db[_0xd236('0x2a')][_0xd236('0x43')](_0x28175d);})['then'](function(_0x4d0d65){_0x471ed6[_0xd236('0x44')]=_0x4d0d65;return _0x471ed6;})[_0xd236('0x23')](respondWithFilteredResult(_0x3108f4,_0x28175d))['catch'](handleError(_0x3108f4,null));};exports[_0xd236('0x45')]=function(_0x342fd5,_0x2d815b){var _0x55007d={'raw':!![],'where':{'id':_0x342fd5['params']['id']}},_0x58a93a={};_0x58a93a[_0xd236('0x2f')]=_['keys'](db['Cdr'][_0xd236('0x2b')]);_0x58a93a[_0xd236('0x35')]=_[_0xd236('0x30')](_0x342fd5[_0xd236('0x35')]);_0x58a93a[_0xd236('0x31')]=_['intersection'](_0x58a93a['model'],_0x58a93a[_0xd236('0x35')]);_0x55007d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x58a93a[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x342fd5[_0xd236('0x35')]['fields']));_0x55007d[_0xd236('0x33')]=_0x55007d['attributes'][_0xd236('0x36')]?_0x55007d[_0xd236('0x33')]:_0x58a93a['model'];if(_0x342fd5['query']['includeAll']){_0x55007d['include']=[{'all':!![]}];}_0x55007d=_[_0xd236('0x3e')]({},_0x55007d,_0x342fd5[_0xd236('0x40')]);return db[_0xd236('0x2a')][_0xd236('0x46')](_0x55007d)[_0xd236('0x23')](handleEntityNotFound(_0x2d815b,null))['then'](respondWithResult(_0x2d815b,null))['catch'](handleError(_0x2d815b,null));};exports[_0xd236('0x47')]=function(_0x7c0650,_0xbf4ba9){return db[_0xd236('0x2a')][_0xd236('0x47')](_0x7c0650[_0xd236('0x48')],{})['then'](respondWithResult(_0xbf4ba9,0xc9))[_0xd236('0x49')](handleError(_0xbf4ba9,null));};exports['update']=function(_0x223a14,_0x2c8861){if(_0x223a14['body']['id']){delete _0x223a14[_0xd236('0x48')]['id'];}return db[_0xd236('0x2a')]['find']({'where':{'id':_0x223a14['params']['id']}})[_0xd236('0x23')](handleEntityNotFound(_0x2c8861,null))[_0xd236('0x23')](saveUpdates(_0x223a14[_0xd236('0x48')],null))[_0xd236('0x23')](respondWithResult(_0x2c8861,null))['catch'](handleError(_0x2c8861,null));};exports[_0xd236('0x4a')]=function(_0x43c12b,_0x3d8ca6){return db[_0xd236('0x2a')][_0xd236('0x46')]({'where':{'id':_0x43c12b[_0xd236('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d8ca6,null))['then'](removeEntity(_0x3d8ca6,null))[_0xd236('0x49')](handleError(_0x3d8ca6,null));};exports['describe']=function(_0xa39da6,_0x30c336){return db['Cdr'][_0xd236('0x4c')]()[_0xd236('0x23')](respondWithResult(_0x30c336,null))['catch'](handleError(_0x30c336,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 556e3be..2b0c0d3 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5735d0,_0x423963){var _0x5e1c52=function(_0x55d80a){while(--_0x55d80a){_0x5735d0['push'](_0x5735d0['shift']());}};_0x5e1c52(++_0x423963);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x25e625,_0x2a97e2){var _0x3312cb=function(_0x3294e8){while(--_0x3294e8){_0x25e625['push'](_0x25e625['shift']());}};_0x3312cb(++_0x2a97e2);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 5fdde5a..4e081dc 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 _0xd320=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x551b1c,_0x3584f9){var _0x131273=function(_0x553185){while(--_0x553185){_0x551b1c['push'](_0x551b1c['shift']());}};_0x131273(++_0x3584f9);}(_0xd320,0x172));var _0x0d32=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0xd320[_0x146a97];return _0x259d5c;};'use strict';var _=require(_0x0d32('0x0'));var util=require(_0x0d32('0x1'));var moment=require(_0x0d32('0x2'));var BPromise=require(_0x0d32('0x3'));var rs=require(_0x0d32('0x4'));var fs=require('fs');var Redis=require(_0x0d32('0x5'));var db=require(_0x0d32('0x6'))['db'];var utils=require(_0x0d32('0x7'));var logger=require(_0x0d32('0x8'))(_0x0d32('0x9'));var config=require(_0x0d32('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0d32('0xb')][_0x0d32('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46d1b9,_0xe62416,_0x354311){return new BPromise(function(_0x11cc33,_0x532215){return client[_0x0d32('0xd')](_0x46d1b9,_0x354311)[_0x0d32('0xe')](function(_0x213c6b){logger[_0x0d32('0xf')](_0x0d32('0x10'),_0xe62416,_0x0d32('0x11'));logger[_0x0d32('0x12')]('Cdr,\x20%s,\x20%s,\x20%s',_0xe62416,_0x0d32('0x11'),JSON[_0x0d32('0x13')](_0x213c6b));if(_0x213c6b[_0x0d32('0x14')]){if(_0x213c6b[_0x0d32('0x14')][_0x0d32('0x15')]===0x1f4){logger['error'](_0x0d32('0x10'),_0xe62416,_0x213c6b[_0x0d32('0x14')]['message']);return _0x532215(_0x213c6b[_0x0d32('0x14')][_0x0d32('0x16')]);}logger[_0x0d32('0x14')]('Cdr,\x20%s,\x20%s',_0xe62416,_0x213c6b[_0x0d32('0x14')][_0x0d32('0x16')]);return _0x11cc33(_0x213c6b[_0x0d32('0x14')]['message']);}else{logger[_0x0d32('0xf')](_0x0d32('0x10'),_0xe62416,'request\x20sent');_0x11cc33(_0x213c6b[_0x0d32('0x17')][_0x0d32('0x16')]);}})[_0x0d32('0x18')](function(_0x2b11ea){logger[_0x0d32('0x14')]('Cdr,\x20%s,\x20%s',_0xe62416,_0x2b11ea);_0x532215(_0x2b11ea);});});}
\ No newline at end of file
+var _0x28cb=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x28cb,0x19c));var _0xb28c=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x28cb[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xb28c('0x0'));var util=require(_0xb28c('0x1'));var moment=require('moment');var BPromise=require(_0xb28c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb28c('0x3'));var db=require(_0xb28c('0x4'))['db'];var utils=require(_0xb28c('0x5'));var logger=require(_0xb28c('0x6'))(_0xb28c('0x7'));var config=require(_0xb28c('0x8'));var jayson=require(_0xb28c('0x9'));var client=jayson[_0xb28c('0xa')][_0xb28c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fb836,_0x306c3f,_0x583878){return new BPromise(function(_0x31fc92,_0x2af86c){return client['request'](_0x1fb836,_0x583878)[_0xb28c('0xc')](function(_0x7de905){logger[_0xb28c('0xd')](_0xb28c('0xe'),_0x306c3f,_0xb28c('0xf'));logger[_0xb28c('0x10')](_0xb28c('0x11'),_0x306c3f,'request\x20sent',JSON[_0xb28c('0x12')](_0x7de905));if(_0x7de905[_0xb28c('0x13')]){if(_0x7de905[_0xb28c('0x13')][_0xb28c('0x14')]===0x1f4){logger[_0xb28c('0x13')]('Cdr,\x20%s,\x20%s',_0x306c3f,_0x7de905['error'][_0xb28c('0x15')]);return _0x2af86c(_0x7de905[_0xb28c('0x13')]['message']);}logger[_0xb28c('0x13')](_0xb28c('0xe'),_0x306c3f,_0x7de905[_0xb28c('0x13')][_0xb28c('0x15')]);return _0x31fc92(_0x7de905['error'][_0xb28c('0x15')]);}else{logger[_0xb28c('0xd')](_0xb28c('0xe'),_0x306c3f,'request\x20sent');_0x31fc92(_0x7de905[_0xb28c('0x16')]['message']);}})[_0xb28c('0x17')](function(_0x456717){logger['error'](_0xb28c('0xe'),_0x306c3f,_0x456717);_0x2af86c(_0x456717);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index a290e55..0245bb8 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _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(_0x44365d,_0x44e0cb){var _0x1a4a9e=function(_0x198df9){while(--_0x198df9){_0x44365d['push'](_0x44365d['shift']());}};_0x1a4a9e(++_0x44e0cb);}(_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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 89bc788..0e685ce 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 _0x6e27=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x136dac,_0x5bab21){var _0x2cd80e=function(_0x29ffd){while(--_0x29ffd){_0x136dac['push'](_0x136dac['shift']());}};_0x2cd80e(++_0x5bab21);}(_0x6e27,0x14d));var _0x76e2=function(_0x495ee7,_0x1f8218){_0x495ee7=_0x495ee7-0x0;var _0x27e06d=_0x6e27[_0x495ee7];return _0x27e06d;};'use strict';var Sequelize=require(_0x76e2('0x0'));module[_0x76e2('0x1')]={'priority':{'type':Sequelize[_0x76e2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x76e2('0x3')],'allowNull':![],'defaultValue':_0x76e2('0x4')},'appdata':{'type':Sequelize[_0x76e2('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x76e2('0x3')],'defaultValue':_0x76e2('0x6')}};
\ No newline at end of file
+var _0x5ccb=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3fa5bc,_0x57d31a){var _0x4fb864=function(_0x37d810){while(--_0x37d810){_0x3fa5bc['push'](_0x3fa5bc['shift']());}};_0x4fb864(++_0x57d31a);}(_0x5ccb,0xb6));var _0xb5cc=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0x5ccb[_0x11309c];return _0x3fea9c;};'use strict';var Sequelize=require(_0xb5cc('0x0'));module[_0xb5cc('0x1')]={'priority':{'type':Sequelize[_0xb5cc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb5cc('0x3')],'allowNull':![],'defaultValue':_0xb5cc('0x4')},'appdata':{'type':Sequelize[_0xb5cc('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb5cc('0x3')],'defaultValue':_0xb5cc('0x6')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 042a6f0..c342346 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 _0x2f3a=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','name','show','model','ChatApplication','rawAttributes','query','keys','intersection','attributes','fields','length','include','find','catch','params','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3db6b0,_0x1160bf){var _0x31d940=function(_0xb16cfd){while(--_0xb16cfd){_0x3db6b0['push'](_0x3db6b0['shift']());}};_0x31d940(++_0x1160bf);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x56047d,_0x11fb7c){_0x56047d=_0x56047d-0x0;var _0x4987=_0x2f3a[_0x56047d];return _0x4987;};'use strict';var emlformat=require(_0xa2f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa2f3('0x1'));var rp=require(_0xa2f3('0x2'));var moment=require(_0xa2f3('0x3'));var BPromise=require(_0xa2f3('0x4'));var Mustache=require(_0xa2f3('0x5'));var util=require(_0xa2f3('0x6'));var path=require('path');var sox=require(_0xa2f3('0x7'));var csv=require('to-csv');var ejs=require(_0xa2f3('0x8'));var fs=require('fs');var fs_extra=require(_0xa2f3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2f3('0xa'));var jsforce=require(_0xa2f3('0xb'));var deskjs=require(_0xa2f3('0xc'));var toCsv=require(_0xa2f3('0xd'));var querystring=require('querystring');var Papa=require(_0xa2f3('0xe'));var Redis=require(_0xa2f3('0xf'));var authService=require(_0xa2f3('0x10'));var qs=require(_0xa2f3('0x11'));var as=require(_0xa2f3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f3('0x13'))(_0xa2f3('0x14'));var utils=require('../../config/utils');var config=require(_0xa2f3('0x15'));var licenseUtil=require(_0xa2f3('0x16'));var db=require(_0xa2f3('0x17'))['db'];function respondWithStatusCode(_0x58f6df,_0x6aa8f2){_0x6aa8f2=_0x6aa8f2||0xcc;return function(_0x194281){if(_0x194281){return _0x58f6df[_0xa2f3('0x18')](_0x6aa8f2);}return _0x58f6df[_0xa2f3('0x19')](_0x6aa8f2)[_0xa2f3('0x1a')]();};}function respondWithResult(_0xd4f9db,_0x3907fe){_0x3907fe=_0x3907fe||0xc8;return function(_0x4544d4){if(_0x4544d4){return _0xd4f9db[_0xa2f3('0x19')](_0x3907fe)['json'](_0x4544d4);}};}function respondWithFilteredResult(_0xdc3967,_0x33bf10){return function(_0x74fb58){if(_0x74fb58){var _0x51d297=typeof _0x33bf10[_0xa2f3('0x1b')]===_0xa2f3('0x1c')&&typeof _0x33bf10['limit']==='undefined';var _0xb1fe06=_0x74fb58[_0xa2f3('0x1d')];var _0x2db0d2=_0x51d297?0x0:_0x33bf10[_0xa2f3('0x1b')];var _0x205578=_0x51d297?_0x74fb58[_0xa2f3('0x1d')]:_0x33bf10[_0xa2f3('0x1b')]+_0x33bf10[_0xa2f3('0x1e')];var _0x550d68;if(_0x205578>=_0xb1fe06){_0x205578=_0xb1fe06;_0x550d68=0xc8;}else{_0x550d68=0xce;}_0xdc3967[_0xa2f3('0x19')](_0x550d68);return _0xdc3967[_0xa2f3('0x1f')]('Content-Range',_0x2db0d2+'-'+_0x205578+'/'+_0xb1fe06)['json'](_0x74fb58);}return null;};}function patchUpdates(_0x2f74a0){return function(_0x53af81){try{jsonpatch[_0xa2f3('0x20')](_0x53af81,_0x2f74a0,!![]);}catch(_0x147fb7){return BPromise['reject'](_0x147fb7);}return _0x53af81[_0xa2f3('0x21')]();};}function saveUpdates(_0x3e055d,_0x14d989){return function(_0x2685bb){if(_0x2685bb){return _0x2685bb[_0xa2f3('0x22')](_0x3e055d)[_0xa2f3('0x23')](function(_0x37f8c2){return _0x37f8c2;});}return null;};}function removeEntity(_0xa02908,_0x49a589){return function(_0x81af9b){if(_0x81af9b){return _0x81af9b[_0xa2f3('0x24')]()[_0xa2f3('0x23')](function(){_0xa02908[_0xa2f3('0x19')](0xcc)[_0xa2f3('0x1a')]();});}};}function handleEntityNotFound(_0x2e6332,_0x1be0c1){return function(_0x5347de){if(!_0x5347de){_0x2e6332['sendStatus'](0x194);}return _0x5347de;};}function handleError(_0x2f4248,_0x4319f3){_0x4319f3=_0x4319f3||0x1f4;return function(_0x1dd4ec){logger[_0xa2f3('0x25')](_0x1dd4ec['stack']);if(_0x1dd4ec[_0xa2f3('0x26')]){delete _0x1dd4ec[_0xa2f3('0x26')];}_0x2f4248[_0xa2f3('0x19')](_0x4319f3)['send'](_0x1dd4ec);};}exports[_0xa2f3('0x27')]=function(_0x4ec4ab,_0x1ceea4){var _0x5b868c={'raw':!![],'where':{'id':_0x4ec4ab['params']['id']}},_0x452142={};_0x452142[_0xa2f3('0x28')]=_['keys'](db[_0xa2f3('0x29')][_0xa2f3('0x2a')]);_0x452142[_0xa2f3('0x2b')]=_[_0xa2f3('0x2c')](_0x4ec4ab[_0xa2f3('0x2b')]);_0x452142['filters']=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],_0x452142[_0xa2f3('0x2b')]);_0x5b868c[_0xa2f3('0x2e')]=_[_0xa2f3('0x2d')](_0x452142[_0xa2f3('0x28')],qs[_0xa2f3('0x2f')](_0x4ec4ab[_0xa2f3('0x2b')][_0xa2f3('0x2f')]));_0x5b868c['attributes']=_0x5b868c[_0xa2f3('0x2e')][_0xa2f3('0x30')]?_0x5b868c[_0xa2f3('0x2e')]:_0x452142[_0xa2f3('0x28')];if(_0x4ec4ab[_0xa2f3('0x2b')]['includeAll']){_0x5b868c[_0xa2f3('0x31')]=[{'all':!![]}];}_0x5b868c=_['merge']({},_0x5b868c,_0x4ec4ab['options']);return db[_0xa2f3('0x29')][_0xa2f3('0x32')](_0x5b868c)['then'](handleEntityNotFound(_0x1ceea4,null))[_0xa2f3('0x23')](respondWithResult(_0x1ceea4,null))[_0xa2f3('0x33')](handleError(_0x1ceea4,null));};exports['update']=function(_0x386f66,_0x3cb618){if(_0x386f66['body']['id']){delete _0x386f66['body']['id'];}return db[_0xa2f3('0x29')][_0xa2f3('0x32')]({'where':{'id':_0x386f66[_0xa2f3('0x34')]['id']}})[_0xa2f3('0x23')](handleEntityNotFound(_0x3cb618,null))['then'](saveUpdates(_0x386f66[_0xa2f3('0x35')],null))['then'](respondWithResult(_0x3cb618,null))[_0xa2f3('0x33')](handleError(_0x3cb618,null));};exports['destroy']=function(_0x5ac995,_0x37cd82){return db[_0xa2f3('0x29')]['find']({'where':{'id':_0x5ac995[_0xa2f3('0x34')]['id']}})['then'](handleEntityNotFound(_0x37cd82,null))[_0xa2f3('0x23')](removeEntity(_0x37cd82,null))[_0xa2f3('0x33')](handleError(_0x37cd82,null));};
\ No newline at end of file
+var _0x9000=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','show','params','keys','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','merge','options','ChatApplication','find','catch','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x10628b,_0xcc6030){var _0xd18e2d=function(_0x402976){while(--_0x402976){_0x10628b['push'](_0x10628b['shift']());}};_0xd18e2d(++_0xcc6030);}(_0x9000,0x19e));var _0x0900=function(_0xec1b03,_0x1ed76f){_0xec1b03=_0xec1b03-0x0;var _0x140c51=_0x9000[_0xec1b03];return _0x140c51;};'use strict';var emlformat=require(_0x0900('0x0'));var rimraf=require(_0x0900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0900('0x2'));var rp=require(_0x0900('0x3'));var moment=require(_0x0900('0x4'));var BPromise=require(_0x0900('0x5'));var Mustache=require(_0x0900('0x6'));var util=require(_0x0900('0x7'));var path=require(_0x0900('0x8'));var sox=require(_0x0900('0x9'));var csv=require(_0x0900('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0900('0xb'));var _=require('lodash');var squel=require(_0x0900('0xc'));var crypto=require(_0x0900('0xd'));var jsforce=require(_0x0900('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0900('0xf'));var Papa=require(_0x0900('0x10'));var Redis=require(_0x0900('0x11'));var authService=require(_0x0900('0x12'));var qs=require(_0x0900('0x13'));var as=require(_0x0900('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0900('0x15'))(_0x0900('0x16'));var utils=require(_0x0900('0x17'));var config=require(_0x0900('0x18'));var licenseUtil=require(_0x0900('0x19'));var db=require(_0x0900('0x1a'))['db'];function respondWithStatusCode(_0xe8ae24,_0x11d1b6){_0x11d1b6=_0x11d1b6||0xcc;return function(_0x3a235b){if(_0x3a235b){return _0xe8ae24[_0x0900('0x1b')](_0x11d1b6);}return _0xe8ae24['status'](_0x11d1b6)[_0x0900('0x1c')]();};}function respondWithResult(_0x183ca6,_0x4ea071){_0x4ea071=_0x4ea071||0xc8;return function(_0x52bb65){if(_0x52bb65){return _0x183ca6[_0x0900('0x1d')](_0x4ea071)['json'](_0x52bb65);}};}function respondWithFilteredResult(_0x3d58eb,_0x4f5eee){return function(_0x35dbd6){if(_0x35dbd6){var _0xb184b6=typeof _0x4f5eee[_0x0900('0x1e')]===_0x0900('0x1f')&&typeof _0x4f5eee['limit']==='undefined';var _0x2a6b91=_0x35dbd6[_0x0900('0x20')];var _0x3f09ee=_0xb184b6?0x0:_0x4f5eee[_0x0900('0x1e')];var _0x5bc7ec=_0xb184b6?_0x35dbd6[_0x0900('0x20')]:_0x4f5eee[_0x0900('0x1e')]+_0x4f5eee[_0x0900('0x21')];var _0x34968a;if(_0x5bc7ec>=_0x2a6b91){_0x5bc7ec=_0x2a6b91;_0x34968a=0xc8;}else{_0x34968a=0xce;}_0x3d58eb[_0x0900('0x1d')](_0x34968a);return _0x3d58eb[_0x0900('0x22')](_0x0900('0x23'),_0x3f09ee+'-'+_0x5bc7ec+'/'+_0x2a6b91)[_0x0900('0x24')](_0x35dbd6);}return null;};}function patchUpdates(_0x4de1d3){return function(_0x5ed4e8){try{jsonpatch[_0x0900('0x25')](_0x5ed4e8,_0x4de1d3,!![]);}catch(_0x5c54a9){return BPromise[_0x0900('0x26')](_0x5c54a9);}return _0x5ed4e8['save']();};}function saveUpdates(_0x41b74a,_0x1f3738){return function(_0x3dc6bc){if(_0x3dc6bc){return _0x3dc6bc['update'](_0x41b74a)[_0x0900('0x27')](function(_0x492a51){return _0x492a51;});}return null;};}function removeEntity(_0x2fd307,_0x369f5a){return function(_0xce8f6e){if(_0xce8f6e){return _0xce8f6e[_0x0900('0x28')]()[_0x0900('0x27')](function(){_0x2fd307[_0x0900('0x1d')](0xcc)[_0x0900('0x1c')]();});}};}function handleEntityNotFound(_0x51fe9f,_0x7b6765){return function(_0x34d63f){if(!_0x34d63f){_0x51fe9f[_0x0900('0x1b')](0x194);}return _0x34d63f;};}function handleError(_0x569856,_0x574307){_0x574307=_0x574307||0x1f4;return function(_0x51ee3a){logger['error'](_0x51ee3a[_0x0900('0x29')]);if(_0x51ee3a[_0x0900('0x2a')]){delete _0x51ee3a['name'];}_0x569856[_0x0900('0x1d')](_0x574307)['send'](_0x51ee3a);};}exports[_0x0900('0x2b')]=function(_0x13fa35,_0x2a8a71){var _0x257914={'raw':!![],'where':{'id':_0x13fa35[_0x0900('0x2c')]['id']}},_0x3fbd95={};_0x3fbd95['model']=_[_0x0900('0x2d')](db['ChatApplication'][_0x0900('0x2e')]);_0x3fbd95[_0x0900('0x2f')]=_[_0x0900('0x2d')](_0x13fa35['query']);_0x3fbd95[_0x0900('0x30')]=_[_0x0900('0x31')](_0x3fbd95[_0x0900('0x32')],_0x3fbd95[_0x0900('0x2f')]);_0x257914['attributes']=_[_0x0900('0x31')](_0x3fbd95['model'],qs[_0x0900('0x33')](_0x13fa35[_0x0900('0x2f')][_0x0900('0x33')]));_0x257914[_0x0900('0x34')]=_0x257914[_0x0900('0x34')][_0x0900('0x35')]?_0x257914['attributes']:_0x3fbd95[_0x0900('0x32')];if(_0x13fa35[_0x0900('0x2f')][_0x0900('0x36')]){_0x257914['include']=[{'all':!![]}];}_0x257914=_[_0x0900('0x37')]({},_0x257914,_0x13fa35[_0x0900('0x38')]);return db[_0x0900('0x39')][_0x0900('0x3a')](_0x257914)[_0x0900('0x27')](handleEntityNotFound(_0x2a8a71,null))[_0x0900('0x27')](respondWithResult(_0x2a8a71,null))[_0x0900('0x3b')](handleError(_0x2a8a71,null));};exports[_0x0900('0x3c')]=function(_0x4b06e2,_0x4d67ad){if(_0x4b06e2['body']['id']){delete _0x4b06e2[_0x0900('0x3d')]['id'];}return db[_0x0900('0x39')][_0x0900('0x3a')]({'where':{'id':_0x4b06e2['params']['id']}})['then'](handleEntityNotFound(_0x4d67ad,null))[_0x0900('0x27')](saveUpdates(_0x4b06e2[_0x0900('0x3d')],null))[_0x0900('0x27')](respondWithResult(_0x4d67ad,null))['catch'](handleError(_0x4d67ad,null));};exports[_0x0900('0x28')]=function(_0x2622d1,_0x108d1a){return db[_0x0900('0x39')][_0x0900('0x3a')]({'where':{'id':_0x2622d1[_0x0900('0x2c')]['id']}})[_0x0900('0x27')](handleEntityNotFound(_0x108d1a,null))[_0x0900('0x27')](removeEntity(_0x108d1a,null))[_0x0900('0x3b')](handleError(_0x108d1a,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index de7ea2a..edff7ca 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 _0x1061=['./chatApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x1061,0x1b5));var _0x1106=function(_0x3c0976,_0x3a6f0b){_0x3c0976=_0x3c0976-0x0;var _0x54b6e0=_0x1061[_0x3c0976];return _0x54b6e0;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1106('0x1'));var BPromise=require(_0x1106('0x2'));var rp=require(_0x1106('0x3'));var fs=require('fs');var path=require(_0x1106('0x4'));var rimraf=require(_0x1106('0x5'));var config=require(_0x1106('0x6'));var attributes=require(_0x1106('0x7'));module[_0x1106('0x8')]=function(_0x5120c6,_0x1f098a){return _0x5120c6[_0x1106('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1106('0xa'),'collate':_0x1106('0xb')});};
\ No newline at end of file
+var _0x1f71=['path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','api','bluebird'];(function(_0x1f7839,_0x2a26e6){var _0x36b42e=function(_0x553222){while(--_0x553222){_0x1f7839['push'](_0x1f7839['shift']());}};_0x36b42e(++_0x2a26e6);}(_0x1f71,0xfa));var _0x11f7=function(_0x371902,_0x1296e1){_0x371902=_0x371902-0x0;var _0xb57653=_0x1f71[_0x371902];return _0xb57653;};'use strict';var _=require(_0x11f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x11f7('0x1'));var moment=require('moment');var BPromise=require(_0x11f7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11f7('0x3'));var rimraf=require(_0x11f7('0x4'));var config=require('../../config/environment');var attributes=require(_0x11f7('0x5'));module[_0x11f7('0x6')]=function(_0x2d0ec5,_0x4b5821){return _0x2d0ec5[_0x11f7('0x7')](_0x11f7('0x8'),attributes,{'tableName':_0x11f7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x11f7('0xa')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index b3c29fd..2f38d51 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 _0x95cd=['ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','request\x20sent','debug'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x95cd,0xbb));var _0xd95c=function(_0x2686f3,_0x3ee836){_0x2686f3=_0x2686f3-0x0;var _0x3f08f=_0x95cd[_0x2686f3];return _0x3f08f;};'use strict';var _=require('lodash');var util=require(_0xd95c('0x0'));var moment=require(_0xd95c('0x1'));var BPromise=require(_0xd95c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd95c('0x3'));var db=require(_0xd95c('0x4'))['db'];var utils=require(_0xd95c('0x5'));var logger=require(_0xd95c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd95c('0x7'));var client=jayson['client'][_0xd95c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9d807b,_0x366083,_0x56ede8){return new BPromise(function(_0x17f34d,_0x2f2092){return client['request'](_0x9d807b,_0x56ede8)[_0xd95c('0x9')](function(_0x29ab56){logger[_0xd95c('0xa')]('ChatApplication,\x20%s,\x20%s',_0x366083,_0xd95c('0xb'));logger[_0xd95c('0xc')](_0xd95c('0xd'),_0x366083,_0xd95c('0xb'),JSON[_0xd95c('0xe')](_0x29ab56));if(_0x29ab56[_0xd95c('0xf')]){if(_0x29ab56[_0xd95c('0xf')][_0xd95c('0x10')]===0x1f4){logger[_0xd95c('0xf')]('ChatApplication,\x20%s,\x20%s',_0x366083,_0x29ab56['error'][_0xd95c('0x11')]);return _0x2f2092(_0x29ab56[_0xd95c('0xf')][_0xd95c('0x11')]);}logger['error'](_0xd95c('0x12'),_0x366083,_0x29ab56['error'][_0xd95c('0x11')]);return _0x17f34d(_0x29ab56[_0xd95c('0xf')][_0xd95c('0x11')]);}else{logger[_0xd95c('0xa')]('ChatApplication,\x20%s,\x20%s',_0x366083,_0xd95c('0xb'));_0x17f34d(_0x29ab56['result'][_0xd95c('0x11')]);}})[_0xd95c('0x13')](function(_0x4d8d40){logger[_0xd95c('0xf')](_0xd95c('0x12'),_0x366083,_0x4d8d40);_0x2f2092(_0x4d8d40);});});}
\ No newline at end of file
+var _0xee06=['client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2eb4ce,_0x245271){var _0x2cb386=function(_0x20bf4d){while(--_0x20bf4d){_0x2eb4ce['push'](_0x2eb4ce['shift']());}};_0x2cb386(++_0x245271);}(_0xee06,0x16b));var _0x6ee0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee06[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6ee0('0x0'));var util=require(_0x6ee0('0x1'));var moment=require(_0x6ee0('0x2'));var BPromise=require(_0x6ee0('0x3'));var rs=require(_0x6ee0('0x4'));var fs=require('fs');var Redis=require(_0x6ee0('0x5'));var db=require(_0x6ee0('0x6'))['db'];var utils=require(_0x6ee0('0x7'));var logger=require(_0x6ee0('0x8'))(_0x6ee0('0x9'));var config=require(_0x6ee0('0xa'));var jayson=require(_0x6ee0('0xb'));var client=jayson[_0x6ee0('0xc')][_0x6ee0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28bea2,_0x4201c4,_0x3f1c51){return new BPromise(function(_0x4a307c,_0x2b0823){return client[_0x6ee0('0xe')](_0x28bea2,_0x3f1c51)[_0x6ee0('0xf')](function(_0x38806f){logger[_0x6ee0('0x10')](_0x6ee0('0x11'),_0x4201c4,_0x6ee0('0x12'));logger['debug'](_0x6ee0('0x13'),_0x4201c4,_0x6ee0('0x12'),JSON['stringify'](_0x38806f));if(_0x38806f[_0x6ee0('0x14')]){if(_0x38806f[_0x6ee0('0x14')][_0x6ee0('0x15')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x4201c4,_0x38806f[_0x6ee0('0x14')]['message']);return _0x2b0823(_0x38806f[_0x6ee0('0x14')][_0x6ee0('0x16')]);}logger['error'](_0x6ee0('0x11'),_0x4201c4,_0x38806f[_0x6ee0('0x14')]['message']);return _0x4a307c(_0x38806f[_0x6ee0('0x14')]['message']);}else{logger[_0x6ee0('0x10')](_0x6ee0('0x11'),_0x4201c4,_0x6ee0('0x12'));_0x4a307c(_0x38806f[_0x6ee0('0x17')][_0x6ee0('0x16')]);}})[_0x6ee0('0x18')](function(_0x5ed815){logger['error'](_0x6ee0('0x11'),_0x4201c4,_0x5ed815);_0x2b0823(_0x5ed815);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ba40703..60c2f31 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 _0x65fe=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x5d92f1,_0x30e8a2){var _0x3d1ead=function(_0x164a74){while(--_0x164a74){_0x5d92f1['push'](_0x5d92f1['shift']());}};_0x3d1ead(++_0x30e8a2);}(_0x65fe,0x17a));var _0xe65f=function(_0x208980,_0x2ed68d){_0x208980=_0x208980-0x0;var _0x4b03a6=_0x65fe[_0x208980];return _0x4b03a6;};'use strict';var multer=require('multer');var util=require(_0xe65f('0x0'));var path=require(_0xe65f('0x1'));var timeout=require(_0xe65f('0x2'));var express=require(_0xe65f('0x3'));var router=express[_0xe65f('0x4')]();var fs_extra=require(_0xe65f('0x5'));var auth=require(_0xe65f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe65f('0x7'));var controller=require(_0xe65f('0x8'));router[_0xe65f('0x9')](_0xe65f('0xa'),auth[_0xe65f('0xb')](),controller[_0xe65f('0xc')]);router['put'](_0xe65f('0xa'),auth['isAuthenticated'](),controller[_0xe65f('0xd')]);router[_0xe65f('0xe')](_0xe65f('0xa'),auth['isAuthenticated'](),controller[_0xe65f('0xf')]);module[_0xe65f('0x10')]=router;
\ No newline at end of file
+var _0x2d7e=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','path'];(function(_0x4442bc,_0x1dd441){var _0x1b87f8=function(_0x3b191c){while(--_0x3b191c){_0x4442bc['push'](_0x4442bc['shift']());}};_0x1b87f8(++_0x1dd441);}(_0x2d7e,0x7c));var _0xe2d7=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x2d7e[_0x4b2863];return _0x567d67;};'use strict';var multer=require(_0xe2d7('0x0'));var util=require('util');var path=require(_0xe2d7('0x1'));var timeout=require(_0xe2d7('0x2'));var express=require(_0xe2d7('0x3'));var router=express['Router']();var fs_extra=require(_0xe2d7('0x4'));var auth=require(_0xe2d7('0x5'));var interaction=require(_0xe2d7('0x6'));var config=require(_0xe2d7('0x7'));var controller=require(_0xe2d7('0x8'));router[_0xe2d7('0x9')](_0xe2d7('0xa'),auth['isAuthenticated'](),controller[_0xe2d7('0xb')]);router[_0xe2d7('0xc')]('/:id',auth[_0xe2d7('0xd')](),controller[_0xe2d7('0xe')]);router[_0xe2d7('0xf')](_0xe2d7('0xa'),auth[_0xe2d7('0xd')](),controller[_0xe2d7('0x10')]);module[_0xe2d7('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 4e86f63..d0f454b 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 _0x59cd=['sequelize','exports','STRING','BOOLEAN'];(function(_0x3cc1ce,_0x45d6ef){var _0x166858=function(_0x137f85){while(--_0x137f85){_0x3cc1ce['push'](_0x3cc1ce['shift']());}};_0x166858(++_0x45d6ef);}(_0x59cd,0x108));var _0xd59c=function(_0x480f4a,_0x2ea3f8){_0x480f4a=_0x480f4a-0x0;var _0xdccb7d=_0x59cd[_0x480f4a];return _0xdccb7d;};'use strict';var Sequelize=require(_0xd59c('0x0'));module[_0xd59c('0x1')]={'name':{'type':Sequelize[_0xd59c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd59c('0x2')]},'write':{'type':Sequelize[_0xd59c('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x6e2e=['BOOLEAN','sequelize','STRING'];(function(_0x555317,_0x12c7ce){var _0x1773ce=function(_0x5a889b){while(--_0x5a889b){_0x555317['push'](_0x555317['shift']());}};_0x1773ce(++_0x12c7ce);}(_0x6e2e,0xd9));var _0xe6e2=function(_0x1c86cf,_0xd758df){_0x1c86cf=_0x1c86cf-0x0;var _0x22c104=_0x6e2e[_0x1c86cf];return _0x22c104;};'use strict';var Sequelize=require(_0xe6e2('0x0'));module['exports']={'name':{'type':Sequelize[_0xe6e2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xe6e2('0x1')]},'write':{'type':Sequelize[_0xe6e2('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 fbc89af..f00e351 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 _0x424b=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ChatGroup','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5d2cb7,_0x4519f6){var _0x4828f6=function(_0x1f9a53){while(--_0x1f9a53){_0x5d2cb7['push'](_0x5d2cb7['shift']());}};_0x4828f6(++_0x4519f6);}(_0x424b,0x1f2));var _0xb424=function(_0xc5d10e,_0x2d0e97){_0xc5d10e=_0xc5d10e-0x0;var _0x56b61d=_0x424b[_0xc5d10e];return _0x56b61d;};'use strict';var emlformat=require(_0xb424('0x0'));var rimraf=require(_0xb424('0x1'));var zipdir=require(_0xb424('0x2'));var jsonpatch=require(_0xb424('0x3'));var rp=require(_0xb424('0x4'));var moment=require(_0xb424('0x5'));var BPromise=require(_0xb424('0x6'));var Mustache=require(_0xb424('0x7'));var util=require(_0xb424('0x8'));var path=require(_0xb424('0x9'));var sox=require(_0xb424('0xa'));var csv=require(_0xb424('0xb'));var ejs=require(_0xb424('0xc'));var fs=require('fs');var fs_extra=require(_0xb424('0xd'));var _=require(_0xb424('0xe'));var squel=require(_0xb424('0xf'));var crypto=require(_0xb424('0x10'));var jsforce=require(_0xb424('0x11'));var deskjs=require(_0xb424('0x12'));var toCsv=require(_0xb424('0xb'));var querystring=require(_0xb424('0x13'));var Papa=require('papaparse');var Redis=require(_0xb424('0x14'));var authService=require(_0xb424('0x15'));var qs=require(_0xb424('0x16'));var as=require(_0xb424('0x17'));var hardwareService=require(_0xb424('0x18'));var logger=require(_0xb424('0x19'))(_0xb424('0x1a'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb424('0x1b'));var db=require(_0xb424('0x1c'))['db'];config['redis']=_[_0xb424('0x1d')](config[_0xb424('0x1e')],{'host':_0xb424('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb424('0x1e')]));require('./chatGroup.socket')[_0xb424('0x20')](socket);function respondWithStatusCode(_0x157932,_0x12d767){_0x12d767=_0x12d767||0xcc;return function(_0x13b22b){if(_0x13b22b){return _0x157932['sendStatus'](_0x12d767);}return _0x157932[_0xb424('0x21')](_0x12d767)[_0xb424('0x22')]();};}function respondWithResult(_0xf53a0f,_0x723832){_0x723832=_0x723832||0xc8;return function(_0x4abeb7){if(_0x4abeb7){return _0xf53a0f[_0xb424('0x21')](_0x723832)[_0xb424('0x23')](_0x4abeb7);}};}function respondWithFilteredResult(_0x4d7212,_0x1e6b9d){return function(_0x306926){if(_0x306926){var _0x59af49=typeof _0x1e6b9d[_0xb424('0x24')]===_0xb424('0x25')&&typeof _0x1e6b9d[_0xb424('0x26')]==='undefined';var _0x38ea5d=_0x306926[_0xb424('0x27')];var _0x946359=_0x59af49?0x0:_0x1e6b9d[_0xb424('0x24')];var _0x5c8e06=_0x59af49?_0x306926[_0xb424('0x27')]:_0x1e6b9d['offset']+_0x1e6b9d['limit'];var _0x390c6f;if(_0x5c8e06>=_0x38ea5d){_0x5c8e06=_0x38ea5d;_0x390c6f=0xc8;}else{_0x390c6f=0xce;}_0x4d7212['status'](_0x390c6f);return _0x4d7212[_0xb424('0x28')](_0xb424('0x29'),_0x946359+'-'+_0x5c8e06+'/'+_0x38ea5d)['json'](_0x306926);}return null;};}function patchUpdates(_0x5160bc){return function(_0x16fb61){try{jsonpatch[_0xb424('0x2a')](_0x16fb61,_0x5160bc,!![]);}catch(_0x3e4070){return BPromise[_0xb424('0x2b')](_0x3e4070);}return _0x16fb61[_0xb424('0x2c')]();};}function saveUpdates(_0x941562,_0xbe4264){return function(_0xbbcf86){if(_0xbbcf86){return _0xbbcf86[_0xb424('0x2d')](_0x941562)[_0xb424('0x2e')](function(_0x1eb51e){return _0x1eb51e;});}return null;};}function removeEntity(_0x27e72b,_0x3c2a27){return function(_0x2e1cdc){if(_0x2e1cdc){return _0x2e1cdc[_0xb424('0x2f')]()[_0xb424('0x2e')](function(){_0x27e72b[_0xb424('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392e56,_0x18d2ef){return function(_0x2036ca){if(!_0x2036ca){_0x392e56[_0xb424('0x30')](0x194);}return _0x2036ca;};}function handleError(_0x42ff17,_0x42df08){_0x42df08=_0x42df08||0x1f4;return function(_0x4db91e){logger[_0xb424('0x31')](_0x4db91e['stack']);if(_0x4db91e[_0xb424('0x32')]){delete _0x4db91e[_0xb424('0x32')];}_0x42ff17[_0xb424('0x21')](_0x42df08)[_0xb424('0x33')](_0x4db91e);};}exports[_0xb424('0x34')]=function(_0x25e943,_0x406e0e){var _0x5af26e={},_0x8aa951={},_0x168eff={'count':0x0,'rows':[]};var _0x117596=_[_0xb424('0x35')](db[_0xb424('0x36')][_0xb424('0x37')],function(_0x16abaf){return{'name':_0x16abaf['fieldName'],'type':_0x16abaf[_0xb424('0x38')][_0xb424('0x39')]};});_0x8aa951[_0xb424('0x3a')]=_['map'](_0x117596,_0xb424('0x32'));_0x8aa951['query']=_[_0xb424('0x3b')](_0x25e943['query']);_0x8aa951[_0xb424('0x3c')]=_[_0xb424('0x3d')](_0x8aa951[_0xb424('0x3a')],_0x8aa951[_0xb424('0x3e')]);_0x5af26e[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x8aa951[_0xb424('0x3a')],qs['fields'](_0x25e943[_0xb424('0x3e')][_0xb424('0x40')]));_0x5af26e['attributes']=_0x5af26e[_0xb424('0x3f')][_0xb424('0x41')]?_0x5af26e[_0xb424('0x3f')]:_0x8aa951[_0xb424('0x3a')];if(!_0x25e943[_0xb424('0x3e')]['hasOwnProperty'](_0xb424('0x42'))){_0x5af26e[_0xb424('0x26')]=qs[_0xb424('0x26')](_0x25e943[_0xb424('0x3e')][_0xb424('0x26')]);_0x5af26e['offset']=qs[_0xb424('0x24')](_0x25e943[_0xb424('0x3e')][_0xb424('0x24')]);}_0x5af26e[_0xb424('0x43')]=qs[_0xb424('0x44')](_0x25e943[_0xb424('0x3e')][_0xb424('0x44')]);_0x5af26e['where']=qs[_0xb424('0x3c')](_[_0xb424('0x45')](_0x25e943['query'],_0x8aa951[_0xb424('0x3c')]),_0x117596);if(_0x25e943[_0xb424('0x3e')][_0xb424('0x46')]){_0x5af26e[_0xb424('0x47')]=_[_0xb424('0x48')](_0x5af26e[_0xb424('0x47')],{'$or':_[_0xb424('0x35')](_0x117596,function(_0x1d9f85){if(_0x1d9f85[_0xb424('0x38')]!=='VIRTUAL'){var _0x393c9f={};_0x393c9f[_0x1d9f85['name']]={'$like':'%'+_0x25e943[_0xb424('0x3e')][_0xb424('0x46')]+'%'};return _0x393c9f;}})});}_0x5af26e=_[_0xb424('0x48')]({},_0x5af26e,_0x25e943[_0xb424('0x49')]);var _0x5d7488={'where':_0x5af26e['where']};return db['ChatGroup'][_0xb424('0x27')](_0x5d7488)[_0xb424('0x2e')](function(_0x38a702){_0x168eff[_0xb424('0x27')]=_0x38a702;if(_0x25e943['query']['includeAll']){_0x5af26e[_0xb424('0x4a')]=[{'all':!![]}];}return db[_0xb424('0x36')][_0xb424('0x4b')](_0x5af26e);})[_0xb424('0x2e')](function(_0x254bff){_0x168eff[_0xb424('0x4c')]=_0x254bff;return _0x168eff;})['then'](respondWithFilteredResult(_0x406e0e,_0x5af26e))[_0xb424('0x4d')](handleError(_0x406e0e,null));};exports[_0xb424('0x4e')]=function(_0x50dbdb,_0x17eb21){var _0x2ab3ef={'raw':!![],'where':{'id':_0x50dbdb['params']['id']}},_0x10ecd1={};_0x10ecd1[_0xb424('0x3a')]=_[_0xb424('0x3b')](db[_0xb424('0x36')][_0xb424('0x37')]);_0x10ecd1[_0xb424('0x3e')]=_[_0xb424('0x3b')](_0x50dbdb[_0xb424('0x3e')]);_0x10ecd1[_0xb424('0x3c')]=_['intersection'](_0x10ecd1['model'],_0x10ecd1['query']);_0x2ab3ef[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x10ecd1[_0xb424('0x3a')],qs[_0xb424('0x40')](_0x50dbdb[_0xb424('0x3e')][_0xb424('0x40')]));_0x2ab3ef['attributes']=_0x2ab3ef['attributes'][_0xb424('0x41')]?_0x2ab3ef[_0xb424('0x3f')]:_0x10ecd1[_0xb424('0x3a')];if(_0x50dbdb['query'][_0xb424('0x4f')]){_0x2ab3ef['include']=[{'all':!![]}];}_0x2ab3ef=_['merge']({},_0x2ab3ef,_0x50dbdb['options']);return db[_0xb424('0x36')][_0xb424('0x50')](_0x2ab3ef)[_0xb424('0x2e')](handleEntityNotFound(_0x17eb21,null))['then'](respondWithResult(_0x17eb21,null))[_0xb424('0x4d')](handleError(_0x17eb21,null));};exports[_0xb424('0x51')]=function(_0x3cffb4,_0x4b47aa){return db[_0xb424('0x36')]['create'](_0x3cffb4[_0xb424('0x52')],{})['then'](respondWithResult(_0x4b47aa,0xc9))[_0xb424('0x4d')](handleError(_0x4b47aa,null));};exports[_0xb424('0x2d')]=function(_0x364165,_0x35af17){if(_0x364165['body']['id']){delete _0x364165[_0xb424('0x52')]['id'];}return db[_0xb424('0x36')][_0xb424('0x50')]({'where':{'id':_0x364165[_0xb424('0x53')]['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x35af17,null))[_0xb424('0x2e')](saveUpdates(_0x364165[_0xb424('0x52')],null))[_0xb424('0x2e')](respondWithResult(_0x35af17,null))[_0xb424('0x4d')](handleError(_0x35af17,null));};exports[_0xb424('0x2f')]=function(_0x28312b,_0xd4dfa){return db['ChatGroup']['find']({'where':{'id':_0x28312b[_0xb424('0x53')]['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0xd4dfa,null))[_0xb424('0x2e')](removeEntity(_0xd4dfa,null))[_0xb424('0x4d')](handleError(_0xd4dfa,null));};exports[_0xb424('0x54')]=function(_0x439aaa,_0x14972c){return db[_0xb424('0x36')][_0xb424('0x54')]()[_0xb424('0x2e')](respondWithResult(_0x14972c,null))[_0xb424('0x4d')](handleError(_0x14972c,null));};exports['getUnread']=function(_0xe5e196,_0xc4bde,_0x4965e2){return db['ChatInternalMessage'][_0xb424('0x27')]({'where':{'ChatGroupId':_0xe5e196[_0xb424('0x53')]['id'],'ToId':_0xe5e196[_0xb424('0x55')]['id'],'read':![]}})['then'](function(_0x14593a){return{'id':_[_0xb424('0x56')](_0xe5e196[_0xb424('0x53')]['id']),'count':_0x14593a};})['then'](respondWithResult(_0xc4bde,null))[_0xb424('0x4d')](handleError(_0xc4bde,null));};exports[_0xb424('0x57')]=function(_0x5bf52d,_0x577365,_0x14fbc4){return db['ChatGroup'][_0xb424('0x50')]({'where':{'id':_0x5bf52d['params']['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x577365,null))['then'](function(_0x5296b3){if(_0x5296b3){return _0x5296b3[_0xb424('0x57')](_0x5bf52d[_0xb424('0x52')][_0xb424('0x58')],_[_0xb424('0x59')](_0x5bf52d[_0xb424('0x52')],[_0xb424('0x58'),'id'])||{});}})[_0xb424('0x2e')](respondWithResult(_0x577365,null))[_0xb424('0x4d')](handleError(_0x577365,null));};exports[_0xb424('0x5a')]=function(_0x355289,_0x506019,_0x12c44d){var _0x1b3800={};var _0x4c1882={};var _0x7ca24b;var _0x45c006;return db[_0xb424('0x36')][_0xb424('0x5b')]({'where':{'id':_0x355289['params']['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x506019,null))['then'](function(_0x44cc00){if(_0x44cc00){_0x7ca24b=_0x44cc00;_0x4c1882[_0xb424('0x3a')]=_['keys'](db[_0xb424('0x5c')][_0xb424('0x37')]);_0x4c1882[_0xb424('0x3e')]=_[_0xb424('0x3b')](_0x355289[_0xb424('0x3e')]);_0x4c1882[_0xb424('0x3c')]=_['intersection'](_0x4c1882[_0xb424('0x3a')],_0x4c1882[_0xb424('0x3e')]);_0x1b3800[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x4c1882[_0xb424('0x3a')],qs['fields'](_0x355289['query'][_0xb424('0x40')]));_0x1b3800[_0xb424('0x3f')]=_0x1b3800[_0xb424('0x3f')][_0xb424('0x41')]?_0x1b3800['attributes']:_0x4c1882[_0xb424('0x3a')];_0x1b3800[_0xb424('0x43')]=qs['sort'](_0x355289[_0xb424('0x3e')][_0xb424('0x44')]);_0x1b3800[_0xb424('0x47')]=qs[_0xb424('0x3c')](_[_0xb424('0x45')](_0x355289[_0xb424('0x3e')],_0x4c1882[_0xb424('0x3c')]));if(_0x355289[_0xb424('0x3e')][_0xb424('0x46')]){_0x1b3800[_0xb424('0x47')]=_[_0xb424('0x48')](_0x1b3800[_0xb424('0x47')],{'$or':_['map'](_0x1b3800[_0xb424('0x3f')],function(_0xc8b3b1){var _0x46bd55={};_0x46bd55[_0xc8b3b1]={'$like':'%'+_0x355289[_0xb424('0x3e')][_0xb424('0x46')]+'%'};return _0x46bd55;})});}_0x1b3800=_[_0xb424('0x48')]({},_0x1b3800,_0x355289[_0xb424('0x49')]);return _0x7ca24b[_0xb424('0x5a')](_0x1b3800);}})[_0xb424('0x2e')](function(_0x315661){if(_0x315661){_0x45c006=_0x315661['length'];if(!_0x355289[_0xb424('0x3e')][_0xb424('0x5d')](_0xb424('0x42'))){_0x1b3800[_0xb424('0x26')]=qs['limit'](_0x355289['query']['limit']);_0x1b3800[_0xb424('0x24')]=qs[_0xb424('0x24')](_0x355289[_0xb424('0x3e')][_0xb424('0x24')]);}return _0x7ca24b['getMembers'](_0x1b3800);}})[_0xb424('0x2e')](function(_0x2a44cb){if(_0x2a44cb){return _0x2a44cb?{'count':_0x45c006,'rows':_0x2a44cb}:null;}})[_0xb424('0x2e')](respondWithResult(_0x506019,null))[_0xb424('0x4d')](handleError(_0x506019,null));};exports[_0xb424('0x5e')]=function(_0x46bdf1,_0x5d4e40,_0x44e7b0){return db[_0xb424('0x36')][_0xb424('0x50')]({'where':{'id':_0x46bdf1[_0xb424('0x53')]['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x5d4e40,null))['then'](function(_0x1ac852){if(_0x1ac852){return _0x1ac852[_0xb424('0x5e')](_0x46bdf1['query'][_0xb424('0x58')]);}})[_0xb424('0x2e')](respondWithStatusCode(_0x5d4e40,null))['catch'](handleError(_0x5d4e40,null));};exports['addMessage']=function(_0x5a7755,_0x4740ea,_0x49063e){if(_0x5a7755['body']['id']){delete _0x5a7755[_0xb424('0x52')]['id'];}return db[_0xb424('0x36')][_0xb424('0x50')]({'where':{'id':_0x5a7755['params']['id']}})[_0xb424('0x2e')](handleEntityNotFound(_0x4740ea,null))[_0xb424('0x2e')](function(_0x83d32f){if(_0x83d32f){_0x5a7755['body'][_0xb424('0x5f')]=_0x83d32f['id'];return db[_0xb424('0x60')]['create'](_0x5a7755[_0xb424('0x52')]);}})[_0xb424('0x2e')](respondWithResult(_0x4740ea,null))['catch'](handleError(_0x4740ea,null));};exports[_0xb424('0x61')]=function(_0x5b1d26,_0x4ab23a,_0x25bac1){var _0x47b27e={};var _0x5ce242={};var _0x13979f;var _0x18f90e;return db['ChatGroup'][_0xb424('0x5b')]({'where':{'id':_0x5b1d26['params']['id']}})['then'](handleEntityNotFound(_0x4ab23a,null))[_0xb424('0x2e')](function(_0x47626a){if(_0x47626a){_0x13979f=_0x47626a;_0x5ce242[_0xb424('0x3a')]=_['keys'](db['ChatInternalMessage'][_0xb424('0x37')]);_0x5ce242[_0xb424('0x3e')]=_[_0xb424('0x3b')](_0x5b1d26[_0xb424('0x3e')]);_0x5ce242[_0xb424('0x3c')]=_[_0xb424('0x3d')](_0x5ce242[_0xb424('0x3a')],_0x5ce242[_0xb424('0x3e')]);_0x47b27e[_0xb424('0x3f')]=_[_0xb424('0x3d')](_0x5ce242[_0xb424('0x3a')],qs[_0xb424('0x40')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x40')]));_0x47b27e[_0xb424('0x3f')]=_0x47b27e['attributes']['length']?_0x47b27e[_0xb424('0x3f')]:_0x5ce242[_0xb424('0x3a')];_0x47b27e[_0xb424('0x43')]=qs[_0xb424('0x44')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x44')]);_0x47b27e['where']=qs[_0xb424('0x3c')](_[_0xb424('0x45')](_0x5b1d26[_0xb424('0x3e')],_0x5ce242[_0xb424('0x3c')]));if(_0x5b1d26[_0xb424('0x3e')][_0xb424('0x46')]){_0x47b27e[_0xb424('0x47')]=_[_0xb424('0x48')](_0x47b27e[_0xb424('0x47')],{'$or':_[_0xb424('0x35')](_0x47b27e[_0xb424('0x3f')],function(_0x2bf732){var _0x44f9a7={};_0x44f9a7[_0x2bf732]={'$like':'%'+_0x5b1d26[_0xb424('0x3e')][_0xb424('0x46')]+'%'};return _0x44f9a7;})});}if(_0x5b1d26[_0xb424('0x3e')][_0xb424('0x62')]){var _0x45be19=_0x5b1d26[_0xb424('0x3e')]['$gte'][_0xb424('0x63')](',');var _0x755b76={};_0x755b76[_0x45be19[0x0]]={'$gte':moment(_0x45be19[0x1])[_0xb424('0x64')]('YYYY-MM-DD\x20HH:mm:ss')};_0x47b27e[_0xb424('0x47')]=_[_0xb424('0x48')](_0x47b27e[_0xb424('0x47')],_0x755b76);}_0x47b27e=_[_0xb424('0x48')]({},_0x47b27e,_0x5b1d26['options']);return _0x13979f[_0xb424('0x61')](_0x47b27e);}})[_0xb424('0x2e')](function(_0x1eb85d){if(_0x1eb85d){_0x18f90e=_0x1eb85d[_0xb424('0x41')];if(!_0x5b1d26[_0xb424('0x3e')][_0xb424('0x5d')]('nolimit')){_0x47b27e[_0xb424('0x26')]=qs[_0xb424('0x26')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x26')]);_0x47b27e['offset']=qs[_0xb424('0x24')](_0x5b1d26[_0xb424('0x3e')][_0xb424('0x24')]);}return _0x13979f['getMessages'](_0x47b27e);}})[_0xb424('0x2e')](function(_0x5722dc){if(_0x5722dc){return _0x5722dc?{'count':_0x18f90e,'rows':_0x5722dc}:null;}})['then'](respondWithResult(_0x4ab23a,null))[_0xb424('0x4d')](handleError(_0x4ab23a,null));};
\ No newline at end of file
+var _0x9baa=['error','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','keys','filters','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','User','removeMembers','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x2370db,_0x592999){var _0x47585c=function(_0xb6899e){while(--_0xb6899e){_0x2370db['push'](_0x2370db['shift']());}};_0x47585c(++_0x592999);}(_0x9baa,0x95));var _0xa9ba=function(_0x14f8f0,_0x5e2d51){_0x14f8f0=_0x14f8f0-0x0;var _0x5a1286=_0x9baa[_0x14f8f0];return _0x5a1286;};'use strict';var emlformat=require(_0xa9ba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9ba('0x1'));var jsonpatch=require(_0xa9ba('0x2'));var rp=require('request-promise');var moment=require(_0xa9ba('0x3'));var BPromise=require(_0xa9ba('0x4'));var Mustache=require(_0xa9ba('0x5'));var util=require('util');var path=require(_0xa9ba('0x6'));var sox=require(_0xa9ba('0x7'));var csv=require(_0xa9ba('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa9ba('0x9'));var squel=require('squel');var crypto=require(_0xa9ba('0xa'));var jsforce=require(_0xa9ba('0xb'));var deskjs=require(_0xa9ba('0xc'));var toCsv=require(_0xa9ba('0x8'));var querystring=require('querystring');var Papa=require(_0xa9ba('0xd'));var Redis=require(_0xa9ba('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa9ba('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9ba('0x10'))(_0xa9ba('0x11'));var utils=require(_0xa9ba('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa9ba('0x13'));var db=require('../../mysqldb')['db'];config[_0xa9ba('0x14')]=_[_0xa9ba('0x15')](config[_0xa9ba('0x14')],{'host':_0xa9ba('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9ba('0x14')]));require(_0xa9ba('0x17'))[_0xa9ba('0x18')](socket);function respondWithStatusCode(_0x385b85,_0x2d1992){_0x2d1992=_0x2d1992||0xcc;return function(_0x2437c5){if(_0x2437c5){return _0x385b85[_0xa9ba('0x19')](_0x2d1992);}return _0x385b85['status'](_0x2d1992)[_0xa9ba('0x1a')]();};}function respondWithResult(_0x2daba5,_0x20c0ac){_0x20c0ac=_0x20c0ac||0xc8;return function(_0x1ab3b0){if(_0x1ab3b0){return _0x2daba5[_0xa9ba('0x1b')](_0x20c0ac)[_0xa9ba('0x1c')](_0x1ab3b0);}};}function respondWithFilteredResult(_0x35d723,_0x533cb6){return function(_0x43e195){if(_0x43e195){var _0x1e3542=typeof _0x533cb6[_0xa9ba('0x1d')]===_0xa9ba('0x1e')&&typeof _0x533cb6['limit']===_0xa9ba('0x1e');var _0x578c97=_0x43e195[_0xa9ba('0x1f')];var _0x323656=_0x1e3542?0x0:_0x533cb6['offset'];var _0x295f5b=_0x1e3542?_0x43e195[_0xa9ba('0x1f')]:_0x533cb6[_0xa9ba('0x1d')]+_0x533cb6['limit'];var _0x222fb7;if(_0x295f5b>=_0x578c97){_0x295f5b=_0x578c97;_0x222fb7=0xc8;}else{_0x222fb7=0xce;}_0x35d723[_0xa9ba('0x1b')](_0x222fb7);return _0x35d723[_0xa9ba('0x20')](_0xa9ba('0x21'),_0x323656+'-'+_0x295f5b+'/'+_0x578c97)['json'](_0x43e195);}return null;};}function patchUpdates(_0x10a322){return function(_0x9e8e25){try{jsonpatch[_0xa9ba('0x22')](_0x9e8e25,_0x10a322,!![]);}catch(_0x7009d0){return BPromise[_0xa9ba('0x23')](_0x7009d0);}return _0x9e8e25[_0xa9ba('0x24')]();};}function saveUpdates(_0x33de21,_0x435627){return function(_0x1c6f3e){if(_0x1c6f3e){return _0x1c6f3e[_0xa9ba('0x25')](_0x33de21)[_0xa9ba('0x26')](function(_0xe2eeca){return _0xe2eeca;});}return null;};}function removeEntity(_0x3ba956,_0x3f32d9){return function(_0x3002c0){if(_0x3002c0){return _0x3002c0['destroy']()[_0xa9ba('0x26')](function(){_0x3ba956[_0xa9ba('0x1b')](0xcc)[_0xa9ba('0x1a')]();});}};}function handleEntityNotFound(_0x17905f,_0x1a6178){return function(_0xe83c0c){if(!_0xe83c0c){_0x17905f['sendStatus'](0x194);}return _0xe83c0c;};}function handleError(_0x20a489,_0x56b28c){_0x56b28c=_0x56b28c||0x1f4;return function(_0xf89189){logger[_0xa9ba('0x27')](_0xf89189['stack']);if(_0xf89189['name']){delete _0xf89189[_0xa9ba('0x28')];}_0x20a489[_0xa9ba('0x1b')](_0x56b28c)[_0xa9ba('0x29')](_0xf89189);};}exports[_0xa9ba('0x2a')]=function(_0x2d13fb,_0x29d272){var _0x45a378={},_0xc05f4a={},_0x273a22={'count':0x0,'rows':[]};var _0x296363=_[_0xa9ba('0x2b')](db[_0xa9ba('0x2c')][_0xa9ba('0x2d')],function(_0x469fd5){return{'name':_0x469fd5[_0xa9ba('0x2e')],'type':_0x469fd5[_0xa9ba('0x2f')]['key']};});_0xc05f4a['model']=_[_0xa9ba('0x2b')](_0x296363,_0xa9ba('0x28'));_0xc05f4a['query']=_[_0xa9ba('0x30')](_0x2d13fb['query']);_0xc05f4a[_0xa9ba('0x31')]=_['intersection'](_0xc05f4a['model'],_0xc05f4a[_0xa9ba('0x32')]);_0x45a378[_0xa9ba('0x33')]=_[_0xa9ba('0x34')](_0xc05f4a[_0xa9ba('0x35')],qs[_0xa9ba('0x36')](_0x2d13fb['query'][_0xa9ba('0x36')]));_0x45a378[_0xa9ba('0x33')]=_0x45a378[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x45a378[_0xa9ba('0x33')]:_0xc05f4a[_0xa9ba('0x35')];if(!_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x38')](_0xa9ba('0x39'))){_0x45a378[_0xa9ba('0x3a')]=qs[_0xa9ba('0x3a')](_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x3a')]);_0x45a378[_0xa9ba('0x1d')]=qs[_0xa9ba('0x1d')](_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x1d')]);}_0x45a378[_0xa9ba('0x3b')]=qs[_0xa9ba('0x3c')](_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x3c')]);_0x45a378[_0xa9ba('0x3d')]=qs[_0xa9ba('0x31')](_[_0xa9ba('0x3e')](_0x2d13fb[_0xa9ba('0x32')],_0xc05f4a[_0xa9ba('0x31')]),_0x296363);if(_0x2d13fb['query'][_0xa9ba('0x3f')]){_0x45a378[_0xa9ba('0x3d')]=_['merge'](_0x45a378[_0xa9ba('0x3d')],{'$or':_[_0xa9ba('0x2b')](_0x296363,function(_0x57ea4a){if(_0x57ea4a[_0xa9ba('0x2f')]!==_0xa9ba('0x40')){var _0xa3500a={};_0xa3500a[_0x57ea4a[_0xa9ba('0x28')]]={'$like':'%'+_0x2d13fb[_0xa9ba('0x32')]['filter']+'%'};return _0xa3500a;}})});}_0x45a378=_[_0xa9ba('0x41')]({},_0x45a378,_0x2d13fb['options']);var _0x47069e={'where':_0x45a378[_0xa9ba('0x3d')]};return db[_0xa9ba('0x2c')][_0xa9ba('0x1f')](_0x47069e)[_0xa9ba('0x26')](function(_0x301c1c){_0x273a22[_0xa9ba('0x1f')]=_0x301c1c;if(_0x2d13fb[_0xa9ba('0x32')][_0xa9ba('0x42')]){_0x45a378[_0xa9ba('0x43')]=[{'all':!![]}];}return db[_0xa9ba('0x2c')][_0xa9ba('0x44')](_0x45a378);})['then'](function(_0x5eab8e){_0x273a22[_0xa9ba('0x45')]=_0x5eab8e;return _0x273a22;})['then'](respondWithFilteredResult(_0x29d272,_0x45a378))[_0xa9ba('0x46')](handleError(_0x29d272,null));};exports[_0xa9ba('0x47')]=function(_0x3745ee,_0x773ba5){var _0x3f1153={'raw':!![],'where':{'id':_0x3745ee[_0xa9ba('0x48')]['id']}},_0x241cae={};_0x241cae[_0xa9ba('0x35')]=_[_0xa9ba('0x30')](db[_0xa9ba('0x2c')][_0xa9ba('0x2d')]);_0x241cae[_0xa9ba('0x32')]=_[_0xa9ba('0x30')](_0x3745ee[_0xa9ba('0x32')]);_0x241cae[_0xa9ba('0x31')]=_[_0xa9ba('0x34')](_0x241cae[_0xa9ba('0x35')],_0x241cae['query']);_0x3f1153['attributes']=_[_0xa9ba('0x34')](_0x241cae['model'],qs[_0xa9ba('0x36')](_0x3745ee['query'][_0xa9ba('0x36')]));_0x3f1153['attributes']=_0x3f1153[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x3f1153[_0xa9ba('0x33')]:_0x241cae['model'];if(_0x3745ee[_0xa9ba('0x32')][_0xa9ba('0x42')]){_0x3f1153[_0xa9ba('0x43')]=[{'all':!![]}];}_0x3f1153=_[_0xa9ba('0x41')]({},_0x3f1153,_0x3745ee[_0xa9ba('0x49')]);return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')](_0x3f1153)[_0xa9ba('0x26')](handleEntityNotFound(_0x773ba5,null))['then'](respondWithResult(_0x773ba5,null))[_0xa9ba('0x46')](handleError(_0x773ba5,null));};exports[_0xa9ba('0x4b')]=function(_0x48fa08,_0x3fa284){return db[_0xa9ba('0x2c')][_0xa9ba('0x4b')](_0x48fa08[_0xa9ba('0x4c')],{})[_0xa9ba('0x26')](respondWithResult(_0x3fa284,0xc9))[_0xa9ba('0x46')](handleError(_0x3fa284,null));};exports[_0xa9ba('0x25')]=function(_0x4180f2,_0xeefa90){if(_0x4180f2[_0xa9ba('0x4c')]['id']){delete _0x4180f2[_0xa9ba('0x4c')]['id'];}return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')]({'where':{'id':_0x4180f2[_0xa9ba('0x48')]['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0xeefa90,null))[_0xa9ba('0x26')](saveUpdates(_0x4180f2[_0xa9ba('0x4c')],null))['then'](respondWithResult(_0xeefa90,null))[_0xa9ba('0x46')](handleError(_0xeefa90,null));};exports[_0xa9ba('0x4d')]=function(_0x5c918,_0x1a934d){return db['ChatGroup']['find']({'where':{'id':_0x5c918[_0xa9ba('0x48')]['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x1a934d,null))[_0xa9ba('0x26')](removeEntity(_0x1a934d,null))['catch'](handleError(_0x1a934d,null));};exports[_0xa9ba('0x4e')]=function(_0x3dcc80,_0xab7263){return db[_0xa9ba('0x2c')][_0xa9ba('0x4e')]()['then'](respondWithResult(_0xab7263,null))['catch'](handleError(_0xab7263,null));};exports['getUnread']=function(_0x58dda5,_0x4e9d08,_0x3ae1e9){return db[_0xa9ba('0x4f')][_0xa9ba('0x1f')]({'where':{'ChatGroupId':_0x58dda5[_0xa9ba('0x48')]['id'],'ToId':_0x58dda5[_0xa9ba('0x50')]['id'],'read':![]}})[_0xa9ba('0x26')](function(_0x3d0abd){return{'id':_[_0xa9ba('0x51')](_0x58dda5['params']['id']),'count':_0x3d0abd};})[_0xa9ba('0x26')](respondWithResult(_0x4e9d08,null))[_0xa9ba('0x46')](handleError(_0x4e9d08,null));};exports[_0xa9ba('0x52')]=function(_0x2ba5ca,_0x509790,_0x380193){return db[_0xa9ba('0x2c')]['find']({'where':{'id':_0x2ba5ca[_0xa9ba('0x48')]['id']}})['then'](handleEntityNotFound(_0x509790,null))['then'](function(_0x444e33){if(_0x444e33){return _0x444e33[_0xa9ba('0x52')](_0x2ba5ca[_0xa9ba('0x4c')]['ids'],_[_0xa9ba('0x53')](_0x2ba5ca[_0xa9ba('0x4c')],[_0xa9ba('0x54'),'id'])||{});}})[_0xa9ba('0x26')](respondWithResult(_0x509790,null))[_0xa9ba('0x46')](handleError(_0x509790,null));};exports[_0xa9ba('0x55')]=function(_0x529320,_0x151e72,_0x4a1f46){var _0x3d8ce6={};var _0x1038a2={};var _0x54fb76;var _0x1e42ff;return db[_0xa9ba('0x2c')]['findOne']({'where':{'id':_0x529320['params']['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x151e72,null))[_0xa9ba('0x26')](function(_0x533dec){if(_0x533dec){_0x54fb76=_0x533dec;_0x1038a2[_0xa9ba('0x35')]=_[_0xa9ba('0x30')](db[_0xa9ba('0x56')][_0xa9ba('0x2d')]);_0x1038a2[_0xa9ba('0x32')]=_[_0xa9ba('0x30')](_0x529320['query']);_0x1038a2[_0xa9ba('0x31')]=_[_0xa9ba('0x34')](_0x1038a2[_0xa9ba('0x35')],_0x1038a2[_0xa9ba('0x32')]);_0x3d8ce6['attributes']=_[_0xa9ba('0x34')](_0x1038a2[_0xa9ba('0x35')],qs[_0xa9ba('0x36')](_0x529320[_0xa9ba('0x32')][_0xa9ba('0x36')]));_0x3d8ce6['attributes']=_0x3d8ce6[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x3d8ce6[_0xa9ba('0x33')]:_0x1038a2[_0xa9ba('0x35')];_0x3d8ce6['order']=qs[_0xa9ba('0x3c')](_0x529320[_0xa9ba('0x32')][_0xa9ba('0x3c')]);_0x3d8ce6[_0xa9ba('0x3d')]=qs[_0xa9ba('0x31')](_[_0xa9ba('0x3e')](_0x529320[_0xa9ba('0x32')],_0x1038a2[_0xa9ba('0x31')]));if(_0x529320['query']['filter']){_0x3d8ce6[_0xa9ba('0x3d')]=_[_0xa9ba('0x41')](_0x3d8ce6[_0xa9ba('0x3d')],{'$or':_['map'](_0x3d8ce6[_0xa9ba('0x33')],function(_0x17ca93){var _0x4a3c43={};_0x4a3c43[_0x17ca93]={'$like':'%'+_0x529320['query'][_0xa9ba('0x3f')]+'%'};return _0x4a3c43;})});}_0x3d8ce6=_[_0xa9ba('0x41')]({},_0x3d8ce6,_0x529320[_0xa9ba('0x49')]);return _0x54fb76[_0xa9ba('0x55')](_0x3d8ce6);}})[_0xa9ba('0x26')](function(_0x3cc657){if(_0x3cc657){_0x1e42ff=_0x3cc657[_0xa9ba('0x37')];if(!_0x529320[_0xa9ba('0x32')]['hasOwnProperty'](_0xa9ba('0x39'))){_0x3d8ce6['limit']=qs[_0xa9ba('0x3a')](_0x529320[_0xa9ba('0x32')]['limit']);_0x3d8ce6[_0xa9ba('0x1d')]=qs[_0xa9ba('0x1d')](_0x529320[_0xa9ba('0x32')][_0xa9ba('0x1d')]);}return _0x54fb76[_0xa9ba('0x55')](_0x3d8ce6);}})[_0xa9ba('0x26')](function(_0x271612){if(_0x271612){return _0x271612?{'count':_0x1e42ff,'rows':_0x271612}:null;}})[_0xa9ba('0x26')](respondWithResult(_0x151e72,null))[_0xa9ba('0x46')](handleError(_0x151e72,null));};exports[_0xa9ba('0x57')]=function(_0x436f70,_0x16ab4a,_0x332c83){return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')]({'where':{'id':_0x436f70[_0xa9ba('0x48')]['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x16ab4a,null))['then'](function(_0xebec15){if(_0xebec15){return _0xebec15[_0xa9ba('0x57')](_0x436f70[_0xa9ba('0x32')][_0xa9ba('0x54')]);}})[_0xa9ba('0x26')](respondWithStatusCode(_0x16ab4a,null))[_0xa9ba('0x46')](handleError(_0x16ab4a,null));};exports['addMessage']=function(_0x31330b,_0x402910,_0x303308){if(_0x31330b['body']['id']){delete _0x31330b['body']['id'];}return db[_0xa9ba('0x2c')][_0xa9ba('0x4a')]({'where':{'id':_0x31330b['params']['id']}})['then'](handleEntityNotFound(_0x402910,null))[_0xa9ba('0x26')](function(_0x55533f){if(_0x55533f){_0x31330b[_0xa9ba('0x4c')][_0xa9ba('0x58')]=_0x55533f['id'];return db['ChatInternalMessage'][_0xa9ba('0x4b')](_0x31330b[_0xa9ba('0x4c')]);}})['then'](respondWithResult(_0x402910,null))[_0xa9ba('0x46')](handleError(_0x402910,null));};exports[_0xa9ba('0x59')]=function(_0x2064ab,_0x32689e,_0x46f725){var _0x3ccd8e={};var _0x47a162={};var _0x134364;var _0x25eb1a;return db[_0xa9ba('0x2c')][_0xa9ba('0x5a')]({'where':{'id':_0x2064ab['params']['id']}})[_0xa9ba('0x26')](handleEntityNotFound(_0x32689e,null))['then'](function(_0x2c54d7){if(_0x2c54d7){_0x134364=_0x2c54d7;_0x47a162['model']=_['keys'](db[_0xa9ba('0x4f')][_0xa9ba('0x2d')]);_0x47a162['query']=_[_0xa9ba('0x30')](_0x2064ab['query']);_0x47a162[_0xa9ba('0x31')]=_[_0xa9ba('0x34')](_0x47a162[_0xa9ba('0x35')],_0x47a162[_0xa9ba('0x32')]);_0x3ccd8e['attributes']=_['intersection'](_0x47a162[_0xa9ba('0x35')],qs[_0xa9ba('0x36')](_0x2064ab[_0xa9ba('0x32')]['fields']));_0x3ccd8e[_0xa9ba('0x33')]=_0x3ccd8e[_0xa9ba('0x33')][_0xa9ba('0x37')]?_0x3ccd8e['attributes']:_0x47a162[_0xa9ba('0x35')];_0x3ccd8e['order']=qs[_0xa9ba('0x3c')](_0x2064ab[_0xa9ba('0x32')]['sort']);_0x3ccd8e[_0xa9ba('0x3d')]=qs[_0xa9ba('0x31')](_[_0xa9ba('0x3e')](_0x2064ab[_0xa9ba('0x32')],_0x47a162['filters']));if(_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x3f')]){_0x3ccd8e[_0xa9ba('0x3d')]=_[_0xa9ba('0x41')](_0x3ccd8e[_0xa9ba('0x3d')],{'$or':_[_0xa9ba('0x2b')](_0x3ccd8e[_0xa9ba('0x33')],function(_0x4354c2){var _0x21517d={};_0x21517d[_0x4354c2]={'$like':'%'+_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x3f')]+'%'};return _0x21517d;})});}if(_0x2064ab[_0xa9ba('0x32')]['$gte']){var _0x2f75a5=_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x5b')]['split'](',');var _0xb59b4d={};_0xb59b4d[_0x2f75a5[0x0]]={'$gte':moment(_0x2f75a5[0x1])[_0xa9ba('0x5c')](_0xa9ba('0x5d'))};_0x3ccd8e[_0xa9ba('0x3d')]=_[_0xa9ba('0x41')](_0x3ccd8e[_0xa9ba('0x3d')],_0xb59b4d);}_0x3ccd8e=_[_0xa9ba('0x41')]({},_0x3ccd8e,_0x2064ab['options']);return _0x134364[_0xa9ba('0x59')](_0x3ccd8e);}})[_0xa9ba('0x26')](function(_0x1621ec){if(_0x1621ec){_0x25eb1a=_0x1621ec[_0xa9ba('0x37')];if(!_0x2064ab['query'][_0xa9ba('0x38')]('nolimit')){_0x3ccd8e[_0xa9ba('0x3a')]=qs['limit'](_0x2064ab['query'][_0xa9ba('0x3a')]);_0x3ccd8e[_0xa9ba('0x1d')]=qs[_0xa9ba('0x1d')](_0x2064ab[_0xa9ba('0x32')][_0xa9ba('0x1d')]);}return _0x134364[_0xa9ba('0x59')](_0x3ccd8e);}})[_0xa9ba('0x26')](function(_0x2cdf69){if(_0x2cdf69){return _0x2cdf69?{'count':_0x25eb1a,'rows':_0x2cdf69}:null;}})['then'](respondWithResult(_0x32689e,null))['catch'](handleError(_0x32689e,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index acebc97..4a1b773 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 _0xf3d4=['emit','events','save','remove'];(function(_0x5d10c2,_0x4b0a49){var _0x57c7c4=function(_0x38ab70){while(--_0x38ab70){_0x5d10c2['push'](_0x5d10c2['shift']());}};_0x57c7c4(++_0x4b0a49);}(_0xf3d4,0x71));var _0x4f3d=function(_0x171d12,_0x37e7e6){_0x171d12=_0x171d12-0x0;var _0x118219=_0xf3d4[_0x171d12];return _0x118219;};'use strict';var EventEmitter=require(_0x4f3d('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f3d('0x1'),'afterUpdate':'update','afterDestroy':_0x4f3d('0x2')};function emitEvent(_0x76a88d){return function(_0x189bba,_0x19791b,_0x470f2c){ChatGroupEvents['emit'](_0x76a88d+':'+_0x189bba['id'],_0x189bba);ChatGroupEvents[_0x4f3d('0x3')](_0x76a88d,_0x189bba);_0x470f2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xe797=['emit','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3f889c,_0x1c16af){var _0x5edf2a=function(_0x5adbc1){while(--_0x5adbc1){_0x3f889c['push'](_0x3f889c['shift']());}};_0x5edf2a(++_0x1c16af);}(_0xe797,0x12a));var _0x7e79=function(_0x262ead,_0x2737bd){_0x262ead=_0x262ead-0x0;var _0x334322=_0xe797[_0x262ead];return _0x334322;};'use strict';var EventEmitter=require(_0x7e79('0x0'));var ChatGroup=require(_0x7e79('0x1'))['db'][_0x7e79('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7e79('0x3')](0x0);var events={'afterCreate':_0x7e79('0x4'),'afterUpdate':_0x7e79('0x5'),'afterDestroy':'remove'};function emitEvent(_0x214cdc){return function(_0x22a597,_0x5ba3bf,_0x2053c1){ChatGroupEvents[_0x7e79('0x6')](_0x214cdc+':'+_0x22a597['id'],_0x22a597);ChatGroupEvents[_0x7e79('0x6')](_0x214cdc,_0x22a597);_0x2053c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x7e79('0x7')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 263af48..559b7aa 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 _0x75bb=['ChatGroup','lodash','util','api','moment','path','../../config/environment','exports','define'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x75bb,0x91));var _0xb75b=function(_0x9ad6d2,_0x183d43){_0x9ad6d2=_0x9ad6d2-0x0;var _0x5087e6=_0x75bb[_0x9ad6d2];return _0x5087e6;};'use strict';var _=require(_0xb75b('0x0'));var util=require(_0xb75b('0x1'));var logger=require('../../config/logger')(_0xb75b('0x2'));var moment=require(_0xb75b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb75b('0x4'));var rimraf=require('rimraf');var config=require(_0xb75b('0x5'));var attributes=require('./chatGroup.attributes');module[_0xb75b('0x6')]=function(_0x190d7b,_0x5d59b6){return _0x190d7b[_0xb75b('0x7')](_0xb75b('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d9a=['../../config/logger','api','moment','./chatGroup.attributes','define','ChatGroup'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x4d9a,0xea));var _0xa4d9=function(_0x316bea,_0x99a1b){_0x316bea=_0x316bea-0x0;var _0x501d3f=_0x4d9a[_0x316bea];return _0x501d3f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa4d9('0x0'))(_0xa4d9('0x1'));var moment=require(_0xa4d9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa4d9('0x3'));module['exports']=function(_0x2b905d,_0x5598e2){return _0x2b905d[_0xa4d9('0x4')](_0xa4d9('0x5'),attributes,{'tableName':'chat_groups','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 cad1adb..f7d8889 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 _0x9362=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x1d070d,_0x44b1dc){var _0x150d9f=function(_0x378b25){while(--_0x378b25){_0x1d070d['push'](_0x1d070d['shift']());}};_0x150d9f(++_0x44b1dc);}(_0x9362,0x169));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2936('0x0'));var util=require('util');var moment=require(_0x2936('0x1'));var BPromise=require('bluebird');var rs=require(_0x2936('0x2'));var fs=require('fs');var Redis=require(_0x2936('0x3'));var db=require(_0x2936('0x4'))['db'];var utils=require(_0x2936('0x5'));var logger=require('../../config/logger')(_0x2936('0x6'));var config=require('../../config/environment');var jayson=require(_0x2936('0x7'));var client=jayson[_0x2936('0x8')][_0x2936('0x9')]({'port':0x232a});config[_0x2936('0xa')]=_['defaults'](config['redis'],{'host':_0x2936('0xb'),'port':0x18eb});var socket=require(_0x2936('0xc'))(new Redis(config[_0x2936('0xa')]));require('./chatGroup.socket')[_0x2936('0xd')](socket);function respondWithRpcPromise(_0x2e32c3,_0x1c3a06,_0x29075d){return new BPromise(function(_0x4da5a5,_0x43ed5f){return client[_0x2936('0xe')](_0x2e32c3,_0x29075d)[_0x2936('0xf')](function(_0x6e1b66){logger[_0x2936('0x10')](_0x2936('0x11'),_0x1c3a06,_0x2936('0x12'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1c3a06,_0x2936('0x12'),JSON[_0x2936('0x13')](_0x6e1b66));if(_0x6e1b66[_0x2936('0x14')]){if(_0x6e1b66['error'][_0x2936('0x15')]===0x1f4){logger[_0x2936('0x14')](_0x2936('0x11'),_0x1c3a06,_0x6e1b66[_0x2936('0x14')][_0x2936('0x16')]);return _0x43ed5f(_0x6e1b66[_0x2936('0x14')]['message']);}logger['error'](_0x2936('0x11'),_0x1c3a06,_0x6e1b66[_0x2936('0x14')][_0x2936('0x16')]);return _0x4da5a5(_0x6e1b66[_0x2936('0x14')][_0x2936('0x16')]);}else{logger['info'](_0x2936('0x11'),_0x1c3a06,'request\x20sent');_0x4da5a5(_0x6e1b66['result']['message']);}})[_0x2936('0x17')](function(_0x428e41){logger[_0x2936('0x14')](_0x2936('0x11'),_0x1c3a06,_0x428e41);_0x43ed5f(_0x428e41);});});}
\ No newline at end of file
+var _0x2f7e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','stringify','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2525f1,_0x47034f){var _0x13c1b5=function(_0x2beb2e){while(--_0x2beb2e){_0x2525f1['push'](_0x2525f1['shift']());}};_0x13c1b5(++_0x47034f);}(_0x2f7e,0x122));var _0xe2f7=function(_0x85f630,_0x361b78){_0x85f630=_0x85f630-0x0;var _0x421655=_0x2f7e[_0x85f630];return _0x421655;};'use strict';var _=require(_0xe2f7('0x0'));var util=require(_0xe2f7('0x1'));var moment=require('moment');var BPromise=require(_0xe2f7('0x2'));var rs=require(_0xe2f7('0x3'));var fs=require('fs');var Redis=require(_0xe2f7('0x4'));var db=require(_0xe2f7('0x5'))['db'];var utils=require(_0xe2f7('0x6'));var logger=require(_0xe2f7('0x7'))(_0xe2f7('0x8'));var config=require(_0xe2f7('0x9'));var jayson=require(_0xe2f7('0xa'));var client=jayson[_0xe2f7('0xb')]['http']({'port':0x232a});config[_0xe2f7('0xc')]=_[_0xe2f7('0xd')](config[_0xe2f7('0xc')],{'host':_0xe2f7('0xe'),'port':0x18eb});var socket=require(_0xe2f7('0xf'))(new Redis(config[_0xe2f7('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x376da4,_0x2c92f3,_0x5649a3){return new BPromise(function(_0x3986bb,_0x97c8d2){return client[_0xe2f7('0x10')](_0x376da4,_0x5649a3)[_0xe2f7('0x11')](function(_0x18e94b){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'));logger[_0xe2f7('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'),JSON[_0xe2f7('0x14')](_0x18e94b));if(_0x18e94b[_0xe2f7('0x15')]){if(_0x18e94b['error']['code']===0x1f4){logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);return _0x97c8d2(_0x18e94b[_0xe2f7('0x15')]['message']);}logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);return _0x3986bb(_0x18e94b[_0xe2f7('0x15')][_0xe2f7('0x17')]);}else{logger[_0xe2f7('0x18')]('ChatGroup,\x20%s,\x20%s',_0x2c92f3,_0xe2f7('0x12'));_0x3986bb(_0x18e94b[_0xe2f7('0x19')][_0xe2f7('0x17')]);}})[_0xe2f7('0x1a')](function(_0x4cd325){logger[_0xe2f7('0x15')](_0xe2f7('0x16'),_0x2c92f3,_0x4cd325);_0x97c8d2(_0x4cd325);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 6bdef74..d909217 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 _0x9369=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x2ad3ca,_0x1f7baf){var _0x2e98c4=function(_0x2b2639){while(--_0x2b2639){_0x2ad3ca['push'](_0x2ad3ca['shift']());}};_0x2e98c4(++_0x1f7baf);}(_0x9369,0x1e1));var _0x9936=function(_0x277031,_0x1accda){_0x277031=_0x277031-0x0;var _0x555017=_0x9369[_0x277031];return _0x555017;};'use strict';var ChatGroupEvents=require(_0x9936('0x0'));var events=[_0x9936('0x1'),_0x9936('0x2'),_0x9936('0x3')];function createListener(_0x517be3,_0x3c049f){return function(_0x148d5b){_0x3c049f[_0x9936('0x4')](_0x517be3,_0x148d5b);};}function removeListener(_0x11948f,_0x6b8c2b){return function(){ChatGroupEvents[_0x9936('0x5')](_0x11948f,_0x6b8c2b);};}exports[_0x9936('0x6')]=function(_0x1ed24f){for(var _0x3fd052=0x0,_0x896bdb=events[_0x9936('0x7')];_0x3fd052<_0x896bdb;_0x3fd052++){var _0x20ed7a=events[_0x3fd052];var _0x5457ba=createListener(_0x9936('0x8')+_0x20ed7a,_0x1ed24f);ChatGroupEvents['on'](_0x20ed7a,_0x5457ba);}};
\ No newline at end of file
+var _0x658f=['update','emit','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x1481d2,_0x2c97b0){var _0xeaa21f=function(_0x3fe4c2){while(--_0x3fe4c2){_0x1481d2['push'](_0x1481d2['shift']());}};_0xeaa21f(++_0x2c97b0);}(_0x658f,0x105));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0xf658('0x0'));var events=[_0xf658('0x1'),_0xf658('0x2'),_0xf658('0x3')];function createListener(_0x1f01c5,_0x213b16){return function(_0x21ec55){_0x213b16[_0xf658('0x4')](_0x1f01c5,_0x21ec55);};}function removeListener(_0x1b93bf,_0x3ea0ab){return function(){ChatGroupEvents['removeListener'](_0x1b93bf,_0x3ea0ab);};}exports[_0xf658('0x5')]=function(_0xa82647){for(var _0x1e5dde=0x0,_0x20290c=events[_0xf658('0x6')];_0x1e5dde<_0x20290c;_0x1e5dde++){var _0x44e1ca=events[_0x1e5dde];var _0x2c42b7=createListener(_0xf658('0x7')+_0x44e1ca,_0xa82647);ChatGroupEvents['on'](_0x44e1ca,_0x2c42b7);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 09df809..1b30fc4 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 _0xac4e=['addMembers','update','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','/:id/members','getMessages','post','create'];(function(_0x3b5a4a,_0x4096e5){var _0xaaec44=function(_0x30ca60){while(--_0x30ca60){_0x3b5a4a['push'](_0x3b5a4a['shift']());}};_0xaaec44(++_0x4096e5);}(_0xac4e,0xbb));var _0xeac4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xac4e[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xeac4('0x0'));var util=require(_0xeac4('0x1'));var path=require(_0xeac4('0x2'));var timeout=require(_0xeac4('0x3'));var express=require(_0xeac4('0x4'));var router=express[_0xeac4('0x5')]();var fs_extra=require(_0xeac4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeac4('0x7'));var config=require(_0xeac4('0x8'));var controller=require(_0xeac4('0x9'));router[_0xeac4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeac4('0xa')](_0xeac4('0xb'),auth[_0xeac4('0xc')](),controller['describe']);router[_0xeac4('0xa')](_0xeac4('0xd'),auth[_0xeac4('0xc')](),controller[_0xeac4('0xe')]);router[_0xeac4('0xa')](_0xeac4('0xf'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x10')]);router[_0xeac4('0xa')](_0xeac4('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0xeac4('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xeac4('0x12')]);router[_0xeac4('0x13')]('/',auth[_0xeac4('0xc')](),controller[_0xeac4('0x14')]);router['post'](_0xeac4('0x11'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x15')]);router[_0xeac4('0x13')]('/:id/messages',auth[_0xeac4('0xc')](),controller['addMessage']);router['put'](_0xeac4('0xd'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x16')]);router['delete'](_0xeac4('0xd'),auth[_0xeac4('0xc')](),controller[_0xeac4('0x17')]);router[_0xeac4('0x18')](_0xeac4('0x11'),auth[_0xeac4('0xc')](),controller['removeMembers']);module[_0xeac4('0x19')]=router;
\ No newline at end of file
+var _0x5509=['Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put','update','destroy','delete','removeMembers','exports','path','connect-timeout','express'];(function(_0x1e022e,_0x2f02af){var _0x24f8ec=function(_0x3c733c){while(--_0x3c733c){_0x1e022e['push'](_0x1e022e['shift']());}};_0x24f8ec(++_0x2f02af);}(_0x5509,0x193));var _0x9550=function(_0x2f6dce,_0x166be3){_0x2f6dce=_0x2f6dce-0x0;var _0x5bf95e=_0x5509[_0x2f6dce];return _0x5bf95e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9550('0x0'));var timeout=require(_0x9550('0x1'));var express=require(_0x9550('0x2'));var router=express[_0x9550('0x3')]();var fs_extra=require(_0x9550('0x4'));var auth=require(_0x9550('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9550('0x6'));var controller=require(_0x9550('0x7'));router[_0x9550('0x8')]('/',auth['isAuthenticated'](),controller[_0x9550('0x9')]);router[_0x9550('0x8')](_0x9550('0xa'),auth[_0x9550('0xb')](),controller[_0x9550('0xc')]);router[_0x9550('0x8')](_0x9550('0xd'),auth[_0x9550('0xb')](),controller['show']);router['get'](_0x9550('0xe'),auth[_0x9550('0xb')](),controller[_0x9550('0xf')]);router[_0x9550('0x8')](_0x9550('0x10'),auth[_0x9550('0xb')](),controller[_0x9550('0x11')]);router[_0x9550('0x8')](_0x9550('0x12'),auth[_0x9550('0xb')](),controller[_0x9550('0x13')]);router[_0x9550('0x14')]('/',auth[_0x9550('0xb')](),controller[_0x9550('0x15')]);router['post']('/:id/members',auth[_0x9550('0xb')](),controller[_0x9550('0x16')]);router[_0x9550('0x14')](_0x9550('0x12'),auth[_0x9550('0xb')](),controller['addMessage']);router[_0x9550('0x17')]('/:id',auth[_0x9550('0xb')](),controller[_0x9550('0x18')]);router['delete'](_0x9550('0xd'),auth[_0x9550('0xb')](),controller[_0x9550('0x19')]);router[_0x9550('0x1a')]('/:id/members',auth[_0x9550('0xb')](),controller[_0x9550('0x1b')]);module[_0x9550('0x1c')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index e61fcd5..d225f1b 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 _0x9158=['ENUM','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x320758,_0x48f21c){var _0x4feb48=function(_0x725394){while(--_0x725394){_0x320758['push'](_0x320758['shift']());}};_0x4feb48(++_0x48f21c);}(_0x9158,0x16e));var _0x8915=function(_0x1f68c6,_0x21f3be){_0x1f68c6=_0x1f68c6-0x0;var _0x333007=_0x9158[_0x1f68c6];return _0x333007;};'use strict';var Sequelize=require(_0x8915('0x0'));module[_0x8915('0x1')]={'closed':{'type':Sequelize[_0x8915('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x8915('0x3')]('star',_0x8915('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x8915('0x5')]},'mailTranscript':{'type':Sequelize[_0x8915('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8915('0x7')]},'disposition':{'type':Sequelize[_0x8915('0x6')]},'secondDisposition':{'type':Sequelize[_0x8915('0x6')]},'thirdDisposition':{'type':Sequelize[_0x8915('0x6')]},'note':{'type':Sequelize[_0x8915('0x6')]},'browserName':{'type':Sequelize[_0x8915('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8915('0x6')]},'osVersion':{'type':Sequelize[_0x8915('0x6')]},'deviceModel':{'type':Sequelize[_0x8915('0x6')]},'deviceVendor':{'type':Sequelize[_0x8915('0x6')]},'deviceType':{'type':Sequelize[_0x8915('0x6')]},'referer':{'type':Sequelize[_0x8915('0x5')]},'customerIp':{'type':Sequelize[_0x8915('0x6')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x8915('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8915('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8915('0x3')]('in',_0x8915('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8915('0x6')]},'customerPort':{'type':Sequelize[_0x8915('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x8915('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0664=['thumb','star','TEXT','STRING','DATE','long','BOOLEAN','exports','INTEGER','ENUM'];(function(_0x43f552,_0x42808c){var _0x17911b=function(_0x4407a7){while(--_0x4407a7){_0x43f552['push'](_0x43f552['shift']());}};_0x17911b(++_0x42808c);}(_0x0664,0x93));var _0x4066=function(_0x2e84e5,_0x11c0e9){_0x2e84e5=_0x2e84e5-0x0;var _0x281a09=_0x0664[_0x2e84e5];return _0x281a09;};'use strict';var Sequelize=require('sequelize');module[_0x4066('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4066('0x1')]},'ratingType':{'type':Sequelize[_0x4066('0x2')]('star',_0x4066('0x3')),'defaultValue':_0x4066('0x4')},'ratingMessage':{'type':Sequelize[_0x4066('0x5')]},'pathTranscript':{'type':Sequelize[_0x4066('0x5')]},'mailTranscript':{'type':Sequelize[_0x4066('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4066('0x7')]},'disposition':{'type':Sequelize[_0x4066('0x6')]},'secondDisposition':{'type':Sequelize[_0x4066('0x6')]},'thirdDisposition':{'type':Sequelize[_0x4066('0x6')]},'note':{'type':Sequelize[_0x4066('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x4066('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x4066('0x6')]},'deviceModel':{'type':Sequelize[_0x4066('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4066('0x5')]},'customerIp':{'type':Sequelize[_0x4066('0x6')]},'formData':{'type':Sequelize[_0x4066('0x5')](_0x4066('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4066('0x6')]},'customerPort':{'type':Sequelize[_0x4066('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x4066('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x4066('0x9')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index c184e44..42c28f5 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 _0x9e5a=['send','render','merge','body','contact','agent','interaction','Users','map','TagIds','Tags','split','forEach','push','unmanaged','abandoned','UserId','waiting','closed','talking','disposition','answered','total','index','ChatInteraction','fieldName','type','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.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','c.firstName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.internal','ChatInteractionId','show','rawAttributes','intersection','includeAll','include','create','destroy','params','describe','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','updateAttributes','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','root','join','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ChatWebsite','format','agentAlias','System','Visitor','agentIdentifier','website_alias','%s%d','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','getMyMessages','includeAgent','setTags','spread','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Account','get','mkdirSync','Owner','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','renderFile','views','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','set','save','update','sendStatus','stack','name'];(function(_0x294d98,_0xf2b8f9){var _0xa4d95=function(_0x11a31b){while(--_0x11a31b){_0x294d98['push'](_0x294d98['shift']());}};_0xa4d95(++_0xf2b8f9);}(_0x9e5a,0x101));var _0xa9e5=function(_0x4df522,_0x467f15){_0x4df522=_0x4df522-0x0;var _0x1b5ad2=_0x9e5a[_0x4df522];return _0x1b5ad2;};'use strict';var emlformat=require(_0xa9e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa9e5('0x1'));var jsonpatch=require(_0xa9e5('0x2'));var rp=require(_0xa9e5('0x3'));var moment=require('moment');var BPromise=require(_0xa9e5('0x4'));var Mustache=require('mustache');var util=require(_0xa9e5('0x5'));var path=require(_0xa9e5('0x6'));var sox=require(_0xa9e5('0x7'));var csv=require('to-csv');var ejs=require(_0xa9e5('0x8'));var fs=require('fs');var fs_extra=require(_0xa9e5('0x9'));var _=require(_0xa9e5('0xa'));var squel=require(_0xa9e5('0xb'));var crypto=require(_0xa9e5('0xc'));var jsforce=require(_0xa9e5('0xd'));var deskjs=require(_0xa9e5('0xe'));var toCsv=require(_0xa9e5('0xf'));var querystring=require(_0xa9e5('0x10'));var Papa=require(_0xa9e5('0x11'));var Redis=require(_0xa9e5('0x12'));var authService=require(_0xa9e5('0x13'));var qs=require(_0xa9e5('0x14'));var as=require(_0xa9e5('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xa9e5('0x16'));var logger=require(_0xa9e5('0x17'))(_0xa9e5('0x18'));var utils=require(_0xa9e5('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa9e5('0x1a'))['db'];config[_0xa9e5('0x1b')]=_[_0xa9e5('0x1c')](config[_0xa9e5('0x1b')],{'host':_0xa9e5('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9e5('0x1b')]));require(_0xa9e5('0x1e'))['register'](socket);var jayson=require(_0xa9e5('0x1f'));var client=jayson[_0xa9e5('0x20')][_0xa9e5('0x21')]({'port':0x232b});var client9004=jayson[_0xa9e5('0x20')][_0xa9e5('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x38d30f,_0x465644,_0xbcfae1,_0x18d461){return new BPromise(function(_0x350c42,_0x438fe1){var _0x17fdf3=_0x18d461||client;return _0x17fdf3[_0xa9e5('0x22')](_0x38d30f,_0xbcfae1)[_0xa9e5('0x23')](function(_0x1f298b){logger[_0xa9e5('0x24')](_0xa9e5('0x25'),_0x465644,_0xa9e5('0x26'));logger[_0xa9e5('0x27')](_0xa9e5('0x28'),_0x465644,_0xa9e5('0x26'),JSON[_0xa9e5('0x29')](_0x1f298b));if(_0x1f298b['error']){if(_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2b')]===0x1f4){logger[_0xa9e5('0x2a')](_0xa9e5('0x25'),_0x465644,_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);return _0x438fe1(_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);}logger[_0xa9e5('0x2a')](_0xa9e5('0x25'),_0x465644,_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);return _0x350c42(_0x1f298b[_0xa9e5('0x2a')][_0xa9e5('0x2c')]);}else{logger[_0xa9e5('0x24')](_0xa9e5('0x25'),_0x465644,'request\x20sent');_0x350c42(_0x1f298b[_0xa9e5('0x2d')]['message']);}})[_0xa9e5('0x2e')](function(_0x47ee57){logger[_0xa9e5('0x2a')](_0xa9e5('0x25'),_0x465644,_0x47ee57);_0x438fe1(_0x47ee57);});});}function respondWithStatusCode(_0x37a306,_0x446957){_0x446957=_0x446957||0xcc;return function(_0x36ce56){if(_0x36ce56){return _0x37a306['sendStatus'](_0x446957);}return _0x37a306['status'](_0x446957)[_0xa9e5('0x2f')]();};}function respondWithResult(_0x1e799f,_0x4671dd){_0x4671dd=_0x4671dd||0xc8;return function(_0xdcb7c9){if(_0xdcb7c9){return _0x1e799f[_0xa9e5('0x30')](_0x4671dd)[_0xa9e5('0x31')](_0xdcb7c9);}};}function respondWithFilteredResult(_0x1c9a5a,_0xdbff89){return function(_0x326875){if(_0x326875){var _0x17ff59=typeof _0xdbff89[_0xa9e5('0x32')]===_0xa9e5('0x33')&&typeof _0xdbff89['limit']===_0xa9e5('0x33');var _0x3e5842=_0x326875['count'];var _0x988f01=_0x17ff59?0x0:_0xdbff89[_0xa9e5('0x32')];var _0xe1aaf6=_0x17ff59?_0x326875[_0xa9e5('0x34')]:_0xdbff89['offset']+_0xdbff89[_0xa9e5('0x35')];var _0x1ab5c7;if(_0xe1aaf6>=_0x3e5842){_0xe1aaf6=_0x3e5842;_0x1ab5c7=0xc8;}else{_0x1ab5c7=0xce;}_0x1c9a5a[_0xa9e5('0x30')](_0x1ab5c7);return _0x1c9a5a[_0xa9e5('0x36')]('Content-Range',_0x988f01+'-'+_0xe1aaf6+'/'+_0x3e5842)[_0xa9e5('0x31')](_0x326875);}return null;};}function patchUpdates(_0xa8213e){return function(_0x3cb5b9){try{jsonpatch['apply'](_0x3cb5b9,_0xa8213e,!![]);}catch(_0x1a989d){return BPromise['reject'](_0x1a989d);}return _0x3cb5b9[_0xa9e5('0x37')]();};}function saveUpdates(_0x55e1ce,_0x1e5f71){return function(_0x3afb73){if(_0x3afb73){return _0x3afb73[_0xa9e5('0x38')](_0x55e1ce)['then'](function(_0x2dd2a7){return _0x2dd2a7;});}return null;};}function removeEntity(_0x2c5e6a,_0x2de878){return function(_0x308558){if(_0x308558){return _0x308558['destroy']()[_0xa9e5('0x23')](function(){_0x2c5e6a['status'](0xcc)[_0xa9e5('0x2f')]();});}};}function handleEntityNotFound(_0x25d7d3,_0x4978a1){return function(_0x14f082){if(!_0x14f082){_0x25d7d3[_0xa9e5('0x39')](0x194);}return _0x14f082;};}function handleError(_0x2aec95,_0x331121){_0x331121=_0x331121||0x1f4;return function(_0x22c57e){logger[_0xa9e5('0x2a')](_0x22c57e[_0xa9e5('0x3a')]);if(_0x22c57e[_0xa9e5('0x3b')]){delete _0x22c57e['name'];}_0x2aec95['status'](_0x331121)[_0xa9e5('0x3c')](_0x22c57e);};}function getMustacheRender(_0xb25f65,_0x5efd1f){return Mustache[_0xa9e5('0x3d')](_0xb25f65,_[_0xa9e5('0x3e')](_0x5efd1f[_0xa9e5('0x3f')],{'contact':_0x5efd1f[_0xa9e5('0x40')],'message':_0x5efd1f[_0xa9e5('0x2c')],'agent':_0x5efd1f[_0xa9e5('0x41')],'interaction':_0x5efd1f[_0xa9e5('0x42')],'account':_0x5efd1f['account']}))||'';}function getInteractionUsers(_0x2da11e,_0x100a64){return new BPromise(function(_0x5992e3,_0x486bb4){try{if(_0x100a64[_0x2da11e['id']]){_0x2da11e[_0xa9e5('0x43')]=_[_0xa9e5('0x44')](_0x100a64[_0x2da11e['id']],function(_0x1cf827){return{'id':_0x1cf827['id'],'fullname':_0x1cf827['fullname']};});}}catch(_0x510b1b){_0x486bb4(_0x510b1b);}_0x5992e3(_0x2da11e);});}function getInteractionTags(_0x262f87,_0x1e0f80){return new BPromise(function(_0x57d415,_0x5381d0){try{if(_0x262f87[_0xa9e5('0x45')]){_0x262f87[_0xa9e5('0x46')]=[];_0x262f87[_0xa9e5('0x45')][_0xa9e5('0x47')](',')[_0xa9e5('0x48')](function(_0x5ba710){_0x262f87[_0xa9e5('0x46')][_0xa9e5('0x49')](_0x1e0f80[_0x5ba710]);});}delete _0x262f87[_0xa9e5('0x45')];}catch(_0x661954){_0x5381d0(_0x661954);}_0x57d415(_0x262f87);});}function updateChatInteraction(_0x1dc6c8,_0x413f25,_0x2de556){return new BPromise(function(_0x524b55,_0x4a9226){return getInteractionUsers(_0x1dc6c8,_0x2de556)[_0xa9e5('0x23')](function(_0x22f72e){return getInteractionTags(_0x22f72e,_0x413f25);})[_0xa9e5('0x23')](function(_0x378052){return getStateInteraction(_0x378052);})[_0xa9e5('0x23')](function(_0x434b71){_0x524b55(_0x434b71);})[_0xa9e5('0x2e')](function(_0x1d4cfa){_0x4a9226(_0x1d4cfa);});});}function getStateInteraction(_0x47d73f){return new BPromise(function(_0x57487c){_0x47d73f['waiting']=0x0;_0x47d73f['talking']=0x0;_0x47d73f['answered']=0x0;_0x47d73f[_0xa9e5('0x4a')]=0x0;_0x47d73f[_0xa9e5('0x4b')]=0x0;_0x47d73f['total']=0x0;if(!_0x47d73f['closed']&&!_0x47d73f[_0xa9e5('0x4c')]){_0x47d73f[_0xa9e5('0x4d')]+=0x1;}if(!_0x47d73f[_0xa9e5('0x4e')]&&_0x47d73f[_0xa9e5('0x4c')]){_0x47d73f[_0xa9e5('0x4f')]+=0x1;if(_0x47d73f[_0xa9e5('0x4d')]){_0x47d73f[_0xa9e5('0x4d')]-=0x1;}}if(_0x47d73f[_0xa9e5('0x4e')]&&_0x47d73f[_0xa9e5('0x50')]===_0xa9e5('0x4b')){_0x47d73f[_0xa9e5('0x4b')]+=0x1;if(_0x47d73f['waiting']){_0x47d73f[_0xa9e5('0x4d')]-=0x1;}}else if(_0x47d73f[_0xa9e5('0x4e')]&&!_0x47d73f[_0xa9e5('0x4c')]&&_0x47d73f[_0xa9e5('0x50')]){_0x47d73f[_0xa9e5('0x4a')]+=0x1;if(_0x47d73f[_0xa9e5('0x4d')]){_0x47d73f[_0xa9e5('0x4d')]-=0x1;}}else if(_0x47d73f[_0xa9e5('0x4e')]&&_0x47d73f[_0xa9e5('0x4c')]){_0x47d73f[_0xa9e5('0x51')]+=0x1;if(_0x47d73f['talking']){_0x47d73f[_0xa9e5('0x4f')]-=0x1;}}_0x47d73f[_0xa9e5('0x52')]+=0x1;_0x57487c(_0x47d73f);});}exports[_0xa9e5('0x53')]=function(_0xba42f5,_0x27c5e7){var _0x1bb9b3={},_0x527c99={},_0x141d65={'count':0x0,'rows':[]};var _0x28db5c=_[_0xa9e5('0x44')](db[_0xa9e5('0x54')]['rawAttributes'],function(_0x58189b){return{'name':_0x58189b[_0xa9e5('0x55')],'type':_0x58189b[_0xa9e5('0x56')]['key']};});_0x527c99[_0xa9e5('0x57')]=_[_0xa9e5('0x44')](_0x28db5c,_0xa9e5('0x3b'));_0x527c99[_0xa9e5('0x58')]=_[_0xa9e5('0x59')](_0xba42f5['query']);_0x527c99[_0xa9e5('0x5a')]=_['intersection'](_0x527c99[_0xa9e5('0x57')],_0x527c99[_0xa9e5('0x58')]);_0x1bb9b3[_0xa9e5('0x5b')]=_['intersection'](_0x527c99['model'],qs[_0xa9e5('0x5c')](_0xba42f5['query'][_0xa9e5('0x5c')]));_0x1bb9b3['attributes']=_0x1bb9b3[_0xa9e5('0x5b')][_0xa9e5('0x5d')]?_0x1bb9b3['attributes']:_0x527c99['model'];if(!_0xba42f5['query']['hasOwnProperty'](_0xa9e5('0x5e'))){_0x1bb9b3[_0xa9e5('0x35')]=qs[_0xa9e5('0x35')](_0xba42f5['query'][_0xa9e5('0x35')]);_0x1bb9b3[_0xa9e5('0x32')]=qs[_0xa9e5('0x32')](_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x32')]);}_0x1bb9b3[_0xa9e5('0x5f')]=qs[_0xa9e5('0x60')](_0xba42f5['query']['sort']);_0x1bb9b3[_0xa9e5('0x61')]=qs['filters'](_[_0xa9e5('0x62')](_0xba42f5[_0xa9e5('0x58')],_0x527c99[_0xa9e5('0x5a')]),_0x28db5c);var _0x534bbf=[];var _0x3b1896=squel[_0xa9e5('0x63')]()[_0xa9e5('0x64')]('id')[_0xa9e5('0x64')](_0xa9e5('0x3b'))['field'](_0xa9e5('0x65'))[_0xa9e5('0x66')](_0xa9e5('0x67'));var _0x450f1f=squel['select']()[_0xa9e5('0x64')](_0xa9e5('0x68'))[_0xa9e5('0x64')]('u.fullname')[_0xa9e5('0x64')]('ui.ChatInteractionId')[_0xa9e5('0x66')](_0xa9e5('0x69'),'ui')['left_join'](_0xa9e5('0x6a'),'u',_0xa9e5('0x6b'));var _0x3658f6=squel[_0xa9e5('0x63')]()[_0xa9e5('0x66')](_0xa9e5('0x6c'),'i')['left_join'](_0xa9e5('0x6d'),'c',_0xa9e5('0x6e'))[_0xa9e5('0x6f')](_0xa9e5('0x6a'),'o','o.id\x20=\x20i.UserId')[_0xa9e5('0x6f')](_0xa9e5('0x70'),'a',_0xa9e5('0x71'))['left_join'](_0xa9e5('0x72'),'me',_0xa9e5('0x73'))[_0xa9e5('0x6f')](_0xa9e5('0x74'),'it',_0xa9e5('0x75'))[_0xa9e5('0x6f')]('tools_tags','t',_0xa9e5('0x76'));var _0x5265b9=squel[_0xa9e5('0x77')]();var _0x2cb45c=[];var _0x51d0f4=squel[_0xa9e5('0x77')]();var _0x44fda2;if(_0xba42f5['query'][_0xa9e5('0x78')]){_0x44fda2=as[_0xa9e5('0x79')](_0xba42f5['query']['search']);var _0x39a45a=_0x44fda2['sqlOperator'];for(var _0x2cb9b3=0x0;_0x2cb9b3<_0x44fda2[_0xa9e5('0x7a')][_0xa9e5('0x5d')];_0x2cb9b3++){var _0x4c60e3=_0x44fda2[_0xa9e5('0x7a')][_0x2cb9b3];var _0x1c6739='i';var _0x2421a2=_[_0xa9e5('0x7b')](_0x28db5c,[_0xa9e5('0x3b'),_0x4c60e3[_0xa9e5('0x64')]]);if(!_0x2421a2){switch(_0x4c60e3[_0xa9e5('0x64')]){case'unreadMessages':if(_0x4c60e3[_0xa9e5('0x7c')]==0x1){_0x3658f6[_0xa9e5('0x7d')]('`'+_0x4c60e3[_0xa9e5('0x64')]+_0xa9e5('0x7e'));}else{_0x3658f6[_0xa9e5('0x7d')]('`'+_0x4c60e3['field']+'`\x20>\x200');}break;case _0xa9e5('0x7f'):if(_0x4c60e3[_0xa9e5('0x80')]===_0xa9e5('0x81')){if(_0x4c60e3['value']['split']('\x20')[_0xa9e5('0x5d')]>0x1){_0x5265b9[_0x39a45a](_0xa9e5('0x82'),qs[_0xa9e5('0x83')](_0x4c60e3[_0xa9e5('0x7c')]),null);}else{var _0xef0f86='%'+_0x4c60e3[_0xa9e5('0x7c')]+'%';_0x5265b9[_0x39a45a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0xef0f86,_0xef0f86,_0xef0f86);}}else{_0x2421a2=_[_0xa9e5('0x7b')](_0x28db5c,[_0xa9e5('0x3b'),_0xa9e5('0x84')]);_0x4c60e3[_0xa9e5('0x64')]=_0xa9e5('0x84');_0x163f65=as['buildExpression'](_0x1c6739,_0x2421a2[_0xa9e5('0x56')],_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x86')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x2f')]);}break;case _0xa9e5('0x87'):var _0x5bc5e3=_0x4c60e3[_0xa9e5('0x7c')][_0xa9e5('0x47')](',')[_0xa9e5('0x44')](function(_0x1e6a09){return Number(_0x1e6a09);});_0x5bc5e3['forEach'](function(_0x18eaf7){_0x51d0f4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x18eaf7+',%');});_0x2cb45c=_['union'](_0x2cb45c,_0x5bc5e3);break;case _0xa9e5('0x88'):if(_0x4c60e3[_0xa9e5('0x80')]===_0xa9e5('0x81')){_0x5265b9[_0x39a45a](_0xa9e5('0x89'),'%'+_0x4c60e3[_0xa9e5('0x7c')]+'%',null);}else{_0x2421a2=_['find'](_0x28db5c,[_0xa9e5('0x3b'),_0xa9e5('0x4c')]);_0x4c60e3[_0xa9e5('0x64')]=_0xa9e5('0x4c');_0x163f65=as[_0xa9e5('0x8a')](_0x1c6739,_0x2421a2[_0xa9e5('0x56')],_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x86')],_0x163f65[_0xa9e5('0x7c')][_0xa9e5('0x2f')]);}break;case _0xa9e5('0x3f'):_0x163f65=as[_0xa9e5('0x8a')]('me',null,_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65[_0xa9e5('0x7c')]['start'],_0x163f65[_0xa9e5('0x7c')]['end']);break;}}else{var _0x163f65=as[_0xa9e5('0x8a')](_0x1c6739,_0x2421a2[_0xa9e5('0x56')],_0x4c60e3);_0x5265b9[_0x39a45a](_0x163f65[_0xa9e5('0x85')],_0x163f65['value'][_0xa9e5('0x86')],_0x163f65[_0xa9e5('0x7c')]['end']);}}}else{var _0x26b35d=_(_0xba42f5[_0xa9e5('0x58')])['keys']()[_0xa9e5('0x44')](function(_0x2703a9){return _[_0xa9e5('0x8b')](_0x28db5c,[_0xa9e5('0x3b'),_0x2703a9])?_0x2703a9:undefined;})['compact']()[_0xa9e5('0x7c')]();if(!_['isEmpty'](_0x26b35d)){_0x26b35d[_0xa9e5('0x48')](function(_0x1e27ca){if(_0x1e27ca===_0xa9e5('0x8c')){_0x3658f6[_0xa9e5('0x61')](_0xa9e5('0x8d'),[][_0xa9e5('0x8e')](_0xba42f5[_0xa9e5('0x58')][_0x1e27ca]));}else if(_0x1e27ca===_0xa9e5('0x8f')){var _0x2aafdf=JSON[_0xa9e5('0x90')](_0xba42f5[_0xa9e5('0x58')][_0x1e27ca])['$gte'];var _0x449684=JSON['parse'](_0xba42f5[_0xa9e5('0x58')][_0x1e27ca])[_0xa9e5('0x91')];_0x3658f6[_0xa9e5('0x61')](_0xa9e5('0x92'),_0x2aafdf,_0x449684);}else{if(_0xba42f5['query'][_0x1e27ca]===_0xa9e5('0x93')){_0x3658f6[_0xa9e5('0x61')]('i.'+_0x1e27ca+_0xa9e5('0x94'));}else{_0x3658f6[_0xa9e5('0x61')]('i.'+_0x1e27ca+'\x20=\x20?',_0xba42f5[_0xa9e5('0x58')][_0x1e27ca]);}}});}if(_0xba42f5[_0xa9e5('0x58')]['read']){if(_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x95')]==0x1){_0x3658f6['having'](_0xa9e5('0x96'));}else{_0x3658f6[_0xa9e5('0x7d')](_0xa9e5('0x97'));}}if(_0xba42f5[_0xa9e5('0x58')]['tag']){_0x2cb45c=_[_0xa9e5('0x98')](_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x99')])?_0xba42f5[_0xa9e5('0x58')]['tag']:new Array(_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x99')]);_0x2cb45c[_0xa9e5('0x48')](function(_0x587261){_0x51d0f4['or'](_0xa9e5('0x9a'),'%,'+_0x587261+',%');});}if(_0xba42f5['query'][_0xa9e5('0x9b')]){var _0xdff0d2=_0xba42f5['query']['filter'][_0xa9e5('0x9c')]('\x5c','\x5c\x5c')[_0xa9e5('0x9c')](/'/g,'\x27\x27');if(qs[_0xa9e5('0x9d')](_0xdff0d2)){_0x5265b9['or'](_0xa9e5('0x9e'),_0xdff0d2+'%');}else{_0x5265b9['or'](_0xa9e5('0x9f'),qs[_0xa9e5('0x83')](_0xdff0d2))['or'](_0xa9e5('0xa0'),_0xdff0d2+'%');}}}_0x3658f6[_0xa9e5('0x61')](_0x5265b9);_0x3658f6[_0xa9e5('0xa1')](_0xa9e5('0xa2'));var _0x63e3ce={'type':db[_0xa9e5('0xa3')][_0xa9e5('0xa4')]['SELECT'],'raw':!![]};var _0x233d2b=_0x3658f6[_0xa9e5('0xa5')]();_0x233d2b[_0xa9e5('0x64')]('i.id');_0x233d2b[_0xa9e5('0x64')](_0xa9e5('0xa6'),_0xa9e5('0xa7'));if(_0x1bb9b3['order']){_0x1bb9b3[_0xa9e5('0x5f')][_0xa9e5('0x48')](function(_0x30a937){var _0x5095a4=_0x30a937[0x0]===_0xa9e5('0xa8')?_0x30a937[0x0]:'i.'+_0x30a937[0x0];_0x3658f6[_0xa9e5('0x5f')](_0x5095a4,_0x30a937[0x1]===_0xa9e5('0xa9')?![]:!![]);});}if(!_[_0xa9e5('0xaa')](_0x2cb45c)){_0x3658f6['having'](_0x51d0f4);_0x233d2b[_0xa9e5('0x61')](_0xa9e5('0xab'),_0x2cb45c);}BPromise[_0xa9e5('0xac')]()[_0xa9e5('0x23')](function(){if(!_0x44fda2){if(_0xba42f5[_0xa9e5('0x58')][_0xa9e5('0x8c')])return;_0x233d2b['where'](_0xa9e5('0xad'));_0x3658f6['where'](_0xa9e5('0xad'));return;}if(_0xba42f5[_0xa9e5('0xae')]['role']!=='agent')return;return _0xba42f5[_0xa9e5('0xae')][_0xa9e5('0xaf')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2b2a37){if(_[_0xa9e5('0xaa')](_0x2b2a37)){_0x233d2b['where'](_0xa9e5('0xb0'));_0x3658f6[_0xa9e5('0x61')](_0xa9e5('0xb0'));}else{_0x233d2b[_0xa9e5('0x61')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x2b2a37,'id'));_0x3658f6['where'](_0xa9e5('0x8d'),_[_0xa9e5('0x44')](_0x2b2a37,'id'));}});})[_0xa9e5('0x23')](function(){if(_0xba42f5[_0xa9e5('0xae')][_0xa9e5('0xb1')]===_0xa9e5('0x41')&&!_0x44fda2&&!_0xba42f5[_0xa9e5('0x58')]['ChatWebsiteId'])return[];return db[_0xa9e5('0xb2')][_0xa9e5('0x58')](_0x233d2b[_0xa9e5('0xb3')](),_0x63e3ce);})[_0xa9e5('0x23')](function(_0x4af092){_0x141d65[_0xa9e5('0x34')]=_0x4af092[_0xa9e5('0x5d')];if(_0x141d65[_0xa9e5('0x34')]===0x0)return[];return db[_0xa9e5('0xb2')][_0xa9e5('0x58')](_0x3b1896[_0xa9e5('0xb3')](),_0x63e3ce)[_0xa9e5('0x23')](function(_0x3886c8){_0x534bbf=_[_0xa9e5('0xb4')](_0x3886c8,'id');_0x63e3ce=_[_0xa9e5('0x3e')](_0x63e3ce,{'model':db[_0xa9e5('0x54')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xba42f5['query'][_0xa9e5('0x5c')]){_0x1bb9b3[_0xa9e5('0x5b')][_0xa9e5('0x48')](function(_0x59db22){_0x3658f6['field']('i.'+_0x59db22);});}else{_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xa6'),_0xa9e5('0xa7'));_0x3658f6['field'](_0xa9e5('0xb5'),_0xa9e5('0xb6'));_0x3658f6['field'](_0xa9e5('0xb7'),_0xa9e5('0xb8'));_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xb9'),_0xa9e5('0xa8'));_0x3658f6[_0xa9e5('0x64')]('i.*');_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xba'),'Contact.firstName');_0x3658f6[_0xa9e5('0x64')]('c.lastName','Contact.lastName');_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xbb'),_0xa9e5('0xbc'));_0x3658f6[_0xa9e5('0x64')]('c.phone',_0xa9e5('0xbd'));_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xbe'),'Contact.mobile');_0x3658f6[_0xa9e5('0x64')](_0xa9e5('0xbf'),_0xa9e5('0xc0'));_0x3658f6[_0xa9e5('0x64')]('o.fullname','Owner.fullname');_0x3658f6[_0xa9e5('0x64')]('o.internal',_0xa9e5('0xc1'));_0x3658f6['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa9e5('0x45'));}if(_0x1bb9b3[_0xa9e5('0x35')])_0x3658f6[_0xa9e5('0x35')](_0x1bb9b3[_0xa9e5('0x35')]);if(_0x1bb9b3[_0xa9e5('0x32')])_0x3658f6[_0xa9e5('0x32')](_0x1bb9b3[_0xa9e5('0x32')]);return db['sequelize'][_0xa9e5('0x58')](_0x3658f6[_0xa9e5('0xb3')](),_0x63e3ce);})[_0xa9e5('0x23')](function(_0x35ca83){if(_0x35ca83[_0xa9e5('0x5d')]>0x0)_0x450f1f[_0xa9e5('0x61')]('ui.ChatInteractionId\x20IN\x20?',_[_0xa9e5('0x44')](_0x35ca83,'id'));return db[_0xa9e5('0xb2')]['query'](_0x450f1f[_0xa9e5('0xb3')](),_0x63e3ce)['then'](function(_0x15fd35){var _0x1cca96=_['groupBy'](_0x15fd35,_0xa9e5('0xc2'));var _0x320917=[];_0x35ca83[_0xa9e5('0x48')](function(_0x24b1f8){_0x320917['push'](updateChatInteraction(_0x24b1f8,_0x534bbf,_0x1cca96));});return BPromise['all'](_0x320917);});});})[_0xa9e5('0x23')](function(_0x488eb0){_0x141d65['rows']=_0x488eb0;return _0x141d65;})[_0xa9e5('0x23')](respondWithFilteredResult(_0x27c5e7,_0x1bb9b3))['catch'](handleError(_0x27c5e7,null));};exports[_0xa9e5('0xc3')]=function(_0x4f627a,_0x472a1c){var _0x5f40aa={'raw':![],'where':{'id':_0x4f627a['params']['id']}},_0x3eefb6={};_0x3eefb6[_0xa9e5('0x57')]=_[_0xa9e5('0x59')](db[_0xa9e5('0x54')][_0xa9e5('0xc4')]);_0x3eefb6[_0xa9e5('0x58')]=_['keys'](_0x4f627a[_0xa9e5('0x58')]);_0x3eefb6[_0xa9e5('0x5a')]=_['intersection'](_0x3eefb6[_0xa9e5('0x57')],_0x3eefb6['query']);_0x5f40aa['attributes']=_[_0xa9e5('0xc5')](_0x3eefb6['model'],qs['fields'](_0x4f627a['query'][_0xa9e5('0x5c')]));_0x5f40aa[_0xa9e5('0x5b')]=_0x5f40aa[_0xa9e5('0x5b')][_0xa9e5('0x5d')]?_0x5f40aa[_0xa9e5('0x5b')]:_0x3eefb6[_0xa9e5('0x57')];if(_0x4f627a[_0xa9e5('0x58')][_0xa9e5('0xc6')]){_0x5f40aa[_0xa9e5('0xc7')]=[{'all':!![]}];}_0x5f40aa=_[_0xa9e5('0x3e')]({},_0x5f40aa,_0x4f627a['options']);return db[_0xa9e5('0x54')][_0xa9e5('0x7b')](_0x5f40aa)[_0xa9e5('0x23')](handleEntityNotFound(_0x472a1c,null))[_0xa9e5('0x23')](respondWithResult(_0x472a1c,null))['catch'](handleError(_0x472a1c,null));};exports[_0xa9e5('0xc8')]=function(_0x58ce0e,_0x38f094){return db['ChatInteraction'][_0xa9e5('0xc8')](_0x58ce0e['body'],{})[_0xa9e5('0x23')](respondWithResult(_0x38f094,0xc9))[_0xa9e5('0x2e')](handleError(_0x38f094,null));};exports[_0xa9e5('0x38')]=function(_0x3a06a6,_0x336a54){if(_0x3a06a6[_0xa9e5('0x3f')]['id']){delete _0x3a06a6[_0xa9e5('0x3f')]['id'];}return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x3a06a6['params']['id']}})['then'](handleEntityNotFound(_0x336a54,null))['then'](saveUpdates(_0x3a06a6['body'],null))[_0xa9e5('0x23')](respondWithResult(_0x336a54,null))[_0xa9e5('0x2e')](handleError(_0x336a54,null));};exports[_0xa9e5('0xc9')]=function(_0x2135d8,_0x52222e){return db[_0xa9e5('0x54')][_0xa9e5('0x7b')]({'where':{'id':_0x2135d8[_0xa9e5('0xca')]['id']}})['then'](handleEntityNotFound(_0x52222e,null))[_0xa9e5('0x23')](removeEntity(_0x52222e,null))['catch'](handleError(_0x52222e,null));};exports[_0xa9e5('0xcb')]=function(_0x4b5d61,_0x5cc2c3){return db['ChatInteraction'][_0xa9e5('0xcb')]()[_0xa9e5('0x23')](respondWithResult(_0x5cc2c3,null))[_0xa9e5('0x2e')](handleError(_0x5cc2c3,null));};exports['createVidaooSession']=function(_0x422241,_0x5aee5b){var _0x39f653=_0x422241['params']['id'];var _0x2d9183;var _0x396f47;var _0x1c120e;return db['ChatInteraction'][_0xa9e5('0xcc')]({'where':{'id':_0x39f653}})[_0xa9e5('0x23')](function(_0x2f67e3){_0x2d9183=_0x2f67e3;return db['ChatWebsite'][_0xa9e5('0xcc')]({'where':{'id':_0x2f67e3[_0xa9e5('0x8c')]},'attributes':['id',_0xa9e5('0xcd'),_0xa9e5('0xce'),_0xa9e5('0xcf'),_0xa9e5('0xd0'),'vidaooMetadata'],'raw':!![]});})[_0xa9e5('0x23')](function(_0x86c45f){if(_0x86c45f&&_0x86c45f[_0xa9e5('0xcd')]&&_0x86c45f[_0xa9e5('0xce')]){_0x396f47=_0x86c45f;var _0x505491={'interaction':{'id':_0x39f653},'agent':{'id':_0x422241[_0xa9e5('0xae')]['id'],'name':_0x422241[_0xa9e5('0xae')][_0xa9e5('0x3b')],'fullname':_0x422241[_0xa9e5('0xae')][_0xa9e5('0xd1')],'email':_0x422241['user']['email']},'contact':_0x422241[_0xa9e5('0x3f')][_0xa9e5('0x40')],'account':_0x422241['body'][_0xa9e5('0xd2')]};var _0x197b0e={'rejectUnauthorized':![],'method':_0xa9e5('0xd3'),'url':_0xa9e5('0xd4'),'headers':{'X-APIKEY':_0x86c45f[_0xa9e5('0xcd')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x422241['user']['email']],'buttons':null,'topic':_0x396f47['vidaooTopic'],'note':_[_0xa9e5('0xd5')](_0x396f47[_0xa9e5('0xd0')])?null:getMustacheRender(_0x396f47[_0xa9e5('0xd0')],_0x505491),'metadata':null},'redirect':_0xa9e5('0xd6'),'json':!![]};try{if(!_[_0xa9e5('0xd5')](_0x396f47['vidaooMetadata'])){var _0x592773=getMustacheRender(_0x396f47['vidaooMetadata'],_0x505491);var _0x43604a=JSON[_0xa9e5('0x90')](_0x592773);_0x197b0e[_0xa9e5('0x3f')]['metadata']=_0x43604a;}}catch(_0x413e06){throw new db['Sequelize'][(_0xa9e5('0xd7'))](_0xa9e5('0xd8'));}return rp(_0x197b0e);}else{throw new db[(_0xa9e5('0xa3'))][(_0xa9e5('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xa9e5('0x23')](function(_0x476fbb){_0x1c120e=_0x476fbb;if(_0x1c120e['id']){var _0xddd1e3={'body':_0x1c120e[_0xa9e5('0xd9')],'ChatWebsiteId':_0x396f47['id'],'ChatInteractionId':_0x2d9183['id'],'direction':_0xa9e5('0xda'),'UserId':_0x422241[_0xa9e5('0xae')]['id']};return db['ChatMessage']['create'](_0xddd1e3,{});}else{throw new db[(_0xa9e5('0xa3'))][(_0xa9e5('0xd7'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xa9e5('0x23')](function(){return _0x2d9183[_0xa9e5('0xdb')]({'vidaooSessionId':_0x1c120e['id']});})['then'](respondWithResult(_0x5aee5b,null))['catch'](handleError(_0x5aee5b,null));};exports[_0xa9e5('0xdc')]=function(_0x190f0f,_0xf4a21a){if(_0x190f0f[_0xa9e5('0x3f')]['id']){delete _0x190f0f[_0xa9e5('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x190f0f[_0xa9e5('0xca')]['id']},'include':[{'model':db[_0xa9e5('0xdd')],'as':_0xa9e5('0x7f')}]})[_0xa9e5('0x23')](handleEntityNotFound(_0xf4a21a,null))[_0xa9e5('0x23')](saveUpdates(_0x190f0f['body'],null))['then'](respondWithResult(_0xf4a21a,null))[_0xa9e5('0x2e')](handleError(_0xf4a21a,null));};exports['abandon']=function(_0x2d91c2,_0x138c54,_0x1f7b39){if(_0x2d91c2[_0xa9e5('0x3f')]['id']){delete _0x2d91c2[_0xa9e5('0x3f')]['id'];}return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x2d91c2[_0xa9e5('0xca')]['id']}})['then'](function(_0x4fc516){if(!_0x4fc516){logger[_0xa9e5('0x2a')](_0xa9e5('0xde'),_0xa9e5('0xdf'),0x194,_0xa9e5('0xe0'));_0x138c54['sendStatus'](0x194);}else{if(_0x4fc516[_0xa9e5('0x4c')]){throw new db[(_0xa9e5('0xa3'))][(_0xa9e5('0xd7'))](_0xa9e5('0xe1'));}}return _0x4fc516;})[_0xa9e5('0x23')](function(_0x4a245d){if(_0x4a245d){return _0x4a245d[_0xa9e5('0x38')]({'closed':_0x2d91c2[_0xa9e5('0x3f')][_0xa9e5('0x4e')],'disposition':_0x2d91c2[_0xa9e5('0x3f')][_0xa9e5('0x50')]})['then'](function(_0x567872){return _0x567872;});}})[_0xa9e5('0x23')](function(_0x37e56c){return respondWithRpcPromise('AbandonInteraction',_0xa9e5('0xdf'),_0x2d91c2[_0xa9e5('0x3f')],client9004);})[_0xa9e5('0x23')](respondWithResult(_0x138c54,null))[_0xa9e5('0x2e')](handleError(_0x138c54,null));};exports[_0xa9e5('0xe2')]=function(_0x4ed4dc,_0x548cd0,_0x2f926e){_0x4ed4dc[_0xa9e5('0x3f')][_0xa9e5('0x3b')]=_0x4ed4dc[_0xa9e5('0xe3')]['originalname'];_0x4ed4dc[_0xa9e5('0x3f')][_0xa9e5('0xe4')]=_0x4ed4dc['file'][_0xa9e5('0xe5')];_0x4ed4dc[_0xa9e5('0x3f')]['type']=_0x4ed4dc[_0xa9e5('0xe3')][_0xa9e5('0xe6')];return db[_0xa9e5('0xe7')][_0xa9e5('0xc8')](_0x4ed4dc['body'])[_0xa9e5('0x23')](respondWithResult(_0x548cd0,0xc9))[_0xa9e5('0x2e')](handleError(_0x548cd0,null));};exports[_0xa9e5('0xe8')]=function(_0x4d135b,_0x38806b,_0x12ce70){return db[_0xa9e5('0x54')][_0xa9e5('0xcc')]({'where':{'id':_0x4d135b[_0xa9e5('0xca')]['id']},'raw':!![]})[_0xa9e5('0x23')](handleEntityNotFound(_0x38806b,null))[_0xa9e5('0x23')](function(_0x4153fc){if(_0x4153fc){if(_0x4153fc[_0xa9e5('0x4e')]){return _0x38806b[_0xa9e5('0x30')](0x193)[_0xa9e5('0x31')]({'status':0x193,'message':_0xa9e5('0xe9')});}return db[_0xa9e5('0xe7')][_0xa9e5('0xcc')]({'where':{'id':_0x4d135b[_0xa9e5('0x58')][_0xa9e5('0xea')]},'raw':!![]})[_0xa9e5('0x23')](handleEntityNotFound(_0x38806b,null));}})[_0xa9e5('0x23')](function(_0x2781e9){if(_0x2781e9){var _0x5c087a=_0x2781e9[_0xa9e5('0xeb')]!==null;var _0x40e65f=path['join'](config[_0xa9e5('0xec')],'server/files/attachments/');if(_0x5c087a){_0x40e65f=path[_0xa9e5('0xed')](_0x40e65f,'offline-chat/');}var _0x271069=path[_0xa9e5('0xed')](_0x40e65f,_0x2781e9[_0xa9e5('0xe4')]);return _0x38806b[_0xa9e5('0xee')](_0x271069);}})[_0xa9e5('0x2e')](handleError(_0x38806b,null));};exports[_0xa9e5('0xef')]=function(_0x22ce35,_0x473457){var _0x412307=null;var _0x57ee96=null;var _0x34813e=null;var _0x33d574=null;if(_0x22ce35[_0xa9e5('0x3f')]['id']){delete _0x22ce35['body']['id'];}if(_0x22ce35['body'][_0xa9e5('0xf0')]){_0x33d574=path[_0xa9e5('0xed')](config['root'],_0xa9e5('0xf1'),util['format'](_0xa9e5('0xf2'),Date['now']()));_0x22ce35[_0xa9e5('0x3f')][_0xa9e5('0xf3')]=_0x33d574;}return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x22ce35['params']['id']},'include':[{'model':db[_0xa9e5('0xf4')],'as':_0xa9e5('0xf5'),'include':[{'model':db[_0xa9e5('0x88')],'as':_0xa9e5('0x88')}]}]})[_0xa9e5('0x23')](handleEntityNotFound(_0x473457,null))[_0xa9e5('0x23')](saveUpdates(_0x22ce35[_0xa9e5('0x3f')],null))[_0xa9e5('0x23')](function(_0x187f26){if(_0x187f26){_0x412307=_0x187f26;return db[_0xa9e5('0xf6')][_0xa9e5('0x7b')]({'where':{'id':_0x412307['ChatWebsiteId']}});}})[_0xa9e5('0x23')](function(_0x2b731c){if(_0x2b731c){_0x34813e=_0x2b731c;return db[_0xa9e5('0xdd')][_0xa9e5('0x7b')]({'where':{'id':_0x412307[_0xa9e5('0x84')]}});}})[_0xa9e5('0x23')](function(_0x159ca7){if(_0x159ca7){_0x57ee96=_0x159ca7;if(_0x33d574){var _0x3cf2c2=null;for(var _0x1ec62c=0x1;_0x1ec62c<_0x412307[_0xa9e5('0xf5')][_0xa9e5('0x5d')];++_0x1ec62c){_0x3cf2c2=_0x412307[_0xa9e5('0xf5')][_0x1ec62c];var _0x4ab78a=_0x3cf2c2[_0xa9e5('0x4c')]?util[_0xa9e5('0xf7')]('%s%d',_0x34813e[_0xa9e5('0xf8')],_0x3cf2c2['UserId']):_0xa9e5('0xf9');var _0x251fe2=_0x22ce35[_0xa9e5('0x3f')]['customer']||util[_0xa9e5('0xf7')]('%s%d',_0xa9e5('0xfa'),_0x3cf2c2[_0xa9e5('0x84')]);switch(_0x34813e[_0xa9e5('0xfb')]){case _0xa9e5('0xfc'):_0x4ab78a=_0x3cf2c2[_0xa9e5('0x4c')]?util[_0xa9e5('0xf7')](_0xa9e5('0xfd'),_0x34813e[_0xa9e5('0xf8')],_0x3cf2c2[_0xa9e5('0x4c')]):'System';break;case'agent_alias':_0x4ab78a=_0x3cf2c2[_0xa9e5('0x4c')]?_0x3cf2c2['User'][_0xa9e5('0xfe')]||_0x3cf2c2[_0xa9e5('0x88')][_0xa9e5('0xd1')]:'System';break;case _0xa9e5('0xff'):_0x4ab78a=_0x3cf2c2['UserId']?_0x3cf2c2[_0xa9e5('0x88')][_0xa9e5('0xd1')]:_0xa9e5('0xf9');break;default:_0x4ab78a=_0x3cf2c2['UserId']?util['format'](_0xa9e5('0xfd'),_0x34813e[_0xa9e5('0xf8')],_0x3cf2c2[_0xa9e5('0x4c')]):'System';}var _0x4a1468=util[_0xa9e5('0xf7')](_0xa9e5('0x100'),moment(_0x3cf2c2[_0xa9e5('0x8f')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0x3cf2c2[_0xa9e5('0x101')]==='in'?_0x251fe2:_0x4ab78a,_0x3cf2c2[_0xa9e5('0x3f')]);if(!_0x3cf2c2[_0xa9e5('0x102')]){fs[_0xa9e5('0x103')](_0x33d574,_0x4a1468);}}return db[_0xa9e5('0x104')][_0xa9e5('0xcc')]({'where':{'service':!![]},'include':[{'model':db[_0xa9e5('0x105')],'as':_0xa9e5('0x106'),'raw':!![]}]});}}})[_0xa9e5('0x23')](function(_0x2fd957){if(_0x2fd957&&_0x2fd957['Smtp']&&_0x22ce35[_0xa9e5('0x3f')]){var _0x11dd08={'tls':{'rejectUnauthorized':![]}};if(_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x107')]){_0x11dd08[_0xa9e5('0x107')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x107')];}else{_0x11dd08[_0xa9e5('0x108')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x108')];_0x11dd08[_0xa9e5('0x109')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x109')];_0x11dd08[_0xa9e5('0x10a')]=_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x10a')];}if(_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0x10b')]){_0x11dd08[_0xa9e5('0x10c')]={'user':_0x2fd957['Smtp'][_0xa9e5('0xae')],'pass':_0x2fd957['Smtp'][_0xa9e5('0x10d')]};}return respondWithRpcPromise(_0xa9e5('0x10e'),'sendMail',{'account':_0x11dd08,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2fd957[_0xa9e5('0x3b')],_0x2fd957['email']||_0x2fd957[_0xa9e5('0x106')][_0xa9e5('0xae')]),'to':_0x22ce35[_0xa9e5('0x3f')][_0xa9e5('0xf0')],'subject':_0xa9e5('0x10f'),'text':util[_0xa9e5('0xf7')](_0xa9e5('0x110'),_0x22ce35['body'][_0xa9e5('0xf0')]),'attachments':[{'path':_0x33d574}]}})[_0xa9e5('0x23')](function(){return _0x412307;})[_0xa9e5('0x2e')](function(_0x10e7ac){console[_0xa9e5('0x2a')](_0x10e7ac);});}else{return _0x412307;}})[_0xa9e5('0x23')](respondWithStatusCode(_0x473457,0xc8))[_0xa9e5('0x2e')](handleError(_0x473457,null));};exports[_0xa9e5('0x111')]=function(_0x36304e,_0x2e0150,_0x4c9296){return db[_0xa9e5('0xf4')][_0xa9e5('0x7b')]({'where':{'id':_0x36304e[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x2e0150,null))[_0xa9e5('0x23')](function(_0x2ff0e3){if(_0x2ff0e3){return _0x2ff0e3[_0xa9e5('0x111')](_0x36304e['body'][_0xa9e5('0x112')],_[_0xa9e5('0x113')](_0x36304e[_0xa9e5('0x3f')],[_0xa9e5('0x112'),'id'])||{});}})[_0xa9e5('0x23')](respondWithResult(_0x2e0150,null))[_0xa9e5('0x2e')](handleError(_0x2e0150,null));};exports['getMessages']=function(_0x15c12b,_0x1a87f7,_0x1ea1cc){var _0x408e41={'raw':![],'where':{}};var _0xf70e9f={};var _0x391b35={'count':0x0,'rows':[]};return db[_0xa9e5('0x54')]['findOne']({'where':{'id':_0x15c12b[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x1a87f7,null))[_0xa9e5('0x23')](function(_0x1ceaa2){if(_0x1ceaa2){_0xf70e9f['model']=_['keys'](db[_0xa9e5('0xf4')][_0xa9e5('0xc4')]);_0xf70e9f['query']=_[_0xa9e5('0x59')](_0x15c12b[_0xa9e5('0x58')]);_0xf70e9f[_0xa9e5('0x5a')]=_[_0xa9e5('0xc5')](_0xf70e9f['model'],_0xf70e9f[_0xa9e5('0x58')]);_0x408e41[_0xa9e5('0x5b')]=_[_0xa9e5('0xc5')](_0xf70e9f[_0xa9e5('0x57')],qs[_0xa9e5('0x5c')](_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x5c')]));_0x408e41[_0xa9e5('0x5b')]=_0x408e41['attributes'][_0xa9e5('0x5d')]?_0x408e41[_0xa9e5('0x5b')]:_0xf70e9f[_0xa9e5('0x57')];if(!_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x114')](_0xa9e5('0x5e'))){_0x408e41[_0xa9e5('0x35')]=qs[_0xa9e5('0x35')](_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x35')]);_0x408e41[_0xa9e5('0x32')]=qs['offset'](_0x15c12b['query']['offset']);}_0x408e41[_0xa9e5('0x5f')]=qs['sort'](_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0x60')]);_0x408e41['where']=qs[_0xa9e5('0x5a')](_['pick'](_0x15c12b['query'],_0xf70e9f[_0xa9e5('0x5a')]));_0x408e41[_0xa9e5('0x61')]['ChatInteractionId']=_0x1ceaa2['id'];if(_0x15c12b[_0xa9e5('0x58')]['filter']){_0x408e41[_0xa9e5('0x61')]=_[_0xa9e5('0x3e')](_0x408e41['where'],{'$or':_[_0xa9e5('0x44')](_0x408e41[_0xa9e5('0x5b')],function(_0x449121){var _0x2c976a={};_0x2c976a[_0x449121]={'$like':'%'+_0x15c12b['query'][_0xa9e5('0x9b')]+'%'};return _0x2c976a;})});}if(_0x15c12b[_0xa9e5('0x58')]['$gte']){var _0x3a7b7b=_0x15c12b[_0xa9e5('0x58')]['$gte']['split'](',');var _0x5cf248={};_0x5cf248[_0x3a7b7b[0x0]]={'$gte':moment(_0x3a7b7b[0x1])[_0xa9e5('0xf7')](_0xa9e5('0x115'))};_0x408e41[_0xa9e5('0x61')]=_[_0xa9e5('0x3e')](_0x408e41['where'],_0x5cf248);}_0x408e41=_[_0xa9e5('0x3e')]({},_0x408e41,_0x15c12b[_0xa9e5('0x116')]);return db[_0xa9e5('0xf4')]['count']({'where':_0x408e41[_0xa9e5('0x61')]})[_0xa9e5('0x23')](function(_0x237439){_0x391b35[_0xa9e5('0x34')]=_0x237439;if(_0x15c12b[_0xa9e5('0x58')][_0xa9e5('0xc6')]){_0x408e41[_0xa9e5('0xc7')]=[{'all':!![]}];}return db['ChatMessage'][_0xa9e5('0x117')](_0x408e41);})[_0xa9e5('0x23')](function(_0x16061b){_0x391b35[_0xa9e5('0x118')]=_0x16061b;return _0x391b35;});}})['then'](respondWithFilteredResult(_0x1a87f7,_0x408e41))[_0xa9e5('0x2e')](handleError(_0x1a87f7,null));};exports[_0xa9e5('0x119')]=function(_0x3ec150,_0x2a03c2,_0x3b9edb){var _0xe2f2e9={'where':{}},_0x17814e={},_0x3fac9b={'count':0x0,'rows':[]};return db[_0xa9e5('0x54')][_0xa9e5('0xcc')]({'where':{'id':_0x3ec150[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x2a03c2,null))[_0xa9e5('0x23')](function(_0x22c1c0){if(_0x22c1c0){_0x17814e[_0xa9e5('0x57')]=_[_0xa9e5('0x59')](db[_0xa9e5('0xf4')][_0xa9e5('0xc4')]);_0x17814e[_0xa9e5('0x58')]=_[_0xa9e5('0x59')](_0x3ec150['query']);_0x17814e[_0xa9e5('0x5a')]=_['intersection'](_0x17814e[_0xa9e5('0x57')],_0x17814e[_0xa9e5('0x58')]);_0xe2f2e9[_0xa9e5('0x5b')]=_['intersection'](_0x17814e[_0xa9e5('0x57')],qs[_0xa9e5('0x5c')](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x5c')]));_0xe2f2e9[_0xa9e5('0x5b')]=_0xe2f2e9[_0xa9e5('0x5b')][_0xa9e5('0x5d')]?_0xe2f2e9['attributes']:_0x17814e[_0xa9e5('0x57')];if(!_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x114')](_0xa9e5('0x5e'))){_0xe2f2e9['limit']=qs[_0xa9e5('0x35')](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x35')]);_0xe2f2e9[_0xa9e5('0x32')]=qs['offset'](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x32')]);}_0xe2f2e9[_0xa9e5('0x5f')]=qs[_0xa9e5('0x60')](_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x60')]);_0xe2f2e9[_0xa9e5('0x61')]=qs[_0xa9e5('0x5a')](_[_0xa9e5('0x62')](_0x3ec150[_0xa9e5('0x58')],_0x17814e['filters']));_0xe2f2e9[_0xa9e5('0x61')][_0xa9e5('0xc2')]=_0x22c1c0['id'];if(_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x9b')]){_0xe2f2e9['where']=_['merge'](_0xe2f2e9[_0xa9e5('0x61')],{'$or':_['map'](_0xe2f2e9[_0xa9e5('0x5b')],function(_0x365c19){var _0x2a7345={};_0x2a7345[_0x365c19]={'$like':'%'+_0x3ec150['query']['filter']+'%'};return _0x2a7345;})});}_0xe2f2e9[_0xa9e5('0x61')]['secret']=![];if(_0x3ec150[_0xa9e5('0x58')]['id']){_0xe2f2e9[_0xa9e5('0x61')]['id']={'$gt':_0x3ec150[_0xa9e5('0x58')]['id']};}_0xe2f2e9=_[_0xa9e5('0x3e')]({},_0xe2f2e9,_0x3ec150[_0xa9e5('0x116')]);return db[_0xa9e5('0xf4')][_0xa9e5('0x34')]({'where':_0xe2f2e9[_0xa9e5('0x61')]})['then'](function(_0x18ff5d){_0x3fac9b[_0xa9e5('0x34')]=_0x18ff5d;_0xe2f2e9[_0xa9e5('0xc7')]=[];if(_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0x11a')]){_0xe2f2e9[_0xa9e5('0xc7')][_0xa9e5('0x49')]({'model':db['User'],'as':_0xa9e5('0x88'),'attributes':['id',_0xa9e5('0xd1'),_0xa9e5('0xfe')]});}if(_0x3ec150[_0xa9e5('0x58')][_0xa9e5('0xc6')]){_0xe2f2e9[_0xa9e5('0xc7')]=[{'all':!![]}];}return db[_0xa9e5('0xf4')][_0xa9e5('0x117')](_0xe2f2e9);})['then'](function(_0x7ff0f1){_0x3fac9b['rows']=_0x7ff0f1;return _0x3fac9b;});}})[_0xa9e5('0x23')](respondWithFilteredResult(_0x2a03c2,_0xe2f2e9))[_0xa9e5('0x2e')](handleError(_0x2a03c2,null));};exports['addTags']=function(_0x5b1036,_0x27e856,_0x5c1a0f){return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x5b1036['params']['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0x27e856,null))[_0xa9e5('0x23')](function(_0x38f9f4){if(_0x38f9f4){return _0x38f9f4[_0xa9e5('0x11b')](_0x5b1036[_0xa9e5('0x3f')][_0xa9e5('0x112')],_['omit'](_0x5b1036['body'],[_0xa9e5('0x112'),'id'])||{})[_0xa9e5('0x11c')](function(){return db['Tag']['findAll']({'attributes':['id',_0xa9e5('0x3b'),_0xa9e5('0x65')],'where':{'id':_0x5b1036[_0xa9e5('0x3f')][_0xa9e5('0x112')]}});})[_0xa9e5('0x23')](function(_0x253924){socket['emit'](_0xa9e5('0x11d'),{'id':Number(_0x5b1036['params']['id']),'tags':_0x253924||[]});return{'id':Number(_0x5b1036['params']['id']),'tags':_0x253924||[]};});}})['then'](respondWithResult(_0x27e856,null))['catch'](handleError(_0x27e856,null));};exports[_0xa9e5('0x11e')]=function(_0x732c5,_0xa27c71,_0x359090){return db[_0xa9e5('0x54')][_0xa9e5('0x7b')]({'where':{'id':_0x732c5[_0xa9e5('0xca')]['id']}})[_0xa9e5('0x23')](handleEntityNotFound(_0xa27c71,null))[_0xa9e5('0x23')](function(_0x374955){if(_0x374955){return _0x374955[_0xa9e5('0x11e')](_0x732c5['query'][_0xa9e5('0x112')]);}})['then'](respondWithStatusCode(_0xa27c71,null))['catch'](handleError(_0xa27c71,null));};exports[_0xa9e5('0xee')]=function(_0x37c939,_0x5e49cd){var _0x394cda=moment()[_0xa9e5('0x11f')]()[_0xa9e5('0xb3')]();var _0x453e81=path[_0xa9e5('0xed')](config['root'],_0xa9e5('0x120'),_0xa9e5('0x121'),_0xa9e5('0x122'));var _0x216f07=path[_0xa9e5('0xed')](config[_0xa9e5('0xec')],_0xa9e5('0x120'),_0xa9e5('0x121'),_0xa9e5('0x123'));var _0x24fef8=path[_0xa9e5('0xed')](_0x453e81,_0x394cda);var _0x2054c7=util[_0xa9e5('0xf7')](_0xa9e5('0x124'),_0x37c939[_0xa9e5('0xca')]['id'],_0x394cda);var _0xec6dbb=path[_0xa9e5('0xed')](_0x453e81,_0x2054c7);var _0x1849f4=[];_0x1849f4[_0xa9e5('0x49')]({'model':db[_0xa9e5('0x88')],'as':_0xa9e5('0x88'),'attributes':['id',_0xa9e5('0xd1')],'raw':!![]});_0x1849f4[_0xa9e5('0x49')]({'model':db[_0xa9e5('0xdd')],'as':_0xa9e5('0x7f'),'attributes':['id',_0xa9e5('0x125'),'lastName'],'raw':!![]});if(_0x37c939['query'][_0xa9e5('0x123')]){_0x1849f4[_0xa9e5('0x49')]({'model':db[_0xa9e5('0xe7')],'as':_0xa9e5('0xe7'),'raw':!![]});}var _0xe5b2b0=[{'model':db[_0xa9e5('0xf4')],'as':'Messages','attributes':['id',_0xa9e5('0x3f'),_0xa9e5('0x8f'),_0xa9e5('0x101'),_0xa9e5('0x102'),_0xa9e5('0x95')],'include':_0x1849f4}];_0xe5b2b0[_0xa9e5('0x49')]({'model':db[_0xa9e5('0xf6')],'as':_0xa9e5('0x126'),'attributes':['id',_0xa9e5('0x3b')]});_0xe5b2b0[_0xa9e5('0x49')]({'model':db[_0xa9e5('0x88')],'as':'Owner','attributes':['id',_0xa9e5('0xd1')]});return db[_0xa9e5('0x54')]['find']({'where':{'id':_0x37c939['params']['id']},'include':_0xe5b2b0})[_0xa9e5('0x23')](handleEntityNotFound(_0x5e49cd,null))['then'](function(_0x247f89){if(_0x247f89){var _0x15134d=_0x247f89[_0xa9e5('0x127')]({'plain':!![]});fs[_0xa9e5('0x128')](_0x24fef8);var _0x467bc4={'channel':'Chat','account':_0x15134d[_0xa9e5('0x126')][_0xa9e5('0x3b')],'agent':_0x15134d[_0xa9e5('0x129')]?_0x15134d['Owner'][_0xa9e5('0xd1')]:_0xa9e5('0x12a'),'createdAt':moment(_0x15134d[_0xa9e5('0x8f')])[_0xa9e5('0xf7')](_0xa9e5('0x115'))[_0xa9e5('0xb3')](),'closedAt':_0x15134d[_0xa9e5('0x4e')]?moment(_0x15134d[_0xa9e5('0x12b')])[_0xa9e5('0xf7')](_0xa9e5('0x115'))['toString']():'','disposition':_0x15134d[_0xa9e5('0x50')],'chatInfo':{'browser':_0x15134d[_0xa9e5('0x12c')],'os':_0x15134d[_0xa9e5('0x12d')],'referer':_0x15134d['referer'],'customerIp':_0x15134d[_0xa9e5('0x12e')],'customerPort':_0x15134d[_0xa9e5('0x12f')]?_0x15134d['customerPort']:'N.A.'},'messages':_(_0x15134d[_0xa9e5('0xf5')])[_0xa9e5('0x130')]()[_0xa9e5('0x9b')]({'secret':![]})['map'](function(_0x4cda34){if(_0x4cda34[_0xa9e5('0xe7')]){var _0x4c44d3=path[_0xa9e5('0xed')](_0x216f07,_0x4cda34[_0xa9e5('0xe7')][_0xa9e5('0xe4')]);if(fs[_0xa9e5('0x131')](_0x4c44d3)){fs[_0xa9e5('0x132')](_0x4c44d3)[_0xa9e5('0x133')](fs['createWriteStream'](path['join'](_0x24fef8,_0x4cda34[_0xa9e5('0xe7')][_0xa9e5('0xe4')])));}}return{'date':moment(_0x4cda34['createdAt'])[_0xa9e5('0xf7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa9e5('0xb3')](),'sender':_0x4cda34[_0xa9e5('0x101')]===_0xa9e5('0xda')?_0x4cda34[_0xa9e5('0x88')]?_0x4cda34['User'][_0xa9e5('0xd1')]:'System':_0x4cda34['Contact']['firstName']+(_0x4cda34[_0xa9e5('0x7f')][_0xa9e5('0x134')]?'\x20'+_0x4cda34['Contact'][_0xa9e5('0x134')]:''),'body':_0x4cda34[_0xa9e5('0xe7')]?_0x4cda34[_0xa9e5('0xe7')]['basename']:_0x4cda34[_0xa9e5('0x3f')],'direction':_0x4cda34[_0xa9e5('0x101')]===_0xa9e5('0xda')?'A':'C','secret':_0x4cda34[_0xa9e5('0x102')],'read':_0x4cda34[_0xa9e5('0x95')],'attachment':_0x4cda34[_0xa9e5('0xe7')]};})[_0xa9e5('0x7c')]()};return ejs[_0xa9e5('0x135')](path[_0xa9e5('0xed')](config[_0xa9e5('0xec')],_0xa9e5('0x120'),_0xa9e5('0x136'),_0xa9e5('0x137')),{'interaction':_0x467bc4})['then'](function(_0x5ad946){var _0x4ff8d7=path[_0xa9e5('0xed')](_0x24fef8,_0xa9e5('0x138')+_0x15134d['id']+'-'+_0x394cda+'.pdf');var _0xb4d2ab={'path':_0x4ff8d7,'channel':_0xa9e5('0x139'),'interactionId':_0x15134d['id']};return pdf[_0xa9e5('0x13a')](_0x5ad946,_0xb4d2ab);})[_0xa9e5('0x23')](function(){return new BPromise(function(_0x3f6e54,_0x5c45d4){zipdir(_0x24fef8,{'saveTo':_0xec6dbb},function(_0x115b23,_0x1454d3){if(_0x115b23)return _0x5c45d4(_0x115b23);return _0x3f6e54(_0x1454d3);});})['then'](function(){return new BPromise(function(_0x303e1c,_0x344cd4){rimraf(_0x24fef8,function(_0x1d21fb){if(_0x1d21fb)_0x344cd4(_0x1d21fb);return _0x303e1c();});});})[_0xa9e5('0x23')](function(){return _0x5e49cd[_0xa9e5('0xee')](_0xec6dbb,_0x2054c7,function(_0xf95535){if(_0xf95535){console[_0xa9e5('0x13b')](_0xa9e5('0x13c'),_0xf95535);}else{fs['unlinkSync'](_0xec6dbb);}});});});}else{return _0x5e49cd[_0xa9e5('0x39')](0xc8);}})[_0xa9e5('0x2e')](handleError(_0x5e49cd,null));};
\ No newline at end of file
+var _0xb2b9=['contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','toString','count','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','groupBy','ChatInteractionId','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','abandon','Interaction\x20already\x20assigned','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','mailTranscript','root','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','secret','includeAgent','spread','Tag','emit','chatInteractionTags:save','removeTags','server','files','attachments','CmContact','firstName','lastName','get','Chat','Account','Owner','closedAt','osName','referer','N.A.','tail','existsSync','createReadStream','pipe','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','jayson/promise','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','limit','undefined','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','render','merge','body','agent','interaction','map','fullname','TagIds','split','forEach','Tags','push','catch','answered','unmanaged','abandoned','total','UserId','waiting','closed','talking','disposition','index','ChatInteraction','rawAttributes','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','search','parseSearch','length','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','isEmpty','ChatWebsiteId','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)'];(function(_0x1bf855,_0xed7250){var _0x1fd120=function(_0x4aefb1){while(--_0x4aefb1){_0x1bf855['push'](_0x1bf855['shift']());}};_0x1fd120(++_0xed7250);}(_0xb2b9,0x1c4));var _0x9b2b=function(_0x1e5dd5,_0x18c0e9){_0x1e5dd5=_0x1e5dd5-0x0;var _0x2af63e=_0xb2b9[_0x1e5dd5];return _0x2af63e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9b2b('0x0'));var jsonpatch=require(_0x9b2b('0x1'));var rp=require(_0x9b2b('0x2'));var moment=require(_0x9b2b('0x3'));var BPromise=require(_0x9b2b('0x4'));var Mustache=require(_0x9b2b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9b2b('0x6'));var csv=require(_0x9b2b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b2b('0x8'));var _=require(_0x9b2b('0x9'));var squel=require(_0x9b2b('0xa'));var crypto=require(_0x9b2b('0xb'));var jsforce=require(_0x9b2b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b2b('0x7'));var querystring=require(_0x9b2b('0xd'));var Papa=require(_0x9b2b('0xe'));var Redis=require('ioredis');var authService=require(_0x9b2b('0xf'));var qs=require(_0x9b2b('0x10'));var as=require(_0x9b2b('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x9b2b('0x12'));var logger=require(_0x9b2b('0x13'))(_0x9b2b('0x14'));var utils=require(_0x9b2b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9b2b('0x16'));var db=require(_0x9b2b('0x17'))['db'];config[_0x9b2b('0x18')]=_[_0x9b2b('0x19')](config[_0x9b2b('0x18')],{'host':_0x9b2b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9b2b('0x18')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x9b2b('0x1b'));var client=jayson['client'][_0x9b2b('0x1c')]({'port':0x232b});var client9004=jayson[_0x9b2b('0x1d')][_0x9b2b('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0xef058a,_0x1a9189,_0x52412b,_0x2ae114){return new BPromise(function(_0x4dfeb9,_0x46960d){var _0x50b194=_0x2ae114||client;return _0x50b194[_0x9b2b('0x1e')](_0xef058a,_0x52412b)[_0x9b2b('0x1f')](function(_0x147630){logger[_0x9b2b('0x20')](_0x9b2b('0x21'),_0x1a9189,_0x9b2b('0x22'));logger[_0x9b2b('0x23')](_0x9b2b('0x24'),_0x1a9189,_0x9b2b('0x22'),JSON[_0x9b2b('0x25')](_0x147630));if(_0x147630[_0x9b2b('0x26')]){if(_0x147630[_0x9b2b('0x26')]['code']===0x1f4){logger[_0x9b2b('0x26')]('ChatInteraction,\x20%s,\x20%s',_0x1a9189,_0x147630[_0x9b2b('0x26')]['message']);return _0x46960d(_0x147630[_0x9b2b('0x26')]['message']);}logger['error'](_0x9b2b('0x21'),_0x1a9189,_0x147630[_0x9b2b('0x26')][_0x9b2b('0x27')]);return _0x4dfeb9(_0x147630[_0x9b2b('0x26')][_0x9b2b('0x27')]);}else{logger['info'](_0x9b2b('0x21'),_0x1a9189,_0x9b2b('0x22'));_0x4dfeb9(_0x147630[_0x9b2b('0x28')]['message']);}})['catch'](function(_0x35a6e0){logger['error'](_0x9b2b('0x21'),_0x1a9189,_0x35a6e0);_0x46960d(_0x35a6e0);});});}function respondWithStatusCode(_0x554b5a,_0x4bc330){_0x4bc330=_0x4bc330||0xcc;return function(_0x1044b9){if(_0x1044b9){return _0x554b5a[_0x9b2b('0x29')](_0x4bc330);}return _0x554b5a[_0x9b2b('0x2a')](_0x4bc330)[_0x9b2b('0x2b')]();};}function respondWithResult(_0x271253,_0x2dde22){_0x2dde22=_0x2dde22||0xc8;return function(_0x2be708){if(_0x2be708){return _0x271253[_0x9b2b('0x2a')](_0x2dde22)[_0x9b2b('0x2c')](_0x2be708);}};}function respondWithFilteredResult(_0x3e0d4b,_0x3cbd1e){return function(_0x2bbe17){if(_0x2bbe17){var _0x35a0fe=typeof _0x3cbd1e['offset']==='undefined'&&typeof _0x3cbd1e[_0x9b2b('0x2d')]===_0x9b2b('0x2e');var _0x1dbb0c=_0x2bbe17['count'];var _0x54c4ee=_0x35a0fe?0x0:_0x3cbd1e[_0x9b2b('0x2f')];var _0x56a8f0=_0x35a0fe?_0x2bbe17['count']:_0x3cbd1e['offset']+_0x3cbd1e[_0x9b2b('0x2d')];var _0xe8ed01;if(_0x56a8f0>=_0x1dbb0c){_0x56a8f0=_0x1dbb0c;_0xe8ed01=0xc8;}else{_0xe8ed01=0xce;}_0x3e0d4b['status'](_0xe8ed01);return _0x3e0d4b[_0x9b2b('0x30')](_0x9b2b('0x31'),_0x54c4ee+'-'+_0x56a8f0+'/'+_0x1dbb0c)['json'](_0x2bbe17);}return null;};}function patchUpdates(_0x3db298){return function(_0x131dcb){try{jsonpatch[_0x9b2b('0x32')](_0x131dcb,_0x3db298,!![]);}catch(_0x13de9a){return BPromise['reject'](_0x13de9a);}return _0x131dcb[_0x9b2b('0x33')]();};}function saveUpdates(_0x20384b,_0x5bbf5d){return function(_0x1d3408){if(_0x1d3408){return _0x1d3408[_0x9b2b('0x34')](_0x20384b)['then'](function(_0xdcf378){return _0xdcf378;});}return null;};}function removeEntity(_0x3432a2,_0x261c8b){return function(_0x3c21e0){if(_0x3c21e0){return _0x3c21e0[_0x9b2b('0x35')]()[_0x9b2b('0x1f')](function(){_0x3432a2[_0x9b2b('0x2a')](0xcc)[_0x9b2b('0x2b')]();});}};}function handleEntityNotFound(_0x2dba3b,_0x272d12){return function(_0x1b9e64){if(!_0x1b9e64){_0x2dba3b[_0x9b2b('0x29')](0x194);}return _0x1b9e64;};}function handleError(_0x51f683,_0x2a57dc){_0x2a57dc=_0x2a57dc||0x1f4;return function(_0x50cac5){logger[_0x9b2b('0x26')](_0x50cac5[_0x9b2b('0x36')]);if(_0x50cac5[_0x9b2b('0x37')]){delete _0x50cac5[_0x9b2b('0x37')];}_0x51f683[_0x9b2b('0x2a')](_0x2a57dc)[_0x9b2b('0x38')](_0x50cac5);};}function getMustacheRender(_0x418e02,_0xb8fa2d){return Mustache[_0x9b2b('0x39')](_0x418e02,_[_0x9b2b('0x3a')](_0xb8fa2d[_0x9b2b('0x3b')],{'contact':_0xb8fa2d['contact'],'message':_0xb8fa2d['message'],'agent':_0xb8fa2d[_0x9b2b('0x3c')],'interaction':_0xb8fa2d[_0x9b2b('0x3d')],'account':_0xb8fa2d['account']}))||'';}function getInteractionUsers(_0x32f6d9,_0x4067c1){return new BPromise(function(_0x4d4740,_0x509462){try{if(_0x4067c1[_0x32f6d9['id']]){_0x32f6d9['Users']=_[_0x9b2b('0x3e')](_0x4067c1[_0x32f6d9['id']],function(_0x4e3733){return{'id':_0x4e3733['id'],'fullname':_0x4e3733[_0x9b2b('0x3f')]};});}}catch(_0x277dbc){_0x509462(_0x277dbc);}_0x4d4740(_0x32f6d9);});}function getInteractionTags(_0x404f42,_0x148170){return new BPromise(function(_0x369b1b,_0x42168f){try{if(_0x404f42[_0x9b2b('0x40')]){_0x404f42['Tags']=[];_0x404f42[_0x9b2b('0x40')][_0x9b2b('0x41')](',')[_0x9b2b('0x42')](function(_0x3f315c){_0x404f42[_0x9b2b('0x43')][_0x9b2b('0x44')](_0x148170[_0x3f315c]);});}delete _0x404f42['TagIds'];}catch(_0x2003b0){_0x42168f(_0x2003b0);}_0x369b1b(_0x404f42);});}function updateChatInteraction(_0xbce19c,_0x29e75b,_0x46576b){return new BPromise(function(_0x1167a9,_0xe459f5){return getInteractionUsers(_0xbce19c,_0x46576b)[_0x9b2b('0x1f')](function(_0x2e6f82){return getInteractionTags(_0x2e6f82,_0x29e75b);})[_0x9b2b('0x1f')](function(_0x2dec08){return getStateInteraction(_0x2dec08);})['then'](function(_0x5d7447){_0x1167a9(_0x5d7447);})[_0x9b2b('0x45')](function(_0x7747dd){_0xe459f5(_0x7747dd);});});}function getStateInteraction(_0x539eb7){return new BPromise(function(_0x599e51){_0x539eb7['waiting']=0x0;_0x539eb7['talking']=0x0;_0x539eb7[_0x9b2b('0x46')]=0x0;_0x539eb7[_0x9b2b('0x47')]=0x0;_0x539eb7[_0x9b2b('0x48')]=0x0;_0x539eb7[_0x9b2b('0x49')]=0x0;if(!_0x539eb7['closed']&&!_0x539eb7[_0x9b2b('0x4a')]){_0x539eb7[_0x9b2b('0x4b')]+=0x1;}if(!_0x539eb7[_0x9b2b('0x4c')]&&_0x539eb7[_0x9b2b('0x4a')]){_0x539eb7[_0x9b2b('0x4d')]+=0x1;if(_0x539eb7[_0x9b2b('0x4b')]){_0x539eb7[_0x9b2b('0x4b')]-=0x1;}}if(_0x539eb7[_0x9b2b('0x4c')]&&_0x539eb7[_0x9b2b('0x4e')]===_0x9b2b('0x48')){_0x539eb7[_0x9b2b('0x48')]+=0x1;if(_0x539eb7[_0x9b2b('0x4b')]){_0x539eb7[_0x9b2b('0x4b')]-=0x1;}}else if(_0x539eb7[_0x9b2b('0x4c')]&&!_0x539eb7[_0x9b2b('0x4a')]&&_0x539eb7[_0x9b2b('0x4e')]){_0x539eb7[_0x9b2b('0x47')]+=0x1;if(_0x539eb7['waiting']){_0x539eb7['waiting']-=0x1;}}else if(_0x539eb7[_0x9b2b('0x4c')]&&_0x539eb7[_0x9b2b('0x4a')]){_0x539eb7[_0x9b2b('0x46')]+=0x1;if(_0x539eb7['talking']){_0x539eb7[_0x9b2b('0x4d')]-=0x1;}}_0x539eb7[_0x9b2b('0x49')]+=0x1;_0x599e51(_0x539eb7);});}exports[_0x9b2b('0x4f')]=function(_0x2b7784,_0x2a3702){var _0x757ab2={},_0x7674e={},_0x49ac39={'count':0x0,'rows':[]};var _0x216156=_[_0x9b2b('0x3e')](db[_0x9b2b('0x50')][_0x9b2b('0x51')],function(_0x59a83e){return{'name':_0x59a83e['fieldName'],'type':_0x59a83e[_0x9b2b('0x52')]['key']};});_0x7674e['model']=_[_0x9b2b('0x3e')](_0x216156,_0x9b2b('0x37'));_0x7674e[_0x9b2b('0x53')]=_[_0x9b2b('0x54')](_0x2b7784[_0x9b2b('0x53')]);_0x7674e[_0x9b2b('0x55')]=_['intersection'](_0x7674e[_0x9b2b('0x56')],_0x7674e['query']);_0x757ab2['attributes']=_[_0x9b2b('0x57')](_0x7674e[_0x9b2b('0x56')],qs[_0x9b2b('0x58')](_0x2b7784[_0x9b2b('0x53')]['fields']));_0x757ab2['attributes']=_0x757ab2[_0x9b2b('0x59')]['length']?_0x757ab2[_0x9b2b('0x59')]:_0x7674e['model'];if(!_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x5a')]('nolimit')){_0x757ab2[_0x9b2b('0x2d')]=qs[_0x9b2b('0x2d')](_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x2d')]);_0x757ab2['offset']=qs[_0x9b2b('0x2f')](_0x2b7784['query'][_0x9b2b('0x2f')]);}_0x757ab2[_0x9b2b('0x5b')]=qs[_0x9b2b('0x5c')](_0x2b7784['query'][_0x9b2b('0x5c')]);_0x757ab2[_0x9b2b('0x5d')]=qs['filters'](_[_0x9b2b('0x5e')](_0x2b7784[_0x9b2b('0x53')],_0x7674e[_0x9b2b('0x55')]),_0x216156);var _0x6917cb=[];var _0x1070ab=squel[_0x9b2b('0x5f')]()[_0x9b2b('0x60')]('id')[_0x9b2b('0x60')]('name')[_0x9b2b('0x60')](_0x9b2b('0x61'))[_0x9b2b('0x62')]('tools_tags');var _0x348ab2=squel['select']()[_0x9b2b('0x60')](_0x9b2b('0x63'))[_0x9b2b('0x60')](_0x9b2b('0x64'))[_0x9b2b('0x60')](_0x9b2b('0x65'))['from']('user_has_chat_interactions','ui')[_0x9b2b('0x66')](_0x9b2b('0x67'),'u',_0x9b2b('0x68'));var _0x56aa09=squel['select']()[_0x9b2b('0x62')](_0x9b2b('0x69'),'i')['left_join'](_0x9b2b('0x6a'),'c',_0x9b2b('0x6b'))[_0x9b2b('0x66')](_0x9b2b('0x67'),'o','o.id\x20=\x20i.UserId')[_0x9b2b('0x66')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0x9b2b('0x66')]('chat_messages','me',_0x9b2b('0x6c'))[_0x9b2b('0x66')]('chat_interaction_has_tags','it',_0x9b2b('0x6d'))[_0x9b2b('0x66')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5d2f65=squel[_0x9b2b('0x6e')]();var _0x3c72f5=[];var _0x58855f=squel['expr']();var _0x43e42b;if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x6f')]){_0x43e42b=as[_0x9b2b('0x70')](_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x6f')]);var _0x23b5d7=_0x43e42b['sqlOperator'];for(var _0x2b2b48=0x0;_0x2b2b48<_0x43e42b['conditions'][_0x9b2b('0x71')];_0x2b2b48++){var _0xafd71=_0x43e42b[_0x9b2b('0x72')][_0x2b2b48];var _0x26ea67='i';var _0x4f9ac3=_[_0x9b2b('0x73')](_0x216156,['name',_0xafd71['field']]);if(!_0x4f9ac3){switch(_0xafd71['field']){case _0x9b2b('0x74'):if(_0xafd71[_0x9b2b('0x75')]==0x1){_0x56aa09['having']('`'+_0xafd71[_0x9b2b('0x60')]+_0x9b2b('0x76'));}else{_0x56aa09[_0x9b2b('0x77')]('`'+_0xafd71[_0x9b2b('0x60')]+_0x9b2b('0x78'));}break;case _0x9b2b('0x79'):if(_0xafd71[_0x9b2b('0x7a')]===_0x9b2b('0x7b')){if(_0xafd71['value'][_0x9b2b('0x41')]('\x20')[_0x9b2b('0x71')]>0x1){_0x5d2f65[_0x23b5d7](_0x9b2b('0x7c'),qs[_0x9b2b('0x7d')](_0xafd71[_0x9b2b('0x75')]),null);}else{var _0x38da68='%'+_0xafd71[_0x9b2b('0x75')]+'%';_0x5d2f65[_0x23b5d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x38da68,_0x38da68,_0x38da68);}}else{_0x4f9ac3=_[_0x9b2b('0x73')](_0x216156,[_0x9b2b('0x37'),_0x9b2b('0x7e')]);_0xafd71[_0x9b2b('0x60')]=_0x9b2b('0x7e');_0x44205e=as[_0x9b2b('0x7f')](_0x26ea67,_0x4f9ac3[_0x9b2b('0x52')],_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e[_0x9b2b('0x75')][_0x9b2b('0x81')],_0x44205e[_0x9b2b('0x75')][_0x9b2b('0x2b')]);}break;case'Tag':var _0x373d90=_0xafd71[_0x9b2b('0x75')][_0x9b2b('0x41')](',')['map'](function(_0x12087d){return Number(_0x12087d);});_0x373d90[_0x9b2b('0x42')](function(_0x5ed7d0){_0x58855f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ed7d0+',%');});_0x3c72f5=_[_0x9b2b('0x82')](_0x3c72f5,_0x373d90);break;case _0x9b2b('0x83'):if(_0xafd71[_0x9b2b('0x7a')]===_0x9b2b('0x7b')){_0x5d2f65[_0x23b5d7](_0x9b2b('0x84'),'%'+_0xafd71[_0x9b2b('0x75')]+'%',null);}else{_0x4f9ac3=_[_0x9b2b('0x73')](_0x216156,['name',_0x9b2b('0x4a')]);_0xafd71[_0x9b2b('0x60')]=_0x9b2b('0x4a');_0x44205e=as[_0x9b2b('0x7f')](_0x26ea67,_0x4f9ac3['type'],_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e[_0x9b2b('0x75')]['start'],_0x44205e['value']['end']);}break;case _0x9b2b('0x3b'):_0x44205e=as[_0x9b2b('0x7f')]('me',null,_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e['value'][_0x9b2b('0x81')],_0x44205e['value'][_0x9b2b('0x2b')]);break;}}else{var _0x44205e=as[_0x9b2b('0x7f')](_0x26ea67,_0x4f9ac3[_0x9b2b('0x52')],_0xafd71);_0x5d2f65[_0x23b5d7](_0x44205e[_0x9b2b('0x80')],_0x44205e[_0x9b2b('0x75')][_0x9b2b('0x81')],_0x44205e['value']['end']);}}}else{var _0xf6b0be=_(_0x2b7784[_0x9b2b('0x53')])['keys']()[_0x9b2b('0x3e')](function(_0x2d696c){return _[_0x9b2b('0x85')](_0x216156,[_0x9b2b('0x37'),_0x2d696c])?_0x2d696c:undefined;})[_0x9b2b('0x86')]()[_0x9b2b('0x75')]();if(!_[_0x9b2b('0x87')](_0xf6b0be)){_0xf6b0be[_0x9b2b('0x42')](function(_0x2842e4){if(_0x2842e4===_0x9b2b('0x88')){_0x56aa09[_0x9b2b('0x5d')]('i.ChatWebsiteId\x20IN\x20?',[]['concat'](_0x2b7784[_0x9b2b('0x53')][_0x2842e4]));}else if(_0x2842e4===_0x9b2b('0x89')){var _0x3d9c09=JSON[_0x9b2b('0x8a')](_0x2b7784[_0x9b2b('0x53')][_0x2842e4])[_0x9b2b('0x8b')];var _0x17efba=JSON[_0x9b2b('0x8a')](_0x2b7784[_0x9b2b('0x53')][_0x2842e4])['$lte'];_0x56aa09[_0x9b2b('0x5d')](_0x9b2b('0x8c'),_0x3d9c09,_0x17efba);}else{if(_0x2b7784[_0x9b2b('0x53')][_0x2842e4]==='null'){_0x56aa09[_0x9b2b('0x5d')]('i.'+_0x2842e4+'\x20IS\x20NULL');}else{_0x56aa09[_0x9b2b('0x5d')]('i.'+_0x2842e4+_0x9b2b('0x8d'),_0x2b7784['query'][_0x2842e4]);}}});}if(_0x2b7784['query'][_0x9b2b('0x8e')]){if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x8e')]==0x1){_0x56aa09[_0x9b2b('0x77')](_0x9b2b('0x8f'));}else{_0x56aa09[_0x9b2b('0x77')]('`unreadMessages`\x20>\x200');}}if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x90')]){_0x3c72f5=_[_0x9b2b('0x91')](_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x90')])?_0x2b7784['query'][_0x9b2b('0x90')]:new Array(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x90')]);_0x3c72f5[_0x9b2b('0x42')](function(_0xb2037f){_0x58855f['or'](_0x9b2b('0x92'),'%,'+_0xb2037f+',%');});}if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x93')]){var _0x3e325=_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x93')][_0x9b2b('0x94')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x9b2b('0x95')](_0x3e325)){_0x5d2f65['or'](_0x9b2b('0x96'),_0x3e325+'%');}else{_0x5d2f65['or'](_0x9b2b('0x97'),qs[_0x9b2b('0x7d')](_0x3e325))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3e325+'%');}}}_0x56aa09[_0x9b2b('0x5d')](_0x5d2f65);_0x56aa09[_0x9b2b('0x98')](_0x9b2b('0x99'));var _0x38d4ba={'type':db[_0x9b2b('0x9a')][_0x9b2b('0x9b')][_0x9b2b('0x9c')],'raw':!![]};var _0x22e32c=_0x56aa09['clone']();_0x22e32c[_0x9b2b('0x60')](_0x9b2b('0x99'));_0x22e32c['field'](_0x9b2b('0x9d'),_0x9b2b('0x74'));if(_0x757ab2[_0x9b2b('0x5b')]){_0x757ab2[_0x9b2b('0x5b')]['forEach'](function(_0x15a3fb){var _0x2b94f2=_0x15a3fb[0x0]===_0x9b2b('0x9e')?_0x15a3fb[0x0]:'i.'+_0x15a3fb[0x0];_0x56aa09[_0x9b2b('0x5b')](_0x2b94f2,_0x15a3fb[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x3c72f5)){_0x56aa09[_0x9b2b('0x77')](_0x58855f);_0x22e32c['where'](_0x9b2b('0x9f'),_0x3c72f5);}BPromise['resolve']()[_0x9b2b('0x1f')](function(){if(!_0x43e42b){if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x88')])return;_0x22e32c[_0x9b2b('0x5d')](_0x9b2b('0xa0'));_0x56aa09[_0x9b2b('0x5d')](_0x9b2b('0xa0'));return;}if(_0x2b7784['user'][_0x9b2b('0xa1')]!==_0x9b2b('0x3c'))return;return _0x2b7784[_0x9b2b('0xa2')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x9b2b('0x1f')](function(_0x4c79d1){if(_[_0x9b2b('0x87')](_0x4c79d1)){_0x22e32c[_0x9b2b('0x5d')]('i.ChatWebsiteId\x20IS\x20NULL');_0x56aa09[_0x9b2b('0x5d')](_0x9b2b('0xa3'));}else{_0x22e32c[_0x9b2b('0x5d')](_0x9b2b('0xa4'),_[_0x9b2b('0x3e')](_0x4c79d1,'id'));_0x56aa09['where'](_0x9b2b('0xa4'),_[_0x9b2b('0x3e')](_0x4c79d1,'id'));}});})[_0x9b2b('0x1f')](function(){if(_0x2b7784[_0x9b2b('0xa2')][_0x9b2b('0xa1')]===_0x9b2b('0x3c')&&!_0x43e42b&&!_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x88')])return[];return db['sequelize'][_0x9b2b('0x53')](_0x22e32c[_0x9b2b('0xa5')](),_0x38d4ba);})['then'](function(_0x403eb7){_0x49ac39[_0x9b2b('0xa6')]=_0x403eb7[_0x9b2b('0x71')];if(_0x49ac39[_0x9b2b('0xa6')]===0x0)return[];return db[_0x9b2b('0xa7')][_0x9b2b('0x53')](_0x1070ab[_0x9b2b('0xa5')](),_0x38d4ba)[_0x9b2b('0x1f')](function(_0x265987){_0x6917cb=_[_0x9b2b('0xa8')](_0x265987,'id');_0x38d4ba=_[_0x9b2b('0x3a')](_0x38d4ba,{'model':db[_0x9b2b('0x50')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b7784[_0x9b2b('0x53')][_0x9b2b('0x58')]){_0x757ab2[_0x9b2b('0x59')][_0x9b2b('0x42')](function(_0x1725cf){_0x56aa09['field']('i.'+_0x1725cf);});}else{_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0x9d'),'unreadMessages');_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xa9'),'Account.key');_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xaa'),_0x9b2b('0xab'));_0x56aa09[_0x9b2b('0x60')]('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',_0x9b2b('0x9e'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xac'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xad'),_0x9b2b('0xae'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xaf'),_0x9b2b('0xb0'));_0x56aa09[_0x9b2b('0x60')]('c.email',_0x9b2b('0xb1'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xb2'),_0x9b2b('0xb3'));_0x56aa09[_0x9b2b('0x60')](_0x9b2b('0xb4'),_0x9b2b('0xb5'));_0x56aa09['field'](_0x9b2b('0xb6'),_0x9b2b('0xb7'));_0x56aa09['field']('o.fullname',_0x9b2b('0xb8'));_0x56aa09[_0x9b2b('0x60')]('o.internal',_0x9b2b('0xb9'));_0x56aa09[_0x9b2b('0x60')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x9b2b('0x40'));}if(_0x757ab2[_0x9b2b('0x2d')])_0x56aa09[_0x9b2b('0x2d')](_0x757ab2[_0x9b2b('0x2d')]);if(_0x757ab2[_0x9b2b('0x2f')])_0x56aa09[_0x9b2b('0x2f')](_0x757ab2['offset']);return db[_0x9b2b('0xa7')]['query'](_0x56aa09[_0x9b2b('0xa5')](),_0x38d4ba);})[_0x9b2b('0x1f')](function(_0x4a0a0f){if(_0x4a0a0f[_0x9b2b('0x71')]>0x0)_0x348ab2['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x9b2b('0x3e')](_0x4a0a0f,'id'));return db[_0x9b2b('0xa7')][_0x9b2b('0x53')](_0x348ab2[_0x9b2b('0xa5')](),_0x38d4ba)[_0x9b2b('0x1f')](function(_0x20b53b){var _0x57b442=_[_0x9b2b('0xba')](_0x20b53b,_0x9b2b('0xbb'));var _0x16e221=[];_0x4a0a0f[_0x9b2b('0x42')](function(_0x1e966b){_0x16e221[_0x9b2b('0x44')](updateChatInteraction(_0x1e966b,_0x6917cb,_0x57b442));});return BPromise['all'](_0x16e221);});});})[_0x9b2b('0x1f')](function(_0x2a43ca){_0x49ac39['rows']=_0x2a43ca;return _0x49ac39;})[_0x9b2b('0x1f')](respondWithFilteredResult(_0x2a3702,_0x757ab2))['catch'](handleError(_0x2a3702,null));};exports[_0x9b2b('0xbc')]=function(_0xb2ca56,_0x4c43e8){var _0x84b41c={'raw':![],'where':{'id':_0xb2ca56[_0x9b2b('0xbd')]['id']}},_0xca7059={};_0xca7059[_0x9b2b('0x56')]=_[_0x9b2b('0x54')](db[_0x9b2b('0x50')][_0x9b2b('0x51')]);_0xca7059['query']=_[_0x9b2b('0x54')](_0xb2ca56[_0x9b2b('0x53')]);_0xca7059['filters']=_[_0x9b2b('0x57')](_0xca7059[_0x9b2b('0x56')],_0xca7059[_0x9b2b('0x53')]);_0x84b41c['attributes']=_['intersection'](_0xca7059[_0x9b2b('0x56')],qs['fields'](_0xb2ca56['query']['fields']));_0x84b41c[_0x9b2b('0x59')]=_0x84b41c[_0x9b2b('0x59')][_0x9b2b('0x71')]?_0x84b41c[_0x9b2b('0x59')]:_0xca7059[_0x9b2b('0x56')];if(_0xb2ca56[_0x9b2b('0x53')][_0x9b2b('0xbe')]){_0x84b41c[_0x9b2b('0xbf')]=[{'all':!![]}];}_0x84b41c=_[_0x9b2b('0x3a')]({},_0x84b41c,_0xb2ca56[_0x9b2b('0xc0')]);return db[_0x9b2b('0x50')][_0x9b2b('0x73')](_0x84b41c)[_0x9b2b('0x1f')](handleEntityNotFound(_0x4c43e8,null))['then'](respondWithResult(_0x4c43e8,null))[_0x9b2b('0x45')](handleError(_0x4c43e8,null));};exports[_0x9b2b('0xc1')]=function(_0x41944a,_0x1147c3){return db[_0x9b2b('0x50')][_0x9b2b('0xc1')](_0x41944a[_0x9b2b('0x3b')],{})['then'](respondWithResult(_0x1147c3,0xc9))[_0x9b2b('0x45')](handleError(_0x1147c3,null));};exports[_0x9b2b('0x34')]=function(_0xdecf20,_0x4d0b68){if(_0xdecf20[_0x9b2b('0x3b')]['id']){delete _0xdecf20['body']['id'];}return db['ChatInteraction'][_0x9b2b('0x73')]({'where':{'id':_0xdecf20['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x4d0b68,null))[_0x9b2b('0x1f')](saveUpdates(_0xdecf20[_0x9b2b('0x3b')],null))[_0x9b2b('0x1f')](respondWithResult(_0x4d0b68,null))[_0x9b2b('0x45')](handleError(_0x4d0b68,null));};exports[_0x9b2b('0x35')]=function(_0x1cb102,_0x46e6e4){return db[_0x9b2b('0x50')]['find']({'where':{'id':_0x1cb102['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x46e6e4,null))[_0x9b2b('0x1f')](removeEntity(_0x46e6e4,null))[_0x9b2b('0x45')](handleError(_0x46e6e4,null));};exports['describe']=function(_0x1e57b2,_0x41b074){return db[_0x9b2b('0x50')][_0x9b2b('0xc2')]()[_0x9b2b('0x1f')](respondWithResult(_0x41b074,null))['catch'](handleError(_0x41b074,null));};exports[_0x9b2b('0xc3')]=function(_0x35746b,_0x3604ed){var _0x40d978=_0x35746b[_0x9b2b('0xbd')]['id'];var _0x4f8423;var _0x398cc6;var _0x4b8221;return db[_0x9b2b('0x50')][_0x9b2b('0xc4')]({'where':{'id':_0x40d978}})[_0x9b2b('0x1f')](function(_0x15436c){_0x4f8423=_0x15436c;return db[_0x9b2b('0xc5')]['findOne']({'where':{'id':_0x15436c[_0x9b2b('0x88')]},'attributes':['id',_0x9b2b('0xc6'),_0x9b2b('0xc7'),_0x9b2b('0xc8'),_0x9b2b('0xc9'),'vidaooMetadata'],'raw':!![]});})[_0x9b2b('0x1f')](function(_0x34c020){if(_0x34c020&&_0x34c020[_0x9b2b('0xc6')]&&_0x34c020[_0x9b2b('0xc7')]){_0x398cc6=_0x34c020;var _0x16bd6e={'interaction':{'id':_0x40d978},'agent':{'id':_0x35746b[_0x9b2b('0xa2')]['id'],'name':_0x35746b[_0x9b2b('0xa2')]['name'],'fullname':_0x35746b['user'][_0x9b2b('0x3f')],'email':_0x35746b[_0x9b2b('0xa2')][_0x9b2b('0xca')]},'contact':_0x35746b[_0x9b2b('0x3b')][_0x9b2b('0xcb')],'account':_0x35746b[_0x9b2b('0x3b')]['account']};var _0x296702={'rejectUnauthorized':![],'method':_0x9b2b('0xcc'),'url':_0x9b2b('0xcd'),'headers':{'X-APIKEY':_0x34c020['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x35746b['user']['email']],'buttons':null,'topic':_0x398cc6[_0x9b2b('0xc8')],'note':_[_0x9b2b('0xce')](_0x398cc6[_0x9b2b('0xc9')])?null:getMustacheRender(_0x398cc6[_0x9b2b('0xc9')],_0x16bd6e),'metadata':null},'redirect':_0x9b2b('0xcf'),'json':!![]};try{if(!_[_0x9b2b('0xce')](_0x398cc6['vidaooMetadata'])){var _0x403c37=getMustacheRender(_0x398cc6[_0x9b2b('0xd0')],_0x16bd6e);var _0x399ce2=JSON['parse'](_0x403c37);_0x296702[_0x9b2b('0x3b')][_0x9b2b('0xd1')]=_0x399ce2;}}catch(_0x2c2cfd){throw new db['Sequelize'][(_0x9b2b('0xd2'))](_0x9b2b('0xd3'));}return rp(_0x296702);}else{throw new db[(_0x9b2b('0x9a'))][(_0x9b2b('0xd2'))](_0x9b2b('0xd4'));}})[_0x9b2b('0x1f')](function(_0x3217e4){_0x4b8221=_0x3217e4;if(_0x4b8221['id']){var _0x18e9d5={'body':_0x4b8221[_0x9b2b('0xd5')],'ChatWebsiteId':_0x398cc6['id'],'ChatInteractionId':_0x4f8423['id'],'direction':_0x9b2b('0xd6'),'UserId':_0x35746b['user']['id']};return db[_0x9b2b('0xd7')][_0x9b2b('0xc1')](_0x18e9d5,{});}else{throw new db[(_0x9b2b('0x9a'))][(_0x9b2b('0xd2'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x9b2b('0x1f')](function(){return _0x4f8423[_0x9b2b('0xd8')]({'vidaooSessionId':_0x4b8221['id']});})[_0x9b2b('0x1f')](respondWithResult(_0x3604ed,null))[_0x9b2b('0x45')](handleError(_0x3604ed,null));};exports[_0x9b2b('0xd9')]=function(_0x2fed56,_0x4698f5){if(_0x2fed56[_0x9b2b('0x3b')]['id']){delete _0x2fed56['body']['id'];}return db[_0x9b2b('0x50')]['find']({'where':{'id':_0x2fed56[_0x9b2b('0xbd')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x9b2b('0x1f')](handleEntityNotFound(_0x4698f5,null))['then'](saveUpdates(_0x2fed56['body'],null))[_0x9b2b('0x1f')](respondWithResult(_0x4698f5,null))[_0x9b2b('0x45')](handleError(_0x4698f5,null));};exports[_0x9b2b('0xda')]=function(_0x29163f,_0x31e8e2,_0x33940b){if(_0x29163f[_0x9b2b('0x3b')]['id']){delete _0x29163f[_0x9b2b('0x3b')]['id'];}return db['ChatInteraction'][_0x9b2b('0x73')]({'where':{'id':_0x29163f[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](function(_0x1ac214){if(!_0x1ac214){logger[_0x9b2b('0x26')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x9b2b('0xda'),0x194,'entity\x20not\x20found');_0x31e8e2[_0x9b2b('0x29')](0x194);}else{if(_0x1ac214[_0x9b2b('0x4a')]){throw new db[(_0x9b2b('0x9a'))]['ValidationError'](_0x9b2b('0xdb'));}}return _0x1ac214;})[_0x9b2b('0x1f')](function(_0xaee2a6){if(_0xaee2a6){return _0xaee2a6[_0x9b2b('0x34')]({'closed':_0x29163f[_0x9b2b('0x3b')]['closed'],'disposition':_0x29163f['body']['disposition']})['then'](function(_0x5a2ec3){return _0x5a2ec3;});}})[_0x9b2b('0x1f')](function(_0x85fe90){return respondWithRpcPromise('AbandonInteraction',_0x9b2b('0xda'),_0x29163f['body'],client9004);})[_0x9b2b('0x1f')](respondWithResult(_0x31e8e2,null))['catch'](handleError(_0x31e8e2,null));};exports[_0x9b2b('0xdc')]=function(_0x1bfb91,_0x4bd0be,_0x16ff41){_0x1bfb91[_0x9b2b('0x3b')][_0x9b2b('0x37')]=_0x1bfb91[_0x9b2b('0xdd')][_0x9b2b('0xde')];_0x1bfb91[_0x9b2b('0x3b')][_0x9b2b('0xdf')]=_0x1bfb91[_0x9b2b('0xdd')][_0x9b2b('0xe0')];_0x1bfb91[_0x9b2b('0x3b')][_0x9b2b('0x52')]=_0x1bfb91[_0x9b2b('0xdd')][_0x9b2b('0xe1')];return db[_0x9b2b('0xe2')][_0x9b2b('0xc1')](_0x1bfb91[_0x9b2b('0x3b')])['then'](respondWithResult(_0x4bd0be,0xc9))[_0x9b2b('0x45')](handleError(_0x4bd0be,null));};exports['attachmentDownload']=function(_0x4317ce,_0x2025fb,_0x5c66d9){return db['ChatInteraction']['findOne']({'where':{'id':_0x4317ce[_0x9b2b('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2025fb,null))[_0x9b2b('0x1f')](function(_0x3f793a){if(_0x3f793a){if(_0x3f793a[_0x9b2b('0x4c')]){return _0x2025fb['status'](0x193)[_0x9b2b('0x2c')]({'status':0x193,'message':_0x9b2b('0xe3')});}return db['Attachment'][_0x9b2b('0xc4')]({'where':{'id':_0x4317ce[_0x9b2b('0x53')][_0x9b2b('0xe4')]},'raw':!![]})[_0x9b2b('0x1f')](handleEntityNotFound(_0x2025fb,null));}})[_0x9b2b('0x1f')](function(_0x4653f5){if(_0x4653f5){var _0x4a0a0a=_0x4653f5[_0x9b2b('0xe5')]!==null;var _0x246f80=path[_0x9b2b('0xe6')](config['root'],_0x9b2b('0xe7'));if(_0x4a0a0a){_0x246f80=path[_0x9b2b('0xe6')](_0x246f80,_0x9b2b('0xe8'));}var _0x323944=path['join'](_0x246f80,_0x4653f5['basename']);return _0x2025fb[_0x9b2b('0xe9')](_0x323944);}})[_0x9b2b('0x45')](handleError(_0x2025fb,null));};exports['close']=function(_0x4bd1b6,_0x301c8e){var _0x503573=null;var _0x1f8714=null;var _0x3072a8=null;var _0x3d9ad4=null;if(_0x4bd1b6[_0x9b2b('0x3b')]['id']){delete _0x4bd1b6['body']['id'];}if(_0x4bd1b6[_0x9b2b('0x3b')][_0x9b2b('0xea')]){_0x3d9ad4=path['join'](config[_0x9b2b('0xeb')],_0x9b2b('0xec'),util[_0x9b2b('0xed')]('transcript-%s.txt',Date[_0x9b2b('0xee')]()));_0x4bd1b6[_0x9b2b('0x3b')]['pathTranscript']=_0x3d9ad4;}return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x4bd1b6[_0x9b2b('0xbd')]['id']},'include':[{'model':db[_0x9b2b('0xd7')],'as':'Messages','include':[{'model':db[_0x9b2b('0x83')],'as':_0x9b2b('0x83')}]}]})[_0x9b2b('0x1f')](handleEntityNotFound(_0x301c8e,null))[_0x9b2b('0x1f')](saveUpdates(_0x4bd1b6[_0x9b2b('0x3b')],null))['then'](function(_0x1b1261){if(_0x1b1261){_0x503573=_0x1b1261;return db[_0x9b2b('0xc5')][_0x9b2b('0x73')]({'where':{'id':_0x503573['ChatWebsiteId']}});}})[_0x9b2b('0x1f')](function(_0x1bb199){if(_0x1bb199){_0x3072a8=_0x1bb199;return db['CmContact']['find']({'where':{'id':_0x503573[_0x9b2b('0x7e')]}});}})[_0x9b2b('0x1f')](function(_0x107b50){if(_0x107b50){_0x1f8714=_0x107b50;if(_0x3d9ad4){var _0x2d35bf=null;for(var _0x4a9949=0x1;_0x4a9949<_0x503573[_0x9b2b('0xef')][_0x9b2b('0x71')];++_0x4a9949){_0x2d35bf=_0x503573[_0x9b2b('0xef')][_0x4a9949];var _0x149183=_0x2d35bf['UserId']?util[_0x9b2b('0xed')](_0x9b2b('0xf0'),_0x3072a8[_0x9b2b('0xf1')],_0x2d35bf[_0x9b2b('0x4a')]):_0x9b2b('0xf2');var _0x3a8dcc=_0x4bd1b6[_0x9b2b('0x3b')][_0x9b2b('0xf3')]||util[_0x9b2b('0xed')](_0x9b2b('0xf0'),_0x9b2b('0xf4'),_0x2d35bf[_0x9b2b('0x7e')]);switch(_0x3072a8[_0x9b2b('0xf5')]){case _0x9b2b('0xf6'):_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?util['format'](_0x9b2b('0xf0'),_0x3072a8[_0x9b2b('0xf1')],_0x2d35bf[_0x9b2b('0x4a')]):'System';break;case _0x9b2b('0xf7'):_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?_0x2d35bf[_0x9b2b('0x83')][_0x9b2b('0xf8')]||_0x2d35bf[_0x9b2b('0x83')][_0x9b2b('0x3f')]:_0x9b2b('0xf2');break;case _0x9b2b('0xf9'):_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?_0x2d35bf[_0x9b2b('0x83')][_0x9b2b('0x3f')]:_0x9b2b('0xf2');break;default:_0x149183=_0x2d35bf[_0x9b2b('0x4a')]?util[_0x9b2b('0xed')]('%s%d',_0x3072a8['agentAlias'],_0x2d35bf[_0x9b2b('0x4a')]):_0x9b2b('0xf2');}var _0x12b9eb=util[_0x9b2b('0xed')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2d35bf[_0x9b2b('0x89')])['format'](_0x9b2b('0xfa')),_0x2d35bf[_0x9b2b('0xfb')]==='in'?_0x3a8dcc:_0x149183,_0x2d35bf[_0x9b2b('0x3b')]);if(!_0x2d35bf['secret']){fs[_0x9b2b('0xfc')](_0x3d9ad4,_0x12b9eb);}}return db[_0x9b2b('0xfd')][_0x9b2b('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x9b2b('0xfe'),'raw':!![]}]});}}})[_0x9b2b('0x1f')](function(_0x38eb91){if(_0x38eb91&&_0x38eb91['Smtp']&&_0x4bd1b6[_0x9b2b('0x3b')]){var _0xc21c6b={'tls':{'rejectUnauthorized':![]}};if(_0x38eb91[_0x9b2b('0xfe')]['service']){_0xc21c6b['service']=_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0xff')];}else{_0xc21c6b[_0x9b2b('0x100')]=_0x38eb91['Smtp']['host'];_0xc21c6b[_0x9b2b('0x101')]=_0x38eb91['Smtp'][_0x9b2b('0x101')];_0xc21c6b['secure']=_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0x102')];}if(_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0x103')]){_0xc21c6b['auth']={'user':_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0xa2')],'pass':_0x38eb91[_0x9b2b('0xfe')][_0x9b2b('0x104')]};}return respondWithRpcPromise(_0x9b2b('0x105'),_0x9b2b('0x106'),{'account':_0xc21c6b,'message':{'from':util[_0x9b2b('0xed')]('\x22%s\x22\x20<%s>',_0x38eb91[_0x9b2b('0x37')],_0x38eb91[_0x9b2b('0xca')]||_0x38eb91[_0x9b2b('0xfe')]['user']),'to':_0x4bd1b6['body'][_0x9b2b('0xea')],'subject':_0x9b2b('0x107'),'text':util[_0x9b2b('0xed')](_0x9b2b('0x108'),_0x4bd1b6['body'][_0x9b2b('0xea')]),'attachments':[{'path':_0x3d9ad4}]}})[_0x9b2b('0x1f')](function(){return _0x503573;})[_0x9b2b('0x45')](function(_0x36b0c8){console[_0x9b2b('0x26')](_0x36b0c8);});}else{return _0x503573;}})[_0x9b2b('0x1f')](respondWithStatusCode(_0x301c8e,0xc8))[_0x9b2b('0x45')](handleError(_0x301c8e,null));};exports[_0x9b2b('0x109')]=function(_0x20a0f8,_0x5ca7b9,_0xc99354){return db[_0x9b2b('0xd7')][_0x9b2b('0x73')]({'where':{'id':_0x20a0f8[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x5ca7b9,null))[_0x9b2b('0x1f')](function(_0x18a5f0){if(_0x18a5f0){return _0x18a5f0['addMessage'](_0x20a0f8[_0x9b2b('0x3b')][_0x9b2b('0x10a')],_[_0x9b2b('0x10b')](_0x20a0f8[_0x9b2b('0x3b')],[_0x9b2b('0x10a'),'id'])||{});}})['then'](respondWithResult(_0x5ca7b9,null))[_0x9b2b('0x45')](handleError(_0x5ca7b9,null));};exports['getMessages']=function(_0x2b8438,_0x625367,_0x4ac1fe){var _0xbf645={'raw':![],'where':{}};var _0x413bf2={};var _0x594652={'count':0x0,'rows':[]};return db[_0x9b2b('0x50')]['findOne']({'where':{'id':_0x2b8438['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x625367,null))['then'](function(_0x2839e1){if(_0x2839e1){_0x413bf2['model']=_[_0x9b2b('0x54')](db[_0x9b2b('0xd7')][_0x9b2b('0x51')]);_0x413bf2[_0x9b2b('0x53')]=_[_0x9b2b('0x54')](_0x2b8438[_0x9b2b('0x53')]);_0x413bf2['filters']=_['intersection'](_0x413bf2['model'],_0x413bf2['query']);_0xbf645[_0x9b2b('0x59')]=_[_0x9b2b('0x57')](_0x413bf2[_0x9b2b('0x56')],qs[_0x9b2b('0x58')](_0x2b8438[_0x9b2b('0x53')]['fields']));_0xbf645['attributes']=_0xbf645[_0x9b2b('0x59')][_0x9b2b('0x71')]?_0xbf645[_0x9b2b('0x59')]:_0x413bf2[_0x9b2b('0x56')];if(!_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x5a')](_0x9b2b('0x10c'))){_0xbf645[_0x9b2b('0x2d')]=qs[_0x9b2b('0x2d')](_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x2d')]);_0xbf645[_0x9b2b('0x2f')]=qs[_0x9b2b('0x2f')](_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x2f')]);}_0xbf645[_0x9b2b('0x5b')]=qs[_0x9b2b('0x5c')](_0x2b8438[_0x9b2b('0x53')]['sort']);_0xbf645[_0x9b2b('0x5d')]=qs[_0x9b2b('0x55')](_[_0x9b2b('0x5e')](_0x2b8438['query'],_0x413bf2[_0x9b2b('0x55')]));_0xbf645[_0x9b2b('0x5d')]['ChatInteractionId']=_0x2839e1['id'];if(_0x2b8438['query'][_0x9b2b('0x93')]){_0xbf645[_0x9b2b('0x5d')]=_[_0x9b2b('0x3a')](_0xbf645[_0x9b2b('0x5d')],{'$or':_['map'](_0xbf645[_0x9b2b('0x59')],function(_0x5d8a41){var _0x47266e={};_0x47266e[_0x5d8a41]={'$like':'%'+_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0x93')]+'%'};return _0x47266e;})});}if(_0x2b8438[_0x9b2b('0x53')]['$gte']){var _0x5a1b92=_0x2b8438['query'][_0x9b2b('0x8b')]['split'](',');var _0x5e46a9={};_0x5e46a9[_0x5a1b92[0x0]]={'$gte':moment(_0x5a1b92[0x1])[_0x9b2b('0xed')](_0x9b2b('0x10d'))};_0xbf645['where']=_[_0x9b2b('0x3a')](_0xbf645[_0x9b2b('0x5d')],_0x5e46a9);}_0xbf645=_[_0x9b2b('0x3a')]({},_0xbf645,_0x2b8438[_0x9b2b('0xc0')]);return db['ChatMessage'][_0x9b2b('0xa6')]({'where':_0xbf645['where']})[_0x9b2b('0x1f')](function(_0x8b8174){_0x594652[_0x9b2b('0xa6')]=_0x8b8174;if(_0x2b8438[_0x9b2b('0x53')][_0x9b2b('0xbe')]){_0xbf645['include']=[{'all':!![]}];}return db[_0x9b2b('0xd7')][_0x9b2b('0x10e')](_0xbf645);})[_0x9b2b('0x1f')](function(_0x3cb18f){_0x594652[_0x9b2b('0x10f')]=_0x3cb18f;return _0x594652;});}})['then'](respondWithFilteredResult(_0x625367,_0xbf645))[_0x9b2b('0x45')](handleError(_0x625367,null));};exports[_0x9b2b('0x110')]=function(_0x573aa6,_0x1ee949,_0x57ebff){var _0x4b703e={'where':{}},_0x46e3da={},_0x2155c7={'count':0x0,'rows':[]};return db[_0x9b2b('0x50')]['findOne']({'where':{'id':_0x573aa6[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x1ee949,null))[_0x9b2b('0x1f')](function(_0x428629){if(_0x428629){_0x46e3da[_0x9b2b('0x56')]=_[_0x9b2b('0x54')](db['ChatMessage'][_0x9b2b('0x51')]);_0x46e3da[_0x9b2b('0x53')]=_[_0x9b2b('0x54')](_0x573aa6['query']);_0x46e3da['filters']=_[_0x9b2b('0x57')](_0x46e3da[_0x9b2b('0x56')],_0x46e3da[_0x9b2b('0x53')]);_0x4b703e[_0x9b2b('0x59')]=_[_0x9b2b('0x57')](_0x46e3da['model'],qs['fields'](_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x58')]));_0x4b703e['attributes']=_0x4b703e['attributes']['length']?_0x4b703e['attributes']:_0x46e3da[_0x9b2b('0x56')];if(!_0x573aa6[_0x9b2b('0x53')]['hasOwnProperty'](_0x9b2b('0x10c'))){_0x4b703e[_0x9b2b('0x2d')]=qs[_0x9b2b('0x2d')](_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x2d')]);_0x4b703e['offset']=qs[_0x9b2b('0x2f')](_0x573aa6[_0x9b2b('0x53')]['offset']);}_0x4b703e['order']=qs[_0x9b2b('0x5c')](_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x5c')]);_0x4b703e['where']=qs[_0x9b2b('0x55')](_['pick'](_0x573aa6[_0x9b2b('0x53')],_0x46e3da[_0x9b2b('0x55')]));_0x4b703e[_0x9b2b('0x5d')][_0x9b2b('0xbb')]=_0x428629['id'];if(_0x573aa6[_0x9b2b('0x53')]['filter']){_0x4b703e[_0x9b2b('0x5d')]=_[_0x9b2b('0x3a')](_0x4b703e[_0x9b2b('0x5d')],{'$or':_['map'](_0x4b703e[_0x9b2b('0x59')],function(_0x555f5f){var _0x2ec2ec={};_0x2ec2ec[_0x555f5f]={'$like':'%'+_0x573aa6['query'][_0x9b2b('0x93')]+'%'};return _0x2ec2ec;})});}_0x4b703e[_0x9b2b('0x5d')][_0x9b2b('0x111')]=![];if(_0x573aa6[_0x9b2b('0x53')]['id']){_0x4b703e['where']['id']={'$gt':_0x573aa6[_0x9b2b('0x53')]['id']};}_0x4b703e=_[_0x9b2b('0x3a')]({},_0x4b703e,_0x573aa6[_0x9b2b('0xc0')]);return db[_0x9b2b('0xd7')]['count']({'where':_0x4b703e[_0x9b2b('0x5d')]})[_0x9b2b('0x1f')](function(_0x574a32){_0x2155c7[_0x9b2b('0xa6')]=_0x574a32;_0x4b703e['include']=[];if(_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0x112')]){_0x4b703e[_0x9b2b('0xbf')][_0x9b2b('0x44')]({'model':db[_0x9b2b('0x83')],'as':_0x9b2b('0x83'),'attributes':['id',_0x9b2b('0x3f'),_0x9b2b('0xf8')]});}if(_0x573aa6[_0x9b2b('0x53')][_0x9b2b('0xbe')]){_0x4b703e[_0x9b2b('0xbf')]=[{'all':!![]}];}return db[_0x9b2b('0xd7')]['findAll'](_0x4b703e);})[_0x9b2b('0x1f')](function(_0x223865){_0x2155c7['rows']=_0x223865;return _0x2155c7;});}})[_0x9b2b('0x1f')](respondWithFilteredResult(_0x1ee949,_0x4b703e))[_0x9b2b('0x45')](handleError(_0x1ee949,null));};exports['addTags']=function(_0x448574,_0x3a9cb8,_0x4cc1f6){return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x448574['params']['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x3a9cb8,null))[_0x9b2b('0x1f')](function(_0x105265){if(_0x105265){return _0x105265['setTags'](_0x448574[_0x9b2b('0x3b')][_0x9b2b('0x10a')],_['omit'](_0x448574[_0x9b2b('0x3b')],[_0x9b2b('0x10a'),'id'])||{})[_0x9b2b('0x113')](function(){return db[_0x9b2b('0x114')]['findAll']({'attributes':['id','name',_0x9b2b('0x61')],'where':{'id':_0x448574[_0x9b2b('0x3b')]['ids']}});})['then'](function(_0x4ee495){socket[_0x9b2b('0x115')](_0x9b2b('0x116'),{'id':Number(_0x448574[_0x9b2b('0xbd')]['id']),'tags':_0x4ee495||[]});return{'id':Number(_0x448574['params']['id']),'tags':_0x4ee495||[]};});}})[_0x9b2b('0x1f')](respondWithResult(_0x3a9cb8,null))['catch'](handleError(_0x3a9cb8,null));};exports['removeTags']=function(_0x34b3f9,_0x1ed58f,_0x631743){return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x34b3f9[_0x9b2b('0xbd')]['id']}})[_0x9b2b('0x1f')](handleEntityNotFound(_0x1ed58f,null))['then'](function(_0x439a5e){if(_0x439a5e){return _0x439a5e[_0x9b2b('0x117')](_0x34b3f9[_0x9b2b('0x53')]['ids']);}})[_0x9b2b('0x1f')](respondWithStatusCode(_0x1ed58f,null))[_0x9b2b('0x45')](handleError(_0x1ed58f,null));};exports[_0x9b2b('0xe9')]=function(_0x37321f,_0x42dc53){var _0x24a87a=moment()['unix']()[_0x9b2b('0xa5')]();var _0x72f048=path[_0x9b2b('0xe6')](config[_0x9b2b('0xeb')],_0x9b2b('0x118'),_0x9b2b('0x119'),'tmp');var _0xd8ab94=path['join'](config[_0x9b2b('0xeb')],_0x9b2b('0x118'),_0x9b2b('0x119'),_0x9b2b('0x11a'));var _0x193f15=path[_0x9b2b('0xe6')](_0x72f048,_0x24a87a);var _0x147dec=util[_0x9b2b('0xed')]('transcript-%d-%s.zip',_0x37321f[_0x9b2b('0xbd')]['id'],_0x24a87a);var _0x2c6f0c=path[_0x9b2b('0xe6')](_0x72f048,_0x147dec);var _0xf9b24b=[];_0xf9b24b[_0x9b2b('0x44')]({'model':db[_0x9b2b('0x83')],'as':_0x9b2b('0x83'),'attributes':['id',_0x9b2b('0x3f')],'raw':!![]});_0xf9b24b[_0x9b2b('0x44')]({'model':db[_0x9b2b('0x11b')],'as':_0x9b2b('0x79'),'attributes':['id',_0x9b2b('0x11c'),_0x9b2b('0x11d')],'raw':!![]});if(_0x37321f[_0x9b2b('0x53')][_0x9b2b('0x11a')]){_0xf9b24b[_0x9b2b('0x44')]({'model':db[_0x9b2b('0xe2')],'as':_0x9b2b('0xe2'),'raw':!![]});}var _0x20868c=[{'model':db[_0x9b2b('0xd7')],'as':'Messages','attributes':['id',_0x9b2b('0x3b'),'createdAt',_0x9b2b('0xfb'),'secret',_0x9b2b('0x8e')],'include':_0xf9b24b}];_0x20868c['push']({'model':db[_0x9b2b('0xc5')],'as':'Account','attributes':['id',_0x9b2b('0x37')]});_0x20868c[_0x9b2b('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0x9b2b('0x3f')]});return db[_0x9b2b('0x50')][_0x9b2b('0x73')]({'where':{'id':_0x37321f[_0x9b2b('0xbd')]['id']},'include':_0x20868c})['then'](handleEntityNotFound(_0x42dc53,null))[_0x9b2b('0x1f')](function(_0x11c2d6){if(_0x11c2d6){var _0xabb55=_0x11c2d6[_0x9b2b('0x11e')]({'plain':!![]});fs['mkdirSync'](_0x193f15);var _0x31ee52={'channel':_0x9b2b('0x11f'),'account':_0xabb55[_0x9b2b('0x120')][_0x9b2b('0x37')],'agent':_0xabb55[_0x9b2b('0x121')]?_0xabb55[_0x9b2b('0x121')][_0x9b2b('0x3f')]:'N.A.','createdAt':moment(_0xabb55[_0x9b2b('0x89')])[_0x9b2b('0xed')](_0x9b2b('0x10d'))['toString'](),'closedAt':_0xabb55['closed']?moment(_0xabb55[_0x9b2b('0x122')])[_0x9b2b('0xed')](_0x9b2b('0x10d'))['toString']():'','disposition':_0xabb55[_0x9b2b('0x4e')],'chatInfo':{'browser':_0xabb55['browserName'],'os':_0xabb55[_0x9b2b('0x123')],'referer':_0xabb55[_0x9b2b('0x124')],'customerIp':_0xabb55['customerIp'],'customerPort':_0xabb55['customerPort']?_0xabb55['customerPort']:_0x9b2b('0x125')},'messages':_(_0xabb55['Messages'])[_0x9b2b('0x126')]()[_0x9b2b('0x93')]({'secret':![]})['map'](function(_0x49e2aa){if(_0x49e2aa[_0x9b2b('0xe2')]){var _0x26b1af=path[_0x9b2b('0xe6')](_0xd8ab94,_0x49e2aa[_0x9b2b('0xe2')][_0x9b2b('0xdf')]);if(fs[_0x9b2b('0x127')](_0x26b1af)){fs[_0x9b2b('0x128')](_0x26b1af)[_0x9b2b('0x129')](fs['createWriteStream'](path['join'](_0x193f15,_0x49e2aa[_0x9b2b('0xe2')][_0x9b2b('0xdf')])));}}return{'date':moment(_0x49e2aa[_0x9b2b('0x89')])[_0x9b2b('0xed')](_0x9b2b('0x10d'))[_0x9b2b('0xa5')](),'sender':_0x49e2aa[_0x9b2b('0xfb')]==='out'?_0x49e2aa[_0x9b2b('0x83')]?_0x49e2aa['User']['fullname']:'System':_0x49e2aa['Contact']['firstName']+(_0x49e2aa[_0x9b2b('0x79')][_0x9b2b('0x11d')]?'\x20'+_0x49e2aa[_0x9b2b('0x79')]['lastName']:''),'body':_0x49e2aa[_0x9b2b('0xe2')]?_0x49e2aa[_0x9b2b('0xe2')]['basename']:_0x49e2aa[_0x9b2b('0x3b')],'direction':_0x49e2aa[_0x9b2b('0xfb')]==='out'?'A':'C','secret':_0x49e2aa[_0x9b2b('0x111')],'read':_0x49e2aa[_0x9b2b('0x8e')],'attachment':_0x49e2aa[_0x9b2b('0xe2')]};})[_0x9b2b('0x75')]()};return ejs[_0x9b2b('0x12a')](path[_0x9b2b('0xe6')](config['root'],'server',_0x9b2b('0x12b'),_0x9b2b('0x12c')),{'interaction':_0x31ee52})['then'](function(_0x395eb9){var _0x3fdac5=path[_0x9b2b('0xe6')](_0x193f15,_0x9b2b('0x12d')+_0xabb55['id']+'-'+_0x24a87a+_0x9b2b('0x12e'));var _0x54ccf4={'path':_0x3fdac5,'channel':_0x9b2b('0x11f'),'interactionId':_0xabb55['id']};return pdf['createPdfFromHTML'](_0x395eb9,_0x54ccf4);})[_0x9b2b('0x1f')](function(){return new BPromise(function(_0x2f3215,_0x5150f3){zipdir(_0x193f15,{'saveTo':_0x2c6f0c},function(_0x47c404,_0x244d8a){if(_0x47c404)return _0x5150f3(_0x47c404);return _0x2f3215(_0x244d8a);});})['then'](function(){return new BPromise(function(_0x1b0fea,_0x48c0c0){rimraf(_0x193f15,function(_0x164d14){if(_0x164d14)_0x48c0c0(_0x164d14);return _0x1b0fea();});});})['then'](function(){return _0x42dc53[_0x9b2b('0xe9')](_0x2c6f0c,_0x147dec,function(_0x535758){if(_0x535758){console[_0x9b2b('0x12f')]('err',_0x535758);}else{fs[_0x9b2b('0x130')](_0x2c6f0c);}});});});}else{return _0x42dc53[_0x9b2b('0x29')](0xc8);}})[_0x9b2b('0x45')](handleError(_0x42dc53,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 2bdb426..955011a 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 _0x2005=['emit','catch','hook','exports','ChatInteraction','../../mysqldb','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll','unreadMessages'];(function(_0x3be492,_0x239dbb){var _0x2c65c1=function(_0x283a46){while(--_0x283a46){_0x3be492['push'](_0x3be492['shift']());}};_0x2c65c1(++_0x239dbb);}(_0x2005,0x16c));var _0x5200=function(_0x493b70,_0x168e73){_0x493b70=_0x493b70-0x0;var _0x4c2355=_0x2005[_0x493b70];return _0x4c2355;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x5200('0x0')];var ChatMessage=require(_0x5200('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5200('0x2')](0x0);var events={'afterCreate':_0x5200('0x3'),'afterUpdate':_0x5200('0x4'),'afterDestroy':_0x5200('0x5')};function emitEvent(_0x14a243){return function(_0x193b20,_0x20ca28,_0x3ffbbc){_0x193b20['getUsers']({'attributes':['id'],'raw':!![]})[_0x5200('0x6')](function(_0x1a0739){_0x193b20[_0x5200('0x7')](_0x5200('0x8'),_0x1a0739['map'](function(_0x3f33d1){return{'id':_0x3f33d1['id']};}));return ChatMessage[_0x5200('0x9')]({'where':{'ChatInteractionId':_0x193b20['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5200('0x6')](function(_0x362977){_0x193b20[_0x5200('0x7')](_0x5200('0xa'),_0x362977['length']);ChatInteractionEvents[_0x5200('0xb')](_0x14a243+':'+_0x193b20['id'],_0x193b20);ChatInteractionEvents[_0x5200('0xb')](_0x14a243,_0x193b20);_0x3ffbbc(null);})[_0x5200('0xc')](_0x3ffbbc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5200('0xd')](e,emitEvent(event));}}module[_0x5200('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x9090=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x9090,0xa8));var _0x0909=function(_0x37deac,_0x5c291e){_0x37deac=_0x37deac-0x0;var _0x31fa76=_0x9090[_0x37deac];return _0x31fa76;};'use strict';var EventEmitter=require(_0x0909('0x0'));var ChatInteraction=require(_0x0909('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x0909('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x0909('0x2')](0x0);var events={'afterCreate':_0x0909('0x3'),'afterUpdate':_0x0909('0x4'),'afterDestroy':_0x0909('0x5')};function emitEvent(_0x39cae1){return function(_0xf83cb6,_0x48480a,_0x1f8157){_0xf83cb6['getUsers']({'attributes':['id'],'raw':!![]})[_0x0909('0x6')](function(_0x526f44){_0xf83cb6[_0x0909('0x7')](_0x0909('0x8'),_0x526f44[_0x0909('0x9')](function(_0x26b0ae){return{'id':_0x26b0ae['id']};}));return ChatMessage[_0x0909('0xa')]({'where':{'ChatInteractionId':_0xf83cb6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0909('0x6')](function(_0x9cfcad){_0xf83cb6['setDataValue'](_0x0909('0xb'),_0x9cfcad[_0x0909('0xc')]);ChatInteractionEvents[_0x0909('0xd')](_0x39cae1+':'+_0xf83cb6['id'],_0xf83cb6);ChatInteractionEvents[_0x0909('0xd')](_0x39cae1,_0xf83cb6);_0x1f8157(null);})[_0x0909('0xe')](_0x1f8157(null));};}for(var e in events){if(events[_0x0909('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x0909('0x10')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 36008f8..d02f27f 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 _0xed65=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x2f4f8f,_0x4394ce){var _0x2b01a1=function(_0x4ee5e6){while(--_0x4ee5e6){_0x2f4f8f['push'](_0x2f4f8f['shift']());}};_0x2b01a1(++_0x4394ce);}(_0xed65,0x8a));var _0x5ed6=function(_0x24b852,_0x2bad67){_0x24b852=_0x24b852-0x0;var _0x180ad2=_0xed65[_0x24b852];return _0x180ad2;};'use strict';var _=require(_0x5ed6('0x0'));var util=require(_0x5ed6('0x1'));var logger=require(_0x5ed6('0x2'))('api');var moment=require(_0x5ed6('0x3'));var BPromise=require(_0x5ed6('0x4'));var rp=require(_0x5ed6('0x5'));var fs=require('fs');var path=require(_0x5ed6('0x6'));var rimraf=require(_0x5ed6('0x7'));var config=require(_0x5ed6('0x8'));var attributes=require(_0x5ed6('0x9'));module[_0x5ed6('0xa')]=function(_0x4bd85a,_0x1fa8c8){return _0x4bd85a[_0x5ed6('0xb')]('ChatInteraction',attributes,{'tableName':_0x5ed6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4b4a02,_0x1e6d6f,_0x2c85c2){if(_0x4b4a02[_0x5ed6('0xd')](_0x5ed6('0xe'))){_0x4b4a02[_0x5ed6('0xf')]=moment()[_0x5ed6('0x10')](_0x5ed6('0x11'));}_0x2c85c2(null,_0x4b4a02);}},'charset':_0x5ed6('0x12'),'collate':_0x5ed6('0x13')});};
\ No newline at end of file
+var _0xad80=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed'];(function(_0x1c1259,_0x2db8ee){var _0x1dab5c=function(_0x5d2670){while(--_0x5d2670){_0x1c1259['push'](_0x1c1259['shift']());}};_0x1dab5c(++_0x2db8ee);}(_0xad80,0x1c5));var _0x0ad8=function(_0x4c04ba,_0xa9637c){_0x4c04ba=_0x4c04ba-0x0;var _0x2b835e=_0xad80[_0x4c04ba];return _0x2b835e;};'use strict';var _=require(_0x0ad8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0ad8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ad8('0x2'));var fs=require('fs');var path=require(_0x0ad8('0x3'));var rimraf=require('rimraf');var config=require(_0x0ad8('0x4'));var attributes=require(_0x0ad8('0x5'));module[_0x0ad8('0x6')]=function(_0x3c1c10,_0x27d7c5){return _0x3c1c10[_0x0ad8('0x7')]('ChatInteraction',attributes,{'tableName':_0x0ad8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x266339,_0x2dcf12,_0x21aff1){if(_0x266339[_0x0ad8('0x9')](_0x0ad8('0xa'))){_0x266339[_0x0ad8('0xb')]=moment()[_0x0ad8('0xc')](_0x0ad8('0xd'));}_0x21aff1(null,_0x266339);}},'charset':_0x0ad8('0xe'),'collate':_0x0ad8('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 0234922..37e5bb7 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 _0xddde=['moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0xddde,0x16f));var _0xeddd=function(_0x42653f,_0x531aed){_0x42653f=_0x42653f-0x0;var _0x55185f=_0xddde[_0x42653f];return _0x55185f;};'use strict';var _=require(_0xeddd('0x0'));var util=require(_0xeddd('0x1'));var moment=require(_0xeddd('0x2'));var BPromise=require('bluebird');var rs=require(_0xeddd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeddd('0x4'));var logger=require(_0xeddd('0x5'))(_0xeddd('0x6'));var config=require(_0xeddd('0x7'));var jayson=require(_0xeddd('0x8'));var client=jayson[_0xeddd('0x9')]['http']({'port':0x232a});config[_0xeddd('0xa')]=_[_0xeddd('0xb')](config[_0xeddd('0xa')],{'host':_0xeddd('0xc'),'port':0x18eb});var socket=require(_0xeddd('0xd'))(new Redis(config[_0xeddd('0xa')]));require(_0xeddd('0xe'))['register'](socket);function respondWithRpcPromise(_0x5b5c76,_0x4d0e77,_0x7a7011){return new BPromise(function(_0x4d925e,_0x43ce8f){return client[_0xeddd('0xf')](_0x5b5c76,_0x7a7011)[_0xeddd('0x10')](function(_0x409adb){logger[_0xeddd('0x11')](_0xeddd('0x12'),_0x4d0e77,_0xeddd('0x13'));logger['debug'](_0xeddd('0x14'),_0x4d0e77,_0xeddd('0x13'),JSON[_0xeddd('0x15')](_0x409adb));if(_0x409adb[_0xeddd('0x16')]){if(_0x409adb[_0xeddd('0x16')]['code']===0x1f4){logger[_0xeddd('0x16')](_0xeddd('0x12'),_0x4d0e77,_0x409adb[_0xeddd('0x16')][_0xeddd('0x17')]);return _0x43ce8f(_0x409adb[_0xeddd('0x16')][_0xeddd('0x17')]);}logger['error'](_0xeddd('0x12'),_0x4d0e77,_0x409adb[_0xeddd('0x16')][_0xeddd('0x17')]);return _0x4d925e(_0x409adb['error'][_0xeddd('0x17')]);}else{logger[_0xeddd('0x11')](_0xeddd('0x12'),_0x4d0e77,_0xeddd('0x13'));_0x4d925e(_0x409adb[_0xeddd('0x18')][_0xeddd('0x17')]);}})[_0xeddd('0x19')](function(_0x3245d5){logger['error'](_0xeddd('0x12'),_0x4d0e77,_0x3245d5);_0x43ce8f(_0x3245d5);});});}exports[_0xeddd('0x1a')]=function(_0x4ce473){var _0x4108e2=this;return new Promise(function(_0x33de03,_0x3784dd){return db[_0xeddd('0x1b')][_0xeddd('0x1c')](_0x4ce473[_0xeddd('0x1d')],{'raw':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473[_0xeddd('0x1e')][_0xeddd('0x1f')]||null:null,'attributes':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473['options'][_0xeddd('0x20')]||null:null,'limit':_0x4ce473[_0xeddd('0x1e')]?_0x4ce473[_0xeddd('0x1e')]['limit']||null:null})[_0xeddd('0x10')](function(_0x1ad2e8){logger[_0xeddd('0x11')]('UpdateChatInteraction',_0x4ce473);logger[_0xeddd('0x21')](_0xeddd('0x1a'),_0x4ce473,JSON[_0xeddd('0x15')](_0x1ad2e8));_0x33de03(_0x1ad2e8);})[_0xeddd('0x19')](function(_0x396b8e){logger[_0xeddd('0x16')](_0xeddd('0x1a'),_0x396b8e[_0xeddd('0x17')],_0x4ce473);_0x3784dd(_0x4108e2[_0xeddd('0x16')](0x1f4,_0x396b8e['message']));});});};exports[_0xeddd('0x22')]=function(_0x468ef5){return new Promise(function(_0xaef21a,_0x5f3213){return db[_0xeddd('0x1b')][_0xeddd('0x23')]({'where':_0x468ef5['options']?_0x468ef5['options']['where']||null:null})['then'](function(_0x9f3320){if(_0x9f3320){return _0x9f3320[_0xeddd('0x24')](_0x468ef5[_0xeddd('0x1d')][_0xeddd('0x25')],_[_0xeddd('0x26')](_0x468ef5[_0xeddd('0x1d')],[_0xeddd('0x25'),'id'])||{});}})[_0xeddd('0x27')](function(_0x18e963){logger[_0xeddd('0x11')](_0xeddd('0x28'),_0x468ef5);logger['debug'](_0xeddd('0x28'),_0x468ef5,JSON[_0xeddd('0x15')](_0x18e963));_0xaef21a(_0x18e963);})[_0xeddd('0x19')](function(_0x32a078){logger[_0xeddd('0x16')](_0xeddd('0x28'),_0x32a078[_0xeddd('0x17')],_0x468ef5);_0x5f3213(_this[_0xeddd('0x16')](0x1f4,_0x32a078[_0xeddd('0x17')]));});});};
\ No newline at end of file
+var _0x0003=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ChatInteraction','body','raw','options','where','attributes','limit','then','UpdateChatInteraction','debug','AddTagsToChatInteraction','ids','AddTags','lodash','util','moment','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x0003,0x164));var _0x3000=function(_0x2be7b2,_0x21c75a){_0x2be7b2=_0x2be7b2-0x0;var _0x31b0a1=_0x0003[_0x2be7b2];return _0x31b0a1;};'use strict';var _=require(_0x3000('0x0'));var util=require(_0x3000('0x1'));var moment=require(_0x3000('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3000('0x3'));var db=require(_0x3000('0x4'))['db'];var utils=require(_0x3000('0x5'));var logger=require(_0x3000('0x6'))(_0x3000('0x7'));var config=require(_0x3000('0x8'));var jayson=require(_0x3000('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x3000('0xa')]=_['defaults'](config['redis'],{'host':_0x3000('0xb'),'port':0x18eb});var socket=require(_0x3000('0xc'))(new Redis(config['redis']));require(_0x3000('0xd'))['register'](socket);function respondWithRpcPromise(_0xac17db,_0x54658d,_0x245273){return new BPromise(function(_0x17421b,_0x56cdfb){return client['request'](_0xac17db,_0x245273)['then'](function(_0x44496f){logger[_0x3000('0xe')](_0x3000('0xf'),_0x54658d,_0x3000('0x10'));logger['debug'](_0x3000('0x11'),_0x54658d,'request\x20sent',JSON[_0x3000('0x12')](_0x44496f));if(_0x44496f[_0x3000('0x13')]){if(_0x44496f[_0x3000('0x13')]['code']===0x1f4){logger[_0x3000('0x13')](_0x3000('0xf'),_0x54658d,_0x44496f['error']['message']);return _0x56cdfb(_0x44496f[_0x3000('0x13')][_0x3000('0x14')]);}logger[_0x3000('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x54658d,_0x44496f['error'][_0x3000('0x14')]);return _0x17421b(_0x44496f[_0x3000('0x13')]['message']);}else{logger['info'](_0x3000('0xf'),_0x54658d,_0x3000('0x10'));_0x17421b(_0x44496f[_0x3000('0x15')][_0x3000('0x14')]);}})[_0x3000('0x16')](function(_0x39bbbf){logger[_0x3000('0x13')](_0x3000('0xf'),_0x54658d,_0x39bbbf);_0x56cdfb(_0x39bbbf);});});}exports['UpdateChatInteraction']=function(_0x57de92){var _0x2452e8=this;return new Promise(function(_0x42d08b,_0x5904cb){return db[_0x3000('0x17')]['update'](_0x57de92[_0x3000('0x18')],{'raw':_0x57de92['options']?_0x57de92['options'][_0x3000('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57de92[_0x3000('0x1a')]?_0x57de92[_0x3000('0x1a')][_0x3000('0x1b')]||null:null,'attributes':_0x57de92[_0x3000('0x1a')]?_0x57de92[_0x3000('0x1a')][_0x3000('0x1c')]||null:null,'limit':_0x57de92[_0x3000('0x1a')]?_0x57de92[_0x3000('0x1a')][_0x3000('0x1d')]||null:null})[_0x3000('0x1e')](function(_0x274e5a){logger[_0x3000('0xe')](_0x3000('0x1f'),_0x57de92);logger[_0x3000('0x20')](_0x3000('0x1f'),_0x57de92,JSON[_0x3000('0x12')](_0x274e5a));_0x42d08b(_0x274e5a);})[_0x3000('0x16')](function(_0x4d03a9){logger[_0x3000('0x13')](_0x3000('0x1f'),_0x4d03a9[_0x3000('0x14')],_0x57de92);_0x5904cb(_0x2452e8[_0x3000('0x13')](0x1f4,_0x4d03a9['message']));});});};exports[_0x3000('0x21')]=function(_0x42547a){return new Promise(function(_0x403500,_0x41d153){return db[_0x3000('0x17')]['find']({'where':_0x42547a[_0x3000('0x1a')]?_0x42547a[_0x3000('0x1a')]['where']||null:null})['then'](function(_0x564dfc){if(_0x564dfc){return _0x564dfc['addTags'](_0x42547a[_0x3000('0x18')][_0x3000('0x22')],_['omit'](_0x42547a[_0x3000('0x18')],['ids','id'])||{});}})['spread'](function(_0x5bf7d3){logger[_0x3000('0xe')]('AddTags',_0x42547a);logger[_0x3000('0x20')]('AddTags',_0x42547a,JSON['stringify'](_0x5bf7d3));_0x403500(_0x5bf7d3);})['catch'](function(_0xc6217a){logger[_0x3000('0x13')](_0x3000('0x23'),_0xc6217a['message'],_0x42547a);_0x41d153(_this[_0x3000('0x13')](0x1f4,_0xc6217a[_0x3000('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 119bd9b..46e3bcb 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 _0x18dd=['./chatInteraction.events','remove','emit','removeListener','length','chatInteraction:'];(function(_0x1fdd66,_0x40d3e5){var _0x3f5d8f=function(_0x54333e){while(--_0x54333e){_0x1fdd66['push'](_0x1fdd66['shift']());}};_0x3f5d8f(++_0x40d3e5);}(_0x18dd,0x6c));var _0xd18d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x18dd[_0x8c43de];return _0xa6591b;};'use strict';var ChatInteractionEvents=require(_0xd18d('0x0'));var events=['save',_0xd18d('0x1'),'update'];function createListener(_0x314dd9,_0x2670de){return function(_0x47e03f){_0x2670de[_0xd18d('0x2')](_0x314dd9,_0x47e03f);};}function removeListener(_0x80b0c6,_0xdc3221){return function(){ChatInteractionEvents[_0xd18d('0x3')](_0x80b0c6,_0xdc3221);};}exports['register']=function(_0x3cea88){for(var _0xc8a428=0x0,_0x4de3da=events[_0xd18d('0x4')];_0xc8a428<_0x4de3da;_0xc8a428++){var _0xb1b216=events[_0xc8a428];var _0x1f65f3=createListener(_0xd18d('0x5')+_0xb1b216,_0x3cea88);ChatInteractionEvents['on'](_0xb1b216,_0x1f65f3);}};
\ No newline at end of file
+var _0x6608=['length','chatInteraction:','./chatInteraction.events','save','remove','update','emit','register'];(function(_0x45bf0f,_0x16c557){var _0x4c57e6=function(_0x1220c2){while(--_0x1220c2){_0x45bf0f['push'](_0x45bf0f['shift']());}};_0x4c57e6(++_0x16c557);}(_0x6608,0x1ca));var _0x8660=function(_0x163259,_0x4bd808){_0x163259=_0x163259-0x0;var _0x311a21=_0x6608[_0x163259];return _0x311a21;};'use strict';var ChatInteractionEvents=require(_0x8660('0x0'));var events=[_0x8660('0x1'),_0x8660('0x2'),_0x8660('0x3')];function createListener(_0x24e461,_0x4486ba){return function(_0xcb931a){_0x4486ba[_0x8660('0x4')](_0x24e461,_0xcb931a);};}function removeListener(_0xd97956,_0x513d40){return function(){ChatInteractionEvents['removeListener'](_0xd97956,_0x513d40);};}exports[_0x8660('0x5')]=function(_0x3ccc5d){for(var _0x26e0cf=0x0,_0x357d52=events[_0x8660('0x6')];_0x26e0cf<_0x357d52;_0x26e0cf++){var _0x45b83a=events[_0x26e0cf];var _0x382ba6=createListener(_0x8660('0x7')+_0x45b83a,_0x3ccc5d);ChatInteractionEvents['on'](_0x45b83a,_0x382ba6);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index d15fb69..7034f97 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 _0xeded=['abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate'];(function(_0x43f5b4,_0x4bb4f0){var _0x3bd82d=function(_0x2f21b4){while(--_0x2f21b4){_0x43f5b4['push'](_0x43f5b4['shift']());}};_0x3bd82d(++_0x4bb4f0);}(_0xeded,0x6e));var _0xdede=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xeded[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var path=require('path');var timeout=require(_0xdede('0x2'));var express=require(_0xdede('0x3'));var router=express[_0xdede('0x4')]();var fs_extra=require(_0xdede('0x5'));var auth=require(_0xdede('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdede('0x7'));var controller=require(_0xdede('0x8'));router[_0xdede('0x9')]('/',auth[_0xdede('0xa')](),controller[_0xdede('0xb')]);router[_0xdede('0x9')]('/describe',auth[_0xdede('0xa')](),controller[_0xdede('0xc')]);router[_0xdede('0x9')]('/:id',auth[_0xdede('0xd')](),controller['show']);router[_0xdede('0x9')]('/:id/attachment_download',auth[_0xdede('0xd')](),controller[_0xdede('0xe')]);router[_0xdede('0x9')](_0xdede('0xf'),auth[_0xdede('0xa')](),controller['getMessages']);router[_0xdede('0x9')](_0xdede('0x10'),auth[_0xdede('0xd')](),controller['getMyMessages']);router[_0xdede('0x9')](_0xdede('0x11'),auth[_0xdede('0xa')](),controller[_0xdede('0x12')]);router[_0xdede('0x13')]('/',auth['isAuthenticated'](),controller[_0xdede('0x14')]);router[_0xdede('0x13')]('/:id/vidaoo',auth[_0xdede('0xa')](),controller[_0xdede('0x15')]);var upload=multer({'storage':multer[_0xdede('0x16')]({'destination':function(_0x3d602c,_0x34a66f,_0x1b95a3){_0x1b95a3(null,path[_0xdede('0x17')](config[_0xdede('0x18')],_0xdede('0x19')));},'filename':function(_0x183e83,_0x2b5008,_0x5d894c){_0x5d894c(null,util[_0xdede('0x1a')](_0xdede('0x1b'),Date['now'](),_0x2b5008[_0xdede('0x1c')][_0xdede('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xdede('0x1e'),upload[_0xdede('0x1f')](_0xdede('0x20')),controller['attachmentUpload']);router[_0xdede('0x13')](_0xdede('0xf'),auth[_0xdede('0xd')](),controller['addMessage']);router[_0xdede('0x13')]('/:id/tags',auth[_0xdede('0xa')](),interaction[_0xdede('0x21')](_0xdede('0x22'),_0xdede('0x23')),controller[_0xdede('0x24')]);router[_0xdede('0x25')](_0xdede('0x26'),auth['isAuthenticated'](),interaction[_0xdede('0x21')]('chat',_0xdede('0x27')),controller[_0xdede('0x28')]);router[_0xdede('0x25')](_0xdede('0x29'),controller[_0xdede('0x2a')]);router[_0xdede('0x25')]('/:id/abandon',auth[_0xdede('0xd')](),controller[_0xdede('0x2b')]);router[_0xdede('0x25')](_0xdede('0x2c'),controller['close']);router[_0xdede('0x2d')](_0xdede('0x26'),auth[_0xdede('0xa')](),interaction[_0xdede('0x21')](_0xdede('0x22'),_0xdede('0x2e')),controller[_0xdede('0x2f')]);router['delete'](_0xdede('0x30'),auth[_0xdede('0xa')](),controller[_0xdede('0x31')]);module[_0xdede('0x32')]=router;
\ No newline at end of file
+var _0x1240=['%s-%s','now','replace','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format'];(function(_0x9ad6fc,_0x164f6c){var _0x2a0830=function(_0x348b88){while(--_0x348b88){_0x9ad6fc['push'](_0x9ad6fc['shift']());}};_0x2a0830(++_0x164f6c);}(_0x1240,0xb8));var _0x0124=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1240[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x0124('0x0'));var util=require(_0x0124('0x1'));var path=require(_0x0124('0x2'));var timeout=require(_0x0124('0x3'));var express=require('express');var router=express[_0x0124('0x4')]();var fs_extra=require(_0x0124('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0124('0x6'));var config=require(_0x0124('0x7'));var controller=require('./chatInteraction.controller');router[_0x0124('0x8')]('/',auth[_0x0124('0x9')](),controller['index']);router['get'](_0x0124('0xa'),auth['isAuthenticated'](),controller[_0x0124('0xb')]);router['get'](_0x0124('0xc'),auth[_0x0124('0xd')](),controller['show']);router[_0x0124('0x8')](_0x0124('0xe'),auth[_0x0124('0xd')](),controller[_0x0124('0xf')]);router[_0x0124('0x8')]('/:id/messages',auth[_0x0124('0x9')](),controller[_0x0124('0x10')]);router[_0x0124('0x8')](_0x0124('0x11'),auth[_0x0124('0xd')](),controller[_0x0124('0x12')]);router[_0x0124('0x8')](_0x0124('0x13'),auth[_0x0124('0x9')](),controller['download']);router[_0x0124('0x14')]('/',auth[_0x0124('0x9')](),controller[_0x0124('0x15')]);router[_0x0124('0x14')](_0x0124('0x16'),auth[_0x0124('0x9')](),controller[_0x0124('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ba093,_0x554eec,_0xabb7b9){_0xabb7b9(null,path[_0x0124('0x18')](config[_0x0124('0x19')],_0x0124('0x1a')));},'filename':function(_0x58d02e,_0xff8a87,_0x56f02b){_0x56f02b(null,util[_0x0124('0x1b')](_0x0124('0x1c'),Date[_0x0124('0x1d')](),_0xff8a87['originalname'][_0x0124('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x0124('0x1f')](_0x0124('0x20')),controller[_0x0124('0x21')]);router[_0x0124('0x14')](_0x0124('0x22'),auth[_0x0124('0xd')](),controller[_0x0124('0x23')]);router[_0x0124('0x14')](_0x0124('0x24'),auth[_0x0124('0x9')](),interaction['tracked']('chat',_0x0124('0x25')),controller[_0x0124('0x26')]);router[_0x0124('0x27')](_0x0124('0xc'),auth[_0x0124('0x9')](),interaction[_0x0124('0x28')](_0x0124('0x29'),_0x0124('0x2a')),controller[_0x0124('0x2b')]);router[_0x0124('0x27')](_0x0124('0x2c'),controller[_0x0124('0x2d')]);router[_0x0124('0x27')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x0124('0x2e')]);router[_0x0124('0x27')](_0x0124('0x2f'),controller[_0x0124('0x30')]);router[_0x0124('0x31')](_0x0124('0xc'),auth[_0x0124('0x9')](),interaction[_0x0124('0x28')]('chat',_0x0124('0x32')),controller['destroy']);router[_0x0124('0x31')]('/:id/tags',auth['isAuthenticated'](),controller[_0x0124('0x33')]);module[_0x0124('0x34')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 7f34aa7..32443b1 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 _0xb6d7=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0xb6d7,0x150));var _0x7b6d=function(_0x43a2e4,_0x5bd47b){_0x43a2e4=_0x43a2e4-0x0;var _0x55f73d=_0xb6d7[_0x43a2e4];return _0x55f73d;};'use strict';var Sequelize=require(_0x7b6d('0x0'));module[_0x7b6d('0x1')]={'body':{'type':Sequelize[_0x7b6d('0x2')](_0x7b6d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7b6d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7b6d('0x5')]}};
\ No newline at end of file
+var _0x7227=['exports','TEXT','medium','INTEGER'];(function(_0x148271,_0x1ba6b0){var _0x1b4dbf=function(_0x2db098){while(--_0x2db098){_0x148271['push'](_0x148271['shift']());}};_0x1b4dbf(++_0x1ba6b0);}(_0x7227,0xa0));var _0x7722=function(_0x42235f,_0x5dabfd){_0x42235f=_0x42235f-0x0;var _0x3f5fab=_0x7227[_0x42235f];return _0x3f5fab;};'use strict';var Sequelize=require('sequelize');module[_0x7722('0x0')]={'body':{'type':Sequelize[_0x7722('0x1')](_0x7722('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7722('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index ca3d342..c09528d 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 _0x34e6=['moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','include','findAll','catch','show','find','create','body','params','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','role','userpic','internal','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','UserProfileResource','resourceId','push','agent','FromId','read','all','eml-format','rimraf','zip-dir','request-promise'];(function(_0x2df002,_0x48b5e0){var _0x3ab9dd=function(_0x5035b1){while(--_0x5035b1){_0x2df002['push'](_0x2df002['shift']());}};_0x3ab9dd(++_0x48b5e0);}(_0x34e6,0x1a4));var _0x634e=function(_0x532656,_0x5c6fb1){_0x532656=_0x532656-0x0;var _0x112890=_0x34e6[_0x532656];return _0x112890;};'use strict';var emlformat=require(_0x634e('0x0'));var rimraf=require(_0x634e('0x1'));var zipdir=require(_0x634e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x634e('0x3'));var moment=require(_0x634e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x634e('0x5'));var util=require(_0x634e('0x6'));var path=require(_0x634e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x634e('0x8'));var fs=require('fs');var fs_extra=require(_0x634e('0x9'));var _=require(_0x634e('0xa'));var squel=require(_0x634e('0xb'));var crypto=require(_0x634e('0xc'));var jsforce=require(_0x634e('0xd'));var deskjs=require(_0x634e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x634e('0xf'));var Papa=require(_0x634e('0x10'));var Redis=require(_0x634e('0x11'));var authService=require(_0x634e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x634e('0x13'));var hardwareService=require(_0x634e('0x14'));var logger=require('../../config/logger')(_0x634e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x634e('0x16'));var db=require(_0x634e('0x17'))['db'];config[_0x634e('0x18')]=_[_0x634e('0x19')](config[_0x634e('0x18')],{'host':_0x634e('0x1a'),'port':0x18eb});var socket=require(_0x634e('0x1b'))(new Redis(config[_0x634e('0x18')]));require(_0x634e('0x1c'))[_0x634e('0x1d')](socket);function respondWithStatusCode(_0x3ff9d5,_0x1c6b36){_0x1c6b36=_0x1c6b36||0xcc;return function(_0x2c7dd2){if(_0x2c7dd2){return _0x3ff9d5[_0x634e('0x1e')](_0x1c6b36);}return _0x3ff9d5[_0x634e('0x1f')](_0x1c6b36)[_0x634e('0x20')]();};}function respondWithResult(_0x22dd62,_0x301538){_0x301538=_0x301538||0xc8;return function(_0x5c7414){if(_0x5c7414){return _0x22dd62[_0x634e('0x1f')](_0x301538)[_0x634e('0x21')](_0x5c7414);}};}function respondWithFilteredResult(_0x227fbe,_0x344f7a){return function(_0x5d465b){if(_0x5d465b){var _0x1c1dcd=typeof _0x344f7a[_0x634e('0x22')]===_0x634e('0x23')&&typeof _0x344f7a[_0x634e('0x24')]==='undefined';var _0x5e3c1b=_0x5d465b[_0x634e('0x25')];var _0x18c8a9=_0x1c1dcd?0x0:_0x344f7a['offset'];var _0x403dda=_0x1c1dcd?_0x5d465b[_0x634e('0x25')]:_0x344f7a['offset']+_0x344f7a[_0x634e('0x24')];var _0xa20803;if(_0x403dda>=_0x5e3c1b){_0x403dda=_0x5e3c1b;_0xa20803=0xc8;}else{_0xa20803=0xce;}_0x227fbe[_0x634e('0x1f')](_0xa20803);return _0x227fbe[_0x634e('0x26')](_0x634e('0x27'),_0x18c8a9+'-'+_0x403dda+'/'+_0x5e3c1b)[_0x634e('0x21')](_0x5d465b);}return null;};}function patchUpdates(_0x52a09c){return function(_0x54a70f){try{jsonpatch[_0x634e('0x28')](_0x54a70f,_0x52a09c,!![]);}catch(_0x42ed3f){return BPromise[_0x634e('0x29')](_0x42ed3f);}return _0x54a70f[_0x634e('0x2a')]();};}function saveUpdates(_0x5d7847,_0x168638){return function(_0x1e274d){if(_0x1e274d){return _0x1e274d[_0x634e('0x2b')](_0x5d7847)[_0x634e('0x2c')](function(_0x595921){return _0x595921;});}return null;};}function removeEntity(_0x1e9d8f,_0x5efe4b){return function(_0x56540e){if(_0x56540e){return _0x56540e['destroy']()[_0x634e('0x2c')](function(){_0x1e9d8f['status'](0xcc)[_0x634e('0x20')]();});}};}function handleEntityNotFound(_0x4873c7,_0x91ebba){return function(_0x678ba3){if(!_0x678ba3){_0x4873c7[_0x634e('0x1e')](0x194);}return _0x678ba3;};}function handleError(_0x26452d,_0x33a1e2){_0x33a1e2=_0x33a1e2||0x1f4;return function(_0x197be2){logger['error'](_0x197be2[_0x634e('0x2d')]);if(_0x197be2[_0x634e('0x2e')]){delete _0x197be2[_0x634e('0x2e')];}_0x26452d[_0x634e('0x1f')](_0x33a1e2)[_0x634e('0x2f')](_0x197be2);};}exports['index']=function(_0x5e23a,_0x5a1d46){var _0x126fed={},_0x3dff4e={},_0x502fb8={'count':0x0,'rows':[]};var _0x1012ab=_['map'](db[_0x634e('0x30')][_0x634e('0x31')],function(_0x58f8b0){return{'name':_0x58f8b0[_0x634e('0x32')],'type':_0x58f8b0[_0x634e('0x33')][_0x634e('0x34')]};});_0x3dff4e[_0x634e('0x35')]=_[_0x634e('0x36')](_0x1012ab,_0x634e('0x2e'));_0x3dff4e[_0x634e('0x37')]=_[_0x634e('0x38')](_0x5e23a[_0x634e('0x37')]);_0x3dff4e[_0x634e('0x39')]=_[_0x634e('0x3a')](_0x3dff4e[_0x634e('0x35')],_0x3dff4e[_0x634e('0x37')]);_0x126fed[_0x634e('0x3b')]=_[_0x634e('0x3a')](_0x3dff4e['model'],qs[_0x634e('0x3c')](_0x5e23a['query'][_0x634e('0x3c')]));_0x126fed[_0x634e('0x3b')]=_0x126fed[_0x634e('0x3b')][_0x634e('0x3d')]?_0x126fed[_0x634e('0x3b')]:_0x3dff4e[_0x634e('0x35')];if(!_0x5e23a[_0x634e('0x37')][_0x634e('0x3e')](_0x634e('0x3f'))){_0x126fed[_0x634e('0x24')]=qs[_0x634e('0x24')](_0x5e23a[_0x634e('0x37')][_0x634e('0x24')]);_0x126fed[_0x634e('0x22')]=qs[_0x634e('0x22')](_0x5e23a[_0x634e('0x37')][_0x634e('0x22')]);}_0x126fed[_0x634e('0x40')]=qs[_0x634e('0x41')](_0x5e23a[_0x634e('0x37')][_0x634e('0x41')]);_0x126fed[_0x634e('0x42')]=qs['filters'](_['pick'](_0x5e23a['query'],_0x3dff4e[_0x634e('0x39')]),_0x1012ab);if(_0x5e23a[_0x634e('0x37')]['filter']){_0x126fed[_0x634e('0x42')]=_[_0x634e('0x43')](_0x126fed[_0x634e('0x42')],{'$or':_['map'](_0x1012ab,function(_0x31312e){if(_0x31312e[_0x634e('0x33')]!==_0x634e('0x44')){var _0x2be8c2={};_0x2be8c2[_0x31312e[_0x634e('0x2e')]]={'$like':'%'+_0x5e23a[_0x634e('0x37')][_0x634e('0x45')]+'%'};return _0x2be8c2;}})});}_0x126fed=_['merge']({},_0x126fed,_0x5e23a['options']);var _0xe3e89b={'where':_0x126fed[_0x634e('0x42')]};return db[_0x634e('0x30')][_0x634e('0x25')](_0xe3e89b)[_0x634e('0x2c')](function(_0x4633ed){_0x502fb8[_0x634e('0x25')]=_0x4633ed;if(_0x5e23a[_0x634e('0x37')]['includeAll']){_0x126fed[_0x634e('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x634e('0x47')](_0x126fed);})['then'](function(_0x3dcc64){_0x502fb8['rows']=_0x3dcc64;return _0x502fb8;})[_0x634e('0x2c')](respondWithFilteredResult(_0x5a1d46,_0x126fed))[_0x634e('0x48')](handleError(_0x5a1d46,null));};exports[_0x634e('0x49')]=function(_0x5c54e4,_0x127a33){var _0x5ab12d={'raw':!![],'where':{'id':_0x5c54e4['params']['id']}},_0x38e77b={};_0x38e77b[_0x634e('0x35')]=_['keys'](db[_0x634e('0x30')][_0x634e('0x31')]);_0x38e77b[_0x634e('0x37')]=_['keys'](_0x5c54e4[_0x634e('0x37')]);_0x38e77b['filters']=_[_0x634e('0x3a')](_0x38e77b[_0x634e('0x35')],_0x38e77b[_0x634e('0x37')]);_0x5ab12d['attributes']=_[_0x634e('0x3a')](_0x38e77b[_0x634e('0x35')],qs['fields'](_0x5c54e4[_0x634e('0x37')][_0x634e('0x3c')]));_0x5ab12d[_0x634e('0x3b')]=_0x5ab12d[_0x634e('0x3b')]['length']?_0x5ab12d[_0x634e('0x3b')]:_0x38e77b[_0x634e('0x35')];if(_0x5c54e4['query']['includeAll']){_0x5ab12d[_0x634e('0x46')]=[{'all':!![]}];}_0x5ab12d=_['merge']({},_0x5ab12d,_0x5c54e4['options']);return db[_0x634e('0x30')][_0x634e('0x4a')](_0x5ab12d)['then'](handleEntityNotFound(_0x127a33,null))[_0x634e('0x2c')](respondWithResult(_0x127a33,null))['catch'](handleError(_0x127a33,null));};exports[_0x634e('0x4b')]=function(_0x47dd84,_0x2a9f7a){return db[_0x634e('0x30')][_0x634e('0x4b')](_0x47dd84[_0x634e('0x4c')],{})[_0x634e('0x2c')](respondWithResult(_0x2a9f7a,0xc9))[_0x634e('0x48')](handleError(_0x2a9f7a,null));};exports[_0x634e('0x2b')]=function(_0x297e32,_0x1fbacf){if(_0x297e32[_0x634e('0x4c')]['id']){delete _0x297e32[_0x634e('0x4c')]['id'];}return db[_0x634e('0x30')]['find']({'where':{'id':_0x297e32[_0x634e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1fbacf,null))['then'](saveUpdates(_0x297e32['body'],null))[_0x634e('0x2c')](respondWithResult(_0x1fbacf,null))[_0x634e('0x48')](handleError(_0x1fbacf,null));};exports[_0x634e('0x4e')]=function(_0x83ae1d,_0x2b5e65){return db[_0x634e('0x30')][_0x634e('0x4a')]({'where':{'id':_0x83ae1d[_0x634e('0x4d')]['id']}})[_0x634e('0x2c')](handleEntityNotFound(_0x2b5e65,null))[_0x634e('0x2c')](removeEntity(_0x2b5e65,null))[_0x634e('0x48')](handleError(_0x2b5e65,null));};exports[_0x634e('0x4f')]=function(_0x3118d8,_0x27c347){return db[_0x634e('0x30')]['describe']()[_0x634e('0x2c')](respondWithResult(_0x27c347,null))['catch'](handleError(_0x27c347,null));};function wrapUser(_0x5a524d){return function(_0x1ab117){var _0x10c4c7=_0x5a524d[_0x634e('0x50')]({'plain':!![]});_0x10c4c7[_0x634e('0x51')]=[];if(_0x1ab117){_0x10c4c7[_0x634e('0x52')]=_0x1ab117[_0x634e('0x53')];_0x10c4c7[_0x634e('0x54')]=_0x1ab117;}else{_0x10c4c7[_0x634e('0x52')]=moment(0x0)[_0x634e('0x55')](_0x634e('0x56'));_0x10c4c7[_0x634e('0x54')]={};}return _0x10c4c7;};}exports[_0x634e('0x57')]=function(_0x16e6e7,_0x118331,_0x2cd8ab){var _0x1a0bb0=[];return db['User'][_0x634e('0x47')]({'where':{'role':['agent',_0x634e('0x58'),_0x634e('0x59')]},'attributes':['id','fullname',_0x634e('0x2e'),_0x634e('0x5a'),_0x634e('0x5b'),_0x634e('0x5c'),'online','lastLoginAt','allowmessenger',_0x634e('0x5d')],'order':qs[_0x634e('0x41')](_0x634e('0x5e')),'include':[{'model':db[_0x634e('0x5f')],'as':_0x634e('0x60'),'attributes':['id',_0x634e('0x2e'),_0x634e('0x33')],'through':{'attributes':[]}}]})[_0x634e('0x2c')](function(_0x2b229e){if(_0x2b229e){var _0x420180=_0x16e6e7['user'][_0x634e('0x50')]({'plain':!![]});if(!_0x420180)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x420180['role']===_0x634e('0x59')){return db[_0x634e('0x61')][_0x634e('0x4a')]({'where':{'name':'Agents','userProfileId':_0x420180[_0x634e('0x62')]},'raw':!![]})['then'](function(_0x3b8c42){if(_0x3b8c42){if(_0x3b8c42['autoAssociation']===0x0){return db[_0x634e('0x63')][_0x634e('0x47')]({'where':{'sectionId':_0x3b8c42['id']},'raw':!![]})[_0x634e('0x2c')](function(_0x9e87d5){var _0x16137b=[];if(_['isEmpty'](_0x9e87d5)){_0x16137b=_['filter'](_0x2b229e,function(_0x19f21c){if(_0x19f21c[_0x634e('0x5a')]!=='agent'){return _0x19f21c;}});return _0x16137b;}else{for(var _0x3a2032=0x0;_0x3a2032<_0x2b229e[_0x634e('0x3d')];_0x3a2032++){var _0x36313f=_0x2b229e[_0x3a2032];if(_0x36313f[_0x634e('0x5a')]==='agent'){var _0x611a35=_['find'](_0x9e87d5,function(_0xe63a49){return _0xe63a49[_0x634e('0x64')]===_0x36313f['id'];});if(_0x611a35)_0x16137b[_0x634e('0x65')](_0x36313f);}else{_0x16137b[_0x634e('0x65')](_0x36313f);}}return _0x16137b;}});}else{return _0x2b229e;}}else{var _0x23465d=_[_0x634e('0x45')](_0x2b229e,function(_0x33e0c4){if(_0x33e0c4[_0x634e('0x5a')]!==_0x634e('0x66')){return _0x33e0c4;}});return _0x23465d;}});}else{return _0x2b229e;}}})[_0x634e('0x2c')](function(_0x3e6cf4){var _0x28c25c=[];if(_0x3e6cf4){_0x1a0bb0=_0x3e6cf4;for(var _0x759cba=0x0;_0x759cba<_0x3e6cf4['length'];_0x759cba+=0x1){_0x1a0bb0[_0x759cba]['messages']=[];_0x28c25c[_0x634e('0x65')](db[_0x634e('0x30')][_0x634e('0x4a')]({'where':{'FromId':[_0x16e6e7[_0x634e('0x59')]['id'],_0x3e6cf4[_0x759cba]['id']],'ToId':[_0x16e6e7[_0x634e('0x59')]['id'],_0x3e6cf4[_0x759cba]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x634e('0x67'),'ToId',_0x634e('0x68'),'body'],'order':qs[_0x634e('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x3e6cf4[_0x759cba])));}return BPromise[_0x634e('0x69')](_0x28c25c);}return[];})[_0x634e('0x2c')](function(_0x48940f){return{'rows':_0x48940f,'count':_0x48940f[_0x634e('0x3d')]};})['then'](respondWithResult(_0x118331,null))['catch'](handleError(_0x118331,null));};
\ No newline at end of file
+var _0xe19e=['push','ToId','read','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','ChatInternalMessage','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','update','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','role','userpic','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId'];(function(_0x4cea31,_0x54ef05){var _0x30bf16=function(_0x1530a7){while(--_0x1530a7){_0x4cea31['push'](_0x4cea31['shift']());}};_0x30bf16(++_0x54ef05);}(_0xe19e,0xdb));var _0xee19=function(_0x2d8533,_0x1ab88e){_0x2d8533=_0x2d8533-0x0;var _0x4383ab=_0xe19e[_0x2d8533];return _0x4383ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee19('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee19('0x1'));var rp=require(_0xee19('0x2'));var moment=require(_0xee19('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xee19('0x4'));var util=require(_0xee19('0x5'));var path=require(_0xee19('0x6'));var sox=require('sox');var csv=require(_0xee19('0x7'));var ejs=require(_0xee19('0x8'));var fs=require('fs');var fs_extra=require(_0xee19('0x9'));var _=require('lodash');var squel=require(_0xee19('0xa'));var crypto=require(_0xee19('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xee19('0xc'));var toCsv=require(_0xee19('0x7'));var querystring=require('querystring');var Papa=require(_0xee19('0xd'));var Redis=require(_0xee19('0xe'));var authService=require(_0xee19('0xf'));var qs=require(_0xee19('0x10'));var as=require(_0xee19('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee19('0x12'))(_0xee19('0x13'));var utils=require(_0xee19('0x14'));var config=require(_0xee19('0x15'));var licenseUtil=require(_0xee19('0x16'));var db=require('../../mysqldb')['db'];config[_0xee19('0x17')]=_['defaults'](config[_0xee19('0x17')],{'host':_0xee19('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xee19('0x17')]));require(_0xee19('0x19'))[_0xee19('0x1a')](socket);function respondWithStatusCode(_0x33591f,_0x13dffb){_0x13dffb=_0x13dffb||0xcc;return function(_0x5b3e14){if(_0x5b3e14){return _0x33591f[_0xee19('0x1b')](_0x13dffb);}return _0x33591f[_0xee19('0x1c')](_0x13dffb)[_0xee19('0x1d')]();};}function respondWithResult(_0x1b98c1,_0x526e72){_0x526e72=_0x526e72||0xc8;return function(_0x5f5131){if(_0x5f5131){return _0x1b98c1[_0xee19('0x1c')](_0x526e72)[_0xee19('0x1e')](_0x5f5131);}};}function respondWithFilteredResult(_0x567bbc,_0x3d95cb){return function(_0x1734c1){if(_0x1734c1){var _0x320234=typeof _0x3d95cb[_0xee19('0x1f')]===_0xee19('0x20')&&typeof _0x3d95cb[_0xee19('0x21')]==='undefined';var _0x4d5cd9=_0x1734c1[_0xee19('0x22')];var _0x445e4f=_0x320234?0x0:_0x3d95cb[_0xee19('0x1f')];var _0x3ce468=_0x320234?_0x1734c1[_0xee19('0x22')]:_0x3d95cb[_0xee19('0x1f')]+_0x3d95cb[_0xee19('0x21')];var _0x31ed17;if(_0x3ce468>=_0x4d5cd9){_0x3ce468=_0x4d5cd9;_0x31ed17=0xc8;}else{_0x31ed17=0xce;}_0x567bbc[_0xee19('0x1c')](_0x31ed17);return _0x567bbc[_0xee19('0x23')]('Content-Range',_0x445e4f+'-'+_0x3ce468+'/'+_0x4d5cd9)['json'](_0x1734c1);}return null;};}function patchUpdates(_0x1f5c65){return function(_0x183527){try{jsonpatch[_0xee19('0x24')](_0x183527,_0x1f5c65,!![]);}catch(_0x36242d){return BPromise[_0xee19('0x25')](_0x36242d);}return _0x183527['save']();};}function saveUpdates(_0x527db0,_0x5db768){return function(_0xb3921a){if(_0xb3921a){return _0xb3921a['update'](_0x527db0)[_0xee19('0x26')](function(_0x324a44){return _0x324a44;});}return null;};}function removeEntity(_0x4fd14d,_0x3444c4){return function(_0x59f975){if(_0x59f975){return _0x59f975[_0xee19('0x27')]()[_0xee19('0x26')](function(){_0x4fd14d['status'](0xcc)[_0xee19('0x1d')]();});}};}function handleEntityNotFound(_0x484c6d,_0x5025e3){return function(_0x50dab){if(!_0x50dab){_0x484c6d['sendStatus'](0x194);}return _0x50dab;};}function handleError(_0xb6bbe6,_0x321ce5){_0x321ce5=_0x321ce5||0x1f4;return function(_0x24f09a){logger[_0xee19('0x28')](_0x24f09a['stack']);if(_0x24f09a[_0xee19('0x29')]){delete _0x24f09a[_0xee19('0x29')];}_0xb6bbe6[_0xee19('0x1c')](_0x321ce5)[_0xee19('0x2a')](_0x24f09a);};}exports[_0xee19('0x2b')]=function(_0x1f6f9c,_0x936f80){var _0x3ff0bf={},_0x3fc1bf={},_0x48bbd0={'count':0x0,'rows':[]};var _0x2ae37d=_[_0xee19('0x2c')](db['ChatInternalMessage']['rawAttributes'],function(_0x2a96bc){return{'name':_0x2a96bc[_0xee19('0x2d')],'type':_0x2a96bc[_0xee19('0x2e')][_0xee19('0x2f')]};});_0x3fc1bf['model']=_[_0xee19('0x2c')](_0x2ae37d,'name');_0x3fc1bf[_0xee19('0x30')]=_['keys'](_0x1f6f9c['query']);_0x3fc1bf[_0xee19('0x31')]=_['intersection'](_0x3fc1bf['model'],_0x3fc1bf[_0xee19('0x30')]);_0x3ff0bf['attributes']=_[_0xee19('0x32')](_0x3fc1bf[_0xee19('0x33')],qs[_0xee19('0x34')](_0x1f6f9c[_0xee19('0x30')][_0xee19('0x34')]));_0x3ff0bf[_0xee19('0x35')]=_0x3ff0bf['attributes'][_0xee19('0x36')]?_0x3ff0bf[_0xee19('0x35')]:_0x3fc1bf[_0xee19('0x33')];if(!_0x1f6f9c[_0xee19('0x30')]['hasOwnProperty'](_0xee19('0x37'))){_0x3ff0bf[_0xee19('0x21')]=qs[_0xee19('0x21')](_0x1f6f9c[_0xee19('0x30')]['limit']);_0x3ff0bf['offset']=qs[_0xee19('0x1f')](_0x1f6f9c['query'][_0xee19('0x1f')]);}_0x3ff0bf['order']=qs[_0xee19('0x38')](_0x1f6f9c[_0xee19('0x30')][_0xee19('0x38')]);_0x3ff0bf['where']=qs[_0xee19('0x31')](_[_0xee19('0x39')](_0x1f6f9c['query'],_0x3fc1bf['filters']),_0x2ae37d);if(_0x1f6f9c[_0xee19('0x30')][_0xee19('0x3a')]){_0x3ff0bf[_0xee19('0x3b')]=_[_0xee19('0x3c')](_0x3ff0bf[_0xee19('0x3b')],{'$or':_[_0xee19('0x2c')](_0x2ae37d,function(_0x422c5a){if(_0x422c5a[_0xee19('0x2e')]!==_0xee19('0x3d')){var _0x5e9b59={};_0x5e9b59[_0x422c5a[_0xee19('0x29')]]={'$like':'%'+_0x1f6f9c[_0xee19('0x30')][_0xee19('0x3a')]+'%'};return _0x5e9b59;}})});}_0x3ff0bf=_[_0xee19('0x3c')]({},_0x3ff0bf,_0x1f6f9c[_0xee19('0x3e')]);var _0x11ee1f={'where':_0x3ff0bf[_0xee19('0x3b')]};return db[_0xee19('0x3f')][_0xee19('0x22')](_0x11ee1f)[_0xee19('0x26')](function(_0x19507f){_0x48bbd0[_0xee19('0x22')]=_0x19507f;if(_0x1f6f9c[_0xee19('0x30')]['includeAll']){_0x3ff0bf[_0xee19('0x40')]=[{'all':!![]}];}return db[_0xee19('0x3f')][_0xee19('0x41')](_0x3ff0bf);})['then'](function(_0x15abbf){_0x48bbd0[_0xee19('0x42')]=_0x15abbf;return _0x48bbd0;})['then'](respondWithFilteredResult(_0x936f80,_0x3ff0bf))['catch'](handleError(_0x936f80,null));};exports['show']=function(_0x22bc3a,_0x3c7d5f){var _0x3e6d28={'raw':!![],'where':{'id':_0x22bc3a[_0xee19('0x43')]['id']}},_0x41d3c9={};_0x41d3c9['model']=_[_0xee19('0x44')](db[_0xee19('0x3f')][_0xee19('0x45')]);_0x41d3c9['query']=_[_0xee19('0x44')](_0x22bc3a[_0xee19('0x30')]);_0x41d3c9[_0xee19('0x31')]=_[_0xee19('0x32')](_0x41d3c9[_0xee19('0x33')],_0x41d3c9['query']);_0x3e6d28[_0xee19('0x35')]=_[_0xee19('0x32')](_0x41d3c9[_0xee19('0x33')],qs['fields'](_0x22bc3a['query'][_0xee19('0x34')]));_0x3e6d28[_0xee19('0x35')]=_0x3e6d28[_0xee19('0x35')]['length']?_0x3e6d28['attributes']:_0x41d3c9[_0xee19('0x33')];if(_0x22bc3a[_0xee19('0x30')]['includeAll']){_0x3e6d28[_0xee19('0x40')]=[{'all':!![]}];}_0x3e6d28=_[_0xee19('0x3c')]({},_0x3e6d28,_0x22bc3a[_0xee19('0x3e')]);return db[_0xee19('0x3f')][_0xee19('0x46')](_0x3e6d28)[_0xee19('0x26')](handleEntityNotFound(_0x3c7d5f,null))[_0xee19('0x26')](respondWithResult(_0x3c7d5f,null))[_0xee19('0x47')](handleError(_0x3c7d5f,null));};exports[_0xee19('0x48')]=function(_0x32333b,_0x35bc2a){return db[_0xee19('0x3f')][_0xee19('0x48')](_0x32333b[_0xee19('0x49')],{})[_0xee19('0x26')](respondWithResult(_0x35bc2a,0xc9))[_0xee19('0x47')](handleError(_0x35bc2a,null));};exports[_0xee19('0x4a')]=function(_0x2cc732,_0x49096e){if(_0x2cc732['body']['id']){delete _0x2cc732[_0xee19('0x49')]['id'];}return db[_0xee19('0x3f')]['find']({'where':{'id':_0x2cc732[_0xee19('0x43')]['id']}})[_0xee19('0x26')](handleEntityNotFound(_0x49096e,null))[_0xee19('0x26')](saveUpdates(_0x2cc732[_0xee19('0x49')],null))[_0xee19('0x26')](respondWithResult(_0x49096e,null))[_0xee19('0x47')](handleError(_0x49096e,null));};exports['destroy']=function(_0x5c51ce,_0x454624){return db['ChatInternalMessage'][_0xee19('0x46')]({'where':{'id':_0x5c51ce[_0xee19('0x43')]['id']}})[_0xee19('0x26')](handleEntityNotFound(_0x454624,null))[_0xee19('0x26')](removeEntity(_0x454624,null))[_0xee19('0x47')](handleError(_0x454624,null));};exports[_0xee19('0x4b')]=function(_0x169bdb,_0x121a0a){return db['ChatInternalMessage']['describe']()[_0xee19('0x26')](respondWithResult(_0x121a0a,null))[_0xee19('0x47')](handleError(_0x121a0a,null));};function wrapUser(_0x28f834){return function(_0x421763){var _0x2686e3=_0x28f834[_0xee19('0x4c')]({'plain':!![]});_0x2686e3[_0xee19('0x4d')]=[];if(_0x421763){_0x2686e3[_0xee19('0x4e')]=_0x421763[_0xee19('0x4f')];_0x2686e3[_0xee19('0x50')]=_0x421763;}else{_0x2686e3[_0xee19('0x4e')]=moment(0x0)[_0xee19('0x51')](_0xee19('0x52'));_0x2686e3[_0xee19('0x50')]={};}return _0x2686e3;};}exports['getUsers']=function(_0x102551,_0x221195,_0x4ec321){var _0x8d0a08=[];return db[_0xee19('0x53')][_0xee19('0x41')]({'where':{'role':[_0xee19('0x54'),_0xee19('0x55'),_0xee19('0x56')]},'attributes':['id','fullname',_0xee19('0x29'),_0xee19('0x57'),_0xee19('0x58'),'internal','online',_0xee19('0x59'),_0xee19('0x5a'),_0xee19('0x5b')],'order':qs[_0xee19('0x38')](_0xee19('0x5c')),'include':[{'model':db[_0xee19('0x5d')],'as':_0xee19('0x5e'),'attributes':['id',_0xee19('0x29'),_0xee19('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x361656){if(_0x361656){var _0x1fc327=_0x102551[_0xee19('0x56')]['get']({'plain':!![]});if(!_0x1fc327)throw new Error(_0xee19('0x5f'));if(_0x1fc327['role']===_0xee19('0x56')){return db[_0xee19('0x60')][_0xee19('0x46')]({'where':{'name':_0xee19('0x61'),'userProfileId':_0x1fc327[_0xee19('0x62')]},'raw':!![]})[_0xee19('0x26')](function(_0x1e1e1b){if(_0x1e1e1b){if(_0x1e1e1b['autoAssociation']===0x0){return db[_0xee19('0x63')][_0xee19('0x41')]({'where':{'sectionId':_0x1e1e1b['id']},'raw':!![]})[_0xee19('0x26')](function(_0x36a5f0){var _0x432e9a=[];if(_[_0xee19('0x64')](_0x36a5f0)){_0x432e9a=_[_0xee19('0x3a')](_0x361656,function(_0x3cbe7c){if(_0x3cbe7c[_0xee19('0x57')]!=='agent'){return _0x3cbe7c;}});return _0x432e9a;}else{for(var _0x15715c=0x0;_0x15715c<_0x361656[_0xee19('0x36')];_0x15715c++){var _0x94da7e=_0x361656[_0x15715c];if(_0x94da7e[_0xee19('0x57')]===_0xee19('0x54')){var _0x1385e8=_[_0xee19('0x46')](_0x36a5f0,function(_0x1afce7){return _0x1afce7[_0xee19('0x65')]===_0x94da7e['id'];});if(_0x1385e8)_0x432e9a[_0xee19('0x66')](_0x94da7e);}else{_0x432e9a[_0xee19('0x66')](_0x94da7e);}}return _0x432e9a;}});}else{return _0x361656;}}else{var _0x1b950=_[_0xee19('0x3a')](_0x361656,function(_0x5664a2){if(_0x5664a2[_0xee19('0x57')]!==_0xee19('0x54')){return _0x5664a2;}});return _0x1b950;}});}else{return _0x361656;}}})[_0xee19('0x26')](function(_0x22daca){var _0x4c327b=[];if(_0x22daca){_0x8d0a08=_0x22daca;for(var _0x45f8d0=0x0;_0x45f8d0<_0x22daca[_0xee19('0x36')];_0x45f8d0+=0x1){_0x8d0a08[_0x45f8d0][_0xee19('0x4d')]=[];_0x4c327b[_0xee19('0x66')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x102551['user']['id'],_0x22daca[_0x45f8d0]['id']],'ToId':[_0x102551[_0xee19('0x56')]['id'],_0x22daca[_0x45f8d0]['id']],'ChatGroupId':null},'attributes':['id',_0xee19('0x4f'),'FromId',_0xee19('0x67'),_0xee19('0x68'),_0xee19('0x49')],'order':qs['sort'](_0xee19('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xee19('0x26')](wrapUser(_0x22daca[_0x45f8d0])));}return BPromise[_0xee19('0x6a')](_0x4c327b);}return[];})[_0xee19('0x26')](function(_0x26d419){return{'rows':_0x26d419,'count':_0x26d419[_0xee19('0x36')]};})[_0xee19('0x26')](respondWithResult(_0x221195,null))[_0xee19('0x47')](handleError(_0x221195,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index e75dec9..db49987 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 _0x2ef4=['exports','ChatInternalMessage','setMaxListeners','save','update','emit','hook'];(function(_0x5ca6cb,_0x3872b4){var _0x172891=function(_0x16f4fd){while(--_0x16f4fd){_0x5ca6cb['push'](_0x5ca6cb['shift']());}};_0x172891(++_0x3872b4);}(_0x2ef4,0x143));var _0x42ef=function(_0x130547,_0x390046){_0x130547=_0x130547-0x0;var _0x554bfb=_0x2ef4[_0x130547];return _0x554bfb;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0x42ef('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x42ef('0x1')](0x0);var events={'afterCreate':_0x42ef('0x2'),'afterUpdate':_0x42ef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x48563b){return function(_0x355f8b,_0x5c1c04,_0x122ae3){ChatInternalMessageEvents[_0x42ef('0x4')](_0x48563b+':'+_0x355f8b['id'],_0x355f8b);ChatInternalMessageEvents[_0x42ef('0x4')](_0x48563b,_0x355f8b);_0x122ae3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x42ef('0x5')](e,emitEvent(event));}}module[_0x42ef('0x6')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xff8a=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0xff8a,0x17f));var _0xaff8=function(_0x28db1c,_0x50f00d){_0x28db1c=_0x28db1c-0x0;var _0x10fd84=_0xff8a[_0x28db1c];return _0x10fd84;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xaff8('0x0'))['db'][_0xaff8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xaff8('0x2')](0x0);var events={'afterCreate':_0xaff8('0x3'),'afterUpdate':'update','afterDestroy':_0xaff8('0x4')};function emitEvent(_0x3ce355){return function(_0xa55ad8,_0x1181df,_0x3497c1){ChatInternalMessageEvents[_0xaff8('0x5')](_0x3ce355+':'+_0xa55ad8['id'],_0xa55ad8);ChatInternalMessageEvents[_0xaff8('0x5')](_0x3ce355,_0xa55ad8);_0x3497c1(null);};}for(var e in events){if(events[_0xaff8('0x6')](e)){var event=events[e];ChatInternalMessage[_0xaff8('0x7')](e,emitEvent(event));}}module[_0xaff8('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 52f7d98..2dc35fe 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 _0xa483=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5c5832,_0x156ba9){var _0x5d20c8=function(_0x1496be){while(--_0x1496be){_0x5c5832['push'](_0x5c5832['shift']());}};_0x5d20c8(++_0x156ba9);}(_0xa483,0xe0));var _0x3a48=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa483[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3a48('0x0'));var util=require(_0x3a48('0x1'));var logger=require(_0x3a48('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3a48('0x3'));var rp=require(_0x3a48('0x4'));var fs=require('fs');var path=require(_0x3a48('0x5'));var rimraf=require(_0x3a48('0x6'));var config=require(_0x3a48('0x7'));var attributes=require(_0x3a48('0x8'));module[_0x3a48('0x9')]=function(_0x1880c8,_0x1d19e1){return _0x1880c8[_0x3a48('0xa')](_0x3a48('0xb'),attributes,{'tableName':_0x3a48('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a48('0xd'),'collate':_0x3a48('0xe')});};
\ No newline at end of file
+var _0x2580=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3b88a3,_0x47b937){var _0x194c72=function(_0x597702){while(--_0x597702){_0x3b88a3['push'](_0x3b88a3['shift']());}};_0x194c72(++_0x47b937);}(_0x2580,0x156));var _0x0258=function(_0x387853,_0x182878){_0x387853=_0x387853-0x0;var _0x1d3172=_0x2580[_0x387853];return _0x1d3172;};'use strict';var _=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var logger=require(_0x0258('0x2'))('api');var moment=require(_0x0258('0x3'));var BPromise=require(_0x0258('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0258('0x5'));var rimraf=require(_0x0258('0x6'));var config=require(_0x0258('0x7'));var attributes=require(_0x0258('0x8'));module[_0x0258('0x9')]=function(_0x62628f,_0x1f53a4){return _0x62628f[_0x0258('0xa')](_0x0258('0xb'),attributes,{'tableName':_0x0258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0258('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index b1df53e..deebe78 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 _0xebea=['defaults','redis','localhost','register','request','then','info','request\x20sent','debug','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x53c4f8,_0x44ccaf){var _0x416458=function(_0x2632aa){while(--_0x2632aa){_0x53c4f8['push'](_0x53c4f8['shift']());}};_0x416458(++_0x44ccaf);}(_0xebea,0x7b));var _0xaebe=function(_0x2b4bda,_0x127dda){_0x2b4bda=_0x2b4bda-0x0;var _0xf714e9=_0xebea[_0x2b4bda];return _0xf714e9;};'use strict';var _=require(_0xaebe('0x0'));var util=require(_0xaebe('0x1'));var moment=require(_0xaebe('0x2'));var BPromise=require(_0xaebe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaebe('0x4'));var db=require(_0xaebe('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaebe('0x6'))(_0xaebe('0x7'));var config=require(_0xaebe('0x8'));var jayson=require(_0xaebe('0x9'));var client=jayson[_0xaebe('0xa')][_0xaebe('0xb')]({'port':0x232a});config['redis']=_[_0xaebe('0xc')](config[_0xaebe('0xd')],{'host':_0xaebe('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xaebe('0xf')](socket);function respondWithRpcPromise(_0x1be3ee,_0x5f4ae0,_0x296c12){return new BPromise(function(_0x4d3552,_0x57c69e){return client[_0xaebe('0x10')](_0x1be3ee,_0x296c12)[_0xaebe('0x11')](function(_0x5b8639){logger[_0xaebe('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x5f4ae0,_0xaebe('0x13'));logger[_0xaebe('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5f4ae0,_0xaebe('0x13'),JSON[_0xaebe('0x15')](_0x5b8639));if(_0x5b8639['error']){if(_0x5b8639[_0xaebe('0x16')]['code']===0x1f4){logger[_0xaebe('0x16')](_0xaebe('0x17'),_0x5f4ae0,_0x5b8639[_0xaebe('0x16')][_0xaebe('0x18')]);return _0x57c69e(_0x5b8639[_0xaebe('0x16')][_0xaebe('0x18')]);}logger[_0xaebe('0x16')](_0xaebe('0x17'),_0x5f4ae0,_0x5b8639[_0xaebe('0x16')][_0xaebe('0x18')]);return _0x4d3552(_0x5b8639['error'][_0xaebe('0x18')]);}else{logger['info'](_0xaebe('0x17'),_0x5f4ae0,_0xaebe('0x13'));_0x4d3552(_0x5b8639[_0xaebe('0x19')]['message']);}})[_0xaebe('0x1a')](function(_0x1afa9d){logger['error'](_0xaebe('0x17'),_0x5f4ae0,_0x1afa9d);_0x57c69e(_0x1afa9d);});});}
\ No newline at end of file
+var _0xaf5a=['localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x1ed116,_0x112e04){var _0x4bdd93=function(_0x1fb571){while(--_0x1fb571){_0x1ed116['push'](_0x1ed116['shift']());}};_0x4bdd93(++_0x112e04);}(_0xaf5a,0x144));var _0xaaf5=function(_0x282442,_0x185644){_0x282442=_0x282442-0x0;var _0x244748=_0xaf5a[_0x282442];return _0x244748;};'use strict';var _=require('lodash');var util=require(_0xaaf5('0x0'));var moment=require('moment');var BPromise=require(_0xaaf5('0x1'));var rs=require(_0xaaf5('0x2'));var fs=require('fs');var Redis=require(_0xaaf5('0x3'));var db=require(_0xaaf5('0x4'))['db'];var utils=require(_0xaaf5('0x5'));var logger=require(_0xaaf5('0x6'))(_0xaaf5('0x7'));var config=require(_0xaaf5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaaf5('0x9')]['http']({'port':0x232a});config[_0xaaf5('0xa')]=_[_0xaaf5('0xb')](config[_0xaaf5('0xa')],{'host':_0xaaf5('0xc'),'port':0x18eb});var socket=require(_0xaaf5('0xd'))(new Redis(config['redis']));require(_0xaaf5('0xe'))[_0xaaf5('0xf')](socket);function respondWithRpcPromise(_0x3813e1,_0x4a3395,_0x5168d7){return new BPromise(function(_0x146c06,_0x2d7bec){return client[_0xaaf5('0x10')](_0x3813e1,_0x5168d7)[_0xaaf5('0x11')](function(_0x38a054){logger[_0xaaf5('0x12')](_0xaaf5('0x13'),_0x4a3395,_0xaaf5('0x14'));logger[_0xaaf5('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x4a3395,_0xaaf5('0x14'),JSON[_0xaaf5('0x16')](_0x38a054));if(_0x38a054[_0xaaf5('0x17')]){if(_0x38a054[_0xaaf5('0x17')][_0xaaf5('0x18')]===0x1f4){logger[_0xaaf5('0x17')](_0xaaf5('0x13'),_0x4a3395,_0x38a054[_0xaaf5('0x17')]['message']);return _0x2d7bec(_0x38a054['error']['message']);}logger[_0xaaf5('0x17')](_0xaaf5('0x13'),_0x4a3395,_0x38a054['error'][_0xaaf5('0x19')]);return _0x146c06(_0x38a054[_0xaaf5('0x17')][_0xaaf5('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4a3395,_0xaaf5('0x14'));_0x146c06(_0x38a054[_0xaaf5('0x1a')][_0xaaf5('0x19')]);}})[_0xaaf5('0x1b')](function(_0x19912a){logger['error'](_0xaaf5('0x13'),_0x4a3395,_0x19912a);_0x2d7bec(_0x19912a);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 50d7cea..741af34 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 _0x9e01=['save','remove','update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x3d6463,_0xa4c820){var _0xfd8436=function(_0x5cc3ad){while(--_0x5cc3ad){_0x3d6463['push'](_0x3d6463['shift']());}};_0xfd8436(++_0xa4c820);}(_0x9e01,0xc7));var _0x19e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9e01[_0x20a584];return _0x4b41a8;};'use strict';var ChatInternalMessageEvents=require(_0x19e0('0x0'));var events=[_0x19e0('0x1'),_0x19e0('0x2'),_0x19e0('0x3')];function createListener(_0x3e4ccc,_0x3502b1){return function(_0x4830ee){_0x3502b1['emit'](_0x3e4ccc,_0x4830ee);};}function removeListener(_0x43fe8e,_0x151fd6){return function(){ChatInternalMessageEvents[_0x19e0('0x4')](_0x43fe8e,_0x151fd6);};}exports[_0x19e0('0x5')]=function(_0x4b4cce){for(var _0x3d05a9=0x0,_0x360b54=events[_0x19e0('0x6')];_0x3d05a9<_0x360b54;_0x3d05a9++){var _0x32fdd2=events[_0x3d05a9];var _0x50043d=createListener(_0x19e0('0x7')+_0x32fdd2,_0x4b4cce);ChatInternalMessageEvents['on'](_0x32fdd2,_0x50043d);}};
\ No newline at end of file
+var _0xd4a5=['save','remove','emit'];(function(_0x57c380,_0x4cdaae){var _0x201cbf=function(_0x792e4f){while(--_0x792e4f){_0x57c380['push'](_0x57c380['shift']());}};_0x201cbf(++_0x4cdaae);}(_0xd4a5,0x1e6));var _0x5d4a=function(_0x4f08f8,_0x5ac43b){_0x4f08f8=_0x4f08f8-0x0;var _0x15a137=_0xd4a5[_0x4f08f8];return _0x15a137;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5d4a('0x0'),_0x5d4a('0x1'),'update'];function createListener(_0x1468c7,_0x3f4302){return function(_0x114528){_0x3f4302[_0x5d4a('0x2')](_0x1468c7,_0x114528);};}function removeListener(_0x32a946,_0x5b8da5){return function(){ChatInternalMessageEvents['removeListener'](_0x32a946,_0x5b8da5);};}exports['register']=function(_0x11826c){for(var _0x4b10af=0x0,_0x535bed=events['length'];_0x4b10af<_0x535bed;_0x4b10af++){var _0x180ff9=events[_0x4b10af];var _0x36cc85=createListener('chatInternalMessage:'+_0x180ff9,_0x11826c);ChatInternalMessageEvents['on'](_0x180ff9,_0x36cc85);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 2093b66..1290d9a 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 _0xc138=['describe','get','isAuthenticated','getUsers','/:id','show','post','create','put','update','delete','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xc138,0xdd));var _0x8c13=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc138[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x8c13('0x0'));var util=require('util');var path=require(_0x8c13('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c13('0x2'));var router=express[_0x8c13('0x3')]();var fs_extra=require(_0x8c13('0x4'));var auth=require(_0x8c13('0x5'));var interaction=require(_0x8c13('0x6'));var config=require(_0x8c13('0x7'));var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8c13('0x8')]);router['get'](_0x8c13('0x9'),auth['isAuthenticated'](),controller[_0x8c13('0xa')]);router[_0x8c13('0xb')]('/users',auth[_0x8c13('0xc')](),controller[_0x8c13('0xd')]);router['get'](_0x8c13('0xe'),auth[_0x8c13('0xc')](),controller[_0x8c13('0xf')]);router[_0x8c13('0x10')]('/',auth['isAuthenticated'](),controller[_0x8c13('0x11')]);router[_0x8c13('0x12')](_0x8c13('0xe'),controller[_0x8c13('0x13')]);router[_0x8c13('0x14')](_0x8c13('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0c90=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','describe','get','/users','getUsers','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4343e4,_0x5391f8){var _0x1d3b85=function(_0x4225ad){while(--_0x4225ad){_0x4343e4['push'](_0x4343e4['shift']());}};_0x1d3b85(++_0x5391f8);}(_0x0c90,0x197));var _0x00c9=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0c90[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x00c9('0x0'));var util=require(_0x00c9('0x1'));var path=require(_0x00c9('0x2'));var timeout=require(_0x00c9('0x3'));var express=require(_0x00c9('0x4'));var router=express[_0x00c9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x00c9('0x6'));var interaction=require(_0x00c9('0x7'));var config=require(_0x00c9('0x8'));var controller=require(_0x00c9('0x9'));router['get']('/',auth[_0x00c9('0xa')](),controller[_0x00c9('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x00c9('0xc')]);router[_0x00c9('0xd')](_0x00c9('0xe'),auth[_0x00c9('0xa')](),controller[_0x00c9('0xf')]);router[_0x00c9('0xd')](_0x00c9('0x10'),auth[_0x00c9('0xa')](),controller[_0x00c9('0x11')]);router[_0x00c9('0x12')]('/',auth[_0x00c9('0xa')](),controller[_0x00c9('0x13')]);router[_0x00c9('0x14')](_0x00c9('0x10'),controller[_0x00c9('0x15')]);router[_0x00c9('0x16')](_0x00c9('0x10'),auth[_0x00c9('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 35eea9a..77d5cc3 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 _0x3014=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x49f096,_0xfc45e){var _0x515854=function(_0x3ad888){while(--_0x3ad888){_0x49f096['push'](_0x49f096['shift']());}};_0x515854(++_0xfc45e);}(_0x3014,0x1d7));var _0x4301=function(_0x930504,_0x2a9c40){_0x930504=_0x930504-0x0;var _0x649c94=_0x3014[_0x930504];return _0x649c94;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4301('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4301('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4301('0x4')),'defaultValue':_0x4301('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4301('0x5')]},'providerName':{'type':Sequelize[_0x4301('0x6')]},'providerResponse':{'type':Sequelize[_0x4301('0x7')]}};
\ No newline at end of file
+var _0x25c2=['BOOLEAN','ENUM','out','DATE','sequelize','TEXT','medium'];(function(_0x1cef07,_0x1eb5f2){var _0x2f0a89=function(_0xdab0fe){while(--_0xdab0fe){_0x1cef07['push'](_0x1cef07['shift']());}};_0x2f0a89(++_0x1eb5f2);}(_0x25c2,0xdd));var _0x225c=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x25c2[_0x386c3e];return _0x4b8e13;};'use strict';var Sequelize=require(_0x225c('0x0'));module['exports']={'body':{'type':Sequelize[_0x225c('0x1')](_0x225c('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x225c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x225c('0x4')]('in','out'),'defaultValue':_0x225c('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x225c('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x225c('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index b2fcaec..1d15a49 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 _0x97bf=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','findAll','show','params','intersection','includeAll','include','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','format','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','reject','formData','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length'];(function(_0xa7258c,_0x32bf7c){var _0x3cc14a=function(_0x673e82){while(--_0x673e82){_0xa7258c['push'](_0xa7258c['shift']());}};_0x3cc14a(++_0x32bf7c);}(_0x97bf,0x143));var _0xf97b=function(_0x1fdc8d,_0x45a590){_0x1fdc8d=_0x1fdc8d-0x0;var _0x2befe7=_0x97bf[_0x1fdc8d];return _0x2befe7;};'use strict';var emlformat=require(_0xf97b('0x0'));var rimraf=require(_0xf97b('0x1'));var zipdir=require(_0xf97b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf97b('0x3'));var moment=require(_0xf97b('0x4'));var BPromise=require(_0xf97b('0x5'));var Mustache=require(_0xf97b('0x6'));var util=require(_0xf97b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf97b('0x8'));var ejs=require(_0xf97b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf97b('0xa'));var squel=require(_0xf97b('0xb'));var crypto=require(_0xf97b('0xc'));var jsforce=require(_0xf97b('0xd'));var deskjs=require(_0xf97b('0xe'));var toCsv=require(_0xf97b('0x8'));var querystring=require('querystring');var Papa=require(_0xf97b('0xf'));var Redis=require(_0xf97b('0x10'));var authService=require(_0xf97b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf97b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf97b('0x13'))('api');var utils=require(_0xf97b('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf97b('0x15')]=_[_0xf97b('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf97b('0x17'))(new Redis(config[_0xf97b('0x15')]));require('./chatMessage.socket')[_0xf97b('0x18')](socket);var jayson=require(_0xf97b('0x19'));var client=jayson[_0xf97b('0x1a')][_0xf97b('0x1b')]({'port':0x232c});var client9002=jayson[_0xf97b('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27da5f,_0x2f9e70,_0x236c89,_0x17f0f2){return new BPromise(function(_0x12c29c,_0x2a871e){var _0x11b908=_0x17f0f2||client;return _0x11b908[_0xf97b('0x1c')](_0x27da5f,_0x236c89)[_0xf97b('0x1d')](function(_0x5c776d){logger[_0xf97b('0x1e')](_0xf97b('0x1f'),_0x2f9e70,_0xf97b('0x20'));logger[_0xf97b('0x21')](_0xf97b('0x22'),_0x2f9e70,_0xf97b('0x20'),JSON['stringify'](_0x5c776d));if(_0x5c776d[_0xf97b('0x23')]){if(_0x5c776d[_0xf97b('0x23')][_0xf97b('0x24')]===0x1f4){logger[_0xf97b('0x23')]('ChatMessage,\x20%s,\x20%s',_0x2f9e70,_0x5c776d[_0xf97b('0x23')]['message']);return _0x2a871e(_0x5c776d[_0xf97b('0x23')][_0xf97b('0x25')]);}logger[_0xf97b('0x23')](_0xf97b('0x1f'),_0x2f9e70,_0x5c776d[_0xf97b('0x23')][_0xf97b('0x25')]);return _0x12c29c(_0x5c776d[_0xf97b('0x23')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x2f9e70,_0xf97b('0x20'));_0x12c29c(_0x5c776d[_0xf97b('0x26')][_0xf97b('0x25')]);}})[_0xf97b('0x27')](function(_0x48ee3a){logger[_0xf97b('0x23')](_0xf97b('0x1f'),_0x2f9e70,_0x48ee3a);_0x2a871e(_0x48ee3a);});});}function respondWithStatusCode(_0x101dfb,_0x18627d){_0x18627d=_0x18627d||0xcc;return function(_0xf102b4){if(_0xf102b4){return _0x101dfb[_0xf97b('0x28')](_0x18627d);}return _0x101dfb[_0xf97b('0x29')](_0x18627d)[_0xf97b('0x2a')]();};}function respondWithResult(_0x50c6cb,_0x4f0768){_0x4f0768=_0x4f0768||0xc8;return function(_0x468711){if(_0x468711){return _0x50c6cb['status'](_0x4f0768)[_0xf97b('0x2b')](_0x468711);}};}function respondWithFilteredResult(_0x964b30,_0x1b6294){return function(_0x2198ac){if(_0x2198ac){var _0x12c175=typeof _0x1b6294[_0xf97b('0x2c')]===_0xf97b('0x2d')&&typeof _0x1b6294[_0xf97b('0x2e')]===_0xf97b('0x2d');var _0xe11233=_0x2198ac['count'];var _0x31ce1e=_0x12c175?0x0:_0x1b6294[_0xf97b('0x2c')];var _0x5d6834=_0x12c175?_0x2198ac['count']:_0x1b6294[_0xf97b('0x2c')]+_0x1b6294['limit'];var _0x57533c;if(_0x5d6834>=_0xe11233){_0x5d6834=_0xe11233;_0x57533c=0xc8;}else{_0x57533c=0xce;}_0x964b30[_0xf97b('0x29')](_0x57533c);return _0x964b30[_0xf97b('0x2f')]('Content-Range',_0x31ce1e+'-'+_0x5d6834+'/'+_0xe11233)[_0xf97b('0x2b')](_0x2198ac);}return null;};}function patchUpdates(_0x33b768){return function(_0x4a08e6){try{jsonpatch[_0xf97b('0x30')](_0x4a08e6,_0x33b768,!![]);}catch(_0x54df49){return BPromise['reject'](_0x54df49);}return _0x4a08e6[_0xf97b('0x31')]();};}function saveUpdates(_0x35404d,_0x4df51e){return function(_0x545bcf){if(_0x545bcf){return _0x545bcf['update'](_0x35404d)[_0xf97b('0x1d')](function(_0x2c9722){return _0x2c9722;});}return null;};}function removeEntity(_0x53e8b3,_0x52dea1){return function(_0x377dad){if(_0x377dad){return _0x377dad[_0xf97b('0x32')]()[_0xf97b('0x1d')](function(){_0x53e8b3['status'](0xcc)[_0xf97b('0x2a')]();});}};}function handleEntityNotFound(_0x3d2c7e,_0x3d1c8c){return function(_0x208966){if(!_0x208966){_0x3d2c7e[_0xf97b('0x28')](0x194);}return _0x208966;};}function handleError(_0x597432,_0x4149c5){_0x4149c5=_0x4149c5||0x1f4;return function(_0x16133a){logger[_0xf97b('0x23')](_0x16133a[_0xf97b('0x33')]);if(_0x16133a[_0xf97b('0x34')]){delete _0x16133a[_0xf97b('0x34')];}_0x597432[_0xf97b('0x29')](_0x4149c5)[_0xf97b('0x35')](_0x16133a);};}exports['index']=function(_0x107954,_0x10d8db){var _0x14c8a6={},_0x2e881c={},_0x1c0200={'count':0x0,'rows':[]};var _0x537ead=_[_0xf97b('0x36')](db[_0xf97b('0x37')][_0xf97b('0x38')],function(_0x340a26){return{'name':_0x340a26[_0xf97b('0x39')],'type':_0x340a26[_0xf97b('0x3a')][_0xf97b('0x3b')]};});_0x2e881c[_0xf97b('0x3c')]=_[_0xf97b('0x36')](_0x537ead,_0xf97b('0x34'));_0x2e881c[_0xf97b('0x3d')]=_[_0xf97b('0x3e')](_0x107954[_0xf97b('0x3d')]);_0x2e881c[_0xf97b('0x3f')]=_['intersection'](_0x2e881c[_0xf97b('0x3c')],_0x2e881c['query']);_0x14c8a6[_0xf97b('0x40')]=_['intersection'](_0x2e881c[_0xf97b('0x3c')],qs[_0xf97b('0x41')](_0x107954['query'][_0xf97b('0x41')]));_0x14c8a6['attributes']=_0x14c8a6[_0xf97b('0x40')][_0xf97b('0x42')]?_0x14c8a6[_0xf97b('0x40')]:_0x2e881c[_0xf97b('0x3c')];if(!_0x107954[_0xf97b('0x3d')][_0xf97b('0x43')](_0xf97b('0x44'))){_0x14c8a6[_0xf97b('0x2e')]=qs[_0xf97b('0x2e')](_0x107954[_0xf97b('0x3d')][_0xf97b('0x2e')]);_0x14c8a6[_0xf97b('0x2c')]=qs['offset'](_0x107954['query']['offset']);}_0x14c8a6[_0xf97b('0x45')]=qs[_0xf97b('0x46')](_0x107954['query'][_0xf97b('0x46')]);_0x14c8a6[_0xf97b('0x47')]=qs[_0xf97b('0x3f')](_[_0xf97b('0x48')](_0x107954[_0xf97b('0x3d')],_0x2e881c['filters']),_0x537ead);if(_0x107954[_0xf97b('0x3d')][_0xf97b('0x49')]){_0x14c8a6[_0xf97b('0x47')]=_[_0xf97b('0x4a')](_0x14c8a6['where'],{'$or':_['map'](_0x537ead,function(_0x36e41f){if(_0x36e41f[_0xf97b('0x3a')]!=='VIRTUAL'){var _0x1bcf13={};_0x1bcf13[_0x36e41f['name']]={'$like':'%'+_0x107954[_0xf97b('0x3d')]['filter']+'%'};return _0x1bcf13;}})});}_0x14c8a6=_[_0xf97b('0x4a')]({},_0x14c8a6,_0x107954[_0xf97b('0x4b')]);var _0x127150={'where':_0x14c8a6[_0xf97b('0x47')]};return db['ChatMessage'][_0xf97b('0x4c')](_0x127150)['then'](function(_0x5ebcae){_0x1c0200['count']=_0x5ebcae;if(_0x107954['query']['includeAll']){_0x14c8a6['include']=[{'all':!![]}];}return db[_0xf97b('0x37')][_0xf97b('0x4d')](_0x14c8a6);})['then'](function(_0x273af5){_0x1c0200['rows']=_0x273af5;return _0x1c0200;})[_0xf97b('0x1d')](respondWithFilteredResult(_0x10d8db,_0x14c8a6))[_0xf97b('0x27')](handleError(_0x10d8db,null));};exports[_0xf97b('0x4e')]=function(_0x1dbfb7,_0x4922fc){var _0x47af76={'raw':!![],'where':{'id':_0x1dbfb7[_0xf97b('0x4f')]['id']}},_0x1bb7fa={};_0x1bb7fa[_0xf97b('0x3c')]=_[_0xf97b('0x3e')](db['ChatMessage'][_0xf97b('0x38')]);_0x1bb7fa[_0xf97b('0x3d')]=_[_0xf97b('0x3e')](_0x1dbfb7[_0xf97b('0x3d')]);_0x1bb7fa[_0xf97b('0x3f')]=_[_0xf97b('0x50')](_0x1bb7fa['model'],_0x1bb7fa[_0xf97b('0x3d')]);_0x47af76[_0xf97b('0x40')]=_[_0xf97b('0x50')](_0x1bb7fa['model'],qs[_0xf97b('0x41')](_0x1dbfb7['query'][_0xf97b('0x41')]));_0x47af76[_0xf97b('0x40')]=_0x47af76[_0xf97b('0x40')][_0xf97b('0x42')]?_0x47af76[_0xf97b('0x40')]:_0x1bb7fa['model'];if(_0x1dbfb7['query'][_0xf97b('0x51')]){_0x47af76[_0xf97b('0x52')]=[{'all':!![]}];}_0x47af76=_[_0xf97b('0x4a')]({},_0x47af76,_0x1dbfb7[_0xf97b('0x4b')]);return db[_0xf97b('0x37')][_0xf97b('0x53')](_0x47af76)[_0xf97b('0x1d')](handleEntityNotFound(_0x4922fc,null))[_0xf97b('0x1d')](respondWithResult(_0x4922fc,null))['catch'](handleError(_0x4922fc,null));};exports[_0xf97b('0x54')]=function(_0x343348,_0x3f5ce2){return db['ChatMessage'][_0xf97b('0x54')](_0x343348[_0xf97b('0x55')],{})['then'](respondWithResult(_0x3f5ce2,0xc9))[_0xf97b('0x27')](handleError(_0x3f5ce2,null));};exports[_0xf97b('0x56')]=function(_0x41bd79,_0x3f852c){if(_0x41bd79[_0xf97b('0x55')]['id']){delete _0x41bd79['body']['id'];}return db[_0xf97b('0x37')][_0xf97b('0x53')]({'where':{'id':_0x41bd79[_0xf97b('0x4f')]['id']}})[_0xf97b('0x1d')](handleEntityNotFound(_0x3f852c,null))[_0xf97b('0x1d')](saveUpdates(_0x41bd79[_0xf97b('0x55')],null))[_0xf97b('0x1d')](respondWithResult(_0x3f852c,null))[_0xf97b('0x27')](handleError(_0x3f852c,null));};exports[_0xf97b('0x32')]=function(_0x24aef5,_0x554f5b){return db['ChatMessage']['find']({'where':{'id':_0x24aef5[_0xf97b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x554f5b,null))[_0xf97b('0x1d')](removeEntity(_0x554f5b,null))[_0xf97b('0x27')](handleError(_0x554f5b,null));};exports['describe']=function(_0x23c138,_0x3729dc){return db['ChatMessage'][_0xf97b('0x57')]()[_0xf97b('0x1d')](respondWithResult(_0x3729dc,null))[_0xf97b('0x27')](handleError(_0x3729dc,null));};var interaction_log=require(_0xf97b('0x13'))(_0xf97b('0x58'));exports[_0xf97b('0x59')]=function(_0x42a0ac,_0x3fb3b1,_0x50dedc){var _0x5f4a91={'agent':{},'channel':_0xf97b('0x5a')};if(_0x42a0ac[_0xf97b('0x55')]['id']){delete _0x42a0ac['body']['id'];}_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x5b')]=!![];_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x42a0ac['body'][_0xf97b('0x5d')]=_0x42a0ac['body']['UserId']||_0x42a0ac[_0xf97b('0x5e')]['id'];_0x5f4a91['agent']['id']=_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x5d')];return db[_0xf97b('0x37')]['find']({'where':{'id':_0x42a0ac[_0xf97b('0x4f')]['id'],'UserId':null}})[_0xf97b('0x1d')](handleEntityNotFound(_0x3fb3b1,null))[_0xf97b('0x1d')](saveUpdates(_0x42a0ac[_0xf97b('0x55')],null))[_0xf97b('0x1d')](function(_0x3357f6){if(_0x3357f6){_0x5f4a91[_0xf97b('0x25')]=_0x3357f6[_0xf97b('0x5f')]({'plain':!![]});return db[_0xf97b('0x60')][_0xf97b('0x53')]({'where':{'id':_0x3357f6[_0xf97b('0x61')]}});}return null;})[_0xf97b('0x1d')](handleEntityNotFound(_0x3fb3b1,null))['then'](function(_0x26062d){if(_0x26062d){return _0x26062d[_0xf97b('0x56')]({'UserId':_0x42a0ac[_0xf97b('0x55')]['UserId'],'read1stAt':_[_0xf97b('0x62')](_0x26062d['read1stAt'])?moment()[_0xf97b('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1dc62e){if(_0x1dc62e){_0x5f4a91['interaction']=_0x1dc62e[_0xf97b('0x5f')]({'plain':!![]});interaction_log[_0xf97b('0x1e')](_0xf97b('0x64'),_0x42a0ac[_0xf97b('0x5e')]['id'],_0x42a0ac[_0xf97b('0x5e')][_0xf97b('0x34')],_0x42a0ac['user'][_0xf97b('0x65')],_0x5f4a91[_0xf97b('0x66')]['id'],_0x42a0ac[_0xf97b('0x55')]?JSON['stringify'](_0x42a0ac[_0xf97b('0x55')]):_0xf97b('0x67'));return respondWithRpcPromise(_0xf97b('0x68'),_0xf97b('0x69'),_0x5f4a91);}return null;})['then'](function(_0x3fe446){var _0x9ec506=_0xf97b('0x6a')+_0x3fe446['message'][_0xf97b('0x6b')];return db[_0xf97b('0x6c')]['query'](_0x9ec506,{'type':db[_0xf97b('0x6d')][_0xf97b('0x6e')][_0xf97b('0x6f')],'raw':!![]})[_0xf97b('0x1d')](function(_0x5accf4){return _0x5accf4;});})[_0xf97b('0x1d')](function(_0x33da90){if(_0x33da90){_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x70')]=_0x33da90[0x0];if(!_0x42a0ac[_0xf97b('0x55')]['UserId'])return;return db[_0xf97b('0x71')][_0xf97b('0x53')]({'where':{'id':_0x42a0ac[_0xf97b('0x55')]['UserId'],'role':_0xf97b('0x72')},'attributes':['id',_0xf97b('0x34'),_0xf97b('0x73'),_0xf97b('0x74'),_0xf97b('0x75')],'raw':!![]});}return null;})[_0xf97b('0x1d')](function(_0x38ba5c){if(!_0x38ba5c)return null;_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x72')]=_0x38ba5c;return _0x5f4a91;})['then'](function(_0x5c0b07){if(_0x5c0b07){if(_0x42a0ac[_0xf97b('0x55')][_0xf97b('0x76')]){_0x5f4a91[_0xf97b('0x25')]['interface']=util[_0xf97b('0x63')](_0xf97b('0x77'),_0x42a0ac[_0xf97b('0x5e')][_0xf97b('0x34')]);_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x78')]=_0x5f4a91['channel'];_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x79')]=_0x5f4a91[_0xf97b('0x78')];_0x5f4a91[_0xf97b('0x25')][_0xf97b('0x7a')]=_0xf97b('0x59');return respondWithRpcPromise(_0xf97b('0x7b'),'EventManager',{'event':_0xf97b('0x7c'),'message':_['merge'](_0x5f4a91[_0xf97b('0x25')],JSON['parse'](_0x5f4a91[_0xf97b('0x66')]['formData']))},client9002)[_0xf97b('0x1d')](function(){return _0x5f4a91;});}return _0x5f4a91;}return null;})[_0xf97b('0x1d')](respondWithResult(_0x3fb3b1,null))[_0xf97b('0x27')](handleError(_0x3fb3b1,null));};var interaction_log=require(_0xf97b('0x13'))('chat-interactions');exports['reject']=function(_0x271dea,_0x1ca243,_0x5badf8){var _0x408611={'agent':{},'channel':'chat'};if(_0x271dea['body']['id']){delete _0x271dea['body']['id'];}_0x271dea[_0xf97b('0x55')][_0xf97b('0x5d')]=_0x271dea[_0xf97b('0x55')][_0xf97b('0x5d')]||_0x271dea[_0xf97b('0x5e')]['id'];_0x408611[_0xf97b('0x72')]['id']=_0x271dea['body'][_0xf97b('0x5d')];return db['ChatMessage'][_0xf97b('0x53')]({'where':{'id':_0x271dea[_0xf97b('0x4f')]['id'],'UserId':null}})[_0xf97b('0x1d')](handleEntityNotFound(_0x1ca243,null))[_0xf97b('0x1d')](function(_0x17446d){if(_0x17446d){_0x408611[_0xf97b('0x25')]=_0x17446d['get']({'plain':!![]});return db[_0xf97b('0x60')][_0xf97b('0x53')]({'where':{'id':_0x17446d[_0xf97b('0x61')]}});}return null;})[_0xf97b('0x1d')](handleEntityNotFound(_0x1ca243,null))[_0xf97b('0x1d')](function(_0x349b76){if(_0x349b76){_0x408611['interaction']=_0x349b76['get']({'plain':!![]});interaction_log[_0xf97b('0x1e')](_0xf97b('0x7d'),_0x271dea['user']['id'],_0x271dea[_0xf97b('0x5e')]['name'],_0x271dea[_0xf97b('0x5e')][_0xf97b('0x65')],_0x408611[_0xf97b('0x66')]['id'],_0x271dea['body']?JSON['stringify'](_0x271dea[_0xf97b('0x55')]):_0xf97b('0x67'));return respondWithRpcPromise('RejectMessage',_0xf97b('0x7e'),_0x408611);}return null;})[_0xf97b('0x1d')](function(_0x794155){var _0x1ba7f5=_0xf97b('0x6a')+_0x794155['message'][_0xf97b('0x6b')];return db['sequelize'][_0xf97b('0x3d')](_0x1ba7f5,{'type':db['Sequelize'][_0xf97b('0x6e')][_0xf97b('0x6f')],'raw':!![]})[_0xf97b('0x1d')](function(_0x2f521d){return _0x2f521d;});})[_0xf97b('0x1d')](function(_0x30e704){if(_0x30e704){_0x408611['message'][_0xf97b('0x70')]=_0x30e704[0x0];if(!_0x271dea[_0xf97b('0x55')][_0xf97b('0x5d')])return;return db[_0xf97b('0x71')][_0xf97b('0x53')]({'where':{'id':_0x271dea['body'][_0xf97b('0x5d')],'role':_0xf97b('0x72')},'attributes':['id',_0xf97b('0x34'),_0xf97b('0x73'),'email','internal'],'raw':!![]});}return null;})[_0xf97b('0x1d')](function(_0x226a27){if(!_0x226a27)return null;_0x408611[_0xf97b('0x25')][_0xf97b('0x72')]=_0x226a27;return _0x408611;})[_0xf97b('0x1d')](function(_0x40adad){if(_0x40adad){_0x40adad[_0xf97b('0x25')][_0xf97b('0x7f')]=util[_0xf97b('0x63')](_0xf97b('0x77'),_0x271dea['user'][_0xf97b('0x34')]);_0x40adad['message'][_0xf97b('0x78')]=_0x408611[_0xf97b('0x78')];_0x40adad[_0xf97b('0x25')]['motionChannel']=_0x408611['channel'];_0x40adad[_0xf97b('0x25')][_0xf97b('0x7a')]=_0xf97b('0x80');respondWithRpcPromise(_0xf97b('0x7b'),'EventManager',{'event':'rejectmessage','message':_[_0xf97b('0x4a')](_0x408611[_0xf97b('0x25')],JSON['parse'](_0x408611[_0xf97b('0x66')][_0xf97b('0x81')]))},client9002);return _0x408611;}return null;})[_0xf97b('0x1d')](respondWithResult(_0x1ca243,null))[_0xf97b('0x27')](handleError(_0x1ca243,null));};
\ No newline at end of file
+var _0x249b=['catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','send','map','ChatMessage','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','body','update','chat-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','User','find','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','reject','chat','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','agent','motionChannel','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0xf1a6d4,_0x222433){var _0x4c349e=function(_0x27f296){while(--_0x27f296){_0xf1a6d4['push'](_0xf1a6d4['shift']());}};_0x4c349e(++_0x222433);}(_0x249b,0x16a));var _0xb249=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x249b[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xb249('0x0'));var rimraf=require(_0xb249('0x1'));var zipdir=require(_0xb249('0x2'));var jsonpatch=require(_0xb249('0x3'));var rp=require(_0xb249('0x4'));var moment=require(_0xb249('0x5'));var BPromise=require(_0xb249('0x6'));var Mustache=require(_0xb249('0x7'));var util=require(_0xb249('0x8'));var path=require('path');var sox=require(_0xb249('0x9'));var csv=require(_0xb249('0xa'));var ejs=require(_0xb249('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb249('0xc'));var squel=require(_0xb249('0xd'));var crypto=require(_0xb249('0xe'));var jsforce=require(_0xb249('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb249('0xa'));var querystring=require(_0xb249('0x10'));var Papa=require(_0xb249('0x11'));var Redis=require(_0xb249('0x12'));var authService=require(_0xb249('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb249('0x14'));var hardwareService=require(_0xb249('0x15'));var logger=require(_0xb249('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb249('0x17'));var db=require(_0xb249('0x18'))['db'];config['redis']=_[_0xb249('0x19')](config[_0xb249('0x1a')],{'host':_0xb249('0x1b'),'port':0x18eb});var socket=require(_0xb249('0x1c'))(new Redis(config[_0xb249('0x1a')]));require(_0xb249('0x1d'))['register'](socket);var jayson=require(_0xb249('0x1e'));var client=jayson[_0xb249('0x1f')][_0xb249('0x20')]({'port':0x232c});var client9002=jayson[_0xb249('0x1f')][_0xb249('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3e1576,_0xa46493,_0x494598,_0xbe227c){return new BPromise(function(_0x4d6a85,_0x447f31){var _0x187541=_0xbe227c||client;return _0x187541['request'](_0x3e1576,_0x494598)['then'](function(_0x22413e){logger[_0xb249('0x21')](_0xb249('0x22'),_0xa46493,_0xb249('0x23'));logger[_0xb249('0x24')](_0xb249('0x25'),_0xa46493,_0xb249('0x23'),JSON[_0xb249('0x26')](_0x22413e));if(_0x22413e['error']){if(_0x22413e['error'][_0xb249('0x27')]===0x1f4){logger[_0xb249('0x28')](_0xb249('0x22'),_0xa46493,_0x22413e[_0xb249('0x28')][_0xb249('0x29')]);return _0x447f31(_0x22413e[_0xb249('0x28')][_0xb249('0x29')]);}logger[_0xb249('0x28')]('ChatMessage,\x20%s,\x20%s',_0xa46493,_0x22413e[_0xb249('0x28')][_0xb249('0x29')]);return _0x4d6a85(_0x22413e['error'][_0xb249('0x29')]);}else{logger[_0xb249('0x21')](_0xb249('0x22'),_0xa46493,_0xb249('0x23'));_0x4d6a85(_0x22413e[_0xb249('0x2a')][_0xb249('0x29')]);}})[_0xb249('0x2b')](function(_0x4ad345){logger[_0xb249('0x28')](_0xb249('0x22'),_0xa46493,_0x4ad345);_0x447f31(_0x4ad345);});});}function respondWithStatusCode(_0x5499ee,_0x228eed){_0x228eed=_0x228eed||0xcc;return function(_0x3b8c22){if(_0x3b8c22){return _0x5499ee[_0xb249('0x2c')](_0x228eed);}return _0x5499ee[_0xb249('0x2d')](_0x228eed)[_0xb249('0x2e')]();};}function respondWithResult(_0x3c71e2,_0x5c1383){_0x5c1383=_0x5c1383||0xc8;return function(_0x42be94){if(_0x42be94){return _0x3c71e2[_0xb249('0x2d')](_0x5c1383)[_0xb249('0x2f')](_0x42be94);}};}function respondWithFilteredResult(_0x36e22c,_0x473d5d){return function(_0x3f7590){if(_0x3f7590){var _0x2756ad=typeof _0x473d5d[_0xb249('0x30')]===_0xb249('0x31')&&typeof _0x473d5d[_0xb249('0x32')]===_0xb249('0x31');var _0x12761a=_0x3f7590[_0xb249('0x33')];var _0x451c23=_0x2756ad?0x0:_0x473d5d[_0xb249('0x30')];var _0x246b06=_0x2756ad?_0x3f7590[_0xb249('0x33')]:_0x473d5d['offset']+_0x473d5d['limit'];var _0x2987de;if(_0x246b06>=_0x12761a){_0x246b06=_0x12761a;_0x2987de=0xc8;}else{_0x2987de=0xce;}_0x36e22c[_0xb249('0x2d')](_0x2987de);return _0x36e22c[_0xb249('0x34')](_0xb249('0x35'),_0x451c23+'-'+_0x246b06+'/'+_0x12761a)[_0xb249('0x2f')](_0x3f7590);}return null;};}function patchUpdates(_0x51e7ad){return function(_0x56edf0){try{jsonpatch['apply'](_0x56edf0,_0x51e7ad,!![]);}catch(_0x8220e2){return BPromise['reject'](_0x8220e2);}return _0x56edf0[_0xb249('0x36')]();};}function saveUpdates(_0x5eacad,_0x4fd82d){return function(_0x4c173e){if(_0x4c173e){return _0x4c173e['update'](_0x5eacad)[_0xb249('0x37')](function(_0x243fd1){return _0x243fd1;});}return null;};}function removeEntity(_0x563064,_0x10a5cd){return function(_0x135005){if(_0x135005){return _0x135005[_0xb249('0x38')]()['then'](function(){_0x563064[_0xb249('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41bdd8,_0x3edd0d){return function(_0xf29a4a){if(!_0xf29a4a){_0x41bdd8[_0xb249('0x2c')](0x194);}return _0xf29a4a;};}function handleError(_0x52b42c,_0x26a8de){_0x26a8de=_0x26a8de||0x1f4;return function(_0xa5a223){logger['error'](_0xa5a223[_0xb249('0x39')]);if(_0xa5a223['name']){delete _0xa5a223[_0xb249('0x3a')];}_0x52b42c[_0xb249('0x2d')](_0x26a8de)[_0xb249('0x3b')](_0xa5a223);};}exports['index']=function(_0x55fd08,_0x8eeba3){var _0x277125={},_0x2fd635={},_0x3f0110={'count':0x0,'rows':[]};var _0x4838b6=_[_0xb249('0x3c')](db[_0xb249('0x3d')]['rawAttributes'],function(_0x35fd40){return{'name':_0x35fd40[_0xb249('0x3e')],'type':_0x35fd40[_0xb249('0x3f')]['key']};});_0x2fd635[_0xb249('0x40')]=_[_0xb249('0x3c')](_0x4838b6,'name');_0x2fd635['query']=_['keys'](_0x55fd08[_0xb249('0x41')]);_0x2fd635['filters']=_[_0xb249('0x42')](_0x2fd635[_0xb249('0x40')],_0x2fd635[_0xb249('0x41')]);_0x277125[_0xb249('0x43')]=_['intersection'](_0x2fd635[_0xb249('0x40')],qs[_0xb249('0x44')](_0x55fd08[_0xb249('0x41')][_0xb249('0x44')]));_0x277125[_0xb249('0x43')]=_0x277125[_0xb249('0x43')][_0xb249('0x45')]?_0x277125['attributes']:_0x2fd635[_0xb249('0x40')];if(!_0x55fd08[_0xb249('0x41')]['hasOwnProperty'](_0xb249('0x46'))){_0x277125[_0xb249('0x32')]=qs['limit'](_0x55fd08['query'][_0xb249('0x32')]);_0x277125['offset']=qs[_0xb249('0x30')](_0x55fd08[_0xb249('0x41')][_0xb249('0x30')]);}_0x277125['order']=qs[_0xb249('0x47')](_0x55fd08[_0xb249('0x41')][_0xb249('0x47')]);_0x277125['where']=qs[_0xb249('0x48')](_[_0xb249('0x49')](_0x55fd08['query'],_0x2fd635['filters']),_0x4838b6);if(_0x55fd08['query'][_0xb249('0x4a')]){_0x277125[_0xb249('0x4b')]=_['merge'](_0x277125[_0xb249('0x4b')],{'$or':_[_0xb249('0x3c')](_0x4838b6,function(_0x22681e){if(_0x22681e[_0xb249('0x3f')]!==_0xb249('0x4c')){var _0x2e303c={};_0x2e303c[_0x22681e['name']]={'$like':'%'+_0x55fd08[_0xb249('0x41')][_0xb249('0x4a')]+'%'};return _0x2e303c;}})});}_0x277125=_[_0xb249('0x4d')]({},_0x277125,_0x55fd08['options']);var _0x14906d={'where':_0x277125['where']};return db[_0xb249('0x3d')][_0xb249('0x33')](_0x14906d)[_0xb249('0x37')](function(_0x1ae336){_0x3f0110['count']=_0x1ae336;if(_0x55fd08['query'][_0xb249('0x4e')]){_0x277125[_0xb249('0x4f')]=[{'all':!![]}];}return db[_0xb249('0x3d')][_0xb249('0x50')](_0x277125);})['then'](function(_0x43341a){_0x3f0110[_0xb249('0x51')]=_0x43341a;return _0x3f0110;})[_0xb249('0x37')](respondWithFilteredResult(_0x8eeba3,_0x277125))['catch'](handleError(_0x8eeba3,null));};exports[_0xb249('0x52')]=function(_0x3b1b8f,_0x336069){var _0xdab56={'raw':!![],'where':{'id':_0x3b1b8f[_0xb249('0x53')]['id']}},_0x2cfbfa={};_0x2cfbfa[_0xb249('0x40')]=_[_0xb249('0x54')](db[_0xb249('0x3d')][_0xb249('0x55')]);_0x2cfbfa['query']=_[_0xb249('0x54')](_0x3b1b8f['query']);_0x2cfbfa['filters']=_[_0xb249('0x42')](_0x2cfbfa[_0xb249('0x40')],_0x2cfbfa['query']);_0xdab56['attributes']=_[_0xb249('0x42')](_0x2cfbfa[_0xb249('0x40')],qs[_0xb249('0x44')](_0x3b1b8f[_0xb249('0x41')]['fields']));_0xdab56[_0xb249('0x43')]=_0xdab56[_0xb249('0x43')]['length']?_0xdab56[_0xb249('0x43')]:_0x2cfbfa[_0xb249('0x40')];if(_0x3b1b8f[_0xb249('0x41')][_0xb249('0x4e')]){_0xdab56[_0xb249('0x4f')]=[{'all':!![]}];}_0xdab56=_['merge']({},_0xdab56,_0x3b1b8f[_0xb249('0x56')]);return db[_0xb249('0x3d')]['find'](_0xdab56)[_0xb249('0x37')](handleEntityNotFound(_0x336069,null))[_0xb249('0x37')](respondWithResult(_0x336069,null))[_0xb249('0x2b')](handleError(_0x336069,null));};exports['create']=function(_0x342757,_0x4e0b95){return db['ChatMessage']['create'](_0x342757[_0xb249('0x57')],{})[_0xb249('0x37')](respondWithResult(_0x4e0b95,0xc9))['catch'](handleError(_0x4e0b95,null));};exports[_0xb249('0x58')]=function(_0x228183,_0x2d6352){if(_0x228183[_0xb249('0x57')]['id']){delete _0x228183[_0xb249('0x57')]['id'];}return db[_0xb249('0x3d')]['find']({'where':{'id':_0x228183['params']['id']}})[_0xb249('0x37')](handleEntityNotFound(_0x2d6352,null))['then'](saveUpdates(_0x228183[_0xb249('0x57')],null))['then'](respondWithResult(_0x2d6352,null))[_0xb249('0x2b')](handleError(_0x2d6352,null));};exports[_0xb249('0x38')]=function(_0xa60dd3,_0x103a0c){return db[_0xb249('0x3d')]['find']({'where':{'id':_0xa60dd3[_0xb249('0x53')]['id']}})['then'](handleEntityNotFound(_0x103a0c,null))['then'](removeEntity(_0x103a0c,null))[_0xb249('0x2b')](handleError(_0x103a0c,null));};exports['describe']=function(_0x24a11c,_0x5dc39a){return db[_0xb249('0x3d')]['describe']()[_0xb249('0x37')](respondWithResult(_0x5dc39a,null))['catch'](handleError(_0x5dc39a,null));};var interaction_log=require(_0xb249('0x16'))(_0xb249('0x59'));exports[_0xb249('0x5a')]=function(_0x19bd94,_0x57b6da,_0x2e3ff7){var _0x41497f={'agent':{},'channel':'chat'};if(_0x19bd94[_0xb249('0x57')]['id']){delete _0x19bd94['body']['id'];}_0x19bd94['body'][_0xb249('0x5b')]=!![];_0x19bd94[_0xb249('0x57')][_0xb249('0x5c')]=moment()[_0xb249('0x5d')](_0xb249('0x5e'));_0x19bd94[_0xb249('0x57')][_0xb249('0x5f')]=_0x19bd94[_0xb249('0x57')]['UserId']||_0x19bd94['user']['id'];_0x41497f['agent']['id']=_0x19bd94[_0xb249('0x57')][_0xb249('0x5f')];return db[_0xb249('0x3d')]['find']({'where':{'id':_0x19bd94['params']['id'],'UserId':null}})[_0xb249('0x37')](handleEntityNotFound(_0x57b6da,null))['then'](saveUpdates(_0x19bd94[_0xb249('0x57')],null))['then'](function(_0x5f0eb7){if(_0x5f0eb7){_0x41497f[_0xb249('0x29')]=_0x5f0eb7[_0xb249('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5f0eb7[_0xb249('0x61')]}});}return null;})[_0xb249('0x37')](handleEntityNotFound(_0x57b6da,null))['then'](function(_0x47a68d){if(_0x47a68d){return _0x47a68d['update']({'UserId':_0x19bd94[_0xb249('0x57')][_0xb249('0x5f')],'read1stAt':_[_0xb249('0x62')](_0x47a68d[_0xb249('0x63')])?moment()[_0xb249('0x5d')](_0xb249('0x5e')):undefined});}return null;})[_0xb249('0x37')](function(_0x4f2010){if(_0x4f2010){_0x41497f[_0xb249('0x64')]=_0x4f2010[_0xb249('0x60')]({'plain':!![]});interaction_log['info'](_0xb249('0x65'),_0x19bd94[_0xb249('0x66')]['id'],_0x19bd94['user'][_0xb249('0x3a')],_0x19bd94[_0xb249('0x66')]['role'],_0x41497f[_0xb249('0x64')]['id'],_0x19bd94['body']?JSON[_0xb249('0x26')](_0x19bd94['body']):_0xb249('0x67'));return respondWithRpcPromise(_0xb249('0x68'),_0xb249('0x69'),_0x41497f);}return null;})[_0xb249('0x37')](function(_0x586fe8){var _0x3758df='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x586fe8[_0xb249('0x29')][_0xb249('0x6a')];return db[_0xb249('0x6b')][_0xb249('0x41')](_0x3758df,{'type':db[_0xb249('0x6c')]['QueryTypes'][_0xb249('0x6d')],'raw':!![]})['then'](function(_0x56598e){return _0x56598e;});})[_0xb249('0x37')](function(_0x2be177){if(_0x2be177){_0x41497f[_0xb249('0x29')]['contact']=_0x2be177[0x0];if(!_0x19bd94['body'][_0xb249('0x5f')])return;return db[_0xb249('0x6e')][_0xb249('0x6f')]({'where':{'id':_0x19bd94['body'][_0xb249('0x5f')],'role':'agent'},'attributes':['id',_0xb249('0x3a'),_0xb249('0x70'),_0xb249('0x71'),_0xb249('0x72')],'raw':!![]});}return null;})[_0xb249('0x37')](function(_0xe91340){if(!_0xe91340)return null;_0x41497f[_0xb249('0x29')]['agent']=_0xe91340;return _0x41497f;})[_0xb249('0x37')](function(_0x19cf00){if(_0x19cf00){if(_0x19bd94['body']['manual']){_0x41497f[_0xb249('0x29')][_0xb249('0x73')]=util[_0xb249('0x5d')](_0xb249('0x74'),_0x19bd94[_0xb249('0x66')][_0xb249('0x3a')]);_0x41497f[_0xb249('0x29')][_0xb249('0x75')]=_0x41497f['channel'];_0x41497f[_0xb249('0x29')]['motionChannel']=_0x41497f['channel'];_0x41497f[_0xb249('0x29')][_0xb249('0x76')]=_0xb249('0x5a');return respondWithRpcPromise(_0xb249('0x77'),_0xb249('0x77'),{'event':_0xb249('0x78'),'message':_['merge'](_0x41497f[_0xb249('0x29')],JSON[_0xb249('0x79')](_0x41497f[_0xb249('0x64')]['formData']))},client9002)['then'](function(){return _0x41497f;});}return _0x41497f;}return null;})[_0xb249('0x37')](respondWithResult(_0x57b6da,null))[_0xb249('0x2b')](handleError(_0x57b6da,null));};var interaction_log=require(_0xb249('0x16'))(_0xb249('0x59'));exports[_0xb249('0x7a')]=function(_0x3c58a6,_0x29c2ef,_0x1874e0){var _0x4f8486={'agent':{},'channel':_0xb249('0x7b')};if(_0x3c58a6['body']['id']){delete _0x3c58a6[_0xb249('0x57')]['id'];}_0x3c58a6[_0xb249('0x57')]['UserId']=_0x3c58a6[_0xb249('0x57')]['UserId']||_0x3c58a6[_0xb249('0x66')]['id'];_0x4f8486['agent']['id']=_0x3c58a6[_0xb249('0x57')][_0xb249('0x5f')];return db[_0xb249('0x3d')][_0xb249('0x6f')]({'where':{'id':_0x3c58a6[_0xb249('0x53')]['id'],'UserId':null}})[_0xb249('0x37')](handleEntityNotFound(_0x29c2ef,null))['then'](function(_0x2ad921){if(_0x2ad921){_0x4f8486['message']=_0x2ad921[_0xb249('0x60')]({'plain':!![]});return db[_0xb249('0x7c')][_0xb249('0x6f')]({'where':{'id':_0x2ad921[_0xb249('0x61')]}});}return null;})[_0xb249('0x37')](handleEntityNotFound(_0x29c2ef,null))[_0xb249('0x37')](function(_0x4a0ab2){if(_0x4a0ab2){_0x4f8486[_0xb249('0x64')]=_0x4a0ab2[_0xb249('0x60')]({'plain':!![]});interaction_log[_0xb249('0x21')](_0xb249('0x7d'),_0x3c58a6[_0xb249('0x66')]['id'],_0x3c58a6[_0xb249('0x66')]['name'],_0x3c58a6[_0xb249('0x66')][_0xb249('0x7e')],_0x4f8486[_0xb249('0x64')]['id'],_0x3c58a6[_0xb249('0x57')]?JSON[_0xb249('0x26')](_0x3c58a6[_0xb249('0x57')]):'null');return respondWithRpcPromise(_0xb249('0x7f'),_0xb249('0x80'),_0x4f8486);}return null;})[_0xb249('0x37')](function(_0xa9fa20){var _0x2d1dd1=_0xb249('0x81')+_0xa9fa20['message']['ContactId'];return db[_0xb249('0x6b')][_0xb249('0x41')](_0x2d1dd1,{'type':db[_0xb249('0x6c')][_0xb249('0x82')]['SELECT'],'raw':!![]})['then'](function(_0x54965b){return _0x54965b;});})[_0xb249('0x37')](function(_0x4a2507){if(_0x4a2507){_0x4f8486[_0xb249('0x29')]['contact']=_0x4a2507[0x0];if(!_0x3c58a6[_0xb249('0x57')][_0xb249('0x5f')])return;return db[_0xb249('0x6e')][_0xb249('0x6f')]({'where':{'id':_0x3c58a6[_0xb249('0x57')][_0xb249('0x5f')],'role':_0xb249('0x83')},'attributes':['id',_0xb249('0x3a'),_0xb249('0x70'),_0xb249('0x71'),_0xb249('0x72')],'raw':!![]});}return null;})[_0xb249('0x37')](function(_0x18c793){if(!_0x18c793)return null;_0x4f8486[_0xb249('0x29')][_0xb249('0x83')]=_0x18c793;return _0x4f8486;})[_0xb249('0x37')](function(_0x55a0fe){if(_0x55a0fe){_0x55a0fe[_0xb249('0x29')][_0xb249('0x73')]=util[_0xb249('0x5d')]('SIP/%s',_0x3c58a6[_0xb249('0x66')][_0xb249('0x3a')]);_0x55a0fe[_0xb249('0x29')]['channel']=_0x4f8486[_0xb249('0x75')];_0x55a0fe[_0xb249('0x29')][_0xb249('0x84')]=_0x4f8486['channel'];_0x55a0fe[_0xb249('0x29')][_0xb249('0x76')]=_0xb249('0x7a');respondWithRpcPromise(_0xb249('0x77'),_0xb249('0x77'),{'event':_0xb249('0x85'),'message':_['merge'](_0x4f8486[_0xb249('0x29')],JSON['parse'](_0x4f8486['interaction'][_0xb249('0x86')]))},client9002);return _0x4f8486;}return null;})[_0xb249('0x37')](respondWithResult(_0x29c2ef,null))[_0xb249('0x2b')](handleError(_0x29c2ef,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 13a4796..79a8d48 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 _0xda7a=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','ChatMessage'];(function(_0x22377a,_0x3397cb){var _0x36f105=function(_0x2174cc){while(--_0x2174cc){_0x22377a['push'](_0x22377a['shift']());}};_0x36f105(++_0x3397cb);}(_0xda7a,0x135));var _0xada7=function(_0x22c2b2,_0x42719b){_0x22c2b2=_0x22c2b2-0x0;var _0x2efc42=_0xda7a[_0x22c2b2];return _0x2efc42;};'use strict';var EventEmitter=require(_0xada7('0x0'));var ChatMessage=require(_0xada7('0x1'))['db'][_0xada7('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xada7('0x3'),'afterUpdate':_0xada7('0x4'),'afterDestroy':_0xada7('0x5')};function emitEvent(_0x281e33){return function(_0x485a29,_0x217aeb,_0x3e27d0){ChatMessageEvents[_0xada7('0x6')](_0x281e33+':'+_0x485a29['id'],_0x485a29);ChatMessageEvents[_0xada7('0x6')](_0x281e33,_0x485a29);_0x3e27d0(null);};}for(var e in events){if(events[_0xada7('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xd953=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0xd953,0xc3));var _0x3d95=function(_0xd64c37,_0x2708df){_0xd64c37=_0xd64c37-0x0;var _0xa0d6d0=_0xd953[_0xd64c37];return _0xa0d6d0;};'use strict';var EventEmitter=require(_0x3d95('0x0'));var ChatMessage=require(_0x3d95('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3d95('0x2')](0x0);var events={'afterCreate':_0x3d95('0x3'),'afterUpdate':_0x3d95('0x4'),'afterDestroy':_0x3d95('0x5')};function emitEvent(_0x4ef320){return function(_0x217479,_0x36fb42,_0x4b85de){ChatMessageEvents[_0x3d95('0x6')](_0x4ef320+':'+_0x217479['id'],_0x217479);ChatMessageEvents[_0x3d95('0x6')](_0x4ef320,_0x217479);_0x4b85de(null);};}for(var e in events){if(events[_0x3d95('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3d95('0x8')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index ec89898..c9f553c 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 _0x0caf=['createdAt','catch','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then','update'];(function(_0xa86c3b,_0x479335){var _0x583a75=function(_0x3ce1a8){while(--_0x3ce1a8){_0xa86c3b['push'](_0xa86c3b['shift']());}};_0x583a75(++_0x479335);}(_0x0caf,0x8a));var _0xf0ca=function(_0x52c633,_0x2009dc){_0x52c633=_0x52c633-0x0;var _0x343f90=_0x0caf[_0x52c633];return _0x343f90;};'use strict';var _=require(_0xf0ca('0x0'));var util=require(_0xf0ca('0x1'));var logger=require('../../config/logger')(_0xf0ca('0x2'));var moment=require(_0xf0ca('0x3'));var BPromise=require('bluebird');var rp=require(_0xf0ca('0x4'));var fs=require('fs');var path=require(_0xf0ca('0x5'));var rimraf=require('rimraf');var config=require(_0xf0ca('0x6'));var attributes=require(_0xf0ca('0x7'));module['exports']=function(_0x23cd65,_0x511813){return _0x23cd65[_0xf0ca('0x8')]('ChatMessage',attributes,{'tableName':_0xf0ca('0x9'),'paranoid':![],'indexes':[{'name':_0xf0ca('0xa'),'fields':[_0xf0ca('0xb')],'type':_0xf0ca('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xba41f5,_0x99f251,_0x33b4e9){var _0x42cd5f=_0x23cd65[_0xf0ca('0xd')];var _0x8fbca1=_0xba41f5[_0xf0ca('0xe')]({'plain':!![]});if(_0x8fbca1[_0xf0ca('0xf')][_0xf0ca('0x10')]()==='in'||_0x8fbca1[_0xf0ca('0xf')][_0xf0ca('0x10')]()===_0xf0ca('0x11')&&!_0x8fbca1[_0xf0ca('0x12')]&&!_[_0xf0ca('0x13')](_0x8fbca1[_0xf0ca('0x14')])){_0x42cd5f['ChatInteraction']['findOne']({'where':{'id':_0x8fbca1[_0xf0ca('0x15')]}})[_0xf0ca('0x16')](function(_0x4945f8){if(_0x4945f8){_0x4945f8[_0xf0ca('0x17')]({'lastMsgAt':_0x8fbca1[_0xf0ca('0x18')],'lastMsgDirection':_0x8fbca1['direction']['toLowerCase']()});}})[_0xf0ca('0x19')](function(_0x212a85){console['error'](_0x212a85);});}_0x33b4e9();}},'charset':'utf8mb4','collate':_0xf0ca('0x1a')});};
\ No newline at end of file
+var _0xd6d9=['../../config/environment','exports','define','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','error','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd6d9,0x16a));var _0x9d6d=function(_0x2c4494,_0x308a9f){_0x2c4494=_0x2c4494-0x0;var _0x367ef7=_0xd6d9[_0x2c4494];return _0x367ef7;};'use strict';var _=require('lodash');var util=require(_0x9d6d('0x0'));var logger=require(_0x9d6d('0x1'))('api');var moment=require(_0x9d6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x9d6d('0x3'));var fs=require('fs');var path=require(_0x9d6d('0x4'));var rimraf=require(_0x9d6d('0x5'));var config=require(_0x9d6d('0x6'));var attributes=require('./chatMessage.attributes');module[_0x9d6d('0x7')]=function(_0x40a14a,_0x298e50){return _0x40a14a[_0x9d6d('0x8')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9d6d('0x9'),'fields':[_0x9d6d('0xa')],'type':_0x9d6d('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xcba81b,_0x519c85,_0x492244){var _0x45ef98=_0x40a14a[_0x9d6d('0xc')];var _0x17485b=_0xcba81b['get']({'plain':!![]});if(_0x17485b[_0x9d6d('0xd')]['toLowerCase']()==='in'||_0x17485b['direction'][_0x9d6d('0xe')]()==='out'&&!_0x17485b[_0x9d6d('0xf')]&&!_[_0x9d6d('0x10')](_0x17485b['UserId'])){_0x45ef98[_0x9d6d('0x11')][_0x9d6d('0x12')]({'where':{'id':_0x17485b[_0x9d6d('0x13')]}})[_0x9d6d('0x14')](function(_0x61b81e){if(_0x61b81e){_0x61b81e[_0x9d6d('0x15')]({'lastMsgAt':_0x17485b['createdAt'],'lastMsgDirection':_0x17485b[_0x9d6d('0xd')][_0x9d6d('0xe')]()});}})['catch'](function(_0x3c472d){console[_0x9d6d('0x16')](_0x3c472d);});}_0x492244();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6ed3053..1fa393e 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 _0x5b29=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','ChatMessage','create','body','options','raw','then','CreateChatMessage','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./chatMessage.socket','request','info'];(function(_0x1dc24d,_0x541fa4){var _0x5d7fb2=function(_0x7ccd26){while(--_0x7ccd26){_0x1dc24d['push'](_0x1dc24d['shift']());}};_0x5d7fb2(++_0x541fa4);}(_0x5b29,0xbd));var _0x95b2=function(_0x5a95c8,_0x4c8601){_0x5a95c8=_0x5a95c8-0x0;var _0x359442=_0x5b29[_0x5a95c8];return _0x359442;};'use strict';var _=require(_0x95b2('0x0'));var util=require(_0x95b2('0x1'));var moment=require(_0x95b2('0x2'));var BPromise=require('bluebird');var rs=require(_0x95b2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95b2('0x4'));var logger=require(_0x95b2('0x5'))(_0x95b2('0x6'));var config=require(_0x95b2('0x7'));var jayson=require(_0x95b2('0x8'));var client=jayson['client'][_0x95b2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x95b2('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x95b2('0xa')]));require(_0x95b2('0xb'))['register'](socket);function respondWithRpcPromise(_0x3eebda,_0x3659c4,_0x25fe8e){return new BPromise(function(_0x4d45ae,_0x352fc8){return client[_0x95b2('0xc')](_0x3eebda,_0x25fe8e)['then'](function(_0x37c439){logger[_0x95b2('0xd')](_0x95b2('0xe'),_0x3659c4,_0x95b2('0xf'));logger[_0x95b2('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3659c4,_0x95b2('0xf'),JSON[_0x95b2('0x11')](_0x37c439));if(_0x37c439[_0x95b2('0x12')]){if(_0x37c439[_0x95b2('0x12')]['code']===0x1f4){logger[_0x95b2('0x12')](_0x95b2('0xe'),_0x3659c4,_0x37c439['error'][_0x95b2('0x13')]);return _0x352fc8(_0x37c439[_0x95b2('0x12')][_0x95b2('0x13')]);}logger[_0x95b2('0x12')](_0x95b2('0xe'),_0x3659c4,_0x37c439[_0x95b2('0x12')][_0x95b2('0x13')]);return _0x4d45ae(_0x37c439[_0x95b2('0x12')]['message']);}else{logger[_0x95b2('0xd')](_0x95b2('0xe'),_0x3659c4,'request\x20sent');_0x4d45ae(_0x37c439[_0x95b2('0x14')][_0x95b2('0x13')]);}})['catch'](function(_0x241124){logger[_0x95b2('0x12')](_0x95b2('0xe'),_0x3659c4,_0x241124);_0x352fc8(_0x241124);});});}exports['CreateChatMessage']=function(_0x4df9d9){var _0x476119=this;return new Promise(function(_0x143849,_0x50e1ee){return db[_0x95b2('0x15')][_0x95b2('0x16')](_0x4df9d9[_0x95b2('0x17')],{'raw':_0x4df9d9['options']?_0x4df9d9[_0x95b2('0x18')][_0x95b2('0x19')]===undefined?!![]:![]:!![]})[_0x95b2('0x1a')](function(_0x193ebb){logger['info'](_0x95b2('0x1b'),_0x4df9d9);logger['debug']('CreateChatMessage',_0x4df9d9,JSON[_0x95b2('0x11')](_0x193ebb));_0x143849(_0x193ebb);})[_0x95b2('0x1c')](function(_0x37e248){logger[_0x95b2('0x12')]('CreateChatMessage',_0x37e248[_0x95b2('0x13')],_0x4df9d9);_0x50e1ee(_0x476119[_0x95b2('0x12')](0x1f4,_0x37e248[_0x95b2('0x13')]));});});};
\ No newline at end of file
+var _0xa777=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x69eff8,_0x598f44){var _0x3706a5=function(_0x1ec4af){while(--_0x1ec4af){_0x69eff8['push'](_0x69eff8['shift']());}};_0x3706a5(++_0x598f44);}(_0xa777,0x102));var _0x7a77=function(_0x28dbf6,_0x2f69c7){_0x28dbf6=_0x28dbf6-0x0;var _0x1473bd=_0xa777[_0x28dbf6];return _0x1473bd;};'use strict';var _=require('lodash');var util=require(_0x7a77('0x0'));var moment=require(_0x7a77('0x1'));var BPromise=require(_0x7a77('0x2'));var rs=require(_0x7a77('0x3'));var fs=require('fs');var Redis=require(_0x7a77('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a77('0x5'));var logger=require(_0x7a77('0x6'))(_0x7a77('0x7'));var config=require(_0x7a77('0x8'));var jayson=require(_0x7a77('0x9'));var client=jayson['client'][_0x7a77('0xa')]({'port':0x232a});config[_0x7a77('0xb')]=_['defaults'](config['redis'],{'host':_0x7a77('0xc'),'port':0x18eb});var socket=require(_0x7a77('0xd'))(new Redis(config['redis']));require(_0x7a77('0xe'))[_0x7a77('0xf')](socket);function respondWithRpcPromise(_0x1065e8,_0x1acc0a,_0x453772){return new BPromise(function(_0x21b370,_0x25c1fd){return client[_0x7a77('0x10')](_0x1065e8,_0x453772)['then'](function(_0x164dad){logger[_0x7a77('0x11')](_0x7a77('0x12'),_0x1acc0a,_0x7a77('0x13'));logger[_0x7a77('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1acc0a,_0x7a77('0x13'),JSON['stringify'](_0x164dad));if(_0x164dad[_0x7a77('0x15')]){if(_0x164dad[_0x7a77('0x15')]['code']===0x1f4){logger[_0x7a77('0x15')](_0x7a77('0x12'),_0x1acc0a,_0x164dad['error'][_0x7a77('0x16')]);return _0x25c1fd(_0x164dad[_0x7a77('0x15')][_0x7a77('0x16')]);}logger[_0x7a77('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1acc0a,_0x164dad['error'][_0x7a77('0x16')]);return _0x21b370(_0x164dad['error']['message']);}else{logger['info'](_0x7a77('0x12'),_0x1acc0a,'request\x20sent');_0x21b370(_0x164dad[_0x7a77('0x17')]['message']);}})[_0x7a77('0x18')](function(_0x22d04b){logger[_0x7a77('0x15')]('ChatMessage,\x20%s,\x20%s',_0x1acc0a,_0x22d04b);_0x25c1fd(_0x22d04b);});});}exports[_0x7a77('0x19')]=function(_0xe5f0db){var _0x9e81f4=this;return new Promise(function(_0x104688,_0x15b568){return db[_0x7a77('0x1a')][_0x7a77('0x1b')](_0xe5f0db[_0x7a77('0x1c')],{'raw':_0xe5f0db[_0x7a77('0x1d')]?_0xe5f0db[_0x7a77('0x1d')][_0x7a77('0x1e')]===undefined?!![]:![]:!![]})[_0x7a77('0x1f')](function(_0x23be00){logger[_0x7a77('0x11')](_0x7a77('0x19'),_0xe5f0db);logger['debug']('CreateChatMessage',_0xe5f0db,JSON[_0x7a77('0x20')](_0x23be00));_0x104688(_0x23be00);})['catch'](function(_0x4f0ba0){logger[_0x7a77('0x15')](_0x7a77('0x19'),_0x4f0ba0[_0x7a77('0x16')],_0xe5f0db);_0x15b568(_0x9e81f4['error'](0x1f4,_0x4f0ba0['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 0872d7f..5b458fe 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 _0xa8eb=['length','./chatMessage.events','remove','register'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xa8eb,0x179));var _0xba8e=function(_0x5ba4cb,_0x51e545){_0x5ba4cb=_0x5ba4cb-0x0;var _0x2c72a0=_0xa8eb[_0x5ba4cb];return _0x2c72a0;};'use strict';var ChatMessageEvents=require(_0xba8e('0x0'));var events=['save',_0xba8e('0x1'),'update'];function createListener(_0xd7f19f,_0x35f485){return function(_0x3b8fee){_0x35f485['emit'](_0xd7f19f,_0x3b8fee);};}function removeListener(_0x353df2,_0x368ce6){return function(){ChatMessageEvents['removeListener'](_0x353df2,_0x368ce6);};}exports[_0xba8e('0x2')]=function(_0x57e345){for(var _0x14c3ac=0x0,_0x52a8ef=events[_0xba8e('0x3')];_0x14c3ac<_0x52a8ef;_0x14c3ac++){var _0x69ccbe=events[_0x14c3ac];var _0x4b1bd6=createListener('chatMessage:'+_0x69ccbe,_0x57e345);ChatMessageEvents['on'](_0x69ccbe,_0x4b1bd6);}};
\ No newline at end of file
+var _0x0bde=['./chatMessage.events','remove','update','emit','removeListener','register','length','chatMessage:'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatMessageEvents=require(_0xe0bd('0x0'));var events=['save',_0xe0bd('0x1'),_0xe0bd('0x2')];function createListener(_0x5644f8,_0x28d5d7){return function(_0x1bb7f7){_0x28d5d7[_0xe0bd('0x3')](_0x5644f8,_0x1bb7f7);};}function removeListener(_0x595deb,_0x95dfde){return function(){ChatMessageEvents[_0xe0bd('0x4')](_0x595deb,_0x95dfde);};}exports[_0xe0bd('0x5')]=function(_0x3a3cd2){for(var _0x37289f=0x0,_0x1c8892=events[_0xe0bd('0x6')];_0x37289f<_0x1c8892;_0x37289f++){var _0x1b75c1=events[_0x37289f];var _0xf790d6=createListener(_0xe0bd('0x7')+_0x1b75c1,_0x3a3cd2);ChatMessageEvents['on'](_0x1b75c1,_0xf790d6);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index f4bdb0b..7cddcc5 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 _0xe441=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','/:id/reject','reject','destroy','exports'];(function(_0x5986c3,_0x34354d){var _0x2c13d0=function(_0x55b9e1){while(--_0x55b9e1){_0x5986c3['push'](_0x5986c3['shift']());}};_0x2c13d0(++_0x34354d);}(_0xe441,0x10e));var _0x1e44=function(_0x83d164,_0x45875e){_0x83d164=_0x83d164-0x0;var _0x4f7b2d=_0xe441[_0x83d164];return _0x4f7b2d;};'use strict';var multer=require(_0x1e44('0x0'));var util=require(_0x1e44('0x1'));var path=require('path');var timeout=require(_0x1e44('0x2'));var express=require(_0x1e44('0x3'));var router=express['Router']();var fs_extra=require(_0x1e44('0x4'));var auth=require(_0x1e44('0x5'));var interaction=require(_0x1e44('0x6'));var config=require(_0x1e44('0x7'));var controller=require(_0x1e44('0x8'));router['get']('/',auth[_0x1e44('0x9')](),controller[_0x1e44('0xa')]);router[_0x1e44('0xb')](_0x1e44('0xc'),auth['isAuthenticated'](),controller[_0x1e44('0xd')]);router[_0x1e44('0xb')](_0x1e44('0xe'),auth[_0x1e44('0x9')](),controller[_0x1e44('0xf')]);router[_0x1e44('0x10')]('/',auth[_0x1e44('0x9')](),interaction['tracked'](_0x1e44('0x11'),_0x1e44('0x12')),controller[_0x1e44('0x13')]);router[_0x1e44('0x14')](_0x1e44('0xe'),controller[_0x1e44('0x15')]);router[_0x1e44('0x14')](_0x1e44('0x16'),auth[_0x1e44('0x9')](),controller['accept']);router['put'](_0x1e44('0x17'),auth[_0x1e44('0x9')](),controller[_0x1e44('0x18')]);router['delete'](_0x1e44('0xe'),auth[_0x1e44('0x9')](),controller[_0x1e44('0x19')]);module[_0x1e44('0x1a')]=router;
\ No newline at end of file
+var _0x3d29=['reject','delete','/:id','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3d29,0xef));var _0x93d2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x3d29[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x93d2('0x0'));var path=require('path');var timeout=require(_0x93d2('0x1'));var express=require(_0x93d2('0x2'));var router=express[_0x93d2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x93d2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x93d2('0x5'));var controller=require('./chatMessage.controller');router[_0x93d2('0x6')]('/',auth[_0x93d2('0x7')](),controller[_0x93d2('0x8')]);router[_0x93d2('0x6')](_0x93d2('0x9'),auth[_0x93d2('0x7')](),controller['describe']);router[_0x93d2('0x6')]('/:id',auth[_0x93d2('0x7')](),controller[_0x93d2('0xa')]);router[_0x93d2('0xb')]('/',auth['isAuthenticated'](),interaction[_0x93d2('0xc')](_0x93d2('0xd'),_0x93d2('0xe')),controller[_0x93d2('0xf')]);router[_0x93d2('0x10')]('/:id',controller[_0x93d2('0x11')]);router[_0x93d2('0x10')](_0x93d2('0x12'),auth[_0x93d2('0x7')](),controller[_0x93d2('0x13')]);router[_0x93d2('0x10')](_0x93d2('0x14'),auth[_0x93d2('0x7')](),controller[_0x93d2('0x15')]);router[_0x93d2('0x16')](_0x93d2('0x17'),auth[_0x93d2('0x7')](),controller[_0x93d2('0x18')]);module[_0x93d2('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 3990e92..81c15d2 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 _0x342f=['sequelize','exports','TEXT','medium'];(function(_0xdc9953,_0x337824){var _0x5d16e7=function(_0x42762d){while(--_0x42762d){_0xdc9953['push'](_0xdc9953['shift']());}};_0x5d16e7(++_0x337824);}(_0x342f,0x1d4));var _0xf342=function(_0xdda099,_0x4c4098){_0xdda099=_0xdda099-0x0;var _0x27ca5f=_0x342f[_0xdda099];return _0x27ca5f;};'use strict';var Sequelize=require(_0xf342('0x0'));module[_0xf342('0x1')]={'body':{'type':Sequelize[_0xf342('0x2')](_0xf342('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xd15f=['TEXT','medium','sequelize','exports'];(function(_0x363bde,_0x1a1d1a){var _0x26b13f=function(_0x2ca810){while(--_0x2ca810){_0x363bde['push'](_0x363bde['shift']());}};_0x26b13f(++_0x1a1d1a);}(_0xd15f,0x1ce));var _0xfd15=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xd15f[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0xfd15('0x0'));module[_0xfd15('0x1')]={'body':{'type':Sequelize[_0xfd15('0x2')](_0xfd15('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 1627afe..4a355bb 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(_0x1d327d,_0x55cc4c){var _0x44da10=function(_0x43b3b8){while(--_0x43b3b8){_0x1d327d['push'](_0x1d327d['shift']());}};_0x44da10(++_0x55cc4c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x7a54,0x106));var _0x47a5=function(_0x2f75e8,_0x510277){_0x2f75e8=_0x2f75e8-0x0;var _0x221962=_0x7a54[_0x2f75e8];return _0x221962;};'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 33f318b..29594bb 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 _0x43d0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x43d0,0x8d));var _0x043d=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x43d0[_0x43d16c];return _0x208cce;};'use strict';var _=require(_0x043d('0x0'));var util=require(_0x043d('0x1'));var logger=require(_0x043d('0x2'))(_0x043d('0x3'));var moment=require(_0x043d('0x4'));var BPromise=require(_0x043d('0x5'));var rp=require(_0x043d('0x6'));var fs=require('fs');var path=require(_0x043d('0x7'));var rimraf=require(_0x043d('0x8'));var config=require(_0x043d('0x9'));var attributes=require(_0x043d('0xa'));module[_0x043d('0xb')]=function(_0x2a7a95,_0x306ce7){return _0x2a7a95[_0x043d('0xc')]('ChatOfflineMessage',attributes,{'tableName':_0x043d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x043d('0xe'),'collate':_0x043d('0xf')});};
\ No newline at end of file
+var _0xdf1b=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatOfflineMessage','utf8mb4'];(function(_0xc28010,_0x3c9617){var _0x3e6332=function(_0x369f7c){while(--_0x369f7c){_0xc28010['push'](_0xc28010['shift']());}};_0x3e6332(++_0x3c9617);}(_0xdf1b,0x112));var _0xbdf1=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xdf1b[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require(_0xbdf1('0x0'));var logger=require(_0xbdf1('0x1'))(_0xbdf1('0x2'));var moment=require(_0xbdf1('0x3'));var BPromise=require(_0xbdf1('0x4'));var rp=require(_0xbdf1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdf1('0x6'));var config=require(_0xbdf1('0x7'));var attributes=require('./chatOfflineMessage.attributes');module[_0xbdf1('0x8')]=function(_0x241262,_0x1ff8a8){return _0x241262[_0xbdf1('0x9')](_0xbdf1('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbdf1('0xb'),'collate':_0xbdf1('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 11a2ab8..fa4869a 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 _0x7568=['request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x5db65f,_0xf89cc8){var _0x34fb4b=function(_0x7c641){while(--_0x7c641){_0x5db65f['push'](_0x5db65f['shift']());}};_0x34fb4b(++_0xf89cc8);}(_0x7568,0xd1));var _0x8756=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x7568[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0x8756('0x0'));var util=require(_0x8756('0x1'));var moment=require('moment');var BPromise=require(_0x8756('0x2'));var rs=require(_0x8756('0x3'));var fs=require('fs');var Redis=require(_0x8756('0x4'));var db=require(_0x8756('0x5'))['db'];var utils=require(_0x8756('0x6'));var logger=require(_0x8756('0x7'))(_0x8756('0x8'));var config=require(_0x8756('0x9'));var jayson=require(_0x8756('0xa'));var client=jayson[_0x8756('0xb')][_0x8756('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x23f7bf,_0xef7c4d,_0x4f92d3){return new BPromise(function(_0x2c0148,_0x6a874f){return client[_0x8756('0xd')](_0x23f7bf,_0x4f92d3)[_0x8756('0xe')](function(_0x508da5){logger['info'](_0x8756('0xf'),_0xef7c4d,_0x8756('0x10'));logger[_0x8756('0x11')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xef7c4d,'request\x20sent',JSON[_0x8756('0x12')](_0x508da5));if(_0x508da5[_0x8756('0x13')]){if(_0x508da5[_0x8756('0x13')][_0x8756('0x14')]===0x1f4){logger[_0x8756('0x13')](_0x8756('0xf'),_0xef7c4d,_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);return _0x6a874f(_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);}logger['error'](_0x8756('0xf'),_0xef7c4d,_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);return _0x2c0148(_0x508da5[_0x8756('0x13')][_0x8756('0x15')]);}else{logger[_0x8756('0x16')](_0x8756('0xf'),_0xef7c4d,'request\x20sent');_0x2c0148(_0x508da5[_0x8756('0x17')][_0x8756('0x15')]);}})[_0x8756('0x18')](function(_0x106cee){logger[_0x8756('0x13')](_0x8756('0xf'),_0xef7c4d,_0x106cee);_0x6a874f(_0x106cee);});});}
\ No newline at end of file
+var _0xd983=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0xd983,0x7d));var _0x3d98=function(_0x3f00b3,_0x3f69d8){_0x3f00b3=_0x3f00b3-0x0;var _0x19bcb5=_0xd983[_0x3f00b3];return _0x19bcb5;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var moment=require(_0x3d98('0x2'));var BPromise=require('bluebird');var rs=require(_0x3d98('0x3'));var fs=require('fs');var Redis=require(_0x3d98('0x4'));var db=require(_0x3d98('0x5'))['db'];var utils=require(_0x3d98('0x6'));var logger=require(_0x3d98('0x7'))(_0x3d98('0x8'));var config=require(_0x3d98('0x9'));var jayson=require(_0x3d98('0xa'));var client=jayson[_0x3d98('0xb')][_0x3d98('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27df6e,_0x199aba,_0x2ee957){return new BPromise(function(_0x5b4af0,_0x395656){return client[_0x3d98('0xd')](_0x27df6e,_0x2ee957)['then'](function(_0x405e72){logger[_0x3d98('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x199aba,_0x3d98('0xf'));logger[_0x3d98('0x10')](_0x3d98('0x11'),_0x199aba,_0x3d98('0xf'),JSON[_0x3d98('0x12')](_0x405e72));if(_0x405e72[_0x3d98('0x13')]){if(_0x405e72['error'][_0x3d98('0x14')]===0x1f4){logger['error'](_0x3d98('0x15'),_0x199aba,_0x405e72[_0x3d98('0x13')][_0x3d98('0x16')]);return _0x395656(_0x405e72[_0x3d98('0x13')]['message']);}logger[_0x3d98('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x199aba,_0x405e72[_0x3d98('0x13')]['message']);return _0x5b4af0(_0x405e72[_0x3d98('0x13')][_0x3d98('0x16')]);}else{logger[_0x3d98('0xe')](_0x3d98('0x15'),_0x199aba,_0x3d98('0xf'));_0x5b4af0(_0x405e72[_0x3d98('0x17')]['message']);}})[_0x3d98('0x18')](function(_0x36a7d6){logger[_0x3d98('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x199aba,_0x36a7d6);_0x395656(_0x36a7d6);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index b4017af..775e21f 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 _0x1f4e=['fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','destroy','multer','util','connect-timeout','express'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x1f4e,0x13c));var _0xe1f4=function(_0x5ebf44,_0x4e543e){_0x5ebf44=_0x5ebf44-0x0;var _0x2fef12=_0x1f4e[_0x5ebf44];return _0x2fef12;};'use strict';var multer=require(_0xe1f4('0x0'));var util=require(_0xe1f4('0x1'));var path=require('path');var timeout=require(_0xe1f4('0x2'));var express=require(_0xe1f4('0x3'));var router=express['Router']();var fs_extra=require(_0xe1f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe1f4('0x5'));var config=require(_0xe1f4('0x6'));var controller=require(_0xe1f4('0x7'));router[_0xe1f4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe1f4('0x8')]('/describe',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xa')]);router[_0xe1f4('0x8')](_0xe1f4('0xb'),auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xc')]);router[_0xe1f4('0xd')]('/',auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xe')]);router['put'](_0xe1f4('0xb'),auth[_0xe1f4('0x9')](),controller['update']);router['delete'](_0xe1f4('0xb'),auth[_0xe1f4('0x9')](),controller[_0xe1f4('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x5541=['index','/describe','describe','/:id','post','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x1b6339,_0x29614e){var _0x4b7dc7=function(_0x4df228){while(--_0x4df228){_0x1b6339['push'](_0x1b6339['shift']());}};_0x4b7dc7(++_0x29614e);}(_0x5541,0x135));var _0x1554=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x5541[_0x54bac5];return _0xc15971;};'use strict';var multer=require(_0x1554('0x0'));var util=require(_0x1554('0x1'));var path=require('path');var timeout=require(_0x1554('0x2'));var express=require(_0x1554('0x3'));var router=express[_0x1554('0x4')]();var fs_extra=require(_0x1554('0x5'));var auth=require(_0x1554('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1554('0x7'));var controller=require(_0x1554('0x8'));router[_0x1554('0x9')]('/',auth[_0x1554('0xa')](),controller[_0x1554('0xb')]);router[_0x1554('0x9')](_0x1554('0xc'),auth[_0x1554('0xa')](),controller[_0x1554('0xd')]);router[_0x1554('0x9')](_0x1554('0xe'),auth[_0x1554('0xa')](),controller['show']);router[_0x1554('0xf')]('/',auth[_0x1554('0xa')](),controller[_0x1554('0x10')]);router[_0x1554('0x11')](_0x1554('0xe'),auth[_0x1554('0xa')](),controller[_0x1554('0x12')]);router['delete'](_0x1554('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x1554('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 0d52221..b4fcac0 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 _0x97d0=['timeout','STRING','INTEGER','sequelize','exports','ENUM','mouseOver'];(function(_0x3d4e45,_0x114c65){var _0x28120d=function(_0x3465ae){while(--_0x3465ae){_0x3d4e45['push'](_0x3d4e45['shift']());}};_0x28120d(++_0x114c65);}(_0x97d0,0xb9));var _0x097d=function(_0x57e1b3,_0x9ad0c5){_0x57e1b3=_0x57e1b3-0x0;var _0x42bb8c=_0x97d0[_0x57e1b3];return _0x42bb8c;};'use strict';var Sequelize=require(_0x097d('0x0'));module[_0x097d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x097d('0x2')](_0x097d('0x3'),_0x097d('0x4')),'defaultValue':_0x097d('0x3')},'selector':{'type':Sequelize[_0x097d('0x5')]},'timeout':{'type':Sequelize[_0x097d('0x6')]}};
\ No newline at end of file
+var _0x1486=['timeout','STRING','ENUM','mouseOver'];(function(_0x1de2bd,_0x953fb){var _0x595960=function(_0xea260b){while(--_0xea260b){_0x1de2bd['push'](_0x1de2bd['shift']());}};_0x595960(++_0x953fb);}(_0x1486,0x89));var _0x6148=function(_0x4b40f9,_0x40dc05){_0x4b40f9=_0x4b40f9-0x0;var _0x2e4f03=_0x1486[_0x4b40f9];return _0x2e4f03;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6148('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x6148('0x1')](_0x6148('0x2'),_0x6148('0x3')),'defaultValue':_0x6148('0x2')},'selector':{'type':Sequelize[_0x6148('0x0')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index af41c44..d512108 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 _0xdefc=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','merge','options','ChatProactiveAction','find','create','body','catch','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x1d7d3d,_0x14be7f){var _0x2a36a8=function(_0x45638b){while(--_0x45638b){_0x1d7d3d['push'](_0x1d7d3d['shift']());}};_0x2a36a8(++_0x14be7f);}(_0xdefc,0x1b3));var _0xcdef=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0xdefc[_0x3071ab];return _0x2f458c;};'use strict';var emlformat=require(_0xcdef('0x0'));var rimraf=require(_0xcdef('0x1'));var zipdir=require(_0xcdef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdef('0x4'));var util=require(_0xcdef('0x5'));var path=require(_0xcdef('0x6'));var sox=require(_0xcdef('0x7'));var csv=require(_0xcdef('0x8'));var ejs=require(_0xcdef('0x9'));var fs=require('fs');var fs_extra=require(_0xcdef('0xa'));var _=require('lodash');var squel=require(_0xcdef('0xb'));var crypto=require('crypto');var jsforce=require(_0xcdef('0xc'));var deskjs=require(_0xcdef('0xd'));var toCsv=require(_0xcdef('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdef('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcdef('0xf'));var as=require(_0xcdef('0x10'));var hardwareService=require(_0xcdef('0x11'));var logger=require(_0xcdef('0x12'))(_0xcdef('0x13'));var utils=require(_0xcdef('0x14'));var config=require(_0xcdef('0x15'));var licenseUtil=require(_0xcdef('0x16'));var db=require(_0xcdef('0x17'))['db'];function respondWithStatusCode(_0x106cf6,_0x21c400){_0x21c400=_0x21c400||0xcc;return function(_0x418c26){if(_0x418c26){return _0x106cf6[_0xcdef('0x18')](_0x21c400);}return _0x106cf6[_0xcdef('0x19')](_0x21c400)['end']();};}function respondWithResult(_0x3ad116,_0x4b64a3){_0x4b64a3=_0x4b64a3||0xc8;return function(_0x50f19e){if(_0x50f19e){return _0x3ad116[_0xcdef('0x19')](_0x4b64a3)[_0xcdef('0x1a')](_0x50f19e);}};}function respondWithFilteredResult(_0x4ce53b,_0x28c0d4){return function(_0x6e0906){if(_0x6e0906){var _0x4d173b=typeof _0x28c0d4[_0xcdef('0x1b')]===_0xcdef('0x1c')&&typeof _0x28c0d4[_0xcdef('0x1d')]===_0xcdef('0x1c');var _0x25c189=_0x6e0906['count'];var _0x46588e=_0x4d173b?0x0:_0x28c0d4[_0xcdef('0x1b')];var _0x32c920=_0x4d173b?_0x6e0906[_0xcdef('0x1e')]:_0x28c0d4[_0xcdef('0x1b')]+_0x28c0d4[_0xcdef('0x1d')];var _0x52562a;if(_0x32c920>=_0x25c189){_0x32c920=_0x25c189;_0x52562a=0xc8;}else{_0x52562a=0xce;}_0x4ce53b[_0xcdef('0x19')](_0x52562a);return _0x4ce53b['set']('Content-Range',_0x46588e+'-'+_0x32c920+'/'+_0x25c189)[_0xcdef('0x1a')](_0x6e0906);}return null;};}function patchUpdates(_0x3cea83){return function(_0x4c4421){try{jsonpatch[_0xcdef('0x1f')](_0x4c4421,_0x3cea83,!![]);}catch(_0x46f769){return BPromise[_0xcdef('0x20')](_0x46f769);}return _0x4c4421[_0xcdef('0x21')]();};}function saveUpdates(_0x1da48e,_0x2894cf){return function(_0x4f91a1){if(_0x4f91a1){return _0x4f91a1[_0xcdef('0x22')](_0x1da48e)[_0xcdef('0x23')](function(_0x2f09a0){return _0x2f09a0;});}return null;};}function removeEntity(_0x4ca6dc,_0x528167){return function(_0x2df6e1){if(_0x2df6e1){return _0x2df6e1[_0xcdef('0x24')]()[_0xcdef('0x23')](function(){_0x4ca6dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43300b,_0x31ad40){return function(_0x45794f){if(!_0x45794f){_0x43300b[_0xcdef('0x18')](0x194);}return _0x45794f;};}function handleError(_0x572e9a,_0x14601b){_0x14601b=_0x14601b||0x1f4;return function(_0x21ce9b){logger[_0xcdef('0x25')](_0x21ce9b[_0xcdef('0x26')]);if(_0x21ce9b[_0xcdef('0x27')]){delete _0x21ce9b[_0xcdef('0x27')];}_0x572e9a[_0xcdef('0x19')](_0x14601b)['send'](_0x21ce9b);};}exports[_0xcdef('0x28')]=function(_0x1f9163,_0x3a1767){var _0x4d575f={'raw':!![],'where':{'id':_0x1f9163[_0xcdef('0x29')]['id']}},_0x42eae9={};_0x42eae9[_0xcdef('0x2a')]=_[_0xcdef('0x2b')](db['ChatProactiveAction'][_0xcdef('0x2c')]);_0x42eae9['query']=_[_0xcdef('0x2b')](_0x1f9163['query']);_0x42eae9[_0xcdef('0x2d')]=_[_0xcdef('0x2e')](_0x42eae9[_0xcdef('0x2a')],_0x42eae9[_0xcdef('0x2f')]);_0x4d575f[_0xcdef('0x30')]=_[_0xcdef('0x2e')](_0x42eae9[_0xcdef('0x2a')],qs[_0xcdef('0x31')](_0x1f9163['query'][_0xcdef('0x31')]));_0x4d575f[_0xcdef('0x30')]=_0x4d575f[_0xcdef('0x30')]['length']?_0x4d575f['attributes']:_0x42eae9[_0xcdef('0x2a')];if(_0x1f9163[_0xcdef('0x2f')]['includeAll']){_0x4d575f['include']=[{'all':!![]}];}_0x4d575f=_[_0xcdef('0x32')]({},_0x4d575f,_0x1f9163[_0xcdef('0x33')]);return db[_0xcdef('0x34')][_0xcdef('0x35')](_0x4d575f)[_0xcdef('0x23')](handleEntityNotFound(_0x3a1767,null))[_0xcdef('0x23')](respondWithResult(_0x3a1767,null))['catch'](handleError(_0x3a1767,null));};exports['create']=function(_0x53e6f9,_0x5523a9){return db[_0xcdef('0x34')][_0xcdef('0x36')](_0x53e6f9[_0xcdef('0x37')],{})['then'](respondWithResult(_0x5523a9,0xc9))[_0xcdef('0x38')](handleError(_0x5523a9,null));};exports['update']=function(_0x1d0221,_0x32ab14){if(_0x1d0221[_0xcdef('0x37')]['id']){delete _0x1d0221[_0xcdef('0x37')]['id'];}return db[_0xcdef('0x34')][_0xcdef('0x35')]({'where':{'id':_0x1d0221[_0xcdef('0x29')]['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x32ab14,null))[_0xcdef('0x23')](saveUpdates(_0x1d0221['body'],null))[_0xcdef('0x23')](respondWithResult(_0x32ab14,null))[_0xcdef('0x38')](handleError(_0x32ab14,null));};exports[_0xcdef('0x24')]=function(_0x277373,_0x30754c){return db[_0xcdef('0x34')][_0xcdef('0x35')]({'where':{'id':_0x277373[_0xcdef('0x29')]['id']}})[_0xcdef('0x23')](handleEntityNotFound(_0x30754c,null))[_0xcdef('0x23')](removeEntity(_0x30754c,null))[_0xcdef('0x38')](handleError(_0x30754c,null));};
\ No newline at end of file
+var _0x98d3=['destroy','then','error','stack','name','show','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','catch','create','ChatProactiveAction','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','update'];(function(_0x3cc05a,_0x1a0c6c){var _0x301bae=function(_0x24c71e){while(--_0x24c71e){_0x3cc05a['push'](_0x3cc05a['shift']());}};_0x301bae(++_0x1a0c6c);}(_0x98d3,0x173));var _0x398d=function(_0x4b38cd,_0x415a30){_0x4b38cd=_0x4b38cd-0x0;var _0x118503=_0x98d3[_0x4b38cd];return _0x118503;};'use strict';var emlformat=require(_0x398d('0x0'));var rimraf=require(_0x398d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x398d('0x2'));var rp=require('request-promise');var moment=require(_0x398d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x398d('0x4'));var util=require(_0x398d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x398d('0x6'));var ejs=require(_0x398d('0x7'));var fs=require('fs');var fs_extra=require(_0x398d('0x8'));var _=require('lodash');var squel=require(_0x398d('0x9'));var crypto=require(_0x398d('0xa'));var jsforce=require(_0x398d('0xb'));var deskjs=require(_0x398d('0xc'));var toCsv=require(_0x398d('0x6'));var querystring=require('querystring');var Papa=require(_0x398d('0xd'));var Redis=require(_0x398d('0xe'));var authService=require(_0x398d('0xf'));var qs=require(_0x398d('0x10'));var as=require(_0x398d('0x11'));var hardwareService=require(_0x398d('0x12'));var logger=require(_0x398d('0x13'))(_0x398d('0x14'));var utils=require('../../config/utils');var config=require(_0x398d('0x15'));var licenseUtil=require(_0x398d('0x16'));var db=require(_0x398d('0x17'))['db'];function respondWithStatusCode(_0x12eb91,_0x15a424){_0x15a424=_0x15a424||0xcc;return function(_0x91619e){if(_0x91619e){return _0x12eb91[_0x398d('0x18')](_0x15a424);}return _0x12eb91[_0x398d('0x19')](_0x15a424)[_0x398d('0x1a')]();};}function respondWithResult(_0x396015,_0x1fc998){_0x1fc998=_0x1fc998||0xc8;return function(_0x537bb6){if(_0x537bb6){return _0x396015['status'](_0x1fc998)[_0x398d('0x1b')](_0x537bb6);}};}function respondWithFilteredResult(_0x36cde2,_0x347508){return function(_0x2197b4){if(_0x2197b4){var _0x278004=typeof _0x347508[_0x398d('0x1c')]===_0x398d('0x1d')&&typeof _0x347508[_0x398d('0x1e')]==='undefined';var _0x26b9a0=_0x2197b4['count'];var _0x673840=_0x278004?0x0:_0x347508[_0x398d('0x1c')];var _0x297768=_0x278004?_0x2197b4['count']:_0x347508['offset']+_0x347508['limit'];var _0x28b124;if(_0x297768>=_0x26b9a0){_0x297768=_0x26b9a0;_0x28b124=0xc8;}else{_0x28b124=0xce;}_0x36cde2[_0x398d('0x19')](_0x28b124);return _0x36cde2[_0x398d('0x1f')](_0x398d('0x20'),_0x673840+'-'+_0x297768+'/'+_0x26b9a0)[_0x398d('0x1b')](_0x2197b4);}return null;};}function patchUpdates(_0x1d9e75){return function(_0x38659b){try{jsonpatch['apply'](_0x38659b,_0x1d9e75,!![]);}catch(_0x55c98e){return BPromise['reject'](_0x55c98e);}return _0x38659b[_0x398d('0x21')]();};}function saveUpdates(_0x3b275a,_0x1ea5f9){return function(_0x2affed){if(_0x2affed){return _0x2affed[_0x398d('0x22')](_0x3b275a)['then'](function(_0x5c4c70){return _0x5c4c70;});}return null;};}function removeEntity(_0x31e87d,_0x497ad1){return function(_0x55a48d){if(_0x55a48d){return _0x55a48d[_0x398d('0x23')]()[_0x398d('0x24')](function(){_0x31e87d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aad76,_0x104069){return function(_0x2cc4ef){if(!_0x2cc4ef){_0x4aad76[_0x398d('0x18')](0x194);}return _0x2cc4ef;};}function handleError(_0x248555,_0x2a1f4d){_0x2a1f4d=_0x2a1f4d||0x1f4;return function(_0xd614bf){logger[_0x398d('0x25')](_0xd614bf[_0x398d('0x26')]);if(_0xd614bf['name']){delete _0xd614bf[_0x398d('0x27')];}_0x248555['status'](_0x2a1f4d)['send'](_0xd614bf);};}exports[_0x398d('0x28')]=function(_0x27bc6e,_0x585fe0){var _0x373326={'raw':!![],'where':{'id':_0x27bc6e[_0x398d('0x29')]['id']}},_0x558249={};_0x558249[_0x398d('0x2a')]=_['keys'](db['ChatProactiveAction'][_0x398d('0x2b')]);_0x558249[_0x398d('0x2c')]=_['keys'](_0x27bc6e[_0x398d('0x2c')]);_0x558249[_0x398d('0x2d')]=_[_0x398d('0x2e')](_0x558249[_0x398d('0x2a')],_0x558249[_0x398d('0x2c')]);_0x373326[_0x398d('0x2f')]=_['intersection'](_0x558249['model'],qs[_0x398d('0x30')](_0x27bc6e[_0x398d('0x2c')][_0x398d('0x30')]));_0x373326[_0x398d('0x2f')]=_0x373326[_0x398d('0x2f')][_0x398d('0x31')]?_0x373326[_0x398d('0x2f')]:_0x558249[_0x398d('0x2a')];if(_0x27bc6e[_0x398d('0x2c')]['includeAll']){_0x373326[_0x398d('0x32')]=[{'all':!![]}];}_0x373326=_[_0x398d('0x33')]({},_0x373326,_0x27bc6e[_0x398d('0x34')]);return db['ChatProactiveAction']['find'](_0x373326)[_0x398d('0x24')](handleEntityNotFound(_0x585fe0,null))[_0x398d('0x24')](respondWithResult(_0x585fe0,null))[_0x398d('0x35')](handleError(_0x585fe0,null));};exports[_0x398d('0x36')]=function(_0x20fe0d,_0x321a49){return db[_0x398d('0x37')][_0x398d('0x36')](_0x20fe0d[_0x398d('0x38')],{})[_0x398d('0x24')](respondWithResult(_0x321a49,0xc9))[_0x398d('0x35')](handleError(_0x321a49,null));};exports[_0x398d('0x22')]=function(_0x32ab00,_0x1c7859){if(_0x32ab00[_0x398d('0x38')]['id']){delete _0x32ab00[_0x398d('0x38')]['id'];}return db[_0x398d('0x37')][_0x398d('0x39')]({'where':{'id':_0x32ab00[_0x398d('0x29')]['id']}})['then'](handleEntityNotFound(_0x1c7859,null))[_0x398d('0x24')](saveUpdates(_0x32ab00[_0x398d('0x38')],null))[_0x398d('0x24')](respondWithResult(_0x1c7859,null))[_0x398d('0x35')](handleError(_0x1c7859,null));};exports[_0x398d('0x23')]=function(_0x4b0045,_0xb8894f){return db['ChatProactiveAction'][_0x398d('0x39')]({'where':{'id':_0x4b0045[_0x398d('0x29')]['id']}})[_0x398d('0x24')](handleEntityNotFound(_0xb8894f,null))[_0x398d('0x24')](removeEntity(_0xb8894f,null))[_0x398d('0x35')](handleError(_0xb8894f,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 7fe52f7..8c01a7c 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 _0x192b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x1c3375,_0x29cf53){var _0x179181=function(_0xc0207c){while(--_0xc0207c){_0x1c3375['push'](_0x1c3375['shift']());}};_0x179181(++_0x29cf53);}(_0x192b,0x1af));var _0xb192=function(_0x58c2ef,_0x599cdc){_0x58c2ef=_0x58c2ef-0x0;var _0x29733d=_0x192b[_0x58c2ef];return _0x29733d;};'use strict';var _=require(_0xb192('0x0'));var util=require(_0xb192('0x1'));var logger=require(_0xb192('0x2'))(_0xb192('0x3'));var moment=require(_0xb192('0x4'));var BPromise=require(_0xb192('0x5'));var rp=require(_0xb192('0x6'));var fs=require('fs');var path=require(_0xb192('0x7'));var rimraf=require(_0xb192('0x8'));var config=require(_0xb192('0x9'));var attributes=require('./chatProactiveAction.attributes');module[_0xb192('0xa')]=function(_0x110910,_0x21a693){return _0x110910[_0xb192('0xb')](_0xb192('0xc'),attributes,{'tableName':_0xb192('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12ec=['rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x73cc89,_0x34e084){var _0x2bfa6f=function(_0x4a9f37){while(--_0x4a9f37){_0x73cc89['push'](_0x73cc89['shift']());}};_0x2bfa6f(++_0x34e084);}(_0x12ec,0x76));var _0xc12e=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x12ec[_0x45fc6a];return _0x14bcfd;};'use strict';var _=require(_0xc12e('0x0'));var util=require(_0xc12e('0x1'));var logger=require(_0xc12e('0x2'))(_0xc12e('0x3'));var moment=require(_0xc12e('0x4'));var BPromise=require(_0xc12e('0x5'));var rp=require(_0xc12e('0x6'));var fs=require('fs');var path=require(_0xc12e('0x7'));var rimraf=require(_0xc12e('0x8'));var config=require(_0xc12e('0x9'));var attributes=require(_0xc12e('0xa'));module[_0xc12e('0xb')]=function(_0x40415a,_0xccc760){return _0x40415a[_0xc12e('0xc')]('ChatProactiveAction',attributes,{'tableName':_0xc12e('0xd'),'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 76e16ce..758ef88 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 _0xd252=['../../config/logger','client','http','request','then','info','debug','request\x20sent','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4eea49,_0x57c9e9){var _0x390f8a=function(_0x18f3c5){while(--_0x18f3c5){_0x4eea49['push'](_0x4eea49['shift']());}};_0x390f8a(++_0x57c9e9);}(_0xd252,0x8b));var _0x2d25=function(_0x45e604,_0x58a542){_0x45e604=_0x45e604-0x0;var _0x4948f8=_0xd252[_0x45e604];return _0x4948f8;};'use strict';var _=require(_0x2d25('0x0'));var util=require(_0x2d25('0x1'));var moment=require(_0x2d25('0x2'));var BPromise=require(_0x2d25('0x3'));var rs=require(_0x2d25('0x4'));var fs=require('fs');var Redis=require(_0x2d25('0x5'));var db=require(_0x2d25('0x6'))['db'];var utils=require(_0x2d25('0x7'));var logger=require(_0x2d25('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2d25('0x9')][_0x2d25('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x266a6e,_0x34fa4c,_0x164eae){return new BPromise(function(_0x3cfd78,_0x1efb6a){return client[_0x2d25('0xb')](_0x266a6e,_0x164eae)[_0x2d25('0xc')](function(_0x4eaa76){logger[_0x2d25('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x34fa4c,'request\x20sent');logger[_0x2d25('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x34fa4c,_0x2d25('0xf'),JSON[_0x2d25('0x10')](_0x4eaa76));if(_0x4eaa76[_0x2d25('0x11')]){if(_0x4eaa76[_0x2d25('0x11')]['code']===0x1f4){logger[_0x2d25('0x11')](_0x2d25('0x12'),_0x34fa4c,_0x4eaa76['error'][_0x2d25('0x13')]);return _0x1efb6a(_0x4eaa76[_0x2d25('0x11')]['message']);}logger['error'](_0x2d25('0x12'),_0x34fa4c,_0x4eaa76[_0x2d25('0x11')]['message']);return _0x3cfd78(_0x4eaa76[_0x2d25('0x11')][_0x2d25('0x13')]);}else{logger['info'](_0x2d25('0x12'),_0x34fa4c,_0x2d25('0xf'));_0x3cfd78(_0x4eaa76[_0x2d25('0x14')][_0x2d25('0x13')]);}})['catch'](function(_0x27de3c){logger[_0x2d25('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x34fa4c,_0x27de3c);_0x1efb6a(_0x27de3c);});});}
\ No newline at end of file
+var _0xf46a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','lodash','moment','bluebird','ioredis'];(function(_0xf50b8c,_0x30f4d0){var _0x57e9ef=function(_0x5ec471){while(--_0x5ec471){_0xf50b8c['push'](_0xf50b8c['shift']());}};_0x57e9ef(++_0x30f4d0);}(_0xf46a,0xa4));var _0xaf46=function(_0x534aab,_0x311c05){_0x534aab=_0x534aab-0x0;var _0x4feeff=_0xf46a[_0x534aab];return _0x4feeff;};'use strict';var _=require(_0xaf46('0x0'));var util=require('util');var moment=require(_0xaf46('0x1'));var BPromise=require(_0xaf46('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf46('0x3'));var db=require(_0xaf46('0x4'))['db'];var utils=require(_0xaf46('0x5'));var logger=require(_0xaf46('0x6'))(_0xaf46('0x7'));var config=require(_0xaf46('0x8'));var jayson=require(_0xaf46('0x9'));var client=jayson[_0xaf46('0xa')][_0xaf46('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9e9887,_0x4f76cc,_0xa4a618){return new BPromise(function(_0x105943,_0x328d92){return client['request'](_0x9e9887,_0xa4a618)[_0xaf46('0xc')](function(_0x4e67c0){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'));logger[_0xaf46('0xe')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4f76cc,_0xaf46('0xd'),JSON[_0xaf46('0xf')](_0x4e67c0));if(_0x4e67c0[_0xaf46('0x10')]){if(_0x4e67c0['error'][_0xaf46('0x11')]===0x1f4){logger['error'](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0['error'][_0xaf46('0x13')]);return _0x328d92(_0x4e67c0['error'][_0xaf46('0x13')]);}logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);return _0x105943(_0x4e67c0[_0xaf46('0x10')][_0xaf46('0x13')]);}else{logger[_0xaf46('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x4f76cc,'request\x20sent');_0x105943(_0x4e67c0['result'][_0xaf46('0x13')]);}})['catch'](function(_0x498720){logger[_0xaf46('0x10')](_0xaf46('0x12'),_0x4f76cc,_0x498720);_0x328d92(_0x498720);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 731d836..5625436 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 _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4afe8f,_0x21233c){var _0x203b62=function(_0x2d16c9){while(--_0x2d16c9){_0x4afe8f['push'](_0x4afe8f['shift']());}};_0x203b62(++_0x21233c);}(_0xac9d,0x14d));var _0xdac9=function(_0x5be8cc,_0x4a6037){_0x5be8cc=_0x5be8cc-0x0;var _0x5f1b7e=_0xac9d[_0x5be8cc];return _0x5f1b7e;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router;
\ No newline at end of file
+var _0x5075=['show','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','isAuthenticated'];(function(_0x4dbab6,_0x22b3fa){var _0x18db47=function(_0x490d01){while(--_0x490d01){_0x4dbab6['push'](_0x4dbab6['shift']());}};_0x18db47(++_0x22b3fa);}(_0x5075,0x73));var _0x5507=function(_0x4ee881,_0x10ddc8){_0x4ee881=_0x4ee881-0x0;var _0x305f48=_0x5075[_0x4ee881];return _0x305f48;};'use strict';var multer=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var path=require(_0x5507('0x2'));var timeout=require(_0x5507('0x3'));var express=require(_0x5507('0x4'));var router=express[_0x5507('0x5')]();var fs_extra=require(_0x5507('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var controller=require(_0x5507('0x9'));router['get']('/:id',auth[_0x5507('0xa')](),controller[_0x5507('0xb')]);router['post']('/',auth[_0x5507('0xa')](),controller[_0x5507('0xc')]);router[_0x5507('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5507('0xe')]);router[_0x5507('0xf')](_0x5507('0x10'),auth[_0x5507('0xa')](),controller['destroy']);module[_0x5507('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 0c53bf4..68c8f1c 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 _0xd112=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0xd112,0xa6));var _0x2d11=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xd112[_0x1b6311];return _0x25aab6;};'use strict';var Sequelize=require(_0x2d11('0x0'));module[_0x2d11('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2d11('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2d11('0x3')]},'timeout':{'type':Sequelize[_0x2d11('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2d11('0x5')]('rrmemory',_0x2d11('0x6'),_0x2d11('0x7'))}};
\ No newline at end of file
+var _0x9d7b=['INTEGER','ENUM','sequelize','exports'];(function(_0x5a7d7c,_0x9ae68a){var _0x239238=function(_0x32777a){while(--_0x32777a){_0x5a7d7c['push'](_0x5a7d7c['shift']());}};_0x239238(++_0x9ae68a);}(_0x9d7b,0x106));var _0xb9d7=function(_0x5ca5a8,_0x169eac){_0x5ca5a8=_0x5ca5a8-0x0;var _0x16d865=_0x9d7b[_0x5ca5a8];return _0x16d865;};'use strict';var Sequelize=require(_0xb9d7('0x0'));module[_0xb9d7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb9d7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9d7('0x3')]('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 8eb4590..acda3ca 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 _0x7a3c=['compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','omit','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','end','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','createdAt','format','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union'];(function(_0x24f207,_0x23cad1){var _0x4bcb1f=function(_0x1ed352){while(--_0x1ed352){_0x24f207['push'](_0x24f207['shift']());}};_0x4bcb1f(++_0x23cad1);}(_0x7a3c,0x1e4));var _0xc7a3=function(_0x145575,_0x2d2dbb){_0x145575=_0x145575-0x0;var _0x24ec6d=_0x7a3c[_0x145575];return _0x24ec6d;};'use strict';var emlformat=require(_0xc7a3('0x0'));var rimraf=require(_0xc7a3('0x1'));var zipdir=require(_0xc7a3('0x2'));var jsonpatch=require(_0xc7a3('0x3'));var rp=require('request-promise');var moment=require(_0xc7a3('0x4'));var BPromise=require(_0xc7a3('0x5'));var Mustache=require(_0xc7a3('0x6'));var util=require(_0xc7a3('0x7'));var path=require(_0xc7a3('0x8'));var sox=require(_0xc7a3('0x9'));var csv=require('to-csv');var ejs=require(_0xc7a3('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a3('0xb'));var _=require(_0xc7a3('0xc'));var squel=require(_0xc7a3('0xd'));var crypto=require(_0xc7a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc7a3('0xf'));var querystring=require(_0xc7a3('0x10'));var Papa=require(_0xc7a3('0x11'));var Redis=require(_0xc7a3('0x12'));var authService=require(_0xc7a3('0x13'));var qs=require(_0xc7a3('0x14'));var as=require(_0xc7a3('0x15'));var hardwareService=require(_0xc7a3('0x16'));var logger=require('../../config/logger')(_0xc7a3('0x17'));var utils=require(_0xc7a3('0x18'));var config=require(_0xc7a3('0x19'));var licenseUtil=require(_0xc7a3('0x1a'));var db=require(_0xc7a3('0x1b'))['db'];config[_0xc7a3('0x1c')]=_['defaults'](config[_0xc7a3('0x1c')],{'host':_0xc7a3('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc7a3('0x1c')]));require(_0xc7a3('0x1e'))[_0xc7a3('0x1f')](socket);var jayson=require(_0xc7a3('0x20'));var client=jayson[_0xc7a3('0x21')][_0xc7a3('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x51b455,_0x1538e2,_0x3306ce,_0x68ef06){return new BPromise(function(_0x5d6179,_0x2d898f){var _0x56bbcb=_0x68ef06||client;return _0x56bbcb[_0xc7a3('0x23')](_0x51b455,_0x3306ce)['then'](function(_0x4efa91){logger['info'](_0xc7a3('0x24'),_0x1538e2,_0xc7a3('0x25'));logger[_0xc7a3('0x26')](_0xc7a3('0x27'),_0x1538e2,_0xc7a3('0x25'),JSON['stringify'](_0x4efa91));if(_0x4efa91['error']){if(_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x29')]===0x1f4){logger[_0xc7a3('0x28')](_0xc7a3('0x24'),_0x1538e2,_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x2a')]);return _0x2d898f(_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x2a')]);}logger[_0xc7a3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1538e2,_0x4efa91['error'][_0xc7a3('0x2a')]);return _0x5d6179(_0x4efa91[_0xc7a3('0x28')][_0xc7a3('0x2a')]);}else{logger[_0xc7a3('0x2b')](_0xc7a3('0x24'),_0x1538e2,_0xc7a3('0x25'));_0x5d6179(_0x4efa91[_0xc7a3('0x2c')]['message']);}})['catch'](function(_0x20cf35){logger[_0xc7a3('0x28')]('ChatQueue,\x20%s,\x20%s',_0x1538e2,_0x20cf35);_0x2d898f(_0x20cf35);});});}function respondWithStatusCode(_0x1dd1a3,_0x22a713){_0x22a713=_0x22a713||0xcc;return function(_0x58fb0f){if(_0x58fb0f){return _0x1dd1a3[_0xc7a3('0x2d')](_0x22a713);}return _0x1dd1a3[_0xc7a3('0x2e')](_0x22a713)['end']();};}function respondWithResult(_0x11a9a3,_0x55068d){_0x55068d=_0x55068d||0xc8;return function(_0x58c9a0){if(_0x58c9a0){return _0x11a9a3['status'](_0x55068d)[_0xc7a3('0x2f')](_0x58c9a0);}};}function respondWithFilteredResult(_0x6b225a,_0x22362a){return function(_0x508dcc){if(_0x508dcc){var _0xb99941=typeof _0x22362a[_0xc7a3('0x30')]===_0xc7a3('0x31')&&typeof _0x22362a[_0xc7a3('0x32')]===_0xc7a3('0x31');var _0x10f601=_0x508dcc[_0xc7a3('0x33')];var _0x1b087e=_0xb99941?0x0:_0x22362a['offset'];var _0xf4a5a8=_0xb99941?_0x508dcc[_0xc7a3('0x33')]:_0x22362a[_0xc7a3('0x30')]+_0x22362a['limit'];var _0x1c7a6c;if(_0xf4a5a8>=_0x10f601){_0xf4a5a8=_0x10f601;_0x1c7a6c=0xc8;}else{_0x1c7a6c=0xce;}_0x6b225a[_0xc7a3('0x2e')](_0x1c7a6c);return _0x6b225a['set'](_0xc7a3('0x34'),_0x1b087e+'-'+_0xf4a5a8+'/'+_0x10f601)['json'](_0x508dcc);}return null;};}function patchUpdates(_0x2c2372){return function(_0x338879){try{jsonpatch[_0xc7a3('0x35')](_0x338879,_0x2c2372,!![]);}catch(_0x4b8671){return BPromise[_0xc7a3('0x36')](_0x4b8671);}return _0x338879[_0xc7a3('0x37')]();};}function saveUpdates(_0x434088,_0x210944){return function(_0xfd62eb){if(_0xfd62eb){return _0xfd62eb[_0xc7a3('0x38')](_0x434088)[_0xc7a3('0x39')](function(_0xde7d4e){return _0xde7d4e;});}return null;};}function removeEntity(_0x5d0d9e,_0x313a81){return function(_0x363382){if(_0x363382){return _0x363382[_0xc7a3('0x3a')]()[_0xc7a3('0x39')](function(){var _0x1ad9e7=_0x363382[_0xc7a3('0x3b')]({'plain':!![]});var _0x210cfc=_0xc7a3('0x3c');return db[_0xc7a3('0x3d')][_0xc7a3('0x3a')]({'where':{'type':_0x210cfc,'resourceId':_0x1ad9e7['id']}})['then'](function(){return _0x363382;});})[_0xc7a3('0x39')](function(){_0x5d0d9e[_0xc7a3('0x2e')](0xcc)[_0xc7a3('0x3e')]();});}};}function handleEntityNotFound(_0x1e1fd2,_0x199923){return function(_0x1099d1){if(!_0x1099d1){_0x1e1fd2[_0xc7a3('0x2d')](0x194);}return _0x1099d1;};}function handleError(_0x47bc65,_0x2810bd){_0x2810bd=_0x2810bd||0x1f4;return function(_0x523256){logger['error'](_0x523256[_0xc7a3('0x3f')]);if(_0x523256['name']){delete _0x523256[_0xc7a3('0x40')];}_0x47bc65['status'](_0x2810bd)[_0xc7a3('0x41')](_0x523256);};}exports['index']=function(_0x101866,_0x591b0d){var _0x31da25={},_0x5e41e3={},_0x5069c1={'count':0x0,'rows':[]};var _0x1f0d66=_[_0xc7a3('0x42')](db[_0xc7a3('0x43')][_0xc7a3('0x44')],function(_0x4f0e24){return{'name':_0x4f0e24[_0xc7a3('0x45')],'type':_0x4f0e24[_0xc7a3('0x46')][_0xc7a3('0x47')]};});_0x5e41e3[_0xc7a3('0x48')]=_[_0xc7a3('0x42')](_0x1f0d66,_0xc7a3('0x40'));_0x5e41e3[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x101866[_0xc7a3('0x49')]);_0x5e41e3[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0x5e41e3['model'],_0x5e41e3[_0xc7a3('0x49')]);_0x31da25[_0xc7a3('0x4d')]=_[_0xc7a3('0x4c')](_0x5e41e3['model'],qs['fields'](_0x101866[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0x31da25['attributes']=_0x31da25[_0xc7a3('0x4d')][_0xc7a3('0x4f')]?_0x31da25[_0xc7a3('0x4d')]:_0x5e41e3['model'];if(!_0x101866[_0xc7a3('0x49')][_0xc7a3('0x50')](_0xc7a3('0x51'))){_0x31da25[_0xc7a3('0x32')]=qs['limit'](_0x101866['query']['limit']);_0x31da25[_0xc7a3('0x30')]=qs['offset'](_0x101866['query']['offset']);}_0x31da25[_0xc7a3('0x52')]=qs[_0xc7a3('0x53')](_0x101866[_0xc7a3('0x49')]['sort']);_0x31da25['where']=qs['filters'](_[_0xc7a3('0x54')](_0x101866[_0xc7a3('0x49')],_0x5e41e3[_0xc7a3('0x4b')]),_0x1f0d66);if(_0x101866[_0xc7a3('0x49')][_0xc7a3('0x55')]){_0x31da25[_0xc7a3('0x56')]=_[_0xc7a3('0x57')](_0x31da25[_0xc7a3('0x56')],{'$or':_[_0xc7a3('0x42')](_0x1f0d66,function(_0x247e71){if(_0x247e71[_0xc7a3('0x46')]!==_0xc7a3('0x58')){var _0x5acaf5={};_0x5acaf5[_0x247e71[_0xc7a3('0x40')]]={'$like':'%'+_0x101866[_0xc7a3('0x49')][_0xc7a3('0x55')]+'%'};return _0x5acaf5;}})});}_0x31da25=_[_0xc7a3('0x57')]({},_0x31da25,_0x101866[_0xc7a3('0x59')]);var _0x4ec5bb={'where':_0x31da25['where']};return db['ChatQueue'][_0xc7a3('0x33')](_0x4ec5bb)[_0xc7a3('0x39')](function(_0x270119){_0x5069c1['count']=_0x270119;if(_0x101866[_0xc7a3('0x49')]['includeAll']){_0x31da25[_0xc7a3('0x5a')]=[{'all':!![]}];}return db[_0xc7a3('0x43')][_0xc7a3('0x5b')](_0x31da25);})[_0xc7a3('0x39')](function(_0x230e1d){_0x5069c1[_0xc7a3('0x5c')]=_0x230e1d;return _0x5069c1;})[_0xc7a3('0x39')](respondWithFilteredResult(_0x591b0d,_0x31da25))['catch'](handleError(_0x591b0d,null));};exports['show']=function(_0x4ec5f1,_0x3fcb99){var _0x503068={'raw':!![],'where':{'id':_0x4ec5f1[_0xc7a3('0x5d')]['id']}},_0x40cb01={};_0x40cb01[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db[_0xc7a3('0x43')][_0xc7a3('0x44')]);_0x40cb01[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x4ec5f1[_0xc7a3('0x49')]);_0x40cb01[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0x40cb01[_0xc7a3('0x48')],_0x40cb01[_0xc7a3('0x49')]);_0x503068[_0xc7a3('0x4d')]=_['intersection'](_0x40cb01[_0xc7a3('0x48')],qs[_0xc7a3('0x4e')](_0x4ec5f1['query'][_0xc7a3('0x4e')]));_0x503068[_0xc7a3('0x4d')]=_0x503068[_0xc7a3('0x4d')]['length']?_0x503068[_0xc7a3('0x4d')]:_0x40cb01[_0xc7a3('0x48')];if(_0x4ec5f1[_0xc7a3('0x49')][_0xc7a3('0x5e')]){_0x503068[_0xc7a3('0x5a')]=[{'all':!![]}];}_0x503068=_['merge']({},_0x503068,_0x4ec5f1[_0xc7a3('0x59')]);return db[_0xc7a3('0x43')]['find'](_0x503068)['then'](handleEntityNotFound(_0x3fcb99,null))[_0xc7a3('0x39')](respondWithResult(_0x3fcb99,null))[_0xc7a3('0x5f')](handleError(_0x3fcb99,null));};exports[_0xc7a3('0x60')]=function(_0xa000de,_0x169b69){return db[_0xc7a3('0x43')]['create'](_0xa000de['body'],{})[_0xc7a3('0x39')](function(_0x26932a){var _0x2e715c=_0xa000de[_0xc7a3('0x61')][_0xc7a3('0x3b')]({'plain':!![]});if(!_0x2e715c)throw new Error(_0xc7a3('0x62'));if(_0x2e715c[_0xc7a3('0x63')]===_0xc7a3('0x61')){var _0x1318b5=_0x26932a[_0xc7a3('0x3b')]({'plain':!![]});var _0x4dd7f6=_0xc7a3('0x3c');return db[_0xc7a3('0x64')]['find']({'where':{'name':_0x4dd7f6,'userProfileId':_0x2e715c['userProfileId']},'raw':!![]})[_0xc7a3('0x39')](function(_0x40f468){if(_0x40f468&&_0x40f468[_0xc7a3('0x65')]===0x0){return db[_0xc7a3('0x3d')][_0xc7a3('0x60')]({'name':_0x1318b5[_0xc7a3('0x40')],'resourceId':_0x1318b5['id'],'type':_0x40f468[_0xc7a3('0x40')],'sectionId':_0x40f468['id']},{})[_0xc7a3('0x39')](function(){return _0x26932a;});}else{return _0x26932a;}})[_0xc7a3('0x5f')](function(_0x40102d){logger['error'](_0xc7a3('0x66'),_0x40102d);throw _0x40102d;});}return _0x26932a;})['then'](respondWithResult(_0x169b69,0xc9))['catch'](handleError(_0x169b69,null));};exports[_0xc7a3('0x38')]=function(_0x323c7e,_0xca1c0d){if(_0x323c7e['body']['id']){delete _0x323c7e[_0xc7a3('0x67')]['id'];}return db['ChatQueue'][_0xc7a3('0x68')]({'where':{'id':_0x323c7e[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0xca1c0d,null))['then'](saveUpdates(_0x323c7e['body'],null))[_0xc7a3('0x39')](respondWithResult(_0xca1c0d,null))[_0xc7a3('0x5f')](handleError(_0xca1c0d,null));};exports[_0xc7a3('0x3a')]=function(_0x2b9d2c,_0x4b838d){return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0x2b9d2c[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x4b838d,null))[_0xc7a3('0x39')](removeEntity(_0x4b838d,null))[_0xc7a3('0x5f')](handleError(_0x4b838d,null));};exports[_0xc7a3('0x69')]=function(_0x194dad,_0x420a00){return db[_0xc7a3('0x43')][_0xc7a3('0x69')]()['then'](respondWithResult(_0x420a00,null))[_0xc7a3('0x5f')](handleError(_0x420a00,null));};exports[_0xc7a3('0x6a')]=function(_0x50835f,_0x3f5648,_0x2e775e){var _0x5b5120={'raw':!![],'where':{}},_0x369505={},_0x304bf5;return db[_0xc7a3('0x43')][_0xc7a3('0x6b')]({'where':{'id':_0x50835f[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x3f5648,null))[_0xc7a3('0x39')](function(_0x24a769){if(_0x24a769){_0x304bf5=_0x24a769[_0xc7a3('0x3b')]({'plain':!![]});_0x369505[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db[_0xc7a3('0x6c')][_0xc7a3('0x44')]);_0x369505[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x50835f[_0xc7a3('0x49')]);_0x369505[_0xc7a3('0x4b')]=_['intersection'](_0x369505[_0xc7a3('0x48')],_0x369505[_0xc7a3('0x49')]);_0x5b5120[_0xc7a3('0x4d')]=_[_0xc7a3('0x4c')](_0x369505[_0xc7a3('0x48')],qs[_0xc7a3('0x4e')](_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0x5b5120[_0xc7a3('0x4d')]=_0x5b5120[_0xc7a3('0x4d')][_0xc7a3('0x4f')]?_0x5b5120[_0xc7a3('0x4d')]:_0x369505['model'];if(!_0x50835f['query'][_0xc7a3('0x50')]('nolimit')){_0x5b5120[_0xc7a3('0x32')]=qs[_0xc7a3('0x32')](_0x50835f[_0xc7a3('0x49')]['limit']);_0x5b5120[_0xc7a3('0x30')]=qs[_0xc7a3('0x30')](_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x30')]);}_0x5b5120[_0xc7a3('0x52')]=qs[_0xc7a3('0x53')](_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x53')]);_0x5b5120[_0xc7a3('0x56')]=qs['filters'](_['pick'](_0x50835f[_0xc7a3('0x49')],_0x369505['filters']));_0x5b5120[_0xc7a3('0x56')][_0xc7a3('0x6d')]=_0x24a769['id'];if(_0x50835f['query']['filter']){_0x5b5120['where']=_[_0xc7a3('0x57')](_0x5b5120[_0xc7a3('0x56')],{'$or':_['map'](_0x5b5120[_0xc7a3('0x4d')],function(_0x38d7dd){var _0x422d69={};_0x422d69[_0x38d7dd]={'$like':'%'+_0x50835f[_0xc7a3('0x49')][_0xc7a3('0x55')]+'%'};return _0x422d69;})});}_0x5b5120=_[_0xc7a3('0x57')]({},_0x5b5120,_0x50835f[_0xc7a3('0x59')]);return db['UserChatQueue'][_0xc7a3('0x5b')](_0x5b5120);}})['then'](function(_0x10c13b){if(_0x10c13b){return db[_0xc7a3('0x6e')][_0xc7a3('0x6f')]({'where':{'id':_[_0xc7a3('0x42')](_0x10c13b,_0xc7a3('0x70')),'role':_0xc7a3('0x71')},'attributes':['id',_0xc7a3('0x40'),_0xc7a3('0x72'),'updatedAt',_0xc7a3('0x73')]});}})[_0xc7a3('0x39')](function(_0x43bfab){if(_0x43bfab){return{'count':_0x43bfab[_0xc7a3('0x33')],'rows':_[_0xc7a3('0x42')](_0x43bfab['rows'],function(_0xde2ecd){return{'membername':_0xde2ecd[_0xc7a3('0x40')],'UserId':_0xde2ecd['id'],'queue_name':_0x304bf5[_0xc7a3('0x40')],'ChatQueueId':_0x304bf5['id'],'interface':util[_0xc7a3('0x74')]('%s/%s','SIP',_0xde2ecd[_0xc7a3('0x40')]),'penalty':0x0,'paused':_0xde2ecd['chatPause'],'createdAt':_0xde2ecd[_0xc7a3('0x73')],'updatedAt':_0xde2ecd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xc7a3('0x39')](respondWithFilteredResult(_0x3f5648,_0x5b5120))[_0xc7a3('0x5f')](handleError(_0x3f5648,null));};exports[_0xc7a3('0x75')]=function(_0x295080,_0x1eacf2,_0x17191d){var _0x1b7cf9={};var _0x1f5731={};var _0xe9f3ea;var _0x2cac5f;return db['ChatQueue'][_0xc7a3('0x6b')]({'where':{'id':_0x295080[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x1eacf2,null))['then'](function(_0x24241f){if(_0x24241f){_0xe9f3ea=_0x24241f;_0x1f5731[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db[_0xc7a3('0x76')]['rawAttributes']);_0x1f5731[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x295080[_0xc7a3('0x49')]);_0x1f5731[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0x1f5731[_0xc7a3('0x48')],_0x1f5731[_0xc7a3('0x49')]);_0x1b7cf9['attributes']=_[_0xc7a3('0x4c')](_0x1f5731[_0xc7a3('0x48')],qs[_0xc7a3('0x4e')](_0x295080[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0x1b7cf9['attributes']=_0x1b7cf9['attributes']['length']?_0x1b7cf9[_0xc7a3('0x4d')]:_0x1f5731[_0xc7a3('0x48')];_0x1b7cf9['order']=qs[_0xc7a3('0x53')](_0x295080[_0xc7a3('0x49')][_0xc7a3('0x53')]);_0x1b7cf9[_0xc7a3('0x56')]=qs['filters'](_[_0xc7a3('0x54')](_0x295080[_0xc7a3('0x49')],_0x1f5731[_0xc7a3('0x4b')]));if(_0x295080[_0xc7a3('0x49')][_0xc7a3('0x55')]){_0x1b7cf9['where']=_[_0xc7a3('0x57')](_0x1b7cf9[_0xc7a3('0x56')],{'$or':_[_0xc7a3('0x42')](_0x1b7cf9[_0xc7a3('0x4d')],function(_0x5d4f16){var _0x4d527c={};_0x4d527c[_0x5d4f16]={'$like':'%'+_0x295080['query']['filter']+'%'};return _0x4d527c;})});}_0x1b7cf9=_[_0xc7a3('0x57')]({},_0x1b7cf9,_0x295080[_0xc7a3('0x59')]);return _0xe9f3ea[_0xc7a3('0x75')](_0x1b7cf9);}})[_0xc7a3('0x39')](function(_0x30ff05){if(_0x30ff05){_0x2cac5f=_0x30ff05[_0xc7a3('0x4f')];if(!_0x295080['query'][_0xc7a3('0x50')]('nolimit')){_0x1b7cf9[_0xc7a3('0x32')]=qs[_0xc7a3('0x32')](_0x295080['query'][_0xc7a3('0x32')]);_0x1b7cf9[_0xc7a3('0x30')]=qs['offset'](_0x295080['query']['offset']);}return _0xe9f3ea[_0xc7a3('0x75')](_0x1b7cf9);}})[_0xc7a3('0x39')](function(_0x5add63){if(_0x5add63){return _0x5add63?{'count':_0x2cac5f,'rows':_0x5add63}:null;}})[_0xc7a3('0x39')](respondWithResult(_0x1eacf2,null))[_0xc7a3('0x5f')](handleError(_0x1eacf2,null));};exports[_0xc7a3('0x77')]=function(_0x5bc563,_0x47db27,_0x5aef0c){var _0x5375fd=_0x5bc563[_0xc7a3('0x67')][_0xc7a3('0x78')];return db[_0xc7a3('0x76')][_0xc7a3('0x5b')]({'where':{'id':_0x5375fd},'attributes':['id'],'include':[{'model':db[_0xc7a3('0x6e')],'as':_0xc7a3('0x79'),'attributes':['id',_0xc7a3('0x40'),_0xc7a3('0x7a'),_0xc7a3('0x7b'),_0xc7a3('0x7c')],'raw':!![]}]})[_0xc7a3('0x39')](function(_0x2aa94f){if(_0x2aa94f){var _0x281c77=_[_0xc7a3('0x7d')](_0x2aa94f,function(_0x598d2c){var _0x26be2f=_0x598d2c[_0xc7a3('0x3b')]({'plain':!![]});return _0x26be2f['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x5bc563[_0xc7a3('0x5d')]['id']}})['then'](function(_0xd6188){return db[_0xc7a3('0x7e')][_0xc7a3('0x7f')](function(_0x3cc9f7){return _0xd6188[_0xc7a3('0x77')](_0x5375fd,{'transaction':_0x3cc9f7})[_0xc7a3('0x39')](function(){return BPromise[_0xc7a3('0x80')](_0x281c77,function(_0x20856b){return db[_0xc7a3('0x6c')][_0xc7a3('0x81')]({'where':{'UserId':_0x20856b['id'],'ChatQueueId':_0x5bc563[_0xc7a3('0x5d')]['id']},'transaction':_0x3cc9f7});});})['then'](function(){_0x281c77['forEach'](function(_0x1723b2){socket[_0xc7a3('0x82')]('userChatQueue:save',{'UserId':_0x1723b2['id'],'ChatQueueId':_0xd6188['id']});});});});});}})[_0xc7a3('0x39')](respondWithStatusCode(_0x47db27,null))[_0xc7a3('0x5f')](handleError(_0x47db27,null));};exports[_0xc7a3('0x83')]=function(_0xb758e2,_0x5821d0,_0x182b88){return db[_0xc7a3('0x76')][_0xc7a3('0x5b')]({'where':{'id':_0xb758e2[_0xc7a3('0x49')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5821d0,null))[_0xc7a3('0x39')](function(_0x119014){var _0x5a9ebe=_['map'](_0x119014,'id');var _0x3e1966=[];var _0x1af90c=[];var _0x360855=squel[_0xc7a3('0x84')]();_0x360855[_0xc7a3('0x85')](_0xc7a3('0x86'))[_0xc7a3('0x87')](_0xc7a3('0x88'),'tq')[_0xc7a3('0x89')](_0xc7a3('0x8a'),'ut',_0xc7a3('0x8b'))[_0xc7a3('0x56')]('ChatQueueId\x20=\x20?',_0xb758e2[_0xc7a3('0x5d')]['id']);for(var _0x7bd688=0x0;_0x7bd688<_0x119014[_0xc7a3('0x4f')];_0x7bd688+=0x1){let _0x3b1d85=_0x119014[_0x7bd688];for(var _0x4d138f=0x0;_0x4d138f<_0x3b1d85[_0xc7a3('0x79')][_0xc7a3('0x4f')];_0x4d138f+=0x1){let _0x35cefe=_0x3b1d85[_0xc7a3('0x79')][_0x4d138f];var _0x540a08=_0x360855[_0xc7a3('0x8c')]();_0x540a08[_0xc7a3('0x56')](_0xc7a3('0x8d'),_0x35cefe['id']);_0x1af90c[_0xc7a3('0x8e')](db['sequelize'][_0xc7a3('0x49')](_0x540a08[_0xc7a3('0x8f')](),{'type':db[_0xc7a3('0x7e')][_0xc7a3('0x90')]['SELECT']})[_0xc7a3('0x39')](function(_0xa73416){if(_0xa73416[_0xc7a3('0x4f')]===0x1){return _0x35cefe['id'];}else{var _0x22a599=_[_0xc7a3('0x91')](_['map'](_0xa73416,'TeamId'),function(_0x1969ce){return _[_0xc7a3('0x92')](_0x5a9ebe,_0x1969ce);});if(_0x22a599){return _0x35cefe['id'];}}}));}}return BPromise['all'](_0x1af90c)[_0xc7a3('0x39')](function(_0x1179b9){_0x3e1966=_(_0x3e1966)[_0xc7a3('0x93')](_0x1179b9)[_0xc7a3('0x94')]()[_0xc7a3('0x95')]();return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0xb758e2[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](function(_0x2e3ecc){return db['sequelize'][_0xc7a3('0x7f')](function(_0x39c5f8){return _0x2e3ecc[_0xc7a3('0x83')](_0xb758e2['query']['ids'],{'transaction':_0x39c5f8})[_0xc7a3('0x39')](function(){if(!_[_0xc7a3('0x96')](_0x3e1966)){return _0x2e3ecc[_0xc7a3('0x97')](_0x3e1966,{'transaction':_0x39c5f8});}})[_0xc7a3('0x39')](function(){_0x3e1966[_0xc7a3('0x98')](function(_0x51b692){socket[_0xc7a3('0x82')](_0xc7a3('0x99'),{'UserId':_0x51b692,'ChatQueueId':_0x2e3ecc['id']});});});});});});})[_0xc7a3('0x39')](respondWithStatusCode(_0x5821d0,null))[_0xc7a3('0x5f')](handleError(_0x5821d0,null));};exports[_0xc7a3('0x9a')]=function(_0x11733a,_0x3a9afd,_0x15612c){return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0x11733a['params']['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x3a9afd,null))[_0xc7a3('0x39')](function(_0x30cb09){if(_0x30cb09){return _0x30cb09[_0xc7a3('0x9a')](_0x11733a[_0xc7a3('0x67')][_0xc7a3('0x78')],_[_0xc7a3('0x9b')](_0x11733a[_0xc7a3('0x67')],[_0xc7a3('0x78'),'id'])||{})['spread'](function(_0x48e510){for(var _0x1f9378=0x0;_0x1f9378<_0x11733a[_0xc7a3('0x67')]['ids']['length'];_0x1f9378+=0x1){socket[_0xc7a3('0x82')](_0xc7a3('0x9c'),{'UserId':Number(_0x11733a[_0xc7a3('0x67')]['ids'][_0x1f9378]),'ChatQueueId':Number(_0x11733a[_0xc7a3('0x5d')]['id'])});}return _0x48e510;});}})[_0xc7a3('0x39')](respondWithResult(_0x3a9afd,null))[_0xc7a3('0x5f')](handleError(_0x3a9afd,null));};exports[_0xc7a3('0x97')]=function(_0x3ce109,_0x14f05e,_0x11d4a3){return db[_0xc7a3('0x43')][_0xc7a3('0x68')]({'where':{'id':_0x3ce109['params']['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x14f05e,null))[_0xc7a3('0x39')](function(_0x79f4d8){if(_0x79f4d8){return _0x79f4d8[_0xc7a3('0x97')](_0x3ce109['query'][_0xc7a3('0x78')])[_0xc7a3('0x39')](function(){if(_['isArray'](_0x3ce109[_0xc7a3('0x49')][_0xc7a3('0x78')])){for(var _0x4c3c11=0x0;_0x4c3c11<_0x3ce109[_0xc7a3('0x49')][_0xc7a3('0x78')]['length'];_0x4c3c11+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x3ce109[_0xc7a3('0x49')][_0xc7a3('0x78')][_0x4c3c11]),'ChatQueueId':Number(_0x3ce109[_0xc7a3('0x5d')]['id'])});}}else{socket[_0xc7a3('0x82')](_0xc7a3('0x99'),{'UserId':Number(_0x3ce109[_0xc7a3('0x49')]['ids']),'ChatQueueId':Number(_0x3ce109[_0xc7a3('0x5d')]['id'])});}});}})[_0xc7a3('0x39')](respondWithStatusCode(_0x14f05e,null))['catch'](handleError(_0x14f05e,null));};exports[_0xc7a3('0x9d')]=function(_0x250526,_0x263780,_0x17dcb0){var _0xcc0279={};var _0xa14a03={};var _0x4f0607;var _0x132d5f;return db[_0xc7a3('0x43')]['findOne']({'where':{'id':_0x250526[_0xc7a3('0x5d')]['id']}})[_0xc7a3('0x39')](handleEntityNotFound(_0x263780,null))[_0xc7a3('0x39')](function(_0x53eb07){if(_0x53eb07){_0x4f0607=_0x53eb07;_0xa14a03[_0xc7a3('0x48')]=_[_0xc7a3('0x4a')](db['User'][_0xc7a3('0x44')]);_0xa14a03[_0xc7a3('0x49')]=_[_0xc7a3('0x4a')](_0x250526[_0xc7a3('0x49')]);_0xa14a03[_0xc7a3('0x4b')]=_[_0xc7a3('0x4c')](_0xa14a03['model'],_0xa14a03[_0xc7a3('0x49')]);_0xcc0279['attributes']=_[_0xc7a3('0x4c')](_0xa14a03[_0xc7a3('0x48')],qs['fields'](_0x250526[_0xc7a3('0x49')][_0xc7a3('0x4e')]));_0xcc0279[_0xc7a3('0x4d')]=_0xcc0279[_0xc7a3('0x4d')][_0xc7a3('0x4f')]?_0xcc0279['attributes']:_0xa14a03[_0xc7a3('0x48')];_0xcc0279[_0xc7a3('0x52')]=qs[_0xc7a3('0x53')](_0x250526[_0xc7a3('0x49')][_0xc7a3('0x53')]);_0xcc0279[_0xc7a3('0x56')]=qs[_0xc7a3('0x4b')](_[_0xc7a3('0x54')](_0x250526[_0xc7a3('0x49')],_0xa14a03[_0xc7a3('0x4b')]));if(_0x250526[_0xc7a3('0x49')][_0xc7a3('0x55')]){_0xcc0279[_0xc7a3('0x56')]=_[_0xc7a3('0x57')](_0xcc0279[_0xc7a3('0x56')],{'$or':_[_0xc7a3('0x42')](_0xcc0279[_0xc7a3('0x4d')],function(_0x5d9e74){var _0x53bb85={};_0x53bb85[_0x5d9e74]={'$like':'%'+_0x250526[_0xc7a3('0x49')][_0xc7a3('0x55')]+'%'};return _0x53bb85;})});}_0xcc0279=_[_0xc7a3('0x57')]({},_0xcc0279,_0x250526['options']);return _0x4f0607[_0xc7a3('0x9d')](_0xcc0279);}})[_0xc7a3('0x39')](function(_0x26aa0f){if(_0x26aa0f){_0x132d5f=_0x26aa0f[_0xc7a3('0x4f')];if(!_0x250526[_0xc7a3('0x49')][_0xc7a3('0x50')](_0xc7a3('0x51'))){_0xcc0279[_0xc7a3('0x32')]=qs['limit'](_0x250526[_0xc7a3('0x49')][_0xc7a3('0x32')]);_0xcc0279[_0xc7a3('0x30')]=qs[_0xc7a3('0x30')](_0x250526[_0xc7a3('0x49')]['offset']);}return _0x4f0607['getAgents'](_0xcc0279);}})[_0xc7a3('0x39')](function(_0x2ed604){if(_0x2ed604){return _0x2ed604?{'count':_0x132d5f,'rows':_0x2ed604}:null;}})['then'](respondWithResult(_0x263780,null))['catch'](handleError(_0x263780,null));};
\ No newline at end of file
+var _0xc136=['keys','rawAttributes','length','user','role','UserProfileSection','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','body','describe','findOne','UserChatQueue','nolimit','ChatQueueId','User','findAndCountAll','agent','chatPause','%s/%s','SIP','createdAt','updatedAt','getTeams','addTeams','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','Team','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','TeamId','includes','all','union','compact','value','removeTeams','ids','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','ChatQueues','end','sendStatus','stack','name','send','ChatQueue','fieldName','type','key','map','query','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x3fba41,_0x39825c){var _0x12e6a2=function(_0x5dda68){while(--_0x5dda68){_0x3fba41['push'](_0x3fba41['shift']());}};_0x12e6a2(++_0x39825c);}(_0xc136,0x16c));var _0x6c13=function(_0x1334e2,_0x6859f4){_0x1334e2=_0x1334e2-0x0;var _0x36bdc6=_0xc136[_0x1334e2];return _0x36bdc6;};'use strict';var emlformat=require(_0x6c13('0x0'));var rimraf=require(_0x6c13('0x1'));var zipdir=require(_0x6c13('0x2'));var jsonpatch=require(_0x6c13('0x3'));var rp=require(_0x6c13('0x4'));var moment=require(_0x6c13('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6c13('0x6'));var path=require(_0x6c13('0x7'));var sox=require(_0x6c13('0x8'));var csv=require(_0x6c13('0x9'));var ejs=require(_0x6c13('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c13('0xb'));var squel=require(_0x6c13('0xc'));var crypto=require(_0x6c13('0xd'));var jsforce=require(_0x6c13('0xe'));var deskjs=require(_0x6c13('0xf'));var toCsv=require(_0x6c13('0x9'));var querystring=require(_0x6c13('0x10'));var Papa=require(_0x6c13('0x11'));var Redis=require('ioredis');var authService=require(_0x6c13('0x12'));var qs=require(_0x6c13('0x13'));var as=require(_0x6c13('0x14'));var hardwareService=require(_0x6c13('0x15'));var logger=require(_0x6c13('0x16'))(_0x6c13('0x17'));var utils=require(_0x6c13('0x18'));var config=require(_0x6c13('0x19'));var licenseUtil=require(_0x6c13('0x1a'));var db=require(_0x6c13('0x1b'))['db'];config[_0x6c13('0x1c')]=_[_0x6c13('0x1d')](config[_0x6c13('0x1c')],{'host':_0x6c13('0x1e'),'port':0x18eb});var socket=require(_0x6c13('0x1f'))(new Redis(config[_0x6c13('0x1c')]));require(_0x6c13('0x20'))[_0x6c13('0x21')](socket);var jayson=require(_0x6c13('0x22'));var client=jayson['client'][_0x6c13('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x1ff6e5,_0xd9dbdd,_0x451585,_0x28659e){return new BPromise(function(_0x4c2d6d,_0x43ac15){var _0x5aa161=_0x28659e||client;return _0x5aa161[_0x6c13('0x24')](_0x1ff6e5,_0x451585)[_0x6c13('0x25')](function(_0x86427a){logger['info'](_0x6c13('0x26'),_0xd9dbdd,_0x6c13('0x27'));logger[_0x6c13('0x28')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0xd9dbdd,'request\x20sent',JSON['stringify'](_0x86427a));if(_0x86427a[_0x6c13('0x29')]){if(_0x86427a['error'][_0x6c13('0x2a')]===0x1f4){logger['error'](_0x6c13('0x26'),_0xd9dbdd,_0x86427a[_0x6c13('0x29')][_0x6c13('0x2b')]);return _0x43ac15(_0x86427a['error'][_0x6c13('0x2b')]);}logger[_0x6c13('0x29')](_0x6c13('0x26'),_0xd9dbdd,_0x86427a[_0x6c13('0x29')]['message']);return _0x4c2d6d(_0x86427a[_0x6c13('0x29')][_0x6c13('0x2b')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0xd9dbdd,'request\x20sent');_0x4c2d6d(_0x86427a[_0x6c13('0x2c')][_0x6c13('0x2b')]);}})['catch'](function(_0x3a9e05){logger[_0x6c13('0x29')](_0x6c13('0x26'),_0xd9dbdd,_0x3a9e05);_0x43ac15(_0x3a9e05);});});}function respondWithStatusCode(_0x169535,_0x44e43a){_0x44e43a=_0x44e43a||0xcc;return function(_0x3f8aa2){if(_0x3f8aa2){return _0x169535['sendStatus'](_0x44e43a);}return _0x169535[_0x6c13('0x2d')](_0x44e43a)['end']();};}function respondWithResult(_0x13598a,_0xa150ec){_0xa150ec=_0xa150ec||0xc8;return function(_0x57e86d){if(_0x57e86d){return _0x13598a['status'](_0xa150ec)[_0x6c13('0x2e')](_0x57e86d);}};}function respondWithFilteredResult(_0x56eeee,_0x55bc01){return function(_0x1e969f){if(_0x1e969f){var _0x14d0ff=typeof _0x55bc01[_0x6c13('0x2f')]===_0x6c13('0x30')&&typeof _0x55bc01[_0x6c13('0x31')]==='undefined';var _0x462472=_0x1e969f[_0x6c13('0x32')];var _0x3b5cee=_0x14d0ff?0x0:_0x55bc01[_0x6c13('0x2f')];var _0x26463f=_0x14d0ff?_0x1e969f[_0x6c13('0x32')]:_0x55bc01[_0x6c13('0x2f')]+_0x55bc01[_0x6c13('0x31')];var _0xc56a79;if(_0x26463f>=_0x462472){_0x26463f=_0x462472;_0xc56a79=0xc8;}else{_0xc56a79=0xce;}_0x56eeee[_0x6c13('0x2d')](_0xc56a79);return _0x56eeee['set'](_0x6c13('0x33'),_0x3b5cee+'-'+_0x26463f+'/'+_0x462472)[_0x6c13('0x2e')](_0x1e969f);}return null;};}function patchUpdates(_0xf766a){return function(_0x3d995f){try{jsonpatch[_0x6c13('0x34')](_0x3d995f,_0xf766a,!![]);}catch(_0x3eb077){return BPromise[_0x6c13('0x35')](_0x3eb077);}return _0x3d995f['save']();};}function saveUpdates(_0x25e6dd,_0x45ca4e){return function(_0x28b5e3){if(_0x28b5e3){return _0x28b5e3[_0x6c13('0x36')](_0x25e6dd)[_0x6c13('0x25')](function(_0x416df2){return _0x416df2;});}return null;};}function removeEntity(_0x325fbb,_0x4aedca){return function(_0x10992f){if(_0x10992f){return _0x10992f[_0x6c13('0x37')]()[_0x6c13('0x25')](function(){var _0x45ff30=_0x10992f[_0x6c13('0x38')]({'plain':!![]});var _0x290c2b=_0x6c13('0x39');return db['UserProfileResource'][_0x6c13('0x37')]({'where':{'type':_0x290c2b,'resourceId':_0x45ff30['id']}})['then'](function(){return _0x10992f;});})[_0x6c13('0x25')](function(){_0x325fbb[_0x6c13('0x2d')](0xcc)[_0x6c13('0x3a')]();});}};}function handleEntityNotFound(_0x84256e,_0x176cbe){return function(_0x3e331e){if(!_0x3e331e){_0x84256e[_0x6c13('0x3b')](0x194);}return _0x3e331e;};}function handleError(_0x5c405c,_0x25df21){_0x25df21=_0x25df21||0x1f4;return function(_0x434f16){logger[_0x6c13('0x29')](_0x434f16[_0x6c13('0x3c')]);if(_0x434f16[_0x6c13('0x3d')]){delete _0x434f16[_0x6c13('0x3d')];}_0x5c405c[_0x6c13('0x2d')](_0x25df21)[_0x6c13('0x3e')](_0x434f16);};}exports['index']=function(_0xea5bcc,_0x3a1391){var _0xe2f74a={},_0x41f67e={},_0x255783={'count':0x0,'rows':[]};var _0x27af50=_['map'](db[_0x6c13('0x3f')]['rawAttributes'],function(_0x80e256){return{'name':_0x80e256[_0x6c13('0x40')],'type':_0x80e256[_0x6c13('0x41')][_0x6c13('0x42')]};});_0x41f67e['model']=_[_0x6c13('0x43')](_0x27af50,_0x6c13('0x3d'));_0x41f67e[_0x6c13('0x44')]=_['keys'](_0xea5bcc['query']);_0x41f67e['filters']=_[_0x6c13('0x45')](_0x41f67e['model'],_0x41f67e[_0x6c13('0x44')]);_0xe2f74a[_0x6c13('0x46')]=_[_0x6c13('0x45')](_0x41f67e[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x48')]));_0xe2f74a['attributes']=_0xe2f74a[_0x6c13('0x46')]['length']?_0xe2f74a[_0x6c13('0x46')]:_0x41f67e[_0x6c13('0x47')];if(!_0xea5bcc['query'][_0x6c13('0x49')]('nolimit')){_0xe2f74a[_0x6c13('0x31')]=qs[_0x6c13('0x31')](_0xea5bcc['query'][_0x6c13('0x31')]);_0xe2f74a[_0x6c13('0x2f')]=qs[_0x6c13('0x2f')](_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x2f')]);}_0xe2f74a[_0x6c13('0x4a')]=qs[_0x6c13('0x4b')](_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x4b')]);_0xe2f74a[_0x6c13('0x4c')]=qs[_0x6c13('0x4d')](_[_0x6c13('0x4e')](_0xea5bcc[_0x6c13('0x44')],_0x41f67e[_0x6c13('0x4d')]),_0x27af50);if(_0xea5bcc['query'][_0x6c13('0x4f')]){_0xe2f74a[_0x6c13('0x4c')]=_[_0x6c13('0x50')](_0xe2f74a[_0x6c13('0x4c')],{'$or':_[_0x6c13('0x43')](_0x27af50,function(_0x47988f){if(_0x47988f[_0x6c13('0x41')]!==_0x6c13('0x51')){var _0x3c9dde={};_0x3c9dde[_0x47988f[_0x6c13('0x3d')]]={'$like':'%'+_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x4f')]+'%'};return _0x3c9dde;}})});}_0xe2f74a=_['merge']({},_0xe2f74a,_0xea5bcc[_0x6c13('0x52')]);var _0x4acc28={'where':_0xe2f74a['where']};return db[_0x6c13('0x3f')][_0x6c13('0x32')](_0x4acc28)[_0x6c13('0x25')](function(_0x5cd64e){_0x255783[_0x6c13('0x32')]=_0x5cd64e;if(_0xea5bcc[_0x6c13('0x44')][_0x6c13('0x53')]){_0xe2f74a[_0x6c13('0x54')]=[{'all':!![]}];}return db[_0x6c13('0x3f')][_0x6c13('0x55')](_0xe2f74a);})['then'](function(_0x4b4a80){_0x255783[_0x6c13('0x56')]=_0x4b4a80;return _0x255783;})[_0x6c13('0x25')](respondWithFilteredResult(_0x3a1391,_0xe2f74a))[_0x6c13('0x57')](handleError(_0x3a1391,null));};exports['show']=function(_0x1cd566,_0x3d0975){var _0x4b0e4b={'raw':!![],'where':{'id':_0x1cd566[_0x6c13('0x58')]['id']}},_0x47caa6={};_0x47caa6[_0x6c13('0x47')]=_[_0x6c13('0x59')](db[_0x6c13('0x3f')][_0x6c13('0x5a')]);_0x47caa6[_0x6c13('0x44')]=_[_0x6c13('0x59')](_0x1cd566[_0x6c13('0x44')]);_0x47caa6[_0x6c13('0x4d')]=_['intersection'](_0x47caa6['model'],_0x47caa6[_0x6c13('0x44')]);_0x4b0e4b[_0x6c13('0x46')]=_[_0x6c13('0x45')](_0x47caa6[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0x1cd566[_0x6c13('0x44')][_0x6c13('0x48')]));_0x4b0e4b[_0x6c13('0x46')]=_0x4b0e4b[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x4b0e4b[_0x6c13('0x46')]:_0x47caa6[_0x6c13('0x47')];if(_0x1cd566['query'][_0x6c13('0x53')]){_0x4b0e4b[_0x6c13('0x54')]=[{'all':!![]}];}_0x4b0e4b=_[_0x6c13('0x50')]({},_0x4b0e4b,_0x1cd566[_0x6c13('0x52')]);return db[_0x6c13('0x3f')]['find'](_0x4b0e4b)[_0x6c13('0x25')](handleEntityNotFound(_0x3d0975,null))['then'](respondWithResult(_0x3d0975,null))[_0x6c13('0x57')](handleError(_0x3d0975,null));};exports['create']=function(_0x585803,_0x202a34){return db[_0x6c13('0x3f')]['create'](_0x585803['body'],{})[_0x6c13('0x25')](function(_0x759769){var _0x21b915=_0x585803[_0x6c13('0x5c')]['get']({'plain':!![]});if(!_0x21b915)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21b915[_0x6c13('0x5d')]===_0x6c13('0x5c')){var _0xd0a14b=_0x759769['get']({'plain':!![]});var _0x368ba5=_0x6c13('0x39');return db[_0x6c13('0x5e')]['find']({'where':{'name':_0x368ba5,'userProfileId':_0x21b915[_0x6c13('0x5f')]},'raw':!![]})['then'](function(_0x3b24f9){if(_0x3b24f9&&_0x3b24f9['autoAssociation']===0x0){return db[_0x6c13('0x60')][_0x6c13('0x61')]({'name':_0xd0a14b[_0x6c13('0x3d')],'resourceId':_0xd0a14b['id'],'type':_0x3b24f9['name'],'sectionId':_0x3b24f9['id']},{})[_0x6c13('0x25')](function(){return _0x759769;});}else{return _0x759769;}})[_0x6c13('0x57')](function(_0x5df913){logger[_0x6c13('0x29')](_0x6c13('0x62'),_0x5df913);throw _0x5df913;});}return _0x759769;})[_0x6c13('0x25')](respondWithResult(_0x202a34,0xc9))[_0x6c13('0x57')](handleError(_0x202a34,null));};exports[_0x6c13('0x36')]=function(_0x33051f,_0x40796f){if(_0x33051f['body']['id']){delete _0x33051f['body']['id'];}return db['ChatQueue'][_0x6c13('0x63')]({'where':{'id':_0x33051f['params']['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x40796f,null))[_0x6c13('0x25')](saveUpdates(_0x33051f[_0x6c13('0x64')],null))['then'](respondWithResult(_0x40796f,null))[_0x6c13('0x57')](handleError(_0x40796f,null));};exports[_0x6c13('0x37')]=function(_0x429b7a,_0x892da3){return db[_0x6c13('0x3f')]['find']({'where':{'id':_0x429b7a[_0x6c13('0x58')]['id']}})['then'](handleEntityNotFound(_0x892da3,null))[_0x6c13('0x25')](removeEntity(_0x892da3,null))[_0x6c13('0x57')](handleError(_0x892da3,null));};exports[_0x6c13('0x65')]=function(_0x5484ce,_0x373d77){return db[_0x6c13('0x3f')][_0x6c13('0x65')]()[_0x6c13('0x25')](respondWithResult(_0x373d77,null))[_0x6c13('0x57')](handleError(_0x373d77,null));};exports['getMembers']=function(_0x17dc1f,_0x202b1e,_0xb894be){var _0x246bcc={'raw':!![],'where':{}},_0x566392={},_0x496b27;return db[_0x6c13('0x3f')][_0x6c13('0x66')]({'where':{'id':_0x17dc1f['params']['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x202b1e,null))['then'](function(_0x3a89eb){if(_0x3a89eb){_0x496b27=_0x3a89eb[_0x6c13('0x38')]({'plain':!![]});_0x566392[_0x6c13('0x47')]=_[_0x6c13('0x59')](db[_0x6c13('0x67')][_0x6c13('0x5a')]);_0x566392[_0x6c13('0x44')]=_[_0x6c13('0x59')](_0x17dc1f[_0x6c13('0x44')]);_0x566392[_0x6c13('0x4d')]=_[_0x6c13('0x45')](_0x566392['model'],_0x566392[_0x6c13('0x44')]);_0x246bcc[_0x6c13('0x46')]=_[_0x6c13('0x45')](_0x566392['model'],qs[_0x6c13('0x48')](_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x48')]));_0x246bcc[_0x6c13('0x46')]=_0x246bcc[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x246bcc[_0x6c13('0x46')]:_0x566392[_0x6c13('0x47')];if(!_0x17dc1f['query'][_0x6c13('0x49')](_0x6c13('0x68'))){_0x246bcc[_0x6c13('0x31')]=qs['limit'](_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x31')]);_0x246bcc[_0x6c13('0x2f')]=qs[_0x6c13('0x2f')](_0x17dc1f[_0x6c13('0x44')]['offset']);}_0x246bcc[_0x6c13('0x4a')]=qs['sort'](_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x4b')]);_0x246bcc['where']=qs['filters'](_[_0x6c13('0x4e')](_0x17dc1f['query'],_0x566392[_0x6c13('0x4d')]));_0x246bcc[_0x6c13('0x4c')][_0x6c13('0x69')]=_0x3a89eb['id'];if(_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x4f')]){_0x246bcc[_0x6c13('0x4c')]=_['merge'](_0x246bcc['where'],{'$or':_[_0x6c13('0x43')](_0x246bcc[_0x6c13('0x46')],function(_0x24344c){var _0x4204da={};_0x4204da[_0x24344c]={'$like':'%'+_0x17dc1f[_0x6c13('0x44')][_0x6c13('0x4f')]+'%'};return _0x4204da;})});}_0x246bcc=_[_0x6c13('0x50')]({},_0x246bcc,_0x17dc1f['options']);return db['UserChatQueue'][_0x6c13('0x55')](_0x246bcc);}})[_0x6c13('0x25')](function(_0x518dea){if(_0x518dea){return db[_0x6c13('0x6a')][_0x6c13('0x6b')]({'where':{'id':_[_0x6c13('0x43')](_0x518dea,'UserId'),'role':_0x6c13('0x6c')},'attributes':['id',_0x6c13('0x3d'),_0x6c13('0x6d'),'updatedAt','createdAt']});}})[_0x6c13('0x25')](function(_0x205675){if(_0x205675){return{'count':_0x205675[_0x6c13('0x32')],'rows':_[_0x6c13('0x43')](_0x205675[_0x6c13('0x56')],function(_0x99d3fc){return{'membername':_0x99d3fc[_0x6c13('0x3d')],'UserId':_0x99d3fc['id'],'queue_name':_0x496b27[_0x6c13('0x3d')],'ChatQueueId':_0x496b27['id'],'interface':util['format'](_0x6c13('0x6e'),_0x6c13('0x6f'),_0x99d3fc['name']),'penalty':0x0,'paused':_0x99d3fc[_0x6c13('0x6d')],'createdAt':_0x99d3fc[_0x6c13('0x70')],'updatedAt':_0x99d3fc[_0x6c13('0x71')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6c13('0x25')](respondWithFilteredResult(_0x202b1e,_0x246bcc))[_0x6c13('0x57')](handleError(_0x202b1e,null));};exports[_0x6c13('0x72')]=function(_0x5de91a,_0x34a169,_0x26e935){var _0x15c08a={};var _0x5dbbe8={};var _0x39867b;var _0x537103;return db['ChatQueue'][_0x6c13('0x66')]({'where':{'id':_0x5de91a[_0x6c13('0x58')]['id']}})['then'](handleEntityNotFound(_0x34a169,null))[_0x6c13('0x25')](function(_0x16f4ec){if(_0x16f4ec){_0x39867b=_0x16f4ec;_0x5dbbe8['model']=_['keys'](db['Team'][_0x6c13('0x5a')]);_0x5dbbe8[_0x6c13('0x44')]=_[_0x6c13('0x59')](_0x5de91a['query']);_0x5dbbe8[_0x6c13('0x4d')]=_[_0x6c13('0x45')](_0x5dbbe8[_0x6c13('0x47')],_0x5dbbe8[_0x6c13('0x44')]);_0x15c08a['attributes']=_[_0x6c13('0x45')](_0x5dbbe8[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0x5de91a['query'][_0x6c13('0x48')]));_0x15c08a[_0x6c13('0x46')]=_0x15c08a[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x15c08a['attributes']:_0x5dbbe8[_0x6c13('0x47')];_0x15c08a[_0x6c13('0x4a')]=qs[_0x6c13('0x4b')](_0x5de91a[_0x6c13('0x44')][_0x6c13('0x4b')]);_0x15c08a[_0x6c13('0x4c')]=qs['filters'](_[_0x6c13('0x4e')](_0x5de91a['query'],_0x5dbbe8[_0x6c13('0x4d')]));if(_0x5de91a['query'][_0x6c13('0x4f')]){_0x15c08a['where']=_[_0x6c13('0x50')](_0x15c08a['where'],{'$or':_[_0x6c13('0x43')](_0x15c08a[_0x6c13('0x46')],function(_0xf26a1f){var _0x49803c={};_0x49803c[_0xf26a1f]={'$like':'%'+_0x5de91a['query'][_0x6c13('0x4f')]+'%'};return _0x49803c;})});}_0x15c08a=_[_0x6c13('0x50')]({},_0x15c08a,_0x5de91a[_0x6c13('0x52')]);return _0x39867b[_0x6c13('0x72')](_0x15c08a);}})[_0x6c13('0x25')](function(_0x5cb5a2){if(_0x5cb5a2){_0x537103=_0x5cb5a2[_0x6c13('0x5b')];if(!_0x5de91a[_0x6c13('0x44')]['hasOwnProperty']('nolimit')){_0x15c08a[_0x6c13('0x31')]=qs['limit'](_0x5de91a['query']['limit']);_0x15c08a['offset']=qs[_0x6c13('0x2f')](_0x5de91a[_0x6c13('0x44')][_0x6c13('0x2f')]);}return _0x39867b[_0x6c13('0x72')](_0x15c08a);}})[_0x6c13('0x25')](function(_0x5af7cb){if(_0x5af7cb){return _0x5af7cb?{'count':_0x537103,'rows':_0x5af7cb}:null;}})[_0x6c13('0x25')](respondWithResult(_0x34a169,null))[_0x6c13('0x57')](handleError(_0x34a169,null));};exports[_0x6c13('0x73')]=function(_0x34f935,_0xefe9ea,_0x44bb77){var _0x577065=_0x34f935[_0x6c13('0x64')]['ids'];return db['Team'][_0x6c13('0x55')]({'where':{'id':_0x577065},'attributes':['id'],'include':[{'model':db[_0x6c13('0x6a')],'as':_0x6c13('0x74'),'attributes':['id','name',_0x6c13('0x75'),_0x6c13('0x76'),_0x6c13('0x77')],'raw':!![]}]})['then'](function(_0x31a451){if(_0x31a451){var _0x508aa5=_['flatMap'](_0x31a451,function(_0xb738a9){var _0x31f9f8=_0xb738a9[_0x6c13('0x38')]({'plain':!![]});return _0x31f9f8['Agents'];});return db[_0x6c13('0x3f')][_0x6c13('0x63')]({'where':{'id':_0x34f935[_0x6c13('0x58')]['id']}})['then'](function(_0x26497a){return db[_0x6c13('0x78')][_0x6c13('0x79')](function(_0x4cf6ff){return _0x26497a['addTeams'](_0x577065,{'transaction':_0x4cf6ff})['then'](function(){return BPromise['each'](_0x508aa5,function(_0x4fc8b6){return db[_0x6c13('0x67')][_0x6c13('0x7a')]({'where':{'UserId':_0x4fc8b6['id'],'ChatQueueId':_0x34f935[_0x6c13('0x58')]['id']},'transaction':_0x4cf6ff});});})[_0x6c13('0x25')](function(){_0x508aa5[_0x6c13('0x7b')](function(_0x2185b8){socket[_0x6c13('0x7c')]('userChatQueue:save',{'UserId':_0x2185b8['id'],'ChatQueueId':_0x26497a['id']});});});});});}})[_0x6c13('0x25')](respondWithStatusCode(_0xefe9ea,null))[_0x6c13('0x57')](handleError(_0xefe9ea,null));};exports['removeTeams']=function(_0x5b446f,_0x2c1361,_0x38901a){return db[_0x6c13('0x7d')][_0x6c13('0x55')]({'where':{'id':_0x5b446f[_0x6c13('0x44')]['ids']},'attributes':['id'],'include':[{'model':db[_0x6c13('0x6a')],'as':_0x6c13('0x74'),'attributes':['id'],'raw':!![]}]})[_0x6c13('0x25')](handleEntityNotFound(_0x2c1361,null))[_0x6c13('0x25')](function(_0x475642){var _0x4cfe66=_[_0x6c13('0x43')](_0x475642,'id');var _0x536625=[];var _0x38c7c4=[];var _0x444bf1=squel['select']();_0x444bf1['field'](_0x6c13('0x7e'))['from'](_0x6c13('0x7f'),'tq')[_0x6c13('0x80')](_0x6c13('0x81'),'ut',_0x6c13('0x82'))[_0x6c13('0x4c')](_0x6c13('0x83'),_0x5b446f[_0x6c13('0x58')]['id']);for(var _0x22bb1a=0x0;_0x22bb1a<_0x475642[_0x6c13('0x5b')];_0x22bb1a+=0x1){let _0x1e0193=_0x475642[_0x22bb1a];for(var _0x5ce7cb=0x0;_0x5ce7cb<_0x1e0193[_0x6c13('0x74')]['length'];_0x5ce7cb+=0x1){let _0x50987a=_0x1e0193[_0x6c13('0x74')][_0x5ce7cb];var _0xff70f0=_0x444bf1[_0x6c13('0x84')]();_0xff70f0[_0x6c13('0x4c')]('ut.UserId\x20=\x20?',_0x50987a['id']);_0x38c7c4[_0x6c13('0x85')](db[_0x6c13('0x78')][_0x6c13('0x44')](_0xff70f0[_0x6c13('0x86')](),{'type':db[_0x6c13('0x78')][_0x6c13('0x87')]['SELECT']})[_0x6c13('0x25')](function(_0x43f1cf){if(_0x43f1cf[_0x6c13('0x5b')]===0x1){return _0x50987a['id'];}else{var _0x5d355d=_['every'](_[_0x6c13('0x43')](_0x43f1cf,_0x6c13('0x88')),function(_0x23a172){return _[_0x6c13('0x89')](_0x4cfe66,_0x23a172);});if(_0x5d355d){return _0x50987a['id'];}}}));}}return BPromise[_0x6c13('0x8a')](_0x38c7c4)[_0x6c13('0x25')](function(_0x20620e){_0x536625=_(_0x536625)[_0x6c13('0x8b')](_0x20620e)[_0x6c13('0x8c')]()[_0x6c13('0x8d')]();return db[_0x6c13('0x3f')][_0x6c13('0x63')]({'where':{'id':_0x5b446f[_0x6c13('0x58')]['id']}})[_0x6c13('0x25')](function(_0x3ffe50){return db[_0x6c13('0x78')][_0x6c13('0x79')](function(_0x54e875){return _0x3ffe50[_0x6c13('0x8e')](_0x5b446f[_0x6c13('0x44')][_0x6c13('0x8f')],{'transaction':_0x54e875})[_0x6c13('0x25')](function(){if(!_[_0x6c13('0x90')](_0x536625)){return _0x3ffe50[_0x6c13('0x91')](_0x536625,{'transaction':_0x54e875});}})[_0x6c13('0x25')](function(){_0x536625['forEach'](function(_0x17e1da){socket['emit'](_0x6c13('0x92'),{'UserId':_0x17e1da,'ChatQueueId':_0x3ffe50['id']});});});});});});})['then'](respondWithStatusCode(_0x2c1361,null))[_0x6c13('0x57')](handleError(_0x2c1361,null));};exports[_0x6c13('0x93')]=function(_0x5a5884,_0x105b30,_0xc733e7){return db['ChatQueue'][_0x6c13('0x63')]({'where':{'id':_0x5a5884[_0x6c13('0x58')]['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x105b30,null))[_0x6c13('0x25')](function(_0x456f55){if(_0x456f55){return _0x456f55[_0x6c13('0x93')](_0x5a5884[_0x6c13('0x64')][_0x6c13('0x8f')],_['omit'](_0x5a5884[_0x6c13('0x64')],[_0x6c13('0x8f'),'id'])||{})[_0x6c13('0x94')](function(_0x41c941){for(var _0x30dfa6=0x0;_0x30dfa6<_0x5a5884['body'][_0x6c13('0x8f')][_0x6c13('0x5b')];_0x30dfa6+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x5a5884[_0x6c13('0x64')][_0x6c13('0x8f')][_0x30dfa6]),'ChatQueueId':Number(_0x5a5884[_0x6c13('0x58')]['id'])});}return _0x41c941;});}})[_0x6c13('0x25')](respondWithResult(_0x105b30,null))[_0x6c13('0x57')](handleError(_0x105b30,null));};exports[_0x6c13('0x91')]=function(_0x409c48,_0xc0f4d3,_0x35d00b){return db['ChatQueue'][_0x6c13('0x63')]({'where':{'id':_0x409c48[_0x6c13('0x58')]['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0xc0f4d3,null))[_0x6c13('0x25')](function(_0x4e028d){if(_0x4e028d){return _0x4e028d['removeAgents'](_0x409c48['query'][_0x6c13('0x8f')])['then'](function(){if(_[_0x6c13('0x95')](_0x409c48[_0x6c13('0x44')][_0x6c13('0x8f')])){for(var _0x2626d6=0x0;_0x2626d6<_0x409c48['query'][_0x6c13('0x8f')][_0x6c13('0x5b')];_0x2626d6+=0x1){socket[_0x6c13('0x7c')](_0x6c13('0x92'),{'UserId':Number(_0x409c48['query'][_0x6c13('0x8f')][_0x2626d6]),'ChatQueueId':Number(_0x409c48[_0x6c13('0x58')]['id'])});}}else{socket[_0x6c13('0x7c')](_0x6c13('0x92'),{'UserId':Number(_0x409c48['query']['ids']),'ChatQueueId':Number(_0x409c48[_0x6c13('0x58')]['id'])});}});}})[_0x6c13('0x25')](respondWithStatusCode(_0xc0f4d3,null))[_0x6c13('0x57')](handleError(_0xc0f4d3,null));};exports[_0x6c13('0x96')]=function(_0x5f274c,_0x310ee1,_0xd06892){var _0x83cccf={};var _0x4c4f2b={};var _0x1c93fd;var _0x2ae5bf;return db['ChatQueue']['findOne']({'where':{'id':_0x5f274c['params']['id']}})[_0x6c13('0x25')](handleEntityNotFound(_0x310ee1,null))[_0x6c13('0x25')](function(_0x15994c){if(_0x15994c){_0x1c93fd=_0x15994c;_0x4c4f2b[_0x6c13('0x47')]=_[_0x6c13('0x59')](db[_0x6c13('0x6a')]['rawAttributes']);_0x4c4f2b[_0x6c13('0x44')]=_['keys'](_0x5f274c[_0x6c13('0x44')]);_0x4c4f2b[_0x6c13('0x4d')]=_['intersection'](_0x4c4f2b[_0x6c13('0x47')],_0x4c4f2b['query']);_0x83cccf['attributes']=_[_0x6c13('0x45')](_0x4c4f2b[_0x6c13('0x47')],qs[_0x6c13('0x48')](_0x5f274c[_0x6c13('0x44')][_0x6c13('0x48')]));_0x83cccf['attributes']=_0x83cccf[_0x6c13('0x46')][_0x6c13('0x5b')]?_0x83cccf[_0x6c13('0x46')]:_0x4c4f2b[_0x6c13('0x47')];_0x83cccf[_0x6c13('0x4a')]=qs['sort'](_0x5f274c[_0x6c13('0x44')]['sort']);_0x83cccf[_0x6c13('0x4c')]=qs[_0x6c13('0x4d')](_[_0x6c13('0x4e')](_0x5f274c[_0x6c13('0x44')],_0x4c4f2b[_0x6c13('0x4d')]));if(_0x5f274c[_0x6c13('0x44')]['filter']){_0x83cccf[_0x6c13('0x4c')]=_[_0x6c13('0x50')](_0x83cccf['where'],{'$or':_[_0x6c13('0x43')](_0x83cccf[_0x6c13('0x46')],function(_0x169c94){var _0xf946e7={};_0xf946e7[_0x169c94]={'$like':'%'+_0x5f274c[_0x6c13('0x44')]['filter']+'%'};return _0xf946e7;})});}_0x83cccf=_[_0x6c13('0x50')]({},_0x83cccf,_0x5f274c[_0x6c13('0x52')]);return _0x1c93fd[_0x6c13('0x96')](_0x83cccf);}})['then'](function(_0x151228){if(_0x151228){_0x2ae5bf=_0x151228[_0x6c13('0x5b')];if(!_0x5f274c[_0x6c13('0x44')][_0x6c13('0x49')](_0x6c13('0x68'))){_0x83cccf[_0x6c13('0x31')]=qs[_0x6c13('0x31')](_0x5f274c[_0x6c13('0x44')][_0x6c13('0x31')]);_0x83cccf[_0x6c13('0x2f')]=qs[_0x6c13('0x2f')](_0x5f274c[_0x6c13('0x44')]['offset']);}return _0x1c93fd['getAgents'](_0x83cccf);}})[_0x6c13('0x25')](function(_0x537521){if(_0x537521){return _0x537521?{'count':_0x2ae5bf,'rows':_0x537521}:null;}})[_0x6c13('0x25')](respondWithResult(_0x310ee1,null))[_0x6c13('0x57')](handleError(_0x310ee1,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 3df46b2..35e5536 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 _0x028d=['hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0xdad15f,_0x2c1f8c){var _0x129e37=function(_0x5449e6){while(--_0x5449e6){_0xdad15f['push'](_0xdad15f['shift']());}};_0x129e37(++_0x2c1f8c);}(_0x028d,0xff));var _0xd028=function(_0x557b3e,_0x29b942){_0x557b3e=_0x557b3e-0x0;var _0x3f3712=_0x028d[_0x557b3e];return _0x3f3712;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xd028('0x0'))['db'][_0xd028('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd028('0x2'),'afterUpdate':_0xd028('0x3'),'afterDestroy':_0xd028('0x4')};function emitEvent(_0x33a4b7){return function(_0x2dc43c,_0x67d150,_0x5094d8){ChatQueueEvents[_0xd028('0x5')](_0x33a4b7+':'+_0x2dc43c['id'],_0x2dc43c);ChatQueueEvents[_0xd028('0x5')](_0x33a4b7,_0x2dc43c);_0x5094d8(null);};}for(var e in events){if(events[_0xd028('0x6')](e)){var event=events[e];ChatQueue[_0xd028('0x7')](e,emitEvent(event));}}module[_0xd028('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0xcf7d=['update','emit','hasOwnProperty','hook','exports','ChatQueue','setMaxListeners'];(function(_0x240261,_0x4fe66c){var _0x45c332=function(_0x4f367a){while(--_0x4f367a){_0x240261['push'](_0x240261['shift']());}};_0x45c332(++_0x4fe66c);}(_0xcf7d,0x8a));var _0xdcf7=function(_0x895ef4,_0x9fbb78){_0x895ef4=_0x895ef4-0x0;var _0x3d62fd=_0xcf7d[_0x895ef4];return _0x3d62fd;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0xdcf7('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdcf7('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdcf7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x13821d){return function(_0x5502a8,_0x29cdf4,_0x27868c){ChatQueueEvents[_0xdcf7('0x3')](_0x13821d+':'+_0x5502a8['id'],_0x5502a8);ChatQueueEvents[_0xdcf7('0x3')](_0x13821d,_0x5502a8);_0x27868c(null);};}for(var e in events){if(events[_0xdcf7('0x4')](e)){var event=events[e];ChatQueue[_0xdcf7('0x5')](e,emitEvent(event));}}module[_0xdcf7('0x6')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index d4c5c1f..2b6da86 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 _0xcfe9=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger'];(function(_0x2c2596,_0x26f279){var _0x269abc=function(_0x5c19c9){while(--_0x5c19c9){_0x2c2596['push'](_0x2c2596['shift']());}};_0x269abc(++_0x26f279);}(_0xcfe9,0x72));var _0x9cfe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfe9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9cfe('0x0'));var util=require(_0x9cfe('0x1'));var logger=require(_0x9cfe('0x2'))(_0x9cfe('0x3'));var moment=require(_0x9cfe('0x4'));var BPromise=require('bluebird');var rp=require(_0x9cfe('0x5'));var fs=require('fs');var path=require(_0x9cfe('0x6'));var rimraf=require(_0x9cfe('0x7'));var config=require(_0x9cfe('0x8'));var attributes=require('./chatQueue.attributes');module[_0x9cfe('0x9')]=function(_0x49a3e7,_0x289ae5){return _0x49a3e7[_0x9cfe('0xa')](_0x9cfe('0xb'),attributes,{'tableName':_0x9cfe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe24=['exports','define','ChatQueue','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatQueue.attributes'];(function(_0x5bf4c5,_0x2f7cab){var _0x10dfdd=function(_0x319a08){while(--_0x319a08){_0x5bf4c5['push'](_0x5bf4c5['shift']());}};_0x10dfdd(++_0x2f7cab);}(_0xbe24,0x16b));var _0x4be2=function(_0x3ed7aa,_0x3d556c){_0x3ed7aa=_0x3ed7aa-0x0;var _0x503cce=_0xbe24[_0x3ed7aa];return _0x503cce;};'use strict';var _=require(_0x4be2('0x0'));var util=require(_0x4be2('0x1'));var logger=require(_0x4be2('0x2'))(_0x4be2('0x3'));var moment=require(_0x4be2('0x4'));var BPromise=require(_0x4be2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4be2('0x6'));var rimraf=require('rimraf');var config=require(_0x4be2('0x7'));var attributes=require(_0x4be2('0x8'));module[_0x4be2('0x9')]=function(_0x29d655,_0x306a5e){return _0x29d655[_0x4be2('0xa')](_0x4be2('0xb'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index 38d1011..2b28537 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 _0x7e27=['error','code','ChatQueue,\x20%s,\x20%s','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','stringify','catch','find','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','request\x20sent','debug'];(function(_0x1f68c6,_0x36a94d){var _0x2374df=function(_0x131a75){while(--_0x131a75){_0x1f68c6['push'](_0x1f68c6['shift']());}};_0x2374df(++_0x36a94d);}(_0x7e27,0xdd));var _0x77e2=function(_0x36e3ba,_0x1912e8){_0x36e3ba=_0x36e3ba-0x0;var _0x7972c7=_0x7e27[_0x36e3ba];return _0x7972c7;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});config[_0x77e2('0xa')]=_[_0x77e2('0xb')](config['redis'],{'host':_0x77e2('0xc'),'port':0x18eb});var socket=require(_0x77e2('0xd'))(new Redis(config[_0x77e2('0xa')]));require(_0x77e2('0xe'))[_0x77e2('0xf')](socket);function respondWithRpcPromise(_0x1907e9,_0x23583e,_0x5a5789){return new BPromise(function(_0x5022db,_0x1b4740){return client['request'](_0x1907e9,_0x5a5789)[_0x77e2('0x10')](function(_0xf8293f){logger['info']('ChatQueue,\x20%s,\x20%s',_0x23583e,_0x77e2('0x11'));logger[_0x77e2('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x23583e,_0x77e2('0x11'),JSON['stringify'](_0xf8293f));if(_0xf8293f['error']){if(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x14')]===0x1f4){logger[_0x77e2('0x13')](_0x77e2('0x15'),_0x23583e,_0xf8293f[_0x77e2('0x13')]['message']);return _0x1b4740(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);}logger['error'](_0x77e2('0x15'),_0x23583e,_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);return _0x5022db(_0xf8293f[_0x77e2('0x13')][_0x77e2('0x16')]);}else{logger[_0x77e2('0x17')](_0x77e2('0x15'),_0x23583e,_0x77e2('0x11'));_0x5022db(_0xf8293f[_0x77e2('0x18')][_0x77e2('0x16')]);}})['catch'](function(_0x375fb0){logger[_0x77e2('0x13')](_0x77e2('0x15'),_0x23583e,_0x375fb0);_0x1b4740(_0x375fb0);});});}exports[_0x77e2('0x19')]=function(_0x3774b3){var _0x2aae6c=this;return new Promise(function(_0x1a5415,_0x1e5273){return db[_0x77e2('0x1a')][_0x77e2('0x1b')]({'raw':_0x3774b3[_0x77e2('0x1c')]?_0x3774b3['options'][_0x77e2('0x1d')]===undefined?!![]:![]:!![],'where':_0x3774b3[_0x77e2('0x1c')]?_0x3774b3['options'][_0x77e2('0x1e')]||null:null,'attributes':_0x3774b3['options']?_0x3774b3['options'][_0x77e2('0x1f')]||null:null,'limit':_0x3774b3['options']?_0x3774b3[_0x77e2('0x1c')][_0x77e2('0x20')]||null:null,'include':_0x3774b3[_0x77e2('0x1c')]?_0x3774b3['options']['include']?_[_0x77e2('0x21')](_0x3774b3['options'][_0x77e2('0x22')],function(_0x370dca){return{'model':db[_0x370dca[_0x77e2('0x23')]],'as':_0x370dca['as'],'attributes':_0x370dca['attributes'],'include':_0x370dca[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0x370dca[_0x77e2('0x22')],function(_0xa2a50f){return{'model':db[_0xa2a50f[_0x77e2('0x23')]],'as':_0xa2a50f['as'],'attributes':_0xa2a50f['attributes'],'include':_0xa2a50f[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0xa2a50f['include'],function(_0x362730){return{'model':db[_0x362730[_0x77e2('0x23')]],'as':_0x362730['as'],'attributes':_0x362730[_0x77e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77e2('0x10')](function(_0x586919){logger['info'](_0x77e2('0x19'),_0x3774b3);logger['debug']('GetChatQueue',_0x3774b3,JSON[_0x77e2('0x24')](_0x586919));_0x1a5415(_0x586919);})[_0x77e2('0x25')](function(_0x4036aa){logger[_0x77e2('0x13')]('GetChatQueue',_0x4036aa[_0x77e2('0x16')],_0x3774b3);_0x1e5273(_0x2aae6c['error'](0x1f4,_0x4036aa['message']));});});};exports['ShowChatQueue']=function(_0x2b9918){var _0x58dcb0=this;return new Promise(function(_0x5ad13e,_0x53d01a){return db[_0x77e2('0x1a')][_0x77e2('0x26')]({'raw':_0x2b9918[_0x77e2('0x1c')]?_0x2b9918[_0x77e2('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2b9918[_0x77e2('0x1c')]?_0x2b9918['options'][_0x77e2('0x1e')]||null:null,'attributes':_0x2b9918['options']?_0x2b9918[_0x77e2('0x1c')][_0x77e2('0x1f')]||null:null,'include':_0x2b9918[_0x77e2('0x1c')]?_0x2b9918[_0x77e2('0x1c')][_0x77e2('0x22')]?_[_0x77e2('0x21')](_0x2b9918[_0x77e2('0x1c')]['include'],function(_0x239568){return{'model':db[_0x239568[_0x77e2('0x23')]],'as':_0x239568['as'],'attributes':_0x239568[_0x77e2('0x1f')],'include':_0x239568[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0x239568[_0x77e2('0x22')],function(_0xcbca0a){return{'model':db[_0xcbca0a[_0x77e2('0x23')]],'as':_0xcbca0a['as'],'attributes':_0xcbca0a[_0x77e2('0x1f')],'include':_0xcbca0a[_0x77e2('0x22')]?_[_0x77e2('0x21')](_0xcbca0a[_0x77e2('0x22')],function(_0x20ea20){return{'model':db[_0x20ea20['model']],'as':_0x20ea20['as'],'attributes':_0x20ea20[_0x77e2('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77e2('0x10')](function(_0x3d0bf6){logger['info']('ShowChatQueue',_0x2b9918);logger[_0x77e2('0x12')](_0x77e2('0x27'),_0x2b9918,JSON[_0x77e2('0x24')](_0x3d0bf6));_0x5ad13e(_0x3d0bf6);})['catch'](function(_0x4a629d){logger[_0x77e2('0x13')](_0x77e2('0x27'),_0x4a629d[_0x77e2('0x16')],_0x2b9918);_0x53d01a(_0x58dcb0[_0x77e2('0x13')](0x1f4,_0x4a629d[_0x77e2('0x16')]));});});};
\ No newline at end of file
+var _0x10b8=['where','attributes','include','map','model','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options'];(function(_0x38599c,_0x5b0424){var _0x149499=function(_0x5a6e25){while(--_0x5a6e25){_0x38599c['push'](_0x38599c['shift']());}};_0x149499(++_0x5b0424);}(_0x10b8,0x166));var _0x810b=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x10b8[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x810b('0x0'));var util=require(_0x810b('0x1'));var moment=require(_0x810b('0x2'));var BPromise=require(_0x810b('0x3'));var rs=require(_0x810b('0x4'));var fs=require('fs');var Redis=require(_0x810b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x810b('0x6'));var logger=require(_0x810b('0x7'))(_0x810b('0x8'));var config=require('../../config/environment');var jayson=require(_0x810b('0x9'));var client=jayson[_0x810b('0xa')][_0x810b('0xb')]({'port':0x232a});config[_0x810b('0xc')]=_[_0x810b('0xd')](config[_0x810b('0xc')],{'host':_0x810b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x810b('0xc')]));require('./chatQueue.socket')[_0x810b('0xf')](socket);function respondWithRpcPromise(_0x3cf5cc,_0x2882aa,_0x6260ea){return new BPromise(function(_0x28be6f,_0x48101e){return client[_0x810b('0x10')](_0x3cf5cc,_0x6260ea)[_0x810b('0x11')](function(_0x288ad9){logger[_0x810b('0x12')]('ChatQueue,\x20%s,\x20%s',_0x2882aa,_0x810b('0x13'));logger[_0x810b('0x14')](_0x810b('0x15'),_0x2882aa,_0x810b('0x13'),JSON[_0x810b('0x16')](_0x288ad9));if(_0x288ad9[_0x810b('0x17')]){if(_0x288ad9[_0x810b('0x17')][_0x810b('0x18')]===0x1f4){logger[_0x810b('0x17')](_0x810b('0x19'),_0x2882aa,_0x288ad9['error']['message']);return _0x48101e(_0x288ad9[_0x810b('0x17')][_0x810b('0x1a')]);}logger[_0x810b('0x17')](_0x810b('0x19'),_0x2882aa,_0x288ad9[_0x810b('0x17')][_0x810b('0x1a')]);return _0x28be6f(_0x288ad9[_0x810b('0x17')][_0x810b('0x1a')]);}else{logger[_0x810b('0x12')](_0x810b('0x19'),_0x2882aa,'request\x20sent');_0x28be6f(_0x288ad9[_0x810b('0x1b')]['message']);}})[_0x810b('0x1c')](function(_0x22e695){logger[_0x810b('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2882aa,_0x22e695);_0x48101e(_0x22e695);});});}exports[_0x810b('0x1d')]=function(_0x569814){var _0x1ee0a0=this;return new Promise(function(_0x4ba246,_0x2906df){return db['ChatQueue'][_0x810b('0x1e')]({'raw':_0x569814[_0x810b('0x1f')]?_0x569814[_0x810b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x569814[_0x810b('0x1f')]?_0x569814['options'][_0x810b('0x20')]||null:null,'attributes':_0x569814[_0x810b('0x1f')]?_0x569814[_0x810b('0x1f')][_0x810b('0x21')]||null:null,'limit':_0x569814['options']?_0x569814[_0x810b('0x1f')]['limit']||null:null,'include':_0x569814[_0x810b('0x1f')]?_0x569814[_0x810b('0x1f')][_0x810b('0x22')]?_[_0x810b('0x23')](_0x569814['options'][_0x810b('0x22')],function(_0x4bd4f9){return{'model':db[_0x4bd4f9[_0x810b('0x24')]],'as':_0x4bd4f9['as'],'attributes':_0x4bd4f9[_0x810b('0x21')],'include':_0x4bd4f9[_0x810b('0x22')]?_['map'](_0x4bd4f9[_0x810b('0x22')],function(_0x817fd6){return{'model':db[_0x817fd6[_0x810b('0x24')]],'as':_0x817fd6['as'],'attributes':_0x817fd6[_0x810b('0x21')],'include':_0x817fd6[_0x810b('0x22')]?_[_0x810b('0x23')](_0x817fd6['include'],function(_0x4eb0f3){return{'model':db[_0x4eb0f3[_0x810b('0x24')]],'as':_0x4eb0f3['as'],'attributes':_0x4eb0f3[_0x810b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x810b('0x11')](function(_0x51352e){logger[_0x810b('0x12')]('GetChatQueue',_0x569814);logger[_0x810b('0x14')](_0x810b('0x1d'),_0x569814,JSON[_0x810b('0x16')](_0x51352e));_0x4ba246(_0x51352e);})[_0x810b('0x1c')](function(_0x83448b){logger[_0x810b('0x17')]('GetChatQueue',_0x83448b[_0x810b('0x1a')],_0x569814);_0x2906df(_0x1ee0a0['error'](0x1f4,_0x83448b[_0x810b('0x1a')]));});});};exports[_0x810b('0x25')]=function(_0x450925){var _0x551209=this;return new Promise(function(_0x41264c,_0x223b44){return db['ChatQueue'][_0x810b('0x26')]({'raw':_0x450925[_0x810b('0x1f')]?_0x450925[_0x810b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x450925[_0x810b('0x1f')]?_0x450925[_0x810b('0x1f')][_0x810b('0x20')]||null:null,'attributes':_0x450925['options']?_0x450925[_0x810b('0x1f')]['attributes']||null:null,'include':_0x450925[_0x810b('0x1f')]?_0x450925['options'][_0x810b('0x22')]?_[_0x810b('0x23')](_0x450925[_0x810b('0x1f')]['include'],function(_0x3cbe75){return{'model':db[_0x3cbe75[_0x810b('0x24')]],'as':_0x3cbe75['as'],'attributes':_0x3cbe75[_0x810b('0x21')],'include':_0x3cbe75[_0x810b('0x22')]?_[_0x810b('0x23')](_0x3cbe75[_0x810b('0x22')],function(_0x3e8ffd){return{'model':db[_0x3e8ffd[_0x810b('0x24')]],'as':_0x3e8ffd['as'],'attributes':_0x3e8ffd['attributes'],'include':_0x3e8ffd[_0x810b('0x22')]?_[_0x810b('0x23')](_0x3e8ffd[_0x810b('0x22')],function(_0x30cfc6){return{'model':db[_0x30cfc6['model']],'as':_0x30cfc6['as'],'attributes':_0x30cfc6[_0x810b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x810b('0x11')](function(_0x6a5fc3){logger[_0x810b('0x12')](_0x810b('0x25'),_0x450925);logger[_0x810b('0x14')]('ShowChatQueue',_0x450925,JSON[_0x810b('0x16')](_0x6a5fc3));_0x41264c(_0x6a5fc3);})[_0x810b('0x1c')](function(_0x2b380f){logger[_0x810b('0x17')](_0x810b('0x25'),_0x2b380f['message'],_0x450925);_0x223b44(_0x551209['error'](0x1f4,_0x2b380f[_0x810b('0x1a')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index f1fb1a9..26e64ab 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 _0x3140=['removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update','emit'];(function(_0x1a399b,_0x362692){var _0x4a555b=function(_0x5bd027){while(--_0x5bd027){_0x1a399b['push'](_0x1a399b['shift']());}};_0x4a555b(++_0x362692);}(_0x3140,0xaf));var _0x0314=function(_0x52980f,_0x47b3b0){_0x52980f=_0x52980f-0x0;var _0x1f52a1=_0x3140[_0x52980f];return _0x1f52a1;};'use strict';var ChatQueueEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){ChatQueueEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);ChatQueueEvents['on'](_0x176944,_0x495b27);}};
\ No newline at end of file
+var _0xc3b5=['length','remove','update','emit','register'];(function(_0x8536bc,_0xcce2c8){var _0x3ef537=function(_0x4fdde4){while(--_0x4fdde4){_0x8536bc['push'](_0x8536bc['shift']());}};_0x3ef537(++_0xcce2c8);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x49bf20,_0x573d06){_0x49bf20=_0x49bf20-0x0;var _0x2cef40=_0xc3b5[_0x49bf20];return _0x2cef40;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x5c3b('0x0'),_0x5c3b('0x1')];function createListener(_0xbe95d4,_0x3acf12){return function(_0x2f9a72){_0x3acf12[_0x5c3b('0x2')](_0xbe95d4,_0x2f9a72);};}function removeListener(_0x237a61,_0x48f8a1){return function(){ChatQueueEvents['removeListener'](_0x237a61,_0x48f8a1);};}exports[_0x5c3b('0x3')]=function(_0x6b8a1e){for(var _0x56345e=0x0,_0x568a28=events[_0x5c3b('0x4')];_0x56345e<_0x568a28;_0x56345e++){var _0x420839=events[_0x56345e];var _0x3892ad=createListener('chatQueue:'+_0x420839,_0x6b8a1e);ChatQueueEvents['on'](_0x420839,_0x3892ad);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index cf213bb..d2453f1 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(_0x42037b,_0xcd2d32){var _0x1e2dbc=function(_0x178c8b){while(--_0x178c8b){_0x42037b['push'](_0x42037b['shift']());}};_0x1e2dbc(++_0xcd2d32);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x470abd,_0x17ef85){var _0x4122c6=function(_0x670550){while(--_0x670550){_0x470abd['push'](_0x470abd['shift']());}};_0x4122c6(++_0x17ef85);}(_0x814b,0x1a2));var _0xb814=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x814b[_0x5db99b];return _0x4b2d0e;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 73a468e..ada80e5 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 _0xcc2e=['STRING','DATE','moment','sequelize'];(function(_0x449f40,_0x4ca207){var _0x20e4f6=function(_0x46f984){while(--_0x46f984){_0x449f40['push'](_0x449f40['shift']());}};_0x20e4f6(++_0x4ca207);}(_0xcc2e,0x112));var _0xecc2=function(_0x114a7e,_0x4049a7){_0x114a7e=_0x114a7e-0x0;var _0x2f6cb4=_0xcc2e[_0x114a7e];return _0x2f6cb4;};'use strict';var moment=require(_0xecc2('0x0'));var Sequelize=require(_0xecc2('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xecc2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xecc2('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xecc2('0x3')]},'exitAt':{'type':Sequelize[_0xecc2('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa2d7=['STRING','DATE','moment','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa2d7,0xbb));var _0x7a2d=function(_0x517587,_0x564c30){_0x517587=_0x517587-0x0;var _0x330f2b=_0xa2d7[_0x517587];return _0x330f2b;};'use strict';var moment=require(_0x7a2d('0x0'));var Sequelize=require(_0x7a2d('0x1'));module[_0x7a2d('0x2')]={'uniqueid':{'type':Sequelize[_0x7a2d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7a2d('0x4')]},'leaveAt':{'type':Sequelize[_0x7a2d('0x4')]},'acceptAt':{'type':Sequelize[_0x7a2d('0x4')]},'exitAt':{'type':Sequelize[_0x7a2d('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index c43097a..71c5ff3 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 _0xee3c=['VIRTUAL','then','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge'];(function(_0x549277,_0x11af15){var _0x2f8004=function(_0x5a8413){while(--_0x5a8413){_0x549277['push'](_0x549277['shift']());}};_0x2f8004(++_0x11af15);}(_0xee3c,0x14a));var _0xcee3=function(_0x329ee0,_0x47c6e9){_0x329ee0=_0x329ee0-0x0;var _0x4b3486=_0xee3c[_0x329ee0];return _0x4b3486;};'use strict';var emlformat=require(_0xcee3('0x0'));var rimraf=require(_0xcee3('0x1'));var zipdir=require(_0xcee3('0x2'));var jsonpatch=require(_0xcee3('0x3'));var rp=require(_0xcee3('0x4'));var moment=require(_0xcee3('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcee3('0x6'));var path=require(_0xcee3('0x7'));var sox=require(_0xcee3('0x8'));var csv=require(_0xcee3('0x9'));var ejs=require(_0xcee3('0xa'));var fs=require('fs');var fs_extra=require(_0xcee3('0xb'));var _=require(_0xcee3('0xc'));var squel=require(_0xcee3('0xd'));var crypto=require(_0xcee3('0xe'));var jsforce=require(_0xcee3('0xf'));var deskjs=require(_0xcee3('0x10'));var toCsv=require(_0xcee3('0x9'));var querystring=require(_0xcee3('0x11'));var Papa=require(_0xcee3('0x12'));var Redis=require(_0xcee3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcee3('0x14'));var as=require(_0xcee3('0x15'));var hardwareService=require(_0xcee3('0x16'));var logger=require(_0xcee3('0x17'))(_0xcee3('0x18'));var utils=require(_0xcee3('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xcee3('0x1a'));var db=require(_0xcee3('0x1b'))['db'];function respondWithStatusCode(_0x2db8ff,_0x1a47e1){_0x1a47e1=_0x1a47e1||0xcc;return function(_0xc4f4f2){if(_0xc4f4f2){return _0x2db8ff['sendStatus'](_0x1a47e1);}return _0x2db8ff[_0xcee3('0x1c')](_0x1a47e1)['end']();};}function respondWithResult(_0x559250,_0x53c810){_0x53c810=_0x53c810||0xc8;return function(_0x3ea063){if(_0x3ea063){return _0x559250[_0xcee3('0x1c')](_0x53c810)['json'](_0x3ea063);}};}function respondWithFilteredResult(_0x50bbf2,_0x34854a){return function(_0x505f09){if(_0x505f09){var _0x420b46=typeof _0x34854a['offset']===_0xcee3('0x1d')&&typeof _0x34854a[_0xcee3('0x1e')]==='undefined';var _0xc139b5=_0x505f09[_0xcee3('0x1f')];var _0x40cb8b=_0x420b46?0x0:_0x34854a[_0xcee3('0x20')];var _0x50bf6e=_0x420b46?_0x505f09[_0xcee3('0x1f')]:_0x34854a[_0xcee3('0x20')]+_0x34854a[_0xcee3('0x1e')];var _0x11bf37;if(_0x50bf6e>=_0xc139b5){_0x50bf6e=_0xc139b5;_0x11bf37=0xc8;}else{_0x11bf37=0xce;}_0x50bbf2['status'](_0x11bf37);return _0x50bbf2[_0xcee3('0x21')](_0xcee3('0x22'),_0x40cb8b+'-'+_0x50bf6e+'/'+_0xc139b5)[_0xcee3('0x23')](_0x505f09);}return null;};}function patchUpdates(_0x8b2470){return function(_0x11d116){try{jsonpatch[_0xcee3('0x24')](_0x11d116,_0x8b2470,!![]);}catch(_0x195ba9){return BPromise[_0xcee3('0x25')](_0x195ba9);}return _0x11d116[_0xcee3('0x26')]();};}function saveUpdates(_0x46d7a9,_0x40dd10){return function(_0xa1efbf){if(_0xa1efbf){return _0xa1efbf[_0xcee3('0x27')](_0x46d7a9)['then'](function(_0x1fee89){return _0x1fee89;});}return null;};}function removeEntity(_0x277194,_0x240736){return function(_0x1ee247){if(_0x1ee247){return _0x1ee247[_0xcee3('0x28')]()['then'](function(){_0x277194['status'](0xcc)[_0xcee3('0x29')]();});}};}function handleEntityNotFound(_0x5b92ba,_0x544509){return function(_0x228ff6){if(!_0x228ff6){_0x5b92ba['sendStatus'](0x194);}return _0x228ff6;};}function handleError(_0x452837,_0x202bfd){_0x202bfd=_0x202bfd||0x1f4;return function(_0x19a15e){logger['error'](_0x19a15e[_0xcee3('0x2a')]);if(_0x19a15e['name']){delete _0x19a15e[_0xcee3('0x2b')];}_0x452837['status'](_0x202bfd)[_0xcee3('0x2c')](_0x19a15e);};}exports[_0xcee3('0x2d')]=function(_0x5d965d,_0x3a2532){var _0x1efb1b={},_0x5c1a32={},_0x400cfe={'count':0x0,'rows':[]};var _0x4ef9da=_['map'](db[_0xcee3('0x2e')]['rawAttributes'],function(_0x22e342){return{'name':_0x22e342[_0xcee3('0x2f')],'type':_0x22e342[_0xcee3('0x30')][_0xcee3('0x31')]};});_0x5c1a32[_0xcee3('0x32')]=_[_0xcee3('0x33')](_0x4ef9da,_0xcee3('0x2b'));_0x5c1a32['query']=_[_0xcee3('0x34')](_0x5d965d['query']);_0x5c1a32[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x5c1a32[_0xcee3('0x32')],_0x5c1a32[_0xcee3('0x37')]);_0x1efb1b[_0xcee3('0x38')]=_[_0xcee3('0x36')](_0x5c1a32[_0xcee3('0x32')],qs[_0xcee3('0x39')](_0x5d965d['query'][_0xcee3('0x39')]));_0x1efb1b[_0xcee3('0x38')]=_0x1efb1b[_0xcee3('0x38')]['length']?_0x1efb1b[_0xcee3('0x38')]:_0x5c1a32[_0xcee3('0x32')];if(!_0x5d965d['query'][_0xcee3('0x3a')]('nolimit')){_0x1efb1b[_0xcee3('0x1e')]=qs['limit'](_0x5d965d['query'][_0xcee3('0x1e')]);_0x1efb1b['offset']=qs[_0xcee3('0x20')](_0x5d965d[_0xcee3('0x37')][_0xcee3('0x20')]);}_0x1efb1b[_0xcee3('0x3b')]=qs['sort'](_0x5d965d['query'][_0xcee3('0x3c')]);_0x1efb1b[_0xcee3('0x3d')]=qs['filters'](_[_0xcee3('0x3e')](_0x5d965d[_0xcee3('0x37')],_0x5c1a32['filters']),_0x4ef9da);if(_0x5d965d[_0xcee3('0x37')][_0xcee3('0x3f')]){_0x1efb1b[_0xcee3('0x3d')]=_[_0xcee3('0x40')](_0x1efb1b[_0xcee3('0x3d')],{'$or':_[_0xcee3('0x33')](_0x4ef9da,function(_0x49f1dc){if(_0x49f1dc[_0xcee3('0x30')]!==_0xcee3('0x41')){var _0x28e726={};_0x28e726[_0x49f1dc[_0xcee3('0x2b')]]={'$like':'%'+_0x5d965d[_0xcee3('0x37')][_0xcee3('0x3f')]+'%'};return _0x28e726;}})});}_0x1efb1b=_[_0xcee3('0x40')]({},_0x1efb1b,_0x5d965d['options']);var _0x139ddc={'where':_0x1efb1b[_0xcee3('0x3d')]};return db[_0xcee3('0x2e')]['count'](_0x139ddc)[_0xcee3('0x42')](function(_0x436961){_0x400cfe['count']=_0x436961;if(_0x5d965d[_0xcee3('0x37')][_0xcee3('0x43')]){_0x1efb1b[_0xcee3('0x44')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xcee3('0x45')](_0x1efb1b);})[_0xcee3('0x42')](function(_0x1bb4a8){_0x400cfe[_0xcee3('0x46')]=_0x1bb4a8;return _0x400cfe;})[_0xcee3('0x42')](respondWithFilteredResult(_0x3a2532,_0x1efb1b))['catch'](handleError(_0x3a2532,null));};exports['show']=function(_0x42e197,_0x41cd61){var _0x45df47={'raw':!![],'where':{'id':_0x42e197[_0xcee3('0x47')]['id']}},_0x47159f={};_0x47159f[_0xcee3('0x32')]=_[_0xcee3('0x34')](db[_0xcee3('0x2e')]['rawAttributes']);_0x47159f[_0xcee3('0x37')]=_[_0xcee3('0x34')](_0x42e197[_0xcee3('0x37')]);_0x47159f[_0xcee3('0x35')]=_[_0xcee3('0x36')](_0x47159f[_0xcee3('0x32')],_0x47159f[_0xcee3('0x37')]);_0x45df47['attributes']=_[_0xcee3('0x36')](_0x47159f['model'],qs[_0xcee3('0x39')](_0x42e197[_0xcee3('0x37')]['fields']));_0x45df47[_0xcee3('0x38')]=_0x45df47[_0xcee3('0x38')][_0xcee3('0x48')]?_0x45df47[_0xcee3('0x38')]:_0x47159f[_0xcee3('0x32')];if(_0x42e197[_0xcee3('0x37')][_0xcee3('0x43')]){_0x45df47[_0xcee3('0x44')]=[{'all':!![]}];}_0x45df47=_[_0xcee3('0x40')]({},_0x45df47,_0x42e197[_0xcee3('0x49')]);return db['ChatQueueReport'][_0xcee3('0x4a')](_0x45df47)[_0xcee3('0x42')](handleEntityNotFound(_0x41cd61,null))['then'](respondWithResult(_0x41cd61,null))[_0xcee3('0x4b')](handleError(_0x41cd61,null));};exports[_0xcee3('0x4c')]=function(_0x31393e,_0x2726d9){return db[_0xcee3('0x2e')][_0xcee3('0x4c')](_0x31393e[_0xcee3('0x4d')],{})['then'](respondWithResult(_0x2726d9,0xc9))[_0xcee3('0x4b')](handleError(_0x2726d9,null));};exports[_0xcee3('0x27')]=function(_0x20bfc5,_0x27022b){if(_0x20bfc5[_0xcee3('0x4d')]['id']){delete _0x20bfc5[_0xcee3('0x4d')]['id'];}return db['ChatQueueReport'][_0xcee3('0x4a')]({'where':{'id':_0x20bfc5['params']['id']}})[_0xcee3('0x42')](handleEntityNotFound(_0x27022b,null))[_0xcee3('0x42')](saveUpdates(_0x20bfc5[_0xcee3('0x4d')],null))['then'](respondWithResult(_0x27022b,null))['catch'](handleError(_0x27022b,null));};exports[_0xcee3('0x28')]=function(_0x319c25,_0x47c149){return db[_0xcee3('0x2e')]['find']({'where':{'id':_0x319c25[_0xcee3('0x47')]['id']}})[_0xcee3('0x42')](handleEntityNotFound(_0x47c149,null))[_0xcee3('0x42')](removeEntity(_0x47c149,null))[_0xcee3('0x4b')](handleError(_0x47c149,null));};exports['describe']=function(_0x5b1d42,_0x491ca0){return db[_0xcee3('0x2e')][_0xcee3('0x4e')]()[_0xcee3('0x42')](respondWithResult(_0x491ca0,null))['catch'](handleError(_0x491ca0,null));};
\ No newline at end of file
+var _0xc17d=['moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','ChatQueueReport','key','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','intersection','includeAll','options','create','body','update','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x57a6bd,_0x19ec0d){var _0x54bfa2=function(_0xd3e40){while(--_0xd3e40){_0x57a6bd['push'](_0x57a6bd['shift']());}};_0x54bfa2(++_0x19ec0d);}(_0xc17d,0x96));var _0xdc17=function(_0x3436a6,_0x165ac2){_0x3436a6=_0x3436a6-0x0;var _0x4d783a=_0xc17d[_0x3436a6];return _0x4d783a;};'use strict';var emlformat=require(_0xdc17('0x0'));var rimraf=require(_0xdc17('0x1'));var zipdir=require(_0xdc17('0x2'));var jsonpatch=require(_0xdc17('0x3'));var rp=require('request-promise');var moment=require(_0xdc17('0x4'));var BPromise=require(_0xdc17('0x5'));var Mustache=require(_0xdc17('0x6'));var util=require(_0xdc17('0x7'));var path=require('path');var sox=require(_0xdc17('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc17('0x9'));var _=require('lodash');var squel=require(_0xdc17('0xa'));var crypto=require(_0xdc17('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc17('0xc'));var querystring=require(_0xdc17('0xd'));var Papa=require(_0xdc17('0xe'));var Redis=require(_0xdc17('0xf'));var authService=require(_0xdc17('0x10'));var qs=require(_0xdc17('0x11'));var as=require(_0xdc17('0x12'));var hardwareService=require(_0xdc17('0x13'));var logger=require('../../config/logger')(_0xdc17('0x14'));var utils=require(_0xdc17('0x15'));var config=require(_0xdc17('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc17('0x17'))['db'];function respondWithStatusCode(_0x4ddfba,_0x137250){_0x137250=_0x137250||0xcc;return function(_0x954b82){if(_0x954b82){return _0x4ddfba['sendStatus'](_0x137250);}return _0x4ddfba[_0xdc17('0x18')](_0x137250)[_0xdc17('0x19')]();};}function respondWithResult(_0x49d6fd,_0x2bb5b2){_0x2bb5b2=_0x2bb5b2||0xc8;return function(_0x59c100){if(_0x59c100){return _0x49d6fd[_0xdc17('0x18')](_0x2bb5b2)[_0xdc17('0x1a')](_0x59c100);}};}function respondWithFilteredResult(_0x5631b6,_0xb3a102){return function(_0x428c8c){if(_0x428c8c){var _0x17ff01=typeof _0xb3a102[_0xdc17('0x1b')]===_0xdc17('0x1c')&&typeof _0xb3a102[_0xdc17('0x1d')]==='undefined';var _0x324272=_0x428c8c[_0xdc17('0x1e')];var _0x1ac85b=_0x17ff01?0x0:_0xb3a102[_0xdc17('0x1b')];var _0x172a20=_0x17ff01?_0x428c8c[_0xdc17('0x1e')]:_0xb3a102['offset']+_0xb3a102[_0xdc17('0x1d')];var _0xd0886e;if(_0x172a20>=_0x324272){_0x172a20=_0x324272;_0xd0886e=0xc8;}else{_0xd0886e=0xce;}_0x5631b6[_0xdc17('0x18')](_0xd0886e);return _0x5631b6[_0xdc17('0x1f')](_0xdc17('0x20'),_0x1ac85b+'-'+_0x172a20+'/'+_0x324272)[_0xdc17('0x1a')](_0x428c8c);}return null;};}function patchUpdates(_0x5650ad){return function(_0x35662c){try{jsonpatch[_0xdc17('0x21')](_0x35662c,_0x5650ad,!![]);}catch(_0x572232){return BPromise[_0xdc17('0x22')](_0x572232);}return _0x35662c[_0xdc17('0x23')]();};}function saveUpdates(_0x218a5d,_0x687339){return function(_0x3e8d98){if(_0x3e8d98){return _0x3e8d98['update'](_0x218a5d)[_0xdc17('0x24')](function(_0x42c341){return _0x42c341;});}return null;};}function removeEntity(_0x595320,_0x5c01aa){return function(_0x1b4706){if(_0x1b4706){return _0x1b4706['destroy']()[_0xdc17('0x24')](function(){_0x595320['status'](0xcc)[_0xdc17('0x19')]();});}};}function handleEntityNotFound(_0x519795,_0x4d936e){return function(_0x4573a0){if(!_0x4573a0){_0x519795[_0xdc17('0x25')](0x194);}return _0x4573a0;};}function handleError(_0x25930f,_0x177ee){_0x177ee=_0x177ee||0x1f4;return function(_0x3a9fc9){logger[_0xdc17('0x26')](_0x3a9fc9[_0xdc17('0x27')]);if(_0x3a9fc9[_0xdc17('0x28')]){delete _0x3a9fc9[_0xdc17('0x28')];}_0x25930f['status'](_0x177ee)[_0xdc17('0x29')](_0x3a9fc9);};}exports['index']=function(_0x879d4b,_0xc167e5){var _0x10f197={},_0x49fd56={},_0x45b68d={'count':0x0,'rows':[]};var _0x391538=_['map'](db[_0xdc17('0x2a')]['rawAttributes'],function(_0x3df4b7){return{'name':_0x3df4b7['fieldName'],'type':_0x3df4b7['type'][_0xdc17('0x2b')]};});_0x49fd56['model']=_['map'](_0x391538,_0xdc17('0x28'));_0x49fd56[_0xdc17('0x2c')]=_['keys'](_0x879d4b['query']);_0x49fd56['filters']=_['intersection'](_0x49fd56[_0xdc17('0x2d')],_0x49fd56['query']);_0x10f197['attributes']=_['intersection'](_0x49fd56[_0xdc17('0x2d')],qs['fields'](_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x2e')]));_0x10f197[_0xdc17('0x2f')]=_0x10f197['attributes'][_0xdc17('0x30')]?_0x10f197['attributes']:_0x49fd56[_0xdc17('0x2d')];if(!_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x31')](_0xdc17('0x32'))){_0x10f197[_0xdc17('0x1d')]=qs[_0xdc17('0x1d')](_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x1d')]);_0x10f197[_0xdc17('0x1b')]=qs[_0xdc17('0x1b')](_0x879d4b['query'][_0xdc17('0x1b')]);}_0x10f197[_0xdc17('0x33')]=qs[_0xdc17('0x34')](_0x879d4b['query'][_0xdc17('0x34')]);_0x10f197[_0xdc17('0x35')]=qs[_0xdc17('0x36')](_[_0xdc17('0x37')](_0x879d4b[_0xdc17('0x2c')],_0x49fd56[_0xdc17('0x36')]),_0x391538);if(_0x879d4b[_0xdc17('0x2c')][_0xdc17('0x38')]){_0x10f197[_0xdc17('0x35')]=_[_0xdc17('0x39')](_0x10f197[_0xdc17('0x35')],{'$or':_[_0xdc17('0x3a')](_0x391538,function(_0x14b814){if(_0x14b814[_0xdc17('0x3b')]!==_0xdc17('0x3c')){var _0x1dcf3b={};_0x1dcf3b[_0x14b814[_0xdc17('0x28')]]={'$like':'%'+_0x879d4b[_0xdc17('0x2c')]['filter']+'%'};return _0x1dcf3b;}})});}_0x10f197=_[_0xdc17('0x39')]({},_0x10f197,_0x879d4b['options']);var _0x30679b={'where':_0x10f197['where']};return db[_0xdc17('0x2a')][_0xdc17('0x1e')](_0x30679b)[_0xdc17('0x24')](function(_0x36ca97){_0x45b68d[_0xdc17('0x1e')]=_0x36ca97;if(_0x879d4b[_0xdc17('0x2c')]['includeAll']){_0x10f197[_0xdc17('0x3d')]=[{'all':!![]}];}return db[_0xdc17('0x2a')][_0xdc17('0x3e')](_0x10f197);})[_0xdc17('0x24')](function(_0x687bf3){_0x45b68d[_0xdc17('0x3f')]=_0x687bf3;return _0x45b68d;})[_0xdc17('0x24')](respondWithFilteredResult(_0xc167e5,_0x10f197))[_0xdc17('0x40')](handleError(_0xc167e5,null));};exports[_0xdc17('0x41')]=function(_0x48a061,_0x2e9928){var _0x45d642={'raw':!![],'where':{'id':_0x48a061[_0xdc17('0x42')]['id']}},_0x51f6b4={};_0x51f6b4[_0xdc17('0x2d')]=_[_0xdc17('0x43')](db[_0xdc17('0x2a')]['rawAttributes']);_0x51f6b4['query']=_[_0xdc17('0x43')](_0x48a061[_0xdc17('0x2c')]);_0x51f6b4[_0xdc17('0x36')]=_[_0xdc17('0x44')](_0x51f6b4[_0xdc17('0x2d')],_0x51f6b4['query']);_0x45d642[_0xdc17('0x2f')]=_[_0xdc17('0x44')](_0x51f6b4[_0xdc17('0x2d')],qs[_0xdc17('0x2e')](_0x48a061[_0xdc17('0x2c')][_0xdc17('0x2e')]));_0x45d642[_0xdc17('0x2f')]=_0x45d642[_0xdc17('0x2f')][_0xdc17('0x30')]?_0x45d642[_0xdc17('0x2f')]:_0x51f6b4['model'];if(_0x48a061[_0xdc17('0x2c')][_0xdc17('0x45')]){_0x45d642[_0xdc17('0x3d')]=[{'all':!![]}];}_0x45d642=_['merge']({},_0x45d642,_0x48a061[_0xdc17('0x46')]);return db[_0xdc17('0x2a')]['find'](_0x45d642)[_0xdc17('0x24')](handleEntityNotFound(_0x2e9928,null))[_0xdc17('0x24')](respondWithResult(_0x2e9928,null))[_0xdc17('0x40')](handleError(_0x2e9928,null));};exports['create']=function(_0x1a3f5d,_0x23d535){return db['ChatQueueReport'][_0xdc17('0x47')](_0x1a3f5d[_0xdc17('0x48')],{})['then'](respondWithResult(_0x23d535,0xc9))['catch'](handleError(_0x23d535,null));};exports[_0xdc17('0x49')]=function(_0x22048b,_0x5a2ca2){if(_0x22048b[_0xdc17('0x48')]['id']){delete _0x22048b[_0xdc17('0x48')]['id'];}return db[_0xdc17('0x2a')][_0xdc17('0x4a')]({'where':{'id':_0x22048b[_0xdc17('0x42')]['id']}})[_0xdc17('0x24')](handleEntityNotFound(_0x5a2ca2,null))[_0xdc17('0x24')](saveUpdates(_0x22048b['body'],null))[_0xdc17('0x24')](respondWithResult(_0x5a2ca2,null))[_0xdc17('0x40')](handleError(_0x5a2ca2,null));};exports[_0xdc17('0x4b')]=function(_0x3a864c,_0x1368e1){return db[_0xdc17('0x2a')]['find']({'where':{'id':_0x3a864c[_0xdc17('0x42')]['id']}})[_0xdc17('0x24')](handleEntityNotFound(_0x1368e1,null))[_0xdc17('0x24')](removeEntity(_0x1368e1,null))[_0xdc17('0x40')](handleError(_0x1368e1,null));};exports[_0xdc17('0x4c')]=function(_0x1be1ca,_0x4417bd){return db[_0xdc17('0x2a')]['describe']()['then'](respondWithResult(_0x4417bd,null))[_0xdc17('0x40')](handleError(_0x4417bd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 789695f..2e96f3d 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3911a0,_0x244e17){var _0x55e9b9=function(_0xb90aad){while(--_0xb90aad){_0x3911a0['push'](_0x3911a0['shift']());}};_0x55e9b9(++_0x244e17);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x38080e,_0x95512d){var _0x4e4c87=function(_0x2be6b3){while(--_0x2be6b3){_0x38080e['push'](_0x38080e['shift']());}};_0x4e4c87(++_0x95512d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5a778b,_0x717daa){_0x5a778b=_0x5a778b-0x0;var _0x32f0da=_0xb10b[_0x5a778b];return _0x32f0da;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 50124e8..8877fad 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 _0x84e7=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','where','attributes','limit','UpdateChatQueueReport','lodash','moment','randomstring'];(function(_0x3f5491,_0x9344ba){var _0x4a364d=function(_0x4dfe73){while(--_0x4dfe73){_0x3f5491['push'](_0x3f5491['shift']());}};_0x4a364d(++_0x9344ba);}(_0x84e7,0x171));var _0x784e=function(_0x8ed86a,_0x3d55cf){_0x8ed86a=_0x8ed86a-0x0;var _0x57d8a4=_0x84e7[_0x8ed86a];return _0x57d8a4;};'use strict';var _=require(_0x784e('0x0'));var util=require('util');var moment=require(_0x784e('0x1'));var BPromise=require('bluebird');var rs=require(_0x784e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x784e('0x3'));var logger=require(_0x784e('0x4'))(_0x784e('0x5'));var config=require(_0x784e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x784e('0x7')][_0x784e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26d18a,_0x5a1706,_0x4bf15f){return new BPromise(function(_0x5b1b5a,_0x28b301){return client[_0x784e('0x9')](_0x26d18a,_0x4bf15f)[_0x784e('0xa')](function(_0x2145bd){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x5a1706,'request\x20sent');logger[_0x784e('0xb')](_0x784e('0xc'),_0x5a1706,_0x784e('0xd'),JSON[_0x784e('0xe')](_0x2145bd));if(_0x2145bd[_0x784e('0xf')]){if(_0x2145bd['error'][_0x784e('0x10')]===0x1f4){logger[_0x784e('0xf')](_0x784e('0x11'),_0x5a1706,_0x2145bd[_0x784e('0xf')][_0x784e('0x12')]);return _0x28b301(_0x2145bd[_0x784e('0xf')][_0x784e('0x12')]);}logger[_0x784e('0xf')](_0x784e('0x11'),_0x5a1706,_0x2145bd[_0x784e('0xf')]['message']);return _0x5b1b5a(_0x2145bd[_0x784e('0xf')][_0x784e('0x12')]);}else{logger['info'](_0x784e('0x11'),_0x5a1706,'request\x20sent');_0x5b1b5a(_0x2145bd[_0x784e('0x13')]['message']);}})[_0x784e('0x14')](function(_0x1782e7){logger[_0x784e('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x5a1706,_0x1782e7);_0x28b301(_0x1782e7);});});}exports[_0x784e('0x15')]=function(_0x1bad48){var _0x477d0f=this;return new Promise(function(_0x4b4430,_0xaf8c64){return db[_0x784e('0x16')][_0x784e('0x17')](_0x1bad48[_0x784e('0x18')],{'raw':_0x1bad48[_0x784e('0x19')]?_0x1bad48[_0x784e('0x19')][_0x784e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x21eb3f){logger['info']('CreateChatQueueReport',_0x1bad48);logger[_0x784e('0xb')]('CreateChatQueueReport',_0x1bad48,JSON[_0x784e('0xe')](_0x21eb3f));_0x4b4430(_0x21eb3f);})[_0x784e('0x14')](function(_0x21127f){logger[_0x784e('0xf')](_0x784e('0x15'),_0x21127f['message'],_0x1bad48);_0xaf8c64(_0x477d0f['error'](0x1f4,_0x21127f[_0x784e('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x462710){var _0x487fb0=this;return new Promise(function(_0x1a2dba,_0x1decd3){return db[_0x784e('0x16')]['update'](_0x462710[_0x784e('0x18')],{'raw':_0x462710[_0x784e('0x19')]?_0x462710['options'][_0x784e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x462710['options']?_0x462710[_0x784e('0x19')][_0x784e('0x1b')]||null:null,'attributes':_0x462710['options']?_0x462710[_0x784e('0x19')][_0x784e('0x1c')]||null:null,'limit':_0x462710['options']?_0x462710['options'][_0x784e('0x1d')]||null:null})[_0x784e('0xa')](function(_0x46a05f){logger['info'](_0x784e('0x1e'),_0x462710);logger['debug'](_0x784e('0x1e'),_0x462710,JSON[_0x784e('0xe')](_0x46a05f));_0x1a2dba(_0x46a05f);})[_0x784e('0x14')](function(_0x8645f1){logger[_0x784e('0xf')](_0x784e('0x1e'),_0x8645f1[_0x784e('0x12')],_0x462710);_0x1decd3(_0x487fb0[_0x784e('0xf')](0x1f4,_0x8645f1['message']));});});};
\ No newline at end of file
+var _0xe747=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueueReport,\x20%s,\x20%s','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','create','options','raw','info','debug','UpdateChatQueueReport','attributes','limit','lodash','util','bluebird'];(function(_0x31ea98,_0x17eb21){var _0x1a735f=function(_0x4aeeac){while(--_0x4aeeac){_0x31ea98['push'](_0x31ea98['shift']());}};_0x1a735f(++_0x17eb21);}(_0xe747,0x13d));var _0x7e74=function(_0xd557b3,_0x36dcd4){_0xd557b3=_0xd557b3-0x0;var _0x22d5bd=_0xe747[_0xd557b3];return _0x22d5bd;};'use strict';var _=require(_0x7e74('0x0'));var util=require(_0x7e74('0x1'));var moment=require('moment');var BPromise=require(_0x7e74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e74('0x3'));var db=require(_0x7e74('0x4'))['db'];var utils=require(_0x7e74('0x5'));var logger=require(_0x7e74('0x6'))(_0x7e74('0x7'));var config=require(_0x7e74('0x8'));var jayson=require(_0x7e74('0x9'));var client=jayson[_0x7e74('0xa')][_0x7e74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4edfd5,_0x549587,_0x1aba42){return new BPromise(function(_0x632af6,_0x2c4d18){return client[_0x7e74('0xc')](_0x4edfd5,_0x1aba42)[_0x7e74('0xd')](function(_0x2fa3d0){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x549587,'request\x20sent');logger['debug'](_0x7e74('0xe'),_0x549587,'request\x20sent',JSON[_0x7e74('0xf')](_0x2fa3d0));if(_0x2fa3d0[_0x7e74('0x10')]){if(_0x2fa3d0[_0x7e74('0x10')]['code']===0x1f4){logger[_0x7e74('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x549587,_0x2fa3d0['error'][_0x7e74('0x11')]);return _0x2c4d18(_0x2fa3d0[_0x7e74('0x10')]['message']);}logger[_0x7e74('0x10')](_0x7e74('0x12'),_0x549587,_0x2fa3d0['error'][_0x7e74('0x11')]);return _0x632af6(_0x2fa3d0['error'][_0x7e74('0x11')]);}else{logger['info'](_0x7e74('0x12'),_0x549587,_0x7e74('0x13'));_0x632af6(_0x2fa3d0[_0x7e74('0x14')][_0x7e74('0x11')]);}})[_0x7e74('0x15')](function(_0xa9ca1d){logger['error'](_0x7e74('0x12'),_0x549587,_0xa9ca1d);_0x2c4d18(_0xa9ca1d);});});}exports[_0x7e74('0x16')]=function(_0x1c7c9f){var _0x3ab129=this;return new Promise(function(_0x59faec,_0xf3ff8e){return db[_0x7e74('0x17')][_0x7e74('0x18')](_0x1c7c9f['body'],{'raw':_0x1c7c9f[_0x7e74('0x19')]?_0x1c7c9f[_0x7e74('0x19')][_0x7e74('0x1a')]===undefined?!![]:![]:!![]})[_0x7e74('0xd')](function(_0x368a94){logger[_0x7e74('0x1b')](_0x7e74('0x16'),_0x1c7c9f);logger[_0x7e74('0x1c')](_0x7e74('0x16'),_0x1c7c9f,JSON[_0x7e74('0xf')](_0x368a94));_0x59faec(_0x368a94);})[_0x7e74('0x15')](function(_0xa82087){logger[_0x7e74('0x10')](_0x7e74('0x16'),_0xa82087[_0x7e74('0x11')],_0x1c7c9f);_0xf3ff8e(_0x3ab129[_0x7e74('0x10')](0x1f4,_0xa82087['message']));});});};exports[_0x7e74('0x1d')]=function(_0x3c9be6){var _0x4fcffa=this;return new Promise(function(_0x52c86b,_0x14a181){return db[_0x7e74('0x17')]['update'](_0x3c9be6['body'],{'raw':_0x3c9be6[_0x7e74('0x19')]?_0x3c9be6['options'][_0x7e74('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9be6['options']?_0x3c9be6[_0x7e74('0x19')]['where']||null:null,'attributes':_0x3c9be6[_0x7e74('0x19')]?_0x3c9be6[_0x7e74('0x19')][_0x7e74('0x1e')]||null:null,'limit':_0x3c9be6[_0x7e74('0x19')]?_0x3c9be6[_0x7e74('0x19')][_0x7e74('0x1f')]||null:null})[_0x7e74('0xd')](function(_0x2d3c52){logger['info'](_0x7e74('0x1d'),_0x3c9be6);logger[_0x7e74('0x1c')](_0x7e74('0x1d'),_0x3c9be6,JSON['stringify'](_0x2d3c52));_0x52c86b(_0x2d3c52);})[_0x7e74('0x15')](function(_0x2b539c){logger[_0x7e74('0x10')]('UpdateChatQueueReport',_0x2b539c[_0x7e74('0x11')],_0x3c9be6);_0x14a181(_0x4fcffa[_0x7e74('0x10')](0x1f4,_0x2b539c[_0x7e74('0x11')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index a16025e..fc09b27 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 _0x044b=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','post','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1c21c9,_0x46b430){var _0x113bb4=function(_0x57b175){while(--_0x57b175){_0x1c21c9['push'](_0x1c21c9['shift']());}};_0x113bb4(++_0x46b430);}(_0x044b,0x1c2));var _0xb044=function(_0x2746a3,_0x37242e){_0x2746a3=_0x2746a3-0x0;var _0x5899f7=_0x044b[_0x2746a3];return _0x5899f7;};'use strict';var multer=require(_0xb044('0x0'));var util=require('util');var path=require(_0xb044('0x1'));var timeout=require(_0xb044('0x2'));var express=require(_0xb044('0x3'));var router=express[_0xb044('0x4')]();var fs_extra=require(_0xb044('0x5'));var auth=require(_0xb044('0x6'));var interaction=require(_0xb044('0x7'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xb044('0x8')](),controller[_0xb044('0x9')]);router[_0xb044('0xa')](_0xb044('0xb'),auth[_0xb044('0x8')](),controller[_0xb044('0xc')]);router['get']('/:id',auth[_0xb044('0x8')](),controller[_0xb044('0xd')]);router[_0xb044('0xe')]('/',auth[_0xb044('0x8')](),controller['create']);router['put'](_0xb044('0xf'),auth[_0xb044('0x8')](),controller[_0xb044('0x10')]);router[_0xb044('0x11')](_0xb044('0xf'),auth[_0xb044('0x8')](),controller['destroy']);module[_0xb044('0x12')]=router;
\ No newline at end of file
+var _0x0c3c=['post','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x305244,_0xcf3eb0){var _0x49e99e=function(_0x20f6c2){while(--_0x20f6c2){_0x305244['push'](_0x305244['shift']());}};_0x49e99e(++_0xcf3eb0);}(_0x0c3c,0x92));var _0xc0c3=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0x0c3c[_0x562faf];return _0x22c1f6;};'use strict';var multer=require(_0xc0c3('0x0'));var util=require(_0xc0c3('0x1'));var path=require(_0xc0c3('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0c3('0x3'));var router=express['Router']();var fs_extra=require(_0xc0c3('0x4'));var auth=require(_0xc0c3('0x5'));var interaction=require(_0xc0c3('0x6'));var config=require(_0xc0c3('0x7'));var controller=require(_0xc0c3('0x8'));router[_0xc0c3('0x9')]('/',auth[_0xc0c3('0xa')](),controller[_0xc0c3('0xb')]);router[_0xc0c3('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xc0c3('0xc')]);router[_0xc0c3('0x9')](_0xc0c3('0xd'),auth[_0xc0c3('0xa')](),controller['show']);router[_0xc0c3('0xe')]('/',auth['isAuthenticated'](),controller[_0xc0c3('0xf')]);router[_0xc0c3('0x10')]('/:id',auth[_0xc0c3('0xa')](),controller['update']);router[_0xc0c3('0x11')](_0xc0c3('0xd'),auth[_0xc0c3('0xa')](),controller[_0xc0c3('0x12')]);module[_0xc0c3('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 276f76e..574b379 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4be563,_0x371f7d){var _0xa7d890=function(_0xe80d67){while(--_0xe80d67){_0x4be563['push'](_0x4be563['shift']());}};_0xa7d890(++_0x371f7d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x30b58,_0x48df3b){var _0x9d210d=function(_0x46fffd){while(--_0x46fffd){_0x30b58['push'](_0x30b58['shift']());}};_0x9d210d(++_0x48df3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8a0d895..3cd3c80 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 _0x5b25=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','count','offset','set','json','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x4445e3,_0x4aba46){var _0x3a4867=function(_0x1c9a4e){while(--_0x1c9a4e){_0x4445e3['push'](_0x4445e3['shift']());}};_0x3a4867(++_0x4aba46);}(_0x5b25,0x88));var _0x55b2=function(_0x490db0,_0x3492c7){_0x490db0=_0x490db0-0x0;var _0x5db0ed=_0x5b25[_0x490db0];return _0x5db0ed;};'use strict';var emlformat=require(_0x55b2('0x0'));var rimraf=require(_0x55b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55b2('0x2'));var rp=require(_0x55b2('0x3'));var moment=require(_0x55b2('0x4'));var BPromise=require(_0x55b2('0x5'));var Mustache=require(_0x55b2('0x6'));var util=require(_0x55b2('0x7'));var path=require(_0x55b2('0x8'));var sox=require(_0x55b2('0x9'));var csv=require(_0x55b2('0xa'));var ejs=require(_0x55b2('0xb'));var fs=require('fs');var fs_extra=require(_0x55b2('0xc'));var _=require(_0x55b2('0xd'));var squel=require(_0x55b2('0xe'));var crypto=require(_0x55b2('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x55b2('0x10'));var Papa=require(_0x55b2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x55b2('0x12'));var as=require(_0x55b2('0x13'));var hardwareService=require(_0x55b2('0x14'));var logger=require(_0x55b2('0x15'))(_0x55b2('0x16'));var utils=require(_0x55b2('0x17'));var config=require(_0x55b2('0x18'));var licenseUtil=require(_0x55b2('0x19'));var db=require(_0x55b2('0x1a'))['db'];function respondWithStatusCode(_0x480b67,_0x49dd9b){_0x49dd9b=_0x49dd9b||0xcc;return function(_0x409cbc){if(_0x409cbc){return _0x480b67[_0x55b2('0x1b')](_0x49dd9b);}return _0x480b67[_0x55b2('0x1c')](_0x49dd9b)[_0x55b2('0x1d')]();};}function respondWithResult(_0x536fb9,_0x4f4b0e){_0x4f4b0e=_0x4f4b0e||0xc8;return function(_0x26c47d){if(_0x26c47d){return _0x536fb9[_0x55b2('0x1c')](_0x4f4b0e)['json'](_0x26c47d);}};}function respondWithFilteredResult(_0x522557,_0x31d2e1){return function(_0x53e458){if(_0x53e458){var _0x22de2e=typeof _0x31d2e1['offset']==='undefined'&&typeof _0x31d2e1[_0x55b2('0x1e')]==='undefined';var _0x16b340=_0x53e458[_0x55b2('0x1f')];var _0xb6887d=_0x22de2e?0x0:_0x31d2e1['offset'];var _0x3a750d=_0x22de2e?_0x53e458[_0x55b2('0x1f')]:_0x31d2e1[_0x55b2('0x20')]+_0x31d2e1[_0x55b2('0x1e')];var _0x7340a0;if(_0x3a750d>=_0x16b340){_0x3a750d=_0x16b340;_0x7340a0=0xc8;}else{_0x7340a0=0xce;}_0x522557['status'](_0x7340a0);return _0x522557[_0x55b2('0x21')]('Content-Range',_0xb6887d+'-'+_0x3a750d+'/'+_0x16b340)[_0x55b2('0x22')](_0x53e458);}return null;};}function patchUpdates(_0x4285b4){return function(_0x28db47){try{jsonpatch[_0x55b2('0x23')](_0x28db47,_0x4285b4,!![]);}catch(_0x4db407){return BPromise[_0x55b2('0x24')](_0x4db407);}return _0x28db47[_0x55b2('0x25')]();};}function saveUpdates(_0x31fa65,_0x505c4c){return function(_0x27f799){if(_0x27f799){return _0x27f799[_0x55b2('0x26')](_0x31fa65)[_0x55b2('0x27')](function(_0x4050e1){return _0x4050e1;});}return null;};}function removeEntity(_0x53efb3,_0x159bc1){return function(_0x5656cd){if(_0x5656cd){return _0x5656cd[_0x55b2('0x28')]()[_0x55b2('0x27')](function(){_0x53efb3['status'](0xcc)[_0x55b2('0x1d')]();});}};}function handleEntityNotFound(_0x5bdefd,_0x307fa8){return function(_0x516ba8){if(!_0x516ba8){_0x5bdefd['sendStatus'](0x194);}return _0x516ba8;};}function handleError(_0x24af40,_0x494b73){_0x494b73=_0x494b73||0x1f4;return function(_0x3cc390){logger[_0x55b2('0x29')](_0x3cc390['stack']);if(_0x3cc390[_0x55b2('0x2a')]){delete _0x3cc390[_0x55b2('0x2a')];}_0x24af40[_0x55b2('0x1c')](_0x494b73)['send'](_0x3cc390);};}exports[_0x55b2('0x2b')]=function(_0x5a7de2,_0x25694e){var _0x4e3953={},_0xbd1399={},_0x5d191c={'count':0x0,'rows':[]};var _0x18d7fa=_[_0x55b2('0x2c')](db[_0x55b2('0x2d')][_0x55b2('0x2e')],function(_0x209bda){return{'name':_0x209bda[_0x55b2('0x2f')],'type':_0x209bda['type']['key']};});_0xbd1399[_0x55b2('0x30')]=_[_0x55b2('0x2c')](_0x18d7fa,_0x55b2('0x2a'));_0xbd1399[_0x55b2('0x31')]=_['keys'](_0x5a7de2[_0x55b2('0x31')]);_0xbd1399['filters']=_[_0x55b2('0x32')](_0xbd1399[_0x55b2('0x30')],_0xbd1399[_0x55b2('0x31')]);_0x4e3953['attributes']=_['intersection'](_0xbd1399[_0x55b2('0x30')],qs[_0x55b2('0x33')](_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x33')]));_0x4e3953[_0x55b2('0x34')]=_0x4e3953[_0x55b2('0x34')][_0x55b2('0x35')]?_0x4e3953['attributes']:_0xbd1399[_0x55b2('0x30')];if(!_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x36')](_0x55b2('0x37'))){_0x4e3953[_0x55b2('0x1e')]=qs[_0x55b2('0x1e')](_0x5a7de2['query'][_0x55b2('0x1e')]);_0x4e3953[_0x55b2('0x20')]=qs[_0x55b2('0x20')](_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x20')]);}_0x4e3953[_0x55b2('0x38')]=qs[_0x55b2('0x39')](_0x5a7de2['query'][_0x55b2('0x39')]);_0x4e3953[_0x55b2('0x3a')]=qs[_0x55b2('0x3b')](_[_0x55b2('0x3c')](_0x5a7de2[_0x55b2('0x31')],_0xbd1399[_0x55b2('0x3b')]),_0x18d7fa);if(_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x3d')]){_0x4e3953['where']=_[_0x55b2('0x3e')](_0x4e3953[_0x55b2('0x3a')],{'$or':_[_0x55b2('0x2c')](_0x18d7fa,function(_0x10a4df){if(_0x10a4df[_0x55b2('0x3f')]!=='VIRTUAL'){var _0x3215df={};_0x3215df[_0x10a4df[_0x55b2('0x2a')]]={'$like':'%'+_0x5a7de2[_0x55b2('0x31')][_0x55b2('0x3d')]+'%'};return _0x3215df;}})});}_0x4e3953=_['merge']({},_0x4e3953,_0x5a7de2[_0x55b2('0x40')]);var _0xa339f8={'where':_0x4e3953['where']};return db[_0x55b2('0x2d')][_0x55b2('0x1f')](_0xa339f8)[_0x55b2('0x27')](function(_0x1e0907){_0x5d191c[_0x55b2('0x1f')]=_0x1e0907;if(_0x5a7de2['query'][_0x55b2('0x41')]){_0x4e3953[_0x55b2('0x42')]=[{'all':!![]}];}return db[_0x55b2('0x2d')][_0x55b2('0x43')](_0x4e3953);})[_0x55b2('0x27')](function(_0x328f03){_0x5d191c[_0x55b2('0x44')]=_0x328f03;return _0x5d191c;})[_0x55b2('0x27')](respondWithFilteredResult(_0x25694e,_0x4e3953))['catch'](handleError(_0x25694e,null));};exports[_0x55b2('0x45')]=function(_0x1fec54,_0x3b0f6b){var _0x33373e={'raw':!![],'where':{'id':_0x1fec54[_0x55b2('0x46')]['id']}},_0x1abded={};_0x1abded['model']=_[_0x55b2('0x47')](db[_0x55b2('0x2d')]['rawAttributes']);_0x1abded[_0x55b2('0x31')]=_[_0x55b2('0x47')](_0x1fec54[_0x55b2('0x31')]);_0x1abded[_0x55b2('0x3b')]=_[_0x55b2('0x32')](_0x1abded[_0x55b2('0x30')],_0x1abded[_0x55b2('0x31')]);_0x33373e[_0x55b2('0x34')]=_[_0x55b2('0x32')](_0x1abded[_0x55b2('0x30')],qs[_0x55b2('0x33')](_0x1fec54[_0x55b2('0x31')][_0x55b2('0x33')]));_0x33373e[_0x55b2('0x34')]=_0x33373e['attributes']['length']?_0x33373e[_0x55b2('0x34')]:_0x1abded[_0x55b2('0x30')];if(_0x1fec54['query'][_0x55b2('0x41')]){_0x33373e[_0x55b2('0x42')]=[{'all':!![]}];}_0x33373e=_[_0x55b2('0x3e')]({},_0x33373e,_0x1fec54[_0x55b2('0x40')]);return db[_0x55b2('0x2d')][_0x55b2('0x48')](_0x33373e)['then'](handleEntityNotFound(_0x3b0f6b,null))['then'](respondWithResult(_0x3b0f6b,null))[_0x55b2('0x49')](handleError(_0x3b0f6b,null));};exports[_0x55b2('0x4a')]=function(_0x461033,_0x4bd6f0){return db['ChatTransferReport'][_0x55b2('0x4a')](_0x461033[_0x55b2('0x4b')],{})[_0x55b2('0x27')](respondWithResult(_0x4bd6f0,0xc9))[_0x55b2('0x49')](handleError(_0x4bd6f0,null));};exports[_0x55b2('0x26')]=function(_0x496376,_0x1042d2){if(_0x496376['body']['id']){delete _0x496376[_0x55b2('0x4b')]['id'];}return db[_0x55b2('0x2d')][_0x55b2('0x48')]({'where':{'id':_0x496376[_0x55b2('0x46')]['id']}})[_0x55b2('0x27')](handleEntityNotFound(_0x1042d2,null))[_0x55b2('0x27')](saveUpdates(_0x496376[_0x55b2('0x4b')],null))[_0x55b2('0x27')](respondWithResult(_0x1042d2,null))[_0x55b2('0x49')](handleError(_0x1042d2,null));};exports['destroy']=function(_0x3fc01e,_0x4b4a99){return db[_0x55b2('0x2d')][_0x55b2('0x48')]({'where':{'id':_0x3fc01e[_0x55b2('0x46')]['id']}})[_0x55b2('0x27')](handleEntityNotFound(_0x4b4a99,null))[_0x55b2('0x27')](removeEntity(_0x4b4a99,null))[_0x55b2('0x49')](handleError(_0x4b4a99,null));};exports[_0x55b2('0x4c')]=function(_0x4a0d0d,_0x17b4c5){return db[_0x55b2('0x2d')][_0x55b2('0x4c')]()[_0x55b2('0x27')](respondWithResult(_0x17b4c5,null))[_0x55b2('0x49')](handleError(_0x17b4c5,null));};
\ No newline at end of file
+var _0x7c43=['params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','to-csv','fs-extra','lodash','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','ChatTransferReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','catch','show'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0x7c43,0x11f));var _0x37c4=function(_0x50c5d5,_0x4ef853){_0x50c5d5=_0x50c5d5-0x0;var _0x466c90=_0x7c43[_0x50c5d5];return _0x466c90;};'use strict';var emlformat=require(_0x37c4('0x0'));var rimraf=require(_0x37c4('0x1'));var zipdir=require(_0x37c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x37c4('0x3'));var BPromise=require(_0x37c4('0x4'));var Mustache=require('mustache');var util=require(_0x37c4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x37c4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x37c4('0x7'));var _=require(_0x37c4('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37c4('0x9'));var toCsv=require(_0x37c4('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37c4('0xa'));var qs=require(_0x37c4('0xb'));var as=require(_0x37c4('0xc'));var hardwareService=require(_0x37c4('0xd'));var logger=require(_0x37c4('0xe'))(_0x37c4('0xf'));var utils=require(_0x37c4('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x37c4('0x11'));var db=require(_0x37c4('0x12'))['db'];function respondWithStatusCode(_0x54f229,_0x313789){_0x313789=_0x313789||0xcc;return function(_0x27c54b){if(_0x27c54b){return _0x54f229[_0x37c4('0x13')](_0x313789);}return _0x54f229[_0x37c4('0x14')](_0x313789)[_0x37c4('0x15')]();};}function respondWithResult(_0x30c4ab,_0x3611fe){_0x3611fe=_0x3611fe||0xc8;return function(_0x379a41){if(_0x379a41){return _0x30c4ab[_0x37c4('0x14')](_0x3611fe)[_0x37c4('0x16')](_0x379a41);}};}function respondWithFilteredResult(_0x2fb9c3,_0x40ce92){return function(_0x29809a){if(_0x29809a){var _0xaf7799=typeof _0x40ce92['offset']===_0x37c4('0x17')&&typeof _0x40ce92[_0x37c4('0x18')]===_0x37c4('0x17');var _0x419c7b=_0x29809a[_0x37c4('0x19')];var _0x3f2680=_0xaf7799?0x0:_0x40ce92[_0x37c4('0x1a')];var _0x387b86=_0xaf7799?_0x29809a[_0x37c4('0x19')]:_0x40ce92['offset']+_0x40ce92[_0x37c4('0x18')];var _0x663c7;if(_0x387b86>=_0x419c7b){_0x387b86=_0x419c7b;_0x663c7=0xc8;}else{_0x663c7=0xce;}_0x2fb9c3[_0x37c4('0x14')](_0x663c7);return _0x2fb9c3[_0x37c4('0x1b')](_0x37c4('0x1c'),_0x3f2680+'-'+_0x387b86+'/'+_0x419c7b)[_0x37c4('0x16')](_0x29809a);}return null;};}function patchUpdates(_0x4f8643){return function(_0x444f4b){try{jsonpatch[_0x37c4('0x1d')](_0x444f4b,_0x4f8643,!![]);}catch(_0x1bf3d7){return BPromise[_0x37c4('0x1e')](_0x1bf3d7);}return _0x444f4b[_0x37c4('0x1f')]();};}function saveUpdates(_0x3437e4,_0x546a59){return function(_0x3630d9){if(_0x3630d9){return _0x3630d9['update'](_0x3437e4)[_0x37c4('0x20')](function(_0x1faf29){return _0x1faf29;});}return null;};}function removeEntity(_0x3fb043,_0x134a8f){return function(_0x586532){if(_0x586532){return _0x586532[_0x37c4('0x21')]()[_0x37c4('0x20')](function(){_0x3fb043['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e914,_0x4d6473){return function(_0xdf13e2){if(!_0xdf13e2){_0x45e914[_0x37c4('0x13')](0x194);}return _0xdf13e2;};}function handleError(_0x3dc7e1,_0x454f8f){_0x454f8f=_0x454f8f||0x1f4;return function(_0x4f98b2){logger[_0x37c4('0x22')](_0x4f98b2[_0x37c4('0x23')]);if(_0x4f98b2[_0x37c4('0x24')]){delete _0x4f98b2['name'];}_0x3dc7e1['status'](_0x454f8f)['send'](_0x4f98b2);};}exports['index']=function(_0xdacfb8,_0x1d0639){var _0x5c9e85={},_0x1185f5={},_0x5d74ac={'count':0x0,'rows':[]};var _0x41060f=_['map'](db[_0x37c4('0x25')][_0x37c4('0x26')],function(_0xb97900){return{'name':_0xb97900[_0x37c4('0x27')],'type':_0xb97900['type'][_0x37c4('0x28')]};});_0x1185f5[_0x37c4('0x29')]=_[_0x37c4('0x2a')](_0x41060f,_0x37c4('0x24'));_0x1185f5['query']=_[_0x37c4('0x2b')](_0xdacfb8[_0x37c4('0x2c')]);_0x1185f5[_0x37c4('0x2d')]=_[_0x37c4('0x2e')](_0x1185f5[_0x37c4('0x29')],_0x1185f5[_0x37c4('0x2c')]);_0x5c9e85[_0x37c4('0x2f')]=_[_0x37c4('0x2e')](_0x1185f5['model'],qs[_0x37c4('0x30')](_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x30')]));_0x5c9e85['attributes']=_0x5c9e85[_0x37c4('0x2f')][_0x37c4('0x31')]?_0x5c9e85[_0x37c4('0x2f')]:_0x1185f5[_0x37c4('0x29')];if(!_0xdacfb8[_0x37c4('0x2c')]['hasOwnProperty'](_0x37c4('0x32'))){_0x5c9e85[_0x37c4('0x18')]=qs[_0x37c4('0x18')](_0xdacfb8['query'][_0x37c4('0x18')]);_0x5c9e85[_0x37c4('0x1a')]=qs[_0x37c4('0x1a')](_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x1a')]);}_0x5c9e85[_0x37c4('0x33')]=qs['sort'](_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x34')]);_0x5c9e85[_0x37c4('0x35')]=qs['filters'](_[_0x37c4('0x36')](_0xdacfb8[_0x37c4('0x2c')],_0x1185f5[_0x37c4('0x2d')]),_0x41060f);if(_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x37')]){_0x5c9e85[_0x37c4('0x35')]=_[_0x37c4('0x38')](_0x5c9e85['where'],{'$or':_['map'](_0x41060f,function(_0x26d2f0){if(_0x26d2f0[_0x37c4('0x39')]!=='VIRTUAL'){var _0x4b5b88={};_0x4b5b88[_0x26d2f0[_0x37c4('0x24')]]={'$like':'%'+_0xdacfb8[_0x37c4('0x2c')]['filter']+'%'};return _0x4b5b88;}})});}_0x5c9e85=_[_0x37c4('0x38')]({},_0x5c9e85,_0xdacfb8[_0x37c4('0x3a')]);var _0x3963ad={'where':_0x5c9e85[_0x37c4('0x35')]};return db[_0x37c4('0x25')][_0x37c4('0x19')](_0x3963ad)['then'](function(_0x536639){_0x5d74ac[_0x37c4('0x19')]=_0x536639;if(_0xdacfb8[_0x37c4('0x2c')][_0x37c4('0x3b')]){_0x5c9e85['include']=[{'all':!![]}];}return db[_0x37c4('0x25')][_0x37c4('0x3c')](_0x5c9e85);})[_0x37c4('0x20')](function(_0x51137f){_0x5d74ac['rows']=_0x51137f;return _0x5d74ac;})[_0x37c4('0x20')](respondWithFilteredResult(_0x1d0639,_0x5c9e85))[_0x37c4('0x3d')](handleError(_0x1d0639,null));};exports[_0x37c4('0x3e')]=function(_0x146577,_0x1ffcec){var _0x25e2d6={'raw':!![],'where':{'id':_0x146577[_0x37c4('0x3f')]['id']}},_0x22479d={};_0x22479d[_0x37c4('0x29')]=_[_0x37c4('0x2b')](db['ChatTransferReport'][_0x37c4('0x26')]);_0x22479d[_0x37c4('0x2c')]=_[_0x37c4('0x2b')](_0x146577[_0x37c4('0x2c')]);_0x22479d[_0x37c4('0x2d')]=_[_0x37c4('0x2e')](_0x22479d['model'],_0x22479d[_0x37c4('0x2c')]);_0x25e2d6['attributes']=_[_0x37c4('0x2e')](_0x22479d['model'],qs[_0x37c4('0x30')](_0x146577[_0x37c4('0x2c')][_0x37c4('0x30')]));_0x25e2d6['attributes']=_0x25e2d6[_0x37c4('0x2f')][_0x37c4('0x31')]?_0x25e2d6['attributes']:_0x22479d[_0x37c4('0x29')];if(_0x146577[_0x37c4('0x2c')][_0x37c4('0x3b')]){_0x25e2d6[_0x37c4('0x40')]=[{'all':!![]}];}_0x25e2d6=_[_0x37c4('0x38')]({},_0x25e2d6,_0x146577[_0x37c4('0x3a')]);return db[_0x37c4('0x25')][_0x37c4('0x41')](_0x25e2d6)[_0x37c4('0x20')](handleEntityNotFound(_0x1ffcec,null))[_0x37c4('0x20')](respondWithResult(_0x1ffcec,null))[_0x37c4('0x3d')](handleError(_0x1ffcec,null));};exports[_0x37c4('0x42')]=function(_0x3809d9,_0x312b12){return db[_0x37c4('0x25')][_0x37c4('0x42')](_0x3809d9[_0x37c4('0x43')],{})[_0x37c4('0x20')](respondWithResult(_0x312b12,0xc9))['catch'](handleError(_0x312b12,null));};exports[_0x37c4('0x44')]=function(_0x5ca3a0,_0x391b29){if(_0x5ca3a0['body']['id']){delete _0x5ca3a0['body']['id'];}return db[_0x37c4('0x25')][_0x37c4('0x41')]({'where':{'id':_0x5ca3a0[_0x37c4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x391b29,null))['then'](saveUpdates(_0x5ca3a0['body'],null))[_0x37c4('0x20')](respondWithResult(_0x391b29,null))['catch'](handleError(_0x391b29,null));};exports[_0x37c4('0x21')]=function(_0x5ba1e6,_0x5baf1f){return db[_0x37c4('0x25')]['find']({'where':{'id':_0x5ba1e6[_0x37c4('0x3f')]['id']}})[_0x37c4('0x20')](handleEntityNotFound(_0x5baf1f,null))[_0x37c4('0x20')](removeEntity(_0x5baf1f,null))['catch'](handleError(_0x5baf1f,null));};exports['describe']=function(_0x191ddd,_0xab2a55){return db['ChatTransferReport'][_0x37c4('0x45')]()[_0x37c4('0x20')](respondWithResult(_0xab2a55,null))[_0x37c4('0x3d')](handleError(_0xab2a55,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index c5fd67b..b97d4e0 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 _0x10f6=['./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x10f6,0x1da));var _0x610f=function(_0x5de6b0,_0x50421d){_0x5de6b0=_0x5de6b0-0x0;var _0x397b9e=_0x10f6[_0x5de6b0];return _0x397b9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x610f('0x0'))(_0x610f('0x1'));var moment=require(_0x610f('0x2'));var BPromise=require(_0x610f('0x3'));var rp=require(_0x610f('0x4'));var fs=require('fs');var path=require(_0x610f('0x5'));var rimraf=require('rimraf');var config=require(_0x610f('0x6'));var attributes=require(_0x610f('0x7'));module[_0x610f('0x8')]=function(_0x672ed2,_0x2624a2){return _0x672ed2[_0x610f('0x9')](_0x610f('0xa'),attributes,{'tableName':_0x610f('0xb'),'paranoid':![],'indexes':[{'name':_0x610f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xca0c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util'];(function(_0x1d8e86,_0x536855){var _0x43b5f1=function(_0x3a3230){while(--_0x3a3230){_0x1d8e86['push'](_0x1d8e86['shift']());}};_0x43b5f1(++_0x536855);}(_0xca0c,0x1da));var _0xcca0=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xca0c[_0x45783c];return _0x1161da;};'use strict';var _=require(_0xcca0('0x0'));var util=require(_0xcca0('0x1'));var logger=require('../../config/logger')(_0xcca0('0x2'));var moment=require(_0xcca0('0x3'));var BPromise=require(_0xcca0('0x4'));var rp=require(_0xcca0('0x5'));var fs=require('fs');var path=require(_0xcca0('0x6'));var rimraf=require(_0xcca0('0x7'));var config=require(_0xcca0('0x8'));var attributes=require(_0xcca0('0x9'));module[_0xcca0('0xa')]=function(_0x2b6056,_0x2e1333){return _0x2b6056['define'](_0xcca0('0xb'),attributes,{'tableName':_0xcca0('0xc'),'paranoid':![],'indexes':[{'name':_0xcca0('0xd'),'fields':[_0xcca0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index de7c53f..f7d072c 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 _0x4a0d=['catch','lodash','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x1a4ac6,_0x1c8f2f){var _0x1ab98e=function(_0x14b761){while(--_0x14b761){_0x1a4ac6['push'](_0x1a4ac6['shift']());}};_0x1ab98e(++_0x1c8f2f);}(_0x4a0d,0xa9));var _0xd4a0=function(_0x4ed37d,_0x1a84c9){_0x4ed37d=_0x4ed37d-0x0;var _0x4fb2c5=_0x4a0d[_0x4ed37d];return _0x4fb2c5;};'use strict';var _=require(_0xd4a0('0x0'));var util=require('util');var moment=require(_0xd4a0('0x1'));var BPromise=require(_0xd4a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd4a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4a0('0x4'))(_0xd4a0('0x5'));var config=require(_0xd4a0('0x6'));var jayson=require(_0xd4a0('0x7'));var client=jayson[_0xd4a0('0x8')][_0xd4a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbe752f,_0x401f9d,_0x5a9499){return new BPromise(function(_0x420e99,_0x10652b){return client[_0xd4a0('0xa')](_0xbe752f,_0x5a9499)[_0xd4a0('0xb')](function(_0x39e66b){logger[_0xd4a0('0xc')](_0xd4a0('0xd'),_0x401f9d,'request\x20sent');logger[_0xd4a0('0xe')](_0xd4a0('0xf'),_0x401f9d,_0xd4a0('0x10'),JSON['stringify'](_0x39e66b));if(_0x39e66b[_0xd4a0('0x11')]){if(_0x39e66b['error']['code']===0x1f4){logger[_0xd4a0('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x401f9d,_0x39e66b['error'][_0xd4a0('0x12')]);return _0x10652b(_0x39e66b[_0xd4a0('0x11')][_0xd4a0('0x12')]);}logger[_0xd4a0('0x11')](_0xd4a0('0xd'),_0x401f9d,_0x39e66b[_0xd4a0('0x11')]['message']);return _0x420e99(_0x39e66b[_0xd4a0('0x11')]['message']);}else{logger[_0xd4a0('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x401f9d,_0xd4a0('0x10'));_0x420e99(_0x39e66b[_0xd4a0('0x13')][_0xd4a0('0x12')]);}})[_0xd4a0('0x14')](function(_0x1a6de7){logger[_0xd4a0('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x401f9d,_0x1a6de7);_0x10652b(_0x1a6de7);});});}
\ No newline at end of file
+var _0xb7e0=['code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xf2efae,_0x307737){var _0x241311=function(_0x5ba928){while(--_0x5ba928){_0xf2efae['push'](_0xf2efae['shift']());}};_0x241311(++_0x307737);}(_0xb7e0,0x16b));var _0x0b7e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb7e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0b7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0b7e('0x1'));var rs=require(_0x0b7e('0x2'));var fs=require('fs');var Redis=require(_0x0b7e('0x3'));var db=require(_0x0b7e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b7e('0x5'));var config=require(_0x0b7e('0x6'));var jayson=require(_0x0b7e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8bd431,_0x26cee6,_0x157417){return new BPromise(function(_0xbfbf6f,_0x11b2e5){return client[_0x0b7e('0x8')](_0x8bd431,_0x157417)[_0x0b7e('0x9')](function(_0x8e7596){logger[_0x0b7e('0xa')](_0x0b7e('0xb'),_0x26cee6,'request\x20sent');logger[_0x0b7e('0xc')](_0x0b7e('0xd'),_0x26cee6,_0x0b7e('0xe'),JSON[_0x0b7e('0xf')](_0x8e7596));if(_0x8e7596[_0x0b7e('0x10')]){if(_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x11')]===0x1f4){logger['error'](_0x0b7e('0xb'),_0x26cee6,_0x8e7596['error']['message']);return _0x11b2e5(_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x12')]);}logger[_0x0b7e('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x26cee6,_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x12')]);return _0xbfbf6f(_0x8e7596[_0x0b7e('0x10')][_0x0b7e('0x12')]);}else{logger[_0x0b7e('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x26cee6,'request\x20sent');_0xbfbf6f(_0x8e7596[_0x0b7e('0x13')]['message']);}})['catch'](function(_0x4ff5c4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x26cee6,_0x4ff5c4);_0x11b2e5(_0x4ff5c4);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 9a53b57..382435c 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 _0xe8c7=['describe','/:id','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x151b2a,_0x2b88b8){var _0x5c2c04=function(_0x1786d0){while(--_0x1786d0){_0x151b2a['push'](_0x151b2a['shift']());}};_0x5c2c04(++_0x2b88b8);}(_0xe8c7,0xfe));var _0x7e8c=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xe8c7[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e8c('0x0'));var timeout=require('connect-timeout');var express=require(_0x7e8c('0x1'));var router=express[_0x7e8c('0x2')]();var fs_extra=require(_0x7e8c('0x3'));var auth=require(_0x7e8c('0x4'));var interaction=require(_0x7e8c('0x5'));var config=require(_0x7e8c('0x6'));var controller=require(_0x7e8c('0x7'));router[_0x7e8c('0x8')]('/',auth['isAuthenticated'](),controller[_0x7e8c('0x9')]);router[_0x7e8c('0x8')](_0x7e8c('0xa'),auth[_0x7e8c('0xb')](),controller[_0x7e8c('0xc')]);router[_0x7e8c('0x8')](_0x7e8c('0xd'),auth[_0x7e8c('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7e8c('0xe')]('/:id',auth[_0x7e8c('0xb')](),controller[_0x7e8c('0xf')]);router[_0x7e8c('0x10')](_0x7e8c('0xd'),auth[_0x7e8c('0xb')](),controller[_0x7e8c('0x11')]);module[_0x7e8c('0x12')]=router;
\ No newline at end of file
+var _0x3bcf=['../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3bcf,0x134));var _0xf3bc=function(_0x8e6b66,_0x1919e1){_0x8e6b66=_0x8e6b66-0x0;var _0x58050e=_0x3bcf[_0x8e6b66];return _0x58050e;};'use strict';var multer=require(_0xf3bc('0x0'));var util=require(_0xf3bc('0x1'));var path=require(_0xf3bc('0x2'));var timeout=require(_0xf3bc('0x3'));var express=require(_0xf3bc('0x4'));var router=express['Router']();var fs_extra=require(_0xf3bc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf3bc('0x6'));var config=require(_0xf3bc('0x7'));var controller=require(_0xf3bc('0x8'));router['get']('/',auth[_0xf3bc('0x9')](),controller[_0xf3bc('0xa')]);router[_0xf3bc('0xb')](_0xf3bc('0xc'),auth[_0xf3bc('0x9')](),controller[_0xf3bc('0xd')]);router[_0xf3bc('0xb')]('/:id',auth[_0xf3bc('0x9')](),controller[_0xf3bc('0xe')]);router[_0xf3bc('0xf')]('/',auth['isAuthenticated'](),controller[_0xf3bc('0x10')]);router[_0xf3bc('0x11')](_0xf3bc('0x12'),auth[_0xf3bc('0x9')](),controller[_0xf3bc('0x13')]);router['delete'](_0xf3bc('0x12'),auth[_0xf3bc('0x9')](),controller[_0xf3bc('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 8daf259..212f687 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 _0x5f51=['setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','name','text','input','getDataValue','onlineForm','textarea','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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}}','website_alias','bottom_right','CHAT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x43785a,_0x322357){var _0x3cbbbe=function(_0x367421){while(--_0x367421){_0x43785a['push'](_0x43785a['shift']());}};_0x3cbbbe(++_0x322357);}(_0x5f51,0x1ed));var _0x15f5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x5f51[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x15f5('0x0'));var rs=require(_0x15f5('0x1'));module[_0x15f5('0x2')]={'name':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'unique':_0x15f5('0x4')},'description':{'type':Sequelize[_0x15f5('0x3')]},'mapKey':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x5')},'mapKeyOffline':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15f5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x15f5('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'defaultValue':_0x15f5('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x15f5('0x9')](_0x15f5('0xa'),_0x15f5('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0xd')},'offline_chat_button':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0xe')},'download_transcript':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x15f5('0x11')]},'closingQuestion':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0x15')},'closingMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x17')},'conditionAgreement':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x18')},'ratingType':{'type':Sequelize[_0x15f5('0x9')]('star',_0x15f5('0x19')),'defaultValue':_0x15f5('0x1a')},'ratingStarsNumber':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':function(){return JSON[_0x15f5('0x1b')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x15f5('0x1c'),'type':_0x15f5('0x1d'),'required':!![]},'props':{'title':_0x15f5('0x1c'),'helpText':''}},{'type':_0x15f5('0x1e'),'props':{'title':_0x15f5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x15f5('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x15f5('0x1f')](_0x15f5('0x20'))?JSON['parse'](this['getDataValue'](_0x15f5('0x20'))):{};},'set':function(_0x211a1c){return this['setDataValue'](_0x15f5('0x20'),JSON[_0x15f5('0x1b')](_0x211a1c));}},'offlineForm':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':function(){return JSON[_0x15f5('0x1b')]({'items':[{'type':_0x15f5('0x1e'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x15f5('0x5'),'type':'email'},'variable':null},{'type':_0x15f5('0x21'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x15f5('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x15f5('0x1f')](_0x15f5('0x23'))?JSON['parse'](this[_0x15f5('0x1f')](_0x15f5('0x23'))):{};},'set':function(_0x274495){return this['setDataValue']('offlineForm',JSON[_0x15f5('0x1b')](_0x274495));}},'token':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':function(){return rs[_0x15f5('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x15f5('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x15f5('0x25')},'waitingMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x26')},'offlineMessageBody':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x15f5('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x15f5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':function(){return _0x15f5('0x29');}},'notificationSound':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x15f5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x2b')},'verticalAlignment':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':_0x15f5('0x2c')},'messagesAlignment':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x15f5('0x3')]},'customerAvatar':{'type':Sequelize[_0x15f5('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x15f5('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x15f5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x15f5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x15f5('0x8')],'comment':_0x15f5('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x16be02){if(!_0x16be02)this[_0x15f5('0x2e')]('mandatoryDispositionPauseId',null);this[_0x15f5('0x2e')](_0x15f5('0x2f'),_0x16be02);}},'vidaooEscalation':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x15f5('0x3')],'allowNull':![],'defaultValue':_0x15f5('0x30')},'vidaooNote':{'type':Sequelize[_0x15f5('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x15f5('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x15f5('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x15f5('0x11')]}};
\ No newline at end of file
+var _0xec01=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','ENUM','thumb','star','input','text','name','getDataValue','onlineForm','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x8df78,_0xdfee63){var _0xde4b55=function(_0x16c846){while(--_0x16c846){_0x8df78['push'](_0x8df78['shift']());}};_0xde4b55(++_0xdfee63);}(_0xec01,0x1a8));var _0x1ec0=function(_0x1b2bb7,_0x367e74){_0x1b2bb7=_0x1b2bb7-0x0;var _0x2489a7=_0xec01[_0x1b2bb7];return _0x2489a7;};'use strict';var Sequelize=require(_0x1ec0('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'unique':_0x1ec0('0x2')},'description':{'type':Sequelize[_0x1ec0('0x1')]},'mapKey':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x3')},'key':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1ec0('0x4')},'customerAlias':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'defaultValue':_0x1ec0('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec0('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1ec0('0x1')]},'animation':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0x1ec0('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x9')},'start_chat_button':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xa')},'offline_chat_button':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xb')},'header_offline':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xc')},'download_transcript':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1ec0('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1ec0('0xe')]},'closingQuestion':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x12')},'closingMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0xb')},'skipMessageButton':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x13')},'conditionAgreement':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x14')},'ratingType':{'type':Sequelize[_0x1ec0('0x15')]('star',_0x1ec0('0x16')),'defaultValue':_0x1ec0('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x1ec0('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x1ec0('0x19'),'required':!![]},'props':{'title':_0x1ec0('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x1ec0('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1ec0('0x3'),'type':_0x1ec0('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x1ec0('0x1b')](_0x1ec0('0x1c'))?JSON['parse'](this[_0x1ec0('0x1b')](_0x1ec0('0x1c'))):{};},'set':function(_0x136abe){return this['setDataValue'](_0x1ec0('0x1c'),JSON[_0x1ec0('0x1d')](_0x136abe));}},'offlineForm':{'type':Sequelize[_0x1ec0('0xe')],'defaultValue':function(){return JSON[_0x1ec0('0x1d')]({'items':[{'type':_0x1ec0('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x1ec0('0x3'),'type':_0x1ec0('0x3')},'variable':null},{'type':_0x1ec0('0x1e'),'config':{'placeholder':_0x1ec0('0x1f')},'props':{'title':_0x1ec0('0x1f'),'helpText':_0x1ec0('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1ec0('0x1b')](_0x1ec0('0x21'))?JSON['parse'](this[_0x1ec0('0x1b')](_0x1ec0('0x21'))):{};},'set':function(_0x2cf672){return this['setDataValue'](_0x1ec0('0x21'),JSON[_0x1ec0('0x1d')](_0x2cf672));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1ec0('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1ec0('0x1')]},'forwardOffline':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x23')},'waitingMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x24')},'offlineMessageBody':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x25')},'skipUnmanaged':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x13')},'sendUnmanaged':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1ec0('0xe')]},'showAgentAvatar':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1ec0('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x26')},'verticalAlignment':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x1ec0('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1ec0('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1ec0('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ec0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1ec0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':_0x1ec0('0x28')},'systemAvatar':{'type':Sequelize[_0x1ec0('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ec0('0x6')],'comment':_0x1ec0('0x29')},'mandatoryDisposition':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![],'comment':_0x1ec0('0x2a'),'set':function(_0xe913d2){if(!_0xe913d2)this['setDataValue'](_0x1ec0('0x2b'),null);this['setDataValue'](_0x1ec0('0x2c'),_0xe913d2);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1ec0('0x1')],'allowNull':![],'defaultValue':_0x1ec0('0x2d')},'vidaooNote':{'type':Sequelize[_0x1ec0('0x1')],'defaultValue':function(){return _0x1ec0('0x2e');}},'vidaooMetadata':{'type':Sequelize[_0x1ec0('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1ec0('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1ec0('0xe')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 52e60a6..6cb059d 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 _0x01d3=['Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','fields','nolimit','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','sitepic','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','chat','Sequelize','createdAt','updatedAt','difference','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','CmContact','contact','customerIp','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','originalname','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','textColor','color_button','backgroundColor','Transaction','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','end','stack','name','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','ChatWebsite','includeAll','include','rows','show','params','Pause','find','catch','create','body','user'];(function(_0x13ea78,_0x4fc7e3){var _0x19fe58=function(_0xfbc7c2){while(--_0xfbc7c2){_0x13ea78['push'](_0x13ea78['shift']());}};_0x19fe58(++_0x4fc7e3);}(_0x01d3,0xdb));var _0x301d=function(_0x2316bb,_0x469930){_0x2316bb=_0x2316bb-0x0;var _0x57041d=_0x01d3[_0x2316bb];return _0x57041d;};'use strict';var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x301d('0x0'));var path=require(_0x301d('0x1'));var ejs=require(_0x301d('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x301d('0x3'));var querystring=require(_0x301d('0x4'));var Redis=require(_0x301d('0x5'));var qs=require(_0x301d('0x6'));var logger=require(_0x301d('0x7'))('api');var config=require(_0x301d('0x8'));var db=require(_0x301d('0x9'))['db'];config[_0x301d('0xa')]=_[_0x301d('0xb')](config[_0x301d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x301d('0xc'))(new Redis(config[_0x301d('0xa')]));require(_0x301d('0xd'))[_0x301d('0xe')](socket);var jayson=require(_0x301d('0xf'));var client=jayson[_0x301d('0x10')][_0x301d('0x11')]({'port':0x232c});var client9002=jayson[_0x301d('0x10')][_0x301d('0x11')]({'port':0x232a});var client9003=jayson['client'][_0x301d('0x11')]({'port':0x232b});var client9001=jayson[_0x301d('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x8a1fd0,_0x36a7aa,_0x2eb3af,_0x53bfe2){return new BPromise(function(_0x496f0c,_0x175871){var _0x3218dc=_0x53bfe2||client;return _0x3218dc[_0x301d('0x12')](_0x8a1fd0,_0x2eb3af)[_0x301d('0x13')](function(_0x11bacf){logger[_0x301d('0x14')](_0x301d('0x15'),_0x36a7aa,'request\x20sent');logger[_0x301d('0x16')](_0x301d('0x17'),_0x36a7aa,'request\x20sent',JSON[_0x301d('0x18')](_0x11bacf));if(_0x11bacf[_0x301d('0x19')]){if(_0x11bacf[_0x301d('0x19')][_0x301d('0x1a')]===0x1f4){logger[_0x301d('0x19')](_0x301d('0x15'),_0x36a7aa,_0x11bacf[_0x301d('0x19')][_0x301d('0x1b')]);return _0x175871(_0x11bacf[_0x301d('0x19')][_0x301d('0x1b')]);}logger[_0x301d('0x19')](_0x301d('0x15'),_0x36a7aa,_0x11bacf[_0x301d('0x19')][_0x301d('0x1b')]);return _0x496f0c(_0x11bacf[_0x301d('0x19')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x36a7aa,_0x301d('0x1c'));_0x496f0c(_0x11bacf[_0x301d('0x1d')][_0x301d('0x1b')]);}})['catch'](function(_0x18495a){logger[_0x301d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x36a7aa,_0x18495a);_0x175871(_0x18495a);});});}function respondWithStatusCode(_0x485f96,_0x292c89){_0x292c89=_0x292c89||0xcc;return function(_0x30569e){if(_0x30569e){return _0x485f96[_0x301d('0x1e')](_0x292c89);}return _0x485f96[_0x301d('0x1f')](_0x292c89)['end']();};}function respondWithResult(_0x1119da,_0x2491b8){_0x2491b8=_0x2491b8||0xc8;return function(_0x10dd5a){if(_0x10dd5a){return _0x1119da[_0x301d('0x1f')](_0x2491b8)[_0x301d('0x20')](_0x10dd5a);}};}function respondWithFilteredResult(_0x28bef6,_0x4fae3d){return function(_0x470b7a){if(_0x470b7a){var _0xb315b6=typeof _0x4fae3d[_0x301d('0x21')]===_0x301d('0x22')&&typeof _0x4fae3d[_0x301d('0x23')]===_0x301d('0x22');var _0x396338=_0x470b7a[_0x301d('0x24')];var _0x5d05db=_0xb315b6?0x0:_0x4fae3d[_0x301d('0x21')];var _0x4feba8=_0xb315b6?_0x470b7a['count']:_0x4fae3d[_0x301d('0x21')]+_0x4fae3d['limit'];var _0x326722;if(_0x4feba8>=_0x396338){_0x4feba8=_0x396338;_0x326722=0xc8;}else{_0x326722=0xce;}_0x28bef6[_0x301d('0x1f')](_0x326722);return _0x28bef6[_0x301d('0x25')](_0x301d('0x26'),_0x5d05db+'-'+_0x4feba8+'/'+_0x396338)[_0x301d('0x20')](_0x470b7a);}return null;};}function saveUpdates(_0x5aaa61){return function(_0xa53d39){if(_0xa53d39){return _0xa53d39[_0x301d('0x27')](_0x5aaa61)[_0x301d('0x13')](function(_0x24b1d5){return _0x24b1d5;});}return null;};}function removeEntity(_0x4a8356){return function(_0x5b4930){if(_0x5b4930){return _0x5b4930['destroy']()['then'](function(){var _0x1cf0bb=_0x5b4930[_0x301d('0x28')]({'plain':!![]});var _0x27c3a1=_0x301d('0x29');return db[_0x301d('0x2a')][_0x301d('0x2b')]({'where':{'type':_0x27c3a1,'resourceId':_0x1cf0bb['id']}})[_0x301d('0x13')](function(){return _0x5b4930;});})[_0x301d('0x13')](function(){_0x4a8356[_0x301d('0x1f')](0xcc)[_0x301d('0x2c')]();});}};}function handleEntityNotFound(_0x4fa080){return function(_0x3032d1){if(!_0x3032d1){_0x4fa080[_0x301d('0x1e')](0x194);}return _0x3032d1;};}function handleError(_0x60949,_0x14aa4a){_0x14aa4a=_0x14aa4a||0x1f4;return function(_0x20b723){logger[_0x301d('0x19')](_0x20b723[_0x301d('0x2d')]);if(_0x20b723[_0x301d('0x2e')]){delete _0x20b723[_0x301d('0x2e')];}_0x60949[_0x301d('0x1f')](_0x14aa4a)['send'](_0x20b723);};}exports['index']=function(_0x42d663,_0x197402){var _0x335800={'include':[{'model':db['Pause'],'as':_0x301d('0x2f')}]},_0x2777a7={},_0x362e53={'count':0x0,'rows':[]};var _0x143a57=_[_0x301d('0x30')](db['ChatWebsite'][_0x301d('0x31')],function(_0x4b5acd){return{'name':_0x4b5acd[_0x301d('0x32')],'type':_0x4b5acd[_0x301d('0x33')][_0x301d('0x34')]};});_0x2777a7[_0x301d('0x35')]=_[_0x301d('0x30')](_0x143a57,_0x301d('0x2e'));_0x2777a7[_0x301d('0x36')]=_[_0x301d('0x37')](_0x42d663['query']);_0x2777a7[_0x301d('0x38')]=_[_0x301d('0x39')](_0x2777a7[_0x301d('0x35')],_0x2777a7[_0x301d('0x36')]);_0x335800[_0x301d('0x3a')]=_['intersection'](_0x2777a7['model'],qs['fields'](_0x42d663[_0x301d('0x36')]['fields']));_0x335800[_0x301d('0x3a')]=_0x335800[_0x301d('0x3a')][_0x301d('0x3b')]?_0x335800[_0x301d('0x3a')]:_0x2777a7[_0x301d('0x35')];if(!_0x42d663['query'][_0x301d('0x3c')]('nolimit')){_0x335800['limit']=qs[_0x301d('0x23')](_0x42d663['query']['limit']);_0x335800[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x42d663[_0x301d('0x36')][_0x301d('0x21')]);}_0x335800[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x42d663['query'][_0x301d('0x3e')]);_0x335800[_0x301d('0x3f')]=qs[_0x301d('0x38')](_[_0x301d('0x40')](_0x42d663[_0x301d('0x36')],_0x2777a7[_0x301d('0x38')]),_0x143a57);if(_0x42d663[_0x301d('0x36')]['filter']){_0x335800[_0x301d('0x3f')]=_['merge'](_0x335800['where'],{'$or':_[_0x301d('0x30')](_0x143a57,function(_0x141062){if(_0x141062['type']!==_0x301d('0x41')){var _0x54436f={};_0x54436f[_0x141062['name']]={'$like':'%'+_0x42d663['query'][_0x301d('0x42')]+'%'};return _0x54436f;}})});}_0x335800=_[_0x301d('0x43')]({},_0x335800,_0x42d663[_0x301d('0x44')]);var _0x4e8072={'where':_0x335800['where']};return db[_0x301d('0x45')][_0x301d('0x24')](_0x4e8072)[_0x301d('0x13')](function(_0x3f4a01){_0x362e53[_0x301d('0x24')]=_0x3f4a01;if(_0x42d663['query'][_0x301d('0x46')]){_0x335800[_0x301d('0x47')]=[{'all':!![]}];}return db[_0x301d('0x45')]['findAll'](_0x335800);})[_0x301d('0x13')](function(_0x331c4b){_0x362e53[_0x301d('0x48')]=_0x331c4b;return _0x362e53;})[_0x301d('0x13')](respondWithFilteredResult(_0x197402,_0x335800))['catch'](handleError(_0x197402,null));};exports[_0x301d('0x49')]=function(_0x587338,_0xe368b8){var _0x5dac87={'raw':![],'where':{'id':_0x587338[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x4b')],'as':_0x301d('0x2f')}]},_0x1e9a22={};_0x1e9a22[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0x45')][_0x301d('0x31')]);_0x1e9a22[_0x301d('0x36')]=_['keys'](_0x587338[_0x301d('0x36')]);_0x1e9a22[_0x301d('0x38')]=_[_0x301d('0x39')](_0x1e9a22[_0x301d('0x35')],_0x1e9a22['query']);_0x5dac87[_0x301d('0x3a')]=_['intersection'](_0x1e9a22['model'],qs['fields'](_0x587338[_0x301d('0x36')]['fields']));_0x5dac87['attributes']=_0x5dac87[_0x301d('0x3a')][_0x301d('0x3b')]?_0x5dac87[_0x301d('0x3a')]:_0x1e9a22[_0x301d('0x35')];if(_0x587338[_0x301d('0x36')][_0x301d('0x46')]){_0x5dac87[_0x301d('0x47')]=[{'all':!![]}];}_0x5dac87=_[_0x301d('0x43')]({},_0x5dac87,_0x587338[_0x301d('0x44')]);return db[_0x301d('0x45')][_0x301d('0x4c')](_0x5dac87)[_0x301d('0x13')](handleEntityNotFound(_0xe368b8,null))[_0x301d('0x13')](respondWithResult(_0xe368b8,null))[_0x301d('0x4d')](handleError(_0xe368b8,null));};exports[_0x301d('0x4e')]=function(_0x1aabbc,_0xd17e9b){return db[_0x301d('0x45')]['create'](_0x1aabbc[_0x301d('0x4f')],{})[_0x301d('0x13')](function(_0xa0535f){var _0x3d24fd=_0x1aabbc[_0x301d('0x50')][_0x301d('0x28')]({'plain':!![]});if(!_0x3d24fd)throw new Error(_0x301d('0x51'));if(_0x3d24fd['role']===_0x301d('0x50')){var _0x1f6117=_0xa0535f['get']({'plain':!![]});var _0x29eafe='ChatWebsites';return db['UserProfileSection']['find']({'where':{'name':_0x29eafe,'userProfileId':_0x3d24fd[_0x301d('0x52')]},'raw':!![]})[_0x301d('0x13')](function(_0x206a75){if(_0x206a75&&_0x206a75['autoAssociation']===0x0){return db[_0x301d('0x2a')]['create']({'name':_0x1f6117[_0x301d('0x2e')],'resourceId':_0x1f6117['id'],'type':_0x206a75[_0x301d('0x2e')],'sectionId':_0x206a75['id']},{})[_0x301d('0x13')](function(){return _0xa0535f;});}else{return _0xa0535f;}})[_0x301d('0x4d')](function(_0x398419){logger[_0x301d('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x398419);throw _0x398419;});}return _0xa0535f;})[_0x301d('0x13')](respondWithResult(_0xd17e9b,0xc9))['catch'](handleError(_0xd17e9b,null));};exports[_0x301d('0x27')]=function(_0x103f75,_0x9b8306){if(_0x103f75['body']['id']){delete _0x103f75['body']['id'];}return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x103f75[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x4b')],'as':'mandatoryDispositionPause'}]})[_0x301d('0x13')](handleEntityNotFound(_0x9b8306,null))[_0x301d('0x13')](saveUpdates(_0x103f75[_0x301d('0x4f')],null))[_0x301d('0x13')](respondWithResult(_0x9b8306,null))['catch'](handleError(_0x9b8306,null));};exports[_0x301d('0x2b')]=function(_0x48d5e8,_0x2e19e5){return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x48d5e8['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2e19e5,null))[_0x301d('0x13')](removeEntity(_0x2e19e5,null))[_0x301d('0x4d')](handleError(_0x2e19e5,null));};exports[_0x301d('0x53')]=function(_0x5c39f7,_0x46438c){return db[_0x301d('0x45')][_0x301d('0x53')]()[_0x301d('0x13')](respondWithResult(_0x46438c,null))[_0x301d('0x4d')](handleError(_0x46438c,null));};exports[_0x301d('0x54')]=function(_0x4ca952,_0x26b920){if(_0x4ca952[_0x301d('0x4f')]['id']){delete _0x4ca952[_0x301d('0x4f')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4ca952['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x26b920,null))[_0x301d('0x13')](function(_0xac7a6d){if(_0xac7a6d){_0x4ca952[_0x301d('0x4f')][_0x301d('0x55')]=_0xac7a6d['id'];return db[_0x301d('0x56')]['create'](_0x4ca952['body']);}})[_0x301d('0x13')](respondWithResult(_0x26b920,null))[_0x301d('0x4d')](handleError(_0x26b920,null));};exports[_0x301d('0x57')]=function(_0x39e9cc,_0x1da4ca){var _0x53ff42={'raw':![],'where':{}};var _0x3822c8={};var _0x4e8423={'count':0x0,'rows':[]};return db[_0x301d('0x45')]['findOne']({'where':{'id':_0x39e9cc[_0x301d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1da4ca,null))[_0x301d('0x13')](function(_0x5dbe3c){if(_0x5dbe3c){_0x3822c8['model']=_[_0x301d('0x37')](db['Disposition'][_0x301d('0x31')]);_0x3822c8[_0x301d('0x36')]=_[_0x301d('0x37')](_0x39e9cc[_0x301d('0x36')]);_0x3822c8[_0x301d('0x38')]=_[_0x301d('0x39')](_0x3822c8['model'],_0x3822c8[_0x301d('0x36')]);_0x53ff42[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x3822c8[_0x301d('0x35')],qs[_0x301d('0x58')](_0x39e9cc[_0x301d('0x36')][_0x301d('0x58')]));_0x53ff42['attributes']=_0x53ff42[_0x301d('0x3a')][_0x301d('0x3b')]?_0x53ff42[_0x301d('0x3a')]:_0x3822c8[_0x301d('0x35')];if(!_0x39e9cc[_0x301d('0x36')][_0x301d('0x3c')](_0x301d('0x59'))){_0x53ff42['limit']=qs[_0x301d('0x23')](_0x39e9cc[_0x301d('0x36')][_0x301d('0x23')]);_0x53ff42[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x39e9cc['query'][_0x301d('0x21')]);}_0x53ff42['order']=qs['sort'](_0x39e9cc[_0x301d('0x36')]['sort']);_0x53ff42[_0x301d('0x3f')]=qs[_0x301d('0x38')](_['pick'](_0x39e9cc[_0x301d('0x36')],_0x3822c8[_0x301d('0x38')]));_0x53ff42[_0x301d('0x3f')][_0x301d('0x55')]=_0x5dbe3c['id'];if(_0x39e9cc['query'][_0x301d('0x42')]){_0x53ff42[_0x301d('0x3f')]=_['merge'](_0x53ff42[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x53ff42[_0x301d('0x3a')],function(_0x1a83d5){var _0x136370={};_0x136370[_0x1a83d5]={'$like':'%'+_0x39e9cc[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x136370;})});}_0x53ff42=_['merge']({},_0x53ff42,_0x39e9cc[_0x301d('0x44')]);return db[_0x301d('0x56')]['count']({'where':_0x53ff42[_0x301d('0x3f')]})['then'](function(_0x13222e){_0x4e8423[_0x301d('0x24')]=_0x13222e;if(_0x39e9cc[_0x301d('0x36')]['includeAll']){_0x53ff42[_0x301d('0x47')]=[{'all':!![]}];}return db[_0x301d('0x56')][_0x301d('0x5a')](_0x53ff42);})[_0x301d('0x13')](function(_0x7b0ccb){_0x4e8423[_0x301d('0x48')]=_0x7b0ccb;return _0x4e8423;});}})[_0x301d('0x13')](respondWithFilteredResult(_0x1da4ca,_0x53ff42))[_0x301d('0x4d')](handleError(_0x1da4ca,null));};exports[_0x301d('0x5b')]=function(_0x315226,_0x133cfa){return db[_0x301d('0x45')]['find']({'where':{'id':_0x315226[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x133cfa,null))[_0x301d('0x13')](function(_0x220a49){if(_0x220a49){return _0x220a49[_0x301d('0x5b')](_0x315226[_0x301d('0x36')][_0x301d('0x5c')]);}})[_0x301d('0x13')](respondWithStatusCode(_0x133cfa,null))[_0x301d('0x4d')](handleError(_0x133cfa,null));};exports[_0x301d('0x5d')]=function(_0x517751,_0xb8e07d){if(_0x517751['body']['id']){delete _0x517751[_0x301d('0x4f')]['id'];}return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x517751[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0xb8e07d,null))[_0x301d('0x13')](function(_0x2175ae){if(_0x2175ae){_0x517751[_0x301d('0x4f')][_0x301d('0x55')]=_0x2175ae['id'];return db['CannedAnswer']['create'](_0x517751['body']);}})[_0x301d('0x13')](respondWithResult(_0xb8e07d,null))['catch'](handleError(_0xb8e07d,null));};exports[_0x301d('0x5e')]=function(_0x31377b,_0x3887fe){var _0x25749f={'raw':![],'where':{}};var _0x3ccaf8={};var _0x1fcf00={'count':0x0,'rows':[]};return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x31377b[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x3887fe,null))['then'](function(_0x5e1403){if(_0x5e1403){_0x3ccaf8[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0x60')][_0x301d('0x31')]);_0x3ccaf8[_0x301d('0x36')]=_[_0x301d('0x37')](_0x31377b['query']);_0x3ccaf8[_0x301d('0x38')]=_[_0x301d('0x39')](_0x3ccaf8[_0x301d('0x35')],_0x3ccaf8['query']);_0x25749f[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x3ccaf8[_0x301d('0x35')],qs[_0x301d('0x58')](_0x31377b[_0x301d('0x36')][_0x301d('0x58')]));_0x25749f[_0x301d('0x3a')]=_0x25749f['attributes'][_0x301d('0x3b')]?_0x25749f[_0x301d('0x3a')]:_0x3ccaf8['model'];if(!_0x31377b['query']['hasOwnProperty'](_0x301d('0x59'))){_0x25749f[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x31377b[_0x301d('0x36')][_0x301d('0x23')]);_0x25749f[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x31377b[_0x301d('0x36')]['offset']);}_0x25749f[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x31377b[_0x301d('0x36')][_0x301d('0x3e')]);_0x25749f[_0x301d('0x3f')]=qs[_0x301d('0x38')](_['pick'](_0x31377b[_0x301d('0x36')],_0x3ccaf8['filters']));_0x25749f[_0x301d('0x3f')][_0x301d('0x55')]=_0x5e1403['id'];if(_0x31377b['query'][_0x301d('0x42')]){_0x25749f[_0x301d('0x3f')]=_['merge'](_0x25749f[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x25749f[_0x301d('0x3a')],function(_0x401cfd){var _0x32f69b={};_0x32f69b[_0x401cfd]={'$like':'%'+_0x31377b[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x32f69b;})});}_0x25749f=_[_0x301d('0x43')]({},_0x25749f,_0x31377b[_0x301d('0x44')]);return db[_0x301d('0x60')][_0x301d('0x24')]({'where':_0x25749f[_0x301d('0x3f')]})['then'](function(_0x438cca){_0x1fcf00[_0x301d('0x24')]=_0x438cca;if(_0x31377b[_0x301d('0x36')]['includeAll']){_0x25749f[_0x301d('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0x301d('0x5a')](_0x25749f);})[_0x301d('0x13')](function(_0x14a3ac){_0x1fcf00['rows']=_0x14a3ac;return _0x1fcf00;});}})[_0x301d('0x13')](respondWithFilteredResult(_0x3887fe,_0x25749f))['catch'](handleError(_0x3887fe,null));};exports['removeAnswers']=function(_0x4de203,_0x5ab5c4){return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x4de203[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x5ab5c4,null))[_0x301d('0x13')](function(_0x312478){if(_0x312478){return _0x312478[_0x301d('0x61')](_0x4de203[_0x301d('0x36')][_0x301d('0x5c')]);}})[_0x301d('0x13')](respondWithStatusCode(_0x5ab5c4,null))[_0x301d('0x4d')](handleError(_0x5ab5c4,null));};exports['addLogo']=function(_0x76bb65,_0x27dc8d){_0x76bb65[_0x301d('0x4f')]['sitepic']=_0x76bb65[_0x301d('0x62')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x76bb65[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x27dc8d,null))[_0x301d('0x13')](saveUpdates(_0x76bb65[_0x301d('0x4f')],null))['then'](respondWithResult(_0x27dc8d,null))[_0x301d('0x4d')](handleError(_0x27dc8d,null));};exports[_0x301d('0x63')]=function(_0x12411e,_0x5e5dd1){_0x12411e[_0x301d('0x4f')][_0x301d('0x64')]=_0x12411e[_0x301d('0x62')][_0x301d('0x65')];return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x12411e[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x5e5dd1,null))['then'](saveUpdates(_0x12411e[_0x301d('0x4f')],null))[_0x301d('0x13')](respondWithResult(_0x5e5dd1,null))[_0x301d('0x4d')](handleError(_0x5e5dd1,null));};exports[_0x301d('0x66')]=function(_0x13e763,_0x5010f9){_0x13e763[_0x301d('0x4f')][_0x301d('0x67')]=_0x13e763['file'][_0x301d('0x65')];return db[_0x301d('0x45')]['find']({'where':{'id':_0x13e763['params']['id']}})['then'](handleEntityNotFound(_0x5010f9,null))['then'](saveUpdates(_0x13e763[_0x301d('0x4f')],null))['then'](respondWithResult(_0x5010f9,null))[_0x301d('0x4d')](handleError(_0x5010f9,null));};exports[_0x301d('0x68')]=function(_0x5898aa,_0x459129){_0x5898aa[_0x301d('0x4f')][_0x301d('0x69')]=_0x5898aa['file']['filename'];return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x5898aa['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x459129,null))[_0x301d('0x13')](saveUpdates(_0x5898aa[_0x301d('0x4f')],null))[_0x301d('0x13')](respondWithResult(_0x459129,null))['catch'](handleError(_0x459129,null));};exports[_0x301d('0x6a')]=function(_0x2735d0,_0x49120f){var _0x1fd44b=path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server/files/images/logos/default_logo.svg');var _0x184e90={'where':{'id':_0x2735d0[_0x301d('0x4a')]['id']},'attributes':['id',_0x301d('0x6d')],'raw':!![]};var _0x39082d=![];return require(_0x301d('0x6e'))[_0x301d('0x6f')]()[_0x301d('0x13')](function(_0x1350e9){if(_0x1350e9){_0x39082d=_0x1350e9[_0x301d('0x70')];}})[_0x301d('0x13')](function(){return db['ChatWebsite'][_0x301d('0x4c')](_0x184e90);})[_0x301d('0x13')](handleEntityNotFound(_0x49120f,null))['then'](function(_0x5adfb7){if(_0x5adfb7){if(!_[_0x301d('0x71')](_0x5adfb7['sitepic'])){if(fs['existsSync'](path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server/files/images/logos/',_0x5adfb7[_0x301d('0x6d')]))&&_0x39082d){_0x1fd44b=path['join'](config['root'],_0x301d('0x72'),_0x5adfb7['sitepic']);}}return _0x49120f[_0x301d('0x73')](_0x1fd44b);}})[_0x301d('0x4d')](handleError(_0x49120f,null));};exports['getAvatar']=function(_0xa0485f,_0x467f4f){var _0x2cf40d=path[_0x301d('0x6b')](config['root'],_0x301d('0x74'));var _0x5761ce={'where':{'id':_0xa0485f[_0x301d('0x4a')]['id']},'attributes':['id',_0x301d('0x64')],'raw':!![]};return db[_0x301d('0x45')]['find'](_0x5761ce)[_0x301d('0x13')](handleEntityNotFound(_0x467f4f,null))[_0x301d('0x13')](function(_0x43c643){if(_0x43c643){if(!_['isNil'](_0x43c643['agentAvatar'])){if(fs[_0x301d('0x75')](path[_0x301d('0x6b')](config['root'],_0x301d('0x76'),_0x43c643[_0x301d('0x64')]))){_0x2cf40d=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0x76'),_0x43c643['agentAvatar']);}}return _0x467f4f['download'](_0x2cf40d);}})['catch'](handleError(_0x467f4f,null));};exports['getCustomerAvatar']=function(_0x30118b,_0x2677d2){var _0x359138=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0x77'));var _0x305ac9={'where':{'id':_0x30118b['params']['id']},'attributes':['id','customerAvatar',_0x301d('0x78')],'raw':!![]};return db[_0x301d('0x45')]['find'](_0x305ac9)[_0x301d('0x13')](handleEntityNotFound(_0x2677d2,null))['then'](function(_0x1fb5a9){if(_0x1fb5a9){if(!_[_0x301d('0x71')](_0x1fb5a9[_0x301d('0x67')])){if(fs[_0x301d('0x75')](path['join'](config[_0x301d('0x6c')],'server/files/images/avatars/',_0x1fb5a9[_0x301d('0x67')]))&&_0x1fb5a9[_0x301d('0x78')]){_0x359138=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0x76'),_0x1fb5a9[_0x301d('0x67')]);}}return _0x2677d2['download'](_0x359138);}})[_0x301d('0x4d')](handleError(_0x2677d2,null));};exports['getSystemAvatar']=function(_0x2b81c3,_0x577e43){var _0x43c774=path['join'](config[_0x301d('0x6c')],_0x301d('0x79'));var _0x4d7e36={'where':{'id':_0x2b81c3[_0x301d('0x4a')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x301d('0x45')][_0x301d('0x4c')](_0x4d7e36)['then'](handleEntityNotFound(_0x577e43,null))[_0x301d('0x13')](function(_0x46d1d5){if(_0x46d1d5){if(!_[_0x301d('0x71')](_0x46d1d5['systemAvatar'])){if(fs['existsSync'](path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server/files/images/avatars/',_0x46d1d5[_0x301d('0x69')]))){_0x43c774=path[_0x301d('0x6b')](config['root'],_0x301d('0x76'),_0x46d1d5[_0x301d('0x69')]);}}return _0x577e43[_0x301d('0x73')](_0x43c774);}})[_0x301d('0x4d')](handleError(_0x577e43,null));};exports['notify']=function(_0x3fb656,_0x1a5088){var _0x52224=require(_0x301d('0x7a'));var _0xe5fb36=new _0x52224();var _0x453ae3=_0xe5fb36[_0x301d('0x7b')](_0x3fb656[_0x301d('0x7c')]['user-agent'])['getResult']();var _0x3dd836={'body':_0x3fb656['body'],'channel':_0x301d('0x7d')};var _0xe445ba=[];var _0x2fd529=[];var _0x2d7df9={};var _0x29423d=![];return db['CmContact'][_0x301d('0x53')]()[_0x301d('0x13')](function(_0x214d8e){if(!_0x214d8e){throw new db[(_0x301d('0x7e'))]['ValidationError']('no\x20available\x20attributes');}_0xe445ba=_['difference'](_[_0x301d('0x37')](_0x214d8e),[_0x301d('0x7f'),_0x301d('0x80')]);_0x2fd529=_[_0x301d('0x81')](_[_0x301d('0x37')](_0x214d8e),['createdAt',_0x301d('0x80'),_0x301d('0x82'),_0x301d('0x83')]);if(_0x3fb656['body']['id']){delete _0x3fb656[_0x301d('0x4f')]['id'];}if(_[_0x301d('0x71')](_0x3fb656['body'][_0x301d('0x84')])){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))]('from\x20is\x20mandatory');}if(_[_0x301d('0x71')](_0x3fb656[_0x301d('0x4f')][_0x301d('0x4f')])||_0x3fb656[_0x301d('0x4f')]['body']===''){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0x86'));}if(_['isNil'](_0x3fb656[_0x301d('0x4f')]['mapKey'])){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0x87')+_0x2fd529);}if(!_[_0x301d('0x88')](_0x2fd529,_0x3fb656[_0x301d('0x4f')]['mapKey'])){throw new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0x89')+_0x2fd529);}_0x2d7df9[_0x3fb656[_0x301d('0x4f')][_0x301d('0x8a')]]=_0x3fb656[_0x301d('0x4f')][_0x301d('0x84')];})[_0x301d('0x13')](function(){return db[_0x301d('0x45')][_0x301d('0x4c')]({'where':{'id':_0x3fb656[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x8b')],'as':_0x301d('0x8c'),'include':[{'model':db['CmContact'],'as':_0x301d('0x8d'),'where':_0x2d7df9,'limit':0x1,'order':[[_0x301d('0x80'),_0x301d('0x8e')]]}]},{'model':db[_0x301d('0x8f')],'as':_0x301d('0x90')}]});})['then'](handleEntityNotFound(_0x1a5088,null))['then'](function(_0x312093){if(_0x312093&&_0x312093[_0x301d('0x8c')]){_0x3dd836[_0x301d('0x91')]=_0x312093;_0x3dd836[_0x301d('0x92')]=_0x312093[_0x301d('0x90')];_0x3dd836['list']=_0x312093[_0x301d('0x8c')];_0x3dd836[_0x301d('0x92')]=_[_0x301d('0x93')](_0x3dd836[_0x301d('0x92')],[_0x301d('0x94')],[_0x301d('0x95')]);if(_0x3dd836[_0x301d('0x91')][_0x301d('0x90')]){delete _0x3dd836[_0x301d('0x91')][_0x301d('0x90')];}if(_0x3dd836[_0x301d('0x91')][_0x301d('0x8c')]&&_0x3dd836[_0x301d('0x91')][_0x301d('0x8c')][_0x301d('0x8d')][_0x301d('0x3b')]){return _0x3dd836['account'][_0x301d('0x8c')][_0x301d('0x8d')][0x0];}var _0x36b4bd=_[_0x301d('0xb')](_0x3fb656[_0x301d('0x4f')],{'firstName':_0x3fb656['body'][_0x301d('0x84')],'ListId':_0x312093[_0x301d('0x83')]});_0x36b4bd[_0x3fb656[_0x301d('0x4f')]['mapKey']]=_0x3fb656['body'][_0x301d('0x84')];return db[_0x301d('0x96')]['create'](_0x36b4bd,{'fields':_0xe445ba,'raw':!![]});}})[_0x301d('0x13')](handleEntityNotFound(_0x1a5088,null))[_0x301d('0x13')](function(_0xa6f5dc){_0x3dd836[_0x301d('0x97')]=_0xa6f5dc;var _0x9f089b=_0x3fb656['body'][_0x301d('0x98')];if(_0x3fb656[_0x301d('0x7c')]['cf-connecting-ip']){_0x9f089b=_0x3fb656[_0x301d('0x7c')]['cf-connecting-ip'];}else if(_0x3fb656[_0x301d('0x7c')]['x-forwarded-for']){_0x9f089b=_[_0x301d('0x99')](_0x3fb656['headers'][_0x301d('0x9a')][_0x301d('0x9b')](','));}if(_0xa6f5dc){var _0xb5f2f0={'ContactId':_0xa6f5dc['id'],'ChatWebsiteId':_0x3fb656[_0x301d('0x4a')]['id'],'from':(_0xa6f5dc[_0x301d('0x9c')]||'')+'\x20'+(_0xa6f5dc[_0x301d('0x9d')]||''),'customerIp':_0x9f089b,'customerPort':_0x3fb656[_0x301d('0x7c')][_0x301d('0x9e')]?_0x3fb656[_0x301d('0x7c')]['x-real-port']:null,'referer':_0x3fb656[_0x301d('0x4f')][_0x301d('0x9f')],'browserName':_0x453ae3[_0x301d('0xa0')][_0x301d('0x2e')]&&_0x453ae3[_0x301d('0xa0')]['version']?util[_0x301d('0xa1')](_0x301d('0xa2'),_0x453ae3[_0x301d('0xa0')]['name'],_0x453ae3[_0x301d('0xa0')]['version']):_0x301d('0xa3'),'browserVersion':_0x453ae3[_0x301d('0xa0')][_0x301d('0xa4')]||_0x301d('0xa3'),'osName':util['format']('%s\x20%s',_0x453ae3['os'][_0x301d('0x2e')],_0x453ae3['os']['version']),'osVersion':_0x453ae3['os']['version'],'deviceModel':_0x453ae3[_0x301d('0xa5')][_0x301d('0x35')]&&_0x453ae3[_0x301d('0xa5')][_0x301d('0xa6')]?util[_0x301d('0xa1')]('%s\x20%s\x20%s',_0x453ae3['device'][_0x301d('0x35')],_0x453ae3['device'][_0x301d('0xa6')],_0x453ae3['device'][_0x301d('0x33')]):null,'deviceVendor':_0x453ae3['device']['vendor'],'deviceType':_0x453ae3[_0x301d('0xa5')][_0x301d('0x33')],'formData':JSON[_0x301d('0x18')](_0x3fb656[_0x301d('0x4f')])};var _0x1274d0={'ChatWebsiteId':_0x3fb656['params']['id'],'closed':![]};if(_0x3fb656[_0x301d('0x4f')][_0x301d('0xa7')]){_0x1274d0[_0x301d('0xa7')]=_0x3fb656[_0x301d('0x4f')][_0x301d('0xa7')];return db['ChatInteraction'][_0x301d('0x4c')]({'where':_0x1274d0})[_0x301d('0x13')](function(_0xd8f0b8){if(_0xd8f0b8){return[_0xd8f0b8,![]];}_0xb5f2f0[_0x301d('0xa7')]=_0x3fb656['body'][_0x301d('0xa7')];_0xb5f2f0[_0x301d('0xa8')]=_0x3fb656[_0x301d('0x4f')][_0x301d('0xa8')];return db[_0x301d('0xa9')][_0x301d('0x4e')](_0xb5f2f0)[_0x301d('0x13')](function(_0x3aa82f){return[_0x3aa82f,!![]];});});}_0x1274d0[_0x301d('0xaa')]=_0xa6f5dc['id'];if(_0x3fb656[_0x301d('0x4f')][_0x301d('0xab')]&&_0x3fb656['body'][_0x301d('0xab')]['id']){_0x1274d0['id']=_0x3fb656[_0x301d('0x4f')][_0x301d('0xab')]['id'];return db['ChatInteraction'][_0x301d('0x4c')]({'where':_0x1274d0})[_0x301d('0x13')](function(_0x18a18a){if(_0x18a18a){return[_0x18a18a,![]];}return db[_0x301d('0xa9')]['create'](_0xb5f2f0)['then'](function(_0x1f81b2){return[_0x1f81b2,!![]];});});}return db[_0x301d('0xa9')][_0x301d('0x4e')](_0xb5f2f0)['then'](function(_0x56befc){return[_0x56befc,!![]];});}})[_0x301d('0xac')](function(_0x71c2a8,_0x18221a){if(_0x71c2a8){_0x29423d=_0x18221a;if(!_0x18221a){var _0x4f6b0a={'from':(_0x3dd836['contact']['firstName']||'')+'\x20'+(_0x3dd836[_0x301d('0x97')]['lastName']||'')};if(_0x3fb656['body'][_0x301d('0xa7')]&&_0x3fb656[_0x301d('0x4f')][_0x301d('0xad')]&&_0x3fb656['body']['threadId']!=_0x3fb656[_0x301d('0x4f')][_0x301d('0xad')]){_0x4f6b0a[_0x301d('0xa7')]=_0x3fb656['body'][_0x301d('0xad')];}return _0x71c2a8[_0x301d('0x27')](_0x4f6b0a);}else{return _0x71c2a8;}}})[_0x301d('0x13')](function(_0x3d7cb7){_0x3dd836[_0x301d('0xab')]=_0x3d7cb7[_0x301d('0x28')]({'plain':!![]});_0x3dd836['interaction'][_0x301d('0xae')]=_0x29423d;if(_0x3dd836[_0x301d('0xab')][_0x301d('0xae')]){if(_0x3dd836['account'][_0x301d('0xaf')]){_0x3dd836[_0x301d('0x92')][_0x301d('0xb0')]({'id':0x0,'priority':_0x3dd836[_0x301d('0x92')]['length']+0x1,'app':'close','appdata':_0x301d('0xb1'),'interval':_0x301d('0xb2')});}}return db[_0x301d('0xb3')]['create']({'body':_0x3fb656[_0x301d('0x4f')][_0x301d('0x4f')],'ChatWebsiteId':_0x3fb656[_0x301d('0x4a')]['id'],'ChatInteractionId':_0x3d7cb7['id'],'direction':'in','ContactId':_0x3dd836[_0x301d('0x97')]['id'],'AttachmentId':_0x3fb656[_0x301d('0x4f')][_0x301d('0xb4')]});})['then'](function(_0x24f27d){_0x3dd836[_0x301d('0x1b')]=_0x24f27d;if(_0x3dd836['interaction'][_0x301d('0xb5')]){return db['User'][_0x301d('0x4c')]({'attributes':['id','name'],'where':{'id':_0x3dd836[_0x301d('0xab')][_0x301d('0xb5')]}})[_0x301d('0x13')](function(_0x38298b){if(_0x38298b){_0x3dd836[_0x301d('0x92')][_0x301d('0xb6')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x38298b[_0x301d('0x2e')]+','+(_0x3dd836[_0x301d('0x91')][_0x301d('0xb7')]||0xa),'interval':'*,*,*,*'});_0x3dd836[_0x301d('0xb8')]=!![];}return respondWithRpcPromise(_0x301d('0xb9'),_0x301d('0xba'),_0x3dd836);});}return respondWithRpcPromise(_0x301d('0xb9'),_0x301d('0xba'),_0x3dd836);})[_0x301d('0x13')](function(_0x21db96){respondWithRpcPromise(_0x301d('0xbb'),_0x301d('0xbb'),{'event':_0x301d('0xbc'),'message':_0x21db96},client9002);return _0x21db96;})[_0x301d('0x13')](respondWithResult(_0x1a5088,null))[_0x301d('0x4d')](handleError(_0x1a5088,null));};exports[_0x301d('0xbd')]=function(_0x247516,_0xa43c31){var _0x1bcf6f,_0xa4bd83,_0x24145f;var _0x1f1958=[];var _0xc0e836={};var _0x3eeaed=_0x247516[_0x301d('0xbe')]||[];var _0xbacdbb=[];var _0x258019;return db[_0x301d('0x96')]['describe']()[_0x301d('0x13')](function(_0x1c9a68){if(!_0x1c9a68){throw new db['Sequelize'][(_0x301d('0x85'))]('no\x20available\x20attributes');}_0x1f1958=_[_0x301d('0x81')](_[_0x301d('0x37')](_0x1c9a68),[_0x301d('0x7f'),'updatedAt',_0x301d('0x82'),_0x301d('0x83')]);if(_0x247516[_0x301d('0x4f')]['id']){delete _0x247516['body']['id'];}if(_['isNil'](_0x247516[_0x301d('0x4f')]['from'])){throw _0xa43c31[_0x301d('0x1f')](0x1f4)[_0x301d('0xbf')](new db['Sequelize'][(_0x301d('0x85'))]('from\x20is\x20mandatory'));}if(_[_0x301d('0x71')](_0x247516[_0x301d('0x4f')][_0x301d('0x4f')])||_0x247516[_0x301d('0x4f')][_0x301d('0x4f')]===''){throw _0xa43c31[_0x301d('0x1f')](0x1f4)['send'](new db[(_0x301d('0x7e'))]['ValidationError'](_0x301d('0x86')));}if(_[_0x301d('0x71')](_0x247516[_0x301d('0x4f')]['mapKeyOffline'])){throw _0xa43c31[_0x301d('0x1f')](0x1f4)['send'](new db[(_0x301d('0x7e'))][(_0x301d('0x85'))](_0x301d('0xc0')+_0x1f1958));}if(!_[_0x301d('0x88')](_0x1f1958,_0x247516[_0x301d('0x4f')][_0x301d('0xc1')])){throw _0xa43c31[_0x301d('0x1f')](0x1f4)[_0x301d('0xbf')](new db['Sequelize']['ValidationError'](_0x301d('0xc2')+_0x1f1958));}_0xc0e836[_0x247516['body']['mapKeyOffline']]=_0x247516[_0x301d('0x4f')][_0x301d('0x84')];})[_0x301d('0x13')](function(){return db[_0x301d('0x45')]['find']({'where':{'id':_0x247516[_0x301d('0x4a')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x301d('0xc3')}]});})['then'](handleEntityNotFound(_0xa43c31,null))[_0x301d('0x13')](function(_0x1718de){if(_0x1718de&&_0x1718de[_0x301d('0x8c')]){_0xa4bd83=_0x1718de;var _0x5db850=_[_0x301d('0xb')](_0x247516[_0x301d('0x4f')],{'firstName':_0x247516[_0x301d('0x4f')][_0x301d('0x84')],'phone':_0x247516[_0x301d('0x4f')]['from'],'ListId':_0x1718de[_0x301d('0x83')]});_0x5db850[_0x247516[_0x301d('0x4f')][_0x301d('0xc1')]]=_0x247516[_0x301d('0x4f')][_0x301d('0x84')];return db[_0x301d('0x96')]['findOrCreate']({'where':_0xc0e836,'defaults':_0x5db850});}})['spread'](function(_0x2f0426){if(_0x2f0426){_0x24145f=_0x2f0426;var _0x101a0d=fs[_0x301d('0xc4')](path[_0x301d('0x6b')](config['root'],_0x301d('0xc5')),_0x301d('0xc6'));var _0x54eafe=ejs[_0x301d('0xc7')](_0x101a0d,{'body':_['toPairs'](_0x247516['body'][_0x301d('0x4f')]),'bodyTitle':_0xa4bd83[_0x301d('0xc8')]});return db['ChatOfflineMessage']['create']({'body':_0x54eafe,'ContactId':_0x2f0426['id'],'ChatWebsiteId':_0xa4bd83['id']});}})[_0x301d('0x13')](function(_0x49d40f){_0x258019=_0x49d40f;if(_0x3eeaed[_0x301d('0x3b')]){var _0x216778=_0x3eeaed[_0x301d('0x30')](function(_0x38e7db){return{'name':_0x38e7db[_0x301d('0xc9')],'basename':_0x38e7db[_0x301d('0x65')],'type':_0x38e7db['mimetype'],'ChatOfflineMessageId':_0x49d40f['id']};});_0xbacdbb=_0x216778[_0x301d('0x30')](_0x33cb22=>{var _0x5ee26f={'filename':_0x33cb22[_0x301d('0x2e')],'path':path[_0x301d('0x6b')](config[_0x301d('0x6c')],'server','files','attachments',_0x301d('0xca'),_0x33cb22['basename'])};return _0x5ee26f;});if(!_0xa4bd83[_0x301d('0xcb')]){return db[_0x301d('0xcc')][_0x301d('0xcd')](function(_0x2c160f){return db[_0x301d('0xce')][_0x301d('0xcf')](_0x216778,{'transaction':_0x2c160f});});}}})[_0x301d('0x13')](function(){if(_0x258019){_0x1bcf6f=_0x258019;return db[_0x301d('0xc3')][_0x301d('0x5f')]({'where':{'active':!![]},'include':[{'model':db[_0x301d('0xd0')],'as':_0x301d('0xd1'),'raw':!![]}]});}})[_0x301d('0x13')](function(_0x13a4b0){if(_0x13a4b0&&_0x13a4b0['Smtp']&&_0xa4bd83['forwardOffline']&&_0xa4bd83[_0x301d('0xd2')]){var _0x56862b={'tls':{'rejectUnauthorized':![]}};if(_0x13a4b0['Smtp']['service']){_0x56862b['service']=_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd3')];}else{_0x56862b['host']=_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd4')];_0x56862b[_0x301d('0xd5')]=_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd5')];_0x56862b[_0x301d('0xd6')]=_0x13a4b0['Smtp']['secure'];}if(_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd7')]){_0x56862b[_0x301d('0xd8')]={'user':_0x13a4b0[_0x301d('0xd1')]['user'],'pass':_0x13a4b0[_0x301d('0xd1')][_0x301d('0xd9')]};}return respondWithRpcPromise('SendMail',_0x301d('0xda'),{'account':_0x56862b,'message':{'from':util['format'](_0x301d('0xdb'),_0x13a4b0[_0x301d('0x2e')],_0x13a4b0[_0x301d('0xdc')]||_0x13a4b0[_0x301d('0xd1')][_0x301d('0x50')]),'to':_0xa4bd83[_0x301d('0xd2')],'subject':_0xa4bd83[_0x301d('0xdd')],'html':_0x1bcf6f['body'],'attachments':_0xbacdbb}},client9003)['then'](function(){return _0x1bcf6f;})[_0x301d('0x4d')](function(_0x2d6bc2){console[_0x301d('0x19')](_0x2d6bc2);});}})['then'](function(){if(_0xa4bd83&&_0xa4bd83[_0x301d('0xcb')]&&_0xa4bd83[_0x301d('0xde')]){var _0xae4f07=[];if(_0x3eeaed[_0x301d('0x3b')]){_0xae4f07=_0x3eeaed[_0x301d('0x30')](function(_0x562b3e){return{'name':_0x562b3e[_0x301d('0xc9')],'basename':_0x562b3e[_0x301d('0x65')],'type':_0x562b3e[_0x301d('0xdf')],'ChatOfflineMessageId':_0x258019['id']};});}var _0x3386d3;if(!_[_0x301d('0x71')](_0xa4bd83[_0x301d('0xe0')])){var _0x482b3d=_[_0x301d('0x30')](_0x247516[_0x301d('0x4f')],function(_0x17f2ae){return _0x17f2ae;});var _0x2649d1=_[_0x301d('0xe1')](_0x482b3d)[0x0];var _0x516a9c=_[_0x301d('0xe2')](_0x2649d1,function(_0x25b9b5){return _0x25b9b5;});_0x3386d3=_0x516a9c[0x1][_0xa4bd83[_0x301d('0xe0')]];}var _0x211e1e={'from':_0x24145f['email'],'firstName':_0x24145f[_0x301d('0x9c')],'lastName':_0x24145f[_0x301d('0x9d')],'mapKey':_0x301d('0xdc'),'message':{'from':_0x24145f[_0x301d('0xdc')],'to':_0xa4bd83[_0x301d('0xc3')]['email'],'cc':'','subject':_[_0x301d('0x71')](_0x3386d3)?_0xa4bd83[_0x301d('0xdd')]:_0x3386d3,'messageId':'','sentAt':new Date(),'attach':_0xae4f07[_0x301d('0x3b')],'attachments':_0xae4f07,'originChannel':_0x301d('0xe3'),'ChatWebsiteId':_0xa4bd83['id'],'ChatOfflineMessageId':_0x1bcf6f['id'],'originTo':_0xa4bd83[_0x301d('0xc3')][_0x301d('0xdc')]},'body':_0x1bcf6f[_0x301d('0x4f')]};var _0x243bc9={'account':{'id':_0xa4bd83['MailAccountId']},'body':_0x211e1e,'log':_0x301d('0xe4')};return respondWithRpcPromise(_0x301d('0xe4'),_0x301d('0xe5'),_0x243bc9,client9001)['then'](function(){return _0x1bcf6f;})[_0x301d('0x4d')](function(_0x215581){console['error'](_0x215581);});}return;})[_0x301d('0x13')](function(){if(_0x1bcf6f){return _0x1bcf6f;}})[_0x301d('0x13')](respondWithResult(_0xa43c31,null))[_0x301d('0x4d')](function(_0x1151e7){console['error']('catch',_0x1151e7);for(var _0x33322e of _0x3eeaed){var _0x8ae128=path[_0x301d('0x6b')](config[_0x301d('0x6c')],_0x301d('0xe6'),'files',_0x301d('0xe7'),_0x301d('0xca'),_0x33322e[_0x301d('0x65')]);fs_extra[_0x301d('0xe8')](_0x8ae128)[_0x301d('0x4d')](function(_0x326fe0){console[_0x301d('0x19')](_0x301d('0xe9'),_0x8ae128,_0x326fe0);});}});};exports[_0x301d('0xea')]=function(_0x420654,_0x4a0d0d){return db[_0x301d('0xa9')][_0x301d('0x4c')]({'where':{'id':_0x420654[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x4a0d0d,null))['then'](function(_0x4e670f){if(_0x4e670f){return _0x4e670f[_0x301d('0xea')](_0x420654[_0x301d('0x4f')]['ids'],_[_0x301d('0xeb')](_0x420654['body'],[_0x301d('0x5c'),'id'])||{});}})[_0x301d('0x13')](respondWithResult(_0x4a0d0d,null))[_0x301d('0x4d')](handleError(_0x4a0d0d,null));};exports[_0x301d('0xec')]=function(_0x68670c,_0x1a000e){var _0x379b5d={'raw':![],'where':{}};var _0x311881={};var _0x293c1d={'count':0x0,'rows':[]};return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x68670c[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x1a000e,null))[_0x301d('0x13')](function(_0x460e2f){if(_0x460e2f){_0x311881[_0x301d('0x35')]=_['keys'](db[_0x301d('0xa9')][_0x301d('0x31')]);_0x311881[_0x301d('0x36')]=_[_0x301d('0x37')](_0x68670c['query']);_0x311881[_0x301d('0x38')]=_[_0x301d('0x39')](_0x311881[_0x301d('0x35')],_0x311881['query']);_0x379b5d['attributes']=_[_0x301d('0x39')](_0x311881['model'],qs[_0x301d('0x58')](_0x68670c[_0x301d('0x36')][_0x301d('0x58')]));_0x379b5d['attributes']=_0x379b5d[_0x301d('0x3a')][_0x301d('0x3b')]?_0x379b5d[_0x301d('0x3a')]:_0x311881[_0x301d('0x35')];if(!_0x68670c['query'][_0x301d('0x3c')](_0x301d('0x59'))){_0x379b5d[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x68670c[_0x301d('0x36')][_0x301d('0x23')]);_0x379b5d[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x68670c['query'][_0x301d('0x21')]);}_0x379b5d[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x68670c[_0x301d('0x36')][_0x301d('0x3e')]);_0x379b5d[_0x301d('0x3f')]=qs['filters'](_[_0x301d('0x40')](_0x68670c[_0x301d('0x36')],_0x311881['filters']));_0x379b5d[_0x301d('0x3f')]['ChatWebsiteId']=_0x460e2f['id'];if(_0x68670c[_0x301d('0x36')][_0x301d('0x42')]){_0x379b5d[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x379b5d[_0x301d('0x3f')],{'$or':_['map'](_0x379b5d['attributes'],function(_0x58f8b4){var _0x223d85={};_0x223d85[_0x58f8b4]={'$like':'%'+_0x68670c[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x223d85;})});}_0x379b5d=_[_0x301d('0x43')]({},_0x379b5d,_0x68670c[_0x301d('0x44')]);return db['ChatInteraction']['count']({'where':_0x379b5d[_0x301d('0x3f')]})['then'](function(_0x56b3bc){_0x293c1d[_0x301d('0x24')]=_0x56b3bc;if(_0x68670c[_0x301d('0x36')][_0x301d('0x46')]){_0x379b5d[_0x301d('0x47')]=[{'model':db['CmContact'],'as':_0x301d('0xed'),'required':![]},{'model':db[_0x301d('0xee')],'as':_0x301d('0xef'),'attributes':[_0x301d('0x2e'),_0x301d('0xf0'),_0x301d('0xf1')],'required':![]},{'model':db[_0x301d('0xf2')],'as':_0x301d('0xf3'),'attributes':['id','name',_0x301d('0xf4')],'where':_0x68670c[_0x301d('0x36')][_0x301d('0xf5')]?{'id':_0x68670c['query']['tag']}:undefined,'required':_0x68670c[_0x301d('0x36')][_0x301d('0xf5')]?!![]:![]}];}return db[_0x301d('0xa9')][_0x301d('0x5a')](_0x379b5d);})[_0x301d('0x13')](function(_0x42bbee){_0x293c1d[_0x301d('0x48')]=_0x42bbee;return _0x293c1d;});}})[_0x301d('0x13')](respondWithFilteredResult(_0x1a000e,_0x379b5d))['catch'](handleError(_0x1a000e,null));};function iftimePromise(_0x2ccabe,_0x3424ff){return respondWithRpcPromise(_0x301d('0xf6'),'getSnippet',{'command':_0x3424ff[_0x301d('0xf7')]?util[_0x301d('0xa1')](_0x301d('0xf8'),_0x2ccabe[_0x301d('0xf9')],_0x3424ff[_0x301d('0xf7')]):util[_0x301d('0xa1')](_0x301d('0xfa'),_0x2ccabe[_0x301d('0xf9')])},client9002)[_0x301d('0x13')](function(_0x218748){var _0x41fb53=_0x218748&&_0x218748[_0x301d('0xfb')](_0x301d('0xfc'))>=0x0?!![]:![];logger[_0x301d('0x14')](_0x301d('0xfd'),_0x3424ff['id'],_0x2ccabe['id'],_0x2ccabe[_0x301d('0xf9')],_0x41fb53?_0x301d('0xfe'):_0x301d('0xff'),_0x3424ff[_0x301d('0xf7')]?_0x3424ff[_0x301d('0xf7')]:_0x301d('0x100'));return _0x41fb53;})['catch'](function(_0x3cdc0c){logger['error'](_0x301d('0xfd'),_0x3424ff['id'],_0x2ccabe['id'],_0x2ccabe[_0x301d('0xf9')],util[_0x301d('0x101')](_0x3cdc0c,{'showHidden':![],'depth':null}),_0x3424ff[_0x301d('0xf7')]?_0x3424ff['timezone']:_0x301d('0x100'));return![];});}exports[_0x301d('0x102')]=function(_0x5c46c9,_0x3f1432){var _0x31d2f4=0x0;var _0x3af862=0x0;var _0x3858f7=![];var _0x57bf9c;var _0x360424;return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x5c46c9[_0x301d('0x4a')]['id']},'include':[{'model':db[_0x301d('0x103')],'as':_0x301d('0x103'),'include':[{'model':db[_0x301d('0x103')],'as':_0x301d('0x104'),'attributes':['id',_0x301d('0xf9')],'raw':!![]}]}]})[_0x301d('0x13')](handleEntityNotFound(_0x3f1432,null))[_0x301d('0x13')](function(_0x32426f){if(_0x32426f){_0x57bf9c=_0x32426f;return _0x32426f[_0x301d('0x105')]({'raw':!![]});}})[_0x301d('0x13')](function(_0x1ace00){if(_0x57bf9c){if(_0x1ace00){_0x360424=_0x1ace00;}}return require(_0x301d('0x6e'))[_0x301d('0x6f')]();})[_0x301d('0x13')](function(_0x43d462){if(_0x43d462){_0x3af862=_0x43d462[_0x301d('0x106')];_0x3858f7=_0x43d462[_0x301d('0x70')];}})['then'](function(){return db['ChatInteraction'][_0x301d('0x24')]({'where':{'closed':![]}});})['then'](function(_0x239b96){_0x31d2f4=_0x239b96;if(_0x3af862&&_0x239b96>_0x3af862){return db[_0x301d('0x107')][_0x301d('0x5f')]({'where':{'id':0x1}})['then'](function(_0x499bee){if(_0x499bee){_0x499bee[_0x301d('0x108')](_0x301d('0x109'));}});}})[_0x301d('0x13')](function(){if(_0x57bf9c[_0x301d('0x103')]&&_0x57bf9c['Interval'][_0x301d('0x104')]){var _0x409d2d=[];for(var _0x310ddd=0x0;_0x310ddd<_0x57bf9c[_0x301d('0x103')][_0x301d('0x104')][_0x301d('0x3b')];_0x310ddd++){var _0x33e311=_0x57bf9c[_0x301d('0x103')]['Intervals'][_0x310ddd][_0x301d('0x28')]({'plain':!![]});_0x409d2d[_0x301d('0xb0')](iftimePromise(_0x33e311,_0x57bf9c));}return BPromise[_0x301d('0x10a')](_0x409d2d)['then'](function(_0x613882){return _[_0x301d('0x10b')](_0x613882);});}else{return!![];}})[_0x301d('0x13')](function(_0x147b5a){var _0x11acea=fs[_0x301d('0xc4')](path['join'](config[_0x301d('0x6c')],'server/files/chat/iframe.ejs'),_0x301d('0xc6'));var _0x1b121b={'remote':_0x57bf9c[_0x301d('0x10c')],'query':querystring[_0x301d('0x18')](_['merge'](_0x57bf9c['get']({'plain':!![]}),{'customerIp':_0x5c46c9[_0x301d('0x7c')][_0x301d('0x9a')]||_0x5c46c9[_0x301d('0x7c')][_0x301d('0x10d')]||_0x5c46c9[_0x301d('0x10e')][_0x301d('0x10f')]||_0x5c46c9['ip'],'referer':_0x5c46c9[_0x301d('0x7c')][_0x301d('0x9f')],'openedInteractions':_0x31d2f4,'maxInteractions':_0x3af862,'virtual':_0x3858f7[_0x301d('0x106')],'online':_0x147b5a,'custom':_0x3858f7}))[_0x301d('0x110')](/'/g,'\x5c\x27')};_0x3f1432[_0x301d('0xbf')](ejs['render'](Mustache[_0x301d('0xc7')](_0x11acea,_0x1b121b),{'proactiveActions':_0x360424,'alignment':_0x57bf9c[_0x301d('0x111')],'verticalAlignment':_0x57bf9c[_0x301d('0x112')],'div_color':_0x57bf9c['color'],'labelText':_0x57bf9c[_0x301d('0x113')],'text_color':_0x57bf9c[_0x301d('0x114')],'button_color':_0x57bf9c[_0x301d('0x115')],'background_color':_0x57bf9c[_0x301d('0x116')]}));})[_0x301d('0x4d')](handleError(_0x3f1432,null));};exports['addApplications']=function(_0x875ed2,_0x3fe2cb){var _0xb7908d=_0x875ed2[_0x301d('0x4a')]['id'];var _0x322560=_0x875ed2[_0x301d('0x4f')];var _0x246b7b=0xc8;var _0x3149df=null;return db[_0x301d('0xcc')]['transaction']({'isolationLevel':db[_0x301d('0xcc')][_0x301d('0x117')]['ISOLATION_LEVELS'][_0x301d('0x118')]},function(_0x314319){return db[_0x301d('0x45')]['findOne']({'where':{'id':_0xb7908d},'transaction':_0x314319})[_0x301d('0x13')](function(_0x2dd5d3){if(_0x2dd5d3){return db[_0x301d('0x8f')][_0x301d('0x2b')]({'where':{'ChatWebsiteId':_0xb7908d},'transaction':_0x314319})[_0x301d('0x13')](function(){var _0x433a70=_[_0x301d('0x30')](_0x322560,function(_0x82cf1f){_0x82cf1f[_0x301d('0x55')]=_0xb7908d;return _0x82cf1f;});return db[_0x301d('0x8f')][_0x301d('0xcf')](_0x433a70,{'transaction':_0x314319});});}else{_0x246b7b=0x194;_0x3149df=[];}});})[_0x301d('0x13')](function(){if(_0x246b7b!==0x194){return db[_0x301d('0x8f')][_0x301d('0x119')]({'where':{'ChatWebsiteId':_0xb7908d},'order':_0x301d('0x94')})[_0x301d('0x13')](function(_0x3ce571){_0x3149df=_0x3ce571;});}})[_0x301d('0x4d')](function(_0x3ff569){_0x246b7b=0x1f4;logger[_0x301d('0x19')](_0x3ff569['stack']);if(_0x3ff569['name']){delete _0x3ff569['name'];}_0x3149df=_0x3ff569;})['finally'](function(){if(_0x3149df===null){_0x3fe2cb[_0x301d('0x1e')](_0x246b7b);}else{if(_0x246b7b===0x1f4){_0x3fe2cb[_0x301d('0x1f')](_0x246b7b)[_0x301d('0xbf')](_0x3149df);}else{_0x3fe2cb[_0x301d('0x1f')](_0x246b7b)[_0x301d('0x20')](_0x3149df);}}});};exports[_0x301d('0x11a')]=function(_0x5aaa2c,_0x406475){var _0x5048be={};var _0x80a996={};var _0x46c892;var _0x20b02b;return db[_0x301d('0x45')]['findOne']({'where':{'id':_0x5aaa2c[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x406475,null))[_0x301d('0x13')](function(_0x13955e){if(_0x13955e){_0x46c892=_0x13955e;_0x80a996['model']=_[_0x301d('0x37')](db['ChatApplication'][_0x301d('0x31')]);_0x80a996['query']=_[_0x301d('0x37')](_0x5aaa2c['query']);_0x80a996['filters']=_[_0x301d('0x39')](_0x80a996[_0x301d('0x35')],_0x80a996[_0x301d('0x36')]);_0x5048be['attributes']=_[_0x301d('0x39')](_0x80a996[_0x301d('0x35')],qs['fields'](_0x5aaa2c['query'][_0x301d('0x58')]));_0x5048be[_0x301d('0x3a')]=_0x5048be[_0x301d('0x3a')][_0x301d('0x3b')]?_0x5048be['attributes']:_0x80a996[_0x301d('0x35')];_0x5048be[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x5aaa2c[_0x301d('0x36')][_0x301d('0x3e')]);_0x5048be[_0x301d('0x3f')]=qs[_0x301d('0x38')](_[_0x301d('0x40')](_0x5aaa2c[_0x301d('0x36')],_0x80a996['filters']));if(_0x5aaa2c[_0x301d('0x36')][_0x301d('0x42')]){_0x5048be[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x5048be[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x5048be[_0x301d('0x3a')],function(_0x842929){var _0x3d00f1={};_0x3d00f1[_0x842929]={'$like':'%'+_0x5aaa2c[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x3d00f1;})});}_0x5048be=_[_0x301d('0x43')]({},_0x5048be,_0x5aaa2c[_0x301d('0x44')]);return _0x46c892[_0x301d('0x11a')](_0x5048be);}})[_0x301d('0x13')](function(_0x4cc5e9){if(_0x4cc5e9){_0x20b02b=_0x4cc5e9[_0x301d('0x3b')];if(!_0x5aaa2c['query'][_0x301d('0x3c')](_0x301d('0x59'))){_0x5048be[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x5aaa2c[_0x301d('0x36')][_0x301d('0x23')]);_0x5048be[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x5aaa2c[_0x301d('0x36')][_0x301d('0x21')]);}return _0x46c892[_0x301d('0x11a')](_0x5048be);}})[_0x301d('0x13')](function(_0x131e79){if(_0x131e79){return _0x131e79?{'count':_0x20b02b,'rows':_0x131e79}:null;}})[_0x301d('0x13')](respondWithResult(_0x406475,null))[_0x301d('0x4d')](handleError(_0x406475,null));};exports['addProactiveActions']=function(_0x80dae1,_0x2a135e){return db['chatProactiveAction'][_0x301d('0x4c')]({'where':{'id':_0x80dae1[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2a135e,null))[_0x301d('0x13')](function(_0x4bca96){if(_0x4bca96){return _0x4bca96[_0x301d('0x11b')](_0x80dae1[_0x301d('0x4f')][_0x301d('0x5c')],_[_0x301d('0xeb')](_0x80dae1['body'],['ids','id'])||{});}})[_0x301d('0x13')](respondWithResult(_0x2a135e,null))[_0x301d('0x4d')](handleError(_0x2a135e,null));};exports[_0x301d('0x105')]=function(_0x950ee,_0x2a3af7){var _0x54d7d7={};var _0x134691={};var _0x148463;var _0x543225;return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x950ee[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2a3af7,null))['then'](function(_0x4408c0){if(_0x4408c0){_0x148463=_0x4408c0;_0x134691[_0x301d('0x35')]=_[_0x301d('0x37')](db['ChatProactiveAction'][_0x301d('0x31')]);_0x134691[_0x301d('0x36')]=_[_0x301d('0x37')](_0x950ee[_0x301d('0x36')]);_0x134691[_0x301d('0x38')]=_[_0x301d('0x39')](_0x134691['model'],_0x134691[_0x301d('0x36')]);_0x54d7d7[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x134691[_0x301d('0x35')],qs[_0x301d('0x58')](_0x950ee[_0x301d('0x36')]['fields']));_0x54d7d7[_0x301d('0x3a')]=_0x54d7d7[_0x301d('0x3a')][_0x301d('0x3b')]?_0x54d7d7[_0x301d('0x3a')]:_0x134691['model'];_0x54d7d7[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x950ee[_0x301d('0x36')][_0x301d('0x3e')]);_0x54d7d7['where']=qs['filters'](_[_0x301d('0x40')](_0x950ee[_0x301d('0x36')],_0x134691[_0x301d('0x38')]));if(_0x950ee[_0x301d('0x36')][_0x301d('0x42')]){_0x54d7d7[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x54d7d7[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x54d7d7[_0x301d('0x3a')],function(_0x3c1189){var _0x3a95aa={};_0x3a95aa[_0x3c1189]={'$like':'%'+_0x950ee[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x3a95aa;})});}_0x54d7d7=_['merge']({},_0x54d7d7,_0x950ee['options']);return _0x148463['getProactiveActions'](_0x54d7d7);}})['then'](function(_0x199ab1){if(_0x199ab1){_0x543225=_0x199ab1[_0x301d('0x3b')];if(!_0x950ee[_0x301d('0x36')][_0x301d('0x3c')](_0x301d('0x59'))){_0x54d7d7[_0x301d('0x23')]=qs[_0x301d('0x23')](_0x950ee['query'][_0x301d('0x23')]);_0x54d7d7[_0x301d('0x21')]=qs['offset'](_0x950ee[_0x301d('0x36')][_0x301d('0x21')]);}return _0x148463[_0x301d('0x105')](_0x54d7d7);}})[_0x301d('0x13')](function(_0x1e4d10){if(_0x1e4d10){return _0x1e4d10?{'count':_0x543225,'rows':_0x1e4d10}:null;}})['then'](respondWithResult(_0x2a3af7,null))[_0x301d('0x4d')](handleError(_0x2a3af7,null));};exports[_0x301d('0x11c')]=function(_0x183404,_0x563e23){var _0x2b3d5c=_0x183404[_0x301d('0x36')][_0x301d('0x11d')]===_0x301d('0x11e')?_0x301d('0x11f'):_0x301d('0x120');return db[_0x301d('0x45')][_0x301d('0x4c')]({'attributes':['id',_0x2b3d5c],'where':{'id':_0x183404[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x563e23,null))[_0x301d('0x13')](function(_0x5d047e){if(_0x5d047e){var _0x3f3871=_0x5d047e[_0x2b3d5c];var _0x54be7c=_0x3f3871&&_0x3f3871[_0x301d('0x121')]?_0x3f3871[_0x301d('0x121')]:[];_0x563e23['send']({'fromKey':_[_0x301d('0x71')](_0x3f3871[_0x301d('0x122')])?undefined:_0x3f3871[_0x301d('0x122')],'count':_0x54be7c[_0x301d('0x3b')],'rows':_0x54be7c});}})[_0x301d('0x4d')](handleError(_0x563e23,null));};exports[_0x301d('0x123')]=function(_0xfb864d,_0x3bba5b){var _0x33cbfc={'raw':![],'where':{}};var _0x257d5f={};var _0x3c3b51={'count':0x0,'rows':[]};return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0xfb864d[_0x301d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3bba5b,null))[_0x301d('0x13')](function(_0xfdb7d2){if(_0xfdb7d2){_0x257d5f[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0x124')][_0x301d('0x31')]);_0x257d5f[_0x301d('0x36')]=_['keys'](_0xfb864d[_0x301d('0x36')]);_0x257d5f['filters']=_[_0x301d('0x39')](_0x257d5f[_0x301d('0x35')],_0x257d5f[_0x301d('0x36')]);_0x33cbfc['attributes']=_['intersection'](_0x257d5f[_0x301d('0x35')],qs[_0x301d('0x58')](_0xfb864d[_0x301d('0x36')][_0x301d('0x58')]));_0x33cbfc[_0x301d('0x3a')]=_0x33cbfc[_0x301d('0x3a')][_0x301d('0x3b')]?_0x33cbfc[_0x301d('0x3a')]:_0x257d5f[_0x301d('0x35')];if(!_0xfb864d['query']['hasOwnProperty'](_0x301d('0x59'))){_0x33cbfc[_0x301d('0x23')]=qs[_0x301d('0x23')](_0xfb864d[_0x301d('0x36')][_0x301d('0x23')]);_0x33cbfc[_0x301d('0x21')]=qs[_0x301d('0x21')](_0xfb864d[_0x301d('0x36')]['offset']);}_0x33cbfc[_0x301d('0x3d')]=qs['sort'](_0xfb864d[_0x301d('0x36')][_0x301d('0x3e')]);_0x33cbfc[_0x301d('0x3f')]=qs['filters'](_['pick'](_0xfb864d[_0x301d('0x36')],_0x257d5f['filters']));_0x33cbfc['where'][_0x301d('0x55')]=_0xfdb7d2['id'];if(_0xfb864d['query'][_0x301d('0x42')]){_0x33cbfc[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x33cbfc[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x33cbfc[_0x301d('0x3a')],function(_0x82d8ec){var _0x52948d={};_0x52948d[_0x82d8ec]={'$like':'%'+_0xfb864d[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x52948d;})});}_0x33cbfc=_[_0x301d('0x43')]({},_0x33cbfc,_0xfb864d['options']);return db[_0x301d('0x124')][_0x301d('0x24')]({'where':_0x33cbfc[_0x301d('0x3f')]})['then'](function(_0x132c71){_0x3c3b51['count']=_0x132c71;if(_0xfb864d[_0x301d('0x36')][_0x301d('0x46')]){_0x33cbfc[_0x301d('0x47')]=[{'all':!![]}];}else{_0x33cbfc[_0x301d('0x47')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0x301d('0x124')]['findAll'](_0x33cbfc);})[_0x301d('0x13')](function(_0x267372){_0x3c3b51['rows']=_0x267372;return _0x3c3b51;});}})['then'](respondWithFilteredResult(_0x3bba5b,_0x33cbfc))[_0x301d('0x4d')](handleError(_0x3bba5b,null));};exports[_0x301d('0x125')]=function(_0x16a1f7,_0x1d9fd3){return db['ChatWebsite']['find']({'where':{'id':_0x16a1f7['params']['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x1d9fd3,null))['then'](function(_0x1d3069){if(_0x1d3069){return _0x1d3069[_0x301d('0x125')](_0x16a1f7['body']['ids'],_[_0x301d('0xeb')](_0x16a1f7['body'],[_0x301d('0x5c'),'id'])||{})[_0x301d('0xac')](function(_0x4f0236){for(var _0x400469=0x0;_0x400469<_0x16a1f7[_0x301d('0x4f')][_0x301d('0x5c')][_0x301d('0x3b')];_0x400469+=0x1){socket[_0x301d('0x126')](_0x301d('0x127'),{'UserId':Number(_0x16a1f7[_0x301d('0x4f')][_0x301d('0x5c')][_0x400469]),'ChatWebsiteId':Number(_0x16a1f7[_0x301d('0x4a')]['id'])});}return _0x4f0236;});}})[_0x301d('0x13')](respondWithResult(_0x1d9fd3,null))[_0x301d('0x4d')](handleError(_0x1d9fd3,null));};exports[_0x301d('0x128')]=function(_0x222ac8,_0x537b6b){return db['ChatWebsite'][_0x301d('0x4c')]({'where':{'id':_0x222ac8[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x537b6b,null))[_0x301d('0x13')](function(_0x571a18){if(_0x571a18){return _0x571a18['removeAgents'](_0x222ac8[_0x301d('0x36')][_0x301d('0x5c')])[_0x301d('0x13')](function(){if(_[_0x301d('0x129')](_0x222ac8[_0x301d('0x36')][_0x301d('0x5c')])){for(var _0x2570b5=0x0;_0x2570b5<_0x222ac8['query'][_0x301d('0x5c')]['length'];_0x2570b5+=0x1){socket[_0x301d('0x126')](_0x301d('0x12a'),{'UserId':Number(_0x222ac8[_0x301d('0x36')]['ids'][_0x2570b5]),'ChatWebsiteId':Number(_0x222ac8[_0x301d('0x4a')]['id'])});}}else{socket[_0x301d('0x126')]('userChatWebsite:remove',{'UserId':Number(_0x222ac8[_0x301d('0x36')]['ids']),'ChatWebsiteId':Number(_0x222ac8[_0x301d('0x4a')]['id'])});}});}})[_0x301d('0x13')](respondWithStatusCode(_0x537b6b,null))['catch'](handleError(_0x537b6b,null));};exports['getAgents']=function(_0x10d333,_0x2fefb8){var _0x3ca522={};var _0x337d56={};var _0xe4bcb7;var _0x481a41;return db[_0x301d('0x45')][_0x301d('0x5f')]({'where':{'id':_0x10d333[_0x301d('0x4a')]['id']}})[_0x301d('0x13')](handleEntityNotFound(_0x2fefb8,null))['then'](function(_0x2c9381){if(_0x2c9381){_0xe4bcb7=_0x2c9381;_0x337d56[_0x301d('0x35')]=_[_0x301d('0x37')](db[_0x301d('0xee')][_0x301d('0x31')]);_0x337d56[_0x301d('0x36')]=_['keys'](_0x10d333[_0x301d('0x36')]);_0x337d56['filters']=_['intersection'](_0x337d56[_0x301d('0x35')],_0x337d56['query']);_0x3ca522[_0x301d('0x3a')]=_[_0x301d('0x39')](_0x337d56[_0x301d('0x35')],qs[_0x301d('0x58')](_0x10d333[_0x301d('0x36')][_0x301d('0x58')]));_0x3ca522[_0x301d('0x3a')]=_0x3ca522[_0x301d('0x3a')]['length']?_0x3ca522[_0x301d('0x3a')]:_0x337d56[_0x301d('0x35')];_0x3ca522[_0x301d('0x3d')]=qs[_0x301d('0x3e')](_0x10d333[_0x301d('0x36')][_0x301d('0x3e')]);_0x3ca522[_0x301d('0x3f')]=qs[_0x301d('0x38')](_['pick'](_0x10d333[_0x301d('0x36')],_0x337d56['filters']));if(_0x10d333['query'][_0x301d('0x42')]){_0x3ca522[_0x301d('0x3f')]=_[_0x301d('0x43')](_0x3ca522[_0x301d('0x3f')],{'$or':_[_0x301d('0x30')](_0x3ca522[_0x301d('0x3a')],function(_0x19ddf7){var _0x5790d2={};_0x5790d2[_0x19ddf7]={'$like':'%'+_0x10d333[_0x301d('0x36')][_0x301d('0x42')]+'%'};return _0x5790d2;})});}_0x3ca522=_[_0x301d('0x43')]({},_0x3ca522,_0x10d333[_0x301d('0x44')]);return _0xe4bcb7[_0x301d('0x12b')](_0x3ca522);}})['then'](function(_0x3033f8){if(_0x3033f8){_0x481a41=_0x3033f8[_0x301d('0x3b')];if(!_0x10d333[_0x301d('0x36')][_0x301d('0x3c')](_0x301d('0x59'))){_0x3ca522[_0x301d('0x23')]=qs['limit'](_0x10d333[_0x301d('0x36')][_0x301d('0x23')]);_0x3ca522[_0x301d('0x21')]=qs[_0x301d('0x21')](_0x10d333[_0x301d('0x36')][_0x301d('0x21')]);}return _0xe4bcb7[_0x301d('0x12b')](_0x3ca522);}})[_0x301d('0x13')](function(_0x2561ae){if(_0x2561ae){return _0x2561ae?{'count':_0x481a41,'rows':_0x2561ae}:null;}})[_0x301d('0x13')](respondWithResult(_0x2fefb8,null))[_0x301d('0x4d')](handleError(_0x2fefb8,null));};
\ No newline at end of file
+var _0x045f=['Disposition','getDispositions','findOne','rawAttributes','rows','removeDispositions','ids','addAnswer','ChatWebsiteId','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','account','contact','headers','cf-connecting-ip','first','split','firstName','lastName','x-real-port','browser','version','unknown','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','offline','files','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','findOrCreate','spread','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','offline-chat','openNewInteraction','transaction','Attachment','MailAccount','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','all','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','referer','virtual','alignment','verticalAlignment','labelText','textColor','backgroundColor','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','onlineForm','items','fromKey','Attachments','addAgents','omit','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','json','offset','undefined','count','limit','update','then','destroy','get','ChatWebsites','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','show','params','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition'];(function(_0x420ec3,_0x38e80f){var _0x57be6b=function(_0x3d04c7){while(--_0x3d04c7){_0x420ec3['push'](_0x420ec3['shift']());}};_0x57be6b(++_0x38e80f);}(_0x045f,0xce));var _0xf045=function(_0x1fa3f4,_0x56868e){_0x1fa3f4=_0x1fa3f4-0x0;var _0x491768=_0x045f[_0x1fa3f4];return _0x491768;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xf045('0x0'));var util=require('util');var path=require(_0xf045('0x1'));var ejs=require(_0xf045('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf045('0x3'));var querystring=require(_0xf045('0x4'));var Redis=require(_0xf045('0x5'));var qs=require(_0xf045('0x6'));var logger=require(_0xf045('0x7'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf045('0x8')]=_[_0xf045('0x9')](config[_0xf045('0x8')],{'host':_0xf045('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf045('0x8')]));require(_0xf045('0xb'))[_0xf045('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf045('0xd')][_0xf045('0xe')]({'port':0x232c});var client9002=jayson[_0xf045('0xd')][_0xf045('0xe')]({'port':0x232a});var client9003=jayson[_0xf045('0xd')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x475f75,_0x36dc4c,_0x347e10,_0x560a8f){return new BPromise(function(_0x2dc02b,_0x46fc86){var _0x354655=_0x560a8f||client;return _0x354655[_0xf045('0xf')](_0x475f75,_0x347e10)['then'](function(_0x1d5d46){logger[_0xf045('0x10')](_0xf045('0x11'),_0x36dc4c,'request\x20sent');logger[_0xf045('0x12')](_0xf045('0x13'),_0x36dc4c,_0xf045('0x14'),JSON['stringify'](_0x1d5d46));if(_0x1d5d46[_0xf045('0x15')]){if(_0x1d5d46['error']['code']===0x1f4){logger['error'](_0xf045('0x11'),_0x36dc4c,_0x1d5d46[_0xf045('0x15')][_0xf045('0x16')]);return _0x46fc86(_0x1d5d46[_0xf045('0x15')][_0xf045('0x16')]);}logger[_0xf045('0x15')](_0xf045('0x11'),_0x36dc4c,_0x1d5d46[_0xf045('0x15')]['message']);return _0x2dc02b(_0x1d5d46[_0xf045('0x15')]['message']);}else{logger['info'](_0xf045('0x11'),_0x36dc4c,_0xf045('0x14'));_0x2dc02b(_0x1d5d46['result'][_0xf045('0x16')]);}})[_0xf045('0x17')](function(_0x30fb75){logger[_0xf045('0x15')](_0xf045('0x11'),_0x36dc4c,_0x30fb75);_0x46fc86(_0x30fb75);});});}function respondWithStatusCode(_0x33c887,_0x1c2956){_0x1c2956=_0x1c2956||0xcc;return function(_0x1ee45e){if(_0x1ee45e){return _0x33c887[_0xf045('0x18')](_0x1c2956);}return _0x33c887[_0xf045('0x19')](_0x1c2956)['end']();};}function respondWithResult(_0x1c8698,_0x26ea50){_0x26ea50=_0x26ea50||0xc8;return function(_0xba7979){if(_0xba7979){return _0x1c8698[_0xf045('0x19')](_0x26ea50)[_0xf045('0x1a')](_0xba7979);}};}function respondWithFilteredResult(_0x21d702,_0x6feb6e){return function(_0x1533dd){if(_0x1533dd){var _0x83e07c=typeof _0x6feb6e[_0xf045('0x1b')]===_0xf045('0x1c')&&typeof _0x6feb6e['limit']===_0xf045('0x1c');var _0x1017c1=_0x1533dd[_0xf045('0x1d')];var _0x4175ab=_0x83e07c?0x0:_0x6feb6e['offset'];var _0x5d339e=_0x83e07c?_0x1533dd[_0xf045('0x1d')]:_0x6feb6e['offset']+_0x6feb6e[_0xf045('0x1e')];var _0x34e5f0;if(_0x5d339e>=_0x1017c1){_0x5d339e=_0x1017c1;_0x34e5f0=0xc8;}else{_0x34e5f0=0xce;}_0x21d702[_0xf045('0x19')](_0x34e5f0);return _0x21d702['set']('Content-Range',_0x4175ab+'-'+_0x5d339e+'/'+_0x1017c1)[_0xf045('0x1a')](_0x1533dd);}return null;};}function saveUpdates(_0x3e4ae2){return function(_0x528fc0){if(_0x528fc0){return _0x528fc0[_0xf045('0x1f')](_0x3e4ae2)[_0xf045('0x20')](function(_0x28c7f9){return _0x28c7f9;});}return null;};}function removeEntity(_0x1069cc){return function(_0x48fcd0){if(_0x48fcd0){return _0x48fcd0[_0xf045('0x21')]()['then'](function(){var _0x477901=_0x48fcd0[_0xf045('0x22')]({'plain':!![]});var _0x1aebda=_0xf045('0x23');return db[_0xf045('0x24')][_0xf045('0x21')]({'where':{'type':_0x1aebda,'resourceId':_0x477901['id']}})[_0xf045('0x20')](function(){return _0x48fcd0;});})[_0xf045('0x20')](function(){_0x1069cc['status'](0xcc)[_0xf045('0x25')]();});}};}function handleEntityNotFound(_0x3e7840){return function(_0x5116e1){if(!_0x5116e1){_0x3e7840[_0xf045('0x18')](0x194);}return _0x5116e1;};}function handleError(_0x4045b8,_0x10d00e){_0x10d00e=_0x10d00e||0x1f4;return function(_0x36cba2){logger[_0xf045('0x15')](_0x36cba2[_0xf045('0x26')]);if(_0x36cba2[_0xf045('0x27')]){delete _0x36cba2[_0xf045('0x27')];}_0x4045b8[_0xf045('0x19')](_0x10d00e)[_0xf045('0x28')](_0x36cba2);};}exports[_0xf045('0x29')]=function(_0x59a12e,_0x159e5c){var _0x190b8a={'include':[{'model':db[_0xf045('0x2a')],'as':_0xf045('0x2b')}]},_0x41b8e6={},_0x563d3c={'count':0x0,'rows':[]};var _0x1fa12e=_[_0xf045('0x2c')](db[_0xf045('0x2d')]['rawAttributes'],function(_0x32fdee){return{'name':_0x32fdee[_0xf045('0x2e')],'type':_0x32fdee['type']['key']};});_0x41b8e6['model']=_[_0xf045('0x2c')](_0x1fa12e,_0xf045('0x27'));_0x41b8e6[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x59a12e['query']);_0x41b8e6[_0xf045('0x31')]=_['intersection'](_0x41b8e6[_0xf045('0x32')],_0x41b8e6['query']);_0x190b8a[_0xf045('0x33')]=_[_0xf045('0x34')](_0x41b8e6[_0xf045('0x32')],qs[_0xf045('0x35')](_0x59a12e[_0xf045('0x2f')][_0xf045('0x35')]));_0x190b8a[_0xf045('0x33')]=_0x190b8a[_0xf045('0x33')][_0xf045('0x36')]?_0x190b8a[_0xf045('0x33')]:_0x41b8e6['model'];if(!_0x59a12e[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x190b8a[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x59a12e[_0xf045('0x2f')]['limit']);_0x190b8a[_0xf045('0x1b')]=qs[_0xf045('0x1b')](_0x59a12e['query'][_0xf045('0x1b')]);}_0x190b8a[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x59a12e[_0xf045('0x2f')][_0xf045('0x3a')]);_0x190b8a[_0xf045('0x3b')]=qs['filters'](_[_0xf045('0x3c')](_0x59a12e[_0xf045('0x2f')],_0x41b8e6['filters']),_0x1fa12e);if(_0x59a12e['query']['filter']){_0x190b8a['where']=_[_0xf045('0x3d')](_0x190b8a['where'],{'$or':_[_0xf045('0x2c')](_0x1fa12e,function(_0x34898a){if(_0x34898a[_0xf045('0x3e')]!==_0xf045('0x3f')){var _0x47c3b5={};_0x47c3b5[_0x34898a[_0xf045('0x27')]]={'$like':'%'+_0x59a12e['query'][_0xf045('0x40')]+'%'};return _0x47c3b5;}})});}_0x190b8a=_[_0xf045('0x3d')]({},_0x190b8a,_0x59a12e['options']);var _0x15ab8f={'where':_0x190b8a['where']};return db['ChatWebsite'][_0xf045('0x1d')](_0x15ab8f)['then'](function(_0x243670){_0x563d3c[_0xf045('0x1d')]=_0x243670;if(_0x59a12e['query'][_0xf045('0x41')]){_0x190b8a[_0xf045('0x42')]=[{'all':!![]}];}return db[_0xf045('0x2d')][_0xf045('0x43')](_0x190b8a);})[_0xf045('0x20')](function(_0x12a3be){_0x563d3c['rows']=_0x12a3be;return _0x563d3c;})['then'](respondWithFilteredResult(_0x159e5c,_0x190b8a))[_0xf045('0x17')](handleError(_0x159e5c,null));};exports[_0xf045('0x44')]=function(_0xb6d1e8,_0x3281c0){var _0x53fc2a={'raw':![],'where':{'id':_0xb6d1e8[_0xf045('0x45')]['id']},'include':[{'model':db[_0xf045('0x2a')],'as':'mandatoryDispositionPause'}]},_0x2f43f1={};_0x2f43f1[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0x2d')]['rawAttributes']);_0x2f43f1[_0xf045('0x2f')]=_[_0xf045('0x30')](_0xb6d1e8[_0xf045('0x2f')]);_0x2f43f1[_0xf045('0x31')]=_[_0xf045('0x34')](_0x2f43f1[_0xf045('0x32')],_0x2f43f1[_0xf045('0x2f')]);_0x53fc2a[_0xf045('0x33')]=_[_0xf045('0x34')](_0x2f43f1[_0xf045('0x32')],qs[_0xf045('0x35')](_0xb6d1e8['query'][_0xf045('0x35')]));_0x53fc2a[_0xf045('0x33')]=_0x53fc2a[_0xf045('0x33')][_0xf045('0x36')]?_0x53fc2a[_0xf045('0x33')]:_0x2f43f1[_0xf045('0x32')];if(_0xb6d1e8[_0xf045('0x2f')][_0xf045('0x41')]){_0x53fc2a['include']=[{'all':!![]}];}_0x53fc2a=_[_0xf045('0x3d')]({},_0x53fc2a,_0xb6d1e8[_0xf045('0x46')]);return db[_0xf045('0x2d')][_0xf045('0x47')](_0x53fc2a)[_0xf045('0x20')](handleEntityNotFound(_0x3281c0,null))[_0xf045('0x20')](respondWithResult(_0x3281c0,null))[_0xf045('0x17')](handleError(_0x3281c0,null));};exports['create']=function(_0x3782a1,_0xd7cdb7){return db[_0xf045('0x2d')]['create'](_0x3782a1['body'],{})[_0xf045('0x20')](function(_0x4d62d4){var _0x588eae=_0x3782a1[_0xf045('0x48')]['get']({'plain':!![]});if(!_0x588eae)throw new Error(_0xf045('0x49'));if(_0x588eae[_0xf045('0x4a')]===_0xf045('0x48')){var _0x1b28fd=_0x4d62d4[_0xf045('0x22')]({'plain':!![]});var _0x4cf450=_0xf045('0x23');return db[_0xf045('0x4b')][_0xf045('0x47')]({'where':{'name':_0x4cf450,'userProfileId':_0x588eae[_0xf045('0x4c')]},'raw':!![]})[_0xf045('0x20')](function(_0x59f7b2){if(_0x59f7b2&&_0x59f7b2[_0xf045('0x4d')]===0x0){return db['UserProfileResource'][_0xf045('0x4e')]({'name':_0x1b28fd[_0xf045('0x27')],'resourceId':_0x1b28fd['id'],'type':_0x59f7b2[_0xf045('0x27')],'sectionId':_0x59f7b2['id']},{})[_0xf045('0x20')](function(){return _0x4d62d4;});}else{return _0x4d62d4;}})['catch'](function(_0x1f024c){logger[_0xf045('0x15')](_0xf045('0x4f'),_0x1f024c);throw _0x1f024c;});}return _0x4d62d4;})['then'](respondWithResult(_0xd7cdb7,0xc9))[_0xf045('0x17')](handleError(_0xd7cdb7,null));};exports['update']=function(_0x324d9e,_0x582e30){if(_0x324d9e['body']['id']){delete _0x324d9e[_0xf045('0x50')]['id'];}return db[_0xf045('0x2d')]['find']({'where':{'id':_0x324d9e[_0xf045('0x45')]['id']},'include':[{'model':db[_0xf045('0x2a')],'as':_0xf045('0x2b')}]})['then'](handleEntityNotFound(_0x582e30,null))[_0xf045('0x20')](saveUpdates(_0x324d9e['body'],null))[_0xf045('0x20')](respondWithResult(_0x582e30,null))['catch'](handleError(_0x582e30,null));};exports[_0xf045('0x21')]=function(_0x5a6611,_0x47ef8c){return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x5a6611[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x47ef8c,null))[_0xf045('0x20')](removeEntity(_0x47ef8c,null))[_0xf045('0x17')](handleError(_0x47ef8c,null));};exports[_0xf045('0x51')]=function(_0x261253,_0x8fdd06){return db[_0xf045('0x2d')][_0xf045('0x51')]()[_0xf045('0x20')](respondWithResult(_0x8fdd06,null))[_0xf045('0x17')](handleError(_0x8fdd06,null));};exports[_0xf045('0x52')]=function(_0x120953,_0x1a2bda){if(_0x120953['body']['id']){delete _0x120953[_0xf045('0x50')]['id'];}return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x120953[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x1a2bda,null))[_0xf045('0x20')](function(_0x400873){if(_0x400873){_0x120953[_0xf045('0x50')]['ChatWebsiteId']=_0x400873['id'];return db[_0xf045('0x53')][_0xf045('0x4e')](_0x120953[_0xf045('0x50')]);}})['then'](respondWithResult(_0x1a2bda,null))['catch'](handleError(_0x1a2bda,null));};exports[_0xf045('0x54')]=function(_0x2c408e,_0x45fbc9){var _0x1732e9={'raw':![],'where':{}};var _0xcecc12={};var _0x56e9bb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xf045('0x55')]({'where':{'id':_0x2c408e['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x45fbc9,null))[_0xf045('0x20')](function(_0x3df0e5){if(_0x3df0e5){_0xcecc12[_0xf045('0x32')]=_[_0xf045('0x30')](db['Disposition'][_0xf045('0x56')]);_0xcecc12['query']=_[_0xf045('0x30')](_0x2c408e['query']);_0xcecc12[_0xf045('0x31')]=_[_0xf045('0x34')](_0xcecc12['model'],_0xcecc12[_0xf045('0x2f')]);_0x1732e9[_0xf045('0x33')]=_[_0xf045('0x34')](_0xcecc12['model'],qs[_0xf045('0x35')](_0x2c408e[_0xf045('0x2f')][_0xf045('0x35')]));_0x1732e9[_0xf045('0x33')]=_0x1732e9[_0xf045('0x33')][_0xf045('0x36')]?_0x1732e9[_0xf045('0x33')]:_0xcecc12[_0xf045('0x32')];if(!_0x2c408e[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x1732e9['limit']=qs['limit'](_0x2c408e[_0xf045('0x2f')][_0xf045('0x1e')]);_0x1732e9[_0xf045('0x1b')]=qs['offset'](_0x2c408e[_0xf045('0x2f')][_0xf045('0x1b')]);}_0x1732e9['order']=qs['sort'](_0x2c408e['query'][_0xf045('0x3a')]);_0x1732e9[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x2c408e[_0xf045('0x2f')],_0xcecc12['filters']));_0x1732e9[_0xf045('0x3b')]['ChatWebsiteId']=_0x3df0e5['id'];if(_0x2c408e[_0xf045('0x2f')][_0xf045('0x40')]){_0x1732e9[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x1732e9[_0xf045('0x3b')],{'$or':_[_0xf045('0x2c')](_0x1732e9[_0xf045('0x33')],function(_0x4549f3){var _0x2336b6={};_0x2336b6[_0x4549f3]={'$like':'%'+_0x2c408e[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x2336b6;})});}_0x1732e9=_['merge']({},_0x1732e9,_0x2c408e[_0xf045('0x46')]);return db['Disposition'][_0xf045('0x1d')]({'where':_0x1732e9[_0xf045('0x3b')]})[_0xf045('0x20')](function(_0x3804ee){_0x56e9bb['count']=_0x3804ee;if(_0x2c408e[_0xf045('0x2f')][_0xf045('0x41')]){_0x1732e9['include']=[{'all':!![]}];}return db[_0xf045('0x53')][_0xf045('0x43')](_0x1732e9);})[_0xf045('0x20')](function(_0x414cce){_0x56e9bb[_0xf045('0x57')]=_0x414cce;return _0x56e9bb;});}})[_0xf045('0x20')](respondWithFilteredResult(_0x45fbc9,_0x1732e9))['catch'](handleError(_0x45fbc9,null));};exports[_0xf045('0x58')]=function(_0x52c11a,_0x17d0fb){return db[_0xf045('0x2d')]['find']({'where':{'id':_0x52c11a['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x17d0fb,null))[_0xf045('0x20')](function(_0x10c09e){if(_0x10c09e){return _0x10c09e[_0xf045('0x58')](_0x52c11a[_0xf045('0x2f')][_0xf045('0x59')]);}})['then'](respondWithStatusCode(_0x17d0fb,null))[_0xf045('0x17')](handleError(_0x17d0fb,null));};exports[_0xf045('0x5a')]=function(_0x1dd43a,_0x57f91a){if(_0x1dd43a['body']['id']){delete _0x1dd43a['body']['id'];}return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x1dd43a['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x57f91a,null))['then'](function(_0x37d94b){if(_0x37d94b){_0x1dd43a[_0xf045('0x50')][_0xf045('0x5b')]=_0x37d94b['id'];return db[_0xf045('0x5c')][_0xf045('0x4e')](_0x1dd43a[_0xf045('0x50')]);}})['then'](respondWithResult(_0x57f91a,null))[_0xf045('0x17')](handleError(_0x57f91a,null));};exports[_0xf045('0x5d')]=function(_0x1d3e88,_0x549a53){var _0x544684={'raw':![],'where':{}};var _0x189687={};var _0x55d839={'count':0x0,'rows':[]};return db[_0xf045('0x2d')]['findOne']({'where':{'id':_0x1d3e88[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x549a53,null))[_0xf045('0x20')](function(_0x1db620){if(_0x1db620){_0x189687[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0x5c')][_0xf045('0x56')]);_0x189687[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x1d3e88['query']);_0x189687['filters']=_['intersection'](_0x189687['model'],_0x189687[_0xf045('0x2f')]);_0x544684[_0xf045('0x33')]=_['intersection'](_0x189687[_0xf045('0x32')],qs[_0xf045('0x35')](_0x1d3e88[_0xf045('0x2f')][_0xf045('0x35')]));_0x544684['attributes']=_0x544684[_0xf045('0x33')][_0xf045('0x36')]?_0x544684[_0xf045('0x33')]:_0x189687[_0xf045('0x32')];if(!_0x1d3e88['query'][_0xf045('0x37')]('nolimit')){_0x544684['limit']=qs['limit'](_0x1d3e88[_0xf045('0x2f')][_0xf045('0x1e')]);_0x544684[_0xf045('0x1b')]=qs['offset'](_0x1d3e88[_0xf045('0x2f')]['offset']);}_0x544684[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x1d3e88[_0xf045('0x2f')][_0xf045('0x3a')]);_0x544684[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x1d3e88[_0xf045('0x2f')],_0x189687[_0xf045('0x31')]));_0x544684['where'][_0xf045('0x5b')]=_0x1db620['id'];if(_0x1d3e88[_0xf045('0x2f')][_0xf045('0x40')]){_0x544684[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x544684['where'],{'$or':_[_0xf045('0x2c')](_0x544684['attributes'],function(_0x134371){var _0x1595b7={};_0x1595b7[_0x134371]={'$like':'%'+_0x1d3e88['query']['filter']+'%'};return _0x1595b7;})});}_0x544684=_[_0xf045('0x3d')]({},_0x544684,_0x1d3e88[_0xf045('0x46')]);return db[_0xf045('0x5c')][_0xf045('0x1d')]({'where':_0x544684[_0xf045('0x3b')]})[_0xf045('0x20')](function(_0x537170){_0x55d839['count']=_0x537170;if(_0x1d3e88[_0xf045('0x2f')][_0xf045('0x41')]){_0x544684[_0xf045('0x42')]=[{'all':!![]}];}return db[_0xf045('0x5c')][_0xf045('0x43')](_0x544684);})[_0xf045('0x20')](function(_0x34ef4c){_0x55d839[_0xf045('0x57')]=_0x34ef4c;return _0x55d839;});}})['then'](respondWithFilteredResult(_0x549a53,_0x544684))[_0xf045('0x17')](handleError(_0x549a53,null));};exports[_0xf045('0x5e')]=function(_0x2452d2,_0xa9000e){return db[_0xf045('0x2d')]['find']({'where':{'id':_0x2452d2[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0xa9000e,null))['then'](function(_0x18f84e){if(_0x18f84e){return _0x18f84e['removeAnswers'](_0x2452d2[_0xf045('0x2f')][_0xf045('0x59')]);}})['then'](respondWithStatusCode(_0xa9000e,null))[_0xf045('0x17')](handleError(_0xa9000e,null));};exports['addLogo']=function(_0x1a9195,_0x3f70b1){_0x1a9195[_0xf045('0x50')][_0xf045('0x5f')]=_0x1a9195[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x1a9195[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x3f70b1,null))[_0xf045('0x20')](saveUpdates(_0x1a9195[_0xf045('0x50')],null))[_0xf045('0x20')](respondWithResult(_0x3f70b1,null))[_0xf045('0x17')](handleError(_0x3f70b1,null));};exports['addAvatar']=function(_0x1cc649,_0x2020e2){_0x1cc649[_0xf045('0x50')][_0xf045('0x62')]=_0x1cc649[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x1cc649[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2020e2,null))[_0xf045('0x20')](saveUpdates(_0x1cc649[_0xf045('0x50')],null))[_0xf045('0x20')](respondWithResult(_0x2020e2,null))[_0xf045('0x17')](handleError(_0x2020e2,null));};exports[_0xf045('0x63')]=function(_0x533099,_0xbe3756){_0x533099[_0xf045('0x50')]['customerAvatar']=_0x533099[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x533099[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0xbe3756,null))[_0xf045('0x20')](saveUpdates(_0x533099['body'],null))[_0xf045('0x20')](respondWithResult(_0xbe3756,null))['catch'](handleError(_0xbe3756,null));};exports[_0xf045('0x64')]=function(_0x32008c,_0x2d7ad4){_0x32008c[_0xf045('0x50')][_0xf045('0x65')]=_0x32008c[_0xf045('0x60')][_0xf045('0x61')];return db[_0xf045('0x2d')]['find']({'where':{'id':_0x32008c['params']['id']}})['then'](handleEntityNotFound(_0x2d7ad4,null))[_0xf045('0x20')](saveUpdates(_0x32008c[_0xf045('0x50')],null))[_0xf045('0x20')](respondWithResult(_0x2d7ad4,null))[_0xf045('0x17')](handleError(_0x2d7ad4,null));};exports[_0xf045('0x66')]=function(_0x28e220,_0x2cef2d){var _0xc424cb=path[_0xf045('0x67')](config['root'],_0xf045('0x68'));var _0x454c0b={'where':{'id':_0x28e220[_0xf045('0x45')]['id']},'attributes':['id',_0xf045('0x5f')],'raw':!![]};var _0xf4035e=![];return require('../../config/license/util')[_0xf045('0x69')]()[_0xf045('0x20')](function(_0xaa1e91){if(_0xaa1e91){_0xf4035e=_0xaa1e91[_0xf045('0x6a')];}})[_0xf045('0x20')](function(){return db['ChatWebsite'][_0xf045('0x47')](_0x454c0b);})['then'](handleEntityNotFound(_0x2cef2d,null))[_0xf045('0x20')](function(_0x313c65){if(_0x313c65){if(!_[_0xf045('0x6b')](_0x313c65['sitepic'])){if(fs[_0xf045('0x6c')](path['join'](config[_0xf045('0x6d')],_0xf045('0x6e'),_0x313c65[_0xf045('0x5f')]))&&_0xf4035e){_0xc424cb=path[_0xf045('0x67')](config['root'],'server/files/images/logos/',_0x313c65[_0xf045('0x5f')]);}}return _0x2cef2d[_0xf045('0x6f')](_0xc424cb);}})['catch'](handleError(_0x2cef2d,null));};exports[_0xf045('0x70')]=function(_0x42879f,_0x123140){var _0x30ce1f=path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x71'));var _0x447048={'where':{'id':_0x42879f[_0xf045('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xf045('0x2d')][_0xf045('0x47')](_0x447048)['then'](handleEntityNotFound(_0x123140,null))[_0xf045('0x20')](function(_0x42520a){if(_0x42520a){if(!_[_0xf045('0x6b')](_0x42520a[_0xf045('0x62')])){if(fs[_0xf045('0x6c')](path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x72'),_0x42520a['agentAvatar']))){_0x30ce1f=path[_0xf045('0x67')](config[_0xf045('0x6d')],'server/files/images/avatars/',_0x42520a[_0xf045('0x62')]);}}return _0x123140[_0xf045('0x6f')](_0x30ce1f);}})[_0xf045('0x17')](handleError(_0x123140,null));};exports[_0xf045('0x73')]=function(_0x1f612f,_0x1f572c){var _0x183b5c=path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x74'));var _0x351260={'where':{'id':_0x1f612f[_0xf045('0x45')]['id']},'attributes':['id',_0xf045('0x75'),_0xf045('0x76')],'raw':!![]};return db[_0xf045('0x2d')][_0xf045('0x47')](_0x351260)['then'](handleEntityNotFound(_0x1f572c,null))[_0xf045('0x20')](function(_0x517a86){if(_0x517a86){if(!_[_0xf045('0x6b')](_0x517a86[_0xf045('0x75')])){if(fs['existsSync'](path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0x72'),_0x517a86[_0xf045('0x75')]))&&_0x517a86[_0xf045('0x76')]){_0x183b5c=path['join'](config['root'],_0xf045('0x72'),_0x517a86['customerAvatar']);}}return _0x1f572c[_0xf045('0x6f')](_0x183b5c);}})[_0xf045('0x17')](handleError(_0x1f572c,null));};exports[_0xf045('0x77')]=function(_0x45a1e8,_0x519b68){var _0x141e7f=path[_0xf045('0x67')](config['root'],_0xf045('0x78'));var _0x57141a={'where':{'id':_0x45a1e8[_0xf045('0x45')]['id']},'attributes':['id',_0xf045('0x65')],'raw':!![]};return db[_0xf045('0x2d')][_0xf045('0x47')](_0x57141a)[_0xf045('0x20')](handleEntityNotFound(_0x519b68,null))[_0xf045('0x20')](function(_0x308fb5){if(_0x308fb5){if(!_[_0xf045('0x6b')](_0x308fb5[_0xf045('0x65')])){if(fs[_0xf045('0x6c')](path['join'](config[_0xf045('0x6d')],_0xf045('0x72'),_0x308fb5[_0xf045('0x65')]))){_0x141e7f=path['join'](config['root'],'server/files/images/avatars/',_0x308fb5[_0xf045('0x65')]);}}return _0x519b68['download'](_0x141e7f);}})[_0xf045('0x17')](handleError(_0x519b68,null));};exports[_0xf045('0x79')]=function(_0x3d2e23,_0x30629d){var _0x562f94=require(_0xf045('0x7a'));var _0xb4eafd=new _0x562f94();var _0x177a3f=_0xb4eafd['setUA'](_0x3d2e23['headers'][_0xf045('0x7b')])['getResult']();var _0x35cad6={'body':_0x3d2e23[_0xf045('0x50')],'channel':_0xf045('0x7c')};var _0x4a8c1f=[];var _0x32088c=[];var _0x7bc27d={};var _0x6a449f=![];return db[_0xf045('0x7d')]['describe']()['then'](function(_0x25ecd5){if(!_0x25ecd5){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x80'));}_0x4a8c1f=_[_0xf045('0x81')](_[_0xf045('0x30')](_0x25ecd5),[_0xf045('0x82'),_0xf045('0x83')]);_0x32088c=_[_0xf045('0x81')](_[_0xf045('0x30')](_0x25ecd5),[_0xf045('0x82'),_0xf045('0x83'),_0xf045('0x84'),'ListId']);if(_0x3d2e23[_0xf045('0x50')]['id']){delete _0x3d2e23[_0xf045('0x50')]['id'];}if(_[_0xf045('0x6b')](_0x3d2e23[_0xf045('0x50')][_0xf045('0x85')])){throw new db[(_0xf045('0x7e'))]['ValidationError'](_0xf045('0x86'));}if(_[_0xf045('0x6b')](_0x3d2e23[_0xf045('0x50')][_0xf045('0x50')])||_0x3d2e23[_0xf045('0x50')][_0xf045('0x50')]===''){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf045('0x6b')](_0x3d2e23[_0xf045('0x50')][_0xf045('0x87')])){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x88')+_0x32088c);}if(!_[_0xf045('0x89')](_0x32088c,_0x3d2e23['body'][_0xf045('0x87')])){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x8a')+_0x32088c);}_0x7bc27d[_0x3d2e23[_0xf045('0x50')]['mapKey']]=_0x3d2e23[_0xf045('0x50')][_0xf045('0x85')];})[_0xf045('0x20')](function(){return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x3d2e23['params']['id']},'include':[{'model':db[_0xf045('0x8b')],'as':_0xf045('0x8c'),'include':[{'model':db['CmContact'],'as':_0xf045('0x8d'),'where':_0x7bc27d,'limit':0x1,'order':[[_0xf045('0x83'),_0xf045('0x8e')]]}]},{'model':db[_0xf045('0x8f')],'as':_0xf045('0x90')}]});})[_0xf045('0x20')](handleEntityNotFound(_0x30629d,null))['then'](function(_0x28497c){if(_0x28497c&&_0x28497c[_0xf045('0x8c')]){_0x35cad6['account']=_0x28497c;_0x35cad6[_0xf045('0x91')]=_0x28497c[_0xf045('0x90')];_0x35cad6[_0xf045('0x92')]=_0x28497c['List'];_0x35cad6['applications']=_[_0xf045('0x93')](_0x35cad6['applications'],['priority'],['asc']);if(_0x35cad6['account']['Applications']){delete _0x35cad6[_0xf045('0x94')]['Applications'];}if(_0x35cad6[_0xf045('0x94')][_0xf045('0x8c')]&&_0x35cad6[_0xf045('0x94')][_0xf045('0x8c')][_0xf045('0x8d')][_0xf045('0x36')]){return _0x35cad6[_0xf045('0x94')][_0xf045('0x8c')]['Contacts'][0x0];}var _0xc4fc74=_[_0xf045('0x9')](_0x3d2e23[_0xf045('0x50')],{'firstName':_0x3d2e23[_0xf045('0x50')]['from'],'ListId':_0x28497c['ListId']});_0xc4fc74[_0x3d2e23[_0xf045('0x50')][_0xf045('0x87')]]=_0x3d2e23['body'][_0xf045('0x85')];return db['CmContact'][_0xf045('0x4e')](_0xc4fc74,{'fields':_0x4a8c1f,'raw':!![]});}})[_0xf045('0x20')](handleEntityNotFound(_0x30629d,null))[_0xf045('0x20')](function(_0x366d6d){_0x35cad6[_0xf045('0x95')]=_0x366d6d;var _0x3b9450=_0x3d2e23[_0xf045('0x50')]['customerIp'];if(_0x3d2e23[_0xf045('0x96')][_0xf045('0x97')]){_0x3b9450=_0x3d2e23[_0xf045('0x96')][_0xf045('0x97')];}else if(_0x3d2e23[_0xf045('0x96')]['x-forwarded-for']){_0x3b9450=_[_0xf045('0x98')](_0x3d2e23[_0xf045('0x96')]['x-forwarded-for'][_0xf045('0x99')](','));}if(_0x366d6d){var _0x4bdb35={'ContactId':_0x366d6d['id'],'ChatWebsiteId':_0x3d2e23['params']['id'],'from':(_0x366d6d[_0xf045('0x9a')]||'')+'\x20'+(_0x366d6d[_0xf045('0x9b')]||''),'customerIp':_0x3b9450,'customerPort':_0x3d2e23[_0xf045('0x96')]['x-real-port']?_0x3d2e23[_0xf045('0x96')][_0xf045('0x9c')]:null,'referer':_0x3d2e23[_0xf045('0x50')]['referer'],'browserName':_0x177a3f['browser'][_0xf045('0x27')]&&_0x177a3f[_0xf045('0x9d')][_0xf045('0x9e')]?util['format']('%s\x20%s',_0x177a3f[_0xf045('0x9d')]['name'],_0x177a3f[_0xf045('0x9d')][_0xf045('0x9e')]):_0xf045('0x9f'),'browserVersion':_0x177a3f[_0xf045('0x9d')]['version']||_0xf045('0x9f'),'osName':util[_0xf045('0xa0')](_0xf045('0xa1'),_0x177a3f['os'][_0xf045('0x27')],_0x177a3f['os']['version']),'osVersion':_0x177a3f['os'][_0xf045('0x9e')],'deviceModel':_0x177a3f[_0xf045('0xa2')][_0xf045('0x32')]&&_0x177a3f[_0xf045('0xa2')][_0xf045('0xa3')]?util['format'](_0xf045('0xa4'),_0x177a3f[_0xf045('0xa2')][_0xf045('0x32')],_0x177a3f[_0xf045('0xa2')][_0xf045('0xa3')],_0x177a3f[_0xf045('0xa2')][_0xf045('0x3e')]):null,'deviceVendor':_0x177a3f[_0xf045('0xa2')]['vendor'],'deviceType':_0x177a3f[_0xf045('0xa2')][_0xf045('0x3e')],'formData':JSON[_0xf045('0xa5')](_0x3d2e23[_0xf045('0x50')])};var _0x44c1ac={'ChatWebsiteId':_0x3d2e23['params']['id'],'closed':![]};if(_0x3d2e23[_0xf045('0x50')][_0xf045('0xa6')]){_0x44c1ac[_0xf045('0xa6')]=_0x3d2e23[_0xf045('0x50')][_0xf045('0xa6')];return db[_0xf045('0xa7')]['find']({'where':_0x44c1ac})['then'](function(_0x4c3691){if(_0x4c3691){return[_0x4c3691,![]];}_0x4bdb35[_0xf045('0xa6')]=_0x3d2e23[_0xf045('0x50')]['threadId'];_0x4bdb35['externalUrl']=_0x3d2e23[_0xf045('0x50')]['externalUrl'];return db[_0xf045('0xa7')][_0xf045('0x4e')](_0x4bdb35)[_0xf045('0x20')](function(_0x11c346){return[_0x11c346,!![]];});});}_0x44c1ac[_0xf045('0xa8')]=_0x366d6d['id'];if(_0x3d2e23['body'][_0xf045('0xa9')]&&_0x3d2e23[_0xf045('0x50')][_0xf045('0xa9')]['id']){_0x44c1ac['id']=_0x3d2e23[_0xf045('0x50')][_0xf045('0xa9')]['id'];return db[_0xf045('0xa7')][_0xf045('0x47')]({'where':_0x44c1ac})['then'](function(_0x511726){if(_0x511726){return[_0x511726,![]];}return db[_0xf045('0xa7')][_0xf045('0x4e')](_0x4bdb35)[_0xf045('0x20')](function(_0x3686b9){return[_0x3686b9,!![]];});});}return db[_0xf045('0xa7')][_0xf045('0x4e')](_0x4bdb35)['then'](function(_0xbb2d8){return[_0xbb2d8,!![]];});}})['spread'](function(_0x495403,_0x569e32){if(_0x495403){_0x6a449f=_0x569e32;if(!_0x569e32){var _0x5ac1ee={'from':(_0x35cad6[_0xf045('0x95')][_0xf045('0x9a')]||'')+'\x20'+(_0x35cad6['contact'][_0xf045('0x9b')]||'')};if(_0x3d2e23[_0xf045('0x50')][_0xf045('0xa6')]&&_0x3d2e23[_0xf045('0x50')][_0xf045('0xaa')]&&_0x3d2e23[_0xf045('0x50')]['threadId']!=_0x3d2e23[_0xf045('0x50')][_0xf045('0xaa')]){_0x5ac1ee[_0xf045('0xa6')]=_0x3d2e23['body'][_0xf045('0xaa')];}return _0x495403[_0xf045('0x1f')](_0x5ac1ee);}else{return _0x495403;}}})[_0xf045('0x20')](function(_0x1cf1e3){_0x35cad6[_0xf045('0xa9')]=_0x1cf1e3[_0xf045('0x22')]({'plain':!![]});_0x35cad6[_0xf045('0xa9')][_0xf045('0xab')]=_0x6a449f;if(_0x35cad6[_0xf045('0xa9')][_0xf045('0xab')]){if(_0x35cad6[_0xf045('0x94')][_0xf045('0xac')]){_0x35cad6['applications'][_0xf045('0xad')]({'id':0x0,'priority':_0x35cad6['applications'][_0xf045('0x36')]+0x1,'app':_0xf045('0xae'),'appdata':_0xf045('0xaf'),'interval':'*,*,*,*'});}}return db[_0xf045('0xb0')][_0xf045('0x4e')]({'body':_0x3d2e23[_0xf045('0x50')][_0xf045('0x50')],'ChatWebsiteId':_0x3d2e23[_0xf045('0x45')]['id'],'ChatInteractionId':_0x1cf1e3['id'],'direction':'in','ContactId':_0x35cad6[_0xf045('0x95')]['id'],'AttachmentId':_0x3d2e23['body'][_0xf045('0xb1')]});})[_0xf045('0x20')](function(_0x23e435){_0x35cad6['message']=_0x23e435;if(_0x35cad6[_0xf045('0xa9')][_0xf045('0xb2')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x35cad6['interaction'][_0xf045('0xb2')]}})[_0xf045('0x20')](function(_0x24496c){if(_0x24496c){_0x35cad6['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xf045('0xb3'),'appdata':_0x24496c[_0xf045('0x27')]+','+(_0x35cad6['account'][_0xf045('0xb4')]||0xa),'interval':_0xf045('0xb5')});_0x35cad6[_0xf045('0xb6')]=!![];}return respondWithRpcPromise(_0xf045('0xb7'),_0xf045('0xb8'),_0x35cad6);});}return respondWithRpcPromise(_0xf045('0xb7'),_0xf045('0xb8'),_0x35cad6);})['then'](function(_0x36c3c2){respondWithRpcPromise('EventManager','EventManager',{'event':_0xf045('0x79'),'message':_0x36c3c2},client9002);return _0x36c3c2;})[_0xf045('0x20')](respondWithResult(_0x30629d,null))[_0xf045('0x17')](handleError(_0x30629d,null));};exports[_0xf045('0xb9')]=function(_0x2a2ac2,_0x59bd1c){var _0x414760,_0x376a8d,_0x17190d;var _0x3e6800=[];var _0x3e14e6={};var _0x2412f6=_0x2a2ac2[_0xf045('0xba')]||[];var _0xecfb87=[];var _0x587da3;return db[_0xf045('0x7d')][_0xf045('0x51')]()[_0xf045('0x20')](function(_0x44644e){if(!_0x44644e){throw new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x80'));}_0x3e6800=_['difference'](_[_0xf045('0x30')](_0x44644e),['createdAt',_0xf045('0x83'),'CompanyId',_0xf045('0xbb')]);if(_0x2a2ac2[_0xf045('0x50')]['id']){delete _0x2a2ac2['body']['id'];}if(_[_0xf045('0x6b')](_0x2a2ac2[_0xf045('0x50')][_0xf045('0x85')])){throw _0x59bd1c[_0xf045('0x19')](0x1f4)['send'](new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0x86')));}if(_['isNil'](_0x2a2ac2[_0xf045('0x50')][_0xf045('0x50')])||_0x2a2ac2['body']['body']===''){throw _0x59bd1c[_0xf045('0x19')](0x1f4)[_0xf045('0x28')](new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))](_0xf045('0xbc')));}if(_['isNil'](_0x2a2ac2['body'][_0xf045('0xbd')])){throw _0x59bd1c[_0xf045('0x19')](0x1f4)['send'](new db['Sequelize'][(_0xf045('0x7f'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e6800));}if(!_[_0xf045('0x89')](_0x3e6800,_0x2a2ac2[_0xf045('0x50')][_0xf045('0xbd')])){throw _0x59bd1c['status'](0x1f4)[_0xf045('0x28')](new db[(_0xf045('0x7e'))][(_0xf045('0x7f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e6800));}_0x3e14e6[_0x2a2ac2['body'][_0xf045('0xbd')]]=_0x2a2ac2[_0xf045('0x50')]['from'];})[_0xf045('0x20')](function(){return db['ChatWebsite'][_0xf045('0x47')]({'where':{'id':_0x2a2ac2[_0xf045('0x45')]['id']},'include':[{'model':db['CmList'],'as':_0xf045('0x8c')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0xf045('0x20')](handleEntityNotFound(_0x59bd1c,null))[_0xf045('0x20')](function(_0x4495ce){if(_0x4495ce&&_0x4495ce[_0xf045('0x8c')]){_0x376a8d=_0x4495ce;var _0x4ae8ec=_[_0xf045('0x9')](_0x2a2ac2[_0xf045('0x50')],{'firstName':_0x2a2ac2[_0xf045('0x50')][_0xf045('0x85')],'phone':_0x2a2ac2[_0xf045('0x50')][_0xf045('0x85')],'ListId':_0x4495ce[_0xf045('0xbb')]});_0x4ae8ec[_0x2a2ac2[_0xf045('0x50')][_0xf045('0xbd')]]=_0x2a2ac2['body']['from'];return db[_0xf045('0x7d')][_0xf045('0xbe')]({'where':_0x3e14e6,'defaults':_0x4ae8ec});}})[_0xf045('0xbf')](function(_0x389949){if(_0x389949){_0x17190d=_0x389949;var _0x52a35c=fs[_0xf045('0xc0')](path[_0xf045('0x67')](config[_0xf045('0x6d')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x53ffa3=ejs[_0xf045('0xc1')](_0x52a35c,{'body':_[_0xf045('0xc2')](_0x2a2ac2[_0xf045('0x50')][_0xf045('0x50')]),'bodyTitle':_0x376a8d[_0xf045('0xc3')]});return db[_0xf045('0xc4')][_0xf045('0x4e')]({'body':_0x53ffa3,'ContactId':_0x389949['id'],'ChatWebsiteId':_0x376a8d['id']});}})['then'](function(_0x5b4281){_0x587da3=_0x5b4281;if(_0x2412f6[_0xf045('0x36')]){var _0x4cd580=_0x2412f6[_0xf045('0x2c')](function(_0xae463d){return{'name':_0xae463d[_0xf045('0xc5')],'basename':_0xae463d[_0xf045('0x61')],'type':_0xae463d[_0xf045('0xc6')],'ChatOfflineMessageId':_0x5b4281['id']};});_0xecfb87=_0x4cd580[_0xf045('0x2c')](_0x5d08b6=>{var _0x4bf008={'filename':_0x5d08b6[_0xf045('0x27')],'path':path['join'](config['root'],'server',_0xf045('0xba'),'attachments',_0xf045('0xc7'),_0x5d08b6['basename'])};return _0x4bf008;});if(!_0x376a8d[_0xf045('0xc8')]){return db['sequelize'][_0xf045('0xc9')](function(_0x4fd11c){return db[_0xf045('0xca')]['bulkCreate'](_0x4cd580,{'transaction':_0x4fd11c});});}}})['then'](function(){if(_0x587da3){_0x414760=_0x587da3;return db[_0xf045('0xcb')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xf045('0xcc')],'as':_0xf045('0xcd'),'raw':!![]}]});}})[_0xf045('0x20')](function(_0x3c6bd1){if(_0x3c6bd1&&_0x3c6bd1[_0xf045('0xcd')]&&_0x376a8d[_0xf045('0xce')]&&_0x376a8d[_0xf045('0xcf')]){var _0x3f76a9={'tls':{'rejectUnauthorized':![]}};if(_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd0')]){_0x3f76a9[_0xf045('0xd0')]=_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd0')];}else{_0x3f76a9[_0xf045('0xd1')]=_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd1')];_0x3f76a9[_0xf045('0xd2')]=_0x3c6bd1[_0xf045('0xcd')]['port'];_0x3f76a9[_0xf045('0xd3')]=_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd3')];}if(_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd4')]){_0x3f76a9['auth']={'user':_0x3c6bd1[_0xf045('0xcd')][_0xf045('0x48')],'pass':_0x3c6bd1[_0xf045('0xcd')][_0xf045('0xd5')]};}return respondWithRpcPromise('SendMail',_0xf045('0xd6'),{'account':_0x3f76a9,'message':{'from':util[_0xf045('0xa0')](_0xf045('0xd7'),_0x3c6bd1['name'],_0x3c6bd1[_0xf045('0xd8')]||_0x3c6bd1['Smtp'][_0xf045('0x48')]),'to':_0x376a8d[_0xf045('0xcf')],'subject':_0x376a8d[_0xf045('0xd9')],'html':_0x414760[_0xf045('0x50')],'attachments':_0xecfb87}},client9003)[_0xf045('0x20')](function(){return _0x414760;})[_0xf045('0x17')](function(_0x53a7c0){console['error'](_0x53a7c0);});}})[_0xf045('0x20')](function(){if(_0x376a8d&&_0x376a8d[_0xf045('0xc8')]&&_0x376a8d[_0xf045('0xda')]){var _0x41ee34=[];if(_0x2412f6['length']){_0x41ee34=_0x2412f6[_0xf045('0x2c')](function(_0x410e76){return{'name':_0x410e76['originalname'],'basename':_0x410e76[_0xf045('0x61')],'type':_0x410e76[_0xf045('0xc6')],'ChatOfflineMessageId':_0x587da3['id']};});}var _0x5d1af2;if(!_[_0xf045('0x6b')](_0x376a8d['subjectOffline'])){var _0x29212b=_[_0xf045('0x2c')](_0x2a2ac2[_0xf045('0x50')],function(_0x351f62){return _0x351f62;});var _0x13d5d3=_[_0xf045('0xdb')](_0x29212b)[0x0];var _0x567985=_[_0xf045('0xdc')](_0x13d5d3,function(_0x3393d4){return _0x3393d4;});_0x5d1af2=_0x567985[0x1][_0x376a8d[_0xf045('0xdd')]];}var _0x37589f={'from':_0x17190d[_0xf045('0xd8')],'firstName':_0x17190d[_0xf045('0x9a')],'lastName':_0x17190d['lastName'],'mapKey':_0xf045('0xd8'),'message':{'from':_0x17190d['email'],'to':_0x376a8d[_0xf045('0xcb')][_0xf045('0xd8')],'cc':'','subject':_[_0xf045('0x6b')](_0x5d1af2)?_0x376a8d[_0xf045('0xd9')]:_0x5d1af2,'messageId':'','sentAt':new Date(),'attach':_0x41ee34['length'],'attachments':_0x41ee34,'originChannel':_0xf045('0xde'),'ChatWebsiteId':_0x376a8d['id'],'ChatOfflineMessageId':_0x414760['id'],'originTo':_0x376a8d['MailAccount'][_0xf045('0xd8')]},'body':_0x414760[_0xf045('0x50')]};var _0x3c7bce={'account':{'id':_0x376a8d[_0xf045('0xda')]},'body':_0x37589f,'log':_0xf045('0xdf')};return respondWithRpcPromise(_0xf045('0xdf'),'notifyMail',_0x3c7bce,client9001)[_0xf045('0x20')](function(){return _0x414760;})[_0xf045('0x17')](function(_0x26b103){console[_0xf045('0x15')](_0x26b103);});}return;})[_0xf045('0x20')](function(){if(_0x414760){return _0x414760;}})[_0xf045('0x20')](respondWithResult(_0x59bd1c,null))[_0xf045('0x17')](function(_0x17d71e){console[_0xf045('0x15')]('catch',_0x17d71e);for(var _0x3eb01b of _0x2412f6){var _0x2bb50a=path[_0xf045('0x67')](config['root'],'server',_0xf045('0xba'),'attachments','offline-chat',_0x3eb01b['filename']);fs_extra['remove'](_0x2bb50a)[_0xf045('0x17')](function(_0x5d0390){console[_0xf045('0x15')]('Could\x20not\x20remove\x20attachment\x20file',_0x2bb50a,_0x5d0390);});}});};exports[_0xf045('0xe0')]=function(_0x17289e,_0x357444){return db[_0xf045('0xa7')][_0xf045('0x47')]({'where':{'id':_0x17289e['params']['id']}})['then'](handleEntityNotFound(_0x357444,null))[_0xf045('0x20')](function(_0x2500f4){if(_0x2500f4){return _0x2500f4['addInteraction'](_0x17289e[_0xf045('0x50')][_0xf045('0x59')],_['omit'](_0x17289e[_0xf045('0x50')],['ids','id'])||{});}})[_0xf045('0x20')](respondWithResult(_0x357444,null))[_0xf045('0x17')](handleError(_0x357444,null));};exports[_0xf045('0xe1')]=function(_0x4b1f0a,_0x2a7b08){var _0x4e967a={'raw':![],'where':{}};var _0x3c5a3a={};var _0x3f7f4f={'count':0x0,'rows':[]};return db[_0xf045('0x2d')]['findOne']({'where':{'id':_0x4b1f0a['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2a7b08,null))[_0xf045('0x20')](function(_0x5d0910){if(_0x5d0910){_0x3c5a3a['model']=_[_0xf045('0x30')](db['ChatInteraction'][_0xf045('0x56')]);_0x3c5a3a['query']=_[_0xf045('0x30')](_0x4b1f0a[_0xf045('0x2f')]);_0x3c5a3a[_0xf045('0x31')]=_[_0xf045('0x34')](_0x3c5a3a[_0xf045('0x32')],_0x3c5a3a['query']);_0x4e967a['attributes']=_[_0xf045('0x34')](_0x3c5a3a['model'],qs['fields'](_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x35')]));_0x4e967a[_0xf045('0x33')]=_0x4e967a['attributes'][_0xf045('0x36')]?_0x4e967a[_0xf045('0x33')]:_0x3c5a3a[_0xf045('0x32')];if(!_0x4b1f0a[_0xf045('0x2f')]['hasOwnProperty']('nolimit')){_0x4e967a[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x4b1f0a[_0xf045('0x2f')]['limit']);_0x4e967a['offset']=qs['offset'](_0x4b1f0a[_0xf045('0x2f')]['offset']);}_0x4e967a[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x4b1f0a[_0xf045('0x2f')]['sort']);_0x4e967a[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x4b1f0a['query'],_0x3c5a3a[_0xf045('0x31')]));_0x4e967a[_0xf045('0x3b')][_0xf045('0x5b')]=_0x5d0910['id'];if(_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x40')]){_0x4e967a['where']=_[_0xf045('0x3d')](_0x4e967a[_0xf045('0x3b')],{'$or':_['map'](_0x4e967a['attributes'],function(_0x2d9531){var _0x373cda={};_0x373cda[_0x2d9531]={'$like':'%'+_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x373cda;})});}_0x4e967a=_['merge']({},_0x4e967a,_0x4b1f0a[_0xf045('0x46')]);return db[_0xf045('0xa7')]['count']({'where':_0x4e967a[_0xf045('0x3b')]})['then'](function(_0x25e6f9){_0x3f7f4f[_0xf045('0x1d')]=_0x25e6f9;if(_0x4b1f0a[_0xf045('0x2f')][_0xf045('0x41')]){_0x4e967a[_0xf045('0x42')]=[{'model':db[_0xf045('0x7d')],'as':_0xf045('0xe2'),'required':![]},{'model':db[_0xf045('0xe3')],'as':_0xf045('0xe4'),'attributes':[_0xf045('0x27'),_0xf045('0xe5'),_0xf045('0xe6')],'required':![]},{'model':db[_0xf045('0xe7')],'as':_0xf045('0xe8'),'attributes':['id','name','color'],'where':_0x4b1f0a[_0xf045('0x2f')][_0xf045('0xe9')]?{'id':_0x4b1f0a[_0xf045('0x2f')]['tag']}:undefined,'required':_0x4b1f0a[_0xf045('0x2f')][_0xf045('0xe9')]?!![]:![]}];}return db[_0xf045('0xa7')][_0xf045('0x43')](_0x4e967a);})[_0xf045('0x20')](function(_0x487216){_0x3f7f4f[_0xf045('0x57')]=_0x487216;return _0x3f7f4f;});}})[_0xf045('0x20')](respondWithFilteredResult(_0x2a7b08,_0x4e967a))[_0xf045('0x17')](handleError(_0x2a7b08,null));};function iftimePromise(_0x29dd8b,_0x54da53){return respondWithRpcPromise(_0xf045('0xea'),_0xf045('0xeb'),{'command':_0x54da53['timezone']?util['format'](_0xf045('0xec'),_0x29dd8b[_0xf045('0xed')],_0x54da53[_0xf045('0xee')]):util[_0xf045('0xa0')](_0xf045('0xef'),_0x29dd8b[_0xf045('0xed')])},client9002)['then'](function(_0x3454d5){var _0x20f859=_0x3454d5&&_0x3454d5[_0xf045('0xf0')](_0xf045('0xf1'))>=0x0?!![]:![];logger[_0xf045('0x10')](_0xf045('0xf2'),_0x54da53['id'],_0x29dd8b['id'],_0x29dd8b['interval'],_0x20f859?_0xf045('0xf3'):'OFFLINE',_0x54da53['timezone']?_0x54da53[_0xf045('0xee')]:_0xf045('0xf4'));return _0x20f859;})[_0xf045('0x17')](function(_0xf03a2f){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x54da53['id'],_0x29dd8b['id'],_0x29dd8b[_0xf045('0xed')],util[_0xf045('0xf5')](_0xf03a2f,{'showHidden':![],'depth':null}),_0x54da53[_0xf045('0xee')]?_0x54da53[_0xf045('0xee')]:_0xf045('0xf4'));return![];});}exports[_0xf045('0xeb')]=function(_0x3c3375,_0x23e908){var _0x23306b=0x0;var _0x59aabe=0x0;var _0x5549c4=![];var _0x2a50e3;var _0x19dc0c;return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x3c3375[_0xf045('0x45')]['id']},'include':[{'model':db[_0xf045('0xf6')],'as':'Interval','include':[{'model':db['Interval'],'as':_0xf045('0xf7'),'attributes':['id',_0xf045('0xed')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x23e908,null))['then'](function(_0x295457){if(_0x295457){_0x2a50e3=_0x295457;return _0x295457[_0xf045('0xf8')]({'raw':!![]});}})[_0xf045('0x20')](function(_0x2abece){if(_0x2a50e3){if(_0x2abece){_0x19dc0c=_0x2abece;}}return require('../../config/license/util')[_0xf045('0x69')]();})[_0xf045('0x20')](function(_0xb43517){if(_0xb43517){_0x59aabe=_0xb43517['virtual'];_0x5549c4=_0xb43517[_0xf045('0x6a')];}})[_0xf045('0x20')](function(){return db[_0xf045('0xa7')][_0xf045('0x1d')]({'where':{'closed':![]}});})[_0xf045('0x20')](function(_0x35c59c){_0x23306b=_0x35c59c;if(_0x59aabe&&_0x35c59c>_0x59aabe){return db[_0xf045('0xf9')][_0xf045('0x55')]({'where':{'id':0x1}})[_0xf045('0x20')](function(_0x5aefe1){if(_0x5aefe1){_0x5aefe1['increment'](_0xf045('0xfa'));}});}})['then'](function(){if(_0x2a50e3['Interval']&&_0x2a50e3['Interval'][_0xf045('0xf7')]){var _0x1c3664=[];for(var _0x186472=0x0;_0x186472<_0x2a50e3[_0xf045('0xf6')][_0xf045('0xf7')][_0xf045('0x36')];_0x186472++){var _0x4c57c2=_0x2a50e3[_0xf045('0xf6')][_0xf045('0xf7')][_0x186472][_0xf045('0x22')]({'plain':!![]});_0x1c3664[_0xf045('0xad')](iftimePromise(_0x4c57c2,_0x2a50e3));}return BPromise[_0xf045('0xfb')](_0x1c3664)['then'](function(_0x215afe){return _['some'](_0x215afe);});}else{return!![];}})[_0xf045('0x20')](function(_0x3ef323){var _0x3c34d2=fs[_0xf045('0xc0')](path[_0xf045('0x67')](config[_0xf045('0x6d')],_0xf045('0xfc')),_0xf045('0xfd'));var _0x50757d={'remote':_0x2a50e3[_0xf045('0xfe')],'query':querystring[_0xf045('0xa5')](_[_0xf045('0x3d')](_0x2a50e3['get']({'plain':!![]}),{'customerIp':_0x3c3375[_0xf045('0x96')]['x-forwarded-for']||_0x3c3375[_0xf045('0x96')][_0xf045('0xff')]||_0x3c3375[_0xf045('0x100')][_0xf045('0x101')]||_0x3c3375['ip'],'referer':_0x3c3375[_0xf045('0x96')][_0xf045('0x102')],'openedInteractions':_0x23306b,'maxInteractions':_0x59aabe,'virtual':_0x5549c4[_0xf045('0x103')],'online':_0x3ef323,'custom':_0x5549c4}))['replace'](/'/g,'\x5c\x27')};_0x23e908[_0xf045('0x28')](ejs[_0xf045('0xc1')](Mustache[_0xf045('0xc1')](_0x3c34d2,_0x50757d),{'proactiveActions':_0x19dc0c,'alignment':_0x2a50e3[_0xf045('0x104')],'verticalAlignment':_0x2a50e3[_0xf045('0x105')],'div_color':_0x2a50e3['color'],'labelText':_0x2a50e3[_0xf045('0x106')],'text_color':_0x2a50e3[_0xf045('0x107')],'button_color':_0x2a50e3['color_button'],'background_color':_0x2a50e3[_0xf045('0x108')]}));})[_0xf045('0x17')](handleError(_0x23e908,null));};exports['addApplications']=function(_0x5db755,_0x136691){var _0x3d0211=_0x5db755[_0xf045('0x45')]['id'];var _0x5c25a2=_0x5db755[_0xf045('0x50')];var _0x431a96=0xc8;var _0x2140bb=null;return db[_0xf045('0x109')][_0xf045('0xc9')]({'isolationLevel':db[_0xf045('0x109')][_0xf045('0x10a')]['ISOLATION_LEVELS'][_0xf045('0x10b')]},function(_0xf9d973){return db[_0xf045('0x2d')][_0xf045('0x55')]({'where':{'id':_0x3d0211},'transaction':_0xf9d973})[_0xf045('0x20')](function(_0x1361eb){if(_0x1361eb){return db[_0xf045('0x8f')][_0xf045('0x21')]({'where':{'ChatWebsiteId':_0x3d0211},'transaction':_0xf9d973})['then'](function(){var _0x16a9aa=_[_0xf045('0x2c')](_0x5c25a2,function(_0x5cb875){_0x5cb875[_0xf045('0x5b')]=_0x3d0211;return _0x5cb875;});return db['ChatApplication'][_0xf045('0x10c')](_0x16a9aa,{'transaction':_0xf9d973});});}else{_0x431a96=0x194;_0x2140bb=[];}});})[_0xf045('0x20')](function(){if(_0x431a96!==0x194){return db[_0xf045('0x8f')][_0xf045('0x10d')]({'where':{'ChatWebsiteId':_0x3d0211},'order':_0xf045('0x10e')})['then'](function(_0x5b5291){_0x2140bb=_0x5b5291;});}})[_0xf045('0x17')](function(_0x1e3270){_0x431a96=0x1f4;logger[_0xf045('0x15')](_0x1e3270[_0xf045('0x26')]);if(_0x1e3270[_0xf045('0x27')]){delete _0x1e3270[_0xf045('0x27')];}_0x2140bb=_0x1e3270;})[_0xf045('0x10f')](function(){if(_0x2140bb===null){_0x136691[_0xf045('0x18')](_0x431a96);}else{if(_0x431a96===0x1f4){_0x136691['status'](_0x431a96)[_0xf045('0x28')](_0x2140bb);}else{_0x136691['status'](_0x431a96)[_0xf045('0x1a')](_0x2140bb);}}});};exports[_0xf045('0x110')]=function(_0x18f61f,_0x428456){var _0x258368={};var _0x9488df={};var _0x20a273;var _0xee9c92;return db[_0xf045('0x2d')][_0xf045('0x55')]({'where':{'id':_0x18f61f['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x428456,null))[_0xf045('0x20')](function(_0x427f96){if(_0x427f96){_0x20a273=_0x427f96;_0x9488df['model']=_[_0xf045('0x30')](db['ChatApplication'][_0xf045('0x56')]);_0x9488df[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x18f61f['query']);_0x9488df[_0xf045('0x31')]=_[_0xf045('0x34')](_0x9488df[_0xf045('0x32')],_0x9488df[_0xf045('0x2f')]);_0x258368[_0xf045('0x33')]=_[_0xf045('0x34')](_0x9488df['model'],qs[_0xf045('0x35')](_0x18f61f[_0xf045('0x2f')]['fields']));_0x258368['attributes']=_0x258368[_0xf045('0x33')]['length']?_0x258368[_0xf045('0x33')]:_0x9488df[_0xf045('0x32')];_0x258368[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x18f61f[_0xf045('0x2f')][_0xf045('0x3a')]);_0x258368[_0xf045('0x3b')]=qs['filters'](_['pick'](_0x18f61f[_0xf045('0x2f')],_0x9488df['filters']));if(_0x18f61f[_0xf045('0x2f')]['filter']){_0x258368[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x258368[_0xf045('0x3b')],{'$or':_[_0xf045('0x2c')](_0x258368[_0xf045('0x33')],function(_0x365dea){var _0x2ab7da={};_0x2ab7da[_0x365dea]={'$like':'%'+_0x18f61f[_0xf045('0x2f')]['filter']+'%'};return _0x2ab7da;})});}_0x258368=_[_0xf045('0x3d')]({},_0x258368,_0x18f61f['options']);return _0x20a273['getApplications'](_0x258368);}})[_0xf045('0x20')](function(_0x311942){if(_0x311942){_0xee9c92=_0x311942[_0xf045('0x36')];if(!_0x18f61f[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x258368[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x18f61f[_0xf045('0x2f')][_0xf045('0x1e')]);_0x258368[_0xf045('0x1b')]=qs[_0xf045('0x1b')](_0x18f61f[_0xf045('0x2f')][_0xf045('0x1b')]);}return _0x20a273[_0xf045('0x110')](_0x258368);}})['then'](function(_0x4e7008){if(_0x4e7008){return _0x4e7008?{'count':_0xee9c92,'rows':_0x4e7008}:null;}})['then'](respondWithResult(_0x428456,null))[_0xf045('0x17')](handleError(_0x428456,null));};exports[_0xf045('0x111')]=function(_0x5cd68e,_0x10c169){return db[_0xf045('0x112')]['find']({'where':{'id':_0x5cd68e['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x10c169,null))[_0xf045('0x20')](function(_0x596bd1){if(_0x596bd1){return _0x596bd1[_0xf045('0x111')](_0x5cd68e['body'][_0xf045('0x59')],_['omit'](_0x5cd68e['body'],['ids','id'])||{});}})[_0xf045('0x20')](respondWithResult(_0x10c169,null))[_0xf045('0x17')](handleError(_0x10c169,null));};exports[_0xf045('0xf8')]=function(_0x4ee990,_0x1d82a4){var _0x108897={};var _0x2ee613={};var _0x3dfb55;var _0x481ec2;return db['ChatWebsite'][_0xf045('0x55')]({'where':{'id':_0x4ee990[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x1d82a4,null))['then'](function(_0x6bbd78){if(_0x6bbd78){_0x3dfb55=_0x6bbd78;_0x2ee613[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0x113')][_0xf045('0x56')]);_0x2ee613['query']=_[_0xf045('0x30')](_0x4ee990['query']);_0x2ee613[_0xf045('0x31')]=_[_0xf045('0x34')](_0x2ee613[_0xf045('0x32')],_0x2ee613[_0xf045('0x2f')]);_0x108897[_0xf045('0x33')]=_[_0xf045('0x34')](_0x2ee613[_0xf045('0x32')],qs[_0xf045('0x35')](_0x4ee990['query'][_0xf045('0x35')]));_0x108897[_0xf045('0x33')]=_0x108897[_0xf045('0x33')][_0xf045('0x36')]?_0x108897[_0xf045('0x33')]:_0x2ee613[_0xf045('0x32')];_0x108897[_0xf045('0x39')]=qs['sort'](_0x4ee990[_0xf045('0x2f')][_0xf045('0x3a')]);_0x108897[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0x4ee990[_0xf045('0x2f')],_0x2ee613['filters']));if(_0x4ee990[_0xf045('0x2f')][_0xf045('0x40')]){_0x108897[_0xf045('0x3b')]=_['merge'](_0x108897[_0xf045('0x3b')],{'$or':_[_0xf045('0x2c')](_0x108897[_0xf045('0x33')],function(_0x277b4c){var _0x1660f2={};_0x1660f2[_0x277b4c]={'$like':'%'+_0x4ee990[_0xf045('0x2f')]['filter']+'%'};return _0x1660f2;})});}_0x108897=_[_0xf045('0x3d')]({},_0x108897,_0x4ee990[_0xf045('0x46')]);return _0x3dfb55[_0xf045('0xf8')](_0x108897);}})[_0xf045('0x20')](function(_0x3146cb){if(_0x3146cb){_0x481ec2=_0x3146cb[_0xf045('0x36')];if(!_0x4ee990['query'][_0xf045('0x37')](_0xf045('0x38'))){_0x108897['limit']=qs['limit'](_0x4ee990[_0xf045('0x2f')][_0xf045('0x1e')]);_0x108897[_0xf045('0x1b')]=qs['offset'](_0x4ee990['query'][_0xf045('0x1b')]);}return _0x3dfb55[_0xf045('0xf8')](_0x108897);}})['then'](function(_0x2f6ce9){if(_0x2f6ce9){return _0x2f6ce9?{'count':_0x481ec2,'rows':_0x2f6ce9}:null;}})[_0xf045('0x20')](respondWithResult(_0x1d82a4,null))[_0xf045('0x17')](handleError(_0x1d82a4,null));};exports[_0xf045('0x114')]=function(_0x23b355,_0x2fc125){var _0x552c8c=_0x23b355['query']['online']==='false'?'offlineForm':_0xf045('0x115');return db[_0xf045('0x2d')][_0xf045('0x47')]({'attributes':['id',_0x552c8c],'where':{'id':_0x23b355[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2fc125,null))[_0xf045('0x20')](function(_0x2e8720){if(_0x2e8720){var _0x2fe3eb=_0x2e8720[_0x552c8c];var _0x138684=_0x2fe3eb&&_0x2fe3eb[_0xf045('0x116')]?_0x2fe3eb[_0xf045('0x116')]:[];_0x2fc125[_0xf045('0x28')]({'fromKey':_[_0xf045('0x6b')](_0x2fe3eb[_0xf045('0x117')])?undefined:_0x2fe3eb[_0xf045('0x117')],'count':_0x138684[_0xf045('0x36')],'rows':_0x138684});}})[_0xf045('0x17')](handleError(_0x2fc125,null));};exports['getOfflineMessages']=function(_0xb5379d,_0x4fb2b8){var _0x5d5d9b={'raw':![],'where':{}};var _0x5094d8={};var _0x296460={'count':0x0,'rows':[]};return db[_0xf045('0x2d')]['findOne']({'where':{'id':_0xb5379d[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x4fb2b8,null))[_0xf045('0x20')](function(_0x293c1a){if(_0x293c1a){_0x5094d8[_0xf045('0x32')]=_['keys'](db[_0xf045('0xc4')][_0xf045('0x56')]);_0x5094d8[_0xf045('0x2f')]=_['keys'](_0xb5379d['query']);_0x5094d8[_0xf045('0x31')]=_[_0xf045('0x34')](_0x5094d8[_0xf045('0x32')],_0x5094d8[_0xf045('0x2f')]);_0x5d5d9b[_0xf045('0x33')]=_[_0xf045('0x34')](_0x5094d8['model'],qs['fields'](_0xb5379d[_0xf045('0x2f')][_0xf045('0x35')]));_0x5d5d9b[_0xf045('0x33')]=_0x5d5d9b[_0xf045('0x33')]['length']?_0x5d5d9b[_0xf045('0x33')]:_0x5094d8[_0xf045('0x32')];if(!_0xb5379d[_0xf045('0x2f')][_0xf045('0x37')](_0xf045('0x38'))){_0x5d5d9b[_0xf045('0x1e')]=qs['limit'](_0xb5379d[_0xf045('0x2f')][_0xf045('0x1e')]);_0x5d5d9b[_0xf045('0x1b')]=qs[_0xf045('0x1b')](_0xb5379d[_0xf045('0x2f')][_0xf045('0x1b')]);}_0x5d5d9b[_0xf045('0x39')]=qs['sort'](_0xb5379d[_0xf045('0x2f')][_0xf045('0x3a')]);_0x5d5d9b[_0xf045('0x3b')]=qs[_0xf045('0x31')](_[_0xf045('0x3c')](_0xb5379d[_0xf045('0x2f')],_0x5094d8[_0xf045('0x31')]));_0x5d5d9b[_0xf045('0x3b')][_0xf045('0x5b')]=_0x293c1a['id'];if(_0xb5379d[_0xf045('0x2f')][_0xf045('0x40')]){_0x5d5d9b['where']=_[_0xf045('0x3d')](_0x5d5d9b['where'],{'$or':_[_0xf045('0x2c')](_0x5d5d9b[_0xf045('0x33')],function(_0x33d377){var _0x284868={};_0x284868[_0x33d377]={'$like':'%'+_0xb5379d[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x284868;})});}_0x5d5d9b=_[_0xf045('0x3d')]({},_0x5d5d9b,_0xb5379d['options']);return db[_0xf045('0xc4')][_0xf045('0x1d')]({'where':_0x5d5d9b['where']})[_0xf045('0x20')](function(_0x28f3ad){_0x296460['count']=_0x28f3ad;if(_0xb5379d['query']['includeAll']){_0x5d5d9b['include']=[{'all':!![]}];}else{_0x5d5d9b[_0xf045('0x42')]=[{'model':db['CmContact'],'as':_0xf045('0xe2'),'required':![]},{'model':db[_0xf045('0xca')],'as':_0xf045('0x118'),'required':![]}];}return db[_0xf045('0xc4')][_0xf045('0x43')](_0x5d5d9b);})[_0xf045('0x20')](function(_0xa7df1d){_0x296460[_0xf045('0x57')]=_0xa7df1d;return _0x296460;});}})[_0xf045('0x20')](respondWithFilteredResult(_0x4fb2b8,_0x5d5d9b))[_0xf045('0x17')](handleError(_0x4fb2b8,null));};exports['addAgents']=function(_0xcdcd9a,_0x4dbb33){return db['ChatWebsite'][_0xf045('0x47')]({'where':{'id':_0xcdcd9a[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x4dbb33,null))[_0xf045('0x20')](function(_0x11a8fd){if(_0x11a8fd){return _0x11a8fd[_0xf045('0x119')](_0xcdcd9a[_0xf045('0x50')][_0xf045('0x59')],_[_0xf045('0x11a')](_0xcdcd9a[_0xf045('0x50')],['ids','id'])||{})[_0xf045('0xbf')](function(_0x5a4f0e){for(var _0x1cafea=0x0;_0x1cafea<_0xcdcd9a[_0xf045('0x50')]['ids'][_0xf045('0x36')];_0x1cafea+=0x1){socket[_0xf045('0x11b')](_0xf045('0x11c'),{'UserId':Number(_0xcdcd9a[_0xf045('0x50')][_0xf045('0x59')][_0x1cafea]),'ChatWebsiteId':Number(_0xcdcd9a[_0xf045('0x45')]['id'])});}return _0x5a4f0e;});}})[_0xf045('0x20')](respondWithResult(_0x4dbb33,null))['catch'](handleError(_0x4dbb33,null));};exports[_0xf045('0x11d')]=function(_0x512fee,_0x5edb80){return db[_0xf045('0x2d')][_0xf045('0x47')]({'where':{'id':_0x512fee['params']['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x5edb80,null))[_0xf045('0x20')](function(_0x28c10c){if(_0x28c10c){return _0x28c10c[_0xf045('0x11d')](_0x512fee['query'][_0xf045('0x59')])['then'](function(){if(_[_0xf045('0x11e')](_0x512fee['query'][_0xf045('0x59')])){for(var _0xb9d797=0x0;_0xb9d797<_0x512fee[_0xf045('0x2f')]['ids'][_0xf045('0x36')];_0xb9d797+=0x1){socket[_0xf045('0x11b')]('userChatWebsite:remove',{'UserId':Number(_0x512fee[_0xf045('0x2f')]['ids'][_0xb9d797]),'ChatWebsiteId':Number(_0x512fee[_0xf045('0x45')]['id'])});}}else{socket['emit'](_0xf045('0x11f'),{'UserId':Number(_0x512fee[_0xf045('0x2f')][_0xf045('0x59')]),'ChatWebsiteId':Number(_0x512fee[_0xf045('0x45')]['id'])});}});}})[_0xf045('0x20')](respondWithStatusCode(_0x5edb80,null))[_0xf045('0x17')](handleError(_0x5edb80,null));};exports[_0xf045('0x120')]=function(_0x313885,_0x2d7631){var _0x4df0fd={};var _0x2bafcf={};var _0x360cfa;var _0x45a6fa;return db[_0xf045('0x2d')][_0xf045('0x55')]({'where':{'id':_0x313885[_0xf045('0x45')]['id']}})[_0xf045('0x20')](handleEntityNotFound(_0x2d7631,null))[_0xf045('0x20')](function(_0x955e75){if(_0x955e75){_0x360cfa=_0x955e75;_0x2bafcf[_0xf045('0x32')]=_[_0xf045('0x30')](db[_0xf045('0xe3')][_0xf045('0x56')]);_0x2bafcf[_0xf045('0x2f')]=_[_0xf045('0x30')](_0x313885[_0xf045('0x2f')]);_0x2bafcf[_0xf045('0x31')]=_[_0xf045('0x34')](_0x2bafcf['model'],_0x2bafcf['query']);_0x4df0fd['attributes']=_[_0xf045('0x34')](_0x2bafcf[_0xf045('0x32')],qs[_0xf045('0x35')](_0x313885['query'][_0xf045('0x35')]));_0x4df0fd[_0xf045('0x33')]=_0x4df0fd[_0xf045('0x33')][_0xf045('0x36')]?_0x4df0fd['attributes']:_0x2bafcf[_0xf045('0x32')];_0x4df0fd[_0xf045('0x39')]=qs[_0xf045('0x3a')](_0x313885['query'][_0xf045('0x3a')]);_0x4df0fd[_0xf045('0x3b')]=qs['filters'](_[_0xf045('0x3c')](_0x313885['query'],_0x2bafcf[_0xf045('0x31')]));if(_0x313885['query'][_0xf045('0x40')]){_0x4df0fd[_0xf045('0x3b')]=_[_0xf045('0x3d')](_0x4df0fd[_0xf045('0x3b')],{'$or':_['map'](_0x4df0fd[_0xf045('0x33')],function(_0x4ced92){var _0x4df646={};_0x4df646[_0x4ced92]={'$like':'%'+_0x313885[_0xf045('0x2f')][_0xf045('0x40')]+'%'};return _0x4df646;})});}_0x4df0fd=_[_0xf045('0x3d')]({},_0x4df0fd,_0x313885[_0xf045('0x46')]);return _0x360cfa['getAgents'](_0x4df0fd);}})[_0xf045('0x20')](function(_0xc2d67b){if(_0xc2d67b){_0x45a6fa=_0xc2d67b[_0xf045('0x36')];if(!_0x313885['query']['hasOwnProperty'](_0xf045('0x38'))){_0x4df0fd[_0xf045('0x1e')]=qs[_0xf045('0x1e')](_0x313885['query'][_0xf045('0x1e')]);_0x4df0fd['offset']=qs[_0xf045('0x1b')](_0x313885[_0xf045('0x2f')][_0xf045('0x1b')]);}return _0x360cfa[_0xf045('0x120')](_0x4df0fd);}})[_0xf045('0x20')](function(_0x5c7fb1){if(_0x5c7fb1){return _0x5c7fb1?{'count':_0x45a6fa,'rows':_0x5c7fb1}:null;}})[_0xf045('0x20')](respondWithResult(_0x2d7631,null))[_0xf045('0x17')](handleError(_0x2d7631,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 429721d..f255ea9 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 _0xdfe7=['hook','exports','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x30da93,_0x41846a){var _0x24c197=function(_0x5c4a25){while(--_0x5c4a25){_0x30da93['push'](_0x30da93['shift']());}};_0x24c197(++_0x41846a);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x4caeca,_0x463cf8){_0x4caeca=_0x4caeca-0x0;var _0x426b1f=_0xdfe7[_0x4caeca];return _0x426b1f;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x7dfe('0x0'))['db'][_0x7dfe('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7dfe('0x2'),'afterUpdate':_0x7dfe('0x3'),'afterDestroy':_0x7dfe('0x4')};function emitEvent(_0xb0b7fb){return function(_0x527490,_0x2c07d2,_0x23ac4c){ChatWebsiteEvents['emit'](_0xb0b7fb+':'+_0x527490['id'],_0x527490);ChatWebsiteEvents[_0x7dfe('0x5')](_0xb0b7fb,_0x527490);_0x23ac4c(null);};}for(var e in events){if(events[_0x7dfe('0x6')](e)){var event=events[e];ChatWebsite[_0x7dfe('0x7')](e,emitEvent(event));}}module[_0x7dfe('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x1e69=['save','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x297633,_0x285ed9){var _0x45ab91=function(_0x483cd9){while(--_0x483cd9){_0x297633['push'](_0x297633['shift']());}};_0x45ab91(++_0x285ed9);}(_0x1e69,0x85));var _0x91e6=function(_0x22133a,_0x21dfc2){_0x22133a=_0x22133a-0x0;var _0xffab4c=_0x1e69[_0x22133a];return _0xffab4c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x91e6('0x0'))['db'][_0x91e6('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x91e6('0x2')](0x0);var events={'afterCreate':_0x91e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x192f10){return function(_0x351c1d,_0x2b53b6,_0x15545c){ChatWebsiteEvents[_0x91e6('0x4')](_0x192f10+':'+_0x351c1d['id'],_0x351c1d);ChatWebsiteEvents[_0x91e6('0x4')](_0x192f10,_0x351c1d);_0x15545c(null);};}for(var e in events){if(events[_0x91e6('0x5')](e)){var event=events[e];ChatWebsite[_0x91e6('0x6')](e,emitEvent(event));}}module[_0x91e6('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 645d9fe..1be79b6 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 _0x91a2=['path','rimraf','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','util','../../config/logger','api','bluebird'];(function(_0x40bfbe,_0x5ae0e0){var _0x843489=function(_0x3b5cc3){while(--_0x3b5cc3){_0x40bfbe['push'](_0x40bfbe['shift']());}};_0x843489(++_0x5ae0e0);}(_0x91a2,0xe2));var _0x291a=function(_0x3da707,_0x30c36d){_0x3da707=_0x3da707-0x0;var _0x342ee7=_0x91a2[_0x3da707];return _0x342ee7;};'use strict';var _=require('lodash');var util=require(_0x291a('0x0'));var logger=require(_0x291a('0x1'))(_0x291a('0x2'));var moment=require('moment');var BPromise=require(_0x291a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x291a('0x4'));var rimraf=require(_0x291a('0x5'));var config=require('../../config/environment');var attributes=require(_0x291a('0x6'));module[_0x291a('0x7')]=function(_0x5c4a21,_0x197367){return _0x5c4a21['define'](_0x291a('0x8'),attributes,{'tableName':_0x291a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe086=['exports','define','chat_websites','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x23bc85,_0x19addc){var _0x177dfd=function(_0x134ab5){while(--_0x134ab5){_0x23bc85['push'](_0x23bc85['shift']());}};_0x177dfd(++_0x19addc);}(_0xe086,0xb7));var _0x6e08=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe086[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e08('0x0'))(_0x6e08('0x1'));var moment=require(_0x6e08('0x2'));var BPromise=require(_0x6e08('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6e08('0x4'));var config=require(_0x6e08('0x5'));var attributes=require(_0x6e08('0x6'));module[_0x6e08('0x7')]=function(_0xe9a5bd,_0x37fbb3){return _0xe9a5bd[_0x6e08('0x8')]('ChatWebsite',attributes,{'tableName':_0x6e08('0x9'),'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 317102e..8f00082 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 _0x28e8=['stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','register','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s'];(function(_0x544305,_0x1332c4){var _0x1e7318=function(_0x380e15){while(--_0x380e15){_0x544305['push'](_0x544305['shift']());}};_0x1e7318(++_0x1332c4);}(_0x28e8,0xa7));var _0x828e=function(_0x1e42c3,_0x2c1032){_0x1e42c3=_0x1e42c3-0x0;var _0x1d31bf=_0x28e8[_0x1e42c3];return _0x1d31bf;};'use strict';var _=require(_0x828e('0x0'));var util=require('util');var moment=require(_0x828e('0x1'));var BPromise=require('bluebird');var rs=require(_0x828e('0x2'));var fs=require('fs');var Redis=require(_0x828e('0x3'));var db=require(_0x828e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x828e('0x5'))(_0x828e('0x6'));var config=require(_0x828e('0x7'));var jayson=require(_0x828e('0x8'));var client=jayson['client'][_0x828e('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x828e('0xa'),'port':0x18eb});var socket=require(_0x828e('0xb'))(new Redis(config[_0x828e('0xc')]));require('./chatWebsite.socket')[_0x828e('0xd')](socket);function respondWithRpcPromise(_0xb11a4b,_0x1c7417,_0x111f79){return new BPromise(function(_0x5e2291,_0x573bfb){return client['request'](_0xb11a4b,_0x111f79)['then'](function(_0x5ec56d){logger['info'](_0x828e('0xe'),_0x1c7417,_0x828e('0xf'));logger['debug'](_0x828e('0x10'),_0x1c7417,'request\x20sent',JSON[_0x828e('0x11')](_0x5ec56d));if(_0x5ec56d['error']){if(_0x5ec56d['error']['code']===0x1f4){logger['error'](_0x828e('0xe'),_0x1c7417,_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);return _0x573bfb(_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);}logger[_0x828e('0x12')](_0x828e('0xe'),_0x1c7417,_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);return _0x5e2291(_0x5ec56d[_0x828e('0x12')][_0x828e('0x13')]);}else{logger[_0x828e('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1c7417,_0x828e('0xf'));_0x5e2291(_0x5ec56d[_0x828e('0x15')][_0x828e('0x13')]);}})[_0x828e('0x16')](function(_0x42a97c){logger[_0x828e('0x12')](_0x828e('0xe'),_0x1c7417,_0x42a97c);_0x573bfb(_0x42a97c);});});}
\ No newline at end of file
+var _0xbf96=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird'];(function(_0x855caa,_0x5624fa){var _0x25488a=function(_0x4407bd){while(--_0x4407bd){_0x855caa['push'](_0x855caa['shift']());}};_0x25488a(++_0x5624fa);}(_0xbf96,0x1d8));var _0x6bf9=function(_0x4ec1bd,_0x2bd250){_0x4ec1bd=_0x4ec1bd-0x0;var _0x1ef159=_0xbf96[_0x4ec1bd];return _0x1ef159;};'use strict';var _=require('lodash');var util=require(_0x6bf9('0x0'));var moment=require(_0x6bf9('0x1'));var BPromise=require(_0x6bf9('0x2'));var rs=require(_0x6bf9('0x3'));var fs=require('fs');var Redis=require(_0x6bf9('0x4'));var db=require(_0x6bf9('0x5'))['db'];var utils=require(_0x6bf9('0x6'));var logger=require('../../config/logger')(_0x6bf9('0x7'));var config=require(_0x6bf9('0x8'));var jayson=require(_0x6bf9('0x9'));var client=jayson[_0x6bf9('0xa')]['http']({'port':0x232a});config[_0x6bf9('0xb')]=_[_0x6bf9('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6bf9('0xd'))[_0x6bf9('0xe')](socket);function respondWithRpcPromise(_0x40a630,_0x1017d9,_0x11bf0f){return new BPromise(function(_0x4e839a,_0x1468b4){return client[_0x6bf9('0xf')](_0x40a630,_0x11bf0f)[_0x6bf9('0x10')](function(_0x4bd9d2){logger[_0x6bf9('0x11')](_0x6bf9('0x12'),_0x1017d9,_0x6bf9('0x13'));logger['debug'](_0x6bf9('0x14'),_0x1017d9,_0x6bf9('0x13'),JSON['stringify'](_0x4bd9d2));if(_0x4bd9d2[_0x6bf9('0x15')]){if(_0x4bd9d2[_0x6bf9('0x15')][_0x6bf9('0x16')]===0x1f4){logger[_0x6bf9('0x15')](_0x6bf9('0x12'),_0x1017d9,_0x4bd9d2[_0x6bf9('0x15')]['message']);return _0x1468b4(_0x4bd9d2[_0x6bf9('0x15')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1017d9,_0x4bd9d2[_0x6bf9('0x15')]['message']);return _0x4e839a(_0x4bd9d2[_0x6bf9('0x15')][_0x6bf9('0x17')]);}else{logger[_0x6bf9('0x11')](_0x6bf9('0x12'),_0x1017d9,_0x6bf9('0x13'));_0x4e839a(_0x4bd9d2[_0x6bf9('0x18')]['message']);}})['catch'](function(_0x3b345f){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x1017d9,_0x3b345f);_0x1468b4(_0x3b345f);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e0cdcb3..72016cf 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 _0xc420=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0xc420,0x156));var _0x0c42=function(_0x40eadc,_0x37af8d){_0x40eadc=_0x40eadc-0x0;var _0x6963b4=_0xc420[_0x40eadc];return _0x6963b4;};'use strict';var ChatWebsiteEvents=require(_0x0c42('0x0'));var events=[_0x0c42('0x1'),_0x0c42('0x2'),'update'];function createListener(_0x560cb1,_0x377a9e){return function(_0x5cf9d6){_0x377a9e[_0x0c42('0x3')](_0x560cb1,_0x5cf9d6);};}function removeListener(_0x3d0032,_0x44efdd){return function(){ChatWebsiteEvents[_0x0c42('0x4')](_0x3d0032,_0x44efdd);};}exports[_0x0c42('0x5')]=function(_0x339210){for(var _0x1bd4ba=0x0,_0x2acf81=events[_0x0c42('0x6')];_0x1bd4ba<_0x2acf81;_0x1bd4ba++){var _0x170603=events[_0x1bd4ba];var _0x1ba181=createListener(_0x0c42('0x7')+_0x170603,_0x339210);ChatWebsiteEvents['on'](_0x170603,_0x1ba181);}};
\ No newline at end of file
+var _0xc2fb=['chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x4da73e,_0x328d03){var _0x483788=function(_0x332d02){while(--_0x332d02){_0x4da73e['push'](_0x4da73e['shift']());}};_0x483788(++_0x328d03);}(_0xc2fb,0x141));var _0xbc2f=function(_0x3d22f4,_0x2dcd7c){_0x3d22f4=_0x3d22f4-0x0;var _0x3bba0a=_0xc2fb[_0x3d22f4];return _0x3bba0a;};'use strict';var ChatWebsiteEvents=require(_0xbc2f('0x0'));var events=[_0xbc2f('0x1'),_0xbc2f('0x2'),'update'];function createListener(_0x234810,_0xa385d1){return function(_0x145479){_0xa385d1[_0xbc2f('0x3')](_0x234810,_0x145479);};}function removeListener(_0xb71daa,_0x54d39a){return function(){ChatWebsiteEvents[_0xbc2f('0x4')](_0xb71daa,_0x54d39a);};}exports[_0xbc2f('0x5')]=function(_0x1731dd){for(var _0x51db5b=0x0,_0x273f2c=events[_0xbc2f('0x6')];_0x51db5b<_0x273f2c;_0x51db5b++){var _0xb98d95=events[_0x51db5b];var _0x39bd7f=createListener(_0xbc2f('0x7')+_0xb98d95,_0x1731dd);ChatWebsiteEvents['on'](_0xb98d95,_0x39bd7f);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b81a7d1..9a2f9fd 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 _0xfe72=['isAuthenticated','index','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','%s-%s','now','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','/:id/offline','any','/:id/interactions','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','/:id','destroy','delete','removeDispositions','removeAgents','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get'];(function(_0x44dfea,_0x3a370e){var _0x5087ee=function(_0x49f066){while(--_0x49f066){_0x44dfea['push'](_0x44dfea['shift']());}};_0x5087ee(++_0x3a370e);}(_0xfe72,0x83));var _0x2fe7=function(_0x3bd041,_0xc4a1b1){_0x3bd041=_0x3bd041-0x0;var _0xf921fc=_0xfe72[_0x3bd041];return _0xf921fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2fe7('0x0'));var timeout=require(_0x2fe7('0x1'));var express=require(_0x2fe7('0x2'));var router=express['Router']();var fs_extra=require(_0x2fe7('0x3'));var auth=require(_0x2fe7('0x4'));var interaction=require(_0x2fe7('0x5'));var config=require(_0x2fe7('0x6'));var controller=require(_0x2fe7('0x7'));router[_0x2fe7('0x8')]('/',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xa')]);router[_0x2fe7('0x8')]('/describe',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xb')]);router[_0x2fe7('0x8')]('/:id',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0xc')]);router[_0x2fe7('0x8')](_0x2fe7('0xd'),auth['isAuthenticated'](),controller[_0x2fe7('0xe')]);router[_0x2fe7('0x8')](_0x2fe7('0xf'),auth[_0x2fe7('0x9')](),controller['getAnswers']);router[_0x2fe7('0x8')]('/:id/logo',controller['getLogo']);router[_0x2fe7('0x8')](_0x2fe7('0x10'),controller[_0x2fe7('0x11')]);router[_0x2fe7('0x8')](_0x2fe7('0x12'),controller['getCustomerAvatar']);router[_0x2fe7('0x8')](_0x2fe7('0x13'),controller[_0x2fe7('0x14')]);router[_0x2fe7('0x8')]('/:id/interactions',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x15')]);router[_0x2fe7('0x8')](_0x2fe7('0x16'),controller[_0x2fe7('0x17')]);router[_0x2fe7('0x8')](_0x2fe7('0x18'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x19')]);router[_0x2fe7('0x8')]('/:id/proactive_actions',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x1a')]);router[_0x2fe7('0x8')]('/:id/fields',controller[_0x2fe7('0x1b')]);router[_0x2fe7('0x8')](_0x2fe7('0x1c'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x1d')]);router[_0x2fe7('0x8')](_0x2fe7('0x1e'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x1f')]);router[_0x2fe7('0x20')]('/',auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x21')]);router['post'](_0x2fe7('0xd'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x22')]);router[_0x2fe7('0x20')](_0x2fe7('0xf'),auth[_0x2fe7('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x2fe7('0x23')]({'destination':function(_0x4b4a7d,_0x27d139,_0x470db1){_0x470db1(null,path[_0x2fe7('0x24')](config[_0x2fe7('0x25')],_0x2fe7('0x26')));},'filename':function(_0xaf79a1,_0x5845e8,_0x267362){_0x267362(null,util['format']('%s-%s',Date['now'](),_0x5845e8['originalname']));}})});router['post'](_0x2fe7('0x27'),upload[_0x2fe7('0x28')](_0x2fe7('0x29')),controller[_0x2fe7('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1df052,_0x311a85,_0x3c3579){_0x3c3579(null,path['join'](config[_0x2fe7('0x25')],_0x2fe7('0x2b')));},'filename':function(_0x12f713,_0x59136b,_0x34ec55){_0x34ec55(null,util[_0x2fe7('0x2c')](_0x2fe7('0x2d'),Date[_0x2fe7('0x2e')](),_0x59136b[_0x2fe7('0x2f')]));}})});router['post'](_0x2fe7('0x10'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x52a87e,_0x2d0f95,_0x3a4cb8){_0x3a4cb8(null,path['join'](config[_0x2fe7('0x25')],_0x2fe7('0x2b')));},'filename':function(_0x161103,_0x1743a5,_0x5bb6af){_0x5bb6af(null,util[_0x2fe7('0x2c')](_0x2fe7('0x2d'),Date['now'](),_0x1743a5[_0x2fe7('0x2f')]));}})});router[_0x2fe7('0x20')](_0x2fe7('0x12'),upload[_0x2fe7('0x28')](_0x2fe7('0x29')),controller[_0x2fe7('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x77d17d,_0x59f8ad,_0x11ff55){_0x11ff55(null,path[_0x2fe7('0x24')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x527b03,_0x108e36,_0x392be8){_0x392be8(null,util['format']('%s-%s',Date[_0x2fe7('0x2e')](),_0x108e36[_0x2fe7('0x2f')]));}})});router[_0x2fe7('0x20')](_0x2fe7('0x13'),upload[_0x2fe7('0x28')]('file'),controller[_0x2fe7('0x31')]);router['post'](_0x2fe7('0x32'),controller[_0x2fe7('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3a9577,_0x292787,_0x44b5e6){const _0xfafcd=path[_0x2fe7('0x24')](config['root'],'server/files',_0x2fe7('0x34'),_0x2fe7('0x35'));fs_extra[_0x2fe7('0x36')](_0xfafcd,function(){_0x44b5e6(null,_0xfafcd);});},'filename':function(_0x1b7151,_0x6c0c31,_0x30f7a6){const _0x3ff4d1=_0x6c0c31[_0x2fe7('0x2f')][_0x2fe7('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x37a14c=path['extname'](_0x3ff4d1);const _0x176c68=Date[_0x2fe7('0x2e')]()+'-'+_0x3ff4d1['replace'](_0x37a14c,'')+_0x37a14c;_0x30f7a6(null,_0x176c68);}})});router[_0x2fe7('0x20')](_0x2fe7('0x38'),offlineUploadMulter[_0x2fe7('0x39')](),controller['offline']);router[_0x2fe7('0x20')](_0x2fe7('0x3a'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x3b')]);router['post'](_0x2fe7('0x18'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x3c')]);router[_0x2fe7('0x20')](_0x2fe7('0x3d'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x3e')]);router['post'](_0x2fe7('0x1e'),auth[_0x2fe7('0x9')](),controller['addAgents']);router[_0x2fe7('0x3f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2fe7('0x40'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x41')]);router[_0x2fe7('0x42')](_0x2fe7('0xd'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x43')]);router[_0x2fe7('0x42')](_0x2fe7('0xf'),auth[_0x2fe7('0x9')](),controller['removeAnswers']);router[_0x2fe7('0x42')](_0x2fe7('0x1e'),auth[_0x2fe7('0x9')](),controller[_0x2fe7('0x44')]);module[_0x2fe7('0x45')]=router;
\ No newline at end of file
+var _0x3abe=['removeAnswers','/:id/users','removeAgents','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','index','get','/describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','server/files/images/avatars/','file','addAvatar','single','addSystemAvatar','/:id/notify','notify','attachments','ensureDir','/:id/offline','offline','addInteraction','addApplications','addProactiveActions','addAgents','/:id','update','destroy','delete'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0x3abe,0x19c));var _0xe3ab=function(_0x59bd9c,_0x16661d){_0x59bd9c=_0x59bd9c-0x0;var _0x305d18=_0x3abe[_0x59bd9c];return _0x305d18;};'use strict';var multer=require(_0xe3ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe3ab('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe3ab('0x2'));var auth=require(_0xe3ab('0x3'));var interaction=require(_0xe3ab('0x4'));var config=require('../../config/environment');var controller=require(_0xe3ab('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xe3ab('0x6')]);router[_0xe3ab('0x7')](_0xe3ab('0x8'),auth[_0xe3ab('0x9')](),controller['describe']);router[_0xe3ab('0x7')]('/:id',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0xa')]);router[_0xe3ab('0x7')](_0xe3ab('0xb'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0xc')]);router['get'](_0xe3ab('0xd'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0xe')]);router[_0xe3ab('0x7')](_0xe3ab('0xf'),controller[_0xe3ab('0x10')]);router['get'](_0xe3ab('0x11'),controller[_0xe3ab('0x12')]);router[_0xe3ab('0x7')](_0xe3ab('0x13'),controller[_0xe3ab('0x14')]);router[_0xe3ab('0x7')](_0xe3ab('0x15'),controller[_0xe3ab('0x16')]);router[_0xe3ab('0x7')](_0xe3ab('0x17'),auth[_0xe3ab('0x9')](),controller['getInteractions']);router[_0xe3ab('0x7')](_0xe3ab('0x18'),controller['getSnippet']);router[_0xe3ab('0x7')](_0xe3ab('0x19'),auth['isAuthenticated'](),controller[_0xe3ab('0x1a')]);router['get'](_0xe3ab('0x1b'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x1c')]);router[_0xe3ab('0x7')](_0xe3ab('0x1d'),controller[_0xe3ab('0x1e')]);router[_0xe3ab('0x7')]('/:id/offline_messages',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x1f')]);router[_0xe3ab('0x7')]('/:id/users',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x20')]);router[_0xe3ab('0x21')]('/',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x22')]);router[_0xe3ab('0x21')]('/:id/dispositions',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x23')]);router[_0xe3ab('0x21')](_0xe3ab('0xd'),auth['isAuthenticated'](),controller[_0xe3ab('0x24')]);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0xa6091f,_0x5664bf,_0x3ee296){_0x3ee296(null,path[_0xe3ab('0x26')](config[_0xe3ab('0x27')],_0xe3ab('0x28')));},'filename':function(_0x59f579,_0x5dd873,_0x3524d7){_0x3524d7(null,util[_0xe3ab('0x29')](_0xe3ab('0x2a'),Date[_0xe3ab('0x2b')](),_0x5dd873[_0xe3ab('0x2c')]));}})});router[_0xe3ab('0x21')](_0xe3ab('0xf'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0x32be26,_0x1f37e1,_0x23a6cc){_0x23a6cc(null,path[_0xe3ab('0x26')](config[_0xe3ab('0x27')],_0xe3ab('0x2d')));},'filename':function(_0x1e257c,_0x57c660,_0x3f0cf6){_0x3f0cf6(null,util[_0xe3ab('0x29')](_0xe3ab('0x2a'),Date[_0xe3ab('0x2b')](),_0x57c660[_0xe3ab('0x2c')]));}})});router['post']('/:id/avatar',upload['single'](_0xe3ab('0x2e')),controller[_0xe3ab('0x2f')]);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0x4641d3,_0x4a5485,_0x5ef298){_0x5ef298(null,path[_0xe3ab('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x763741,_0xcb1623,_0x5b96eb){_0x5b96eb(null,util[_0xe3ab('0x29')](_0xe3ab('0x2a'),Date[_0xe3ab('0x2b')](),_0xcb1623[_0xe3ab('0x2c')]));}})});router[_0xe3ab('0x21')](_0xe3ab('0x13'),upload[_0xe3ab('0x30')](_0xe3ab('0x2e')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xe3ab('0x25')]({'destination':function(_0x4fb2c6,_0x458fc2,_0x5304b0){_0x5304b0(null,path['join'](config[_0xe3ab('0x27')],'server/files/images/avatars/'));},'filename':function(_0x47ecd5,_0x5b675a,_0x1ceac7){_0x1ceac7(null,util[_0xe3ab('0x29')]('%s-%s',Date[_0xe3ab('0x2b')](),_0x5b675a['originalname']));}})});router[_0xe3ab('0x21')](_0xe3ab('0x15'),upload[_0xe3ab('0x30')](_0xe3ab('0x2e')),controller[_0xe3ab('0x31')]);router[_0xe3ab('0x21')](_0xe3ab('0x32'),controller[_0xe3ab('0x33')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x3d9350,_0x161d00,_0x2e91d9){const _0x1ce654=path[_0xe3ab('0x26')](config[_0xe3ab('0x27')],'server/files',_0xe3ab('0x34'),'offline-chat');fs_extra[_0xe3ab('0x35')](_0x1ce654,function(){_0x2e91d9(null,_0x1ce654);});},'filename':function(_0x2d265b,_0x357a37,_0x2d72da){const _0x8cacaa=_0x357a37['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a64e4=path['extname'](_0x8cacaa);const _0x4b353a=Date[_0xe3ab('0x2b')]()+'-'+_0x8cacaa['replace'](_0x4a64e4,'')+_0x4a64e4;_0x2d72da(null,_0x4b353a);}})});router[_0xe3ab('0x21')](_0xe3ab('0x36'),offlineUploadMulter['any'](),controller[_0xe3ab('0x37')]);router[_0xe3ab('0x21')](_0xe3ab('0x17'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x38')]);router[_0xe3ab('0x21')]('/:id/applications',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x39')]);router[_0xe3ab('0x21')]('/:id/proactive_actions',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x3a')]);router[_0xe3ab('0x21')]('/:id/users',auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x3b')]);router['put'](_0xe3ab('0x3c'),auth['isAuthenticated'](),controller[_0xe3ab('0x3d')]);router['delete'](_0xe3ab('0x3c'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x3e')]);router[_0xe3ab('0x3f')](_0xe3ab('0xb'),auth[_0xe3ab('0x9')](),controller['removeDispositions']);router[_0xe3ab('0x3f')](_0xe3ab('0xd'),auth['isAuthenticated'](),controller[_0xe3ab('0x40')]);router['delete'](_0xe3ab('0x41'),auth[_0xe3ab('0x9')](),controller[_0xe3ab('0x42')]);module[_0xe3ab('0x43')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 90407b0..18e50e6 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 _0xb234=['STRING','sequelize','exports','ENUM','AmazonAWS','Google'];(function(_0x5ecbe8,_0x42522f){var _0x1c6e21=function(_0x593f92){while(--_0x593f92){_0x5ecbe8['push'](_0x5ecbe8['shift']());}};_0x1c6e21(++_0x42522f);}(_0xb234,0x13f));var _0x4b23=function(_0xa49733,_0x3c465d){_0xa49733=_0xa49733-0x0;var _0x2084fb=_0xb234[_0xa49733];return _0x2084fb;};'use strict';var Sequelize=require(_0x4b23('0x0'));module[_0x4b23('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4b23('0x2')](_0x4b23('0x3'),_0x4b23('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x4b23('0x5')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdc59=['sequelize','exports','STRING','Google'];(function(_0x483cec,_0x2ccfda){var _0xa1147f=function(_0x4fff48){while(--_0x4fff48){_0x483cec['push'](_0x483cec['shift']());}};_0xa1147f(++_0x2ccfda);}(_0xdc59,0x12c));var _0x9dc5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xdc59[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0x9dc5('0x0'));module[_0x9dc5('0x1')]={'name':{'type':Sequelize[_0x9dc5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x9dc5('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9dc5('0x2')]},'data2':{'type':Sequelize[_0x9dc5('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index b02934a..32ca98e 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(_0x3a8077,_0x13fd8f){var _0x3301d8=function(_0x330421){while(--_0x330421){_0x3a8077['push'](_0x3a8077['shift']());}};_0x3301d8(++_0x13fd8f);}(_0x2ef3,0xba));var _0x32ef=function(_0xbdb771,_0x4d845b){_0xbdb771=_0xbdb771-0x0;var _0x4baab6=_0x2ef3[_0xbdb771];return _0x4baab6;};'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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x845027,_0x1bbaf3){var _0x449735=function(_0x3a28b7){while(--_0x3a28b7){_0x845027['push'](_0x845027['shift']());}};_0x449735(++_0x1bbaf3);}(_0x7a54,0x106));var _0x47a5=function(_0x535b81,_0x23b191){_0x535b81=_0x535b81-0x0;var _0xcbd02d=_0x7a54[_0x535b81];return _0xcbd02d;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 2e68990..06e2580 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 _0xc1f7=['CloudProvider','cloud_providers','lodash','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xc1f7,0xda));var _0x7c1f=function(_0x55fd26,_0x53ce4f){_0x55fd26=_0x55fd26-0x0;var _0x3dfb52=_0xc1f7[_0x55fd26];return _0x3dfb52;};'use strict';var _=require(_0x7c1f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7c1f('0x1'));var BPromise=require(_0x7c1f('0x2'));var rp=require(_0x7c1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c1f('0x4'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x7c1f('0x5')]=function(_0x5c8b73,_0x3bca99){return _0x5c8b73[_0x7c1f('0x6')](_0x7c1f('0x7'),attributes,{'tableName':_0x7c1f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9016=['path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d4d04,_0x17cc3e){var _0x24620d=function(_0x72c5fb){while(--_0x72c5fb){_0x1d4d04['push'](_0x1d4d04['shift']());}};_0x24620d(++_0x17cc3e);}(_0x9016,0x1b6));var _0x6901=function(_0x31debc,_0x3eedad){_0x31debc=_0x31debc-0x0;var _0x16b31a=_0x9016[_0x31debc];return _0x16b31a;};'use strict';var _=require('lodash');var util=require(_0x6901('0x0'));var logger=require(_0x6901('0x1'))(_0x6901('0x2'));var moment=require(_0x6901('0x3'));var BPromise=require(_0x6901('0x4'));var rp=require(_0x6901('0x5'));var fs=require('fs');var path=require(_0x6901('0x6'));var rimraf=require('rimraf');var config=require(_0x6901('0x7'));var attributes=require(_0x6901('0x8'));module[_0x6901('0x9')]=function(_0x2b251c,_0xaddc95){return _0x2b251c[_0x6901('0xa')](_0x6901('0xb'),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 ccfab60..fb82166 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 _0x7e27=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x650d07,_0xacc99e){var _0x5f5737=function(_0x5c83c2){while(--_0x5c83c2){_0x650d07['push'](_0x650d07['shift']());}};_0x5f5737(++_0xacc99e);}(_0x7e27,0xdd));var _0x77e2=function(_0x2acca6,_0x43dfc7){_0x2acca6=_0x2acca6-0x0;var _0x385d27=_0x7e27[_0x2acca6];return _0x385d27;};'use strict';var _=require(_0x77e2('0x0'));var util=require(_0x77e2('0x1'));var moment=require('moment');var BPromise=require(_0x77e2('0x2'));var rs=require(_0x77e2('0x3'));var fs=require('fs');var Redis=require(_0x77e2('0x4'));var db=require(_0x77e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77e2('0x6'))(_0x77e2('0x7'));var config=require(_0x77e2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x77e2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x101e56,_0x137a61,_0x502153){return new BPromise(function(_0x3c2b3f,_0x2cdfa3){return client[_0x77e2('0xa')](_0x101e56,_0x502153)[_0x77e2('0xb')](function(_0x3802ce){logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');logger['debug'](_0x77e2('0xe'),_0x137a61,'request\x20sent',JSON[_0x77e2('0xf')](_0x3802ce));if(_0x3802ce[_0x77e2('0x10')]){if(_0x3802ce['error']['code']===0x1f4){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce['error'][_0x77e2('0x11')]);return _0x2cdfa3(_0x3802ce['error']['message']);}logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x3802ce[_0x77e2('0x10')][_0x77e2('0x11')]);return _0x3c2b3f(_0x3802ce[_0x77e2('0x10')]['message']);}else{logger[_0x77e2('0xc')](_0x77e2('0xd'),_0x137a61,'request\x20sent');_0x3c2b3f(_0x3802ce[_0x77e2('0x12')][_0x77e2('0x11')]);}})[_0x77e2('0x13')](function(_0x1352c1){logger[_0x77e2('0x10')](_0x77e2('0xd'),_0x137a61,_0x1352c1);_0x2cdfa3(_0x1352c1);});});}
\ No newline at end of file
+var _0x457b=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x3c920d,_0x4aab37){var _0x4891e0=function(_0x3dea11){while(--_0x3dea11){_0x3c920d['push'](_0x3c920d['shift']());}};_0x4891e0(++_0x4aab37);}(_0x457b,0xca));var _0xb457=function(_0x19e57f,_0x4ae750){_0x19e57f=_0x19e57f-0x0;var _0x469556=_0x457b[_0x19e57f];return _0x469556;};'use strict';var _=require(_0xb457('0x0'));var util=require(_0xb457('0x1'));var moment=require('moment');var BPromise=require(_0xb457('0x2'));var rs=require(_0xb457('0x3'));var fs=require('fs');var Redis=require(_0xb457('0x4'));var db=require(_0xb457('0x5'))['db'];var utils=require(_0xb457('0x6'));var logger=require('../../config/logger')(_0xb457('0x7'));var config=require(_0xb457('0x8'));var jayson=require(_0xb457('0x9'));var client=jayson[_0xb457('0xa')][_0xb457('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x523e05,_0x5b8ba2,_0x13632b){return new BPromise(function(_0x2182d6,_0x48388c){return client['request'](_0x523e05,_0x13632b)[_0xb457('0xc')](function(_0x3baee8){logger[_0xb457('0xd')](_0xb457('0xe'),_0x5b8ba2,_0xb457('0xf'));logger[_0xb457('0x10')](_0xb457('0x11'),_0x5b8ba2,_0xb457('0xf'),JSON[_0xb457('0x12')](_0x3baee8));if(_0x3baee8[_0xb457('0x13')]){if(_0x3baee8[_0xb457('0x13')][_0xb457('0x14')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);return _0x48388c(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}logger[_0xb457('0x13')]('CloudProvider,\x20%s,\x20%s',_0x5b8ba2,_0x3baee8['error'][_0xb457('0x15')]);return _0x2182d6(_0x3baee8[_0xb457('0x13')][_0xb457('0x15')]);}else{logger[_0xb457('0xd')]('CloudProvider,\x20%s,\x20%s',_0x5b8ba2,_0xb457('0xf'));_0x2182d6(_0x3baee8[_0xb457('0x16')][_0xb457('0x15')]);}})[_0xb457('0x17')](function(_0x250a02){logger[_0xb457('0x13')](_0xb457('0xe'),_0x5b8ba2,_0x250a02);_0x48388c(_0x250a02);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index df8ad9c..008fafe 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 _0x6c0c=['delete','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x6c0c,0x18f));var _0xc6c0=function(_0x1c5266,_0x49986c){_0x1c5266=_0x1c5266-0x0;var _0x52b115=_0x6c0c[_0x1c5266];return _0x52b115;};'use strict';var multer=require(_0xc6c0('0x0'));var util=require(_0xc6c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc6c0('0x2'));var router=express['Router']();var fs_extra=require(_0xc6c0('0x3'));var auth=require(_0xc6c0('0x4'));var interaction=require(_0xc6c0('0x5'));var config=require(_0xc6c0('0x6'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0xc6c0('0x7')](),controller[_0xc6c0('0x8')]);router[_0xc6c0('0x9')](_0xc6c0('0xa'),auth[_0xc6c0('0x7')](),controller[_0xc6c0('0xb')]);router[_0xc6c0('0xc')]('/',auth[_0xc6c0('0x7')](),controller[_0xc6c0('0xd')]);router['put']('/:id',auth[_0xc6c0('0x7')](),controller[_0xc6c0('0xe')]);router[_0xc6c0('0xf')](_0xc6c0('0xa'),auth[_0xc6c0('0x7')](),controller[_0xc6c0('0x10')]);module[_0xc6c0('0x11')]=router;
\ No newline at end of file
+var _0xe021=['path','connect-timeout','../../components/auth/service','../../config/environment','./cloudProvider.controller','index','get','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe021,0x10e));var _0x1e02=function(_0x251260,_0x9c45a5){_0x251260=_0x251260-0x0;var _0xf09928=_0xe021[_0x251260];return _0xf09928;};'use strict';var multer=require(_0x1e02('0x0'));var util=require(_0x1e02('0x1'));var path=require(_0x1e02('0x2'));var timeout=require(_0x1e02('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1e02('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1e02('0x5'));var controller=require(_0x1e02('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e02('0x7')]);router[_0x1e02('0x8')]('/:id',auth[_0x1e02('0x9')](),controller[_0x1e02('0xa')]);router[_0x1e02('0xb')]('/',auth['isAuthenticated'](),controller[_0x1e02('0xc')]);router[_0x1e02('0xd')](_0x1e02('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1e02('0xe'),auth[_0x1e02('0x9')](),controller[_0x1e02('0xf')]);module[_0x1e02('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2d87f6e..66372e2 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 _0xe62a=['exports','STRING','name','sequelize'];(function(_0x10504e,_0x4e282d){var _0x339624=function(_0x372c9c){while(--_0x372c9c){_0x10504e['push'](_0x10504e['shift']());}};_0x339624(++_0x4e282d);}(_0xe62a,0x16b));var _0xae62=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe62a[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xae62('0x0'));module[_0xae62('0x1')]={'name':{'type':Sequelize[_0xae62('0x2')],'unique':_0xae62('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xae62('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xae62('0x2')]},'fax':{'type':Sequelize[_0xae62('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xae62('0x2')]},'city':{'type':Sequelize[_0xae62('0x2')]},'country':{'type':Sequelize[_0xae62('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xae62('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xae62('0x2')]},'description':{'type':Sequelize[_0xae62('0x2')]}};
\ No newline at end of file
+var _0x6b9d=['name','sequelize','exports','STRING'];(function(_0x5d2da5,_0x44c684){var _0x46df8c=function(_0xec9e01){while(--_0xec9e01){_0x5d2da5['push'](_0x5d2da5['shift']());}};_0x46df8c(++_0x44c684);}(_0x6b9d,0xed));var _0xd6b9=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0x6b9d[_0x57dc85];return _0x563a2e;};'use strict';var Sequelize=require(_0xd6b9('0x0'));module[_0xd6b9('0x1')]={'name':{'type':Sequelize[_0xd6b9('0x2')],'unique':_0xd6b9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xd6b9('0x2')]},'companyId':{'type':Sequelize[_0xd6b9('0x2')]},'website':{'type':Sequelize[_0xd6b9('0x2')]},'phone':{'type':Sequelize[_0xd6b9('0x2')]},'fax':{'type':Sequelize[_0xd6b9('0x2')]},'type':{'type':Sequelize[_0xd6b9('0x2')]},'street':{'type':Sequelize[_0xd6b9('0x2')]},'postalCode':{'type':Sequelize[_0xd6b9('0x2')]},'city':{'type':Sequelize[_0xd6b9('0x2')]},'country':{'type':Sequelize[_0xd6b9('0x2')]},'email':{'type':Sequelize[_0xd6b9('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xd6b9('0x2')]},'sPostalCode':{'type':Sequelize[_0xd6b9('0x2')]},'sCity':{'type':Sequelize[_0xd6b9('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd6b9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 1aaaafd..9d147d3 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 _0x53c2=['options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','rawAttributes','sort','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','end','error','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','nolimit','order','where','pick','filters','map','filter','merge'];(function(_0xb789ef,_0x1b2701){var _0x57d304=function(_0x5c0b53){while(--_0x5c0b53){_0xb789ef['push'](_0xb789ef['shift']());}};_0x57d304(++_0x1b2701);}(_0x53c2,0x122));var _0x253c=function(_0xbd8d83,_0x1451ff){_0xbd8d83=_0xbd8d83-0x0;var _0x21b6bf=_0x53c2[_0xbd8d83];return _0x21b6bf;};'use strict';var emlformat=require(_0x253c('0x0'));var rimraf=require(_0x253c('0x1'));var zipdir=require(_0x253c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x253c('0x3'));var moment=require(_0x253c('0x4'));var BPromise=require(_0x253c('0x5'));var Mustache=require(_0x253c('0x6'));var util=require(_0x253c('0x7'));var path=require(_0x253c('0x8'));var sox=require(_0x253c('0x9'));var csv=require(_0x253c('0xa'));var ejs=require(_0x253c('0xb'));var fs=require('fs');var fs_extra=require(_0x253c('0xc'));var _=require(_0x253c('0xd'));var squel=require(_0x253c('0xe'));var crypto=require(_0x253c('0xf'));var jsforce=require(_0x253c('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x253c('0x11'));var Redis=require('ioredis');var authService=require(_0x253c('0x12'));var qs=require(_0x253c('0x13'));var as=require(_0x253c('0x14'));var hardwareService=require(_0x253c('0x15'));var logger=require('../../config/logger')(_0x253c('0x16'));var utils=require('../../config/utils');var config=require(_0x253c('0x17'));var licenseUtil=require(_0x253c('0x18'));var db=require(_0x253c('0x19'))['db'];function respondWithStatusCode(_0x638b51,_0x362c0c){_0x362c0c=_0x362c0c||0xcc;return function(_0x1b74d8){if(_0x1b74d8){return _0x638b51[_0x253c('0x1a')](_0x362c0c);}return _0x638b51[_0x253c('0x1b')](_0x362c0c)['end']();};}function respondWithResult(_0x355b72,_0x5e20be){_0x5e20be=_0x5e20be||0xc8;return function(_0x167cc9){if(_0x167cc9){return _0x355b72[_0x253c('0x1b')](_0x5e20be)[_0x253c('0x1c')](_0x167cc9);}};}function respondWithFilteredResult(_0x31ea08,_0x4cd3c8){return function(_0x3d9a32){if(_0x3d9a32){var _0x498935=typeof _0x4cd3c8[_0x253c('0x1d')]===_0x253c('0x1e')&&typeof _0x4cd3c8['limit']===_0x253c('0x1e');var _0x543026=_0x3d9a32[_0x253c('0x1f')];var _0x48b8b9=_0x498935?0x0:_0x4cd3c8[_0x253c('0x1d')];var _0x370c6e=_0x498935?_0x3d9a32[_0x253c('0x1f')]:_0x4cd3c8[_0x253c('0x1d')]+_0x4cd3c8[_0x253c('0x20')];var _0x172cc6;if(_0x370c6e>=_0x543026){_0x370c6e=_0x543026;_0x172cc6=0xc8;}else{_0x172cc6=0xce;}_0x31ea08[_0x253c('0x1b')](_0x172cc6);return _0x31ea08[_0x253c('0x21')](_0x253c('0x22'),_0x48b8b9+'-'+_0x370c6e+'/'+_0x543026)['json'](_0x3d9a32);}return null;};}function patchUpdates(_0x2168ff){return function(_0x112295){try{jsonpatch[_0x253c('0x23')](_0x112295,_0x2168ff,!![]);}catch(_0x3329ee){return BPromise[_0x253c('0x24')](_0x3329ee);}return _0x112295['save']();};}function saveUpdates(_0x4b293d,_0xe21392){return function(_0x15eb73){if(_0x15eb73){return _0x15eb73['update'](_0x4b293d)[_0x253c('0x25')](function(_0x28189d){return _0x28189d;});}return null;};}function removeEntity(_0x1fed74,_0x5b53e8){return function(_0x9b908){if(_0x9b908){return _0x9b908[_0x253c('0x26')]()[_0x253c('0x25')](function(){var _0x243acf=_0x9b908[_0x253c('0x27')]({'plain':!![]});var _0x38d9d3=_0x253c('0x28');return db[_0x253c('0x29')][_0x253c('0x26')]({'where':{'type':_0x38d9d3,'resourceId':_0x243acf['id']}})[_0x253c('0x25')](function(){return _0x9b908;});})['then'](function(){_0x1fed74['status'](0xcc)[_0x253c('0x2a')]();});}};}function handleEntityNotFound(_0x211659,_0x4519bf){return function(_0x173ac7){if(!_0x173ac7){_0x211659['sendStatus'](0x194);}return _0x173ac7;};}function handleError(_0x4cff1b,_0x5aafaf){_0x5aafaf=_0x5aafaf||0x1f4;return function(_0x19da89){logger[_0x253c('0x2b')](_0x19da89['stack']);if(_0x19da89[_0x253c('0x2c')]){delete _0x19da89[_0x253c('0x2c')];}_0x4cff1b[_0x253c('0x1b')](_0x5aafaf)[_0x253c('0x2d')](_0x19da89);};}exports['index']=function(_0x310d36,_0xb55b4a){var _0x59a187={},_0x3b35c7={},_0x313e8f={'count':0x0,'rows':[]};return db[_0x253c('0x2e')][_0x253c('0x2f')]()['then'](function(_0x527340){_0x3b35c7[_0x253c('0x30')]=_[_0x253c('0x31')](_0x527340);_0x3b35c7[_0x253c('0x32')]=_[_0x253c('0x31')](_0x310d36[_0x253c('0x32')]);_0x3b35c7['filters']=_[_0x253c('0x33')](_0x3b35c7[_0x253c('0x30')],_0x3b35c7[_0x253c('0x32')]);_0x59a187[_0x253c('0x34')]=_[_0x253c('0x33')](_0x3b35c7[_0x253c('0x30')],qs[_0x253c('0x35')](_0x310d36['query'][_0x253c('0x35')]));_0x59a187[_0x253c('0x34')]=_0x59a187['attributes']['length']?_0x59a187[_0x253c('0x34')]:_0x3b35c7[_0x253c('0x30')];if(!_0x310d36[_0x253c('0x32')]['hasOwnProperty'](_0x253c('0x36'))){_0x59a187['limit']=qs[_0x253c('0x20')](_0x310d36[_0x253c('0x32')][_0x253c('0x20')]);_0x59a187[_0x253c('0x1d')]=qs[_0x253c('0x1d')](_0x310d36[_0x253c('0x32')][_0x253c('0x1d')]);}_0x59a187[_0x253c('0x37')]=qs['sort'](_0x310d36[_0x253c('0x32')]['sort']);_0x59a187[_0x253c('0x38')]=qs['filters'](_[_0x253c('0x39')](_0x310d36[_0x253c('0x32')],_0x3b35c7[_0x253c('0x3a')]),_0x527340);if(_0x310d36[_0x253c('0x32')]['filter']){_0x59a187[_0x253c('0x38')]=_['merge'](_0x59a187[_0x253c('0x38')],{'$or':_[_0x253c('0x3b')](_0x59a187[_0x253c('0x34')],function(_0xa52b11){var _0x56a7f9={};_0x56a7f9[_0xa52b11]={'$like':'%'+_0x310d36[_0x253c('0x32')][_0x253c('0x3c')]+'%'};return _0x56a7f9;})});}_0x59a187=_[_0x253c('0x3d')]({},_0x59a187,_0x310d36[_0x253c('0x3e')]);var _0x323978={'where':_0x59a187[_0x253c('0x38')]};return db['CmCompany'][_0x253c('0x1f')](_0x323978)[_0x253c('0x25')](function(_0x43cfa7){_0x313e8f[_0x253c('0x1f')]=_0x43cfa7;if(_0x310d36[_0x253c('0x32')][_0x253c('0x3f')]){_0x59a187[_0x253c('0x40')]=[{'all':!![]}];}return db[_0x253c('0x2e')][_0x253c('0x41')](_0x59a187);})['then'](function(_0x9389ef){_0x313e8f[_0x253c('0x42')]=_0x9389ef;return _0x313e8f;})[_0x253c('0x25')](respondWithFilteredResult(_0xb55b4a,_0x59a187))[_0x253c('0x43')](handleError(_0xb55b4a,null));})[_0x253c('0x43')](handleError(_0xb55b4a,null));};exports[_0x253c('0x44')]=function(_0x3405ae,_0x32f239){var _0x5c7f4f={'raw':![],'where':{'id':_0x3405ae[_0x253c('0x45')]['id']}},_0x47d9d1={};_0x47d9d1[_0x253c('0x30')]=_[_0x253c('0x31')](db[_0x253c('0x2e')]['rawAttributes']);_0x47d9d1[_0x253c('0x32')]=_['keys'](_0x3405ae['query']);_0x47d9d1[_0x253c('0x3a')]=_[_0x253c('0x33')](_0x47d9d1['model'],_0x47d9d1[_0x253c('0x32')]);_0x5c7f4f[_0x253c('0x34')]=_[_0x253c('0x33')](_0x47d9d1[_0x253c('0x30')],qs[_0x253c('0x35')](_0x3405ae['query'][_0x253c('0x35')]));_0x5c7f4f[_0x253c('0x34')]=_0x5c7f4f[_0x253c('0x34')][_0x253c('0x46')]?_0x5c7f4f['attributes']:_0x47d9d1[_0x253c('0x30')];if(_0x3405ae[_0x253c('0x32')][_0x253c('0x3f')]){_0x5c7f4f[_0x253c('0x40')]=[{'all':!![]}];}_0x5c7f4f=_[_0x253c('0x3d')]({},_0x5c7f4f,_0x3405ae[_0x253c('0x3e')]);return db[_0x253c('0x2e')]['find'](_0x5c7f4f)[_0x253c('0x25')](handleEntityNotFound(_0x32f239,null))['then'](respondWithResult(_0x32f239,null))[_0x253c('0x43')](handleError(_0x32f239,null));};exports['create']=function(_0xe92478,_0x45407e){return db[_0x253c('0x2e')][_0x253c('0x47')](_0xe92478[_0x253c('0x48')],{})[_0x253c('0x25')](function(_0x1a1ea1){var _0x971d94=_0xe92478[_0x253c('0x49')]['get']({'plain':!![]});if(!_0x971d94)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x971d94[_0x253c('0x4a')]===_0x253c('0x49')){var _0x12f84c=_0x1a1ea1['get']({'plain':!![]});var _0x3207ff=_0x253c('0x28');return db[_0x253c('0x4b')][_0x253c('0x4c')]({'where':{'name':_0x3207ff,'userProfileId':_0x971d94[_0x253c('0x4d')]},'raw':!![]})['then'](function(_0x13a982){if(_0x13a982&&_0x13a982[_0x253c('0x4e')]===0x0){return db[_0x253c('0x29')][_0x253c('0x47')]({'name':_0x12f84c['name'],'resourceId':_0x12f84c['id'],'type':_0x13a982[_0x253c('0x2c')],'sectionId':_0x13a982['id']},{})['then'](function(){return _0x1a1ea1;});}else{return _0x1a1ea1;}})[_0x253c('0x43')](function(_0x4c2567){logger['error'](_0x253c('0x4f'),_0x4c2567);throw _0x4c2567;});}return _0x1a1ea1;})[_0x253c('0x25')](respondWithResult(_0x45407e,0xc9))[_0x253c('0x43')](handleError(_0x45407e,null));};exports['update']=function(_0x117648,_0x51dd2d){if(_0x117648['body']['id']){delete _0x117648[_0x253c('0x48')]['id'];}return db[_0x253c('0x2e')]['find']({'where':{'id':_0x117648['params']['id']}})[_0x253c('0x25')](handleEntityNotFound(_0x51dd2d,null))[_0x253c('0x25')](saveUpdates(_0x117648[_0x253c('0x48')],null))[_0x253c('0x25')](respondWithResult(_0x51dd2d,null))['catch'](handleError(_0x51dd2d,null));};exports[_0x253c('0x26')]=function(_0x28ae8d,_0x17a4f1){return db[_0x253c('0x2e')][_0x253c('0x4c')]({'where':{'id':_0x28ae8d[_0x253c('0x45')]['id']}})['then'](handleEntityNotFound(_0x17a4f1,null))[_0x253c('0x25')](removeEntity(_0x17a4f1,null))['catch'](handleError(_0x17a4f1,null));};exports[_0x253c('0x2f')]=function(_0x440cb6,_0x5dbf76){return db[_0x253c('0x2e')]['describe']()['then'](respondWithResult(_0x5dbf76,null))[_0x253c('0x43')](handleError(_0x5dbf76,null));};exports[_0x253c('0x50')]=function(_0x4d5fc2,_0x50de1f,_0x33f8b8){return db[_0x253c('0x51')]['find']({'where':{'id':_0x4d5fc2[_0x253c('0x45')]['id']}})['then'](handleEntityNotFound(_0x50de1f,null))[_0x253c('0x25')](function(_0x3b3a4e){if(_0x3b3a4e){return _0x3b3a4e[_0x253c('0x50')](_0x4d5fc2[_0x253c('0x48')][_0x253c('0x52')],_[_0x253c('0x53')](_0x4d5fc2[_0x253c('0x48')],[_0x253c('0x52'),'id'])||{});}})[_0x253c('0x25')](respondWithResult(_0x50de1f,null))[_0x253c('0x43')](handleError(_0x50de1f,null));};exports[_0x253c('0x54')]=function(_0x480aa5,_0x380f5b,_0x2c41e1){var _0x2905b7={};var _0x2e657f={};var _0x55ba58;var _0x34f479;return db[_0x253c('0x2e')][_0x253c('0x55')]({'where':{'id':_0x480aa5[_0x253c('0x45')]['id']}})['then'](handleEntityNotFound(_0x380f5b,null))[_0x253c('0x25')](function(_0x517ed7){if(_0x517ed7){_0x55ba58=_0x517ed7;_0x2e657f[_0x253c('0x30')]=_[_0x253c('0x31')](db[_0x253c('0x51')][_0x253c('0x56')]);_0x2e657f[_0x253c('0x32')]=_[_0x253c('0x31')](_0x480aa5[_0x253c('0x32')]);_0x2e657f[_0x253c('0x3a')]=_[_0x253c('0x33')](_0x2e657f[_0x253c('0x30')],_0x2e657f[_0x253c('0x32')]);_0x2905b7['attributes']=_[_0x253c('0x33')](_0x2e657f[_0x253c('0x30')],qs[_0x253c('0x35')](_0x480aa5[_0x253c('0x32')][_0x253c('0x35')]));_0x2905b7[_0x253c('0x34')]=_0x2905b7['attributes'][_0x253c('0x46')]?_0x2905b7[_0x253c('0x34')]:_0x2e657f[_0x253c('0x30')];_0x2905b7[_0x253c('0x37')]=qs[_0x253c('0x57')](_0x480aa5['query'][_0x253c('0x57')]);_0x2905b7[_0x253c('0x38')]=qs[_0x253c('0x3a')](_[_0x253c('0x39')](_0x480aa5[_0x253c('0x32')],_0x2e657f[_0x253c('0x3a')]));if(_0x480aa5[_0x253c('0x32')]['filter']){_0x2905b7[_0x253c('0x38')]=_['merge'](_0x2905b7[_0x253c('0x38')],{'$or':_['map'](_0x2905b7['attributes'],function(_0x40350a){var _0x29601f={};_0x29601f[_0x40350a]={'$like':'%'+_0x480aa5['query'][_0x253c('0x3c')]+'%'};return _0x29601f;})});}_0x2905b7=_[_0x253c('0x3d')]({},_0x2905b7,_0x480aa5[_0x253c('0x3e')]);return _0x55ba58['getContacts'](_0x2905b7);}})['then'](function(_0x5c8d55){if(_0x5c8d55){_0x34f479=_0x5c8d55[_0x253c('0x46')];if(!_0x480aa5[_0x253c('0x32')]['hasOwnProperty']('nolimit')){_0x2905b7[_0x253c('0x20')]=qs[_0x253c('0x20')](_0x480aa5[_0x253c('0x32')][_0x253c('0x20')]);_0x2905b7[_0x253c('0x1d')]=qs['offset'](_0x480aa5[_0x253c('0x32')][_0x253c('0x1d')]);}return _0x55ba58[_0x253c('0x54')](_0x2905b7);}})['then'](function(_0x5b0967){if(_0x5b0967){return _0x5b0967?{'count':_0x34f479,'rows':_0x5b0967}:null;}})[_0x253c('0x25')](respondWithResult(_0x380f5b,null))[_0x253c('0x43')](handleError(_0x380f5b,null));};
\ No newline at end of file
+var _0x5252=['ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','Companies','end','error','stack','name','send','index','describe','keys','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','CmCompany','rows','catch','show','params','rawAttributes','intersection','length','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','CmContact','eml-format','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x3b1893,_0x146f1b){var _0x568540=function(_0x332c78){while(--_0x332c78){_0x3b1893['push'](_0x3b1893['shift']());}};_0x568540(++_0x146f1b);}(_0x5252,0xf2));var _0x2525=function(_0x4c0ebb,_0x3125c4){_0x4c0ebb=_0x4c0ebb-0x0;var _0x16a483=_0x5252[_0x4c0ebb];return _0x16a483;};'use strict';var emlformat=require(_0x2525('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2525('0x1'));var rp=require('request-promise');var moment=require(_0x2525('0x2'));var BPromise=require(_0x2525('0x3'));var Mustache=require(_0x2525('0x4'));var util=require(_0x2525('0x5'));var path=require(_0x2525('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2525('0x7'));var fs=require('fs');var fs_extra=require(_0x2525('0x8'));var _=require(_0x2525('0x9'));var squel=require(_0x2525('0xa'));var crypto=require(_0x2525('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2525('0xc'));var toCsv=require(_0x2525('0xd'));var querystring=require(_0x2525('0xe'));var Papa=require(_0x2525('0xf'));var Redis=require(_0x2525('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2525('0x11'))(_0x2525('0x12'));var utils=require(_0x2525('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2525('0x14'));var db=require(_0x2525('0x15'))['db'];function respondWithStatusCode(_0x3e9aea,_0x24b438){_0x24b438=_0x24b438||0xcc;return function(_0x457699){if(_0x457699){return _0x3e9aea[_0x2525('0x16')](_0x24b438);}return _0x3e9aea[_0x2525('0x17')](_0x24b438)['end']();};}function respondWithResult(_0x229b72,_0x633e0){_0x633e0=_0x633e0||0xc8;return function(_0x52260d){if(_0x52260d){return _0x229b72[_0x2525('0x17')](_0x633e0)[_0x2525('0x18')](_0x52260d);}};}function respondWithFilteredResult(_0x5b84ef,_0x295091){return function(_0x2ca852){if(_0x2ca852){var _0x3feb33=typeof _0x295091[_0x2525('0x19')]===_0x2525('0x1a')&&typeof _0x295091[_0x2525('0x1b')]===_0x2525('0x1a');var _0x35a69c=_0x2ca852[_0x2525('0x1c')];var _0x153a71=_0x3feb33?0x0:_0x295091['offset'];var _0x333b8e=_0x3feb33?_0x2ca852[_0x2525('0x1c')]:_0x295091[_0x2525('0x19')]+_0x295091[_0x2525('0x1b')];var _0x41072d;if(_0x333b8e>=_0x35a69c){_0x333b8e=_0x35a69c;_0x41072d=0xc8;}else{_0x41072d=0xce;}_0x5b84ef[_0x2525('0x17')](_0x41072d);return _0x5b84ef['set']('Content-Range',_0x153a71+'-'+_0x333b8e+'/'+_0x35a69c)[_0x2525('0x18')](_0x2ca852);}return null;};}function patchUpdates(_0x2add3b){return function(_0x4e3977){try{jsonpatch[_0x2525('0x1d')](_0x4e3977,_0x2add3b,!![]);}catch(_0x1145eb){return BPromise[_0x2525('0x1e')](_0x1145eb);}return _0x4e3977[_0x2525('0x1f')]();};}function saveUpdates(_0xcdeb9b,_0x1f3fcc){return function(_0x423e8c){if(_0x423e8c){return _0x423e8c[_0x2525('0x20')](_0xcdeb9b)[_0x2525('0x21')](function(_0x565f44){return _0x565f44;});}return null;};}function removeEntity(_0x8480cc,_0x1ad600){return function(_0x2a010a){if(_0x2a010a){return _0x2a010a[_0x2525('0x22')]()[_0x2525('0x21')](function(){var _0x1e683a=_0x2a010a['get']({'plain':!![]});var _0x20a510=_0x2525('0x23');return db['UserProfileResource']['destroy']({'where':{'type':_0x20a510,'resourceId':_0x1e683a['id']}})['then'](function(){return _0x2a010a;});})[_0x2525('0x21')](function(){_0x8480cc['status'](0xcc)[_0x2525('0x24')]();});}};}function handleEntityNotFound(_0xe4a574,_0x1c7c2c){return function(_0x354da2){if(!_0x354da2){_0xe4a574[_0x2525('0x16')](0x194);}return _0x354da2;};}function handleError(_0x2fd657,_0x12d63a){_0x12d63a=_0x12d63a||0x1f4;return function(_0x25ce0e){logger[_0x2525('0x25')](_0x25ce0e[_0x2525('0x26')]);if(_0x25ce0e[_0x2525('0x27')]){delete _0x25ce0e[_0x2525('0x27')];}_0x2fd657[_0x2525('0x17')](_0x12d63a)[_0x2525('0x28')](_0x25ce0e);};}exports[_0x2525('0x29')]=function(_0xe68a67,_0x53848f){var _0x1051f7={},_0x4efa89={},_0x266ee={'count':0x0,'rows':[]};return db['CmCompany'][_0x2525('0x2a')]()[_0x2525('0x21')](function(_0x2a3dc6){_0x4efa89['model']=_[_0x2525('0x2b')](_0x2a3dc6);_0x4efa89[_0x2525('0x2c')]=_['keys'](_0xe68a67[_0x2525('0x2c')]);_0x4efa89[_0x2525('0x2d')]=_['intersection'](_0x4efa89[_0x2525('0x2e')],_0x4efa89[_0x2525('0x2c')]);_0x1051f7[_0x2525('0x2f')]=_['intersection'](_0x4efa89[_0x2525('0x2e')],qs[_0x2525('0x30')](_0xe68a67[_0x2525('0x2c')]['fields']));_0x1051f7[_0x2525('0x2f')]=_0x1051f7[_0x2525('0x2f')]['length']?_0x1051f7['attributes']:_0x4efa89[_0x2525('0x2e')];if(!_0xe68a67[_0x2525('0x2c')][_0x2525('0x31')](_0x2525('0x32'))){_0x1051f7[_0x2525('0x1b')]=qs[_0x2525('0x1b')](_0xe68a67['query'][_0x2525('0x1b')]);_0x1051f7[_0x2525('0x19')]=qs['offset'](_0xe68a67['query']['offset']);}_0x1051f7[_0x2525('0x33')]=qs[_0x2525('0x34')](_0xe68a67['query'][_0x2525('0x34')]);_0x1051f7[_0x2525('0x35')]=qs[_0x2525('0x2d')](_[_0x2525('0x36')](_0xe68a67[_0x2525('0x2c')],_0x4efa89[_0x2525('0x2d')]),_0x2a3dc6);if(_0xe68a67[_0x2525('0x2c')][_0x2525('0x37')]){_0x1051f7[_0x2525('0x35')]=_[_0x2525('0x38')](_0x1051f7[_0x2525('0x35')],{'$or':_[_0x2525('0x39')](_0x1051f7['attributes'],function(_0x4f9613){var _0x49f394={};_0x49f394[_0x4f9613]={'$like':'%'+_0xe68a67[_0x2525('0x2c')]['filter']+'%'};return _0x49f394;})});}_0x1051f7=_[_0x2525('0x38')]({},_0x1051f7,_0xe68a67[_0x2525('0x3a')]);var _0x46a84e={'where':_0x1051f7['where']};return db['CmCompany'][_0x2525('0x1c')](_0x46a84e)[_0x2525('0x21')](function(_0x3262e7){_0x266ee[_0x2525('0x1c')]=_0x3262e7;if(_0xe68a67['query'][_0x2525('0x3b')]){_0x1051f7[_0x2525('0x3c')]=[{'all':!![]}];}return db[_0x2525('0x3d')]['findAll'](_0x1051f7);})[_0x2525('0x21')](function(_0x44f3da){_0x266ee[_0x2525('0x3e')]=_0x44f3da;return _0x266ee;})[_0x2525('0x21')](respondWithFilteredResult(_0x53848f,_0x1051f7))['catch'](handleError(_0x53848f,null));})[_0x2525('0x3f')](handleError(_0x53848f,null));};exports[_0x2525('0x40')]=function(_0x5eb16d,_0x527231){var _0x9ca01a={'raw':![],'where':{'id':_0x5eb16d[_0x2525('0x41')]['id']}},_0x3a611c={};_0x3a611c[_0x2525('0x2e')]=_[_0x2525('0x2b')](db[_0x2525('0x3d')][_0x2525('0x42')]);_0x3a611c[_0x2525('0x2c')]=_[_0x2525('0x2b')](_0x5eb16d[_0x2525('0x2c')]);_0x3a611c[_0x2525('0x2d')]=_[_0x2525('0x43')](_0x3a611c['model'],_0x3a611c[_0x2525('0x2c')]);_0x9ca01a[_0x2525('0x2f')]=_[_0x2525('0x43')](_0x3a611c[_0x2525('0x2e')],qs[_0x2525('0x30')](_0x5eb16d[_0x2525('0x2c')][_0x2525('0x30')]));_0x9ca01a[_0x2525('0x2f')]=_0x9ca01a[_0x2525('0x2f')][_0x2525('0x44')]?_0x9ca01a[_0x2525('0x2f')]:_0x3a611c[_0x2525('0x2e')];if(_0x5eb16d[_0x2525('0x2c')][_0x2525('0x3b')]){_0x9ca01a[_0x2525('0x3c')]=[{'all':!![]}];}_0x9ca01a=_[_0x2525('0x38')]({},_0x9ca01a,_0x5eb16d[_0x2525('0x3a')]);return db[_0x2525('0x3d')][_0x2525('0x45')](_0x9ca01a)[_0x2525('0x21')](handleEntityNotFound(_0x527231,null))['then'](respondWithResult(_0x527231,null))['catch'](handleError(_0x527231,null));};exports[_0x2525('0x46')]=function(_0x3a79c0,_0x4a140e){return db[_0x2525('0x3d')][_0x2525('0x46')](_0x3a79c0[_0x2525('0x47')],{})[_0x2525('0x21')](function(_0x31f492){var _0x21d827=_0x3a79c0[_0x2525('0x48')]['get']({'plain':!![]});if(!_0x21d827)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21d827[_0x2525('0x49')]===_0x2525('0x48')){var _0x4242dc=_0x31f492['get']({'plain':!![]});var _0x2c073c=_0x2525('0x23');return db[_0x2525('0x4a')]['find']({'where':{'name':_0x2c073c,'userProfileId':_0x21d827['userProfileId']},'raw':!![]})['then'](function(_0xa76e2b){if(_0xa76e2b&&_0xa76e2b[_0x2525('0x4b')]===0x0){return db[_0x2525('0x4c')]['create']({'name':_0x4242dc[_0x2525('0x27')],'resourceId':_0x4242dc['id'],'type':_0xa76e2b['name'],'sectionId':_0xa76e2b['id']},{})[_0x2525('0x21')](function(){return _0x31f492;});}else{return _0x31f492;}})['catch'](function(_0x16e106){logger[_0x2525('0x25')](_0x2525('0x4d'),_0x16e106);throw _0x16e106;});}return _0x31f492;})[_0x2525('0x21')](respondWithResult(_0x4a140e,0xc9))[_0x2525('0x3f')](handleError(_0x4a140e,null));};exports[_0x2525('0x20')]=function(_0x31be0b,_0xc3bbbb){if(_0x31be0b[_0x2525('0x47')]['id']){delete _0x31be0b['body']['id'];}return db[_0x2525('0x3d')][_0x2525('0x45')]({'where':{'id':_0x31be0b[_0x2525('0x41')]['id']}})['then'](handleEntityNotFound(_0xc3bbbb,null))[_0x2525('0x21')](saveUpdates(_0x31be0b[_0x2525('0x47')],null))['then'](respondWithResult(_0xc3bbbb,null))[_0x2525('0x3f')](handleError(_0xc3bbbb,null));};exports[_0x2525('0x22')]=function(_0x558806,_0x158059){return db['CmCompany'][_0x2525('0x45')]({'where':{'id':_0x558806[_0x2525('0x41')]['id']}})[_0x2525('0x21')](handleEntityNotFound(_0x158059,null))['then'](removeEntity(_0x158059,null))[_0x2525('0x3f')](handleError(_0x158059,null));};exports['describe']=function(_0x3308ff,_0x18573c){return db[_0x2525('0x3d')][_0x2525('0x2a')]()[_0x2525('0x21')](respondWithResult(_0x18573c,null))['catch'](handleError(_0x18573c,null));};exports['addContacts']=function(_0x1d80ce,_0x52655d,_0x318ca7){return db['CmContact'][_0x2525('0x45')]({'where':{'id':_0x1d80ce[_0x2525('0x41')]['id']}})['then'](handleEntityNotFound(_0x52655d,null))['then'](function(_0x343c34){if(_0x343c34){return _0x343c34[_0x2525('0x4e')](_0x1d80ce[_0x2525('0x47')][_0x2525('0x4f')],_[_0x2525('0x50')](_0x1d80ce[_0x2525('0x47')],['ids','id'])||{});}})[_0x2525('0x21')](respondWithResult(_0x52655d,null))[_0x2525('0x3f')](handleError(_0x52655d,null));};exports[_0x2525('0x51')]=function(_0x5db492,_0x15e627,_0x419af9){var _0x5bc07f={};var _0x5f2fb9={};var _0x5bc64c;var _0x199b52;return db['CmCompany']['findOne']({'where':{'id':_0x5db492[_0x2525('0x41')]['id']}})['then'](handleEntityNotFound(_0x15e627,null))['then'](function(_0x3855fd){if(_0x3855fd){_0x5bc64c=_0x3855fd;_0x5f2fb9[_0x2525('0x2e')]=_[_0x2525('0x2b')](db[_0x2525('0x52')][_0x2525('0x42')]);_0x5f2fb9[_0x2525('0x2c')]=_[_0x2525('0x2b')](_0x5db492['query']);_0x5f2fb9[_0x2525('0x2d')]=_[_0x2525('0x43')](_0x5f2fb9[_0x2525('0x2e')],_0x5f2fb9[_0x2525('0x2c')]);_0x5bc07f[_0x2525('0x2f')]=_[_0x2525('0x43')](_0x5f2fb9[_0x2525('0x2e')],qs[_0x2525('0x30')](_0x5db492[_0x2525('0x2c')][_0x2525('0x30')]));_0x5bc07f['attributes']=_0x5bc07f[_0x2525('0x2f')][_0x2525('0x44')]?_0x5bc07f['attributes']:_0x5f2fb9[_0x2525('0x2e')];_0x5bc07f[_0x2525('0x33')]=qs[_0x2525('0x34')](_0x5db492[_0x2525('0x2c')][_0x2525('0x34')]);_0x5bc07f[_0x2525('0x35')]=qs['filters'](_[_0x2525('0x36')](_0x5db492[_0x2525('0x2c')],_0x5f2fb9[_0x2525('0x2d')]));if(_0x5db492[_0x2525('0x2c')][_0x2525('0x37')]){_0x5bc07f['where']=_[_0x2525('0x38')](_0x5bc07f['where'],{'$or':_[_0x2525('0x39')](_0x5bc07f[_0x2525('0x2f')],function(_0x1b06f1){var _0x520cc1={};_0x520cc1[_0x1b06f1]={'$like':'%'+_0x5db492[_0x2525('0x2c')][_0x2525('0x37')]+'%'};return _0x520cc1;})});}_0x5bc07f=_[_0x2525('0x38')]({},_0x5bc07f,_0x5db492[_0x2525('0x3a')]);return _0x5bc64c['getContacts'](_0x5bc07f);}})[_0x2525('0x21')](function(_0x5d3dd1){if(_0x5d3dd1){_0x199b52=_0x5d3dd1[_0x2525('0x44')];if(!_0x5db492[_0x2525('0x2c')][_0x2525('0x31')]('nolimit')){_0x5bc07f[_0x2525('0x1b')]=qs['limit'](_0x5db492['query']['limit']);_0x5bc07f['offset']=qs[_0x2525('0x19')](_0x5db492[_0x2525('0x2c')][_0x2525('0x19')]);}return _0x5bc64c['getContacts'](_0x5bc07f);}})[_0x2525('0x21')](function(_0x655aad){if(_0x655aad){return _0x655aad?{'count':_0x199b52,'rows':_0x655aad}:null;}})['then'](respondWithResult(_0x15e627,null))['catch'](handleError(_0x15e627,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ff7da5f..bbc138b 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 _0xfc88=['exports','cm_companies','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x144b30,_0x77072d){var _0x1bb7bc=function(_0x1082cc){while(--_0x1082cc){_0x144b30['push'](_0x144b30['shift']());}};_0x1bb7bc(++_0x77072d);}(_0xfc88,0x1b2));var _0x8fc8=function(_0x1a5724,_0x1535ee){_0x1a5724=_0x1a5724-0x0;var _0x1cc99e=_0xfc88[_0x1a5724];return _0x1cc99e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8fc8('0x0'))(_0x8fc8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8fc8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fc8('0x3'));var config=require(_0x8fc8('0x4'));var attributes=require(_0x8fc8('0x5'));module[_0x8fc8('0x6')]=function(_0x4d2f3a,_0x8a6152){return _0x4d2f3a['define']('CmCompany',attributes,{'tableName':_0x8fc8('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9539=['CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x138688,_0x186edf){var _0x24b567=function(_0x519609){while(--_0x519609){_0x138688['push'](_0x138688['shift']());}};_0x24b567(++_0x186edf);}(_0x9539,0x179));var _0x9953=function(_0x5438d7,_0x19e07a){_0x5438d7=_0x5438d7-0x0;var _0x2519dd=_0x9539[_0x5438d7];return _0x2519dd;};'use strict';var _=require(_0x9953('0x0'));var util=require(_0x9953('0x1'));var logger=require(_0x9953('0x2'))(_0x9953('0x3'));var moment=require(_0x9953('0x4'));var BPromise=require(_0x9953('0x5'));var rp=require(_0x9953('0x6'));var fs=require('fs');var path=require(_0x9953('0x7'));var rimraf=require(_0x9953('0x8'));var config=require(_0x9953('0x9'));var attributes=require(_0x9953('0xa'));module[_0x9953('0xb')]=function(_0x52ec4f,_0x5dcc0d){return _0x52ec4f[_0x9953('0xc')](_0x9953('0xd'),attributes,{'tableName':_0x9953('0xe'),'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 fb9adb3..3cbd76d 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 _0xe4a3=['message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x46d13a,_0x21cd98){var _0x2c9e6a=function(_0x256a2d){while(--_0x256a2d){_0x46d13a['push'](_0x46d13a['shift']());}};_0x2c9e6a(++_0x21cd98);}(_0xe4a3,0x95));var _0x3e4a=function(_0x174bc8,_0x3d7c6e){_0x174bc8=_0x174bc8-0x0;var _0x4ebd5f=_0xe4a3[_0x174bc8];return _0x4ebd5f;};'use strict';var _=require(_0x3e4a('0x0'));var util=require('util');var moment=require(_0x3e4a('0x1'));var BPromise=require(_0x3e4a('0x2'));var rs=require(_0x3e4a('0x3'));var fs=require('fs');var Redis=require(_0x3e4a('0x4'));var db=require(_0x3e4a('0x5'))['db'];var utils=require(_0x3e4a('0x6'));var logger=require(_0x3e4a('0x7'))('rpc');var config=require(_0x3e4a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3e4a('0x9')][_0x3e4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1aaf3b,_0x1d99b6,_0x285870){return new BPromise(function(_0x27d6cc,_0x3ae3ee){return client[_0x3e4a('0xb')](_0x1aaf3b,_0x285870)['then'](function(_0x3b4bb6){logger[_0x3e4a('0xc')](_0x3e4a('0xd'),_0x1d99b6,_0x3e4a('0xe'));logger['debug'](_0x3e4a('0xf'),_0x1d99b6,_0x3e4a('0xe'),JSON[_0x3e4a('0x10')](_0x3b4bb6));if(_0x3b4bb6[_0x3e4a('0x11')]){if(_0x3b4bb6[_0x3e4a('0x11')][_0x3e4a('0x12')]===0x1f4){logger[_0x3e4a('0x11')](_0x3e4a('0xd'),_0x1d99b6,_0x3b4bb6[_0x3e4a('0x11')][_0x3e4a('0x13')]);return _0x3ae3ee(_0x3b4bb6[_0x3e4a('0x11')][_0x3e4a('0x13')]);}logger[_0x3e4a('0x11')]('CmCompany,\x20%s,\x20%s',_0x1d99b6,_0x3b4bb6[_0x3e4a('0x11')]['message']);return _0x27d6cc(_0x3b4bb6[_0x3e4a('0x11')]['message']);}else{logger[_0x3e4a('0xc')](_0x3e4a('0xd'),_0x1d99b6,_0x3e4a('0xe'));_0x27d6cc(_0x3b4bb6['result'][_0x3e4a('0x13')]);}})[_0x3e4a('0x14')](function(_0x14db0b){logger[_0x3e4a('0x11')](_0x3e4a('0xd'),_0x1d99b6,_0x14db0b);_0x3ae3ee(_0x14db0b);});});}
\ No newline at end of file
+var _0x5b12=['message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x334688,_0xf68c2c){var _0x42dc15=function(_0x17f90a){while(--_0x17f90a){_0x334688['push'](_0x334688['shift']());}};_0x42dc15(++_0xf68c2c);}(_0x5b12,0x120));var _0x25b1=function(_0x26cc10,_0x24dd3b){_0x26cc10=_0x26cc10-0x0;var _0xb7cbec=_0x5b12[_0x26cc10];return _0xb7cbec;};'use strict';var _=require(_0x25b1('0x0'));var util=require('util');var moment=require(_0x25b1('0x1'));var BPromise=require('bluebird');var rs=require(_0x25b1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x25b1('0x3'));var logger=require(_0x25b1('0x4'))('rpc');var config=require(_0x25b1('0x5'));var jayson=require(_0x25b1('0x6'));var client=jayson['client'][_0x25b1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x515bdc,_0x3ef2a8,_0xa07613){return new BPromise(function(_0x46e462,_0x1ca7c7){return client[_0x25b1('0x8')](_0x515bdc,_0xa07613)[_0x25b1('0x9')](function(_0x359245){logger[_0x25b1('0xa')](_0x25b1('0xb'),_0x3ef2a8,_0x25b1('0xc'));logger[_0x25b1('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x3ef2a8,'request\x20sent',JSON['stringify'](_0x359245));if(_0x359245[_0x25b1('0xe')]){if(_0x359245['error'][_0x25b1('0xf')]===0x1f4){logger[_0x25b1('0xe')](_0x25b1('0xb'),_0x3ef2a8,_0x359245[_0x25b1('0xe')][_0x25b1('0x10')]);return _0x1ca7c7(_0x359245['error']['message']);}logger[_0x25b1('0xe')]('CmCompany,\x20%s,\x20%s',_0x3ef2a8,_0x359245[_0x25b1('0xe')][_0x25b1('0x10')]);return _0x46e462(_0x359245['error'][_0x25b1('0x10')]);}else{logger[_0x25b1('0xa')](_0x25b1('0xb'),_0x3ef2a8,_0x25b1('0xc'));_0x46e462(_0x359245[_0x25b1('0x11')][_0x25b1('0x10')]);}})[_0x25b1('0x12')](function(_0x52a127){logger[_0x25b1('0xe')]('CmCompany,\x20%s,\x20%s',_0x3ef2a8,_0x52a127);_0x1ca7c7(_0x52a127);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 83320cc..a14050b 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 _0x0b51=['describe','/:id','show','/:id/contacts','post','create','addContacts','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe'];(function(_0x24c308,_0x5f4765){var _0x5de5ae=function(_0x340d56){while(--_0x340d56){_0x24c308['push'](_0x24c308['shift']());}};_0x5de5ae(++_0x5f4765);}(_0x0b51,0xfd));var _0x10b5=function(_0x538c48,_0x169ec5){_0x538c48=_0x538c48-0x0;var _0x2fc4e4=_0x0b51[_0x538c48];return _0x2fc4e4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x10b5('0x0'));var timeout=require(_0x10b5('0x1'));var express=require('express');var router=express[_0x10b5('0x2')]();var fs_extra=require(_0x10b5('0x3'));var auth=require(_0x10b5('0x4'));var interaction=require(_0x10b5('0x5'));var config=require('../../config/environment');var controller=require(_0x10b5('0x6'));router[_0x10b5('0x7')]('/',auth[_0x10b5('0x8')](),controller[_0x10b5('0x9')]);router[_0x10b5('0x7')](_0x10b5('0xa'),auth['isAuthenticated'](),controller[_0x10b5('0xb')]);router[_0x10b5('0x7')](_0x10b5('0xc'),auth['isAuthenticated'](),controller[_0x10b5('0xd')]);router[_0x10b5('0x7')](_0x10b5('0xe'),auth['isAuthenticated'](),controller['getContacts']);router[_0x10b5('0xf')]('/',auth[_0x10b5('0x8')](),controller[_0x10b5('0x10')]);router[_0x10b5('0xf')]('/:id/contacts',auth[_0x10b5('0x8')](),controller[_0x10b5('0x11')]);router['put'](_0x10b5('0xc'),auth[_0x10b5('0x8')](),controller[_0x10b5('0x12')]);router[_0x10b5('0x13')](_0x10b5('0xc'),auth[_0x10b5('0x8')](),controller[_0x10b5('0x14')]);module[_0x10b5('0x15')]=router;
\ No newline at end of file
+var _0x470c=['put','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x470c,0x8e));var _0xc470=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x470c[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xc470('0x0'));var util=require(_0xc470('0x1'));var path=require('path');var timeout=require(_0xc470('0x2'));var express=require(_0xc470('0x3'));var router=express['Router']();var fs_extra=require(_0xc470('0x4'));var auth=require(_0xc470('0x5'));var interaction=require(_0xc470('0x6'));var config=require(_0xc470('0x7'));var controller=require(_0xc470('0x8'));router['get']('/',auth[_0xc470('0x9')](),controller[_0xc470('0xa')]);router[_0xc470('0xb')]('/describe',auth[_0xc470('0x9')](),controller['describe']);router['get'](_0xc470('0xc'),auth[_0xc470('0x9')](),controller[_0xc470('0xd')]);router[_0xc470('0xb')](_0xc470('0xe'),auth[_0xc470('0x9')](),controller['getContacts']);router[_0xc470('0xf')]('/',auth[_0xc470('0x9')](),controller[_0xc470('0x10')]);router['post'](_0xc470('0xe'),auth['isAuthenticated'](),controller[_0xc470('0x11')]);router[_0xc470('0x12')]('/:id',auth[_0xc470('0x9')](),controller['update']);router['delete']('/:id',auth[_0xc470('0x9')](),controller['destroy']);module[_0xc470('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 862aaee..2f4e270 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 _0x1475=['UNSIGNED','DATE','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x14ad92,_0x3b4315){var _0x41ceae=function(_0x252cd1){while(--_0x252cd1){_0x14ad92['push'](_0x14ad92['shift']());}};_0x41ceae(++_0x3b4315);}(_0x1475,0x8a));var _0x5147=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x1475[_0x1b51ea];return _0x18bbdc;};'use strict';var _=require(_0x5147('0x0'));var Sequelize=require(_0x5147('0x1'));module[_0x5147('0x2')]={'firstName':{'type':Sequelize[_0x5147('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x5147('0x3')]},'postalCode':{'type':Sequelize[_0x5147('0x3')]},'city':{'type':Sequelize[_0x5147('0x3')]},'country':{'type':Sequelize[_0x5147('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5147('0x3')]},'description':{'type':Sequelize[_0x5147('0x4')]},'phone':{'type':Sequelize[_0x5147('0x3')]},'mobile':{'type':Sequelize[_0x5147('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5147('0x3')]},'url':{'type':Sequelize[_0x5147('0x3')]},'facebook':{'type':Sequelize[_0x5147('0x3')]},'fb_data':{'type':Sequelize[_0x5147('0x3')]},'twitter':{'type':Sequelize[_0x5147('0x3')]},'skype':{'type':Sequelize[_0x5147('0x3')]},'teams':{'type':Sequelize[_0x5147('0x3')]},'viber':{'type':Sequelize[_0x5147('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x5147('0x3')]},'telegram':{'type':Sequelize[_0x5147('0x3')]},'UserId':{'type':Sequelize[_0x5147('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5147('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x5147('0x7')],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0x8744=['sequelize','exports','STRING','INTEGER','DATE','NOW','lodash'];(function(_0x4ca288,_0x254dd8){var _0x2362c1=function(_0x5504d8){while(--_0x5504d8){_0x4ca288['push'](_0x4ca288['shift']());}};_0x2362c1(++_0x254dd8);}(_0x8744,0x172));var _0x4874=function(_0xa70262,_0x32b588){_0xa70262=_0xa70262-0x0;var _0x285242=_0x8744[_0xa70262];return _0x285242;};'use strict';var _=require(_0x4874('0x0'));var Sequelize=require(_0x4874('0x1'));module[_0x4874('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x4874('0x3')]},'street':{'type':Sequelize[_0x4874('0x3')]},'postalCode':{'type':Sequelize[_0x4874('0x3')]},'city':{'type':Sequelize[_0x4874('0x3')]},'country':{'type':Sequelize[_0x4874('0x3')]},'dateOfBirth':{'type':Sequelize[_0x4874('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4874('0x3')]},'mobile':{'type':Sequelize[_0x4874('0x3')]},'fax':{'type':Sequelize[_0x4874('0x3')]},'email':{'type':Sequelize[_0x4874('0x3')]},'url':{'type':Sequelize[_0x4874('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x4874('0x3')]},'twitter':{'type':Sequelize[_0x4874('0x3')]},'skype':{'type':Sequelize[_0x4874('0x3')]},'teams':{'type':Sequelize[_0x4874('0x3')]},'viber':{'type':Sequelize[_0x4874('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x4874('0x3')]},'UserId':{'type':Sequelize[_0x4874('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4874('0x5')],'defaultValue':Sequelize[_0x4874('0x6')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index f89cf8c..43928c5 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 _0x5542=['SELECT','clone','DESC','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','ListId','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','tags','columnName','displayName','analytics','alias','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','CmHopperFinal','CmHopperHistory','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','spread','show','params','$and','findAll','omit','pickBy','format','table','setFields','id\x20=\x20?','toParam','values','phone','rawAttributes','intersection','getTags','setTags','getHoppers','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','send','upload','createReadStream','path','parse','import','binding','firstName','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','pid','getJourney','chat','openchannel','fax','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','VoiceCallReport','findAndCountAll','Website','Account','closed','closedAt','disposition','secondDisposition','key','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','externalUrl','threadId','startCase','Owner','all','flatten','sortBy','reverse','slice','bluebird','util','lodash','squel','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','name','index','describe','keys','startsWith','cf_','CmCustomField','findOne','trimStart','length','fieldType','type','model','query','filters','attributes','fields','nolimit','order','sort','where','pick','field','color','from','select','cm_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','dateOfBirth','datetime','buildExpression','text','start','hasOwnProperty','filter','isNil','Contact','push','isEmpty','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','c.id'];(function(_0x22eebc,_0x267306){var _0x5e060e=function(_0x44697e){while(--_0x44697e){_0x22eebc['push'](_0x22eebc['shift']());}};_0x5e060e(++_0x267306);}(_0x5542,0x1cb));var _0x2554=function(_0x441fae,_0x3ab2ee){_0x441fae=_0x441fae-0x0;var _0x189025=_0x5542[_0x441fae];return _0x189025;};'use strict';var moment=require('moment');var BPromise=require(_0x2554('0x0'));var util=require(_0x2554('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x2554('0x2'));var squel=require(_0x2554('0x3'));var Papa=require(_0x2554('0x4'));var Redis=require('ioredis');var qs=require(_0x2554('0x5'));var as=require(_0x2554('0x6'));var logger=require(_0x2554('0x7'))('api');var config=require('../../config/environment');var db=require(_0x2554('0x8'))['db'];config[_0x2554('0x9')]=_['defaults'](config[_0x2554('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2554('0xa'))(new Redis(config[_0x2554('0x9')]));require(_0x2554('0xb'))[_0x2554('0xc')](socket);function respondWithResult(_0x5f53ef,_0x539520){_0x539520=_0x539520||0xc8;return function(_0x58a4fd){if(_0x58a4fd){return _0x5f53ef[_0x2554('0xd')](_0x539520)[_0x2554('0xe')](_0x58a4fd);}};}function respondWithFilteredResult(_0x2ddd1c,_0x4e399a){return function(_0x500898){if(_0x500898){var _0x3b80a1=typeof _0x4e399a[_0x2554('0xf')]===_0x2554('0x10')&&typeof _0x4e399a[_0x2554('0x11')]===_0x2554('0x10');var _0x52512c=_0x500898[_0x2554('0x12')];var _0xbe3d65=_0x3b80a1?0x0:_0x4e399a[_0x2554('0xf')];var _0x56ffec=_0x3b80a1?_0x500898[_0x2554('0x12')]:_0x4e399a['offset']+_0x4e399a[_0x2554('0x11')];var _0x1b8b9a;if(_0x56ffec>=_0x52512c){_0x56ffec=_0x52512c;_0x1b8b9a=0xc8;}else{_0x1b8b9a=0xce;}_0x2ddd1c[_0x2554('0xd')](_0x1b8b9a);return _0x2ddd1c[_0x2554('0x13')](_0x2554('0x14'),_0xbe3d65+'-'+_0x56ffec+'/'+_0x52512c)[_0x2554('0xe')](_0x500898);}return null;};}function saveUpdates(_0x333770){return function(_0x1069c9){if(_0x1069c9){return _0x1069c9[_0x2554('0x15')](_0x333770)[_0x2554('0x16')](function(_0x49602e){return _0x49602e;});}return null;};}function removeEntity(_0x8ca9d2){return function(_0x1e0ef7){if(_0x1e0ef7){return _0x1e0ef7[_0x2554('0x17')]()[_0x2554('0x16')](function(){_0x8ca9d2['status'](0xcc)[_0x2554('0x18')]();});}};}function handleEntityNotFound(_0x2872c1){return function(_0x390b07){if(!_0x390b07){_0x2872c1['sendStatus'](0x194);}return _0x390b07;};}function handleError(_0xa7bbc3,_0x20affc){_0x20affc=_0x20affc||0x1f4;return function(_0x2aec4d){logger[_0x2554('0x19')](_0x2aec4d['stack']);if(_0x2aec4d['name']){delete _0x2aec4d[_0x2554('0x1a')];}_0xa7bbc3['status'](_0x20affc)['send'](_0x2aec4d);};}exports[_0x2554('0x1b')]=function(_0x3e2b79,_0x3f32fd){var _0x3c80ab={},_0x4bb313={},_0x1f1280={'count':0x0,'rows':[]};return db['CmContact'][_0x2554('0x1c')]()['then'](function(_0x268438){var _0x3306b6=[];for(var _0x198331=0x0;_0x198331
','getHost','imap.gmail.com'];(function(_0x4f583c,_0x3b608d){var _0x53208a=function(_0x322e1a){while(--_0x322e1a){_0x4f583c['push'](_0x4f583c['shift']());}};_0x53208a(++_0x3b608d);}(_0xeaab,0xd9));var _0xbeaa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xeaab[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbeaa('0x0'));var moment=require('moment');var random=require(_0xbeaa('0x1'));var fs=require('fs');var path=require(_0xbeaa('0x2'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0xbeaa('0x3'))(_0xbeaa('0x4'));var config=require(_0xbeaa('0x5'));function getAddress(_0x3e9c3b){var _0x281a29=_[_0xbeaa('0x6')](_0x3e9c3b[_0xbeaa('0x7')]);return _0x281a29&&_0x281a29[_0xbeaa('0x8')]?_0x281a29[_0xbeaa('0x8')]:_0xbeaa('0x9')+random[_0xbeaa('0xa')](0x6)+_0xbeaa('0xb');}function getFirstName(_0x15a826){var _0xd2a868=_['head'](_0x15a826[_0xbeaa('0x7')]);if(_0xd2a868&&_0xd2a868[_0xbeaa('0xc')]){if(_0xd2a868[_0xbeaa('0xc')]==_0xd2a868[_0xbeaa('0x8')]){return _0xd2a868[_0xbeaa('0xc')][_0xbeaa('0xd')](0x0,_0xd2a868[_0xbeaa('0xc')]['indexOf']('@'));}var _0x18fd02=_0xd2a868['name'][_0xbeaa('0xe')](/\s+/);return _0x18fd02[_0xbeaa('0xf')]>0x1?_0x18fd02['slice'](0x0,-0x1)[_0xbeaa('0x10')]('\x20'):_0xd2a868['name'];}return _0xbeaa('0x11');}function getLastName(_0x17d717){var _0x5457e5=_[_0xbeaa('0x6')](_0x17d717[_0xbeaa('0x7')]);if(_0x5457e5&&_0x5457e5[_0xbeaa('0xc')]){var _0x6fee13=_0x5457e5[_0xbeaa('0xc')][_0xbeaa('0xe')](/\s+/);return _0x6fee13[_0xbeaa('0xf')]>0x1?_0x6fee13[_0xbeaa('0x12')]():'';}return'';}function getMails(_0x2ab806,_0x34271a){var _0x1b28a5='';for(var _0x1cc387=0x0;_0x1cc387<_0x34271a[_0xbeaa('0x7')][_0xbeaa('0xf')];_0x1cc387+=0x1){if(_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]!==_0x2ab806){if(!_[_0xbeaa('0x13')](_0x1b28a5)){_0x1b28a5+=',';}_0x1b28a5+=_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0xc')]||_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]||'';_0x1b28a5+='\x20<';_0x1b28a5+=_0x34271a['value'][_0x1cc387][_0xbeaa('0x8')]?_0x34271a[_0xbeaa('0x7')][_0x1cc387][_0xbeaa('0x8')]:'anonymous'+random[_0xbeaa('0xa')](0x6)+_0xbeaa('0xb');_0x1b28a5+='>';}}return _0x1b28a5;}function parseEmail(_0x3f2827,_0x3aa812,_0x3923fd){if(_0x3aa812[_0xbeaa('0x14')]){var _0x106621=/