From 32f65a1ec79a9c360515821dfeb59b91eaefa4cf Mon Sep 17 00:00:00 2001
From: support
Date: Wed, 26 Oct 2022 13:35:20 +0000
Subject: [PATCH] Built motion from commit 92278a62.|2.6.19
---
apidoc/api_project.js | 4 ++--
apidoc/api_project.json | 4 ++--
npm-shrinkwrap.json | 2 +-
package.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.events.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 +-
server/api/client-side-logs.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.oauth.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 +-
.../cmContactHasItem.attributes.js | 2 +-
.../cmContactHasItem.controller.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.model.js | 2 +-
.../api/cmContactHasItem/cmContactHasItem.rpc.js | 2 +-
server/api/cmContactHasItem/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 +-
.../cmHopperAdditionalPhone.attributes.js | 2 +-
.../cmHopperAdditionalPhone.controller.js | 2 +-
.../cmHopperAdditionalPhone.model.js | 2 +-
.../cmHopperAdditionalPhone.rpc.js | 2 +-
server/api/cmHopperAdditionalPhone/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 +-
.../contactItemType/contactItemType.attributes.js | 2 +-
.../contactItemType/contactItemType.controller.js | 2 +-
.../api/contactItemType/contactItemType.model.js | 2 +-
server/api/contactItemType/contactItemType.rpc.js | 2 +-
server/api/contactItemType/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-setting/index.js | 2 +-
server/api/user-setting/user-setting.attributes.js | 2 +-
server/api/user-setting/user-setting.controller.js | 2 +-
server/api/user-setting/user-setting.events.js | 2 +-
server/api/user-setting/user-setting.model.js | 2 +-
server/api/user-setting/user-setting.socket.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/contacts/index.js | 2 +-
server/components/contacts/sql-utils.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/import/cm/csvUpdates.js | 2 +-
server/components/integrations/configuration.js | 2 +-
server/components/interaction/service.js | 2 +-
server/components/interaction/sql-utils.js | 2 +-
.../components/interaction/update-interaction.js | 2 +-
server/components/interaction/utils.js | 2 +-
server/components/license/service.js | 2 +-
server/components/parsers/advancedSearch.js | 2 +-
server/components/parsers/qs.js | 2 +-
server/components/realtime/agents.js | 2 +-
server/components/realtime/queues.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/cloud-provider.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/api.js | 2 +-
server/errors/index.js | 2 +-
server/mysqldb/index.js | 2 +-
server/routes.js | 2 +-
server/rpc/index.js | 2 +-
server/services/agi/channel.js | 2 +-
server/services/agi/error.js | 2 +-
server/services/agi/events.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/project.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/index.js | 2 +-
server/services/ami/dialer/models/action.js | 2 +-
server/services/ami/dialer/models/agentComplete.js | 2 +-
server/services/ami/dialer/models/final.js | 2 +-
server/services/ami/dialer/models/hangup.js | 2 +-
server/services/ami/dialer/models/history.js | 2 +-
.../ami/dialer/models/queueCallerAbandon.js | 2 +-
server/services/ami/dialer/utils/hopper.js | 2 +-
server/services/ami/dialer/utils/index.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/voiceQueueSummary.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/realtime/utils.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/cmHopperAdditionalPhone.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/interval.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 +-
server/utils/client-side-logger.js | 2 +-
server/utils/iftime.js | 2 +-
server/utils/loggers.js | 2 +-
server/utils/mask-sensitive-data.js | 2 +-
server/utils/safe-template.js | 2 +-
server/utils/update-app-config.js | 2 +-
snippet/3.5.0/index.html | 2 +-
1206 files changed, 1208 insertions(+), 1208 deletions(-)
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 72584d1..1a9ff3f 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -1,6 +1,6 @@
define({
"name": "xCALLY Motion API",
- "version": "2.6.20",
+ "version": "2.6.19",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-26T12:04:32.698Z",
+ "time": "2022-10-26T13:25:58.962Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index b881c6a..cb526c2 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -1,6 +1,6 @@
{
"name": "xCALLY Motion API",
- "version": "2.6.20",
+ "version": "2.6.19",
"description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.",
"title": "xCALLY MOTION API",
"header": {
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-26T12:04:32.698Z",
+ "time": "2022-10-26T13:25:58.962Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 1ceedbc..0549b25 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.20",
+ "version": "2.6.19",
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
diff --git a/package.json b/package.json
index 79e37a8..f66562f 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "motion",
- "version": "2.6.20",
+ "version": "2.6.19",
"description": "xCALLY Motion is the new Realtime asynchronous solution for your multichannel contact center over Asterisk.",
"main": "server/app.js",
"engines": {
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index d868ee3..1931fa6 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 _0x7a95=['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]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x5e84ee,_0x4e49af){var _0x14a436=function(_0x5ba5eb){while(--_0x5ba5eb){_0x5e84ee['push'](_0x5e84ee['shift']());}};_0x14a436(++_0x4e49af);}(_0x7a95,0xa5));var _0x57a9=function(_0x28259f,_0x4f7913){_0x28259f=_0x28259f-0x0;var _0x3d4d2b=_0x7a95[_0x28259f];return _0x3d4d2b;};'use strict';var Sequelize=require('sequelize');module[_0x57a9('0x0')]={'name':{'type':Sequelize[_0x57a9('0x1')],'get':function(_0x4620d1){return this[_0x57a9('0x2')](_0x57a9('0x3'));}},'action':{'type':Sequelize[_0x57a9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x57a9('0x5'),_0x57a9('0x6'),_0x57a9('0x7'),_0x57a9('0x8'),_0x57a9('0x9'),_0x57a9('0xa'),_0x57a9('0xb'),_0x57a9('0xc')]],'msg':_0x57a9('0xd')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x57a9('0xe')},'data2':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0xf')},'data3':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comment':_0x57a9('0x10')},'data4':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x57a9('0x4')](0x1000),'comments':_0x57a9('0x11')},'data6':{'type':Sequelize[_0x57a9('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x57a9('0x12')],'comments':_0x57a9('0x13')}};
\ No newline at end of file
+var _0xaa65=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar'];(function(_0x4cdcba,_0x34b28e){var _0x285181=function(_0x462f53){while(--_0x462f53){_0x4cdcba['push'](_0x4cdcba['shift']());}};_0x285181(++_0x34b28e);}(_0xaa65,0x90));var _0x5aa6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaa65[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5aa6('0x0'));module[_0x5aa6('0x1')]={'name':{'type':Sequelize[_0x5aa6('0x2')],'get':function(_0xcc6470){return this['getDataValue'](_0x5aa6('0x3'));}},'action':{'type':Sequelize[_0x5aa6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5aa6('0x5'),_0x5aa6('0x6'),_0x5aa6('0x7'),'jscripty','urlForward',_0x5aa6('0x8'),_0x5aa6('0x9'),_0x5aa6('0xa')]],'msg':_0x5aa6('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xc')},'data2':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xd')},'data3':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comment':_0x5aa6('0xe')},'data4':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comments':_0x5aa6('0xf')},'data5':{'type':Sequelize[_0x5aa6('0x4')](0x1000),'comments':_0x5aa6('0x10')},'data6':{'type':Sequelize[_0x5aa6('0x4')],'comments':_0x5aa6('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':_0x5aa6('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 2b3c200..42fe1e6 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 _0xc5a0=['stack','name','send','update','body','Action','params','catch','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error'];(function(_0x5adb00,_0x329c2a){var _0xc32601=function(_0x4bdff8){while(--_0x4bdff8){_0x5adb00['push'](_0x5adb00['shift']());}};_0xc32601(++_0x329c2a);}(_0xc5a0,0xbc));var _0x0c5a=function(_0x504f5d,_0xefefa7){_0x504f5d=_0x504f5d-0x0;var _0x3f794d=_0xc5a0[_0x504f5d];return _0x3f794d;};'use strict';var emlformat=require(_0x0c5a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0c5a('0x1'));var rp=require('request-promise');var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var Mustache=require(_0x0c5a('0x4'));var util=require(_0x0c5a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0c5a('0x6'));var ejs=require(_0x0c5a('0x7'));var fs=require('fs');var fs_extra=require(_0x0c5a('0x8'));var _=require(_0x0c5a('0x9'));var squel=require(_0x0c5a('0xa'));var crypto=require(_0x0c5a('0xb'));var jsforce=require(_0x0c5a('0xc'));var deskjs=require(_0x0c5a('0xd'));var toCsv=require(_0x0c5a('0x6'));var querystring=require(_0x0c5a('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c5a('0xf'));var authService=require(_0x0c5a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c5a('0x11'));var logger=require(_0x0c5a('0x12'))('api');var utils=require(_0x0c5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0c5a('0x14'));var db=require(_0x0c5a('0x15'))['db'];function respondWithStatusCode(_0x14cd6b,_0x324ae9){_0x324ae9=_0x324ae9||0xcc;return function(_0x289a0c){if(_0x289a0c){return _0x14cd6b['sendStatus'](_0x324ae9);}return _0x14cd6b['status'](_0x324ae9)[_0x0c5a('0x16')]();};}function respondWithResult(_0x56c3b1,_0x7c71a8){_0x7c71a8=_0x7c71a8||0xc8;return function(_0x138720){if(_0x138720){return _0x56c3b1[_0x0c5a('0x17')](_0x7c71a8)[_0x0c5a('0x18')](_0x138720);}};}function respondWithFilteredResult(_0x396bf2,_0x5e50b9){return function(_0x443258){if(_0x443258){var _0x73520f=typeof _0x5e50b9[_0x0c5a('0x19')]===_0x0c5a('0x1a')&&typeof _0x5e50b9['limit']===_0x0c5a('0x1a');var _0x3bf1db=_0x443258[_0x0c5a('0x1b')];var _0x425ac7=_0x73520f?0x0:_0x5e50b9[_0x0c5a('0x19')];var _0x43cc7b=_0x73520f?_0x443258[_0x0c5a('0x1b')]:_0x5e50b9[_0x0c5a('0x19')]+_0x5e50b9[_0x0c5a('0x1c')];var _0x4475f5;if(_0x43cc7b>=_0x3bf1db){_0x43cc7b=_0x3bf1db;_0x4475f5=0xc8;}else{_0x4475f5=0xce;}_0x396bf2[_0x0c5a('0x17')](_0x4475f5);return _0x396bf2[_0x0c5a('0x1d')](_0x0c5a('0x1e'),_0x425ac7+'-'+_0x43cc7b+'/'+_0x3bf1db)[_0x0c5a('0x18')](_0x443258);}return null;};}function patchUpdates(_0x1a933a){return function(_0x1f05f0){try{jsonpatch[_0x0c5a('0x1f')](_0x1f05f0,_0x1a933a,!![]);}catch(_0x332993){return BPromise[_0x0c5a('0x20')](_0x332993);}return _0x1f05f0[_0x0c5a('0x21')]();};}function saveUpdates(_0x2b9586,_0x2dabcb){return function(_0x3f599c){if(_0x3f599c){return _0x3f599c['update'](_0x2b9586)[_0x0c5a('0x22')](function(_0x4d00d4){return _0x4d00d4;});}return null;};}function removeEntity(_0x575f5e,_0x457d63){return function(_0x26de60){if(_0x26de60){return _0x26de60[_0x0c5a('0x23')]()['then'](function(){_0x575f5e[_0x0c5a('0x17')](0xcc)[_0x0c5a('0x16')]();});}};}function handleEntityNotFound(_0x91c3ed,_0x29a79f){return function(_0x1d5ee9){if(!_0x1d5ee9){_0x91c3ed['sendStatus'](0x194);}return _0x1d5ee9;};}function handleError(_0x44b87c,_0x1ff181){_0x1ff181=_0x1ff181||0x1f4;return function(_0x3ceee3){logger[_0x0c5a('0x24')](_0x3ceee3[_0x0c5a('0x25')]);if(_0x3ceee3[_0x0c5a('0x26')]){delete _0x3ceee3[_0x0c5a('0x26')];}_0x44b87c[_0x0c5a('0x17')](_0x1ff181)[_0x0c5a('0x27')](_0x3ceee3);};}exports[_0x0c5a('0x28')]=function(_0x2949c1,_0x332bcf){if(_0x2949c1['body']['id']){delete _0x2949c1[_0x0c5a('0x29')]['id'];}return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x2949c1[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x332bcf,null))[_0x0c5a('0x22')](saveUpdates(_0x2949c1['body'],null))[_0x0c5a('0x22')](respondWithResult(_0x332bcf,null))['catch'](handleError(_0x332bcf,null));};exports[_0x0c5a('0x23')]=function(_0x5e7bc2,_0x2e60c9){return db[_0x0c5a('0x2a')]['find']({'where':{'id':_0x5e7bc2[_0x0c5a('0x2b')]['id']}})[_0x0c5a('0x22')](handleEntityNotFound(_0x2e60c9,null))[_0x0c5a('0x22')](removeEntity(_0x2e60c9,null))[_0x0c5a('0x2c')](handleError(_0x2e60c9,null));};
\ No newline at end of file
+var _0x91e8=['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','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','name','send','body','Action','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x3564d6,_0x37d1cb){var _0x1f2267=function(_0xbf7dfb){while(--_0xbf7dfb){_0x3564d6['push'](_0x3564d6['shift']());}};_0x1f2267(++_0x37d1cb);}(_0x91e8,0x122));var _0x891e=function(_0x140261,_0x2b2d9b){_0x140261=_0x140261-0x0;var _0x12e4f0=_0x91e8[_0x140261];return _0x12e4f0;};'use strict';var emlformat=require(_0x891e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x891e('0x1'));var jsonpatch=require(_0x891e('0x2'));var rp=require(_0x891e('0x3'));var moment=require(_0x891e('0x4'));var BPromise=require(_0x891e('0x5'));var Mustache=require(_0x891e('0x6'));var util=require(_0x891e('0x7'));var path=require(_0x891e('0x8'));var sox=require('sox');var csv=require(_0x891e('0x9'));var ejs=require(_0x891e('0xa'));var fs=require('fs');var fs_extra=require(_0x891e('0xb'));var _=require(_0x891e('0xc'));var squel=require(_0x891e('0xd'));var crypto=require(_0x891e('0xe'));var jsforce=require(_0x891e('0xf'));var deskjs=require(_0x891e('0x10'));var toCsv=require(_0x891e('0x9'));var querystring=require(_0x891e('0x11'));var Papa=require(_0x891e('0x12'));var Redis=require(_0x891e('0x13'));var authService=require(_0x891e('0x14'));var qs=require(_0x891e('0x15'));var as=require(_0x891e('0x16'));var hardwareService=require(_0x891e('0x17'));var logger=require(_0x891e('0x18'))(_0x891e('0x19'));var utils=require(_0x891e('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x891e('0x1b'))['db'];function respondWithStatusCode(_0x1f7e47,_0x347a93){_0x347a93=_0x347a93||0xcc;return function(_0x1a2599){if(_0x1a2599){return _0x1f7e47[_0x891e('0x1c')](_0x347a93);}return _0x1f7e47[_0x891e('0x1d')](_0x347a93)[_0x891e('0x1e')]();};}function respondWithResult(_0x157ad4,_0x34d633){_0x34d633=_0x34d633||0xc8;return function(_0x31ae7a){if(_0x31ae7a){return _0x157ad4[_0x891e('0x1d')](_0x34d633)['json'](_0x31ae7a);}};}function respondWithFilteredResult(_0x5b3233,_0x482a92){return function(_0x3ca096){if(_0x3ca096){var _0x45ee65=typeof _0x482a92[_0x891e('0x1f')]===_0x891e('0x20')&&typeof _0x482a92[_0x891e('0x21')]===_0x891e('0x20');var _0x9d5627=_0x3ca096[_0x891e('0x22')];var _0x19bc2a=_0x45ee65?0x0:_0x482a92[_0x891e('0x1f')];var _0x5060bf=_0x45ee65?_0x3ca096[_0x891e('0x22')]:_0x482a92[_0x891e('0x1f')]+_0x482a92[_0x891e('0x21')];var _0xd8f555;if(_0x5060bf>=_0x9d5627){_0x5060bf=_0x9d5627;_0xd8f555=0xc8;}else{_0xd8f555=0xce;}_0x5b3233[_0x891e('0x1d')](_0xd8f555);return _0x5b3233[_0x891e('0x23')]('Content-Range',_0x19bc2a+'-'+_0x5060bf+'/'+_0x9d5627)[_0x891e('0x24')](_0x3ca096);}return null;};}function patchUpdates(_0x460370){return function(_0x7eff7a){try{jsonpatch[_0x891e('0x25')](_0x7eff7a,_0x460370,!![]);}catch(_0x2c44d7){return BPromise[_0x891e('0x26')](_0x2c44d7);}return _0x7eff7a[_0x891e('0x27')]();};}function saveUpdates(_0x1f0b66,_0x414be8){return function(_0x31d01c){if(_0x31d01c){return _0x31d01c[_0x891e('0x28')](_0x1f0b66)[_0x891e('0x29')](function(_0x1c3986){return _0x1c3986;});}return null;};}function removeEntity(_0x3d36d7,_0xacd550){return function(_0xe02029){if(_0xe02029){return _0xe02029[_0x891e('0x2a')]()['then'](function(){_0x3d36d7[_0x891e('0x1d')](0xcc)[_0x891e('0x1e')]();});}};}function handleEntityNotFound(_0x3d7178,_0x5cacc5){return function(_0x380cdb){if(!_0x380cdb){_0x3d7178[_0x891e('0x1c')](0x194);}return _0x380cdb;};}function handleError(_0x5ba7eb,_0xb2ea0){_0xb2ea0=_0xb2ea0||0x1f4;return function(_0x12e3bf){logger[_0x891e('0x2b')](_0x12e3bf['stack']);if(_0x12e3bf[_0x891e('0x2c')]){delete _0x12e3bf[_0x891e('0x2c')];}_0x5ba7eb[_0x891e('0x1d')](_0xb2ea0)[_0x891e('0x2d')](_0x12e3bf);};}exports[_0x891e('0x28')]=function(_0x338f1e,_0x45ddf5){if(_0x338f1e[_0x891e('0x2e')]['id']){delete _0x338f1e[_0x891e('0x2e')]['id'];}return db[_0x891e('0x2f')][_0x891e('0x30')]({'where':{'id':_0x338f1e[_0x891e('0x31')]['id']}})[_0x891e('0x29')](handleEntityNotFound(_0x45ddf5,null))[_0x891e('0x29')](saveUpdates(_0x338f1e[_0x891e('0x2e')],null))[_0x891e('0x29')](respondWithResult(_0x45ddf5,null))['catch'](handleError(_0x45ddf5,null));};exports[_0x891e('0x2a')]=function(_0x481a08,_0x5b168a){return db[_0x891e('0x2f')][_0x891e('0x30')]({'where':{'id':_0x481a08[_0x891e('0x31')]['id']}})[_0x891e('0x29')](handleEntityNotFound(_0x5b168a,null))['then'](removeEntity(_0x5b168a,null))['catch'](handleError(_0x5b168a,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 23dea0d..3ebab0f 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 _0xff3c=['tools_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','define'];(function(_0x361e2c,_0x5f584f){var _0x859c70=function(_0x1f0ab5){while(--_0x1f0ab5){_0x361e2c['push'](_0x361e2c['shift']());}};_0x859c70(++_0x5f584f);}(_0xff3c,0x1a3));var _0xcff3=function(_0x3c4322,_0x2e87f9){_0x3c4322=_0x3c4322-0x0;var _0x4ea1b5=_0xff3c[_0x3c4322];return _0x4ea1b5;};'use strict';var _=require(_0xcff3('0x0'));var util=require(_0xcff3('0x1'));var logger=require(_0xcff3('0x2'))('api');var moment=require(_0xcff3('0x3'));var BPromise=require(_0xcff3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcff3('0x5'));var rimraf=require(_0xcff3('0x6'));var config=require(_0xcff3('0x7'));var attributes=require(_0xcff3('0x8'));module['exports']=function(_0x205a14,_0x48a6b2){return _0x205a14[_0xcff3('0x9')]('Action',attributes,{'tableName':_0xcff3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f88=['exports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./action.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4f88,0x173));var _0x84f8=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0x4f88[_0x38c652];return _0x218a37;};'use strict';var _=require(_0x84f8('0x0'));var util=require(_0x84f8('0x1'));var logger=require(_0x84f8('0x2'))(_0x84f8('0x3'));var moment=require('moment');var BPromise=require(_0x84f8('0x4'));var rp=require(_0x84f8('0x5'));var fs=require('fs');var path=require(_0x84f8('0x6'));var rimraf=require(_0x84f8('0x7'));var config=require('../../config/environment');var attributes=require(_0x84f8('0x8'));module[_0x84f8('0x9')]=function(_0x38d913,_0x5cf8bd){return _0x38d913['define']('Action',attributes,{'tableName':'tools_actions','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 bd6da6e..a534b11 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0xf96866,_0x547647){var _0x336c0d=function(_0x4d03be){while(--_0x4d03be){_0xf96866['push'](_0xf96866['shift']());}};_0x336c0d(++_0x547647);}(_0xe14b,0x93));var _0xbe14=function(_0x38dd04,_0xabfd0b){_0x38dd04=_0x38dd04-0x0;var _0x429407=_0xe14b[_0x38dd04];return _0x429407;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2891d1,_0x2ddd3e){var _0x486948=function(_0x13fa0f){while(--_0x13fa0f){_0x2891d1['push'](_0x2891d1['shift']());}};_0x486948(++_0x2ddd3e);}(_0xf494,0x1c6));var _0x4f49=function(_0x33ee6a,_0x456591){_0x33ee6a=_0x33ee6a-0x0;var _0x1311df=_0xf494[_0x33ee6a];return _0x1311df;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index cb48595..9628995 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 _0x6859=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer'];(function(_0x5a66d8,_0x988719){var _0x488c3b=function(_0x53023f){while(--_0x53023f){_0x5a66d8['push'](_0x5a66d8['shift']());}};_0x488c3b(++_0x988719);}(_0x6859,0xc3));var _0x9685=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x6859[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0x9685('0x0'));var util=require('util');var path=require(_0x9685('0x1'));var timeout=require(_0x9685('0x2'));var express=require(_0x9685('0x3'));var router=express[_0x9685('0x4')]();var fs_extra=require(_0x9685('0x5'));var auth=require(_0x9685('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9685('0x7'));var controller=require(_0x9685('0x8'));router['put'](_0x9685('0x9'),auth[_0x9685('0xa')](),controller[_0x9685('0xb')]);router[_0x9685('0xc')](_0x9685('0x9'),auth['isAuthenticated'](),controller[_0x9685('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xc2d5=['/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','put'];(function(_0x236ca4,_0x92402a){var _0x4e8a9a=function(_0x523b03){while(--_0x523b03){_0x236ca4['push'](_0x236ca4['shift']());}};_0x4e8a9a(++_0x92402a);}(_0xc2d5,0xa2));var _0x5c2d=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xc2d5[_0x128bef];return _0x1ba862;};'use strict';var multer=require(_0x5c2d('0x0'));var util=require('util');var path=require(_0x5c2d('0x1'));var timeout=require(_0x5c2d('0x2'));var express=require(_0x5c2d('0x3'));var router=express[_0x5c2d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0x5c2d('0x5')](_0x5c2d('0x6'),auth[_0x5c2d('0x7')](),controller[_0x5c2d('0x8')]);router[_0x5c2d('0x9')]('/:id',auth[_0x5c2d('0x7')](),controller[_0x5c2d('0xa')]);module[_0x5c2d('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 8cc0b0f..069d07f 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 _0x687b=['STRING','TEXT','sequelize','exports'];(function(_0x3b9e53,_0x2f9366){var _0x51af53=function(_0x56bbe8){while(--_0x56bbe8){_0x3b9e53['push'](_0x3b9e53['shift']());}};_0x51af53(++_0x2f9366);}(_0x687b,0x14a));var _0xb687=function(_0x29b886,_0x3ec7c2){_0x29b886=_0x29b886-0x0;var _0x263ef9=_0x687b[_0x29b886];return _0x263ef9;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'name':{'type':Sequelize[_0xb687('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb687('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xb687('0x3')]},'joins':{'type':Sequelize[_0xb687('0x3')]}};
\ No newline at end of file
+var _0xe14b=['exports','STRING','TEXT','sequelize'];(function(_0x1bca21,_0x16484c){var _0x585671=function(_0x131f5b){while(--_0x131f5b){_0x1bca21['push'](_0x1bca21['shift']());}};_0x585671(++_0x16484c);}(_0xe14b,0x93));var _0xbe14=function(_0x152759,_0x451cca){_0x152759=_0x152759-0x0;var _0x379a1d=_0xe14b[_0x152759];return _0x379a1d;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xbe14('0x2')]},'table':{'type':Sequelize[_0xbe14('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbe14('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index e9aff69..9c6d9e0 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 _0xaf2f=['then','get','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','findAll','rows','params','includeAll','include','find','catch','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','toString','SELECT','cross_join','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','getFields','AnalyticMetric','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','left_join','groupBy','debug','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy'];(function(_0x5ad1ee,_0x49bdd2){var _0x2fcb07=function(_0x108aea){while(--_0x108aea){_0x5ad1ee['push'](_0x5ad1ee['shift']());}};_0x2fcb07(++_0x49bdd2);}(_0xaf2f,0x126));var _0xfaf2=function(_0x4b72b3,_0xb05c18){_0x4b72b3=_0x4b72b3-0x0;var _0x4bed2f=_0xaf2f[_0x4b72b3];return _0x4bed2f;};'use strict';var emlformat=require(_0xfaf2('0x0'));var rimraf=require(_0xfaf2('0x1'));var zipdir=require(_0xfaf2('0x2'));var jsonpatch=require(_0xfaf2('0x3'));var rp=require(_0xfaf2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfaf2('0x5'));var util=require('util');var path=require(_0xfaf2('0x6'));var sox=require(_0xfaf2('0x7'));var csv=require('to-csv');var ejs=require(_0xfaf2('0x8'));var fs=require('fs');var fs_extra=require(_0xfaf2('0x9'));var _=require(_0xfaf2('0xa'));var squel=require(_0xfaf2('0xb'));var crypto=require(_0xfaf2('0xc'));var jsforce=require(_0xfaf2('0xd'));var deskjs=require(_0xfaf2('0xe'));var toCsv=require(_0xfaf2('0xf'));var querystring=require(_0xfaf2('0x10'));var Papa=require(_0xfaf2('0x11'));var Redis=require(_0xfaf2('0x12'));var authService=require(_0xfaf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfaf2('0x14'));var hardwareService=require(_0xfaf2('0x15'));var logger=require('../../config/logger')(_0xfaf2('0x16'));var utils=require(_0xfaf2('0x17'));var config=require(_0xfaf2('0x18'));var licenseUtil=require(_0xfaf2('0x19'));var db=require(_0xfaf2('0x1a'))['db'];var dbH=require(_0xfaf2('0x1a'))[_0xfaf2('0x1b')];function respondWithStatusCode(_0x4cb9ef,_0x1a6acf){_0x1a6acf=_0x1a6acf||0xcc;return function(_0x532e74){if(_0x532e74){return _0x4cb9ef[_0xfaf2('0x1c')](_0x1a6acf);}return _0x4cb9ef['status'](_0x1a6acf)[_0xfaf2('0x1d')]();};}function respondWithResult(_0x5cddfc,_0x46f038){_0x46f038=_0x46f038||0xc8;return function(_0x36f083){if(_0x36f083){return _0x5cddfc[_0xfaf2('0x1e')](_0x46f038)['json'](_0x36f083);}};}function respondWithFilteredResult(_0x187a61,_0x126bfb){return function(_0x7aa8b2){if(_0x7aa8b2){var _0x32bbd8=typeof _0x126bfb[_0xfaf2('0x1f')]===_0xfaf2('0x20')&&typeof _0x126bfb[_0xfaf2('0x21')]===_0xfaf2('0x20');var _0x3b7f5e=_0x7aa8b2[_0xfaf2('0x22')];var _0x5991e9=_0x32bbd8?0x0:_0x126bfb[_0xfaf2('0x1f')];var _0x3564a0=_0x32bbd8?_0x7aa8b2['count']:_0x126bfb[_0xfaf2('0x1f')]+_0x126bfb[_0xfaf2('0x21')];var _0xda4911;if(_0x3564a0>=_0x3b7f5e){_0x3564a0=_0x3b7f5e;_0xda4911=0xc8;}else{_0xda4911=0xce;}_0x187a61[_0xfaf2('0x1e')](_0xda4911);return _0x187a61[_0xfaf2('0x23')](_0xfaf2('0x24'),_0x5991e9+'-'+_0x3564a0+'/'+_0x3b7f5e)[_0xfaf2('0x25')](_0x7aa8b2);}return null;};}function patchUpdates(_0x1f9480){return function(_0x5d4467){try{jsonpatch[_0xfaf2('0x26')](_0x5d4467,_0x1f9480,!![]);}catch(_0x14ff68){return BPromise[_0xfaf2('0x27')](_0x14ff68);}return _0x5d4467['save']();};}function saveUpdates(_0x30553c,_0x155bc1){return function(_0x3560a0){if(_0x3560a0){return _0x3560a0[_0xfaf2('0x28')](_0x30553c)['then'](function(_0x2eadcf){return _0x2eadcf;});}return null;};}function removeEntity(_0x19e933,_0x2c2370){return function(_0x1c7f27){if(_0x1c7f27){return _0x1c7f27[_0xfaf2('0x29')]()[_0xfaf2('0x2a')](function(){var _0x364b4f=_0x1c7f27[_0xfaf2('0x2b')]({'plain':!![]});var _0xbb1c0b=_0xfaf2('0x2c');return db[_0xfaf2('0x2d')][_0xfaf2('0x29')]({'where':{'type':_0xbb1c0b,'resourceId':_0x364b4f['id']}})['then'](function(){return _0x1c7f27;});})['then'](function(){_0x19e933[_0xfaf2('0x1e')](0xcc)[_0xfaf2('0x1d')]();});}};}function handleEntityNotFound(_0x548511,_0x15b711){return function(_0x5c0f08){if(!_0x5c0f08){_0x548511[_0xfaf2('0x1c')](0x194);}return _0x5c0f08;};}function handleError(_0xe3c01a,_0x26cafe){_0x26cafe=_0x26cafe||0x1f4;return function(_0x34e232){logger[_0xfaf2('0x2e')](_0x34e232[_0xfaf2('0x2f')]);if(_0x34e232[_0xfaf2('0x30')]){delete _0x34e232[_0xfaf2('0x30')];}_0xe3c01a[_0xfaf2('0x1e')](_0x26cafe)['send'](_0x34e232);};}exports[_0xfaf2('0x31')]=function(_0x1df04d,_0x2e726c){var _0x280219={},_0x4d35b5={},_0x5817b1={'count':0x0,'rows':[]};var _0x262d77=_[_0xfaf2('0x32')](db[_0xfaf2('0x33')][_0xfaf2('0x34')],function(_0x4d4553){return{'name':_0x4d4553[_0xfaf2('0x35')],'type':_0x4d4553[_0xfaf2('0x36')][_0xfaf2('0x37')]};});_0x4d35b5[_0xfaf2('0x38')]=_['map'](_0x262d77,_0xfaf2('0x30'));_0x4d35b5[_0xfaf2('0x39')]=_[_0xfaf2('0x3a')](_0x1df04d[_0xfaf2('0x39')]);_0x4d35b5['filters']=_[_0xfaf2('0x3b')](_0x4d35b5[_0xfaf2('0x38')],_0x4d35b5['query']);_0x280219[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x4d35b5['model'],qs[_0xfaf2('0x3d')](_0x1df04d[_0xfaf2('0x39')]['fields']));_0x280219[_0xfaf2('0x3c')]=_0x280219[_0xfaf2('0x3c')][_0xfaf2('0x3e')]?_0x280219[_0xfaf2('0x3c')]:_0x4d35b5['model'];if(!_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x3f')]('nolimit')){_0x280219[_0xfaf2('0x21')]=qs[_0xfaf2('0x21')](_0x1df04d['query'][_0xfaf2('0x21')]);_0x280219[_0xfaf2('0x1f')]=qs[_0xfaf2('0x1f')](_0x1df04d[_0xfaf2('0x39')]['offset']);}_0x280219[_0xfaf2('0x40')]=qs[_0xfaf2('0x41')](_0x1df04d[_0xfaf2('0x39')]['sort']);_0x280219['where']=qs[_0xfaf2('0x42')](_[_0xfaf2('0x43')](_0x1df04d[_0xfaf2('0x39')],_0x4d35b5[_0xfaf2('0x42')]),_0x262d77);if(_0x1df04d[_0xfaf2('0x39')]['filter']){_0x280219[_0xfaf2('0x44')]=_[_0xfaf2('0x45')](_0x280219[_0xfaf2('0x44')],{'$or':_[_0xfaf2('0x32')](_0x262d77,function(_0x4a860c){if(_0x4a860c['type']!=='VIRTUAL'){var _0x2b8d99={};_0x2b8d99[_0x4a860c['name']]={'$like':'%'+_0x1df04d[_0xfaf2('0x39')][_0xfaf2('0x46')]+'%'};return _0x2b8d99;}})});}_0x280219=_[_0xfaf2('0x45')]({},_0x280219,_0x1df04d[_0xfaf2('0x47')]);var _0x2af6b6={'where':_0x280219[_0xfaf2('0x44')]};return db[_0xfaf2('0x33')]['count'](_0x2af6b6)[_0xfaf2('0x2a')](function(_0x2ecf3d){_0x5817b1[_0xfaf2('0x22')]=_0x2ecf3d;if(_0x1df04d[_0xfaf2('0x39')]['includeAll']){_0x280219['include']=[{'all':!![]}];}return db[_0xfaf2('0x33')][_0xfaf2('0x48')](_0x280219);})['then'](function(_0x22284e){_0x5817b1[_0xfaf2('0x49')]=_0x22284e;return _0x5817b1;})['then'](respondWithFilteredResult(_0x2e726c,_0x280219))['catch'](handleError(_0x2e726c,null));};exports['show']=function(_0xe45a70,_0x539c3d){var _0x381bc0={'raw':![],'where':{'id':_0xe45a70[_0xfaf2('0x4a')]['id']}},_0x3d079f={};_0x3d079f[_0xfaf2('0x38')]=_[_0xfaf2('0x3a')](db[_0xfaf2('0x33')][_0xfaf2('0x34')]);_0x3d079f[_0xfaf2('0x39')]=_['keys'](_0xe45a70[_0xfaf2('0x39')]);_0x3d079f['filters']=_['intersection'](_0x3d079f[_0xfaf2('0x38')],_0x3d079f['query']);_0x381bc0[_0xfaf2('0x3c')]=_[_0xfaf2('0x3b')](_0x3d079f[_0xfaf2('0x38')],qs[_0xfaf2('0x3d')](_0xe45a70[_0xfaf2('0x39')]['fields']));_0x381bc0[_0xfaf2('0x3c')]=_0x381bc0['attributes'][_0xfaf2('0x3e')]?_0x381bc0[_0xfaf2('0x3c')]:_0x3d079f['model'];if(_0xe45a70[_0xfaf2('0x39')][_0xfaf2('0x4b')]){_0x381bc0[_0xfaf2('0x4c')]=[{'all':!![]}];}_0x381bc0=_[_0xfaf2('0x45')]({},_0x381bc0,_0xe45a70['options']);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x381bc0)[_0xfaf2('0x2a')](handleEntityNotFound(_0x539c3d,null))[_0xfaf2('0x2a')](respondWithResult(_0x539c3d,null))[_0xfaf2('0x4e')](handleError(_0x539c3d,null));};exports[_0xfaf2('0x4f')]=function(_0x3b1a95,_0x448afe){return db[_0xfaf2('0x33')][_0xfaf2('0x4f')](_0x3b1a95['body'],{})['then'](function(_0x4de5aa){var _0x559044=_0x3b1a95[_0xfaf2('0x50')]['get']({'plain':!![]});if(!_0x559044)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x559044[_0xfaf2('0x51')]===_0xfaf2('0x50')){var _0x4e2581=_0x4de5aa[_0xfaf2('0x2b')]({'plain':!![]});var _0x5a8ab4=_0xfaf2('0x52');return db[_0xfaf2('0x53')][_0xfaf2('0x4d')]({'where':{'name':_0x5a8ab4,'userProfileId':_0x559044[_0xfaf2('0x54')]},'raw':!![]})[_0xfaf2('0x2a')](function(_0x198c72){if(_0x198c72&&_0x198c72[_0xfaf2('0x55')]===0x0){return db[_0xfaf2('0x2d')][_0xfaf2('0x4f')]({'name':_0x4e2581[_0xfaf2('0x30')],'resourceId':_0x4e2581['id'],'type':'CustomReports','sectionId':_0x198c72['id']},{})['then'](function(){return _0x4de5aa;});}else{return _0x4de5aa;}})[_0xfaf2('0x4e')](function(_0x1d4d44){logger[_0xfaf2('0x2e')](_0xfaf2('0x56'),_0x1d4d44);throw _0x1d4d44;});}return _0x4de5aa;})['then'](respondWithResult(_0x448afe,0xc9))['catch'](handleError(_0x448afe,null));};exports[_0xfaf2('0x28')]=function(_0x28cf1f,_0x234e9f){if(_0x28cf1f['body']['id']){delete _0x28cf1f[_0xfaf2('0x57')]['id'];}return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x28cf1f['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x234e9f,null))[_0xfaf2('0x2a')](saveUpdates(_0x28cf1f[_0xfaf2('0x57')],null))[_0xfaf2('0x2a')](respondWithResult(_0x234e9f,null))[_0xfaf2('0x4e')](handleError(_0x234e9f,null));};exports['destroy']=function(_0x27aaf6,_0x17a331){return db[_0xfaf2('0x33')][_0xfaf2('0x4d')]({'where':{'id':_0x27aaf6['params']['id']}})[_0xfaf2('0x2a')](handleEntityNotFound(_0x17a331,null))['then'](removeEntity(_0x17a331,null))[_0xfaf2('0x4e')](handleError(_0x17a331,null));};exports[_0xfaf2('0x58')]=function(_0x4b89d7,_0x1c2810){var _0x7e8f3f=0xa;var _0x47c0d7=[_0xfaf2('0x59'),'left_join',_0xfaf2('0x5a'),'cross_join'];var _0x30988f={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x3d3677={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':_0xfaf2('0x65')};var _0x15dec1=function(_0x43c0b9){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),_0xfaf2('0x68'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x43c0b9);};var _0x4a6b65=function(_0x298f86){if(!_0x298f86||!_0x298f86['rules'][_0xfaf2('0x3e')]){return'';}for(var _0x1ee1ae='(',_0x334ccb=0x0;_0x334ccb<_0x298f86[_0xfaf2('0x69')]['length'];_0x334ccb+=0x1){_0x334ccb>0x0&&(_0x1ee1ae+='\x20'+_0x298f86[_0xfaf2('0x6a')]+'\x20');_0x1ee1ae+=_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]?_0x4a6b65(_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6b')]):_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6c')]+'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6d')]+(_0x15dec1(_0x298f86[_0xfaf2('0x69')][_0x334ccb]['condition'])?'\x20'+_0x298f86[_0xfaf2('0x69')][_0x334ccb][_0xfaf2('0x6e')]:'');}return _0x1ee1ae+')';};var _0x179c7c={'where':{'id':_0x4b89d7[_0xfaf2('0x4a')]['id']}},_0x418852,_0x53ec76,_0x55f417,_0x4781ad,_0x5c7673;_0x179c7c=_[_0xfaf2('0x45')]({},_0x179c7c,_0x4b89d7['options']);return db[_0xfaf2('0x33')]['find'](_0x179c7c)[_0xfaf2('0x2a')](function(_0x3b8e56){if(_0x3b8e56){_0x418852=_0x3b8e56;return _0x3b8e56['getFields']();}return null;})[_0xfaf2('0x2a')](function(_0x52b7c3){if(_0x52b7c3){if(!_0x52b7c3[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x53ec76=_0x52b7c3;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x333305){if(_0x333305){_0x55f417=_[_0xfaf2('0x72')](_0x333305,'id');var _0x2c6013;var _0x4aec5a=squel[_0xfaf2('0x73')]();_0x4aec5a[_0xfaf2('0x74')](_0x418852[_0xfaf2('0x75')]);for(var _0x143a1f=0x0;_0x143a1f<_0x53ec76[_0xfaf2('0x3e')];_0x143a1f+=0x1){_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x76')]?_0x55f417[_0x53ec76[_0x143a1f][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x53ec76[_0x143a1f][_0xfaf2('0x6c')];_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x78')]?_[_0xfaf2('0x79')](_0x30988f[_0x53ec76[_0x143a1f]['function']],'%s',_0x2c6013):_0x2c6013;_0x2c6013=_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]?_['replace'](_0x3d3677[_0x53ec76[_0x143a1f][_0xfaf2('0x7a')]],'%s',_0x2c6013):_0x2c6013;if(_0x53ec76[_0x143a1f]['groupBy']){_0x4aec5a[_0xfaf2('0x6b')](_0x2c6013);}_0x53ec76[_0x143a1f][_0xfaf2('0x7b')]&&_0x4aec5a[_0xfaf2('0x40')](_0x2c6013,_0x53ec76[_0x143a1f]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x4aec5a[_0xfaf2('0x6c')](_0x2c6013,_0x53ec76[_0x143a1f][_0xfaf2('0x7d')]||_0x2c6013);}if(_0x418852[_0xfaf2('0x7e')]){_0x418852[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x418852['joins']);for(var _0x2e0cec=0x0;_0x2e0cec<_0x418852[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x2e0cec+=0x1){if(_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['type']&&_[_0xfaf2('0x66')](_0x47c0d7,_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x36')])&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x80')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x81')]&&_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]){_0x4aec5a[_0x418852['joins'][_0x2e0cec][_0xfaf2('0x36')]](_0x418852[_0xfaf2('0x7e')][_0x2e0cec]['foreignTable'],null,util[_0xfaf2('0x7a')]('%s.%s\x20=\x20%s.%s',_0x418852[_0xfaf2('0x75')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x80')],_0x418852['joins'][_0x2e0cec][_0xfaf2('0x81')],_0x418852[_0xfaf2('0x7e')][_0x2e0cec][_0xfaf2('0x82')]));}}}if(_0x418852[_0xfaf2('0x83')]){_0x418852[_0xfaf2('0x83')]=JSON['parse'](_0x418852[_0xfaf2('0x83')]);_0x4aec5a[_0xfaf2('0x44')](_0x4a6b65(_0x418852['conditions'][_0xfaf2('0x6b')]));}_0x5c7673=_0x4aec5a[_0xfaf2('0x84')]();_0x4aec5a[_0xfaf2('0x21')](_0x7e8f3f);_0x4aec5a[_0xfaf2('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x4aec5a[_0xfaf2('0x85')]());return dbH['sequelize']['query'](_0x4aec5a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xfaf2('0x86')]});}})['then'](respondWithResult(_0x1c2810,null))[_0xfaf2('0x4e')](handleError(_0x1c2810,null));};function runReport(_0x40f693,_0x5c1dac,_0x52c1d9){var _0x370184=_0x5c1dac[_0xfaf2('0x30')];var _0x3bda03=0xa;var _0x8e5ccb=['join','left_join',_0xfaf2('0x5a'),_0xfaf2('0x87')];var _0x237198={'SUM':_0xfaf2('0x5b'),'COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xfaf2('0x5e'),'MIN':'MIN(%s)','AVG':_0xfaf2('0x88'),'GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':_0xfaf2('0x60'),'GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x1b0f63={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':_0xfaf2('0x62'),'HOUR':_0xfaf2('0x63'),'ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x24e83c=function(_0x3c6d41){return!_[_0xfaf2('0x66')](['IS\x20NULL',_0xfaf2('0x68'),_0xfaf2('0x8b'),_0xfaf2('0x8c')],_0x3c6d41);};var _0x443005=function(_0x8fb83c){if(!_0x8fb83c||!_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x305b54='(',_0x51dbed=0x0;_0x51dbed<_0x8fb83c[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x51dbed+=0x1){_0x51dbed>0x0&&(_0x305b54+='\x20'+_0x8fb83c[_0xfaf2('0x6a')]+'\x20');_0x305b54+=_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6b')]?_0x443005(_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['group']):_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6c')]+'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed][_0xfaf2('0x6d')]+(_0x24e83c(_0x8fb83c['rules'][_0x51dbed][_0xfaf2('0x6d')])?'\x20'+_0x8fb83c[_0xfaf2('0x69')][_0x51dbed]['value']:'');}return _0x305b54+')';};var _0x16c846={'where':{'id':_0x40f693['id']}},_0x4ba198,_0x659b1b,_0x3724a9,_0x274f5c,_0x4558c2;_0x16c846=_[_0xfaf2('0x45')]({},_0x16c846,_0x52c1d9);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x16c846)[_0xfaf2('0x2a')](function(_0x5f0c35){if(_0x5f0c35){_0x4ba198=_0x5f0c35;return _0x5f0c35[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0xa21aee){if(_0xa21aee){if(!_0xa21aee[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))][(_0xfaf2('0x70'))](_0xfaf2('0x71'),0x193);}_0x659b1b=_0xa21aee;return db[_0xfaf2('0x8e')][_0xfaf2('0x48')]({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x4bbc0e){if(_0x4bbc0e){_0x3724a9=_[_0xfaf2('0x72')](_0x4bbc0e,'id');var _0x5a59af;var _0x50a4c0=squel['select']();_0x50a4c0[_0xfaf2('0x74')](_0x4ba198[_0xfaf2('0x75')]);for(var _0x2b64c3=0x0;_0x2b64c3<_0x659b1b[_0xfaf2('0x3e')];_0x2b64c3+=0x1){_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]?_0x3724a9[_0x659b1b[_0x2b64c3][_0xfaf2('0x76')]]['metric']:_0x659b1b[_0x2b64c3]['field'];_0x5a59af=_0x659b1b[_0x2b64c3]['function']?_[_0xfaf2('0x79')](_0x237198[_0x659b1b[_0x2b64c3][_0xfaf2('0x78')]],'%s',_0x5a59af):_0x5a59af;_0x5a59af=_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x1b0f63[_0x659b1b[_0x2b64c3][_0xfaf2('0x7a')]],'%s',_0x5a59af):_0x5a59af;if(_0x659b1b[_0x2b64c3]['groupBy']){_0x50a4c0[_0xfaf2('0x6b')](_0x5a59af);}_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]&&_0x50a4c0[_0xfaf2('0x40')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7b')]===_0xfaf2('0x7c')?![]:!![]);_0x50a4c0[_0xfaf2('0x6c')](_0x5a59af,_0x659b1b[_0x2b64c3][_0xfaf2('0x7d')]||_0x5a59af);}if(_0x4ba198[_0xfaf2('0x7e')]){_0x4ba198[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x4ba198[_0xfaf2('0x7e')]);for(var _0x243692=0x0;_0x243692<_0x4ba198[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x243692+=0x1){if(_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]&&_[_0xfaf2('0x66')](_0x8e5ccb,_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')])&&_0x4ba198['joins'][_0x243692]['parentKey']&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')]&&_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]){_0x50a4c0[_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x36')]](_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x4ba198['table'],_0x4ba198['joins'][_0x243692][_0xfaf2('0x80')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x81')],_0x4ba198[_0xfaf2('0x7e')][_0x243692][_0xfaf2('0x82')]));}}}if(_0x4ba198[_0xfaf2('0x83')]){_0x4ba198[_0xfaf2('0x83')]=JSON['parse'](_0x4ba198[_0xfaf2('0x83')]);_0x50a4c0[_0xfaf2('0x44')](_0x443005(_0x4ba198[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x4558c2=_0x50a4c0[_0xfaf2('0x84')]();_0x50a4c0['limit'](_0x3bda03);_0x50a4c0[_0xfaf2('0x1f')](0x0);return;}})[_0xfaf2('0x2a')](function(){if(_0x5c1dac[_0xfaf2('0x90')]===_0xfaf2('0x91')){return null;}var _0x9c3608=_[_0xfaf2('0x45')](_0x5c1dac,{'name':_0x5c1dac[_0xfaf2('0x92')]||_0x5c1dac[_0xfaf2('0x30')]||_0x4ba198[_0xfaf2('0x30')],'basename':_0x370184,'savename':util['format'](_0xfaf2('0x93'),_0x5c1dac['name']||_0x4ba198['name'],require(_0xfaf2('0x94'))[_0xfaf2('0x95')](0x4),_0x5c1dac[_0xfaf2('0x90')]||'csv'),'reportId':_0x4ba198['id'],'reportType':_0xfaf2('0x96')});return db[_0xfaf2('0x97')][_0xfaf2('0x4f')](_0x9c3608,{'raw':!![]});})['then'](function(_0x10b0ef){if(_0x4ba198[_0xfaf2('0x75')]==='cdr'){_0x4558c2[_0xfaf2('0x44')](_0x4ba198[_0xfaf2('0x75')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5c1dac[_0xfaf2('0x98')],_0x5c1dac[_0xfaf2('0x99')]);}else{_0x4558c2[_0xfaf2('0x44')](_0x4ba198['table']+_0xfaf2('0x9a'),_0x5c1dac['startDate'],_0x5c1dac['endDate']);}if(_0x10b0ef){logger[_0xfaf2('0x9b')]('Run\x20Query:',_0x4558c2['toString']());require(_0xfaf2('0x9c'))[_0xfaf2('0x9d')](path[_0xfaf2('0x59')](__dirname,'../../components/export/',_0x10b0ef[_0xfaf2('0x90')]),[_0x10b0ef['id'],_0x4558c2[_0xfaf2('0x85')](),path[_0xfaf2('0x59')](__dirname,_0xfaf2('0x9e'),_0x10b0ef['savename']),_0x370184]);return _0x10b0ef;}else{var _0x3fe47c=squel[_0xfaf2('0x73')]();_0x3fe47c[_0xfaf2('0x74')]('('+_0x4558c2[_0xfaf2('0x85')]()+')',_0xfaf2('0x9f'));_0x3fe47c[_0xfaf2('0x6c')](_0xfaf2('0xa0'),'count');_0x4558c2[_0xfaf2('0x21')](_0x5c1dac['limit']||_0x3bda03);_0x4558c2['offset'](_0x5c1dac[_0xfaf2('0x1f')]||0x0);return dbH[_0xfaf2('0xa1')]['query'](_0x3fe47c[_0xfaf2('0x85')](),{'type':dbH['sequelize'][_0xfaf2('0xa2')][_0xfaf2('0x86')]})[_0xfaf2('0x2a')](function(_0x29031a){if(!_0x29031a[_0xfaf2('0x3e')]){_0x274f5c=0x0;}else{_0x274f5c=_0x29031a[0x0][_0xfaf2('0x22')]||0x0;}return dbH['sequelize'][_0xfaf2('0x39')](_0x4558c2[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')][_0xfaf2('0x86')]});})[_0xfaf2('0x2a')](function(_0x453ab7){return{'rows':_0x453ab7||[],'count':_0x274f5c};});}});}exports[_0xfaf2('0xa3')]=function(_0x1d067a,_0x2a66e4){return runReport(_0x1d067a[_0xfaf2('0x4a')],_0x1d067a[_0xfaf2('0x39')],_0x1d067a[_0xfaf2('0x47')])[_0xfaf2('0x2a')](respondWithResult(_0x2a66e4,null))['catch'](handleError(_0x2a66e4,null));};exports[_0xfaf2('0xa4')]=runReport;exports[_0xfaf2('0x39')]=function(_0x44f585,_0x53b8b0){var _0x57cf1a=0xa;var _0x2a25a9=['join',_0xfaf2('0xa5'),_0xfaf2('0x5a'),'cross_join'];var _0x299f69={'SUM':'SUM(%s)','COUNT':_0xfaf2('0x5c'),'COUNT DISTINCT':_0xfaf2('0x5d'),'MAX':_0xfaf2('0x5e'),'MIN':_0xfaf2('0x5f'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfaf2('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xfaf2('0x61')};var _0x164c28={'SEC_TO_TIME':_0xfaf2('0x8a'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xfaf2('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x512563=function(_0x31bd06){return!_[_0xfaf2('0x66')]([_0xfaf2('0x67'),'IS\x20NOT\x20NULL',_0xfaf2('0x8b'),'IS\x20NOT\x20EMPTY'],_0x31bd06);};var _0x59484d=function(_0x52e7c8){if(!_0x52e7c8||!_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')]){return'';}for(var _0x405098='(',_0x3050d1=0x0;_0x3050d1<_0x52e7c8[_0xfaf2('0x69')][_0xfaf2('0x3e')];_0x3050d1+=0x1){_0x3050d1>0x0&&(_0x405098+='\x20'+_0x52e7c8[_0xfaf2('0x6a')]+'\x20');_0x405098+=_0x52e7c8[_0xfaf2('0x69')][_0x3050d1]['group']?_0x59484d(_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6b')]):_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6c')]+'\x20'+_0x52e7c8['rules'][_0x3050d1][_0xfaf2('0x6d')]+(_0x512563(_0x52e7c8['rules'][_0x3050d1]['condition'])?'\x20'+_0x52e7c8[_0xfaf2('0x69')][_0x3050d1][_0xfaf2('0x6e')]:'');}return _0x405098+')';};var _0x2eda44={'where':{'id':_0x44f585[_0xfaf2('0x4a')]['id']}},_0x37a04c,_0x4868a7,_0x3bbb6a,_0x35bd7b,_0x7fbe67;_0x2eda44=_[_0xfaf2('0x45')]({},_0x2eda44,_0x44f585[_0xfaf2('0x47')]);return db[_0xfaf2('0x33')][_0xfaf2('0x4d')](_0x2eda44)[_0xfaf2('0x2a')](function(_0x3ae28e){if(_0x3ae28e){_0x37a04c=_0x3ae28e;return _0x3ae28e[_0xfaf2('0x8d')]();}return null;})[_0xfaf2('0x2a')](function(_0x5e54ef){if(_0x5e54ef){if(!_0x5e54ef[_0xfaf2('0x3e')]){throw new db[(_0xfaf2('0x6f'))]['ValidationErrorItem'](_0xfaf2('0x71'),0x193);}_0x4868a7=_0x5e54ef;return db[_0xfaf2('0x8e')]['findAll']({'raw':!![]});}return null;})[_0xfaf2('0x2a')](function(_0x173782){if(_0x173782){_0x3bbb6a=_['keyBy'](_0x173782,'id');var _0x53bba4;var _0x48397c=squel[_0xfaf2('0x73')]();_0x48397c[_0xfaf2('0x74')](_0x37a04c['table']);for(var _0x3086bc=0x0;_0x3086bc<_0x4868a7['length'];_0x3086bc+=0x1){_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x76')]?_0x3bbb6a[_0x4868a7[_0x3086bc][_0xfaf2('0x76')]][_0xfaf2('0x77')]:_0x4868a7[_0x3086bc][_0xfaf2('0x6c')];_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x78')]?_['replace'](_0x299f69[_0x4868a7[_0x3086bc][_0xfaf2('0x78')]],'%s',_0x53bba4):_0x53bba4;_0x53bba4=_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]?_[_0xfaf2('0x79')](_0x164c28[_0x4868a7[_0x3086bc][_0xfaf2('0x7a')]],'%s',_0x53bba4):_0x53bba4;if(_0x4868a7[_0x3086bc][_0xfaf2('0xa6')]){_0x48397c[_0xfaf2('0x6b')](_0x53bba4);}_0x4868a7[_0x3086bc]['orderBy']&&_0x48397c[_0xfaf2('0x40')](_0x53bba4,_0x4868a7[_0x3086bc]['orderBy']===_0xfaf2('0x7c')?![]:!![]);_0x48397c[_0xfaf2('0x6c')](_0x53bba4,_0x4868a7[_0x3086bc][_0xfaf2('0x7d')]||_0x53bba4);}if(_0x37a04c[_0xfaf2('0x7e')]){_0x37a04c[_0xfaf2('0x7e')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x7e')]);for(var _0x32779b=0x0;_0x32779b<_0x37a04c[_0xfaf2('0x7e')][_0xfaf2('0x3e')];_0x32779b+=0x1){if(_0x37a04c['joins'][_0x32779b][_0xfaf2('0x36')]&&_['includes'](_0x2a25a9,_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')])&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')]&&_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]){_0x48397c[_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x36')]](_0x37a04c[_0xfaf2('0x7e')][_0x32779b]['foreignTable'],null,util[_0xfaf2('0x7a')](_0xfaf2('0x8f'),_0x37a04c[_0xfaf2('0x75')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x80')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x81')],_0x37a04c[_0xfaf2('0x7e')][_0x32779b][_0xfaf2('0x82')]));}}}if(_0x37a04c[_0xfaf2('0x83')]){_0x37a04c[_0xfaf2('0x83')]=JSON[_0xfaf2('0x7f')](_0x37a04c[_0xfaf2('0x83')]);_0x48397c[_0xfaf2('0x44')](_0x59484d(_0x37a04c[_0xfaf2('0x83')][_0xfaf2('0x6b')]));}_0x7fbe67=_0x48397c[_0xfaf2('0x84')]();_0x48397c['limit'](_0x57cf1a);_0x48397c['offset'](0x0);logger[_0xfaf2('0xa7')]('Limited\x20Query:',_0x48397c[_0xfaf2('0x85')]());return dbH[_0xfaf2('0xa1')][_0xfaf2('0x39')](_0x48397c[_0xfaf2('0x85')](),{'type':dbH[_0xfaf2('0xa1')][_0xfaf2('0xa2')]['SELECT']});}})['then'](function(){return{'sql':_0x7fbe67[_0xfaf2('0x85')]()};})[_0xfaf2('0x2a')](respondWithResult(_0x53b8b0,null))[_0xfaf2('0x4e')](handleError(_0x53b8b0,null));};
\ No newline at end of file
+var _0xeb5e=['../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','then','get','CustomReports','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','count','includeAll','AnalyticCustomReport','findAll','catch','show','params','length','include','options','create','body','role','user','Reports','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','table','foreignTable','conditions','clone','toString','sequelize','SELECT','left_join','right_join','DATE(%s)','IS\x20NULL','value','keyBy','output','web','fullPath','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','QueryTypes','run','Please\x20insert\x20at\x20least\x20one\x20field','debug','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x393f01,_0x2dba17){var _0x2adc57=function(_0x52c9b6){while(--_0x52c9b6){_0x393f01['push'](_0x393f01['shift']());}};_0x2adc57(++_0x2dba17);}(_0xeb5e,0x134));var _0xeeb5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xeb5e[_0x18ab2a];return _0x16dcee;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeeb5('0x0'));var zipdir=require(_0xeeb5('0x1'));var jsonpatch=require(_0xeeb5('0x2'));var rp=require(_0xeeb5('0x3'));var moment=require(_0xeeb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeeb5('0x5'));var util=require(_0xeeb5('0x6'));var path=require('path');var sox=require(_0xeeb5('0x7'));var csv=require(_0xeeb5('0x8'));var ejs=require(_0xeeb5('0x9'));var fs=require('fs');var fs_extra=require(_0xeeb5('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xeeb5('0xb'));var jsforce=require(_0xeeb5('0xc'));var deskjs=require(_0xeeb5('0xd'));var toCsv=require(_0xeeb5('0x8'));var querystring=require(_0xeeb5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xeeb5('0xf'));var qs=require(_0xeeb5('0x10'));var as=require(_0xeeb5('0x11'));var hardwareService=require(_0xeeb5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xeeb5('0x13'));var config=require(_0xeeb5('0x14'));var licenseUtil=require(_0xeeb5('0x15'));var db=require(_0xeeb5('0x16'))['db'];var dbH=require(_0xeeb5('0x16'))[_0xeeb5('0x17')];function respondWithStatusCode(_0xc681fc,_0x539677){_0x539677=_0x539677||0xcc;return function(_0x14d7f7){if(_0x14d7f7){return _0xc681fc['sendStatus'](_0x539677);}return _0xc681fc[_0xeeb5('0x18')](_0x539677)['end']();};}function respondWithResult(_0x4a4b47,_0x3a6205){_0x3a6205=_0x3a6205||0xc8;return function(_0x24daa5){if(_0x24daa5){return _0x4a4b47[_0xeeb5('0x18')](_0x3a6205)[_0xeeb5('0x19')](_0x24daa5);}};}function respondWithFilteredResult(_0xd3ac3d,_0x145ae8){return function(_0x482ed7){if(_0x482ed7){var _0x201020=typeof _0x145ae8[_0xeeb5('0x1a')]===_0xeeb5('0x1b')&&typeof _0x145ae8[_0xeeb5('0x1c')]===_0xeeb5('0x1b');var _0x5db57a=_0x482ed7['count'];var _0xd8433b=_0x201020?0x0:_0x145ae8['offset'];var _0x97bb78=_0x201020?_0x482ed7['count']:_0x145ae8[_0xeeb5('0x1a')]+_0x145ae8[_0xeeb5('0x1c')];var _0xc639ce;if(_0x97bb78>=_0x5db57a){_0x97bb78=_0x5db57a;_0xc639ce=0xc8;}else{_0xc639ce=0xce;}_0xd3ac3d[_0xeeb5('0x18')](_0xc639ce);return _0xd3ac3d[_0xeeb5('0x1d')]('Content-Range',_0xd8433b+'-'+_0x97bb78+'/'+_0x5db57a)[_0xeeb5('0x19')](_0x482ed7);}return null;};}function patchUpdates(_0x115bed){return function(_0x1c507b){try{jsonpatch[_0xeeb5('0x1e')](_0x1c507b,_0x115bed,!![]);}catch(_0x1fb3a8){return BPromise[_0xeeb5('0x1f')](_0x1fb3a8);}return _0x1c507b[_0xeeb5('0x20')]();};}function saveUpdates(_0x144173,_0x54049a){return function(_0x36b1ea){if(_0x36b1ea){return _0x36b1ea[_0xeeb5('0x21')](_0x144173)['then'](function(_0x9bfb84){return _0x9bfb84;});}return null;};}function removeEntity(_0x4482ab,_0x4c2cc6){return function(_0x5206d9){if(_0x5206d9){return _0x5206d9[_0xeeb5('0x22')]()[_0xeeb5('0x23')](function(){var _0x1bb6d9=_0x5206d9[_0xeeb5('0x24')]({'plain':!![]});var _0x57e16b=_0xeeb5('0x25');return db[_0xeeb5('0x26')][_0xeeb5('0x22')]({'where':{'type':_0x57e16b,'resourceId':_0x1bb6d9['id']}})['then'](function(){return _0x5206d9;});})[_0xeeb5('0x23')](function(){_0x4482ab[_0xeeb5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b7ca2,_0x4270ab){return function(_0x51d3dc){if(!_0x51d3dc){_0x3b7ca2[_0xeeb5('0x27')](0x194);}return _0x51d3dc;};}function handleError(_0x175301,_0x158adf){_0x158adf=_0x158adf||0x1f4;return function(_0x1bfeb6){logger[_0xeeb5('0x28')](_0x1bfeb6[_0xeeb5('0x29')]);if(_0x1bfeb6[_0xeeb5('0x2a')]){delete _0x1bfeb6['name'];}_0x175301[_0xeeb5('0x18')](_0x158adf)[_0xeeb5('0x2b')](_0x1bfeb6);};}exports[_0xeeb5('0x2c')]=function(_0x5b2174,_0x142d64){var _0x46de1c={},_0x1518a7={},_0x1fcc37={'count':0x0,'rows':[]};var _0x3eaa2f=_['map'](db['AnalyticCustomReport'][_0xeeb5('0x2d')],function(_0x77064a){return{'name':_0x77064a[_0xeeb5('0x2e')],'type':_0x77064a['type']['key']};});_0x1518a7['model']=_['map'](_0x3eaa2f,_0xeeb5('0x2a'));_0x1518a7[_0xeeb5('0x2f')]=_[_0xeeb5('0x30')](_0x5b2174[_0xeeb5('0x2f')]);_0x1518a7[_0xeeb5('0x31')]=_['intersection'](_0x1518a7[_0xeeb5('0x32')],_0x1518a7[_0xeeb5('0x2f')]);_0x46de1c[_0xeeb5('0x33')]=_[_0xeeb5('0x34')](_0x1518a7[_0xeeb5('0x32')],qs['fields'](_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x35')]));_0x46de1c[_0xeeb5('0x33')]=_0x46de1c[_0xeeb5('0x33')]['length']?_0x46de1c[_0xeeb5('0x33')]:_0x1518a7[_0xeeb5('0x32')];if(!_0x5b2174['query'][_0xeeb5('0x36')](_0xeeb5('0x37'))){_0x46de1c[_0xeeb5('0x1c')]=qs[_0xeeb5('0x1c')](_0x5b2174[_0xeeb5('0x2f')]['limit']);_0x46de1c[_0xeeb5('0x1a')]=qs[_0xeeb5('0x1a')](_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x1a')]);}_0x46de1c[_0xeeb5('0x38')]=qs[_0xeeb5('0x39')](_0x5b2174[_0xeeb5('0x2f')]['sort']);_0x46de1c[_0xeeb5('0x3a')]=qs[_0xeeb5('0x31')](_[_0xeeb5('0x3b')](_0x5b2174[_0xeeb5('0x2f')],_0x1518a7['filters']),_0x3eaa2f);if(_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x3c')]){_0x46de1c[_0xeeb5('0x3a')]=_['merge'](_0x46de1c[_0xeeb5('0x3a')],{'$or':_[_0xeeb5('0x3d')](_0x3eaa2f,function(_0x4f9021){if(_0x4f9021[_0xeeb5('0x3e')]!==_0xeeb5('0x3f')){var _0xa92a9f={};_0xa92a9f[_0x4f9021[_0xeeb5('0x2a')]]={'$like':'%'+_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x3c')]+'%'};return _0xa92a9f;}})});}_0x46de1c=_[_0xeeb5('0x40')]({},_0x46de1c,_0x5b2174['options']);var _0x57a0cf={'where':_0x46de1c[_0xeeb5('0x3a')]};return db['AnalyticCustomReport'][_0xeeb5('0x41')](_0x57a0cf)[_0xeeb5('0x23')](function(_0x5a157c){_0x1fcc37[_0xeeb5('0x41')]=_0x5a157c;if(_0x5b2174[_0xeeb5('0x2f')][_0xeeb5('0x42')]){_0x46de1c['include']=[{'all':!![]}];}return db[_0xeeb5('0x43')][_0xeeb5('0x44')](_0x46de1c);})[_0xeeb5('0x23')](function(_0xadb3a4){_0x1fcc37['rows']=_0xadb3a4;return _0x1fcc37;})[_0xeeb5('0x23')](respondWithFilteredResult(_0x142d64,_0x46de1c))[_0xeeb5('0x45')](handleError(_0x142d64,null));};exports[_0xeeb5('0x46')]=function(_0x527651,_0x3021c0){var _0x4bd15f={'raw':![],'where':{'id':_0x527651[_0xeeb5('0x47')]['id']}},_0x1b177b={};_0x1b177b['model']=_[_0xeeb5('0x30')](db[_0xeeb5('0x43')][_0xeeb5('0x2d')]);_0x1b177b['query']=_[_0xeeb5('0x30')](_0x527651[_0xeeb5('0x2f')]);_0x1b177b[_0xeeb5('0x31')]=_[_0xeeb5('0x34')](_0x1b177b[_0xeeb5('0x32')],_0x1b177b['query']);_0x4bd15f['attributes']=_[_0xeeb5('0x34')](_0x1b177b[_0xeeb5('0x32')],qs['fields'](_0x527651[_0xeeb5('0x2f')][_0xeeb5('0x35')]));_0x4bd15f[_0xeeb5('0x33')]=_0x4bd15f[_0xeeb5('0x33')][_0xeeb5('0x48')]?_0x4bd15f[_0xeeb5('0x33')]:_0x1b177b[_0xeeb5('0x32')];if(_0x527651[_0xeeb5('0x2f')][_0xeeb5('0x42')]){_0x4bd15f[_0xeeb5('0x49')]=[{'all':!![]}];}_0x4bd15f=_['merge']({},_0x4bd15f,_0x527651[_0xeeb5('0x4a')]);return db[_0xeeb5('0x43')]['find'](_0x4bd15f)[_0xeeb5('0x23')](handleEntityNotFound(_0x3021c0,null))['then'](respondWithResult(_0x3021c0,null))[_0xeeb5('0x45')](handleError(_0x3021c0,null));};exports['create']=function(_0x5199f1,_0x1da7b0){return db[_0xeeb5('0x43')][_0xeeb5('0x4b')](_0x5199f1[_0xeeb5('0x4c')],{})[_0xeeb5('0x23')](function(_0x5c3c0f){var _0xe3aa24=_0x5199f1['user'][_0xeeb5('0x24')]({'plain':!![]});if(!_0xe3aa24)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe3aa24[_0xeeb5('0x4d')]===_0xeeb5('0x4e')){var _0x37cc77=_0x5c3c0f[_0xeeb5('0x24')]({'plain':!![]});var _0x291245=_0xeeb5('0x4f');return db[_0xeeb5('0x50')][_0xeeb5('0x51')]({'where':{'name':_0x291245,'userProfileId':_0xe3aa24[_0xeeb5('0x52')]},'raw':!![]})[_0xeeb5('0x23')](function(_0x43470a){if(_0x43470a&&_0x43470a[_0xeeb5('0x53')]===0x0){return db[_0xeeb5('0x26')][_0xeeb5('0x4b')]({'name':_0x37cc77[_0xeeb5('0x2a')],'resourceId':_0x37cc77['id'],'type':'CustomReports','sectionId':_0x43470a['id']},{})[_0xeeb5('0x23')](function(){return _0x5c3c0f;});}else{return _0x5c3c0f;}})[_0xeeb5('0x45')](function(_0x149724){logger['error'](_0xeeb5('0x54'),_0x149724);throw _0x149724;});}return _0x5c3c0f;})['then'](respondWithResult(_0x1da7b0,0xc9))[_0xeeb5('0x45')](handleError(_0x1da7b0,null));};exports[_0xeeb5('0x21')]=function(_0x2277cc,_0x355eff){if(_0x2277cc[_0xeeb5('0x4c')]['id']){delete _0x2277cc['body']['id'];}return db[_0xeeb5('0x43')]['find']({'where':{'id':_0x2277cc[_0xeeb5('0x47')]['id']}})[_0xeeb5('0x23')](handleEntityNotFound(_0x355eff,null))['then'](saveUpdates(_0x2277cc[_0xeeb5('0x4c')],null))[_0xeeb5('0x23')](respondWithResult(_0x355eff,null))[_0xeeb5('0x45')](handleError(_0x355eff,null));};exports[_0xeeb5('0x22')]=function(_0x83dcd4,_0x4b3568){return db[_0xeeb5('0x43')]['find']({'where':{'id':_0x83dcd4['params']['id']}})[_0xeeb5('0x23')](handleEntityNotFound(_0x4b3568,null))['then'](removeEntity(_0x4b3568,null))[_0xeeb5('0x45')](handleError(_0x4b3568,null));};exports[_0xeeb5('0x55')]=function(_0x226056,_0x1725b8){var _0xe8f999=0xa;var _0x348209=[_0xeeb5('0x56'),'left_join','right_join',_0xeeb5('0x57')];var _0x25aee1={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':_0xeeb5('0x5a'),'MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':_0xeeb5('0x5d'),'GROUP_CONCAT':_0xeeb5('0x5e'),'GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x3b4846={'SEC_TO_TIME':_0xeeb5('0x61'),'DATE':'DATE(%s)','HOUR':_0xeeb5('0x62'),'ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':_0xeeb5('0x64')};var _0x539a8a=function(_0x1e624e){return!_[_0xeeb5('0x65')](['IS\x20NULL',_0xeeb5('0x66'),_0xeeb5('0x67'),_0xeeb5('0x68')],_0x1e624e);};var _0x47ec23=function(_0x17a858){if(!_0x17a858||!_0x17a858[_0xeeb5('0x69')][_0xeeb5('0x48')]){return'';}for(var _0x334f6f='(',_0x153485=0x0;_0x153485<_0x17a858[_0xeeb5('0x69')][_0xeeb5('0x48')];_0x153485+=0x1){_0x153485>0x0&&(_0x334f6f+='\x20'+_0x17a858[_0xeeb5('0x6a')]+'\x20');_0x334f6f+=_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6b')]?_0x47ec23(_0x17a858[_0xeeb5('0x69')][_0x153485]['group']):_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6c')]+'\x20'+_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6d')]+(_0x539a8a(_0x17a858[_0xeeb5('0x69')][_0x153485][_0xeeb5('0x6d')])?'\x20'+_0x17a858[_0xeeb5('0x69')][_0x153485]['value']:'');}return _0x334f6f+')';};var _0x68d3a7={'where':{'id':_0x226056[_0xeeb5('0x47')]['id']}},_0x4414e5,_0x34edeb,_0x5edf4f,_0x3fcd6e,_0x17a6b4;_0x68d3a7=_['merge']({},_0x68d3a7,_0x226056[_0xeeb5('0x4a')]);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x68d3a7)[_0xeeb5('0x23')](function(_0x52c262){if(_0x52c262){_0x4414e5=_0x52c262;return _0x52c262[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x5d3e32){if(_0x5d3e32){if(!_0x5d3e32[_0xeeb5('0x48')]){throw new db[(_0xeeb5('0x6f'))][(_0xeeb5('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x34edeb=_0x5d3e32;return db[_0xeeb5('0x71')]['findAll']({'raw':!![]});}return null;})[_0xeeb5('0x23')](function(_0x166577){if(_0x166577){_0x5edf4f=_['keyBy'](_0x166577,'id');var _0x40e58b;var _0x18bdb7=squel[_0xeeb5('0x72')]();_0x18bdb7[_0xeeb5('0x73')](_0x4414e5['table']);for(var _0x10f8fd=0x0;_0x10f8fd<_0x34edeb['length'];_0x10f8fd+=0x1){_0x40e58b=_0x34edeb[_0x10f8fd]['MetricId']?_0x5edf4f[_0x34edeb[_0x10f8fd][_0xeeb5('0x74')]][_0xeeb5('0x75')]:_0x34edeb[_0x10f8fd][_0xeeb5('0x6c')];_0x40e58b=_0x34edeb[_0x10f8fd][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x25aee1[_0x34edeb[_0x10f8fd][_0xeeb5('0x76')]],'%s',_0x40e58b):_0x40e58b;_0x40e58b=_0x34edeb[_0x10f8fd][_0xeeb5('0x78')]?_[_0xeeb5('0x77')](_0x3b4846[_0x34edeb[_0x10f8fd]['format']],'%s',_0x40e58b):_0x40e58b;if(_0x34edeb[_0x10f8fd][_0xeeb5('0x79')]){_0x18bdb7['group'](_0x40e58b);}_0x34edeb[_0x10f8fd]['orderBy']&&_0x18bdb7['order'](_0x40e58b,_0x34edeb[_0x10f8fd][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x18bdb7[_0xeeb5('0x6c')](_0x40e58b,_0x34edeb[_0x10f8fd][_0xeeb5('0x7c')]||_0x40e58b);}if(_0x4414e5[_0xeeb5('0x7d')]){_0x4414e5[_0xeeb5('0x7d')]=JSON[_0xeeb5('0x7e')](_0x4414e5[_0xeeb5('0x7d')]);for(var _0x3c5892=0x0;_0x3c5892<_0x4414e5[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x3c5892+=0x1){if(_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x3e')]&&_[_0xeeb5('0x65')](_0x348209,_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['type'])&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x7f')]&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['foreignTable']&&_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x80')]){_0x18bdb7[_0x4414e5['joins'][_0x3c5892][_0xeeb5('0x3e')]](_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['foreignTable'],null,util[_0xeeb5('0x78')](_0xeeb5('0x81'),_0x4414e5[_0xeeb5('0x82')],_0x4414e5[_0xeeb5('0x7d')][_0x3c5892]['parentKey'],_0x4414e5['joins'][_0x3c5892][_0xeeb5('0x83')],_0x4414e5[_0xeeb5('0x7d')][_0x3c5892][_0xeeb5('0x80')]));}}}if(_0x4414e5['conditions']){_0x4414e5[_0xeeb5('0x84')]=JSON[_0xeeb5('0x7e')](_0x4414e5['conditions']);_0x18bdb7[_0xeeb5('0x3a')](_0x47ec23(_0x4414e5[_0xeeb5('0x84')][_0xeeb5('0x6b')]));}_0x17a6b4=_0x18bdb7[_0xeeb5('0x85')]();_0x18bdb7['limit'](_0xe8f999);_0x18bdb7[_0xeeb5('0x1a')](0x0);logger['debug']('Limited\x20Query:',_0x18bdb7[_0xeeb5('0x86')]());return dbH[_0xeeb5('0x87')][_0xeeb5('0x2f')](_0x18bdb7[_0xeeb5('0x86')](),{'type':dbH[_0xeeb5('0x87')]['QueryTypes'][_0xeeb5('0x88')]});}})[_0xeeb5('0x23')](respondWithResult(_0x1725b8,null))[_0xeeb5('0x45')](handleError(_0x1725b8,null));};function runReport(_0x539bcf,_0x1ad28a,_0x3396ec){var _0x17ba20=_0x1ad28a[_0xeeb5('0x2a')];var _0x1df7ca=0xa;var _0x159ef3=[_0xeeb5('0x56'),_0xeeb5('0x89'),_0xeeb5('0x8a'),_0xeeb5('0x57')];var _0x2491bf={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xeeb5('0x5e'),'GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x3ed4c5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeeb5('0x8b'),'HOUR':'HOUR(%s)','ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x13070a=function(_0x37a844){return!_['includes']([_0xeeb5('0x8c'),_0xeeb5('0x66'),_0xeeb5('0x67'),_0xeeb5('0x68')],_0x37a844);};var _0x3c43a3=function(_0x376a51){if(!_0x376a51||!_0x376a51['rules'][_0xeeb5('0x48')]){return'';}for(var _0x5989f4='(',_0xf85c70=0x0;_0xf85c70<_0x376a51[_0xeeb5('0x69')]['length'];_0xf85c70+=0x1){_0xf85c70>0x0&&(_0x5989f4+='\x20'+_0x376a51[_0xeeb5('0x6a')]+'\x20');_0x5989f4+=_0x376a51['rules'][_0xf85c70]['group']?_0x3c43a3(_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x6b')]):_0x376a51['rules'][_0xf85c70][_0xeeb5('0x6c')]+'\x20'+_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x6d')]+(_0x13070a(_0x376a51['rules'][_0xf85c70][_0xeeb5('0x6d')])?'\x20'+_0x376a51[_0xeeb5('0x69')][_0xf85c70][_0xeeb5('0x8d')]:'');}return _0x5989f4+')';};var _0x72926a={'where':{'id':_0x539bcf['id']}},_0x45a35c,_0x55629a,_0x4f1e70,_0x1830d0,_0x5db4aa;_0x72926a=_[_0xeeb5('0x40')]({},_0x72926a,_0x3396ec);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x72926a)[_0xeeb5('0x23')](function(_0xd013ed){if(_0xd013ed){_0x45a35c=_0xd013ed;return _0xd013ed[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x56c10f){if(_0x56c10f){if(!_0x56c10f[_0xeeb5('0x48')]){throw new db['Sequelize'][(_0xeeb5('0x70'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x55629a=_0x56c10f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x5aa3b6){if(_0x5aa3b6){_0x4f1e70=_[_0xeeb5('0x8e')](_0x5aa3b6,'id');var _0xf27fe0;var _0x1e1e19=squel[_0xeeb5('0x72')]();_0x1e1e19[_0xeeb5('0x73')](_0x45a35c[_0xeeb5('0x82')]);for(var _0x1a9d69=0x0;_0x1a9d69<_0x55629a[_0xeeb5('0x48')];_0x1a9d69+=0x1){_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x74')]?_0x4f1e70[_0x55629a[_0x1a9d69][_0xeeb5('0x74')]]['metric']:_0x55629a[_0x1a9d69][_0xeeb5('0x6c')];_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x2491bf[_0x55629a[_0x1a9d69]['function']],'%s',_0xf27fe0):_0xf27fe0;_0xf27fe0=_0x55629a[_0x1a9d69][_0xeeb5('0x78')]?_[_0xeeb5('0x77')](_0x3ed4c5[_0x55629a[_0x1a9d69]['format']],'%s',_0xf27fe0):_0xf27fe0;if(_0x55629a[_0x1a9d69]['groupBy']){_0x1e1e19[_0xeeb5('0x6b')](_0xf27fe0);}_0x55629a[_0x1a9d69][_0xeeb5('0x7a')]&&_0x1e1e19['order'](_0xf27fe0,_0x55629a[_0x1a9d69][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x1e1e19[_0xeeb5('0x6c')](_0xf27fe0,_0x55629a[_0x1a9d69]['alias']||_0xf27fe0);}if(_0x45a35c[_0xeeb5('0x7d')]){_0x45a35c[_0xeeb5('0x7d')]=JSON['parse'](_0x45a35c[_0xeeb5('0x7d')]);for(var _0x394710=0x0;_0x394710<_0x45a35c[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x394710+=0x1){if(_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x3e')]&&_[_0xeeb5('0x65')](_0x159ef3,_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x3e')])&&_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x7f')]&&_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')]&&_0x45a35c[_0xeeb5('0x7d')][_0x394710]['foreignKey']){_0x1e1e19[_0x45a35c['joins'][_0x394710][_0xeeb5('0x3e')]](_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')],null,util[_0xeeb5('0x78')](_0xeeb5('0x81'),_0x45a35c[_0xeeb5('0x82')],_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x7f')],_0x45a35c[_0xeeb5('0x7d')][_0x394710][_0xeeb5('0x83')],_0x45a35c[_0xeeb5('0x7d')][_0x394710]['foreignKey']));}}}if(_0x45a35c[_0xeeb5('0x84')]){_0x45a35c['conditions']=JSON['parse'](_0x45a35c[_0xeeb5('0x84')]);_0x1e1e19[_0xeeb5('0x3a')](_0x3c43a3(_0x45a35c['conditions'][_0xeeb5('0x6b')]));}_0x5db4aa=_0x1e1e19[_0xeeb5('0x85')]();_0x1e1e19[_0xeeb5('0x1c')](_0x1df7ca);_0x1e1e19[_0xeeb5('0x1a')](0x0);return;}})[_0xeeb5('0x23')](function(){if(_0x1ad28a[_0xeeb5('0x8f')]===_0xeeb5('0x90')){return null;}var _0x43ad2d=_[_0xeeb5('0x40')](_0x1ad28a,{'name':_0x1ad28a[_0xeeb5('0x91')]||_0x1ad28a[_0xeeb5('0x2a')]||_0x45a35c[_0xeeb5('0x2a')],'basename':_0x17ba20,'savename':util[_0xeeb5('0x78')]('%s-%s.%s',_0x1ad28a['name']||_0x45a35c[_0xeeb5('0x2a')],require(_0xeeb5('0x92'))['generate'](0x4),_0x1ad28a[_0xeeb5('0x8f')]||_0xeeb5('0x93')),'reportId':_0x45a35c['id'],'reportType':'custom'});return db[_0xeeb5('0x94')][_0xeeb5('0x4b')](_0x43ad2d,{'raw':!![]});})[_0xeeb5('0x23')](function(_0x466c54){if(_0x45a35c[_0xeeb5('0x82')]==='cdr'){_0x5db4aa[_0xeeb5('0x3a')](_0x45a35c[_0xeeb5('0x82')]+_0xeeb5('0x95'),_0x1ad28a[_0xeeb5('0x96')],_0x1ad28a[_0xeeb5('0x97')]);}else{_0x5db4aa[_0xeeb5('0x3a')](_0x45a35c['table']+_0xeeb5('0x98'),_0x1ad28a[_0xeeb5('0x96')],_0x1ad28a[_0xeeb5('0x97')]);}if(_0x466c54){logger[_0xeeb5('0x99')](_0xeeb5('0x9a'),_0x5db4aa[_0xeeb5('0x86')]());require('child_process')['fork'](path[_0xeeb5('0x56')](__dirname,_0xeeb5('0x9b'),_0x466c54[_0xeeb5('0x8f')]),[_0x466c54['id'],_0x5db4aa[_0xeeb5('0x86')](),path[_0xeeb5('0x56')](__dirname,_0xeeb5('0x9c'),_0x466c54[_0xeeb5('0x9d')]),_0x17ba20]);return _0x466c54;}else{var _0x1d5286=squel['select']();_0x1d5286[_0xeeb5('0x73')]('('+_0x5db4aa[_0xeeb5('0x86')]()+')','countTable');_0x1d5286[_0xeeb5('0x6c')](_0xeeb5('0x9e'),'count');_0x5db4aa['limit'](_0x1ad28a[_0xeeb5('0x1c')]||_0x1df7ca);_0x5db4aa[_0xeeb5('0x1a')](_0x1ad28a[_0xeeb5('0x1a')]||0x0);return dbH['sequelize'][_0xeeb5('0x2f')](_0x1d5286['toString'](),{'type':dbH['sequelize'][_0xeeb5('0x9f')][_0xeeb5('0x88')]})['then'](function(_0x2c7984){if(!_0x2c7984['length']){_0x1830d0=0x0;}else{_0x1830d0=_0x2c7984[0x0][_0xeeb5('0x41')]||0x0;}return dbH[_0xeeb5('0x87')][_0xeeb5('0x2f')](_0x5db4aa['toString'](),{'type':dbH[_0xeeb5('0x87')][_0xeeb5('0x9f')][_0xeeb5('0x88')]});})[_0xeeb5('0x23')](function(_0x3ee131){return{'rows':_0x3ee131||[],'count':_0x1830d0};});}});}exports[_0xeeb5('0xa0')]=function(_0x104bd6,_0x2c78a5){return runReport(_0x104bd6[_0xeeb5('0x47')],_0x104bd6['query'],_0x104bd6[_0xeeb5('0x4a')])['then'](respondWithResult(_0x2c78a5,null))[_0xeeb5('0x45')](handleError(_0x2c78a5,null));};exports['runReport']=runReport;exports[_0xeeb5('0x2f')]=function(_0x1c75e1,_0x324aeb){var _0x1dad46=0xa;var _0x2351d6=[_0xeeb5('0x56'),_0xeeb5('0x89'),'right_join',_0xeeb5('0x57')];var _0x1e93c7={'SUM':_0xeeb5('0x58'),'COUNT':_0xeeb5('0x59'),'COUNT DISTINCT':_0xeeb5('0x5a'),'MAX':_0xeeb5('0x5b'),'MIN':_0xeeb5('0x5c'),'AVG':_0xeeb5('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xeeb5('0x5f'),'GROUP_CONCAT DESC':_0xeeb5('0x60')};var _0x19eea7={'SEC_TO_TIME':_0xeeb5('0x61'),'DATE':_0xeeb5('0x8b'),'HOUR':_0xeeb5('0x62'),'ROUND':_0xeeb5('0x63'),'UNIX_TIMESTAMP':_0xeeb5('0x64')};var _0x21d96b=function(_0x21840d){return!_[_0xeeb5('0x65')](['IS\x20NULL',_0xeeb5('0x66'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x21840d);};var _0x279fc8=function(_0x310bf0){if(!_0x310bf0||!_0x310bf0[_0xeeb5('0x69')][_0xeeb5('0x48')]){return'';}for(var _0x5c8ada='(',_0xad747f=0x0;_0xad747f<_0x310bf0[_0xeeb5('0x69')]['length'];_0xad747f+=0x1){_0xad747f>0x0&&(_0x5c8ada+='\x20'+_0x310bf0[_0xeeb5('0x6a')]+'\x20');_0x5c8ada+=_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6b')]?_0x279fc8(_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6b')]):_0x310bf0[_0xeeb5('0x69')][_0xad747f]['field']+'\x20'+_0x310bf0[_0xeeb5('0x69')][_0xad747f]['condition']+(_0x21d96b(_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x6d')])?'\x20'+_0x310bf0[_0xeeb5('0x69')][_0xad747f][_0xeeb5('0x8d')]:'');}return _0x5c8ada+')';};var _0x3bce78={'where':{'id':_0x1c75e1[_0xeeb5('0x47')]['id']}},_0x65d25e,_0x108fb2,_0x114d96,_0x2d7a31,_0x2e6f5a;_0x3bce78=_[_0xeeb5('0x40')]({},_0x3bce78,_0x1c75e1['options']);return db[_0xeeb5('0x43')][_0xeeb5('0x51')](_0x3bce78)['then'](function(_0x1836c8){if(_0x1836c8){_0x65d25e=_0x1836c8;return _0x1836c8[_0xeeb5('0x6e')]();}return null;})[_0xeeb5('0x23')](function(_0x5450fd){if(_0x5450fd){if(!_0x5450fd[_0xeeb5('0x48')]){throw new db[(_0xeeb5('0x6f'))][(_0xeeb5('0x70'))](_0xeeb5('0xa1'),0x193);}_0x108fb2=_0x5450fd;return db['AnalyticMetric'][_0xeeb5('0x44')]({'raw':!![]});}return null;})[_0xeeb5('0x23')](function(_0x46da19){if(_0x46da19){_0x114d96=_['keyBy'](_0x46da19,'id');var _0x4c0333;var _0x715be7=squel[_0xeeb5('0x72')]();_0x715be7[_0xeeb5('0x73')](_0x65d25e[_0xeeb5('0x82')]);for(var _0x3783ed=0x0;_0x3783ed<_0x108fb2[_0xeeb5('0x48')];_0x3783ed+=0x1){_0x4c0333=_0x108fb2[_0x3783ed]['MetricId']?_0x114d96[_0x108fb2[_0x3783ed][_0xeeb5('0x74')]][_0xeeb5('0x75')]:_0x108fb2[_0x3783ed][_0xeeb5('0x6c')];_0x4c0333=_0x108fb2[_0x3783ed][_0xeeb5('0x76')]?_[_0xeeb5('0x77')](_0x1e93c7[_0x108fb2[_0x3783ed][_0xeeb5('0x76')]],'%s',_0x4c0333):_0x4c0333;_0x4c0333=_0x108fb2[_0x3783ed]['format']?_[_0xeeb5('0x77')](_0x19eea7[_0x108fb2[_0x3783ed][_0xeeb5('0x78')]],'%s',_0x4c0333):_0x4c0333;if(_0x108fb2[_0x3783ed][_0xeeb5('0x79')]){_0x715be7[_0xeeb5('0x6b')](_0x4c0333);}_0x108fb2[_0x3783ed][_0xeeb5('0x7a')]&&_0x715be7[_0xeeb5('0x38')](_0x4c0333,_0x108fb2[_0x3783ed][_0xeeb5('0x7a')]===_0xeeb5('0x7b')?![]:!![]);_0x715be7[_0xeeb5('0x6c')](_0x4c0333,_0x108fb2[_0x3783ed][_0xeeb5('0x7c')]||_0x4c0333);}if(_0x65d25e[_0xeeb5('0x7d')]){_0x65d25e['joins']=JSON[_0xeeb5('0x7e')](_0x65d25e[_0xeeb5('0x7d')]);for(var _0x1dee23=0x0;_0x1dee23<_0x65d25e[_0xeeb5('0x7d')][_0xeeb5('0x48')];_0x1dee23+=0x1){if(_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['type']&&_[_0xeeb5('0x65')](_0x2351d6,_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x3e')])&&_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['parentKey']&&_0x65d25e['joins'][_0x1dee23][_0xeeb5('0x83')]&&_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x80')]){_0x715be7[_0x65d25e['joins'][_0x1dee23][_0xeeb5('0x3e')]](_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['foreignTable'],null,util[_0xeeb5('0x78')]('%s.%s\x20=\x20%s.%s',_0x65d25e[_0xeeb5('0x82')],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23]['parentKey'],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x83')],_0x65d25e[_0xeeb5('0x7d')][_0x1dee23][_0xeeb5('0x80')]));}}}if(_0x65d25e[_0xeeb5('0x84')]){_0x65d25e[_0xeeb5('0x84')]=JSON[_0xeeb5('0x7e')](_0x65d25e[_0xeeb5('0x84')]);_0x715be7['where'](_0x279fc8(_0x65d25e[_0xeeb5('0x84')][_0xeeb5('0x6b')]));}_0x2e6f5a=_0x715be7[_0xeeb5('0x85')]();_0x715be7[_0xeeb5('0x1c')](_0x1dad46);_0x715be7[_0xeeb5('0x1a')](0x0);logger[_0xeeb5('0xa2')]('Limited\x20Query:',_0x715be7[_0xeeb5('0x86')]());return dbH[_0xeeb5('0x87')]['query'](_0x715be7['toString'](),{'type':dbH[_0xeeb5('0x87')][_0xeeb5('0x9f')][_0xeeb5('0x88')]});}})[_0xeeb5('0x23')](function(){return{'sql':_0x2e6f5a[_0xeeb5('0x86')]()};})[_0xeeb5('0x23')](respondWithResult(_0x324aeb,null))[_0xeeb5('0x45')](handleError(_0x324aeb,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index f0296b3..01f838d 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 _0xebd8=['path','../../config/environment','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xebd8,0x164));var _0x8ebd=function(_0x566aff,_0x37fa7a){_0x566aff=_0x566aff-0x0;var _0x28ff10=_0xebd8[_0x566aff];return _0x28ff10;};'use strict';var _=require('lodash');var util=require(_0x8ebd('0x0'));var logger=require(_0x8ebd('0x1'))(_0x8ebd('0x2'));var moment=require('moment');var BPromise=require(_0x8ebd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ebd('0x4'));var rimraf=require('rimraf');var config=require(_0x8ebd('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x21f2f6,_0x41f227){return _0x21f2f6['define'](_0x8ebd('0x6'),attributes,{'tableName':_0x8ebd('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2089=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x2089,0x107));var _0x9208=function(_0x231ef3,_0x75aa1c){_0x231ef3=_0x231ef3-0x0;var _0x3a9965=_0x2089[_0x231ef3];return _0x3a9965;};'use strict';var _=require(_0x9208('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9208('0x1'));var moment=require(_0x9208('0x2'));var BPromise=require(_0x9208('0x3'));var rp=require(_0x9208('0x4'));var fs=require('fs');var path=require(_0x9208('0x5'));var rimraf=require('rimraf');var config=require(_0x9208('0x6'));var attributes=require(_0x9208('0x7'));module[_0x9208('0x8')]=function(_0x4cd1fc,_0x45bc6b){return _0x4cd1fc[_0x9208('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x9208('0xa'),'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 a5f2b1e..81c0fa2 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 _0x6776=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x7a7e22,_0x5c8f17){var _0x57c703=function(_0x4268fb){while(--_0x4268fb){_0x7a7e22['push'](_0x7a7e22['shift']());}};_0x57c703(++_0x5c8f17);}(_0x6776,0xcc));var _0x6677=function(_0x5f49bc,_0x548555){_0x5f49bc=_0x5f49bc-0x0;var _0x44bbb9=_0x6776[_0x5f49bc];return _0x44bbb9;};'use strict';var _=require(_0x6677('0x0'));var util=require(_0x6677('0x1'));var moment=require(_0x6677('0x2'));var BPromise=require(_0x6677('0x3'));var rs=require(_0x6677('0x4'));var fs=require('fs');var Redis=require(_0x6677('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6677('0x6'));var logger=require(_0x6677('0x7'))(_0x6677('0x8'));var config=require('../../config/environment');var jayson=require(_0x6677('0x9'));var client=jayson[_0x6677('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20048f,_0xce23d6,_0x3d6ade){return new BPromise(function(_0x22ace7,_0x40766a){return client[_0x6677('0xb')](_0x20048f,_0x3d6ade)[_0x6677('0xc')](function(_0x3898a3){logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));logger[_0x6677('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xce23d6,_0x6677('0xf'),JSON[_0x6677('0x11')](_0x3898a3));if(_0x3898a3[_0x6677('0x12')]){if(_0x3898a3[_0x6677('0x12')][_0x6677('0x13')]===0x1f4){logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x40766a(_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);}logger[_0x6677('0x12')](_0x6677('0xe'),_0xce23d6,_0x3898a3[_0x6677('0x12')][_0x6677('0x14')]);return _0x22ace7(_0x3898a3['error'][_0x6677('0x14')]);}else{logger[_0x6677('0xd')](_0x6677('0xe'),_0xce23d6,_0x6677('0xf'));_0x22ace7(_0x3898a3[_0x6677('0x15')][_0x6677('0x14')]);}})[_0x6677('0x16')](function(_0x3c1a80){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xce23d6,_0x3c1a80);_0x40766a(_0x3c1a80);});});}
\ No newline at end of file
+var _0x48ee=['AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info'];(function(_0xea0cf2,_0x1502d9){var _0x3652df=function(_0x39db2a){while(--_0x39db2a){_0xea0cf2['push'](_0xea0cf2['shift']());}};_0x3652df(++_0x1502d9);}(_0x48ee,0x138));var _0xe48e=function(_0x1ba229,_0x46fef5){_0x1ba229=_0x1ba229-0x0;var _0x44692f=_0x48ee[_0x1ba229];return _0x44692f;};'use strict';var _=require('lodash');var util=require(_0xe48e('0x0'));var moment=require(_0xe48e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe48e('0x2'));var db=require(_0xe48e('0x3'))['db'];var utils=require(_0xe48e('0x4'));var logger=require('../../config/logger')(_0xe48e('0x5'));var config=require('../../config/environment');var jayson=require(_0xe48e('0x6'));var client=jayson[_0xe48e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a1ac2,_0x34f626,_0xdd9c26){return new BPromise(function(_0x54cde1,_0x5b7e13){return client[_0xe48e('0x8')](_0x3a1ac2,_0xdd9c26)[_0xe48e('0x9')](function(_0x4bde1f){logger[_0xe48e('0xa')](_0xe48e('0xb'),_0x34f626,'request\x20sent');logger['debug'](_0xe48e('0xc'),_0x34f626,_0xe48e('0xd'),JSON[_0xe48e('0xe')](_0x4bde1f));if(_0x4bde1f['error']){if(_0x4bde1f[_0xe48e('0xf')]['code']===0x1f4){logger[_0xe48e('0xf')](_0xe48e('0xb'),_0x34f626,_0x4bde1f['error'][_0xe48e('0x10')]);return _0x5b7e13(_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);}logger[_0xe48e('0xf')](_0xe48e('0xb'),_0x34f626,_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);return _0x54cde1(_0x4bde1f[_0xe48e('0xf')][_0xe48e('0x10')]);}else{logger[_0xe48e('0xa')](_0xe48e('0xb'),_0x34f626,_0xe48e('0xd'));_0x54cde1(_0x4bde1f[_0xe48e('0x11')]['message']);}})[_0xe48e('0x12')](function(_0x2ae9a3){logger['error'](_0xe48e('0xb'),_0x34f626,_0x2ae9a3);_0x5b7e13(_0x2ae9a3);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 483552e..8598295 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 _0x5086=['create','/:id','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','show','preview','run','query'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x5086,0x16d));var _0x6508=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x5086[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6508('0x0'));var util=require('util');var path=require(_0x6508('0x1'));var timeout=require(_0x6508('0x2'));var express=require(_0x6508('0x3'));var router=express[_0x6508('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6508('0x5'));var interaction=require(_0x6508('0x6'));var config=require(_0x6508('0x7'));var controller=require(_0x6508('0x8'));router['get']('/',auth[_0x6508('0x9')](),controller['index']);router[_0x6508('0xa')]('/:id',auth[_0x6508('0x9')](),controller[_0x6508('0xb')]);router[_0x6508('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x6508('0xc')]);router[_0x6508('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x6508('0xd')]);router[_0x6508('0xa')]('/:id/query',auth[_0x6508('0x9')](),controller[_0x6508('0xe')]);router['post']('/',auth[_0x6508('0x9')](),controller[_0x6508('0xf')]);router['put'](_0x6508('0x10'),auth[_0x6508('0x9')](),controller[_0x6508('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6508('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x29c7=['index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','create','put','update','destroy','exports','multer','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x29c7,0x84));var _0x729c=function(_0x179f38,_0x4a5eca){_0x179f38=_0x179f38-0x0;var _0x385a77=_0x29c7[_0x179f38];return _0x385a77;};'use strict';var multer=require(_0x729c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x729c('0x1'));var auth=require(_0x729c('0x2'));var interaction=require(_0x729c('0x3'));var config=require(_0x729c('0x4'));var controller=require(_0x729c('0x5'));router[_0x729c('0x6')]('/',auth[_0x729c('0x7')](),controller[_0x729c('0x8')]);router[_0x729c('0x6')](_0x729c('0x9'),auth[_0x729c('0x7')](),controller['show']);router[_0x729c('0x6')](_0x729c('0xa'),auth['isAuthenticated'](),controller[_0x729c('0xb')]);router[_0x729c('0x6')](_0x729c('0xc'),auth[_0x729c('0x7')](),controller[_0x729c('0xd')]);router[_0x729c('0x6')](_0x729c('0xe'),auth[_0x729c('0x7')](),controller['query']);router['post']('/',auth[_0x729c('0x7')](),controller[_0x729c('0xf')]);router[_0x729c('0x10')](_0x729c('0x9'),auth[_0x729c('0x7')](),controller[_0x729c('0x11')]);router['delete']('/:id',auth[_0x729c('0x7')](),controller[_0x729c('0x12')]);module[_0x729c('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index dd784ab..e35c33f 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 _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x2ff4a7,_0xe37347){_0x2ff4a7=_0x2ff4a7-0x0;var _0xc01c3f=_0x8ef6[_0x2ff4a7];return _0xc01c3f;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x4650bf,_0x44b2bd){var _0x29ec71=function(_0xb8caad){while(--_0xb8caad){_0x4650bf['push'](_0x4650bf['shift']());}};_0x29ec71(++_0x44b2bd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5fc3[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 4aadc35..62d599d 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 _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x4819,0xcd));var _0x9481=function(_0x30505b,_0x3b6c06){_0x30505b=_0x30505b-0x0;var _0x4f7466=_0x4819[_0x30505b];return _0x4f7466;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x814b=['attributes','intersection','length','nolimit','limit','order','where','filter','merge','options','includeAll','findAll','catch','show','params','rawAttributes','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','preview','join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','left_join','right_join','MAX(%s)','operator','value','Sequelize','keyBy','from','groupBy','%s.%s\x20=\x20%s.%s','output','web','fullPath','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','SELECT','run','runReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','map','AnalyticDefaultReport','fieldName','type','model','query','keys','filters'];(function(_0x58f1b0,_0x3a2be3){var _0x551656=function(_0x5152c1){while(--_0x5152c1){_0x58f1b0['push'](_0x58f1b0['shift']());}};_0x551656(++_0x3a2be3);}(_0x814b,0x1a2));var _0xb814=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x814b[_0x349148];return _0x2f2b0f;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xa'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];var dbH=require(_0xb814('0x1a'))[_0xb814('0x1b')];function respondWithStatusCode(_0x2ce718,_0x3bde14){_0x3bde14=_0x3bde14||0xcc;return function(_0x1438e7){if(_0x1438e7){return _0x2ce718[_0xb814('0x1c')](_0x3bde14);}return _0x2ce718[_0xb814('0x1d')](_0x3bde14)[_0xb814('0x1e')]();};}function respondWithResult(_0x3f4881,_0x44fb96){_0x44fb96=_0x44fb96||0xc8;return function(_0x17f5bd){if(_0x17f5bd){return _0x3f4881[_0xb814('0x1d')](_0x44fb96)[_0xb814('0x1f')](_0x17f5bd);}};}function respondWithFilteredResult(_0x3a71d6,_0x45e0d0){return function(_0x265a83){if(_0x265a83){var _0x125ce2=typeof _0x45e0d0[_0xb814('0x20')]===_0xb814('0x21')&&typeof _0x45e0d0['limit']===_0xb814('0x21');var _0x55ba16=_0x265a83[_0xb814('0x22')];var _0xfac75b=_0x125ce2?0x0:_0x45e0d0['offset'];var _0x4b55a7=_0x125ce2?_0x265a83['count']:_0x45e0d0[_0xb814('0x20')]+_0x45e0d0['limit'];var _0x57c128;if(_0x4b55a7>=_0x55ba16){_0x4b55a7=_0x55ba16;_0x57c128=0xc8;}else{_0x57c128=0xce;}_0x3a71d6[_0xb814('0x1d')](_0x57c128);return _0x3a71d6[_0xb814('0x23')](_0xb814('0x24'),_0xfac75b+'-'+_0x4b55a7+'/'+_0x55ba16)['json'](_0x265a83);}return null;};}function patchUpdates(_0xf5b8aa){return function(_0x531032){try{jsonpatch[_0xb814('0x25')](_0x531032,_0xf5b8aa,!![]);}catch(_0x1808a3){return BPromise[_0xb814('0x26')](_0x1808a3);}return _0x531032[_0xb814('0x27')]();};}function saveUpdates(_0x27352e,_0x2bd039){return function(_0x1f5d40){if(_0x1f5d40){return _0x1f5d40['update'](_0x27352e)[_0xb814('0x28')](function(_0x52b7a3){return _0x52b7a3;});}return null;};}function removeEntity(_0x3f81d0,_0x457dac){return function(_0x31c7ec){if(_0x31c7ec){return _0x31c7ec[_0xb814('0x29')]()[_0xb814('0x28')](function(){var _0xb9e57d=_0x31c7ec[_0xb814('0x2a')]({'plain':!![]});var _0x5755ea=_0xb814('0x2b');return db[_0xb814('0x2c')][_0xb814('0x29')]({'where':{'type':_0x5755ea,'resourceId':_0xb9e57d['id']}})[_0xb814('0x28')](function(){return _0x31c7ec;});})[_0xb814('0x28')](function(){_0x3f81d0[_0xb814('0x1d')](0xcc)[_0xb814('0x1e')]();});}};}function handleEntityNotFound(_0x1e4e89,_0x5a6291){return function(_0x271aa8){if(!_0x271aa8){_0x1e4e89[_0xb814('0x1c')](0x194);}return _0x271aa8;};}function handleError(_0x52ed64,_0x9008b2){_0x9008b2=_0x9008b2||0x1f4;return function(_0x37d24d){logger[_0xb814('0x2d')](_0x37d24d['stack']);if(_0x37d24d[_0xb814('0x2e')]){delete _0x37d24d[_0xb814('0x2e')];}_0x52ed64['status'](_0x9008b2)[_0xb814('0x2f')](_0x37d24d);};}exports['index']=function(_0x6efe9a,_0x5f3e9b){var _0x4cfc58={},_0x419cd9={},_0x4a4f27={'count':0x0,'rows':[]};var _0x2431e2=_[_0xb814('0x30')](db[_0xb814('0x31')]['rawAttributes'],function(_0x51d5ae){return{'name':_0x51d5ae[_0xb814('0x32')],'type':_0x51d5ae[_0xb814('0x33')]['key']};});_0x419cd9[_0xb814('0x34')]=_[_0xb814('0x30')](_0x2431e2,_0xb814('0x2e'));_0x419cd9[_0xb814('0x35')]=_[_0xb814('0x36')](_0x6efe9a[_0xb814('0x35')]);_0x419cd9[_0xb814('0x37')]=_['intersection'](_0x419cd9[_0xb814('0x34')],_0x419cd9[_0xb814('0x35')]);_0x4cfc58[_0xb814('0x38')]=_[_0xb814('0x39')](_0x419cd9[_0xb814('0x34')],qs['fields'](_0x6efe9a[_0xb814('0x35')]['fields']));_0x4cfc58[_0xb814('0x38')]=_0x4cfc58[_0xb814('0x38')][_0xb814('0x3a')]?_0x4cfc58['attributes']:_0x419cd9[_0xb814('0x34')];if(!_0x6efe9a[_0xb814('0x35')]['hasOwnProperty'](_0xb814('0x3b'))){_0x4cfc58[_0xb814('0x3c')]=qs[_0xb814('0x3c')](_0x6efe9a[_0xb814('0x35')][_0xb814('0x3c')]);_0x4cfc58[_0xb814('0x20')]=qs['offset'](_0x6efe9a[_0xb814('0x35')]['offset']);}_0x4cfc58[_0xb814('0x3d')]=qs['sort'](_0x6efe9a[_0xb814('0x35')]['sort']);_0x4cfc58[_0xb814('0x3e')]=qs[_0xb814('0x37')](_['pick'](_0x6efe9a['query'],_0x419cd9['filters']),_0x2431e2);if(_0x6efe9a['query'][_0xb814('0x3f')]){_0x4cfc58[_0xb814('0x3e')]=_[_0xb814('0x40')](_0x4cfc58[_0xb814('0x3e')],{'$or':_['map'](_0x2431e2,function(_0x47d782){if(_0x47d782[_0xb814('0x33')]!=='VIRTUAL'){var _0x2a93da={};_0x2a93da[_0x47d782[_0xb814('0x2e')]]={'$like':'%'+_0x6efe9a[_0xb814('0x35')][_0xb814('0x3f')]+'%'};return _0x2a93da;}})});}_0x4cfc58=_[_0xb814('0x40')]({},_0x4cfc58,_0x6efe9a[_0xb814('0x41')]);var _0x3b7f5a={'where':_0x4cfc58[_0xb814('0x3e')]};return db[_0xb814('0x31')]['count'](_0x3b7f5a)['then'](function(_0x5d26be){_0x4a4f27[_0xb814('0x22')]=_0x5d26be;if(_0x6efe9a['query'][_0xb814('0x42')]){_0x4cfc58['include']=[{'all':!![]}];}return db[_0xb814('0x31')][_0xb814('0x43')](_0x4cfc58);})[_0xb814('0x28')](function(_0x2e97cc){_0x4a4f27['rows']=_0x2e97cc;return _0x4a4f27;})[_0xb814('0x28')](respondWithFilteredResult(_0x5f3e9b,_0x4cfc58))[_0xb814('0x44')](handleError(_0x5f3e9b,null));};exports[_0xb814('0x45')]=function(_0x22cf27,_0x7d92aa){var _0x450a08={'raw':!![],'where':{'id':_0x22cf27[_0xb814('0x46')]['id']}},_0x534eb8={};_0x534eb8[_0xb814('0x34')]=_[_0xb814('0x36')](db[_0xb814('0x31')][_0xb814('0x47')]);_0x534eb8[_0xb814('0x35')]=_[_0xb814('0x36')](_0x22cf27['query']);_0x534eb8['filters']=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],_0x534eb8[_0xb814('0x35')]);_0x450a08[_0xb814('0x38')]=_[_0xb814('0x39')](_0x534eb8[_0xb814('0x34')],qs[_0xb814('0x48')](_0x22cf27[_0xb814('0x35')][_0xb814('0x48')]));_0x450a08[_0xb814('0x38')]=_0x450a08[_0xb814('0x38')]['length']?_0x450a08[_0xb814('0x38')]:_0x534eb8[_0xb814('0x34')];if(_0x22cf27['query'][_0xb814('0x42')]){_0x450a08['include']=[{'all':!![]}];}_0x450a08=_[_0xb814('0x40')]({},_0x450a08,_0x22cf27[_0xb814('0x41')]);return db[_0xb814('0x31')][_0xb814('0x49')](_0x450a08)[_0xb814('0x28')](handleEntityNotFound(_0x7d92aa,null))[_0xb814('0x28')](respondWithResult(_0x7d92aa,null))[_0xb814('0x44')](handleError(_0x7d92aa,null));};exports[_0xb814('0x4a')]=function(_0x32a397,_0x2a422a){return db['AnalyticDefaultReport']['create'](_0x32a397[_0xb814('0x4b')],{})[_0xb814('0x28')](function(_0x4156d8){var _0x3f8e29=_0x32a397[_0xb814('0x4c')][_0xb814('0x2a')]({'plain':!![]});if(!_0x3f8e29)throw new Error(_0xb814('0x4d'));if(_0x3f8e29['role']===_0xb814('0x4c')){var _0x388324=_0x4156d8[_0xb814('0x2a')]({'plain':!![]});var _0x5a916d=_0xb814('0x4e');return db['UserProfileSection'][_0xb814('0x49')]({'where':{'name':_0x5a916d,'userProfileId':_0x3f8e29['userProfileId']},'raw':!![]})[_0xb814('0x28')](function(_0x3cf8f8){if(_0x3cf8f8&&_0x3cf8f8['autoAssociation']===0x0){return db[_0xb814('0x2c')][_0xb814('0x4a')]({'name':_0x388324[_0xb814('0x2e')],'resourceId':_0x388324['id'],'type':'DefaultReports','sectionId':_0x3cf8f8['id']},{})[_0xb814('0x28')](function(){return _0x4156d8;});}else{return _0x4156d8;}})['catch'](function(_0x13bdcf){logger[_0xb814('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bdcf);throw _0x13bdcf;});}return _0x4156d8;})[_0xb814('0x28')](respondWithResult(_0x2a422a,0xc9))['catch'](handleError(_0x2a422a,null));};exports['update']=function(_0x3b9709,_0x35f59a){if(_0x3b9709[_0xb814('0x4b')]['id']){delete _0x3b9709['body']['id'];}return db[_0xb814('0x31')]['find']({'where':{'id':_0x3b9709[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x35f59a,null))['then'](saveUpdates(_0x3b9709[_0xb814('0x4b')],null))['then'](respondWithResult(_0x35f59a,null))[_0xb814('0x44')](handleError(_0x35f59a,null));};exports[_0xb814('0x29')]=function(_0xb2bd82,_0x113fe5){return db[_0xb814('0x31')][_0xb814('0x49')]({'where':{'id':_0xb2bd82[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x113fe5,null))['then'](removeEntity(_0x113fe5,null))[_0xb814('0x44')](handleError(_0x113fe5,null));};exports[_0xb814('0x4f')]=function(_0x5d71d5,_0x29a127){var _0xe14249=0xa;var _0x4d13db=[_0xb814('0x50'),'left_join','right_join',_0xb814('0x51')];var _0x5257be={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb814('0x56'),'GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x176585={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x4d611d=function(_0x211194){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x211194);};var _0x52edfa=function(_0x135e13){if(!_0x135e13||!_0x135e13['rules'][_0xb814('0x3a')]){return'';}for(var _0x39b754='(',_0xac95cf=0x0;_0xac95cf<_0x135e13['rules'][_0xb814('0x3a')];_0xac95cf+=0x1){_0xac95cf>0x0&&(_0x39b754+='\x20'+_0x135e13['operator']+'\x20');_0x39b754+=_0x135e13[_0xb814('0x63')][_0xac95cf]['group']?_0x52edfa(_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x64')]):_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x65')]+'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf][_0xb814('0x66')]+(_0x4d611d(_0x135e13[_0xb814('0x63')][_0xac95cf]['condition'])?'\x20'+_0x135e13[_0xb814('0x63')][_0xac95cf]['value']:'');}return _0x39b754+')';};var _0x255047={'where':{'id':_0x5d71d5['params']['id']}},_0x22c73f,_0x1b989d,_0x3dcaeb,_0x19fa45,_0x139531;_0x255047=_[_0xb814('0x40')]({},_0x255047,_0x5d71d5[_0xb814('0x41')]);return db['AnalyticDefaultReport'][_0xb814('0x49')](_0x255047)[_0xb814('0x28')](function(_0x263699){if(_0x263699){_0x22c73f=_0x263699;return _0x263699[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x51d834){if(_0x51d834){if(!_0x51d834[_0xb814('0x3a')]){throw new db['Sequelize'][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x1b989d=_0x51d834;return db[_0xb814('0x6a')][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x41bcaf){if(_0x41bcaf){_0x3dcaeb=_['keyBy'](_0x41bcaf,'id');var _0x506bf2;var _0x5d064b=squel[_0xb814('0x6b')]();_0x5d064b['from'](_0x22c73f[_0xb814('0x6c')]);for(var _0x1d3954=0x0;_0x1d3954<_0x1b989d[_0xb814('0x3a')];_0x1d3954+=0x1){_0x506bf2=_0x1b989d[_0x1d3954]['MetricId']?_0x3dcaeb[_0x1b989d[_0x1d3954][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x1b989d[_0x1d3954][_0xb814('0x65')];_0x506bf2=_0x1b989d[_0x1d3954]['function']?_[_0xb814('0x6f')](_0x5257be[_0x1b989d[_0x1d3954][_0xb814('0x70')]],'%s',_0x506bf2):_0x506bf2;_0x506bf2=_0x1b989d[_0x1d3954][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x176585[_0x1b989d[_0x1d3954]['format']],'%s',_0x506bf2):_0x506bf2;if(_0x1b989d[_0x1d3954]['groupBy']){_0x5d064b[_0xb814('0x64')](_0x506bf2);}_0x1b989d[_0x1d3954][_0xb814('0x72')]&&_0x5d064b[_0xb814('0x3d')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x5d064b[_0xb814('0x65')](_0x506bf2,_0x1b989d[_0x1d3954][_0xb814('0x74')]||_0x506bf2);}if(_0x22c73f[_0xb814('0x75')]){_0x22c73f[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x22c73f[_0xb814('0x75')]);for(var _0x226b0e=0x0;_0x226b0e<_0x22c73f[_0xb814('0x75')][_0xb814('0x3a')];_0x226b0e+=0x1){if(_0x22c73f[_0xb814('0x75')][_0x226b0e]['type']&&_[_0xb814('0x5e')](_0x4d13db,_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')])&&_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')]&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignTable']&&_0x22c73f[_0xb814('0x75')][_0x226b0e]['foreignKey']){_0x5d064b[_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x33')]](_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],null,util[_0xb814('0x71')]('%s.%s\x20=\x20%s.%s',_0x22c73f['table'],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x77')],_0x22c73f[_0xb814('0x75')][_0x226b0e][_0xb814('0x78')],_0x22c73f['joins'][_0x226b0e][_0xb814('0x79')]));}}}if(_0x22c73f['conditions']){_0x22c73f[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x22c73f['conditions']);_0x5d064b['where'](_0x52edfa(_0x22c73f[_0xb814('0x7a')]['group']));}_0x139531=_0x5d064b[_0xb814('0x7b')]();_0x5d064b[_0xb814('0x3c')](_0xe14249);_0x5d064b[_0xb814('0x20')](0x0);logger[_0xb814('0x7c')](_0xb814('0x7d'),_0x5d064b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')]['query'](_0x5d064b[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')]['SELECT']});}})[_0xb814('0x28')](respondWithResult(_0x29a127,null))[_0xb814('0x44')](handleError(_0x29a127,null));};function runReport(_0x58d56c,_0x10a90d,_0x583f26){var _0x37adec=_0x10a90d[_0xb814('0x2e')];var _0x4e15c2=0xa;var _0x5a0c4a=[_0xb814('0x50'),_0xb814('0x81'),_0xb814('0x82'),_0xb814('0x51')];var _0x220f8b={'SUM':_0xb814('0x52'),'COUNT':_0xb814('0x53'),'COUNT DISTINCT':_0xb814('0x54'),'MAX':_0xb814('0x83'),'MIN':_0xb814('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x52b6da={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1fb1ea=function(_0x31c072){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),_0xb814('0x62')],_0x31c072);};var _0x5cf5ad=function(_0x20efc3){if(!_0x20efc3||!_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x30faa0='(',_0x55ceb8=0x0;_0x55ceb8<_0x20efc3[_0xb814('0x63')][_0xb814('0x3a')];_0x55ceb8+=0x1){_0x55ceb8>0x0&&(_0x30faa0+='\x20'+_0x20efc3[_0xb814('0x84')]+'\x20');_0x30faa0+=_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x64')]?_0x5cf5ad(_0x20efc3['rules'][_0x55ceb8]['group']):_0x20efc3[_0xb814('0x63')][_0x55ceb8]['field']+'\x20'+_0x20efc3[_0xb814('0x63')][_0x55ceb8][_0xb814('0x66')]+(_0x1fb1ea(_0x20efc3['rules'][_0x55ceb8][_0xb814('0x66')])?'\x20'+_0x20efc3['rules'][_0x55ceb8][_0xb814('0x85')]:'');}return _0x30faa0+')';};var _0x520d0f={'where':{'id':_0x58d56c['id']}},_0x44e668,_0x1aff2b,_0x41867b,_0x2c3948,_0x2d8899;_0x520d0f=_[_0xb814('0x40')]({},_0x520d0f,_0x583f26);return db[_0xb814('0x31')]['find'](_0x520d0f)['then'](function(_0x21aa36){if(_0x21aa36){_0x44e668=_0x21aa36;return _0x21aa36['getFields']();}return null;})['then'](function(_0x2d0061){if(_0x2d0061){if(!_0x2d0061[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))]['ValidationErrorItem'](_0xb814('0x69'),0x193);}_0x1aff2b=_0x2d0061;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x14ec54){if(_0x14ec54){_0x41867b=_[_0xb814('0x87')](_0x14ec54,'id');var _0x4c8a00;var _0x1454b3=squel[_0xb814('0x6b')]();_0x1454b3[_0xb814('0x88')](_0x44e668['table']);for(var _0x1ebbf6=0x0;_0x1ebbf6<_0x1aff2b[_0xb814('0x3a')];_0x1ebbf6+=0x1){_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x6d')]?_0x41867b[_0x1aff2b[_0x1ebbf6]['MetricId']][_0xb814('0x6e')]:_0x1aff2b[_0x1ebbf6][_0xb814('0x65')];_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]?_[_0xb814('0x6f')](_0x220f8b[_0x1aff2b[_0x1ebbf6][_0xb814('0x70')]],'%s',_0x4c8a00):_0x4c8a00;_0x4c8a00=_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]?_[_0xb814('0x6f')](_0x52b6da[_0x1aff2b[_0x1ebbf6][_0xb814('0x71')]],'%s',_0x4c8a00):_0x4c8a00;if(_0x1aff2b[_0x1ebbf6][_0xb814('0x89')]){_0x1454b3[_0xb814('0x64')](_0x4c8a00);}_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]&&_0x1454b3[_0xb814('0x3d')](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x72')]==='DESC'?![]:!![]);_0x1454b3['field'](_0x4c8a00,_0x1aff2b[_0x1ebbf6][_0xb814('0x74')]||_0x4c8a00);}if(_0x44e668['joins']){_0x44e668[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x44e668[_0xb814('0x75')]);for(var _0x2bc95b=0x0;_0x2bc95b<_0x44e668[_0xb814('0x75')][_0xb814('0x3a')];_0x2bc95b+=0x1){if(_0x44e668[_0xb814('0x75')][_0x2bc95b]['type']&&_['includes'](_0x5a0c4a,_0x44e668[_0xb814('0x75')][_0x2bc95b]['type'])&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')]&&_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable']&&_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]){_0x1454b3[_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x33')]](_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],null,util[_0xb814('0x71')](_0xb814('0x8a'),_0x44e668['table'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x77')],_0x44e668[_0xb814('0x75')][_0x2bc95b]['foreignTable'],_0x44e668[_0xb814('0x75')][_0x2bc95b][_0xb814('0x79')]));}}}if(_0x44e668['conditions']){_0x44e668[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x44e668['conditions']);_0x1454b3[_0xb814('0x3e')](_0x5cf5ad(_0x44e668[_0xb814('0x7a')][_0xb814('0x64')]));}_0x2d8899=_0x1454b3[_0xb814('0x7b')]();_0x1454b3[_0xb814('0x3c')](_0x4e15c2);_0x1454b3[_0xb814('0x20')](0x0);return;}})[_0xb814('0x28')](function(){if(_0x10a90d[_0xb814('0x8b')]===_0xb814('0x8c')){return null;}var _0x1f8c7a=_[_0xb814('0x40')](_0x10a90d,{'name':_0x10a90d[_0xb814('0x8d')]||_0x10a90d['name']||_0x44e668['name'],'basename':_0x37adec,'savename':util[_0xb814('0x71')]('%s-%s.%s',_0x10a90d['name']||_0x44e668[_0xb814('0x2e')],require('randomstring')['generate'](0x4),_0x10a90d['output']||_0xb814('0x8e')),'reportId':_0x44e668['id'],'reportType':_0xb814('0x8f')});return db[_0xb814('0x90')]['create'](_0x1f8c7a,{'raw':!![]});})[_0xb814('0x28')](function(_0x4dbe89){if(_0x44e668[_0xb814('0x6c')]===_0xb814('0x91')){_0x2d8899['where'](_0x44e668[_0xb814('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}else{_0x2d8899[_0xb814('0x3e')](_0x44e668[_0xb814('0x6c')]+_0xb814('0x94'),_0x10a90d[_0xb814('0x92')],_0x10a90d[_0xb814('0x93')]);}if(_0x4dbe89){logger[_0xb814('0x95')](_0xb814('0x96'),_0x2d8899[_0xb814('0x7e')]());require(_0xb814('0x97'))[_0xb814('0x98')](path[_0xb814('0x50')](__dirname,_0xb814('0x99'),_0x4dbe89[_0xb814('0x8b')]),[_0x4dbe89['id'],_0x2d8899['toString'](),path[_0xb814('0x50')](__dirname,_0xb814('0x9a'),_0x4dbe89['savename']),_0x37adec]);return _0x4dbe89;}else{var _0x2c7cd6=squel[_0xb814('0x6b')]();_0x2c7cd6[_0xb814('0x88')]('('+_0x2d8899['toString']()+')','countTable');_0x2c7cd6[_0xb814('0x65')]('COUNT(*)',_0xb814('0x22'));_0x2d8899['limit'](_0x10a90d[_0xb814('0x3c')]||_0x4e15c2);_0x2d8899['offset'](_0x10a90d['offset']||0x0);return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x2c7cd6[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]})[_0xb814('0x28')](function(_0x4543c3){if(!_0x4543c3[_0xb814('0x3a')]){_0x2c3948=0x0;}else{_0x2c3948=_0x4543c3[0x0][_0xb814('0x22')]||0x0;}return dbH[_0xb814('0x7f')]['query'](_0x2d8899[_0xb814('0x7e')](),{'type':dbH['sequelize'][_0xb814('0x80')][_0xb814('0x9b')]});})[_0xb814('0x28')](function(_0x4fde6a){return{'rows':_0x4fde6a||[],'count':_0x2c3948};});}});}exports[_0xb814('0x9c')]=function(_0x18fb74,_0x371e92){return runReport(_0x18fb74[_0xb814('0x46')],_0x18fb74[_0xb814('0x35')],_0x18fb74[_0xb814('0x41')])[_0xb814('0x28')](respondWithResult(_0x371e92,null))[_0xb814('0x44')](handleError(_0x371e92,null));};exports[_0xb814('0x9d')]=runReport;exports[_0xb814('0x35')]=function(_0x3b65c0,_0x11e0c3){var _0x22c811=0xa;var _0x3fd24c=[_0xb814('0x50'),'left_join',_0xb814('0x82'),_0xb814('0x51')];var _0x3e61eb={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb814('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xb814('0x57'),'GROUP_CONCAT DESC':_0xb814('0x58')};var _0x5be0bb={'SEC_TO_TIME':_0xb814('0x59'),'DATE':_0xb814('0x5a'),'HOUR':_0xb814('0x5b'),'ROUND':_0xb814('0x5c'),'UNIX_TIMESTAMP':_0xb814('0x5d')};var _0x1bd9ab=function(_0x20e608){return!_[_0xb814('0x5e')]([_0xb814('0x5f'),_0xb814('0x60'),_0xb814('0x61'),'IS\x20NOT\x20EMPTY'],_0x20e608);};var _0x2a5dff=function(_0x553635){if(!_0x553635||!_0x553635[_0xb814('0x63')][_0xb814('0x3a')]){return'';}for(var _0x35e8f7='(',_0xa7ff62=0x0;_0xa7ff62<_0x553635[_0xb814('0x63')][_0xb814('0x3a')];_0xa7ff62+=0x1){_0xa7ff62>0x0&&(_0x35e8f7+='\x20'+_0x553635[_0xb814('0x84')]+'\x20');_0x35e8f7+=_0x553635[_0xb814('0x63')][_0xa7ff62]['group']?_0x2a5dff(_0x553635['rules'][_0xa7ff62]['group']):_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x65')]+'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')]+(_0x1bd9ab(_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x66')])?'\x20'+_0x553635[_0xb814('0x63')][_0xa7ff62][_0xb814('0x85')]:'');}return _0x35e8f7+')';};var _0x41847e={'where':{'id':_0x3b65c0[_0xb814('0x46')]['id']}},_0x1a5685,_0x51313d,_0x5c989a,_0x41486b,_0x16c05b;_0x41847e=_[_0xb814('0x40')]({},_0x41847e,_0x3b65c0[_0xb814('0x41')]);return db[_0xb814('0x31')]['find'](_0x41847e)[_0xb814('0x28')](function(_0x52899a){if(_0x52899a){_0x1a5685=_0x52899a;return _0x52899a[_0xb814('0x67')]();}return null;})[_0xb814('0x28')](function(_0x205c6c){if(_0x205c6c){if(!_0x205c6c[_0xb814('0x3a')]){throw new db[(_0xb814('0x86'))][(_0xb814('0x68'))](_0xb814('0x69'),0x193);}_0x51313d=_0x205c6c;return db['AnalyticMetric'][_0xb814('0x43')]({'raw':!![]});}return null;})[_0xb814('0x28')](function(_0x1f04eb){if(_0x1f04eb){_0x5c989a=_[_0xb814('0x87')](_0x1f04eb,'id');var _0x4a1c4e;var _0x17c63b=squel[_0xb814('0x6b')]();_0x17c63b[_0xb814('0x88')](_0x1a5685[_0xb814('0x6c')]);for(var _0xa66ca3=0x0;_0xa66ca3<_0x51313d['length'];_0xa66ca3+=0x1){_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x6d')]?_0x5c989a[_0x51313d[_0xa66ca3][_0xb814('0x6d')]][_0xb814('0x6e')]:_0x51313d[_0xa66ca3]['field'];_0x4a1c4e=_0x51313d[_0xa66ca3][_0xb814('0x70')]?_['replace'](_0x3e61eb[_0x51313d[_0xa66ca3][_0xb814('0x70')]],'%s',_0x4a1c4e):_0x4a1c4e;_0x4a1c4e=_0x51313d[_0xa66ca3]['format']?_[_0xb814('0x6f')](_0x5be0bb[_0x51313d[_0xa66ca3][_0xb814('0x71')]],'%s',_0x4a1c4e):_0x4a1c4e;if(_0x51313d[_0xa66ca3][_0xb814('0x89')]){_0x17c63b[_0xb814('0x64')](_0x4a1c4e);}_0x51313d[_0xa66ca3]['orderBy']&&_0x17c63b[_0xb814('0x3d')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x72')]===_0xb814('0x73')?![]:!![]);_0x17c63b[_0xb814('0x65')](_0x4a1c4e,_0x51313d[_0xa66ca3][_0xb814('0x74')]||_0x4a1c4e);}if(_0x1a5685[_0xb814('0x75')]){_0x1a5685[_0xb814('0x75')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x75')]);for(var _0x152260=0x0;_0x152260<_0x1a5685[_0xb814('0x75')][_0xb814('0x3a')];_0x152260+=0x1){if(_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]&&_[_0xb814('0x5e')](_0x3fd24c,_0x1a5685['joins'][_0x152260][_0xb814('0x33')])&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')]&&_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')]&&_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']){_0x17c63b[_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x33')]](_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1a5685[_0xb814('0x6c')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x77')],_0x1a5685[_0xb814('0x75')][_0x152260][_0xb814('0x78')],_0x1a5685[_0xb814('0x75')][_0x152260]['foreignKey']));}}}if(_0x1a5685[_0xb814('0x7a')]){_0x1a5685[_0xb814('0x7a')]=JSON[_0xb814('0x76')](_0x1a5685[_0xb814('0x7a')]);_0x17c63b['where'](_0x2a5dff(_0x1a5685[_0xb814('0x7a')][_0xb814('0x64')]));}_0x16c05b=_0x17c63b[_0xb814('0x7b')]();_0x17c63b[_0xb814('0x3c')](_0x22c811);_0x17c63b[_0xb814('0x20')](0x0);logger['debug'](_0xb814('0x7d'),_0x17c63b[_0xb814('0x7e')]());return dbH[_0xb814('0x7f')][_0xb814('0x35')](_0x17c63b[_0xb814('0x7e')](),{'type':dbH[_0xb814('0x7f')][_0xb814('0x80')][_0xb814('0x9b')]});}})[_0xb814('0x28')](function(){return{'sql':_0x16c05b[_0xb814('0x7e')]()};})[_0xb814('0x28')](respondWithResult(_0x11e0c3,null))[_0xb814('0x44')](handleError(_0x11e0c3,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index ba272ec..e45c9cd 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 _0x1d1d=['request-promise','rimraf','../../config/environment','define','analytics_default_reports','util','../../config/logger','moment','bluebird'];(function(_0x174c4d,_0x3771df){var _0x5a23c7=function(_0x5034c7){while(--_0x5034c7){_0x174c4d['push'](_0x174c4d['shift']());}};_0x5a23c7(++_0x3771df);}(_0x1d1d,0xcb));var _0xd1d1=function(_0x178015,_0x4bcd41){_0x178015=_0x178015-0x0;var _0x5ef3c5=_0x1d1d[_0x178015];return _0x5ef3c5;};'use strict';var _=require('lodash');var util=require(_0xd1d1('0x0'));var logger=require(_0xd1d1('0x1'))('api');var moment=require(_0xd1d1('0x2'));var BPromise=require(_0xd1d1('0x3'));var rp=require(_0xd1d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd1d1('0x5'));var config=require(_0xd1d1('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x1d1294,_0x1f256f){return _0x1d1294[_0xd1d1('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0xd1d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b8e=['../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x3e9e78,_0x1e92c9){var _0x4fc5ac=function(_0x44cbd1){while(--_0x44cbd1){_0x3e9e78['push'](_0x3e9e78['shift']());}};_0x4fc5ac(++_0x1e92c9);}(_0x2b8e,0x14f));var _0xe2b8=function(_0x1e73ab,_0x3a9040){_0x1e73ab=_0x1e73ab-0x0;var _0x40d8c0=_0x2b8e[_0x1e73ab];return _0x40d8c0;};'use strict';var _=require(_0xe2b8('0x0'));var util=require(_0xe2b8('0x1'));var logger=require(_0xe2b8('0x2'))('api');var moment=require(_0xe2b8('0x3'));var BPromise=require(_0xe2b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2b8('0x5'));var rimraf=require('rimraf');var config=require(_0xe2b8('0x6'));var attributes=require(_0xe2b8('0x7'));module['exports']=function(_0x156628,_0x5536dc){return _0x156628[_0xe2b8('0x8')](_0xe2b8('0x9'),attributes,{'tableName':_0xe2b8('0xa'),'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 7dad965..57eebb9 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 _0xa797=['info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2ff733,_0x5f2825){var _0x156deb=function(_0x1f684d){while(--_0x1f684d){_0x2ff733['push'](_0x2ff733['shift']());}};_0x156deb(++_0x5f2825);}(_0xa797,0x127));var _0x7a79=function(_0x3b36af,_0x3556e8){_0x3b36af=_0x3b36af-0x0;var _0x578b1c=_0xa797[_0x3b36af];return _0x578b1c;};'use strict';var _=require(_0x7a79('0x0'));var util=require(_0x7a79('0x1'));var moment=require(_0x7a79('0x2'));var BPromise=require(_0x7a79('0x3'));var rs=require(_0x7a79('0x4'));var fs=require('fs');var Redis=require(_0x7a79('0x5'));var db=require(_0x7a79('0x6'))['db'];var utils=require(_0x7a79('0x7'));var logger=require('../../config/logger')(_0x7a79('0x8'));var config=require(_0x7a79('0x9'));var jayson=require(_0x7a79('0xa'));var client=jayson['client'][_0x7a79('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48e17a,_0x4d7f0e,_0x5cf034){return new BPromise(function(_0x3429ba,_0x25875b){return client[_0x7a79('0xc')](_0x48e17a,_0x5cf034)['then'](function(_0xcc9a99){logger[_0x7a79('0xd')](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));logger[_0x7a79('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4d7f0e,'request\x20sent',JSON['stringify'](_0xcc9a99));if(_0xcc9a99[_0x7a79('0x11')]){if(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x12')]===0x1f4){logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99['error']['message']);return _0x25875b(_0xcc9a99[_0x7a79('0x11')]['message']);}logger[_0x7a79('0x11')](_0x7a79('0xe'),_0x4d7f0e,_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);return _0x3429ba(_0xcc9a99[_0x7a79('0x11')][_0x7a79('0x13')]);}else{logger['info'](_0x7a79('0xe'),_0x4d7f0e,_0x7a79('0xf'));_0x3429ba(_0xcc9a99[_0x7a79('0x14')][_0x7a79('0x13')]);}})[_0x7a79('0x15')](function(_0xd22eb3){logger[_0x7a79('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4d7f0e,_0xd22eb3);_0x25875b(_0xd22eb3);});});}
\ No newline at end of file
+var _0x6c71=['jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2c4e42,_0x7104de){var _0x380da6=function(_0x56f273){while(--_0x56f273){_0x2c4e42['push'](_0x2c4e42['shift']());}};_0x380da6(++_0x7104de);}(_0x6c71,0x1ad));var _0x16c7=function(_0x456fc1,_0x191e3d){_0x456fc1=_0x456fc1-0x0;var _0x84fab3=_0x6c71[_0x456fc1];return _0x84fab3;};'use strict';var _=require(_0x16c7('0x0'));var util=require(_0x16c7('0x1'));var moment=require(_0x16c7('0x2'));var BPromise=require(_0x16c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x16c7('0x5'));var logger=require(_0x16c7('0x6'))('rpc');var config=require(_0x16c7('0x7'));var jayson=require(_0x16c7('0x8'));var client=jayson[_0x16c7('0x9')][_0x16c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448d24,_0x359aea,_0x1f95e8){return new BPromise(function(_0x2eac9f,_0x116cda){return client['request'](_0x448d24,_0x1f95e8)[_0x16c7('0xb')](function(_0x21c7b2){logger[_0x16c7('0xc')](_0x16c7('0xd'),_0x359aea,_0x16c7('0xe'));logger[_0x16c7('0xf')](_0x16c7('0x10'),_0x359aea,_0x16c7('0xe'),JSON[_0x16c7('0x11')](_0x21c7b2));if(_0x21c7b2['error']){if(_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x13')]===0x1f4){logger[_0x16c7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x359aea,_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x14')]);return _0x116cda(_0x21c7b2[_0x16c7('0x12')][_0x16c7('0x14')]);}logger[_0x16c7('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x359aea,_0x21c7b2['error']['message']);return _0x2eac9f(_0x21c7b2['error'][_0x16c7('0x14')]);}else{logger[_0x16c7('0xc')](_0x16c7('0xd'),_0x359aea,_0x16c7('0xe'));_0x2eac9f(_0x21c7b2[_0x16c7('0x15')]['message']);}})[_0x16c7('0x16')](function(_0x4c8c42){logger['error'](_0x16c7('0xd'),_0x359aea,_0x4c8c42);_0x116cda(_0x4c8c42);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 7572d30..7885f1d 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 _0xfb5b=['destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put'];(function(_0x1bfd2d,_0x18fca5){var _0x7b1809=function(_0x59561f){while(--_0x59561f){_0x1bfd2d['push'](_0x1bfd2d['shift']());}};_0x7b1809(++_0x18fca5);}(_0xfb5b,0x89));var _0xbfb5=function(_0x4c6c3f,_0x54c1ee){_0x4c6c3f=_0x4c6c3f-0x0;var _0x3f0d7c=_0xfb5b[_0x4c6c3f];return _0x3f0d7c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbfb5('0x0'));var timeout=require(_0xbfb5('0x1'));var express=require('express');var router=express[_0xbfb5('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbfb5('0x3'));var config=require(_0xbfb5('0x4'));var controller=require('./analyticDefaultReport.controller');router[_0xbfb5('0x5')]('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x7')]);router[_0xbfb5('0x5')](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x9')]);router[_0xbfb5('0x5')](_0xbfb5('0xa'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xb')]);router['get'](_0xbfb5('0xc'),auth[_0xbfb5('0x6')](),controller['run']);router[_0xbfb5('0x5')](_0xbfb5('0xd'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0xbfb5('0x6')](),controller[_0xbfb5('0xe')]);router[_0xbfb5('0xf')](_0xbfb5('0x8'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbfb5('0x8'),auth[_0xbfb5('0x6')](),controller[_0xbfb5('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x2c40=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','exports'];(function(_0x59c683,_0x209444){var _0x47251b=function(_0x4db046){while(--_0x4db046){_0x59c683['push'](_0x59c683['shift']());}};_0x47251b(++_0x209444);}(_0x2c40,0xfd));var _0x02c4=function(_0x575d6b,_0x3f86c1){_0x575d6b=_0x575d6b-0x0;var _0x2c9819=_0x2c40[_0x575d6b];return _0x2c9819;};'use strict';var multer=require('multer');var util=require(_0x02c4('0x0'));var path=require(_0x02c4('0x1'));var timeout=require(_0x02c4('0x2'));var express=require(_0x02c4('0x3'));var router=express[_0x02c4('0x4')]();var fs_extra=require(_0x02c4('0x5'));var auth=require(_0x02c4('0x6'));var interaction=require(_0x02c4('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x02c4('0x8')]('/',auth[_0x02c4('0x9')](),controller['index']);router[_0x02c4('0x8')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xb')]);router['get'](_0x02c4('0xc'),auth['isAuthenticated'](),controller[_0x02c4('0xd')]);router['get'](_0x02c4('0xe'),auth[_0x02c4('0x9')](),controller[_0x02c4('0xf')]);router[_0x02c4('0x8')](_0x02c4('0x10'),auth['isAuthenticated'](),controller[_0x02c4('0x11')]);router['post']('/',auth[_0x02c4('0x9')](),controller['create']);router[_0x02c4('0x12')](_0x02c4('0xa'),auth[_0x02c4('0x9')](),controller[_0x02c4('0x13')]);router[_0x02c4('0x14')](_0x02c4('0xa'),auth['isAuthenticated'](),controller[_0x02c4('0x15')]);module[_0x02c4('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 948df9b..d93dbc5 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 _0x80c6=['STRING','ENUM','xlsx','DATE','Loading','scheduled','manual','sequelize','moment','exports'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x80c6,0x151));var _0x680c=function(_0x32453a,_0x3ed27d){_0x32453a=_0x32453a-0x0;var _0x2182bb=_0x80c6[_0x32453a];return _0x2182bb;};'use strict';var Sequelize=require(_0x680c('0x0'));var moment=require(_0x680c('0x1'));module[_0x680c('0x2')]={'name':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x680c('0x4')]('csv','pdf',_0x680c('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x680c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x680c('0x6')]},'endDate':{'type':Sequelize[_0x680c('0x6')]},'status':{'type':Sequelize[_0x680c('0x3')],'defaultValue':_0x680c('0x7')},'type':{'type':Sequelize['ENUM']('manual',_0x680c('0x8')),'allowNull':![],'defaultValue':_0x680c('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x680c('0x3')]}};
\ No newline at end of file
+var _0x409a=['xlsx','DATE','Loading','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','csv','pdf'];(function(_0xd46227,_0x18477f){var _0x2a980d=function(_0x34e452){while(--_0x34e452){_0xd46227['push'](_0xd46227['shift']());}};_0x2a980d(++_0x18477f);}(_0x409a,0x181));var _0xa409=function(_0x931503,_0x296d97){_0x931503=_0x931503-0x0;var _0x2c838f=_0x409a[_0x931503];return _0x2c838f;};'use strict';var Sequelize=require(_0xa409('0x0'));var moment=require(_0xa409('0x1'));module['exports']={'name':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xa409('0x3'),_0xa409('0x4'),_0xa409('0x5')),'allowNull':![],'defaultValue':_0xa409('0x3')},'savename':{'type':Sequelize[_0xa409('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa409('0x6')]},'endDate':{'type':Sequelize[_0xa409('0x6')]},'status':{'type':Sequelize[_0xa409('0x2')],'defaultValue':_0xa409('0x7')},'type':{'type':Sequelize[_0xa409('0x8')](_0xa409('0x9'),_0xa409('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xa409('0xb')](0xb)[_0xa409('0xc')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index d36722a..e44b41c 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 _0xaee4=['save','get','ExtractedReports','UserProfileResource','destroy','then','name','index','map','AnalyticExtractedReport','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','root','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject'];(function(_0x308ca1,_0xf8eb57){var _0x1c589e=function(_0x1489b7){while(--_0x1489b7){_0x308ca1['push'](_0x308ca1['shift']());}};_0x1c589e(++_0xf8eb57);}(_0xaee4,0xf9));var _0x4aee=function(_0x4f869b,_0x457e62){_0x4f869b=_0x4f869b-0x0;var _0x456ff7=_0xaee4[_0x4f869b];return _0x456ff7;};'use strict';var emlformat=require(_0x4aee('0x0'));var rimraf=require(_0x4aee('0x1'));var zipdir=require(_0x4aee('0x2'));var jsonpatch=require(_0x4aee('0x3'));var rp=require(_0x4aee('0x4'));var moment=require(_0x4aee('0x5'));var BPromise=require(_0x4aee('0x6'));var Mustache=require('mustache');var util=require(_0x4aee('0x7'));var path=require(_0x4aee('0x8'));var sox=require(_0x4aee('0x9'));var csv=require(_0x4aee('0xa'));var ejs=require(_0x4aee('0xb'));var fs=require('fs');var fs_extra=require(_0x4aee('0xc'));var _=require('lodash');var squel=require(_0x4aee('0xd'));var crypto=require(_0x4aee('0xe'));var jsforce=require(_0x4aee('0xf'));var deskjs=require(_0x4aee('0x10'));var toCsv=require(_0x4aee('0xa'));var querystring=require('querystring');var Papa=require(_0x4aee('0x11'));var Redis=require(_0x4aee('0x12'));var authService=require(_0x4aee('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aee('0x14'));var logger=require(_0x4aee('0x15'))(_0x4aee('0x16'));var utils=require(_0x4aee('0x17'));var config=require(_0x4aee('0x18'));var licenseUtil=require(_0x4aee('0x19'));var db=require(_0x4aee('0x1a'))['db'];function respondWithStatusCode(_0x3b1c17,_0x291c95){_0x291c95=_0x291c95||0xcc;return function(_0x3585bd){if(_0x3585bd){return _0x3b1c17[_0x4aee('0x1b')](_0x291c95);}return _0x3b1c17[_0x4aee('0x1c')](_0x291c95)['end']();};}function respondWithResult(_0x3b9193,_0x20f621){_0x20f621=_0x20f621||0xc8;return function(_0x54cddf){if(_0x54cddf){return _0x3b9193[_0x4aee('0x1c')](_0x20f621)[_0x4aee('0x1d')](_0x54cddf);}};}function respondWithFilteredResult(_0x45b3cf,_0xfc48ed){return function(_0x5a45df){if(_0x5a45df){var _0x47c357=typeof _0xfc48ed[_0x4aee('0x1e')]==='undefined'&&typeof _0xfc48ed[_0x4aee('0x1f')]==='undefined';var _0x3d4028=_0x5a45df[_0x4aee('0x20')];var _0x44daf5=_0x47c357?0x0:_0xfc48ed[_0x4aee('0x1e')];var _0x1c35df=_0x47c357?_0x5a45df[_0x4aee('0x20')]:_0xfc48ed[_0x4aee('0x1e')]+_0xfc48ed[_0x4aee('0x1f')];var _0x3474d0;if(_0x1c35df>=_0x3d4028){_0x1c35df=_0x3d4028;_0x3474d0=0xc8;}else{_0x3474d0=0xce;}_0x45b3cf[_0x4aee('0x1c')](_0x3474d0);return _0x45b3cf['set'](_0x4aee('0x21'),_0x44daf5+'-'+_0x1c35df+'/'+_0x3d4028)[_0x4aee('0x1d')](_0x5a45df);}return null;};}function patchUpdates(_0xdeb0ba){return function(_0x54bb91){try{jsonpatch[_0x4aee('0x22')](_0x54bb91,_0xdeb0ba,!![]);}catch(_0x92666d){return BPromise[_0x4aee('0x23')](_0x92666d);}return _0x54bb91[_0x4aee('0x24')]();};}function saveUpdates(_0x200ea0,_0x39a659){return function(_0x1697d3){if(_0x1697d3){return _0x1697d3['update'](_0x200ea0)['then'](function(_0x247a72){return _0x247a72;});}return null;};}function removeEntity(_0x4f14af,_0xd2efc0){return function(_0x1fa8f9){if(_0x1fa8f9){return _0x1fa8f9['destroy']()['then'](function(){var _0x4f3c9b=_0x1fa8f9[_0x4aee('0x25')]({'plain':!![]});var _0xc7c083=_0x4aee('0x26');return db[_0x4aee('0x27')][_0x4aee('0x28')]({'where':{'type':_0xc7c083,'resourceId':_0x4f3c9b['id']}})['then'](function(){return _0x1fa8f9;});})[_0x4aee('0x29')](function(){_0x4f14af['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dca55,_0x4fd286){return function(_0x19182f){if(!_0x19182f){_0x2dca55[_0x4aee('0x1b')](0x194);}return _0x19182f;};}function handleError(_0x47deab,_0xab9eb4){_0xab9eb4=_0xab9eb4||0x1f4;return function(_0x322bfa){logger['error'](_0x322bfa['stack']);if(_0x322bfa[_0x4aee('0x2a')]){delete _0x322bfa['name'];}_0x47deab[_0x4aee('0x1c')](_0xab9eb4)['send'](_0x322bfa);};}exports[_0x4aee('0x2b')]=function(_0x204b7e,_0x219a46){var _0x61efd1={},_0x263d98={},_0x562c0f={'count':0x0,'rows':[]};var _0x756ea8=_[_0x4aee('0x2c')](db[_0x4aee('0x2d')][_0x4aee('0x2e')],function(_0x348640){return{'name':_0x348640['fieldName'],'type':_0x348640['type'][_0x4aee('0x2f')]};});_0x263d98[_0x4aee('0x30')]=_[_0x4aee('0x2c')](_0x756ea8,_0x4aee('0x2a'));_0x263d98[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x204b7e[_0x4aee('0x31')]);_0x263d98['filters']=_['intersection'](_0x263d98[_0x4aee('0x30')],_0x263d98[_0x4aee('0x31')]);_0x61efd1[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x263d98[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x204b7e[_0x4aee('0x31')]['fields']));_0x61efd1[_0x4aee('0x33')]=_0x61efd1['attributes'][_0x4aee('0x36')]?_0x61efd1['attributes']:_0x263d98[_0x4aee('0x30')];if(!_0x204b7e['query'][_0x4aee('0x37')]('nolimit')){_0x61efd1[_0x4aee('0x1f')]=qs[_0x4aee('0x1f')](_0x204b7e['query'][_0x4aee('0x1f')]);_0x61efd1[_0x4aee('0x1e')]=qs[_0x4aee('0x1e')](_0x204b7e[_0x4aee('0x31')][_0x4aee('0x1e')]);}_0x61efd1[_0x4aee('0x38')]=qs['sort'](_0x204b7e['query']['sort']);_0x61efd1[_0x4aee('0x39')]=qs[_0x4aee('0x3a')](_[_0x4aee('0x3b')](_0x204b7e['query'],_0x263d98[_0x4aee('0x3a')]),_0x756ea8);if(_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]){_0x61efd1['where']=_[_0x4aee('0x3d')](_0x61efd1[_0x4aee('0x39')],{'$or':_['map'](_0x756ea8,function(_0x45e6ce){if(_0x45e6ce[_0x4aee('0x3e')]!==_0x4aee('0x3f')){var _0xdaf027={};_0xdaf027[_0x45e6ce[_0x4aee('0x2a')]]={'$like':'%'+_0x204b7e[_0x4aee('0x31')][_0x4aee('0x3c')]+'%'};return _0xdaf027;}})});}_0x61efd1=_['merge']({},_0x61efd1,_0x204b7e[_0x4aee('0x40')]);var _0x3823ba={'where':_0x61efd1[_0x4aee('0x39')]};return db['AnalyticExtractedReport'][_0x4aee('0x20')](_0x3823ba)['then'](function(_0x342888){_0x562c0f[_0x4aee('0x20')]=_0x342888;if(_0x204b7e['query']['includeAll']){_0x61efd1[_0x4aee('0x41')]=[{'all':!![]}];}return db[_0x4aee('0x2d')][_0x4aee('0x42')](_0x61efd1);})[_0x4aee('0x29')](function(_0x66ac7f){_0x562c0f[_0x4aee('0x43')]=_0x66ac7f;return _0x562c0f;})[_0x4aee('0x29')](respondWithFilteredResult(_0x219a46,_0x61efd1))[_0x4aee('0x44')](handleError(_0x219a46,null));};exports[_0x4aee('0x45')]=function(_0x30de25,_0x125507){var _0x352f3a={'raw':!![],'where':{'id':_0x30de25[_0x4aee('0x46')]['id']}},_0x5013c4={};_0x5013c4[_0x4aee('0x30')]=_[_0x4aee('0x32')](db['AnalyticExtractedReport'][_0x4aee('0x2e')]);_0x5013c4[_0x4aee('0x31')]=_[_0x4aee('0x32')](_0x30de25[_0x4aee('0x31')]);_0x5013c4[_0x4aee('0x3a')]=_['intersection'](_0x5013c4[_0x4aee('0x30')],_0x5013c4[_0x4aee('0x31')]);_0x352f3a[_0x4aee('0x33')]=_[_0x4aee('0x34')](_0x5013c4[_0x4aee('0x30')],qs[_0x4aee('0x35')](_0x30de25[_0x4aee('0x31')][_0x4aee('0x35')]));_0x352f3a[_0x4aee('0x33')]=_0x352f3a[_0x4aee('0x33')]['length']?_0x352f3a[_0x4aee('0x33')]:_0x5013c4[_0x4aee('0x30')];if(_0x30de25[_0x4aee('0x31')][_0x4aee('0x47')]){_0x352f3a[_0x4aee('0x41')]=[{'all':!![]}];}_0x352f3a=_[_0x4aee('0x3d')]({},_0x352f3a,_0x30de25[_0x4aee('0x40')]);return db[_0x4aee('0x2d')][_0x4aee('0x48')](_0x352f3a)[_0x4aee('0x29')](handleEntityNotFound(_0x125507,null))[_0x4aee('0x29')](respondWithResult(_0x125507,null))[_0x4aee('0x44')](handleError(_0x125507,null));};exports[_0x4aee('0x49')]=function(_0x4a0e1a,_0x441c33){return db[_0x4aee('0x2d')][_0x4aee('0x49')](_0x4a0e1a['body'],{})[_0x4aee('0x29')](function(_0x2df7bd){var _0x514e33=_0x4a0e1a[_0x4aee('0x4a')][_0x4aee('0x25')]({'plain':!![]});if(!_0x514e33)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x514e33['role']===_0x4aee('0x4a')){var _0x4cd316=_0x2df7bd[_0x4aee('0x25')]({'plain':!![]});var _0x25069c='ExtractedReports';return db[_0x4aee('0x4b')][_0x4aee('0x48')]({'where':{'name':_0x25069c,'userProfileId':_0x514e33[_0x4aee('0x4c')]},'raw':!![]})[_0x4aee('0x29')](function(_0x231607){if(_0x231607&&_0x231607[_0x4aee('0x4d')]===0x0){return db[_0x4aee('0x27')][_0x4aee('0x49')]({'name':_0x4cd316['name'],'resourceId':_0x4cd316['id'],'type':_0x231607['name'],'sectionId':_0x231607['id']},{})[_0x4aee('0x29')](function(){return _0x2df7bd;});}else{return _0x2df7bd;}})[_0x4aee('0x44')](function(_0x423fac){logger[_0x4aee('0x4e')](_0x4aee('0x4f'),_0x423fac);throw _0x423fac;});}return _0x2df7bd;})[_0x4aee('0x29')](respondWithResult(_0x441c33,0xc9))[_0x4aee('0x44')](handleError(_0x441c33,null));};exports['update']=function(_0xf67ba6,_0x1d8bf7){if(_0xf67ba6['body']['id']){delete _0xf67ba6[_0x4aee('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x4aee('0x48')]({'where':{'id':_0xf67ba6['params']['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x1d8bf7,null))['then'](saveUpdates(_0xf67ba6[_0x4aee('0x50')],null))[_0x4aee('0x29')](respondWithResult(_0x1d8bf7,null))[_0x4aee('0x44')](handleError(_0x1d8bf7,null));};exports[_0x4aee('0x28')]=function(_0x5178db,_0x2aece8){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x5178db[_0x4aee('0x46')]['id']}})[_0x4aee('0x29')](handleEntityNotFound(_0x2aece8,null))['then'](removeEntity(_0x2aece8,null))[_0x4aee('0x44')](handleError(_0x2aece8,null));};exports[_0x4aee('0x51')]=function(_0x4ab417,_0x1537bf,_0x679440){return db[_0x4aee('0x2d')][_0x4aee('0x48')]({'where':{'id':_0x4ab417[_0x4aee('0x46')]['id']},'attributes':[_0x4aee('0x2a'),_0x4aee('0x52'),_0x4aee('0x53'),_0x4aee('0x54')],'raw':!![]})[_0x4aee('0x29')](handleEntityNotFound(_0x1537bf,null))[_0x4aee('0x29')](function(_0x7954b9){if(_0x7954b9){if(!fs[_0x4aee('0x55')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]))){throw new db['Sequelize'][(_0x4aee('0x59'))](_0x4aee('0x5a'));}if(_0x4ab417[_0x4aee('0x31')][_0x4aee('0x5b')]){return _0x1537bf[_0x4aee('0x1b')](0xc8);}return _0x1537bf[_0x4aee('0x51')](path[_0x4aee('0x56')](config[_0x4aee('0x57')],_0x4aee('0x58'),_0x7954b9[_0x4aee('0x53')]),util[_0x4aee('0x5c')](_0x4aee('0x5d'),_0x7954b9[_0x4aee('0x52')]||_0x7954b9[_0x4aee('0x2a')],_0x7954b9[_0x4aee('0x54')][_0x4aee('0x5e')]()));}})[_0x4aee('0x44')](handleError(_0x1537bf,null));};
\ No newline at end of file
+var _0x388a=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','root','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','server/files/reports','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x706e7e,_0x31bb07){var _0x1dfb2e=function(_0x47cbb8){while(--_0x47cbb8){_0x706e7e['push'](_0x706e7e['shift']());}};_0x1dfb2e(++_0x31bb07);}(_0x388a,0x17e));var _0xa388=function(_0x80c112,_0xae37fc){_0x80c112=_0x80c112-0x0;var _0x23232c=_0x388a[_0x80c112];return _0x23232c;};'use strict';var emlformat=require(_0xa388('0x0'));var rimraf=require(_0xa388('0x1'));var zipdir=require(_0xa388('0x2'));var jsonpatch=require(_0xa388('0x3'));var rp=require(_0xa388('0x4'));var moment=require(_0xa388('0x5'));var BPromise=require(_0xa388('0x6'));var Mustache=require(_0xa388('0x7'));var util=require('util');var path=require(_0xa388('0x8'));var sox=require(_0xa388('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa388('0xa'));var squel=require(_0xa388('0xb'));var crypto=require(_0xa388('0xc'));var jsforce=require(_0xa388('0xd'));var deskjs=require(_0xa388('0xe'));var toCsv=require(_0xa388('0xf'));var querystring=require(_0xa388('0x10'));var Papa=require('papaparse');var Redis=require(_0xa388('0x11'));var authService=require(_0xa388('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa388('0x13'));var hardwareService=require(_0xa388('0x14'));var logger=require(_0xa388('0x15'))('api');var utils=require(_0xa388('0x16'));var config=require(_0xa388('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa388('0x18'))['db'];function respondWithStatusCode(_0x17d47e,_0x2087da){_0x2087da=_0x2087da||0xcc;return function(_0x5f4637){if(_0x5f4637){return _0x17d47e['sendStatus'](_0x2087da);}return _0x17d47e['status'](_0x2087da)[_0xa388('0x19')]();};}function respondWithResult(_0x4c816b,_0x289744){_0x289744=_0x289744||0xc8;return function(_0x388e29){if(_0x388e29){return _0x4c816b[_0xa388('0x1a')](_0x289744)[_0xa388('0x1b')](_0x388e29);}};}function respondWithFilteredResult(_0x1d01ef,_0x3b8699){return function(_0x2ae86f){if(_0x2ae86f){var _0x581364=typeof _0x3b8699['offset']===_0xa388('0x1c')&&typeof _0x3b8699[_0xa388('0x1d')]===_0xa388('0x1c');var _0x2378f0=_0x2ae86f[_0xa388('0x1e')];var _0x215e27=_0x581364?0x0:_0x3b8699[_0xa388('0x1f')];var _0x537a6d=_0x581364?_0x2ae86f[_0xa388('0x1e')]:_0x3b8699[_0xa388('0x1f')]+_0x3b8699[_0xa388('0x1d')];var _0x9be630;if(_0x537a6d>=_0x2378f0){_0x537a6d=_0x2378f0;_0x9be630=0xc8;}else{_0x9be630=0xce;}_0x1d01ef[_0xa388('0x1a')](_0x9be630);return _0x1d01ef['set'](_0xa388('0x20'),_0x215e27+'-'+_0x537a6d+'/'+_0x2378f0)[_0xa388('0x1b')](_0x2ae86f);}return null;};}function patchUpdates(_0x3d4656){return function(_0x3392ec){try{jsonpatch[_0xa388('0x21')](_0x3392ec,_0x3d4656,!![]);}catch(_0x138dc2){return BPromise[_0xa388('0x22')](_0x138dc2);}return _0x3392ec[_0xa388('0x23')]();};}function saveUpdates(_0x2b479f,_0x2c8efb){return function(_0x19552c){if(_0x19552c){return _0x19552c[_0xa388('0x24')](_0x2b479f)[_0xa388('0x25')](function(_0x15ed3e){return _0x15ed3e;});}return null;};}function removeEntity(_0x3ecff2,_0x2ffc35){return function(_0x1e56d4){if(_0x1e56d4){return _0x1e56d4['destroy']()[_0xa388('0x25')](function(){var _0x37d0e6=_0x1e56d4['get']({'plain':!![]});var _0x243ce9=_0xa388('0x26');return db[_0xa388('0x27')][_0xa388('0x28')]({'where':{'type':_0x243ce9,'resourceId':_0x37d0e6['id']}})[_0xa388('0x25')](function(){return _0x1e56d4;});})['then'](function(){_0x3ecff2[_0xa388('0x1a')](0xcc)[_0xa388('0x19')]();});}};}function handleEntityNotFound(_0x220246,_0x1e44da){return function(_0xe9e5e2){if(!_0xe9e5e2){_0x220246['sendStatus'](0x194);}return _0xe9e5e2;};}function handleError(_0xa719d6,_0x5eeccd){_0x5eeccd=_0x5eeccd||0x1f4;return function(_0xe8b4b2){logger[_0xa388('0x29')](_0xe8b4b2[_0xa388('0x2a')]);if(_0xe8b4b2[_0xa388('0x2b')]){delete _0xe8b4b2['name'];}_0xa719d6['status'](_0x5eeccd)[_0xa388('0x2c')](_0xe8b4b2);};}exports[_0xa388('0x2d')]=function(_0x17ff06,_0x129879){var _0x431a59={},_0x168508={},_0x5dc0c6={'count':0x0,'rows':[]};var _0x383b11=_[_0xa388('0x2e')](db[_0xa388('0x2f')][_0xa388('0x30')],function(_0x2f4a9e){return{'name':_0x2f4a9e[_0xa388('0x31')],'type':_0x2f4a9e[_0xa388('0x32')]['key']};});_0x168508[_0xa388('0x33')]=_['map'](_0x383b11,'name');_0x168508[_0xa388('0x34')]=_[_0xa388('0x35')](_0x17ff06[_0xa388('0x34')]);_0x168508[_0xa388('0x36')]=_['intersection'](_0x168508[_0xa388('0x33')],_0x168508['query']);_0x431a59[_0xa388('0x37')]=_[_0xa388('0x38')](_0x168508[_0xa388('0x33')],qs[_0xa388('0x39')](_0x17ff06[_0xa388('0x34')][_0xa388('0x39')]));_0x431a59[_0xa388('0x37')]=_0x431a59[_0xa388('0x37')]['length']?_0x431a59['attributes']:_0x168508[_0xa388('0x33')];if(!_0x17ff06[_0xa388('0x34')][_0xa388('0x3a')](_0xa388('0x3b'))){_0x431a59[_0xa388('0x1d')]=qs[_0xa388('0x1d')](_0x17ff06[_0xa388('0x34')][_0xa388('0x1d')]);_0x431a59[_0xa388('0x1f')]=qs[_0xa388('0x1f')](_0x17ff06[_0xa388('0x34')][_0xa388('0x1f')]);}_0x431a59['order']=qs[_0xa388('0x3c')](_0x17ff06[_0xa388('0x34')][_0xa388('0x3c')]);_0x431a59['where']=qs['filters'](_['pick'](_0x17ff06[_0xa388('0x34')],_0x168508[_0xa388('0x36')]),_0x383b11);if(_0x17ff06[_0xa388('0x34')][_0xa388('0x3d')]){_0x431a59['where']=_[_0xa388('0x3e')](_0x431a59[_0xa388('0x3f')],{'$or':_['map'](_0x383b11,function(_0x19b46d){if(_0x19b46d[_0xa388('0x32')]!==_0xa388('0x40')){var _0x529b7d={};_0x529b7d[_0x19b46d[_0xa388('0x2b')]]={'$like':'%'+_0x17ff06[_0xa388('0x34')][_0xa388('0x3d')]+'%'};return _0x529b7d;}})});}_0x431a59=_[_0xa388('0x3e')]({},_0x431a59,_0x17ff06[_0xa388('0x41')]);var _0x446095={'where':_0x431a59[_0xa388('0x3f')]};return db[_0xa388('0x2f')]['count'](_0x446095)[_0xa388('0x25')](function(_0x1f7b25){_0x5dc0c6['count']=_0x1f7b25;if(_0x17ff06['query'][_0xa388('0x42')]){_0x431a59[_0xa388('0x43')]=[{'all':!![]}];}return db[_0xa388('0x2f')][_0xa388('0x44')](_0x431a59);})['then'](function(_0x34e7df){_0x5dc0c6[_0xa388('0x45')]=_0x34e7df;return _0x5dc0c6;})[_0xa388('0x25')](respondWithFilteredResult(_0x129879,_0x431a59))['catch'](handleError(_0x129879,null));};exports[_0xa388('0x46')]=function(_0x58da0d,_0x2458db){var _0x31484b={'raw':!![],'where':{'id':_0x58da0d[_0xa388('0x47')]['id']}},_0x420442={};_0x420442[_0xa388('0x33')]=_['keys'](db[_0xa388('0x2f')][_0xa388('0x30')]);_0x420442['query']=_[_0xa388('0x35')](_0x58da0d[_0xa388('0x34')]);_0x420442[_0xa388('0x36')]=_[_0xa388('0x38')](_0x420442[_0xa388('0x33')],_0x420442[_0xa388('0x34')]);_0x31484b['attributes']=_['intersection'](_0x420442[_0xa388('0x33')],qs[_0xa388('0x39')](_0x58da0d[_0xa388('0x34')][_0xa388('0x39')]));_0x31484b[_0xa388('0x37')]=_0x31484b[_0xa388('0x37')][_0xa388('0x48')]?_0x31484b[_0xa388('0x37')]:_0x420442[_0xa388('0x33')];if(_0x58da0d[_0xa388('0x34')][_0xa388('0x42')]){_0x31484b['include']=[{'all':!![]}];}_0x31484b=_[_0xa388('0x3e')]({},_0x31484b,_0x58da0d['options']);return db[_0xa388('0x2f')]['find'](_0x31484b)[_0xa388('0x25')](handleEntityNotFound(_0x2458db,null))[_0xa388('0x25')](respondWithResult(_0x2458db,null))[_0xa388('0x49')](handleError(_0x2458db,null));};exports[_0xa388('0x4a')]=function(_0x20e99c,_0x4e7896){return db[_0xa388('0x2f')][_0xa388('0x4a')](_0x20e99c[_0xa388('0x4b')],{})[_0xa388('0x25')](function(_0x51ab75){var _0x5dcaa8=_0x20e99c[_0xa388('0x4c')]['get']({'plain':!![]});if(!_0x5dcaa8)throw new Error(_0xa388('0x4d'));if(_0x5dcaa8[_0xa388('0x4e')]===_0xa388('0x4c')){var _0x3b8abc=_0x51ab75[_0xa388('0x4f')]({'plain':!![]});var _0x1ce8c3=_0xa388('0x26');return db[_0xa388('0x50')][_0xa388('0x51')]({'where':{'name':_0x1ce8c3,'userProfileId':_0x5dcaa8[_0xa388('0x52')]},'raw':!![]})[_0xa388('0x25')](function(_0x1a28fd){if(_0x1a28fd&&_0x1a28fd[_0xa388('0x53')]===0x0){return db[_0xa388('0x27')][_0xa388('0x4a')]({'name':_0x3b8abc[_0xa388('0x2b')],'resourceId':_0x3b8abc['id'],'type':_0x1a28fd['name'],'sectionId':_0x1a28fd['id']},{})[_0xa388('0x25')](function(){return _0x51ab75;});}else{return _0x51ab75;}})['catch'](function(_0x2b0709){logger[_0xa388('0x29')](_0xa388('0x54'),_0x2b0709);throw _0x2b0709;});}return _0x51ab75;})[_0xa388('0x25')](respondWithResult(_0x4e7896,0xc9))[_0xa388('0x49')](handleError(_0x4e7896,null));};exports[_0xa388('0x24')]=function(_0x5491ca,_0xde0faf){if(_0x5491ca[_0xa388('0x4b')]['id']){delete _0x5491ca[_0xa388('0x4b')]['id'];}return db[_0xa388('0x2f')][_0xa388('0x51')]({'where':{'id':_0x5491ca['params']['id']}})[_0xa388('0x25')](handleEntityNotFound(_0xde0faf,null))['then'](saveUpdates(_0x5491ca[_0xa388('0x4b')],null))['then'](respondWithResult(_0xde0faf,null))[_0xa388('0x49')](handleError(_0xde0faf,null));};exports[_0xa388('0x28')]=function(_0x4eb570,_0x3cfcb7){return db[_0xa388('0x2f')][_0xa388('0x51')]({'where':{'id':_0x4eb570[_0xa388('0x47')]['id']}})[_0xa388('0x25')](handleEntityNotFound(_0x3cfcb7,null))['then'](removeEntity(_0x3cfcb7,null))[_0xa388('0x49')](handleError(_0x3cfcb7,null));};exports[_0xa388('0x55')]=function(_0x4f81e9,_0x1e7068,_0x35c437){return db[_0xa388('0x2f')]['find']({'where':{'id':_0x4f81e9[_0xa388('0x47')]['id']},'attributes':['name',_0xa388('0x56'),'savename',_0xa388('0x57')],'raw':!![]})[_0xa388('0x25')](handleEntityNotFound(_0x1e7068,null))[_0xa388('0x25')](function(_0x399790){if(_0x399790){if(!fs[_0xa388('0x58')](path['join'](config[_0xa388('0x59')],'server/files/reports',_0x399790[_0xa388('0x5a')]))){throw new db[(_0xa388('0x5b'))][(_0xa388('0x5c'))](_0xa388('0x5d'));}if(_0x4f81e9[_0xa388('0x34')][_0xa388('0x5e')]){return _0x1e7068['sendStatus'](0xc8);}return _0x1e7068[_0xa388('0x55')](path['join'](config[_0xa388('0x59')],_0xa388('0x5f'),_0x399790[_0xa388('0x5a')]),util[_0xa388('0x60')](_0xa388('0x61'),_0x399790[_0xa388('0x56')]||_0x399790[_0xa388('0x2b')],_0x399790[_0xa388('0x57')]['toLowerCase']()));}})[_0xa388('0x49')](handleError(_0x1e7068,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 2fe92b3..ff01000 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 _0xcd5a=['path','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18fc2d,_0x3d356a){var _0x409fc8=function(_0x432710){while(--_0x432710){_0x18fc2d['push'](_0x18fc2d['shift']());}};_0x409fc8(++_0x3d356a);}(_0xcd5a,0xa1));var _0xacd5=function(_0x16834b,_0x4c2cda){_0x16834b=_0x16834b-0x0;var _0x4c7aee=_0xcd5a[_0x16834b];return _0x4c7aee;};'use strict';var _=require(_0xacd5('0x0'));var util=require(_0xacd5('0x1'));var logger=require(_0xacd5('0x2'))(_0xacd5('0x3'));var moment=require(_0xacd5('0x4'));var BPromise=require(_0xacd5('0x5'));var rp=require(_0xacd5('0x6'));var fs=require('fs');var path=require(_0xacd5('0x7'));var rimraf=require(_0xacd5('0x8'));var config=require(_0xacd5('0x9'));var attributes=require('./analyticExtractedReport.attributes');module[_0xacd5('0xa')]=function(_0x106087,_0x313668){return _0x106087[_0xacd5('0xb')](_0xacd5('0xc'),attributes,{'tableName':_0xacd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xacde=['../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x34eccb,_0x3a9083){var _0x15f1f6=function(_0x454bf0){while(--_0x454bf0){_0x34eccb['push'](_0x34eccb['shift']());}};_0x15f1f6(++_0x3a9083);}(_0xacde,0xc5));var _0xeacd=function(_0x4be687,_0xe630cc){_0x4be687=_0x4be687-0x0;var _0x42156f=_0xacde[_0x4be687];return _0x42156f;};'use strict';var _=require(_0xeacd('0x0'));var util=require(_0xeacd('0x1'));var logger=require(_0xeacd('0x2'))(_0xeacd('0x3'));var moment=require(_0xeacd('0x4'));var BPromise=require(_0xeacd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeacd('0x6'));var rimraf=require('rimraf');var config=require(_0xeacd('0x7'));var attributes=require(_0xeacd('0x8'));module['exports']=function(_0x42cc59,_0x1727ba){return _0x42cc59[_0xeacd('0x9')](_0xeacd('0xa'),attributes,{'tableName':_0xeacd('0xb'),'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 5383348..04a97c1 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 _0x6f75=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x49f67f,_0x4113a4){var _0x4779a1=function(_0x5064b0){while(--_0x5064b0){_0x49f67f['push'](_0x49f67f['shift']());}};_0x4779a1(++_0x4113a4);}(_0x6f75,0x71));var _0x56f7=function(_0x3a4998,_0x5b8203){_0x3a4998=_0x3a4998-0x0;var _0x18e7df=_0x6f75[_0x3a4998];return _0x18e7df;};'use strict';var _=require(_0x56f7('0x0'));var util=require(_0x56f7('0x1'));var moment=require(_0x56f7('0x2'));var BPromise=require(_0x56f7('0x3'));var rs=require(_0x56f7('0x4'));var fs=require('fs');var Redis=require(_0x56f7('0x5'));var db=require(_0x56f7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x56f7('0x7'))(_0x56f7('0x8'));var config=require(_0x56f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x137d14,_0xcc51b1,_0x4b5dcc){return new BPromise(function(_0x184bf7,_0x5155ff){return client['request'](_0x137d14,_0x4b5dcc)[_0x56f7('0xa')](function(_0x1e607c){logger[_0x56f7('0xb')](_0x56f7('0xc'),_0xcc51b1,_0x56f7('0xd'));logger[_0x56f7('0xe')](_0x56f7('0xf'),_0xcc51b1,_0x56f7('0xd'),JSON[_0x56f7('0x10')](_0x1e607c));if(_0x1e607c[_0x56f7('0x11')]){if(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x12')]===0x1f4){logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c['error'][_0x56f7('0x13')]);return _0x5155ff(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}logger[_0x56f7('0x11')](_0x56f7('0xc'),_0xcc51b1,_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);return _0x184bf7(_0x1e607c[_0x56f7('0x11')][_0x56f7('0x13')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x56f7('0xd'));_0x184bf7(_0x1e607c[_0x56f7('0x14')][_0x56f7('0x13')]);}})[_0x56f7('0x15')](function(_0x40fb77){logger[_0x56f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcc51b1,_0x40fb77);_0x5155ff(_0x40fb77);});});}
\ No newline at end of file
+var _0x6fa8=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x364048,_0x34dea3){var _0x591678=function(_0x239c0a){while(--_0x239c0a){_0x364048['push'](_0x364048['shift']());}};_0x591678(++_0x34dea3);}(_0x6fa8,0x79));var _0x86fa=function(_0x1ef48d,_0x203c73){_0x1ef48d=_0x1ef48d-0x0;var _0x450096=_0x6fa8[_0x1ef48d];return _0x450096;};'use strict';var _=require('lodash');var util=require(_0x86fa('0x0'));var moment=require(_0x86fa('0x1'));var BPromise=require(_0x86fa('0x2'));var rs=require(_0x86fa('0x3'));var fs=require('fs');var Redis=require(_0x86fa('0x4'));var db=require(_0x86fa('0x5'))['db'];var utils=require(_0x86fa('0x6'));var logger=require(_0x86fa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x86fa('0x8'));var client=jayson[_0x86fa('0x9')][_0x86fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x509e45,_0x1f0e92,_0x34b993){return new BPromise(function(_0x20eec3,_0x2de438){return client[_0x86fa('0xb')](_0x509e45,_0x34b993)['then'](function(_0x2bd4bc){logger[_0x86fa('0xc')](_0x86fa('0xd'),_0x1f0e92,_0x86fa('0xe'));logger['debug'](_0x86fa('0xf'),_0x1f0e92,_0x86fa('0xe'),JSON['stringify'](_0x2bd4bc));if(_0x2bd4bc[_0x86fa('0x10')]){if(_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x11')]===0x1f4){logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x12')]);return _0x2de438(_0x2bd4bc['error'][_0x86fa('0x12')]);}logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x2bd4bc['error'][_0x86fa('0x12')]);return _0x20eec3(_0x2bd4bc[_0x86fa('0x10')][_0x86fa('0x12')]);}else{logger[_0x86fa('0xc')](_0x86fa('0xd'),_0x1f0e92,_0x86fa('0xe'));_0x20eec3(_0x2bd4bc[_0x86fa('0x13')]['message']);}})[_0x86fa('0x14')](function(_0x4ae13c){logger[_0x86fa('0x10')](_0x86fa('0xd'),_0x1f0e92,_0x4ae13c);_0x2de438(_0x4ae13c);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index e6ce910..9153d6c 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 _0x4606=['/:id/download','download','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show'];(function(_0x2bf755,_0x4b156b){var _0x2e1810=function(_0x77fbae){while(--_0x77fbae){_0x2bf755['push'](_0x2bf755['shift']());}};_0x2e1810(++_0x4b156b);}(_0x4606,0x1e4));var _0x6460=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4606[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6460('0x0'));var util=require('util');var path=require(_0x6460('0x1'));var timeout=require(_0x6460('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6460('0x3'));var config=require(_0x6460('0x4'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x6460('0x5')](),controller[_0x6460('0x6')]);router[_0x6460('0x7')]('/:id',auth[_0x6460('0x5')](),controller[_0x6460('0x8')]);router[_0x6460('0x7')](_0x6460('0x9'),auth[_0x6460('0x5')](),controller[_0x6460('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6460('0xb')]);router[_0x6460('0xc')](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xe')]);router['delete'](_0x6460('0xd'),auth[_0x6460('0x5')](),controller[_0x6460('0xf')]);module[_0x6460('0x10')]=router;
\ No newline at end of file
+var _0xe641=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0xe641,0xea));var _0x1e64=function(_0x30f583,_0x42b6a8){_0x30f583=_0x30f583-0x0;var _0xf24311=_0xe641[_0x30f583];return _0xf24311;};'use strict';var multer=require(_0x1e64('0x0'));var util=require(_0x1e64('0x1'));var path=require(_0x1e64('0x2'));var timeout=require(_0x1e64('0x3'));var express=require(_0x1e64('0x4'));var router=express[_0x1e64('0x5')]();var fs_extra=require(_0x1e64('0x6'));var auth=require(_0x1e64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1e64('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0x1e64('0x9')]('/',auth[_0x1e64('0xa')](),controller[_0x1e64('0xb')]);router[_0x1e64('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1e64('0xc')]);router[_0x1e64('0x9')](_0x1e64('0xd'),auth[_0x1e64('0xa')](),controller[_0x1e64('0xe')]);router[_0x1e64('0xf')]('/',auth[_0x1e64('0xa')](),controller['create']);router[_0x1e64('0x10')](_0x1e64('0x11'),auth[_0x1e64('0xa')](),controller[_0x1e64('0x12')]);router[_0x1e64('0x13')](_0x1e64('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 5760a9f..c7ed436 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 _0x4280=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x4280,0x136));var _0x0428=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4280[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0428('0x0'));module['exports']={'field':{'type':Sequelize[_0x0428('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x0428('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x0428('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x0428('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xd03f=['STRING','BOOLEAN','sequelize','exports'];(function(_0x334599,_0x4b1cfa){var _0x4cdff2=function(_0x297be7){while(--_0x297be7){_0x334599['push'](_0x334599['shift']());}};_0x4cdff2(++_0x4b1cfa);}(_0xd03f,0x16e));var _0xfd03=function(_0xe391aa,_0x255528){_0xe391aa=_0xe391aa-0x0;var _0x793c4d=_0xd03f[_0xe391aa];return _0x793c4d;};'use strict';var Sequelize=require(_0xfd03('0x0'));module[_0xfd03('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xfd03('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xfd03('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfd03('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index bd98ded..bd2664d 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 _0x50ea=['VIRTUAL','merge','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','sendStatus','status','json','offset','count','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filters','pick','where'];(function(_0x1d2e01,_0x30e8aa){var _0x36bc23=function(_0x59613c){while(--_0x59613c){_0x1d2e01['push'](_0x1d2e01['shift']());}};_0x36bc23(++_0x30e8aa);}(_0x50ea,0x1ca));var _0xa50e=function(_0xff7bd7,_0x1eef65){_0xff7bd7=_0xff7bd7-0x0;var _0x2b9786=_0x50ea[_0xff7bd7];return _0x2b9786;};'use strict';var emlformat=require(_0xa50e('0x0'));var rimraf=require(_0xa50e('0x1'));var zipdir=require(_0xa50e('0x2'));var jsonpatch=require(_0xa50e('0x3'));var rp=require(_0xa50e('0x4'));var moment=require(_0xa50e('0x5'));var BPromise=require(_0xa50e('0x6'));var Mustache=require(_0xa50e('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa50e('0x8'));var csv=require(_0xa50e('0x9'));var ejs=require(_0xa50e('0xa'));var fs=require('fs');var fs_extra=require(_0xa50e('0xb'));var _=require(_0xa50e('0xc'));var squel=require(_0xa50e('0xd'));var crypto=require(_0xa50e('0xe'));var jsforce=require(_0xa50e('0xf'));var deskjs=require(_0xa50e('0x10'));var toCsv=require(_0xa50e('0x9'));var querystring=require(_0xa50e('0x11'));var Papa=require(_0xa50e('0x12'));var Redis=require(_0xa50e('0x13'));var authService=require(_0xa50e('0x14'));var qs=require(_0xa50e('0x15'));var as=require(_0xa50e('0x16'));var hardwareService=require(_0xa50e('0x17'));var logger=require(_0xa50e('0x18'))(_0xa50e('0x19'));var utils=require(_0xa50e('0x1a'));var config=require(_0xa50e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa50e('0x1c'))['db'];function respondWithStatusCode(_0x29c414,_0xc2d654){_0xc2d654=_0xc2d654||0xcc;return function(_0xf3d641){if(_0xf3d641){return _0x29c414[_0xa50e('0x1d')](_0xc2d654);}return _0x29c414[_0xa50e('0x1e')](_0xc2d654)['end']();};}function respondWithResult(_0x289b5b,_0x5650fb){_0x5650fb=_0x5650fb||0xc8;return function(_0x11e8d){if(_0x11e8d){return _0x289b5b['status'](_0x5650fb)[_0xa50e('0x1f')](_0x11e8d);}};}function respondWithFilteredResult(_0xcac5f0,_0x4f6d9b){return function(_0x2c9945){if(_0x2c9945){var _0x3627cc=typeof _0x4f6d9b[_0xa50e('0x20')]==='undefined'&&typeof _0x4f6d9b['limit']==='undefined';var _0x35edc4=_0x2c9945[_0xa50e('0x21')];var _0x48a610=_0x3627cc?0x0:_0x4f6d9b['offset'];var _0x2c25c3=_0x3627cc?_0x2c9945[_0xa50e('0x21')]:_0x4f6d9b[_0xa50e('0x20')]+_0x4f6d9b['limit'];var _0x343174;if(_0x2c25c3>=_0x35edc4){_0x2c25c3=_0x35edc4;_0x343174=0xc8;}else{_0x343174=0xce;}_0xcac5f0['status'](_0x343174);return _0xcac5f0['set'](_0xa50e('0x22'),_0x48a610+'-'+_0x2c25c3+'/'+_0x35edc4)[_0xa50e('0x1f')](_0x2c9945);}return null;};}function patchUpdates(_0x80ff38){return function(_0x481f36){try{jsonpatch[_0xa50e('0x23')](_0x481f36,_0x80ff38,!![]);}catch(_0x5b4d66){return BPromise[_0xa50e('0x24')](_0x5b4d66);}return _0x481f36[_0xa50e('0x25')]();};}function saveUpdates(_0x222115,_0x1753ae){return function(_0x3ecfa7){if(_0x3ecfa7){return _0x3ecfa7['update'](_0x222115)[_0xa50e('0x26')](function(_0xff0918){return _0xff0918;});}return null;};}function removeEntity(_0x37724f,_0x1369bc){return function(_0xbb3cc3){if(_0xbb3cc3){return _0xbb3cc3[_0xa50e('0x27')]()['then'](function(){_0x37724f['status'](0xcc)[_0xa50e('0x28')]();});}};}function handleEntityNotFound(_0x2cc0ac,_0xbb3463){return function(_0xbde460){if(!_0xbde460){_0x2cc0ac['sendStatus'](0x194);}return _0xbde460;};}function handleError(_0x22902c,_0x5adacc){_0x5adacc=_0x5adacc||0x1f4;return function(_0x1b10a2){logger['error'](_0x1b10a2[_0xa50e('0x29')]);if(_0x1b10a2[_0xa50e('0x2a')]){delete _0x1b10a2[_0xa50e('0x2a')];}_0x22902c['status'](_0x5adacc)[_0xa50e('0x2b')](_0x1b10a2);};}exports['index']=function(_0x79e5ab,_0x2c2299){var _0x48a530={},_0x419253={},_0x121682={'count':0x0,'rows':[]};var _0x5c4d4f=_['map'](db[_0xa50e('0x2c')][_0xa50e('0x2d')],function(_0x320ff8){return{'name':_0x320ff8[_0xa50e('0x2e')],'type':_0x320ff8[_0xa50e('0x2f')][_0xa50e('0x30')]};});_0x419253['model']=_[_0xa50e('0x31')](_0x5c4d4f,'name');_0x419253['query']=_[_0xa50e('0x32')](_0x79e5ab[_0xa50e('0x33')]);_0x419253['filters']=_[_0xa50e('0x34')](_0x419253[_0xa50e('0x35')],_0x419253[_0xa50e('0x33')]);_0x48a530[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x419253['model'],qs['fields'](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x37')]));_0x48a530['attributes']=_0x48a530['attributes'][_0xa50e('0x38')]?_0x48a530[_0xa50e('0x36')]:_0x419253[_0xa50e('0x35')];if(!_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x39')](_0xa50e('0x3a'))){_0x48a530[_0xa50e('0x3b')]=qs[_0xa50e('0x3b')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3b')]);_0x48a530[_0xa50e('0x20')]=qs[_0xa50e('0x20')](_0x79e5ab[_0xa50e('0x33')]['offset']);}_0x48a530['order']=qs[_0xa50e('0x3c')](_0x79e5ab[_0xa50e('0x33')][_0xa50e('0x3c')]);_0x48a530['where']=qs[_0xa50e('0x3d')](_[_0xa50e('0x3e')](_0x79e5ab['query'],_0x419253[_0xa50e('0x3d')]),_0x5c4d4f);if(_0x79e5ab['query']['filter']){_0x48a530[_0xa50e('0x3f')]=_['merge'](_0x48a530[_0xa50e('0x3f')],{'$or':_[_0xa50e('0x31')](_0x5c4d4f,function(_0xab6230){if(_0xab6230[_0xa50e('0x2f')]!==_0xa50e('0x40')){var _0x54e236={};_0x54e236[_0xab6230[_0xa50e('0x2a')]]={'$like':'%'+_0x79e5ab[_0xa50e('0x33')]['filter']+'%'};return _0x54e236;}})});}_0x48a530=_[_0xa50e('0x41')]({},_0x48a530,_0x79e5ab[_0xa50e('0x42')]);var _0x1894f6={'where':_0x48a530['where']};return db[_0xa50e('0x2c')][_0xa50e('0x21')](_0x1894f6)[_0xa50e('0x26')](function(_0x4dcd23){_0x121682['count']=_0x4dcd23;if(_0x79e5ab[_0xa50e('0x33')]['includeAll']){_0x48a530['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa50e('0x43')](_0x48a530);})[_0xa50e('0x26')](function(_0x46d0dd){_0x121682[_0xa50e('0x44')]=_0x46d0dd;return _0x121682;})[_0xa50e('0x26')](respondWithFilteredResult(_0x2c2299,_0x48a530))['catch'](handleError(_0x2c2299,null));};exports[_0xa50e('0x45')]=function(_0x293d26,_0x876dc3){var _0x3a7acc={'raw':![],'where':{'id':_0x293d26[_0xa50e('0x46')]['id']}},_0x69713a={};_0x69713a['model']=_[_0xa50e('0x32')](db['AnalyticFieldReport'][_0xa50e('0x2d')]);_0x69713a[_0xa50e('0x33')]=_['keys'](_0x293d26[_0xa50e('0x33')]);_0x69713a[_0xa50e('0x3d')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],_0x69713a['query']);_0x3a7acc[_0xa50e('0x36')]=_[_0xa50e('0x34')](_0x69713a[_0xa50e('0x35')],qs[_0xa50e('0x37')](_0x293d26[_0xa50e('0x33')]['fields']));_0x3a7acc[_0xa50e('0x36')]=_0x3a7acc[_0xa50e('0x36')][_0xa50e('0x38')]?_0x3a7acc[_0xa50e('0x36')]:_0x69713a[_0xa50e('0x35')];if(_0x293d26[_0xa50e('0x33')][_0xa50e('0x47')]){_0x3a7acc[_0xa50e('0x48')]=[{'all':!![]}];}_0x3a7acc=_['merge']({},_0x3a7acc,_0x293d26[_0xa50e('0x42')]);return db[_0xa50e('0x2c')][_0xa50e('0x49')](_0x3a7acc)[_0xa50e('0x26')](handleEntityNotFound(_0x876dc3,null))[_0xa50e('0x26')](respondWithResult(_0x876dc3,null))[_0xa50e('0x4a')](handleError(_0x876dc3,null));};exports[_0xa50e('0x4b')]=function(_0x3b9e63,_0x2a8054){return db[_0xa50e('0x2c')][_0xa50e('0x4b')](_0x3b9e63[_0xa50e('0x4c')],{})[_0xa50e('0x26')](respondWithResult(_0x2a8054,0xc9))[_0xa50e('0x4a')](handleError(_0x2a8054,null));};exports[_0xa50e('0x4d')]=function(_0x5a35f6,_0x2cf481){return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x5a35f6[_0xa50e('0x4c')],{'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x2cf481,0xc9))[_0xa50e('0x4a')](handleError(_0x2cf481,null));};exports[_0xa50e('0x4e')]=function(_0x189b54,_0x556438){if(_0x189b54[_0xa50e('0x4c')]['id']){delete _0x189b54[_0xa50e('0x4c')]['id'];}return db[_0xa50e('0x2c')][_0xa50e('0x49')]({'where':{'id':_0x189b54[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x556438,null))[_0xa50e('0x26')](saveUpdates(_0x189b54[_0xa50e('0x4c')],null))[_0xa50e('0x26')](respondWithResult(_0x556438,null))['catch'](handleError(_0x556438,null));};exports[_0xa50e('0x27')]=function(_0x29192a,_0x32c7bc){return db[_0xa50e('0x2c')]['find']({'where':{'id':_0x29192a[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x32c7bc,null))[_0xa50e('0x26')](removeEntity(_0x32c7bc,null))['catch'](handleError(_0x32c7bc,null));};exports[_0xa50e('0x4f')]=function(_0x14d619,_0x3f51cd){return db[_0xa50e('0x2c')]['destroy']({'where':{'id':_0x14d619['query'][_0xa50e('0x50')]||[]},'raw':![],'individualHooks':!![]})[_0xa50e('0x26')](respondWithResult(_0x3f51cd,0xcc))[_0xa50e('0x4a')](handleError(_0x3f51cd,null));};exports[_0xa50e('0x51')]=function(_0x15c874,_0x490c58,_0x6f533c){return db[_0xa50e('0x52')][_0xa50e('0x53')]({'where':{'id':_0x15c874[_0xa50e('0x46')]['id']}})[_0xa50e('0x26')](handleEntityNotFound(_0x490c58,null))[_0xa50e('0x26')](function(_0x243539){if(_0x243539){return db[_0xa50e('0x54')][_0xa50e('0x55')](function(_0x311c3e){return db[_0xa50e('0x2c')][_0xa50e('0x27')]({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']},'transaction':_0x311c3e})['then'](function(_0x35e11f){var _0x218760=_[_0xa50e('0x31')](_0x15c874[_0xa50e('0x4c')],function(_0x392682){delete _0x392682['id'];_0x392682[_0xa50e('0x56')]=_0x15c874['params']['id'];return _0x392682;});return db[_0xa50e('0x2c')][_0xa50e('0x4d')](_0x218760,{'transaction':_0x311c3e});});})[_0xa50e('0x26')](function(){return db[_0xa50e('0x2c')]['findAll']({'where':{'CustomReportId':_0x15c874[_0xa50e('0x46')]['id']}});});}})['then'](respondWithResult(_0x490c58,null))['catch'](handleError(_0x490c58,null));};
\ No newline at end of file
+var _0x5a49=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','AnalyticFieldReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x5a49,0x1e7));var _0x95a4=function(_0x329a91,_0x2b1d8f){_0x329a91=_0x329a91-0x0;var _0x3294a8=_0x5a49[_0x329a91];return _0x3294a8;};'use strict';var emlformat=require(_0x95a4('0x0'));var rimraf=require(_0x95a4('0x1'));var zipdir=require(_0x95a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95a4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x95a4('0x4'));var util=require(_0x95a4('0x5'));var path=require(_0x95a4('0x6'));var sox=require(_0x95a4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95a4('0x8'));var _=require(_0x95a4('0x9'));var squel=require('squel');var crypto=require(_0x95a4('0xa'));var jsforce=require(_0x95a4('0xb'));var deskjs=require(_0x95a4('0xc'));var toCsv=require(_0x95a4('0xd'));var querystring=require(_0x95a4('0xe'));var Papa=require(_0x95a4('0xf'));var Redis=require(_0x95a4('0x10'));var authService=require(_0x95a4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x95a4('0x12'));var hardwareService=require(_0x95a4('0x13'));var logger=require('../../config/logger')(_0x95a4('0x14'));var utils=require(_0x95a4('0x15'));var config=require(_0x95a4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x95a4('0x17'))['db'];function respondWithStatusCode(_0x44073d,_0x2ee8b1){_0x2ee8b1=_0x2ee8b1||0xcc;return function(_0x2095d9){if(_0x2095d9){return _0x44073d[_0x95a4('0x18')](_0x2ee8b1);}return _0x44073d[_0x95a4('0x19')](_0x2ee8b1)['end']();};}function respondWithResult(_0x25b9a1,_0x496c7b){_0x496c7b=_0x496c7b||0xc8;return function(_0x4656cf){if(_0x4656cf){return _0x25b9a1[_0x95a4('0x19')](_0x496c7b)[_0x95a4('0x1a')](_0x4656cf);}};}function respondWithFilteredResult(_0x34f7ce,_0x11ca6c){return function(_0x31749e){if(_0x31749e){var _0x4fae15=typeof _0x11ca6c[_0x95a4('0x1b')]===_0x95a4('0x1c')&&typeof _0x11ca6c[_0x95a4('0x1d')]===_0x95a4('0x1c');var _0x2a38d0=_0x31749e[_0x95a4('0x1e')];var _0x2dad27=_0x4fae15?0x0:_0x11ca6c[_0x95a4('0x1b')];var _0x2ae7d6=_0x4fae15?_0x31749e['count']:_0x11ca6c[_0x95a4('0x1b')]+_0x11ca6c[_0x95a4('0x1d')];var _0x425807;if(_0x2ae7d6>=_0x2a38d0){_0x2ae7d6=_0x2a38d0;_0x425807=0xc8;}else{_0x425807=0xce;}_0x34f7ce[_0x95a4('0x19')](_0x425807);return _0x34f7ce[_0x95a4('0x1f')](_0x95a4('0x20'),_0x2dad27+'-'+_0x2ae7d6+'/'+_0x2a38d0)['json'](_0x31749e);}return null;};}function patchUpdates(_0x46a4dc){return function(_0x20b932){try{jsonpatch[_0x95a4('0x21')](_0x20b932,_0x46a4dc,!![]);}catch(_0x2c4127){return BPromise[_0x95a4('0x22')](_0x2c4127);}return _0x20b932[_0x95a4('0x23')]();};}function saveUpdates(_0x586db8,_0x3ab2ad){return function(_0x68f88){if(_0x68f88){return _0x68f88[_0x95a4('0x24')](_0x586db8)[_0x95a4('0x25')](function(_0x441d72){return _0x441d72;});}return null;};}function removeEntity(_0x589d73,_0x504478){return function(_0x16575b){if(_0x16575b){return _0x16575b[_0x95a4('0x26')]()[_0x95a4('0x25')](function(){_0x589d73[_0x95a4('0x19')](0xcc)[_0x95a4('0x27')]();});}};}function handleEntityNotFound(_0x57ad12,_0x48ba44){return function(_0x1dc2b9){if(!_0x1dc2b9){_0x57ad12[_0x95a4('0x18')](0x194);}return _0x1dc2b9;};}function handleError(_0x3a5ed3,_0x31524b){_0x31524b=_0x31524b||0x1f4;return function(_0x2cd049){logger[_0x95a4('0x28')](_0x2cd049['stack']);if(_0x2cd049[_0x95a4('0x29')]){delete _0x2cd049['name'];}_0x3a5ed3[_0x95a4('0x19')](_0x31524b)[_0x95a4('0x2a')](_0x2cd049);};}exports[_0x95a4('0x2b')]=function(_0x42fbab,_0xbd0056){var _0x5a591d={},_0x16123b={},_0x57526a={'count':0x0,'rows':[]};var _0x34f0ef=_[_0x95a4('0x2c')](db[_0x95a4('0x2d')]['rawAttributes'],function(_0x3e5f8b){return{'name':_0x3e5f8b[_0x95a4('0x2e')],'type':_0x3e5f8b[_0x95a4('0x2f')][_0x95a4('0x30')]};});_0x16123b['model']=_[_0x95a4('0x2c')](_0x34f0ef,_0x95a4('0x29'));_0x16123b[_0x95a4('0x31')]=_[_0x95a4('0x32')](_0x42fbab[_0x95a4('0x31')]);_0x16123b[_0x95a4('0x33')]=_[_0x95a4('0x34')](_0x16123b[_0x95a4('0x35')],_0x16123b[_0x95a4('0x31')]);_0x5a591d[_0x95a4('0x36')]=_['intersection'](_0x16123b[_0x95a4('0x35')],qs[_0x95a4('0x37')](_0x42fbab[_0x95a4('0x31')][_0x95a4('0x37')]));_0x5a591d[_0x95a4('0x36')]=_0x5a591d[_0x95a4('0x36')][_0x95a4('0x38')]?_0x5a591d[_0x95a4('0x36')]:_0x16123b['model'];if(!_0x42fbab[_0x95a4('0x31')][_0x95a4('0x39')](_0x95a4('0x3a'))){_0x5a591d[_0x95a4('0x1d')]=qs['limit'](_0x42fbab[_0x95a4('0x31')]['limit']);_0x5a591d[_0x95a4('0x1b')]=qs[_0x95a4('0x1b')](_0x42fbab['query'][_0x95a4('0x1b')]);}_0x5a591d[_0x95a4('0x3b')]=qs['sort'](_0x42fbab[_0x95a4('0x31')][_0x95a4('0x3c')]);_0x5a591d['where']=qs[_0x95a4('0x33')](_[_0x95a4('0x3d')](_0x42fbab[_0x95a4('0x31')],_0x16123b[_0x95a4('0x33')]),_0x34f0ef);if(_0x42fbab['query']['filter']){_0x5a591d['where']=_[_0x95a4('0x3e')](_0x5a591d[_0x95a4('0x3f')],{'$or':_['map'](_0x34f0ef,function(_0x4d1108){if(_0x4d1108[_0x95a4('0x2f')]!==_0x95a4('0x40')){var _0x36404a={};_0x36404a[_0x4d1108['name']]={'$like':'%'+_0x42fbab[_0x95a4('0x31')][_0x95a4('0x41')]+'%'};return _0x36404a;}})});}_0x5a591d=_['merge']({},_0x5a591d,_0x42fbab[_0x95a4('0x42')]);var _0x96cbbc={'where':_0x5a591d[_0x95a4('0x3f')]};return db[_0x95a4('0x2d')][_0x95a4('0x1e')](_0x96cbbc)[_0x95a4('0x25')](function(_0x45f8e2){_0x57526a['count']=_0x45f8e2;if(_0x42fbab[_0x95a4('0x31')][_0x95a4('0x43')]){_0x5a591d[_0x95a4('0x44')]=[{'all':!![]}];}return db[_0x95a4('0x2d')][_0x95a4('0x45')](_0x5a591d);})[_0x95a4('0x25')](function(_0x3a1970){_0x57526a['rows']=_0x3a1970;return _0x57526a;})[_0x95a4('0x25')](respondWithFilteredResult(_0xbd0056,_0x5a591d))['catch'](handleError(_0xbd0056,null));};exports[_0x95a4('0x46')]=function(_0x544db5,_0x18d98f){var _0x40b7cb={'raw':![],'where':{'id':_0x544db5[_0x95a4('0x47')]['id']}},_0xd40964={};_0xd40964[_0x95a4('0x35')]=_['keys'](db[_0x95a4('0x2d')][_0x95a4('0x48')]);_0xd40964[_0x95a4('0x31')]=_[_0x95a4('0x32')](_0x544db5['query']);_0xd40964[_0x95a4('0x33')]=_[_0x95a4('0x34')](_0xd40964[_0x95a4('0x35')],_0xd40964[_0x95a4('0x31')]);_0x40b7cb[_0x95a4('0x36')]=_['intersection'](_0xd40964[_0x95a4('0x35')],qs[_0x95a4('0x37')](_0x544db5[_0x95a4('0x31')][_0x95a4('0x37')]));_0x40b7cb[_0x95a4('0x36')]=_0x40b7cb['attributes'][_0x95a4('0x38')]?_0x40b7cb[_0x95a4('0x36')]:_0xd40964[_0x95a4('0x35')];if(_0x544db5[_0x95a4('0x31')][_0x95a4('0x43')]){_0x40b7cb['include']=[{'all':!![]}];}_0x40b7cb=_[_0x95a4('0x3e')]({},_0x40b7cb,_0x544db5[_0x95a4('0x42')]);return db[_0x95a4('0x2d')][_0x95a4('0x49')](_0x40b7cb)['then'](handleEntityNotFound(_0x18d98f,null))[_0x95a4('0x25')](respondWithResult(_0x18d98f,null))[_0x95a4('0x4a')](handleError(_0x18d98f,null));};exports[_0x95a4('0x4b')]=function(_0x113693,_0x5b64fd){return db[_0x95a4('0x2d')]['create'](_0x113693[_0x95a4('0x4c')],{})[_0x95a4('0x25')](respondWithResult(_0x5b64fd,0xc9))[_0x95a4('0x4a')](handleError(_0x5b64fd,null));};exports['bulkCreate']=function(_0x1cf314,_0x229ca2){return db[_0x95a4('0x2d')][_0x95a4('0x4d')](_0x1cf314['body'],{'raw':![],'individualHooks':!![]})[_0x95a4('0x25')](respondWithResult(_0x229ca2,0xc9))[_0x95a4('0x4a')](handleError(_0x229ca2,null));};exports['update']=function(_0x561515,_0x511e00){if(_0x561515['body']['id']){delete _0x561515[_0x95a4('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x95a4('0x49')]({'where':{'id':_0x561515[_0x95a4('0x47')]['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0x511e00,null))['then'](saveUpdates(_0x561515[_0x95a4('0x4c')],null))['then'](respondWithResult(_0x511e00,null))[_0x95a4('0x4a')](handleError(_0x511e00,null));};exports[_0x95a4('0x26')]=function(_0x46ce47,_0xdd0b2e){return db[_0x95a4('0x2d')][_0x95a4('0x49')]({'where':{'id':_0x46ce47[_0x95a4('0x47')]['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0xdd0b2e,null))[_0x95a4('0x25')](removeEntity(_0xdd0b2e,null))['catch'](handleError(_0xdd0b2e,null));};exports[_0x95a4('0x4e')]=function(_0x3049fb,_0xf8f4fb){return db['AnalyticFieldReport'][_0x95a4('0x26')]({'where':{'id':_0x3049fb[_0x95a4('0x31')][_0x95a4('0x4f')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xf8f4fb,0xcc))[_0x95a4('0x4a')](handleError(_0xf8f4fb,null));};exports[_0x95a4('0x50')]=function(_0x54b07f,_0x5a04eb,_0x2ed4e4){return db[_0x95a4('0x51')]['findOne']({'where':{'id':_0x54b07f['params']['id']}})[_0x95a4('0x25')](handleEntityNotFound(_0x5a04eb,null))['then'](function(_0x24cd65){if(_0x24cd65){return db[_0x95a4('0x52')][_0x95a4('0x53')](function(_0x179930){return db[_0x95a4('0x2d')][_0x95a4('0x26')]({'where':{'CustomReportId':_0x54b07f[_0x95a4('0x47')]['id']},'transaction':_0x179930})[_0x95a4('0x25')](function(_0x5b9d27){var _0x8029d6=_[_0x95a4('0x2c')](_0x54b07f[_0x95a4('0x4c')],function(_0x104b08){delete _0x104b08['id'];_0x104b08['CustomReportId']=_0x54b07f[_0x95a4('0x47')]['id'];return _0x104b08;});return db[_0x95a4('0x2d')]['bulkCreate'](_0x8029d6,{'transaction':_0x179930});});})[_0x95a4('0x25')](function(){return db[_0x95a4('0x2d')][_0x95a4('0x45')]({'where':{'CustomReportId':_0x54b07f['params']['id']}});});}})[_0x95a4('0x25')](respondWithResult(_0x5a04eb,null))[_0x95a4('0x4a')](handleError(_0x5a04eb,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index bf4019f..5d7d6d1 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 _0x5a1f=['analytics_report_fields','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x3f20d6,_0x3dd14c){var _0x3c8528=function(_0x3eb3f2){while(--_0x3eb3f2){_0x3f20d6['push'](_0x3f20d6['shift']());}};_0x3c8528(++_0x3dd14c);}(_0x5a1f,0x1e5));var _0xf5a1=function(_0x1a37e9,_0x506022){_0x1a37e9=_0x1a37e9-0x0;var _0x2dd1ad=_0x5a1f[_0x1a37e9];return _0x2dd1ad;};'use strict';var _=require(_0xf5a1('0x0'));var util=require(_0xf5a1('0x1'));var logger=require('../../config/logger')(_0xf5a1('0x2'));var moment=require(_0xf5a1('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a1('0x5'));var config=require(_0xf5a1('0x6'));var attributes=require(_0xf5a1('0x7'));module[_0xf5a1('0x8')]=function(_0x45c7c0,_0x1a63bf){return _0x45c7c0[_0xf5a1('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0xf5a1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88da=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','moment'];(function(_0xcf4690,_0x1888f6){var _0x1a5ebe=function(_0x1c428c){while(--_0x1c428c){_0xcf4690['push'](_0xcf4690['shift']());}};_0x1a5ebe(++_0x1888f6);}(_0x88da,0xa5));var _0xa88d=function(_0x5cb25e,_0x120a7f){_0x5cb25e=_0x5cb25e-0x0;var _0xe7d756=_0x88da[_0x5cb25e];return _0xe7d756;};'use strict';var _=require(_0xa88d('0x0'));var util=require(_0xa88d('0x1'));var logger=require(_0xa88d('0x2'))('api');var moment=require(_0xa88d('0x3'));var BPromise=require(_0xa88d('0x4'));var rp=require(_0xa88d('0x5'));var fs=require('fs');var path=require(_0xa88d('0x6'));var rimraf=require(_0xa88d('0x7'));var config=require(_0xa88d('0x8'));var attributes=require(_0xa88d('0x9'));module[_0xa88d('0xa')]=function(_0xa8a29e,_0x37a735){return _0xa8a29e[_0xa88d('0xb')](_0xa88d('0xc'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 3dadc4a..eb6904b 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 _0x8bba=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x2738d5,_0x2a6f42){var _0x5c92db=function(_0x4a50fe){while(--_0x4a50fe){_0x2738d5['push'](_0x2738d5['shift']());}};_0x5c92db(++_0x2a6f42);}(_0x8bba,0x18e));var _0xa8bb=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x8bba[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0xa8bb('0x0'));var util=require(_0xa8bb('0x1'));var moment=require(_0xa8bb('0x2'));var BPromise=require(_0xa8bb('0x3'));var rs=require(_0xa8bb('0x4'));var fs=require('fs');var Redis=require(_0xa8bb('0x5'));var db=require(_0xa8bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8bb('0x7'));var config=require(_0xa8bb('0x8'));var jayson=require(_0xa8bb('0x9'));var client=jayson['client'][_0xa8bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fe735,_0x2bdae2,_0x3afeb4){return new BPromise(function(_0x3d3196,_0x520669){return client[_0xa8bb('0xb')](_0x9fe735,_0x3afeb4)['then'](function(_0x78ff08){logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));logger[_0xa8bb('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2bdae2,_0xa8bb('0xe'),JSON[_0xa8bb('0x10')](_0x78ff08));if(_0x78ff08['error']){if(_0x78ff08['error'][_0xa8bb('0x11')]===0x1f4){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x520669(_0x78ff08['error']['message']);}logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x78ff08['error']['message']);return _0x3d3196(_0x78ff08['error'][_0xa8bb('0x13')]);}else{logger[_0xa8bb('0xc')](_0xa8bb('0xd'),_0x2bdae2,_0xa8bb('0xe'));_0x3d3196(_0x78ff08[_0xa8bb('0x14')]['message']);}})[_0xa8bb('0x15')](function(_0x5ba952){logger[_0xa8bb('0x12')](_0xa8bb('0xd'),_0x2bdae2,_0x5ba952);_0x520669(_0x5ba952);});});}
\ No newline at end of file
+var _0xbefc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4a7b7e,_0x1d1bf4){var _0xffd584=function(_0x6cb30c){while(--_0x6cb30c){_0x4a7b7e['push'](_0x4a7b7e['shift']());}};_0xffd584(++_0x1d1bf4);}(_0xbefc,0x80));var _0xcbef=function(_0x42af56,_0x4eaefe){_0x42af56=_0x42af56-0x0;var _0x2e5696=_0xbefc[_0x42af56];return _0x2e5696;};'use strict';var _=require(_0xcbef('0x0'));var util=require(_0xcbef('0x1'));var moment=require(_0xcbef('0x2'));var BPromise=require(_0xcbef('0x3'));var rs=require(_0xcbef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbef('0x5'))['db'];var utils=require(_0xcbef('0x6'));var logger=require(_0xcbef('0x7'))('rpc');var config=require(_0xcbef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcbef('0x9')][_0xcbef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x528bdc,_0x235ad4,_0x2d4702){return new BPromise(function(_0x51c81d,_0x5c7eb6){return client['request'](_0x528bdc,_0x2d4702)['then'](function(_0x212734){logger[_0xcbef('0xb')](_0xcbef('0xc'),_0x235ad4,_0xcbef('0xd'));logger[_0xcbef('0xe')](_0xcbef('0xf'),_0x235ad4,'request\x20sent',JSON[_0xcbef('0x10')](_0x212734));if(_0x212734[_0xcbef('0x11')]){if(_0x212734[_0xcbef('0x11')][_0xcbef('0x12')]===0x1f4){logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);return _0x5c7eb6(_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);}logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x212734[_0xcbef('0x11')][_0xcbef('0x13')]);return _0x51c81d(_0x212734['error']['message']);}else{logger['info'](_0xcbef('0xc'),_0x235ad4,_0xcbef('0xd'));_0x51c81d(_0x212734[_0xcbef('0x14')][_0xcbef('0x13')]);}})[_0xcbef('0x15')](function(_0x109163){logger[_0xcbef('0x11')](_0xcbef('0xc'),_0x235ad4,_0x109163);_0x5c7eb6(_0x109163);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index fb22be2..c5f0115 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(_0x139a94,_0x7a7ac2){var _0x4f259e=function(_0xdf86fe){while(--_0xdf86fe){_0x139a94['push'](_0x139a94['shift']());}};_0x4f259e(++_0x7a7ac2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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(_0x2e195d,_0x229650){var _0x15cf2a=function(_0x1603eb){while(--_0x1603eb){_0x2e195d['push'](_0x2e195d['shift']());}};_0x15cf2a(++_0x229650);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 7b0b355..05b952e 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 _0xa062=['TEXT','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa062,0x101));var _0x2a06=function(_0x3f75d7,_0x22bab8){_0x3f75d7=_0x3f75d7-0x0;var _0x26fb16=_0xa062[_0x3f75d7];return _0x26fb16;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'name':{'type':Sequelize[_0x2a06('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x2a06('0x2')]},'metric':{'type':Sequelize[_0x2a06('0x3')]},'description':{'type':Sequelize[_0x2a06('0x2')]}};
\ No newline at end of file
+var _0x9e5e=['STRING','TEXT','sequelize','exports','name'];(function(_0x2ab276,_0x2fc401){var _0x46dfb1=function(_0x44f9fc){while(--_0x44f9fc){_0x2ab276['push'](_0x2ab276['shift']());}};_0x46dfb1(++_0x2fc401);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x9e5e[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xe9e5('0x0'));module[_0xe9e5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe9e5('0x2')},'table':{'type':Sequelize[_0xe9e5('0x3')]},'metric':{'type':Sequelize[_0xe9e5('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 0ff2bab..9e6fbd7 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 _0x6aa7=['json','apply','reject','save','update','then','destroy','get','Metrics','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','catch','error','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range'];(function(_0x3d9176,_0x399d6f){var _0x12adc5=function(_0x700b01){while(--_0x700b01){_0x3d9176['push'](_0x3d9176['shift']());}};_0x12adc5(++_0x399d6f);}(_0x6aa7,0x178));var _0x76aa=function(_0x2d3f23,_0x2bf9f7){_0x2d3f23=_0x2d3f23-0x0;var _0x244ced=_0x6aa7[_0x2d3f23];return _0x244ced;};'use strict';var emlformat=require(_0x76aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76aa('0x1'));var jsonpatch=require(_0x76aa('0x2'));var rp=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x76aa('0x5'));var util=require(_0x76aa('0x6'));var path=require(_0x76aa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76aa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76aa('0x9'));var squel=require(_0x76aa('0xa'));var crypto=require(_0x76aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x76aa('0xc'));var toCsv=require(_0x76aa('0xd'));var querystring=require(_0x76aa('0xe'));var Papa=require('papaparse');var Redis=require(_0x76aa('0xf'));var authService=require(_0x76aa('0x10'));var qs=require(_0x76aa('0x11'));var as=require(_0x76aa('0x12'));var hardwareService=require(_0x76aa('0x13'));var logger=require(_0x76aa('0x14'))(_0x76aa('0x15'));var utils=require(_0x76aa('0x16'));var config=require(_0x76aa('0x17'));var licenseUtil=require(_0x76aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xcc;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0x19')](_0x5df49c);}return _0x112c39[_0x76aa('0x1a')](_0x5df49c)[_0x76aa('0x1b')]();};}function respondWithResult(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0xc8;return function(_0x5f5b59){if(_0x5f5b59){return _0x10432c[_0x76aa('0x1a')](_0x4e309f)['json'](_0x5f5b59);}};}function respondWithFilteredResult(_0x180d92,_0x319bf1){return function(_0x5cf594){if(_0x5cf594){var _0x2111c7=typeof _0x319bf1['offset']===_0x76aa('0x1c')&&typeof _0x319bf1['limit']===_0x76aa('0x1c');var _0x413cf6=_0x5cf594[_0x76aa('0x1d')];var _0x21c16d=_0x2111c7?0x0:_0x319bf1[_0x76aa('0x1e')];var _0x3ead3f=_0x2111c7?_0x5cf594['count']:_0x319bf1['offset']+_0x319bf1[_0x76aa('0x1f')];var _0x454dd3;if(_0x3ead3f>=_0x413cf6){_0x3ead3f=_0x413cf6;_0x454dd3=0xc8;}else{_0x454dd3=0xce;}_0x180d92[_0x76aa('0x1a')](_0x454dd3);return _0x180d92[_0x76aa('0x20')](_0x76aa('0x21'),_0x21c16d+'-'+_0x3ead3f+'/'+_0x413cf6)[_0x76aa('0x22')](_0x5cf594);}return null;};}function patchUpdates(_0x19af92){return function(_0x2eaf48){try{jsonpatch[_0x76aa('0x23')](_0x2eaf48,_0x19af92,!![]);}catch(_0x5990c1){return BPromise[_0x76aa('0x24')](_0x5990c1);}return _0x2eaf48[_0x76aa('0x25')]();};}function saveUpdates(_0x338a6b,_0x5b3f55){return function(_0x41463a){if(_0x41463a){return _0x41463a[_0x76aa('0x26')](_0x338a6b)[_0x76aa('0x27')](function(_0x2bd2c6){return _0x2bd2c6;});}return null;};}function removeEntity(_0x29c50c,_0xc1044c){return function(_0x3cd039){if(_0x3cd039){return _0x3cd039[_0x76aa('0x28')]()[_0x76aa('0x27')](function(){var _0x2cba6d=_0x3cd039[_0x76aa('0x29')]({'plain':!![]});var _0x26b75e=_0x76aa('0x2a');return db['UserProfileResource'][_0x76aa('0x28')]({'where':{'type':_0x26b75e,'resourceId':_0x2cba6d['id']}})[_0x76aa('0x27')](function(){return _0x3cd039;});})[_0x76aa('0x27')](function(){_0x29c50c[_0x76aa('0x1a')](0xcc)[_0x76aa('0x1b')]();});}};}function handleEntityNotFound(_0x2f9316,_0x25a803){return function(_0x282d0a){if(!_0x282d0a){_0x2f9316[_0x76aa('0x19')](0x194);}return _0x282d0a;};}function handleError(_0x1bdc3d,_0x545b06){_0x545b06=_0x545b06||0x1f4;return function(_0x3fcb7f){logger['error'](_0x3fcb7f[_0x76aa('0x2b')]);if(_0x3fcb7f[_0x76aa('0x2c')]){delete _0x3fcb7f[_0x76aa('0x2c')];}_0x1bdc3d[_0x76aa('0x1a')](_0x545b06)[_0x76aa('0x2d')](_0x3fcb7f);};}exports[_0x76aa('0x2e')]=function(_0x2ee0f9,_0x3827ec){var _0x19fd4f={},_0x3ea05a={},_0x5edcd8={'count':0x0,'rows':[]};var _0x430ad6=_[_0x76aa('0x2f')](db[_0x76aa('0x30')][_0x76aa('0x31')],function(_0x458ac3){return{'name':_0x458ac3[_0x76aa('0x32')],'type':_0x458ac3[_0x76aa('0x33')]['key']};});_0x3ea05a[_0x76aa('0x34')]=_[_0x76aa('0x2f')](_0x430ad6,'name');_0x3ea05a[_0x76aa('0x35')]=_['keys'](_0x2ee0f9[_0x76aa('0x35')]);_0x3ea05a['filters']=_[_0x76aa('0x36')](_0x3ea05a['model'],_0x3ea05a['query']);_0x19fd4f[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x3ea05a[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x2ee0f9['query']['fields']));_0x19fd4f[_0x76aa('0x37')]=_0x19fd4f[_0x76aa('0x37')][_0x76aa('0x39')]?_0x19fd4f[_0x76aa('0x37')]:_0x3ea05a[_0x76aa('0x34')];if(!_0x2ee0f9['query'][_0x76aa('0x3a')]('nolimit')){_0x19fd4f['limit']=qs[_0x76aa('0x1f')](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1f')]);_0x19fd4f[_0x76aa('0x1e')]=qs['offset'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x1e')]);}_0x19fd4f[_0x76aa('0x3b')]=qs['sort'](_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x3c')]);_0x19fd4f[_0x76aa('0x3d')]=qs[_0x76aa('0x3e')](_[_0x76aa('0x3f')](_0x2ee0f9[_0x76aa('0x35')],_0x3ea05a[_0x76aa('0x3e')]),_0x430ad6);if(_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]){_0x19fd4f['where']=_[_0x76aa('0x41')](_0x19fd4f[_0x76aa('0x3d')],{'$or':_[_0x76aa('0x2f')](_0x430ad6,function(_0xa824e8){if(_0xa824e8[_0x76aa('0x33')]!==_0x76aa('0x42')){var _0x572fdb={};_0x572fdb[_0xa824e8['name']]={'$like':'%'+_0x2ee0f9[_0x76aa('0x35')][_0x76aa('0x40')]+'%'};return _0x572fdb;}})});}_0x19fd4f=_[_0x76aa('0x41')]({},_0x19fd4f,_0x2ee0f9[_0x76aa('0x43')]);var _0x50599f={'where':_0x19fd4f[_0x76aa('0x3d')]};return db[_0x76aa('0x30')][_0x76aa('0x1d')](_0x50599f)[_0x76aa('0x27')](function(_0x1138b5){_0x5edcd8['count']=_0x1138b5;if(_0x2ee0f9[_0x76aa('0x35')]['includeAll']){_0x19fd4f[_0x76aa('0x44')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x19fd4f);})['then'](function(_0x144f0a){_0x5edcd8['rows']=_0x144f0a;return _0x5edcd8;})['then'](respondWithFilteredResult(_0x3827ec,_0x19fd4f))['catch'](handleError(_0x3827ec,null));};exports[_0x76aa('0x45')]=function(_0x3fd153,_0x116dc5){var _0x2c0744={'raw':!![],'where':{'id':_0x3fd153['params']['id']}},_0x27a52e={};_0x27a52e[_0x76aa('0x34')]=_[_0x76aa('0x46')](db[_0x76aa('0x30')][_0x76aa('0x31')]);_0x27a52e[_0x76aa('0x35')]=_['keys'](_0x3fd153[_0x76aa('0x35')]);_0x27a52e[_0x76aa('0x3e')]=_['intersection'](_0x27a52e[_0x76aa('0x34')],_0x27a52e['query']);_0x2c0744[_0x76aa('0x37')]=_[_0x76aa('0x36')](_0x27a52e[_0x76aa('0x34')],qs[_0x76aa('0x38')](_0x3fd153[_0x76aa('0x35')][_0x76aa('0x38')]));_0x2c0744[_0x76aa('0x37')]=_0x2c0744[_0x76aa('0x37')][_0x76aa('0x39')]?_0x2c0744[_0x76aa('0x37')]:_0x27a52e['model'];if(_0x3fd153[_0x76aa('0x35')]['includeAll']){_0x2c0744[_0x76aa('0x44')]=[{'all':!![]}];}_0x2c0744=_[_0x76aa('0x41')]({},_0x2c0744,_0x3fd153[_0x76aa('0x43')]);return db[_0x76aa('0x30')]['find'](_0x2c0744)['then'](handleEntityNotFound(_0x116dc5,null))[_0x76aa('0x27')](respondWithResult(_0x116dc5,null))['catch'](handleError(_0x116dc5,null));};exports[_0x76aa('0x47')]=function(_0x302a0c,_0x4315b3){return db[_0x76aa('0x30')][_0x76aa('0x47')](_0x302a0c[_0x76aa('0x48')],{})['then'](function(_0x564546){var _0x2fcf8f=_0x302a0c[_0x76aa('0x49')][_0x76aa('0x29')]({'plain':!![]});if(!_0x2fcf8f)throw new Error(_0x76aa('0x4a'));if(_0x2fcf8f[_0x76aa('0x4b')]===_0x76aa('0x49')){var _0x4c52d5=_0x564546[_0x76aa('0x29')]({'plain':!![]});var _0x2d631e=_0x76aa('0x2a');return db['UserProfileSection'][_0x76aa('0x4c')]({'where':{'name':_0x2d631e,'userProfileId':_0x2fcf8f['userProfileId']},'raw':!![]})[_0x76aa('0x27')](function(_0x5e1d84){if(_0x5e1d84&&_0x5e1d84[_0x76aa('0x4d')]===0x0){return db[_0x76aa('0x4e')][_0x76aa('0x47')]({'name':_0x4c52d5[_0x76aa('0x2c')],'resourceId':_0x4c52d5['id'],'type':_0x5e1d84[_0x76aa('0x2c')],'sectionId':_0x5e1d84['id']},{})[_0x76aa('0x27')](function(){return _0x564546;});}else{return _0x564546;}})[_0x76aa('0x4f')](function(_0x4f2c2b){logger[_0x76aa('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f2c2b);throw _0x4f2c2b;});}return _0x564546;})[_0x76aa('0x27')](respondWithResult(_0x4315b3,0xc9))[_0x76aa('0x4f')](handleError(_0x4315b3,null));};exports[_0x76aa('0x26')]=function(_0x53be10,_0x3fa7ec){if(_0x53be10[_0x76aa('0x48')]['id']){delete _0x53be10[_0x76aa('0x48')]['id'];}return db['AnalyticMetric'][_0x76aa('0x4c')]({'where':{'id':_0x53be10[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x3fa7ec,null))[_0x76aa('0x27')](saveUpdates(_0x53be10['body'],null))[_0x76aa('0x27')](respondWithResult(_0x3fa7ec,null))[_0x76aa('0x4f')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x28')]=function(_0x410933,_0x2027f8){return db[_0x76aa('0x30')]['find']({'where':{'id':_0x410933[_0x76aa('0x51')]['id']}})[_0x76aa('0x27')](handleEntityNotFound(_0x2027f8,null))[_0x76aa('0x27')](removeEntity(_0x2027f8,null))[_0x76aa('0x4f')](handleError(_0x2027f8,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x1e514e,_0x4c2113){var _0x54f8ae=function(_0xa83626){while(--_0xa83626){_0x1e514e['push'](_0x1e514e['shift']());}};_0x54f8ae(++_0x4c2113);}(_0x9a19,0x114));var _0x99a1=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x9a19[_0x3430aa];return _0x2ac5c;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 39590e9..38d414a 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 _0x28b1=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','./analyticMetric.attributes','AnalyticMetric','analytics_metrics'];(function(_0x1a4bc0,_0x31747f){var _0x3c11e6=function(_0x4e5af6){while(--_0x4e5af6){_0x1a4bc0['push'](_0x1a4bc0['shift']());}};_0x3c11e6(++_0x31747f);}(_0x28b1,0x1d6));var _0x128b=function(_0x49f42f,_0x4f3ce7){_0x49f42f=_0x49f42f-0x0;var _0x40368b=_0x28b1[_0x49f42f];return _0x40368b;};'use strict';var _=require(_0x128b('0x0'));var util=require(_0x128b('0x1'));var logger=require(_0x128b('0x2'))('api');var moment=require(_0x128b('0x3'));var BPromise=require(_0x128b('0x4'));var rp=require(_0x128b('0x5'));var fs=require('fs');var path=require(_0x128b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x128b('0x7'));module['exports']=function(_0x5c3ceb,_0x3699d5){return _0x5c3ceb['define'](_0x128b('0x8'),attributes,{'tableName':_0x128b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe2a=['rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bb321,_0x16ce37){var _0x4b2937=function(_0x36a9b6){while(--_0x36a9b6){_0x1bb321['push'](_0x1bb321['shift']());}};_0x4b2937(++_0x16ce37);}(_0xbe2a,0x1d9));var _0xabe2=function(_0x47dd4a,_0x8ecd84){_0x47dd4a=_0x47dd4a-0x0;var _0xf70f7c=_0xbe2a[_0x47dd4a];return _0xf70f7c;};'use strict';var _=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var logger=require(_0xabe2('0x2'))(_0xabe2('0x3'));var moment=require(_0xabe2('0x4'));var BPromise=require(_0xabe2('0x5'));var rp=require(_0xabe2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xabe2('0x7'));var config=require('../../config/environment');var attributes=require(_0xabe2('0x8'));module[_0xabe2('0x9')]=function(_0x2ddf42,_0x475007){return _0x2ddf42[_0xabe2('0xa')](_0xabe2('0xb'),attributes,{'tableName':'analytics_metrics','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 4f53eb6..96152e2 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 _0x0c2c=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x52d39a,_0x242577){var _0x8344a=function(_0x1d197a){while(--_0x1d197a){_0x52d39a['push'](_0x52d39a['shift']());}};_0x8344a(++_0x242577);}(_0x0c2c,0x1bd));var _0xc0c2=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x0c2c[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xc0c2('0x0'));var util=require('util');var moment=require(_0xc0c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xc0c2('0x2'));var fs=require('fs');var Redis=require(_0xc0c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c2('0x5'));var jayson=require(_0xc0c2('0x6'));var client=jayson[_0xc0c2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497bc3,_0x558aeb,_0x19998b){return new BPromise(function(_0x5a4ab6,_0x4b59d5){return client[_0xc0c2('0x8')](_0x497bc3,_0x19998b)[_0xc0c2('0x9')](function(_0x26ed3f){logger[_0xc0c2('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x558aeb,_0xc0c2('0xb'));logger[_0xc0c2('0xc')](_0xc0c2('0xd'),_0x558aeb,_0xc0c2('0xb'),JSON[_0xc0c2('0xe')](_0x26ed3f));if(_0x26ed3f['error']){if(_0x26ed3f[_0xc0c2('0xf')]['code']===0x1f4){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x4b59d5(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);return _0x5a4ab6(_0x26ed3f[_0xc0c2('0xf')][_0xc0c2('0x11')]);}else{logger[_0xc0c2('0xa')](_0xc0c2('0x10'),_0x558aeb,'request\x20sent');_0x5a4ab6(_0x26ed3f['result']['message']);}})[_0xc0c2('0x12')](function(_0x188e6c){logger[_0xc0c2('0xf')](_0xc0c2('0x10'),_0x558aeb,_0x188e6c);_0x4b59d5(_0x188e6c);});});}
\ No newline at end of file
+var _0x3bfc=['then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0xe41a46,_0x144159){var _0x3d970c=function(_0x97c741){while(--_0x97c741){_0xe41a46['push'](_0xe41a46['shift']());}};_0x3d970c(++_0x144159);}(_0x3bfc,0x154));var _0xc3bf=function(_0x2cea58,_0x153c15){_0x2cea58=_0x2cea58-0x0;var _0x192933=_0x3bfc[_0x2cea58];return _0x192933;};'use strict';var _=require(_0xc3bf('0x0'));var util=require(_0xc3bf('0x1'));var moment=require(_0xc3bf('0x2'));var BPromise=require(_0xc3bf('0x3'));var rs=require(_0xc3bf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3bf('0x5'))['db'];var utils=require(_0xc3bf('0x6'));var logger=require(_0xc3bf('0x7'))('rpc');var config=require(_0xc3bf('0x8'));var jayson=require(_0xc3bf('0x9'));var client=jayson['client'][_0xc3bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22877f,_0x425b45,_0x24601c){return new BPromise(function(_0x1cebaf,_0x42813e){return client[_0xc3bf('0xb')](_0x22877f,_0x24601c)[_0xc3bf('0xc')](function(_0x38c2ef){logger[_0xc3bf('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x425b45,_0xc3bf('0xe'));logger[_0xc3bf('0xf')](_0xc3bf('0x10'),_0x425b45,_0xc3bf('0xe'),JSON[_0xc3bf('0x11')](_0x38c2ef));if(_0x38c2ef[_0xc3bf('0x12')]){if(_0x38c2ef['error']['code']===0x1f4){logger['error'](_0xc3bf('0x13'),_0x425b45,_0x38c2ef[_0xc3bf('0x12')]['message']);return _0x42813e(_0x38c2ef['error'][_0xc3bf('0x14')]);}logger[_0xc3bf('0x12')](_0xc3bf('0x13'),_0x425b45,_0x38c2ef[_0xc3bf('0x12')][_0xc3bf('0x14')]);return _0x1cebaf(_0x38c2ef['error'][_0xc3bf('0x14')]);}else{logger[_0xc3bf('0xd')](_0xc3bf('0x13'),_0x425b45,_0xc3bf('0xe'));_0x1cebaf(_0x38c2ef['result'][_0xc3bf('0x14')]);}})[_0xc3bf('0x15')](function(_0xb14e0c){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x425b45,_0xb14e0c);_0x42813e(_0xb14e0c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 0176ba5..7e40cf9 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 _0xec46=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x6d7446,_0x179e0e){var _0x6bf1a=function(_0x1b8eb9){while(--_0x1b8eb9){_0x6d7446['push'](_0x6d7446['shift']());}};_0x6bf1a(++_0x179e0e);}(_0xec46,0x19c));var _0x6ec4=function(_0x267d66,_0xe313d1){_0x267d66=_0x267d66-0x0;var _0x1742be=_0xec46[_0x267d66];return _0x1742be;};'use strict';var multer=require(_0x6ec4('0x0'));var util=require(_0x6ec4('0x1'));var path=require(_0x6ec4('0x2'));var timeout=require(_0x6ec4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6ec4('0x4'));var auth=require(_0x6ec4('0x5'));var interaction=require(_0x6ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x6ec4('0x7'));router[_0x6ec4('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ec4('0x9')]);router['get'](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xc')]);router[_0x6ec4('0xd')]('/',auth[_0x6ec4('0xb')](),controller[_0x6ec4('0xe')]);router[_0x6ec4('0xf')](_0x6ec4('0xa'),auth[_0x6ec4('0xb')](),controller[_0x6ec4('0x10')]);router[_0x6ec4('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x6ec4('0x12')]);module[_0x6ec4('0x13')]=router;
\ No newline at end of file
+var _0x27a8=['/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x5e3212,_0x2b36de){var _0x62f793=function(_0x371267){while(--_0x371267){_0x5e3212['push'](_0x5e3212['shift']());}};_0x62f793(++_0x2b36de);}(_0x27a8,0x170));var _0x827a=function(_0x2f3fe7,_0x4048ba){_0x2f3fe7=_0x2f3fe7-0x0;var _0xbc9d29=_0x27a8[_0x2f3fe7];return _0xbc9d29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x827a('0x0'));var timeout=require(_0x827a('0x1'));var express=require(_0x827a('0x2'));var router=express[_0x827a('0x3')]();var fs_extra=require(_0x827a('0x4'));var auth=require(_0x827a('0x5'));var interaction=require(_0x827a('0x6'));var config=require(_0x827a('0x7'));var controller=require(_0x827a('0x8'));router[_0x827a('0x9')]('/',auth[_0x827a('0xa')](),controller[_0x827a('0xb')]);router[_0x827a('0x9')](_0x827a('0xc'),auth[_0x827a('0xa')](),controller[_0x827a('0xd')]);router[_0x827a('0xe')]('/',auth[_0x827a('0xa')](),controller[_0x827a('0xf')]);router[_0x827a('0x10')](_0x827a('0xc'),auth[_0x827a('0xa')](),controller[_0x827a('0x11')]);router['delete']('/:id',auth[_0x827a('0xa')](),controller[_0x827a('0x12')]);module[_0x827a('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index a47d0ea..ca4c962 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 _0x1e69=['TEXT','exports'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x1e69,0x85));var _0x91e6=function(_0x2c6991,_0x4b5775){_0x2c6991=_0x2c6991-0x0;var _0x4de9fa=_0x1e69[_0x2c6991];return _0x4de9fa;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'tree':{'type':Sequelize[_0x91e6('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x2664=['TEXT','sequelize','exports'];(function(_0x4c8833,_0x14e755){var _0x30df54=function(_0x197811){while(--_0x197811){_0x4c8833['push'](_0x4c8833['shift']());}};_0x30df54(++_0x14e755);}(_0x2664,0x127));var _0x4266=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2664[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x4266('0x0'));module[_0x4266('0x1')]={'tree':{'type':Sequelize[_0x4266('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 29e583a..cd9072d 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 _0x11da=['api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','find','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/logger'];(function(_0x31d3b4,_0x138abc){var _0x43b94b=function(_0x50d9f3){while(--_0x50d9f3){_0x31d3b4['push'](_0x31d3b4['shift']());}};_0x43b94b(++_0x138abc);}(_0x11da,0x7f));var _0xa11d=function(_0x4f184d,_0x124bbe){_0x4f184d=_0x4f184d-0x0;var _0x5a1c06=_0x11da[_0x4f184d];return _0x5a1c06;};'use strict';var emlformat=require(_0xa11d('0x0'));var rimraf=require(_0xa11d('0x1'));var zipdir=require(_0xa11d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa11d('0x3'));var moment=require(_0xa11d('0x4'));var BPromise=require(_0xa11d('0x5'));var Mustache=require(_0xa11d('0x6'));var util=require(_0xa11d('0x7'));var path=require(_0xa11d('0x8'));var sox=require(_0xa11d('0x9'));var csv=require('to-csv');var ejs=require(_0xa11d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa11d('0xb'));var squel=require(_0xa11d('0xc'));var crypto=require(_0xa11d('0xd'));var jsforce=require(_0xa11d('0xe'));var deskjs=require(_0xa11d('0xf'));var toCsv=require(_0xa11d('0x10'));var querystring=require(_0xa11d('0x11'));var Papa=require(_0xa11d('0x12'));var Redis=require(_0xa11d('0x13'));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(_0xa11d('0x14'))(_0xa11d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa11d('0x16'))['db'];function respondWithStatusCode(_0x285b6e,_0x4a2402){_0x4a2402=_0x4a2402||0xcc;return function(_0x16a908){if(_0x16a908){return _0x285b6e[_0xa11d('0x17')](_0x4a2402);}return _0x285b6e[_0xa11d('0x18')](_0x4a2402)[_0xa11d('0x19')]();};}function respondWithResult(_0x252844,_0x21543e){_0x21543e=_0x21543e||0xc8;return function(_0x602c0){if(_0x602c0){return _0x252844[_0xa11d('0x18')](_0x21543e)[_0xa11d('0x1a')](_0x602c0);}};}function respondWithFilteredResult(_0x578ba8,_0x4b342e){return function(_0x534641){if(_0x534641){var _0x5ea49e=typeof _0x4b342e[_0xa11d('0x1b')]===_0xa11d('0x1c')&&typeof _0x4b342e[_0xa11d('0x1d')]===_0xa11d('0x1c');var _0x13839c=_0x534641[_0xa11d('0x1e')];var _0x411533=_0x5ea49e?0x0:_0x4b342e[_0xa11d('0x1b')];var _0x1af580=_0x5ea49e?_0x534641[_0xa11d('0x1e')]:_0x4b342e['offset']+_0x4b342e[_0xa11d('0x1d')];var _0x251009;if(_0x1af580>=_0x13839c){_0x1af580=_0x13839c;_0x251009=0xc8;}else{_0x251009=0xce;}_0x578ba8[_0xa11d('0x18')](_0x251009);return _0x578ba8[_0xa11d('0x1f')](_0xa11d('0x20'),_0x411533+'-'+_0x1af580+'/'+_0x13839c)[_0xa11d('0x1a')](_0x534641);}return null;};}function patchUpdates(_0x4144aa){return function(_0x467b66){try{jsonpatch[_0xa11d('0x21')](_0x467b66,_0x4144aa,!![]);}catch(_0x3a09cd){return BPromise['reject'](_0x3a09cd);}return _0x467b66[_0xa11d('0x22')]();};}function saveUpdates(_0x18cba7,_0xd5cd7f){return function(_0x4798da){if(_0x4798da){return _0x4798da[_0xa11d('0x23')](_0x18cba7)[_0xa11d('0x24')](function(_0x34104e){return _0x34104e;});}return null;};}function removeEntity(_0x416271,_0x738dc8){return function(_0x4f44b2){if(_0x4f44b2){return _0x4f44b2[_0xa11d('0x25')]()[_0xa11d('0x24')](function(){_0x416271['status'](0xcc)[_0xa11d('0x19')]();});}};}function handleEntityNotFound(_0x3a8957,_0x54a883){return function(_0x22df71){if(!_0x22df71){_0x3a8957['sendStatus'](0x194);}return _0x22df71;};}function handleError(_0x2046b9,_0x255d11){_0x255d11=_0x255d11||0x1f4;return function(_0x1ff8c0){logger[_0xa11d('0x26')](_0x1ff8c0[_0xa11d('0x27')]);if(_0x1ff8c0['name']){delete _0x1ff8c0[_0xa11d('0x28')];}_0x2046b9[_0xa11d('0x18')](_0x255d11)[_0xa11d('0x29')](_0x1ff8c0);};}exports[_0xa11d('0x2a')]=function(_0x23ddd7,_0x438610){var _0x2e2735={},_0x30c712={},_0x38964a={'count':0x0,'rows':[]};var _0x2ea647=_[_0xa11d('0x2b')](db['AnalyticTreeReport'][_0xa11d('0x2c')],function(_0x44c43b){return{'name':_0x44c43b['fieldName'],'type':_0x44c43b[_0xa11d('0x2d')][_0xa11d('0x2e')]};});_0x30c712[_0xa11d('0x2f')]=_['map'](_0x2ea647,_0xa11d('0x28'));_0x30c712[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x23ddd7[_0xa11d('0x30')]);_0x30c712[_0xa11d('0x32')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],_0x30c712[_0xa11d('0x30')]);_0x2e2735[_0xa11d('0x34')]=_[_0xa11d('0x33')](_0x30c712[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x23ddd7['query'][_0xa11d('0x35')]));_0x2e2735[_0xa11d('0x34')]=_0x2e2735[_0xa11d('0x34')][_0xa11d('0x36')]?_0x2e2735[_0xa11d('0x34')]:_0x30c712['model'];if(!_0x23ddd7['query'][_0xa11d('0x37')](_0xa11d('0x38'))){_0x2e2735[_0xa11d('0x1d')]=qs[_0xa11d('0x1d')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1d')]);_0x2e2735[_0xa11d('0x1b')]=qs[_0xa11d('0x1b')](_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x1b')]);}_0x2e2735[_0xa11d('0x39')]=qs[_0xa11d('0x3a')](_0x23ddd7['query'][_0xa11d('0x3a')]);_0x2e2735[_0xa11d('0x3b')]=qs['filters'](_[_0xa11d('0x3c')](_0x23ddd7[_0xa11d('0x30')],_0x30c712[_0xa11d('0x32')]),_0x2ea647);if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]){_0x2e2735['where']=_[_0xa11d('0x3e')](_0x2e2735[_0xa11d('0x3b')],{'$or':_[_0xa11d('0x2b')](_0x2ea647,function(_0x38b769){if(_0x38b769[_0xa11d('0x2d')]!==_0xa11d('0x3f')){var _0x1f6f92={};_0x1f6f92[_0x38b769[_0xa11d('0x28')]]={'$like':'%'+_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x3d')]+'%'};return _0x1f6f92;}})});}_0x2e2735=_['merge']({},_0x2e2735,_0x23ddd7[_0xa11d('0x40')]);var _0xb118c2={'where':_0x2e2735[_0xa11d('0x3b')]};return db[_0xa11d('0x41')][_0xa11d('0x1e')](_0xb118c2)[_0xa11d('0x24')](function(_0x39a95b){_0x38964a[_0xa11d('0x1e')]=_0x39a95b;if(_0x23ddd7[_0xa11d('0x30')][_0xa11d('0x42')]){_0x2e2735[_0xa11d('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xa11d('0x44')](_0x2e2735);})[_0xa11d('0x24')](function(_0x50b96d){_0x38964a['rows']=_0x50b96d;return _0x38964a;})[_0xa11d('0x24')](respondWithFilteredResult(_0x438610,_0x2e2735))[_0xa11d('0x45')](handleError(_0x438610,null));};exports[_0xa11d('0x46')]=function(_0x3dbe5f,_0x15fbd5){var _0x518435={'raw':!![],'where':{'id':_0x3dbe5f[_0xa11d('0x47')]['id']}},_0x440d7e={};_0x440d7e[_0xa11d('0x2f')]=_[_0xa11d('0x31')](db[_0xa11d('0x41')]['rawAttributes']);_0x440d7e[_0xa11d('0x30')]=_[_0xa11d('0x31')](_0x3dbe5f[_0xa11d('0x30')]);_0x440d7e[_0xa11d('0x32')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],_0x440d7e[_0xa11d('0x30')]);_0x518435[_0xa11d('0x34')]=_['intersection'](_0x440d7e[_0xa11d('0x2f')],qs[_0xa11d('0x35')](_0x3dbe5f[_0xa11d('0x30')]['fields']));_0x518435['attributes']=_0x518435[_0xa11d('0x34')][_0xa11d('0x36')]?_0x518435['attributes']:_0x440d7e[_0xa11d('0x2f')];if(_0x3dbe5f[_0xa11d('0x30')][_0xa11d('0x42')]){_0x518435[_0xa11d('0x43')]=[{'all':!![]}];}_0x518435=_[_0xa11d('0x3e')]({},_0x518435,_0x3dbe5f[_0xa11d('0x40')]);return db[_0xa11d('0x41')][_0xa11d('0x48')](_0x518435)[_0xa11d('0x24')](handleEntityNotFound(_0x15fbd5,null))[_0xa11d('0x24')](respondWithResult(_0x15fbd5,null))[_0xa11d('0x45')](handleError(_0x15fbd5,null));};exports['create']=function(_0x1b759a,_0x33e4bd){return db[_0xa11d('0x41')]['create'](_0x1b759a[_0xa11d('0x49')],{})[_0xa11d('0x24')](respondWithResult(_0x33e4bd,0xc9))['catch'](handleError(_0x33e4bd,null));};exports[_0xa11d('0x23')]=function(_0x25b097,_0x33288c){if(_0x25b097[_0xa11d('0x49')]['id']){delete _0x25b097[_0xa11d('0x49')]['id'];}return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x25b097[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x33288c,null))[_0xa11d('0x24')](saveUpdates(_0x25b097[_0xa11d('0x49')],null))['then'](respondWithResult(_0x33288c,null))[_0xa11d('0x45')](handleError(_0x33288c,null));};exports[_0xa11d('0x25')]=function(_0x4137ff,_0x3eefac){return db[_0xa11d('0x41')][_0xa11d('0x48')]({'where':{'id':_0x4137ff[_0xa11d('0x47')]['id']}})[_0xa11d('0x24')](handleEntityNotFound(_0x3eefac,null))[_0xa11d('0x24')](removeEntity(_0x3eefac,null))[_0xa11d('0x45')](handleError(_0x3eefac,null));};
\ No newline at end of file
+var _0x9788=['catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','AnalyticTreeReport','findAll','rows','show','params','rawAttributes','intersection','find','create','body'];(function(_0x3f3b97,_0x395d93){var _0xb6ab0c=function(_0x330c5a){while(--_0x330c5a){_0x3f3b97['push'](_0x3f3b97['shift']());}};_0xb6ab0c(++_0x395d93);}(_0x9788,0x1db));var _0x8978=function(_0x30a616,_0x16f281){_0x30a616=_0x30a616-0x0;var _0x29d79d=_0x9788[_0x30a616];return _0x29d79d;};'use strict';var emlformat=require(_0x8978('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8978('0x1'));var jsonpatch=require(_0x8978('0x2'));var rp=require(_0x8978('0x3'));var moment=require(_0x8978('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8978('0x5'));var util=require(_0x8978('0x6'));var path=require(_0x8978('0x7'));var sox=require(_0x8978('0x8'));var csv=require('to-csv');var ejs=require(_0x8978('0x9'));var fs=require('fs');var fs_extra=require(_0x8978('0xa'));var _=require(_0x8978('0xb'));var squel=require('squel');var crypto=require(_0x8978('0xc'));var jsforce=require(_0x8978('0xd'));var deskjs=require(_0x8978('0xe'));var toCsv=require(_0x8978('0xf'));var querystring=require('querystring');var Papa=require(_0x8978('0x10'));var Redis=require(_0x8978('0x11'));var authService=require(_0x8978('0x12'));var qs=require(_0x8978('0x13'));var as=require(_0x8978('0x14'));var hardwareService=require(_0x8978('0x15'));var logger=require(_0x8978('0x16'))(_0x8978('0x17'));var utils=require(_0x8978('0x18'));var config=require(_0x8978('0x19'));var licenseUtil=require(_0x8978('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x106aa2,_0x39e1d2){_0x39e1d2=_0x39e1d2||0xcc;return function(_0x9d3140){if(_0x9d3140){return _0x106aa2['sendStatus'](_0x39e1d2);}return _0x106aa2[_0x8978('0x1b')](_0x39e1d2)[_0x8978('0x1c')]();};}function respondWithResult(_0x43deef,_0x4e7d48){_0x4e7d48=_0x4e7d48||0xc8;return function(_0x8ce215){if(_0x8ce215){return _0x43deef[_0x8978('0x1b')](_0x4e7d48)['json'](_0x8ce215);}};}function respondWithFilteredResult(_0x2eff35,_0x2fb17d){return function(_0x3e1e9c){if(_0x3e1e9c){var _0x244f57=typeof _0x2fb17d[_0x8978('0x1d')]===_0x8978('0x1e')&&typeof _0x2fb17d[_0x8978('0x1f')]===_0x8978('0x1e');var _0x479a60=_0x3e1e9c[_0x8978('0x20')];var _0x5b65c7=_0x244f57?0x0:_0x2fb17d[_0x8978('0x1d')];var _0x52cd18=_0x244f57?_0x3e1e9c[_0x8978('0x20')]:_0x2fb17d[_0x8978('0x1d')]+_0x2fb17d[_0x8978('0x1f')];var _0x5ec7ec;if(_0x52cd18>=_0x479a60){_0x52cd18=_0x479a60;_0x5ec7ec=0xc8;}else{_0x5ec7ec=0xce;}_0x2eff35['status'](_0x5ec7ec);return _0x2eff35[_0x8978('0x21')](_0x8978('0x22'),_0x5b65c7+'-'+_0x52cd18+'/'+_0x479a60)['json'](_0x3e1e9c);}return null;};}function patchUpdates(_0x2a7666){return function(_0x165f58){try{jsonpatch[_0x8978('0x23')](_0x165f58,_0x2a7666,!![]);}catch(_0x2c13b3){return BPromise['reject'](_0x2c13b3);}return _0x165f58[_0x8978('0x24')]();};}function saveUpdates(_0x5c9998,_0x33a5d7){return function(_0xa98e86){if(_0xa98e86){return _0xa98e86[_0x8978('0x25')](_0x5c9998)[_0x8978('0x26')](function(_0x2569e2){return _0x2569e2;});}return null;};}function removeEntity(_0x2a430c,_0x145bb7){return function(_0x1b7758){if(_0x1b7758){return _0x1b7758[_0x8978('0x27')]()[_0x8978('0x26')](function(){_0x2a430c[_0x8978('0x1b')](0xcc)[_0x8978('0x1c')]();});}};}function handleEntityNotFound(_0x4c49fe,_0x46785b){return function(_0xda73b4){if(!_0xda73b4){_0x4c49fe[_0x8978('0x28')](0x194);}return _0xda73b4;};}function handleError(_0x226715,_0x1fb755){_0x1fb755=_0x1fb755||0x1f4;return function(_0x71a77b){logger[_0x8978('0x29')](_0x71a77b[_0x8978('0x2a')]);if(_0x71a77b['name']){delete _0x71a77b[_0x8978('0x2b')];}_0x226715[_0x8978('0x1b')](_0x1fb755)[_0x8978('0x2c')](_0x71a77b);};}exports[_0x8978('0x2d')]=function(_0x1f212c,_0x4e4250){var _0x350b15={},_0x231501={},_0x4c74c7={'count':0x0,'rows':[]};var _0x57b8a4=_[_0x8978('0x2e')](db['AnalyticTreeReport']['rawAttributes'],function(_0x2dc634){return{'name':_0x2dc634[_0x8978('0x2f')],'type':_0x2dc634['type'][_0x8978('0x30')]};});_0x231501[_0x8978('0x31')]=_[_0x8978('0x2e')](_0x57b8a4,_0x8978('0x2b'));_0x231501[_0x8978('0x32')]=_[_0x8978('0x33')](_0x1f212c[_0x8978('0x32')]);_0x231501[_0x8978('0x34')]=_['intersection'](_0x231501[_0x8978('0x31')],_0x231501[_0x8978('0x32')]);_0x350b15[_0x8978('0x35')]=_['intersection'](_0x231501['model'],qs[_0x8978('0x36')](_0x1f212c['query'][_0x8978('0x36')]));_0x350b15[_0x8978('0x35')]=_0x350b15['attributes'][_0x8978('0x37')]?_0x350b15[_0x8978('0x35')]:_0x231501[_0x8978('0x31')];if(!_0x1f212c['query'][_0x8978('0x38')](_0x8978('0x39'))){_0x350b15[_0x8978('0x1f')]=qs[_0x8978('0x1f')](_0x1f212c[_0x8978('0x32')][_0x8978('0x1f')]);_0x350b15[_0x8978('0x1d')]=qs[_0x8978('0x1d')](_0x1f212c[_0x8978('0x32')][_0x8978('0x1d')]);}_0x350b15['order']=qs[_0x8978('0x3a')](_0x1f212c[_0x8978('0x32')]['sort']);_0x350b15['where']=qs[_0x8978('0x34')](_[_0x8978('0x3b')](_0x1f212c[_0x8978('0x32')],_0x231501[_0x8978('0x34')]),_0x57b8a4);if(_0x1f212c['query']['filter']){_0x350b15[_0x8978('0x3c')]=_['merge'](_0x350b15['where'],{'$or':_['map'](_0x57b8a4,function(_0xd4d885){if(_0xd4d885[_0x8978('0x3d')]!==_0x8978('0x3e')){var _0xf03683={};_0xf03683[_0xd4d885[_0x8978('0x2b')]]={'$like':'%'+_0x1f212c[_0x8978('0x32')][_0x8978('0x3f')]+'%'};return _0xf03683;}})});}_0x350b15=_[_0x8978('0x40')]({},_0x350b15,_0x1f212c[_0x8978('0x41')]);var _0x22ef6c={'where':_0x350b15['where']};return db['AnalyticTreeReport'][_0x8978('0x20')](_0x22ef6c)[_0x8978('0x26')](function(_0x131b0e){_0x4c74c7['count']=_0x131b0e;if(_0x1f212c[_0x8978('0x32')][_0x8978('0x42')]){_0x350b15[_0x8978('0x43')]=[{'all':!![]}];}return db[_0x8978('0x44')][_0x8978('0x45')](_0x350b15);})[_0x8978('0x26')](function(_0x3301f7){_0x4c74c7[_0x8978('0x46')]=_0x3301f7;return _0x4c74c7;})['then'](respondWithFilteredResult(_0x4e4250,_0x350b15))['catch'](handleError(_0x4e4250,null));};exports[_0x8978('0x47')]=function(_0x4d4d3e,_0x4d7ccf){var _0x53fcfe={'raw':!![],'where':{'id':_0x4d4d3e[_0x8978('0x48')]['id']}},_0x4972c1={};_0x4972c1[_0x8978('0x31')]=_[_0x8978('0x33')](db[_0x8978('0x44')][_0x8978('0x49')]);_0x4972c1[_0x8978('0x32')]=_[_0x8978('0x33')](_0x4d4d3e[_0x8978('0x32')]);_0x4972c1[_0x8978('0x34')]=_['intersection'](_0x4972c1[_0x8978('0x31')],_0x4972c1['query']);_0x53fcfe[_0x8978('0x35')]=_[_0x8978('0x4a')](_0x4972c1[_0x8978('0x31')],qs[_0x8978('0x36')](_0x4d4d3e[_0x8978('0x32')]['fields']));_0x53fcfe[_0x8978('0x35')]=_0x53fcfe[_0x8978('0x35')][_0x8978('0x37')]?_0x53fcfe[_0x8978('0x35')]:_0x4972c1[_0x8978('0x31')];if(_0x4d4d3e[_0x8978('0x32')][_0x8978('0x42')]){_0x53fcfe[_0x8978('0x43')]=[{'all':!![]}];}_0x53fcfe=_['merge']({},_0x53fcfe,_0x4d4d3e[_0x8978('0x41')]);return db[_0x8978('0x44')][_0x8978('0x4b')](_0x53fcfe)['then'](handleEntityNotFound(_0x4d7ccf,null))['then'](respondWithResult(_0x4d7ccf,null))['catch'](handleError(_0x4d7ccf,null));};exports[_0x8978('0x4c')]=function(_0x193827,_0x236eca){return db['AnalyticTreeReport'][_0x8978('0x4c')](_0x193827[_0x8978('0x4d')],{})[_0x8978('0x26')](respondWithResult(_0x236eca,0xc9))['catch'](handleError(_0x236eca,null));};exports[_0x8978('0x25')]=function(_0x3933be,_0x7a070b){if(_0x3933be['body']['id']){delete _0x3933be[_0x8978('0x4d')]['id'];}return db['AnalyticTreeReport'][_0x8978('0x4b')]({'where':{'id':_0x3933be['params']['id']}})[_0x8978('0x26')](handleEntityNotFound(_0x7a070b,null))[_0x8978('0x26')](saveUpdates(_0x3933be['body'],null))['then'](respondWithResult(_0x7a070b,null))[_0x8978('0x4e')](handleError(_0x7a070b,null));};exports[_0x8978('0x27')]=function(_0x587579,_0x3fda7e){return db[_0x8978('0x44')][_0x8978('0x4b')]({'where':{'id':_0x587579[_0x8978('0x48')]['id']}})[_0x8978('0x26')](handleEntityNotFound(_0x3fda7e,null))[_0x8978('0x26')](removeEntity(_0x3fda7e,null))['catch'](handleError(_0x3fda7e,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 818426c..8391aef 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 _0x0617=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1b1948,_0x49f451){var _0x3cbd38=function(_0x2ca4f2){while(--_0x2ca4f2){_0x1b1948['push'](_0x1b1948['shift']());}};_0x3cbd38(++_0x49f451);}(_0x0617,0xcb));var _0x7061=function(_0x365d9a,_0x6b8d5f){_0x365d9a=_0x365d9a-0x0;var _0x54161d=_0x0617[_0x365d9a];return _0x54161d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7061('0x0'))(_0x7061('0x1'));var moment=require(_0x7061('0x2'));var BPromise=require(_0x7061('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7061('0x4'));var rimraf=require('rimraf');var config=require(_0x7061('0x5'));var attributes=require(_0x7061('0x6'));module[_0x7061('0x7')]=function(_0x55fe55,_0xe7c0de){return _0x55fe55[_0x7061('0x8')](_0x7061('0x9'),attributes,{'tableName':_0x7061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad91=['analytics_report_trees','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x10acb2,_0x3ca870){var _0x186379=function(_0x294bbd){while(--_0x294bbd){_0x10acb2['push'](_0x10acb2['shift']());}};_0x186379(++_0x3ca870);}(_0xad91,0x105));var _0x1ad9=function(_0x1c46c5,_0x41bc70){_0x1c46c5=_0x1c46c5-0x0;var _0x4e403c=_0xad91[_0x1c46c5];return _0x4e403c;};'use strict';var _=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var logger=require(_0x1ad9('0x2'))(_0x1ad9('0x3'));var moment=require('moment');var BPromise=require(_0x1ad9('0x4'));var rp=require(_0x1ad9('0x5'));var fs=require('fs');var path=require(_0x1ad9('0x6'));var rimraf=require(_0x1ad9('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ad9('0x8'));module[_0x1ad9('0x9')]=function(_0x22f6a6,_0x96d8fb){return _0x22f6a6[_0x1ad9('0xa')](_0x1ad9('0xb'),attributes,{'tableName':_0x1ad9('0xc'),'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 d3c9ea4..f5c38c4 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x49b30e,_0x30f431){var _0x4af321=function(_0x6c4fd9){while(--_0x6c4fd9){_0x49b30e['push'](_0x49b30e['shift']());}};_0x4af321(++_0x30f431);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xc4aa[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5096e5,_0x4d0c54){var _0x23dd95=function(_0x26b0cf){while(--_0x26b0cf){_0x5096e5['push'](_0x5096e5['shift']());}};_0x23dd95(++_0x4d0c54);}(_0xdb28,0x106));var _0x8db2=function(_0x19abee,_0x54372e){_0x19abee=_0x19abee-0x0;var _0x23c7bd=_0xdb28[_0x19abee];return _0x23c7bd;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 480e2b4..88fb65b 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 _0xdb59=['get','isAuthenticated','/:id','post','put','update','destroy','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xdb59,0xda));var _0x9db5=function(_0x44d3d7,_0x1c6356){_0x44d3d7=_0x44d3d7-0x0;var _0x1886c0=_0xdb59[_0x44d3d7];return _0x1886c0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9db5('0x0'));var express=require(_0x9db5('0x1'));var router=express['Router']();var fs_extra=require(_0x9db5('0x2'));var auth=require(_0x9db5('0x3'));var interaction=require(_0x9db5('0x4'));var config=require(_0x9db5('0x5'));var controller=require(_0x9db5('0x6'));router[_0x9db5('0x7')]('/',auth[_0x9db5('0x8')](),controller['index']);router[_0x9db5('0x7')](_0x9db5('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9db5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9db5('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9db5('0xc')]);router['delete'](_0x9db5('0x9'),auth[_0x9db5('0x8')](),controller[_0x9db5('0xd')]);module[_0x9db5('0xe')]=router;
\ No newline at end of file
+var _0x2dc7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2dc7,0x96));var _0x72dc=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x2dc7[_0x43a37c];return _0x5d1d40;};'use strict';var multer=require(_0x72dc('0x0'));var util=require(_0x72dc('0x1'));var path=require(_0x72dc('0x2'));var timeout=require(_0x72dc('0x3'));var express=require(_0x72dc('0x4'));var router=express[_0x72dc('0x5')]();var fs_extra=require(_0x72dc('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x72dc('0x7'));var config=require(_0x72dc('0x8'));var controller=require(_0x72dc('0x9'));router['get']('/',auth[_0x72dc('0xa')](),controller[_0x72dc('0xb')]);router['get'](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller['show']);router[_0x72dc('0xd')]('/',auth[_0x72dc('0xa')](),controller['create']);router[_0x72dc('0xe')](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller[_0x72dc('0xf')]);router[_0x72dc('0x10')](_0x72dc('0xc'),auth[_0x72dc('0xa')](),controller[_0x72dc('0x11')]);module[_0x72dc('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index bfea402..841a945 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 _0xff98=['exports','STRING'];(function(_0x386f0a,_0x3b084a){var _0x32ffa0=function(_0x4cdefd){while(--_0x4cdefd){_0x386f0a['push'](_0x386f0a['shift']());}};_0x32ffa0(++_0x3b084a);}(_0xff98,0x9c));var _0x8ff9=function(_0xdb5d5a,_0x5c857e){_0xdb5d5a=_0xdb5d5a-0x0;var _0x426c3b=_0xff98[_0xdb5d5a];return _0x426c3b;};'use strict';var Sequelize=require('sequelize');module[_0x8ff9('0x0')]={'name':{'type':Sequelize[_0x8ff9('0x1')]},'basename':{'type':Sequelize[_0x8ff9('0x1')]},'type':{'type':Sequelize[_0x8ff9('0x1')]}};
\ No newline at end of file
+var _0xea70=['STRING','sequelize','exports'];(function(_0x5d6806,_0x54f344){var _0x21adb5=function(_0x4448f5){while(--_0x4448f5){_0x5d6806['push'](_0x5d6806['shift']());}};_0x21adb5(++_0x54f344);}(_0xea70,0x175));var _0x0ea7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xea70[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x0ea7('0x0'));module[_0x0ea7('0x1')]={'name':{'type':Sequelize[_0x0ea7('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0ea7('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index acbceeb..69edd05 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 _0x280b=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','clone','params','get','omit','body','createdAt','create','find','originalname','basename','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','update','then','destroy','sendStatus','name','send','index','Attachment','type','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3a428d,_0x4f6232){var _0x1fb723=function(_0x554a39){while(--_0x554a39){_0x3a428d['push'](_0x3a428d['shift']());}};_0x1fb723(++_0x4f6232);}(_0x280b,0x180));var _0xb280=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x280b[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0xb280('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb280('0x1'));var jsonpatch=require(_0xb280('0x2'));var rp=require(_0xb280('0x3'));var moment=require(_0xb280('0x4'));var BPromise=require(_0xb280('0x5'));var Mustache=require('mustache');var util=require(_0xb280('0x6'));var path=require(_0xb280('0x7'));var sox=require(_0xb280('0x8'));var csv=require(_0xb280('0x9'));var ejs=require(_0xb280('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb280('0xb'));var squel=require(_0xb280('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb280('0x9'));var querystring=require(_0xb280('0xd'));var Papa=require('papaparse');var Redis=require(_0xb280('0xe'));var authService=require(_0xb280('0xf'));var qs=require(_0xb280('0x10'));var as=require(_0xb280('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb280('0x12'))('api');var utils=require(_0xb280('0x13'));var config=require(_0xb280('0x14'));var licenseUtil=require(_0xb280('0x15'));var db=require(_0xb280('0x16'))['db'];function respondWithStatusCode(_0x28c187,_0x1f8e42){_0x1f8e42=_0x1f8e42||0xcc;return function(_0x275188){if(_0x275188){return _0x28c187['sendStatus'](_0x1f8e42);}return _0x28c187[_0xb280('0x17')](_0x1f8e42)[_0xb280('0x18')]();};}function respondWithResult(_0x348798,_0x30134a){_0x30134a=_0x30134a||0xc8;return function(_0x5597ad){if(_0x5597ad){return _0x348798[_0xb280('0x17')](_0x30134a)['json'](_0x5597ad);}};}function respondWithFilteredResult(_0x195575,_0x5e097c){return function(_0x29f14e){if(_0x29f14e){var _0x30f276=typeof _0x5e097c[_0xb280('0x19')]===_0xb280('0x1a')&&typeof _0x5e097c['limit']===_0xb280('0x1a');var _0x414adf=_0x29f14e[_0xb280('0x1b')];var _0x1aef67=_0x30f276?0x0:_0x5e097c[_0xb280('0x19')];var _0x253b5e=_0x30f276?_0x29f14e[_0xb280('0x1b')]:_0x5e097c[_0xb280('0x19')]+_0x5e097c[_0xb280('0x1c')];var _0xc9b5a1;if(_0x253b5e>=_0x414adf){_0x253b5e=_0x414adf;_0xc9b5a1=0xc8;}else{_0xc9b5a1=0xce;}_0x195575[_0xb280('0x17')](_0xc9b5a1);return _0x195575[_0xb280('0x1d')]('Content-Range',_0x1aef67+'-'+_0x253b5e+'/'+_0x414adf)[_0xb280('0x1e')](_0x29f14e);}return null;};}function patchUpdates(_0x38e20e){return function(_0x37e5c2){try{jsonpatch[_0xb280('0x1f')](_0x37e5c2,_0x38e20e,!![]);}catch(_0x10a24d){return BPromise[_0xb280('0x20')](_0x10a24d);}return _0x37e5c2['save']();};}function saveUpdates(_0x559a80,_0x3eabd9){return function(_0x47734c){if(_0x47734c){return _0x47734c[_0xb280('0x21')](_0x559a80)[_0xb280('0x22')](function(_0x25a56d){return _0x25a56d;});}return null;};}function removeEntity(_0x2eb5fe,_0x5e9eae){return function(_0x57b37c){if(_0x57b37c){return _0x57b37c[_0xb280('0x23')]()[_0xb280('0x22')](function(){_0x2eb5fe[_0xb280('0x17')](0xcc)[_0xb280('0x18')]();});}};}function handleEntityNotFound(_0x12ae73,_0x440f4b){return function(_0x44d03c){if(!_0x44d03c){_0x12ae73[_0xb280('0x24')](0x194);}return _0x44d03c;};}function handleError(_0x548676,_0x449bc9){_0x449bc9=_0x449bc9||0x1f4;return function(_0x45f937){logger['error'](_0x45f937['stack']);if(_0x45f937[_0xb280('0x25')]){delete _0x45f937[_0xb280('0x25')];}_0x548676[_0xb280('0x17')](_0x449bc9)[_0xb280('0x26')](_0x45f937);};}exports[_0xb280('0x27')]=function(_0x2ca5ef,_0xcb9ce8){var _0x27a475={},_0xb94030={},_0x440cf1={'count':0x0,'rows':[]};var _0x58b5c8=_['map'](db[_0xb280('0x28')]['rawAttributes'],function(_0x27274b){return{'name':_0x27274b['fieldName'],'type':_0x27274b[_0xb280('0x29')][_0xb280('0x2a')]};});_0xb94030['model']=_['map'](_0x58b5c8,_0xb280('0x25'));_0xb94030[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x2ca5ef[_0xb280('0x2b')]);_0xb94030[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0xb94030[_0xb280('0x2f')],_0xb94030[_0xb280('0x2b')]);_0x27a475[_0xb280('0x30')]=_['intersection'](_0xb94030['model'],qs[_0xb280('0x31')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x31')]));_0x27a475[_0xb280('0x30')]=_0x27a475[_0xb280('0x30')][_0xb280('0x32')]?_0x27a475[_0xb280('0x30')]:_0xb94030[_0xb280('0x2f')];if(!_0x2ca5ef['query']['hasOwnProperty'](_0xb280('0x33'))){_0x27a475[_0xb280('0x1c')]=qs['limit'](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x1c')]);_0x27a475['offset']=qs['offset'](_0x2ca5ef['query'][_0xb280('0x19')]);}_0x27a475[_0xb280('0x34')]=qs[_0xb280('0x35')](_0x2ca5ef[_0xb280('0x2b')][_0xb280('0x35')]);_0x27a475[_0xb280('0x36')]=qs['filters'](_[_0xb280('0x37')](_0x2ca5ef['query'],_0xb94030[_0xb280('0x2d')]),_0x58b5c8);if(_0x2ca5ef['query'][_0xb280('0x38')]){_0x27a475[_0xb280('0x36')]=_[_0xb280('0x39')](_0x27a475[_0xb280('0x36')],{'$or':_[_0xb280('0x3a')](_0x58b5c8,function(_0x2787f8){if(_0x2787f8[_0xb280('0x29')]!==_0xb280('0x3b')){var _0xe6a22e={};_0xe6a22e[_0x2787f8[_0xb280('0x25')]]={'$like':'%'+_0x2ca5ef[_0xb280('0x2b')]['filter']+'%'};return _0xe6a22e;}})});}_0x27a475=_[_0xb280('0x39')]({},_0x27a475,_0x2ca5ef[_0xb280('0x3c')]);var _0x5cd98c={'where':_0x27a475[_0xb280('0x36')]};return db[_0xb280('0x28')][_0xb280('0x1b')](_0x5cd98c)[_0xb280('0x22')](function(_0x5bf59a){_0x440cf1[_0xb280('0x1b')]=_0x5bf59a;if(_0x2ca5ef['query'][_0xb280('0x3d')]){_0x27a475[_0xb280('0x3e')]=[{'all':!![]}];}return db[_0xb280('0x28')][_0xb280('0x3f')](_0x27a475);})[_0xb280('0x22')](function(_0x430921){_0x440cf1[_0xb280('0x40')]=_0x430921;return _0x440cf1;})[_0xb280('0x22')](respondWithFilteredResult(_0xcb9ce8,_0x27a475))[_0xb280('0x41')](handleError(_0xcb9ce8,null));};exports['show']=function(_0x5dd0cc,_0x2c7831){var _0x11d412={'raw':!![],'where':{'id':_0x5dd0cc['params']['id']}},_0x5b7501={};_0x5b7501[_0xb280('0x2f')]=_['keys'](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5b7501[_0xb280('0x2b')]=_[_0xb280('0x2c')](_0x5dd0cc[_0xb280('0x2b')]);_0x5b7501[_0xb280('0x2d')]=_[_0xb280('0x2e')](_0x5b7501[_0xb280('0x2f')],_0x5b7501['query']);_0x11d412[_0xb280('0x30')]=_[_0xb280('0x2e')](_0x5b7501['model'],qs[_0xb280('0x31')](_0x5dd0cc['query'][_0xb280('0x31')]));_0x11d412[_0xb280('0x30')]=_0x11d412['attributes'][_0xb280('0x32')]?_0x11d412[_0xb280('0x30')]:_0x5b7501[_0xb280('0x2f')];if(_0x5dd0cc['query'][_0xb280('0x3d')]){_0x11d412[_0xb280('0x3e')]=[{'all':!![]}];}_0x11d412=_['merge']({},_0x11d412,_0x5dd0cc['options']);return db['Attachment']['find'](_0x11d412)[_0xb280('0x22')](handleEntityNotFound(_0x2c7831,null))[_0xb280('0x22')](respondWithResult(_0x2c7831,null))['catch'](handleError(_0x2c7831,null));};exports[_0xb280('0x43')]=function(_0xe4ff86,_0x25a7cc){var _0x5bd341={'where':{'id':_0xe4ff86[_0xb280('0x44')]['id']}},_0x80f81e={};_0x80f81e[_0xb280('0x2f')]=_[_0xb280('0x2c')](db[_0xb280('0x28')][_0xb280('0x42')]);_0x5bd341['attributes']=_[_0xb280('0x2e')](_0x80f81e[_0xb280('0x2f')],qs[_0xb280('0x31')](_0xe4ff86[_0xb280('0x2b')][_0xb280('0x31')]));_0x5bd341[_0xb280('0x30')]=_0x5bd341[_0xb280('0x30')][_0xb280('0x32')]?_0x5bd341[_0xb280('0x30')]:_0x80f81e['model'];if(_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]){_0x5bd341[_0xb280('0x3e')]=[{'all':!![]}];}_0x5bd341=_[_0xb280('0x39')]({},_0x5bd341,_0xe4ff86['options']);return db[_0xb280('0x28')]['find'](_0x5bd341)[_0xb280('0x22')](handleEntityNotFound(_0x25a7cc,null))[_0xb280('0x22')](function(_0x845a9b){if(_0x845a9b){var _0x1085b6=_0x845a9b[_0xb280('0x45')]({'plain':!![]});_0x1085b6=qs[_0xb280('0x46')](_0x1085b6,['id','createdAt','updatedAt']);_0xe4ff86[_0xb280('0x47')]=_[_0xb280('0x46')](_0xe4ff86['body'],['id',_0xb280('0x48'),'updatedAt']);return db['Attachment'][_0xb280('0x49')](_[_0xb280('0x39')](_0x1085b6,_0xe4ff86[_0xb280('0x47')]),{'include':_0xe4ff86[_0xb280('0x2b')][_0xb280('0x3d')]?[{'all':!![]}]:undefined});}})[_0xb280('0x22')](respondWithResult(_0x25a7cc,0xc9))[_0xb280('0x41')](handleError(_0x25a7cc,null));};exports['update']=function(_0x7fdb22,_0x32468a){if(_0x7fdb22[_0xb280('0x47')]['id']){delete _0x7fdb22[_0xb280('0x47')]['id'];}return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x7fdb22[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x32468a,null))[_0xb280('0x22')](saveUpdates(_0x7fdb22['body'],null))[_0xb280('0x22')](respondWithResult(_0x32468a,null))['catch'](handleError(_0x32468a,null));};exports['destroy']=function(_0x3b1339,_0x55df54){return db[_0xb280('0x28')][_0xb280('0x4a')]({'where':{'id':_0x3b1339[_0xb280('0x44')]['id']}})[_0xb280('0x22')](handleEntityNotFound(_0x55df54,null))['then'](removeEntity(_0x55df54,null))[_0xb280('0x41')](handleError(_0x55df54,null));};exports[_0xb280('0x49')]=function(_0x5d0dfd,_0x1485c0,_0x7baf2a){_0x5d0dfd[_0xb280('0x47')][_0xb280('0x25')]=_0x5d0dfd['file'][_0xb280('0x4b')];_0x5d0dfd[_0xb280('0x47')][_0xb280('0x4c')]=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4e')];_0x5d0dfd[_0xb280('0x47')]['type']=_0x5d0dfd[_0xb280('0x4d')][_0xb280('0x4f')];return db[_0xb280('0x28')][_0xb280('0x49')](_0x5d0dfd[_0xb280('0x47')])[_0xb280('0x22')](respondWithResult(_0x1485c0,0xc9))[_0xb280('0x41')](handleError(_0x1485c0,null));};exports[_0xb280('0x50')]=function(_0x863481,_0x435675,_0x28f28c){return db[_0xb280('0x28')][_0xb280('0x51')]({'where':{'id':_0x863481[_0xb280('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x435675,null))[_0xb280('0x22')](function(_0x54f53b){if(_0x54f53b){var _0x9f5e75=_0x54f53b[_0xb280('0x52')]!==null;var _0x5b35de=path[_0xb280('0x53')](config[_0xb280('0x54')],_0xb280('0x55'));if(_0x9f5e75){_0x5b35de=path[_0xb280('0x53')](_0x5b35de,_0xb280('0x56'));}var _0xca1404=path[_0xb280('0x53')](_0x5b35de,_0x54f53b[_0xb280('0x4c')]);return _0x435675[_0xb280('0x50')](_0xca1404);}})[_0xb280('0x41')](handleError(_0x435675,null));};
\ No newline at end of file
+var _0x72e9=['show','params','find','clone','merge','get','updatedAt','body','createdAt','create','file','basename','filename','mimetype','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','apply','reject','update','then','destroy','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','where','pick','filters','filter','includeAll','include','findAll','rows','catch'];(function(_0x3d50a7,_0x1f6705){var _0x4017ef=function(_0x20b7d6){while(--_0x20b7d6){_0x3d50a7['push'](_0x3d50a7['shift']());}};_0x4017ef(++_0x1f6705);}(_0x72e9,0xbb));var _0x972e=function(_0x3e197b,_0x36ba95){_0x3e197b=_0x3e197b-0x0;var _0x3ba301=_0x72e9[_0x3e197b];return _0x3ba301;};'use strict';var emlformat=require(_0x972e('0x0'));var rimraf=require(_0x972e('0x1'));var zipdir=require(_0x972e('0x2'));var jsonpatch=require(_0x972e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x972e('0x4'));var Mustache=require(_0x972e('0x5'));var util=require(_0x972e('0x6'));var path=require(_0x972e('0x7'));var sox=require(_0x972e('0x8'));var csv=require(_0x972e('0x9'));var ejs=require(_0x972e('0xa'));var fs=require('fs');var fs_extra=require(_0x972e('0xb'));var _=require(_0x972e('0xc'));var squel=require(_0x972e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x972e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x972e('0xf'));var Papa=require(_0x972e('0x10'));var Redis=require('ioredis');var authService=require(_0x972e('0x11'));var qs=require(_0x972e('0x12'));var as=require(_0x972e('0x13'));var hardwareService=require(_0x972e('0x14'));var logger=require(_0x972e('0x15'))(_0x972e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x972e('0x17'))['db'];function respondWithStatusCode(_0x30f33e,_0x3d87c9){_0x3d87c9=_0x3d87c9||0xcc;return function(_0x5c5f11){if(_0x5c5f11){return _0x30f33e[_0x972e('0x18')](_0x3d87c9);}return _0x30f33e['status'](_0x3d87c9)[_0x972e('0x19')]();};}function respondWithResult(_0x3c1378,_0x403fb2){_0x403fb2=_0x403fb2||0xc8;return function(_0x479353){if(_0x479353){return _0x3c1378[_0x972e('0x1a')](_0x403fb2)[_0x972e('0x1b')](_0x479353);}};}function respondWithFilteredResult(_0x3557f8,_0x238908){return function(_0x1f595d){if(_0x1f595d){var _0x2e7440=typeof _0x238908['offset']===_0x972e('0x1c')&&typeof _0x238908[_0x972e('0x1d')]===_0x972e('0x1c');var _0x5e0d9e=_0x1f595d['count'];var _0x4f7575=_0x2e7440?0x0:_0x238908[_0x972e('0x1e')];var _0xa91f61=_0x2e7440?_0x1f595d[_0x972e('0x1f')]:_0x238908[_0x972e('0x1e')]+_0x238908[_0x972e('0x1d')];var _0x3fcc75;if(_0xa91f61>=_0x5e0d9e){_0xa91f61=_0x5e0d9e;_0x3fcc75=0xc8;}else{_0x3fcc75=0xce;}_0x3557f8[_0x972e('0x1a')](_0x3fcc75);return _0x3557f8['set']('Content-Range',_0x4f7575+'-'+_0xa91f61+'/'+_0x5e0d9e)[_0x972e('0x1b')](_0x1f595d);}return null;};}function patchUpdates(_0x231254){return function(_0x54cd66){try{jsonpatch[_0x972e('0x20')](_0x54cd66,_0x231254,!![]);}catch(_0x46388c){return BPromise[_0x972e('0x21')](_0x46388c);}return _0x54cd66['save']();};}function saveUpdates(_0x2753b2,_0xcd8afa){return function(_0x52876c){if(_0x52876c){return _0x52876c[_0x972e('0x22')](_0x2753b2)[_0x972e('0x23')](function(_0x23e4e6){return _0x23e4e6;});}return null;};}function removeEntity(_0x178c2c,_0x1b2194){return function(_0x8f32cd){if(_0x8f32cd){return _0x8f32cd[_0x972e('0x24')]()[_0x972e('0x23')](function(){_0x178c2c[_0x972e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fbed0,_0x46ca0b){return function(_0x456a6c){if(!_0x456a6c){_0x1fbed0[_0x972e('0x18')](0x194);}return _0x456a6c;};}function handleError(_0x190fc4,_0x258961){_0x258961=_0x258961||0x1f4;return function(_0x4a4164){logger[_0x972e('0x25')](_0x4a4164[_0x972e('0x26')]);if(_0x4a4164[_0x972e('0x27')]){delete _0x4a4164[_0x972e('0x27')];}_0x190fc4['status'](_0x258961)[_0x972e('0x28')](_0x4a4164);};}exports[_0x972e('0x29')]=function(_0x229894,_0x3d62df){var _0x203466={},_0x41bc44={},_0x319917={'count':0x0,'rows':[]};var _0x519d25=_['map'](db[_0x972e('0x2a')][_0x972e('0x2b')],function(_0x2098a3){return{'name':_0x2098a3[_0x972e('0x2c')],'type':_0x2098a3[_0x972e('0x2d')]['key']};});_0x41bc44[_0x972e('0x2e')]=_[_0x972e('0x2f')](_0x519d25,_0x972e('0x27'));_0x41bc44[_0x972e('0x30')]=_[_0x972e('0x31')](_0x229894['query']);_0x41bc44['filters']=_[_0x972e('0x32')](_0x41bc44[_0x972e('0x2e')],_0x41bc44['query']);_0x203466[_0x972e('0x33')]=_[_0x972e('0x32')](_0x41bc44['model'],qs[_0x972e('0x34')](_0x229894[_0x972e('0x30')]['fields']));_0x203466[_0x972e('0x33')]=_0x203466[_0x972e('0x33')][_0x972e('0x35')]?_0x203466['attributes']:_0x41bc44['model'];if(!_0x229894['query']['hasOwnProperty'](_0x972e('0x36'))){_0x203466[_0x972e('0x1d')]=qs[_0x972e('0x1d')](_0x229894[_0x972e('0x30')][_0x972e('0x1d')]);_0x203466[_0x972e('0x1e')]=qs[_0x972e('0x1e')](_0x229894[_0x972e('0x30')][_0x972e('0x1e')]);}_0x203466[_0x972e('0x37')]=qs['sort'](_0x229894['query']['sort']);_0x203466[_0x972e('0x38')]=qs['filters'](_[_0x972e('0x39')](_0x229894[_0x972e('0x30')],_0x41bc44[_0x972e('0x3a')]),_0x519d25);if(_0x229894[_0x972e('0x30')][_0x972e('0x3b')]){_0x203466[_0x972e('0x38')]=_['merge'](_0x203466[_0x972e('0x38')],{'$or':_[_0x972e('0x2f')](_0x519d25,function(_0x1051d7){if(_0x1051d7[_0x972e('0x2d')]!=='VIRTUAL'){var _0x123783={};_0x123783[_0x1051d7[_0x972e('0x27')]]={'$like':'%'+_0x229894[_0x972e('0x30')][_0x972e('0x3b')]+'%'};return _0x123783;}})});}_0x203466=_['merge']({},_0x203466,_0x229894['options']);var _0x256509={'where':_0x203466['where']};return db['Attachment'][_0x972e('0x1f')](_0x256509)[_0x972e('0x23')](function(_0x2ee097){_0x319917[_0x972e('0x1f')]=_0x2ee097;if(_0x229894['query'][_0x972e('0x3c')]){_0x203466[_0x972e('0x3d')]=[{'all':!![]}];}return db[_0x972e('0x2a')][_0x972e('0x3e')](_0x203466);})[_0x972e('0x23')](function(_0xdf5eb7){_0x319917[_0x972e('0x3f')]=_0xdf5eb7;return _0x319917;})[_0x972e('0x23')](respondWithFilteredResult(_0x3d62df,_0x203466))[_0x972e('0x40')](handleError(_0x3d62df,null));};exports[_0x972e('0x41')]=function(_0x445fa1,_0x1c6b89){var _0x2a6160={'raw':!![],'where':{'id':_0x445fa1[_0x972e('0x42')]['id']}},_0x2ed4ef={};_0x2ed4ef['model']=_[_0x972e('0x31')](db[_0x972e('0x2a')][_0x972e('0x2b')]);_0x2ed4ef[_0x972e('0x30')]=_[_0x972e('0x31')](_0x445fa1['query']);_0x2ed4ef['filters']=_['intersection'](_0x2ed4ef['model'],_0x2ed4ef[_0x972e('0x30')]);_0x2a6160[_0x972e('0x33')]=_[_0x972e('0x32')](_0x2ed4ef['model'],qs[_0x972e('0x34')](_0x445fa1[_0x972e('0x30')][_0x972e('0x34')]));_0x2a6160['attributes']=_0x2a6160['attributes'][_0x972e('0x35')]?_0x2a6160[_0x972e('0x33')]:_0x2ed4ef['model'];if(_0x445fa1[_0x972e('0x30')][_0x972e('0x3c')]){_0x2a6160[_0x972e('0x3d')]=[{'all':!![]}];}_0x2a6160=_['merge']({},_0x2a6160,_0x445fa1['options']);return db[_0x972e('0x2a')][_0x972e('0x43')](_0x2a6160)[_0x972e('0x23')](handleEntityNotFound(_0x1c6b89,null))['then'](respondWithResult(_0x1c6b89,null))[_0x972e('0x40')](handleError(_0x1c6b89,null));};exports[_0x972e('0x44')]=function(_0x3445ec,_0x475f25){var _0xa6b13f={'where':{'id':_0x3445ec[_0x972e('0x42')]['id']}},_0x21bdf9={};_0x21bdf9[_0x972e('0x2e')]=_[_0x972e('0x31')](db[_0x972e('0x2a')]['rawAttributes']);_0xa6b13f[_0x972e('0x33')]=_[_0x972e('0x32')](_0x21bdf9[_0x972e('0x2e')],qs[_0x972e('0x34')](_0x3445ec[_0x972e('0x30')]['fields']));_0xa6b13f[_0x972e('0x33')]=_0xa6b13f['attributes'][_0x972e('0x35')]?_0xa6b13f[_0x972e('0x33')]:_0x21bdf9['model'];if(_0x3445ec[_0x972e('0x30')][_0x972e('0x3c')]){_0xa6b13f['include']=[{'all':!![]}];}_0xa6b13f=_[_0x972e('0x45')]({},_0xa6b13f,_0x3445ec['options']);return db['Attachment'][_0x972e('0x43')](_0xa6b13f)[_0x972e('0x23')](handleEntityNotFound(_0x475f25,null))[_0x972e('0x23')](function(_0x5e3e3c){if(_0x5e3e3c){var _0x4a860d=_0x5e3e3c[_0x972e('0x46')]({'plain':!![]});_0x4a860d=qs['omit'](_0x4a860d,['id','createdAt',_0x972e('0x47')]);_0x3445ec['body']=_['omit'](_0x3445ec[_0x972e('0x48')],['id',_0x972e('0x49'),'updatedAt']);return db['Attachment'][_0x972e('0x4a')](_[_0x972e('0x45')](_0x4a860d,_0x3445ec[_0x972e('0x48')]),{'include':_0x3445ec[_0x972e('0x30')][_0x972e('0x3c')]?[{'all':!![]}]:undefined});}})[_0x972e('0x23')](respondWithResult(_0x475f25,0xc9))['catch'](handleError(_0x475f25,null));};exports[_0x972e('0x22')]=function(_0x3bd1ad,_0x144ec8){if(_0x3bd1ad[_0x972e('0x48')]['id']){delete _0x3bd1ad[_0x972e('0x48')]['id'];}return db[_0x972e('0x2a')][_0x972e('0x43')]({'where':{'id':_0x3bd1ad[_0x972e('0x42')]['id']}})[_0x972e('0x23')](handleEntityNotFound(_0x144ec8,null))[_0x972e('0x23')](saveUpdates(_0x3bd1ad[_0x972e('0x48')],null))['then'](respondWithResult(_0x144ec8,null))[_0x972e('0x40')](handleError(_0x144ec8,null));};exports[_0x972e('0x24')]=function(_0xd6084,_0x3bedc8){return db['Attachment'][_0x972e('0x43')]({'where':{'id':_0xd6084[_0x972e('0x42')]['id']}})[_0x972e('0x23')](handleEntityNotFound(_0x3bedc8,null))[_0x972e('0x23')](removeEntity(_0x3bedc8,null))[_0x972e('0x40')](handleError(_0x3bedc8,null));};exports[_0x972e('0x4a')]=function(_0x270339,_0x250dc4,_0x1b22fb){_0x270339['body'][_0x972e('0x27')]=_0x270339[_0x972e('0x4b')]['originalname'];_0x270339['body'][_0x972e('0x4c')]=_0x270339[_0x972e('0x4b')][_0x972e('0x4d')];_0x270339['body'][_0x972e('0x2d')]=_0x270339[_0x972e('0x4b')][_0x972e('0x4e')];return db['Attachment'][_0x972e('0x4a')](_0x270339[_0x972e('0x48')])[_0x972e('0x23')](respondWithResult(_0x250dc4,0xc9))['catch'](handleError(_0x250dc4,null));};exports['download']=function(_0x3919d8,_0x2fb3f7,_0x4e8e75){return db[_0x972e('0x2a')]['findOne']({'where':{'id':_0x3919d8[_0x972e('0x42')]['id']},'raw':!![]})[_0x972e('0x23')](handleEntityNotFound(_0x2fb3f7,null))['then'](function(_0x375323){if(_0x375323){var _0x4e6843=_0x375323[_0x972e('0x4f')]!==null;var _0x5a5ac0=path[_0x972e('0x50')](config[_0x972e('0x51')],'server/files/attachments/');if(_0x4e6843){_0x5a5ac0=path[_0x972e('0x50')](_0x5a5ac0,_0x972e('0x52'));}var _0x284c6d=path['join'](_0x5a5ac0,_0x375323[_0x972e('0x4c')]);return _0x2fb3f7[_0x972e('0x53')](_0x284c6d);}})[_0x972e('0x40')](handleError(_0x2fb3f7,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 9ae68aa..1281382 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 _0x7611=['rimraf','./attachment.attributes','exports','define','attachments','lodash','util','../../config/logger','api','moment'];(function(_0x3eb2f4,_0x51516a){var _0x59fb19=function(_0x1ed9d9){while(--_0x1ed9d9){_0x3eb2f4['push'](_0x3eb2f4['shift']());}};_0x59fb19(++_0x51516a);}(_0x7611,0xaf));var _0x1761=function(_0x925658,_0x35e35d){_0x925658=_0x925658-0x0;var _0x2b9837=_0x7611[_0x925658];return _0x2b9837;};'use strict';var _=require(_0x1761('0x0'));var util=require(_0x1761('0x1'));var logger=require(_0x1761('0x2'))(_0x1761('0x3'));var moment=require(_0x1761('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1761('0x5'));var config=require('../../config/environment');var attributes=require(_0x1761('0x6'));module[_0x1761('0x7')]=function(_0x95a1ed,_0x39d234){return _0x95a1ed[_0x1761('0x8')]('Attachment',attributes,{'tableName':_0x1761('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1a11=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x1a11,0x99));var _0x11a1=function(_0x5d9ab8,_0x18d257){_0x5d9ab8=_0x5d9ab8-0x0;var _0x533d5c=_0x1a11[_0x5d9ab8];return _0x533d5c;};'use strict';var _=require(_0x11a1('0x0'));var util=require(_0x11a1('0x1'));var logger=require(_0x11a1('0x2'))(_0x11a1('0x3'));var moment=require(_0x11a1('0x4'));var BPromise=require(_0x11a1('0x5'));var rp=require(_0x11a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11a1('0x7'));var config=require(_0x11a1('0x8'));var attributes=require(_0x11a1('0x9'));module[_0x11a1('0xa')]=function(_0x5e4906,_0x224847){return _0x5e4906[_0x11a1('0xb')](_0x11a1('0xc'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index 13bf39c..514c35a 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 _0x04d0=['../../mysqldb','rpc','jayson/promise','client','request','then','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','debug','moment','bluebird','randomstring','ioredis'];(function(_0x2f965f,_0x100aca){var _0x73f2b9=function(_0x25705d){while(--_0x25705d){_0x2f965f['push'](_0x2f965f['shift']());}};_0x73f2b9(++_0x100aca);}(_0x04d0,0x10a));var _0x004d=function(_0x27d1a1,_0x252378){_0x27d1a1=_0x27d1a1-0x0;var _0x1225ad=_0x04d0[_0x27d1a1];return _0x1225ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x004d('0x0'));var BPromise=require(_0x004d('0x1'));var rs=require(_0x004d('0x2'));var fs=require('fs');var Redis=require(_0x004d('0x3'));var db=require(_0x004d('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x004d('0x5'));var config=require('../../config/environment');var jayson=require(_0x004d('0x6'));var client=jayson[_0x004d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36e8bd,_0x2da158,_0x4d0ae4){return new BPromise(function(_0x1f0efd,_0x58d4f5){return client[_0x004d('0x8')](_0x36e8bd,_0x4d0ae4)[_0x004d('0x9')](function(_0x2d9da5){logger['info'](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));logger['debug'](_0x004d('0xc'),_0x2da158,'request\x20sent',JSON[_0x004d('0xd')](_0x2d9da5));if(_0x2d9da5[_0x004d('0xe')]){if(_0x2d9da5['error'][_0x004d('0xf')]===0x1f4){logger['error'](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);return _0x58d4f5(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x2d9da5[_0x004d('0xe')]['message']);return _0x1f0efd(_0x2d9da5[_0x004d('0xe')][_0x004d('0x10')]);}else{logger[_0x004d('0x11')](_0x004d('0xa'),_0x2da158,_0x004d('0xb'));_0x1f0efd(_0x2d9da5[_0x004d('0x12')][_0x004d('0x10')]);}})[_0x004d('0x13')](function(_0x5b4f40){logger[_0x004d('0xe')](_0x004d('0xa'),_0x2da158,_0x5b4f40);_0x58d4f5(_0x5b4f40);});});}exports[_0x004d('0x14')]=function(_0x4b3912){var _0x1adf2a=this;return new Promise(function(_0x583196,_0x40de7e){return db[_0x004d('0x15')][_0x004d('0x16')](_0x4b3912[_0x004d('0x17')],{'raw':_0x4b3912['options']?_0x4b3912[_0x004d('0x18')][_0x004d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x31ac5c){logger[_0x004d('0x11')](_0x004d('0x14'),_0x4b3912);logger[_0x004d('0x1a')]('CreateAttachment',_0x4b3912,JSON[_0x004d('0xd')](_0x31ac5c));_0x583196(_0x31ac5c);})[_0x004d('0x13')](function(_0x2da052){logger[_0x004d('0xe')](_0x004d('0x14'),_0x2da052[_0x004d('0x10')],_0x4b3912);_0x40de7e(_0x1adf2a[_0x004d('0xe')](0x1f4,_0x2da052[_0x004d('0x10')]));});});};
\ No newline at end of file
+var _0xb43b=['raw','then','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Attachment,\x20%s,\x20%s','catch','CreateAttachment','Attachment','create','options'];(function(_0xac8c71,_0x26de55){var _0x2fbac1=function(_0x59e466){while(--_0x59e466){_0xac8c71['push'](_0xac8c71['shift']());}};_0x2fbac1(++_0x26de55);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49b487,_0x27137c){_0x49b487=_0x49b487-0x0;var _0x1e04f1=_0xb43b[_0x49b487];return _0x1e04f1;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('Attachment,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}exports[_0xbb43('0x15')]=function(_0x2e3b43){var _0x55dd73=this;return new Promise(function(_0x1c16d7,_0x4f28b8){return db[_0xbb43('0x16')][_0xbb43('0x17')](_0x2e3b43['body'],{'raw':_0x2e3b43['options']?_0x2e3b43[_0xbb43('0x18')][_0xbb43('0x19')]===undefined?!![]:![]:!![]})[_0xbb43('0x1a')](function(_0x2bf2d4){logger['info'](_0xbb43('0x15'),_0x2e3b43);logger['debug'](_0xbb43('0x15'),_0x2e3b43,JSON['stringify'](_0x2bf2d4));_0x1c16d7(_0x2bf2d4);})[_0xbb43('0x14')](function(_0x565256){logger[_0xbb43('0x10')](_0xbb43('0x15'),_0x565256['message'],_0x2e3b43);_0x4f28b8(_0x55dd73[_0xbb43('0x10')](0x1f4,_0x565256['message']));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 2b44543..fb30a56 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 _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x15ccd9,_0x51a714){var _0x1bd6f3=function(_0x17cc0d){while(--_0x17cc0d){_0x15ccd9['push'](_0x15ccd9['shift']());}};_0x1bd6f3(++_0x51a714);}(_0x757a,0xde));var _0xa757=function(_0xd6c5fa,_0x39d0e3){_0xd6c5fa=_0xd6c5fa-0x0;var _0x35d2a1=_0x757a[_0xd6c5fa];return _0x35d2a1;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+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(_0x14ca6e,_0x3cc76a){var _0x3fa76a=function(_0x3bde0b){while(--_0x3bde0b){_0x14ca6e['push'](_0x14ca6e['shift']());}};_0x3fa76a(++_0x3cc76a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3b1082,_0x223695){_0x3b1082=_0x3b1082-0x0;var _0x296714=_0x5f2f[_0x3b1082];return _0x296714;};'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
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 63a3aec..ffe3dd2 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 _0xa994=['../../config/logger','api','activedirectory','undefined','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','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','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','salt','role','disabled','blocked','online','admin','user','domain','blockedAt','add','minutes','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','use','password','passport-local','moment','activedirectory2','bluebird','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa994,0x150));var _0x4a99=function(_0x2d4963,_0x430e5f){_0x2d4963=_0x2d4963-0x0;var _0x3caa5f=_0xa994[_0x2d4963];return _0x3caa5f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x4a99('0x0'))['Strategy'];var moment=require(_0x4a99('0x1'));var ActiveDirectory=require(_0x4a99('0x2'));var BPromise=require(_0x4a99('0x3'));var util=require('util');var db=require('../../mysqldb')['db'];var authService=require(_0x4a99('0x4'));var utils=require(_0x4a99('0x5'));var config=require(_0x4a99('0x6'));var logger=require(_0x4a99('0x7'))(_0x4a99('0x8'));function isActiveDirectoryConfigured(_0x4a0718){var _0x1d03b0=![];if(typeof _0x4a0718[_0x4a99('0x9')]!==_0x4a99('0xa')){_0x1d03b0=_0x4a0718[_0x4a99('0x9')][_0x4a99('0xb')]&&_0x4a0718['activedirectory'][_0x4a99('0xc')]&&_0x4a0718[_0x4a99('0x9')]['domain'];}return _0x1d03b0;}function adAuthenticate(_0xb9ae0b,_0x42b04d,_0x38b46e){return new BPromise(function(_0x2c9291,_0x37ce9b){try{var _0xb6082f=new ActiveDirectory(_0xb9ae0b);_0xb6082f[_0x4a99('0xd')](_0x42b04d,_0x38b46e,function(_0x317ab6,_0xf737c8){if(_0x317ab6){logger[_0x4a99('0xe')](_0x4a99('0xf'),_0x42b04d,util[_0x4a99('0x10')](_0x317ab6,{'showHidden':![],'depth':null}));_0x37ce9b(_0x4a99('0x11'));}else if(!_0xf737c8){logger[_0x4a99('0xe')](_0x4a99('0x12'),_0x42b04d);_0x37ce9b(_0x4a99('0x11'));}else{_0x2c9291(_0xf737c8);}});}catch(_0x450525){_0x37ce9b(_0x450525);}});}function ActiveDirectoryAuthenticate(_0x83eed8,_0x3712bd,_0x4668db,_0x225f5a){var _0x6c53da,_0x1d7861;if(!isActiveDirectoryConfigured(config)){logger[_0x4a99('0xe')](_0x4a99('0x13'),_0x3712bd);return _0x225f5a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x4a99('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x4a99('0x15'),_0x4a99('0x16')],'raw':!![]})[_0x4a99('0x17')](function(_0x3e8f8c){_0x6c53da=_0x3e8f8c;if(!_0x6c53da[_0x4a99('0x15')]){logger[_0x4a99('0xe')](_0x4a99('0x18'),_0x3712bd);throw new Error(_0x4a99('0x11'));}return _0x83eed8[_0x4a99('0x19')]({'attributes':['id',_0x4a99('0x1a'),'password',_0x4a99('0x1b'),_0x4a99('0x1c'),_0x4a99('0x1d'),_0x4a99('0x1e'),'blockedAt',_0x4a99('0x1f')],'where':{'name':_0x3712bd,'role':{'$or':[_0x4a99('0x20'),_0x4a99('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0x4a99('0x17')](function(_0x4ef9bc){if(!_0x4ef9bc||_0x4ef9bc&&_0x4ef9bc[_0x4a99('0x1a')]!==_0x3712bd){throw new Error(_0x4a99('0x11'));}_0x1d7861=_0x4ef9bc;var _0x337f64=_0x1d7861[_0x4a99('0x1a')]+'@'+config['activedirectory'][_0x4a99('0x22')];return adAuthenticate(config[_0x4a99('0x9')],_0x337f64,_0x4668db);})[_0x4a99('0x17')](function(_0x16bb62){if(_0x1d7861[_0x4a99('0x1d')]){throw new Error(_0x4a99('0x11'));}if(_0x6c53da['blockDuration']>0x0){if(_0x1d7861[_0x4a99('0x1e')]){if(moment(_0x1d7861[_0x4a99('0x23')])[_0x4a99('0x24')](_0x6c53da[_0x4a99('0x16')],_0x4a99('0x25'))>moment()){throw new Error(_0x4a99('0x11'));}return utils[_0x4a99('0x26')](_0x1d7861,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1d7861);})['then'](function(){return _0x225f5a(null,_0x1d7861);});}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}}else{return utils[_0x4a99('0x27')](_0x1d7861)[_0x4a99('0x17')](function(){return _0x225f5a(null,_0x1d7861);});}})[_0x4a99('0x28')](function(_0x35a67e){return _0x225f5a(null,![],_0x35a67e);});}function handleError(_0x63d9f7,_0x429529,_0x41a01c){return _0x63d9f7['status'](_0x429529||0x1f4)[_0x4a99('0x29')]({'message':_0x41a01c?_0x41a01c[_0x4a99('0x2a')]||_0x41a01c:''});}exports[_0x4a99('0x2b')]=function(_0x45e34f,_0x552851,_0x1e0b64){passport['authenticate'](_0x4a99('0x2c'),function(_0x16f7e8,_0x1e85bc,_0x21b4a3){var _0x4e3670=_0x16f7e8||_0x21b4a3;if(_0x4e3670){return handleError(_0x552851,0x191,_0x4e3670);}if(!_0x1e85bc){return handleError(_0x552851,0x194,{'message':_0x4a99('0x2d')});}else{var _0x325608={'payload':{'id':_0x1e85bc['id'],'role':_0x1e85bc['role']},'options':{'expiresIn':0x15180}};return authService[_0x4a99('0x2e')](_0x325608)[_0x4a99('0x17')](function(_0x423696){_0x552851['json']({'id':_0x1e85bc['id'],'token':_0x423696,'statusCall':'','isAlreadyLogged':_0x1e85bc[_0x4a99('0x1f')]});});}})(_0x45e34f,_0x552851,_0x1e0b64);};passport[_0x4a99('0x2f')](_0x4a99('0x2c'),new LocalStrategy({'usernameField':_0x4a99('0x1a'),'passwordField':_0x4a99('0x30')},function(_0x1ba1a1,_0x30b58a,_0x53cb41){return ActiveDirectoryAuthenticate(db['User'],_0x1ba1a1,_0x30b58a,_0x53cb41);}));
\ No newline at end of file
+var _0x7f52=['online','admin','user','agent','add','minutes','clearBlockUser','then','getLicense','catch','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','use','User','passport','passport-local','Strategy','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','findOne','blockDuration','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7f52,0x1cc));var _0x27f5=function(_0x51486a,_0x250856){_0x51486a=_0x51486a-0x0;var _0x7756d9=_0x7f52[_0x51486a];return _0x7756d9;};'use strict';var passport=require(_0x27f5('0x0'));var LocalStrategy=require(_0x27f5('0x1'))[_0x27f5('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x27f5('0x3'));var util=require(_0x27f5('0x4'));var db=require(_0x27f5('0x5'))['db'];var authService=require(_0x27f5('0x6'));var utils=require(_0x27f5('0x7'));var config=require(_0x27f5('0x8'));var logger=require('../../config/logger')(_0x27f5('0x9'));function isActiveDirectoryConfigured(_0xe0e8c3){var _0x57aca7=![];if(typeof _0xe0e8c3[_0x27f5('0xa')]!==_0x27f5('0xb')){_0x57aca7=_0xe0e8c3['activedirectory'][_0x27f5('0xc')]&&_0xe0e8c3[_0x27f5('0xa')][_0x27f5('0xd')]&&_0xe0e8c3[_0x27f5('0xa')][_0x27f5('0xe')];}return _0x57aca7;}function adAuthenticate(_0x19d7b5,_0x681fbc,_0xf7fe12){return new BPromise(function(_0x105ae5,_0x3f2d23){try{var _0x103fdb=new ActiveDirectory(_0x19d7b5);_0x103fdb[_0x27f5('0xf')](_0x681fbc,_0xf7fe12,function(_0x5cdbf2,_0x5cd642){if(_0x5cdbf2){logger[_0x27f5('0x10')](_0x27f5('0x11'),_0x681fbc,util[_0x27f5('0x12')](_0x5cdbf2,{'showHidden':![],'depth':null}));_0x3f2d23(_0x27f5('0x13'));}else if(!_0x5cd642){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x681fbc);_0x3f2d23(_0x27f5('0x13'));}else{_0x105ae5(_0x5cd642);}});}catch(_0x4b3a95){_0x3f2d23(_0x4b3a95);}});}function ActiveDirectoryAuthenticate(_0x338020,_0x52027a,_0x4dabd2,_0xf7830e){var _0xcc2e59,_0x486ffa;if(!isActiveDirectoryConfigured(config)){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x52027a);return _0xf7830e(null,![],{'message':_0x27f5('0x13')});}return db['Setting'][_0x27f5('0x14')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x27f5('0x15')],'raw':!![]})['then'](function(_0x492a34){_0xcc2e59=_0x492a34;if(!_0xcc2e59[_0x27f5('0x16')]){logger[_0x27f5('0x10')](_0x27f5('0x17'),_0x52027a);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x338020[_0x27f5('0x14')]({'attributes':['id',_0x27f5('0x18'),_0x27f5('0x19'),_0x27f5('0x1a'),'role',_0x27f5('0x1b'),_0x27f5('0x1c'),_0x27f5('0x1d'),_0x27f5('0x1e')],'where':{'name':_0x52027a,'role':{'$or':[_0x27f5('0x1f'),_0x27f5('0x20'),_0x27f5('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x307fcc){if(!_0x307fcc||_0x307fcc&&_0x307fcc[_0x27f5('0x18')]!==_0x52027a){throw new Error(_0x27f5('0x13'));}_0x486ffa=_0x307fcc;var _0x284433=_0x486ffa[_0x27f5('0x18')]+'@'+config['activedirectory'][_0x27f5('0xe')];return adAuthenticate(config['activedirectory'],_0x284433,_0x4dabd2);})['then'](function(_0x2c9960){if(_0x486ffa['disabled']){throw new Error(_0x27f5('0x13'));}if(_0xcc2e59[_0x27f5('0x15')]>0x0){if(_0x486ffa[_0x27f5('0x1c')]){if(moment(_0x486ffa[_0x27f5('0x1d')])[_0x27f5('0x22')](_0xcc2e59[_0x27f5('0x15')],_0x27f5('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x27f5('0x24')](_0x486ffa,0x0,![],null)[_0x27f5('0x25')](function(){return utils[_0x27f5('0x26')](_0x486ffa);})[_0x27f5('0x25')](function(){return _0xf7830e(null,_0x486ffa);});}else{return utils[_0x27f5('0x26')](_0x486ffa)['then'](function(){return _0xf7830e(null,_0x486ffa);});}}else{return utils[_0x27f5('0x26')](_0x486ffa)[_0x27f5('0x25')](function(){return _0xf7830e(null,_0x486ffa);});}})[_0x27f5('0x27')](function(_0x5c9eb7){return _0xf7830e(null,![],_0x5c9eb7);});}function handleError(_0x54c352,_0x1c5781,_0x8b041c){return _0x54c352['status'](_0x1c5781||0x1f4)[_0x27f5('0x28')]({'message':_0x8b041c?_0x8b041c[_0x27f5('0x29')]||_0x8b041c:''});}exports[_0x27f5('0x2a')]=function(_0x572edf,_0x400fb5,_0x27ef78){passport['authenticate']('ad-login',function(_0x7bd30a,_0x443f15,_0x265067){var _0x264374=_0x7bd30a||_0x265067;if(_0x264374){return handleError(_0x400fb5,0x191,_0x264374);}if(!_0x443f15){return handleError(_0x400fb5,0x194,{'message':_0x27f5('0x2b')});}else{var _0x16dd14={'payload':{'id':_0x443f15['id'],'role':_0x443f15[_0x27f5('0x2c')]},'options':{'expiresIn':0x15180}};return authService[_0x27f5('0x2d')](_0x16dd14)['then'](function(_0x394048){_0x400fb5[_0x27f5('0x2e')]({'id':_0x443f15['id'],'token':_0x394048,'statusCall':'','isAlreadyLogged':_0x443f15[_0x27f5('0x1e')]});});}})(_0x572edf,_0x400fb5,_0x27ef78);};passport[_0x27f5('0x2f')]('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0x27f5('0x19')},function(_0x509400,_0xcb9087,_0x748660){return ActiveDirectoryAuthenticate(db[_0x27f5('0x30')],_0x509400,_0xcb9087,_0x748660);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 172ef51..cb9720e 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 _0x41fc=['./authActiveDirectory.controller','login','exports'];(function(_0x38c27e,_0x469e85){var _0x370bc6=function(_0x2f92f2){while(--_0x2f92f2){_0x38c27e['push'](_0x38c27e['shift']());}};_0x370bc6(++_0x469e85);}(_0x41fc,0x126));var _0xc41f=function(_0x6fbc58,_0x5a2cf1){_0x6fbc58=_0x6fbc58-0x0;var _0x266f48=_0x41fc[_0x6fbc58];return _0x266f48;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xc41f('0x0'));router['post']('/',controller[_0xc41f('0x1')]);module[_0xc41f('0x2')]=router;
\ No newline at end of file
+var _0x84c2=['post','login','exports','express','Router','./authActiveDirectory.controller'];(function(_0x4e1ba7,_0x5311f2){var _0x145c84=function(_0x1b4788){while(--_0x1b4788){_0x4e1ba7['push'](_0x4e1ba7['shift']());}};_0x145c84(++_0x5311f2);}(_0x84c2,0x1a7));var _0x284c=function(_0x396552,_0x532a80){_0x396552=_0x396552-0x0;var _0xb63575=_0x84c2[_0x396552];return _0xb63575;};'use strict';var express=require(_0x284c('0x0'));var router=express[_0x284c('0x1')]();var controller=require(_0x284c('0x2'));router[_0x284c('0x3')]('/',controller[_0x284c('0x4')]);module[_0x284c('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 453381a..ce73e5b 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(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x7a54,0x106));var _0x47a5=function(_0x1c1193,_0x17c294){_0x1c1193=_0x1c1193-0x0;var _0x80047b=_0x7a54[_0x1c1193];return _0x80047b;};'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(_0x213f91,_0x8f3782){var _0x5cf677=function(_0x469754){while(--_0x469754){_0x213f91['push'](_0x213f91['shift']());}};_0x5cf677(++_0x8f3782);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 095e9e5..8a15539 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 _0x43a1=['express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43a1,0x138));var _0x143a=function(_0x21aafd,_0x1f0fa6){_0x21aafd=_0x21aafd-0x0;var _0x9f2800=_0x43a1[_0x21aafd];return _0x9f2800;};'use strict';var express=require(_0x143a('0x0'));var passport=require('passport');var router=express[_0x143a('0x1')]();var controller=require(_0x143a('0x2'));var userController=require(_0x143a('0x3'));var authService=require(_0x143a('0x4'));router[_0x143a('0x5')]('/',controller[_0x143a('0x6')]);router[_0x143a('0x5')](_0x143a('0x7'),controller[_0x143a('0x8')],authService[_0x143a('0x9')],userController[_0x143a('0x6')],authService[_0x143a('0xa')]);module[_0x143a('0xb')]=router;
\ No newline at end of file
+var _0x596c=['get','login','isMiddleware','setTokenCookie','exports','../user/user.controller.js'];(function(_0x5df033,_0x29458b){var _0x445829=function(_0x2c795b){while(--_0x2c795b){_0x5df033['push'](_0x5df033['shift']());}};_0x445829(++_0x29458b);}(_0x596c,0x1cd));var _0xc596=function(_0x55a177,_0x3fed1b){_0x55a177=_0x55a177-0x0;var _0x4196eb=_0x596c[_0x55a177];return _0x4196eb;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0xc596('0x0'));var authService=require('../../components/auth/service');router[_0xc596('0x1')]('/',controller[_0xc596('0x2')]);router['get']('/callback',controller['callback'],authService[_0xc596('0x3')],userController['login'],authService[_0xc596('0x4')]);module[_0xc596('0x5')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index f178a99..37c0c8d 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 _0xb7a0=['stringify','status','login','local-login','signToken','json','online','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','blockedAt','resetPasswordExpires','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','send','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','findOne','name','password','role','disabled','blocked','loginAttempts','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb7a0,0x10c));var _0x0b7a=function(_0x330106,_0x4e50d9){_0x330106=_0x330106-0x0;var _0x492d1c=_0xb7a0[_0x330106];return _0x492d1c;};'use strict';var util=require(_0x0b7a('0x0'));var passport=require(_0x0b7a('0x1'));var LocalStrategy=require(_0x0b7a('0x2'))['Strategy'];var jayson=require(_0x0b7a('0x3'));var _=require(_0x0b7a('0x4'));var rs=require(_0x0b7a('0x5'));var moment=require(_0x0b7a('0x6'));var db=require(_0x0b7a('0x7'))['db'];var authService=require(_0x0b7a('0x8'));var utils=require(_0x0b7a('0x9'));var client=jayson[_0x0b7a('0xa')][_0x0b7a('0xb')]({'port':0x232b});function localAuthenticate(_0x6aa89b,_0x2b2f42,_0x1c32ec,_0x49b1a9){var _0x56b29a,_0x596961;return db[_0x0b7a('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x10e314){_0x56b29a=_0x10e314;return _0x6aa89b[_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0xf'),_0x0b7a('0x10'),'salt',_0x0b7a('0x11'),_0x0b7a('0x12'),_0x0b7a('0x13'),'blockedAt',_0x0b7a('0x14')],'where':{'name':_0x2b2f42,'role':{'$or':['admin',_0x0b7a('0x15'),_0x0b7a('0x16')]}}});})[_0x0b7a('0x17')](function(_0x29dcee){if(!_0x29dcee||_0x29dcee&&_0x29dcee['name']!==_0x2b2f42){throw new Error(_0x0b7a('0x18'));}else{_0x596961=_0x29dcee;return _0x596961;}})[_0x0b7a('0x17')](function(){_0x596961[_0x0b7a('0x19')](_0x1c32ec,function(_0xdb3481,_0x5cc395){var _0x38e9b0=_0x596961[_0x0b7a('0x14')]+0x1;if(_0xdb3481){return _0x49b1a9(_0xdb3481);}else if(!_0x5cc395){if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])[_0x0b7a('0x1b')](_0x56b29a[_0x0b7a('0x1a')],'minutes')>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)['then'](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x38e9b0>=_0x56b29a[_0x0b7a('0xd')]){return utils[_0x0b7a('0x1c')](_0x596961,0x0,!![],moment())['then'](function(){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0b7a('0x1c')](_0x596961,_0x38e9b0,![],null)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});});}}}else{return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}}else{if(_0x596961[_0x0b7a('0x12')]){return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x56b29a[_0x0b7a('0xd')]>0x0){if(_0x596961[_0x0b7a('0x13')]){if(_0x56b29a[_0x0b7a('0x1a')]>0x0){if(moment(_0x596961['blockedAt'])['add'](_0x56b29a[_0x0b7a('0x1a')],_0x0b7a('0x1d'))>moment()){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)[_0x0b7a('0x17')](function(){return utils[_0x0b7a('0x1e')](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}else{return _0x49b1a9(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x0b7a('0x1c')](_0x596961,0x0,![],null)['then'](function(){return utils['getLicense'](_0x596961);})[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);})['catch'](function(_0x3221e8){return _0x49b1a9(null,![],_0x3221e8);});}}else{if(_0x596961[_0x0b7a('0x13')]){return _0x49b1a9(null,![],{'message':_0x0b7a('0x18')});}else{return utils[_0x0b7a('0x1e')](_0x596961)[_0x0b7a('0x17')](function(){return _0x49b1a9(null,_0x596961);});}}}});})[_0x0b7a('0x1f')](function(_0x24f52f){return _0x49b1a9(null,![],_0x24f52f);});}function sendServiceMail(_0x3664a2){return db[_0x0b7a('0x20')][_0x0b7a('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0x0b7a('0x22')],'include':[{'model':db['MailServerOut'],'as':_0x0b7a('0x23'),'include':[{'model':db[_0x0b7a('0x24')],'as':_0x0b7a('0x24')}]}]})[_0x0b7a('0x17')](function(_0x39a742){if(!_0x39a742){throw new Error(_0x0b7a('0x25'));}var _0x1f4e08=_0x39a742['getSmtpOptions']();var _0x55c0ee={'account':_0x1f4e08,'message':_['merge']({'from':util[_0x0b7a('0x26')](_0x0b7a('0x27'),_0x39a742[_0x0b7a('0xf')],_0x39a742['email']||_0x39a742[_0x0b7a('0x23')]['user'])},_0x3664a2)};return client['request'](_0x0b7a('0x28'),_0x55c0ee);})[_0x0b7a('0x17')](function(_0x2d127d){if(_0x2d127d[_0x0b7a('0x29')]){throw new Error(util[_0x0b7a('0x26')](_0x0b7a('0x2a'),_0x2d127d['error'][_0x0b7a('0x2b')]||JSON[_0x0b7a('0x2c')](_0x2d127d[_0x0b7a('0x29')])));}return!![];});}function handleError(_0x101b2c,_0x4605a1,_0x107f6c){return _0x101b2c[_0x0b7a('0x2d')](_0x4605a1||0x1f4)['send']({'message':_0x107f6c?_0x107f6c[_0x0b7a('0x2b')]||_0x107f6c:''});}exports[_0x0b7a('0x2e')]=function(_0x37f9ba,_0x12cd22,_0x4e37d9){passport[_0x0b7a('0x19')](_0x0b7a('0x2f'),function(_0x574d28,_0x14167c,_0x2c9388){var _0x11282d=_0x574d28||_0x2c9388;if(_0x11282d){return handleError(_0x12cd22,0x191,_0x11282d);}if(!_0x14167c){return handleError(_0x12cd22,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x116fa0={'payload':{'id':_0x14167c['id'],'role':_0x14167c[_0x0b7a('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x0b7a('0x30')](_0x116fa0)[_0x0b7a('0x17')](function(_0x147c2a){_0x12cd22[_0x0b7a('0x31')]({'id':_0x14167c['id'],'token':_0x147c2a,'statusCall':'','isAlreadyLogged':_0x14167c[_0x0b7a('0x32')]});});}})(_0x37f9ba,_0x12cd22,_0x4e37d9);};exports['forgot']=function(_0x4eb8f1,_0x219779){if(!_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]){return handleError(_0x219779,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xff414a=rs[_0x0b7a('0x34')]();_0x4eb8f1[_0x0b7a('0x33')]['email']=_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')][_0x0b7a('0x35')]()['toLowerCase']();var _0x44f3a5;return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'where':{'id':0x1},'attributes':[_0x0b7a('0xd'),_0x0b7a('0x1a')],'raw':!![]})['then'](function(_0x37d0a1){_0x44f3a5=_0x37d0a1;return db[_0x0b7a('0x36')]['find']({'where':{'email':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')]}});})['then'](function(_0x24d53e){if(!_0x24d53e){throw new Error(_0x0b7a('0x37'));}if(_0x24d53e['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x24d53e[_0x0b7a('0x13')]){if(moment(_0x24d53e['blockedAt'])[_0x0b7a('0x1b')](_0x44f3a5['blockDuration'],_0x0b7a('0x1d'))>moment()){throw new Error(_0x0b7a('0x38'));}else{_0x24d53e[_0x0b7a('0x13')]=![];_0x24d53e[_0x0b7a('0x39')]=null;}}_0x24d53e['resetPasswordToken']=_0xff414a;_0x24d53e[_0x0b7a('0x3a')]=Date['now']()+0x36ee80;return _0x24d53e[_0x0b7a('0x3b')]();})[_0x0b7a('0x17')](function(){return sendServiceMail({'to':_0x4eb8f1[_0x0b7a('0x33')][_0x0b7a('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x0b7a('0x3c')+_0x0b7a('0x3d')+_0x0b7a('0x3e')+_0x4eb8f1['headers']['host']+'/reset/'+_0xff414a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x0b7a('0x17')](function(){_0x219779[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':'Reset\x20Email\x20sent!'});})[_0x0b7a('0x1f')](function(_0xf3d61d){return handleError(_0x219779,0x1f4,_0xf3d61d);});};exports[_0x0b7a('0x40')]=function(_0x32db6b,_0x5e99c2){return db[_0x0b7a('0x36')][_0x0b7a('0x21')]({'where':{'resetPasswordToken':_0x32db6b[_0x0b7a('0x41')][_0x0b7a('0x42')],'resetPasswordExpires':{'$gt':Date[_0x0b7a('0x43')]()}}})[_0x0b7a('0x17')](function(_0x13c8f0){if(!_0x13c8f0){throw new Error(_0x0b7a('0x44'));}return db[_0x0b7a('0xc')][_0x0b7a('0xe')]({'attributes':['id',_0x0b7a('0x45'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x0b7a('0x17')](function(_0x59ad57){if(_0x59ad57[_0x0b7a('0x45')])authService[_0x0b7a('0x46')](_0x32db6b[_0x0b7a('0x33')]['password']);if(!_0x59ad57[_0x0b7a('0x47')]||!_0x13c8f0[_0x0b7a('0x48')])return _0x13c8f0;authService[_0x0b7a('0x49')](_0x32db6b['body'][_0x0b7a('0x10')],_0x13c8f0[_0x0b7a('0x48')],_0x59ad57[_0x0b7a('0x4a')]);return _0x13c8f0;})[_0x0b7a('0x17')](function(){_0x13c8f0[_0x0b7a('0x10')]=_0x32db6b['body'][_0x0b7a('0x10')];_0x13c8f0[_0x0b7a('0x4b')]=null;_0x13c8f0[_0x0b7a('0x3a')]=null;return _0x13c8f0['save']();});})['then'](function(){_0x5e99c2[_0x0b7a('0x2d')](0xc8)[_0x0b7a('0x3f')]({'message':_0x0b7a('0x4c')});})['catch'](function(_0x2c1b85){return handleError(_0x5e99c2,0x1f4,_0x2c1b85);});};passport[_0x0b7a('0x4d')](_0x0b7a('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x561a3c,_0x4cfcde,_0x2ceddb){return localAuthenticate(db['User'],_0x561a3c,_0x4cfcde,_0x2ceddb);}));
\ No newline at end of file
+var _0x9d46=['format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','message','stringify','status','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','blockedAt','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','password','salt','role','disabled','loginAttempts','admin','user','agent','then','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','catch','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge'];(function(_0x34e29e,_0x3d6df5){var _0x4d0088=function(_0x317af6){while(--_0x317af6){_0x34e29e['push'](_0x34e29e['shift']());}};_0x4d0088(++_0x3d6df5);}(_0x9d46,0xe1));var _0x69d4=function(_0x17c92d,_0x571d35){_0x17c92d=_0x17c92d-0x0;var _0x2f26ba=_0x9d46[_0x17c92d];return _0x2f26ba;};'use strict';var util=require(_0x69d4('0x0'));var passport=require(_0x69d4('0x1'));var LocalStrategy=require(_0x69d4('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x69d4('0x3'));var rs=require(_0x69d4('0x4'));var moment=require('moment');var db=require(_0x69d4('0x5'))['db'];var authService=require(_0x69d4('0x6'));var utils=require(_0x69d4('0x7'));var client=jayson[_0x69d4('0x8')][_0x69d4('0x9')]({'port':0x232b});function localAuthenticate(_0x19db4c,_0x4bf4ab,_0x521088,_0x2205f8){var _0x2626ef,_0x47edc5;return db['Setting'][_0x69d4('0xa')]({'where':{'id':0x1},'attributes':[_0x69d4('0xb'),_0x69d4('0xc')],'raw':!![]})['then'](function(_0x13ec19){_0x2626ef=_0x13ec19;return _0x19db4c[_0x69d4('0xa')]({'attributes':['id','name',_0x69d4('0xd'),_0x69d4('0xe'),_0x69d4('0xf'),_0x69d4('0x10'),'blocked','blockedAt',_0x69d4('0x11')],'where':{'name':_0x4bf4ab,'role':{'$or':[_0x69d4('0x12'),_0x69d4('0x13'),_0x69d4('0x14')]}}});})[_0x69d4('0x15')](function(_0x206021){if(!_0x206021||_0x206021&&_0x206021[_0x69d4('0x16')]!==_0x4bf4ab){throw new Error(_0x69d4('0x17'));}else{_0x47edc5=_0x206021;return _0x47edc5;}})[_0x69d4('0x15')](function(){_0x47edc5['authenticate'](_0x521088,function(_0x325da1,_0x512639){var _0x3c1243=_0x47edc5['loginAttempts']+0x1;if(_0x325da1){return _0x2205f8(_0x325da1);}else if(!_0x512639){if(_0x47edc5[_0x69d4('0x10')]){return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2626ef[_0x69d4('0xb')]>0x0){if(_0x47edc5[_0x69d4('0x18')]){if(_0x2626ef['blockDuration']>0x0){if(moment(_0x47edc5['blockedAt'])['add'](_0x2626ef[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils[_0x69d4('0x1a')](_0x47edc5,_0x3c1243,![],null)[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}}else{if(_0x3c1243>=_0x2626ef[_0x69d4('0xb')]){return utils[_0x69d4('0x1a')](_0x47edc5,0x0,!![],moment())[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});});}else{return utils[_0x69d4('0x1a')](_0x47edc5,_0x3c1243,![],null)[_0x69d4('0x15')](function(){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});});}}}else{return _0x2205f8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x47edc5[_0x69d4('0x10')]){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else if(_0x2626ef[_0x69d4('0xb')]>0x0){if(_0x47edc5[_0x69d4('0x18')]){if(_0x2626ef[_0x69d4('0xc')]>0x0){if(moment(_0x47edc5['blockedAt'])['add'](_0x2626ef[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils['clearBlockUser'](_0x47edc5,0x0,![],null)[_0x69d4('0x15')](function(){return utils[_0x69d4('0x1b')](_0x47edc5);})['then'](function(){return _0x2205f8(null,_0x47edc5);});}}else{return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}}else{return utils['clearBlockUser'](_0x47edc5,0x0,![],null)['then'](function(){return utils[_0x69d4('0x1b')](_0x47edc5);})[_0x69d4('0x15')](function(){return _0x2205f8(null,_0x47edc5);})[_0x69d4('0x1c')](function(_0x2fb2e2){return _0x2205f8(null,![],_0x2fb2e2);});}}else{if(_0x47edc5[_0x69d4('0x18')]){return _0x2205f8(null,![],{'message':_0x69d4('0x17')});}else{return utils[_0x69d4('0x1b')](_0x47edc5)['then'](function(){return _0x2205f8(null,_0x47edc5);});}}}});})[_0x69d4('0x1c')](function(_0x108c49){return _0x2205f8(null,![],_0x108c49);});}function sendServiceMail(_0x3040bd){return db['MailAccount'][_0x69d4('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0x69d4('0x1e')],'include':[{'model':db[_0x69d4('0x1f')],'as':'Smtp','include':[{'model':db[_0x69d4('0x20')],'as':_0x69d4('0x20')}]}]})[_0x69d4('0x15')](function(_0x3d4e4a){if(!_0x3d4e4a){throw new Error(_0x69d4('0x21'));}var _0x4ebb7c=_0x3d4e4a[_0x69d4('0x22')]();var _0xe118d0={'account':_0x4ebb7c,'message':_[_0x69d4('0x23')]({'from':util[_0x69d4('0x24')](_0x69d4('0x25'),_0x3d4e4a[_0x69d4('0x16')],_0x3d4e4a[_0x69d4('0x1e')]||_0x3d4e4a[_0x69d4('0x26')]['user'])},_0x3040bd)};return client[_0x69d4('0x27')](_0x69d4('0x28'),_0xe118d0);})['then'](function(_0x192bd8){if(_0x192bd8[_0x69d4('0x29')]){throw new Error(util[_0x69d4('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x192bd8['error'][_0x69d4('0x2a')]||JSON[_0x69d4('0x2b')](_0x192bd8[_0x69d4('0x29')])));}return!![];});}function handleError(_0x4145f8,_0x508c63,_0x4e34b7){return _0x4145f8[_0x69d4('0x2c')](_0x508c63||0x1f4)['send']({'message':_0x4e34b7?_0x4e34b7[_0x69d4('0x2a')]||_0x4e34b7:''});}exports[_0x69d4('0x2d')]=function(_0x19dd84,_0x13adbb,_0x54b74e){passport[_0x69d4('0x2e')](_0x69d4('0x2f'),function(_0x323a9c,_0x1604f6,_0x411495){var _0x3f0f7d=_0x323a9c||_0x411495;if(_0x3f0f7d){return handleError(_0x13adbb,0x191,_0x3f0f7d);}if(!_0x1604f6){return handleError(_0x13adbb,0x194,{'message':_0x69d4('0x30')});}else{var _0x23859a={'payload':{'id':_0x1604f6['id'],'role':_0x1604f6[_0x69d4('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x69d4('0x31')](_0x23859a)[_0x69d4('0x15')](function(_0x4ef0a1){_0x13adbb[_0x69d4('0x32')]({'id':_0x1604f6['id'],'token':_0x4ef0a1,'statusCall':'','isAlreadyLogged':_0x1604f6[_0x69d4('0x33')]});});}})(_0x19dd84,_0x13adbb,_0x54b74e);};exports[_0x69d4('0x34')]=function(_0x18077e,_0x809a53){if(!_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')]){return handleError(_0x809a53,0x1f4,{'message':_0x69d4('0x36')});}var _0x5117b3=rs[_0x69d4('0x37')]();_0x18077e['body'][_0x69d4('0x1e')]=_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')][_0x69d4('0x38')]()[_0x69d4('0x39')]();var _0x2773b0;return db[_0x69d4('0x3a')][_0x69d4('0xa')]({'where':{'id':0x1},'attributes':[_0x69d4('0xb'),'blockDuration'],'raw':!![]})[_0x69d4('0x15')](function(_0x1e8b6f){_0x2773b0=_0x1e8b6f;return db[_0x69d4('0x3b')][_0x69d4('0x1d')]({'where':{'email':_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')]}});})[_0x69d4('0x15')](function(_0x1bba89){if(!_0x1bba89){throw new Error(_0x69d4('0x3c'));}if(_0x1bba89[_0x69d4('0x10')]){throw new Error(_0x69d4('0x3d'));}if(_0x1bba89['blocked']){if(moment(_0x1bba89[_0x69d4('0x3e')])[_0x69d4('0x3f')](_0x2773b0[_0x69d4('0xc')],_0x69d4('0x19'))>moment()){throw new Error(_0x69d4('0x40'));}else{_0x1bba89[_0x69d4('0x18')]=![];_0x1bba89[_0x69d4('0x3e')]=null;}}_0x1bba89[_0x69d4('0x41')]=_0x5117b3;_0x1bba89[_0x69d4('0x42')]=Date[_0x69d4('0x43')]()+0x36ee80;return _0x1bba89[_0x69d4('0x44')]();})[_0x69d4('0x15')](function(){return sendServiceMail({'to':_0x18077e[_0x69d4('0x35')][_0x69d4('0x1e')],'subject':_0x69d4('0x45'),'text':_0x69d4('0x46')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x18077e[_0x69d4('0x47')]['host']+_0x69d4('0x48')+_0x5117b3+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x69d4('0x15')](function(){_0x809a53[_0x69d4('0x2c')](0xc8)[_0x69d4('0x49')]({'message':_0x69d4('0x4a')});})['catch'](function(_0x3bd64b){return handleError(_0x809a53,0x1f4,_0x3bd64b);});};exports[_0x69d4('0x4b')]=function(_0x585e0d,_0x170f32){return db[_0x69d4('0x3b')][_0x69d4('0x1d')]({'where':{'resetPasswordToken':_0x585e0d[_0x69d4('0x4c')][_0x69d4('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x69d4('0x43')]()}}})[_0x69d4('0x15')](function(_0x3fa2d7){if(!_0x3fa2d7){throw new Error(_0x69d4('0x4e'));}return db['Setting'][_0x69d4('0xa')]({'attributes':['id',_0x69d4('0x4f'),'enforcePasswordHistory',_0x69d4('0x50')]})[_0x69d4('0x15')](function(_0x4237e0){if(_0x4237e0[_0x69d4('0x4f')])authService[_0x69d4('0x51')](_0x585e0d[_0x69d4('0x35')]['password']);if(!_0x4237e0[_0x69d4('0x52')]||!_0x3fa2d7['previousPasswords'])return _0x3fa2d7;authService[_0x69d4('0x53')](_0x585e0d[_0x69d4('0x35')][_0x69d4('0xd')],_0x3fa2d7[_0x69d4('0x54')],_0x4237e0[_0x69d4('0x50')]);return _0x3fa2d7;})['then'](function(){_0x3fa2d7[_0x69d4('0xd')]=_0x585e0d[_0x69d4('0x35')][_0x69d4('0xd')];_0x3fa2d7[_0x69d4('0x41')]=null;_0x3fa2d7[_0x69d4('0x42')]=null;return _0x3fa2d7['save']();});})[_0x69d4('0x15')](function(){_0x170f32[_0x69d4('0x2c')](0xc8)[_0x69d4('0x49')]({'message':_0x69d4('0x55')});})[_0x69d4('0x1c')](function(_0x4eebb9){return handleError(_0x170f32,0x1f4,_0x4eebb9);});};passport[_0x69d4('0x56')](_0x69d4('0x2f'),new LocalStrategy({'usernameField':_0x69d4('0x16'),'passwordField':_0x69d4('0xd')},function(_0x433b19,_0x2a007a,_0x883f2f){return localAuthenticate(db[_0x69d4('0x3b')],_0x433b19,_0x2a007a,_0x883f2f);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 21d45e5..66d9d6c 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 _0x2724=['Router','post','/forgot','forgot','reset','express'];(function(_0x36e492,_0x1d8453){var _0x4c8f23=function(_0x22978f){while(--_0x22978f){_0x36e492['push'](_0x36e492['shift']());}};_0x4c8f23(++_0x1d8453);}(_0x2724,0xe9));var _0x4272=function(_0xd42c57,_0x295663){_0xd42c57=_0xd42c57-0x0;var _0x43e989=_0x2724[_0xd42c57];return _0x43e989;};'use strict';var express=require(_0x4272('0x0'));var router=express[_0x4272('0x1')]();var controller=require('./authLocal.controller');router[_0x4272('0x2')]('/',controller['login']);router[_0x4272('0x2')](_0x4272('0x3'),controller[_0x4272('0x4')]);router[_0x4272('0x2')]('/reset/:token',controller[_0x4272('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x593a=['login','/forgot','forgot','reset','./authLocal.controller','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x593a,0x6a));var _0xa593=function(_0xf6842c,_0x5aaeb8){_0xf6842c=_0xf6842c-0x0;var _0x446268=_0x593a[_0xf6842c];return _0x446268;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xa593('0x0'));router[_0xa593('0x1')]('/',controller[_0xa593('0x2')]);router[_0xa593('0x1')](_0xa593('0x3'),controller[_0xa593('0x4')]);router[_0xa593('0x1')]('/reset/:token',controller[_0xa593('0x5')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 9c1e68b..556335f 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 _0x92b5=['STRING','INTEGER','exports'];(function(_0x41225c,_0x2c4c94){var _0xb75a5f=function(_0x5c34a0){while(--_0x5c34a0){_0x41225c['push'](_0x41225c['shift']());}};_0xb75a5f(++_0x2c4c94);}(_0x92b5,0x6b));var _0x592b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x92b5[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require('sequelize');module[_0x592b('0x0')]={'name':{'type':Sequelize[_0x592b('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x592b('0x1')]},'description':{'type':Sequelize[_0x592b('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x592b('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xc02d=['sequelize','exports','STRING','INTEGER'];(function(_0x3c49b5,_0x2fce8e){var _0x146bc9=function(_0x5e4010){while(--_0x5e4010){_0x3c49b5['push'](_0x3c49b5['shift']());}};_0x146bc9(++_0x2fce8e);}(_0xc02d,0x1b0));var _0xdc02=function(_0x552516,_0x33e040){_0x552516=_0x552516-0x0;var _0x533b0a=_0xc02d[_0x552516];return _0x533b0a;};'use strict';var Sequelize=require(_0xdc02('0x0'));module[_0xdc02('0x1')]={'name':{'type':Sequelize[_0xdc02('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xdc02('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xdc02('0x3')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index b49400d..e5d7c6c 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 _0x687f=['index','Automation','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','find','addConditions','ids','omit','getConditions','findOne','pick','addActions','Action','getActions','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','apply','save','update','then','destroy','stack','name','send'];(function(_0x2a3506,_0x4c72c2){var _0x268978=function(_0x365b64){while(--_0x365b64){_0x2a3506['push'](_0x2a3506['shift']());}};_0x268978(++_0x4c72c2);}(_0x687f,0x167));var _0xf687=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x687f[_0x3ba422];return _0x20b5dd;};'use strict';var emlformat=require(_0xf687('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf687('0x1'));var rp=require(_0xf687('0x2'));var moment=require(_0xf687('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf687('0x4'));var util=require(_0xf687('0x5'));var path=require(_0xf687('0x6'));var sox=require(_0xf687('0x7'));var csv=require(_0xf687('0x8'));var ejs=require(_0xf687('0x9'));var fs=require('fs');var fs_extra=require(_0xf687('0xa'));var _=require(_0xf687('0xb'));var squel=require(_0xf687('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf687('0x8'));var querystring=require(_0xf687('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf687('0xe'));var qs=require(_0xf687('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf687('0x10'))('api');var utils=require(_0xf687('0x11'));var config=require(_0xf687('0x12'));var licenseUtil=require(_0xf687('0x13'));var db=require(_0xf687('0x14'))['db'];function respondWithStatusCode(_0x3cbcfc,_0x20ed3b){_0x20ed3b=_0x20ed3b||0xcc;return function(_0x435085){if(_0x435085){return _0x3cbcfc[_0xf687('0x15')](_0x20ed3b);}return _0x3cbcfc['status'](_0x20ed3b)['end']();};}function respondWithResult(_0x2c3e63,_0x52ecce){_0x52ecce=_0x52ecce||0xc8;return function(_0x2c33c8){if(_0x2c33c8){return _0x2c3e63[_0xf687('0x16')](_0x52ecce)[_0xf687('0x17')](_0x2c33c8);}};}function respondWithFilteredResult(_0x199411,_0x3612d8){return function(_0x11428a){if(_0x11428a){var _0x2208f9=typeof _0x3612d8[_0xf687('0x18')]===_0xf687('0x19')&&typeof _0x3612d8['limit']===_0xf687('0x19');var _0x5baf08=_0x11428a[_0xf687('0x1a')];var _0x1ebc99=_0x2208f9?0x0:_0x3612d8['offset'];var _0x289f08=_0x2208f9?_0x11428a[_0xf687('0x1a')]:_0x3612d8[_0xf687('0x18')]+_0x3612d8['limit'];var _0x7fd230;if(_0x289f08>=_0x5baf08){_0x289f08=_0x5baf08;_0x7fd230=0xc8;}else{_0x7fd230=0xce;}_0x199411['status'](_0x7fd230);return _0x199411[_0xf687('0x1b')]('Content-Range',_0x1ebc99+'-'+_0x289f08+'/'+_0x5baf08)[_0xf687('0x17')](_0x11428a);}return null;};}function patchUpdates(_0x208a9a){return function(_0x334449){try{jsonpatch[_0xf687('0x1c')](_0x334449,_0x208a9a,!![]);}catch(_0x4bf07f){return BPromise['reject'](_0x4bf07f);}return _0x334449[_0xf687('0x1d')]();};}function saveUpdates(_0x23c0c0,_0x378ca5){return function(_0x493030){if(_0x493030){return _0x493030[_0xf687('0x1e')](_0x23c0c0)[_0xf687('0x1f')](function(_0x2d326c){return _0x2d326c;});}return null;};}function removeEntity(_0x1b2c4e,_0xa2054a){return function(_0x5dd8c2){if(_0x5dd8c2){return _0x5dd8c2[_0xf687('0x20')]()['then'](function(){_0x1b2c4e[_0xf687('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dfb30,_0x2a0ac8){return function(_0x2ce8d7){if(!_0x2ce8d7){_0x1dfb30[_0xf687('0x15')](0x194);}return _0x2ce8d7;};}function handleError(_0x3efcb4,_0x57b2e0){_0x57b2e0=_0x57b2e0||0x1f4;return function(_0x107bf5){logger['error'](_0x107bf5[_0xf687('0x21')]);if(_0x107bf5[_0xf687('0x22')]){delete _0x107bf5[_0xf687('0x22')];}_0x3efcb4[_0xf687('0x16')](_0x57b2e0)[_0xf687('0x23')](_0x107bf5);};}exports[_0xf687('0x24')]=function(_0x194969,_0x4c8b85){var _0x5ae822={},_0xa7796={},_0x115aac={'count':0x0,'rows':[]};var _0x4c27d3=_['map'](db[_0xf687('0x25')][_0xf687('0x26')],function(_0x1a570f){return{'name':_0x1a570f[_0xf687('0x27')],'type':_0x1a570f['type'][_0xf687('0x28')]};});_0xa7796[_0xf687('0x29')]=_[_0xf687('0x2a')](_0x4c27d3,_0xf687('0x22'));_0xa7796[_0xf687('0x2b')]=_[_0xf687('0x2c')](_0x194969[_0xf687('0x2b')]);_0xa7796['filters']=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],_0xa7796[_0xf687('0x2b')]);_0x5ae822[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0xa7796[_0xf687('0x29')],qs[_0xf687('0x2f')](_0x194969[_0xf687('0x2b')]['fields']));_0x5ae822[_0xf687('0x2e')]=_0x5ae822[_0xf687('0x2e')][_0xf687('0x30')]?_0x5ae822[_0xf687('0x2e')]:_0xa7796[_0xf687('0x29')];if(!_0x194969[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x5ae822['limit']=qs[_0xf687('0x33')](_0x194969[_0xf687('0x2b')][_0xf687('0x33')]);_0x5ae822[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x194969[_0xf687('0x2b')][_0xf687('0x18')]);}_0x5ae822[_0xf687('0x34')]=qs[_0xf687('0x35')](_0x194969['query'][_0xf687('0x35')]);_0x5ae822['where']=qs[_0xf687('0x36')](_['pick'](_0x194969[_0xf687('0x2b')],_0xa7796['filters']),_0x4c27d3);if(_0x194969[_0xf687('0x2b')][_0xf687('0x37')]){_0x5ae822[_0xf687('0x38')]=_[_0xf687('0x39')](_0x5ae822[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x4c27d3,function(_0x87d5ef){if(_0x87d5ef[_0xf687('0x3a')]!==_0xf687('0x3b')){var _0x14c6e6={};_0x14c6e6[_0x87d5ef[_0xf687('0x22')]]={'$like':'%'+_0x194969['query'][_0xf687('0x37')]+'%'};return _0x14c6e6;}})});}_0x5ae822=_[_0xf687('0x39')]({},_0x5ae822,_0x194969[_0xf687('0x3c')]);var _0x2ed544={'where':_0x5ae822[_0xf687('0x38')]};return db[_0xf687('0x25')][_0xf687('0x1a')](_0x2ed544)[_0xf687('0x1f')](function(_0x3c6769){_0x115aac['count']=_0x3c6769;if(_0x194969['query'][_0xf687('0x3d')]){_0x5ae822[_0xf687('0x3e')]=[{'all':!![]}];}return db[_0xf687('0x25')][_0xf687('0x3f')](_0x5ae822);})[_0xf687('0x1f')](function(_0x39f98c){_0x115aac['rows']=_0x39f98c;return _0x115aac;})['then'](respondWithFilteredResult(_0x4c8b85,_0x5ae822))['catch'](handleError(_0x4c8b85,null));};exports[_0xf687('0x40')]=function(_0x197489,_0xbfd120){var _0x481639={'raw':![],'where':{'id':_0x197489[_0xf687('0x41')]['id']}},_0x9a13ba={};_0x9a13ba['model']=_[_0xf687('0x2c')](db['Automation'][_0xf687('0x26')]);_0x9a13ba['query']=_[_0xf687('0x2c')](_0x197489['query']);_0x9a13ba[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x9a13ba[_0xf687('0x29')],_0x9a13ba[_0xf687('0x2b')]);_0x481639['attributes']=_[_0xf687('0x2d')](_0x9a13ba['model'],qs[_0xf687('0x2f')](_0x197489[_0xf687('0x2b')][_0xf687('0x2f')]));_0x481639['attributes']=_0x481639[_0xf687('0x2e')][_0xf687('0x30')]?_0x481639[_0xf687('0x2e')]:_0x9a13ba['model'];if(_0x197489[_0xf687('0x2b')]['includeAll']){_0x481639[_0xf687('0x3e')]=[{'all':!![]}];}_0x481639=_[_0xf687('0x39')]({},_0x481639,_0x197489[_0xf687('0x3c')]);return db[_0xf687('0x25')]['find'](_0x481639)['then'](handleEntityNotFound(_0xbfd120,null))[_0xf687('0x1f')](respondWithResult(_0xbfd120,null))[_0xf687('0x42')](handleError(_0xbfd120,null));};exports['create']=function(_0x3fcd53,_0x51c72e){return db['Automation'][_0xf687('0x43')](_0x3fcd53[_0xf687('0x44')],{})['then'](respondWithResult(_0x51c72e,0xc9))['catch'](handleError(_0x51c72e,null));};exports['update']=function(_0xe74dbb,_0x23beb9){if(_0xe74dbb[_0xf687('0x44')]['id']){delete _0xe74dbb[_0xf687('0x44')]['id'];}return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0xe74dbb[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x23beb9,null))[_0xf687('0x1f')](saveUpdates(_0xe74dbb[_0xf687('0x44')],null))[_0xf687('0x1f')](respondWithResult(_0x23beb9,null))[_0xf687('0x42')](handleError(_0x23beb9,null));};exports[_0xf687('0x20')]=function(_0x334ce5,_0x5c9020){return db[_0xf687('0x25')][_0xf687('0x45')]({'where':{'id':_0x334ce5[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5c9020,null))[_0xf687('0x1f')](removeEntity(_0x5c9020,null))[_0xf687('0x42')](handleError(_0x5c9020,null));};exports[_0xf687('0x46')]=function(_0x195eca,_0x495825,_0xe5ea9b){return db['Condition'][_0xf687('0x45')]({'where':{'id':_0x195eca[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x495825,null))[_0xf687('0x1f')](function(_0x488a89){if(_0x488a89){return _0x488a89[_0xf687('0x46')](_0x195eca[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x195eca[_0xf687('0x44')],['ids','id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x495825,null))[_0xf687('0x42')](handleError(_0x495825,null));};exports[_0xf687('0x49')]=function(_0x384fce,_0x1f9c87,_0x37b234){var _0x3dab11={};var _0x5151ed={};var _0xa04736;var _0x49d8bc;return db[_0xf687('0x25')][_0xf687('0x4a')]({'where':{'id':_0x384fce['params']['id']}})['then'](handleEntityNotFound(_0x1f9c87,null))[_0xf687('0x1f')](function(_0x5ed6e2){if(_0x5ed6e2){_0xa04736=_0x5ed6e2;_0x5151ed[_0xf687('0x29')]=_[_0xf687('0x2c')](db['Condition'][_0xf687('0x26')]);_0x5151ed[_0xf687('0x2b')]=_['keys'](_0x384fce[_0xf687('0x2b')]);_0x5151ed['filters']=_[_0xf687('0x2d')](_0x5151ed[_0xf687('0x29')],_0x5151ed[_0xf687('0x2b')]);_0x3dab11[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x5151ed['model'],qs[_0xf687('0x2f')](_0x384fce[_0xf687('0x2b')][_0xf687('0x2f')]));_0x3dab11[_0xf687('0x2e')]=_0x3dab11[_0xf687('0x2e')][_0xf687('0x30')]?_0x3dab11[_0xf687('0x2e')]:_0x5151ed['model'];_0x3dab11[_0xf687('0x34')]=qs['sort'](_0x384fce[_0xf687('0x2b')][_0xf687('0x35')]);_0x3dab11[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0x384fce['query'],_0x5151ed['filters']));if(_0x384fce[_0xf687('0x2b')][_0xf687('0x37')]){_0x3dab11[_0xf687('0x38')]=_[_0xf687('0x39')](_0x3dab11[_0xf687('0x38')],{'$or':_[_0xf687('0x2a')](_0x3dab11[_0xf687('0x2e')],function(_0x44491b){var _0x204728={};_0x204728[_0x44491b]={'$like':'%'+_0x384fce[_0xf687('0x2b')]['filter']+'%'};return _0x204728;})});}_0x3dab11=_['merge']({},_0x3dab11,_0x384fce[_0xf687('0x3c')]);return _0xa04736[_0xf687('0x49')](_0x3dab11);}})[_0xf687('0x1f')](function(_0x20b53b){if(_0x20b53b){_0x49d8bc=_0x20b53b[_0xf687('0x30')];if(!_0x384fce['query'][_0xf687('0x31')](_0xf687('0x32'))){_0x3dab11[_0xf687('0x33')]=qs['limit'](_0x384fce[_0xf687('0x2b')][_0xf687('0x33')]);_0x3dab11[_0xf687('0x18')]=qs[_0xf687('0x18')](_0x384fce['query']['offset']);}return _0xa04736[_0xf687('0x49')](_0x3dab11);}})['then'](function(_0x27080f){if(_0x27080f){return _0x27080f?{'count':_0x49d8bc,'rows':_0x27080f}:null;}})['then'](respondWithResult(_0x1f9c87,null))[_0xf687('0x42')](handleError(_0x1f9c87,null));};exports['addActions']=function(_0x5ba658,_0x310e79,_0x410be7){return db['Action'][_0xf687('0x45')]({'where':{'id':_0x5ba658[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x310e79,null))[_0xf687('0x1f')](function(_0x4ad68e){if(_0x4ad68e){return _0x4ad68e[_0xf687('0x4c')](_0x5ba658[_0xf687('0x44')][_0xf687('0x47')],_[_0xf687('0x48')](_0x5ba658[_0xf687('0x44')],[_0xf687('0x47'),'id'])||{});}})[_0xf687('0x1f')](respondWithResult(_0x310e79,null))[_0xf687('0x42')](handleError(_0x310e79,null));};exports['getActions']=function(_0xae8767,_0x5aac27,_0x2013c6){var _0x7d75f={};var _0x226f40={};var _0xee152b;var _0x3102fa;return db[_0xf687('0x25')]['findOne']({'where':{'id':_0xae8767[_0xf687('0x41')]['id']}})[_0xf687('0x1f')](handleEntityNotFound(_0x5aac27,null))[_0xf687('0x1f')](function(_0x5cf5d0){if(_0x5cf5d0){_0xee152b=_0x5cf5d0;_0x226f40['model']=_[_0xf687('0x2c')](db[_0xf687('0x4d')][_0xf687('0x26')]);_0x226f40[_0xf687('0x2b')]=_['keys'](_0xae8767['query']);_0x226f40[_0xf687('0x36')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],_0x226f40['query']);_0x7d75f[_0xf687('0x2e')]=_[_0xf687('0x2d')](_0x226f40[_0xf687('0x29')],qs[_0xf687('0x2f')](_0xae8767[_0xf687('0x2b')][_0xf687('0x2f')]));_0x7d75f['attributes']=_0x7d75f[_0xf687('0x2e')][_0xf687('0x30')]?_0x7d75f['attributes']:_0x226f40['model'];_0x7d75f[_0xf687('0x34')]=qs['sort'](_0xae8767['query']['sort']);_0x7d75f[_0xf687('0x38')]=qs[_0xf687('0x36')](_[_0xf687('0x4b')](_0xae8767[_0xf687('0x2b')],_0x226f40['filters']));if(_0xae8767[_0xf687('0x2b')]['filter']){_0x7d75f[_0xf687('0x38')]=_[_0xf687('0x39')](_0x7d75f[_0xf687('0x38')],{'$or':_['map'](_0x7d75f[_0xf687('0x2e')],function(_0x13f12c){var _0x1e5083={};_0x1e5083[_0x13f12c]={'$like':'%'+_0xae8767[_0xf687('0x2b')][_0xf687('0x37')]+'%'};return _0x1e5083;})});}_0x7d75f=_['merge']({},_0x7d75f,_0xae8767[_0xf687('0x3c')]);return _0xee152b[_0xf687('0x4e')](_0x7d75f);}})['then'](function(_0x5ba918){if(_0x5ba918){_0x3102fa=_0x5ba918[_0xf687('0x30')];if(!_0xae8767[_0xf687('0x2b')][_0xf687('0x31')](_0xf687('0x32'))){_0x7d75f['limit']=qs['limit'](_0xae8767[_0xf687('0x2b')][_0xf687('0x33')]);_0x7d75f[_0xf687('0x18')]=qs[_0xf687('0x18')](_0xae8767['query'][_0xf687('0x18')]);}return _0xee152b['getActions'](_0x7d75f);}})[_0xf687('0x1f')](function(_0x46e88a){if(_0x46e88a){return _0x46e88a?{'count':_0x3102fa,'rows':_0x46e88a}:null;}})[_0xf687('0x1f')](respondWithResult(_0x5aac27,null))[_0xf687('0x42')](handleError(_0x5aac27,null));};
\ No newline at end of file
+var _0x336c=['nolimit','order','sort','where','filter','type','VIRTUAL','merge','include','findAll','rows','catch','show','params','keys','intersection','includeAll','find','create','body','addConditions','Condition','getConditions','findOne','pick','options','addActions','Action','ids','getActions','hasOwnProperty','eml-format','rimraf','request-promise','moment','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','Automation','rawAttributes','fieldName','model','query','filters','attributes','fields','length'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x336c,0x15f));var _0xc336=function(_0x49ae59,_0x52bdd0){_0x49ae59=_0x49ae59-0x0;var _0x3888b8=_0x336c[_0x49ae59];return _0x3888b8;};'use strict';var emlformat=require(_0xc336('0x0'));var rimraf=require(_0xc336('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc336('0x2'));var moment=require(_0xc336('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc336('0x4'));var path=require(_0xc336('0x5'));var sox=require('sox');var csv=require(_0xc336('0x6'));var ejs=require(_0xc336('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc336('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc336('0x9'));var toCsv=require('to-csv');var querystring=require(_0xc336('0xa'));var Papa=require(_0xc336('0xb'));var Redis=require(_0xc336('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc336('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc336('0xe'));var utils=require(_0xc336('0xf'));var config=require(_0xc336('0x10'));var licenseUtil=require(_0xc336('0x11'));var db=require(_0xc336('0x12'))['db'];function respondWithStatusCode(_0x5c891e,_0x351229){_0x351229=_0x351229||0xcc;return function(_0x45302b){if(_0x45302b){return _0x5c891e['sendStatus'](_0x351229);}return _0x5c891e[_0xc336('0x13')](_0x351229)['end']();};}function respondWithResult(_0x97bba0,_0x1b74d5){_0x1b74d5=_0x1b74d5||0xc8;return function(_0x10b59b){if(_0x10b59b){return _0x97bba0[_0xc336('0x13')](_0x1b74d5)[_0xc336('0x14')](_0x10b59b);}};}function respondWithFilteredResult(_0x7b4b08,_0x90b322){return function(_0x552a60){if(_0x552a60){var _0x51c035=typeof _0x90b322[_0xc336('0x15')]===_0xc336('0x16')&&typeof _0x90b322[_0xc336('0x17')]==='undefined';var _0x125592=_0x552a60[_0xc336('0x18')];var _0x330b4c=_0x51c035?0x0:_0x90b322[_0xc336('0x15')];var _0xfff80d=_0x51c035?_0x552a60['count']:_0x90b322['offset']+_0x90b322[_0xc336('0x17')];var _0x1e121f;if(_0xfff80d>=_0x125592){_0xfff80d=_0x125592;_0x1e121f=0xc8;}else{_0x1e121f=0xce;}_0x7b4b08['status'](_0x1e121f);return _0x7b4b08[_0xc336('0x19')](_0xc336('0x1a'),_0x330b4c+'-'+_0xfff80d+'/'+_0x125592)[_0xc336('0x14')](_0x552a60);}return null;};}function patchUpdates(_0x3fcb11){return function(_0x374561){try{jsonpatch[_0xc336('0x1b')](_0x374561,_0x3fcb11,!![]);}catch(_0x1c598e){return BPromise[_0xc336('0x1c')](_0x1c598e);}return _0x374561[_0xc336('0x1d')]();};}function saveUpdates(_0x23129c,_0x5aa78b){return function(_0x43dfc2){if(_0x43dfc2){return _0x43dfc2[_0xc336('0x1e')](_0x23129c)[_0xc336('0x1f')](function(_0x70757c){return _0x70757c;});}return null;};}function removeEntity(_0x21ed12,_0x1b984a){return function(_0x308dd3){if(_0x308dd3){return _0x308dd3[_0xc336('0x20')]()['then'](function(){_0x21ed12[_0xc336('0x13')](0xcc)[_0xc336('0x21')]();});}};}function handleEntityNotFound(_0xad8b07,_0x192ec8){return function(_0x2220ac){if(!_0x2220ac){_0xad8b07[_0xc336('0x22')](0x194);}return _0x2220ac;};}function handleError(_0x50fb52,_0x4e3f96){_0x4e3f96=_0x4e3f96||0x1f4;return function(_0x133baa){logger[_0xc336('0x23')](_0x133baa['stack']);if(_0x133baa[_0xc336('0x24')]){delete _0x133baa['name'];}_0x50fb52['status'](_0x4e3f96)[_0xc336('0x25')](_0x133baa);};}exports[_0xc336('0x26')]=function(_0x3bf1d6,_0x510b09){var _0x296381={},_0x32f0eb={},_0x21b221={'count':0x0,'rows':[]};var _0x1519c6=_[_0xc336('0x27')](db[_0xc336('0x28')][_0xc336('0x29')],function(_0x11dc31){return{'name':_0x11dc31[_0xc336('0x2a')],'type':_0x11dc31['type']['key']};});_0x32f0eb[_0xc336('0x2b')]=_[_0xc336('0x27')](_0x1519c6,_0xc336('0x24'));_0x32f0eb[_0xc336('0x2c')]=_['keys'](_0x3bf1d6['query']);_0x32f0eb[_0xc336('0x2d')]=_['intersection'](_0x32f0eb['model'],_0x32f0eb[_0xc336('0x2c')]);_0x296381[_0xc336('0x2e')]=_['intersection'](_0x32f0eb[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x2f')]));_0x296381[_0xc336('0x2e')]=_0x296381[_0xc336('0x2e')][_0xc336('0x30')]?_0x296381[_0xc336('0x2e')]:_0x32f0eb[_0xc336('0x2b')];if(!_0x3bf1d6[_0xc336('0x2c')]['hasOwnProperty'](_0xc336('0x31'))){_0x296381['limit']=qs[_0xc336('0x17')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x17')]);_0x296381[_0xc336('0x15')]=qs['offset'](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x15')]);}_0x296381[_0xc336('0x32')]=qs[_0xc336('0x33')](_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x33')]);_0x296381[_0xc336('0x34')]=qs[_0xc336('0x2d')](_['pick'](_0x3bf1d6[_0xc336('0x2c')],_0x32f0eb[_0xc336('0x2d')]),_0x1519c6);if(_0x3bf1d6[_0xc336('0x2c')][_0xc336('0x35')]){_0x296381[_0xc336('0x34')]=_['merge'](_0x296381['where'],{'$or':_['map'](_0x1519c6,function(_0x5126b8){if(_0x5126b8[_0xc336('0x36')]!==_0xc336('0x37')){var _0x22f8f8={};_0x22f8f8[_0x5126b8['name']]={'$like':'%'+_0x3bf1d6[_0xc336('0x2c')]['filter']+'%'};return _0x22f8f8;}})});}_0x296381=_[_0xc336('0x38')]({},_0x296381,_0x3bf1d6['options']);var _0x50e964={'where':_0x296381[_0xc336('0x34')]};return db[_0xc336('0x28')][_0xc336('0x18')](_0x50e964)[_0xc336('0x1f')](function(_0x22df8c){_0x21b221[_0xc336('0x18')]=_0x22df8c;if(_0x3bf1d6[_0xc336('0x2c')]['includeAll']){_0x296381[_0xc336('0x39')]=[{'all':!![]}];}return db['Automation'][_0xc336('0x3a')](_0x296381);})[_0xc336('0x1f')](function(_0x21438f){_0x21b221[_0xc336('0x3b')]=_0x21438f;return _0x21b221;})[_0xc336('0x1f')](respondWithFilteredResult(_0x510b09,_0x296381))[_0xc336('0x3c')](handleError(_0x510b09,null));};exports[_0xc336('0x3d')]=function(_0x1fcb3d,_0xca1ff3){var _0x1fef80={'raw':![],'where':{'id':_0x1fcb3d[_0xc336('0x3e')]['id']}},_0xc6903e={};_0xc6903e['model']=_['keys'](db[_0xc336('0x28')][_0xc336('0x29')]);_0xc6903e[_0xc336('0x2c')]=_[_0xc336('0x3f')](_0x1fcb3d['query']);_0xc6903e[_0xc336('0x2d')]=_[_0xc336('0x40')](_0xc6903e[_0xc336('0x2b')],_0xc6903e['query']);_0x1fef80[_0xc336('0x2e')]=_[_0xc336('0x40')](_0xc6903e[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x1fcb3d[_0xc336('0x2c')][_0xc336('0x2f')]));_0x1fef80[_0xc336('0x2e')]=_0x1fef80['attributes']['length']?_0x1fef80['attributes']:_0xc6903e[_0xc336('0x2b')];if(_0x1fcb3d[_0xc336('0x2c')][_0xc336('0x41')]){_0x1fef80[_0xc336('0x39')]=[{'all':!![]}];}_0x1fef80=_[_0xc336('0x38')]({},_0x1fef80,_0x1fcb3d['options']);return db['Automation'][_0xc336('0x42')](_0x1fef80)[_0xc336('0x1f')](handleEntityNotFound(_0xca1ff3,null))[_0xc336('0x1f')](respondWithResult(_0xca1ff3,null))[_0xc336('0x3c')](handleError(_0xca1ff3,null));};exports[_0xc336('0x43')]=function(_0x516433,_0x1a41b4){return db[_0xc336('0x28')][_0xc336('0x43')](_0x516433[_0xc336('0x44')],{})[_0xc336('0x1f')](respondWithResult(_0x1a41b4,0xc9))[_0xc336('0x3c')](handleError(_0x1a41b4,null));};exports[_0xc336('0x1e')]=function(_0x4a5ee2,_0x5f3123){if(_0x4a5ee2[_0xc336('0x44')]['id']){delete _0x4a5ee2[_0xc336('0x44')]['id'];}return db['Automation'][_0xc336('0x42')]({'where':{'id':_0x4a5ee2['params']['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x5f3123,null))[_0xc336('0x1f')](saveUpdates(_0x4a5ee2[_0xc336('0x44')],null))['then'](respondWithResult(_0x5f3123,null))[_0xc336('0x3c')](handleError(_0x5f3123,null));};exports['destroy']=function(_0x1cc79d,_0x27630d){return db['Automation'][_0xc336('0x42')]({'where':{'id':_0x1cc79d[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x27630d,null))['then'](removeEntity(_0x27630d,null))[_0xc336('0x3c')](handleError(_0x27630d,null));};exports[_0xc336('0x45')]=function(_0xf3b2fa,_0x4c67dd,_0x116b24){return db[_0xc336('0x46')]['find']({'where':{'id':_0xf3b2fa[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x4c67dd,null))[_0xc336('0x1f')](function(_0x4b5b95){if(_0x4b5b95){return _0x4b5b95[_0xc336('0x45')](_0xf3b2fa[_0xc336('0x44')]['ids'],_['omit'](_0xf3b2fa['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4c67dd,null))[_0xc336('0x3c')](handleError(_0x4c67dd,null));};exports[_0xc336('0x47')]=function(_0x438285,_0x1cd7b8,_0x5df97a){var _0x2286a1={};var _0x2c1362={};var _0x258dda;var _0x179799;return db['Automation'][_0xc336('0x48')]({'where':{'id':_0x438285[_0xc336('0x3e')]['id']}})[_0xc336('0x1f')](handleEntityNotFound(_0x1cd7b8,null))['then'](function(_0x237b52){if(_0x237b52){_0x258dda=_0x237b52;_0x2c1362[_0xc336('0x2b')]=_[_0xc336('0x3f')](db[_0xc336('0x46')]['rawAttributes']);_0x2c1362[_0xc336('0x2c')]=_[_0xc336('0x3f')](_0x438285['query']);_0x2c1362['filters']=_['intersection'](_0x2c1362[_0xc336('0x2b')],_0x2c1362[_0xc336('0x2c')]);_0x2286a1[_0xc336('0x2e')]=_['intersection'](_0x2c1362[_0xc336('0x2b')],qs[_0xc336('0x2f')](_0x438285[_0xc336('0x2c')][_0xc336('0x2f')]));_0x2286a1['attributes']=_0x2286a1['attributes'][_0xc336('0x30')]?_0x2286a1['attributes']:_0x2c1362['model'];_0x2286a1['order']=qs[_0xc336('0x33')](_0x438285['query'][_0xc336('0x33')]);_0x2286a1['where']=qs[_0xc336('0x2d')](_[_0xc336('0x49')](_0x438285[_0xc336('0x2c')],_0x2c1362[_0xc336('0x2d')]));if(_0x438285[_0xc336('0x2c')][_0xc336('0x35')]){_0x2286a1[_0xc336('0x34')]=_[_0xc336('0x38')](_0x2286a1[_0xc336('0x34')],{'$or':_[_0xc336('0x27')](_0x2286a1[_0xc336('0x2e')],function(_0x3f95ae){var _0x5cc4f3={};_0x5cc4f3[_0x3f95ae]={'$like':'%'+_0x438285[_0xc336('0x2c')][_0xc336('0x35')]+'%'};return _0x5cc4f3;})});}_0x2286a1=_[_0xc336('0x38')]({},_0x2286a1,_0x438285[_0xc336('0x4a')]);return _0x258dda['getConditions'](_0x2286a1);}})[_0xc336('0x1f')](function(_0x2edcd2){if(_0x2edcd2){_0x179799=_0x2edcd2[_0xc336('0x30')];if(!_0x438285[_0xc336('0x2c')]['hasOwnProperty']('nolimit')){_0x2286a1[_0xc336('0x17')]=qs[_0xc336('0x17')](_0x438285[_0xc336('0x2c')]['limit']);_0x2286a1['offset']=qs['offset'](_0x438285['query'][_0xc336('0x15')]);}return _0x258dda['getConditions'](_0x2286a1);}})[_0xc336('0x1f')](function(_0x53667b){if(_0x53667b){return _0x53667b?{'count':_0x179799,'rows':_0x53667b}:null;}})['then'](respondWithResult(_0x1cd7b8,null))[_0xc336('0x3c')](handleError(_0x1cd7b8,null));};exports[_0xc336('0x4b')]=function(_0x55e666,_0x86974c,_0x13f3d4){return db[_0xc336('0x4c')][_0xc336('0x42')]({'where':{'id':_0x55e666[_0xc336('0x3e')]['id']}})['then'](handleEntityNotFound(_0x86974c,null))[_0xc336('0x1f')](function(_0x4ca3f4){if(_0x4ca3f4){return _0x4ca3f4[_0xc336('0x4b')](_0x55e666[_0xc336('0x44')][_0xc336('0x4d')],_['omit'](_0x55e666['body'],[_0xc336('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x86974c,null))['catch'](handleError(_0x86974c,null));};exports[_0xc336('0x4e')]=function(_0x4df59b,_0x3ed4b1,_0xf3b328){var _0x52a238={};var _0x38455d={};var _0x521591;var _0x38b473;return db[_0xc336('0x28')][_0xc336('0x48')]({'where':{'id':_0x4df59b[_0xc336('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ed4b1,null))['then'](function(_0x217596){if(_0x217596){_0x521591=_0x217596;_0x38455d['model']=_[_0xc336('0x3f')](db['Action'][_0xc336('0x29')]);_0x38455d[_0xc336('0x2c')]=_['keys'](_0x4df59b[_0xc336('0x2c')]);_0x38455d[_0xc336('0x2d')]=_[_0xc336('0x40')](_0x38455d[_0xc336('0x2b')],_0x38455d[_0xc336('0x2c')]);_0x52a238[_0xc336('0x2e')]=_[_0xc336('0x40')](_0x38455d[_0xc336('0x2b')],qs['fields'](_0x4df59b[_0xc336('0x2c')][_0xc336('0x2f')]));_0x52a238[_0xc336('0x2e')]=_0x52a238[_0xc336('0x2e')][_0xc336('0x30')]?_0x52a238[_0xc336('0x2e')]:_0x38455d['model'];_0x52a238[_0xc336('0x32')]=qs[_0xc336('0x33')](_0x4df59b['query'][_0xc336('0x33')]);_0x52a238['where']=qs[_0xc336('0x2d')](_[_0xc336('0x49')](_0x4df59b[_0xc336('0x2c')],_0x38455d[_0xc336('0x2d')]));if(_0x4df59b[_0xc336('0x2c')][_0xc336('0x35')]){_0x52a238['where']=_[_0xc336('0x38')](_0x52a238[_0xc336('0x34')],{'$or':_[_0xc336('0x27')](_0x52a238[_0xc336('0x2e')],function(_0x40d323){var _0x5b8f5f={};_0x5b8f5f[_0x40d323]={'$like':'%'+_0x4df59b[_0xc336('0x2c')][_0xc336('0x35')]+'%'};return _0x5b8f5f;})});}_0x52a238=_[_0xc336('0x38')]({},_0x52a238,_0x4df59b[_0xc336('0x4a')]);return _0x521591[_0xc336('0x4e')](_0x52a238);}})[_0xc336('0x1f')](function(_0x390358){if(_0x390358){_0x38b473=_0x390358[_0xc336('0x30')];if(!_0x4df59b['query'][_0xc336('0x4f')](_0xc336('0x31'))){_0x52a238[_0xc336('0x17')]=qs[_0xc336('0x17')](_0x4df59b['query'][_0xc336('0x17')]);_0x52a238['offset']=qs[_0xc336('0x15')](_0x4df59b[_0xc336('0x2c')][_0xc336('0x15')]);}return _0x521591['getActions'](_0x52a238);}})[_0xc336('0x1f')](function(_0x36a225){if(_0x36a225){return _0x36a225?{'count':_0x38b473,'rows':_0x36a225}:null;}})['then'](respondWithResult(_0x3ed4b1,null))['catch'](handleError(_0x3ed4b1,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 3913064..5e4cc75 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 _0xdc38=['Automation','tools_automations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','define'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xdc38,0x92));var _0x8dc3=function(_0x35a097,_0x42c39f){_0x35a097=_0x35a097-0x0;var _0x5ebefc=_0xdc38[_0x35a097];return _0x5ebefc;};'use strict';var _=require('lodash');var util=require(_0x8dc3('0x0'));var logger=require(_0x8dc3('0x1'))(_0x8dc3('0x2'));var moment=require(_0x8dc3('0x3'));var BPromise=require(_0x8dc3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dc3('0x5'));var rimraf=require(_0x8dc3('0x6'));var config=require(_0x8dc3('0x7'));var attributes=require(_0x8dc3('0x8'));module['exports']=function(_0xaf7ad9,_0x3e832f){return _0xaf7ad9[_0x8dc3('0x9')](_0x8dc3('0xa'),attributes,{'tableName':_0x8dc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf2e2=['define','Automation','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes'];(function(_0x5ad18c,_0x4ee0d3){var _0x470c74=function(_0x3b5850){while(--_0x3b5850){_0x5ad18c['push'](_0x5ad18c['shift']());}};_0x470c74(++_0x4ee0d3);}(_0xf2e2,0x1db));var _0x2f2e=function(_0x3d3904,_0x5dfdb){_0x3d3904=_0x3d3904-0x0;var _0x20cdfc=_0xf2e2[_0x3d3904];return _0x20cdfc;};'use strict';var _=require(_0x2f2e('0x0'));var util=require(_0x2f2e('0x1'));var logger=require(_0x2f2e('0x2'))('api');var moment=require(_0x2f2e('0x3'));var BPromise=require(_0x2f2e('0x4'));var rp=require(_0x2f2e('0x5'));var fs=require('fs');var path=require(_0x2f2e('0x6'));var rimraf=require('rimraf');var config=require(_0x2f2e('0x7'));var attributes=require(_0x2f2e('0x8'));module['exports']=function(_0x33420c,_0x109a3f){return _0x33420c[_0x2f2e('0x9')](_0x2f2e('0xa'),attributes,{'tableName':'tools_automations','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 7e05180..746a4ec 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 _0x5ba3=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','Automation,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ba3,0x140));var _0x35ba=function(_0x73c797,_0x2817e6){_0x73c797=_0x73c797-0x0;var _0x28bd51=_0x5ba3[_0x73c797];return _0x28bd51;};'use strict';var _=require(_0x35ba('0x0'));var util=require('util');var moment=require(_0x35ba('0x1'));var BPromise=require(_0x35ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ba('0x3'));var db=require(_0x35ba('0x4'))['db'];var utils=require(_0x35ba('0x5'));var logger=require('../../config/logger')(_0x35ba('0x6'));var config=require(_0x35ba('0x7'));var jayson=require(_0x35ba('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x20cd5f,_0x3264d3,_0x380ffb){return new BPromise(function(_0x4c55f3,_0x22bed8){return client['request'](_0x20cd5f,_0x380ffb)[_0x35ba('0x9')](function(_0x366ddc){logger[_0x35ba('0xa')](_0x35ba('0xb'),_0x3264d3,'request\x20sent');logger[_0x35ba('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x3264d3,'request\x20sent',JSON['stringify'](_0x366ddc));if(_0x366ddc[_0x35ba('0xd')]){if(_0x366ddc[_0x35ba('0xd')][_0x35ba('0xe')]===0x1f4){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x22bed8(_0x366ddc[_0x35ba('0xd')]['message']);}logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x366ddc[_0x35ba('0xd')][_0x35ba('0xf')]);return _0x4c55f3(_0x366ddc['error'][_0x35ba('0xf')]);}else{logger['info']('Automation,\x20%s,\x20%s',_0x3264d3,_0x35ba('0x10'));_0x4c55f3(_0x366ddc[_0x35ba('0x11')]['message']);}})[_0x35ba('0x12')](function(_0x2b6b71){logger[_0x35ba('0xd')](_0x35ba('0xb'),_0x3264d3,_0x2b6b71);_0x22bed8(_0x2b6b71);});});}
\ No newline at end of file
+var _0x3014=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s'];(function(_0x487af7,_0x3afa30){var _0x15be2e=function(_0xd48c1b){while(--_0xd48c1b){_0x487af7['push'](_0x487af7['shift']());}};_0x15be2e(++_0x3afa30);}(_0x3014,0x1d7));var _0x4301=function(_0x4f7fa8,_0x268486){_0x4f7fa8=_0x4f7fa8-0x0;var _0x50c25a=_0x3014[_0x4f7fa8];return _0x50c25a;};'use strict';var _=require(_0x4301('0x0'));var util=require(_0x4301('0x1'));var moment=require('moment');var BPromise=require(_0x4301('0x2'));var rs=require(_0x4301('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4301('0x4'));var logger=require(_0x4301('0x5'))(_0x4301('0x6'));var config=require(_0x4301('0x7'));var jayson=require(_0x4301('0x8'));var client=jayson[_0x4301('0x9')][_0x4301('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6e61,_0x5013c,_0x1dc855){return new BPromise(function(_0x337800,_0x4d5020){return client['request'](_0x3a6e61,_0x1dc855)[_0x4301('0xb')](function(_0x2d6581){logger['info'](_0x4301('0xc'),_0x5013c,_0x4301('0xd'));logger[_0x4301('0xe')](_0x4301('0xf'),_0x5013c,'request\x20sent',JSON[_0x4301('0x10')](_0x2d6581));if(_0x2d6581['error']){if(_0x2d6581[_0x4301('0x11')][_0x4301('0x12')]===0x1f4){logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x4d5020(_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);}logger[_0x4301('0x11')](_0x4301('0xc'),_0x5013c,_0x2d6581[_0x4301('0x11')][_0x4301('0x13')]);return _0x337800(_0x2d6581[_0x4301('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5013c,_0x4301('0xd'));_0x337800(_0x2d6581[_0x4301('0x14')][_0x4301('0x13')]);}})[_0x4301('0x15')](function(_0x4da25c){logger['error'](_0x4301('0xc'),_0x5013c,_0x4da25c);_0x4d5020(_0x4da25c);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index e32df0c..d39165f 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 _0x21d1=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','delete','destroy','exports','multer','util','path'];(function(_0x4b5456,_0x42dfc1){var _0x2c103d=function(_0x143563){while(--_0x143563){_0x4b5456['push'](_0x4b5456['shift']());}};_0x2c103d(++_0x42dfc1);}(_0x21d1,0x1c9));var _0x121d=function(_0x41058e,_0xf056ef){_0x41058e=_0x41058e-0x0;var _0xebf413=_0x21d1[_0x41058e];return _0xebf413;};'use strict';var multer=require(_0x121d('0x0'));var util=require(_0x121d('0x1'));var path=require(_0x121d('0x2'));var timeout=require(_0x121d('0x3'));var express=require(_0x121d('0x4'));var router=express[_0x121d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x121d('0x6'));var config=require(_0x121d('0x7'));var controller=require(_0x121d('0x8'));router[_0x121d('0x9')]('/',auth[_0x121d('0xa')](),controller['index']);router[_0x121d('0x9')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0xc')]);router[_0x121d('0x9')](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0xe')]);router[_0x121d('0x9')](_0x121d('0xf'),auth['isAuthenticated'](),controller[_0x121d('0x10')]);router[_0x121d('0x11')]('/',auth[_0x121d('0xa')](),controller['create']);router['post'](_0x121d('0xd'),auth[_0x121d('0xa')](),controller[_0x121d('0x12')]);router['post']('/:id/actions',auth[_0x121d('0xa')](),controller['addActions']);router[_0x121d('0x13')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller['update']);router[_0x121d('0x14')](_0x121d('0xb'),auth[_0x121d('0xa')](),controller[_0x121d('0x15')]);module[_0x121d('0x16')]=router;
\ No newline at end of file
+var _0x2e3d=['addActions','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','getActions','create','post','addConditions','/:id/actions'];(function(_0x527a6c,_0x15b18d){var _0x4c780d=function(_0xebc03){while(--_0xebc03){_0x527a6c['push'](_0x527a6c['shift']());}};_0x4c780d(++_0x15b18d);}(_0x2e3d,0x8c));var _0xd2e3=function(_0x19c3fd,_0x5a83bf){_0x19c3fd=_0x19c3fd-0x0;var _0x321198=_0x2e3d[_0x19c3fd];return _0x321198;};'use strict';var multer=require(_0xd2e3('0x0'));var util=require(_0xd2e3('0x1'));var path=require(_0xd2e3('0x2'));var timeout=require(_0xd2e3('0x3'));var express=require(_0xd2e3('0x4'));var router=express[_0xd2e3('0x5')]();var fs_extra=require(_0xd2e3('0x6'));var auth=require(_0xd2e3('0x7'));var interaction=require(_0xd2e3('0x8'));var config=require('../../config/environment');var controller=require(_0xd2e3('0x9'));router[_0xd2e3('0xa')]('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0xc')]);router['get'](_0xd2e3('0xd'),auth['isAuthenticated'](),controller[_0xd2e3('0xe')]);router['get'](_0xd2e3('0xf'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x10')]);router[_0xd2e3('0xa')]('/:id/actions',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x11')]);router['post']('/',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x12')]);router[_0xd2e3('0x13')]('/:id/conditions',auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x14')]);router[_0xd2e3('0x13')](_0xd2e3('0x15'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x16')]);router[_0xd2e3('0x17')](_0xd2e3('0xd'),auth[_0xd2e3('0xb')](),controller[_0xd2e3('0x18')]);router[_0xd2e3('0x19')](_0xd2e3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xd2e3('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index f216426..286c834 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 _0xb111=['#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence'];(function(_0x47d32d,_0x4ad6e4){var _0xfe59b5=function(_0x448cd5){while(--_0x448cd5){_0x47d32d['push'](_0x47d32d['shift']());}};_0xfe59b5(++_0x4ad6e4);}(_0xb111,0x149));var _0x1b11=function(_0x30a0c7,_0x2e8020){_0x30a0c7=_0x30a0c7-0x0;var _0x14a010=_0xb111[_0x30a0c7];return _0x14a010;};'use strict';var Sequelize=require('sequelize');module[_0x1b11('0x0')]={'name':{'type':Sequelize[_0x1b11('0x1')],'unique':_0x1b11('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x4')),'allowNull':![],'defaultValue':_0x1b11('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':_0x1b11('0x6')},'limitCalls':{'type':Sequelize[_0x1b11('0x7')](0x4)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1b11('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1b11('0x10')},'dialTimezone':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':_0x1b11('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x12'),_0x1b11('0x13'),_0x1b11('0x14')),'defaultValue':_0x1b11('0x12')},'dialAMDActive':{'type':Sequelize[_0x1b11('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1b11('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1b11('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1b11('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1b11('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1b11('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1b11('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1b11('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1b11('0x7')](0x9)[_0x1b11('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1b11('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1b11('0x3')](_0x1b11('0x1d'),'ASC'),'defaultValue':_0x1b11('0x1d')},'dialPrefix':{'type':Sequelize[_0x1b11('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1b11('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x1b11('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x1b11('0x7')](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1b11('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1b11('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1b11('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1b11('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xb954=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','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\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x38ceff,_0x3c88bd){var _0x44c5f6=function(_0x3288f9){while(--_0x3288f9){_0x38ceff['push'](_0x38ceff['shift']());}};_0x44c5f6(++_0x3c88bd);}(_0xb954,0x115));var _0x4b95=function(_0x1a124d,_0x3e04b0){_0x1a124d=_0x1a124d-0x0;var _0x5f0830=_0xb954[_0x1a124d];return _0x5f0830;};'use strict';var Sequelize=require(_0x4b95('0x0'));module[_0x4b95('0x1')]={'name':{'type':Sequelize[_0x4b95('0x2')],'unique':_0x4b95('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x4b95('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4b95('0x5')],'defaultValue':0x0,'comment':_0x4b95('0x6')},'limitCalls':{'type':Sequelize[_0x4b95('0x7')](0x4)[_0x4b95('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x4b95('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4b95('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'comment':_0x4b95('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4b95('0x2')],'defaultValue':_0x4b95('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x4b95('0x11')](_0x4b95('0x12'),_0x4b95('0x13'),'onlyIfOpen'),'defaultValue':_0x4b95('0x12')},'dialAMDActive':{'type':Sequelize[_0x4b95('0x5')],'defaultValue':0x0,'comment':_0x4b95('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4b95('0x15')},'dialAMDGreeting':{'type':Sequelize[_0x4b95('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4b95('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4b95('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4b95('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4b95('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4b95('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4b95('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4b95('0x7')](0x9)[_0x4b95('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4b95('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4b95('0x11')]('DESC',_0x4b95('0x1d')),'defaultValue':_0x4b95('0x1e')},'dialPrefix':{'type':Sequelize[_0x4b95('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x4b95('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4b95('0x1f')},'dialCutDigit':{'type':Sequelize[_0x4b95('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4b95('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4b95('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4b95('0x7')](0x3)[_0x4b95('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4b95('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x4b95('0x7')](0x5)[_0x4b95('0x8')],'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 ac709b6..4a30029 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 _0xe773=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getHoppers','CmHopper','CampaignId','findAll','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','NOW()','cm_contacts','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json'];(function(_0x2d5341,_0x590e15){var _0x3c87a5=function(_0x5ecdd5){while(--_0x5ecdd5){_0x2d5341['push'](_0x2d5341['shift']());}};_0x3c87a5(++_0x590e15);}(_0xe773,0x19a));var _0x3e77=function(_0x5b51dc,_0x4a4b33){_0x5b51dc=_0x5b51dc-0x0;var _0x315a48=_0xe773[_0x5b51dc];return _0x315a48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e77('0x0'));var zipdir=require(_0x3e77('0x1'));var jsonpatch=require(_0x3e77('0x2'));var rp=require('request-promise');var moment=require(_0x3e77('0x3'));var BPromise=require(_0x3e77('0x4'));var Mustache=require(_0x3e77('0x5'));var util=require(_0x3e77('0x6'));var path=require(_0x3e77('0x7'));var sox=require('sox');var csv=require(_0x3e77('0x8'));var ejs=require(_0x3e77('0x9'));var fs=require('fs');var fs_extra=require(_0x3e77('0xa'));var _=require(_0x3e77('0xb'));var squel=require(_0x3e77('0xc'));var crypto=require(_0x3e77('0xd'));var jsforce=require(_0x3e77('0xe'));var deskjs=require(_0x3e77('0xf'));var toCsv=require(_0x3e77('0x8'));var querystring=require(_0x3e77('0x10'));var Papa=require(_0x3e77('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e77('0x12'));var as=require(_0x3e77('0x13'));var hardwareService=require(_0x3e77('0x14'));var logger=require(_0x3e77('0x15'))(_0x3e77('0x16'));var utils=require('../../config/utils');var config=require(_0x3e77('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aa8a5,_0x4a1d09){_0x4a1d09=_0x4a1d09||0xcc;return function(_0x5b0f11){if(_0x5b0f11){return _0x1aa8a5[_0x3e77('0x18')](_0x4a1d09);}return _0x1aa8a5[_0x3e77('0x19')](_0x4a1d09)[_0x3e77('0x1a')]();};}function respondWithResult(_0x53188b,_0xb9208c){_0xb9208c=_0xb9208c||0xc8;return function(_0x55610c){if(_0x55610c){return _0x53188b[_0x3e77('0x19')](_0xb9208c)[_0x3e77('0x1b')](_0x55610c);}};}function respondWithFilteredResult(_0x4a48c8,_0x3fc41f){return function(_0x11d14b){if(_0x11d14b){var _0x39ec03=typeof _0x3fc41f[_0x3e77('0x1c')]===_0x3e77('0x1d')&&typeof _0x3fc41f[_0x3e77('0x1e')]==='undefined';var _0x1c2260=_0x11d14b[_0x3e77('0x1f')];var _0x35d890=_0x39ec03?0x0:_0x3fc41f[_0x3e77('0x1c')];var _0x58b8ee=_0x39ec03?_0x11d14b['count']:_0x3fc41f[_0x3e77('0x1c')]+_0x3fc41f['limit'];var _0x1eb346;if(_0x58b8ee>=_0x1c2260){_0x58b8ee=_0x1c2260;_0x1eb346=0xc8;}else{_0x1eb346=0xce;}_0x4a48c8[_0x3e77('0x19')](_0x1eb346);return _0x4a48c8[_0x3e77('0x20')](_0x3e77('0x21'),_0x35d890+'-'+_0x58b8ee+'/'+_0x1c2260)[_0x3e77('0x1b')](_0x11d14b);}return null;};}function patchUpdates(_0x19c4e1){return function(_0x4b2101){try{jsonpatch[_0x3e77('0x22')](_0x4b2101,_0x19c4e1,!![]);}catch(_0x96b07){return BPromise[_0x3e77('0x23')](_0x96b07);}return _0x4b2101[_0x3e77('0x24')]();};}function saveUpdates(_0x2a384a,_0x289c3d){return function(_0x2e027a){if(_0x2e027a){return _0x2e027a[_0x3e77('0x25')](_0x2a384a)['then'](function(_0x45762f){return _0x45762f;});}return null;};}function removeEntity(_0x317f32,_0x3ef7cf){return function(_0x1b2ce6){if(_0x1b2ce6){return _0x1b2ce6['destroy']()[_0x3e77('0x26')](function(){var _0x320144=_0x1b2ce6[_0x3e77('0x27')]({'plain':!![]});var _0x1efc1a=_0x3e77('0x28');return db[_0x3e77('0x29')][_0x3e77('0x2a')]({'where':{'type':_0x1efc1a,'resourceId':_0x320144['id']}})[_0x3e77('0x26')](function(){return _0x1b2ce6;});})[_0x3e77('0x26')](function(){_0x317f32[_0x3e77('0x19')](0xcc)[_0x3e77('0x1a')]();});}};}function handleEntityNotFound(_0x472a9e,_0x5cfc73){return function(_0x30e81f){if(!_0x30e81f){_0x472a9e[_0x3e77('0x18')](0x194);}return _0x30e81f;};}function handleError(_0x4fc072,_0x581719){_0x581719=_0x581719||0x1f4;return function(_0x3c4f6a){logger[_0x3e77('0x2b')](_0x3c4f6a[_0x3e77('0x2c')]);if(_0x3c4f6a[_0x3e77('0x2d')]){delete _0x3c4f6a['name'];}_0x4fc072[_0x3e77('0x19')](_0x581719)['send'](_0x3c4f6a);};}exports[_0x3e77('0x2e')]=function(_0x3333f1,_0x27cce5){var _0x577599={},_0x513d5c={},_0x2e42a1={'count':0x0,'rows':[]};var _0x2276f4=_[_0x3e77('0x2f')](db[_0x3e77('0x30')][_0x3e77('0x31')],function(_0x7c3a3c){return{'name':_0x7c3a3c[_0x3e77('0x32')],'type':_0x7c3a3c['type'][_0x3e77('0x33')]};});_0x513d5c[_0x3e77('0x34')]=_['map'](_0x2276f4,_0x3e77('0x2d'));_0x513d5c[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3333f1['query']);_0x513d5c[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],_0x513d5c[_0x3e77('0x35')]);_0x577599[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x513d5c[_0x3e77('0x34')],qs['fields'](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x577599[_0x3e77('0x39')]=_0x577599[_0x3e77('0x39')]['length']?_0x577599[_0x3e77('0x39')]:_0x513d5c[_0x3e77('0x34')];if(!_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x577599['limit']=qs[_0x3e77('0x1e')](_0x3333f1[_0x3e77('0x35')]['limit']);_0x577599[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x577599[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x3333f1[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x577599[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3333f1['query'],_0x513d5c[_0x3e77('0x37')]),_0x2276f4);if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]){_0x577599['where']=_[_0x3e77('0x42')](_0x577599[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x2276f4,function(_0x18a3f5){if(_0x18a3f5[_0x3e77('0x43')]!==_0x3e77('0x44')){var _0x39894b={};_0x39894b[_0x18a3f5['name']]={'$like':'%'+_0x3333f1[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x39894b;}})});}_0x577599=_[_0x3e77('0x42')]({},_0x577599,_0x3333f1[_0x3e77('0x45')]);var _0x288df3={'where':_0x577599[_0x3e77('0x3f')]};return db[_0x3e77('0x30')]['count'](_0x288df3)[_0x3e77('0x26')](function(_0x48396b){_0x2e42a1[_0x3e77('0x1f')]=_0x48396b;if(_0x3333f1[_0x3e77('0x35')][_0x3e77('0x46')]){_0x577599[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x30')]['findAll'](_0x577599);})[_0x3e77('0x26')](function(_0x58cfe4){_0x2e42a1[_0x3e77('0x48')]=_0x58cfe4;return _0x2e42a1;})[_0x3e77('0x26')](respondWithFilteredResult(_0x27cce5,_0x577599))[_0x3e77('0x49')](handleError(_0x27cce5,null));};exports[_0x3e77('0x4a')]=function(_0x155210,_0x3c59ae){var _0x4d6a9d={'raw':![],'where':{'id':_0x155210[_0x3e77('0x4b')]['id']}},_0x4d51cd={};_0x4d51cd[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x4d51cd[_0x3e77('0x35')]=_['keys'](_0x155210['query']);_0x4d51cd[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],_0x4d51cd[_0x3e77('0x35')]);_0x4d6a9d[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x4d51cd[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x155210[_0x3e77('0x35')]['fields']));_0x4d6a9d[_0x3e77('0x39')]=_0x4d6a9d[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x4d6a9d[_0x3e77('0x39')]:_0x4d51cd[_0x3e77('0x34')];if(_0x155210['query'][_0x3e77('0x46')]){_0x4d6a9d[_0x3e77('0x47')]=[{'all':!![]}];}_0x4d6a9d=_[_0x3e77('0x42')]({},_0x4d6a9d,_0x155210[_0x3e77('0x45')]);return db[_0x3e77('0x30')][_0x3e77('0x4d')](_0x4d6a9d)[_0x3e77('0x26')](handleEntityNotFound(_0x3c59ae,null))[_0x3e77('0x26')](respondWithResult(_0x3c59ae,null))[_0x3e77('0x49')](handleError(_0x3c59ae,null));};exports[_0x3e77('0x4e')]=function(_0x598971,_0x2e28f7){return db[_0x3e77('0x30')][_0x3e77('0x4e')](_0x598971[_0x3e77('0x4f')],{})['then'](function(_0x3022f6){var _0x36ba43=_0x598971[_0x3e77('0x50')]['get']({'plain':!![]});if(!_0x36ba43)throw new Error(_0x3e77('0x51'));if(_0x36ba43[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1b6046=_0x3022f6[_0x3e77('0x27')]({'plain':!![]});var _0x5ae2cd=_0x3e77('0x28');return db[_0x3e77('0x53')][_0x3e77('0x4d')]({'where':{'name':_0x5ae2cd,'userProfileId':_0x36ba43[_0x3e77('0x54')]},'raw':!![]})[_0x3e77('0x26')](function(_0x30c4ea){if(_0x30c4ea&&_0x30c4ea[_0x3e77('0x55')]===0x0){return db['UserProfileResource'][_0x3e77('0x4e')]({'name':_0x1b6046['name'],'resourceId':_0x1b6046['id'],'type':_0x30c4ea[_0x3e77('0x2d')],'sectionId':_0x30c4ea['id']},{})[_0x3e77('0x26')](function(){return _0x3022f6;});}else{return _0x3022f6;}})[_0x3e77('0x49')](function(_0x1e3c3a){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x1e3c3a);throw _0x1e3c3a;});}return _0x3022f6;})[_0x3e77('0x26')](respondWithResult(_0x2e28f7,0xc9))[_0x3e77('0x49')](handleError(_0x2e28f7,null));};exports[_0x3e77('0x57')]=function(_0x595879,_0x24346a){var _0x126d4c={'where':{'id':_0x595879[_0x3e77('0x4b')]['id']}},_0xe54e0={};_0xe54e0[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x30')][_0x3e77('0x31')]);_0x126d4c[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xe54e0[_0x3e77('0x34')],qs['fields'](_0x595879[_0x3e77('0x35')]['fields']));_0x126d4c[_0x3e77('0x39')]=_0x126d4c['attributes'][_0x3e77('0x4c')]?_0x126d4c[_0x3e77('0x39')]:_0xe54e0[_0x3e77('0x34')];if(_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]){_0x126d4c[_0x3e77('0x47')]=[{'all':!![]}];}_0x126d4c=_[_0x3e77('0x42')]({},_0x126d4c,_0x595879['options']);return db['Campaign'][_0x3e77('0x4d')](_0x126d4c)['then'](handleEntityNotFound(_0x24346a,null))[_0x3e77('0x26')](function(_0x3e61bf){if(_0x3e61bf){var _0x512fda=_0x3e61bf[_0x3e77('0x27')]({'plain':!![]});_0x512fda=qs[_0x3e77('0x58')](_0x512fda,['id',_0x3e77('0x59'),_0x3e77('0x5a')]);_0x595879[_0x3e77('0x4f')]=_[_0x3e77('0x58')](_0x595879[_0x3e77('0x4f')],['id','createdAt',_0x3e77('0x5a')]);return db[_0x3e77('0x30')][_0x3e77('0x4e')](_[_0x3e77('0x42')](_0x512fda,_0x595879[_0x3e77('0x4f')]),{'include':_0x595879[_0x3e77('0x35')][_0x3e77('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x4de4c4){var _0x1ebdc6=_0x595879[_0x3e77('0x50')][_0x3e77('0x27')]({'plain':!![]});if(!_0x1ebdc6)throw new Error(_0x3e77('0x51'));if(_0x1ebdc6[_0x3e77('0x52')]===_0x3e77('0x50')){var _0x1890b5=_0x4de4c4['get']({'plain':!![]});var _0x26bd0c=_0x3e77('0x28');return db[_0x3e77('0x53')]['find']({'where':{'name':_0x26bd0c,'userProfileId':_0x1ebdc6['userProfileId']},'raw':!![]})[_0x3e77('0x26')](function(_0x532df3){if(_0x532df3&&_0x532df3['autoAssociation']===0x0){return db[_0x3e77('0x29')]['create']({'name':_0x1890b5[_0x3e77('0x2d')],'resourceId':_0x1890b5['id'],'type':_0x532df3[_0x3e77('0x2d')],'sectionId':_0x532df3['id']},{})[_0x3e77('0x26')](function(){return _0x4de4c4;});}else{return _0x4de4c4;}})[_0x3e77('0x49')](function(_0x58623b){logger[_0x3e77('0x2b')](_0x3e77('0x56'),_0x58623b);throw _0x58623b;});}return _0x4de4c4;});}})[_0x3e77('0x26')](respondWithResult(_0x24346a,0xc9))['catch'](handleError(_0x24346a,null));};exports['update']=function(_0x293c2e,_0x2c4bc2){if(_0x293c2e[_0x3e77('0x4f')]['id']){delete _0x293c2e[_0x3e77('0x4f')]['id'];}return db[_0x3e77('0x30')]['find']({'where':{'id':_0x293c2e[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c4bc2,null))['then'](saveUpdates(_0x293c2e[_0x3e77('0x4f')],null))['then'](respondWithResult(_0x2c4bc2,null))['catch'](handleError(_0x2c4bc2,null));};exports['destroy']=function(_0x207da1,_0x18cedd){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x207da1[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18cedd,null))['then'](removeEntity(_0x18cedd,null))[_0x3e77('0x49')](handleError(_0x18cedd,null));};exports[_0x3e77('0x5b')]=function(_0x3c174a,_0x248266,_0x3d4973){var _0x117abc={'raw':!![],'where':{}};var _0x1647f5={};var _0xf4a464={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3c174a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x248266,null))[_0x3e77('0x26')](function(_0x110d3f){if(_0x110d3f){_0x1647f5[_0x3e77('0x34')]=_['keys'](db[_0x3e77('0x5c')][_0x3e77('0x31')]);_0x1647f5[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3c174a[_0x3e77('0x35')]);_0x1647f5[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],_0x1647f5[_0x3e77('0x35')]);_0x117abc[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x1647f5[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x117abc['attributes']=_0x117abc[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x117abc[_0x3e77('0x39')]:_0x1647f5[_0x3e77('0x34')];if(!_0x3c174a['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x117abc[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3c174a[_0x3e77('0x35')]['limit']);_0x117abc['offset']=qs[_0x3e77('0x1c')](_0x3c174a[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x117abc[_0x3e77('0x3d')]=qs['sort'](_0x3c174a[_0x3e77('0x35')]['sort']);_0x117abc[_0x3e77('0x3f')]=qs['filters'](_[_0x3e77('0x40')](_0x3c174a[_0x3e77('0x35')],_0x1647f5['filters']));_0x117abc[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x110d3f['id'];if(_0x3c174a['query'][_0x3e77('0x41')]){_0x117abc['where']=_['merge'](_0x117abc[_0x3e77('0x3f')],{'$or':_['map'](_0x117abc[_0x3e77('0x39')],function(_0x5e1400){var _0x5b6150={};_0x5b6150[_0x5e1400]={'$like':'%'+_0x3c174a[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x5b6150;})});}_0x117abc=_[_0x3e77('0x42')]({},_0x117abc,_0x3c174a[_0x3e77('0x45')]);return db[_0x3e77('0x5c')][_0x3e77('0x1f')]({'where':_0x117abc[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x10c9ef){_0xf4a464[_0x3e77('0x1f')]=_0x10c9ef;if(_0x3c174a[_0x3e77('0x35')][_0x3e77('0x46')]){_0x117abc[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x5c')][_0x3e77('0x5e')](_0x117abc);})[_0x3e77('0x26')](function(_0x24566a){_0xf4a464[_0x3e77('0x48')]=_0x24566a;return _0xf4a464;});}})['then'](respondWithFilteredResult(_0x248266,_0x117abc))[_0x3e77('0x49')](handleError(_0x248266,null));};exports[_0x3e77('0x5f')]=function(_0x74c95f,_0xa03927,_0x4206d0){var _0x5269f5={'raw':!![],'where':{}};var _0x26eb34={};var _0x15e0c5={'count':0x0,'rows':[]};return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x74c95f[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xa03927,null))[_0x3e77('0x26')](function(_0x41d433){if(_0x41d433){_0x26eb34[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmHopperHistory']['rawAttributes']);_0x26eb34[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x74c95f['query']);_0x26eb34[_0x3e77('0x37')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],_0x26eb34['query']);_0x5269f5[_0x3e77('0x39')]=_['intersection'](_0x26eb34[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x5269f5[_0x3e77('0x39')]=_0x5269f5[_0x3e77('0x39')]['length']?_0x5269f5[_0x3e77('0x39')]:_0x26eb34['model'];if(!_0x74c95f[_0x3e77('0x35')][_0x3e77('0x3b')]('nolimit')){_0x5269f5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x74c95f[_0x3e77('0x35')][_0x3e77('0x1e')]);_0x5269f5[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x74c95f[_0x3e77('0x35')]['offset']);}_0x5269f5[_0x3e77('0x3d')]=qs[_0x3e77('0x3e')](_0x74c95f[_0x3e77('0x35')]['sort']);_0x5269f5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x74c95f[_0x3e77('0x35')],_0x26eb34[_0x3e77('0x37')]));_0x5269f5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x41d433['id'];if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x41')]){_0x5269f5[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x5269f5['where'],{'$or':_[_0x3e77('0x2f')](_0x5269f5['attributes'],function(_0x510cf6){var _0x1c1965={};_0x1c1965[_0x510cf6]={'$like':'%'+_0x74c95f['query'][_0x3e77('0x41')]+'%'};return _0x1c1965;})});}_0x5269f5=_['merge']({},_0x5269f5,_0x74c95f[_0x3e77('0x45')]);return db[_0x3e77('0x61')][_0x3e77('0x1f')]({'where':_0x5269f5[_0x3e77('0x3f')]})[_0x3e77('0x26')](function(_0x1b0f7c){_0x15e0c5[_0x3e77('0x1f')]=_0x1b0f7c;if(_0x74c95f[_0x3e77('0x35')][_0x3e77('0x46')]){_0x5269f5['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3e77('0x5e')](_0x5269f5);})['then'](function(_0x14a786){_0x15e0c5[_0x3e77('0x48')]=_0x14a786;return _0x15e0c5;});}})['then'](respondWithFilteredResult(_0xa03927,_0x5269f5))['catch'](handleError(_0xa03927,null));};exports[_0x3e77('0x62')]=function(_0x3fbea2,_0x578e79,_0x25aa11){var _0xfb07c5={'raw':!![],'where':{}};var _0x173c5d={};var _0x4ed6ed={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x3fbea2['params']['id']}})['then'](handleEntityNotFound(_0x578e79,null))[_0x3e77('0x26')](function(_0x284b55){if(_0x284b55){_0x173c5d[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x63')][_0x3e77('0x31')]);_0x173c5d[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x3fbea2['query']);_0x173c5d[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],_0x173c5d[_0x3e77('0x35')]);_0xfb07c5[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x173c5d[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x3fbea2['query'][_0x3e77('0x3a')]));_0xfb07c5[_0x3e77('0x39')]=_0xfb07c5[_0x3e77('0x39')][_0x3e77('0x4c')]?_0xfb07c5[_0x3e77('0x39')]:_0x173c5d[_0x3e77('0x34')];if(!_0x3fbea2['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0xfb07c5[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1e')]);_0xfb07c5[_0x3e77('0x1c')]=qs['offset'](_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0xfb07c5['order']=qs['sort'](_0x3fbea2['query']['sort']);_0xfb07c5[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x3fbea2[_0x3e77('0x35')],_0x173c5d['filters']));_0xfb07c5[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x284b55['id'];if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x41')]){_0xfb07c5['where']=_[_0x3e77('0x42')](_0xfb07c5[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0xfb07c5[_0x3e77('0x39')],function(_0x4443e7){var _0x2db50a={};_0x2db50a[_0x4443e7]={'$like':'%'+_0x3fbea2[_0x3e77('0x35')]['filter']+'%'};return _0x2db50a;})});}_0xfb07c5=_[_0x3e77('0x42')]({},_0xfb07c5,_0x3fbea2[_0x3e77('0x45')]);return db[_0x3e77('0x63')]['count']({'where':_0xfb07c5['where']})[_0x3e77('0x26')](function(_0x461587){_0x4ed6ed[_0x3e77('0x1f')]=_0x461587;if(_0x3fbea2[_0x3e77('0x35')][_0x3e77('0x46')]){_0xfb07c5[_0x3e77('0x47')]=[{'all':!![]}];}return db[_0x3e77('0x63')]['findAll'](_0xfb07c5);})[_0x3e77('0x26')](function(_0x2d842f){_0x4ed6ed[_0x3e77('0x48')]=_0x2d842f;return _0x4ed6ed;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x578e79,_0xfb07c5))[_0x3e77('0x49')](handleError(_0x578e79,null));};exports[_0x3e77('0x64')]=function(_0x4f1814,_0x10e034,_0x149463){var _0x44b60f={'raw':!![],'where':{}};var _0x423886={};var _0x38d154={'count':0x0,'rows':[]};return db[_0x3e77('0x30')]['findOne']({'where':{'id':_0x4f1814[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x10e034,null))[_0x3e77('0x26')](function(_0x50e433){if(_0x50e433){_0x423886[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x65')]['rawAttributes']);_0x423886[_0x3e77('0x35')]=_['keys'](_0x4f1814[_0x3e77('0x35')]);_0x423886[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],_0x423886[_0x3e77('0x35')]);_0x44b60f[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0x423886[_0x3e77('0x34')],qs[_0x3e77('0x3a')](_0x4f1814['query'][_0x3e77('0x3a')]));_0x44b60f['attributes']=_0x44b60f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44b60f[_0x3e77('0x39')]:_0x423886[_0x3e77('0x34')];if(!_0x4f1814['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44b60f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x4f1814['query'][_0x3e77('0x1e')]);_0x44b60f[_0x3e77('0x1c')]=qs['offset'](_0x4f1814[_0x3e77('0x35')][_0x3e77('0x1c')]);}_0x44b60f['order']=qs[_0x3e77('0x3e')](_0x4f1814['query']['sort']);_0x44b60f['where']=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x4f1814[_0x3e77('0x35')],_0x423886[_0x3e77('0x37')]));_0x44b60f[_0x3e77('0x3f')][_0x3e77('0x5d')]=_0x50e433['id'];if(_0x4f1814['query'][_0x3e77('0x41')]){_0x44b60f['where']=_[_0x3e77('0x42')](_0x44b60f['where'],{'$or':_[_0x3e77('0x2f')](_0x44b60f[_0x3e77('0x39')],function(_0x1baf86){var _0x3564fd={};_0x3564fd[_0x1baf86]={'$like':'%'+_0x4f1814[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x3564fd;})});}_0x44b60f=_['merge']({},_0x44b60f,_0x4f1814['options']);return db[_0x3e77('0x65')][_0x3e77('0x1f')]({'where':_0x44b60f['where']})[_0x3e77('0x26')](function(_0x15ee01){_0x38d154[_0x3e77('0x1f')]=_0x15ee01;if(_0x4f1814[_0x3e77('0x35')]['includeAll']){_0x44b60f['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x3e77('0x5e')](_0x44b60f);})[_0x3e77('0x26')](function(_0x1c58fd){_0x38d154['rows']=_0x1c58fd;return _0x38d154;});}})[_0x3e77('0x26')](respondWithFilteredResult(_0x10e034,_0x44b60f))[_0x3e77('0x49')](handleError(_0x10e034,null));};exports[_0x3e77('0x66')]=function(_0x97a639,_0x2fdbc9,_0xa91b28){var _0x2def37={};var _0xd2cce2={};var _0x3ca480;var _0xad1adb;return db['Campaign'][_0x3e77('0x60')]({'where':{'id':_0x97a639[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x2fdbc9,null))[_0x3e77('0x26')](function(_0x159cc1){if(_0x159cc1){_0x3ca480=_0x159cc1;_0xd2cce2[_0x3e77('0x34')]=_[_0x3e77('0x36')](db['CmList'][_0x3e77('0x31')]);_0xd2cce2[_0x3e77('0x35')]=_[_0x3e77('0x36')](_0x97a639[_0x3e77('0x35')]);_0xd2cce2[_0x3e77('0x37')]=_['intersection'](_0xd2cce2[_0x3e77('0x34')],_0xd2cce2[_0x3e77('0x35')]);_0x2def37[_0x3e77('0x39')]=_[_0x3e77('0x38')](_0xd2cce2['model'],qs[_0x3e77('0x3a')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x2def37[_0x3e77('0x39')]=_0x2def37['attributes'][_0x3e77('0x4c')]?_0x2def37[_0x3e77('0x39')]:_0xd2cce2[_0x3e77('0x34')];_0x2def37['order']=qs[_0x3e77('0x3e')](_0x97a639['query']['sort']);_0x2def37[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x97a639[_0x3e77('0x35')],_0xd2cce2[_0x3e77('0x37')]));if(_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]){_0x2def37[_0x3e77('0x3f')]=_[_0x3e77('0x42')](_0x2def37[_0x3e77('0x3f')],{'$or':_['map'](_0x2def37[_0x3e77('0x39')],function(_0x554c5f){var _0x9a8dd3={};_0x9a8dd3[_0x554c5f]={'$like':'%'+_0x97a639[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x9a8dd3;})});}_0x2def37=_[_0x3e77('0x42')]({},_0x2def37,_0x97a639[_0x3e77('0x45')]);return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x58b9c0){if(_0x58b9c0){_0xad1adb=_0x58b9c0[_0x3e77('0x4c')];if(!_0x97a639[_0x3e77('0x35')][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x2def37[_0x3e77('0x1e')]=qs['limit'](_0x97a639['query'][_0x3e77('0x1e')]);_0x2def37[_0x3e77('0x1c')]=qs[_0x3e77('0x1c')](_0x97a639[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x3ca480[_0x3e77('0x66')](_0x2def37);}})[_0x3e77('0x26')](function(_0x154844){if(_0x154844){return _0x154844?{'count':_0xad1adb,'rows':_0x154844}:null;}})[_0x3e77('0x26')](respondWithResult(_0x2fdbc9,null))[_0x3e77('0x49')](handleError(_0x2fdbc9,null));};exports[_0x3e77('0x67')]=function(_0x36d358,_0x10fd5b,_0x354ede){var _0x3a104e,_0x5a224c;var _0x25b353=[];var _0x40394f=moment()['format'](_0x3e77('0x68'));return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x36d358[_0x3e77('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10fd5b,null))[_0x3e77('0x26')](function(_0x1aa56b){if(_0x1aa56b){_0x5a224c=_0x1aa56b;return _0x1aa56b[_0x3e77('0x67')](_0x36d358['body'][_0x3e77('0x69')],_['omit'](_0x36d358[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x2a621f){var _0x4cab54;var _0xd69c2d;_0x3a104e=_0x2a621f||[];var _0xbf12ac=[];if(_0x2a621f){for(var _0x80aa0e=0x0;_0x80aa0e<_0x2a621f['length'];_0x80aa0e+=0x1){var _0x3b18e9=_0x2a621f[_0x80aa0e][_0x3e77('0x27')]({'plain':!![]});_0x5a224c[_0x3e77('0x6b')]=_0x36d358['body'][_0x3e77('0x6b')]?_0x36d358[_0x3e77('0x4f')]['dialCheckDuplicateType']:_0x5a224c[_0x3e77('0x6b')];switch(_0x5a224c['dialCheckDuplicateType']){case'always':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field'](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()',_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27','createdAt')[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')]('cm_contacts')['where'](_0x3e77('0x79'))[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7c'))[_0x3e77('0x78')](_0x3e77('0x7d'))['where']('CampaignId\x20=\x20?',_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]()))[_0x3e77('0x3f')](_0x3e77('0x7e'),squel[_0x3e77('0x74')]()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')](_0x3e77('0x6e'))[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())))[_0x3e77('0x77')]();break;case'onlyIfOpen':_0x4cab54=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')](_0x3e77('0x6e'))['fromQuery']([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),'ListId',_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()[_0x3e77('0x75')](_0x3e77('0x70'),_0x3e77('0x70'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),_0x3e77('0x73'))[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')](),_0x3e77('0x5d'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b'))[_0x3e77('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3e77('0x75')](_0x3e77('0x7f'))[_0x3e77('0x78')]('cm_hopper')[_0x3e77('0x3f')](_0x3e77('0x80'),_0x36d358[_0x3e77('0x4b')]['id']['toString']())))[_0x3e77('0x77')]();break;default:_0x4cab54=squel[_0x3e77('0x6c')]()['into'](_0x3e77('0x6e'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x71'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()['field']('phone',_0x3e77('0x70'))[_0x3e77('0x75')]('NOW()','scheduledAt')[_0x3e77('0x75')]('id','ContactId')[_0x3e77('0x75')](_0x3b18e9[_0x3e77('0x76')]['toString'](),'ListId')[_0x3e77('0x75')](_0x36d358[_0x3e77('0x4b')]['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))[_0x3e77('0x75')]('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))[_0x3e77('0x78')](_0x3e77('0x82'))[_0x3e77('0x3f')]('deletedAt\x20IS\x20NULL')[_0x3e77('0x3f')](_0x3e77('0x7a'),_0x3b18e9[_0x3e77('0x76')]['toString']())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();}_0xd69c2d=squel[_0x3e77('0x6c')]()[_0x3e77('0x6d')]('cm_hopper_additional_phones')[_0x3e77('0x6f')](['cmHopperId',_0x3e77('0x71'),_0x3e77('0x70'),'OrderBy',_0x3e77('0x59'),_0x3e77('0x5a')],squel['select']()['field']('h.id','id')[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x71'))[_0x3e77('0x75')](_0x3e77('0x83'),_0x3e77('0x70'))[_0x3e77('0x75')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x59'))['field']('\x27'+_0x40394f+'\x27',_0x3e77('0x5a'))['from'](_0x3e77('0x84'),'ci')[_0x3e77('0x85')](_0x3e77('0x6e'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x3e77('0x86'),_0x3b18e9['CmListId'][_0x3e77('0x77')]())['where'](_0x3e77('0x87'),_0x36d358[_0x3e77('0x4b')]['id'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x88'),_0x40394f))[_0x3e77('0x77')]();_0xbf12ac[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x4cab54));_0x25b353[_0x3e77('0x89')](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0xd69c2d));}return BPromise[_0x3e77('0x8b')](_0xbf12ac);}})[_0x3e77('0x26')](function(){return BPromise['all'](_0x25b353);})[_0x3e77('0x26')](function(){return _0x3a104e;})['then'](respondWithResult(_0x10fd5b,null))[_0x3e77('0x49')](handleError(_0x10fd5b,null));};exports[_0x3e77('0x8c')]=function(_0x22c41a,_0xfbe6a0,_0x57dd35){return db[_0x3e77('0x30')][_0x3e77('0x4d')]({'where':{'id':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0xfbe6a0,null))['then'](function(_0xc34e57){if(_0xc34e57){return _0xc34e57[_0x3e77('0x8c')](_0x22c41a['query'][_0x3e77('0x69')]);}})[_0x3e77('0x26')](function(_0x5dd70c){if(_0x5dd70c){return db[_0x3e77('0x5c')][_0x3e77('0x2a')]({'where':{'ListId':_0x22c41a[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x22c41a[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x5dd70c;});}})[_0x3e77('0x26')](respondWithStatusCode(_0xfbe6a0,null))[_0x3e77('0x49')](handleError(_0xfbe6a0,null));};exports[_0x3e77('0x8d')]=function(_0x33a8ac,_0x18a735,_0x4cdce9){var _0x44ab7f={};var _0x12e4ed={};var _0x4260bf;var _0x2f72a0;return db[_0x3e77('0x30')][_0x3e77('0x60')]({'where':{'id':_0x33a8ac[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x18a735,null))[_0x3e77('0x26')](function(_0xef7ec9){if(_0xef7ec9){_0x4260bf=_0xef7ec9;_0x12e4ed[_0x3e77('0x34')]=_[_0x3e77('0x36')](db[_0x3e77('0x8e')][_0x3e77('0x31')]);_0x12e4ed['query']=_['keys'](_0x33a8ac[_0x3e77('0x35')]);_0x12e4ed[_0x3e77('0x37')]=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],_0x12e4ed[_0x3e77('0x35')]);_0x44ab7f['attributes']=_[_0x3e77('0x38')](_0x12e4ed[_0x3e77('0x34')],qs['fields'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3a')]));_0x44ab7f['attributes']=_0x44ab7f[_0x3e77('0x39')][_0x3e77('0x4c')]?_0x44ab7f['attributes']:_0x12e4ed[_0x3e77('0x34')];_0x44ab7f[_0x3e77('0x3d')]=qs['sort'](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x3e')]);_0x44ab7f[_0x3e77('0x3f')]=qs[_0x3e77('0x37')](_[_0x3e77('0x40')](_0x33a8ac[_0x3e77('0x35')],_0x12e4ed[_0x3e77('0x37')]));if(_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]){_0x44ab7f['where']=_[_0x3e77('0x42')](_0x44ab7f[_0x3e77('0x3f')],{'$or':_[_0x3e77('0x2f')](_0x44ab7f[_0x3e77('0x39')],function(_0x59b408){var _0x506a73={};_0x506a73[_0x59b408]={'$like':'%'+_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x41')]+'%'};return _0x506a73;})});}_0x44ab7f=_['merge']({},_0x44ab7f,_0x33a8ac[_0x3e77('0x45')]);return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})['then'](function(_0x4a56ea){if(_0x4a56ea){_0x2f72a0=_0x4a56ea[_0x3e77('0x4c')];if(!_0x33a8ac['query'][_0x3e77('0x3b')](_0x3e77('0x3c'))){_0x44ab7f[_0x3e77('0x1e')]=qs[_0x3e77('0x1e')](_0x33a8ac['query']['limit']);_0x44ab7f['offset']=qs[_0x3e77('0x1c')](_0x33a8ac[_0x3e77('0x35')][_0x3e77('0x1c')]);}return _0x4260bf[_0x3e77('0x8d')](_0x44ab7f);}})[_0x3e77('0x26')](function(_0x3c88ec){if(_0x3c88ec){return _0x3c88ec?{'count':_0x2f72a0,'rows':_0x3c88ec}:null;}})['then'](respondWithResult(_0x18a735,null))[_0x3e77('0x49')](handleError(_0x18a735,null));};exports[_0x3e77('0x8f')]=function(_0x475079,_0x50c60e,_0x252d72){var _0x27b586,_0x4855cd;var _0x5ad1d7=[];var _0x4a6f7e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3e77('0x30')]['find']({'where':{'id':_0x475079[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x50c60e,null))[_0x3e77('0x26')](function(_0x524d1c){if(_0x524d1c){_0x4855cd=_0x524d1c;return _0x524d1c[_0x3e77('0x8f')](_0x475079[_0x3e77('0x4f')][_0x3e77('0x69')],_[_0x3e77('0x58')](_0x475079[_0x3e77('0x4f')],[_0x3e77('0x69'),'id'])||{});}return null;})[_0x3e77('0x6a')](function(_0x5b1585){var _0x121e28;var _0x129c74;_0x27b586=_0x5b1585||[];var _0x7f34af=[];if(_0x5b1585){for(var _0x458b59=0x0;_0x458b59<_0x5b1585[_0x3e77('0x4c')];_0x458b59+=0x1){var _0x2f5f44=_0x5b1585[_0x458b59][_0x3e77('0x27')]({'plain':!![]});_0x121e28=squel['insert']()[_0x3e77('0x6d')](_0x3e77('0x90'))[_0x3e77('0x6f')]([_0x3e77('0x70'),_0x3e77('0x72'),_0x3e77('0x73'),_0x3e77('0x5d'),_0x3e77('0x59'),_0x3e77('0x5a')],squel[_0x3e77('0x74')]()[_0x3e77('0x75')]('phone',_0x3e77('0x70'))['field']('id',_0x3e77('0x72'))[_0x3e77('0x75')](_0x2f5f44[_0x3e77('0x76')][_0x3e77('0x77')](),_0x3e77('0x73'))['field'](_0x475079['params']['id']['toString'](),_0x3e77('0x5d'))[_0x3e77('0x75')](_0x3e77('0x81'),_0x3e77('0x59'))['field'](_0x3e77('0x81'),'updatedAt')['from'](_0x3e77('0x82'))[_0x3e77('0x3f')](_0x3e77('0x79'))['where'](_0x3e77('0x7a'),_0x2f5f44['CmListId'][_0x3e77('0x77')]())[_0x3e77('0x3f')](_0x3e77('0x7b')))[_0x3e77('0x77')]();_0x7f34af['push'](db[_0x3e77('0x8a')][_0x3e77('0x35')](_0x121e28));}return BPromise['all'](_0x7f34af);}})[_0x3e77('0x26')](function(){return _0x27b586;})['then'](respondWithResult(_0x50c60e,null))['catch'](handleError(_0x50c60e,null));};exports[_0x3e77('0x91')]=function(_0x5f4d01,_0x5237f2,_0x56e17f){return db[_0x3e77('0x30')]['find']({'where':{'id':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](handleEntityNotFound(_0x5237f2,null))[_0x3e77('0x26')](function(_0x3980db){if(_0x3980db){return _0x3980db[_0x3e77('0x91')](_0x5f4d01['query'][_0x3e77('0x69')]);}})['then'](function(_0x434ebb){if(_0x434ebb){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x5f4d01[_0x3e77('0x35')][_0x3e77('0x69')],'CampaignId':_0x5f4d01[_0x3e77('0x4b')]['id']}})[_0x3e77('0x26')](function(){return _0x434ebb;});}})[_0x3e77('0x26')](respondWithStatusCode(_0x5237f2,null))[_0x3e77('0x49')](handleError(_0x5237f2,null));};
\ No newline at end of file
+var _0x97c1=['where','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','find','autoAssociation','getHoppers','findOne','pick','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','omit','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','insert','into','cmHopperId','OrderBy','h.id','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','format','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x26d034,_0x2c22db){var _0x3015aa=function(_0x282e96){while(--_0x282e96){_0x26d034['push'](_0x26d034['shift']());}};_0x3015aa(++_0x2c22db);}(_0x97c1,0xdf));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x197c('0x0'));var rimraf=require(_0x197c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x197c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x197c('0x3'));var Mustache=require(_0x197c('0x4'));var util=require(_0x197c('0x5'));var path=require(_0x197c('0x6'));var sox=require(_0x197c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x197c('0x8'));var _=require(_0x197c('0x9'));var squel=require(_0x197c('0xa'));var crypto=require(_0x197c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x197c('0xc'));var querystring=require('querystring');var Papa=require(_0x197c('0xd'));var Redis=require(_0x197c('0xe'));var authService=require(_0x197c('0xf'));var qs=require(_0x197c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x197c('0x11'));var logger=require(_0x197c('0x12'))(_0x197c('0x13'));var utils=require(_0x197c('0x14'));var config=require(_0x197c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x197c('0x16'))['db'];function respondWithStatusCode(_0x668f8,_0x27e46f){_0x27e46f=_0x27e46f||0xcc;return function(_0x1adcfa){if(_0x1adcfa){return _0x668f8['sendStatus'](_0x27e46f);}return _0x668f8[_0x197c('0x17')](_0x27e46f)[_0x197c('0x18')]();};}function respondWithResult(_0x5a7e1c,_0xf735ce){_0xf735ce=_0xf735ce||0xc8;return function(_0x188ff2){if(_0x188ff2){return _0x5a7e1c[_0x197c('0x17')](_0xf735ce)['json'](_0x188ff2);}};}function respondWithFilteredResult(_0x5194c3,_0x422dfa){return function(_0x2bc612){if(_0x2bc612){var _0x2083d4=typeof _0x422dfa[_0x197c('0x19')]===_0x197c('0x1a')&&typeof _0x422dfa[_0x197c('0x1b')]===_0x197c('0x1a');var _0x75beba=_0x2bc612['count'];var _0x372311=_0x2083d4?0x0:_0x422dfa['offset'];var _0x50ac52=_0x2083d4?_0x2bc612[_0x197c('0x1c')]:_0x422dfa[_0x197c('0x19')]+_0x422dfa[_0x197c('0x1b')];var _0x2ce10d;if(_0x50ac52>=_0x75beba){_0x50ac52=_0x75beba;_0x2ce10d=0xc8;}else{_0x2ce10d=0xce;}_0x5194c3['status'](_0x2ce10d);return _0x5194c3[_0x197c('0x1d')](_0x197c('0x1e'),_0x372311+'-'+_0x50ac52+'/'+_0x75beba)[_0x197c('0x1f')](_0x2bc612);}return null;};}function patchUpdates(_0x5c278a){return function(_0x1adb43){try{jsonpatch[_0x197c('0x20')](_0x1adb43,_0x5c278a,!![]);}catch(_0x3b5c4c){return BPromise[_0x197c('0x21')](_0x3b5c4c);}return _0x1adb43[_0x197c('0x22')]();};}function saveUpdates(_0x3c2151,_0x362bbf){return function(_0x2092a0){if(_0x2092a0){return _0x2092a0[_0x197c('0x23')](_0x3c2151)[_0x197c('0x24')](function(_0x29b266){return _0x29b266;});}return null;};}function removeEntity(_0x177bc9,_0x174942){return function(_0x2a1310){if(_0x2a1310){return _0x2a1310[_0x197c('0x25')]()[_0x197c('0x24')](function(){var _0x5f4a02=_0x2a1310[_0x197c('0x26')]({'plain':!![]});var _0x2911dd=_0x197c('0x27');return db['UserProfileResource'][_0x197c('0x25')]({'where':{'type':_0x2911dd,'resourceId':_0x5f4a02['id']}})[_0x197c('0x24')](function(){return _0x2a1310;});})['then'](function(){_0x177bc9['status'](0xcc)[_0x197c('0x18')]();});}};}function handleEntityNotFound(_0x48f759,_0xfbca7a){return function(_0x14b0aa){if(!_0x14b0aa){_0x48f759[_0x197c('0x28')](0x194);}return _0x14b0aa;};}function handleError(_0x16e026,_0x2f031c){_0x2f031c=_0x2f031c||0x1f4;return function(_0x3cdcd8){logger[_0x197c('0x29')](_0x3cdcd8[_0x197c('0x2a')]);if(_0x3cdcd8[_0x197c('0x2b')]){delete _0x3cdcd8['name'];}_0x16e026['status'](_0x2f031c)['send'](_0x3cdcd8);};}exports['index']=function(_0x5f7425,_0x4c9256){var _0x252cde={},_0x35dbf3={},_0x58bc60={'count':0x0,'rows':[]};var _0x422ac6=_['map'](db[_0x197c('0x2c')][_0x197c('0x2d')],function(_0x2ace33){return{'name':_0x2ace33[_0x197c('0x2e')],'type':_0x2ace33[_0x197c('0x2f')][_0x197c('0x30')]};});_0x35dbf3[_0x197c('0x31')]=_[_0x197c('0x32')](_0x422ac6,_0x197c('0x2b'));_0x35dbf3['query']=_['keys'](_0x5f7425[_0x197c('0x33')]);_0x35dbf3[_0x197c('0x34')]=_[_0x197c('0x35')](_0x35dbf3[_0x197c('0x31')],_0x35dbf3[_0x197c('0x33')]);_0x252cde[_0x197c('0x36')]=_[_0x197c('0x35')](_0x35dbf3['model'],qs['fields'](_0x5f7425[_0x197c('0x33')][_0x197c('0x37')]));_0x252cde['attributes']=_0x252cde['attributes'][_0x197c('0x38')]?_0x252cde[_0x197c('0x36')]:_0x35dbf3[_0x197c('0x31')];if(!_0x5f7425[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x252cde[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x5f7425[_0x197c('0x33')]['limit']);_0x252cde[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x5f7425[_0x197c('0x33')][_0x197c('0x19')]);}_0x252cde[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x5f7425['query'][_0x197c('0x3c')]);_0x252cde[_0x197c('0x3d')]=qs[_0x197c('0x34')](_['pick'](_0x5f7425[_0x197c('0x33')],_0x35dbf3[_0x197c('0x34')]),_0x422ac6);if(_0x5f7425[_0x197c('0x33')][_0x197c('0x3e')]){_0x252cde[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x252cde[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x422ac6,function(_0x323a14){if(_0x323a14[_0x197c('0x2f')]!=='VIRTUAL'){var _0x2705f5={};_0x2705f5[_0x323a14[_0x197c('0x2b')]]={'$like':'%'+_0x5f7425['query']['filter']+'%'};return _0x2705f5;}})});}_0x252cde=_[_0x197c('0x3f')]({},_0x252cde,_0x5f7425[_0x197c('0x40')]);var _0x3517a6={'where':_0x252cde[_0x197c('0x3d')]};return db[_0x197c('0x2c')]['count'](_0x3517a6)[_0x197c('0x24')](function(_0x3efae){_0x58bc60[_0x197c('0x1c')]=_0x3efae;if(_0x5f7425[_0x197c('0x33')][_0x197c('0x41')]){_0x252cde['include']=[{'all':!![]}];}return db[_0x197c('0x2c')][_0x197c('0x42')](_0x252cde);})[_0x197c('0x24')](function(_0x197b27){_0x58bc60[_0x197c('0x43')]=_0x197b27;return _0x58bc60;})['then'](respondWithFilteredResult(_0x4c9256,_0x252cde))[_0x197c('0x44')](handleError(_0x4c9256,null));};exports[_0x197c('0x45')]=function(_0x3b7fc1,_0x35f36d){var _0x3e6d6e={'raw':![],'where':{'id':_0x3b7fc1[_0x197c('0x46')]['id']}},_0x41eb51={};_0x41eb51[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')][_0x197c('0x2d')]);_0x41eb51['query']=_['keys'](_0x3b7fc1['query']);_0x41eb51['filters']=_[_0x197c('0x35')](_0x41eb51[_0x197c('0x31')],_0x41eb51['query']);_0x3e6d6e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x41eb51['model'],qs[_0x197c('0x37')](_0x3b7fc1[_0x197c('0x33')]['fields']));_0x3e6d6e[_0x197c('0x36')]=_0x3e6d6e[_0x197c('0x36')]['length']?_0x3e6d6e[_0x197c('0x36')]:_0x41eb51[_0x197c('0x31')];if(_0x3b7fc1[_0x197c('0x33')]['includeAll']){_0x3e6d6e[_0x197c('0x48')]=[{'all':!![]}];}_0x3e6d6e=_[_0x197c('0x3f')]({},_0x3e6d6e,_0x3b7fc1[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x3e6d6e)[_0x197c('0x24')](handleEntityNotFound(_0x35f36d,null))[_0x197c('0x24')](respondWithResult(_0x35f36d,null))[_0x197c('0x44')](handleError(_0x35f36d,null));};exports['create']=function(_0x5994bf,_0x3a5089){return db[_0x197c('0x2c')][_0x197c('0x49')](_0x5994bf[_0x197c('0x4a')],{})[_0x197c('0x24')](function(_0x28fac4){var _0x4c82d5=_0x5994bf[_0x197c('0x4b')]['get']({'plain':!![]});if(!_0x4c82d5)throw new Error(_0x197c('0x4c'));if(_0x4c82d5[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x9e8c6a=_0x28fac4[_0x197c('0x26')]({'plain':!![]});var _0x2ab21f=_0x197c('0x27');return db[_0x197c('0x4e')]['find']({'where':{'name':_0x2ab21f,'userProfileId':_0x4c82d5[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x43e9b7){if(_0x43e9b7&&_0x43e9b7['autoAssociation']===0x0){return db[_0x197c('0x50')]['create']({'name':_0x9e8c6a[_0x197c('0x2b')],'resourceId':_0x9e8c6a['id'],'type':_0x43e9b7[_0x197c('0x2b')],'sectionId':_0x43e9b7['id']},{})[_0x197c('0x24')](function(){return _0x28fac4;});}else{return _0x28fac4;}})[_0x197c('0x44')](function(_0x1d7cdd){logger[_0x197c('0x29')](_0x197c('0x51'),_0x1d7cdd);throw _0x1d7cdd;});}return _0x28fac4;})[_0x197c('0x24')](respondWithResult(_0x3a5089,0xc9))['catch'](handleError(_0x3a5089,null));};exports[_0x197c('0x52')]=function(_0x3a9261,_0x275294){var _0x5f3301={'where':{'id':_0x3a9261[_0x197c('0x46')]['id']}},_0x244faa={};_0x244faa[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x2c')]['rawAttributes']);_0x5f3301['attributes']=_[_0x197c('0x35')](_0x244faa[_0x197c('0x31')],qs[_0x197c('0x37')](_0x3a9261[_0x197c('0x33')][_0x197c('0x37')]));_0x5f3301['attributes']=_0x5f3301['attributes'][_0x197c('0x38')]?_0x5f3301[_0x197c('0x36')]:_0x244faa['model'];if(_0x3a9261[_0x197c('0x33')][_0x197c('0x41')]){_0x5f3301[_0x197c('0x48')]=[{'all':!![]}];}_0x5f3301=_[_0x197c('0x3f')]({},_0x5f3301,_0x3a9261[_0x197c('0x40')]);return db[_0x197c('0x2c')]['find'](_0x5f3301)[_0x197c('0x24')](handleEntityNotFound(_0x275294,null))[_0x197c('0x24')](function(_0x57c8c8){if(_0x57c8c8){var _0x480cab=_0x57c8c8[_0x197c('0x26')]({'plain':!![]});_0x480cab=qs['omit'](_0x480cab,['id',_0x197c('0x53'),_0x197c('0x54')]);_0x3a9261[_0x197c('0x4a')]=_['omit'](_0x3a9261[_0x197c('0x4a')],['id',_0x197c('0x53'),'updatedAt']);return db[_0x197c('0x2c')][_0x197c('0x49')](_[_0x197c('0x3f')](_0x480cab,_0x3a9261['body']),{'include':_0x3a9261[_0x197c('0x33')][_0x197c('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x570d76){var _0x381191=_0x3a9261[_0x197c('0x4b')][_0x197c('0x26')]({'plain':!![]});if(!_0x381191)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x381191[_0x197c('0x4d')]===_0x197c('0x4b')){var _0x32e8ba=_0x570d76['get']({'plain':!![]});var _0xe84f3b=_0x197c('0x27');return db[_0x197c('0x4e')][_0x197c('0x55')]({'where':{'name':_0xe84f3b,'userProfileId':_0x381191[_0x197c('0x4f')]},'raw':!![]})[_0x197c('0x24')](function(_0x8d1f3f){if(_0x8d1f3f&&_0x8d1f3f[_0x197c('0x56')]===0x0){return db[_0x197c('0x50')][_0x197c('0x49')]({'name':_0x32e8ba['name'],'resourceId':_0x32e8ba['id'],'type':_0x8d1f3f[_0x197c('0x2b')],'sectionId':_0x8d1f3f['id']},{})['then'](function(){return _0x570d76;});}else{return _0x570d76;}})['catch'](function(_0x4a8e13){logger['error'](_0x197c('0x51'),_0x4a8e13);throw _0x4a8e13;});}return _0x570d76;});}})[_0x197c('0x24')](respondWithResult(_0x275294,0xc9))[_0x197c('0x44')](handleError(_0x275294,null));};exports[_0x197c('0x23')]=function(_0x55b744,_0x32d739){if(_0x55b744['body']['id']){delete _0x55b744[_0x197c('0x4a')]['id'];}return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x55b744['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x32d739,null))[_0x197c('0x24')](saveUpdates(_0x55b744[_0x197c('0x4a')],null))[_0x197c('0x24')](respondWithResult(_0x32d739,null))['catch'](handleError(_0x32d739,null));};exports[_0x197c('0x25')]=function(_0x304cb7,_0x33ae9c){return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x304cb7[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x33ae9c,null))[_0x197c('0x24')](removeEntity(_0x33ae9c,null))[_0x197c('0x44')](handleError(_0x33ae9c,null));};exports[_0x197c('0x57')]=function(_0x1e6371,_0x436a53,_0x2c7e66){var _0x1947bd={'raw':!![],'where':{}};var _0x342efa={};var _0x25d3c1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')][_0x197c('0x58')]({'where':{'id':_0x1e6371[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x436a53,null))[_0x197c('0x24')](function(_0x2a03e3){if(_0x2a03e3){_0x342efa['model']=_['keys'](db['CmHopper'][_0x197c('0x2d')]);_0x342efa['query']=_[_0x197c('0x47')](_0x1e6371['query']);_0x342efa['filters']=_[_0x197c('0x35')](_0x342efa[_0x197c('0x31')],_0x342efa[_0x197c('0x33')]);_0x1947bd['attributes']=_[_0x197c('0x35')](_0x342efa[_0x197c('0x31')],qs['fields'](_0x1e6371[_0x197c('0x33')][_0x197c('0x37')]));_0x1947bd[_0x197c('0x36')]=_0x1947bd[_0x197c('0x36')]['length']?_0x1947bd[_0x197c('0x36')]:_0x342efa['model'];if(!_0x1e6371[_0x197c('0x33')]['hasOwnProperty'](_0x197c('0x3a'))){_0x1947bd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x1e6371['query'][_0x197c('0x1b')]);_0x1947bd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x1e6371['query'][_0x197c('0x19')]);}_0x1947bd[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x1e6371[_0x197c('0x33')][_0x197c('0x3c')]);_0x1947bd[_0x197c('0x3d')]=qs['filters'](_[_0x197c('0x59')](_0x1e6371['query'],_0x342efa['filters']));_0x1947bd[_0x197c('0x3d')][_0x197c('0x5a')]=_0x2a03e3['id'];if(_0x1e6371['query'][_0x197c('0x3e')]){_0x1947bd[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x1947bd[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x1947bd['attributes'],function(_0x5da64e){var _0x4ca9b9={};_0x4ca9b9[_0x5da64e]={'$like':'%'+_0x1e6371['query'][_0x197c('0x3e')]+'%'};return _0x4ca9b9;})});}_0x1947bd=_[_0x197c('0x3f')]({},_0x1947bd,_0x1e6371['options']);return db['CmHopper'][_0x197c('0x1c')]({'where':_0x1947bd['where']})['then'](function(_0x2d4b26){_0x25d3c1[_0x197c('0x1c')]=_0x2d4b26;if(_0x1e6371[_0x197c('0x33')][_0x197c('0x41')]){_0x1947bd[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5b')]['findAll'](_0x1947bd);})[_0x197c('0x24')](function(_0x2321e1){_0x25d3c1[_0x197c('0x43')]=_0x2321e1;return _0x25d3c1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x436a53,_0x1947bd))[_0x197c('0x44')](handleError(_0x436a53,null));};exports[_0x197c('0x5c')]=function(_0x4cfcc6,_0x4b332f,_0x15d047){var _0x6c3afd={'raw':!![],'where':{}};var _0x49283d={};var _0x2519a1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')][_0x197c('0x58')]({'where':{'id':_0x4cfcc6['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x4b332f,null))[_0x197c('0x24')](function(_0x530d41){if(_0x530d41){_0x49283d[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x5d')][_0x197c('0x2d')]);_0x49283d[_0x197c('0x33')]=_['keys'](_0x4cfcc6['query']);_0x49283d['filters']=_[_0x197c('0x35')](_0x49283d['model'],_0x49283d['query']);_0x6c3afd[_0x197c('0x36')]=_[_0x197c('0x35')](_0x49283d[_0x197c('0x31')],qs[_0x197c('0x37')](_0x4cfcc6[_0x197c('0x33')]['fields']));_0x6c3afd['attributes']=_0x6c3afd[_0x197c('0x36')][_0x197c('0x38')]?_0x6c3afd['attributes']:_0x49283d[_0x197c('0x31')];if(!_0x4cfcc6[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x6c3afd[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x4cfcc6['query'][_0x197c('0x1b')]);_0x6c3afd[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x4cfcc6[_0x197c('0x33')][_0x197c('0x19')]);}_0x6c3afd['order']=qs['sort'](_0x4cfcc6[_0x197c('0x33')]['sort']);_0x6c3afd[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x4cfcc6[_0x197c('0x33')],_0x49283d[_0x197c('0x34')]));_0x6c3afd['where'][_0x197c('0x5a')]=_0x530d41['id'];if(_0x4cfcc6[_0x197c('0x33')][_0x197c('0x3e')]){_0x6c3afd[_0x197c('0x3d')]=_['merge'](_0x6c3afd['where'],{'$or':_[_0x197c('0x32')](_0x6c3afd['attributes'],function(_0x5505e2){var _0x34b3d6={};_0x34b3d6[_0x5505e2]={'$like':'%'+_0x4cfcc6[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x34b3d6;})});}_0x6c3afd=_['merge']({},_0x6c3afd,_0x4cfcc6['options']);return db[_0x197c('0x5d')][_0x197c('0x1c')]({'where':_0x6c3afd['where']})[_0x197c('0x24')](function(_0x235fce){_0x2519a1['count']=_0x235fce;if(_0x4cfcc6[_0x197c('0x33')][_0x197c('0x41')]){_0x6c3afd['include']=[{'all':!![]}];}return db[_0x197c('0x5d')]['findAll'](_0x6c3afd);})[_0x197c('0x24')](function(_0x18c722){_0x2519a1[_0x197c('0x43')]=_0x18c722;return _0x2519a1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x4b332f,_0x6c3afd))[_0x197c('0x44')](handleError(_0x4b332f,null));};exports['getHopperFinals']=function(_0x2d1b23,_0x41b34c,_0x35269e){var _0x1a684e={'raw':!![],'where':{}};var _0x2bbe66={};var _0x33c765={'count':0x0,'rows':[]};return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x2d1b23[_0x197c('0x46')]['id']}})['then'](handleEntityNotFound(_0x41b34c,null))[_0x197c('0x24')](function(_0x3c3f7a){if(_0x3c3f7a){_0x2bbe66[_0x197c('0x31')]=_[_0x197c('0x47')](db['CmHopperFinal'][_0x197c('0x2d')]);_0x2bbe66[_0x197c('0x33')]=_[_0x197c('0x47')](_0x2d1b23['query']);_0x2bbe66[_0x197c('0x34')]=_[_0x197c('0x35')](_0x2bbe66[_0x197c('0x31')],_0x2bbe66[_0x197c('0x33')]);_0x1a684e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x2bbe66[_0x197c('0x31')],qs['fields'](_0x2d1b23[_0x197c('0x33')]['fields']));_0x1a684e[_0x197c('0x36')]=_0x1a684e[_0x197c('0x36')][_0x197c('0x38')]?_0x1a684e[_0x197c('0x36')]:_0x2bbe66[_0x197c('0x31')];if(!_0x2d1b23['query'][_0x197c('0x39')](_0x197c('0x3a'))){_0x1a684e[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x2d1b23[_0x197c('0x33')]['limit']);_0x1a684e['offset']=qs[_0x197c('0x19')](_0x2d1b23[_0x197c('0x33')][_0x197c('0x19')]);}_0x1a684e[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x2d1b23[_0x197c('0x33')][_0x197c('0x3c')]);_0x1a684e[_0x197c('0x3d')]=qs['filters'](_[_0x197c('0x59')](_0x2d1b23[_0x197c('0x33')],_0x2bbe66['filters']));_0x1a684e[_0x197c('0x3d')][_0x197c('0x5a')]=_0x3c3f7a['id'];if(_0x2d1b23['query'][_0x197c('0x3e')]){_0x1a684e[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x1a684e[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x1a684e['attributes'],function(_0x5563ff){var _0x31fe6a={};_0x31fe6a[_0x5563ff]={'$like':'%'+_0x2d1b23[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x31fe6a;})});}_0x1a684e=_[_0x197c('0x3f')]({},_0x1a684e,_0x2d1b23[_0x197c('0x40')]);return db[_0x197c('0x5e')][_0x197c('0x1c')]({'where':_0x1a684e[_0x197c('0x3d')]})['then'](function(_0xd324a0){_0x33c765[_0x197c('0x1c')]=_0xd324a0;if(_0x2d1b23[_0x197c('0x33')][_0x197c('0x41')]){_0x1a684e[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5e')]['findAll'](_0x1a684e);})[_0x197c('0x24')](function(_0x16c3be){_0x33c765[_0x197c('0x43')]=_0x16c3be;return _0x33c765;});}})['then'](respondWithFilteredResult(_0x41b34c,_0x1a684e))[_0x197c('0x44')](handleError(_0x41b34c,null));};exports['getHopperBlacks']=function(_0x3207ed,_0x24a61d,_0x165b03){var _0x6174a5={'raw':!![],'where':{}};var _0x14040f={};var _0x2141b1={'count':0x0,'rows':[]};return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x3207ed[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x24a61d,null))[_0x197c('0x24')](function(_0x307edb){if(_0x307edb){_0x14040f['model']=_[_0x197c('0x47')](db['CmHopperBlack'][_0x197c('0x2d')]);_0x14040f[_0x197c('0x33')]=_[_0x197c('0x47')](_0x3207ed[_0x197c('0x33')]);_0x14040f['filters']=_[_0x197c('0x35')](_0x14040f[_0x197c('0x31')],_0x14040f[_0x197c('0x33')]);_0x6174a5[_0x197c('0x36')]=_[_0x197c('0x35')](_0x14040f['model'],qs[_0x197c('0x37')](_0x3207ed[_0x197c('0x33')][_0x197c('0x37')]));_0x6174a5[_0x197c('0x36')]=_0x6174a5[_0x197c('0x36')]['length']?_0x6174a5['attributes']:_0x14040f[_0x197c('0x31')];if(!_0x3207ed[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x6174a5[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x3207ed['query'][_0x197c('0x1b')]);_0x6174a5['offset']=qs['offset'](_0x3207ed[_0x197c('0x33')][_0x197c('0x19')]);}_0x6174a5[_0x197c('0x3b')]=qs['sort'](_0x3207ed[_0x197c('0x33')][_0x197c('0x3c')]);_0x6174a5[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x3207ed[_0x197c('0x33')],_0x14040f['filters']));_0x6174a5[_0x197c('0x3d')]['CampaignId']=_0x307edb['id'];if(_0x3207ed[_0x197c('0x33')]['filter']){_0x6174a5[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x6174a5['where'],{'$or':_[_0x197c('0x32')](_0x6174a5[_0x197c('0x36')],function(_0x25ed2c){var _0x24d25a={};_0x24d25a[_0x25ed2c]={'$like':'%'+_0x3207ed[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x24d25a;})});}_0x6174a5=_[_0x197c('0x3f')]({},_0x6174a5,_0x3207ed[_0x197c('0x40')]);return db[_0x197c('0x5f')][_0x197c('0x1c')]({'where':_0x6174a5[_0x197c('0x3d')]})[_0x197c('0x24')](function(_0x4a27ac){_0x2141b1['count']=_0x4a27ac;if(_0x3207ed[_0x197c('0x33')][_0x197c('0x41')]){_0x6174a5[_0x197c('0x48')]=[{'all':!![]}];}return db[_0x197c('0x5f')][_0x197c('0x42')](_0x6174a5);})['then'](function(_0x31d653){_0x2141b1[_0x197c('0x43')]=_0x31d653;return _0x2141b1;});}})[_0x197c('0x24')](respondWithFilteredResult(_0x24a61d,_0x6174a5))[_0x197c('0x44')](handleError(_0x24a61d,null));};exports[_0x197c('0x60')]=function(_0x32370a,_0x18e177,_0x2ce52a){var _0x211abe={};var _0x1e3364={};var _0xc8ecb4;var _0x2b5d20;return db['Campaign']['findOne']({'where':{'id':_0x32370a[_0x197c('0x46')]['id']}})['then'](handleEntityNotFound(_0x18e177,null))[_0x197c('0x24')](function(_0x74def6){if(_0x74def6){_0xc8ecb4=_0x74def6;_0x1e3364[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x61')][_0x197c('0x2d')]);_0x1e3364[_0x197c('0x33')]=_['keys'](_0x32370a[_0x197c('0x33')]);_0x1e3364['filters']=_[_0x197c('0x35')](_0x1e3364[_0x197c('0x31')],_0x1e3364[_0x197c('0x33')]);_0x211abe[_0x197c('0x36')]=_[_0x197c('0x35')](_0x1e3364[_0x197c('0x31')],qs['fields'](_0x32370a[_0x197c('0x33')][_0x197c('0x37')]));_0x211abe[_0x197c('0x36')]=_0x211abe[_0x197c('0x36')][_0x197c('0x38')]?_0x211abe[_0x197c('0x36')]:_0x1e3364[_0x197c('0x31')];_0x211abe[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x32370a[_0x197c('0x33')]['sort']);_0x211abe[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x32370a[_0x197c('0x33')],_0x1e3364[_0x197c('0x34')]));if(_0x32370a[_0x197c('0x33')][_0x197c('0x3e')]){_0x211abe[_0x197c('0x3d')]=_['merge'](_0x211abe[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x211abe[_0x197c('0x36')],function(_0x4f92e2){var _0x1eee91={};_0x1eee91[_0x4f92e2]={'$like':'%'+_0x32370a[_0x197c('0x33')]['filter']+'%'};return _0x1eee91;})});}_0x211abe=_[_0x197c('0x3f')]({},_0x211abe,_0x32370a[_0x197c('0x40')]);return _0xc8ecb4['getLists'](_0x211abe);}})[_0x197c('0x24')](function(_0x2dcb84){if(_0x2dcb84){_0x2b5d20=_0x2dcb84[_0x197c('0x38')];if(!_0x32370a[_0x197c('0x33')][_0x197c('0x39')](_0x197c('0x3a'))){_0x211abe[_0x197c('0x1b')]=qs[_0x197c('0x1b')](_0x32370a['query']['limit']);_0x211abe[_0x197c('0x19')]=qs['offset'](_0x32370a[_0x197c('0x33')][_0x197c('0x19')]);}return _0xc8ecb4[_0x197c('0x60')](_0x211abe);}})['then'](function(_0x2fb26b){if(_0x2fb26b){return _0x2fb26b?{'count':_0x2b5d20,'rows':_0x2fb26b}:null;}})[_0x197c('0x24')](respondWithResult(_0x18e177,null))[_0x197c('0x44')](handleError(_0x18e177,null));};exports[_0x197c('0x62')]=function(_0x29e6ee,_0x57d9a4,_0x499624){var _0x29c93c,_0x27285d;var _0x478431=[];var _0x1db087=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x197c('0x55')]({'where':{'id':_0x29e6ee[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x57d9a4,null))[_0x197c('0x24')](function(_0x277247){if(_0x277247){_0x27285d=_0x277247;return _0x277247[_0x197c('0x62')](_0x29e6ee[_0x197c('0x4a')][_0x197c('0x63')],_[_0x197c('0x64')](_0x29e6ee['body'],[_0x197c('0x63'),'id'])||{});}return null;})[_0x197c('0x65')](function(_0x4675d3){var _0x1355e6;var _0x53cd6e;_0x29c93c=_0x4675d3||[];var _0x201ed7=[];if(_0x4675d3){for(var _0x283fa4=0x0;_0x283fa4<_0x4675d3[_0x197c('0x38')];_0x283fa4+=0x1){var _0x48ca1a=_0x4675d3[_0x283fa4][_0x197c('0x26')]({'plain':!![]});_0x27285d['dialCheckDuplicateType']=_0x29e6ee[_0x197c('0x4a')][_0x197c('0x66')]?_0x29e6ee[_0x197c('0x4a')][_0x197c('0x66')]:_0x27285d['dialCheckDuplicateType'];switch(_0x27285d['dialCheckDuplicateType']){case _0x197c('0x67'):_0x1355e6=squel['insert']()['into'](_0x197c('0x68'))[_0x197c('0x69')](['phone',_0x197c('0x6a'),_0x197c('0x6b'),_0x197c('0x6c'),_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel['select']()[_0x197c('0x6d')](_0x197c('0x6e'),_0x197c('0x6e'))[_0x197c('0x6d')](_0x197c('0x6f'),'scheduledAt')[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')](),_0x197c('0x5a'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')](_0x197c('0x73'))[_0x197c('0x3d')](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x48ca1a[_0x197c('0x70')]['toString']())[_0x197c('0x3d')](_0x197c('0x76'))['where'](_0x197c('0x77'),squel['select']()[_0x197c('0x6d')](_0x197c('0x78'))[_0x197c('0x72')](_0x197c('0x79'))[_0x197c('0x3d')](_0x197c('0x7a'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x7c'))[_0x197c('0x72')](_0x197c('0x68'))[_0x197c('0x3d')](_0x197c('0x7a'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]())))[_0x197c('0x71')]();break;case'onlyIfOpen':_0x1355e6=squel[_0x197c('0x7d')]()[_0x197c('0x7e')](_0x197c('0x68'))[_0x197c('0x69')]([_0x197c('0x6e'),_0x197c('0x6a'),'ContactId',_0x197c('0x6c'),_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')]('phone',_0x197c('0x6e'))[_0x197c('0x6d')]('NOW()',_0x197c('0x6a'))[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))['field'](_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')](),_0x197c('0x5a'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')]('cm_contacts')['where'](_0x197c('0x74'))['where'](_0x197c('0x75'),_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')]())[_0x197c('0x3d')](_0x197c('0x76'))[_0x197c('0x3d')](_0x197c('0x77'),squel['select']()[_0x197c('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0x197c('0x68'))[_0x197c('0x3d')]('CampaignId\x20=\x20?',_0x29e6ee['params']['id'][_0x197c('0x71')]())))[_0x197c('0x71')]();break;default:_0x1355e6=squel['insert']()[_0x197c('0x7e')](_0x197c('0x68'))[_0x197c('0x69')]([_0x197c('0x6e'),'scheduledAt',_0x197c('0x6b'),'ListId','CampaignId',_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x6e'),'phone')[_0x197c('0x6d')]('NOW()','scheduledAt')[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x29e6ee['params']['id'][_0x197c('0x71')](),'CampaignId')[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27','updatedAt')['from'](_0x197c('0x73'))[_0x197c('0x3d')](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x48ca1a['CmListId'][_0x197c('0x71')]())['where'](_0x197c('0x76')))[_0x197c('0x71')]();}_0x53cd6e=squel[_0x197c('0x7d')]()[_0x197c('0x7e')]('cm_hopper_additional_phones')[_0x197c('0x69')]([_0x197c('0x7f'),_0x197c('0x6a'),_0x197c('0x6e'),_0x197c('0x80'),_0x197c('0x53'),'updatedAt'],squel[_0x197c('0x7b')]()[_0x197c('0x6d')](_0x197c('0x81'),'id')[_0x197c('0x6d')](_0x197c('0x6f'),'scheduledAt')[_0x197c('0x6d')]('ci.item','phone')[_0x197c('0x6d')]('ci.OrderBY',_0x197c('0x80'))[_0x197c('0x6d')]('\x27'+_0x1db087+'\x27',_0x197c('0x53'))['field']('\x27'+_0x1db087+'\x27',_0x197c('0x54'))[_0x197c('0x72')](_0x197c('0x82'),'ci')[_0x197c('0x83')](_0x197c('0x68'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x197c('0x3d')](_0x197c('0x84'),_0x48ca1a[_0x197c('0x70')][_0x197c('0x71')]())['where'](_0x197c('0x85'),_0x29e6ee[_0x197c('0x46')]['id'][_0x197c('0x71')]())['where']('h.createdAt\x20=\x20?',_0x1db087))[_0x197c('0x71')]();_0x201ed7[_0x197c('0x86')](db[_0x197c('0x87')]['query'](_0x1355e6));_0x478431[_0x197c('0x86')](db['sequelize'][_0x197c('0x33')](_0x53cd6e));}return BPromise[_0x197c('0x88')](_0x201ed7);}})[_0x197c('0x24')](function(){return BPromise[_0x197c('0x88')](_0x478431);})[_0x197c('0x24')](function(){return _0x29c93c;})[_0x197c('0x24')](respondWithResult(_0x57d9a4,null))[_0x197c('0x44')](handleError(_0x57d9a4,null));};exports[_0x197c('0x89')]=function(_0x5e326f,_0x160a1,_0x62c16c){return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x5e326f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x160a1,null))[_0x197c('0x24')](function(_0x55476f){if(_0x55476f){return _0x55476f[_0x197c('0x89')](_0x5e326f[_0x197c('0x33')][_0x197c('0x63')]);}})[_0x197c('0x24')](function(_0x1daa31){if(_0x1daa31){return db[_0x197c('0x5b')]['destroy']({'where':{'ListId':_0x5e326f[_0x197c('0x33')][_0x197c('0x63')],'CampaignId':_0x5e326f[_0x197c('0x46')]['id']}})[_0x197c('0x24')](function(){return _0x1daa31;});}})[_0x197c('0x24')](respondWithStatusCode(_0x160a1,null))[_0x197c('0x44')](handleError(_0x160a1,null));};exports[_0x197c('0x8a')]=function(_0x36ae6c,_0x3d4d3b,_0x522cbb){var _0x4b599e={};var _0x4bc033={};var _0x2bfbb0;var _0x44f647;return db[_0x197c('0x2c')]['findOne']({'where':{'id':_0x36ae6c['params']['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x3d4d3b,null))[_0x197c('0x24')](function(_0x1568c2){if(_0x1568c2){_0x2bfbb0=_0x1568c2;_0x4bc033[_0x197c('0x31')]=_[_0x197c('0x47')](db[_0x197c('0x61')]['rawAttributes']);_0x4bc033[_0x197c('0x33')]=_['keys'](_0x36ae6c[_0x197c('0x33')]);_0x4bc033['filters']=_[_0x197c('0x35')](_0x4bc033[_0x197c('0x31')],_0x4bc033[_0x197c('0x33')]);_0x4b599e[_0x197c('0x36')]=_[_0x197c('0x35')](_0x4bc033[_0x197c('0x31')],qs[_0x197c('0x37')](_0x36ae6c[_0x197c('0x33')][_0x197c('0x37')]));_0x4b599e['attributes']=_0x4b599e[_0x197c('0x36')][_0x197c('0x38')]?_0x4b599e[_0x197c('0x36')]:_0x4bc033[_0x197c('0x31')];_0x4b599e[_0x197c('0x3b')]=qs[_0x197c('0x3c')](_0x36ae6c[_0x197c('0x33')][_0x197c('0x3c')]);_0x4b599e[_0x197c('0x3d')]=qs[_0x197c('0x34')](_[_0x197c('0x59')](_0x36ae6c[_0x197c('0x33')],_0x4bc033[_0x197c('0x34')]));if(_0x36ae6c[_0x197c('0x33')][_0x197c('0x3e')]){_0x4b599e[_0x197c('0x3d')]=_[_0x197c('0x3f')](_0x4b599e[_0x197c('0x3d')],{'$or':_[_0x197c('0x32')](_0x4b599e['attributes'],function(_0x2d9880){var _0x12f785={};_0x12f785[_0x2d9880]={'$like':'%'+_0x36ae6c[_0x197c('0x33')][_0x197c('0x3e')]+'%'};return _0x12f785;})});}_0x4b599e=_[_0x197c('0x3f')]({},_0x4b599e,_0x36ae6c[_0x197c('0x40')]);return _0x2bfbb0[_0x197c('0x8a')](_0x4b599e);}})[_0x197c('0x24')](function(_0x5b578b){if(_0x5b578b){_0x44f647=_0x5b578b['length'];if(!_0x36ae6c['query'][_0x197c('0x39')](_0x197c('0x3a'))){_0x4b599e['limit']=qs[_0x197c('0x1b')](_0x36ae6c[_0x197c('0x33')]['limit']);_0x4b599e[_0x197c('0x19')]=qs[_0x197c('0x19')](_0x36ae6c['query'][_0x197c('0x19')]);}return _0x2bfbb0[_0x197c('0x8a')](_0x4b599e);}})['then'](function(_0x366bf0){if(_0x366bf0){return _0x366bf0?{'count':_0x44f647,'rows':_0x366bf0}:null;}})[_0x197c('0x24')](respondWithResult(_0x3d4d3b,null))[_0x197c('0x44')](handleError(_0x3d4d3b,null));};exports['addBlackLists']=function(_0x45bdad,_0x21071b,_0x8f048){var _0x10f469,_0x48e103;var _0xbfdf5a=[];var _0x4f2c75=moment()[_0x197c('0x8b')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x45bdad['params']['id']}})['then'](handleEntityNotFound(_0x21071b,null))[_0x197c('0x24')](function(_0x1c608c){if(_0x1c608c){_0x48e103=_0x1c608c;return _0x1c608c[_0x197c('0x8c')](_0x45bdad[_0x197c('0x4a')][_0x197c('0x63')],_[_0x197c('0x64')](_0x45bdad[_0x197c('0x4a')],[_0x197c('0x63'),'id'])||{});}return null;})[_0x197c('0x65')](function(_0x43b746){var _0xd42353;var _0x4ccaff;_0x10f469=_0x43b746||[];var _0x109daf=[];if(_0x43b746){for(var _0x3658c9=0x0;_0x3658c9<_0x43b746[_0x197c('0x38')];_0x3658c9+=0x1){var _0x264af2=_0x43b746[_0x3658c9]['get']({'plain':!![]});_0xd42353=squel[_0x197c('0x7d')]()[_0x197c('0x7e')]('cm_hopper_black')[_0x197c('0x69')]([_0x197c('0x6e'),_0x197c('0x6b'),'ListId',_0x197c('0x5a'),_0x197c('0x53'),_0x197c('0x54')],squel[_0x197c('0x7b')]()[_0x197c('0x6d')]('phone',_0x197c('0x6e'))[_0x197c('0x6d')]('id',_0x197c('0x6b'))[_0x197c('0x6d')](_0x264af2[_0x197c('0x70')][_0x197c('0x71')](),_0x197c('0x6c'))[_0x197c('0x6d')](_0x45bdad[_0x197c('0x46')]['id'][_0x197c('0x71')](),'CampaignId')[_0x197c('0x6d')](_0x197c('0x6f'),_0x197c('0x53'))[_0x197c('0x6d')](_0x197c('0x6f'),'updatedAt')['from'](_0x197c('0x73'))['where'](_0x197c('0x74'))[_0x197c('0x3d')](_0x197c('0x75'),_0x264af2[_0x197c('0x70')][_0x197c('0x71')]())[_0x197c('0x3d')](_0x197c('0x76')))['toString']();_0x109daf[_0x197c('0x86')](db[_0x197c('0x87')]['query'](_0xd42353));}return BPromise[_0x197c('0x88')](_0x109daf);}})[_0x197c('0x24')](function(){return _0x10f469;})[_0x197c('0x24')](respondWithResult(_0x21071b,null))['catch'](handleError(_0x21071b,null));};exports[_0x197c('0x8d')]=function(_0x2eebbb,_0x43ca15,_0x22a786){return db[_0x197c('0x2c')][_0x197c('0x55')]({'where':{'id':_0x2eebbb[_0x197c('0x46')]['id']}})[_0x197c('0x24')](handleEntityNotFound(_0x43ca15,null))['then'](function(_0x12fb25){if(_0x12fb25){return _0x12fb25[_0x197c('0x8d')](_0x2eebbb[_0x197c('0x33')][_0x197c('0x63')]);}})[_0x197c('0x24')](function(_0x498cd6){if(_0x498cd6){return db['CmHopperBlack'][_0x197c('0x25')]({'where':{'ListId':_0x2eebbb[_0x197c('0x33')]['ids'],'CampaignId':_0x2eebbb[_0x197c('0x46')]['id']}})['then'](function(){return _0x498cd6;});}})[_0x197c('0x24')](respondWithStatusCode(_0x43ca15,null))['catch'](handleError(_0x43ca15,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 7770169..adc08af 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(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x7a54,0x106));var _0x47a5=function(_0x1148c4,_0x490d09){_0x1148c4=_0x1148c4-0x0;var _0x4abd1d=_0x7a54[_0x1148c4];return _0x4abd1d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 9036268..dc7268c 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 _0x4ef1=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','bluebird'];(function(_0x170f4c,_0x4a4c80){var _0x52eedd=function(_0x473905){while(--_0x473905){_0x170f4c['push'](_0x170f4c['shift']());}};_0x52eedd(++_0x4a4c80);}(_0x4ef1,0xeb));var _0x14ef=function(_0x5a6dc5,_0x4a7a46){_0x5a6dc5=_0x5a6dc5-0x0;var _0x2b6dcd=_0x4ef1[_0x5a6dc5];return _0x2b6dcd;};'use strict';var _=require(_0x14ef('0x0'));var util=require(_0x14ef('0x1'));var moment=require('moment');var BPromise=require(_0x14ef('0x2'));var rs=require(_0x14ef('0x3'));var fs=require('fs');var Redis=require(_0x14ef('0x4'));var db=require(_0x14ef('0x5'))['db'];var utils=require(_0x14ef('0x6'));var logger=require(_0x14ef('0x7'))(_0x14ef('0x8'));var config=require(_0x14ef('0x9'));var jayson=require(_0x14ef('0xa'));var client=jayson[_0x14ef('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261fa2,_0x2dc335,_0x5b75ad){return new BPromise(function(_0x4175e7,_0x2ab217){return client[_0x14ef('0xc')](_0x261fa2,_0x5b75ad)[_0x14ef('0xd')](function(_0x17acc1){logger['info'](_0x14ef('0xe'),_0x2dc335,'request\x20sent');logger[_0x14ef('0xf')](_0x14ef('0x10'),_0x2dc335,_0x14ef('0x11'),JSON[_0x14ef('0x12')](_0x17acc1));if(_0x17acc1['error']){if(_0x17acc1['error'][_0x14ef('0x13')]===0x1f4){logger[_0x14ef('0x14')]('Campaign,\x20%s,\x20%s',_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x2ab217(_0x17acc1[_0x14ef('0x14')]['message']);}logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x17acc1[_0x14ef('0x14')][_0x14ef('0x15')]);return _0x4175e7(_0x17acc1['error'][_0x14ef('0x15')]);}else{logger[_0x14ef('0x16')](_0x14ef('0xe'),_0x2dc335,_0x14ef('0x11'));_0x4175e7(_0x17acc1['result'][_0x14ef('0x15')]);}})[_0x14ef('0x17')](function(_0x24556b){logger[_0x14ef('0x14')](_0x14ef('0xe'),_0x2dc335,_0x24556b);_0x2ab217(_0x24556b);});});}exports[_0x14ef('0x18')]=function(_0x17f63a){var _0x1acc0a=this;return new Promise(function(_0x19b2cb,_0x3b5b23){return db[_0x14ef('0x19')][_0x14ef('0x1a')]({'raw':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1c')]||null:null,'attributes':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1d')]||null:null,'limit':_0x17f63a[_0x14ef('0x1b')]?_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1e')]||null:null,'include':_0x17f63a['options']?_0x17f63a[_0x14ef('0x1b')]['include']?_['map'](_0x17f63a[_0x14ef('0x1b')][_0x14ef('0x1f')],function(_0x37bb6f){return{'model':db[_0x37bb6f[_0x14ef('0x20')]],'as':_0x37bb6f['as'],'attributes':_0x37bb6f[_0x14ef('0x1d')],'include':_0x37bb6f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x37bb6f[_0x14ef('0x1f')],function(_0x45105f){return{'model':db[_0x45105f[_0x14ef('0x20')]],'as':_0x45105f['as'],'attributes':_0x45105f['attributes'],'include':_0x45105f[_0x14ef('0x1f')]?_[_0x14ef('0x21')](_0x45105f[_0x14ef('0x1f')],function(_0x21a176){return{'model':db[_0x21a176[_0x14ef('0x20')]],'as':_0x21a176['as'],'attributes':_0x21a176[_0x14ef('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa0178d){logger['info']('GetCampaign',_0x17f63a);logger[_0x14ef('0xf')](_0x14ef('0x18'),_0x17f63a,JSON[_0x14ef('0x12')](_0xa0178d));_0x19b2cb(_0xa0178d);})[_0x14ef('0x17')](function(_0x38f5e9){logger[_0x14ef('0x14')](_0x14ef('0x18'),_0x38f5e9[_0x14ef('0x15')],_0x17f63a);_0x3b5b23(_0x1acc0a['error'](0x1f4,_0x38f5e9[_0x14ef('0x15')]));});});};
\ No newline at end of file
+var _0xde64=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetCampaign','Campaign','findAll','options','raw','where','limit','map','include','model','attributes','debug','lodash','util','moment','bluebird'];(function(_0x4330fb,_0x25240c){var _0xbd081a=function(_0x42bf28){while(--_0x42bf28){_0x4330fb['push'](_0x4330fb['shift']());}};_0xbd081a(++_0x25240c);}(_0xde64,0x17c));var _0x4de6=function(_0x2499c0,_0xd1f953){_0x2499c0=_0x2499c0-0x0;var _0x291404=_0xde64[_0x2499c0];return _0x291404;};'use strict';var _=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var moment=require(_0x4de6('0x2'));var BPromise=require(_0x4de6('0x3'));var rs=require(_0x4de6('0x4'));var fs=require('fs');var Redis=require(_0x4de6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de6('0x6'));var logger=require(_0x4de6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4de6('0x8'));var client=jayson[_0x4de6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568496,_0x24edef,_0x35ae72){return new BPromise(function(_0x475fb9,_0x248e39){return client[_0x4de6('0xa')](_0x568496,_0x35ae72)[_0x4de6('0xb')](function(_0x48a974){logger[_0x4de6('0xc')](_0x4de6('0xd'),_0x24edef,_0x4de6('0xe'));logger['debug'](_0x4de6('0xf'),_0x24edef,_0x4de6('0xe'),JSON[_0x4de6('0x10')](_0x48a974));if(_0x48a974[_0x4de6('0x11')]){if(_0x48a974[_0x4de6('0x11')]['code']===0x1f4){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974[_0x4de6('0x11')]['message']);return _0x248e39(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x48a974['error'][_0x4de6('0x12')]);return _0x475fb9(_0x48a974[_0x4de6('0x11')][_0x4de6('0x12')]);}else{logger['info'](_0x4de6('0xd'),_0x24edef,'request\x20sent');_0x475fb9(_0x48a974['result'][_0x4de6('0x12')]);}})[_0x4de6('0x13')](function(_0x6dbcf3){logger[_0x4de6('0x11')](_0x4de6('0xd'),_0x24edef,_0x6dbcf3);_0x248e39(_0x6dbcf3);});});}exports[_0x4de6('0x14')]=function(_0x324202){var _0x5aacb4=this;return new Promise(function(_0x420f7c,_0xea1610){return db[_0x4de6('0x15')][_0x4de6('0x16')]({'raw':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x18')]===undefined?!![]:![]:!![],'where':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x19')]||null:null,'attributes':_0x324202['options']?_0x324202[_0x4de6('0x17')]['attributes']||null:null,'limit':_0x324202[_0x4de6('0x17')]?_0x324202[_0x4de6('0x17')][_0x4de6('0x1a')]||null:null,'include':_0x324202['options']?_0x324202[_0x4de6('0x17')]['include']?_[_0x4de6('0x1b')](_0x324202[_0x4de6('0x17')][_0x4de6('0x1c')],function(_0x5ddbab){return{'model':db[_0x5ddbab[_0x4de6('0x1d')]],'as':_0x5ddbab['as'],'attributes':_0x5ddbab[_0x4de6('0x1e')],'include':_0x5ddbab[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x5ddbab[_0x4de6('0x1c')],function(_0x25a76b){return{'model':db[_0x25a76b[_0x4de6('0x1d')]],'as':_0x25a76b['as'],'attributes':_0x25a76b['attributes'],'include':_0x25a76b[_0x4de6('0x1c')]?_[_0x4de6('0x1b')](_0x25a76b[_0x4de6('0x1c')],function(_0x327215){return{'model':db[_0x327215[_0x4de6('0x1d')]],'as':_0x327215['as'],'attributes':_0x327215[_0x4de6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4de6('0xb')](function(_0x7bc61e){logger[_0x4de6('0xc')]('GetCampaign',_0x324202);logger[_0x4de6('0x1f')](_0x4de6('0x14'),_0x324202,JSON[_0x4de6('0x10')](_0x7bc61e));_0x420f7c(_0x7bc61e);})[_0x4de6('0x13')](function(_0x24a0a7){logger['error'](_0x4de6('0x14'),_0x24a0a7['message'],_0x324202);_0xea1610(_0x5aacb4[_0x4de6('0x11')](0x1f4,_0x24a0a7[_0x4de6('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 7dd31ea..2a5ab09 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 _0xfeff=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util'];(function(_0x2c47d7,_0x42b567){var _0x41ca0b=function(_0x45e9ba){while(--_0x45e9ba){_0x2c47d7['push'](_0x2c47d7['shift']());}};_0x41ca0b(++_0x42b567);}(_0xfeff,0xe5));var _0xffef=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xfeff[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0xffef('0x0'));var util=require(_0xffef('0x1'));var path=require(_0xffef('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xffef('0x3'));var interaction=require(_0xffef('0x4'));var config=require(_0xffef('0x5'));var controller=require(_0xffef('0x6'));router[_0xffef('0x7')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x9')]);router['get'](_0xffef('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xffef('0x7')](_0xffef('0xb'),auth['isAuthenticated'](),controller[_0xffef('0xc')]);router[_0xffef('0x7')](_0xffef('0xd'),auth['isAuthenticated'](),controller[_0xffef('0xe')]);router[_0xffef('0x7')](_0xffef('0xf'),auth[_0xffef('0x8')](),controller['getHopperFinals']);router['get'](_0xffef('0x10'),auth[_0xffef('0x8')](),controller[_0xffef('0x11')]);router['get'](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x13')]);router['get'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x15')]);router[_0xffef('0x16')]('/',auth[_0xffef('0x8')](),controller[_0xffef('0x17')]);router[_0xffef('0x16')](_0xffef('0x18'),auth[_0xffef('0x8')](),controller['clone']);router[_0xffef('0x16')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x19')]);router['post'](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1a')]);router['put']('/:id',auth[_0xffef('0x8')](),controller[_0xffef('0x1b')]);router[_0xffef('0x1c')](_0xffef('0xa'),auth[_0xffef('0x8')](),controller[_0xffef('0x1d')]);router[_0xffef('0x1c')](_0xffef('0x12'),auth[_0xffef('0x8')](),controller[_0xffef('0x1e')]);router[_0xffef('0x1c')](_0xffef('0x14'),auth[_0xffef('0x8')](),controller[_0xffef('0x1f')]);module[_0xffef('0x20')]=router;
\ No newline at end of file
+var _0xbaae=['index','get','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','update','delete','removeBlackLists','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x58a4ac,_0x43fd42){var _0x545810=function(_0x308e65){while(--_0x308e65){_0x58a4ac['push'](_0x58a4ac['shift']());}};_0x545810(++_0x43fd42);}(_0xbaae,0x182));var _0xebaa=function(_0x1c0f97,_0x83214b){_0x1c0f97=_0x1c0f97-0x0;var _0x1ea59d=_0xbaae[_0x1c0f97];return _0x1ea59d;};'use strict';var multer=require(_0xebaa('0x0'));var util=require(_0xebaa('0x1'));var path=require(_0xebaa('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xebaa('0x3')]();var fs_extra=require(_0xebaa('0x4'));var auth=require(_0xebaa('0x5'));var interaction=require(_0xebaa('0x6'));var config=require(_0xebaa('0x7'));var controller=require(_0xebaa('0x8'));router['get']('/',auth[_0xebaa('0x9')](),controller[_0xebaa('0xa')]);router[_0xebaa('0xb')](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller[_0xebaa('0xd')]);router[_0xebaa('0xb')](_0xebaa('0xe'),auth[_0xebaa('0x9')](),controller['getHoppers']);router[_0xebaa('0xb')](_0xebaa('0xf'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x10')]);router['get'](_0xebaa('0x11'),auth[_0xebaa('0x9')](),controller['getHopperFinals']);router[_0xebaa('0xb')](_0xebaa('0x12'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0xebaa('0xb')]('/:id/lists',auth[_0xebaa('0x9')](),controller[_0xebaa('0x13')]);router[_0xebaa('0xb')](_0xebaa('0x14'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xebaa('0x16')]);router[_0xebaa('0x17')](_0xebaa('0x18'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x19')]);router[_0xebaa('0x17')](_0xebaa('0x1a'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x1b')]);router[_0xebaa('0x17')](_0xebaa('0x14'),auth['isAuthenticated'](),controller[_0xebaa('0x1c')]);router['put'](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller[_0xebaa('0x1d')]);router[_0xebaa('0x1e')](_0xebaa('0xc'),auth[_0xebaa('0x9')](),controller['destroy']);router[_0xebaa('0x1e')](_0xebaa('0x1a'),auth[_0xebaa('0x9')](),controller['removeLists']);router['delete']('/:id/blacklists',auth[_0xebaa('0x9')](),controller[_0xebaa('0x1f')]);module[_0xebaa('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 0f12e20..c87ba0b 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 _0x9470=['exports','STRING','TEXT','getDataValue','key'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x9470,0x118));var _0x0947=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x9470[_0x3cb6dc];return _0x47ec89;};'use strict';var Sequelize=require('sequelize');module[_0x0947('0x0')]={'key':{'type':Sequelize[_0x0947('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x0947('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x0947('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0947('0x3')](_0x0947('0x4'));}}};
\ No newline at end of file
+var _0x5457=['medium','STRING','VIRTUAL','key','sequelize','TEXT'];(function(_0x33a645,_0x341973){var _0x40761d=function(_0x41a222){while(--_0x41a222){_0x33a645['push'](_0x33a645['shift']());}};_0x40761d(++_0x341973);}(_0x5457,0x70));var _0x7545=function(_0x5611af,_0x4f0e4d){_0x5611af=_0x5611af-0x0;var _0x11723d=_0x5457[_0x5611af];return _0x11723d;};'use strict';var Sequelize=require(_0x7545('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x7545('0x1')],'length':_0x7545('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7545('0x3')]},'name':{'type':Sequelize[_0x7545('0x4')],'get':function(){return this['getDataValue'](_0x7545('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 04020a0..6781a3c 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 _0xca06=['key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','CannedAnswers','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','end','name','send','index','fieldName','type'];(function(_0x22a2b2,_0xa9f5b3){var _0x1ee264=function(_0x1ccc7f){while(--_0x1ccc7f){_0x22a2b2['push'](_0x22a2b2['shift']());}};_0x1ee264(++_0xa9f5b3);}(_0xca06,0x1d7));var _0x6ca0=function(_0xa0b91b,_0x2e2a5d){_0xa0b91b=_0xa0b91b-0x0;var _0x23196b=_0xca06[_0xa0b91b];return _0x23196b;};'use strict';var emlformat=require(_0x6ca0('0x0'));var rimraf=require(_0x6ca0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ca0('0x2'));var moment=require('moment');var BPromise=require(_0x6ca0('0x3'));var Mustache=require(_0x6ca0('0x4'));var util=require(_0x6ca0('0x5'));var path=require('path');var sox=require(_0x6ca0('0x6'));var csv=require('to-csv');var ejs=require(_0x6ca0('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca0('0x8'));var _=require(_0x6ca0('0x9'));var squel=require(_0x6ca0('0xa'));var crypto=require(_0x6ca0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6ca0('0xc'));var toCsv=require(_0x6ca0('0xd'));var querystring=require(_0x6ca0('0xe'));var Papa=require(_0x6ca0('0xf'));var Redis=require(_0x6ca0('0x10'));var authService=require(_0x6ca0('0x11'));var qs=require(_0x6ca0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ca0('0x13'));var logger=require(_0x6ca0('0x14'))('api');var utils=require(_0x6ca0('0x15'));var config=require(_0x6ca0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca0('0x17'))['db'];function respondWithStatusCode(_0xc52007,_0x19b662){_0x19b662=_0x19b662||0xcc;return function(_0x1d4ff4){if(_0x1d4ff4){return _0xc52007[_0x6ca0('0x18')](_0x19b662);}return _0xc52007[_0x6ca0('0x19')](_0x19b662)['end']();};}function respondWithResult(_0x3a008f,_0x1a27eb){_0x1a27eb=_0x1a27eb||0xc8;return function(_0x59e607){if(_0x59e607){return _0x3a008f[_0x6ca0('0x19')](_0x1a27eb)[_0x6ca0('0x1a')](_0x59e607);}};}function respondWithFilteredResult(_0x57aa6a,_0xfb12cd){return function(_0x3b7926){if(_0x3b7926){var _0x450696=typeof _0xfb12cd['offset']===_0x6ca0('0x1b')&&typeof _0xfb12cd[_0x6ca0('0x1c')]==='undefined';var _0xd26cec=_0x3b7926['count'];var _0x1a1ded=_0x450696?0x0:_0xfb12cd[_0x6ca0('0x1d')];var _0x47a189=_0x450696?_0x3b7926[_0x6ca0('0x1e')]:_0xfb12cd[_0x6ca0('0x1d')]+_0xfb12cd['limit'];var _0x1c0d22;if(_0x47a189>=_0xd26cec){_0x47a189=_0xd26cec;_0x1c0d22=0xc8;}else{_0x1c0d22=0xce;}_0x57aa6a[_0x6ca0('0x19')](_0x1c0d22);return _0x57aa6a[_0x6ca0('0x1f')](_0x6ca0('0x20'),_0x1a1ded+'-'+_0x47a189+'/'+_0xd26cec)[_0x6ca0('0x1a')](_0x3b7926);}return null;};}function patchUpdates(_0x5e9d62){return function(_0x116a2c){try{jsonpatch['apply'](_0x116a2c,_0x5e9d62,!![]);}catch(_0x554c25){return BPromise[_0x6ca0('0x21')](_0x554c25);}return _0x116a2c['save']();};}function saveUpdates(_0x33126d,_0x5ebff6){return function(_0x5ba278){if(_0x5ba278){return _0x5ba278[_0x6ca0('0x22')](_0x33126d)[_0x6ca0('0x23')](function(_0x3601e3){return _0x3601e3;});}return null;};}function removeEntity(_0x128bc8,_0x357394){return function(_0x5098fd){if(_0x5098fd){return _0x5098fd[_0x6ca0('0x24')]()[_0x6ca0('0x23')](function(){var _0x26f0be=_0x5098fd[_0x6ca0('0x25')]({'plain':!![]});var _0x32e64b='CannedAnswers';return db[_0x6ca0('0x26')][_0x6ca0('0x24')]({'where':{'type':_0x32e64b,'resourceId':_0x26f0be['id']}})[_0x6ca0('0x23')](function(){return _0x5098fd;});})[_0x6ca0('0x23')](function(){_0x128bc8[_0x6ca0('0x19')](0xcc)[_0x6ca0('0x27')]();});}};}function handleEntityNotFound(_0xa198d8,_0x1d2258){return function(_0x2da691){if(!_0x2da691){_0xa198d8[_0x6ca0('0x18')](0x194);}return _0x2da691;};}function handleError(_0x1b54cd,_0x4e745f){_0x4e745f=_0x4e745f||0x1f4;return function(_0x2eae5e){logger['error'](_0x2eae5e['stack']);if(_0x2eae5e[_0x6ca0('0x28')]){delete _0x2eae5e['name'];}_0x1b54cd[_0x6ca0('0x19')](_0x4e745f)[_0x6ca0('0x29')](_0x2eae5e);};}exports[_0x6ca0('0x2a')]=function(_0x163369,_0x10c112){var _0x1bf32d={},_0x3dd149={},_0xd1db2={'count':0x0,'rows':[]};var _0x358047=_['map'](db['CannedAnswer']['rawAttributes'],function(_0x14ae83){return{'name':_0x14ae83[_0x6ca0('0x2b')],'type':_0x14ae83[_0x6ca0('0x2c')][_0x6ca0('0x2d')]};});_0x3dd149[_0x6ca0('0x2e')]=_['map'](_0x358047,'name');_0x3dd149['query']=_[_0x6ca0('0x2f')](_0x163369['query']);_0x3dd149['filters']=_[_0x6ca0('0x30')](_0x3dd149[_0x6ca0('0x2e')],_0x3dd149[_0x6ca0('0x31')]);_0x1bf32d[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x3dd149['model'],qs['fields'](_0x163369['query'][_0x6ca0('0x33')]));_0x1bf32d[_0x6ca0('0x32')]=_0x1bf32d[_0x6ca0('0x32')][_0x6ca0('0x34')]?_0x1bf32d[_0x6ca0('0x32')]:_0x3dd149[_0x6ca0('0x2e')];if(!_0x163369['query'][_0x6ca0('0x35')](_0x6ca0('0x36'))){_0x1bf32d['limit']=qs[_0x6ca0('0x1c')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x1c')]);_0x1bf32d[_0x6ca0('0x1d')]=qs[_0x6ca0('0x1d')](_0x163369['query'][_0x6ca0('0x1d')]);}_0x1bf32d[_0x6ca0('0x37')]=qs[_0x6ca0('0x38')](_0x163369[_0x6ca0('0x31')][_0x6ca0('0x38')]);_0x1bf32d[_0x6ca0('0x39')]=qs[_0x6ca0('0x3a')](_[_0x6ca0('0x3b')](_0x163369[_0x6ca0('0x31')],_0x3dd149[_0x6ca0('0x3a')]),_0x358047);if(_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]){_0x1bf32d['where']=_[_0x6ca0('0x3d')](_0x1bf32d[_0x6ca0('0x39')],{'$or':[{'key':{'$like':'%'+_0x163369[_0x6ca0('0x31')][_0x6ca0('0x3c')]+'%'}},{'value':{'$like':'%'+_0x163369['query'][_0x6ca0('0x3c')]+'%'}}]});}_0x1bf32d=_[_0x6ca0('0x3d')]({},_0x1bf32d,_0x163369[_0x6ca0('0x3e')]);var _0x4dbeeb={'where':_0x1bf32d[_0x6ca0('0x39')]};return db[_0x6ca0('0x3f')]['count'](_0x4dbeeb)[_0x6ca0('0x23')](function(_0x405e79){_0xd1db2['count']=_0x405e79;if(_0x163369['query'][_0x6ca0('0x40')]){_0x1bf32d['include']=[{'all':!![]}];}return db[_0x6ca0('0x3f')][_0x6ca0('0x41')](_0x1bf32d);})['then'](function(_0xcc9c93){_0xd1db2[_0x6ca0('0x42')]=_0xcc9c93;return _0xd1db2;})[_0x6ca0('0x23')](respondWithFilteredResult(_0x10c112,_0x1bf32d))[_0x6ca0('0x43')](handleError(_0x10c112,null));};exports[_0x6ca0('0x44')]=function(_0x497f06,_0x5a59e4){var _0x48be61={'raw':!![],'where':{'id':_0x497f06[_0x6ca0('0x45')]['id']}},_0x1c02be={};_0x1c02be[_0x6ca0('0x2e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x1c02be['query']=_[_0x6ca0('0x2f')](_0x497f06[_0x6ca0('0x31')]);_0x1c02be['filters']=_['intersection'](_0x1c02be[_0x6ca0('0x2e')],_0x1c02be[_0x6ca0('0x31')]);_0x48be61[_0x6ca0('0x32')]=_[_0x6ca0('0x30')](_0x1c02be[_0x6ca0('0x2e')],qs[_0x6ca0('0x33')](_0x497f06[_0x6ca0('0x31')]['fields']));_0x48be61[_0x6ca0('0x32')]=_0x48be61[_0x6ca0('0x32')]['length']?_0x48be61['attributes']:_0x1c02be[_0x6ca0('0x2e')];if(_0x497f06['query']['includeAll']){_0x48be61[_0x6ca0('0x46')]=[{'all':!![]}];}_0x48be61=_[_0x6ca0('0x3d')]({},_0x48be61,_0x497f06['options']);return db[_0x6ca0('0x3f')][_0x6ca0('0x47')](_0x48be61)[_0x6ca0('0x23')](handleEntityNotFound(_0x5a59e4,null))[_0x6ca0('0x23')](respondWithResult(_0x5a59e4,null))[_0x6ca0('0x43')](handleError(_0x5a59e4,null));};exports[_0x6ca0('0x22')]=function(_0x9387d9,_0x50c096){if(_0x9387d9[_0x6ca0('0x48')]['id']){delete _0x9387d9[_0x6ca0('0x48')]['id'];}return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0x9387d9[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x50c096,null))['then'](saveUpdates(_0x9387d9[_0x6ca0('0x48')],null))[_0x6ca0('0x23')](respondWithResult(_0x50c096,null))[_0x6ca0('0x43')](handleError(_0x50c096,null));};exports[_0x6ca0('0x24')]=function(_0xe30141,_0x19264e){return db[_0x6ca0('0x3f')][_0x6ca0('0x47')]({'where':{'id':_0xe30141[_0x6ca0('0x45')]['id']}})[_0x6ca0('0x23')](handleEntityNotFound(_0x19264e,null))[_0x6ca0('0x23')](removeEntity(_0x19264e,null))['catch'](handleError(_0x19264e,null));};exports[_0x6ca0('0x49')]=function(_0x556224,_0x32e632){var _0x1577bf={'key':_0x556224['body']['key']};if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')]){_0x1577bf[_0x6ca0('0x4a')]=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4a')];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4b')]){_0x1577bf[_0x6ca0('0x4b')]=_0x556224[_0x6ca0('0x48')]['SmsAccountId'];}else if(_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4c')]){_0x1577bf[_0x6ca0('0x4c')]=_0x556224['body'][_0x6ca0('0x4c')];}else if(_0x556224['body'][_0x6ca0('0x4d')]){_0x1577bf['ChatWebsiteId']=_0x556224[_0x6ca0('0x48')][_0x6ca0('0x4d')];}return db['CannedAnswer'][_0x6ca0('0x47')]({'where':_0x1577bf})['then'](function(_0x2f7d2a){if(_0x2f7d2a){throw new db['Sequelize'][(_0x6ca0('0x4e'))](_0x6ca0('0x4f'));}return db[_0x6ca0('0x3f')][_0x6ca0('0x49')](_0x556224[_0x6ca0('0x48')]);})[_0x6ca0('0x23')](function(_0x254a26){var _0x5eaeac=_0x556224['user'][_0x6ca0('0x25')]({'plain':!![]});if(!_0x5eaeac)throw new Error(_0x6ca0('0x50'));if(_0x5eaeac[_0x6ca0('0x51')]===_0x6ca0('0x52')){var _0x247bbf=_0x254a26[_0x6ca0('0x25')]({'plain':!![]});return db[_0x6ca0('0x53')][_0x6ca0('0x47')]({'where':{'name':_0x6ca0('0x54'),'userProfileId':_0x5eaeac['userProfileId']},'raw':!![]})[_0x6ca0('0x23')](function(_0x43d2aa){if(_0x43d2aa&&_0x43d2aa['autoAssociation']===0x0){return db[_0x6ca0('0x26')][_0x6ca0('0x49')]({'name':_0x247bbf[_0x6ca0('0x28')],'resourceId':_0x247bbf['id'],'type':_0x43d2aa[_0x6ca0('0x28')],'sectionId':_0x43d2aa['id']},{})[_0x6ca0('0x23')](function(){return _0x254a26;});}else{return _0x254a26;}})['catch'](function(_0x4bfd60){logger['error'](_0x6ca0('0x55'),_0x4bfd60);throw _0x4bfd60;});}return _0x254a26;})[_0x6ca0('0x23')](respondWithResult(_0x32e632,0xc9))[_0x6ca0('0x43')](handleError(_0x32e632,null));};
\ No newline at end of file
+var _0x10c5=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','findAll','catch','show','keys','rawAttributes','includeAll','find','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2b6bb1,_0x6ca1d7){var _0x3218b6=function(_0x5ce75c){while(--_0x5ce75c){_0x2b6bb1['push'](_0x2b6bb1['shift']());}};_0x3218b6(++_0x6ca1d7);}(_0x10c5,0x1ae));var _0x510c=function(_0x445199,_0x50daf7){_0x445199=_0x445199-0x0;var _0x1cc1a4=_0x10c5[_0x445199];return _0x1cc1a4;};'use strict';var emlformat=require(_0x510c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x510c('0x1'));var rp=require(_0x510c('0x2'));var moment=require(_0x510c('0x3'));var BPromise=require(_0x510c('0x4'));var Mustache=require(_0x510c('0x5'));var util=require(_0x510c('0x6'));var path=require('path');var sox=require(_0x510c('0x7'));var csv=require(_0x510c('0x8'));var ejs=require(_0x510c('0x9'));var fs=require('fs');var fs_extra=require(_0x510c('0xa'));var _=require(_0x510c('0xb'));var squel=require(_0x510c('0xc'));var crypto=require(_0x510c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x510c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x510c('0xf'));var Redis=require(_0x510c('0x10'));var authService=require(_0x510c('0x11'));var qs=require(_0x510c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x510c('0x13'));var logger=require(_0x510c('0x14'))(_0x510c('0x15'));var utils=require(_0x510c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x510c('0x17'));var db=require(_0x510c('0x18'))['db'];function respondWithStatusCode(_0x2b1c4c,_0xc05a86){_0xc05a86=_0xc05a86||0xcc;return function(_0x14f459){if(_0x14f459){return _0x2b1c4c[_0x510c('0x19')](_0xc05a86);}return _0x2b1c4c[_0x510c('0x1a')](_0xc05a86)[_0x510c('0x1b')]();};}function respondWithResult(_0x2ab106,_0x4a4a08){_0x4a4a08=_0x4a4a08||0xc8;return function(_0x593982){if(_0x593982){return _0x2ab106['status'](_0x4a4a08)[_0x510c('0x1c')](_0x593982);}};}function respondWithFilteredResult(_0x19c721,_0x429dc3){return function(_0x36c12c){if(_0x36c12c){var _0x16fe9b=typeof _0x429dc3[_0x510c('0x1d')]===_0x510c('0x1e')&&typeof _0x429dc3[_0x510c('0x1f')]===_0x510c('0x1e');var _0x39cbcc=_0x36c12c['count'];var _0x40ef25=_0x16fe9b?0x0:_0x429dc3['offset'];var _0x166dd8=_0x16fe9b?_0x36c12c['count']:_0x429dc3[_0x510c('0x1d')]+_0x429dc3[_0x510c('0x1f')];var _0x318b88;if(_0x166dd8>=_0x39cbcc){_0x166dd8=_0x39cbcc;_0x318b88=0xc8;}else{_0x318b88=0xce;}_0x19c721[_0x510c('0x1a')](_0x318b88);return _0x19c721['set'](_0x510c('0x20'),_0x40ef25+'-'+_0x166dd8+'/'+_0x39cbcc)[_0x510c('0x1c')](_0x36c12c);}return null;};}function patchUpdates(_0xa36377){return function(_0x4860f3){try{jsonpatch[_0x510c('0x21')](_0x4860f3,_0xa36377,!![]);}catch(_0x216d88){return BPromise[_0x510c('0x22')](_0x216d88);}return _0x4860f3['save']();};}function saveUpdates(_0x17f83b,_0x2e88eb){return function(_0x145c3f){if(_0x145c3f){return _0x145c3f[_0x510c('0x23')](_0x17f83b)['then'](function(_0x38a00e){return _0x38a00e;});}return null;};}function removeEntity(_0x57f055,_0x2acd6c){return function(_0x133555){if(_0x133555){return _0x133555[_0x510c('0x24')]()[_0x510c('0x25')](function(){var _0x2119c8=_0x133555[_0x510c('0x26')]({'plain':!![]});var _0x46f9fd=_0x510c('0x27');return db[_0x510c('0x28')][_0x510c('0x24')]({'where':{'type':_0x46f9fd,'resourceId':_0x2119c8['id']}})[_0x510c('0x25')](function(){return _0x133555;});})[_0x510c('0x25')](function(){_0x57f055[_0x510c('0x1a')](0xcc)[_0x510c('0x1b')]();});}};}function handleEntityNotFound(_0x1fc2cf,_0x550229){return function(_0x7c5f67){if(!_0x7c5f67){_0x1fc2cf[_0x510c('0x19')](0x194);}return _0x7c5f67;};}function handleError(_0x497bc2,_0x50dc65){_0x50dc65=_0x50dc65||0x1f4;return function(_0x165e1a){logger[_0x510c('0x29')](_0x165e1a[_0x510c('0x2a')]);if(_0x165e1a[_0x510c('0x2b')]){delete _0x165e1a[_0x510c('0x2b')];}_0x497bc2[_0x510c('0x1a')](_0x50dc65)[_0x510c('0x2c')](_0x165e1a);};}exports[_0x510c('0x2d')]=function(_0x85fa77,_0x9809ee){var _0x4ce854={},_0x3bec43={},_0x598977={'count':0x0,'rows':[]};var _0x3eb399=_[_0x510c('0x2e')](db[_0x510c('0x2f')]['rawAttributes'],function(_0x159cee){return{'name':_0x159cee[_0x510c('0x30')],'type':_0x159cee[_0x510c('0x31')]['key']};});_0x3bec43[_0x510c('0x32')]=_[_0x510c('0x2e')](_0x3eb399,_0x510c('0x2b'));_0x3bec43['query']=_['keys'](_0x85fa77['query']);_0x3bec43[_0x510c('0x33')]=_[_0x510c('0x34')](_0x3bec43[_0x510c('0x32')],_0x3bec43[_0x510c('0x35')]);_0x4ce854[_0x510c('0x36')]=_[_0x510c('0x34')](_0x3bec43['model'],qs[_0x510c('0x37')](_0x85fa77[_0x510c('0x35')][_0x510c('0x37')]));_0x4ce854[_0x510c('0x36')]=_0x4ce854[_0x510c('0x36')][_0x510c('0x38')]?_0x4ce854['attributes']:_0x3bec43[_0x510c('0x32')];if(!_0x85fa77[_0x510c('0x35')][_0x510c('0x39')](_0x510c('0x3a'))){_0x4ce854[_0x510c('0x1f')]=qs[_0x510c('0x1f')](_0x85fa77[_0x510c('0x35')][_0x510c('0x1f')]);_0x4ce854[_0x510c('0x1d')]=qs[_0x510c('0x1d')](_0x85fa77[_0x510c('0x35')][_0x510c('0x1d')]);}_0x4ce854[_0x510c('0x3b')]=qs['sort'](_0x85fa77[_0x510c('0x35')]['sort']);_0x4ce854[_0x510c('0x3c')]=qs[_0x510c('0x33')](_['pick'](_0x85fa77['query'],_0x3bec43['filters']),_0x3eb399);if(_0x85fa77[_0x510c('0x35')][_0x510c('0x3d')]){_0x4ce854[_0x510c('0x3c')]=_[_0x510c('0x3e')](_0x4ce854[_0x510c('0x3c')],{'$or':[{'key':{'$like':'%'+_0x85fa77[_0x510c('0x35')][_0x510c('0x3d')]+'%'}},{'value':{'$like':'%'+_0x85fa77['query'][_0x510c('0x3d')]+'%'}}]});}_0x4ce854=_[_0x510c('0x3e')]({},_0x4ce854,_0x85fa77['options']);var _0x1eec58={'where':_0x4ce854[_0x510c('0x3c')]};return db[_0x510c('0x2f')]['count'](_0x1eec58)[_0x510c('0x25')](function(_0x47c89f){_0x598977['count']=_0x47c89f;if(_0x85fa77[_0x510c('0x35')]['includeAll']){_0x4ce854['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x510c('0x3f')](_0x4ce854);})[_0x510c('0x25')](function(_0x1a2a02){_0x598977['rows']=_0x1a2a02;return _0x598977;})[_0x510c('0x25')](respondWithFilteredResult(_0x9809ee,_0x4ce854))[_0x510c('0x40')](handleError(_0x9809ee,null));};exports[_0x510c('0x41')]=function(_0x3fe8ba,_0x3b67f6){var _0xa75747={'raw':!![],'where':{'id':_0x3fe8ba['params']['id']}},_0x1b01c7={};_0x1b01c7['model']=_[_0x510c('0x42')](db[_0x510c('0x2f')][_0x510c('0x43')]);_0x1b01c7['query']=_[_0x510c('0x42')](_0x3fe8ba[_0x510c('0x35')]);_0x1b01c7[_0x510c('0x33')]=_['intersection'](_0x1b01c7[_0x510c('0x32')],_0x1b01c7[_0x510c('0x35')]);_0xa75747['attributes']=_[_0x510c('0x34')](_0x1b01c7[_0x510c('0x32')],qs[_0x510c('0x37')](_0x3fe8ba[_0x510c('0x35')][_0x510c('0x37')]));_0xa75747[_0x510c('0x36')]=_0xa75747['attributes'][_0x510c('0x38')]?_0xa75747[_0x510c('0x36')]:_0x1b01c7[_0x510c('0x32')];if(_0x3fe8ba[_0x510c('0x35')][_0x510c('0x44')]){_0xa75747['include']=[{'all':!![]}];}_0xa75747=_['merge']({},_0xa75747,_0x3fe8ba['options']);return db[_0x510c('0x2f')][_0x510c('0x45')](_0xa75747)[_0x510c('0x25')](handleEntityNotFound(_0x3b67f6,null))['then'](respondWithResult(_0x3b67f6,null))[_0x510c('0x40')](handleError(_0x3b67f6,null));};exports[_0x510c('0x23')]=function(_0xce72b4,_0xcf3283){if(_0xce72b4['body']['id']){delete _0xce72b4['body']['id'];}return db[_0x510c('0x2f')][_0x510c('0x45')]({'where':{'id':_0xce72b4[_0x510c('0x46')]['id']}})['then'](handleEntityNotFound(_0xcf3283,null))[_0x510c('0x25')](saveUpdates(_0xce72b4['body'],null))[_0x510c('0x25')](respondWithResult(_0xcf3283,null))[_0x510c('0x40')](handleError(_0xcf3283,null));};exports[_0x510c('0x24')]=function(_0x20f5f5,_0x5bf146){return db['CannedAnswer']['find']({'where':{'id':_0x20f5f5[_0x510c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5bf146,null))[_0x510c('0x25')](removeEntity(_0x5bf146,null))[_0x510c('0x40')](handleError(_0x5bf146,null));};exports[_0x510c('0x47')]=function(_0x38fb20,_0x2cd45a){var _0x1ec7de={'key':_0x38fb20['body']['key']};if(_0x38fb20[_0x510c('0x48')][_0x510c('0x49')]){_0x1ec7de['MailAccountId']=_0x38fb20['body']['MailAccountId'];}else if(_0x38fb20[_0x510c('0x48')]['SmsAccountId']){_0x1ec7de[_0x510c('0x4a')]=_0x38fb20[_0x510c('0x48')]['SmsAccountId'];}else if(_0x38fb20[_0x510c('0x48')][_0x510c('0x4b')]){_0x1ec7de['OpenchannelAccountId']=_0x38fb20[_0x510c('0x48')]['OpenchannelAccountId'];}else if(_0x38fb20[_0x510c('0x48')]['ChatWebsiteId']){_0x1ec7de['ChatWebsiteId']=_0x38fb20[_0x510c('0x48')][_0x510c('0x4c')];}return db[_0x510c('0x2f')][_0x510c('0x45')]({'where':_0x1ec7de})['then'](function(_0x5442c1){if(_0x5442c1){throw new db[(_0x510c('0x4d'))][(_0x510c('0x4e'))](_0x510c('0x4f'));}return db[_0x510c('0x2f')][_0x510c('0x47')](_0x38fb20['body']);})['then'](function(_0x252e66){var _0x41238b=_0x38fb20[_0x510c('0x50')][_0x510c('0x26')]({'plain':!![]});if(!_0x41238b)throw new Error(_0x510c('0x51'));if(_0x41238b[_0x510c('0x52')]==='user'){var _0x386db3=_0x252e66[_0x510c('0x26')]({'plain':!![]});return db[_0x510c('0x53')][_0x510c('0x45')]({'where':{'name':_0x510c('0x27'),'userProfileId':_0x41238b[_0x510c('0x54')]},'raw':!![]})[_0x510c('0x25')](function(_0xd3e810){if(_0xd3e810&&_0xd3e810[_0x510c('0x55')]===0x0){return db[_0x510c('0x28')][_0x510c('0x47')]({'name':_0x386db3['name'],'resourceId':_0x386db3['id'],'type':_0xd3e810[_0x510c('0x2b')],'sectionId':_0xd3e810['id']},{})[_0x510c('0x25')](function(){return _0x252e66;});}else{return _0x252e66;}})[_0x510c('0x40')](function(_0x1ec79b){logger[_0x510c('0x29')](_0x510c('0x56'),_0x1ec79b);throw _0x1ec79b;});}return _0x252e66;})['then'](respondWithResult(_0x2cd45a,0xc9))[_0x510c('0x40')](handleError(_0x2cd45a,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 65da8d3..a090a3a 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 _0x81df=['api','moment','bluebird','request-promise','path','rimraf','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3554de,_0x1c1680){var _0x469d4b=function(_0x402f44){while(--_0x402f44){_0x3554de['push'](_0x3554de['shift']());}};_0x469d4b(++_0x1c1680);}(_0x81df,0xb3));var _0xf81d=function(_0x112e86,_0x2cc9b0){_0x112e86=_0x112e86-0x0;var _0xf6b5d9=_0x81df[_0x112e86];return _0xf6b5d9;};'use strict';var _=require(_0xf81d('0x0'));var util=require(_0xf81d('0x1'));var logger=require(_0xf81d('0x2'))(_0xf81d('0x3'));var moment=require(_0xf81d('0x4'));var BPromise=require(_0xf81d('0x5'));var rp=require(_0xf81d('0x6'));var fs=require('fs');var path=require(_0xf81d('0x7'));var rimraf=require(_0xf81d('0x8'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xf81d('0x9')]=function(_0x4678d9,_0x18a5a1){return _0x4678d9['define'](_0xf81d('0xa'),attributes,{'tableName':_0xf81d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf81d('0xc')});};
\ No newline at end of file
+var _0xe82b=['tools_canned_answers','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x41130b,_0x2654b1){var _0x1ff258=function(_0x284984){while(--_0x284984){_0x41130b['push'](_0x41130b['shift']());}};_0x1ff258(++_0x2654b1);}(_0xe82b,0x11a));var _0xbe82=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xe82b[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var logger=require('../../config/logger')(_0xbe82('0x2'));var moment=require(_0xbe82('0x3'));var BPromise=require(_0xbe82('0x4'));var rp=require(_0xbe82('0x5'));var fs=require('fs');var path=require(_0xbe82('0x6'));var rimraf=require(_0xbe82('0x7'));var config=require('../../config/environment');var attributes=require(_0xbe82('0x8'));module[_0xbe82('0x9')]=function(_0x5e33b2,_0x1f02d7){return _0x5e33b2[_0xbe82('0xa')](_0xbe82('0xb'),attributes,{'tableName':_0xbe82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe82('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 9e717d7..037be3e 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(_0x1bb67e,_0x4b021d){var _0x83a82e=function(_0x1e4bab){while(--_0x1e4bab){_0x1bb67e['push'](_0x1bb67e['shift']());}};_0x83a82e(++_0x4b021d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x27e671,_0x4dee15){var _0x4b0b6d=function(_0x2bd1da){while(--_0x2bd1da){_0x27e671['push'](_0x27e671['shift']());}};_0x4b0b6d(++_0x4dee15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 b030f78..2de9dd7 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 _0x7531=['/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3ab928,_0x2b990b){var _0xf47692=function(_0x311b8e){while(--_0x311b8e){_0x3ab928['push'](_0x3ab928['shift']());}};_0xf47692(++_0x2b990b);}(_0x7531,0x67));var _0x1753=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7531[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x1753('0x0'));var util=require('util');var path=require(_0x1753('0x1'));var timeout=require(_0x1753('0x2'));var express=require(_0x1753('0x3'));var router=express[_0x1753('0x4')]();var fs_extra=require(_0x1753('0x5'));var auth=require(_0x1753('0x6'));var interaction=require(_0x1753('0x7'));var config=require(_0x1753('0x8'));var controller=require('./cannedAnswer.controller');router[_0x1753('0x9')]('/',auth[_0x1753('0xa')](),controller['index']);router[_0x1753('0x9')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0xc')]);router[_0x1753('0xd')]('/',auth['isAuthenticated'](),controller[_0x1753('0xe')]);router[_0x1753('0xf')]('/:id',auth[_0x1753('0xa')](),controller[_0x1753('0x10')]);router[_0x1753('0x11')](_0x1753('0xb'),auth[_0x1753('0xa')](),controller[_0x1753('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x7663=['../../config/environment','./cannedAnswer.controller','index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2ce0a2,_0x1529ae){var _0x201721=function(_0x145f8d){while(--_0x145f8d){_0x2ce0a2['push'](_0x2ce0a2['shift']());}};_0x201721(++_0x1529ae);}(_0x7663,0x142));var _0x3766=function(_0x3073d5,_0xd1fdf5){_0x3073d5=_0x3073d5-0x0;var _0x56ee5a=_0x7663[_0x3073d5];return _0x56ee5a;};'use strict';var multer=require(_0x3766('0x0'));var util=require(_0x3766('0x1'));var path=require(_0x3766('0x2'));var timeout=require(_0x3766('0x3'));var express=require(_0x3766('0x4'));var router=express['Router']();var fs_extra=require(_0x3766('0x5'));var auth=require(_0x3766('0x6'));var interaction=require(_0x3766('0x7'));var config=require(_0x3766('0x8'));var controller=require(_0x3766('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3766('0xa')]);router[_0x3766('0xb')]('/:id',auth[_0x3766('0xc')](),controller[_0x3766('0xd')]);router[_0x3766('0xe')]('/',auth[_0x3766('0xc')](),controller[_0x3766('0xf')]);router[_0x3766('0x10')](_0x3766('0x11'),auth['isAuthenticated'](),controller[_0x3766('0x12')]);router[_0x3766('0x13')](_0x3766('0x11'),auth[_0x3766('0xc')](),controller[_0x3766('0x14')]);module[_0x3766('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 52dede7..71339cc 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 _0x34e5=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x3fd6fd,_0x2ac441){var _0x3849f3=function(_0x19d13a){while(--_0x19d13a){_0x3fd6fd['push'](_0x3fd6fd['shift']());}};_0x3849f3(++_0x2ac441);}(_0x34e5,0x172));var _0x534e=function(_0x51d50a,_0x501b7e){_0x51d50a=_0x51d50a-0x0;var _0x46295a=_0x34e5[_0x51d50a];return _0x46295a;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x534e('0x1')},'clid':{'type':Sequelize[_0x534e('0x2')]},'src':{'type':Sequelize[_0x534e('0x2')]},'dst':{'type':Sequelize[_0x534e('0x2')]},'dcontext':{'type':Sequelize[_0x534e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x534e('0x2')]},'lastapp':{'type':Sequelize[_0x534e('0x2')]},'lastdata':{'type':Sequelize[_0x534e('0x2')]},'duration':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x534e('0x2')]},'amaflags':{'type':Sequelize[_0x534e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x534e('0x2')]},'uniqueid':{'type':Sequelize[_0x534e('0x2')]},'linkedid':{'type':Sequelize[_0x534e('0x2')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x534e('0x2')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf45e=['INTEGER','sequelize','DATE','STRING'];(function(_0x10b099,_0x847335){var _0xace9f7=function(_0x3e5ccb){while(--_0x3e5ccb){_0x10b099['push'](_0x10b099['shift']());}};_0xace9f7(++_0x847335);}(_0xf45e,0x115));var _0xef45=function(_0x4b531b,_0x299078){_0x4b531b=_0x4b531b-0x0;var _0x1bc994=_0xf45e[_0x4b531b];return _0x1bc994;};'use strict';var Sequelize=require(_0xef45('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xef45('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xef45('0x2')]},'src':{'type':Sequelize[_0xef45('0x2')]},'dst':{'type':Sequelize[_0xef45('0x2')]},'dcontext':{'type':Sequelize[_0xef45('0x2')]},'channel':{'type':Sequelize[_0xef45('0x2')]},'dstchannel':{'type':Sequelize[_0xef45('0x2')]},'lastapp':{'type':Sequelize[_0xef45('0x2')]},'lastdata':{'type':Sequelize[_0xef45('0x2')]},'duration':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xef45('0x2')]},'amaflags':{'type':Sequelize[_0xef45('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xef45('0x2')]},'userfield':{'type':Sequelize[_0xef45('0x2')]},'uniqueid':{'type':Sequelize[_0xef45('0x2')]},'linkedid':{'type':Sequelize[_0xef45('0x2')]},'sequence':{'type':Sequelize[_0xef45('0x2')]},'peeraccount':{'type':Sequelize[_0xef45('0x2')]},'type':{'type':Sequelize[_0xef45('0x2')]},'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 169b49f..bcb1507 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 _0x4ab0=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','sendStatus','error','stack','name','send','Cdr','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs'];(function(_0x58bb02,_0x1558dc){var _0xd6a0ad=function(_0x139f4a){while(--_0x139f4a){_0x58bb02['push'](_0x58bb02['shift']());}};_0xd6a0ad(++_0x1558dc);}(_0x4ab0,0xd5));var _0x04ab=function(_0x558eed,_0x4cd4f3){_0x558eed=_0x558eed-0x0;var _0xf8fb7=_0x4ab0[_0x558eed];return _0xf8fb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x04ab('0x0'));var zipdir=require(_0x04ab('0x1'));var jsonpatch=require(_0x04ab('0x2'));var rp=require(_0x04ab('0x3'));var moment=require(_0x04ab('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x04ab('0x5'));var path=require(_0x04ab('0x6'));var sox=require('sox');var csv=require(_0x04ab('0x7'));var ejs=require(_0x04ab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04ab('0x9'));var squel=require(_0x04ab('0xa'));var crypto=require(_0x04ab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04ab('0xc'));var toCsv=require(_0x04ab('0x7'));var querystring=require(_0x04ab('0xd'));var Papa=require(_0x04ab('0xe'));var Redis=require('ioredis');var authService=require(_0x04ab('0xf'));var qs=require(_0x04ab('0x10'));var as=require(_0x04ab('0x11'));var hardwareService=require(_0x04ab('0x12'));var logger=require('../../config/logger')(_0x04ab('0x13'));var utils=require(_0x04ab('0x14'));var config=require(_0x04ab('0x15'));var licenseUtil=require(_0x04ab('0x16'));var db=require(_0x04ab('0x17'))['db'];function respondWithStatusCode(_0x386d0a,_0x4a6b39){_0x4a6b39=_0x4a6b39||0xcc;return function(_0x710503){if(_0x710503){return _0x386d0a['sendStatus'](_0x4a6b39);}return _0x386d0a[_0x04ab('0x18')](_0x4a6b39)[_0x04ab('0x19')]();};}function respondWithResult(_0x2abdf8,_0x428798){_0x428798=_0x428798||0xc8;return function(_0x4f0da1){if(_0x4f0da1){return _0x2abdf8['status'](_0x428798)['json'](_0x4f0da1);}};}function respondWithFilteredResult(_0x103ca8,_0x3cee44){return function(_0x149fd2){if(_0x149fd2){var _0x2b10b0=typeof _0x3cee44[_0x04ab('0x1a')]===_0x04ab('0x1b')&&typeof _0x3cee44[_0x04ab('0x1c')]===_0x04ab('0x1b');var _0x1f3251=_0x149fd2[_0x04ab('0x1d')];var _0x5ce43c=_0x2b10b0?0x0:_0x3cee44[_0x04ab('0x1a')];var _0x83ab27=_0x2b10b0?_0x149fd2[_0x04ab('0x1d')]:_0x3cee44[_0x04ab('0x1a')]+_0x3cee44[_0x04ab('0x1c')];var _0x10669a;if(_0x83ab27>=_0x1f3251){_0x83ab27=_0x1f3251;_0x10669a=0xc8;}else{_0x10669a=0xce;}_0x103ca8[_0x04ab('0x18')](_0x10669a);return _0x103ca8[_0x04ab('0x1e')](_0x04ab('0x1f'),_0x5ce43c+'-'+_0x83ab27+'/'+_0x1f3251)['json'](_0x149fd2);}return null;};}function patchUpdates(_0x75a04e){return function(_0x4a6679){try{jsonpatch[_0x04ab('0x20')](_0x4a6679,_0x75a04e,!![]);}catch(_0x1d04c2){return BPromise[_0x04ab('0x21')](_0x1d04c2);}return _0x4a6679['save']();};}function saveUpdates(_0x15a36b,_0x1c08f4){return function(_0xf6275e){if(_0xf6275e){return _0xf6275e['update'](_0x15a36b)['then'](function(_0xc8358e){return _0xc8358e;});}return null;};}function removeEntity(_0x2f614a,_0x5885bd){return function(_0x551583){if(_0x551583){return _0x551583[_0x04ab('0x22')]()[_0x04ab('0x23')](function(){_0x2f614a[_0x04ab('0x18')](0xcc)[_0x04ab('0x19')]();});}};}function handleEntityNotFound(_0x26bb81,_0xa3838a){return function(_0x21d9b7){if(!_0x21d9b7){_0x26bb81[_0x04ab('0x24')](0x194);}return _0x21d9b7;};}function handleError(_0x222557,_0x5cf1e5){_0x5cf1e5=_0x5cf1e5||0x1f4;return function(_0x86bf80){logger[_0x04ab('0x25')](_0x86bf80[_0x04ab('0x26')]);if(_0x86bf80[_0x04ab('0x27')]){delete _0x86bf80['name'];}_0x222557['status'](_0x5cf1e5)[_0x04ab('0x28')](_0x86bf80);};}exports['index']=function(_0x404eae,_0x30db64){var _0x2e069d={},_0x3c25fb={},_0x12385b={'count':0x0,'rows':[]};var _0x5596fc=_['map'](db[_0x04ab('0x29')][_0x04ab('0x2a')],function(_0x28e77b){return{'name':_0x28e77b[_0x04ab('0x2b')],'type':_0x28e77b[_0x04ab('0x2c')][_0x04ab('0x2d')]};});_0x3c25fb[_0x04ab('0x2e')]=_[_0x04ab('0x2f')](_0x5596fc,_0x04ab('0x27'));_0x3c25fb[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x404eae[_0x04ab('0x30')]);_0x3c25fb[_0x04ab('0x32')]=_['intersection'](_0x3c25fb[_0x04ab('0x2e')],_0x3c25fb[_0x04ab('0x30')]);_0x2e069d['attributes']=_[_0x04ab('0x33')](_0x3c25fb[_0x04ab('0x2e')],qs['fields'](_0x404eae[_0x04ab('0x30')][_0x04ab('0x34')]));_0x2e069d['attributes']=_0x2e069d[_0x04ab('0x35')][_0x04ab('0x36')]?_0x2e069d[_0x04ab('0x35')]:_0x3c25fb[_0x04ab('0x2e')];if(!_0x404eae[_0x04ab('0x30')][_0x04ab('0x37')]('nolimit')){_0x2e069d[_0x04ab('0x1c')]=qs[_0x04ab('0x1c')](_0x404eae[_0x04ab('0x30')]['limit']);_0x2e069d[_0x04ab('0x1a')]=qs['offset'](_0x404eae['query'][_0x04ab('0x1a')]);}_0x2e069d[_0x04ab('0x38')]=qs['sort'](_0x404eae[_0x04ab('0x30')]['sort']);_0x2e069d[_0x04ab('0x39')]=qs[_0x04ab('0x32')](_[_0x04ab('0x3a')](_0x404eae[_0x04ab('0x30')],_0x3c25fb[_0x04ab('0x32')]),_0x5596fc);if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3b')]){_0x2e069d[_0x04ab('0x39')]=_[_0x04ab('0x3c')](_0x2e069d[_0x04ab('0x39')],{'$or':_[_0x04ab('0x2f')](_0x5596fc,function(_0x3f145){if(_0x3f145['type']!==_0x04ab('0x3d')){var _0x14756a={};_0x14756a[_0x3f145['name']]={'$like':'%'+_0x404eae['query'][_0x04ab('0x3b')]+'%'};return _0x14756a;}})});}_0x2e069d=_[_0x04ab('0x3c')]({},_0x2e069d,_0x404eae[_0x04ab('0x3e')]);var _0x4327b9={'where':_0x2e069d['where']};return db[_0x04ab('0x29')][_0x04ab('0x1d')](_0x4327b9)[_0x04ab('0x23')](function(_0x244acf){_0x12385b['count']=_0x244acf;if(_0x404eae[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x2e069d[_0x04ab('0x40')]=[{'all':!![]}];}return db[_0x04ab('0x29')][_0x04ab('0x41')](_0x2e069d);})[_0x04ab('0x23')](function(_0x20b8cc){_0x12385b[_0x04ab('0x42')]=_0x20b8cc;return _0x12385b;})['then'](respondWithFilteredResult(_0x30db64,_0x2e069d))['catch'](handleError(_0x30db64,null));};exports[_0x04ab('0x43')]=function(_0x4c8cb0,_0x8a93c2){var _0x46a7c5={'raw':!![],'where':{'id':_0x4c8cb0['params']['id']}},_0x3c27ee={};_0x3c27ee[_0x04ab('0x2e')]=_[_0x04ab('0x31')](db[_0x04ab('0x29')]['rawAttributes']);_0x3c27ee[_0x04ab('0x30')]=_[_0x04ab('0x31')](_0x4c8cb0[_0x04ab('0x30')]);_0x3c27ee[_0x04ab('0x32')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],_0x3c27ee[_0x04ab('0x30')]);_0x46a7c5[_0x04ab('0x35')]=_[_0x04ab('0x33')](_0x3c27ee[_0x04ab('0x2e')],qs['fields'](_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x34')]));_0x46a7c5[_0x04ab('0x35')]=_0x46a7c5[_0x04ab('0x35')][_0x04ab('0x36')]?_0x46a7c5[_0x04ab('0x35')]:_0x3c27ee['model'];if(_0x4c8cb0[_0x04ab('0x30')][_0x04ab('0x3f')]){_0x46a7c5[_0x04ab('0x40')]=[{'all':!![]}];}_0x46a7c5=_[_0x04ab('0x3c')]({},_0x46a7c5,_0x4c8cb0['options']);return db[_0x04ab('0x29')][_0x04ab('0x44')](_0x46a7c5)[_0x04ab('0x23')](handleEntityNotFound(_0x8a93c2,null))[_0x04ab('0x23')](respondWithResult(_0x8a93c2,null))[_0x04ab('0x45')](handleError(_0x8a93c2,null));};exports['create']=function(_0x326621,_0x15b995){return db['Cdr']['create'](_0x326621[_0x04ab('0x46')],{})[_0x04ab('0x23')](respondWithResult(_0x15b995,0xc9))[_0x04ab('0x45')](handleError(_0x15b995,null));};exports[_0x04ab('0x47')]=function(_0x1c4aa2,_0x3a9056){if(_0x1c4aa2[_0x04ab('0x46')]['id']){delete _0x1c4aa2['body']['id'];}return db[_0x04ab('0x29')][_0x04ab('0x44')]({'where':{'id':_0x1c4aa2[_0x04ab('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a9056,null))[_0x04ab('0x23')](saveUpdates(_0x1c4aa2[_0x04ab('0x46')],null))['then'](respondWithResult(_0x3a9056,null))[_0x04ab('0x45')](handleError(_0x3a9056,null));};exports['destroy']=function(_0xc9db25,_0x4bc4f6){return db[_0x04ab('0x29')]['find']({'where':{'id':_0xc9db25['params']['id']}})[_0x04ab('0x23')](handleEntityNotFound(_0x4bc4f6,null))[_0x04ab('0x23')](removeEntity(_0x4bc4f6,null))[_0x04ab('0x45')](handleError(_0x4bc4f6,null));};exports['describe']=function(_0x53f63a,_0x5ed30e){return db[_0x04ab('0x29')][_0x04ab('0x49')]()['then'](respondWithResult(_0x5ed30e,null))[_0x04ab('0x45')](handleError(_0x5ed30e,null));};
\ No newline at end of file
+var _0x826a=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','Cdr','fieldName','type'];(function(_0x5ab238,_0x4ddda9){var _0x236db6=function(_0x5f1f3f){while(--_0x5f1f3f){_0x5ab238['push'](_0x5ab238['shift']());}};_0x236db6(++_0x4ddda9);}(_0x826a,0x1aa));var _0xa826=function(_0x7f4ea5,_0x1655e0){_0x7f4ea5=_0x7f4ea5-0x0;var _0x26f5b7=_0x826a[_0x7f4ea5];return _0x26f5b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa826('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa826('0x1'));var rp=require('request-promise');var moment=require(_0xa826('0x2'));var BPromise=require(_0xa826('0x3'));var Mustache=require(_0xa826('0x4'));var util=require(_0xa826('0x5'));var path=require('path');var sox=require(_0xa826('0x6'));var csv=require(_0xa826('0x7'));var ejs=require(_0xa826('0x8'));var fs=require('fs');var fs_extra=require(_0xa826('0x9'));var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x7'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var licenseUtil=require(_0xa826('0x18'));var db=require(_0xa826('0x19'))['db'];function respondWithStatusCode(_0x212fac,_0x40838f){_0x40838f=_0x40838f||0xcc;return function(_0x2f1d39){if(_0x2f1d39){return _0x212fac['sendStatus'](_0x40838f);}return _0x212fac[_0xa826('0x1a')](_0x40838f)['end']();};}function respondWithResult(_0x3e99b0,_0x41c0c2){_0x41c0c2=_0x41c0c2||0xc8;return function(_0x5dc0c7){if(_0x5dc0c7){return _0x3e99b0['status'](_0x41c0c2)['json'](_0x5dc0c7);}};}function respondWithFilteredResult(_0x1b6d16,_0x4f25bd){return function(_0x4c546b){if(_0x4c546b){var _0x9a3788=typeof _0x4f25bd[_0xa826('0x1b')]===_0xa826('0x1c')&&typeof _0x4f25bd['limit']===_0xa826('0x1c');var _0x312e14=_0x4c546b[_0xa826('0x1d')];var _0x453c5d=_0x9a3788?0x0:_0x4f25bd[_0xa826('0x1b')];var _0x48930f=_0x9a3788?_0x4c546b[_0xa826('0x1d')]:_0x4f25bd[_0xa826('0x1b')]+_0x4f25bd[_0xa826('0x1e')];var _0x57e96e;if(_0x48930f>=_0x312e14){_0x48930f=_0x312e14;_0x57e96e=0xc8;}else{_0x57e96e=0xce;}_0x1b6d16['status'](_0x57e96e);return _0x1b6d16[_0xa826('0x1f')](_0xa826('0x20'),_0x453c5d+'-'+_0x48930f+'/'+_0x312e14)[_0xa826('0x21')](_0x4c546b);}return null;};}function patchUpdates(_0x8d1650){return function(_0x124564){try{jsonpatch['apply'](_0x124564,_0x8d1650,!![]);}catch(_0x3171ff){return BPromise[_0xa826('0x22')](_0x3171ff);}return _0x124564[_0xa826('0x23')]();};}function saveUpdates(_0x5d410f,_0x5ddeef){return function(_0x361ca5){if(_0x361ca5){return _0x361ca5[_0xa826('0x24')](_0x5d410f)[_0xa826('0x25')](function(_0x4eb4f3){return _0x4eb4f3;});}return null;};}function removeEntity(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(_0x1d4ade){return _0x1d4ade[_0xa826('0x26')]()[_0xa826('0x25')](function(){_0x1d7adf['status'](0xcc)[_0xa826('0x27')]();});}};}function handleEntityNotFound(_0x4fa5db,_0x17ef2d){return function(_0x174f16){if(!_0x174f16){_0x4fa5db['sendStatus'](0x194);}return _0x174f16;};}function handleError(_0xfc0448,_0xfa4d94){_0xfa4d94=_0xfa4d94||0x1f4;return function(_0x38c919){logger[_0xa826('0x28')](_0x38c919[_0xa826('0x29')]);if(_0x38c919[_0xa826('0x2a')]){delete _0x38c919[_0xa826('0x2a')];}_0xfc0448[_0xa826('0x1a')](_0xfa4d94)[_0xa826('0x2b')](_0x38c919);};}exports[_0xa826('0x2c')]=function(_0x1e35de,_0x473d8d){var _0x1f2749={},_0x2cb586={},_0x2253c7={'count':0x0,'rows':[]};var _0x27f8f9=_['map'](db[_0xa826('0x2d')]['rawAttributes'],function(_0x2dd810){return{'name':_0x2dd810[_0xa826('0x2e')],'type':_0x2dd810[_0xa826('0x2f')][_0xa826('0x30')]};});_0x2cb586[_0xa826('0x31')]=_['map'](_0x27f8f9,'name');_0x2cb586[_0xa826('0x32')]=_[_0xa826('0x33')](_0x1e35de[_0xa826('0x32')]);_0x2cb586[_0xa826('0x34')]=_['intersection'](_0x2cb586[_0xa826('0x31')],_0x2cb586[_0xa826('0x32')]);_0x1f2749['attributes']=_[_0xa826('0x35')](_0x2cb586['model'],qs[_0xa826('0x36')](_0x1e35de[_0xa826('0x32')][_0xa826('0x36')]));_0x1f2749[_0xa826('0x37')]=_0x1f2749[_0xa826('0x37')]['length']?_0x1f2749[_0xa826('0x37')]:_0x2cb586[_0xa826('0x31')];if(!_0x1e35de[_0xa826('0x32')][_0xa826('0x38')](_0xa826('0x39'))){_0x1f2749[_0xa826('0x1e')]=qs[_0xa826('0x1e')](_0x1e35de[_0xa826('0x32')][_0xa826('0x1e')]);_0x1f2749[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0x1e35de['query'][_0xa826('0x1b')]);}_0x1f2749['order']=qs[_0xa826('0x3a')](_0x1e35de['query'][_0xa826('0x3a')]);_0x1f2749[_0xa826('0x3b')]=qs[_0xa826('0x34')](_[_0xa826('0x3c')](_0x1e35de[_0xa826('0x32')],_0x2cb586[_0xa826('0x34')]),_0x27f8f9);if(_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]){_0x1f2749[_0xa826('0x3b')]=_[_0xa826('0x3e')](_0x1f2749[_0xa826('0x3b')],{'$or':_[_0xa826('0x3f')](_0x27f8f9,function(_0x5911d3){if(_0x5911d3[_0xa826('0x2f')]!==_0xa826('0x40')){var _0x251208={};_0x251208[_0x5911d3['name']]={'$like':'%'+_0x1e35de[_0xa826('0x32')][_0xa826('0x3d')]+'%'};return _0x251208;}})});}_0x1f2749=_['merge']({},_0x1f2749,_0x1e35de[_0xa826('0x41')]);var _0x47d9f1={'where':_0x1f2749['where']};return db[_0xa826('0x2d')][_0xa826('0x1d')](_0x47d9f1)[_0xa826('0x25')](function(_0x308d4){_0x2253c7[_0xa826('0x1d')]=_0x308d4;if(_0x1e35de[_0xa826('0x32')]['includeAll']){_0x1f2749[_0xa826('0x42')]=[{'all':!![]}];}return db[_0xa826('0x2d')][_0xa826('0x43')](_0x1f2749);})[_0xa826('0x25')](function(_0x244fd3){_0x2253c7[_0xa826('0x44')]=_0x244fd3;return _0x2253c7;})['then'](respondWithFilteredResult(_0x473d8d,_0x1f2749))[_0xa826('0x45')](handleError(_0x473d8d,null));};exports[_0xa826('0x46')]=function(_0x405ee1,_0x162be1){var _0x258e57={'raw':!![],'where':{'id':_0x405ee1[_0xa826('0x47')]['id']}},_0x53b70e={};_0x53b70e[_0xa826('0x31')]=_[_0xa826('0x33')](db[_0xa826('0x2d')][_0xa826('0x48')]);_0x53b70e[_0xa826('0x32')]=_[_0xa826('0x33')](_0x405ee1[_0xa826('0x32')]);_0x53b70e[_0xa826('0x34')]=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],_0x53b70e[_0xa826('0x32')]);_0x258e57['attributes']=_[_0xa826('0x35')](_0x53b70e[_0xa826('0x31')],qs[_0xa826('0x36')](_0x405ee1['query'][_0xa826('0x36')]));_0x258e57[_0xa826('0x37')]=_0x258e57[_0xa826('0x37')][_0xa826('0x49')]?_0x258e57[_0xa826('0x37')]:_0x53b70e['model'];if(_0x405ee1[_0xa826('0x32')][_0xa826('0x4a')]){_0x258e57[_0xa826('0x42')]=[{'all':!![]}];}_0x258e57=_[_0xa826('0x3e')]({},_0x258e57,_0x405ee1[_0xa826('0x41')]);return db[_0xa826('0x2d')][_0xa826('0x4b')](_0x258e57)['then'](handleEntityNotFound(_0x162be1,null))[_0xa826('0x25')](respondWithResult(_0x162be1,null))['catch'](handleError(_0x162be1,null));};exports['create']=function(_0x4b4352,_0x26a858){return db[_0xa826('0x2d')][_0xa826('0x4c')](_0x4b4352[_0xa826('0x4d')],{})['then'](respondWithResult(_0x26a858,0xc9))[_0xa826('0x45')](handleError(_0x26a858,null));};exports['update']=function(_0x5e0947,_0xedcbc2){if(_0x5e0947[_0xa826('0x4d')]['id']){delete _0x5e0947['body']['id'];}return db[_0xa826('0x2d')][_0xa826('0x4b')]({'where':{'id':_0x5e0947['params']['id']}})['then'](handleEntityNotFound(_0xedcbc2,null))['then'](saveUpdates(_0x5e0947['body'],null))['then'](respondWithResult(_0xedcbc2,null))['catch'](handleError(_0xedcbc2,null));};exports['destroy']=function(_0xb3fae0,_0x5d5269){return db[_0xa826('0x2d')]['find']({'where':{'id':_0xb3fae0[_0xa826('0x47')]['id']}})[_0xa826('0x25')](handleEntityNotFound(_0x5d5269,null))[_0xa826('0x25')](removeEntity(_0x5d5269,null))[_0xa826('0x45')](handleError(_0x5d5269,null));};exports[_0xa826('0x4e')]=function(_0x52cf5e,_0x209704){return db['Cdr']['describe']()[_0xa826('0x25')](respondWithResult(_0x209704,null))[_0xa826('0x45')](handleError(_0x209704,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e2b0612..6b5c418 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x49856d,_0x1c47bc){var _0x19976d=function(_0x351f98){while(--_0x351f98){_0x49856d['push'](_0x49856d['shift']());}};_0x19976d(++_0x1c47bc);}(_0x7a54,0x106));var _0x47a5=function(_0x3ff227,_0x3a8351){_0x3ff227=_0x3ff227-0x0;var _0x3fae84=_0x7a54[_0x3ff227];return _0x3fae84;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x400a3b,_0x5a5189){var _0x53426b=function(_0x113d6d){while(--_0x113d6d){_0x400a3b['push'](_0x400a3b['shift']());}};_0x53426b(++_0x5a5189);}(_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 a41d34e..9f86bcb 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 _0x1d5e=['request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x5f3466,_0x15e4d3){var _0x21b9a6=function(_0x15a04b){while(--_0x15a04b){_0x5f3466['push'](_0x5f3466['shift']());}};_0x21b9a6(++_0x15e4d3);}(_0x1d5e,0x11b));var _0xe1d5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1d5e[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0xe1d5('0x0'));var moment=require('moment');var BPromise=require(_0xe1d5('0x1'));var rs=require(_0xe1d5('0x2'));var fs=require('fs');var Redis=require(_0xe1d5('0x3'));var db=require(_0xe1d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xe1d5('0x5'));var jayson=require(_0xe1d5('0x6'));var client=jayson[_0xe1d5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x464db5,_0xe682c4,_0x436702){return new BPromise(function(_0x4bbf8f,_0xe8872b){return client[_0xe1d5('0x8')](_0x464db5,_0x436702)[_0xe1d5('0x9')](function(_0x1219c8){logger[_0xe1d5('0xa')]('Cdr,\x20%s,\x20%s',_0xe682c4,_0xe1d5('0xb'));logger[_0xe1d5('0xc')](_0xe1d5('0xd'),_0xe682c4,_0xe1d5('0xb'),JSON[_0xe1d5('0xe')](_0x1219c8));if(_0x1219c8[_0xe1d5('0xf')]){if(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x10')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0xe682c4,_0x1219c8[_0xe1d5('0xf')]['message']);return _0xe8872b(_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);}logger['error'](_0xe1d5('0x12'),_0xe682c4,_0x1219c8[_0xe1d5('0xf')][_0xe1d5('0x11')]);return _0x4bbf8f(_0x1219c8['error'][_0xe1d5('0x11')]);}else{logger[_0xe1d5('0xa')](_0xe1d5('0x12'),_0xe682c4,'request\x20sent');_0x4bbf8f(_0x1219c8[_0xe1d5('0x13')][_0xe1d5('0x11')]);}})[_0xe1d5('0x14')](function(_0x354e4e){logger[_0xe1d5('0xf')](_0xe1d5('0x12'),_0xe682c4,_0x354e4e);_0xe8872b(_0x354e4e);});});}
\ No newline at end of file
+var _0xd892=['request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s'];(function(_0x2f77d6,_0x815a1d){var _0x5bf9eb=function(_0xb05bb5){while(--_0xb05bb5){_0x2f77d6['push'](_0x2f77d6['shift']());}};_0x5bf9eb(++_0x815a1d);}(_0xd892,0x18f));var _0x2d89=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xd892[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x2d89('0x0'));var util=require(_0x2d89('0x1'));var moment=require(_0x2d89('0x2'));var BPromise=require(_0x2d89('0x3'));var rs=require(_0x2d89('0x4'));var fs=require('fs');var Redis=require(_0x2d89('0x5'));var db=require(_0x2d89('0x6'))['db'];var utils=require(_0x2d89('0x7'));var logger=require(_0x2d89('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2d89('0x9'));var client=jayson[_0x2d89('0xa')][_0x2d89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x363cb9,_0x370d2a,_0xa3365d){return new BPromise(function(_0x14332c,_0xd82516){return client[_0x2d89('0xc')](_0x363cb9,_0xa3365d)[_0x2d89('0xd')](function(_0x470a45){logger['info'](_0x2d89('0xe'),_0x370d2a,_0x2d89('0xf'));logger[_0x2d89('0x10')]('Cdr,\x20%s,\x20%s,\x20%s',_0x370d2a,'request\x20sent',JSON[_0x2d89('0x11')](_0x470a45));if(_0x470a45[_0x2d89('0x12')]){if(_0x470a45[_0x2d89('0x12')][_0x2d89('0x13')]===0x1f4){logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);return _0xd82516(_0x470a45[_0x2d89('0x12')]['message']);}logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);return _0x14332c(_0x470a45[_0x2d89('0x12')][_0x2d89('0x14')]);}else{logger[_0x2d89('0x15')](_0x2d89('0xe'),_0x370d2a,_0x2d89('0xf'));_0x14332c(_0x470a45['result'][_0x2d89('0x14')]);}})[_0x2d89('0x16')](function(_0x2f62e4){logger[_0x2d89('0x12')](_0x2d89('0xe'),_0x370d2a,_0x2f62e4);_0xd82516(_0x2f62e4);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 0d650bf..3dd46ec 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(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 _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(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index d423ba9..16ece3c 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 _0x987f=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x127cfa,_0x1f028c){var _0x2a6dcb=function(_0x49af9c){while(--_0x49af9c){_0x127cfa['push'](_0x127cfa['shift']());}};_0x2a6dcb(++_0x1f028c);}(_0x987f,0xf9));var _0xf987=function(_0x2c1101,_0x1909d9){_0x2c1101=_0x2c1101-0x0;var _0x56f52f=_0x987f[_0x2c1101];return _0x56f52f;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'priority':{'type':Sequelize[_0xf987('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf987('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf987('0x4')]()},'description':{'type':Sequelize[_0xf987('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf987('0x5')}};
\ No newline at end of file
+var _0x9c76=['exports','noop','STRING','*,*,*,*','sequelize'];(function(_0x983327,_0x54bbf9){var _0x30e0c2=function(_0x22cedc){while(--_0x22cedc){_0x983327['push'](_0x983327['shift']());}};_0x30e0c2(++_0x54bbf9);}(_0x9c76,0x199));var _0x69c7=function(_0x1c73e8,_0x5349ec){_0x1c73e8=_0x1c73e8-0x0;var _0x5f2c5b=_0x9c76[_0x1c73e8];return _0x5f2c5b;};'use strict';var Sequelize=require(_0x69c7('0x0'));module[_0x69c7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x69c7('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x69c7('0x3')]},'interval':{'type':Sequelize[_0x69c7('0x3')],'defaultValue':_0x69c7('0x4')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 883b244..8b682b7 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 _0x639a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','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','../../config/environment','end','status','json','offset','undefined','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','include','merge','options','find','catch','update','body','ChatApplication'];(function(_0x15fcee,_0x5ca682){var _0x42c080=function(_0x4d1332){while(--_0x4d1332){_0x15fcee['push'](_0x15fcee['shift']());}};_0x42c080(++_0x5ca682);}(_0x639a,0xec));var _0xa639=function(_0x33ec4b,_0x30cdd9){_0x33ec4b=_0x33ec4b-0x0;var _0x48027a=_0x639a[_0x33ec4b];return _0x48027a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa639('0x0'));var zipdir=require(_0xa639('0x1'));var jsonpatch=require(_0xa639('0x2'));var rp=require(_0xa639('0x3'));var moment=require(_0xa639('0x4'));var BPromise=require(_0xa639('0x5'));var Mustache=require('mustache');var util=require(_0xa639('0x6'));var path=require(_0xa639('0x7'));var sox=require(_0xa639('0x8'));var csv=require('to-csv');var ejs=require(_0xa639('0x9'));var fs=require('fs');var fs_extra=require(_0xa639('0xa'));var _=require(_0xa639('0xb'));var squel=require(_0xa639('0xc'));var crypto=require('crypto');var jsforce=require(_0xa639('0xd'));var deskjs=require(_0xa639('0xe'));var toCsv=require(_0xa639('0xf'));var querystring=require(_0xa639('0x10'));var Papa=require(_0xa639('0x11'));var Redis=require(_0xa639('0x12'));var authService=require(_0xa639('0x13'));var qs=require(_0xa639('0x14'));var as=require(_0xa639('0x15'));var hardwareService=require(_0xa639('0x16'));var logger=require(_0xa639('0x17'))(_0xa639('0x18'));var utils=require(_0xa639('0x19'));var config=require(_0xa639('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ba862,_0x2bf30f){_0x2bf30f=_0x2bf30f||0xcc;return function(_0xbd7aec){if(_0xbd7aec){return _0x5ba862['sendStatus'](_0x2bf30f);}return _0x5ba862['status'](_0x2bf30f)[_0xa639('0x1b')]();};}function respondWithResult(_0x1bdc46,_0x4d4b66){_0x4d4b66=_0x4d4b66||0xc8;return function(_0x1df5dd){if(_0x1df5dd){return _0x1bdc46[_0xa639('0x1c')](_0x4d4b66)[_0xa639('0x1d')](_0x1df5dd);}};}function respondWithFilteredResult(_0x49e770,_0xb15138){return function(_0x24f1a9){if(_0x24f1a9){var _0x96a92f=typeof _0xb15138[_0xa639('0x1e')]===_0xa639('0x1f')&&typeof _0xb15138['limit']===_0xa639('0x1f');var _0x4c6311=_0x24f1a9[_0xa639('0x20')];var _0x2e23a9=_0x96a92f?0x0:_0xb15138[_0xa639('0x1e')];var _0x229545=_0x96a92f?_0x24f1a9[_0xa639('0x20')]:_0xb15138['offset']+_0xb15138['limit'];var _0x2a36df;if(_0x229545>=_0x4c6311){_0x229545=_0x4c6311;_0x2a36df=0xc8;}else{_0x2a36df=0xce;}_0x49e770[_0xa639('0x1c')](_0x2a36df);return _0x49e770[_0xa639('0x21')](_0xa639('0x22'),_0x2e23a9+'-'+_0x229545+'/'+_0x4c6311)[_0xa639('0x1d')](_0x24f1a9);}return null;};}function patchUpdates(_0x52500b){return function(_0x5a939f){try{jsonpatch[_0xa639('0x23')](_0x5a939f,_0x52500b,!![]);}catch(_0x5d732c){return BPromise['reject'](_0x5d732c);}return _0x5a939f['save']();};}function saveUpdates(_0x43f85f,_0x28a11c){return function(_0x13592d){if(_0x13592d){return _0x13592d['update'](_0x43f85f)[_0xa639('0x24')](function(_0x562d03){return _0x562d03;});}return null;};}function removeEntity(_0xe89eb9,_0x351a33){return function(_0x55189d){if(_0x55189d){return _0x55189d['destroy']()['then'](function(){_0xe89eb9[_0xa639('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42b5d8,_0x3d6e0c){return function(_0x237da8){if(!_0x237da8){_0x42b5d8[_0xa639('0x25')](0x194);}return _0x237da8;};}function handleError(_0x5ded72,_0x314e07){_0x314e07=_0x314e07||0x1f4;return function(_0x1a0d4e){logger[_0xa639('0x26')](_0x1a0d4e[_0xa639('0x27')]);if(_0x1a0d4e[_0xa639('0x28')]){delete _0x1a0d4e[_0xa639('0x28')];}_0x5ded72[_0xa639('0x1c')](_0x314e07)[_0xa639('0x29')](_0x1a0d4e);};}exports[_0xa639('0x2a')]=function(_0x3cda24,_0x4b7f2c){var _0x2d315f={'raw':!![],'where':{'id':_0x3cda24[_0xa639('0x2b')]['id']}},_0x38ff11={};_0x38ff11[_0xa639('0x2c')]=_[_0xa639('0x2d')](db['ChatApplication'][_0xa639('0x2e')]);_0x38ff11[_0xa639('0x2f')]=_['keys'](_0x3cda24[_0xa639('0x2f')]);_0x38ff11[_0xa639('0x30')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],_0x38ff11[_0xa639('0x2f')]);_0x2d315f[_0xa639('0x32')]=_[_0xa639('0x31')](_0x38ff11[_0xa639('0x2c')],qs['fields'](_0x3cda24[_0xa639('0x2f')]['fields']));_0x2d315f[_0xa639('0x32')]=_0x2d315f[_0xa639('0x32')]['length']?_0x2d315f[_0xa639('0x32')]:_0x38ff11['model'];if(_0x3cda24[_0xa639('0x2f')]['includeAll']){_0x2d315f[_0xa639('0x33')]=[{'all':!![]}];}_0x2d315f=_[_0xa639('0x34')]({},_0x2d315f,_0x3cda24[_0xa639('0x35')]);return db['ChatApplication'][_0xa639('0x36')](_0x2d315f)[_0xa639('0x24')](handleEntityNotFound(_0x4b7f2c,null))[_0xa639('0x24')](respondWithResult(_0x4b7f2c,null))[_0xa639('0x37')](handleError(_0x4b7f2c,null));};exports[_0xa639('0x38')]=function(_0x2c69fa,_0xa34d5c){if(_0x2c69fa[_0xa639('0x39')]['id']){delete _0x2c69fa['body']['id'];}return db[_0xa639('0x3a')]['find']({'where':{'id':_0x2c69fa[_0xa639('0x2b')]['id']}})[_0xa639('0x24')](handleEntityNotFound(_0xa34d5c,null))['then'](saveUpdates(_0x2c69fa[_0xa639('0x39')],null))[_0xa639('0x24')](respondWithResult(_0xa34d5c,null))[_0xa639('0x37')](handleError(_0xa34d5c,null));};exports['destroy']=function(_0x4ce86c,_0x16d74d){return db[_0xa639('0x3a')]['find']({'where':{'id':_0x4ce86c['params']['id']}})[_0xa639('0x24')](handleEntityNotFound(_0x16d74d,null))[_0xa639('0x24')](removeEntity(_0x16d74d,null))['catch'](handleError(_0x16d74d,null));};
\ No newline at end of file
+var _0xb077=['intersection','fields','length','include','merge','catch','body','find','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','status','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','attributes'];(function(_0x23e797,_0x1dc763){var _0xa5e856=function(_0x4578af){while(--_0x4578af){_0x23e797['push'](_0x23e797['shift']());}};_0xa5e856(++_0x1dc763);}(_0xb077,0x7a));var _0x7b07=function(_0x52551d,_0x9d47ba){_0x52551d=_0x52551d-0x0;var _0x5df61d=_0xb077[_0x52551d];return _0x5df61d;};'use strict';var emlformat=require(_0x7b07('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7b07('0x1'));var rp=require('request-promise');var moment=require(_0x7b07('0x2'));var BPromise=require(_0x7b07('0x3'));var Mustache=require(_0x7b07('0x4'));var util=require(_0x7b07('0x5'));var path=require(_0x7b07('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b07('0x7'));var fs=require('fs');var fs_extra=require(_0x7b07('0x8'));var _=require(_0x7b07('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7b07('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7b07('0xb'));var querystring=require(_0x7b07('0xc'));var Papa=require(_0x7b07('0xd'));var Redis=require(_0x7b07('0xe'));var authService=require(_0x7b07('0xf'));var qs=require(_0x7b07('0x10'));var as=require(_0x7b07('0x11'));var hardwareService=require(_0x7b07('0x12'));var logger=require(_0x7b07('0x13'))('api');var utils=require(_0x7b07('0x14'));var config=require(_0x7b07('0x15'));var licenseUtil=require(_0x7b07('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe825c4,_0x3d73c6){_0x3d73c6=_0x3d73c6||0xcc;return function(_0x9f3404){if(_0x9f3404){return _0xe825c4[_0x7b07('0x17')](_0x3d73c6);}return _0xe825c4['status'](_0x3d73c6)[_0x7b07('0x18')]();};}function respondWithResult(_0x10fc29,_0x44cf4c){_0x44cf4c=_0x44cf4c||0xc8;return function(_0x5ded26){if(_0x5ded26){return _0x10fc29['status'](_0x44cf4c)[_0x7b07('0x19')](_0x5ded26);}};}function respondWithFilteredResult(_0x389f3c,_0x2acc2f){return function(_0x2f6e33){if(_0x2f6e33){var _0x4b7d85=typeof _0x2acc2f['offset']==='undefined'&&typeof _0x2acc2f['limit']===_0x7b07('0x1a');var _0x18311b=_0x2f6e33[_0x7b07('0x1b')];var _0x3aab02=_0x4b7d85?0x0:_0x2acc2f[_0x7b07('0x1c')];var _0x282b2f=_0x4b7d85?_0x2f6e33[_0x7b07('0x1b')]:_0x2acc2f[_0x7b07('0x1c')]+_0x2acc2f[_0x7b07('0x1d')];var _0x2d9278;if(_0x282b2f>=_0x18311b){_0x282b2f=_0x18311b;_0x2d9278=0xc8;}else{_0x2d9278=0xce;}_0x389f3c['status'](_0x2d9278);return _0x389f3c['set']('Content-Range',_0x3aab02+'-'+_0x282b2f+'/'+_0x18311b)[_0x7b07('0x19')](_0x2f6e33);}return null;};}function patchUpdates(_0x3d0f65){return function(_0x2e5e24){try{jsonpatch[_0x7b07('0x1e')](_0x2e5e24,_0x3d0f65,!![]);}catch(_0x2f97ab){return BPromise[_0x7b07('0x1f')](_0x2f97ab);}return _0x2e5e24[_0x7b07('0x20')]();};}function saveUpdates(_0x481812,_0xe41126){return function(_0x44e774){if(_0x44e774){return _0x44e774[_0x7b07('0x21')](_0x481812)['then'](function(_0xf43662){return _0xf43662;});}return null;};}function removeEntity(_0x5ed88d,_0x2b81cf){return function(_0x5e858d){if(_0x5e858d){return _0x5e858d[_0x7b07('0x22')]()[_0x7b07('0x23')](function(){_0x5ed88d[_0x7b07('0x24')](0xcc)[_0x7b07('0x18')]();});}};}function handleEntityNotFound(_0x572e32,_0x3a960c){return function(_0x54943d){if(!_0x54943d){_0x572e32[_0x7b07('0x17')](0x194);}return _0x54943d;};}function handleError(_0x343e21,_0x4ded23){_0x4ded23=_0x4ded23||0x1f4;return function(_0x447119){logger[_0x7b07('0x25')](_0x447119[_0x7b07('0x26')]);if(_0x447119[_0x7b07('0x27')]){delete _0x447119[_0x7b07('0x27')];}_0x343e21[_0x7b07('0x24')](_0x4ded23)[_0x7b07('0x28')](_0x447119);};}exports[_0x7b07('0x29')]=function(_0x4777cc,_0x232f70){var _0xcaeb2a={'raw':!![],'where':{'id':_0x4777cc[_0x7b07('0x2a')]['id']}},_0xa78d19={};_0xa78d19[_0x7b07('0x2b')]=_[_0x7b07('0x2c')](db[_0x7b07('0x2d')]['rawAttributes']);_0xa78d19['query']=_[_0x7b07('0x2c')](_0x4777cc[_0x7b07('0x2e')]);_0xa78d19[_0x7b07('0x2f')]=_['intersection'](_0xa78d19[_0x7b07('0x2b')],_0xa78d19[_0x7b07('0x2e')]);_0xcaeb2a[_0x7b07('0x30')]=_[_0x7b07('0x31')](_0xa78d19['model'],qs[_0x7b07('0x32')](_0x4777cc['query'][_0x7b07('0x32')]));_0xcaeb2a['attributes']=_0xcaeb2a[_0x7b07('0x30')][_0x7b07('0x33')]?_0xcaeb2a['attributes']:_0xa78d19['model'];if(_0x4777cc[_0x7b07('0x2e')]['includeAll']){_0xcaeb2a[_0x7b07('0x34')]=[{'all':!![]}];}_0xcaeb2a=_[_0x7b07('0x35')]({},_0xcaeb2a,_0x4777cc['options']);return db[_0x7b07('0x2d')]['find'](_0xcaeb2a)[_0x7b07('0x23')](handleEntityNotFound(_0x232f70,null))[_0x7b07('0x23')](respondWithResult(_0x232f70,null))[_0x7b07('0x36')](handleError(_0x232f70,null));};exports[_0x7b07('0x21')]=function(_0xcfc128,_0x19c41f){if(_0xcfc128[_0x7b07('0x37')]['id']){delete _0xcfc128[_0x7b07('0x37')]['id'];}return db[_0x7b07('0x2d')][_0x7b07('0x38')]({'where':{'id':_0xcfc128[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x19c41f,null))[_0x7b07('0x23')](saveUpdates(_0xcfc128[_0x7b07('0x37')],null))[_0x7b07('0x23')](respondWithResult(_0x19c41f,null))[_0x7b07('0x36')](handleError(_0x19c41f,null));};exports[_0x7b07('0x22')]=function(_0x409f8d,_0x46f5bd){return db[_0x7b07('0x2d')]['find']({'where':{'id':_0x409f8d[_0x7b07('0x2a')]['id']}})[_0x7b07('0x23')](handleEntityNotFound(_0x46f5bd,null))[_0x7b07('0x23')](removeEntity(_0x46f5bd,null))[_0x7b07('0x36')](handleError(_0x46f5bd,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index ff4fd32..791e586 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 _0xf0cc=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','lodash','api','request-promise','path'];(function(_0xb1f8d9,_0x595b62){var _0x1c72da=function(_0x511a0c){while(--_0x511a0c){_0xb1f8d9['push'](_0xb1f8d9['shift']());}};_0x1c72da(++_0x595b62);}(_0xf0cc,0xa7));var _0xcf0c=function(_0xe4bba1,_0x4cae3a){_0xe4bba1=_0xe4bba1-0x0;var _0x4a7fcf=_0xf0cc[_0xe4bba1];return _0x4a7fcf;};'use strict';var _=require(_0xcf0c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcf0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcf0c('0x2'));var fs=require('fs');var path=require(_0xcf0c('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x4'));module[_0xcf0c('0x5')]=function(_0x1a6003,_0x497363){return _0x1a6003[_0xcf0c('0x6')](_0xcf0c('0x7'),attributes,{'tableName':_0xcf0c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xaffb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x57169f,_0x2695f6){var _0xb9279=function(_0x4a4e32){while(--_0x4a4e32){_0x57169f['push'](_0x57169f['shift']());}};_0xb9279(++_0x2695f6);}(_0xaffb,0x85));var _0xbaff=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0xaffb[_0x5401ae];return _0x286068;};'use strict';var _=require(_0xbaff('0x0'));var util=require(_0xbaff('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbaff('0x2'));var BPromise=require(_0xbaff('0x3'));var rp=require(_0xbaff('0x4'));var fs=require('fs');var path=require(_0xbaff('0x5'));var rimraf=require(_0xbaff('0x6'));var config=require(_0xbaff('0x7'));var attributes=require(_0xbaff('0x8'));module[_0xbaff('0x9')]=function(_0x2e7034,_0xd86e22){return _0x2e7034[_0xbaff('0xa')](_0xbaff('0xb'),attributes,{'tableName':_0xbaff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbaff('0xd'),'collate':_0xbaff('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 4691932..9b7cf35 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 _0x0541=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1f2314,_0x38e139){var _0x515db4=function(_0x41f99d){while(--_0x41f99d){_0x1f2314['push'](_0x1f2314['shift']());}};_0x515db4(++_0x38e139);}(_0x0541,0x155));var _0x1054=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0541[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0x1054('0x0'));var util=require(_0x1054('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1054('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1054('0x3'))['db'];var utils=require(_0x1054('0x4'));var logger=require(_0x1054('0x5'))(_0x1054('0x6'));var config=require(_0x1054('0x7'));var jayson=require(_0x1054('0x8'));var client=jayson[_0x1054('0x9')][_0x1054('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189527,_0x4dbedb,_0x4e478e){return new BPromise(function(_0x466374,_0x39217b){return client[_0x1054('0xb')](_0x189527,_0x4e478e)[_0x1054('0xc')](function(_0x26d170){logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));logger[_0x1054('0x10')](_0x1054('0x11'),_0x4dbedb,_0x1054('0xf'),JSON['stringify'](_0x26d170));if(_0x26d170['error']){if(_0x26d170[_0x1054('0x12')]['code']===0x1f4){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170['error'][_0x1054('0x13')]);return _0x39217b(_0x26d170[_0x1054('0x12')]['message']);}logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);return _0x466374(_0x26d170[_0x1054('0x12')][_0x1054('0x13')]);}else{logger[_0x1054('0xd')](_0x1054('0xe'),_0x4dbedb,_0x1054('0xf'));_0x466374(_0x26d170['result'][_0x1054('0x13')]);}})[_0x1054('0x14')](function(_0x30dbe6){logger[_0x1054('0x12')](_0x1054('0xe'),_0x4dbedb,_0x30dbe6);_0x39217b(_0x30dbe6);});});}
\ No newline at end of file
+var _0x3864=['error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x13d153,_0x3edda1){var _0x508a08=function(_0x465db7){while(--_0x465db7){_0x13d153['push'](_0x13d153['shift']());}};_0x508a08(++_0x3edda1);}(_0x3864,0x124));var _0x4386=function(_0x3515e4,_0x1b3681){_0x3515e4=_0x3515e4-0x0;var _0x5ce445=_0x3864[_0x3515e4];return _0x5ce445;};'use strict';var _=require(_0x4386('0x0'));var util=require(_0x4386('0x1'));var moment=require(_0x4386('0x2'));var BPromise=require('bluebird');var rs=require(_0x4386('0x3'));var fs=require('fs');var Redis=require(_0x4386('0x4'));var db=require(_0x4386('0x5'))['db'];var utils=require(_0x4386('0x6'));var logger=require('../../config/logger')(_0x4386('0x7'));var config=require(_0x4386('0x8'));var jayson=require(_0x4386('0x9'));var client=jayson['client'][_0x4386('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x749358,_0x4ee23b,_0x4cd0db){return new BPromise(function(_0x115fde,_0x33b78f){return client[_0x4386('0xb')](_0x749358,_0x4cd0db)[_0x4386('0xc')](function(_0x1b6c79){logger[_0x4386('0xd')]('ChatApplication,\x20%s,\x20%s',_0x4ee23b,_0x4386('0xe'));logger[_0x4386('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x4ee23b,'request\x20sent',JSON['stringify'](_0x1b6c79));if(_0x1b6c79['error']){if(_0x1b6c79[_0x4386('0x10')][_0x4386('0x11')]===0x1f4){logger[_0x4386('0x10')](_0x4386('0x12'),_0x4ee23b,_0x1b6c79[_0x4386('0x10')][_0x4386('0x13')]);return _0x33b78f(_0x1b6c79[_0x4386('0x10')][_0x4386('0x13')]);}logger[_0x4386('0x10')](_0x4386('0x12'),_0x4ee23b,_0x1b6c79[_0x4386('0x10')]['message']);return _0x115fde(_0x1b6c79[_0x4386('0x10')]['message']);}else{logger[_0x4386('0xd')](_0x4386('0x12'),_0x4ee23b,'request\x20sent');_0x115fde(_0x1b6c79[_0x4386('0x14')]['message']);}})[_0x4386('0x15')](function(_0x5c5ff7){logger['error'](_0x4386('0x12'),_0x4ee23b,_0x5c5ff7);_0x33b78f(_0x5c5ff7);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 3d9d525..0673885 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 _0xfdf2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x29887d,_0x36d8e9){var _0xe5a96a=function(_0x845060){while(--_0x845060){_0x29887d['push'](_0x29887d['shift']());}};_0xe5a96a(++_0x36d8e9);}(_0xfdf2,0x1aa));var _0x2fdf=function(_0x3b194f,_0x4b5a3e){_0x3b194f=_0x3b194f-0x0;var _0x1dce17=_0xfdf2[_0x3b194f];return _0x1dce17;};'use strict';var multer=require('multer');var util=require(_0x2fdf('0x0'));var path=require(_0x2fdf('0x1'));var timeout=require(_0x2fdf('0x2'));var express=require(_0x2fdf('0x3'));var router=express[_0x2fdf('0x4')]();var fs_extra=require(_0x2fdf('0x5'));var auth=require(_0x2fdf('0x6'));var interaction=require(_0x2fdf('0x7'));var config=require(_0x2fdf('0x8'));var controller=require('./chatApplication.controller');router[_0x2fdf('0x9')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xb')]);router[_0x2fdf('0xc')]('/:id',auth[_0x2fdf('0xa')](),controller[_0x2fdf('0xd')]);router[_0x2fdf('0xe')](_0x2fdf('0xf'),auth[_0x2fdf('0xa')](),controller[_0x2fdf('0x10')]);module[_0x2fdf('0x11')]=router;
\ No newline at end of file
+var _0x3acd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0xaf2f45,_0x23d92a){var _0xa228b8=function(_0x390d4f){while(--_0x390d4f){_0xaf2f45['push'](_0xaf2f45['shift']());}};_0xa228b8(++_0x23d92a);}(_0x3acd,0x14e));var _0xd3ac=function(_0x255a7f,_0x107d6e){_0x255a7f=_0x255a7f-0x0;var _0x57e195=_0x3acd[_0x255a7f];return _0x57e195;};'use strict';var multer=require(_0xd3ac('0x0'));var util=require(_0xd3ac('0x1'));var path=require(_0xd3ac('0x2'));var timeout=require(_0xd3ac('0x3'));var express=require(_0xd3ac('0x4'));var router=express['Router']();var fs_extra=require(_0xd3ac('0x5'));var auth=require(_0xd3ac('0x6'));var interaction=require(_0xd3ac('0x7'));var config=require(_0xd3ac('0x8'));var controller=require(_0xd3ac('0x9'));router[_0xd3ac('0xa')](_0xd3ac('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd3ac('0xc')]('/:id',auth[_0xd3ac('0xd')](),controller[_0xd3ac('0xe')]);router[_0xd3ac('0xf')](_0xd3ac('0xb'),auth[_0xd3ac('0xd')](),controller['destroy']);module[_0xd3ac('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 7a49579..69664c1 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 _0xafec=['STRING','BOOLEAN','exports'];(function(_0x1c5042,_0x1ff338){var _0x20aa36=function(_0x4f97e8){while(--_0x4f97e8){_0x1c5042['push'](_0x1c5042['shift']());}};_0x20aa36(++_0x1ff338);}(_0xafec,0x161));var _0xcafe=function(_0xf0abc0,_0x3d3cdc){_0xf0abc0=_0xf0abc0-0x0;var _0x29fd55=_0xafec[_0xf0abc0];return _0x29fd55;};'use strict';var Sequelize=require('sequelize');module[_0xcafe('0x0')]={'name':{'type':Sequelize[_0xcafe('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcafe('0x1')]},'write':{'type':Sequelize[_0xcafe('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1dbb=['BOOLEAN','sequelize','exports','STRING'];(function(_0x43dbd8,_0x4f70e6){var _0x4dac4d=function(_0x213056){while(--_0x213056){_0x43dbd8['push'](_0x43dbd8['shift']());}};_0x4dac4d(++_0x4f70e6);}(_0x1dbb,0xed));var _0xb1db=function(_0x317554,_0x53e29f){_0x317554=_0x317554-0x0;var _0x4db3d6=_0x1dbb[_0x317554];return _0x4db3d6;};'use strict';var Sequelize=require(_0xb1db('0x0'));module[_0xb1db('0x1')]={'name':{'type':Sequelize[_0xb1db('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb1db('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 35f7caa..e714363 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 _0x793f=['jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','save','update','then','error','stack','name','send','ChatGroup','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','model','length','include','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','rimraf','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto'];(function(_0x590861,_0x42c7f3){var _0x1d0a80=function(_0x42d3de){while(--_0x42d3de){_0x590861['push'](_0x590861['shift']());}};_0x1d0a80(++_0x42c7f3);}(_0x793f,0x15a));var _0xf793=function(_0x257c53,_0x2cddf8){_0x257c53=_0x257c53-0x0;var _0x6f5365=_0x793f[_0x257c53];return _0x6f5365;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf793('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf793('0x1'));var rp=require(_0xf793('0x2'));var moment=require('moment');var BPromise=require(_0xf793('0x3'));var Mustache=require('mustache');var util=require(_0xf793('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xf793('0x5'));var ejs=require(_0xf793('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf793('0x7'));var squel=require(_0xf793('0x8'));var crypto=require(_0xf793('0x9'));var jsforce=require(_0xf793('0xa'));var deskjs=require(_0xf793('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf793('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf793('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf793('0xe'));var logger=require('../../config/logger')(_0xf793('0xf'));var utils=require('../../config/utils');var config=require(_0xf793('0x10'));var licenseUtil=require(_0xf793('0x11'));var db=require(_0xf793('0x12'))['db'];config['redis']=_['defaults'](config[_0xf793('0x13')],{'host':_0xf793('0x14'),'port':0x18eb});var socket=require(_0xf793('0x15'))(new Redis(config[_0xf793('0x13')]));require('./chatGroup.socket')[_0xf793('0x16')](socket);function respondWithStatusCode(_0x43859c,_0x24c62f){_0x24c62f=_0x24c62f||0xcc;return function(_0x23ba38){if(_0x23ba38){return _0x43859c[_0xf793('0x17')](_0x24c62f);}return _0x43859c['status'](_0x24c62f)[_0xf793('0x18')]();};}function respondWithResult(_0x583148,_0x114925){_0x114925=_0x114925||0xc8;return function(_0x4b8f58){if(_0x4b8f58){return _0x583148['status'](_0x114925)['json'](_0x4b8f58);}};}function respondWithFilteredResult(_0x19bc06,_0x54188a){return function(_0x22335a){if(_0x22335a){var _0x31d5e1=typeof _0x54188a[_0xf793('0x19')]===_0xf793('0x1a')&&typeof _0x54188a[_0xf793('0x1b')]==='undefined';var _0x3bc25b=_0x22335a[_0xf793('0x1c')];var _0x1ed3a2=_0x31d5e1?0x0:_0x54188a['offset'];var _0x536eda=_0x31d5e1?_0x22335a[_0xf793('0x1c')]:_0x54188a[_0xf793('0x19')]+_0x54188a[_0xf793('0x1b')];var _0x552fbb;if(_0x536eda>=_0x3bc25b){_0x536eda=_0x3bc25b;_0x552fbb=0xc8;}else{_0x552fbb=0xce;}_0x19bc06[_0xf793('0x1d')](_0x552fbb);return _0x19bc06['set'](_0xf793('0x1e'),_0x1ed3a2+'-'+_0x536eda+'/'+_0x3bc25b)[_0xf793('0x1f')](_0x22335a);}return null;};}function patchUpdates(_0x41cfc7){return function(_0x59cd26){try{jsonpatch['apply'](_0x59cd26,_0x41cfc7,!![]);}catch(_0x571c46){return BPromise['reject'](_0x571c46);}return _0x59cd26[_0xf793('0x20')]();};}function saveUpdates(_0x450e39,_0x4be66b){return function(_0x20210d){if(_0x20210d){return _0x20210d[_0xf793('0x21')](_0x450e39)['then'](function(_0x53dbd6){return _0x53dbd6;});}return null;};}function removeEntity(_0x682f1b,_0x2806f9){return function(_0x4d7193){if(_0x4d7193){return _0x4d7193['destroy']()[_0xf793('0x22')](function(){_0x682f1b[_0xf793('0x1d')](0xcc)[_0xf793('0x18')]();});}};}function handleEntityNotFound(_0x2658d6,_0x30808a){return function(_0x5a332b){if(!_0x5a332b){_0x2658d6[_0xf793('0x17')](0x194);}return _0x5a332b;};}function handleError(_0x2135f2,_0x23d344){_0x23d344=_0x23d344||0x1f4;return function(_0x221e3a){logger[_0xf793('0x23')](_0x221e3a[_0xf793('0x24')]);if(_0x221e3a['name']){delete _0x221e3a[_0xf793('0x25')];}_0x2135f2[_0xf793('0x1d')](_0x23d344)[_0xf793('0x26')](_0x221e3a);};}exports['index']=function(_0x1b0fec,_0x1f038f){var _0x5c5180={},_0x3dbc29={},_0xa5fd34={'count':0x0,'rows':[]};var _0x9698a0=_['map'](db[_0xf793('0x27')][_0xf793('0x28')],function(_0x4423cc){return{'name':_0x4423cc[_0xf793('0x29')],'type':_0x4423cc[_0xf793('0x2a')][_0xf793('0x2b')]};});_0x3dbc29['model']=_[_0xf793('0x2c')](_0x9698a0,_0xf793('0x25'));_0x3dbc29[_0xf793('0x2d')]=_[_0xf793('0x2e')](_0x1b0fec[_0xf793('0x2d')]);_0x3dbc29[_0xf793('0x2f')]=_['intersection'](_0x3dbc29['model'],_0x3dbc29[_0xf793('0x2d')]);_0x5c5180[_0xf793('0x30')]=_[_0xf793('0x31')](_0x3dbc29['model'],qs['fields'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x32')]));_0x5c5180[_0xf793('0x30')]=_0x5c5180[_0xf793('0x30')]['length']?_0x5c5180['attributes']:_0x3dbc29['model'];if(!_0x1b0fec[_0xf793('0x2d')]['hasOwnProperty'](_0xf793('0x33'))){_0x5c5180[_0xf793('0x1b')]=qs[_0xf793('0x1b')](_0x1b0fec['query'][_0xf793('0x1b')]);_0x5c5180[_0xf793('0x19')]=qs['offset'](_0x1b0fec[_0xf793('0x2d')][_0xf793('0x19')]);}_0x5c5180['order']=qs[_0xf793('0x34')](_0x1b0fec['query'][_0xf793('0x34')]);_0x5c5180[_0xf793('0x35')]=qs['filters'](_[_0xf793('0x36')](_0x1b0fec[_0xf793('0x2d')],_0x3dbc29[_0xf793('0x2f')]),_0x9698a0);if(_0x1b0fec['query'][_0xf793('0x37')]){_0x5c5180[_0xf793('0x35')]=_[_0xf793('0x38')](_0x5c5180[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0x9698a0,function(_0x2ac7e6){if(_0x2ac7e6['type']!==_0xf793('0x39')){var _0x2c558e={};_0x2c558e[_0x2ac7e6[_0xf793('0x25')]]={'$like':'%'+_0x1b0fec[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x2c558e;}})});}_0x5c5180=_[_0xf793('0x38')]({},_0x5c5180,_0x1b0fec[_0xf793('0x3a')]);var _0x44daf7={'where':_0x5c5180['where']};return db[_0xf793('0x27')][_0xf793('0x1c')](_0x44daf7)[_0xf793('0x22')](function(_0x4ae4b6){_0xa5fd34[_0xf793('0x1c')]=_0x4ae4b6;if(_0x1b0fec[_0xf793('0x2d')][_0xf793('0x3b')]){_0x5c5180['include']=[{'all':!![]}];}return db[_0xf793('0x27')]['findAll'](_0x5c5180);})[_0xf793('0x22')](function(_0x4ee1af){_0xa5fd34[_0xf793('0x3c')]=_0x4ee1af;return _0xa5fd34;})[_0xf793('0x22')](respondWithFilteredResult(_0x1f038f,_0x5c5180))['catch'](handleError(_0x1f038f,null));};exports[_0xf793('0x3d')]=function(_0x4a6f50,_0x29c5d5){var _0x5680de={'raw':!![],'where':{'id':_0x4a6f50[_0xf793('0x3e')]['id']}},_0x13a4e6={};_0x13a4e6[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x27')][_0xf793('0x28')]);_0x13a4e6[_0xf793('0x2d')]=_['keys'](_0x4a6f50['query']);_0x13a4e6['filters']=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],_0x13a4e6['query']);_0x5680de[_0xf793('0x30')]=_[_0xf793('0x31')](_0x13a4e6[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x4a6f50['query']['fields']));_0x5680de['attributes']=_0x5680de[_0xf793('0x30')][_0xf793('0x40')]?_0x5680de[_0xf793('0x30')]:_0x13a4e6[_0xf793('0x3f')];if(_0x4a6f50[_0xf793('0x2d')]['includeAll']){_0x5680de[_0xf793('0x41')]=[{'all':!![]}];}_0x5680de=_[_0xf793('0x38')]({},_0x5680de,_0x4a6f50[_0xf793('0x3a')]);return db[_0xf793('0x27')][_0xf793('0x42')](_0x5680de)['then'](handleEntityNotFound(_0x29c5d5,null))[_0xf793('0x22')](respondWithResult(_0x29c5d5,null))[_0xf793('0x43')](handleError(_0x29c5d5,null));};exports['create']=function(_0x57fe6d,_0x22ae8e){return db[_0xf793('0x27')][_0xf793('0x44')](_0x57fe6d[_0xf793('0x45')],{})[_0xf793('0x22')](respondWithResult(_0x22ae8e,0xc9))[_0xf793('0x43')](handleError(_0x22ae8e,null));};exports[_0xf793('0x21')]=function(_0x11be05,_0x279d9d){if(_0x11be05['body']['id']){delete _0x11be05[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x11be05[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x279d9d,null))[_0xf793('0x22')](saveUpdates(_0x11be05['body'],null))[_0xf793('0x22')](respondWithResult(_0x279d9d,null))[_0xf793('0x43')](handleError(_0x279d9d,null));};exports[_0xf793('0x46')]=function(_0x515caf,_0x2c408e){return db['ChatGroup'][_0xf793('0x42')]({'where':{'id':_0x515caf[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x2c408e,null))[_0xf793('0x22')](removeEntity(_0x2c408e,null))[_0xf793('0x43')](handleError(_0x2c408e,null));};exports[_0xf793('0x47')]=function(_0x316f20,_0x35e024){return db[_0xf793('0x27')]['describe']()[_0xf793('0x22')](respondWithResult(_0x35e024,null))[_0xf793('0x43')](handleError(_0x35e024,null));};exports[_0xf793('0x48')]=function(_0x5d9a42,_0x31aecf,_0x495379){return db[_0xf793('0x49')]['count']({'where':{'ChatGroupId':_0x5d9a42[_0xf793('0x3e')]['id'],'ToId':_0x5d9a42[_0xf793('0x4a')]['id'],'read':![]}})[_0xf793('0x22')](function(_0x5eb283){return{'id':_[_0xf793('0x4b')](_0x5d9a42[_0xf793('0x3e')]['id']),'count':_0x5eb283};})[_0xf793('0x22')](respondWithResult(_0x31aecf,null))[_0xf793('0x43')](handleError(_0x31aecf,null));};exports[_0xf793('0x4c')]=function(_0x101876,_0x333e54,_0x63b614){return db[_0xf793('0x27')]['find']({'where':{'id':_0x101876[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x333e54,null))[_0xf793('0x22')](function(_0x3d0e06){if(_0x3d0e06){return _0x3d0e06['addMembers'](_0x101876['body']['ids'],_[_0xf793('0x4d')](_0x101876['body'],[_0xf793('0x4e'),'id'])||{});}})[_0xf793('0x22')](respondWithResult(_0x333e54,null))[_0xf793('0x43')](handleError(_0x333e54,null));};exports[_0xf793('0x4f')]=function(_0x36a031,_0x4c5734,_0x43e446){var _0xeeacd9={};var _0x458774={};var _0x54de26;var _0x2c42f8;return db[_0xf793('0x27')][_0xf793('0x50')]({'where':{'id':_0x36a031[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x4c5734,null))[_0xf793('0x22')](function(_0x4585dd){if(_0x4585dd){_0x54de26=_0x4585dd;_0x458774[_0xf793('0x3f')]=_[_0xf793('0x2e')](db[_0xf793('0x51')][_0xf793('0x28')]);_0x458774[_0xf793('0x2d')]=_['keys'](_0x36a031[_0xf793('0x2d')]);_0x458774[_0xf793('0x2f')]=_['intersection'](_0x458774['model'],_0x458774[_0xf793('0x2d')]);_0xeeacd9[_0xf793('0x30')]=_['intersection'](_0x458774[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x36a031[_0xf793('0x2d')]['fields']));_0xeeacd9['attributes']=_0xeeacd9[_0xf793('0x30')][_0xf793('0x40')]?_0xeeacd9[_0xf793('0x30')]:_0x458774[_0xf793('0x3f')];_0xeeacd9['order']=qs[_0xf793('0x34')](_0x36a031['query'][_0xf793('0x34')]);_0xeeacd9[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x36a031[_0xf793('0x2d')],_0x458774['filters']));if(_0x36a031[_0xf793('0x2d')]['filter']){_0xeeacd9['where']=_['merge'](_0xeeacd9[_0xf793('0x35')],{'$or':_[_0xf793('0x2c')](_0xeeacd9[_0xf793('0x30')],function(_0x1c7f76){var _0x50772c={};_0x50772c[_0x1c7f76]={'$like':'%'+_0x36a031[_0xf793('0x2d')][_0xf793('0x37')]+'%'};return _0x50772c;})});}_0xeeacd9=_[_0xf793('0x38')]({},_0xeeacd9,_0x36a031[_0xf793('0x3a')]);return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})[_0xf793('0x22')](function(_0x1266ed){if(_0x1266ed){_0x2c42f8=_0x1266ed[_0xf793('0x40')];if(!_0x36a031['query']['hasOwnProperty'](_0xf793('0x33'))){_0xeeacd9[_0xf793('0x1b')]=qs['limit'](_0x36a031[_0xf793('0x2d')][_0xf793('0x1b')]);_0xeeacd9[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x36a031[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x54de26[_0xf793('0x4f')](_0xeeacd9);}})['then'](function(_0x1bc456){if(_0x1bc456){return _0x1bc456?{'count':_0x2c42f8,'rows':_0x1bc456}:null;}})[_0xf793('0x22')](respondWithResult(_0x4c5734,null))[_0xf793('0x43')](handleError(_0x4c5734,null));};exports[_0xf793('0x52')]=function(_0x2e9eb0,_0x2ccc6c,_0x28487b){return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2e9eb0[_0xf793('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ccc6c,null))['then'](function(_0x54def8){if(_0x54def8){return _0x54def8[_0xf793('0x52')](_0x2e9eb0['query']['ids']);}})[_0xf793('0x22')](respondWithStatusCode(_0x2ccc6c,null))[_0xf793('0x43')](handleError(_0x2ccc6c,null));};exports[_0xf793('0x53')]=function(_0x2adce5,_0x30bcc1,_0x342eae){if(_0x2adce5['body']['id']){delete _0x2adce5[_0xf793('0x45')]['id'];}return db[_0xf793('0x27')][_0xf793('0x42')]({'where':{'id':_0x2adce5[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x30bcc1,null))[_0xf793('0x22')](function(_0x2ce0b5){if(_0x2ce0b5){_0x2adce5[_0xf793('0x45')][_0xf793('0x54')]=_0x2ce0b5['id'];return db[_0xf793('0x49')][_0xf793('0x44')](_0x2adce5[_0xf793('0x45')]);}})['then'](respondWithResult(_0x30bcc1,null))[_0xf793('0x43')](handleError(_0x30bcc1,null));};exports[_0xf793('0x55')]=function(_0x43f3ad,_0x522715,_0x55e392){var _0x52fb76={};var _0x1ff0bf={};var _0x3022b1;var _0x3ba91e;return db['ChatGroup'][_0xf793('0x50')]({'where':{'id':_0x43f3ad[_0xf793('0x3e')]['id']}})[_0xf793('0x22')](handleEntityNotFound(_0x522715,null))['then'](function(_0xe40850){if(_0xe40850){_0x3022b1=_0xe40850;_0x1ff0bf[_0xf793('0x3f')]=_['keys'](db[_0xf793('0x49')][_0xf793('0x28')]);_0x1ff0bf['query']=_[_0xf793('0x2e')](_0x43f3ad[_0xf793('0x2d')]);_0x1ff0bf['filters']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],_0x1ff0bf[_0xf793('0x2d')]);_0x52fb76['attributes']=_[_0xf793('0x31')](_0x1ff0bf[_0xf793('0x3f')],qs[_0xf793('0x32')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x32')]));_0x52fb76[_0xf793('0x30')]=_0x52fb76['attributes'][_0xf793('0x40')]?_0x52fb76[_0xf793('0x30')]:_0x1ff0bf[_0xf793('0x3f')];_0x52fb76['order']=qs[_0xf793('0x34')](_0x43f3ad[_0xf793('0x2d')]['sort']);_0x52fb76[_0xf793('0x35')]=qs[_0xf793('0x2f')](_[_0xf793('0x36')](_0x43f3ad[_0xf793('0x2d')],_0x1ff0bf[_0xf793('0x2f')]));if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x37')]){_0x52fb76['where']=_[_0xf793('0x38')](_0x52fb76['where'],{'$or':_[_0xf793('0x2c')](_0x52fb76[_0xf793('0x30')],function(_0x111f8a){var _0x1b9193={};_0x1b9193[_0x111f8a]={'$like':'%'+_0x43f3ad[_0xf793('0x2d')]['filter']+'%'};return _0x1b9193;})});}if(_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')]){var _0x3d1608=_0x43f3ad[_0xf793('0x2d')][_0xf793('0x56')][_0xf793('0x57')](',');var _0x37a9da={};_0x37a9da[_0x3d1608[0x0]]={'$gte':moment(_0x3d1608[0x1])[_0xf793('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x52fb76[_0xf793('0x35')]=_[_0xf793('0x38')](_0x52fb76[_0xf793('0x35')],_0x37a9da);}_0x52fb76=_['merge']({},_0x52fb76,_0x43f3ad[_0xf793('0x3a')]);return _0x3022b1['getMessages'](_0x52fb76);}})[_0xf793('0x22')](function(_0x1cbc07){if(_0x1cbc07){_0x3ba91e=_0x1cbc07[_0xf793('0x40')];if(!_0x43f3ad[_0xf793('0x2d')]['hasOwnProperty']('nolimit')){_0x52fb76[_0xf793('0x1b')]=qs['limit'](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x1b')]);_0x52fb76[_0xf793('0x19')]=qs[_0xf793('0x19')](_0x43f3ad[_0xf793('0x2d')][_0xf793('0x19')]);}return _0x3022b1[_0xf793('0x55')](_0x52fb76);}})[_0xf793('0x22')](function(_0x506d0b){if(_0x506d0b){return _0x506d0b?{'count':_0x3ba91e,'rows':_0x506d0b}:null;}})[_0xf793('0x22')](respondWithResult(_0x522715,null))['catch'](handleError(_0x522715,null));};
\ No newline at end of file
+var _0x0ca0=['include','findAll','show','params','rawAttributes','options','find','create','body','destroy','describe','catch','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','ChatGroup','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ca0,0x142));var _0x00ca=function(_0x2c48f3,_0x58ec6c){_0x2c48f3=_0x2c48f3-0x0;var _0x234a62=_0x0ca0[_0x2c48f3];return _0x234a62;};'use strict';var emlformat=require(_0x00ca('0x0'));var rimraf=require(_0x00ca('0x1'));var zipdir=require(_0x00ca('0x2'));var jsonpatch=require(_0x00ca('0x3'));var rp=require(_0x00ca('0x4'));var moment=require(_0x00ca('0x5'));var BPromise=require(_0x00ca('0x6'));var Mustache=require('mustache');var util=require(_0x00ca('0x7'));var path=require(_0x00ca('0x8'));var sox=require(_0x00ca('0x9'));var csv=require(_0x00ca('0xa'));var ejs=require(_0x00ca('0xb'));var fs=require('fs');var fs_extra=require(_0x00ca('0xc'));var _=require(_0x00ca('0xd'));var squel=require('squel');var crypto=require(_0x00ca('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x00ca('0xf'));var toCsv=require(_0x00ca('0xa'));var querystring=require('querystring');var Papa=require(_0x00ca('0x10'));var Redis=require(_0x00ca('0x11'));var authService=require(_0x00ca('0x12'));var qs=require(_0x00ca('0x13'));var as=require(_0x00ca('0x14'));var hardwareService=require(_0x00ca('0x15'));var logger=require(_0x00ca('0x16'))(_0x00ca('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x00ca('0x18'));var db=require('../../mysqldb')['db'];config[_0x00ca('0x19')]=_[_0x00ca('0x1a')](config[_0x00ca('0x19')],{'host':_0x00ca('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x00ca('0x19')]));require(_0x00ca('0x1c'))[_0x00ca('0x1d')](socket);function respondWithStatusCode(_0x599f36,_0x2c2841){_0x2c2841=_0x2c2841||0xcc;return function(_0x498762){if(_0x498762){return _0x599f36[_0x00ca('0x1e')](_0x2c2841);}return _0x599f36[_0x00ca('0x1f')](_0x2c2841)[_0x00ca('0x20')]();};}function respondWithResult(_0x568e98,_0x314898){_0x314898=_0x314898||0xc8;return function(_0x4916d2){if(_0x4916d2){return _0x568e98[_0x00ca('0x1f')](_0x314898)[_0x00ca('0x21')](_0x4916d2);}};}function respondWithFilteredResult(_0x55c9cf,_0x7752c8){return function(_0x3849e5){if(_0x3849e5){var _0x1b61ae=typeof _0x7752c8[_0x00ca('0x22')]===_0x00ca('0x23')&&typeof _0x7752c8['limit']===_0x00ca('0x23');var _0x4cc0a9=_0x3849e5[_0x00ca('0x24')];var _0x44ce38=_0x1b61ae?0x0:_0x7752c8[_0x00ca('0x22')];var _0x52c013=_0x1b61ae?_0x3849e5[_0x00ca('0x24')]:_0x7752c8['offset']+_0x7752c8[_0x00ca('0x25')];var _0x10619b;if(_0x52c013>=_0x4cc0a9){_0x52c013=_0x4cc0a9;_0x10619b=0xc8;}else{_0x10619b=0xce;}_0x55c9cf[_0x00ca('0x1f')](_0x10619b);return _0x55c9cf['set'](_0x00ca('0x26'),_0x44ce38+'-'+_0x52c013+'/'+_0x4cc0a9)['json'](_0x3849e5);}return null;};}function patchUpdates(_0x4ae11f){return function(_0x197713){try{jsonpatch[_0x00ca('0x27')](_0x197713,_0x4ae11f,!![]);}catch(_0x1a6d08){return BPromise[_0x00ca('0x28')](_0x1a6d08);}return _0x197713['save']();};}function saveUpdates(_0x1111b5,_0x245176){return function(_0x33cea2){if(_0x33cea2){return _0x33cea2[_0x00ca('0x29')](_0x1111b5)['then'](function(_0x1c1188){return _0x1c1188;});}return null;};}function removeEntity(_0x51ec44,_0x32c023){return function(_0xd1939b){if(_0xd1939b){return _0xd1939b['destroy']()[_0x00ca('0x2a')](function(){_0x51ec44['status'](0xcc)[_0x00ca('0x20')]();});}};}function handleEntityNotFound(_0x20be1f,_0x3d89c1){return function(_0x4bb609){if(!_0x4bb609){_0x20be1f['sendStatus'](0x194);}return _0x4bb609;};}function handleError(_0x1d66d4,_0xe45610){_0xe45610=_0xe45610||0x1f4;return function(_0x187c61){logger[_0x00ca('0x2b')](_0x187c61[_0x00ca('0x2c')]);if(_0x187c61['name']){delete _0x187c61[_0x00ca('0x2d')];}_0x1d66d4['status'](_0xe45610)[_0x00ca('0x2e')](_0x187c61);};}exports[_0x00ca('0x2f')]=function(_0x4decf3,_0x518f0c){var _0x5391b1={},_0xf31194={},_0x33c461={'count':0x0,'rows':[]};var _0x102dec=_['map'](db['ChatGroup']['rawAttributes'],function(_0x226bac){return{'name':_0x226bac[_0x00ca('0x30')],'type':_0x226bac[_0x00ca('0x31')]['key']};});_0xf31194[_0x00ca('0x32')]=_[_0x00ca('0x33')](_0x102dec,_0x00ca('0x2d'));_0xf31194['query']=_[_0x00ca('0x34')](_0x4decf3[_0x00ca('0x35')]);_0xf31194[_0x00ca('0x36')]=_[_0x00ca('0x37')](_0xf31194[_0x00ca('0x32')],_0xf31194[_0x00ca('0x35')]);_0x5391b1['attributes']=_[_0x00ca('0x37')](_0xf31194[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x38')]));_0x5391b1[_0x00ca('0x39')]=_0x5391b1[_0x00ca('0x39')][_0x00ca('0x3a')]?_0x5391b1[_0x00ca('0x39')]:_0xf31194[_0x00ca('0x32')];if(!_0x4decf3[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0x5391b1['limit']=qs[_0x00ca('0x25')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x25')]);_0x5391b1[_0x00ca('0x22')]=qs[_0x00ca('0x22')](_0x4decf3[_0x00ca('0x35')][_0x00ca('0x22')]);}_0x5391b1[_0x00ca('0x3d')]=qs[_0x00ca('0x3e')](_0x4decf3['query'][_0x00ca('0x3e')]);_0x5391b1[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4decf3['query'],_0xf31194[_0x00ca('0x36')]),_0x102dec);if(_0x4decf3[_0x00ca('0x35')][_0x00ca('0x41')]){_0x5391b1[_0x00ca('0x3f')]=_['merge'](_0x5391b1['where'],{'$or':_['map'](_0x102dec,function(_0x45ff7e){if(_0x45ff7e[_0x00ca('0x31')]!==_0x00ca('0x42')){var _0xd7b2e2={};_0xd7b2e2[_0x45ff7e[_0x00ca('0x2d')]]={'$like':'%'+_0x4decf3[_0x00ca('0x35')][_0x00ca('0x41')]+'%'};return _0xd7b2e2;}})});}_0x5391b1=_[_0x00ca('0x43')]({},_0x5391b1,_0x4decf3['options']);var _0x5c090a={'where':_0x5391b1[_0x00ca('0x3f')]};return db[_0x00ca('0x44')][_0x00ca('0x24')](_0x5c090a)[_0x00ca('0x2a')](function(_0x7c901){_0x33c461[_0x00ca('0x24')]=_0x7c901;if(_0x4decf3[_0x00ca('0x35')][_0x00ca('0x45')]){_0x5391b1[_0x00ca('0x46')]=[{'all':!![]}];}return db[_0x00ca('0x44')][_0x00ca('0x47')](_0x5391b1);})[_0x00ca('0x2a')](function(_0x1193b4){_0x33c461['rows']=_0x1193b4;return _0x33c461;})[_0x00ca('0x2a')](respondWithFilteredResult(_0x518f0c,_0x5391b1))['catch'](handleError(_0x518f0c,null));};exports[_0x00ca('0x48')]=function(_0x360315,_0x5d58b5){var _0x37a040={'raw':!![],'where':{'id':_0x360315[_0x00ca('0x49')]['id']}},_0x47ca7c={};_0x47ca7c[_0x00ca('0x32')]=_[_0x00ca('0x34')](db['ChatGroup'][_0x00ca('0x4a')]);_0x47ca7c[_0x00ca('0x35')]=_[_0x00ca('0x34')](_0x360315[_0x00ca('0x35')]);_0x47ca7c[_0x00ca('0x36')]=_[_0x00ca('0x37')](_0x47ca7c['model'],_0x47ca7c[_0x00ca('0x35')]);_0x37a040['attributes']=_['intersection'](_0x47ca7c[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x360315[_0x00ca('0x35')][_0x00ca('0x38')]));_0x37a040[_0x00ca('0x39')]=_0x37a040[_0x00ca('0x39')][_0x00ca('0x3a')]?_0x37a040[_0x00ca('0x39')]:_0x47ca7c[_0x00ca('0x32')];if(_0x360315[_0x00ca('0x35')]['includeAll']){_0x37a040['include']=[{'all':!![]}];}_0x37a040=_[_0x00ca('0x43')]({},_0x37a040,_0x360315[_0x00ca('0x4b')]);return db['ChatGroup'][_0x00ca('0x4c')](_0x37a040)[_0x00ca('0x2a')](handleEntityNotFound(_0x5d58b5,null))[_0x00ca('0x2a')](respondWithResult(_0x5d58b5,null))['catch'](handleError(_0x5d58b5,null));};exports[_0x00ca('0x4d')]=function(_0xabe623,_0x1d5af1){return db[_0x00ca('0x44')][_0x00ca('0x4d')](_0xabe623[_0x00ca('0x4e')],{})[_0x00ca('0x2a')](respondWithResult(_0x1d5af1,0xc9))['catch'](handleError(_0x1d5af1,null));};exports[_0x00ca('0x29')]=function(_0x327423,_0x276d98){if(_0x327423[_0x00ca('0x4e')]['id']){delete _0x327423['body']['id'];}return db[_0x00ca('0x44')]['find']({'where':{'id':_0x327423[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x276d98,null))[_0x00ca('0x2a')](saveUpdates(_0x327423['body'],null))[_0x00ca('0x2a')](respondWithResult(_0x276d98,null))['catch'](handleError(_0x276d98,null));};exports[_0x00ca('0x4f')]=function(_0x2f221a,_0x144949){return db[_0x00ca('0x44')][_0x00ca('0x4c')]({'where':{'id':_0x2f221a[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x144949,null))[_0x00ca('0x2a')](removeEntity(_0x144949,null))['catch'](handleError(_0x144949,null));};exports[_0x00ca('0x50')]=function(_0x5252e5,_0x3f82c3){return db[_0x00ca('0x44')][_0x00ca('0x50')]()[_0x00ca('0x2a')](respondWithResult(_0x3f82c3,null))[_0x00ca('0x51')](handleError(_0x3f82c3,null));};exports[_0x00ca('0x52')]=function(_0x3ebb0c,_0x362b8c,_0x3c15d3){return db[_0x00ca('0x53')][_0x00ca('0x24')]({'where':{'ChatGroupId':_0x3ebb0c[_0x00ca('0x49')]['id'],'ToId':_0x3ebb0c[_0x00ca('0x54')]['id'],'read':![]}})['then'](function(_0x2c0095){return{'id':_[_0x00ca('0x55')](_0x3ebb0c[_0x00ca('0x49')]['id']),'count':_0x2c0095};})[_0x00ca('0x2a')](respondWithResult(_0x362b8c,null))[_0x00ca('0x51')](handleError(_0x362b8c,null));};exports[_0x00ca('0x56')]=function(_0x54f5fe,_0x6071dc,_0x34ab37){return db[_0x00ca('0x44')][_0x00ca('0x4c')]({'where':{'id':_0x54f5fe['params']['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x6071dc,null))[_0x00ca('0x2a')](function(_0x19aa69){if(_0x19aa69){return _0x19aa69['addMembers'](_0x54f5fe['body'][_0x00ca('0x57')],_[_0x00ca('0x58')](_0x54f5fe[_0x00ca('0x4e')],[_0x00ca('0x57'),'id'])||{});}})[_0x00ca('0x2a')](respondWithResult(_0x6071dc,null))[_0x00ca('0x51')](handleError(_0x6071dc,null));};exports[_0x00ca('0x59')]=function(_0x4e190f,_0x2bb36a,_0x585e0a){var _0x36302d={};var _0x643c24={};var _0x4f58c1;var _0x24e054;return db[_0x00ca('0x44')]['findOne']({'where':{'id':_0x4e190f[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x2bb36a,null))[_0x00ca('0x2a')](function(_0x238038){if(_0x238038){_0x4f58c1=_0x238038;_0x643c24[_0x00ca('0x32')]=_['keys'](db['User'][_0x00ca('0x4a')]);_0x643c24[_0x00ca('0x35')]=_['keys'](_0x4e190f[_0x00ca('0x35')]);_0x643c24[_0x00ca('0x36')]=_['intersection'](_0x643c24[_0x00ca('0x32')],_0x643c24[_0x00ca('0x35')]);_0x36302d[_0x00ca('0x39')]=_['intersection'](_0x643c24[_0x00ca('0x32')],qs[_0x00ca('0x38')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x38')]));_0x36302d[_0x00ca('0x39')]=_0x36302d['attributes']['length']?_0x36302d[_0x00ca('0x39')]:_0x643c24[_0x00ca('0x32')];_0x36302d[_0x00ca('0x3d')]=qs[_0x00ca('0x3e')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x3e')]);_0x36302d[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4e190f[_0x00ca('0x35')],_0x643c24[_0x00ca('0x36')]));if(_0x4e190f[_0x00ca('0x35')][_0x00ca('0x41')]){_0x36302d['where']=_[_0x00ca('0x43')](_0x36302d[_0x00ca('0x3f')],{'$or':_['map'](_0x36302d[_0x00ca('0x39')],function(_0x305d7b){var _0x306ce8={};_0x306ce8[_0x305d7b]={'$like':'%'+_0x4e190f[_0x00ca('0x35')][_0x00ca('0x41')]+'%'};return _0x306ce8;})});}_0x36302d=_[_0x00ca('0x43')]({},_0x36302d,_0x4e190f[_0x00ca('0x4b')]);return _0x4f58c1[_0x00ca('0x59')](_0x36302d);}})['then'](function(_0x413e3f){if(_0x413e3f){_0x24e054=_0x413e3f['length'];if(!_0x4e190f[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0x36302d['limit']=qs[_0x00ca('0x25')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x25')]);_0x36302d[_0x00ca('0x22')]=qs[_0x00ca('0x22')](_0x4e190f[_0x00ca('0x35')][_0x00ca('0x22')]);}return _0x4f58c1['getMembers'](_0x36302d);}})[_0x00ca('0x2a')](function(_0x1008f2){if(_0x1008f2){return _0x1008f2?{'count':_0x24e054,'rows':_0x1008f2}:null;}})[_0x00ca('0x2a')](respondWithResult(_0x2bb36a,null))[_0x00ca('0x51')](handleError(_0x2bb36a,null));};exports['removeMembers']=function(_0x297d5e,_0x114e38,_0x41b315){return db[_0x00ca('0x44')]['find']({'where':{'id':_0x297d5e[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x114e38,null))['then'](function(_0x22b3b3){if(_0x22b3b3){return _0x22b3b3[_0x00ca('0x5a')](_0x297d5e[_0x00ca('0x35')][_0x00ca('0x57')]);}})['then'](respondWithStatusCode(_0x114e38,null))[_0x00ca('0x51')](handleError(_0x114e38,null));};exports[_0x00ca('0x5b')]=function(_0x356544,_0x353a66,_0x41441a){if(_0x356544[_0x00ca('0x4e')]['id']){delete _0x356544['body']['id'];}return db[_0x00ca('0x44')]['find']({'where':{'id':_0x356544[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x353a66,null))['then'](function(_0x43e895){if(_0x43e895){_0x356544['body'][_0x00ca('0x5c')]=_0x43e895['id'];return db[_0x00ca('0x53')]['create'](_0x356544['body']);}})[_0x00ca('0x2a')](respondWithResult(_0x353a66,null))[_0x00ca('0x51')](handleError(_0x353a66,null));};exports[_0x00ca('0x5d')]=function(_0x4e3018,_0x47c260,_0x168648){var _0xe3b893={};var _0x37340a={};var _0x4c4397;var _0x4c4a94;return db[_0x00ca('0x44')][_0x00ca('0x5e')]({'where':{'id':_0x4e3018[_0x00ca('0x49')]['id']}})[_0x00ca('0x2a')](handleEntityNotFound(_0x47c260,null))[_0x00ca('0x2a')](function(_0x3ce5d7){if(_0x3ce5d7){_0x4c4397=_0x3ce5d7;_0x37340a[_0x00ca('0x32')]=_['keys'](db['ChatInternalMessage'][_0x00ca('0x4a')]);_0x37340a['query']=_[_0x00ca('0x34')](_0x4e3018['query']);_0x37340a['filters']=_[_0x00ca('0x37')](_0x37340a[_0x00ca('0x32')],_0x37340a[_0x00ca('0x35')]);_0xe3b893[_0x00ca('0x39')]=_['intersection'](_0x37340a['model'],qs[_0x00ca('0x38')](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x38')]));_0xe3b893[_0x00ca('0x39')]=_0xe3b893[_0x00ca('0x39')][_0x00ca('0x3a')]?_0xe3b893[_0x00ca('0x39')]:_0x37340a[_0x00ca('0x32')];_0xe3b893[_0x00ca('0x3d')]=qs['sort'](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x3e')]);_0xe3b893[_0x00ca('0x3f')]=qs[_0x00ca('0x36')](_[_0x00ca('0x40')](_0x4e3018[_0x00ca('0x35')],_0x37340a[_0x00ca('0x36')]));if(_0x4e3018[_0x00ca('0x35')]['filter']){_0xe3b893[_0x00ca('0x3f')]=_['merge'](_0xe3b893[_0x00ca('0x3f')],{'$or':_[_0x00ca('0x33')](_0xe3b893[_0x00ca('0x39')],function(_0x44c401){var _0x191fe3={};_0x191fe3[_0x44c401]={'$like':'%'+_0x4e3018['query']['filter']+'%'};return _0x191fe3;})});}if(_0x4e3018['query'][_0x00ca('0x5f')]){var _0xa169f6=_0x4e3018[_0x00ca('0x35')][_0x00ca('0x5f')]['split'](',');var _0x534df9={};_0x534df9[_0xa169f6[0x0]]={'$gte':moment(_0xa169f6[0x1])[_0x00ca('0x60')](_0x00ca('0x61'))};_0xe3b893[_0x00ca('0x3f')]=_[_0x00ca('0x43')](_0xe3b893[_0x00ca('0x3f')],_0x534df9);}_0xe3b893=_[_0x00ca('0x43')]({},_0xe3b893,_0x4e3018[_0x00ca('0x4b')]);return _0x4c4397[_0x00ca('0x5d')](_0xe3b893);}})[_0x00ca('0x2a')](function(_0xcebd8){if(_0xcebd8){_0x4c4a94=_0xcebd8[_0x00ca('0x3a')];if(!_0x4e3018[_0x00ca('0x35')][_0x00ca('0x3b')](_0x00ca('0x3c'))){_0xe3b893[_0x00ca('0x25')]=qs[_0x00ca('0x25')](_0x4e3018['query']['limit']);_0xe3b893[_0x00ca('0x22')]=qs['offset'](_0x4e3018[_0x00ca('0x35')][_0x00ca('0x22')]);}return _0x4c4397[_0x00ca('0x5d')](_0xe3b893);}})[_0x00ca('0x2a')](function(_0x175caf){if(_0x175caf){return _0x175caf?{'count':_0x4c4a94,'rows':_0x175caf}:null;}})['then'](respondWithResult(_0x47c260,null))['catch'](handleError(_0x47c260,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 5f8204e..803190b 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 _0x6e12=['ChatGroup','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x2d3c60,_0x4df458){var _0x560041=function(_0x5568af){while(--_0x5568af){_0x2d3c60['push'](_0x2d3c60['shift']());}};_0x560041(++_0x4df458);}(_0x6e12,0x1d4));var _0x26e1=function(_0x13a14b,_0x52d0e0){_0x13a14b=_0x13a14b-0x0;var _0x6c505b=_0x6e12[_0x13a14b];return _0x6c505b;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x26e1('0x0'))['db'][_0x26e1('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26e1('0x2'),'afterUpdate':_0x26e1('0x3'),'afterDestroy':_0x26e1('0x4')};function emitEvent(_0x2d8a27){return function(_0x2dba5a,_0x4aca8e,_0x5c985b){ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27+':'+_0x2dba5a['id'],_0x2dba5a);ChatGroupEvents[_0x26e1('0x5')](_0x2d8a27,_0x2dba5a);_0x5c985b(null);};}for(var e in events){if(events[_0x26e1('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x7750=['hook','events','ChatGroup','setMaxListeners','emit'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7750,0x182));var _0x0775=function(_0x248ab0,_0x5a7934){_0x248ab0=_0x248ab0-0x0;var _0x54f4ee=_0x7750[_0x248ab0];return _0x54f4ee;};'use strict';var EventEmitter=require(_0x0775('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x0775('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0775('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x255bdc){return function(_0x26b370,_0x114bbd,_0x3a2f34){ChatGroupEvents[_0x0775('0x3')](_0x255bdc+':'+_0x26b370['id'],_0x26b370);ChatGroupEvents[_0x0775('0x3')](_0x255bdc,_0x26b370);_0x3a2f34(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0775('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 3b6fb55..b53b939 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 _0xb684=['api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','../../config/logger'];(function(_0x35588f,_0x43053e){var _0x5656e7=function(_0x473e4c){while(--_0x473e4c){_0x35588f['push'](_0x35588f['shift']());}};_0x5656e7(++_0x43053e);}(_0xb684,0x83));var _0x4b68=function(_0x553378,_0x1c2756){_0x553378=_0x553378-0x0;var _0x44caca=_0xb684[_0x553378];return _0x44caca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4b68('0x0'))(_0x4b68('0x1'));var moment=require(_0x4b68('0x2'));var BPromise=require(_0x4b68('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b68('0x4'));var rimraf=require(_0x4b68('0x5'));var config=require(_0x4b68('0x6'));var attributes=require(_0x4b68('0x7'));module[_0x4b68('0x8')]=function(_0x4d58b9,_0x1261d6){return _0x4d58b9['define'](_0x4b68('0x9'),attributes,{'tableName':_0x4b68('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d22=['bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','util','../../config/logger','api','moment'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x0d22,0xe6));var _0x20d2=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x0d22[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require('lodash');var util=require(_0x20d2('0x0'));var logger=require(_0x20d2('0x1'))(_0x20d2('0x2'));var moment=require(_0x20d2('0x3'));var BPromise=require(_0x20d2('0x4'));var rp=require(_0x20d2('0x5'));var fs=require('fs');var path=require(_0x20d2('0x6'));var rimraf=require(_0x20d2('0x7'));var config=require(_0x20d2('0x8'));var attributes=require(_0x20d2('0x9'));module[_0x20d2('0xa')]=function(_0x4ea7d3,_0x431c77){return _0x4ea7d3[_0x20d2('0xb')](_0x20d2('0xc'),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 52f4a07..14998c5 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 _0xb56f=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xd76732,_0x5f4e32){var _0x342534=function(_0x10c3cb){while(--_0x10c3cb){_0xd76732['push'](_0xd76732['shift']());}};_0x342534(++_0x5f4e32);}(_0xb56f,0x113));var _0xfb56=function(_0x4aec74,_0xbecf13){_0x4aec74=_0x4aec74-0x0;var _0x19cf6d=_0xb56f[_0x4aec74];return _0x19cf6d;};'use strict';var _=require(_0xfb56('0x0'));var util=require(_0xfb56('0x1'));var moment=require(_0xfb56('0x2'));var BPromise=require('bluebird');var rs=require(_0xfb56('0x3'));var fs=require('fs');var Redis=require(_0xfb56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb56('0x5'));var logger=require(_0xfb56('0x6'))('rpc');var config=require(_0xfb56('0x7'));var jayson=require(_0xfb56('0x8'));var client=jayson[_0xfb56('0x9')][_0xfb56('0xa')]({'port':0x232a});config[_0xfb56('0xb')]=_[_0xfb56('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfb56('0xd'))(new Redis(config[_0xfb56('0xb')]));require(_0xfb56('0xe'))[_0xfb56('0xf')](socket);function respondWithRpcPromise(_0x311b0e,_0x3a168f,_0x134442){return new BPromise(function(_0x5e49b3,_0x5db511){return client['request'](_0x311b0e,_0x134442)[_0xfb56('0x10')](function(_0x537d40){logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));logger[_0xfb56('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3a168f,_0xfb56('0x13'),JSON[_0xfb56('0x15')](_0x537d40));if(_0x537d40[_0xfb56('0x16')]){if(_0x537d40['error'][_0xfb56('0x17')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5db511(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}logger[_0xfb56('0x16')](_0xfb56('0x12'),_0x3a168f,_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);return _0x5e49b3(_0x537d40[_0xfb56('0x16')][_0xfb56('0x18')]);}else{logger[_0xfb56('0x11')](_0xfb56('0x12'),_0x3a168f,_0xfb56('0x13'));_0x5e49b3(_0x537d40[_0xfb56('0x19')][_0xfb56('0x18')]);}})[_0xfb56('0x1a')](function(_0x586436){logger['error'](_0xfb56('0x12'),_0x3a168f,_0x586436);_0x5db511(_0x586436);});});}
\ No newline at end of file
+var _0x4784=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e7bbc,_0x413a95){var _0x3d6abc=function(_0x10d177){while(--_0x10d177){_0x5e7bbc['push'](_0x5e7bbc['shift']());}};_0x3d6abc(++_0x413a95);}(_0x4784,0xe4));var _0x4478=function(_0x2c072b,_0x6c4449){_0x2c072b=_0x2c072b-0x0;var _0x167ee3=_0x4784[_0x2c072b];return _0x167ee3;};'use strict';var _=require(_0x4478('0x0'));var util=require(_0x4478('0x1'));var moment=require(_0x4478('0x2'));var BPromise=require(_0x4478('0x3'));var rs=require(_0x4478('0x4'));var fs=require('fs');var Redis=require(_0x4478('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4478('0x6'));var logger=require(_0x4478('0x7'))(_0x4478('0x8'));var config=require('../../config/environment');var jayson=require(_0x4478('0x9'));var client=jayson['client'][_0x4478('0xa')]({'port':0x232a});config['redis']=_[_0x4478('0xb')](config[_0x4478('0xc')],{'host':_0x4478('0xd'),'port':0x18eb});var socket=require(_0x4478('0xe'))(new Redis(config[_0x4478('0xc')]));require('./chatGroup.socket')[_0x4478('0xf')](socket);function respondWithRpcPromise(_0x2747ad,_0x2bca2c,_0x3cf977){return new BPromise(function(_0xcc937d,_0x2d95ef){return client[_0x4478('0x10')](_0x2747ad,_0x3cf977)['then'](function(_0x21e831){logger[_0x4478('0x11')](_0x4478('0x12'),_0x2bca2c,_0x4478('0x13'));logger[_0x4478('0x14')](_0x4478('0x15'),_0x2bca2c,'request\x20sent',JSON[_0x4478('0x16')](_0x21e831));if(_0x21e831[_0x4478('0x17')]){if(_0x21e831[_0x4478('0x17')][_0x4478('0x18')]===0x1f4){logger[_0x4478('0x17')]('ChatGroup,\x20%s,\x20%s',_0x2bca2c,_0x21e831['error'][_0x4478('0x19')]);return _0x2d95ef(_0x21e831[_0x4478('0x17')][_0x4478('0x19')]);}logger[_0x4478('0x17')](_0x4478('0x12'),_0x2bca2c,_0x21e831[_0x4478('0x17')][_0x4478('0x19')]);return _0xcc937d(_0x21e831['error'][_0x4478('0x19')]);}else{logger[_0x4478('0x11')](_0x4478('0x12'),_0x2bca2c,_0x4478('0x13'));_0xcc937d(_0x21e831[_0x4478('0x1a')]['message']);}})[_0x4478('0x1b')](function(_0x12b731){logger['error'](_0x4478('0x12'),_0x2bca2c,_0x12b731);_0x2d95ef(_0x12b731);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 56bf1ac..c914cb2 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 _0x9f74=['register','length','chatGroup:','./chatGroup.events','save','remove','emit','removeListener'];(function(_0x5e34a4,_0x2e63ed){var _0x8d41d7=function(_0x45c61b){while(--_0x45c61b){_0x5e34a4['push'](_0x5e34a4['shift']());}};_0x8d41d7(++_0x2e63ed);}(_0x9f74,0x163));var _0x49f7=function(_0xa3ec8e,_0x35f872){_0xa3ec8e=_0xa3ec8e-0x0;var _0x388a9c=_0x9f74[_0xa3ec8e];return _0x388a9c;};'use strict';var ChatGroupEvents=require(_0x49f7('0x0'));var events=[_0x49f7('0x1'),_0x49f7('0x2'),'update'];function createListener(_0x3baaa0,_0x4f94d0){return function(_0x947981){_0x4f94d0[_0x49f7('0x3')](_0x3baaa0,_0x947981);};}function removeListener(_0x4f3a07,_0xb6f3d0){return function(){ChatGroupEvents[_0x49f7('0x4')](_0x4f3a07,_0xb6f3d0);};}exports[_0x49f7('0x5')]=function(_0x2b9c50){for(var _0x2f59de=0x0,_0xb97a18=events[_0x49f7('0x6')];_0x2f59de<_0xb97a18;_0x2f59de++){var _0x2e627d=events[_0x2f59de];var _0x592dbd=createListener(_0x49f7('0x7')+_0x2e627d,_0x2b9c50);ChatGroupEvents['on'](_0x2e627d,_0x592dbd);}};
\ No newline at end of file
+var _0xd578=['register','./chatGroup.events','remove','update'];(function(_0x2e8cbd,_0x3015b6){var _0x18107c=function(_0x51150c){while(--_0x51150c){_0x2e8cbd['push'](_0x2e8cbd['shift']());}};_0x18107c(++_0x3015b6);}(_0xd578,0x18d));var _0x8d57=function(_0x56fae,_0x2d1fe0){_0x56fae=_0x56fae-0x0;var _0x1eeed7=_0xd578[_0x56fae];return _0x1eeed7;};'use strict';var ChatGroupEvents=require(_0x8d57('0x0'));var events=['save',_0x8d57('0x1'),_0x8d57('0x2')];function createListener(_0xa581c1,_0x4850c0){return function(_0x5173e2){_0x4850c0['emit'](_0xa581c1,_0x5173e2);};}function removeListener(_0x54c6e6,_0x21f998){return function(){ChatGroupEvents['removeListener'](_0x54c6e6,_0x21f998);};}exports[_0x8d57('0x3')]=function(_0x5e5fc0){for(var _0x2d781c=0x0,_0x1443ee=events['length'];_0x2d781c<_0x1443ee;_0x2d781c++){var _0x24a4c4=events[_0x2d781c];var _0x1c068a=createListener('chatGroup:'+_0x24a4c4,_0x5e5fc0);ChatGroupEvents['on'](_0x24a4c4,_0x1c068a);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 96f4f7a..c28c62b 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 _0xe02a=['get','isAuthenticated','index','/describe','describe','show','/:id/unread','/:id/members','getMembers','getMessages','create','addMembers','post','addMessage','put','/:id','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller'];(function(_0x308351,_0x184653){var _0x2def07=function(_0x2a30a4){while(--_0x2a30a4){_0x308351['push'](_0x308351['shift']());}};_0x2def07(++_0x184653);}(_0xe02a,0x1dd));var _0xae02=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe02a[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0xae02('0x0'));var util=require(_0xae02('0x1'));var path=require(_0xae02('0x2'));var timeout=require('connect-timeout');var express=require(_0xae02('0x3'));var router=express[_0xae02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xae02('0x5'));var interaction=require(_0xae02('0x6'));var config=require(_0xae02('0x7'));var controller=require(_0xae02('0x8'));router[_0xae02('0x9')]('/',auth[_0xae02('0xa')](),controller[_0xae02('0xb')]);router[_0xae02('0x9')](_0xae02('0xc'),auth['isAuthenticated'](),controller[_0xae02('0xd')]);router[_0xae02('0x9')]('/:id',auth[_0xae02('0xa')](),controller[_0xae02('0xe')]);router[_0xae02('0x9')](_0xae02('0xf'),auth['isAuthenticated'](),controller['getUnread']);router[_0xae02('0x9')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller[_0xae02('0x11')]);router[_0xae02('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0xae02('0x12')]);router['post']('/',auth[_0xae02('0xa')](),controller[_0xae02('0x13')]);router['post'](_0xae02('0x10'),auth['isAuthenticated'](),controller[_0xae02('0x14')]);router[_0xae02('0x15')]('/:id/messages',auth[_0xae02('0xa')](),controller[_0xae02('0x16')]);router[_0xae02('0x17')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller['update']);router[_0xae02('0x19')](_0xae02('0x18'),auth[_0xae02('0xa')](),controller[_0xae02('0x1a')]);router[_0xae02('0x19')](_0xae02('0x10'),auth[_0xae02('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
+var _0xb059=['destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','/:id','isAuthenticated','show','getUnread','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers','delete'];(function(_0xa34bda,_0x34f584){var _0x37c970=function(_0xa3eca2){while(--_0xa3eca2){_0xa34bda['push'](_0xa34bda['shift']());}};_0x37c970(++_0x34f584);}(_0xb059,0x12b));var _0x9b05=function(_0x16152d,_0x5a5b49){_0x16152d=_0x16152d-0x0;var _0x1768d8=_0xb059[_0x16152d];return _0x1768d8;};'use strict';var multer=require(_0x9b05('0x0'));var util=require(_0x9b05('0x1'));var path=require(_0x9b05('0x2'));var timeout=require(_0x9b05('0x3'));var express=require(_0x9b05('0x4'));var router=express[_0x9b05('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9b05('0x6'));var interaction=require(_0x9b05('0x7'));var config=require(_0x9b05('0x8'));var controller=require(_0x9b05('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x9b05('0xa')]);router[_0x9b05('0xb')](_0x9b05('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller[_0x9b05('0xf')]);router['get']('/:id/unread',auth['isAuthenticated'](),controller[_0x9b05('0x10')]);router[_0x9b05('0xb')]('/:id/members',auth[_0x9b05('0xe')](),controller[_0x9b05('0x11')]);router[_0x9b05('0xb')](_0x9b05('0x12'),auth['isAuthenticated'](),controller[_0x9b05('0x13')]);router['post']('/',auth[_0x9b05('0xe')](),controller[_0x9b05('0x14')]);router[_0x9b05('0x15')](_0x9b05('0x16'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x17')]);router[_0x9b05('0x15')](_0x9b05('0x12'),auth[_0x9b05('0xe')](),controller['addMessage']);router['put'](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller['update']);router[_0x9b05('0x18')](_0x9b05('0xd'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x19')]);router[_0x9b05('0x18')](_0x9b05('0x16'),auth[_0x9b05('0xe')](),controller[_0x9b05('0x1a')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 4d8e48f..08a1f24 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 _0x80f6=['TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x80f6,0x66));var _0x680f=function(_0x1f1a8e,_0x5f09d0){_0x1f1a8e=_0x1f1a8e-0x0;var _0x5b28a0=_0x80f6[_0x1f1a8e];return _0x5b28a0;};'use strict';var Sequelize=require(_0x680f('0x0'));module[_0x680f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x680f('0x2')]},'ratingType':{'type':Sequelize[_0x680f('0x3')](_0x680f('0x4'),_0x680f('0x5')),'defaultValue':_0x680f('0x4')},'ratingMessage':{'type':Sequelize[_0x680f('0x6')]},'pathTranscript':{'type':Sequelize[_0x680f('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x680f('0x7')]},'disposition':{'type':Sequelize[_0x680f('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x680f('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x680f('0x8')]},'browserVersion':{'type':Sequelize[_0x680f('0x8')]},'osName':{'type':Sequelize[_0x680f('0x8')]},'osVersion':{'type':Sequelize[_0x680f('0x8')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x680f('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x680f('0x6')]},'customerIp':{'type':Sequelize[_0x680f('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x680f('0x9'))},'read1stAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgAt':{'type':Sequelize[_0x680f('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x680f('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x680f('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x680f('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x680f('0x2')]}};
\ No newline at end of file
+var _0x3613=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x495291,_0x3ba520){var _0x13a724=function(_0x7dcdd1){while(--_0x7dcdd1){_0x495291['push'](_0x495291['shift']());}};_0x13a724(++_0x3ba520);}(_0x3613,0x6e));var _0x3361=function(_0x9ddaa0,_0x1d3878){_0x9ddaa0=_0x9ddaa0-0x0;var _0x14dce9=_0x3613[_0x9ddaa0];return _0x14dce9;};'use strict';var Sequelize=require(_0x3361('0x0'));module[_0x3361('0x1')]={'closed':{'type':Sequelize[_0x3361('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3361('0x3')]},'ratingType':{'type':Sequelize[_0x3361('0x4')](_0x3361('0x5'),_0x3361('0x6')),'defaultValue':_0x3361('0x5')},'ratingMessage':{'type':Sequelize[_0x3361('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x3361('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3361('0x8')]},'secondDisposition':{'type':Sequelize[_0x3361('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3361('0x8')]},'note':{'type':Sequelize[_0x3361('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3361('0x8')]},'osName':{'type':Sequelize[_0x3361('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3361('0x7')]},'customerIp':{'type':Sequelize[_0x3361('0x8')]},'formData':{'type':Sequelize[_0x3361('0x7')](_0x3361('0x9'))},'read1stAt':{'type':Sequelize[_0x3361('0xa')]},'lastMsgAt':{'type':Sequelize[_0x3361('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x3361('0x4')]('in',_0x3361('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3361('0x8')]},'customerPort':{'type':Sequelize[_0x3361('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3361('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3361('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index b8cc09c..0a248d5 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 _0x1fc4=['sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','nolimit','order','sort','filters','pick','ChatInteractionId','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','include','getMyMessages','hasOwnProperty','includeAgent','push','rows','addTags','setTags','omit','spread','Tag','color','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','direction','read','Account','Owner','get','mkdirSync','Chat','N.A.','toString','closedAt','referer','customerIp','customerPort','tail','createReadStream','pipe','out','firstName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','request-promise','moment','mustache','util','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','name','send','render','merge','body','contact','agent','account','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','show','params','model','keys','ChatInteraction','intersection','attributes','fields','length','includeAll','options','find','create','update','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','agentAlias','customer','Visitor','agentIdentifier','website_alias','%s%d','System','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail'];(function(_0x19d828,_0x2439ce){var _0x25b133=function(_0x5214a8){while(--_0x5214a8){_0x19d828['push'](_0x19d828['shift']());}};_0x25b133(++_0x2439ce);}(_0x1fc4,0x1ed));var _0x41fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x1fc4[_0x501510];return _0x1e6ee5;};'use strict';var rimraf=require(_0x41fc('0x0'));var zipdir=require('zip-dir');var rp=require(_0x41fc('0x1'));var moment=require(_0x41fc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x41fc('0x3'));var util=require(_0x41fc('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x41fc('0x5'));var qs=require(_0x41fc('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x41fc('0x7'))(_0x41fc('0x8'));var config=require(_0x41fc('0x9'));var db=require(_0x41fc('0xa'))['db'];config[_0x41fc('0xb')]=_[_0x41fc('0xc')](config['redis'],{'host':_0x41fc('0xd'),'port':0x18eb});var socket=require(_0x41fc('0xe'))(new Redis(config[_0x41fc('0xb')]));require('./chatInteraction.socket')[_0x41fc('0xf')](socket);var jayson=require(_0x41fc('0x10'));var client=jayson[_0x41fc('0x11')]['http']({'port':0x232b});var client9004=jayson[_0x41fc('0x11')][_0x41fc('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x57572a,_0x40774b,_0x55c2b7,_0x11773c){return new BPromise(function(_0x247247,_0x50bfbd){var _0x32385f=_0x11773c||client;return _0x32385f[_0x41fc('0x13')](_0x57572a,_0x55c2b7)[_0x41fc('0x14')](function(_0x24b132){logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));logger['debug'](_0x41fc('0x17'),_0x40774b,'request\x20sent',JSON['stringify'](_0x24b132));if(_0x24b132['error']){if(_0x24b132[_0x41fc('0x18')][_0x41fc('0x19')]===0x1f4){logger['error'](_0x41fc('0x15'),_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x50bfbd(_0x24b132[_0x41fc('0x18')]['message']);}logger[_0x41fc('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x40774b,_0x24b132[_0x41fc('0x18')][_0x41fc('0x1a')]);return _0x247247(_0x24b132['error'][_0x41fc('0x1a')]);}else{logger['info'](_0x41fc('0x15'),_0x40774b,_0x41fc('0x16'));_0x247247(_0x24b132[_0x41fc('0x1b')][_0x41fc('0x1a')]);}})[_0x41fc('0x1c')](function(_0x1112c2){logger['error'](_0x41fc('0x15'),_0x40774b,_0x1112c2);_0x50bfbd(_0x1112c2);});});}function respondWithStatusCode(_0x4559ef,_0x2ea987){_0x2ea987=_0x2ea987||0xcc;return function(_0x4539d4){if(_0x4539d4){return _0x4559ef[_0x41fc('0x1d')](_0x2ea987);}return _0x4559ef[_0x41fc('0x1e')](_0x2ea987)[_0x41fc('0x1f')]();};}function respondWithResult(_0x119a13,_0x13c8d4){_0x13c8d4=_0x13c8d4||0xc8;return function(_0x27e716){if(_0x27e716){return _0x119a13[_0x41fc('0x1e')](_0x13c8d4)[_0x41fc('0x20')](_0x27e716);}};}function respondWithFilteredResult(_0x5e1811,_0x541d32){return function(_0x5dc5e6){if(_0x5dc5e6){var _0x13f10c=typeof _0x541d32[_0x41fc('0x21')]===_0x41fc('0x22')&&typeof _0x541d32[_0x41fc('0x23')]===_0x41fc('0x22');var _0x4a5bea=_0x5dc5e6[_0x41fc('0x24')];var _0x2bb7cd=_0x13f10c?0x0:_0x541d32['offset'];var _0x63be2=_0x13f10c?_0x5dc5e6[_0x41fc('0x24')]:_0x541d32[_0x41fc('0x21')]+_0x541d32[_0x41fc('0x23')];var _0x7e7e81;if(_0x63be2>=_0x4a5bea){_0x63be2=_0x4a5bea;_0x7e7e81=0xc8;}else{_0x7e7e81=0xce;}_0x5e1811['status'](_0x7e7e81);return _0x5e1811[_0x41fc('0x25')]('Content-Range',_0x2bb7cd+'-'+_0x63be2+'/'+_0x4a5bea)[_0x41fc('0x20')](_0x5dc5e6);}return null;};}function saveUpdates(_0x4256ea){return function(_0x4f6f88){if(_0x4f6f88){return _0x4f6f88['update'](_0x4256ea)[_0x41fc('0x14')](function(_0x127c62){return _0x127c62;});}return null;};}function removeEntity(_0x119145){return function(_0x599f36){if(_0x599f36){return _0x599f36[_0x41fc('0x26')]()[_0x41fc('0x14')](function(){_0x119145['status'](0xcc)[_0x41fc('0x1f')]();});}};}function handleEntityNotFound(_0x5d4660){return function(_0x3eccd9){if(!_0x3eccd9){_0x5d4660[_0x41fc('0x1d')](0x194);}return _0x3eccd9;};}function handleError(_0x5429f6,_0x17979c){_0x17979c=_0x17979c||0x1f4;return function(_0x39c588){logger['error'](_0x39c588['stack']);if(_0x39c588[_0x41fc('0x27')]){delete _0x39c588[_0x41fc('0x27')];}_0x5429f6[_0x41fc('0x1e')](_0x17979c)[_0x41fc('0x28')](_0x39c588);};}function getMustacheRender(_0x10e80a,_0x293f59){return Mustache[_0x41fc('0x29')](_0x10e80a,_[_0x41fc('0x2a')](_0x293f59[_0x41fc('0x2b')],{'contact':_0x293f59[_0x41fc('0x2c')],'message':_0x293f59['message'],'agent':_0x293f59[_0x41fc('0x2d')],'interaction':_0x293f59['interaction'],'account':_0x293f59[_0x41fc('0x2e')]}))||'';}exports[_0x41fc('0x2f')]=function(_0x3eca15,_0x138023){var _0x329a74={};var _0x3180fb=_[_0x41fc('0x30')](db['ChatInteraction'][_0x41fc('0x31')],function(_0x3c1a20){return{'name':_0x3c1a20[_0x41fc('0x32')],'type':_0x3c1a20[_0x41fc('0x33')][_0x41fc('0x34')]};});_0x329a74=qs[_0x41fc('0x35')](_0x3180fb,_0x3eca15);return interaction[_0x41fc('0x36')](_0x41fc('0x37'),_0x3eca15[_0x41fc('0x38')],_0x3eca15[_0x41fc('0x39')],_0x329a74,_0x3180fb)[_0x41fc('0x14')](respondWithFilteredResult(_0x138023,_0x329a74))[_0x41fc('0x1c')](handleError(_0x138023,null));};exports[_0x41fc('0x3a')]=function(_0x3c6d89,_0x46c5d0){var _0xd5e05b={'raw':![],'where':{'id':_0x3c6d89[_0x41fc('0x3b')]['id']}},_0x24e2b5={};_0x24e2b5[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x3e')][_0x41fc('0x31')]);_0x24e2b5[_0x41fc('0x38')]=_['keys'](_0x3c6d89[_0x41fc('0x38')]);_0x24e2b5['filters']=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],_0x24e2b5[_0x41fc('0x38')]);_0xd5e05b[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x24e2b5[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x41')]));_0xd5e05b[_0x41fc('0x40')]=_0xd5e05b[_0x41fc('0x40')][_0x41fc('0x42')]?_0xd5e05b[_0x41fc('0x40')]:_0x24e2b5[_0x41fc('0x3c')];if(_0x3c6d89[_0x41fc('0x38')][_0x41fc('0x43')]){_0xd5e05b['include']=[{'all':!![]}];}_0xd5e05b=_[_0x41fc('0x2a')]({},_0xd5e05b,_0x3c6d89[_0x41fc('0x44')]);return db['ChatInteraction'][_0x41fc('0x45')](_0xd5e05b)[_0x41fc('0x14')](handleEntityNotFound(_0x46c5d0,null))[_0x41fc('0x14')](respondWithResult(_0x46c5d0,null))[_0x41fc('0x1c')](handleError(_0x46c5d0,null));};exports[_0x41fc('0x46')]=function(_0x5d5251,_0x26c961){return db['ChatInteraction'][_0x41fc('0x46')](_0x5d5251[_0x41fc('0x2b')],{})['then'](respondWithResult(_0x26c961,0xc9))[_0x41fc('0x1c')](handleError(_0x26c961,null));};exports[_0x41fc('0x47')]=function(_0x267cae,_0x396158){if(_0x267cae[_0x41fc('0x2b')]['id']){delete _0x267cae[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x267cae[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x396158,null))[_0x41fc('0x14')](saveUpdates(_0x267cae['body'],null))[_0x41fc('0x14')](respondWithResult(_0x396158,null))[_0x41fc('0x1c')](handleError(_0x396158,null));};exports['destroy']=function(_0xacd39f,_0x52509b){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0xacd39f[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x52509b,null))[_0x41fc('0x14')](removeEntity(_0x52509b,null))['catch'](handleError(_0x52509b,null));};exports[_0x41fc('0x48')]=function(_0x200068,_0x338acb){return db[_0x41fc('0x3e')][_0x41fc('0x48')]()[_0x41fc('0x14')](respondWithResult(_0x338acb,null))[_0x41fc('0x1c')](handleError(_0x338acb,null));};exports[_0x41fc('0x49')]=function(_0x2f6d7d,_0x5e3dcd){var _0x13294c=_0x2f6d7d['params']['id'];var _0x4a5810;var _0x1d78c6;var _0x505c60;return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x13294c}})['then'](function(_0x3743d2){_0x4a5810=_0x3743d2;return db[_0x41fc('0x4b')][_0x41fc('0x4a')]({'where':{'id':_0x3743d2[_0x41fc('0x4c')]},'attributes':['id',_0x41fc('0x4d'),_0x41fc('0x4e'),_0x41fc('0x4f'),_0x41fc('0x50'),_0x41fc('0x51')],'raw':!![]});})[_0x41fc('0x14')](function(_0x37ce77){if(_0x37ce77&&_0x37ce77['vidaooApiKey']&&_0x37ce77[_0x41fc('0x4e')]){_0x1d78c6=_0x37ce77;var _0xf64fa8={'interaction':{'id':_0x13294c},'agent':{'id':_0x2f6d7d[_0x41fc('0x39')]['id'],'name':_0x2f6d7d['user']['name'],'fullname':_0x2f6d7d[_0x41fc('0x39')][_0x41fc('0x52')],'email':_0x2f6d7d[_0x41fc('0x39')]['email']},'contact':_0x2f6d7d['body'][_0x41fc('0x2c')],'account':_0x2f6d7d[_0x41fc('0x2b')][_0x41fc('0x2e')]};var _0x35abac={'rejectUnauthorized':![],'method':_0x41fc('0x53'),'url':_0x41fc('0x54'),'headers':{'X-APIKEY':_0x37ce77[_0x41fc('0x4d')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2f6d7d[_0x41fc('0x39')]['email']],'buttons':null,'topic':_0x1d78c6[_0x41fc('0x4f')],'note':_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x50')])?null:getMustacheRender(_0x1d78c6[_0x41fc('0x50')],_0xf64fa8),'metadata':null},'redirect':_0x41fc('0x56'),'json':!![]};try{if(!_[_0x41fc('0x55')](_0x1d78c6[_0x41fc('0x51')])){var _0x54adbb=getMustacheRender(_0x1d78c6[_0x41fc('0x51')],_0xf64fa8);var _0x250ab2=JSON[_0x41fc('0x57')](_0x54adbb);_0x35abac[_0x41fc('0x2b')][_0x41fc('0x58')]=_0x250ab2;}}catch(_0x2dc50b){throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5b'));}return rp(_0x35abac);}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5c'));}})[_0x41fc('0x14')](function(_0x4046b9){_0x505c60=_0x4046b9;if(_0x505c60['id']){var _0x5c1f31={'body':_0x505c60[_0x41fc('0x5d')],'ChatWebsiteId':_0x1d78c6['id'],'ChatInteractionId':_0x4a5810['id'],'direction':'out','UserId':_0x2f6d7d['user']['id']};return db['ChatMessage']['create'](_0x5c1f31,{});}else{throw new db[(_0x41fc('0x59'))][(_0x41fc('0x5a'))](_0x41fc('0x5e'));}})['then'](function(){return _0x4a5810['updateAttributes']({'vidaooSessionId':_0x505c60['id']});})['then'](respondWithResult(_0x5e3dcd,null))[_0x41fc('0x1c')](handleError(_0x5e3dcd,null));};exports[_0x41fc('0x5f')]=function(_0x582077,_0x2e889d){if(_0x582077[_0x41fc('0x2b')]['id']){delete _0x582077['body']['id'];}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x582077['params']['id']},'include':[{'model':db['CmContact'],'as':_0x41fc('0x60')}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2e889d,null))[_0x41fc('0x14')](saveUpdates(_0x582077[_0x41fc('0x2b')],null))[_0x41fc('0x14')](respondWithResult(_0x2e889d,null))['catch'](handleError(_0x2e889d,null));};exports[_0x41fc('0x61')]=function(_0x430220,_0x5bd368){if(_0x430220[_0x41fc('0x2b')]['id']){delete _0x430220[_0x41fc('0x2b')]['id'];}return db[_0x41fc('0x3e')]['find']({'where':{'id':_0x430220[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](function(_0x501a48){if(!_0x501a48){logger[_0x41fc('0x18')](_0x41fc('0x62'),_0x41fc('0x61'),0x194,_0x41fc('0x63'));_0x5bd368[_0x41fc('0x1d')](0x194);}else{if(_0x501a48[_0x41fc('0x64')]){throw new db['Sequelize']['ValidationError'](_0x41fc('0x65'));}}return _0x501a48;})[_0x41fc('0x14')](function(_0xa9454){if(_0xa9454){return _0xa9454['update']({'closed':_0x430220[_0x41fc('0x2b')]['closed'],'disposition':_0x430220[_0x41fc('0x2b')][_0x41fc('0x66')]})[_0x41fc('0x14')](function(_0x18e7d9){return _0x18e7d9;});}})['then'](function(){return respondWithRpcPromise(_0x41fc('0x67'),_0x41fc('0x61'),_0x430220[_0x41fc('0x2b')],client9004);})[_0x41fc('0x14')](respondWithResult(_0x5bd368,null))[_0x41fc('0x1c')](handleError(_0x5bd368,null));};exports[_0x41fc('0x68')]=function(_0x2f3b84,_0xc3ed0){_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x27')]=_0x2f3b84[_0x41fc('0x69')][_0x41fc('0x6a')];_0x2f3b84[_0x41fc('0x2b')][_0x41fc('0x6b')]=_0x2f3b84[_0x41fc('0x69')]['filename'];_0x2f3b84[_0x41fc('0x2b')]['type']=_0x2f3b84['file'][_0x41fc('0x6c')];return db[_0x41fc('0x6d')][_0x41fc('0x46')](_0x2f3b84[_0x41fc('0x2b')])['then'](respondWithResult(_0xc3ed0,0xc9))['catch'](handleError(_0xc3ed0,null));};exports[_0x41fc('0x6e')]=function(_0x43f567,_0x2ca377){return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43f567[_0x41fc('0x3b')]['id']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null))[_0x41fc('0x14')](function(_0x21ed99){if(_0x21ed99){if(_0x21ed99[_0x41fc('0x6f')]){return _0x2ca377['status'](0x193)[_0x41fc('0x20')]({'status':0x193,'message':_0x41fc('0x70')});}return db[_0x41fc('0x6d')][_0x41fc('0x4a')]({'where':{'id':_0x43f567['query']['attachId']},'raw':!![]})[_0x41fc('0x14')](handleEntityNotFound(_0x2ca377,null));}})[_0x41fc('0x14')](function(_0x5d8d59){if(_0x5d8d59){var _0x4f4cb3=_0x5d8d59[_0x41fc('0x71')]!==null;var _0x3f3b7e=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x74'));if(_0x4f4cb3){_0x3f3b7e=path[_0x41fc('0x72')](_0x3f3b7e,_0x41fc('0x75'));}var _0xb5c435=path[_0x41fc('0x72')](_0x3f3b7e,_0x5d8d59[_0x41fc('0x6b')]);return _0x2ca377[_0x41fc('0x76')](_0xb5c435);}})[_0x41fc('0x1c')](handleError(_0x2ca377,null));};exports['close']=function(_0x280911,_0x2a8278){var _0x153f21=null;var _0x45cd04=null;var _0x3eb16f=null;if(_0x280911[_0x41fc('0x2b')]['id']){delete _0x280911[_0x41fc('0x2b')]['id'];}if(_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')]){_0x3eb16f=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0x78'),util[_0x41fc('0x79')](_0x41fc('0x7a'),Date[_0x41fc('0x7b')]()));_0x280911[_0x41fc('0x2b')][_0x41fc('0x7c')]=_0x3eb16f;}return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x280911[_0x41fc('0x3b')]['id']},'include':[{'model':db[_0x41fc('0x7d')],'as':_0x41fc('0x7e'),'include':[{'model':db[_0x41fc('0x7f')],'as':_0x41fc('0x7f')}]}]})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8278,null))[_0x41fc('0x14')](saveUpdates(_0x280911[_0x41fc('0x2b')],null))[_0x41fc('0x14')](function(_0x5239d5){if(_0x5239d5){_0x153f21=_0x5239d5;return db['ChatWebsite'][_0x41fc('0x45')]({'where':{'id':_0x153f21['ChatWebsiteId']}});}})[_0x41fc('0x14')](function(_0x244ecb){if(_0x244ecb){_0x45cd04=_0x244ecb;return db[_0x41fc('0x80')][_0x41fc('0x45')]({'where':{'id':_0x153f21[_0x41fc('0x81')]}});}})[_0x41fc('0x14')](function(_0x5acbc7){if(_0x5acbc7){if(_0x3eb16f){var _0x317625=null;for(var _0xd99007=0x1;_0xd99007<_0x153f21['Messages'][_0x41fc('0x42')];++_0xd99007){_0x317625=_0x153f21[_0x41fc('0x7e')][_0xd99007];var _0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')]('%s%d',_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):'System';var _0xf58b49=_0x280911[_0x41fc('0x2b')][_0x41fc('0x83')]||util['format']('%s%d',_0x41fc('0x84'),_0x317625['ContactId']);switch(_0x45cd04[_0x41fc('0x85')]){case _0x41fc('0x86'):_0x1d9947=_0x317625[_0x41fc('0x64')]?util['format'](_0x41fc('0x87'),_0x45cd04['agentAlias'],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');break;case'agent_alias':_0x1d9947=_0x317625[_0x41fc('0x64')]?_0x317625[_0x41fc('0x7f')][_0x41fc('0x89')]||_0x317625['User'][_0x41fc('0x52')]:'System';break;case _0x41fc('0x8a'):_0x1d9947=_0x317625['UserId']?_0x317625['User']['fullname']:_0x41fc('0x88');break;default:_0x1d9947=_0x317625[_0x41fc('0x64')]?util[_0x41fc('0x79')](_0x41fc('0x87'),_0x45cd04[_0x41fc('0x82')],_0x317625[_0x41fc('0x64')]):_0x41fc('0x88');}var _0x4b5c37=util[_0x41fc('0x79')](_0x41fc('0x8b'),moment(_0x317625[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0x8d')),_0x317625['direction']==='in'?_0xf58b49:_0x1d9947,_0x317625[_0x41fc('0x2b')]);if(!_0x317625[_0x41fc('0x8e')]){fs[_0x41fc('0x8f')](_0x3eb16f,_0x4b5c37);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x41fc('0x90')],'as':_0x41fc('0x91'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x41fc('0x92'),'raw':!![]}]}]});}}})[_0x41fc('0x14')](function(_0x2f09ce){if(!_0x2f09ce||!_0x2f09ce['Smtp']||!_0x280911[_0x41fc('0x2b')])return _0x153f21;var _0x3058dc=_0x2f09ce[_0x41fc('0x93')]();return respondWithRpcPromise(_0x41fc('0x94'),_0x41fc('0x95'),{'account':_0x3058dc,'message':{'from':util[_0x41fc('0x79')](_0x41fc('0x96'),_0x2f09ce[_0x41fc('0x27')],_0x2f09ce[_0x41fc('0x97')]||_0x2f09ce['Smtp'][_0x41fc('0x39')]),'to':_0x280911[_0x41fc('0x2b')][_0x41fc('0x77')],'subject':_0x41fc('0x98'),'text':util['format'](_0x41fc('0x99'),_0x280911['body'][_0x41fc('0x77')]),'attachments':[{'path':_0x3eb16f}]}})['then'](function(){return _0x153f21;})[_0x41fc('0x1c')](function(_0xe43fb9){logger[_0x41fc('0x18')](_0xe43fb9);});})[_0x41fc('0x14')](respondWithStatusCode(_0x2a8278,0xc8))[_0x41fc('0x1c')](handleError(_0x2a8278,null));};exports['addMessage']=function(_0x4a501d,_0x2a8b6b){return db[_0x41fc('0x7d')][_0x41fc('0x45')]({'where':{'id':_0x4a501d[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2a8b6b,null))[_0x41fc('0x14')](function(_0x368769){if(_0x368769){return _0x368769[_0x41fc('0x9a')](_0x4a501d[_0x41fc('0x2b')][_0x41fc('0x9b')],_['omit'](_0x4a501d[_0x41fc('0x2b')],[_0x41fc('0x9b'),'id'])||{});}})[_0x41fc('0x14')](respondWithResult(_0x2a8b6b,null))[_0x41fc('0x1c')](handleError(_0x2a8b6b,null));};exports['getMessages']=function(_0x28d988,_0x2306b1){var _0x499387={'raw':![],'where':{}};var _0x5c2fcc={};var _0x48c3ec={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')]['findOne']({'where':{'id':_0x28d988[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2306b1,null))[_0x41fc('0x14')](function(_0x1d0462){if(_0x1d0462){_0x5c2fcc[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x5c2fcc[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x28d988['query']);_0x5c2fcc['filters']=_[_0x41fc('0x3f')](_0x5c2fcc['model'],_0x5c2fcc['query']);_0x499387['attributes']=_[_0x41fc('0x3f')](_0x5c2fcc[_0x41fc('0x3c')],qs['fields'](_0x28d988[_0x41fc('0x38')][_0x41fc('0x41')]));_0x499387[_0x41fc('0x40')]=_0x499387[_0x41fc('0x40')]['length']?_0x499387[_0x41fc('0x40')]:_0x5c2fcc[_0x41fc('0x3c')];if(!_0x28d988['query']['hasOwnProperty'](_0x41fc('0x9c'))){_0x499387[_0x41fc('0x23')]=qs[_0x41fc('0x23')](_0x28d988[_0x41fc('0x38')]['limit']);_0x499387[_0x41fc('0x21')]=qs['offset'](_0x28d988['query'][_0x41fc('0x21')]);}_0x499387[_0x41fc('0x9d')]=qs[_0x41fc('0x9e')](_0x28d988['query'][_0x41fc('0x9e')]);_0x499387['where']=qs[_0x41fc('0x9f')](_[_0x41fc('0xa0')](_0x28d988[_0x41fc('0x38')],_0x5c2fcc[_0x41fc('0x9f')]));_0x499387['where'][_0x41fc('0xa1')]=_0x1d0462['id'];if(_0x28d988['query']['filter']){_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x499387[_0x41fc('0x40')],function(_0x5d153a){var _0x3766ea={};_0x3766ea[_0x5d153a]={'$like':'%'+_0x28d988[_0x41fc('0x38')][_0x41fc('0xa3')]+'%'};return _0x3766ea;})});}if(_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')]){var _0x12d710=_0x28d988[_0x41fc('0x38')][_0x41fc('0xa4')][_0x41fc('0xa5')](',');var _0x5784e5={};_0x5784e5[_0x12d710[0x0]]={'$gte':moment(_0x12d710[0x1])[_0x41fc('0x79')](_0x41fc('0xa6'))};_0x499387[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x499387[_0x41fc('0xa2')],_0x5784e5);}_0x499387=_[_0x41fc('0x2a')]({},_0x499387,_0x28d988[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x499387[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x3508a5){_0x48c3ec['count']=_0x3508a5;if(_0x28d988[_0x41fc('0x38')][_0x41fc('0x43')]){_0x499387[_0x41fc('0xa7')]=[{'all':!![]}];}return db['ChatMessage'][_0x41fc('0x36')](_0x499387);})['then'](function(_0x24a09a){_0x48c3ec['rows']=_0x24a09a;return _0x48c3ec;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2306b1,_0x499387))[_0x41fc('0x1c')](handleError(_0x2306b1,null));};exports[_0x41fc('0xa8')]=function(_0x43fd16,_0x2999d4){var _0x12bb76={'where':{}},_0x53ddc0={},_0xfe031b={'count':0x0,'rows':[]};return db[_0x41fc('0x3e')][_0x41fc('0x4a')]({'where':{'id':_0x43fd16[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x2999d4,null))['then'](function(_0x52658f){if(_0x52658f){_0x53ddc0[_0x41fc('0x3c')]=_[_0x41fc('0x3d')](db[_0x41fc('0x7d')][_0x41fc('0x31')]);_0x53ddc0[_0x41fc('0x38')]=_[_0x41fc('0x3d')](_0x43fd16[_0x41fc('0x38')]);_0x53ddc0['filters']=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],_0x53ddc0[_0x41fc('0x38')]);_0x12bb76[_0x41fc('0x40')]=_[_0x41fc('0x3f')](_0x53ddc0[_0x41fc('0x3c')],qs[_0x41fc('0x41')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x41')]));_0x12bb76[_0x41fc('0x40')]=_0x12bb76[_0x41fc('0x40')][_0x41fc('0x42')]?_0x12bb76[_0x41fc('0x40')]:_0x53ddc0[_0x41fc('0x3c')];if(!_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa9')]('nolimit')){_0x12bb76['limit']=qs[_0x41fc('0x23')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x23')]);_0x12bb76[_0x41fc('0x21')]=qs[_0x41fc('0x21')](_0x43fd16['query'][_0x41fc('0x21')]);}_0x12bb76['order']=qs[_0x41fc('0x9e')](_0x43fd16[_0x41fc('0x38')][_0x41fc('0x9e')]);_0x12bb76[_0x41fc('0xa2')]=qs['filters'](_['pick'](_0x43fd16[_0x41fc('0x38')],_0x53ddc0[_0x41fc('0x9f')]));_0x12bb76[_0x41fc('0xa2')][_0x41fc('0xa1')]=_0x52658f['id'];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xa3')]){_0x12bb76[_0x41fc('0xa2')]=_[_0x41fc('0x2a')](_0x12bb76[_0x41fc('0xa2')],{'$or':_[_0x41fc('0x30')](_0x12bb76['attributes'],function(_0x2db164){var _0x9c8f40={};_0x9c8f40[_0x2db164]={'$like':'%'+_0x43fd16[_0x41fc('0x38')]['filter']+'%'};return _0x9c8f40;})});}_0x12bb76[_0x41fc('0xa2')]['secret']=![];if(_0x43fd16[_0x41fc('0x38')]['id']){_0x12bb76[_0x41fc('0xa2')]['id']={'$gt':_0x43fd16[_0x41fc('0x38')]['id']};}_0x12bb76=_['merge']({},_0x12bb76,_0x43fd16[_0x41fc('0x44')]);return db['ChatMessage'][_0x41fc('0x24')]({'where':_0x12bb76[_0x41fc('0xa2')]})[_0x41fc('0x14')](function(_0x1edbc8){_0xfe031b[_0x41fc('0x24')]=_0x1edbc8;_0x12bb76['include']=[];if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0xaa')]){_0x12bb76[_0x41fc('0xa7')][_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id',_0x41fc('0x52'),_0x41fc('0x89')]});}if(_0x43fd16[_0x41fc('0x38')][_0x41fc('0x43')]){_0x12bb76[_0x41fc('0xa7')]=[{'all':!![]}];}return db[_0x41fc('0x7d')][_0x41fc('0x36')](_0x12bb76);})[_0x41fc('0x14')](function(_0x4870e8){_0xfe031b[_0x41fc('0xac')]=_0x4870e8;return _0xfe031b;});}})[_0x41fc('0x14')](respondWithFilteredResult(_0x2999d4,_0x12bb76))[_0x41fc('0x1c')](handleError(_0x2999d4,null));};exports[_0x41fc('0xad')]=function(_0x18b8a4,_0xb4a7a3){return db['ChatInteraction'][_0x41fc('0x45')]({'where':{'id':_0x18b8a4['params']['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0xb4a7a3,null))['then'](function(_0x400ab6){if(_0x400ab6){return _0x400ab6[_0x41fc('0xae')](_0x18b8a4[_0x41fc('0x2b')][_0x41fc('0x9b')],_[_0x41fc('0xaf')](_0x18b8a4['body'],[_0x41fc('0x9b'),'id'])||{})[_0x41fc('0xb0')](function(){return db[_0x41fc('0xb1')]['findAll']({'attributes':['id',_0x41fc('0x27'),_0x41fc('0xb2')],'where':{'id':_0x18b8a4[_0x41fc('0x2b')]['ids']}});})[_0x41fc('0x14')](function(_0xf0330a){socket['emit'](_0x41fc('0xb3'),{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]});return{'id':Number(_0x18b8a4[_0x41fc('0x3b')]['id']),'tags':_0xf0330a||[]};});}})[_0x41fc('0x14')](respondWithResult(_0xb4a7a3,null))[_0x41fc('0x1c')](handleError(_0xb4a7a3,null));};exports[_0x41fc('0xb4')]=function(_0x1bdb9b,_0x12bf27){return db[_0x41fc('0x3e')][_0x41fc('0x45')]({'where':{'id':_0x1bdb9b[_0x41fc('0x3b')]['id']}})[_0x41fc('0x14')](handleEntityNotFound(_0x12bf27,null))['then'](function(_0x10df5b){if(_0x10df5b){return _0x10df5b[_0x41fc('0xb4')](_0x1bdb9b[_0x41fc('0x38')]['ids']);}})[_0x41fc('0x14')](respondWithStatusCode(_0x12bf27,null))[_0x41fc('0x1c')](handleError(_0x12bf27,null));};exports[_0x41fc('0x76')]=function(_0x5574e7,_0x5489d6){var _0x5d0428=moment()[_0x41fc('0xb5')]()['toString']();var _0x1a89fb=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),_0x41fc('0xb8'));var _0x7e95ef=path[_0x41fc('0x72')](config[_0x41fc('0x73')],_0x41fc('0xb6'),_0x41fc('0xb7'),'attachments');var _0x288038=path[_0x41fc('0x72')](_0x1a89fb,_0x5d0428);var _0x3a0ccb=util[_0x41fc('0x79')](_0x41fc('0xb9'),_0x5574e7['params']['id'],_0x5d0428);var _0x511650=path['join'](_0x1a89fb,_0x3a0ccb);var _0x3231ef=[];_0x3231ef[_0x41fc('0xab')]({'model':db['User'],'as':_0x41fc('0x7f'),'attributes':['id','fullname'],'raw':!![]});_0x3231ef[_0x41fc('0xab')]({'model':db[_0x41fc('0x80')],'as':_0x41fc('0x60'),'attributes':['id','firstName',_0x41fc('0xba')],'raw':!![]});if(_0x5574e7[_0x41fc('0x38')][_0x41fc('0xbb')]){_0x3231ef[_0x41fc('0xab')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x271260=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body','createdAt',_0x41fc('0xbc'),_0x41fc('0x8e'),_0x41fc('0xbd')],'include':_0x3231ef}];_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x4b')],'as':_0x41fc('0xbe'),'attributes':['id',_0x41fc('0x27')]});_0x271260[_0x41fc('0xab')]({'model':db[_0x41fc('0x7f')],'as':_0x41fc('0xbf'),'attributes':['id',_0x41fc('0x52')]});return db['ChatInteraction']['find']({'where':{'id':_0x5574e7[_0x41fc('0x3b')]['id']},'include':_0x271260})[_0x41fc('0x14')](handleEntityNotFound(_0x5489d6,null))[_0x41fc('0x14')](function(_0x4fc3d3){if(_0x4fc3d3){var _0x106fa2=_0x4fc3d3[_0x41fc('0xc0')]({'plain':!![]});fs[_0x41fc('0xc1')](_0x288038);var _0x61dfdb={'channel':_0x41fc('0xc2'),'account':_0x106fa2[_0x41fc('0xbe')][_0x41fc('0x27')],'agent':_0x106fa2[_0x41fc('0xbf')]?_0x106fa2[_0x41fc('0xbf')]['fullname']:_0x41fc('0xc3'),'createdAt':moment(_0x106fa2[_0x41fc('0x8c')])[_0x41fc('0x79')](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'closedAt':_0x106fa2[_0x41fc('0x6f')]?moment(_0x106fa2[_0x41fc('0xc5')])[_0x41fc('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x106fa2[_0x41fc('0x66')],'chatInfo':{'browser':_0x106fa2['browserName'],'os':_0x106fa2['osName'],'referer':_0x106fa2[_0x41fc('0xc6')],'customerIp':_0x106fa2[_0x41fc('0xc7')],'customerPort':_0x106fa2[_0x41fc('0xc8')]?_0x106fa2[_0x41fc('0xc8')]:'N.A.'},'messages':_(_0x106fa2[_0x41fc('0x7e')])[_0x41fc('0xc9')]()[_0x41fc('0xa3')]({'secret':![]})[_0x41fc('0x30')](function(_0x374c93){if(_0x374c93[_0x41fc('0x6d')]){var _0x5cf940=path[_0x41fc('0x72')](_0x7e95ef,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]);if(fs['existsSync'](_0x5cf940)){fs[_0x41fc('0xca')](_0x5cf940)[_0x41fc('0xcb')](fs['createWriteStream'](path[_0x41fc('0x72')](_0x288038,_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')])));}}return{'date':moment(_0x374c93[_0x41fc('0x8c')])['format'](_0x41fc('0xa6'))[_0x41fc('0xc4')](),'sender':_0x374c93['direction']===_0x41fc('0xcc')?_0x374c93['User']?_0x374c93[_0x41fc('0x7f')][_0x41fc('0x52')]:'System':_0x374c93[_0x41fc('0x60')][_0x41fc('0xcd')]+(_0x374c93['Contact']['lastName']?'\x20'+_0x374c93[_0x41fc('0x60')][_0x41fc('0xba')]:''),'body':_0x374c93[_0x41fc('0x6d')]?_0x374c93[_0x41fc('0x6d')][_0x41fc('0x6b')]:_0x374c93[_0x41fc('0x2b')],'direction':_0x374c93[_0x41fc('0xbc')]===_0x41fc('0xcc')?'A':'C','secret':_0x374c93[_0x41fc('0x8e')],'read':_0x374c93[_0x41fc('0xbd')],'attachment':_0x374c93[_0x41fc('0x6d')]};})[_0x41fc('0xce')]()};return ejs['renderFile'](path[_0x41fc('0x72')](config['root'],'server',_0x41fc('0xcf'),_0x41fc('0xd0')),{'interaction':_0x61dfdb})[_0x41fc('0x14')](function(_0x152607){var _0x6c976c=path['join'](_0x288038,_0x41fc('0xd1')+_0x106fa2['id']+'-'+_0x5d0428+_0x41fc('0xd2'));var _0x1debfc={'path':_0x6c976c,'channel':_0x41fc('0xc2'),'interactionId':_0x106fa2['id']};return pdf[_0x41fc('0xd3')](_0x152607,_0x1debfc);})['then'](function(){return new Promise(function(_0x335804,_0x46183a){zipdir(_0x288038,{'saveTo':_0x511650},function(_0x2497d3,_0x4f4538){if(_0x2497d3)return _0x46183a(_0x2497d3);return _0x335804(_0x4f4538);});})['then'](function(){return new BPromise(function(_0x1246de,_0xfaec57){rimraf(_0x288038,function(_0x5d7888){if(_0x5d7888)_0xfaec57(_0x5d7888);return _0x1246de();});});})['then'](function(){return _0x5489d6[_0x41fc('0x76')](_0x511650,_0x3a0ccb,function(_0x26a894){if(_0x26a894){logger[_0x41fc('0x18')](_0x41fc('0xd4'),_0x26a894);}else{fs[_0x41fc('0xd5')](_0x511650);}});});});}else{return _0x5489d6[_0x41fc('0x1d')](0xc8);}})[_0x41fc('0x1c')](handleError(_0x5489d6,null));};
\ No newline at end of file
+var _0x70e1=['User','ChatWebsiteId','ContactId','format','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','omit','getMessages','hasOwnProperty','nolimit','order','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','sort','secret','includeAgent','push','addTags','setTags','ids','spread','Tag','color','chatInteractionTags:save','removeTags','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','ChatWebsite','Owner','get','mkdirSync','Chat','Account','toString','closedAt','browserName','osName','referer','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','read','value','renderFile','views','transcript-','.pdf','err','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','offset','undefined','limit','count','update','destroy','end','sendStatus','stack','name','send','merge','body','contact','agent','interaction','account','index','map','rawAttributes','fieldName','type','getOptions','findAll','chat','query','show','params','model','keys','ChatInteraction','filters','intersection','attributes','fields','length','includeAll','include','options','create','find','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Unauthorized','Attachment','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','Messages'];(function(_0x2196f3,_0x25609c){var _0x3b865f=function(_0x344ba9){while(--_0x344ba9){_0x2196f3['push'](_0x2196f3['shift']());}};_0x3b865f(++_0x25609c);}(_0x70e1,0x124));var _0x170e=function(_0x78e522,_0x37c539){_0x78e522=_0x78e522-0x0;var _0x4a170d=_0x70e1[_0x78e522];return _0x4a170d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x170e('0x0'));var rp=require(_0x170e('0x1'));var moment=require(_0x170e('0x2'));var BPromise=require(_0x170e('0x3'));var Mustache=require('mustache');var util=require(_0x170e('0x4'));var path=require(_0x170e('0x5'));var ejs=require(_0x170e('0x6'));var fs=require('fs');var _=require(_0x170e('0x7'));var Redis=require(_0x170e('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0x170e('0x9'));var pdf=require(_0x170e('0xa'));var logger=require('../../config/logger')(_0x170e('0xb'));var config=require('../../config/environment');var db=require(_0x170e('0xc'))['db'];config[_0x170e('0xd')]=_['defaults'](config[_0x170e('0xd')],{'host':_0x170e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x170e('0xd')]));require(_0x170e('0xf'))['register'](socket);var jayson=require(_0x170e('0x10'));var client=jayson[_0x170e('0x11')][_0x170e('0x12')]({'port':0x232b});var client9004=jayson[_0x170e('0x11')][_0x170e('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x14ba22,_0x4e8ab7,_0x459732,_0x303eaa){return new BPromise(function(_0xa4b7a3,_0x5ea7b7){var _0x321eff=_0x303eaa||client;return _0x321eff[_0x170e('0x13')](_0x14ba22,_0x459732)[_0x170e('0x14')](function(_0x13e27e){logger['info'](_0x170e('0x15'),_0x4e8ab7,_0x170e('0x16'));logger[_0x170e('0x17')](_0x170e('0x18'),_0x4e8ab7,'request\x20sent',JSON[_0x170e('0x19')](_0x13e27e));if(_0x13e27e[_0x170e('0x1a')]){if(_0x13e27e['error'][_0x170e('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x4e8ab7,_0x13e27e[_0x170e('0x1a')][_0x170e('0x1c')]);return _0x5ea7b7(_0x13e27e[_0x170e('0x1a')]['message']);}logger[_0x170e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x4e8ab7,_0x13e27e[_0x170e('0x1a')][_0x170e('0x1c')]);return _0xa4b7a3(_0x13e27e['error']['message']);}else{logger['info'](_0x170e('0x15'),_0x4e8ab7,_0x170e('0x16'));_0xa4b7a3(_0x13e27e[_0x170e('0x1d')]['message']);}})[_0x170e('0x1e')](function(_0x1d66ad){logger[_0x170e('0x1a')](_0x170e('0x15'),_0x4e8ab7,_0x1d66ad);_0x5ea7b7(_0x1d66ad);});});}function respondWithStatusCode(_0x2cf0ae,_0x10b52a){_0x10b52a=_0x10b52a||0xcc;return function(_0x2a5aa9){if(_0x2a5aa9){return _0x2cf0ae['sendStatus'](_0x10b52a);}return _0x2cf0ae['status'](_0x10b52a)['end']();};}function respondWithResult(_0x568dfd,_0x4743df){_0x4743df=_0x4743df||0xc8;return function(_0x54b9a1){if(_0x54b9a1){return _0x568dfd[_0x170e('0x1f')](_0x4743df)['json'](_0x54b9a1);}};}function respondWithFilteredResult(_0x334b50,_0xd7789f){return function(_0x380577){if(_0x380577){var _0x4456c0=typeof _0xd7789f[_0x170e('0x20')]===_0x170e('0x21')&&typeof _0xd7789f[_0x170e('0x22')]==='undefined';var _0x1e642d=_0x380577['count'];var _0x50f318=_0x4456c0?0x0:_0xd7789f[_0x170e('0x20')];var _0xa739fd=_0x4456c0?_0x380577[_0x170e('0x23')]:_0xd7789f[_0x170e('0x20')]+_0xd7789f[_0x170e('0x22')];var _0x87e16e;if(_0xa739fd>=_0x1e642d){_0xa739fd=_0x1e642d;_0x87e16e=0xc8;}else{_0x87e16e=0xce;}_0x334b50[_0x170e('0x1f')](_0x87e16e);return _0x334b50['set']('Content-Range',_0x50f318+'-'+_0xa739fd+'/'+_0x1e642d)['json'](_0x380577);}return null;};}function saveUpdates(_0x2d6761){return function(_0x43a999){if(_0x43a999){return _0x43a999[_0x170e('0x24')](_0x2d6761)[_0x170e('0x14')](function(_0x3ddd26){return _0x3ddd26;});}return null;};}function removeEntity(_0x391874){return function(_0x5954a0){if(_0x5954a0){return _0x5954a0[_0x170e('0x25')]()[_0x170e('0x14')](function(){_0x391874[_0x170e('0x1f')](0xcc)[_0x170e('0x26')]();});}};}function handleEntityNotFound(_0x39855e){return function(_0x2016be){if(!_0x2016be){_0x39855e[_0x170e('0x27')](0x194);}return _0x2016be;};}function handleError(_0x5e05a4,_0x1ce8ea){_0x1ce8ea=_0x1ce8ea||0x1f4;return function(_0x3790ae){logger['error'](_0x3790ae[_0x170e('0x28')]);if(_0x3790ae['name']){delete _0x3790ae[_0x170e('0x29')];}_0x5e05a4[_0x170e('0x1f')](_0x1ce8ea)[_0x170e('0x2a')](_0x3790ae);};}function getMustacheRender(_0x47110c,_0x1e86a5){return Mustache['render'](_0x47110c,_[_0x170e('0x2b')](_0x1e86a5[_0x170e('0x2c')],{'contact':_0x1e86a5[_0x170e('0x2d')],'message':_0x1e86a5['message'],'agent':_0x1e86a5[_0x170e('0x2e')],'interaction':_0x1e86a5[_0x170e('0x2f')],'account':_0x1e86a5[_0x170e('0x30')]}))||'';}exports[_0x170e('0x31')]=function(_0x5986d4,_0x113959){var _0x259245={};var _0x13b321=_[_0x170e('0x32')](db['ChatInteraction'][_0x170e('0x33')],function(_0x16a305){return{'name':_0x16a305[_0x170e('0x34')],'type':_0x16a305[_0x170e('0x35')]['key']};});_0x259245=qs[_0x170e('0x36')](_0x13b321,_0x5986d4);return interaction[_0x170e('0x37')](_0x170e('0x38'),_0x5986d4[_0x170e('0x39')],_0x5986d4['user'],_0x259245,_0x13b321)[_0x170e('0x14')](respondWithFilteredResult(_0x113959,_0x259245))['catch'](handleError(_0x113959,null));};exports[_0x170e('0x3a')]=function(_0x2f4638,_0x496793){var _0x461766={'raw':![],'where':{'id':_0x2f4638[_0x170e('0x3b')]['id']}},_0x1b8d40={};_0x1b8d40[_0x170e('0x3c')]=_[_0x170e('0x3d')](db[_0x170e('0x3e')][_0x170e('0x33')]);_0x1b8d40[_0x170e('0x39')]=_[_0x170e('0x3d')](_0x2f4638[_0x170e('0x39')]);_0x1b8d40[_0x170e('0x3f')]=_[_0x170e('0x40')](_0x1b8d40[_0x170e('0x3c')],_0x1b8d40[_0x170e('0x39')]);_0x461766[_0x170e('0x41')]=_['intersection'](_0x1b8d40[_0x170e('0x3c')],qs[_0x170e('0x42')](_0x2f4638['query'][_0x170e('0x42')]));_0x461766[_0x170e('0x41')]=_0x461766[_0x170e('0x41')][_0x170e('0x43')]?_0x461766[_0x170e('0x41')]:_0x1b8d40[_0x170e('0x3c')];if(_0x2f4638[_0x170e('0x39')][_0x170e('0x44')]){_0x461766[_0x170e('0x45')]=[{'all':!![]}];}_0x461766=_[_0x170e('0x2b')]({},_0x461766,_0x2f4638[_0x170e('0x46')]);return db[_0x170e('0x3e')]['find'](_0x461766)['then'](handleEntityNotFound(_0x496793,null))['then'](respondWithResult(_0x496793,null))[_0x170e('0x1e')](handleError(_0x496793,null));};exports[_0x170e('0x47')]=function(_0x11fc40,_0x447441){return db[_0x170e('0x3e')][_0x170e('0x47')](_0x11fc40[_0x170e('0x2c')],{})[_0x170e('0x14')](respondWithResult(_0x447441,0xc9))[_0x170e('0x1e')](handleError(_0x447441,null));};exports[_0x170e('0x24')]=function(_0x3b224b,_0x589a0a){if(_0x3b224b[_0x170e('0x2c')]['id']){delete _0x3b224b['body']['id'];}return db['ChatInteraction'][_0x170e('0x48')]({'where':{'id':_0x3b224b[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x589a0a,null))[_0x170e('0x14')](saveUpdates(_0x3b224b[_0x170e('0x2c')],null))[_0x170e('0x14')](respondWithResult(_0x589a0a,null))[_0x170e('0x1e')](handleError(_0x589a0a,null));};exports[_0x170e('0x25')]=function(_0x3749d0,_0x129e16){return db['ChatInteraction']['find']({'where':{'id':_0x3749d0[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x129e16,null))[_0x170e('0x14')](removeEntity(_0x129e16,null))[_0x170e('0x1e')](handleError(_0x129e16,null));};exports['describe']=function(_0x281f50,_0x3a0fee){return db['ChatInteraction'][_0x170e('0x49')]()[_0x170e('0x14')](respondWithResult(_0x3a0fee,null))[_0x170e('0x1e')](handleError(_0x3a0fee,null));};exports[_0x170e('0x4a')]=function(_0x2986e3,_0xf992a7){var _0x4f1b41=_0x2986e3['params']['id'];var _0x5bc945;var _0x486e1e;var _0xa8061;return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x4f1b41}})['then'](function(_0x1654cc){_0x5bc945=_0x1654cc;return db['ChatWebsite'][_0x170e('0x4b')]({'where':{'id':_0x1654cc['ChatWebsiteId']},'attributes':['id',_0x170e('0x4c'),_0x170e('0x4d'),_0x170e('0x4e'),_0x170e('0x4f'),_0x170e('0x50')],'raw':!![]});})[_0x170e('0x14')](function(_0x169cc2){if(_0x169cc2&&_0x169cc2[_0x170e('0x4c')]&&_0x169cc2['vidaooEscalation']){_0x486e1e=_0x169cc2;var _0x5a50c3={'interaction':{'id':_0x4f1b41},'agent':{'id':_0x2986e3['user']['id'],'name':_0x2986e3[_0x170e('0x51')]['name'],'fullname':_0x2986e3[_0x170e('0x51')][_0x170e('0x52')],'email':_0x2986e3[_0x170e('0x51')][_0x170e('0x53')]},'contact':_0x2986e3[_0x170e('0x2c')][_0x170e('0x2d')],'account':_0x2986e3[_0x170e('0x2c')][_0x170e('0x30')]};var _0x21860c={'rejectUnauthorized':![],'method':_0x170e('0x54'),'url':_0x170e('0x55'),'headers':{'X-APIKEY':_0x169cc2[_0x170e('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2986e3[_0x170e('0x51')][_0x170e('0x53')]],'buttons':null,'topic':_0x486e1e[_0x170e('0x4e')],'note':_['isNull'](_0x486e1e['vidaooNote'])?null:getMustacheRender(_0x486e1e[_0x170e('0x4f')],_0x5a50c3),'metadata':null},'redirect':_0x170e('0x56'),'json':!![]};try{if(!_['isNull'](_0x486e1e[_0x170e('0x50')])){var _0x5c1f5f=getMustacheRender(_0x486e1e[_0x170e('0x50')],_0x5a50c3);var _0x1ebc34=JSON[_0x170e('0x57')](_0x5c1f5f);_0x21860c[_0x170e('0x2c')][_0x170e('0x58')]=_0x1ebc34;}}catch(_0x27be7e){throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x5b'));}return rp(_0x21860c);}else{throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x5c'));}})[_0x170e('0x14')](function(_0x27e4cf){_0xa8061=_0x27e4cf;if(_0xa8061['id']){var _0x1c0d0b={'body':_0xa8061[_0x170e('0x5d')],'ChatWebsiteId':_0x486e1e['id'],'ChatInteractionId':_0x5bc945['id'],'direction':_0x170e('0x5e'),'UserId':_0x2986e3[_0x170e('0x51')]['id']};return db[_0x170e('0x5f')][_0x170e('0x47')](_0x1c0d0b,{});}else{throw new db['Sequelize'][(_0x170e('0x5a'))](_0x170e('0x60'));}})[_0x170e('0x14')](function(){return _0x5bc945[_0x170e('0x61')]({'vidaooSessionId':_0xa8061['id']});})['then'](respondWithResult(_0xf992a7,null))['catch'](handleError(_0xf992a7,null));};exports[_0x170e('0x62')]=function(_0x33711c,_0xfdee2d){if(_0x33711c[_0x170e('0x2c')]['id']){delete _0x33711c['body']['id'];}return db[_0x170e('0x3e')]['find']({'where':{'id':_0x33711c[_0x170e('0x3b')]['id']},'include':[{'model':db['CmContact'],'as':_0x170e('0x63')}]})[_0x170e('0x14')](handleEntityNotFound(_0xfdee2d,null))[_0x170e('0x14')](saveUpdates(_0x33711c['body'],null))[_0x170e('0x14')](respondWithResult(_0xfdee2d,null))[_0x170e('0x1e')](handleError(_0xfdee2d,null));};exports['abandon']=function(_0x270259,_0x2aab5e){if(_0x270259[_0x170e('0x2c')]['id']){delete _0x270259[_0x170e('0x2c')]['id'];}return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x270259[_0x170e('0x3b')]['id']}})['then'](function(_0x258b07){if(!_0x258b07){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x170e('0x64'),0x194,_0x170e('0x65'));_0x2aab5e[_0x170e('0x27')](0x194);}else{if(_0x258b07[_0x170e('0x66')]){throw new db[(_0x170e('0x59'))][(_0x170e('0x5a'))](_0x170e('0x67'));}}return _0x258b07;})[_0x170e('0x14')](function(_0x309d03){if(_0x309d03){return _0x309d03[_0x170e('0x24')]({'closed':_0x270259[_0x170e('0x2c')][_0x170e('0x68')],'disposition':_0x270259[_0x170e('0x2c')][_0x170e('0x69')]})[_0x170e('0x14')](function(_0x852d8){return _0x852d8;});}})[_0x170e('0x14')](function(){return respondWithRpcPromise('AbandonInteraction',_0x170e('0x64'),_0x270259[_0x170e('0x2c')],client9004);})[_0x170e('0x14')](respondWithResult(_0x2aab5e,null))[_0x170e('0x1e')](handleError(_0x2aab5e,null));};exports[_0x170e('0x6a')]=function(_0x7b1011,_0xf6a202){_0x7b1011[_0x170e('0x2c')]['name']=_0x7b1011[_0x170e('0x6b')]['originalname'];_0x7b1011['body'][_0x170e('0x6c')]=_0x7b1011['file'][_0x170e('0x6d')];_0x7b1011[_0x170e('0x2c')]['type']=_0x7b1011[_0x170e('0x6b')][_0x170e('0x6e')];return db['Attachment'][_0x170e('0x47')](_0x7b1011[_0x170e('0x2c')])[_0x170e('0x14')](respondWithResult(_0xf6a202,0xc9))['catch'](handleError(_0xf6a202,null));};exports['attachmentDownload']=function(_0x58a11b,_0x26e291){return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x58a11b[_0x170e('0x3b')]['id']},'raw':!![]})[_0x170e('0x14')](handleEntityNotFound(_0x26e291,null))[_0x170e('0x14')](function(_0x15aeab){if(_0x15aeab){if(_0x15aeab[_0x170e('0x68')]){return _0x26e291[_0x170e('0x1f')](0x193)['json']({'status':0x193,'message':_0x170e('0x6f')});}return db[_0x170e('0x70')][_0x170e('0x4b')]({'where':{'id':_0x58a11b[_0x170e('0x39')][_0x170e('0x71')]},'raw':!![]})['then'](handleEntityNotFound(_0x26e291,null));}})[_0x170e('0x14')](function(_0x1cf558){if(_0x1cf558){var _0x3538b5=_0x1cf558[_0x170e('0x72')]!==null;var _0xefd4c3=path['join'](config[_0x170e('0x73')],_0x170e('0x74'));if(_0x3538b5){_0xefd4c3=path[_0x170e('0x75')](_0xefd4c3,_0x170e('0x76'));}var _0x27c0f3=path[_0x170e('0x75')](_0xefd4c3,_0x1cf558['basename']);return _0x26e291[_0x170e('0x77')](_0x27c0f3);}})[_0x170e('0x1e')](handleError(_0x26e291,null));};exports[_0x170e('0x78')]=function(_0x4a5f73,_0x3a1aa6){var _0x4747d4=null;var _0x1e1c6e=null;var _0x1ee0f3=null;if(_0x4a5f73[_0x170e('0x2c')]['id']){delete _0x4a5f73[_0x170e('0x2c')]['id'];}if(_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')]){_0x1ee0f3=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0x7a'),util['format'](_0x170e('0x7b'),Date['now']()));_0x4a5f73[_0x170e('0x2c')][_0x170e('0x7c')]=_0x1ee0f3;}return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x4a5f73[_0x170e('0x3b')]['id']},'include':[{'model':db[_0x170e('0x5f')],'as':_0x170e('0x7d'),'include':[{'model':db[_0x170e('0x7e')],'as':_0x170e('0x7e')}]}]})[_0x170e('0x14')](handleEntityNotFound(_0x3a1aa6,null))[_0x170e('0x14')](saveUpdates(_0x4a5f73[_0x170e('0x2c')],null))[_0x170e('0x14')](function(_0x2333ae){if(_0x2333ae){_0x4747d4=_0x2333ae;return db['ChatWebsite'][_0x170e('0x48')]({'where':{'id':_0x4747d4[_0x170e('0x7f')]}});}})[_0x170e('0x14')](function(_0x44d68f){if(_0x44d68f){_0x1e1c6e=_0x44d68f;return db['CmContact'][_0x170e('0x48')]({'where':{'id':_0x4747d4[_0x170e('0x80')]}});}})[_0x170e('0x14')](function(_0x288c72){if(_0x288c72){if(_0x1ee0f3){var _0x4481e6=null;for(var _0xa2abaa=0x1;_0xa2abaa<_0x4747d4[_0x170e('0x7d')][_0x170e('0x43')];++_0xa2abaa){_0x4481e6=_0x4747d4[_0x170e('0x7d')][_0xa2abaa];var _0x389e1c=_0x4481e6['UserId']?util[_0x170e('0x81')]('%s%d',_0x1e1c6e[_0x170e('0x82')],_0x4481e6[_0x170e('0x66')]):'System';var _0x68e882=_0x4a5f73[_0x170e('0x2c')][_0x170e('0x83')]||util[_0x170e('0x81')](_0x170e('0x84'),_0x170e('0x85'),_0x4481e6[_0x170e('0x80')]);switch(_0x1e1c6e[_0x170e('0x86')]){case _0x170e('0x87'):_0x389e1c=_0x4481e6[_0x170e('0x66')]?util[_0x170e('0x81')](_0x170e('0x84'),_0x1e1c6e[_0x170e('0x82')],_0x4481e6['UserId']):_0x170e('0x88');break;case _0x170e('0x89'):_0x389e1c=_0x4481e6[_0x170e('0x66')]?_0x4481e6[_0x170e('0x7e')]['alias']||_0x4481e6['User'][_0x170e('0x52')]:_0x170e('0x88');break;case'agent_fullname':_0x389e1c=_0x4481e6['UserId']?_0x4481e6[_0x170e('0x7e')][_0x170e('0x52')]:_0x170e('0x88');break;default:_0x389e1c=_0x4481e6[_0x170e('0x66')]?util[_0x170e('0x81')](_0x170e('0x84'),_0x1e1c6e[_0x170e('0x82')],_0x4481e6[_0x170e('0x66')]):_0x170e('0x88');}var _0x1172bb=util[_0x170e('0x81')](_0x170e('0x8a'),moment(_0x4481e6[_0x170e('0x8b')])[_0x170e('0x81')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4481e6[_0x170e('0x8c')]==='in'?_0x68e882:_0x389e1c,_0x4481e6['body']);if(!_0x4481e6['secret']){fs[_0x170e('0x8d')](_0x1ee0f3,_0x1172bb);}}return db[_0x170e('0x8e')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x170e('0x8f')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x170e('0x90'),'raw':!![]}]}]});}}})['then'](function(_0x5e37ff){if(!_0x5e37ff||!_0x5e37ff[_0x170e('0x91')]||!_0x4a5f73[_0x170e('0x2c')])return _0x4747d4;var _0xf150e7=_0x5e37ff[_0x170e('0x92')]();return respondWithRpcPromise(_0x170e('0x93'),'sendMail',{'account':_0xf150e7,'message':{'from':util[_0x170e('0x81')](_0x170e('0x94'),_0x5e37ff[_0x170e('0x29')],_0x5e37ff[_0x170e('0x53')]||_0x5e37ff['Smtp'][_0x170e('0x51')]),'to':_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')],'subject':_0x170e('0x95'),'text':util[_0x170e('0x81')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x4a5f73[_0x170e('0x2c')][_0x170e('0x79')]),'attachments':[{'path':_0x1ee0f3}]}})['then'](function(){return _0x4747d4;})['catch'](function(_0x3c36cf){logger['error'](_0x3c36cf);});})['then'](respondWithStatusCode(_0x3a1aa6,0xc8))['catch'](handleError(_0x3a1aa6,null));};exports[_0x170e('0x96')]=function(_0x56e189,_0x44c952){return db['ChatMessage'][_0x170e('0x48')]({'where':{'id':_0x56e189[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x44c952,null))[_0x170e('0x14')](function(_0x4e6e14){if(_0x4e6e14){return _0x4e6e14[_0x170e('0x96')](_0x56e189['body']['ids'],_[_0x170e('0x97')](_0x56e189['body'],['ids','id'])||{});}})[_0x170e('0x14')](respondWithResult(_0x44c952,null))[_0x170e('0x1e')](handleError(_0x44c952,null));};exports[_0x170e('0x98')]=function(_0x3fc59c,_0x5b1925){var _0x2df274={'raw':![],'where':{}};var _0x44acfb={};var _0x1a1acb={'count':0x0,'rows':[]};return db[_0x170e('0x3e')][_0x170e('0x4b')]({'where':{'id':_0x3fc59c['params']['id']}})['then'](handleEntityNotFound(_0x5b1925,null))[_0x170e('0x14')](function(_0x1395f3){if(_0x1395f3){_0x44acfb[_0x170e('0x3c')]=_[_0x170e('0x3d')](db[_0x170e('0x5f')][_0x170e('0x33')]);_0x44acfb[_0x170e('0x39')]=_[_0x170e('0x3d')](_0x3fc59c[_0x170e('0x39')]);_0x44acfb[_0x170e('0x3f')]=_[_0x170e('0x40')](_0x44acfb[_0x170e('0x3c')],_0x44acfb['query']);_0x2df274[_0x170e('0x41')]=_['intersection'](_0x44acfb[_0x170e('0x3c')],qs[_0x170e('0x42')](_0x3fc59c[_0x170e('0x39')][_0x170e('0x42')]));_0x2df274[_0x170e('0x41')]=_0x2df274['attributes']['length']?_0x2df274[_0x170e('0x41')]:_0x44acfb[_0x170e('0x3c')];if(!_0x3fc59c[_0x170e('0x39')][_0x170e('0x99')](_0x170e('0x9a'))){_0x2df274[_0x170e('0x22')]=qs[_0x170e('0x22')](_0x3fc59c[_0x170e('0x39')][_0x170e('0x22')]);_0x2df274[_0x170e('0x20')]=qs[_0x170e('0x20')](_0x3fc59c['query']['offset']);}_0x2df274[_0x170e('0x9b')]=qs['sort'](_0x3fc59c[_0x170e('0x39')]['sort']);_0x2df274[_0x170e('0x9c')]=qs[_0x170e('0x3f')](_[_0x170e('0x9d')](_0x3fc59c[_0x170e('0x39')],_0x44acfb[_0x170e('0x3f')]));_0x2df274[_0x170e('0x9c')][_0x170e('0x9e')]=_0x1395f3['id'];if(_0x3fc59c['query'][_0x170e('0x9f')]){_0x2df274[_0x170e('0x9c')]=_['merge'](_0x2df274[_0x170e('0x9c')],{'$or':_['map'](_0x2df274[_0x170e('0x41')],function(_0x826f57){var _0x40ce4e={};_0x40ce4e[_0x826f57]={'$like':'%'+_0x3fc59c[_0x170e('0x39')][_0x170e('0x9f')]+'%'};return _0x40ce4e;})});}if(_0x3fc59c[_0x170e('0x39')][_0x170e('0xa0')]){var _0x5a4c25=_0x3fc59c[_0x170e('0x39')][_0x170e('0xa0')]['split'](',');var _0x421626={};_0x421626[_0x5a4c25[0x0]]={'$gte':moment(_0x5a4c25[0x1])[_0x170e('0x81')](_0x170e('0xa1'))};_0x2df274[_0x170e('0x9c')]=_[_0x170e('0x2b')](_0x2df274[_0x170e('0x9c')],_0x421626);}_0x2df274=_[_0x170e('0x2b')]({},_0x2df274,_0x3fc59c[_0x170e('0x46')]);return db[_0x170e('0x5f')][_0x170e('0x23')]({'where':_0x2df274[_0x170e('0x9c')]})['then'](function(_0x411b6e){_0x1a1acb[_0x170e('0x23')]=_0x411b6e;if(_0x3fc59c[_0x170e('0x39')]['includeAll']){_0x2df274[_0x170e('0x45')]=[{'all':!![]}];}return db['ChatMessage'][_0x170e('0x37')](_0x2df274);})[_0x170e('0x14')](function(_0x373ab8){_0x1a1acb[_0x170e('0xa2')]=_0x373ab8;return _0x1a1acb;});}})[_0x170e('0x14')](respondWithFilteredResult(_0x5b1925,_0x2df274))[_0x170e('0x1e')](handleError(_0x5b1925,null));};exports['getMyMessages']=function(_0x3729ec,_0x32d3c7){var _0x582b7a={'where':{}},_0x3a1f0c={},_0x1350a6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x170e('0x4b')]({'where':{'id':_0x3729ec[_0x170e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x32d3c7,null))[_0x170e('0x14')](function(_0x1f0933){if(_0x1f0933){_0x3a1f0c[_0x170e('0x3c')]=_['keys'](db[_0x170e('0x5f')][_0x170e('0x33')]);_0x3a1f0c[_0x170e('0x39')]=_['keys'](_0x3729ec['query']);_0x3a1f0c['filters']=_['intersection'](_0x3a1f0c[_0x170e('0x3c')],_0x3a1f0c['query']);_0x582b7a[_0x170e('0x41')]=_[_0x170e('0x40')](_0x3a1f0c[_0x170e('0x3c')],qs['fields'](_0x3729ec[_0x170e('0x39')][_0x170e('0x42')]));_0x582b7a['attributes']=_0x582b7a['attributes'][_0x170e('0x43')]?_0x582b7a[_0x170e('0x41')]:_0x3a1f0c['model'];if(!_0x3729ec['query']['hasOwnProperty'](_0x170e('0x9a'))){_0x582b7a[_0x170e('0x22')]=qs['limit'](_0x3729ec[_0x170e('0x39')][_0x170e('0x22')]);_0x582b7a[_0x170e('0x20')]=qs[_0x170e('0x20')](_0x3729ec[_0x170e('0x39')]['offset']);}_0x582b7a[_0x170e('0x9b')]=qs[_0x170e('0xa3')](_0x3729ec[_0x170e('0x39')][_0x170e('0xa3')]);_0x582b7a[_0x170e('0x9c')]=qs[_0x170e('0x3f')](_[_0x170e('0x9d')](_0x3729ec[_0x170e('0x39')],_0x3a1f0c[_0x170e('0x3f')]));_0x582b7a[_0x170e('0x9c')][_0x170e('0x9e')]=_0x1f0933['id'];if(_0x3729ec[_0x170e('0x39')][_0x170e('0x9f')]){_0x582b7a[_0x170e('0x9c')]=_['merge'](_0x582b7a[_0x170e('0x9c')],{'$or':_[_0x170e('0x32')](_0x582b7a[_0x170e('0x41')],function(_0x529e38){var _0x523532={};_0x523532[_0x529e38]={'$like':'%'+_0x3729ec[_0x170e('0x39')][_0x170e('0x9f')]+'%'};return _0x523532;})});}_0x582b7a['where'][_0x170e('0xa4')]=![];if(_0x3729ec[_0x170e('0x39')]['id']){_0x582b7a[_0x170e('0x9c')]['id']={'$gt':_0x3729ec['query']['id']};}_0x582b7a=_['merge']({},_0x582b7a,_0x3729ec[_0x170e('0x46')]);return db['ChatMessage'][_0x170e('0x23')]({'where':_0x582b7a['where']})[_0x170e('0x14')](function(_0x100d0c){_0x1350a6[_0x170e('0x23')]=_0x100d0c;_0x582b7a[_0x170e('0x45')]=[];if(_0x3729ec['query'][_0x170e('0xa5')]){_0x582b7a[_0x170e('0x45')][_0x170e('0xa6')]({'model':db[_0x170e('0x7e')],'as':'User','attributes':['id','fullname','alias']});}if(_0x3729ec[_0x170e('0x39')][_0x170e('0x44')]){_0x582b7a[_0x170e('0x45')]=[{'all':!![]}];}return db[_0x170e('0x5f')][_0x170e('0x37')](_0x582b7a);})[_0x170e('0x14')](function(_0x1e0496){_0x1350a6['rows']=_0x1e0496;return _0x1350a6;});}})[_0x170e('0x14')](respondWithFilteredResult(_0x32d3c7,_0x582b7a))[_0x170e('0x1e')](handleError(_0x32d3c7,null));};exports[_0x170e('0xa7')]=function(_0x5dee75,_0x13fd57){return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x5dee75[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x13fd57,null))[_0x170e('0x14')](function(_0x2b86cd){if(_0x2b86cd){return _0x2b86cd[_0x170e('0xa8')](_0x5dee75[_0x170e('0x2c')][_0x170e('0xa9')],_[_0x170e('0x97')](_0x5dee75[_0x170e('0x2c')],[_0x170e('0xa9'),'id'])||{})[_0x170e('0xaa')](function(){return db[_0x170e('0xab')][_0x170e('0x37')]({'attributes':['id',_0x170e('0x29'),_0x170e('0xac')],'where':{'id':_0x5dee75['body'][_0x170e('0xa9')]}});})[_0x170e('0x14')](function(_0xbf958c){socket['emit'](_0x170e('0xad'),{'id':Number(_0x5dee75[_0x170e('0x3b')]['id']),'tags':_0xbf958c||[]});return{'id':Number(_0x5dee75[_0x170e('0x3b')]['id']),'tags':_0xbf958c||[]};});}})[_0x170e('0x14')](respondWithResult(_0x13fd57,null))[_0x170e('0x1e')](handleError(_0x13fd57,null));};exports[_0x170e('0xae')]=function(_0x2f614b,_0x1f1c8c){return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0x2f614b[_0x170e('0x3b')]['id']}})[_0x170e('0x14')](handleEntityNotFound(_0x1f1c8c,null))[_0x170e('0x14')](function(_0x210b81){if(_0x210b81){return _0x210b81[_0x170e('0xae')](_0x2f614b[_0x170e('0x39')]['ids']);}})[_0x170e('0x14')](respondWithStatusCode(_0x1f1c8c,null))[_0x170e('0x1e')](handleError(_0x1f1c8c,null));};exports[_0x170e('0x77')]=function(_0xa7daad,_0x28d0e7){var _0x510ea7=moment()['unix']()['toString']();var _0xcbb72b=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0xaf'),_0x170e('0xb0'),_0x170e('0xb1'));var _0x528260=path[_0x170e('0x75')](config[_0x170e('0x73')],_0x170e('0xaf'),_0x170e('0xb0'),_0x170e('0xb2'));var _0x2e3a23=path[_0x170e('0x75')](_0xcbb72b,_0x510ea7);var _0x5c7e7c=util[_0x170e('0x81')](_0x170e('0xb3'),_0xa7daad[_0x170e('0x3b')]['id'],_0x510ea7);var _0x15becc=path['join'](_0xcbb72b,_0x5c7e7c);var _0x48254b=[];_0x48254b[_0x170e('0xa6')]({'model':db[_0x170e('0x7e')],'as':'User','attributes':['id',_0x170e('0x52')],'raw':!![]});_0x48254b['push']({'model':db[_0x170e('0xb4')],'as':'Contact','attributes':['id',_0x170e('0xb5'),_0x170e('0xb6')],'raw':!![]});if(_0xa7daad[_0x170e('0x39')]['attachments']){_0x48254b[_0x170e('0xa6')]({'model':db[_0x170e('0x70')],'as':_0x170e('0x70'),'raw':!![]});}var _0x556a05=[{'model':db[_0x170e('0x5f')],'as':'Messages','attributes':['id',_0x170e('0x2c'),_0x170e('0x8b'),_0x170e('0x8c'),'secret','read'],'include':_0x48254b}];_0x556a05[_0x170e('0xa6')]({'model':db[_0x170e('0xb7')],'as':'Account','attributes':['id',_0x170e('0x29')]});_0x556a05[_0x170e('0xa6')]({'model':db['User'],'as':_0x170e('0xb8'),'attributes':['id',_0x170e('0x52')]});return db[_0x170e('0x3e')][_0x170e('0x48')]({'where':{'id':_0xa7daad[_0x170e('0x3b')]['id']},'include':_0x556a05})[_0x170e('0x14')](handleEntityNotFound(_0x28d0e7,null))[_0x170e('0x14')](function(_0x204445){if(_0x204445){var _0x536061=_0x204445[_0x170e('0xb9')]({'plain':!![]});fs[_0x170e('0xba')](_0x2e3a23);var _0x23bc71={'channel':_0x170e('0xbb'),'account':_0x536061[_0x170e('0xbc')][_0x170e('0x29')],'agent':_0x536061[_0x170e('0xb8')]?_0x536061[_0x170e('0xb8')]['fullname']:'N.A.','createdAt':moment(_0x536061[_0x170e('0x8b')])[_0x170e('0x81')]('YYYY-MM-DD\x20HH:mm:ss')[_0x170e('0xbd')](),'closedAt':_0x536061[_0x170e('0x68')]?moment(_0x536061[_0x170e('0xbe')])[_0x170e('0x81')](_0x170e('0xa1'))[_0x170e('0xbd')]():'','disposition':_0x536061['disposition'],'chatInfo':{'browser':_0x536061[_0x170e('0xbf')],'os':_0x536061[_0x170e('0xc0')],'referer':_0x536061[_0x170e('0xc1')],'customerIp':_0x536061['customerIp'],'customerPort':_0x536061[_0x170e('0xc2')]?_0x536061[_0x170e('0xc2')]:_0x170e('0xc3')},'messages':_(_0x536061[_0x170e('0x7d')])[_0x170e('0xc4')]()[_0x170e('0x9f')]({'secret':![]})[_0x170e('0x32')](function(_0x324c33){if(_0x324c33[_0x170e('0x70')]){var _0x7aca0=path[_0x170e('0x75')](_0x528260,_0x324c33[_0x170e('0x70')]['basename']);if(fs[_0x170e('0xc5')](_0x7aca0)){fs[_0x170e('0xc6')](_0x7aca0)[_0x170e('0xc7')](fs[_0x170e('0xc8')](path[_0x170e('0x75')](_0x2e3a23,_0x324c33[_0x170e('0x70')]['basename'])));}}return{'date':moment(_0x324c33[_0x170e('0x8b')])[_0x170e('0x81')](_0x170e('0xa1'))['toString'](),'sender':_0x324c33[_0x170e('0x8c')]===_0x170e('0x5e')?_0x324c33[_0x170e('0x7e')]?_0x324c33[_0x170e('0x7e')]['fullname']:_0x170e('0x88'):_0x324c33[_0x170e('0x63')]['firstName']+(_0x324c33['Contact'][_0x170e('0xb6')]?'\x20'+_0x324c33[_0x170e('0x63')][_0x170e('0xb6')]:''),'body':_0x324c33['Attachment']?_0x324c33[_0x170e('0x70')][_0x170e('0x6c')]:_0x324c33[_0x170e('0x2c')],'direction':_0x324c33[_0x170e('0x8c')]===_0x170e('0x5e')?'A':'C','secret':_0x324c33[_0x170e('0xa4')],'read':_0x324c33[_0x170e('0xc9')],'attachment':_0x324c33[_0x170e('0x70')]};})[_0x170e('0xca')]()};return ejs[_0x170e('0xcb')](path[_0x170e('0x75')](config['root'],_0x170e('0xaf'),_0x170e('0xcc'),'downloadInteraction.ejs'),{'interaction':_0x23bc71})['then'](function(_0x4eb17f){var _0x3f6497=path[_0x170e('0x75')](_0x2e3a23,_0x170e('0xcd')+_0x536061['id']+'-'+_0x510ea7+_0x170e('0xce'));var _0x1be69d={'path':_0x3f6497,'channel':'Chat','interactionId':_0x536061['id']};return pdf['createPdfFromHTML'](_0x4eb17f,_0x1be69d);})['then'](function(){return new Promise(function(_0x445359,_0x51ec03){zipdir(_0x2e3a23,{'saveTo':_0x15becc},function(_0x315b9f,_0x2b17ce){if(_0x315b9f)return _0x51ec03(_0x315b9f);return _0x445359(_0x2b17ce);});})[_0x170e('0x14')](function(){return new BPromise(function(_0x535edb,_0x36a053){rimraf(_0x2e3a23,function(_0x5bc016){if(_0x5bc016)_0x36a053(_0x5bc016);return _0x535edb();});});})[_0x170e('0x14')](function(){return _0x28d0e7[_0x170e('0x77')](_0x15becc,_0x5c7e7c,function(_0x1933f3){if(_0x1933f3){logger['error'](_0x170e('0xcf'),_0x1933f3);}else{fs[_0x170e('0xd0')](_0x15becc);}});});});}else{return _0x28d0e7['sendStatus'](0xc8);}})[_0x170e('0x1e')](handleError(_0x28d0e7,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 77d7837..5833d48 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 _0xe714=['getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove'];(function(_0x313112,_0x4af4a4){var _0x422beb=function(_0x545c94){while(--_0x545c94){_0x313112['push'](_0x313112['shift']());}};_0x422beb(++_0x4af4a4);}(_0xe714,0xad));var _0x4e71=function(_0x1f9426,_0x4d0b55){_0x1f9426=_0x1f9426-0x0;var _0xd40e25=_0xe714[_0x1f9426];return _0xd40e25;};'use strict';var EventEmitter=require(_0x4e71('0x0'));var ChatInteraction=require(_0x4e71('0x1'))['db'][_0x4e71('0x2')];var ChatMessage=require(_0x4e71('0x1'))['db'][_0x4e71('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4e71('0x4')](0x0);var events={'afterCreate':_0x4e71('0x5'),'afterUpdate':'update','afterDestroy':_0x4e71('0x6')};function emitEvent(_0x4f297f){return function(_0x47d817,_0x3b0084,_0x232a3e){_0x47d817[_0x4e71('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x37bf78){_0x47d817[_0x4e71('0x8')](_0x4e71('0x9'),_0x37bf78['map'](function(_0x734cc){return{'id':_0x734cc['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x47d817['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4e71('0xa')](function(_0x5c2c9a){_0x47d817['setDataValue'](_0x4e71('0xb'),_0x5c2c9a[_0x4e71('0xc')]);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f+':'+_0x47d817['id'],_0x47d817);ChatInteractionEvents[_0x4e71('0xd')](_0x4f297f,_0x47d817);_0x232a3e(null);})[_0x4e71('0xe')](_0x232a3e(null));};}for(var e in events){if(events[_0x4e71('0xf')](e)){var event=events[e];ChatInteraction[_0x4e71('0x10')](e,emitEvent(event));}}module[_0x4e71('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xb67d=['findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','then','setDataValue','map'];(function(_0x2f10e3,_0x5018fe){var _0x37264=function(_0x6e2ce1){while(--_0x6e2ce1){_0x2f10e3['push'](_0x2f10e3['shift']());}};_0x37264(++_0x5018fe);}(_0xb67d,0x116));var _0xdb67=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb67d[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xdb67('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xdb67('0x1')];var ChatMessage=require(_0xdb67('0x2'))['db'][_0xdb67('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdb67('0x4')](0x0);var events={'afterCreate':_0xdb67('0x5'),'afterUpdate':_0xdb67('0x6'),'afterDestroy':'remove'};function emitEvent(_0x293dcb){return function(_0x990fca,_0x1f085d,_0x292cca){_0x990fca['getUsers']({'attributes':['id'],'raw':!![]})[_0xdb67('0x7')](function(_0x10fb08){_0x990fca[_0xdb67('0x8')]('Users',_0x10fb08[_0xdb67('0x9')](function(_0x7b2620){return{'id':_0x7b2620['id']};}));return ChatMessage[_0xdb67('0xa')]({'where':{'ChatInteractionId':_0x990fca['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdb67('0x7')](function(_0x2ab672){_0x990fca['setDataValue'](_0xdb67('0xb'),_0x2ab672[_0xdb67('0xc')]);ChatInteractionEvents['emit'](_0x293dcb+':'+_0x990fca['id'],_0x990fca);ChatInteractionEvents[_0xdb67('0xd')](_0x293dcb,_0x990fca);_0x292cca(null);})['catch'](_0x292cca(null));};}for(var e in events){if(events[_0xdb67('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xdb67('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index d71efb7..e6b26a7 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 _0x3e2c=['path','rimraf','../../config/environment','./chatInteraction.attributes','exports','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird'];(function(_0x19c967,_0x4d538e){var _0x386e76=function(_0x5678e8){while(--_0x5678e8){_0x19c967['push'](_0x19c967['shift']());}};_0x386e76(++_0x4d538e);}(_0x3e2c,0x1b6));var _0xc3e2=function(_0x23b7e4,_0x1c9417){_0x23b7e4=_0x23b7e4-0x0;var _0x40d91b=_0x3e2c[_0x23b7e4];return _0x40d91b;};'use strict';var _=require(_0xc3e2('0x0'));var util=require(_0xc3e2('0x1'));var logger=require(_0xc3e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc3e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc3e2('0x4'));var rimraf=require(_0xc3e2('0x5'));var config=require(_0xc3e2('0x6'));var attributes=require(_0xc3e2('0x7'));module[_0xc3e2('0x8')]=function(_0xfffadc,_0x3e4644){return _0xfffadc['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a095a,_0x37bff2,_0x4f87bc){if(_0x1a095a['changed'](_0xc3e2('0x9'))){_0x1a095a[_0xc3e2('0xa')]=moment()[_0xc3e2('0xb')](_0xc3e2('0xc'));}_0x4f87bc(null,_0x1a095a);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xaefa=['closedAt','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','changed'];(function(_0x51c343,_0xf63b5){var _0x4d3855=function(_0x55721a){while(--_0x55721a){_0x51c343['push'](_0x51c343['shift']());}};_0x4d3855(++_0xf63b5);}(_0xaefa,0x64));var _0xaaef=function(_0x386c03,_0x32b041){_0x386c03=_0x386c03-0x0;var _0x4806fa=_0xaefa[_0x386c03];return _0x4806fa;};'use strict';var _=require('lodash');var util=require(_0xaaef('0x0'));var logger=require(_0xaaef('0x1'))('api');var moment=require(_0xaaef('0x2'));var BPromise=require(_0xaaef('0x3'));var rp=require(_0xaaef('0x4'));var fs=require('fs');var path=require(_0xaaef('0x5'));var rimraf=require('rimraf');var config=require(_0xaaef('0x6'));var attributes=require(_0xaaef('0x7'));module[_0xaaef('0x8')]=function(_0x54b113,_0x260933){return _0x54b113[_0xaaef('0x9')](_0xaaef('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x800f18,_0x1f0b5a,_0x29659){if(_0x800f18[_0xaaef('0xb')]('closed')){_0x800f18[_0xaaef('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x29659(null,_0x800f18);}},'charset':'utf8mb4','collate':_0xaaef('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 72fd8d1..040937b 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 _0x9f0e=['defaults','localhost','socket.io-emitter','./chatInteraction.socket','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','then','debug','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis'];(function(_0x38709e,_0x674239){var _0x5b4fa3=function(_0x132443){while(--_0x132443){_0x38709e['push'](_0x38709e['shift']());}};_0x5b4fa3(++_0x674239);}(_0x9f0e,0x115));var _0xe9f0=function(_0x2fce43,_0x1d9626){_0x2fce43=_0x2fce43-0x0;var _0x537102=_0x9f0e[_0x2fce43];return _0x537102;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9f0('0x0'));var BPromise=require(_0xe9f0('0x1'));var rs=require(_0xe9f0('0x2'));var fs=require('fs');var Redis=require(_0xe9f0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9f0('0x4'));var logger=require('../../config/logger')(_0xe9f0('0x5'));var config=require('../../config/environment');var jayson=require(_0xe9f0('0x6'));var client=jayson[_0xe9f0('0x7')][_0xe9f0('0x8')]({'port':0x232a});config[_0xe9f0('0x9')]=_[_0xe9f0('0xa')](config[_0xe9f0('0x9')],{'host':_0xe9f0('0xb'),'port':0x18eb});var socket=require(_0xe9f0('0xc'))(new Redis(config['redis']));require(_0xe9f0('0xd'))['register'](socket);function respondWithRpcPromise(_0x242147,_0x5ce997,_0x2c688d){return new BPromise(function(_0x25533b,_0x2cbd7d){return client['request'](_0x242147,_0x2c688d)['then'](function(_0x2f9d7b){logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,_0xe9f0('0x10'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5ce997,'request\x20sent',JSON['stringify'](_0x2f9d7b));if(_0x2f9d7b[_0xe9f0('0x11')]){if(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x12')]===0x1f4){logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x2cbd7d(_0x2f9d7b[_0xe9f0('0x11')]['message']);}logger['error'](_0xe9f0('0xf'),_0x5ce997,_0x2f9d7b['error'][_0xe9f0('0x13')]);return _0x25533b(_0x2f9d7b[_0xe9f0('0x11')][_0xe9f0('0x13')]);}else{logger[_0xe9f0('0xe')](_0xe9f0('0xf'),_0x5ce997,'request\x20sent');_0x25533b(_0x2f9d7b[_0xe9f0('0x14')][_0xe9f0('0x13')]);}})[_0xe9f0('0x15')](function(_0x43e3a8){logger[_0xe9f0('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x5ce997,_0x43e3a8);_0x2cbd7d(_0x43e3a8);});});}exports[_0xe9f0('0x16')]=function(_0xd7ecd0){var _0x4708d8=this;return new Promise(function(_0xa1df12,_0x347b0a){return db[_0xe9f0('0x17')][_0xe9f0('0x18')](_0xd7ecd0[_0xe9f0('0x19')],{'raw':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null,'attributes':_0xd7ecd0[_0xe9f0('0x1a')]?_0xd7ecd0['options'][_0xe9f0('0x1d')]||null:null,'limit':_0xd7ecd0['options']?_0xd7ecd0['options'][_0xe9f0('0x1e')]||null:null})[_0xe9f0('0x1f')](function(_0x369677){logger[_0xe9f0('0xe')](_0xe9f0('0x16'),_0xd7ecd0);logger[_0xe9f0('0x20')]('UpdateChatInteraction',_0xd7ecd0,JSON[_0xe9f0('0x21')](_0x369677));_0xa1df12(_0x369677);})[_0xe9f0('0x15')](function(_0x26e661){logger[_0xe9f0('0x11')](_0xe9f0('0x16'),_0x26e661['message'],_0xd7ecd0);_0x347b0a(_0x4708d8['error'](0x1f4,_0x26e661[_0xe9f0('0x13')]));});});};exports[_0xe9f0('0x22')]=function(_0x17f797){return new Promise(function(_0x8ac026,_0x505f93){return db[_0xe9f0('0x17')][_0xe9f0('0x23')]({'where':_0x17f797[_0xe9f0('0x1a')]?_0x17f797[_0xe9f0('0x1a')][_0xe9f0('0x1c')]||null:null})[_0xe9f0('0x1f')](function(_0x3014fa){if(_0x3014fa){return _0x3014fa[_0xe9f0('0x24')](_0x17f797[_0xe9f0('0x19')][_0xe9f0('0x25')],_[_0xe9f0('0x26')](_0x17f797[_0xe9f0('0x19')],[_0xe9f0('0x25'),'id'])||{});}})[_0xe9f0('0x27')](function(_0x5c9772){logger[_0xe9f0('0xe')](_0xe9f0('0x28'),_0x17f797);logger[_0xe9f0('0x20')](_0xe9f0('0x28'),_0x17f797,JSON['stringify'](_0x5c9772));_0x8ac026(_0x5c9772);})[_0xe9f0('0x15')](function(_0x582148){logger[_0xe9f0('0x11')](_0xe9f0('0x28'),_0x582148[_0xe9f0('0x13')],_0x17f797);_0x505f93(_this[_0xe9f0('0x11')](0x1f4,_0x582148['message']));});});};
\ No newline at end of file
+var _0x2000=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','ChatInteraction','update','raw','options','attributes','limit','info','UpdateChatInteraction','stringify','catch','AddTagsToChatInteraction','where','addTags','body','ids','omit','AddTags','lodash'];(function(_0x53e4ab,_0x22e0cb){var _0x21bb4f=function(_0x107787){while(--_0x107787){_0x53e4ab['push'](_0x53e4ab['shift']());}};_0x21bb4f(++_0x22e0cb);}(_0x2000,0x13f));var _0x0200=function(_0x1d3791,_0x51c613){_0x1d3791=_0x1d3791-0x0;var _0x40fbf5=_0x2000[_0x1d3791];return _0x40fbf5;};'use strict';var _=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var moment=require('moment');var BPromise=require(_0x0200('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0200('0x3'));var db=require(_0x0200('0x4'))['db'];var utils=require(_0x0200('0x5'));var logger=require(_0x0200('0x6'))(_0x0200('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0200('0x8')][_0x0200('0x9')]({'port':0x232a});config[_0x0200('0xa')]=_['defaults'](config[_0x0200('0xa')],{'host':_0x0200('0xb'),'port':0x18eb});var socket=require(_0x0200('0xc'))(new Redis(config[_0x0200('0xa')]));require('./chatInteraction.socket')[_0x0200('0xd')](socket);function respondWithRpcPromise(_0x22b43a,_0x4071df,_0x10a728){return new BPromise(function(_0x264556,_0x42c5e0){return client[_0x0200('0xe')](_0x22b43a,_0x10a728)[_0x0200('0xf')](function(_0x37b067){logger['info'](_0x0200('0x10'),_0x4071df,'request\x20sent');logger[_0x0200('0x11')](_0x0200('0x12'),_0x4071df,_0x0200('0x13'),JSON['stringify'](_0x37b067));if(_0x37b067[_0x0200('0x14')]){if(_0x37b067[_0x0200('0x14')]['code']===0x1f4){logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x37b067[_0x0200('0x14')]['message']);return _0x42c5e0(_0x37b067[_0x0200('0x14')]['message']);}logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x37b067[_0x0200('0x14')]['message']);return _0x264556(_0x37b067[_0x0200('0x14')][_0x0200('0x15')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x4071df,_0x0200('0x13'));_0x264556(_0x37b067[_0x0200('0x16')][_0x0200('0x15')]);}})['catch'](function(_0x5d2850){logger[_0x0200('0x14')](_0x0200('0x10'),_0x4071df,_0x5d2850);_0x42c5e0(_0x5d2850);});});}exports['UpdateChatInteraction']=function(_0x21c8ed){var _0x1aadd4=this;return new Promise(function(_0x302c4f,_0x149929){return db[_0x0200('0x17')][_0x0200('0x18')](_0x21c8ed['body'],{'raw':_0x21c8ed['options']?_0x21c8ed['options'][_0x0200('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed['options']['where']||null:null,'attributes':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed[_0x0200('0x1a')][_0x0200('0x1b')]||null:null,'limit':_0x21c8ed[_0x0200('0x1a')]?_0x21c8ed['options'][_0x0200('0x1c')]||null:null})[_0x0200('0xf')](function(_0x5df627){logger[_0x0200('0x1d')]('UpdateChatInteraction',_0x21c8ed);logger[_0x0200('0x11')](_0x0200('0x1e'),_0x21c8ed,JSON[_0x0200('0x1f')](_0x5df627));_0x302c4f(_0x5df627);})[_0x0200('0x20')](function(_0x2ea1d4){logger[_0x0200('0x14')](_0x0200('0x1e'),_0x2ea1d4[_0x0200('0x15')],_0x21c8ed);_0x149929(_0x1aadd4[_0x0200('0x14')](0x1f4,_0x2ea1d4[_0x0200('0x15')]));});});};exports[_0x0200('0x21')]=function(_0x52d7c5){return new Promise(function(_0x1bbc61,_0x40cbbc){return db['ChatInteraction']['find']({'where':_0x52d7c5[_0x0200('0x1a')]?_0x52d7c5[_0x0200('0x1a')][_0x0200('0x22')]||null:null})[_0x0200('0xf')](function(_0x1b676f){if(_0x1b676f){return _0x1b676f[_0x0200('0x23')](_0x52d7c5[_0x0200('0x24')][_0x0200('0x25')],_[_0x0200('0x26')](_0x52d7c5[_0x0200('0x24')],[_0x0200('0x25'),'id'])||{});}})['spread'](function(_0x219c0e){logger['info'](_0x0200('0x27'),_0x52d7c5);logger[_0x0200('0x11')](_0x0200('0x27'),_0x52d7c5,JSON[_0x0200('0x1f')](_0x219c0e));_0x1bbc61(_0x219c0e);})[_0x0200('0x20')](function(_0x1318b8){logger[_0x0200('0x14')](_0x0200('0x27'),_0x1318b8[_0x0200('0x15')],_0x52d7c5);_0x40cbbc(_this[_0x0200('0x14')](0x1f4,_0x1318b8[_0x0200('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 2711d69..63d2b79 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 _0x6332=['remove','emit','removeListener','register','length','chatInteraction:','save'];(function(_0x184ae4,_0x511d97){var _0x5bb118=function(_0x2af1c3){while(--_0x2af1c3){_0x184ae4['push'](_0x184ae4['shift']());}};_0x5bb118(++_0x511d97);}(_0x6332,0x133));var _0x2633=function(_0x88d014,_0x3daebb){_0x88d014=_0x88d014-0x0;var _0x373690=_0x6332[_0x88d014];return _0x373690;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x2633('0x0'),_0x2633('0x1'),'update'];function createListener(_0x1e1e15,_0x5b3fca){return function(_0x34a09c){_0x5b3fca[_0x2633('0x2')](_0x1e1e15,_0x34a09c);};}function removeListener(_0x1fe5c2,_0x5174b7){return function(){ChatInteractionEvents[_0x2633('0x3')](_0x1fe5c2,_0x5174b7);};}exports[_0x2633('0x4')]=function(_0x45a63a){for(var _0x58f938=0x0,_0x25f01f=events[_0x2633('0x5')];_0x58f938<_0x25f01f;_0x58f938++){var _0x59d641=events[_0x58f938];var _0x522213=createListener(_0x2633('0x6')+_0x59d641,_0x45a63a);ChatInteractionEvents['on'](_0x59d641,_0x522213);}};
\ No newline at end of file
+var _0x28bc=['emit','removeListener','register','length','chatInteraction:','remove'];(function(_0x6bd2c1,_0x1ff03d){var _0x4f7c03=function(_0x3238d4){while(--_0x3238d4){_0x6bd2c1['push'](_0x6bd2c1['shift']());}};_0x4f7c03(++_0x1ff03d);}(_0x28bc,0xf5));var _0xc28b=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x28bc[_0x35a274];return _0x40d905;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xc28b('0x0'),'update'];function createListener(_0x2bf447,_0x39a141){return function(_0x57b981){_0x39a141[_0xc28b('0x1')](_0x2bf447,_0x57b981);};}function removeListener(_0x38b1eb,_0x491178){return function(){ChatInteractionEvents[_0xc28b('0x2')](_0x38b1eb,_0x491178);};}exports[_0xc28b('0x3')]=function(_0x1e2848){for(var _0x5c1be7=0x0,_0x4cdf9c=events[_0xc28b('0x4')];_0x5c1be7<_0x4cdf9c;_0x5c1be7++){var _0x2266d2=events[_0x5c1be7];var _0x20b169=createListener(_0xc28b('0x5')+_0x2266d2,_0x1e2848);ChatInteractionEvents['on'](_0x2266d2,_0x20b169);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 8152993..226bf0a 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 _0x8ce6=['/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','tracked','destroy','removeTags','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ce6,0xa0));var _0x68ce=function(_0x51bebf,_0x22aa21){_0x51bebf=_0x51bebf-0x0;var _0x95197d=_0x8ce6[_0x51bebf];return _0x95197d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x68ce('0x0'));var timeout=require(_0x68ce('0x1'));var express=require('express');var router=express[_0x68ce('0x2')]();var fs_extra=require(_0x68ce('0x3'));var auth=require(_0x68ce('0x4'));var interaction=require(_0x68ce('0x5'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x68ce('0x6')](),controller['index']);router['get'](_0x68ce('0x7'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x8')]);router[_0x68ce('0x9')](_0x68ce('0xa'),auth[_0x68ce('0xb')](),controller['show']);router['get'](_0x68ce('0xc'),auth[_0x68ce('0xb')](),controller[_0x68ce('0xd')]);router['get'](_0x68ce('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x68ce('0xf'),auth[_0x68ce('0xb')](),controller['getMyMessages']);router[_0x68ce('0x9')](_0x68ce('0x10'),auth[_0x68ce('0x6')](),controller['download']);router[_0x68ce('0x11')]('/',auth[_0x68ce('0x6')](),controller['create']);router[_0x68ce('0x11')](_0x68ce('0x12'),auth['isAuthenticated'](),controller[_0x68ce('0x13')]);var upload=multer({'storage':multer[_0x68ce('0x14')]({'destination':function(_0x44f36f,_0x4564f5,_0x38b1cf){_0x38b1cf(null,path[_0x68ce('0x15')](config[_0x68ce('0x16')],_0x68ce('0x17')));},'filename':function(_0x3852a9,_0x19b9e5,_0x3c589e){_0x3c589e(null,util[_0x68ce('0x18')](_0x68ce('0x19'),Date[_0x68ce('0x1a')](),_0x19b9e5[_0x68ce('0x1b')][_0x68ce('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x68ce('0x11')]('/:id/attachment_upload',upload[_0x68ce('0x1d')](_0x68ce('0x1e')),controller[_0x68ce('0x1f')]);router[_0x68ce('0x11')]('/:id/messages',auth[_0x68ce('0xb')](),controller[_0x68ce('0x20')]);router[_0x68ce('0x11')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),interaction['tracked'](_0x68ce('0x22'),_0x68ce('0x23')),controller[_0x68ce('0x24')]);router[_0x68ce('0x25')](_0x68ce('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x68ce('0x26')),controller[_0x68ce('0x27')]);router['put'](_0x68ce('0x28'),controller[_0x68ce('0x29')]);router['put'](_0x68ce('0x2a'),auth[_0x68ce('0xb')](),controller[_0x68ce('0x2b')]);router[_0x68ce('0x25')](_0x68ce('0x2c'),controller['close']);router[_0x68ce('0x2d')](_0x68ce('0xa'),auth[_0x68ce('0x6')](),interaction[_0x68ce('0x2e')](_0x68ce('0x22'),'chatinteraction:destroy'),controller[_0x68ce('0x2f')]);router[_0x68ce('0x2d')](_0x68ce('0x21'),auth[_0x68ce('0x6')](),controller[_0x68ce('0x30')]);module[_0x68ce('0x31')]=router;
\ No newline at end of file
+var _0x15b4=['/:id/attachment_upload','file','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','/:id/tags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','post','create','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace'];(function(_0x4d9acc,_0x5c8738){var _0x5e0d3a=function(_0x5ce4c1){while(--_0x5ce4c1){_0x4d9acc['push'](_0x4d9acc['shift']());}};_0x5e0d3a(++_0x5c8738);}(_0x15b4,0x74));var _0x415b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x15b4[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x415b('0x0'));var util=require(_0x415b('0x1'));var path=require(_0x415b('0x2'));var timeout=require(_0x415b('0x3'));var express=require(_0x415b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x415b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x415b('0x6'));router[_0x415b('0x7')]('/',auth[_0x415b('0x8')](),controller[_0x415b('0x9')]);router[_0x415b('0x7')](_0x415b('0xa'),auth[_0x415b('0x8')](),controller[_0x415b('0xb')]);router['get'](_0x415b('0xc'),auth[_0x415b('0xd')](),controller[_0x415b('0xe')]);router[_0x415b('0x7')](_0x415b('0xf'),auth[_0x415b('0xd')](),controller[_0x415b('0x10')]);router['get']('/:id/messages',auth[_0x415b('0x8')](),controller[_0x415b('0x11')]);router[_0x415b('0x7')](_0x415b('0x12'),auth[_0x415b('0xd')](),controller['getMyMessages']);router['get'](_0x415b('0x13'),auth[_0x415b('0x8')](),controller[_0x415b('0x14')]);router[_0x415b('0x15')]('/',auth['isAuthenticated'](),controller[_0x415b('0x16')]);router[_0x415b('0x15')]('/:id/vidaoo',auth[_0x415b('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x235b51,_0x19bb43,_0xcda6b3){_0xcda6b3(null,path[_0x415b('0x17')](config[_0x415b('0x18')],_0x415b('0x19')));},'filename':function(_0x5776aa,_0x585e9e,_0x34a243){_0x34a243(null,util[_0x415b('0x1a')](_0x415b('0x1b'),Date[_0x415b('0x1c')](),_0x585e9e[_0x415b('0x1d')][_0x415b('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x415b('0x15')](_0x415b('0x1f'),upload['single'](_0x415b('0x20')),controller['attachmentUpload']);router[_0x415b('0x15')]('/:id/messages',auth[_0x415b('0xd')](),controller['addMessage']);router[_0x415b('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x415b('0x21')](_0x415b('0x22'),'chatinteraction:addtags'),controller[_0x415b('0x23')]);router[_0x415b('0x24')](_0x415b('0xc'),auth[_0x415b('0x8')](),interaction[_0x415b('0x21')]('chat',_0x415b('0x25')),controller[_0x415b('0x26')]);router[_0x415b('0x24')](_0x415b('0x27'),controller[_0x415b('0x28')]);router['put'](_0x415b('0x29'),auth[_0x415b('0xd')](),controller[_0x415b('0x2a')]);router[_0x415b('0x24')](_0x415b('0x2b'),controller['close']);router[_0x415b('0x2c')](_0x415b('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0x415b('0x22'),_0x415b('0x2d')),controller[_0x415b('0x2e')]);router[_0x415b('0x2c')](_0x415b('0x2f'),auth['isAuthenticated'](),controller['removeTags']);module[_0x415b('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 56f33ec..878c200 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 _0x07a2=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x07a2,0x13d));var _0x207a=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x07a2[_0x1e7ead];return _0x3912b2;};'use strict';var Sequelize=require('sequelize');module[_0x207a('0x0')]={'body':{'type':Sequelize[_0x207a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x207a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x207a('0x3')]}};
\ No newline at end of file
+var _0x9ac5=['INTEGER','sequelize','exports','BOOLEAN'];(function(_0x8a0aed,_0x9370b5){var _0x3723fa=function(_0x25a50f){while(--_0x25a50f){_0x8a0aed['push'](_0x8a0aed['shift']());}};_0x3723fa(++_0x9370b5);}(_0x9ac5,0x141));var _0x59ac=function(_0x27eea1,_0x144cea){_0x27eea1=_0x27eea1-0x0;var _0x3e4f5b=_0x9ac5[_0x27eea1];return _0x3e4f5b;};'use strict';var Sequelize=require(_0x59ac('0x0'));module[_0x59ac('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x59ac('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x59ac('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 3b78a9e..c89704c 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 _0x1f50=['intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','create','body','params','describe','createdAt','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','findAll','admin','user','fullname','role','userpic','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','messages','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes'];(function(_0x254974,_0x2c8a95){var _0x3e95f9=function(_0x128bef){while(--_0x128bef){_0x254974['push'](_0x254974['shift']());}};_0x3e95f9(++_0x2c8a95);}(_0x1f50,0x104));var _0x01f5=function(_0x5695a0,_0x3963d2){_0x5695a0=_0x5695a0-0x0;var _0x83dbf7=_0x1f50[_0x5695a0];return _0x83dbf7;};'use strict';var emlformat=require(_0x01f5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01f5('0x1'));var jsonpatch=require(_0x01f5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01f5('0x3'));var path=require(_0x01f5('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x01f5('0x5'));var fs=require('fs');var fs_extra=require(_0x01f5('0x6'));var _=require(_0x01f5('0x7'));var squel=require(_0x01f5('0x8'));var crypto=require(_0x01f5('0x9'));var jsforce=require(_0x01f5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x01f5('0xb'));var querystring=require(_0x01f5('0xc'));var Papa=require(_0x01f5('0xd'));var Redis=require(_0x01f5('0xe'));var authService=require(_0x01f5('0xf'));var qs=require(_0x01f5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f5('0x11'))(_0x01f5('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x01f5('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x01f5('0x14')](config['redis'],{'host':_0x01f5('0x15'),'port':0x18eb});var socket=require(_0x01f5('0x16'))(new Redis(config[_0x01f5('0x17')]));require('./chatInternalMessage.socket')[_0x01f5('0x18')](socket);function respondWithStatusCode(_0x1e3f1c,_0x4ecfff){_0x4ecfff=_0x4ecfff||0xcc;return function(_0x3ea4bd){if(_0x3ea4bd){return _0x1e3f1c[_0x01f5('0x19')](_0x4ecfff);}return _0x1e3f1c[_0x01f5('0x1a')](_0x4ecfff)[_0x01f5('0x1b')]();};}function respondWithResult(_0x38d41d,_0x190fda){_0x190fda=_0x190fda||0xc8;return function(_0x902895){if(_0x902895){return _0x38d41d[_0x01f5('0x1a')](_0x190fda)[_0x01f5('0x1c')](_0x902895);}};}function respondWithFilteredResult(_0x2a0be0,_0xa2abf9){return function(_0x125851){if(_0x125851){var _0x38c1b9=typeof _0xa2abf9[_0x01f5('0x1d')]===_0x01f5('0x1e')&&typeof _0xa2abf9[_0x01f5('0x1f')]===_0x01f5('0x1e');var _0x198eca=_0x125851[_0x01f5('0x20')];var _0x4de33e=_0x38c1b9?0x0:_0xa2abf9[_0x01f5('0x1d')];var _0x4dd194=_0x38c1b9?_0x125851[_0x01f5('0x20')]:_0xa2abf9['offset']+_0xa2abf9[_0x01f5('0x1f')];var _0x1eb156;if(_0x4dd194>=_0x198eca){_0x4dd194=_0x198eca;_0x1eb156=0xc8;}else{_0x1eb156=0xce;}_0x2a0be0[_0x01f5('0x1a')](_0x1eb156);return _0x2a0be0['set']('Content-Range',_0x4de33e+'-'+_0x4dd194+'/'+_0x198eca)[_0x01f5('0x1c')](_0x125851);}return null;};}function patchUpdates(_0x380a4c){return function(_0x10a040){try{jsonpatch['apply'](_0x10a040,_0x380a4c,!![]);}catch(_0x6f446b){return BPromise[_0x01f5('0x21')](_0x6f446b);}return _0x10a040[_0x01f5('0x22')]();};}function saveUpdates(_0x31478d,_0x5386c1){return function(_0x47e82b){if(_0x47e82b){return _0x47e82b[_0x01f5('0x23')](_0x31478d)[_0x01f5('0x24')](function(_0x3e904a){return _0x3e904a;});}return null;};}function removeEntity(_0x5ad70a,_0x45d595){return function(_0x22176e){if(_0x22176e){return _0x22176e[_0x01f5('0x25')]()[_0x01f5('0x24')](function(){_0x5ad70a[_0x01f5('0x1a')](0xcc)[_0x01f5('0x1b')]();});}};}function handleEntityNotFound(_0x323763,_0x3336bf){return function(_0x5b7f47){if(!_0x5b7f47){_0x323763[_0x01f5('0x19')](0x194);}return _0x5b7f47;};}function handleError(_0xd0d190,_0x5df797){_0x5df797=_0x5df797||0x1f4;return function(_0x2d3a87){logger[_0x01f5('0x26')](_0x2d3a87[_0x01f5('0x27')]);if(_0x2d3a87[_0x01f5('0x28')]){delete _0x2d3a87['name'];}_0xd0d190[_0x01f5('0x1a')](_0x5df797)['send'](_0x2d3a87);};}exports[_0x01f5('0x29')]=function(_0x54fbc3,_0x284f93){var _0x1970e9={},_0x4ff97b={},_0x204c6f={'count':0x0,'rows':[]};var _0x3fd842=_[_0x01f5('0x2a')](db[_0x01f5('0x2b')][_0x01f5('0x2c')],function(_0x1916bf){return{'name':_0x1916bf[_0x01f5('0x2d')],'type':_0x1916bf[_0x01f5('0x2e')][_0x01f5('0x2f')]};});_0x4ff97b[_0x01f5('0x30')]=_['map'](_0x3fd842,_0x01f5('0x28'));_0x4ff97b['query']=_['keys'](_0x54fbc3[_0x01f5('0x31')]);_0x4ff97b[_0x01f5('0x32')]=_['intersection'](_0x4ff97b[_0x01f5('0x30')],_0x4ff97b['query']);_0x1970e9[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x4ff97b[_0x01f5('0x30')],qs[_0x01f5('0x35')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x35')]));_0x1970e9[_0x01f5('0x33')]=_0x1970e9['attributes'][_0x01f5('0x36')]?_0x1970e9[_0x01f5('0x33')]:_0x4ff97b[_0x01f5('0x30')];if(!_0x54fbc3['query'][_0x01f5('0x37')]('nolimit')){_0x1970e9[_0x01f5('0x1f')]=qs[_0x01f5('0x1f')](_0x54fbc3[_0x01f5('0x31')]['limit']);_0x1970e9['offset']=qs[_0x01f5('0x1d')](_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x1d')]);}_0x1970e9[_0x01f5('0x38')]=qs[_0x01f5('0x39')](_0x54fbc3['query'][_0x01f5('0x39')]);_0x1970e9['where']=qs[_0x01f5('0x32')](_[_0x01f5('0x3a')](_0x54fbc3[_0x01f5('0x31')],_0x4ff97b[_0x01f5('0x32')]),_0x3fd842);if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]){_0x1970e9['where']=_[_0x01f5('0x3c')](_0x1970e9[_0x01f5('0x3d')],{'$or':_[_0x01f5('0x2a')](_0x3fd842,function(_0x323e94){if(_0x323e94[_0x01f5('0x2e')]!==_0x01f5('0x3e')){var _0x51405c={};_0x51405c[_0x323e94[_0x01f5('0x28')]]={'$like':'%'+_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3b')]+'%'};return _0x51405c;}})});}_0x1970e9=_[_0x01f5('0x3c')]({},_0x1970e9,_0x54fbc3['options']);var _0x30f79={'where':_0x1970e9[_0x01f5('0x3d')]};return db[_0x01f5('0x2b')]['count'](_0x30f79)[_0x01f5('0x24')](function(_0xb04d96){_0x204c6f['count']=_0xb04d96;if(_0x54fbc3[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x1970e9[_0x01f5('0x40')]=[{'all':!![]}];}return db[_0x01f5('0x2b')]['findAll'](_0x1970e9);})['then'](function(_0x482850){_0x204c6f[_0x01f5('0x41')]=_0x482850;return _0x204c6f;})[_0x01f5('0x24')](respondWithFilteredResult(_0x284f93,_0x1970e9))[_0x01f5('0x42')](handleError(_0x284f93,null));};exports[_0x01f5('0x43')]=function(_0xc986f1,_0x3de016){var _0x3182d0={'raw':!![],'where':{'id':_0xc986f1['params']['id']}},_0x23109f={};_0x23109f[_0x01f5('0x30')]=_[_0x01f5('0x44')](db[_0x01f5('0x2b')][_0x01f5('0x2c')]);_0x23109f[_0x01f5('0x31')]=_[_0x01f5('0x44')](_0xc986f1['query']);_0x23109f['filters']=_[_0x01f5('0x34')](_0x23109f[_0x01f5('0x30')],_0x23109f['query']);_0x3182d0[_0x01f5('0x33')]=_[_0x01f5('0x34')](_0x23109f['model'],qs[_0x01f5('0x35')](_0xc986f1[_0x01f5('0x31')][_0x01f5('0x35')]));_0x3182d0['attributes']=_0x3182d0[_0x01f5('0x33')]['length']?_0x3182d0[_0x01f5('0x33')]:_0x23109f['model'];if(_0xc986f1[_0x01f5('0x31')][_0x01f5('0x3f')]){_0x3182d0['include']=[{'all':!![]}];}_0x3182d0=_[_0x01f5('0x3c')]({},_0x3182d0,_0xc986f1[_0x01f5('0x45')]);return db[_0x01f5('0x2b')][_0x01f5('0x46')](_0x3182d0)['then'](handleEntityNotFound(_0x3de016,null))[_0x01f5('0x24')](respondWithResult(_0x3de016,null))[_0x01f5('0x42')](handleError(_0x3de016,null));};exports[_0x01f5('0x47')]=function(_0x11f81a,_0xc63c91){return db[_0x01f5('0x2b')][_0x01f5('0x47')](_0x11f81a[_0x01f5('0x48')],{})[_0x01f5('0x24')](respondWithResult(_0xc63c91,0xc9))[_0x01f5('0x42')](handleError(_0xc63c91,null));};exports['update']=function(_0xa90d74,_0x303cf1){if(_0xa90d74['body']['id']){delete _0xa90d74[_0x01f5('0x48')]['id'];}return db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'id':_0xa90d74[_0x01f5('0x49')]['id']}})['then'](handleEntityNotFound(_0x303cf1,null))[_0x01f5('0x24')](saveUpdates(_0xa90d74[_0x01f5('0x48')],null))['then'](respondWithResult(_0x303cf1,null))[_0x01f5('0x42')](handleError(_0x303cf1,null));};exports[_0x01f5('0x25')]=function(_0x20509a,_0x4c38af){return db[_0x01f5('0x2b')]['find']({'where':{'id':_0x20509a['params']['id']}})['then'](handleEntityNotFound(_0x4c38af,null))[_0x01f5('0x24')](removeEntity(_0x4c38af,null))[_0x01f5('0x42')](handleError(_0x4c38af,null));};exports['describe']=function(_0x29fd7d,_0x4f2a7f){return db[_0x01f5('0x2b')][_0x01f5('0x4a')]()[_0x01f5('0x24')](respondWithResult(_0x4f2a7f,null))[_0x01f5('0x42')](handleError(_0x4f2a7f,null));};function wrapUser(_0x2b288a){return function(_0x10261f){var _0x56dd0d=_0x2b288a['get']({'plain':!![]});_0x56dd0d['messages']=[];if(_0x10261f){_0x56dd0d['lastMessageAt']=_0x10261f[_0x01f5('0x4b')];_0x56dd0d['lastMessage']=_0x10261f;}else{_0x56dd0d[_0x01f5('0x4c')]=moment(0x0)['format'](_0x01f5('0x4d'));_0x56dd0d['lastMessage']={};}return _0x56dd0d;};}exports[_0x01f5('0x4e')]=function(_0x228537,_0x2e5dbb,_0xe964da){var _0xfc4e96=[];return db['User'][_0x01f5('0x4f')]({'where':{'role':['agent',_0x01f5('0x50'),_0x01f5('0x51')]},'attributes':['id',_0x01f5('0x52'),_0x01f5('0x28'),_0x01f5('0x53'),_0x01f5('0x54'),_0x01f5('0x55'),'online',_0x01f5('0x56'),'allowmessenger',_0x01f5('0x57')],'order':qs[_0x01f5('0x39')](_0x01f5('0x58')),'include':[{'model':db[_0x01f5('0x59')],'as':_0x01f5('0x5a'),'attributes':['id',_0x01f5('0x28'),'type'],'through':{'attributes':[]}}]})[_0x01f5('0x24')](function(_0x1e0940){if(_0x1e0940){var _0x1df495=_0x228537[_0x01f5('0x51')]['get']({'plain':!![]});if(!_0x1df495)throw new Error(_0x01f5('0x5b'));if(_0x1df495[_0x01f5('0x53')]===_0x01f5('0x51')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x1df495[_0x01f5('0x5c')]},'raw':!![]})[_0x01f5('0x24')](function(_0x5909ab){if(_0x5909ab){if(_0x5909ab[_0x01f5('0x5d')]===0x0){return db[_0x01f5('0x5e')]['findAll']({'where':{'sectionId':_0x5909ab['id']},'raw':!![]})[_0x01f5('0x24')](function(_0x38db76){var _0x1ccb05=[];if(_[_0x01f5('0x5f')](_0x38db76)){_0x1ccb05=_[_0x01f5('0x3b')](_0x1e0940,function(_0x34bed0){if(_0x34bed0[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x34bed0;}});return _0x1ccb05;}else{for(var _0x445ae7=0x0;_0x445ae7<_0x1e0940[_0x01f5('0x36')];_0x445ae7++){var _0x1eabaa=_0x1e0940[_0x445ae7];if(_0x1eabaa['role']===_0x01f5('0x60')){var _0x4b8610=_[_0x01f5('0x46')](_0x38db76,function(_0x509d65){return _0x509d65[_0x01f5('0x61')]===_0x1eabaa['id'];});if(_0x4b8610)_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}else{_0x1ccb05[_0x01f5('0x62')](_0x1eabaa);}}return _0x1ccb05;}});}else{return _0x1e0940;}}else{var _0x45cfe6=_[_0x01f5('0x3b')](_0x1e0940,function(_0x1073cc){if(_0x1073cc[_0x01f5('0x53')]!==_0x01f5('0x60')){return _0x1073cc;}});return _0x45cfe6;}});}else{return _0x1e0940;}}})[_0x01f5('0x24')](function(_0x268101){var _0x38473d=[];if(_0x268101){_0xfc4e96=_0x268101;for(var _0x2417af=0x0;_0x2417af<_0x268101[_0x01f5('0x36')];_0x2417af+=0x1){_0xfc4e96[_0x2417af][_0x01f5('0x63')]=[];_0x38473d[_0x01f5('0x62')](db[_0x01f5('0x2b')][_0x01f5('0x46')]({'where':{'FromId':[_0x228537[_0x01f5('0x51')]['id'],_0x268101[_0x2417af]['id']],'ToId':[_0x228537['user']['id'],_0x268101[_0x2417af]['id']],'ChatGroupId':null},'attributes':['id',_0x01f5('0x4b'),_0x01f5('0x64'),_0x01f5('0x65'),_0x01f5('0x66'),_0x01f5('0x48')],'order':qs[_0x01f5('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x268101[_0x2417af])));}return BPromise[_0x01f5('0x67')](_0x38473d);}return[];})['then'](function(_0xd4e087){return{'rows':_0xd4e087,'count':_0xd4e087['length']};})[_0x01f5('0x24')](respondWithResult(_0x2e5dbb,null))[_0x01f5('0x42')](handleError(_0x2e5dbb,null));};
\ No newline at end of file
+var _0x8dd0=['attributes','fields','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','length','include','create','body','find','params','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','messages','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','ChatInternalMessage','fieldName','type','key','model','map','query','keys','intersection'];(function(_0x2aa9da,_0x33c82d){var _0x5d2c88=function(_0x127a78){while(--_0x127a78){_0x2aa9da['push'](_0x2aa9da['shift']());}};_0x5d2c88(++_0x33c82d);}(_0x8dd0,0x112));var _0x08dd=function(_0x4ca280,_0x1a1c4b){_0x4ca280=_0x4ca280-0x0;var _0x4bff7a=_0x8dd0[_0x4ca280];return _0x4bff7a;};'use strict';var emlformat=require(_0x08dd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x08dd('0x1'));var jsonpatch=require(_0x08dd('0x2'));var rp=require(_0x08dd('0x3'));var moment=require(_0x08dd('0x4'));var BPromise=require(_0x08dd('0x5'));var Mustache=require(_0x08dd('0x6'));var util=require(_0x08dd('0x7'));var path=require(_0x08dd('0x8'));var sox=require(_0x08dd('0x9'));var csv=require(_0x08dd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08dd('0xb'));var _=require(_0x08dd('0xc'));var squel=require(_0x08dd('0xd'));var crypto=require(_0x08dd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x08dd('0xa'));var querystring=require(_0x08dd('0xf'));var Papa=require(_0x08dd('0x10'));var Redis=require(_0x08dd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x08dd('0x12'));var as=require(_0x08dd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x08dd('0x14'));var utils=require(_0x08dd('0x15'));var config=require(_0x08dd('0x16'));var licenseUtil=require(_0x08dd('0x17'));var db=require(_0x08dd('0x18'))['db'];config[_0x08dd('0x19')]=_['defaults'](config[_0x08dd('0x19')],{'host':_0x08dd('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x08dd('0x19')]));require(_0x08dd('0x1b'))['register'](socket);function respondWithStatusCode(_0x4fd31a,_0x2d1c8a){_0x2d1c8a=_0x2d1c8a||0xcc;return function(_0x17045b){if(_0x17045b){return _0x4fd31a[_0x08dd('0x1c')](_0x2d1c8a);}return _0x4fd31a[_0x08dd('0x1d')](_0x2d1c8a)[_0x08dd('0x1e')]();};}function respondWithResult(_0x2ab3c6,_0x492528){_0x492528=_0x492528||0xc8;return function(_0x7e227b){if(_0x7e227b){return _0x2ab3c6['status'](_0x492528)[_0x08dd('0x1f')](_0x7e227b);}};}function respondWithFilteredResult(_0x314356,_0x4ff1c2){return function(_0x87ad4){if(_0x87ad4){var _0x178fae=typeof _0x4ff1c2['offset']===_0x08dd('0x20')&&typeof _0x4ff1c2[_0x08dd('0x21')]===_0x08dd('0x20');var _0x109d03=_0x87ad4[_0x08dd('0x22')];var _0xf4d44a=_0x178fae?0x0:_0x4ff1c2[_0x08dd('0x23')];var _0x2454aa=_0x178fae?_0x87ad4[_0x08dd('0x22')]:_0x4ff1c2[_0x08dd('0x23')]+_0x4ff1c2[_0x08dd('0x21')];var _0x37d398;if(_0x2454aa>=_0x109d03){_0x2454aa=_0x109d03;_0x37d398=0xc8;}else{_0x37d398=0xce;}_0x314356[_0x08dd('0x1d')](_0x37d398);return _0x314356['set'](_0x08dd('0x24'),_0xf4d44a+'-'+_0x2454aa+'/'+_0x109d03)[_0x08dd('0x1f')](_0x87ad4);}return null;};}function patchUpdates(_0xa566de){return function(_0x2da508){try{jsonpatch[_0x08dd('0x25')](_0x2da508,_0xa566de,!![]);}catch(_0x46beaa){return BPromise[_0x08dd('0x26')](_0x46beaa);}return _0x2da508['save']();};}function saveUpdates(_0x31947a,_0x14008b){return function(_0x1155c7){if(_0x1155c7){return _0x1155c7[_0x08dd('0x27')](_0x31947a)['then'](function(_0xb3c9d5){return _0xb3c9d5;});}return null;};}function removeEntity(_0x268a03,_0xc0eb9d){return function(_0x46fe8f){if(_0x46fe8f){return _0x46fe8f[_0x08dd('0x28')]()[_0x08dd('0x29')](function(){_0x268a03['status'](0xcc)[_0x08dd('0x1e')]();});}};}function handleEntityNotFound(_0x3e4042,_0x2c047f){return function(_0x388a24){if(!_0x388a24){_0x3e4042[_0x08dd('0x1c')](0x194);}return _0x388a24;};}function handleError(_0x47b19a,_0x3ecac3){_0x3ecac3=_0x3ecac3||0x1f4;return function(_0x4ba6ad){logger[_0x08dd('0x2a')](_0x4ba6ad[_0x08dd('0x2b')]);if(_0x4ba6ad[_0x08dd('0x2c')]){delete _0x4ba6ad[_0x08dd('0x2c')];}_0x47b19a['status'](_0x3ecac3)[_0x08dd('0x2d')](_0x4ba6ad);};}exports[_0x08dd('0x2e')]=function(_0x4b4efd,_0x204fc7){var _0x50e8b3={},_0x380bbc={},_0x28ecbc={'count':0x0,'rows':[]};var _0x4e736f=_['map'](db[_0x08dd('0x2f')]['rawAttributes'],function(_0xfbbfe2){return{'name':_0xfbbfe2[_0x08dd('0x30')],'type':_0xfbbfe2[_0x08dd('0x31')][_0x08dd('0x32')]};});_0x380bbc[_0x08dd('0x33')]=_[_0x08dd('0x34')](_0x4e736f,_0x08dd('0x2c'));_0x380bbc[_0x08dd('0x35')]=_[_0x08dd('0x36')](_0x4b4efd[_0x08dd('0x35')]);_0x380bbc['filters']=_[_0x08dd('0x37')](_0x380bbc[_0x08dd('0x33')],_0x380bbc['query']);_0x50e8b3[_0x08dd('0x38')]=_['intersection'](_0x380bbc[_0x08dd('0x33')],qs[_0x08dd('0x39')](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x39')]));_0x50e8b3[_0x08dd('0x38')]=_0x50e8b3[_0x08dd('0x38')]['length']?_0x50e8b3[_0x08dd('0x38')]:_0x380bbc['model'];if(!_0x4b4efd['query']['hasOwnProperty'](_0x08dd('0x3a'))){_0x50e8b3[_0x08dd('0x21')]=qs[_0x08dd('0x21')](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x21')]);_0x50e8b3['offset']=qs['offset'](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x23')]);}_0x50e8b3[_0x08dd('0x3b')]=qs['sort'](_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x3c')]);_0x50e8b3[_0x08dd('0x3d')]=qs[_0x08dd('0x3e')](_[_0x08dd('0x3f')](_0x4b4efd['query'],_0x380bbc[_0x08dd('0x3e')]),_0x4e736f);if(_0x4b4efd['query']['filter']){_0x50e8b3[_0x08dd('0x3d')]=_['merge'](_0x50e8b3[_0x08dd('0x3d')],{'$or':_['map'](_0x4e736f,function(_0x38e071){if(_0x38e071['type']!==_0x08dd('0x40')){var _0x567fa8={};_0x567fa8[_0x38e071[_0x08dd('0x2c')]]={'$like':'%'+_0x4b4efd['query'][_0x08dd('0x41')]+'%'};return _0x567fa8;}})});}_0x50e8b3=_[_0x08dd('0x42')]({},_0x50e8b3,_0x4b4efd[_0x08dd('0x43')]);var _0x1693c9={'where':_0x50e8b3[_0x08dd('0x3d')]};return db[_0x08dd('0x2f')]['count'](_0x1693c9)['then'](function(_0x3adc1a){_0x28ecbc['count']=_0x3adc1a;if(_0x4b4efd[_0x08dd('0x35')][_0x08dd('0x44')]){_0x50e8b3['include']=[{'all':!![]}];}return db[_0x08dd('0x2f')][_0x08dd('0x45')](_0x50e8b3);})[_0x08dd('0x29')](function(_0x4c88a0){_0x28ecbc['rows']=_0x4c88a0;return _0x28ecbc;})[_0x08dd('0x29')](respondWithFilteredResult(_0x204fc7,_0x50e8b3))[_0x08dd('0x46')](handleError(_0x204fc7,null));};exports[_0x08dd('0x47')]=function(_0x15e0f6,_0xb17f88){var _0x193fc0={'raw':!![],'where':{'id':_0x15e0f6['params']['id']}},_0x9aea12={};_0x9aea12[_0x08dd('0x33')]=_[_0x08dd('0x36')](db[_0x08dd('0x2f')][_0x08dd('0x48')]);_0x9aea12['query']=_[_0x08dd('0x36')](_0x15e0f6[_0x08dd('0x35')]);_0x9aea12[_0x08dd('0x3e')]=_['intersection'](_0x9aea12['model'],_0x9aea12[_0x08dd('0x35')]);_0x193fc0['attributes']=_[_0x08dd('0x37')](_0x9aea12[_0x08dd('0x33')],qs['fields'](_0x15e0f6[_0x08dd('0x35')][_0x08dd('0x39')]));_0x193fc0[_0x08dd('0x38')]=_0x193fc0[_0x08dd('0x38')][_0x08dd('0x49')]?_0x193fc0[_0x08dd('0x38')]:_0x9aea12[_0x08dd('0x33')];if(_0x15e0f6['query'][_0x08dd('0x44')]){_0x193fc0[_0x08dd('0x4a')]=[{'all':!![]}];}_0x193fc0=_['merge']({},_0x193fc0,_0x15e0f6[_0x08dd('0x43')]);return db['ChatInternalMessage']['find'](_0x193fc0)['then'](handleEntityNotFound(_0xb17f88,null))[_0x08dd('0x29')](respondWithResult(_0xb17f88,null))[_0x08dd('0x46')](handleError(_0xb17f88,null));};exports[_0x08dd('0x4b')]=function(_0x31a4d9,_0x4b803b){return db[_0x08dd('0x2f')][_0x08dd('0x4b')](_0x31a4d9[_0x08dd('0x4c')],{})[_0x08dd('0x29')](respondWithResult(_0x4b803b,0xc9))[_0x08dd('0x46')](handleError(_0x4b803b,null));};exports['update']=function(_0x164810,_0x26352f){if(_0x164810[_0x08dd('0x4c')]['id']){delete _0x164810[_0x08dd('0x4c')]['id'];}return db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'id':_0x164810[_0x08dd('0x4e')]['id']}})[_0x08dd('0x29')](handleEntityNotFound(_0x26352f,null))['then'](saveUpdates(_0x164810[_0x08dd('0x4c')],null))['then'](respondWithResult(_0x26352f,null))[_0x08dd('0x46')](handleError(_0x26352f,null));};exports['destroy']=function(_0x10b14d,_0x5803a6){return db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'id':_0x10b14d[_0x08dd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5803a6,null))['then'](removeEntity(_0x5803a6,null))[_0x08dd('0x46')](handleError(_0x5803a6,null));};exports[_0x08dd('0x4f')]=function(_0x5753d6,_0x192ccf){return db['ChatInternalMessage'][_0x08dd('0x4f')]()[_0x08dd('0x29')](respondWithResult(_0x192ccf,null))[_0x08dd('0x46')](handleError(_0x192ccf,null));};function wrapUser(_0x54f692){return function(_0x209e86){var _0x35e6fe=_0x54f692[_0x08dd('0x50')]({'plain':!![]});_0x35e6fe['messages']=[];if(_0x209e86){_0x35e6fe[_0x08dd('0x51')]=_0x209e86['createdAt'];_0x35e6fe['lastMessage']=_0x209e86;}else{_0x35e6fe[_0x08dd('0x51')]=moment(0x0)[_0x08dd('0x52')](_0x08dd('0x53'));_0x35e6fe[_0x08dd('0x54')]={};}return _0x35e6fe;};}exports['getUsers']=function(_0x2037b9,_0x5438e7,_0x58a357){var _0x546fa9=[];return db[_0x08dd('0x55')][_0x08dd('0x45')]({'where':{'role':[_0x08dd('0x56'),_0x08dd('0x57'),'user']},'attributes':['id',_0x08dd('0x58'),'name',_0x08dd('0x59'),_0x08dd('0x5a'),'internal',_0x08dd('0x5b'),_0x08dd('0x5c'),_0x08dd('0x5d'),_0x08dd('0x5e')],'order':qs[_0x08dd('0x3c')](_0x08dd('0x5f')),'include':[{'model':db[_0x08dd('0x60')],'as':_0x08dd('0x61'),'attributes':['id','name',_0x08dd('0x31')],'through':{'attributes':[]}}]})[_0x08dd('0x29')](function(_0x572dcc){if(_0x572dcc){var _0x52cfe2=_0x2037b9[_0x08dd('0x62')][_0x08dd('0x50')]({'plain':!![]});if(!_0x52cfe2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x52cfe2['role']===_0x08dd('0x62')){return db[_0x08dd('0x63')][_0x08dd('0x4d')]({'where':{'name':_0x08dd('0x64'),'userProfileId':_0x52cfe2[_0x08dd('0x65')]},'raw':!![]})['then'](function(_0x344730){if(_0x344730){if(_0x344730[_0x08dd('0x66')]===0x0){return db[_0x08dd('0x67')]['findAll']({'where':{'sectionId':_0x344730['id']},'raw':!![]})['then'](function(_0x2fac51){var _0x15e042=[];if(_['isEmpty'](_0x2fac51)){_0x15e042=_[_0x08dd('0x41')](_0x572dcc,function(_0x36733a){if(_0x36733a[_0x08dd('0x59')]!==_0x08dd('0x56')){return _0x36733a;}});return _0x15e042;}else{for(var _0x143115=0x0;_0x143115<_0x572dcc[_0x08dd('0x49')];_0x143115++){var _0xc1b5e1=_0x572dcc[_0x143115];if(_0xc1b5e1[_0x08dd('0x59')]===_0x08dd('0x56')){var _0x5cd9d1=_[_0x08dd('0x4d')](_0x2fac51,function(_0x445d25){return _0x445d25[_0x08dd('0x68')]===_0xc1b5e1['id'];});if(_0x5cd9d1)_0x15e042[_0x08dd('0x69')](_0xc1b5e1);}else{_0x15e042[_0x08dd('0x69')](_0xc1b5e1);}}return _0x15e042;}});}else{return _0x572dcc;}}else{var _0x127992=_[_0x08dd('0x41')](_0x572dcc,function(_0x238455){if(_0x238455['role']!=='agent'){return _0x238455;}});return _0x127992;}});}else{return _0x572dcc;}}})[_0x08dd('0x29')](function(_0x594cf6){var _0x358641=[];if(_0x594cf6){_0x546fa9=_0x594cf6;for(var _0x1bfe6a=0x0;_0x1bfe6a<_0x594cf6[_0x08dd('0x49')];_0x1bfe6a+=0x1){_0x546fa9[_0x1bfe6a][_0x08dd('0x6a')]=[];_0x358641['push'](db[_0x08dd('0x2f')][_0x08dd('0x4d')]({'where':{'FromId':[_0x2037b9[_0x08dd('0x62')]['id'],_0x594cf6[_0x1bfe6a]['id']],'ToId':[_0x2037b9[_0x08dd('0x62')]['id'],_0x594cf6[_0x1bfe6a]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x08dd('0x6b'),_0x08dd('0x6c'),'body'],'order':qs[_0x08dd('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x08dd('0x29')](wrapUser(_0x594cf6[_0x1bfe6a])));}return BPromise[_0x08dd('0x6d')](_0x358641);}return[];})['then'](function(_0x266fd3){return{'rows':_0x266fd3,'count':_0x266fd3[_0x08dd('0x49')]};})[_0x08dd('0x29')](respondWithResult(_0x5438e7,null))['catch'](handleError(_0x5438e7,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index fe38dd5..a2d3002 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 _0xb435=['emit','hasOwnProperty','exports','events','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x5c6f36,_0xbd2a45){var _0x19569f=function(_0xa98b75){while(--_0xa98b75){_0x5c6f36['push'](_0x5c6f36['shift']());}};_0x19569f(++_0xbd2a45);}(_0xb435,0x13e));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x5b43('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x5b43('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5b43('0x2')](0x0);var events={'afterCreate':_0x5b43('0x3'),'afterUpdate':_0x5b43('0x4'),'afterDestroy':_0x5b43('0x5')};function emitEvent(_0x224c11){return function(_0x41afcd,_0x328b1d,_0x55c9b2){ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11+':'+_0x41afcd['id'],_0x41afcd);ChatInternalMessageEvents[_0x5b43('0x6')](_0x224c11,_0x41afcd);_0x55c9b2(null);};}for(var e in events){if(events[_0x5b43('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x5b43('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x32e3=['update','remove','emit','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x32e3,0x1d8));var _0x332e=function(_0x5cd3d5,_0x326da8){_0x5cd3d5=_0x5cd3d5-0x0;var _0x3d1993=_0x32e3[_0x5cd3d5];return _0x3d1993;};'use strict';var EventEmitter=require(_0x332e('0x0'));var ChatInternalMessage=require(_0x332e('0x1'))['db'][_0x332e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x332e('0x3')](0x0);var events={'afterCreate':_0x332e('0x4'),'afterUpdate':_0x332e('0x5'),'afterDestroy':_0x332e('0x6')};function emitEvent(_0x4512b3){return function(_0x5c866b,_0x1017db,_0x1a5500){ChatInternalMessageEvents[_0x332e('0x7')](_0x4512b3+':'+_0x5c866b['id'],_0x5c866b);ChatInternalMessageEvents[_0x332e('0x7')](_0x4512b3,_0x5c866b);_0x1a5500(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x332e('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index cc62a9d..33cd22c 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 _0x555b=['api','moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x555b,0xe1));var _0xb555=function(_0xbd499f,_0x315793){_0xbd499f=_0xbd499f-0x0;var _0x2d2d12=_0x555b[_0xbd499f];return _0x2d2d12;};'use strict';var _=require(_0xb555('0x0'));var util=require(_0xb555('0x1'));var logger=require(_0xb555('0x2'))(_0xb555('0x3'));var moment=require(_0xb555('0x4'));var BPromise=require(_0xb555('0x5'));var rp=require(_0xb555('0x6'));var fs=require('fs');var path=require(_0xb555('0x7'));var rimraf=require(_0xb555('0x8'));var config=require('../../config/environment');var attributes=require(_0xb555('0x9'));module[_0xb555('0xa')]=function(_0x4638b8,_0x131e43){return _0x4638b8[_0xb555('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5f39=['request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x5f39,0x1cb));var _0x95f3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5f39[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x95f3('0x0'));var util=require(_0x95f3('0x1'));var logger=require(_0x95f3('0x2'))(_0x95f3('0x3'));var moment=require(_0x95f3('0x4'));var BPromise=require(_0x95f3('0x5'));var rp=require(_0x95f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95f3('0x7'));var config=require(_0x95f3('0x8'));var attributes=require(_0x95f3('0x9'));module[_0x95f3('0xa')]=function(_0x4b0f91,_0xf57150){return _0x4b0f91[_0x95f3('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x95f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x95f3('0xd'),'collate':_0x95f3('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 15d2274..da3f461 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 _0x7721=['client','http','localhost','redis','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xebb209,_0x5b286c){var _0x5f3a20=function(_0x49e974){while(--_0x49e974){_0xebb209['push'](_0xebb209['shift']());}};_0x5f3a20(++_0x5b286c);}(_0x7721,0x115));var _0x1772=function(_0x57c27c,_0x4496ac){_0x57c27c=_0x57c27c-0x0;var _0x2f356e=_0x7721[_0x57c27c];return _0x2f356e;};'use strict';var _=require(_0x1772('0x0'));var util=require(_0x1772('0x1'));var moment=require(_0x1772('0x2'));var BPromise=require(_0x1772('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1772('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1772('0x5'))(_0x1772('0x6'));var config=require(_0x1772('0x7'));var jayson=require(_0x1772('0x8'));var client=jayson[_0x1772('0x9')][_0x1772('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x1772('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1772('0xc')]));require(_0x1772('0xd'))[_0x1772('0xe')](socket);function respondWithRpcPromise(_0xd6e82a,_0xd65598,_0x2b6e89){return new BPromise(function(_0x4630cc,_0x3ffa84){return client[_0x1772('0xf')](_0xd6e82a,_0x2b6e89)[_0x1772('0x10')](function(_0xfb07a8){logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,'request\x20sent');logger[_0x1772('0x13')](_0x1772('0x14'),_0xd65598,_0x1772('0x15'),JSON['stringify'](_0xfb07a8));if(_0xfb07a8[_0x1772('0x16')]){if(_0xfb07a8['error']['code']===0x1f4){logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x3ffa84(_0xfb07a8[_0x1772('0x16')]['message']);}logger[_0x1772('0x16')](_0x1772('0x12'),_0xd65598,_0xfb07a8[_0x1772('0x16')]['message']);return _0x4630cc(_0xfb07a8['error'][_0x1772('0x17')]);}else{logger[_0x1772('0x11')](_0x1772('0x12'),_0xd65598,_0x1772('0x15'));_0x4630cc(_0xfb07a8[_0x1772('0x18')]['message']);}})[_0x1772('0x19')](function(_0xd2fdd5){logger['error'](_0x1772('0x12'),_0xd65598,_0xd2fdd5);_0x3ffa84(_0xd2fdd5);});});}
\ No newline at end of file
+var _0x8881=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0x8881,0xd0));var _0x1888=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x8881[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x1888('0x0'));var util=require(_0x1888('0x1'));var moment=require(_0x1888('0x2'));var BPromise=require(_0x1888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1888('0x4'))['db'];var utils=require(_0x1888('0x5'));var logger=require('../../config/logger')(_0x1888('0x6'));var config=require('../../config/environment');var jayson=require(_0x1888('0x7'));var client=jayson['client'][_0x1888('0x8')]({'port':0x232a});config[_0x1888('0x9')]=_[_0x1888('0xa')](config[_0x1888('0x9')],{'host':_0x1888('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1888('0x9')]));require(_0x1888('0xc'))[_0x1888('0xd')](socket);function respondWithRpcPromise(_0x276def,_0x37837b,_0x2b9bf9){return new BPromise(function(_0x22ff6b,_0x1da670){return client[_0x1888('0xe')](_0x276def,_0x2b9bf9)[_0x1888('0xf')](function(_0x5eb1a2){logger[_0x1888('0x10')](_0x1888('0x11'),_0x37837b,_0x1888('0x12'));logger[_0x1888('0x13')](_0x1888('0x14'),_0x37837b,_0x1888('0x12'),JSON[_0x1888('0x15')](_0x5eb1a2));if(_0x5eb1a2[_0x1888('0x16')]){if(_0x5eb1a2['error']['code']===0x1f4){logger[_0x1888('0x16')](_0x1888('0x11'),_0x37837b,_0x5eb1a2['error'][_0x1888('0x17')]);return _0x1da670(_0x5eb1a2[_0x1888('0x16')][_0x1888('0x17')]);}logger[_0x1888('0x16')](_0x1888('0x11'),_0x37837b,_0x5eb1a2[_0x1888('0x16')]['message']);return _0x22ff6b(_0x5eb1a2[_0x1888('0x16')]['message']);}else{logger[_0x1888('0x10')](_0x1888('0x11'),_0x37837b,_0x1888('0x12'));_0x22ff6b(_0x5eb1a2[_0x1888('0x18')][_0x1888('0x17')]);}})[_0x1888('0x19')](function(_0x3b3f3e){logger[_0x1888('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x37837b,_0x3b3f3e);_0x1da670(_0x3b3f3e);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 86b4808..84464ff 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 _0x2a91=['./chatInternalMessage.events','remove','update','removeListener'];(function(_0x5ee5ef,_0x2267eb){var _0x1e608d=function(_0x34cf1e){while(--_0x34cf1e){_0x5ee5ef['push'](_0x5ee5ef['shift']());}};_0x1e608d(++_0x2267eb);}(_0x2a91,0x1cc));var _0x12a9=function(_0x3a55a6,_0x4a8738){_0x3a55a6=_0x3a55a6-0x0;var _0xc40765=_0x2a91[_0x3a55a6];return _0xc40765;};'use strict';var ChatInternalMessageEvents=require(_0x12a9('0x0'));var events=['save',_0x12a9('0x1'),_0x12a9('0x2')];function createListener(_0x4c6841,_0x758e24){return function(_0xd4eb28){_0x758e24['emit'](_0x4c6841,_0xd4eb28);};}function removeListener(_0x334c06,_0xe010e){return function(){ChatInternalMessageEvents[_0x12a9('0x3')](_0x334c06,_0xe010e);};}exports['register']=function(_0x548905){for(var _0x3acb73=0x0,_0x4aa20e=events['length'];_0x3acb73<_0x4aa20e;_0x3acb73++){var _0xcb25=events[_0x3acb73];var _0x477274=createListener('chatInternalMessage:'+_0xcb25,_0x548905);ChatInternalMessageEvents['on'](_0xcb25,_0x477274);}};
\ No newline at end of file
+var _0x73ce=['save','remove','update','emit','register','length','./chatInternalMessage.events'];(function(_0x91964a,_0x2dc2f6){var _0x4490b1=function(_0x3ed329){while(--_0x3ed329){_0x91964a['push'](_0x91964a['shift']());}};_0x4490b1(++_0x2dc2f6);}(_0x73ce,0x172));var _0xe73c=function(_0x535fef,_0x416c17){_0x535fef=_0x535fef-0x0;var _0x545e9b=_0x73ce[_0x535fef];return _0x545e9b;};'use strict';var ChatInternalMessageEvents=require(_0xe73c('0x0'));var events=[_0xe73c('0x1'),_0xe73c('0x2'),_0xe73c('0x3')];function createListener(_0x17d472,_0x193b81){return function(_0x5522ca){_0x193b81[_0xe73c('0x4')](_0x17d472,_0x5522ca);};}function removeListener(_0x4edb32,_0x3fec1d){return function(){ChatInternalMessageEvents['removeListener'](_0x4edb32,_0x3fec1d);};}exports[_0xe73c('0x5')]=function(_0x1b131c){for(var _0x1cd963=0x0,_0x5ed683=events[_0xe73c('0x6')];_0x1cd963<_0x5ed683;_0x1cd963++){var _0x53cde7=events[_0x1cd963];var _0x33ffd7=createListener('chatInternalMessage:'+_0x53cde7,_0x1b131c);ChatInternalMessageEvents['on'](_0x53cde7,_0x33ffd7);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 1fbcaf9..f93c5ce 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 _0xbe58=['index','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xbe58,0x90));var _0x8be5=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xbe58[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0x8be5('0x0'));var util=require(_0x8be5('0x1'));var path=require(_0x8be5('0x2'));var timeout=require('connect-timeout');var express=require(_0x8be5('0x3'));var router=express[_0x8be5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8be5('0x5'));var interaction=require(_0x8be5('0x6'));var config=require('../../config/environment');var controller=require(_0x8be5('0x7'));router[_0x8be5('0x8')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0xa')]);router['get']('/describe',auth[_0x8be5('0x9')](),controller[_0x8be5('0xb')]);router[_0x8be5('0x8')](_0x8be5('0xc'),auth['isAuthenticated'](),controller[_0x8be5('0xd')]);router[_0x8be5('0x8')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0xf')]);router[_0x8be5('0x10')]('/',auth[_0x8be5('0x9')](),controller[_0x8be5('0x11')]);router[_0x8be5('0x12')](_0x8be5('0xe'),controller[_0x8be5('0x13')]);router[_0x8be5('0x14')](_0x8be5('0xe'),auth[_0x8be5('0x9')](),controller[_0x8be5('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x418c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x340a1a,_0x47003a){var _0x1f13e5=function(_0x28ef88){while(--_0x28ef88){_0x340a1a['push'](_0x340a1a['shift']());}};_0x1f13e5(++_0x47003a);}(_0x418c,0x13f));var _0xc418=function(_0x1f7524,_0x56f235){_0x1f7524=_0x1f7524-0x0;var _0x210671=_0x418c[_0x1f7524];return _0x210671;};'use strict';var multer=require('multer');var util=require(_0xc418('0x0'));var path=require(_0xc418('0x1'));var timeout=require(_0xc418('0x2'));var express=require(_0xc418('0x3'));var router=express['Router']();var fs_extra=require(_0xc418('0x4'));var auth=require(_0xc418('0x5'));var interaction=require(_0xc418('0x6'));var config=require(_0xc418('0x7'));var controller=require(_0xc418('0x8'));router[_0xc418('0x9')]('/',auth[_0xc418('0xa')](),controller['index']);router[_0xc418('0x9')](_0xc418('0xb'),auth[_0xc418('0xa')](),controller[_0xc418('0xc')]);router[_0xc418('0x9')](_0xc418('0xd'),auth[_0xc418('0xa')](),controller[_0xc418('0xe')]);router[_0xc418('0x9')](_0xc418('0xf'),auth['isAuthenticated'](),controller[_0xc418('0x10')]);router[_0xc418('0x11')]('/',auth[_0xc418('0xa')](),controller['create']);router[_0xc418('0x12')](_0xc418('0xf'),controller[_0xc418('0x13')]);router[_0xc418('0x14')](_0xc418('0xf'),auth['isAuthenticated'](),controller[_0xc418('0x15')]);module[_0xc418('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index b83517c..da54004 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 _0xfd6f=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x3a9b70,_0x3b362a){var _0x11d6b5=function(_0x87a9db){while(--_0x87a9db){_0x3a9b70['push'](_0x3a9b70['shift']());}};_0x11d6b5(++_0x3b362a);}(_0xfd6f,0x19d));var _0xffd6=function(_0x225d7e,_0x1e8eed){_0x225d7e=_0x225d7e-0x0;var _0x3924d4=_0xfd6f[_0x225d7e];return _0x3924d4;};'use strict';var Sequelize=require(_0xffd6('0x0'));module[_0xffd6('0x1')]={'body':{'type':Sequelize[_0xffd6('0x2')](_0xffd6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xffd6('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xffd6('0x5')]('in',_0xffd6('0x6')),'defaultValue':_0xffd6('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xffd6('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xffd6('0x2')]}};
\ No newline at end of file
+var _0x5c00=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x12d0bb,_0x56430a){var _0x44e5af=function(_0x1c0db0){while(--_0x1c0db0){_0x12d0bb['push'](_0x12d0bb['shift']());}};_0x44e5af(++_0x56430a);}(_0x5c00,0x17e));var _0x05c0=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0x5c00[_0x1ebce2];return _0x4a330c;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'body':{'type':Sequelize[_0x05c0('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x05c0('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x05c0('0x4')]('in',_0x05c0('0x5')),'defaultValue':_0x05c0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x05c0('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x05c0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 531e169..4e08110 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 _0x0bb7=['order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','ChatMessage','find','create','body','describe','chat-interactions','accept','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','isNil','format','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','formData','reject','get','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','QueryTypes','fullname','internal','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','stack','send','index','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x409afc,_0x1f3328){var _0x12f0ff=function(_0x2c7882){while(--_0x2c7882){_0x409afc['push'](_0x409afc['shift']());}};_0x12f0ff(++_0x1f3328);}(_0x0bb7,0x14c));var _0x70bb=function(_0x34cf01,_0x4b9987){_0x34cf01=_0x34cf01-0x0;var _0x24b81a=_0x0bb7[_0x34cf01];return _0x24b81a;};'use strict';var emlformat=require(_0x70bb('0x0'));var rimraf=require(_0x70bb('0x1'));var zipdir=require(_0x70bb('0x2'));var jsonpatch=require(_0x70bb('0x3'));var rp=require(_0x70bb('0x4'));var moment=require('moment');var BPromise=require(_0x70bb('0x5'));var Mustache=require('mustache');var util=require(_0x70bb('0x6'));var path=require(_0x70bb('0x7'));var sox=require('sox');var csv=require(_0x70bb('0x8'));var ejs=require(_0x70bb('0x9'));var fs=require('fs');var fs_extra=require(_0x70bb('0xa'));var _=require(_0x70bb('0xb'));var squel=require(_0x70bb('0xc'));var crypto=require(_0x70bb('0xd'));var jsforce=require(_0x70bb('0xe'));var deskjs=require(_0x70bb('0xf'));var toCsv=require(_0x70bb('0x8'));var querystring=require(_0x70bb('0x10'));var Papa=require(_0x70bb('0x11'));var Redis=require(_0x70bb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x70bb('0x13'));var as=require(_0x70bb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70bb('0x15'))('api');var utils=require(_0x70bb('0x16'));var config=require(_0x70bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x70bb('0x18'))['db'];config[_0x70bb('0x19')]=_[_0x70bb('0x1a')](config['redis'],{'host':_0x70bb('0x1b'),'port':0x18eb});var socket=require(_0x70bb('0x1c'))(new Redis(config[_0x70bb('0x19')]));require(_0x70bb('0x1d'))[_0x70bb('0x1e')](socket);var jayson=require(_0x70bb('0x1f'));var client=jayson[_0x70bb('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x70bb('0x20')][_0x70bb('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1e1c0c,_0x16fe3a,_0x5f044e,_0x1e319a){return new BPromise(function(_0x3d26f3,_0x3c6ad6){var _0x454cea=_0x1e319a||client;return _0x454cea[_0x70bb('0x22')](_0x1e1c0c,_0x5f044e)['then'](function(_0x281ca7){logger['info'](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');logger[_0x70bb('0x24')](_0x70bb('0x25'),_0x16fe3a,_0x70bb('0x26'),JSON[_0x70bb('0x27')](_0x281ca7));if(_0x281ca7[_0x70bb('0x28')]){if(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x29')]===0x1f4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3c6ad6(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);return _0x3d26f3(_0x281ca7[_0x70bb('0x28')][_0x70bb('0x2a')]);}else{logger[_0x70bb('0x2b')](_0x70bb('0x23'),_0x16fe3a,'request\x20sent');_0x3d26f3(_0x281ca7[_0x70bb('0x2c')][_0x70bb('0x2a')]);}})[_0x70bb('0x2d')](function(_0x5d2cb4){logger[_0x70bb('0x28')](_0x70bb('0x23'),_0x16fe3a,_0x5d2cb4);_0x3c6ad6(_0x5d2cb4);});});}function respondWithStatusCode(_0x27a511,_0x225518){_0x225518=_0x225518||0xcc;return function(_0x167d5a){if(_0x167d5a){return _0x27a511[_0x70bb('0x2e')](_0x225518);}return _0x27a511['status'](_0x225518)[_0x70bb('0x2f')]();};}function respondWithResult(_0x43745f,_0x2cc13c){_0x2cc13c=_0x2cc13c||0xc8;return function(_0x40c0f7){if(_0x40c0f7){return _0x43745f[_0x70bb('0x30')](_0x2cc13c)['json'](_0x40c0f7);}};}function respondWithFilteredResult(_0x4c50bd,_0x415f10){return function(_0x3079e0){if(_0x3079e0){var _0x36c4c8=typeof _0x415f10[_0x70bb('0x31')]===_0x70bb('0x32')&&typeof _0x415f10[_0x70bb('0x33')]===_0x70bb('0x32');var _0x9600c8=_0x3079e0[_0x70bb('0x34')];var _0x2d87c1=_0x36c4c8?0x0:_0x415f10[_0x70bb('0x31')];var _0x1e4769=_0x36c4c8?_0x3079e0[_0x70bb('0x34')]:_0x415f10['offset']+_0x415f10[_0x70bb('0x33')];var _0x58532b;if(_0x1e4769>=_0x9600c8){_0x1e4769=_0x9600c8;_0x58532b=0xc8;}else{_0x58532b=0xce;}_0x4c50bd[_0x70bb('0x30')](_0x58532b);return _0x4c50bd[_0x70bb('0x35')](_0x70bb('0x36'),_0x2d87c1+'-'+_0x1e4769+'/'+_0x9600c8)[_0x70bb('0x37')](_0x3079e0);}return null;};}function patchUpdates(_0x43102d){return function(_0x3e990c){try{jsonpatch[_0x70bb('0x38')](_0x3e990c,_0x43102d,!![]);}catch(_0x501d56){return BPromise['reject'](_0x501d56);}return _0x3e990c[_0x70bb('0x39')]();};}function saveUpdates(_0x16669c,_0x29ca30){return function(_0x1554c8){if(_0x1554c8){return _0x1554c8[_0x70bb('0x3a')](_0x16669c)[_0x70bb('0x3b')](function(_0xb5dc32){return _0xb5dc32;});}return null;};}function removeEntity(_0x1e27e4,_0x39753e){return function(_0x165427){if(_0x165427){return _0x165427[_0x70bb('0x3c')]()['then'](function(){_0x1e27e4['status'](0xcc)[_0x70bb('0x2f')]();});}};}function handleEntityNotFound(_0x3299a6,_0x33d85e){return function(_0x41d561){if(!_0x41d561){_0x3299a6[_0x70bb('0x2e')](0x194);}return _0x41d561;};}function handleError(_0x358b05,_0x704ce5){_0x704ce5=_0x704ce5||0x1f4;return function(_0x58d741){logger['error'](_0x58d741[_0x70bb('0x3d')]);if(_0x58d741['name']){delete _0x58d741['name'];}_0x358b05['status'](_0x704ce5)[_0x70bb('0x3e')](_0x58d741);};}exports[_0x70bb('0x3f')]=function(_0x291be7,_0x4f2ad6){var _0x282162={},_0x4bd656={},_0x1ec123={'count':0x0,'rows':[]};var _0x7f445d=_['map'](db['ChatMessage'][_0x70bb('0x40')],function(_0x32c509){return{'name':_0x32c509['fieldName'],'type':_0x32c509[_0x70bb('0x41')][_0x70bb('0x42')]};});_0x4bd656[_0x70bb('0x43')]=_[_0x70bb('0x44')](_0x7f445d,_0x70bb('0x45'));_0x4bd656[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x291be7[_0x70bb('0x46')]);_0x4bd656[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],_0x4bd656['query']);_0x282162['attributes']=_[_0x70bb('0x49')](_0x4bd656[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x291be7['query'][_0x70bb('0x4a')]));_0x282162[_0x70bb('0x4b')]=_0x282162[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x282162['attributes']:_0x4bd656['model'];if(!_0x291be7[_0x70bb('0x46')][_0x70bb('0x4d')](_0x70bb('0x4e'))){_0x282162[_0x70bb('0x33')]=qs[_0x70bb('0x33')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x33')]);_0x282162['offset']=qs[_0x70bb('0x31')](_0x291be7['query'][_0x70bb('0x31')]);}_0x282162[_0x70bb('0x4f')]=qs[_0x70bb('0x50')](_0x291be7[_0x70bb('0x46')][_0x70bb('0x50')]);_0x282162[_0x70bb('0x51')]=qs[_0x70bb('0x48')](_[_0x70bb('0x52')](_0x291be7['query'],_0x4bd656[_0x70bb('0x48')]),_0x7f445d);if(_0x291be7[_0x70bb('0x46')]['filter']){_0x282162[_0x70bb('0x51')]=_[_0x70bb('0x53')](_0x282162['where'],{'$or':_[_0x70bb('0x44')](_0x7f445d,function(_0x365fb4){if(_0x365fb4[_0x70bb('0x41')]!==_0x70bb('0x54')){var _0x559a3a={};_0x559a3a[_0x365fb4['name']]={'$like':'%'+_0x291be7[_0x70bb('0x46')][_0x70bb('0x55')]+'%'};return _0x559a3a;}})});}_0x282162=_['merge']({},_0x282162,_0x291be7[_0x70bb('0x56')]);var _0x37d2ab={'where':_0x282162[_0x70bb('0x51')]};return db['ChatMessage']['count'](_0x37d2ab)[_0x70bb('0x3b')](function(_0xe06b59){_0x1ec123[_0x70bb('0x34')]=_0xe06b59;if(_0x291be7['query']['includeAll']){_0x282162[_0x70bb('0x57')]=[{'all':!![]}];}return db['ChatMessage'][_0x70bb('0x58')](_0x282162);})[_0x70bb('0x3b')](function(_0x3540bd){_0x1ec123['rows']=_0x3540bd;return _0x1ec123;})[_0x70bb('0x3b')](respondWithFilteredResult(_0x4f2ad6,_0x282162))[_0x70bb('0x2d')](handleError(_0x4f2ad6,null));};exports['show']=function(_0x26f2f2,_0x3f4929){var _0x59d619={'raw':!![],'where':{'id':_0x26f2f2[_0x70bb('0x59')]['id']}},_0x11d815={};_0x11d815[_0x70bb('0x43')]=_[_0x70bb('0x47')](db[_0x70bb('0x5a')][_0x70bb('0x40')]);_0x11d815[_0x70bb('0x46')]=_[_0x70bb('0x47')](_0x26f2f2['query']);_0x11d815[_0x70bb('0x48')]=_[_0x70bb('0x49')](_0x11d815[_0x70bb('0x43')],_0x11d815[_0x70bb('0x46')]);_0x59d619[_0x70bb('0x4b')]=_['intersection'](_0x11d815[_0x70bb('0x43')],qs[_0x70bb('0x4a')](_0x26f2f2[_0x70bb('0x46')]['fields']));_0x59d619['attributes']=_0x59d619[_0x70bb('0x4b')][_0x70bb('0x4c')]?_0x59d619[_0x70bb('0x4b')]:_0x11d815[_0x70bb('0x43')];if(_0x26f2f2[_0x70bb('0x46')]['includeAll']){_0x59d619[_0x70bb('0x57')]=[{'all':!![]}];}_0x59d619=_[_0x70bb('0x53')]({},_0x59d619,_0x26f2f2[_0x70bb('0x56')]);return db[_0x70bb('0x5a')][_0x70bb('0x5b')](_0x59d619)[_0x70bb('0x3b')](handleEntityNotFound(_0x3f4929,null))[_0x70bb('0x3b')](respondWithResult(_0x3f4929,null))['catch'](handleError(_0x3f4929,null));};exports['create']=function(_0x31f3c3,_0x30ee14){return db[_0x70bb('0x5a')][_0x70bb('0x5c')](_0x31f3c3[_0x70bb('0x5d')],{})[_0x70bb('0x3b')](respondWithResult(_0x30ee14,0xc9))[_0x70bb('0x2d')](handleError(_0x30ee14,null));};exports[_0x70bb('0x3a')]=function(_0x3f1b6c,_0x170e1a){if(_0x3f1b6c[_0x70bb('0x5d')]['id']){delete _0x3f1b6c[_0x70bb('0x5d')]['id'];}return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x3f1b6c[_0x70bb('0x59')]['id']}})[_0x70bb('0x3b')](handleEntityNotFound(_0x170e1a,null))['then'](saveUpdates(_0x3f1b6c[_0x70bb('0x5d')],null))[_0x70bb('0x3b')](respondWithResult(_0x170e1a,null))[_0x70bb('0x2d')](handleError(_0x170e1a,null));};exports['destroy']=function(_0x30d89d,_0x37a9f2){return db[_0x70bb('0x5a')]['find']({'where':{'id':_0x30d89d[_0x70bb('0x59')]['id']}})['then'](handleEntityNotFound(_0x37a9f2,null))[_0x70bb('0x3b')](removeEntity(_0x37a9f2,null))[_0x70bb('0x2d')](handleError(_0x37a9f2,null));};exports['describe']=function(_0x21f2cd,_0x31a43f){return db[_0x70bb('0x5a')][_0x70bb('0x5e')]()[_0x70bb('0x3b')](respondWithResult(_0x31a43f,null))[_0x70bb('0x2d')](handleError(_0x31a43f,null));};var interaction_log=require('../../config/logger')(_0x70bb('0x5f'));exports[_0x70bb('0x60')]=function(_0x522c58,_0x7d50ce,_0x55891c){var _0x10594a={'agent':{},'channel':_0x70bb('0x61')};if(_0x522c58[_0x70bb('0x5d')]['id']){delete _0x522c58[_0x70bb('0x5d')]['id'];}_0x522c58['body'][_0x70bb('0x62')]=!![];_0x522c58[_0x70bb('0x5d')][_0x70bb('0x63')]=moment()['format'](_0x70bb('0x64'));_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x522c58[_0x70bb('0x66')]['id'];_0x10594a[_0x70bb('0x67')]['id']=_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7d50ce,null))[_0x70bb('0x3b')](saveUpdates(_0x522c58[_0x70bb('0x5d')],null))['then'](function(_0x12e70d){if(_0x12e70d){_0x10594a[_0x70bb('0x2a')]=_0x12e70d['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x12e70d['ChatInteractionId']}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x7d50ce,null))['then'](function(_0x221aaa){if(_0x221aaa){return _0x221aaa[_0x70bb('0x3a')]({'UserId':_0x522c58[_0x70bb('0x5d')][_0x70bb('0x65')],'read1stAt':_[_0x70bb('0x68')](_0x221aaa['read1stAt'])?moment()[_0x70bb('0x69')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1c616c){if(_0x1c616c){_0x10594a[_0x70bb('0x6a')]=_0x1c616c['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x522c58[_0x70bb('0x66')]['id'],_0x522c58[_0x70bb('0x66')]['name'],_0x522c58[_0x70bb('0x66')][_0x70bb('0x6b')],_0x10594a[_0x70bb('0x6a')]['id'],_0x522c58['body']?JSON[_0x70bb('0x27')](_0x522c58['body']):_0x70bb('0x6c'));return respondWithRpcPromise(_0x70bb('0x6d'),_0x70bb('0x6e'),_0x10594a);}return null;})[_0x70bb('0x3b')](function(_0x5bf286){var _0x20c56a=_0x70bb('0x6f')+_0x5bf286[_0x70bb('0x2a')][_0x70bb('0x70')];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x20c56a,{'type':db['Sequelize']['QueryTypes'][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x4fbba7){return _0x4fbba7;});})['then'](function(_0x318e30){if(_0x318e30){_0x10594a[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x318e30[0x0];if(!_0x522c58[_0x70bb('0x5d')]['UserId'])return;return db[_0x70bb('0x74')][_0x70bb('0x5b')]({'where':{'id':_0x522c58[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),'fullname',_0x70bb('0x75'),'internal'],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x42bb8a){if(!_0x42bb8a)return null;_0x10594a['message']['agent']=_0x42bb8a;return _0x10594a;})[_0x70bb('0x3b')](function(_0x57029e){if(_0x57029e){if(_0x522c58['body']['manual']){_0x10594a['message'][_0x70bb('0x76')]=util[_0x70bb('0x69')](_0x70bb('0x77'),_0x522c58[_0x70bb('0x66')][_0x70bb('0x45')]);_0x10594a['message']['channel']=_0x10594a[_0x70bb('0x78')];_0x10594a[_0x70bb('0x2a')]['motionChannel']=_0x10594a['channel'];_0x10594a[_0x70bb('0x2a')][_0x70bb('0x79')]='accept';return respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x7b'),'message':_[_0x70bb('0x53')](_0x10594a[_0x70bb('0x2a')],JSON['parse'](_0x10594a[_0x70bb('0x6a')][_0x70bb('0x7c')]))},client9002)['then'](function(){return _0x10594a;});}return _0x10594a;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x7d50ce,null))[_0x70bb('0x2d')](handleError(_0x7d50ce,null));};var interaction_log=require(_0x70bb('0x15'))(_0x70bb('0x5f'));exports[_0x70bb('0x7d')]=function(_0x5777a0,_0x58f136,_0x352986){var _0x52916d={'agent':{},'channel':_0x70bb('0x61')};if(_0x5777a0[_0x70bb('0x5d')]['id']){delete _0x5777a0['body']['id'];}_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]=_0x5777a0[_0x70bb('0x5d')][_0x70bb('0x65')]||_0x5777a0['user']['id'];_0x52916d[_0x70bb('0x67')]['id']=_0x5777a0['body']['UserId'];return db[_0x70bb('0x5a')][_0x70bb('0x5b')]({'where':{'id':_0x5777a0[_0x70bb('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x3c67fd){if(_0x3c67fd){_0x52916d[_0x70bb('0x2a')]=_0x3c67fd[_0x70bb('0x7e')]({'plain':!![]});return db['ChatInteraction'][_0x70bb('0x5b')]({'where':{'id':_0x3c67fd[_0x70bb('0x7f')]}});}return null;})[_0x70bb('0x3b')](handleEntityNotFound(_0x58f136,null))[_0x70bb('0x3b')](function(_0x1aa14f){if(_0x1aa14f){_0x52916d['interaction']=_0x1aa14f[_0x70bb('0x7e')]({'plain':!![]});interaction_log[_0x70bb('0x2b')](_0x70bb('0x80'),_0x5777a0['user']['id'],_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')],_0x5777a0[_0x70bb('0x66')]['role'],_0x52916d[_0x70bb('0x6a')]['id'],_0x5777a0[_0x70bb('0x5d')]?JSON[_0x70bb('0x27')](_0x5777a0[_0x70bb('0x5d')]):'null');return respondWithRpcPromise(_0x70bb('0x81'),_0x70bb('0x82'),_0x52916d);}return null;})[_0x70bb('0x3b')](function(_0x3334a8){var _0x449c9c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3334a8[_0x70bb('0x2a')]['ContactId'];return db[_0x70bb('0x71')][_0x70bb('0x46')](_0x449c9c,{'type':db[_0x70bb('0x83')][_0x70bb('0x84')][_0x70bb('0x72')],'raw':!![]})[_0x70bb('0x3b')](function(_0x3a161c){return _0x3a161c;});})[_0x70bb('0x3b')](function(_0x182186){if(_0x182186){_0x52916d[_0x70bb('0x2a')][_0x70bb('0x73')]=_0x182186[0x0];if(!_0x5777a0['body'][_0x70bb('0x65')])return;return db[_0x70bb('0x74')]['find']({'where':{'id':_0x5777a0[_0x70bb('0x5d')]['UserId'],'role':_0x70bb('0x67')},'attributes':['id',_0x70bb('0x45'),_0x70bb('0x85'),_0x70bb('0x75'),_0x70bb('0x86')],'raw':!![]});}return null;})[_0x70bb('0x3b')](function(_0x110b42){if(!_0x110b42)return null;_0x52916d[_0x70bb('0x2a')][_0x70bb('0x67')]=_0x110b42;return _0x52916d;})[_0x70bb('0x3b')](function(_0x537598){if(_0x537598){_0x537598[_0x70bb('0x2a')][_0x70bb('0x76')]=util['format'](_0x70bb('0x77'),_0x5777a0[_0x70bb('0x66')][_0x70bb('0x45')]);_0x537598[_0x70bb('0x2a')][_0x70bb('0x78')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x87')]=_0x52916d[_0x70bb('0x78')];_0x537598[_0x70bb('0x2a')][_0x70bb('0x79')]=_0x70bb('0x7d');respondWithRpcPromise(_0x70bb('0x7a'),_0x70bb('0x7a'),{'event':_0x70bb('0x88'),'message':_[_0x70bb('0x53')](_0x52916d[_0x70bb('0x2a')],JSON['parse'](_0x52916d[_0x70bb('0x6a')]['formData']))},client9002);return _0x52916d;}return null;})[_0x70bb('0x3b')](respondWithResult(_0x58f136,null))[_0x70bb('0x2d')](handleError(_0x58f136,null));};
\ No newline at end of file
+var _0x8aed=['interface','channel','event','EventManager','acceptmessage','parse','../../config/logger','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','User','fullname','internal','SIP/%s','rejectmessage','formData','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','show','params','keys','fields','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','manual'];(function(_0x27968c,_0x5f4dbd){var _0x3cfb3a=function(_0x296d49){while(--_0x296d49){_0x27968c['push'](_0x27968c['shift']());}};_0x3cfb3a(++_0x5f4dbd);}(_0x8aed,0x96));var _0xd8ae=function(_0x4e8799,_0x2854ba){_0x4e8799=_0x4e8799-0x0;var _0x366238=_0x8aed[_0x4e8799];return _0x366238;};'use strict';var emlformat=require(_0xd8ae('0x0'));var rimraf=require(_0xd8ae('0x1'));var zipdir=require(_0xd8ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8ae('0x3'));var moment=require(_0xd8ae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8ae('0x5'));var util=require(_0xd8ae('0x6'));var path=require('path');var sox=require(_0xd8ae('0x7'));var csv=require(_0xd8ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8ae('0x9'));var _=require(_0xd8ae('0xa'));var squel=require(_0xd8ae('0xb'));var crypto=require(_0xd8ae('0xc'));var jsforce=require(_0xd8ae('0xd'));var deskjs=require(_0xd8ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd8ae('0xf'));var Papa=require(_0xd8ae('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8ae('0x11'));var as=require(_0xd8ae('0x12'));var hardwareService=require(_0xd8ae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xd8ae('0x14'));var config=require(_0xd8ae('0x15'));var licenseUtil=require(_0xd8ae('0x16'));var db=require(_0xd8ae('0x17'))['db'];config[_0xd8ae('0x18')]=_[_0xd8ae('0x19')](config[_0xd8ae('0x18')],{'host':_0xd8ae('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd8ae('0x18')]));require(_0xd8ae('0x1b'))[_0xd8ae('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd8ae('0x1d')][_0xd8ae('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xd8ae('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x5ea127,_0x506bf0,_0x48d56d,_0x312a79){return new BPromise(function(_0x192ea5,_0x27e189){var _0x2b84f8=_0x312a79||client;return _0x2b84f8[_0xd8ae('0x1f')](_0x5ea127,_0x48d56d)[_0xd8ae('0x20')](function(_0x3b8bca){logger[_0xd8ae('0x21')](_0xd8ae('0x22'),_0x506bf0,_0xd8ae('0x23'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x506bf0,_0xd8ae('0x23'),JSON[_0xd8ae('0x24')](_0x3b8bca));if(_0x3b8bca['error']){if(_0x3b8bca[_0xd8ae('0x25')][_0xd8ae('0x26')]===0x1f4){logger[_0xd8ae('0x25')]('ChatMessage,\x20%s,\x20%s',_0x506bf0,_0x3b8bca[_0xd8ae('0x25')]['message']);return _0x27e189(_0x3b8bca['error'][_0xd8ae('0x27')]);}logger[_0xd8ae('0x25')](_0xd8ae('0x22'),_0x506bf0,_0x3b8bca['error'][_0xd8ae('0x27')]);return _0x192ea5(_0x3b8bca[_0xd8ae('0x25')][_0xd8ae('0x27')]);}else{logger[_0xd8ae('0x21')](_0xd8ae('0x22'),_0x506bf0,'request\x20sent');_0x192ea5(_0x3b8bca[_0xd8ae('0x28')][_0xd8ae('0x27')]);}})[_0xd8ae('0x29')](function(_0x4fb645){logger[_0xd8ae('0x25')](_0xd8ae('0x22'),_0x506bf0,_0x4fb645);_0x27e189(_0x4fb645);});});}function respondWithStatusCode(_0x4cf479,_0x55f57e){_0x55f57e=_0x55f57e||0xcc;return function(_0xcffeb3){if(_0xcffeb3){return _0x4cf479[_0xd8ae('0x2a')](_0x55f57e);}return _0x4cf479['status'](_0x55f57e)['end']();};}function respondWithResult(_0x503e60,_0x537a93){_0x537a93=_0x537a93||0xc8;return function(_0x42e64b){if(_0x42e64b){return _0x503e60[_0xd8ae('0x2b')](_0x537a93)[_0xd8ae('0x2c')](_0x42e64b);}};}function respondWithFilteredResult(_0x50f82c,_0x3e25e2){return function(_0x424e71){if(_0x424e71){var _0x1c6a44=typeof _0x3e25e2[_0xd8ae('0x2d')]===_0xd8ae('0x2e')&&typeof _0x3e25e2[_0xd8ae('0x2f')]===_0xd8ae('0x2e');var _0x4ae93f=_0x424e71['count'];var _0x17bbf2=_0x1c6a44?0x0:_0x3e25e2['offset'];var _0x198117=_0x1c6a44?_0x424e71['count']:_0x3e25e2[_0xd8ae('0x2d')]+_0x3e25e2[_0xd8ae('0x2f')];var _0x14e0a5;if(_0x198117>=_0x4ae93f){_0x198117=_0x4ae93f;_0x14e0a5=0xc8;}else{_0x14e0a5=0xce;}_0x50f82c[_0xd8ae('0x2b')](_0x14e0a5);return _0x50f82c['set'](_0xd8ae('0x30'),_0x17bbf2+'-'+_0x198117+'/'+_0x4ae93f)[_0xd8ae('0x2c')](_0x424e71);}return null;};}function patchUpdates(_0x32b0da){return function(_0x3e0e92){try{jsonpatch[_0xd8ae('0x31')](_0x3e0e92,_0x32b0da,!![]);}catch(_0x512f46){return BPromise[_0xd8ae('0x32')](_0x512f46);}return _0x3e0e92[_0xd8ae('0x33')]();};}function saveUpdates(_0x27c7bf,_0x594bfb){return function(_0x557c4b){if(_0x557c4b){return _0x557c4b[_0xd8ae('0x34')](_0x27c7bf)[_0xd8ae('0x20')](function(_0x15404b){return _0x15404b;});}return null;};}function removeEntity(_0x1741c0,_0x5c7f26){return function(_0x5765a0){if(_0x5765a0){return _0x5765a0[_0xd8ae('0x35')]()[_0xd8ae('0x20')](function(){_0x1741c0['status'](0xcc)[_0xd8ae('0x36')]();});}};}function handleEntityNotFound(_0x1f239c,_0x2f00f4){return function(_0x386343){if(!_0x386343){_0x1f239c[_0xd8ae('0x2a')](0x194);}return _0x386343;};}function handleError(_0x5c21ca,_0x58f6d8){_0x58f6d8=_0x58f6d8||0x1f4;return function(_0x330f73){logger[_0xd8ae('0x25')](_0x330f73[_0xd8ae('0x37')]);if(_0x330f73['name']){delete _0x330f73[_0xd8ae('0x38')];}_0x5c21ca['status'](_0x58f6d8)[_0xd8ae('0x39')](_0x330f73);};}exports[_0xd8ae('0x3a')]=function(_0x21c63c,_0x575fae){var _0x2b4133={},_0x4cea34={},_0x2d7b47={'count':0x0,'rows':[]};var _0x473dd2=_[_0xd8ae('0x3b')](db[_0xd8ae('0x3c')][_0xd8ae('0x3d')],function(_0x1e6cac){return{'name':_0x1e6cac[_0xd8ae('0x3e')],'type':_0x1e6cac['type'][_0xd8ae('0x3f')]};});_0x4cea34[_0xd8ae('0x40')]=_[_0xd8ae('0x3b')](_0x473dd2,_0xd8ae('0x38'));_0x4cea34['query']=_['keys'](_0x21c63c[_0xd8ae('0x41')]);_0x4cea34[_0xd8ae('0x42')]=_[_0xd8ae('0x43')](_0x4cea34[_0xd8ae('0x40')],_0x4cea34[_0xd8ae('0x41')]);_0x2b4133['attributes']=_[_0xd8ae('0x43')](_0x4cea34[_0xd8ae('0x40')],qs['fields'](_0x21c63c[_0xd8ae('0x41')]['fields']));_0x2b4133[_0xd8ae('0x44')]=_0x2b4133[_0xd8ae('0x44')][_0xd8ae('0x45')]?_0x2b4133[_0xd8ae('0x44')]:_0x4cea34[_0xd8ae('0x40')];if(!_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x46')]('nolimit')){_0x2b4133[_0xd8ae('0x2f')]=qs['limit'](_0x21c63c['query']['limit']);_0x2b4133[_0xd8ae('0x2d')]=qs[_0xd8ae('0x2d')](_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x2d')]);}_0x2b4133[_0xd8ae('0x47')]=qs[_0xd8ae('0x48')](_0x21c63c['query'][_0xd8ae('0x48')]);_0x2b4133[_0xd8ae('0x49')]=qs[_0xd8ae('0x42')](_[_0xd8ae('0x4a')](_0x21c63c['query'],_0x4cea34['filters']),_0x473dd2);if(_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x4b')]){_0x2b4133[_0xd8ae('0x49')]=_[_0xd8ae('0x4c')](_0x2b4133[_0xd8ae('0x49')],{'$or':_['map'](_0x473dd2,function(_0x278aff){if(_0x278aff[_0xd8ae('0x4d')]!==_0xd8ae('0x4e')){var _0x346b13={};_0x346b13[_0x278aff[_0xd8ae('0x38')]]={'$like':'%'+_0x21c63c[_0xd8ae('0x41')]['filter']+'%'};return _0x346b13;}})});}_0x2b4133=_[_0xd8ae('0x4c')]({},_0x2b4133,_0x21c63c['options']);var _0xb5ec06={'where':_0x2b4133[_0xd8ae('0x49')]};return db[_0xd8ae('0x3c')][_0xd8ae('0x4f')](_0xb5ec06)[_0xd8ae('0x20')](function(_0x11db47){_0x2d7b47[_0xd8ae('0x4f')]=_0x11db47;if(_0x21c63c[_0xd8ae('0x41')][_0xd8ae('0x50')]){_0x2b4133[_0xd8ae('0x51')]=[{'all':!![]}];}return db[_0xd8ae('0x3c')][_0xd8ae('0x52')](_0x2b4133);})[_0xd8ae('0x20')](function(_0x1beb34){_0x2d7b47[_0xd8ae('0x53')]=_0x1beb34;return _0x2d7b47;})[_0xd8ae('0x20')](respondWithFilteredResult(_0x575fae,_0x2b4133))[_0xd8ae('0x29')](handleError(_0x575fae,null));};exports[_0xd8ae('0x54')]=function(_0x2bb36a,_0xc0c80f){var _0x33bae8={'raw':!![],'where':{'id':_0x2bb36a[_0xd8ae('0x55')]['id']}},_0x2fa1a5={};_0x2fa1a5[_0xd8ae('0x40')]=_['keys'](db[_0xd8ae('0x3c')]['rawAttributes']);_0x2fa1a5[_0xd8ae('0x41')]=_[_0xd8ae('0x56')](_0x2bb36a[_0xd8ae('0x41')]);_0x2fa1a5['filters']=_['intersection'](_0x2fa1a5[_0xd8ae('0x40')],_0x2fa1a5[_0xd8ae('0x41')]);_0x33bae8['attributes']=_[_0xd8ae('0x43')](_0x2fa1a5[_0xd8ae('0x40')],qs[_0xd8ae('0x57')](_0x2bb36a[_0xd8ae('0x41')][_0xd8ae('0x57')]));_0x33bae8['attributes']=_0x33bae8[_0xd8ae('0x44')]['length']?_0x33bae8[_0xd8ae('0x44')]:_0x2fa1a5['model'];if(_0x2bb36a[_0xd8ae('0x41')][_0xd8ae('0x50')]){_0x33bae8[_0xd8ae('0x51')]=[{'all':!![]}];}_0x33bae8=_[_0xd8ae('0x4c')]({},_0x33bae8,_0x2bb36a['options']);return db[_0xd8ae('0x3c')][_0xd8ae('0x58')](_0x33bae8)[_0xd8ae('0x20')](handleEntityNotFound(_0xc0c80f,null))[_0xd8ae('0x20')](respondWithResult(_0xc0c80f,null))[_0xd8ae('0x29')](handleError(_0xc0c80f,null));};exports[_0xd8ae('0x59')]=function(_0x48f6bc,_0x80935e){return db[_0xd8ae('0x3c')][_0xd8ae('0x59')](_0x48f6bc[_0xd8ae('0x5a')],{})['then'](respondWithResult(_0x80935e,0xc9))['catch'](handleError(_0x80935e,null));};exports[_0xd8ae('0x34')]=function(_0x497e36,_0x5f965e){if(_0x497e36['body']['id']){delete _0x497e36[_0xd8ae('0x5a')]['id'];}return db[_0xd8ae('0x3c')][_0xd8ae('0x58')]({'where':{'id':_0x497e36[_0xd8ae('0x55')]['id']}})[_0xd8ae('0x20')](handleEntityNotFound(_0x5f965e,null))[_0xd8ae('0x20')](saveUpdates(_0x497e36[_0xd8ae('0x5a')],null))[_0xd8ae('0x20')](respondWithResult(_0x5f965e,null))[_0xd8ae('0x29')](handleError(_0x5f965e,null));};exports[_0xd8ae('0x35')]=function(_0x326dc9,_0x575b43){return db['ChatMessage'][_0xd8ae('0x58')]({'where':{'id':_0x326dc9[_0xd8ae('0x55')]['id']}})['then'](handleEntityNotFound(_0x575b43,null))[_0xd8ae('0x20')](removeEntity(_0x575b43,null))['catch'](handleError(_0x575b43,null));};exports[_0xd8ae('0x5b')]=function(_0x464bb6,_0x25c18d){return db['ChatMessage'][_0xd8ae('0x5b')]()[_0xd8ae('0x20')](respondWithResult(_0x25c18d,null))[_0xd8ae('0x29')](handleError(_0x25c18d,null));};var interaction_log=require('../../config/logger')(_0xd8ae('0x5c'));exports[_0xd8ae('0x5d')]=function(_0xc297fb,_0x421ff0,_0x1a7845){var _0x2f0bdf={'agent':{},'channel':_0xd8ae('0x5e')};if(_0xc297fb['body']['id']){delete _0xc297fb[_0xd8ae('0x5a')]['id'];}_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x5f')]=!![];_0xc297fb[_0xd8ae('0x5a')]['readAt']=moment()[_0xd8ae('0x60')](_0xd8ae('0x61'));_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')]=_0xc297fb['body']['UserId']||_0xc297fb[_0xd8ae('0x63')]['id'];_0x2f0bdf[_0xd8ae('0x64')]['id']=_0xc297fb[_0xd8ae('0x5a')]['UserId'];return db[_0xd8ae('0x3c')]['find']({'where':{'id':_0xc297fb[_0xd8ae('0x55')]['id'],'UserId':null}})[_0xd8ae('0x20')](handleEntityNotFound(_0x421ff0,null))[_0xd8ae('0x20')](saveUpdates(_0xc297fb[_0xd8ae('0x5a')],null))[_0xd8ae('0x20')](function(_0x132dcd){if(_0x132dcd){_0x2f0bdf['message']=_0x132dcd[_0xd8ae('0x65')]({'plain':!![]});return db[_0xd8ae('0x66')]['find']({'where':{'id':_0x132dcd[_0xd8ae('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x421ff0,null))[_0xd8ae('0x20')](function(_0x442004){if(_0x442004){return _0x442004[_0xd8ae('0x34')]({'UserId':_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')],'read1stAt':_[_0xd8ae('0x68')](_0x442004[_0xd8ae('0x69')])?moment()['format'](_0xd8ae('0x61')):undefined});}return null;})[_0xd8ae('0x20')](function(_0x40c219){if(_0x40c219){_0x2f0bdf['interaction']=_0x40c219['get']({'plain':!![]});interaction_log[_0xd8ae('0x21')](_0xd8ae('0x6a'),_0xc297fb[_0xd8ae('0x63')]['id'],_0xc297fb['user'][_0xd8ae('0x38')],_0xc297fb[_0xd8ae('0x63')]['role'],_0x2f0bdf[_0xd8ae('0x6b')]['id'],_0xc297fb[_0xd8ae('0x5a')]?JSON[_0xd8ae('0x24')](_0xc297fb['body']):_0xd8ae('0x6c'));return respondWithRpcPromise(_0xd8ae('0x6d'),_0xd8ae('0x6e'),_0x2f0bdf);}return null;})[_0xd8ae('0x20')](function(_0x1b0308){var _0xb25d82=_0xd8ae('0x6f')+_0x1b0308['message'][_0xd8ae('0x70')];return db[_0xd8ae('0x71')]['query'](_0xb25d82,{'type':db[_0xd8ae('0x72')][_0xd8ae('0x73')][_0xd8ae('0x74')],'raw':!![]})[_0xd8ae('0x20')](function(_0x316218){return _0x316218;});})[_0xd8ae('0x20')](function(_0x518a67){if(_0x518a67){_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x75')]=_0x518a67[0x0];if(!_0xc297fb[_0xd8ae('0x5a')]['UserId'])return;return db['User'][_0xd8ae('0x58')]({'where':{'id':_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0xd8ae('0x76'),'internal'],'raw':!![]});}return null;})[_0xd8ae('0x20')](function(_0x5703eb){if(!_0x5703eb)return null;_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x64')]=_0x5703eb;return _0x2f0bdf;})[_0xd8ae('0x20')](function(_0x24a5db){if(_0x24a5db){if(_0xc297fb[_0xd8ae('0x5a')][_0xd8ae('0x77')]){_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x78')]=util[_0xd8ae('0x60')]('SIP/%s',_0xc297fb[_0xd8ae('0x63')][_0xd8ae('0x38')]);_0x2f0bdf[_0xd8ae('0x27')]['channel']=_0x2f0bdf[_0xd8ae('0x79')];_0x2f0bdf[_0xd8ae('0x27')]['motionChannel']=_0x2f0bdf[_0xd8ae('0x79')];_0x2f0bdf[_0xd8ae('0x27')][_0xd8ae('0x7a')]=_0xd8ae('0x5d');return respondWithRpcPromise(_0xd8ae('0x7b'),'EventManager',{'event':_0xd8ae('0x7c'),'message':_[_0xd8ae('0x4c')](_0x2f0bdf['message'],JSON[_0xd8ae('0x7d')](_0x2f0bdf[_0xd8ae('0x6b')]['formData']))},client9002)[_0xd8ae('0x20')](function(){return _0x2f0bdf;});}return _0x2f0bdf;}return null;})['then'](respondWithResult(_0x421ff0,null))['catch'](handleError(_0x421ff0,null));};var interaction_log=require(_0xd8ae('0x7e'))(_0xd8ae('0x5c'));exports[_0xd8ae('0x32')]=function(_0x2cb653,_0x44b6b2,_0x45a4d4){var _0x583028={'agent':{},'channel':_0xd8ae('0x5e')};if(_0x2cb653[_0xd8ae('0x5a')]['id']){delete _0x2cb653[_0xd8ae('0x5a')]['id'];}_0x2cb653['body'][_0xd8ae('0x62')]=_0x2cb653[_0xd8ae('0x5a')]['UserId']||_0x2cb653[_0xd8ae('0x63')]['id'];_0x583028[_0xd8ae('0x64')]['id']=_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')];return db['ChatMessage'][_0xd8ae('0x58')]({'where':{'id':_0x2cb653['params']['id'],'UserId':null}})[_0xd8ae('0x20')](handleEntityNotFound(_0x44b6b2,null))[_0xd8ae('0x20')](function(_0x1971dc){if(_0x1971dc){_0x583028[_0xd8ae('0x27')]=_0x1971dc[_0xd8ae('0x65')]({'plain':!![]});return db['ChatInteraction'][_0xd8ae('0x58')]({'where':{'id':_0x1971dc[_0xd8ae('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x44b6b2,null))[_0xd8ae('0x20')](function(_0xe914c2){if(_0xe914c2){_0x583028[_0xd8ae('0x6b')]=_0xe914c2[_0xd8ae('0x65')]({'plain':!![]});interaction_log[_0xd8ae('0x21')](_0xd8ae('0x7f'),_0x2cb653[_0xd8ae('0x63')]['id'],_0x2cb653['user'][_0xd8ae('0x38')],_0x2cb653[_0xd8ae('0x63')][_0xd8ae('0x80')],_0x583028[_0xd8ae('0x6b')]['id'],_0x2cb653[_0xd8ae('0x5a')]?JSON[_0xd8ae('0x24')](_0x2cb653['body']):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x583028);}return null;})[_0xd8ae('0x20')](function(_0x53eba7){var _0x21d421=_0xd8ae('0x6f')+_0x53eba7['message'][_0xd8ae('0x70')];return db[_0xd8ae('0x71')][_0xd8ae('0x41')](_0x21d421,{'type':db[_0xd8ae('0x72')]['QueryTypes'][_0xd8ae('0x74')],'raw':!![]})['then'](function(_0x1799c6){return _0x1799c6;});})['then'](function(_0x4c421f){if(_0x4c421f){_0x583028['message'][_0xd8ae('0x75')]=_0x4c421f[0x0];if(!_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')])return;return db[_0xd8ae('0x81')][_0xd8ae('0x58')]({'where':{'id':_0x2cb653[_0xd8ae('0x5a')][_0xd8ae('0x62')],'role':'agent'},'attributes':['id',_0xd8ae('0x38'),_0xd8ae('0x82'),_0xd8ae('0x76'),_0xd8ae('0x83')],'raw':!![]});}return null;})['then'](function(_0x14a12b){if(!_0x14a12b)return null;_0x583028[_0xd8ae('0x27')][_0xd8ae('0x64')]=_0x14a12b;return _0x583028;})['then'](function(_0x44f3d8){if(_0x44f3d8){_0x44f3d8[_0xd8ae('0x27')][_0xd8ae('0x78')]=util[_0xd8ae('0x60')](_0xd8ae('0x84'),_0x2cb653[_0xd8ae('0x63')][_0xd8ae('0x38')]);_0x44f3d8[_0xd8ae('0x27')][_0xd8ae('0x79')]=_0x583028[_0xd8ae('0x79')];_0x44f3d8[_0xd8ae('0x27')]['motionChannel']=_0x583028['channel'];_0x44f3d8['message']['event']=_0xd8ae('0x32');respondWithRpcPromise(_0xd8ae('0x7b'),_0xd8ae('0x7b'),{'event':_0xd8ae('0x85'),'message':_[_0xd8ae('0x4c')](_0x583028['message'],JSON[_0xd8ae('0x7d')](_0x583028[_0xd8ae('0x6b')][_0xd8ae('0x86')]))},client9002);return _0x583028;}return null;})[_0xd8ae('0x20')](respondWithResult(_0x44b6b2,null))['catch'](handleError(_0x44b6b2,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 5021504..ca913b6 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 _0x73e6=['../../mysqldb','ChatMessage','remove','emit','hasOwnProperty'];(function(_0x5440ba,_0xf350cc){var _0x54e377=function(_0x26c67a){while(--_0x26c67a){_0x5440ba['push'](_0x5440ba['shift']());}};_0x54e377(++_0xf350cc);}(_0x73e6,0x11d));var _0x673e=function(_0x5dcce1,_0x5c8a64){_0x5dcce1=_0x5dcce1-0x0;var _0x554d28=_0x73e6[_0x5dcce1];return _0x554d28;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x673e('0x0'))['db'][_0x673e('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x673e('0x2')};function emitEvent(_0x2d503b){return function(_0x1f992f,_0x4749fc,_0x2e2bd1){ChatMessageEvents[_0x673e('0x3')](_0x2d503b+':'+_0x1f992f['id'],_0x1f992f);ChatMessageEvents[_0x673e('0x3')](_0x2d503b,_0x1f992f);_0x2e2bd1(null);};}for(var e in events){if(events[_0x673e('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x3432=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x193653,_0x422a45){var _0x1ed7b8=function(_0xdc78ca){while(--_0xdc78ca){_0x193653['push'](_0x193653['shift']());}};_0x1ed7b8(++_0x422a45);}(_0x3432,0x163));var _0x2343=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3432[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x2343('0x0'));var ChatMessage=require(_0x2343('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x2343('0x2')](0x0);var events={'afterCreate':_0x2343('0x3'),'afterUpdate':_0x2343('0x4'),'afterDestroy':_0x2343('0x5')};function emitEvent(_0x28ae09){return function(_0x49c984,_0x3a5a89,_0x217adc){ChatMessageEvents[_0x2343('0x6')](_0x28ae09+':'+_0x49c984['id'],_0x49c984);ChatMessageEvents[_0x2343('0x6')](_0x28ae09,_0x49c984);_0x217adc(null);};}for(var e in events){if(events[_0x2343('0x7')](e)){var event=events[e];ChatMessage[_0x2343('0x8')](e,emitEvent(event));}}module[_0x2343('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index d9a6e26..a584c4b 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 _0xe697=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','findOne','ChatInteractionId','update','createdAt','catch'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe697,0x1cf));var _0x7e69=function(_0x5447aa,_0x3afc00){_0x5447aa=_0x5447aa-0x0;var _0xb21e53=_0xe697[_0x5447aa];return _0xb21e53;};'use strict';var _=require('lodash');var util=require(_0x7e69('0x0'));var logger=require(_0x7e69('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7e69('0x2'));var rp=require(_0x7e69('0x3'));var fs=require('fs');var path=require(_0x7e69('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x56dca7,_0x5c893a){return _0x56dca7[_0x7e69('0x5')]('ChatMessage',attributes,{'tableName':_0x7e69('0x6'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x7e69('0x7')],'type':_0x7e69('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x210b71,_0x564857,_0xf9f2fa){var _0x13f5ea=_0x56dca7[_0x7e69('0x9')];var _0x288df0=_0x210b71[_0x7e69('0xa')]({'plain':!![]});if(_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='in'||_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()==='out'&&!_0x288df0[_0x7e69('0xd')]&&!_[_0x7e69('0xe')](_0x288df0['UserId'])){_0x13f5ea['ChatInteraction'][_0x7e69('0xf')]({'where':{'id':_0x288df0[_0x7e69('0x10')]}})['then'](function(_0x4be24c){if(_0x4be24c){_0x4be24c[_0x7e69('0x11')]({'lastMsgAt':_0x288df0[_0x7e69('0x12')],'lastMsgDirection':_0x288df0[_0x7e69('0xb')][_0x7e69('0xc')]()});}})[_0x7e69('0x13')](function(_0x40ef2a){console[_0x7e69('0x14')](_0x40ef2a);});}_0xf9f2fa();}},'charset':_0x7e69('0x15'),'collate':_0x7e69('0x16')});};
\ No newline at end of file
+var _0xea49=['request-promise','path','rimraf','./chatMessage.attributes','exports','define','fti_chat_messages','body','FULLTEXT','models','get','direction','out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','toLowerCase','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x161587,_0x5c4528){var _0x293546=function(_0x40406e){while(--_0x40406e){_0x161587['push'](_0x161587['shift']());}};_0x293546(++_0x5c4528);}(_0xea49,0x14b));var _0x9ea4=function(_0x213ed5,_0x26712a){_0x213ed5=_0x213ed5-0x0;var _0x191514=_0xea49[_0x213ed5];return _0x191514;};'use strict';var _=require(_0x9ea4('0x0'));var util=require(_0x9ea4('0x1'));var logger=require('../../config/logger')(_0x9ea4('0x2'));var moment=require(_0x9ea4('0x3'));var BPromise=require(_0x9ea4('0x4'));var rp=require(_0x9ea4('0x5'));var fs=require('fs');var path=require(_0x9ea4('0x6'));var rimraf=require(_0x9ea4('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ea4('0x8'));module[_0x9ea4('0x9')]=function(_0x28aa83,_0x1cd230){return _0x28aa83[_0x9ea4('0xa')]('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9ea4('0xb'),'fields':[_0x9ea4('0xc')],'type':_0x9ea4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x231ec0,_0x433d5a,_0x3e81b8){var _0x4fbdf0=_0x28aa83[_0x9ea4('0xe')];var _0x2f8309=_0x231ec0[_0x9ea4('0xf')]({'plain':!![]});if(_0x2f8309[_0x9ea4('0x10')]['toLowerCase']()==='in'||_0x2f8309[_0x9ea4('0x10')]['toLowerCase']()===_0x9ea4('0x11')&&!_0x2f8309[_0x9ea4('0x12')]&&!_[_0x9ea4('0x13')](_0x2f8309[_0x9ea4('0x14')])){_0x4fbdf0[_0x9ea4('0x15')][_0x9ea4('0x16')]({'where':{'id':_0x2f8309['ChatInteractionId']}})[_0x9ea4('0x17')](function(_0x54f930){if(_0x54f930){_0x54f930['update']({'lastMsgAt':_0x2f8309[_0x9ea4('0x18')],'lastMsgDirection':_0x2f8309[_0x9ea4('0x10')][_0x9ea4('0x19')]()});}})[_0x9ea4('0x1a')](function(_0x3bf7a5){console['error'](_0x3bf7a5);});}_0x3e81b8();}},'charset':'utf8mb4','collate':_0x9ea4('0x1b')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index ed9c315..5df5ca8 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 _0xb4c9=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','stringify','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xb4c9,0xbf));var _0x9b4c=function(_0x43a88c,_0x452929){_0x43a88c=_0x43a88c-0x0;var _0x5f267f=_0xb4c9[_0x43a88c];return _0x5f267f;};'use strict';var _=require('lodash');var util=require(_0x9b4c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9b4c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b4c('0x2'));var logger=require(_0x9b4c('0x3'))(_0x9b4c('0x4'));var config=require(_0x9b4c('0x5'));var jayson=require(_0x9b4c('0x6'));var client=jayson[_0x9b4c('0x7')][_0x9b4c('0x8')]({'port':0x232a});config[_0x9b4c('0x9')]=_[_0x9b4c('0xa')](config[_0x9b4c('0x9')],{'host':_0x9b4c('0xb'),'port':0x18eb});var socket=require(_0x9b4c('0xc'))(new Redis(config[_0x9b4c('0x9')]));require('./chatMessage.socket')[_0x9b4c('0xd')](socket);function respondWithRpcPromise(_0x300a7a,_0x23210b,_0x315437){return new BPromise(function(_0x46e6f5,_0xe7b36d){return client[_0x9b4c('0xe')](_0x300a7a,_0x315437)[_0x9b4c('0xf')](function(_0xb27041){logger[_0x9b4c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'));logger[_0x9b4c('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x23210b,_0x9b4c('0x11'),JSON['stringify'](_0xb27041));if(_0xb27041[_0x9b4c('0x13')]){if(_0xb27041['error'][_0x9b4c('0x14')]===0x1f4){logger[_0x9b4c('0x13')](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')][_0x9b4c('0x16')]);return _0xe7b36d(_0xb27041[_0x9b4c('0x13')]['message']);}logger['error'](_0x9b4c('0x15'),_0x23210b,_0xb27041[_0x9b4c('0x13')]['message']);return _0x46e6f5(_0xb27041['error'][_0x9b4c('0x16')]);}else{logger['info'](_0x9b4c('0x15'),_0x23210b,_0x9b4c('0x11'));_0x46e6f5(_0xb27041[_0x9b4c('0x17')][_0x9b4c('0x16')]);}})[_0x9b4c('0x18')](function(_0x3c797d){logger[_0x9b4c('0x13')]('ChatMessage,\x20%s,\x20%s',_0x23210b,_0x3c797d);_0xe7b36d(_0x3c797d);});});}exports['CreateChatMessage']=function(_0xd03081){var _0x27ee27=this;return new Promise(function(_0x2916c9,_0x1cbf69){return db[_0x9b4c('0x19')][_0x9b4c('0x1a')](_0xd03081[_0x9b4c('0x1b')],{'raw':_0xd03081['options']?_0xd03081[_0x9b4c('0x1c')][_0x9b4c('0x1d')]===undefined?!![]:![]:!![]})[_0x9b4c('0xf')](function(_0x34f82c){logger[_0x9b4c('0x10')](_0x9b4c('0x1e'),_0xd03081);logger[_0x9b4c('0x12')]('CreateChatMessage',_0xd03081,JSON[_0x9b4c('0x1f')](_0x34f82c));_0x2916c9(_0x34f82c);})[_0x9b4c('0x18')](function(_0x53c6a3){logger[_0x9b4c('0x13')](_0x9b4c('0x1e'),_0x53c6a3[_0x9b4c('0x16')],_0xd03081);_0x1cbf69(_0x27ee27['error'](0x1f4,_0x53c6a3[_0x9b4c('0x16')]));});});};
\ No newline at end of file
+var _0xa673=['ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateChatMessage','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket','request','then'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xa673,0x17b));var _0x3a67=function(_0x35005f,_0x4dad9f){_0x35005f=_0x35005f-0x0;var _0x1f0270=_0xa673[_0x35005f];return _0x1f0270;};'use strict';var _=require(_0x3a67('0x0'));var util=require(_0x3a67('0x1'));var moment=require(_0x3a67('0x2'));var BPromise=require(_0x3a67('0x3'));var rs=require(_0x3a67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a67('0x5'))['db'];var utils=require(_0x3a67('0x6'));var logger=require(_0x3a67('0x7'))('rpc');var config=require(_0x3a67('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3a67('0x9')][_0x3a67('0xa')]({'port':0x232a});config['redis']=_[_0x3a67('0xb')](config[_0x3a67('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3a67('0xd'))(new Redis(config[_0x3a67('0xc')]));require(_0x3a67('0xe'))['register'](socket);function respondWithRpcPromise(_0x5195d2,_0x3b3ed2,_0x27f828){return new BPromise(function(_0x1884e2,_0x1774f4){return client[_0x3a67('0xf')](_0x5195d2,_0x27f828)[_0x3a67('0x10')](function(_0x4ff92f){logger['info'](_0x3a67('0x11'),_0x3b3ed2,'request\x20sent');logger['debug'](_0x3a67('0x12'),_0x3b3ed2,_0x3a67('0x13'),JSON['stringify'](_0x4ff92f));if(_0x4ff92f[_0x3a67('0x14')]){if(_0x4ff92f['error'][_0x3a67('0x15')]===0x1f4){logger[_0x3a67('0x14')](_0x3a67('0x11'),_0x3b3ed2,_0x4ff92f['error'][_0x3a67('0x16')]);return _0x1774f4(_0x4ff92f[_0x3a67('0x14')][_0x3a67('0x16')]);}logger[_0x3a67('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3b3ed2,_0x4ff92f['error'][_0x3a67('0x16')]);return _0x1884e2(_0x4ff92f[_0x3a67('0x14')][_0x3a67('0x16')]);}else{logger[_0x3a67('0x17')](_0x3a67('0x11'),_0x3b3ed2,_0x3a67('0x13'));_0x1884e2(_0x4ff92f[_0x3a67('0x18')][_0x3a67('0x16')]);}})[_0x3a67('0x19')](function(_0x1c4b43){logger[_0x3a67('0x14')](_0x3a67('0x11'),_0x3b3ed2,_0x1c4b43);_0x1774f4(_0x1c4b43);});});}exports[_0x3a67('0x1a')]=function(_0x2b9813){var _0x2115dd=this;return new Promise(function(_0x372778,_0xc08b88){return db['ChatMessage'][_0x3a67('0x1b')](_0x2b9813[_0x3a67('0x1c')],{'raw':_0x2b9813[_0x3a67('0x1d')]?_0x2b9813[_0x3a67('0x1d')][_0x3a67('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xb199d){logger['info'](_0x3a67('0x1a'),_0x2b9813);logger[_0x3a67('0x1f')](_0x3a67('0x1a'),_0x2b9813,JSON[_0x3a67('0x20')](_0xb199d));_0x372778(_0xb199d);})[_0x3a67('0x19')](function(_0x225481){logger[_0x3a67('0x14')]('CreateChatMessage',_0x225481[_0x3a67('0x16')],_0x2b9813);_0xc08b88(_0x2115dd[_0x3a67('0x14')](0x1f4,_0x225481['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 69faa2d..c706f62 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 _0x7c09=['save','remove','emit','removeListener','length','chatMessage:'];(function(_0x39ec63,_0x346199){var _0x5802e1=function(_0x286585){while(--_0x286585){_0x39ec63['push'](_0x39ec63['shift']());}};_0x5802e1(++_0x346199);}(_0x7c09,0x102));var _0x97c0=function(_0x4f39ad,_0x1cd3be){_0x4f39ad=_0x4f39ad-0x0;var _0x6da4ff=_0x7c09[_0x4f39ad];return _0x6da4ff;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x97c0('0x0'),_0x97c0('0x1'),'update'];function createListener(_0xfbf689,_0x7d8f6f){return function(_0x2d04b9){_0x7d8f6f[_0x97c0('0x2')](_0xfbf689,_0x2d04b9);};}function removeListener(_0x12eb6d,_0x99bf54){return function(){ChatMessageEvents[_0x97c0('0x3')](_0x12eb6d,_0x99bf54);};}exports['register']=function(_0x4b2f81){for(var _0x590368=0x0,_0x46fdd9=events[_0x97c0('0x4')];_0x590368<_0x46fdd9;_0x590368++){var _0x2c19fa=events[_0x590368];var _0x109bc8=createListener(_0x97c0('0x5')+_0x2c19fa,_0x4b2f81);ChatMessageEvents['on'](_0x2c19fa,_0x109bc8);}};
\ No newline at end of file
+var _0x47c7=['./chatMessage.events','remove','update','removeListener','register','length','chatMessage:'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x47c7,0x1ab));var _0x747c=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x47c7[_0x12a554];return _0x244ba0;};'use strict';var ChatMessageEvents=require(_0x747c('0x0'));var events=['save',_0x747c('0x1'),_0x747c('0x2')];function createListener(_0x4a6fc3,_0xbe1d88){return function(_0x2af847){_0xbe1d88['emit'](_0x4a6fc3,_0x2af847);};}function removeListener(_0x3313cd,_0x3c0c0){return function(){ChatMessageEvents[_0x747c('0x3')](_0x3313cd,_0x3c0c0);};}exports[_0x747c('0x4')]=function(_0x5e991e){for(var _0xa1148a=0x0,_0x4eb6bc=events[_0x747c('0x5')];_0xa1148a<_0x4eb6bc;_0xa1148a++){var _0x24206f=events[_0xa1148a];var _0x10b9f0=createListener(_0x747c('0x6')+_0x24206f,_0x5e991e);ChatMessageEvents['on'](_0x24206f,_0x10b9f0);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 1c2c249..b00560b 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 _0xecd9=['./chatMessage.controller','get','isAuthenticated','/describe','describe','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject','reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x154b29,_0x4aab17){var _0x48b5c6=function(_0x3ac71a){while(--_0x3ac71a){_0x154b29['push'](_0x154b29['shift']());}};_0x48b5c6(++_0x4aab17);}(_0xecd9,0x162));var _0x9ecd=function(_0x24143b,_0x536f6d){_0x24143b=_0x24143b-0x0;var _0x324c9a=_0xecd9[_0x24143b];return _0x324c9a;};'use strict';var multer=require(_0x9ecd('0x0'));var util=require(_0x9ecd('0x1'));var path=require(_0x9ecd('0x2'));var timeout=require(_0x9ecd('0x3'));var express=require(_0x9ecd('0x4'));var router=express[_0x9ecd('0x5')]();var fs_extra=require(_0x9ecd('0x6'));var auth=require(_0x9ecd('0x7'));var interaction=require(_0x9ecd('0x8'));var config=require(_0x9ecd('0x9'));var controller=require(_0x9ecd('0xa'));router[_0x9ecd('0xb')]('/',auth[_0x9ecd('0xc')](),controller['index']);router['get'](_0x9ecd('0xd'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xe')]);router[_0x9ecd('0xb')]('/:id',auth[_0x9ecd('0xc')](),controller[_0x9ecd('0xf')]);router[_0x9ecd('0x10')]('/',auth[_0x9ecd('0xc')](),interaction[_0x9ecd('0x11')](_0x9ecd('0x12'),_0x9ecd('0x13')),controller[_0x9ecd('0x14')]);router[_0x9ecd('0x15')]('/:id',controller[_0x9ecd('0x16')]);router['put']('/:id/accept',auth[_0x9ecd('0xc')](),controller['accept']);router[_0x9ecd('0x15')](_0x9ecd('0x17'),auth['isAuthenticated'](),controller[_0x9ecd('0x18')]);router['delete'](_0x9ecd('0x19'),auth[_0x9ecd('0xc')](),controller[_0x9ecd('0x1a')]);module[_0x9ecd('0x1b')]=router;
\ No newline at end of file
+var _0x10d5=['chat','chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','destroy','exports','multer','util','connect-timeout','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked'];(function(_0x52f975,_0x4e4e7d){var _0x1103e7=function(_0x5d82fc){while(--_0x5d82fc){_0x52f975['push'](_0x52f975['shift']());}};_0x1103e7(++_0x4e4e7d);}(_0x10d5,0xab));var _0x510d=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x10d5[_0x4409e7];return _0x24c751;};'use strict';var multer=require(_0x510d('0x0'));var util=require(_0x510d('0x1'));var path=require('path');var timeout=require(_0x510d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x510d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x510d('0x4'));router[_0x510d('0x5')]('/',auth[_0x510d('0x6')](),controller[_0x510d('0x7')]);router[_0x510d('0x5')](_0x510d('0x8'),auth[_0x510d('0x6')](),controller[_0x510d('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x510d('0xa')]);router[_0x510d('0xb')]('/',auth[_0x510d('0x6')](),interaction[_0x510d('0xc')](_0x510d('0xd'),_0x510d('0xe')),controller[_0x510d('0xf')]);router[_0x510d('0x10')](_0x510d('0x11'),controller['update']);router[_0x510d('0x10')](_0x510d('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x510d('0x13'),auth['isAuthenticated'](),controller[_0x510d('0x14')]);router['delete']('/:id',auth[_0x510d('0x6')](),controller[_0x510d('0x15')]);module[_0x510d('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index da45158..192ce44 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x596cc0,_0x4e1a74){var _0x37dc4f=function(_0x47a0dd){while(--_0x47a0dd){_0x596cc0['push'](_0x596cc0['shift']());}};_0x37dc4f(++_0x4e1a74);}(_0xb10b,0x12a));var _0xbb10=function(_0x11d684,_0x4d4123){_0x11d684=_0x11d684-0x0;var _0x78a301=_0xb10b[_0x11d684];return _0x78a301;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x0b0e[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 1fbe08e..b07432d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x4cf785,_0x3158dc){_0x4cf785=_0x4cf785-0x0;var _0x2c8d9c=_0x7a54[_0x4cf785];return _0x2c8d9c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x7a54,0x106));var _0x47a5=function(_0x562c00,_0x185000){_0x562c00=_0x562c00-0x0;var _0x1a0c79=_0x7a54[_0x562c00];return _0x1a0c79;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index f24f1c6..193c9c8 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf02c=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x2bfe2d,_0x694d7f){var _0x489188=function(_0x56b625){while(--_0x56b625){_0x2bfe2d['push'](_0x2bfe2d['shift']());}};_0x489188(++_0x694d7f);}(_0xf02c,0x92));var _0xcf02=function(_0xb48270,_0x536ef3){_0xb48270=_0xb48270-0x0;var _0x457510=_0xf02c[_0xb48270];return _0x457510;};'use strict';var EventEmitter=require(_0xcf02('0x0'));var ChatOfflineMessage=require(_0xcf02('0x1'))['db'][_0xcf02('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xcf02('0x3')](0x0);var events={'afterCreate':_0xcf02('0x4'),'afterUpdate':_0xcf02('0x5'),'afterDestroy':_0xcf02('0x6')};function emitEvent(_0x378e8b){return function(_0x3abde3,_0x354198,_0x3e8829){ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b+':'+_0x3abde3['id'],_0x3abde3);ChatOfflineMessageEvents[_0xcf02('0x7')](_0x378e8b,_0x3abde3);_0x3e8829(null);};}for(var e in events){if(events[_0xcf02('0x8')](e)){var event=events[e];ChatOfflineMessage[_0xcf02('0x9')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x7449=['emit','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','update'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7449,0x14b));var _0x9744=function(_0x27e1fe,_0x194c88){_0x27e1fe=_0x27e1fe-0x0;var _0x37d1b7=_0x7449[_0x27e1fe];return _0x37d1b7;};'use strict';var EventEmitter=require(_0x9744('0x0'));var ChatOfflineMessage=require(_0x9744('0x1'))['db'][_0x9744('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9744('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9744('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1243a4){return function(_0x5df42f,_0x31aad8,_0x149ff6){ChatOfflineMessageEvents[_0x9744('0x5')](_0x1243a4+':'+_0x5df42f['id'],_0x5df42f);ChatOfflineMessageEvents[_0x9744('0x5')](_0x1243a4,_0x5df42f);_0x149ff6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x9744('0x6')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index cd6f30c..f3a917f 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 _0x7506=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x37044b,_0x1351f1){var _0x7c82f2=function(_0x4d6504){while(--_0x4d6504){_0x37044b['push'](_0x37044b['shift']());}};_0x7c82f2(++_0x1351f1);}(_0x7506,0x184));var _0x6750=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x7506[_0x341e0f];return _0x59555a;};'use strict';var attributes=require(_0x6750('0x0'));module[_0x6750('0x1')]=function(_0x25f152){return _0x25f152[_0x6750('0x2')](_0x6750('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6750('0x4'),'collate':_0x6750('0x5')});};
\ No newline at end of file
+var _0xc1fb=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x4cb9aa,_0x58b44f){var _0x2eff51=function(_0x18a09c){while(--_0x18a09c){_0x4cb9aa['push'](_0x4cb9aa['shift']());}};_0x2eff51(++_0x58b44f);}(_0xc1fb,0xd8));var _0xbc1f=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xc1fb[_0x5f5cce];return _0x705ecf;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xbc1f('0x0')]=function(_0x4f7d3a){return _0x4f7d3a['define'](_0xbc1f('0x1'),attributes,{'tableName':_0xbc1f('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc1f('0x3'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 1566149..0706eb0 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 _0x2809=['../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x36ded5,_0x4351bd){var _0x582ca6=function(_0x538838){while(--_0x538838){_0x36ded5['push'](_0x36ded5['shift']());}};_0x582ca6(++_0x4351bd);}(_0x2809,0x190));var _0x9280=function(_0x9aad68,_0x45377){_0x9aad68=_0x9aad68-0x0;var _0x281340=_0x2809[_0x9aad68];return _0x281340;};'use strict';var _=require(_0x9280('0x0'));var util=require(_0x9280('0x1'));var moment=require(_0x9280('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9280('0x3'));var db=require(_0x9280('0x4'))['db'];var utils=require(_0x9280('0x5'));var logger=require(_0x9280('0x6'))(_0x9280('0x7'));var config=require(_0x9280('0x8'));var jayson=require(_0x9280('0x9'));var client=jayson[_0x9280('0xa')][_0x9280('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188f08,_0x22c1ac,_0x2d2345){return new BPromise(function(_0x5af08e,_0x86f0bc){return client[_0x9280('0xc')](_0x188f08,_0x2d2345)[_0x9280('0xd')](function(_0x45dd4e){logger[_0x9280('0xe')](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));logger[_0x9280('0x11')](_0x9280('0x12'),_0x22c1ac,_0x9280('0x10'),JSON[_0x9280('0x13')](_0x45dd4e));if(_0x45dd4e[_0x9280('0x14')]){if(_0x45dd4e[_0x9280('0x14')]['code']===0x1f4){logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x86f0bc(_0x45dd4e[_0x9280('0x14')]['message']);}logger[_0x9280('0x14')](_0x9280('0xf'),_0x22c1ac,_0x45dd4e['error'][_0x9280('0x15')]);return _0x5af08e(_0x45dd4e[_0x9280('0x14')][_0x9280('0x15')]);}else{logger['info'](_0x9280('0xf'),_0x22c1ac,_0x9280('0x10'));_0x5af08e(_0x45dd4e[_0x9280('0x16')][_0x9280('0x15')]);}})[_0x9280('0x17')](function(_0x1cb4cd){logger['error'](_0x9280('0xf'),_0x22c1ac,_0x1cb4cd);_0x86f0bc(_0x1cb4cd);});});}
\ No newline at end of file
+var _0xa6e7=['stringify','error','code','message','catch','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5270b4,_0x5ad6c0){var _0x40dff8=function(_0x4d0b5f){while(--_0x4d0b5f){_0x5270b4['push'](_0x5270b4['shift']());}};_0x40dff8(++_0x5ad6c0);}(_0xa6e7,0xb0));var _0x7a6e=function(_0xfbb8c3,_0xdc7b86){_0xfbb8c3=_0xfbb8c3-0x0;var _0x134bc2=_0xa6e7[_0xfbb8c3];return _0x134bc2;};'use strict';var _=require(_0x7a6e('0x0'));var util=require('util');var moment=require(_0x7a6e('0x1'));var BPromise=require(_0x7a6e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a6e('0x3'));var logger=require(_0x7a6e('0x4'))(_0x7a6e('0x5'));var config=require(_0x7a6e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7a6e('0x7')][_0x7a6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e3ec1,_0x48f81e,_0x56984a){return new BPromise(function(_0x50d511,_0x415f8d){return client[_0x7a6e('0x9')](_0x2e3ec1,_0x56984a)['then'](function(_0x4adb65){logger[_0x7a6e('0xa')](_0x7a6e('0xb'),_0x48f81e,_0x7a6e('0xc'));logger[_0x7a6e('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x48f81e,_0x7a6e('0xc'),JSON[_0x7a6e('0xe')](_0x4adb65));if(_0x4adb65['error']){if(_0x4adb65[_0x7a6e('0xf')][_0x7a6e('0x10')]===0x1f4){logger[_0x7a6e('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48f81e,_0x4adb65[_0x7a6e('0xf')]['message']);return _0x415f8d(_0x4adb65[_0x7a6e('0xf')]['message']);}logger[_0x7a6e('0xf')](_0x7a6e('0xb'),_0x48f81e,_0x4adb65[_0x7a6e('0xf')]['message']);return _0x50d511(_0x4adb65['error'][_0x7a6e('0x11')]);}else{logger[_0x7a6e('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x48f81e,_0x7a6e('0xc'));_0x50d511(_0x4adb65['result'][_0x7a6e('0x11')]);}})[_0x7a6e('0x12')](function(_0x68974d){logger['error'](_0x7a6e('0xb'),_0x48f81e,_0x68974d);_0x415f8d(_0x68974d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index b64e104..676cdd7 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 _0x14c4=['isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get'];(function(_0x207aa7,_0x191d10){var _0x2617b4=function(_0x4e70e7){while(--_0x4e70e7){_0x207aa7['push'](_0x207aa7['shift']());}};_0x2617b4(++_0x191d10);}(_0x14c4,0x9d));var _0x414c=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0x14c4[_0x1c0e91];return _0x34322c;};'use strict';var multer=require(_0x414c('0x0'));var util=require(_0x414c('0x1'));var path=require(_0x414c('0x2'));var timeout=require('connect-timeout');var express=require(_0x414c('0x3'));var router=express[_0x414c('0x4')]();var fs_extra=require(_0x414c('0x5'));var auth=require(_0x414c('0x6'));var interaction=require(_0x414c('0x7'));var config=require(_0x414c('0x8'));var controller=require(_0x414c('0x9'));router[_0x414c('0xa')]('/',auth[_0x414c('0xb')](),controller[_0x414c('0xc')]);router[_0x414c('0xa')](_0x414c('0xd'),auth[_0x414c('0xb')](),controller[_0x414c('0xe')]);router[_0x414c('0xa')](_0x414c('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x414c('0x10')]('/',auth[_0x414c('0xb')](),controller['create']);router[_0x414c('0x11')](_0x414c('0xf'),auth[_0x414c('0xb')](),controller['update']);router[_0x414c('0x12')](_0x414c('0xf'),auth['isAuthenticated'](),controller[_0x414c('0x13')]);module[_0x414c('0x14')]=router;
\ No newline at end of file
+var _0x5068=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x3a430b,_0x3b491a){var _0x470839=function(_0x120be2){while(--_0x120be2){_0x3a430b['push'](_0x3a430b['shift']());}};_0x470839(++_0x3b491a);}(_0x5068,0xe3));var _0x8506=function(_0x5c4c20,_0x59b68b){_0x5c4c20=_0x5c4c20-0x0;var _0x1defb5=_0x5068[_0x5c4c20];return _0x1defb5;};'use strict';var multer=require(_0x8506('0x0'));var util=require(_0x8506('0x1'));var path=require(_0x8506('0x2'));var timeout=require(_0x8506('0x3'));var express=require(_0x8506('0x4'));var router=express[_0x8506('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8506('0x6'));var interaction=require(_0x8506('0x7'));var config=require(_0x8506('0x8'));var controller=require('./chatOfflineMessage.controller');router[_0x8506('0x9')]('/',auth[_0x8506('0xa')](),controller[_0x8506('0xb')]);router[_0x8506('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x8506('0xc')]);router[_0x8506('0x9')](_0x8506('0xd'),auth[_0x8506('0xa')](),controller[_0x8506('0xe')]);router[_0x8506('0xf')]('/',auth[_0x8506('0xa')](),controller[_0x8506('0x10')]);router[_0x8506('0x11')](_0x8506('0xd'),auth[_0x8506('0xa')](),controller[_0x8506('0x12')]);router[_0x8506('0x13')]('/:id',auth[_0x8506('0xa')](),controller[_0x8506('0x14')]);module[_0x8506('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index dc3e059..7e25f26 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 _0x870e=['sequelize','exports','STRING','mouseOver','timeout','INTEGER'];(function(_0x3f6cc0,_0x432b00){var _0xfc7086=function(_0x34f4af){while(--_0x34f4af){_0x3f6cc0['push'](_0x3f6cc0['shift']());}};_0xfc7086(++_0x432b00);}(_0x870e,0x17a));var _0xe870=function(_0x5d3f47,_0x1bce6f){_0x5d3f47=_0x5d3f47-0x0;var _0x3628e7=_0x870e[_0x5d3f47];return _0x3628e7;};'use strict';var Sequelize=require(_0xe870('0x0'));module[_0xe870('0x1')]={'name':{'type':Sequelize[_0xe870('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe870('0x3'),_0xe870('0x4')),'defaultValue':_0xe870('0x3')},'selector':{'type':Sequelize[_0xe870('0x2')]},'timeout':{'type':Sequelize[_0xe870('0x5')]}};
\ No newline at end of file
+var _0x3b93=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x5b5199,_0x58a8e5){var _0x2f5736=function(_0x1f35ce){while(--_0x1f35ce){_0x5b5199['push'](_0x5b5199['shift']());}};_0x2f5736(++_0x58a8e5);}(_0x3b93,0xe0));var _0x33b9=function(_0x2a8e31,_0x5c4853){_0x2a8e31=_0x2a8e31-0x0;var _0x11cc23=_0x3b93[_0x2a8e31];return _0x11cc23;};'use strict';var Sequelize=require(_0x33b9('0x0'));module[_0x33b9('0x1')]={'name':{'type':Sequelize[_0x33b9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x33b9('0x3')](_0x33b9('0x4'),_0x33b9('0x5')),'defaultValue':_0x33b9('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x33b9('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index faa1079..9a36499 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 _0x1c88=['filters','model','attributes','intersection','fields','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1c88,0x1a9));var _0x81c8=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x1c88[_0x52e68e];return _0x3211a4;};'use strict';var emlformat=require(_0x81c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x81c8('0x1'));var jsonpatch=require(_0x81c8('0x2'));var rp=require(_0x81c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81c8('0x4'));var util=require(_0x81c8('0x5'));var path=require(_0x81c8('0x6'));var sox=require(_0x81c8('0x7'));var csv=require(_0x81c8('0x8'));var ejs=require(_0x81c8('0x9'));var fs=require('fs');var fs_extra=require(_0x81c8('0xa'));var _=require(_0x81c8('0xb'));var squel=require(_0x81c8('0xc'));var crypto=require(_0x81c8('0xd'));var jsforce=require(_0x81c8('0xe'));var deskjs=require(_0x81c8('0xf'));var toCsv=require(_0x81c8('0x8'));var querystring=require('querystring');var Papa=require(_0x81c8('0x10'));var Redis=require(_0x81c8('0x11'));var authService=require(_0x81c8('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81c8('0x13'));var logger=require(_0x81c8('0x14'))(_0x81c8('0x15'));var utils=require('../../config/utils');var config=require(_0x81c8('0x16'));var licenseUtil=require(_0x81c8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40061f,_0x1d0a15){_0x1d0a15=_0x1d0a15||0xcc;return function(_0x1d71f3){if(_0x1d71f3){return _0x40061f[_0x81c8('0x18')](_0x1d0a15);}return _0x40061f['status'](_0x1d0a15)[_0x81c8('0x19')]();};}function respondWithResult(_0x28b41f,_0x147d9e){_0x147d9e=_0x147d9e||0xc8;return function(_0x5e9a80){if(_0x5e9a80){return _0x28b41f[_0x81c8('0x1a')](_0x147d9e)[_0x81c8('0x1b')](_0x5e9a80);}};}function respondWithFilteredResult(_0x136cde,_0x55d438){return function(_0x10732c){if(_0x10732c){var _0x43a548=typeof _0x55d438[_0x81c8('0x1c')]===_0x81c8('0x1d')&&typeof _0x55d438[_0x81c8('0x1e')]==='undefined';var _0x3f7bf3=_0x10732c[_0x81c8('0x1f')];var _0x573a83=_0x43a548?0x0:_0x55d438[_0x81c8('0x1c')];var _0x1b74d1=_0x43a548?_0x10732c[_0x81c8('0x1f')]:_0x55d438[_0x81c8('0x1c')]+_0x55d438[_0x81c8('0x1e')];var _0x330ef2;if(_0x1b74d1>=_0x3f7bf3){_0x1b74d1=_0x3f7bf3;_0x330ef2=0xc8;}else{_0x330ef2=0xce;}_0x136cde[_0x81c8('0x1a')](_0x330ef2);return _0x136cde[_0x81c8('0x20')](_0x81c8('0x21'),_0x573a83+'-'+_0x1b74d1+'/'+_0x3f7bf3)['json'](_0x10732c);}return null;};}function patchUpdates(_0x2af7b6){return function(_0x5662c7){try{jsonpatch['apply'](_0x5662c7,_0x2af7b6,!![]);}catch(_0x5821d4){return BPromise['reject'](_0x5821d4);}return _0x5662c7[_0x81c8('0x22')]();};}function saveUpdates(_0x513d85,_0x147382){return function(_0x42fb26){if(_0x42fb26){return _0x42fb26[_0x81c8('0x23')](_0x513d85)[_0x81c8('0x24')](function(_0xcccbc){return _0xcccbc;});}return null;};}function removeEntity(_0x32c98a,_0x43d9f2){return function(_0x24674b){if(_0x24674b){return _0x24674b[_0x81c8('0x25')]()[_0x81c8('0x24')](function(){_0x32c98a[_0x81c8('0x1a')](0xcc)[_0x81c8('0x19')]();});}};}function handleEntityNotFound(_0x490d58,_0x52ff11){return function(_0xb71afc){if(!_0xb71afc){_0x490d58[_0x81c8('0x18')](0x194);}return _0xb71afc;};}function handleError(_0x3f06e7,_0x2174f2){_0x2174f2=_0x2174f2||0x1f4;return function(_0x5ac31d){logger[_0x81c8('0x26')](_0x5ac31d['stack']);if(_0x5ac31d[_0x81c8('0x27')]){delete _0x5ac31d[_0x81c8('0x27')];}_0x3f06e7[_0x81c8('0x1a')](_0x2174f2)[_0x81c8('0x28')](_0x5ac31d);};}exports[_0x81c8('0x29')]=function(_0x3ac0e4,_0xbe3e16){var _0xd4514={'raw':!![],'where':{'id':_0x3ac0e4[_0x81c8('0x2a')]['id']}},_0x5a2929={};_0x5a2929['model']=_[_0x81c8('0x2b')](db[_0x81c8('0x2c')][_0x81c8('0x2d')]);_0x5a2929[_0x81c8('0x2e')]=_[_0x81c8('0x2b')](_0x3ac0e4[_0x81c8('0x2e')]);_0x5a2929[_0x81c8('0x2f')]=_['intersection'](_0x5a2929[_0x81c8('0x30')],_0x5a2929['query']);_0xd4514[_0x81c8('0x31')]=_[_0x81c8('0x32')](_0x5a2929[_0x81c8('0x30')],qs['fields'](_0x3ac0e4[_0x81c8('0x2e')][_0x81c8('0x33')]));_0xd4514['attributes']=_0xd4514[_0x81c8('0x31')]['length']?_0xd4514[_0x81c8('0x31')]:_0x5a2929['model'];if(_0x3ac0e4[_0x81c8('0x2e')]['includeAll']){_0xd4514[_0x81c8('0x34')]=[{'all':!![]}];}_0xd4514=_[_0x81c8('0x35')]({},_0xd4514,_0x3ac0e4[_0x81c8('0x36')]);return db[_0x81c8('0x2c')][_0x81c8('0x37')](_0xd4514)[_0x81c8('0x24')](handleEntityNotFound(_0xbe3e16,null))[_0x81c8('0x24')](respondWithResult(_0xbe3e16,null))[_0x81c8('0x38')](handleError(_0xbe3e16,null));};exports['create']=function(_0x21584b,_0x599751){return db[_0x81c8('0x2c')][_0x81c8('0x39')](_0x21584b[_0x81c8('0x3a')],{})[_0x81c8('0x24')](respondWithResult(_0x599751,0xc9))[_0x81c8('0x38')](handleError(_0x599751,null));};exports['update']=function(_0x3b6eda,_0x5f5c42){if(_0x3b6eda[_0x81c8('0x3a')]['id']){delete _0x3b6eda[_0x81c8('0x3a')]['id'];}return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x3b6eda[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x5f5c42,null))['then'](saveUpdates(_0x3b6eda[_0x81c8('0x3a')],null))[_0x81c8('0x24')](respondWithResult(_0x5f5c42,null))[_0x81c8('0x38')](handleError(_0x5f5c42,null));};exports[_0x81c8('0x25')]=function(_0x2e27ad,_0x1cd895){return db[_0x81c8('0x2c')][_0x81c8('0x37')]({'where':{'id':_0x2e27ad[_0x81c8('0x2a')]['id']}})[_0x81c8('0x24')](handleEntityNotFound(_0x1cd895,null))['then'](removeEntity(_0x1cd895,null))[_0x81c8('0x38')](handleError(_0x1cd895,null));};
\ No newline at end of file
+var _0xabe8=['send','model','keys','filters','intersection','query','attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','create','update','body','catch','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name'];(function(_0xf28958,_0x53f0ed){var _0x4a4ce4=function(_0x5275fb){while(--_0x5275fb){_0xf28958['push'](_0xf28958['shift']());}};_0x4a4ce4(++_0x53f0ed);}(_0xabe8,0x8c));var _0x8abe=function(_0x56338a,_0x1d112e){_0x56338a=_0x56338a-0x0;var _0x404efd=_0xabe8[_0x56338a];return _0x404efd;};'use strict';var emlformat=require(_0x8abe('0x0'));var rimraf=require(_0x8abe('0x1'));var zipdir=require(_0x8abe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8abe('0x3'));var moment=require(_0x8abe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8abe('0x5'));var util=require('util');var path=require(_0x8abe('0x6'));var sox=require(_0x8abe('0x7'));var csv=require(_0x8abe('0x8'));var ejs=require(_0x8abe('0x9'));var fs=require('fs');var fs_extra=require(_0x8abe('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8abe('0xb'));var jsforce=require(_0x8abe('0xc'));var deskjs=require(_0x8abe('0xd'));var toCsv=require(_0x8abe('0x8'));var querystring=require(_0x8abe('0xe'));var Papa=require(_0x8abe('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8abe('0x10'));var hardwareService=require(_0x8abe('0x11'));var logger=require(_0x8abe('0x12'))(_0x8abe('0x13'));var utils=require(_0x8abe('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8abe('0x15'))['db'];function respondWithStatusCode(_0x8d4179,_0x1970b2){_0x1970b2=_0x1970b2||0xcc;return function(_0x3890f8){if(_0x3890f8){return _0x8d4179['sendStatus'](_0x1970b2);}return _0x8d4179['status'](_0x1970b2)['end']();};}function respondWithResult(_0xb75397,_0x5e7c8b){_0x5e7c8b=_0x5e7c8b||0xc8;return function(_0x1c407d){if(_0x1c407d){return _0xb75397['status'](_0x5e7c8b)[_0x8abe('0x16')](_0x1c407d);}};}function respondWithFilteredResult(_0x168f96,_0x5d24ad){return function(_0x1bcd6d){if(_0x1bcd6d){var _0x5bc34a=typeof _0x5d24ad[_0x8abe('0x17')]===_0x8abe('0x18')&&typeof _0x5d24ad[_0x8abe('0x19')]===_0x8abe('0x18');var _0x3f5d9b=_0x1bcd6d[_0x8abe('0x1a')];var _0x1cd7c9=_0x5bc34a?0x0:_0x5d24ad[_0x8abe('0x17')];var _0x45905e=_0x5bc34a?_0x1bcd6d[_0x8abe('0x1a')]:_0x5d24ad[_0x8abe('0x17')]+_0x5d24ad['limit'];var _0x190e2e;if(_0x45905e>=_0x3f5d9b){_0x45905e=_0x3f5d9b;_0x190e2e=0xc8;}else{_0x190e2e=0xce;}_0x168f96[_0x8abe('0x1b')](_0x190e2e);return _0x168f96[_0x8abe('0x1c')](_0x8abe('0x1d'),_0x1cd7c9+'-'+_0x45905e+'/'+_0x3f5d9b)[_0x8abe('0x16')](_0x1bcd6d);}return null;};}function patchUpdates(_0x49f03d){return function(_0x4f6c1c){try{jsonpatch[_0x8abe('0x1e')](_0x4f6c1c,_0x49f03d,!![]);}catch(_0xfa8e74){return BPromise[_0x8abe('0x1f')](_0xfa8e74);}return _0x4f6c1c[_0x8abe('0x20')]();};}function saveUpdates(_0x346153,_0x2f7e3c){return function(_0x113ab2){if(_0x113ab2){return _0x113ab2['update'](_0x346153)[_0x8abe('0x21')](function(_0x1eaf31){return _0x1eaf31;});}return null;};}function removeEntity(_0x383ca7,_0x1873d5){return function(_0x1f9bde){if(_0x1f9bde){return _0x1f9bde[_0x8abe('0x22')]()[_0x8abe('0x21')](function(){_0x383ca7[_0x8abe('0x1b')](0xcc)[_0x8abe('0x23')]();});}};}function handleEntityNotFound(_0x3d1785,_0x40f33a){return function(_0x301d4a){if(!_0x301d4a){_0x3d1785[_0x8abe('0x24')](0x194);}return _0x301d4a;};}function handleError(_0x189440,_0x14c9db){_0x14c9db=_0x14c9db||0x1f4;return function(_0x261c62){logger[_0x8abe('0x25')](_0x261c62[_0x8abe('0x26')]);if(_0x261c62['name']){delete _0x261c62[_0x8abe('0x27')];}_0x189440[_0x8abe('0x1b')](_0x14c9db)[_0x8abe('0x28')](_0x261c62);};}exports['show']=function(_0xca4d,_0x4a899c){var _0x1e9316={'raw':!![],'where':{'id':_0xca4d['params']['id']}},_0x3f30bf={};_0x3f30bf[_0x8abe('0x29')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x3f30bf['query']=_[_0x8abe('0x2a')](_0xca4d['query']);_0x3f30bf[_0x8abe('0x2b')]=_[_0x8abe('0x2c')](_0x3f30bf[_0x8abe('0x29')],_0x3f30bf[_0x8abe('0x2d')]);_0x1e9316[_0x8abe('0x2e')]=_[_0x8abe('0x2c')](_0x3f30bf[_0x8abe('0x29')],qs['fields'](_0xca4d[_0x8abe('0x2d')][_0x8abe('0x2f')]));_0x1e9316[_0x8abe('0x2e')]=_0x1e9316[_0x8abe('0x2e')][_0x8abe('0x30')]?_0x1e9316[_0x8abe('0x2e')]:_0x3f30bf['model'];if(_0xca4d[_0x8abe('0x2d')][_0x8abe('0x31')]){_0x1e9316[_0x8abe('0x32')]=[{'all':!![]}];}_0x1e9316=_[_0x8abe('0x33')]({},_0x1e9316,_0xca4d[_0x8abe('0x34')]);return db[_0x8abe('0x35')][_0x8abe('0x36')](_0x1e9316)[_0x8abe('0x21')](handleEntityNotFound(_0x4a899c,null))[_0x8abe('0x21')](respondWithResult(_0x4a899c,null))['catch'](handleError(_0x4a899c,null));};exports[_0x8abe('0x37')]=function(_0x47d627,_0x1a0364){return db[_0x8abe('0x35')]['create'](_0x47d627['body'],{})[_0x8abe('0x21')](respondWithResult(_0x1a0364,0xc9))['catch'](handleError(_0x1a0364,null));};exports[_0x8abe('0x38')]=function(_0xbf1d9,_0x3599de){if(_0xbf1d9[_0x8abe('0x39')]['id']){delete _0xbf1d9[_0x8abe('0x39')]['id'];}return db['ChatProactiveAction'][_0x8abe('0x36')]({'where':{'id':_0xbf1d9['params']['id']}})['then'](handleEntityNotFound(_0x3599de,null))[_0x8abe('0x21')](saveUpdates(_0xbf1d9[_0x8abe('0x39')],null))[_0x8abe('0x21')](respondWithResult(_0x3599de,null))[_0x8abe('0x3a')](handleError(_0x3599de,null));};exports['destroy']=function(_0xf736e6,_0x30af7c){return db['ChatProactiveAction'][_0x8abe('0x36')]({'where':{'id':_0xf736e6[_0x8abe('0x3b')]['id']}})['then'](handleEntityNotFound(_0x30af7c,null))[_0x8abe('0x21')](removeEntity(_0x30af7c,null))['catch'](handleError(_0x30af7c,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index b3aa3f1..27e82ce 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 _0xe8b6=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','chat_proactive_actions','lodash','../../config/logger','api','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe8b6,0x98));var _0x6e8b=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xe8b6[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x6e8b('0x0'));var util=require('util');var logger=require(_0x6e8b('0x1'))(_0x6e8b('0x2'));var moment=require(_0x6e8b('0x3'));var BPromise=require(_0x6e8b('0x4'));var rp=require(_0x6e8b('0x5'));var fs=require('fs');var path=require(_0x6e8b('0x6'));var rimraf=require(_0x6e8b('0x7'));var config=require(_0x6e8b('0x8'));var attributes=require(_0x6e8b('0x9'));module[_0x6e8b('0xa')]=function(_0x59ec43,_0x2bce18){return _0x59ec43[_0x6e8b('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x6e8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x496b=['path','./chatProactiveAction.attributes','exports','ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x496b,0x12d));var _0xb496=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x496b[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0xb496('0x0'));var util=require(_0xb496('0x1'));var logger=require(_0xb496('0x2'))(_0xb496('0x3'));var moment=require(_0xb496('0x4'));var BPromise=require(_0xb496('0x5'));var rp=require(_0xb496('0x6'));var fs=require('fs');var path=require(_0xb496('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb496('0x8'));module[_0xb496('0x9')]=function(_0x28843c,_0x387eee){return _0x28843c['define'](_0xb496('0xa'),attributes,{'tableName':'chat_proactive_actions','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 a2147bf..e533246 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 _0xc3d1=['moment','bluebird','randomstring','ioredis','rpc','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xc3d1,0xbd));var _0x1c3d=function(_0x57746e,_0x45093f){_0x57746e=_0x57746e-0x0;var _0x5caeaa=_0xc3d1[_0x57746e];return _0x5caeaa;};'use strict';var _=require(_0x1c3d('0x0'));var util=require('util');var moment=require(_0x1c3d('0x1'));var BPromise=require(_0x1c3d('0x2'));var rs=require(_0x1c3d('0x3'));var fs=require('fs');var Redis=require(_0x1c3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c3d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1c3d('0x6')][_0x1c3d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c0d41,_0x4fbabd,_0x19440e){return new BPromise(function(_0x598dd1,_0x31041f){return client[_0x1c3d('0x8')](_0x3c0d41,_0x19440e)[_0x1c3d('0x9')](function(_0x498c38){logger['info'](_0x1c3d('0xa'),_0x4fbabd,'request\x20sent');logger[_0x1c3d('0xb')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4fbabd,'request\x20sent',JSON[_0x1c3d('0xc')](_0x498c38));if(_0x498c38[_0x1c3d('0xd')]){if(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xe')]===0x1f4){logger[_0x1c3d('0xd')](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x31041f(_0x498c38[_0x1c3d('0xd')][_0x1c3d('0xf')]);}logger['error'](_0x1c3d('0xa'),_0x4fbabd,_0x498c38[_0x1c3d('0xd')]['message']);return _0x598dd1(_0x498c38['error'][_0x1c3d('0xf')]);}else{logger['info'](_0x1c3d('0xa'),_0x4fbabd,_0x1c3d('0x10'));_0x598dd1(_0x498c38[_0x1c3d('0x11')][_0x1c3d('0xf')]);}})[_0x1c3d('0x12')](function(_0x3ce38e){logger[_0x1c3d('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x4fbabd,_0x3ce38e);_0x31041f(_0x3ce38e);});});}
\ No newline at end of file
+var _0x8792=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x8792,0xc1));var _0x2879=function(_0x584354,_0x3b4a6f){_0x584354=_0x584354-0x0;var _0x285f14=_0x8792[_0x584354];return _0x285f14;};'use strict';var _=require(_0x2879('0x0'));var util=require(_0x2879('0x1'));var moment=require(_0x2879('0x2'));var BPromise=require(_0x2879('0x3'));var rs=require(_0x2879('0x4'));var fs=require('fs');var Redis=require(_0x2879('0x5'));var db=require(_0x2879('0x6'))['db'];var utils=require(_0x2879('0x7'));var logger=require(_0x2879('0x8'))(_0x2879('0x9'));var config=require(_0x2879('0xa'));var jayson=require(_0x2879('0xb'));var client=jayson[_0x2879('0xc')][_0x2879('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x487821,_0x55a6c6,_0x5dbc71){return new BPromise(function(_0x2c8690,_0x585d05){return client[_0x2879('0xe')](_0x487821,_0x5dbc71)[_0x2879('0xf')](function(_0x26ec16){logger[_0x2879('0x10')](_0x2879('0x11'),_0x55a6c6,_0x2879('0x12'));logger[_0x2879('0x13')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x55a6c6,_0x2879('0x12'),JSON['stringify'](_0x26ec16));if(_0x26ec16[_0x2879('0x14')]){if(_0x26ec16[_0x2879('0x14')][_0x2879('0x15')]===0x1f4){logger[_0x2879('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x55a6c6,_0x26ec16[_0x2879('0x14')]['message']);return _0x585d05(_0x26ec16[_0x2879('0x14')][_0x2879('0x16')]);}logger[_0x2879('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x55a6c6,_0x26ec16['error'][_0x2879('0x16')]);return _0x2c8690(_0x26ec16['error'][_0x2879('0x16')]);}else{logger[_0x2879('0x10')](_0x2879('0x11'),_0x55a6c6,_0x2879('0x12'));_0x2c8690(_0x26ec16[_0x2879('0x17')][_0x2879('0x16')]);}})[_0x2879('0x18')](function(_0x5d9575){logger[_0x2879('0x14')](_0x2879('0x11'),_0x55a6c6,_0x5d9575);_0x585d05(_0x5d9575);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 76e830b..661e53e 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x1b8f36,_0x5ce399){var _0x4ff650=function(_0xc87da0){while(--_0xc87da0){_0x1b8f36['push'](_0x1b8f36['shift']());}};_0x4ff650(++_0x5ce399);}(_0x33c5,0xe6));var _0x533c=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0x33c5[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','util','path','express','Router'];(function(_0x2d5346,_0xb13ba4){var _0x5348eb=function(_0x694baa){while(--_0x694baa){_0x2d5346['push'](_0x2d5346['shift']());}};_0x5348eb(++_0xb13ba4);}(_0x33c5,0xe6));var _0x533c=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0x33c5[_0x2d1cf4];return _0x554a7c;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xb')]);router[_0x533c('0xc')]('/',auth[_0x533c('0xa')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0x9'),auth[_0x533c('0xa')](),controller[_0x533c('0x11')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index ff388d2..9ebad90 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 _0xb970=['STRING','name','INTEGER','ENUM','beepall','roundrobin','exports'];(function(_0x5f1cf8,_0x5e0923){var _0x27d0fa=function(_0x3f1171){while(--_0x3f1171){_0x5f1cf8['push'](_0x5f1cf8['shift']());}};_0x27d0fa(++_0x5e0923);}(_0xb970,0x99));var _0x0b97=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb970[_0x454018];return _0x24697d;};'use strict';var Sequelize=require('sequelize');module[_0x0b97('0x0')]={'name':{'type':Sequelize[_0x0b97('0x1')],'unique':_0x0b97('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0b97('0x1')]},'timeout':{'type':Sequelize[_0x0b97('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b97('0x4')]('rrmemory',_0x0b97('0x5'),_0x0b97('0x6'))}};
\ No newline at end of file
+var _0xc34c=['roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x28958c,_0x4cf771){var _0x31c1a7=function(_0x2a542c){while(--_0x2a542c){_0x28958c['push'](_0x28958c['shift']());}};_0x31c1a7(++_0x4cf771);}(_0xc34c,0x169));var _0xcc34=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc34c[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0xcc34('0x0'));module[_0xcc34('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xcc34('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcc34('0x3')]},'timeout':{'type':Sequelize[_0xcc34('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcc34('0x5')](_0xcc34('0x6'),_0xcc34('0x7'),_0xcc34('0x8'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index dabeb90..f06c039 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 _0xa02d=['value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','isArray','getAgents','order','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','end','status','json','offset','undefined','count','limit','set','update','then','get','ChatQueues','UserProfileResource','destroy','sendStatus','error','stack','name','index','map','ChatQueue','key','getOptions','where','query','findAll','rows','catch','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','hasOwnProperty','nolimit','sort','pick','ChatQueueId','filter','merge','options','UserChatQueue','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','sequelize','transaction','findOrCreate','forEach','userChatQueue:save','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId'];(function(_0x273cb0,_0xc7b288){var _0x50241a=function(_0x49b206){while(--_0x49b206){_0x273cb0['push'](_0x273cb0['shift']());}};_0x50241a(++_0xc7b288);}(_0xa02d,0x161));var _0xda02=function(_0x3f993e,_0x2d5757){_0x3f993e=_0x3f993e-0x0;var _0x39c135=_0xa02d[_0x3f993e];return _0x39c135;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xda02('0x0'));var squel=require(_0xda02('0x1'));var Redis=require(_0xda02('0x2'));var qs=require(_0xda02('0x3'));var logger=require(_0xda02('0x4'))(_0xda02('0x5'));var config=require(_0xda02('0x6'));var db=require('../../mysqldb')['db'];config[_0xda02('0x7')]=_[_0xda02('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xda02('0x9'))(new Redis(config[_0xda02('0x7')]));require('./chatQueue.socket')[_0xda02('0xa')](socket);function respondWithStatusCode(_0x458752,_0x49de04){_0x49de04=_0x49de04||0xcc;return function(_0x3119d9){if(_0x3119d9){return _0x458752['sendStatus'](_0x49de04);}return _0x458752['status'](_0x49de04)[_0xda02('0xb')]();};}function respondWithResult(_0x4618a9,_0x353b43){_0x353b43=_0x353b43||0xc8;return function(_0x1ea9e0){if(_0x1ea9e0){return _0x4618a9[_0xda02('0xc')](_0x353b43)[_0xda02('0xd')](_0x1ea9e0);}};}function respondWithFilteredResult(_0x371a6e,_0x3c8b07){return function(_0x48c3d0){if(_0x48c3d0){var _0x40a1aa=typeof _0x3c8b07[_0xda02('0xe')]===_0xda02('0xf')&&typeof _0x3c8b07['limit']===_0xda02('0xf');var _0x2510ef=_0x48c3d0['count'];var _0x3eb5a9=_0x40a1aa?0x0:_0x3c8b07['offset'];var _0x1b01de=_0x40a1aa?_0x48c3d0[_0xda02('0x10')]:_0x3c8b07['offset']+_0x3c8b07[_0xda02('0x11')];var _0x29a5a9;if(_0x1b01de>=_0x2510ef){_0x1b01de=_0x2510ef;_0x29a5a9=0xc8;}else{_0x29a5a9=0xce;}_0x371a6e[_0xda02('0xc')](_0x29a5a9);return _0x371a6e[_0xda02('0x12')]('Content-Range',_0x3eb5a9+'-'+_0x1b01de+'/'+_0x2510ef)[_0xda02('0xd')](_0x48c3d0);}return null;};}function saveUpdates(_0x5ef94e){return function(_0x14ab6a){if(_0x14ab6a){return _0x14ab6a[_0xda02('0x13')](_0x5ef94e)[_0xda02('0x14')](function(_0x478720){return _0x478720;});}return null;};}function removeEntity(_0x2bc895){return function(_0x530c7d){if(_0x530c7d){return _0x530c7d['destroy']()['then'](function(){var _0x3b2553=_0x530c7d[_0xda02('0x15')]({'plain':!![]});var _0x527973=_0xda02('0x16');return db[_0xda02('0x17')][_0xda02('0x18')]({'where':{'type':_0x527973,'resourceId':_0x3b2553['id']}})['then'](function(){return _0x530c7d;});})[_0xda02('0x14')](function(){_0x2bc895[_0xda02('0xc')](0xcc)[_0xda02('0xb')]();});}};}function handleEntityNotFound(_0x48604d){return function(_0x5f19c2){if(!_0x5f19c2){_0x48604d[_0xda02('0x19')](0x194);}return _0x5f19c2;};}function handleError(_0xd3b7ce,_0x511a6f){_0x511a6f=_0x511a6f||0x1f4;return function(_0x1df5e4){logger[_0xda02('0x1a')](_0x1df5e4[_0xda02('0x1b')]);if(_0x1df5e4['name']){delete _0x1df5e4[_0xda02('0x1c')];}_0xd3b7ce['status'](_0x511a6f)['send'](_0x1df5e4);};}exports[_0xda02('0x1d')]=function(_0x10998b,_0x67aa73){var _0x13057d={};var _0x21c71d={'count':0x0,'rows':[]};var _0x526df5=_[_0xda02('0x1e')](db[_0xda02('0x1f')]['rawAttributes'],function(_0x4ecae6){return{'name':_0x4ecae6['fieldName'],'type':_0x4ecae6['type'][_0xda02('0x20')]};});_0x13057d=qs[_0xda02('0x21')](_0x526df5,_0x10998b);var _0xec0f63={'where':_0x13057d[_0xda02('0x22')]};return db[_0xda02('0x1f')][_0xda02('0x10')](_0xec0f63)[_0xda02('0x14')](function(_0x39d496){_0x21c71d[_0xda02('0x10')]=_0x39d496;_0x13057d['include']=qs['include'](_0x10998b[_0xda02('0x23')]);return db[_0xda02('0x1f')][_0xda02('0x24')](_0x13057d);})[_0xda02('0x14')](function(_0x2b1115){_0x21c71d[_0xda02('0x25')]=_0x2b1115;return _0x21c71d;})[_0xda02('0x14')](respondWithFilteredResult(_0x67aa73,_0x13057d))[_0xda02('0x26')](handleError(_0x67aa73,null));};exports[_0xda02('0x27')]=function(_0x2b45a5,_0x1cb4a2){var _0x1d79a8={'raw':!![],'where':{'id':_0x2b45a5['params']['id']}},_0x278cc9={};_0x278cc9[_0xda02('0x28')]=_[_0xda02('0x29')](db[_0xda02('0x1f')][_0xda02('0x2a')]);_0x278cc9[_0xda02('0x23')]=_[_0xda02('0x29')](_0x2b45a5[_0xda02('0x23')]);_0x278cc9[_0xda02('0x2b')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],_0x278cc9['query']);_0x1d79a8[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x278cc9[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x2b45a5[_0xda02('0x23')][_0xda02('0x2e')]));_0x1d79a8[_0xda02('0x2d')]=_0x1d79a8['attributes'][_0xda02('0x2f')]?_0x1d79a8[_0xda02('0x2d')]:_0x278cc9[_0xda02('0x28')];if(_0x2b45a5[_0xda02('0x23')]['includeAll']){_0x1d79a8[_0xda02('0x30')]=[{'all':!![]}];}_0x1d79a8=_['merge']({},_0x1d79a8,_0x2b45a5['options']);return db['ChatQueue'][_0xda02('0x31')](_0x1d79a8)[_0xda02('0x14')](handleEntityNotFound(_0x1cb4a2,null))[_0xda02('0x14')](respondWithResult(_0x1cb4a2,null))[_0xda02('0x26')](handleError(_0x1cb4a2,null));};exports[_0xda02('0x32')]=function(_0x3fbc98,_0x14023c){return db[_0xda02('0x1f')][_0xda02('0x32')](_0x3fbc98[_0xda02('0x33')],{})[_0xda02('0x14')](function(_0x1ab94c){var _0x4e5a8e=_0x3fbc98[_0xda02('0x34')][_0xda02('0x15')]({'plain':!![]});if(!_0x4e5a8e)throw new Error(_0xda02('0x35'));if(_0x4e5a8e[_0xda02('0x36')]===_0xda02('0x34')){var _0x30c9c4=_0x1ab94c[_0xda02('0x15')]({'plain':!![]});var _0x34a1bb='ChatQueues';return db[_0xda02('0x37')][_0xda02('0x31')]({'where':{'name':_0x34a1bb,'userProfileId':_0x4e5a8e['userProfileId']},'raw':!![]})[_0xda02('0x14')](function(_0xdf9b1a){if(_0xdf9b1a&&_0xdf9b1a[_0xda02('0x38')]===0x0){return db[_0xda02('0x17')][_0xda02('0x32')]({'name':_0x30c9c4[_0xda02('0x1c')],'resourceId':_0x30c9c4['id'],'type':_0xdf9b1a['name'],'sectionId':_0xdf9b1a['id']},{})[_0xda02('0x14')](function(){return _0x1ab94c;});}else{return _0x1ab94c;}})[_0xda02('0x26')](function(_0x1aab09){logger[_0xda02('0x1a')](_0xda02('0x39'),_0x1aab09);throw _0x1aab09;});}return _0x1ab94c;})[_0xda02('0x14')](respondWithResult(_0x14023c,0xc9))[_0xda02('0x26')](handleError(_0x14023c,null));};exports[_0xda02('0x13')]=function(_0x434293,_0x35456c){if(_0x434293[_0xda02('0x33')]['id']){delete _0x434293[_0xda02('0x33')]['id'];}return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x434293[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x35456c,null))[_0xda02('0x14')](saveUpdates(_0x434293['body'],null))[_0xda02('0x14')](respondWithResult(_0x35456c,null))[_0xda02('0x26')](handleError(_0x35456c,null));};exports['destroy']=function(_0x3b7935,_0x2ae886){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x3b7935[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x2ae886,null))[_0xda02('0x14')](removeEntity(_0x2ae886,null))[_0xda02('0x26')](handleError(_0x2ae886,null));};exports[_0xda02('0x3b')]=function(_0x53810e,_0x39faac){return db[_0xda02('0x1f')][_0xda02('0x3b')]()['then'](respondWithResult(_0x39faac,null))[_0xda02('0x26')](handleError(_0x39faac,null));};exports['getMembers']=function(_0x5ddd0f,_0x3a449a){var _0x231136={'raw':!![],'where':{}},_0x40b4e1={},_0x5ea3c8;return db['ChatQueue'][_0xda02('0x3c')]({'where':{'id':_0x5ddd0f[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x3a449a,null))[_0xda02('0x14')](function(_0x58fd37){if(_0x58fd37){_0x5ea3c8=_0x58fd37[_0xda02('0x15')]({'plain':!![]});_0x40b4e1[_0xda02('0x28')]=_['keys'](db['UserChatQueue'][_0xda02('0x2a')]);_0x40b4e1[_0xda02('0x23')]=_[_0xda02('0x29')](_0x5ddd0f[_0xda02('0x23')]);_0x40b4e1[_0xda02('0x2b')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],_0x40b4e1[_0xda02('0x23')]);_0x231136[_0xda02('0x2d')]=_['intersection'](_0x40b4e1[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x5ddd0f[_0xda02('0x23')]['fields']));_0x231136[_0xda02('0x2d')]=_0x231136['attributes'][_0xda02('0x2f')]?_0x231136['attributes']:_0x40b4e1[_0xda02('0x28')];if(!_0x5ddd0f[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x231136['limit']=qs['limit'](_0x5ddd0f[_0xda02('0x23')][_0xda02('0x11')]);_0x231136[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x5ddd0f[_0xda02('0x23')][_0xda02('0xe')]);}_0x231136['order']=qs[_0xda02('0x3f')](_0x5ddd0f[_0xda02('0x23')]['sort']);_0x231136[_0xda02('0x22')]=qs['filters'](_[_0xda02('0x40')](_0x5ddd0f[_0xda02('0x23')],_0x40b4e1[_0xda02('0x2b')]));_0x231136[_0xda02('0x22')][_0xda02('0x41')]=_0x58fd37['id'];if(_0x5ddd0f[_0xda02('0x23')][_0xda02('0x42')]){_0x231136['where']=_[_0xda02('0x43')](_0x231136[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x231136[_0xda02('0x2d')],function(_0x268e65){var _0x18f866={};_0x18f866[_0x268e65]={'$like':'%'+_0x5ddd0f[_0xda02('0x23')]['filter']+'%'};return _0x18f866;})});}_0x231136=_['merge']({},_0x231136,_0x5ddd0f[_0xda02('0x44')]);return db[_0xda02('0x45')][_0xda02('0x24')](_0x231136);}})[_0xda02('0x14')](function(_0x24f08f){if(_0x24f08f){return db[_0xda02('0x46')][_0xda02('0x47')]({'where':{'id':_[_0xda02('0x1e')](_0x24f08f,'UserId'),'role':_0xda02('0x48')},'attributes':['id',_0xda02('0x1c'),_0xda02('0x49'),_0xda02('0x4a'),_0xda02('0x4b')]});}})[_0xda02('0x14')](function(_0x2efd5e){if(_0x2efd5e){return{'count':_0x2efd5e['count'],'rows':_[_0xda02('0x1e')](_0x2efd5e[_0xda02('0x25')],function(_0x849382){return{'membername':_0x849382[_0xda02('0x1c')],'UserId':_0x849382['id'],'queue_name':_0x5ea3c8[_0xda02('0x1c')],'ChatQueueId':_0x5ea3c8['id'],'interface':util[_0xda02('0x4c')](_0xda02('0x4d'),_0xda02('0x4e'),_0x849382[_0xda02('0x1c')]),'penalty':0x0,'paused':_0x849382['chatPause'],'createdAt':_0x849382[_0xda02('0x4b')],'updatedAt':_0x849382[_0xda02('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a449a,_0x231136))['catch'](handleError(_0x3a449a,null));};exports[_0xda02('0x4f')]=function(_0x214b23,_0x106487){var _0x286018={};var _0x5100dc={};var _0x4462f5;var _0x11adda;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x214b23[_0xda02('0x3a')]['id']}})['then'](handleEntityNotFound(_0x106487,null))[_0xda02('0x14')](function(_0x16f917){if(_0x16f917){_0x4462f5=_0x16f917;_0x5100dc[_0xda02('0x28')]=_['keys'](db['Team'][_0xda02('0x2a')]);_0x5100dc['query']=_[_0xda02('0x29')](_0x214b23['query']);_0x5100dc['filters']=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],_0x5100dc[_0xda02('0x23')]);_0x286018[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x5100dc[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x214b23[_0xda02('0x23')]['fields']));_0x286018[_0xda02('0x2d')]=_0x286018[_0xda02('0x2d')][_0xda02('0x2f')]?_0x286018['attributes']:_0x5100dc[_0xda02('0x28')];_0x286018['order']=qs['sort'](_0x214b23['query'][_0xda02('0x3f')]);_0x286018[_0xda02('0x22')]=qs[_0xda02('0x2b')](_['pick'](_0x214b23[_0xda02('0x23')],_0x5100dc[_0xda02('0x2b')]));if(_0x214b23['query'][_0xda02('0x42')]){_0x286018[_0xda02('0x22')]=_[_0xda02('0x43')](_0x286018[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x286018[_0xda02('0x2d')],function(_0x22bc78){var _0x5b3c85={};_0x5b3c85[_0x22bc78]={'$like':'%'+_0x214b23[_0xda02('0x23')][_0xda02('0x42')]+'%'};return _0x5b3c85;})});}_0x286018=_[_0xda02('0x43')]({},_0x286018,_0x214b23[_0xda02('0x44')]);return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x14e7e4){if(_0x14e7e4){_0x11adda=_0x14e7e4[_0xda02('0x2f')];if(!_0x214b23[_0xda02('0x23')][_0xda02('0x3d')]('nolimit')){_0x286018[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x214b23[_0xda02('0x23')][_0xda02('0x11')]);_0x286018[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x214b23['query']['offset']);}return _0x4462f5[_0xda02('0x4f')](_0x286018);}})[_0xda02('0x14')](function(_0x1c255e){if(_0x1c255e){return _0x1c255e?{'count':_0x11adda,'rows':_0x1c255e}:null;}})['then'](respondWithResult(_0x106487,null))['catch'](handleError(_0x106487,null));};exports[_0xda02('0x50')]=function(_0x5be91c,_0x135144){var _0x15ec45=_0x5be91c['body'][_0xda02('0x51')];return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x15ec45},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id','name',_0xda02('0x54'),'voicePause','interface'],'raw':!![]}]})[_0xda02('0x14')](function(_0x3c91a8){if(_0x3c91a8){var _0x390836=_['flatMap'](_0x3c91a8,function(_0x555d24){var _0x321fa7=_0x555d24[_0xda02('0x15')]({'plain':!![]});return _0x321fa7[_0xda02('0x53')];});return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x5be91c[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x331ed5){return db[_0xda02('0x55')][_0xda02('0x56')](function(_0x428d1b){return _0x331ed5['addTeams'](_0x15ec45,{'transaction':_0x428d1b})[_0xda02('0x14')](function(){return BPromise['each'](_0x390836,function(_0x4755de){return db['UserChatQueue'][_0xda02('0x57')]({'where':{'UserId':_0x4755de['id'],'ChatQueueId':_0x5be91c['params']['id']},'transaction':_0x428d1b});});})[_0xda02('0x14')](function(){_0x390836[_0xda02('0x58')](function(_0x1ab5b5){socket['emit'](_0xda02('0x59'),{'UserId':_0x1ab5b5['id'],'ChatQueueId':_0x331ed5['id']});});});});});}})['then'](respondWithStatusCode(_0x135144,null))[_0xda02('0x26')](handleError(_0x135144,null));};exports['removeTeams']=function(_0x57a443,_0x7e8e70){return db[_0xda02('0x52')][_0xda02('0x24')]({'where':{'id':_0x57a443[_0xda02('0x23')]['ids']},'attributes':['id'],'include':[{'model':db[_0xda02('0x46')],'as':_0xda02('0x53'),'attributes':['id'],'raw':!![]}]})[_0xda02('0x14')](handleEntityNotFound(_0x7e8e70,null))[_0xda02('0x14')](function(_0x5e75a2){var _0x4f887a=_[_0xda02('0x1e')](_0x5e75a2,'id');var _0x731a2e=[];var _0x3dd3ed=[];var _0x2f0661=squel[_0xda02('0x5a')]();_0x2f0661['field'](_0xda02('0x5b'))['from'](_0xda02('0x5c'),'tq')[_0xda02('0x5d')](_0xda02('0x5e'),'ut',_0xda02('0x5f'))[_0xda02('0x22')](_0xda02('0x60'),_0x57a443[_0xda02('0x3a')]['id']);for(var _0x33f177=0x0;_0x33f177<_0x5e75a2['length'];_0x33f177+=0x1){let _0x54535d=_0x5e75a2[_0x33f177];for(var _0xfe746c=0x0;_0xfe746c<_0x54535d[_0xda02('0x53')][_0xda02('0x2f')];_0xfe746c+=0x1){let _0x38f2bc=_0x54535d['Agents'][_0xfe746c];var _0x61022d=_0x2f0661[_0xda02('0x61')]();_0x61022d[_0xda02('0x22')](_0xda02('0x62'),_0x38f2bc['id']);_0x3dd3ed[_0xda02('0x63')](db[_0xda02('0x55')][_0xda02('0x23')](_0x61022d['toString'](),{'type':db[_0xda02('0x55')][_0xda02('0x64')]['SELECT']})[_0xda02('0x14')](function(_0x113249){if(_0x113249[_0xda02('0x2f')]===0x1){return _0x38f2bc['id'];}else{var _0x3adaa6=_[_0xda02('0x65')](_[_0xda02('0x1e')](_0x113249,_0xda02('0x66')),function(_0x209fb9){return _['includes'](_0x4f887a,_0x209fb9);});if(_0x3adaa6){return _0x38f2bc['id'];}}}));}}return BPromise['all'](_0x3dd3ed)[_0xda02('0x14')](function(_0x22af9d){_0x731a2e=_(_0x731a2e)['union'](_0x22af9d)['compact']()[_0xda02('0x67')]();return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x57a443[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](function(_0x216ffb){return db['sequelize']['transaction'](function(_0x433699){return _0x216ffb[_0xda02('0x68')](_0x57a443[_0xda02('0x23')]['ids'],{'transaction':_0x433699})[_0xda02('0x14')](function(){if(!_[_0xda02('0x69')](_0x731a2e)){return _0x216ffb[_0xda02('0x6a')](_0x731a2e,{'transaction':_0x433699});}})[_0xda02('0x14')](function(){_0x731a2e[_0xda02('0x58')](function(_0x37ddd7){socket[_0xda02('0x6b')](_0xda02('0x6c'),{'UserId':_0x37ddd7,'ChatQueueId':_0x216ffb['id']});});});});});});})['then'](respondWithStatusCode(_0x7e8e70,null))[_0xda02('0x26')](handleError(_0x7e8e70,null));};exports['addAgents']=function(_0x4cdedd,_0x1ac8d1){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x4cdedd[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x1ac8d1,null))['then'](function(_0x2c5b2f){if(_0x2c5b2f){return _0x2c5b2f[_0xda02('0x6d')](_0x4cdedd[_0xda02('0x33')]['ids'],_[_0xda02('0x6e')](_0x4cdedd['body'],['ids','id'])||{})['spread'](function(_0x3e428e){for(var _0x104703=0x0;_0x104703<_0x4cdedd['body'][_0xda02('0x51')][_0xda02('0x2f')];_0x104703+=0x1){socket[_0xda02('0x6b')](_0xda02('0x59'),{'UserId':Number(_0x4cdedd[_0xda02('0x33')]['ids'][_0x104703]),'ChatQueueId':Number(_0x4cdedd[_0xda02('0x3a')]['id'])});}return _0x3e428e;});}})[_0xda02('0x14')](respondWithResult(_0x1ac8d1,null))[_0xda02('0x26')](handleError(_0x1ac8d1,null));};exports['removeAgents']=function(_0x46a107,_0x512b0e){return db[_0xda02('0x1f')][_0xda02('0x31')]({'where':{'id':_0x46a107[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x512b0e,null))[_0xda02('0x14')](function(_0x420b41){if(_0x420b41){return _0x420b41[_0xda02('0x6a')](_0x46a107[_0xda02('0x23')][_0xda02('0x51')])[_0xda02('0x14')](function(){if(_[_0xda02('0x6f')](_0x46a107['query'][_0xda02('0x51')])){for(var _0x30495f=0x0;_0x30495f<_0x46a107[_0xda02('0x23')][_0xda02('0x51')][_0xda02('0x2f')];_0x30495f+=0x1){socket[_0xda02('0x6b')]('userChatQueue:remove',{'UserId':Number(_0x46a107['query'][_0xda02('0x51')][_0x30495f]),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x46a107[_0xda02('0x23')]['ids']),'ChatQueueId':Number(_0x46a107[_0xda02('0x3a')]['id'])});}});}})[_0xda02('0x14')](respondWithStatusCode(_0x512b0e,null))['catch'](handleError(_0x512b0e,null));};exports[_0xda02('0x70')]=function(_0x3b9efb,_0x4d08b0){var _0x59fedc={};var _0x472670={};var _0x48da1b;var _0x2a8650;return db[_0xda02('0x1f')][_0xda02('0x3c')]({'where':{'id':_0x3b9efb[_0xda02('0x3a')]['id']}})[_0xda02('0x14')](handleEntityNotFound(_0x4d08b0,null))[_0xda02('0x14')](function(_0x531949){if(_0x531949){_0x48da1b=_0x531949;_0x472670[_0xda02('0x28')]=_[_0xda02('0x29')](db['User'][_0xda02('0x2a')]);_0x472670[_0xda02('0x23')]=_[_0xda02('0x29')](_0x3b9efb[_0xda02('0x23')]);_0x472670['filters']=_['intersection'](_0x472670[_0xda02('0x28')],_0x472670[_0xda02('0x23')]);_0x59fedc[_0xda02('0x2d')]=_[_0xda02('0x2c')](_0x472670[_0xda02('0x28')],qs[_0xda02('0x2e')](_0x3b9efb[_0xda02('0x23')]['fields']));_0x59fedc[_0xda02('0x2d')]=_0x59fedc[_0xda02('0x2d')][_0xda02('0x2f')]?_0x59fedc[_0xda02('0x2d')]:_0x472670[_0xda02('0x28')];_0x59fedc[_0xda02('0x71')]=qs[_0xda02('0x3f')](_0x3b9efb[_0xda02('0x23')]['sort']);_0x59fedc[_0xda02('0x22')]=qs[_0xda02('0x2b')](_[_0xda02('0x40')](_0x3b9efb['query'],_0x472670[_0xda02('0x2b')]));if(_0x3b9efb[_0xda02('0x23')]['filter']){_0x59fedc['where']=_[_0xda02('0x43')](_0x59fedc[_0xda02('0x22')],{'$or':_[_0xda02('0x1e')](_0x59fedc['attributes'],function(_0x280276){var _0xd2c136={};_0xd2c136[_0x280276]={'$like':'%'+_0x3b9efb[_0xda02('0x23')]['filter']+'%'};return _0xd2c136;})});}_0x59fedc=_['merge']({},_0x59fedc,_0x3b9efb['options']);return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2ed8ea){if(_0x2ed8ea){_0x2a8650=_0x2ed8ea[_0xda02('0x2f')];if(!_0x3b9efb[_0xda02('0x23')][_0xda02('0x3d')](_0xda02('0x3e'))){_0x59fedc[_0xda02('0x11')]=qs[_0xda02('0x11')](_0x3b9efb[_0xda02('0x23')][_0xda02('0x11')]);_0x59fedc[_0xda02('0xe')]=qs[_0xda02('0xe')](_0x3b9efb[_0xda02('0x23')][_0xda02('0xe')]);}return _0x48da1b[_0xda02('0x70')](_0x59fedc);}})[_0xda02('0x14')](function(_0x2f0ce4){if(_0x2f0ce4){return _0x2f0ce4?{'count':_0x2a8650,'rows':_0x2f0ce4}:null;}})['then'](respondWithResult(_0x4d08b0,null))[_0xda02('0x26')](handleError(_0x4d08b0,null));};
\ No newline at end of file
+var _0x98ec=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','order','sort','ChatQueueId','filter','User','findAndCountAll','UserId','chatPause','updatedAt','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','pick','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatQueue.socket','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','catch','create'];(function(_0x6b6190,_0x3131ac){var _0x1c1982=function(_0x3535b3){while(--_0x3535b3){_0x6b6190['push'](_0x6b6190['shift']());}};_0x1c1982(++_0x3131ac);}(_0x98ec,0x145));var _0xc98e=function(_0x57e14f,_0x17f93c){_0x57e14f=_0x57e14f-0x0;var _0x39fce2=_0x98ec[_0x57e14f];return _0x39fce2;};'use strict';var BPromise=require(_0xc98e('0x0'));var util=require(_0xc98e('0x1'));var _=require(_0xc98e('0x2'));var squel=require(_0xc98e('0x3'));var Redis=require(_0xc98e('0x4'));var qs=require(_0xc98e('0x5'));var logger=require(_0xc98e('0x6'))(_0xc98e('0x7'));var config=require('../../config/environment');var db=require(_0xc98e('0x8'))['db'];config[_0xc98e('0x9')]=_[_0xc98e('0xa')](config['redis'],{'host':_0xc98e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc98e('0x9')]));require(_0xc98e('0xc'))['register'](socket);function respondWithStatusCode(_0x294242,_0x250d84){_0x250d84=_0x250d84||0xcc;return function(_0x156c85){if(_0x156c85){return _0x294242[_0xc98e('0xd')](_0x250d84);}return _0x294242['status'](_0x250d84)[_0xc98e('0xe')]();};}function respondWithResult(_0x242fef,_0x3c2ac1){_0x3c2ac1=_0x3c2ac1||0xc8;return function(_0x2ac12e){if(_0x2ac12e){return _0x242fef['status'](_0x3c2ac1)[_0xc98e('0xf')](_0x2ac12e);}};}function respondWithFilteredResult(_0x3e5f96,_0x55be17){return function(_0x23bc17){if(_0x23bc17){var _0x3a9518=typeof _0x55be17[_0xc98e('0x10')]===_0xc98e('0x11')&&typeof _0x55be17[_0xc98e('0x12')]===_0xc98e('0x11');var _0x3fd228=_0x23bc17[_0xc98e('0x13')];var _0x5ecbf2=_0x3a9518?0x0:_0x55be17[_0xc98e('0x10')];var _0x1915c1=_0x3a9518?_0x23bc17[_0xc98e('0x13')]:_0x55be17[_0xc98e('0x10')]+_0x55be17[_0xc98e('0x12')];var _0x50a8f6;if(_0x1915c1>=_0x3fd228){_0x1915c1=_0x3fd228;_0x50a8f6=0xc8;}else{_0x50a8f6=0xce;}_0x3e5f96[_0xc98e('0x14')](_0x50a8f6);return _0x3e5f96['set'](_0xc98e('0x15'),_0x5ecbf2+'-'+_0x1915c1+'/'+_0x3fd228)['json'](_0x23bc17);}return null;};}function saveUpdates(_0x431ed1){return function(_0x3bd548){if(_0x3bd548){return _0x3bd548[_0xc98e('0x16')](_0x431ed1)[_0xc98e('0x17')](function(_0x5653d5){return _0x5653d5;});}return null;};}function removeEntity(_0x46a940){return function(_0x252ef9){if(_0x252ef9){return _0x252ef9[_0xc98e('0x18')]()['then'](function(){var _0x16781b=_0x252ef9[_0xc98e('0x19')]({'plain':!![]});var _0x78513d=_0xc98e('0x1a');return db[_0xc98e('0x1b')][_0xc98e('0x18')]({'where':{'type':_0x78513d,'resourceId':_0x16781b['id']}})[_0xc98e('0x17')](function(){return _0x252ef9;});})[_0xc98e('0x17')](function(){_0x46a940[_0xc98e('0x14')](0xcc)[_0xc98e('0xe')]();});}};}function handleEntityNotFound(_0xd3a04){return function(_0x2c4f1f){if(!_0x2c4f1f){_0xd3a04[_0xc98e('0xd')](0x194);}return _0x2c4f1f;};}function handleError(_0x5dd65d,_0x49b3f7){_0x49b3f7=_0x49b3f7||0x1f4;return function(_0x1ed13b){logger[_0xc98e('0x1c')](_0x1ed13b[_0xc98e('0x1d')]);if(_0x1ed13b['name']){delete _0x1ed13b[_0xc98e('0x1e')];}_0x5dd65d['status'](_0x49b3f7)[_0xc98e('0x1f')](_0x1ed13b);};}exports[_0xc98e('0x20')]=function(_0x523168,_0x508a1f){var _0x4d977e={};var _0x2cb23a={'count':0x0,'rows':[]};var _0x417636=_[_0xc98e('0x21')](db[_0xc98e('0x22')][_0xc98e('0x23')],function(_0x38e53e){return{'name':_0x38e53e[_0xc98e('0x24')],'type':_0x38e53e[_0xc98e('0x25')][_0xc98e('0x26')]};});_0x4d977e=qs[_0xc98e('0x27')](_0x417636,_0x523168);var _0xee3a0b={'where':_0x4d977e[_0xc98e('0x28')]};return db[_0xc98e('0x22')]['count'](_0xee3a0b)[_0xc98e('0x17')](function(_0x50895b){_0x2cb23a[_0xc98e('0x13')]=_0x50895b;_0x4d977e[_0xc98e('0x29')]=qs[_0xc98e('0x29')](_0x523168[_0xc98e('0x2a')]);return db[_0xc98e('0x22')][_0xc98e('0x2b')](_0x4d977e);})[_0xc98e('0x17')](function(_0x494609){_0x2cb23a[_0xc98e('0x2c')]=_0x494609;return _0x2cb23a;})[_0xc98e('0x17')](respondWithFilteredResult(_0x508a1f,_0x4d977e))['catch'](handleError(_0x508a1f,null));};exports[_0xc98e('0x2d')]=function(_0x3288ab,_0x32e585){var _0x5f5187={'raw':!![],'where':{'id':_0x3288ab[_0xc98e('0x2e')]['id']}},_0x504d1a={};_0x504d1a[_0xc98e('0x2f')]=_['keys'](db[_0xc98e('0x22')]['rawAttributes']);_0x504d1a[_0xc98e('0x2a')]=_[_0xc98e('0x30')](_0x3288ab[_0xc98e('0x2a')]);_0x504d1a[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x504d1a[_0xc98e('0x2f')],_0x504d1a[_0xc98e('0x2a')]);_0x5f5187[_0xc98e('0x33')]=_[_0xc98e('0x32')](_0x504d1a[_0xc98e('0x2f')],qs['fields'](_0x3288ab['query'][_0xc98e('0x34')]));_0x5f5187['attributes']=_0x5f5187[_0xc98e('0x33')][_0xc98e('0x35')]?_0x5f5187[_0xc98e('0x33')]:_0x504d1a[_0xc98e('0x2f')];if(_0x3288ab[_0xc98e('0x2a')][_0xc98e('0x36')]){_0x5f5187[_0xc98e('0x29')]=[{'all':!![]}];}_0x5f5187=_[_0xc98e('0x37')]({},_0x5f5187,_0x3288ab[_0xc98e('0x38')]);return db[_0xc98e('0x22')]['find'](_0x5f5187)[_0xc98e('0x17')](handleEntityNotFound(_0x32e585,null))['then'](respondWithResult(_0x32e585,null))[_0xc98e('0x39')](handleError(_0x32e585,null));};exports[_0xc98e('0x3a')]=function(_0x37f685,_0x302453){return db[_0xc98e('0x22')][_0xc98e('0x3a')](_0x37f685[_0xc98e('0x3b')],{})[_0xc98e('0x17')](function(_0x572643){var _0x2857d9=_0x37f685[_0xc98e('0x3c')]['get']({'plain':!![]});if(!_0x2857d9)throw new Error(_0xc98e('0x3d'));if(_0x2857d9[_0xc98e('0x3e')]===_0xc98e('0x3c')){var _0x2e953b=_0x572643[_0xc98e('0x19')]({'plain':!![]});var _0x3df0af='ChatQueues';return db[_0xc98e('0x3f')][_0xc98e('0x40')]({'where':{'name':_0x3df0af,'userProfileId':_0x2857d9[_0xc98e('0x41')]},'raw':!![]})['then'](function(_0x43347e){if(_0x43347e&&_0x43347e[_0xc98e('0x42')]===0x0){return db[_0xc98e('0x1b')][_0xc98e('0x3a')]({'name':_0x2e953b[_0xc98e('0x1e')],'resourceId':_0x2e953b['id'],'type':_0x43347e[_0xc98e('0x1e')],'sectionId':_0x43347e['id']},{})[_0xc98e('0x17')](function(){return _0x572643;});}else{return _0x572643;}})['catch'](function(_0x2cabfe){logger[_0xc98e('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2cabfe);throw _0x2cabfe;});}return _0x572643;})[_0xc98e('0x17')](respondWithResult(_0x302453,0xc9))[_0xc98e('0x39')](handleError(_0x302453,null));};exports[_0xc98e('0x16')]=function(_0x59c78b,_0x5f59f8){if(_0x59c78b[_0xc98e('0x3b')]['id']){delete _0x59c78b[_0xc98e('0x3b')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x59c78b[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x5f59f8,null))['then'](saveUpdates(_0x59c78b['body'],null))['then'](respondWithResult(_0x5f59f8,null))[_0xc98e('0x39')](handleError(_0x5f59f8,null));};exports[_0xc98e('0x18')]=function(_0x79b489,_0x2a7a90){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x79b489['params']['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x2a7a90,null))[_0xc98e('0x17')](removeEntity(_0x2a7a90,null))[_0xc98e('0x39')](handleError(_0x2a7a90,null));};exports[_0xc98e('0x43')]=function(_0xa57843,_0x1b8e5e){return db[_0xc98e('0x22')][_0xc98e('0x43')]()[_0xc98e('0x17')](respondWithResult(_0x1b8e5e,null))[_0xc98e('0x39')](handleError(_0x1b8e5e,null));};exports[_0xc98e('0x44')]=function(_0x54b6fd,_0x25aae7){var _0x4a496c={'raw':!![],'where':{}},_0x1043f1={},_0x10e370;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0x54b6fd[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x25aae7,null))['then'](function(_0x72d614){if(_0x72d614){_0x10e370=_0x72d614[_0xc98e('0x19')]({'plain':!![]});_0x1043f1[_0xc98e('0x2f')]=_[_0xc98e('0x30')](db[_0xc98e('0x46')][_0xc98e('0x23')]);_0x1043f1['query']=_[_0xc98e('0x30')](_0x54b6fd['query']);_0x1043f1[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x1043f1[_0xc98e('0x2f')],_0x1043f1[_0xc98e('0x2a')]);_0x4a496c['attributes']=_['intersection'](_0x1043f1[_0xc98e('0x2f')],qs['fields'](_0x54b6fd['query']['fields']));_0x4a496c[_0xc98e('0x33')]=_0x4a496c[_0xc98e('0x33')][_0xc98e('0x35')]?_0x4a496c[_0xc98e('0x33')]:_0x1043f1[_0xc98e('0x2f')];if(!_0x54b6fd['query'][_0xc98e('0x47')](_0xc98e('0x48'))){_0x4a496c[_0xc98e('0x12')]=qs[_0xc98e('0x12')](_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x12')]);_0x4a496c[_0xc98e('0x10')]=qs[_0xc98e('0x10')](_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x10')]);}_0x4a496c[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0x54b6fd[_0xc98e('0x2a')]['sort']);_0x4a496c['where']=qs[_0xc98e('0x31')](_['pick'](_0x54b6fd[_0xc98e('0x2a')],_0x1043f1[_0xc98e('0x31')]));_0x4a496c[_0xc98e('0x28')][_0xc98e('0x4b')]=_0x72d614['id'];if(_0x54b6fd[_0xc98e('0x2a')][_0xc98e('0x4c')]){_0x4a496c['where']=_[_0xc98e('0x37')](_0x4a496c['where'],{'$or':_[_0xc98e('0x21')](_0x4a496c[_0xc98e('0x33')],function(_0x4f4bb3){var _0x514204={};_0x514204[_0x4f4bb3]={'$like':'%'+_0x54b6fd['query'][_0xc98e('0x4c')]+'%'};return _0x514204;})});}_0x4a496c=_[_0xc98e('0x37')]({},_0x4a496c,_0x54b6fd[_0xc98e('0x38')]);return db[_0xc98e('0x46')][_0xc98e('0x2b')](_0x4a496c);}})['then'](function(_0x20fe9a){if(_0x20fe9a){return db[_0xc98e('0x4d')][_0xc98e('0x4e')]({'where':{'id':_['map'](_0x20fe9a,_0xc98e('0x4f')),'role':'agent'},'attributes':['id',_0xc98e('0x1e'),_0xc98e('0x50'),_0xc98e('0x51'),'createdAt']});}})[_0xc98e('0x17')](function(_0x388b1e){if(_0x388b1e){return{'count':_0x388b1e[_0xc98e('0x13')],'rows':_[_0xc98e('0x21')](_0x388b1e[_0xc98e('0x2c')],function(_0x433790){return{'membername':_0x433790[_0xc98e('0x1e')],'UserId':_0x433790['id'],'queue_name':_0x10e370[_0xc98e('0x1e')],'ChatQueueId':_0x10e370['id'],'interface':util['format'](_0xc98e('0x52'),'SIP',_0x433790[_0xc98e('0x1e')]),'penalty':0x0,'paused':_0x433790['chatPause'],'createdAt':_0x433790[_0xc98e('0x53')],'updatedAt':_0x433790[_0xc98e('0x51')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25aae7,_0x4a496c))[_0xc98e('0x39')](handleError(_0x25aae7,null));};exports[_0xc98e('0x54')]=function(_0xdfe919,_0xa90964){var _0x130b80={};var _0x275ebd={};var _0x3634eb;var _0x1270d3;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0xdfe919[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0xa90964,null))[_0xc98e('0x17')](function(_0x196b0d){if(_0x196b0d){_0x3634eb=_0x196b0d;_0x275ebd['model']=_[_0xc98e('0x30')](db[_0xc98e('0x55')][_0xc98e('0x23')]);_0x275ebd['query']=_[_0xc98e('0x30')](_0xdfe919[_0xc98e('0x2a')]);_0x275ebd[_0xc98e('0x31')]=_[_0xc98e('0x32')](_0x275ebd[_0xc98e('0x2f')],_0x275ebd[_0xc98e('0x2a')]);_0x130b80[_0xc98e('0x33')]=_['intersection'](_0x275ebd['model'],qs[_0xc98e('0x34')](_0xdfe919['query']['fields']));_0x130b80['attributes']=_0x130b80['attributes']['length']?_0x130b80[_0xc98e('0x33')]:_0x275ebd[_0xc98e('0x2f')];_0x130b80[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x4a')]);_0x130b80[_0xc98e('0x28')]=qs[_0xc98e('0x31')](_['pick'](_0xdfe919[_0xc98e('0x2a')],_0x275ebd[_0xc98e('0x31')]));if(_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x4c')]){_0x130b80['where']=_[_0xc98e('0x37')](_0x130b80[_0xc98e('0x28')],{'$or':_[_0xc98e('0x21')](_0x130b80['attributes'],function(_0x3ad195){var _0x588d73={};_0x588d73[_0x3ad195]={'$like':'%'+_0xdfe919[_0xc98e('0x2a')]['filter']+'%'};return _0x588d73;})});}_0x130b80=_[_0xc98e('0x37')]({},_0x130b80,_0xdfe919[_0xc98e('0x38')]);return _0x3634eb['getTeams'](_0x130b80);}})[_0xc98e('0x17')](function(_0xf1fad7){if(_0xf1fad7){_0x1270d3=_0xf1fad7[_0xc98e('0x35')];if(!_0xdfe919[_0xc98e('0x2a')]['hasOwnProperty'](_0xc98e('0x48'))){_0x130b80['limit']=qs[_0xc98e('0x12')](_0xdfe919[_0xc98e('0x2a')]['limit']);_0x130b80['offset']=qs['offset'](_0xdfe919[_0xc98e('0x2a')][_0xc98e('0x10')]);}return _0x3634eb[_0xc98e('0x54')](_0x130b80);}})['then'](function(_0x46c88d){if(_0x46c88d){return _0x46c88d?{'count':_0x1270d3,'rows':_0x46c88d}:null;}})['then'](respondWithResult(_0xa90964,null))[_0xc98e('0x39')](handleError(_0xa90964,null));};exports[_0xc98e('0x56')]=function(_0x32bc4,_0x4e4789){var _0x57d29f=_0x32bc4[_0xc98e('0x3b')][_0xc98e('0x57')];return db[_0xc98e('0x55')][_0xc98e('0x2b')]({'where':{'id':_0x57d29f},'attributes':['id'],'include':[{'model':db[_0xc98e('0x4d')],'as':_0xc98e('0x58'),'attributes':['id',_0xc98e('0x1e'),_0xc98e('0x59'),_0xc98e('0x5a'),_0xc98e('0x5b')],'raw':!![]}]})[_0xc98e('0x17')](function(_0x41a905){if(_0x41a905){var _0x8a6eb=_[_0xc98e('0x5c')](_0x41a905,function(_0x5c24bd){var _0x5cad24=_0x5c24bd[_0xc98e('0x19')]({'plain':!![]});return _0x5cad24[_0xc98e('0x58')];});return db['ChatQueue'][_0xc98e('0x40')]({'where':{'id':_0x32bc4[_0xc98e('0x2e')]['id']}})['then'](function(_0x170867){return db[_0xc98e('0x5d')][_0xc98e('0x5e')](function(_0x1cc1f9){return _0x170867['addTeams'](_0x57d29f,{'transaction':_0x1cc1f9})[_0xc98e('0x17')](function(){return BPromise[_0xc98e('0x5f')](_0x8a6eb,function(_0x555e2b){return db[_0xc98e('0x46')]['findOrCreate']({'where':{'UserId':_0x555e2b['id'],'ChatQueueId':_0x32bc4[_0xc98e('0x2e')]['id']},'transaction':_0x1cc1f9});});})[_0xc98e('0x17')](function(){_0x8a6eb[_0xc98e('0x60')](function(_0x6c4efd){socket[_0xc98e('0x61')](_0xc98e('0x62'),{'UserId':_0x6c4efd['id'],'ChatQueueId':_0x170867['id']});});});});});}})[_0xc98e('0x17')](respondWithStatusCode(_0x4e4789,null))[_0xc98e('0x39')](handleError(_0x4e4789,null));};exports[_0xc98e('0x63')]=function(_0x1b980c,_0x2c0ae5){return db[_0xc98e('0x55')]['findAll']({'where':{'id':_0x1b980c[_0xc98e('0x2a')][_0xc98e('0x57')]},'attributes':['id'],'include':[{'model':db[_0xc98e('0x4d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc98e('0x17')](handleEntityNotFound(_0x2c0ae5,null))[_0xc98e('0x17')](function(_0xa8a0ab){var _0x3f8a77=_['map'](_0xa8a0ab,'id');var _0xb56fac=[];var _0x252b2e=[];var _0x595ff2=squel[_0xc98e('0x64')]();_0x595ff2[_0xc98e('0x65')](_0xc98e('0x66'))[_0xc98e('0x67')](_0xc98e('0x68'),'tq')[_0xc98e('0x69')]('user_has_teams','ut',_0xc98e('0x6a'))[_0xc98e('0x28')](_0xc98e('0x6b'),_0x1b980c[_0xc98e('0x2e')]['id']);for(var _0x2b8835=0x0;_0x2b8835<_0xa8a0ab[_0xc98e('0x35')];_0x2b8835+=0x1){let _0x47c734=_0xa8a0ab[_0x2b8835];for(var _0x32a362=0x0;_0x32a362<_0x47c734[_0xc98e('0x58')]['length'];_0x32a362+=0x1){let _0x306a27=_0x47c734[_0xc98e('0x58')][_0x32a362];var _0x571d75=_0x595ff2[_0xc98e('0x6c')]();_0x571d75[_0xc98e('0x28')]('ut.UserId\x20=\x20?',_0x306a27['id']);_0x252b2e[_0xc98e('0x6d')](db[_0xc98e('0x5d')][_0xc98e('0x2a')](_0x571d75[_0xc98e('0x6e')](),{'type':db['sequelize'][_0xc98e('0x6f')][_0xc98e('0x70')]})[_0xc98e('0x17')](function(_0x2fe92c){if(_0x2fe92c[_0xc98e('0x35')]===0x1){return _0x306a27['id'];}else{var _0x53cf6a=_[_0xc98e('0x71')](_[_0xc98e('0x21')](_0x2fe92c,_0xc98e('0x72')),function(_0x17fa44){return _[_0xc98e('0x73')](_0x3f8a77,_0x17fa44);});if(_0x53cf6a){return _0x306a27['id'];}}}));}}return BPromise[_0xc98e('0x74')](_0x252b2e)['then'](function(_0x28f7a6){_0xb56fac=_(_0xb56fac)[_0xc98e('0x75')](_0x28f7a6)['compact']()[_0xc98e('0x76')]();return db[_0xc98e('0x22')]['find']({'where':{'id':_0x1b980c['params']['id']}})[_0xc98e('0x17')](function(_0x314a94){return db[_0xc98e('0x5d')][_0xc98e('0x5e')](function(_0x5e05f6){return _0x314a94['removeTeams'](_0x1b980c[_0xc98e('0x2a')][_0xc98e('0x57')],{'transaction':_0x5e05f6})[_0xc98e('0x17')](function(){if(!_[_0xc98e('0x77')](_0xb56fac)){return _0x314a94[_0xc98e('0x78')](_0xb56fac,{'transaction':_0x5e05f6});}})[_0xc98e('0x17')](function(){_0xb56fac['forEach'](function(_0x42809f){socket[_0xc98e('0x61')](_0xc98e('0x79'),{'UserId':_0x42809f,'ChatQueueId':_0x314a94['id']});});});});});});})[_0xc98e('0x17')](respondWithStatusCode(_0x2c0ae5,null))[_0xc98e('0x39')](handleError(_0x2c0ae5,null));};exports[_0xc98e('0x7a')]=function(_0x1be9a9,_0x317c2b){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x1be9a9[_0xc98e('0x2e')]['id']}})['then'](handleEntityNotFound(_0x317c2b,null))[_0xc98e('0x17')](function(_0x2a93ee){if(_0x2a93ee){return _0x2a93ee[_0xc98e('0x7a')](_0x1be9a9['body'][_0xc98e('0x57')],_[_0xc98e('0x7b')](_0x1be9a9[_0xc98e('0x3b')],['ids','id'])||{})[_0xc98e('0x7c')](function(_0x468e3f){for(var _0x525c64=0x0;_0x525c64<_0x1be9a9['body'][_0xc98e('0x57')]['length'];_0x525c64+=0x1){socket[_0xc98e('0x61')]('userChatQueue:save',{'UserId':Number(_0x1be9a9[_0xc98e('0x3b')][_0xc98e('0x57')][_0x525c64]),'ChatQueueId':Number(_0x1be9a9[_0xc98e('0x2e')]['id'])});}return _0x468e3f;});}})[_0xc98e('0x17')](respondWithResult(_0x317c2b,null))[_0xc98e('0x39')](handleError(_0x317c2b,null));};exports[_0xc98e('0x78')]=function(_0x3ab47e,_0x452948){return db[_0xc98e('0x22')][_0xc98e('0x40')]({'where':{'id':_0x3ab47e[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x452948,null))[_0xc98e('0x17')](function(_0x1987bc){if(_0x1987bc){return _0x1987bc[_0xc98e('0x78')](_0x3ab47e[_0xc98e('0x2a')][_0xc98e('0x57')])[_0xc98e('0x17')](function(){if(_[_0xc98e('0x7d')](_0x3ab47e['query'][_0xc98e('0x57')])){for(var _0x5c0b3d=0x0;_0x5c0b3d<_0x3ab47e['query'][_0xc98e('0x57')][_0xc98e('0x35')];_0x5c0b3d+=0x1){socket[_0xc98e('0x61')]('userChatQueue:remove',{'UserId':Number(_0x3ab47e[_0xc98e('0x2a')][_0xc98e('0x57')][_0x5c0b3d]),'ChatQueueId':Number(_0x3ab47e[_0xc98e('0x2e')]['id'])});}}else{socket[_0xc98e('0x61')](_0xc98e('0x79'),{'UserId':Number(_0x3ab47e[_0xc98e('0x2a')]['ids']),'ChatQueueId':Number(_0x3ab47e[_0xc98e('0x2e')]['id'])});}});}})[_0xc98e('0x17')](respondWithStatusCode(_0x452948,null))[_0xc98e('0x39')](handleError(_0x452948,null));};exports[_0xc98e('0x7e')]=function(_0x5df54e,_0x1d7d93){var _0x5032af={};var _0x2484ce={};var _0x4fde54;var _0xa52fbe;return db[_0xc98e('0x22')][_0xc98e('0x45')]({'where':{'id':_0x5df54e[_0xc98e('0x2e')]['id']}})[_0xc98e('0x17')](handleEntityNotFound(_0x1d7d93,null))[_0xc98e('0x17')](function(_0x612f1d){if(_0x612f1d){_0x4fde54=_0x612f1d;_0x2484ce[_0xc98e('0x2f')]=_['keys'](db[_0xc98e('0x4d')][_0xc98e('0x23')]);_0x2484ce['query']=_[_0xc98e('0x30')](_0x5df54e[_0xc98e('0x2a')]);_0x2484ce[_0xc98e('0x31')]=_['intersection'](_0x2484ce[_0xc98e('0x2f')],_0x2484ce[_0xc98e('0x2a')]);_0x5032af['attributes']=_[_0xc98e('0x32')](_0x2484ce[_0xc98e('0x2f')],qs[_0xc98e('0x34')](_0x5df54e['query'][_0xc98e('0x34')]));_0x5032af[_0xc98e('0x33')]=_0x5032af[_0xc98e('0x33')]['length']?_0x5032af[_0xc98e('0x33')]:_0x2484ce[_0xc98e('0x2f')];_0x5032af[_0xc98e('0x49')]=qs[_0xc98e('0x4a')](_0x5df54e[_0xc98e('0x2a')][_0xc98e('0x4a')]);_0x5032af[_0xc98e('0x28')]=qs['filters'](_[_0xc98e('0x7f')](_0x5df54e[_0xc98e('0x2a')],_0x2484ce[_0xc98e('0x31')]));if(_0x5df54e['query'][_0xc98e('0x4c')]){_0x5032af['where']=_['merge'](_0x5032af[_0xc98e('0x28')],{'$or':_['map'](_0x5032af[_0xc98e('0x33')],function(_0x24de70){var _0x2197db={};_0x2197db[_0x24de70]={'$like':'%'+_0x5df54e['query']['filter']+'%'};return _0x2197db;})});}_0x5032af=_[_0xc98e('0x37')]({},_0x5032af,_0x5df54e[_0xc98e('0x38')]);return _0x4fde54['getAgents'](_0x5032af);}})[_0xc98e('0x17')](function(_0x43af75){if(_0x43af75){_0xa52fbe=_0x43af75[_0xc98e('0x35')];if(!_0x5df54e['query'][_0xc98e('0x47')](_0xc98e('0x48'))){_0x5032af['limit']=qs[_0xc98e('0x12')](_0x5df54e[_0xc98e('0x2a')]['limit']);_0x5032af[_0xc98e('0x10')]=qs[_0xc98e('0x10')](_0x5df54e[_0xc98e('0x2a')]['offset']);}return _0x4fde54['getAgents'](_0x5032af);}})[_0xc98e('0x17')](function(_0x17db52){if(_0x17db52){return _0x17db52?{'count':_0xa52fbe,'rows':_0x17db52}:null;}})[_0xc98e('0x17')](respondWithResult(_0x1d7d93,null))[_0xc98e('0x39')](handleError(_0x1d7d93,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index dcac9d3..df51624 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 _0x8bad=['hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4e66b2,_0x1d0c56){var _0x265d82=function(_0x17cdcb){while(--_0x17cdcb){_0x4e66b2['push'](_0x4e66b2['shift']());}};_0x265d82(++_0x1d0c56);}(_0x8bad,0x124));var _0xd8ba=function(_0x53400c,_0x25337d){_0x53400c=_0x53400c-0x0;var _0x259fe5=_0x8bad[_0x53400c];return _0x259fe5;};'use strict';var EventEmitter=require(_0xd8ba('0x0'));var ChatQueue=require(_0xd8ba('0x1'))['db'][_0xd8ba('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd8ba('0x3')](0x0);var events={'afterCreate':_0xd8ba('0x4'),'afterUpdate':_0xd8ba('0x5'),'afterDestroy':_0xd8ba('0x6')};function emitEvent(_0x385e50){return function(_0x42969b,_0x55d8d5,_0x224bb6){ChatQueueEvents[_0xd8ba('0x7')](_0x385e50+':'+_0x42969b['id'],_0x42969b);ChatQueueEvents[_0xd8ba('0x7')](_0x385e50,_0x42969b);_0x224bb6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xd8ba('0x8')](e,emitEvent(event));}}module[_0xd8ba('0x9')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7e8e=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3356f0,_0x230069){var _0x33de59=function(_0x19b8da){while(--_0x19b8da){_0x3356f0['push'](_0x3356f0['shift']());}};_0x33de59(++_0x230069);}(_0x7e8e,0x91));var _0xe7e8=function(_0x3849ff,_0x4ae25e){_0x3849ff=_0x3849ff-0x0;var _0x3ab676=_0x7e8e[_0x3849ff];return _0x3ab676;};'use strict';var EventEmitter=require(_0xe7e8('0x0'));var ChatQueue=require(_0xe7e8('0x1'))['db'][_0xe7e8('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe7e8('0x3')](0x0);var events={'afterCreate':_0xe7e8('0x4'),'afterUpdate':_0xe7e8('0x5'),'afterDestroy':_0xe7e8('0x6')};function emitEvent(_0xd0a13b){return function(_0x3c3670,_0x143dc7,_0x533317){ChatQueueEvents['emit'](_0xd0a13b+':'+_0x3c3670['id'],_0x3c3670);ChatQueueEvents[_0xe7e8('0x7')](_0xd0a13b,_0x3c3670);_0x533317(null);};}for(var e in events){if(events[_0xe7e8('0x8')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xe7e8('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 6889fc2..aa7cf3e 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 _0x1f86=['moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x8ffa8e,_0x56f5c6){var _0x9d972a=function(_0x2cdced){while(--_0x2cdced){_0x8ffa8e['push'](_0x8ffa8e['shift']());}};_0x9d972a(++_0x56f5c6);}(_0x1f86,0xbc));var _0x61f8=function(_0x19cfe5,_0x4d1bcf){_0x19cfe5=_0x19cfe5-0x0;var _0x15b837=_0x1f86[_0x19cfe5];return _0x15b837;};'use strict';var _=require(_0x61f8('0x0'));var util=require(_0x61f8('0x1'));var logger=require(_0x61f8('0x2'))(_0x61f8('0x3'));var moment=require(_0x61f8('0x4'));var BPromise=require(_0x61f8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x61f8('0x6'));var rimraf=require(_0x61f8('0x7'));var config=require(_0x61f8('0x8'));var attributes=require(_0x61f8('0x9'));module[_0x61f8('0xa')]=function(_0x36e52f,_0x2df5b2){return _0x36e52f[_0x61f8('0xb')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x724c=['rimraf','./chatQueue.attributes','define','ChatQueue','util','moment','bluebird','request-promise','path'];(function(_0xf1a50a,_0xf21556){var _0x19c1d3=function(_0x163be7){while(--_0x163be7){_0xf1a50a['push'](_0xf1a50a['shift']());}};_0x19c1d3(++_0xf21556);}(_0x724c,0xd3));var _0xc724=function(_0x4e1d60,_0x4e93ef){_0x4e1d60=_0x4e1d60-0x0;var _0x39cd7a=_0x724c[_0x4e1d60];return _0x39cd7a;};'use strict';var _=require('lodash');var util=require(_0xc724('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xc724('0x1'));var BPromise=require(_0xc724('0x2'));var rp=require(_0xc724('0x3'));var fs=require('fs');var path=require(_0xc724('0x4'));var rimraf=require(_0xc724('0x5'));var config=require('../../config/environment');var attributes=require(_0xc724('0x6'));module['exports']=function(_0x5a70fe,_0x214ff2){return _0x5a70fe[_0xc724('0x7')](_0xc724('0x8'),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 795e1fb..a965163 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 _0x7035=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','ChatQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetChatQueue','catch','ShowChatQueue','lodash'];(function(_0x5f4ab1,_0x1cbb88){var _0x5e553d=function(_0x35ff48){while(--_0x35ff48){_0x5f4ab1['push'](_0x5f4ab1['shift']());}};_0x5e553d(++_0x1cbb88);}(_0x7035,0x15e));var _0x5703=function(_0x3aa92c,_0x3a10a0){_0x3aa92c=_0x3aa92c-0x0;var _0x2b1300=_0x7035[_0x3aa92c];return _0x2b1300;};'use strict';var _=require(_0x5703('0x0'));var util=require('util');var moment=require(_0x5703('0x1'));var BPromise=require(_0x5703('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5703('0x3'));var db=require(_0x5703('0x4'))['db'];var utils=require(_0x5703('0x5'));var logger=require(_0x5703('0x6'))(_0x5703('0x7'));var config=require('../../config/environment');var jayson=require(_0x5703('0x8'));var client=jayson[_0x5703('0x9')]['http']({'port':0x232a});config[_0x5703('0xa')]=_[_0x5703('0xb')](config[_0x5703('0xa')],{'host':_0x5703('0xc'),'port':0x18eb});var socket=require(_0x5703('0xd'))(new Redis(config[_0x5703('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x169e83,_0x5775d8,_0x4f1db7){return new BPromise(function(_0x5c36a5,_0x522449){return client[_0x5703('0xe')](_0x169e83,_0x4f1db7)[_0x5703('0xf')](function(_0xfcbc9e){logger['info'](_0x5703('0x10'),_0x5775d8,'request\x20sent');logger[_0x5703('0x11')](_0x5703('0x12'),_0x5775d8,_0x5703('0x13'),JSON[_0x5703('0x14')](_0xfcbc9e));if(_0xfcbc9e[_0x5703('0x15')]){if(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x16')]===0x1f4){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x522449(_0xfcbc9e['error'][_0x5703('0x17')]);}logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);return _0x5c36a5(_0xfcbc9e[_0x5703('0x15')][_0x5703('0x17')]);}else{logger[_0x5703('0x18')](_0x5703('0x10'),_0x5775d8,'request\x20sent');_0x5c36a5(_0xfcbc9e[_0x5703('0x19')][_0x5703('0x17')]);}})['catch'](function(_0x579097){logger[_0x5703('0x15')](_0x5703('0x10'),_0x5775d8,_0x579097);_0x522449(_0x579097);});});}exports['GetChatQueue']=function(_0x240cb8){var _0x59e065=this;return new Promise(function(_0x43cdbf,_0x33d30a){return db[_0x5703('0x1a')][_0x5703('0x1b')]({'raw':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x240cb8['options']?_0x240cb8['options'][_0x5703('0x1e')]||null:null,'attributes':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x1f')]||null:null,'limit':_0x240cb8[_0x5703('0x1c')]?_0x240cb8['options'][_0x5703('0x20')]||null:null,'include':_0x240cb8[_0x5703('0x1c')]?_0x240cb8[_0x5703('0x1c')]['include']?_['map'](_0x240cb8['options'][_0x5703('0x21')],function(_0x495db2){return{'model':db[_0x495db2[_0x5703('0x22')]],'as':_0x495db2['as'],'attributes':_0x495db2[_0x5703('0x1f')],'include':_0x495db2[_0x5703('0x21')]?_[_0x5703('0x23')](_0x495db2[_0x5703('0x21')],function(_0x57964d){return{'model':db[_0x57964d[_0x5703('0x22')]],'as':_0x57964d['as'],'attributes':_0x57964d['attributes'],'include':_0x57964d[_0x5703('0x21')]?_[_0x5703('0x23')](_0x57964d[_0x5703('0x21')],function(_0x4b23ed){return{'model':db[_0x4b23ed[_0x5703('0x22')]],'as':_0x4b23ed['as'],'attributes':_0x4b23ed[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3bd1f7){logger[_0x5703('0x18')](_0x5703('0x24'),_0x240cb8);logger[_0x5703('0x11')]('GetChatQueue',_0x240cb8,JSON['stringify'](_0x3bd1f7));_0x43cdbf(_0x3bd1f7);})[_0x5703('0x25')](function(_0x28a460){logger[_0x5703('0x15')](_0x5703('0x24'),_0x28a460[_0x5703('0x17')],_0x240cb8);_0x33d30a(_0x59e065[_0x5703('0x15')](0x1f4,_0x28a460[_0x5703('0x17')]));});});};exports[_0x5703('0x26')]=function(_0x3508e8){var _0x2fb0c0=this;return new Promise(function(_0x2af3c3,_0x3fadcc){return db[_0x5703('0x1a')]['find']({'raw':_0x3508e8['options']?_0x3508e8['options'][_0x5703('0x1d')]===undefined?!![]:![]:!![],'where':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')][_0x5703('0x1e')]||null:null,'attributes':_0x3508e8[_0x5703('0x1c')]?_0x3508e8['options'][_0x5703('0x1f')]||null:null,'include':_0x3508e8[_0x5703('0x1c')]?_0x3508e8[_0x5703('0x1c')]['include']?_[_0x5703('0x23')](_0x3508e8[_0x5703('0x1c')][_0x5703('0x21')],function(_0x2eab10){return{'model':db[_0x2eab10['model']],'as':_0x2eab10['as'],'attributes':_0x2eab10[_0x5703('0x1f')],'include':_0x2eab10[_0x5703('0x21')]?_['map'](_0x2eab10[_0x5703('0x21')],function(_0x1f08ba){return{'model':db[_0x1f08ba[_0x5703('0x22')]],'as':_0x1f08ba['as'],'attributes':_0x1f08ba['attributes'],'include':_0x1f08ba[_0x5703('0x21')]?_['map'](_0x1f08ba[_0x5703('0x21')],function(_0x319aa6){return{'model':db[_0x319aa6[_0x5703('0x22')]],'as':_0x319aa6['as'],'attributes':_0x319aa6[_0x5703('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x495a7c){logger[_0x5703('0x18')](_0x5703('0x26'),_0x3508e8);logger[_0x5703('0x11')](_0x5703('0x26'),_0x3508e8,JSON[_0x5703('0x14')](_0x495a7c));_0x2af3c3(_0x495a7c);})['catch'](function(_0x5c0ae3){logger[_0x5703('0x15')](_0x5703('0x26'),_0x5c0ae3[_0x5703('0x17')],_0x3508e8);_0x3fadcc(_0x2fb0c0[_0x5703('0x15')](0x1f4,_0x5c0ae3[_0x5703('0x17')]));});});};
\ No newline at end of file
+var _0x77f1=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','register','request'];(function(_0x48af02,_0xa58dcf){var _0xa8280a=function(_0x46c7f9){while(--_0x46c7f9){_0x48af02['push'](_0x48af02['shift']());}};_0xa8280a(++_0xa58dcf);}(_0x77f1,0x1dd));var _0x177f=function(_0x1c7fe7,_0x13f754){_0x1c7fe7=_0x1c7fe7-0x0;var _0x366cff=_0x77f1[_0x1c7fe7];return _0x366cff;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177f('0x3'));var logger=require(_0x177f('0x4'))('rpc');var config=require(_0x177f('0x5'));var jayson=require(_0x177f('0x6'));var client=jayson[_0x177f('0x7')][_0x177f('0x8')]({'port':0x232a});config[_0x177f('0x9')]=_['defaults'](config[_0x177f('0x9')],{'host':_0x177f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x177f('0x9')]));require('./chatQueue.socket')[_0x177f('0xb')](socket);function respondWithRpcPromise(_0x4e1bab,_0x2050c2,_0x38989d){return new BPromise(function(_0x47ccab,_0x42d6d2){return client[_0x177f('0xc')](_0x4e1bab,_0x38989d)[_0x177f('0xd')](function(_0xf5086c){logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));logger[_0x177f('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2050c2,_0x177f('0x10'),JSON[_0x177f('0x12')](_0xf5086c));if(_0xf5086c[_0x177f('0x13')]){if(_0xf5086c[_0x177f('0x13')]['code']===0x1f4){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')]['message']);return _0x42d6d2(_0xf5086c['error'][_0x177f('0x14')]);}logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);return _0x47ccab(_0xf5086c[_0x177f('0x13')][_0x177f('0x14')]);}else{logger[_0x177f('0xe')](_0x177f('0xf'),_0x2050c2,_0x177f('0x10'));_0x47ccab(_0xf5086c['result'][_0x177f('0x14')]);}})[_0x177f('0x15')](function(_0x4d1c1e){logger[_0x177f('0x13')](_0x177f('0xf'),_0x2050c2,_0x4d1c1e);_0x42d6d2(_0x4d1c1e);});});}exports[_0x177f('0x16')]=function(_0x3cccbf){var _0x3ff483=this;return new Promise(function(_0x4649f0,_0x40f6ed){return db[_0x177f('0x17')][_0x177f('0x18')]({'raw':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf['options'][_0x177f('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1b')]||null:null,'attributes':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1c')]||null:null,'limit':_0x3cccbf['options']?_0x3cccbf['options'][_0x177f('0x1d')]||null:null,'include':_0x3cccbf[_0x177f('0x19')]?_0x3cccbf[_0x177f('0x19')][_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x3cccbf[_0x177f('0x19')]['include'],function(_0x248e4c){return{'model':db[_0x248e4c[_0x177f('0x20')]],'as':_0x248e4c['as'],'attributes':_0x248e4c[_0x177f('0x1c')],'include':_0x248e4c[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x248e4c[_0x177f('0x1e')],function(_0x1a8e92){return{'model':db[_0x1a8e92[_0x177f('0x20')]],'as':_0x1a8e92['as'],'attributes':_0x1a8e92[_0x177f('0x1c')],'include':_0x1a8e92[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x1a8e92[_0x177f('0x1e')],function(_0x25d876){return{'model':db[_0x25d876[_0x177f('0x20')]],'as':_0x25d876['as'],'attributes':_0x25d876[_0x177f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xfa8ad0){logger[_0x177f('0xe')]('GetChatQueue',_0x3cccbf);logger[_0x177f('0x11')](_0x177f('0x16'),_0x3cccbf,JSON['stringify'](_0xfa8ad0));_0x4649f0(_0xfa8ad0);})[_0x177f('0x15')](function(_0x27cfb3){logger['error']('GetChatQueue',_0x27cfb3['message'],_0x3cccbf);_0x40f6ed(_0x3ff483['error'](0x1f4,_0x27cfb3[_0x177f('0x14')]));});});};exports[_0x177f('0x21')]=function(_0x6cc694){var _0x15681b=this;return new Promise(function(_0xcf2134,_0x99a037){return db[_0x177f('0x17')][_0x177f('0x22')]({'raw':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['where']||null:null,'attributes':_0x6cc694[_0x177f('0x19')]?_0x6cc694[_0x177f('0x19')]['attributes']||null:null,'include':_0x6cc694['options']?_0x6cc694[_0x177f('0x19')][_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x6cc694[_0x177f('0x19')]['include'],function(_0x5c0033){return{'model':db[_0x5c0033[_0x177f('0x20')]],'as':_0x5c0033['as'],'attributes':_0x5c0033[_0x177f('0x1c')],'include':_0x5c0033[_0x177f('0x1e')]?_[_0x177f('0x1f')](_0x5c0033[_0x177f('0x1e')],function(_0x25659d){return{'model':db[_0x25659d[_0x177f('0x20')]],'as':_0x25659d['as'],'attributes':_0x25659d['attributes'],'include':_0x25659d[_0x177f('0x1e')]?_['map'](_0x25659d[_0x177f('0x1e')],function(_0x23b8c9){return{'model':db[_0x23b8c9['model']],'as':_0x23b8c9['as'],'attributes':_0x23b8c9[_0x177f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x177f('0xd')](function(_0x408154){logger[_0x177f('0xe')]('ShowChatQueue',_0x6cc694);logger['debug']('ShowChatQueue',_0x6cc694,JSON[_0x177f('0x12')](_0x408154));_0xcf2134(_0x408154);})[_0x177f('0x15')](function(_0x47532c){logger[_0x177f('0x13')](_0x177f('0x21'),_0x47532c[_0x177f('0x14')],_0x6cc694);_0x99a037(_0x15681b[_0x177f('0x13')](0x1f4,_0x47532c[_0x177f('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index ad7e3ab..fe51aff 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 _0xb458=['length','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x5e6c25,_0x29046e){var _0x8d0c63=function(_0x509bff){while(--_0x509bff){_0x5e6c25['push'](_0x5e6c25['shift']());}};_0x8d0c63(++_0x29046e);}(_0xb458,0x103));var _0x8b45=function(_0x1024ca,_0x2562fe){_0x1024ca=_0x1024ca-0x0;var _0x390f5c=_0xb458[_0x1024ca];return _0x390f5c;};'use strict';var ChatQueueEvents=require(_0x8b45('0x0'));var events=[_0x8b45('0x1'),_0x8b45('0x2'),'update'];function createListener(_0x58a508,_0xdf89d4){return function(_0x93d9cd){_0xdf89d4[_0x8b45('0x3')](_0x58a508,_0x93d9cd);};}function removeListener(_0x13a8c6,_0x5d51e4){return function(){ChatQueueEvents[_0x8b45('0x4')](_0x13a8c6,_0x5d51e4);};}exports['register']=function(_0x5cc2d5){for(var _0xe8d774=0x0,_0x12bd05=events[_0x8b45('0x5')];_0xe8d774<_0x12bd05;_0xe8d774++){var _0x3a8ccb=events[_0xe8d774];var _0x32342f=createListener('chatQueue:'+_0x3a8ccb,_0x5cc2d5);ChatQueueEvents['on'](_0x3a8ccb,_0x32342f);}};
\ No newline at end of file
+var _0x303a=['removeListener','register','length','./chatQueue.events','remove','update','emit'];(function(_0x3445fc,_0xe740b8){var _0x4534c2=function(_0x1fe7dc){while(--_0x1fe7dc){_0x3445fc['push'](_0x3445fc['shift']());}};_0x4534c2(++_0xe740b8);}(_0x303a,0x1a0));var _0xa303=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x303a[_0x20845e];return _0x28cf2b;};'use strict';var ChatQueueEvents=require(_0xa303('0x0'));var events=['save',_0xa303('0x1'),_0xa303('0x2')];function createListener(_0x36e548,_0x19d27a){return function(_0x594b49){_0x19d27a[_0xa303('0x3')](_0x36e548,_0x594b49);};}function removeListener(_0x26b47c,_0x38a354){return function(){ChatQueueEvents[_0xa303('0x4')](_0x26b47c,_0x38a354);};}exports[_0xa303('0x5')]=function(_0x1c7ee9){for(var _0x2bc3d7=0x0,_0x3f61f1=events[_0xa303('0x6')];_0x2bc3d7<_0x3f61f1;_0x2bc3d7++){var _0x5d95fd=events[_0x2bc3d7];var _0x51e1ee=createListener('chatQueue:'+_0x5d95fd,_0x1c7ee9);ChatQueueEvents['on'](_0x5d95fd,_0x51e1ee);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index dd6c5ec..698ad40 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 _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(_0x455a9c,_0x4235c6){var _0x112350=function(_0x5a044d){while(--_0x5a044d){_0x455a9c['push'](_0x455a9c['shift']());}};_0x112350(++_0x4235c6);}(_0x814b,0x1a2));var _0xb814=function(_0x263f9d,_0x3d854e){_0x263f9d=_0x263f9d-0x0;var _0x4c4efa=_0x814b[_0x263f9d];return _0x4c4efa;};'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
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x532d14,_0x285b6b){var _0x2e636f=function(_0x594503){while(--_0x594503){_0x532d14['push'](_0x532d14['shift']());}};_0x2e636f(++_0x285b6b);}(_0x008c,0x188));var _0xc008=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x008c[_0x320b8e];return _0x55a10a;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);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 2aeefab..777e422 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 _0x20da=['exports','STRING','DATE','moment','sequelize'];(function(_0x2add1c,_0x50f7c7){var _0x304af0=function(_0x324103){while(--_0x324103){_0x2add1c['push'](_0x2add1c['shift']());}};_0x304af0(++_0x50f7c7);}(_0x20da,0xcb));var _0xa20d=function(_0x58deaf,_0x4d4bde){_0x58deaf=_0x58deaf-0x0;var _0x23ee59=_0x20da[_0x58deaf];return _0x23ee59;};'use strict';var moment=require(_0xa20d('0x0'));var Sequelize=require(_0xa20d('0x1'));module[_0xa20d('0x2')]={'uniqueid':{'type':Sequelize[_0xa20d('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa20d('0x4')]},'leaveAt':{'type':Sequelize[_0xa20d('0x4')]},'acceptAt':{'type':Sequelize[_0xa20d('0x4')]},'exitAt':{'type':Sequelize[_0xa20d('0x4')]},'reason':{'type':Sequelize[_0xa20d('0x3')]}};
\ No newline at end of file
+var _0x9fe1=['moment','exports','STRING','DATE'];(function(_0x3a5b58,_0x1a206f){var _0x230d94=function(_0xcb4681){while(--_0xcb4681){_0x3a5b58['push'](_0x3a5b58['shift']());}};_0x230d94(++_0x1a206f);}(_0x9fe1,0x18c));var _0x19fe=function(_0x266d00,_0x3cd3b8){_0x266d00=_0x266d00-0x0;var _0x3a5690=_0x9fe1[_0x266d00];return _0x3a5690;};'use strict';var moment=require(_0x19fe('0x0'));var Sequelize=require('sequelize');module[_0x19fe('0x1')]={'uniqueid':{'type':Sequelize[_0x19fe('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x19fe('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x19fe('0x3')]},'exitAt':{'type':Sequelize[_0x19fe('0x3')]},'reason':{'type':Sequelize[_0x19fe('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 2947fad..a6b60d7 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 _0xbccd=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','sort','filters','pick','filter','where','merge','options','includeAll','include','ChatQueueReport','findAll','params','keys','length','find','create','catch','body','describe'];(function(_0x444af1,_0x117b28){var _0x3f137f=function(_0x4a8d06){while(--_0x4a8d06){_0x444af1['push'](_0x444af1['shift']());}};_0x3f137f(++_0x117b28);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xbccd[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xdbcc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdbcc('0x1'));var rp=require(_0xdbcc('0x2'));var moment=require(_0xdbcc('0x3'));var BPromise=require(_0xdbcc('0x4'));var Mustache=require(_0xdbcc('0x5'));var util=require(_0xdbcc('0x6'));var path=require('path');var sox=require(_0xdbcc('0x7'));var csv=require(_0xdbcc('0x8'));var ejs=require(_0xdbcc('0x9'));var fs=require('fs');var fs_extra=require(_0xdbcc('0xa'));var _=require(_0xdbcc('0xb'));var squel=require(_0xdbcc('0xc'));var crypto=require(_0xdbcc('0xd'));var jsforce=require(_0xdbcc('0xe'));var deskjs=require(_0xdbcc('0xf'));var toCsv=require(_0xdbcc('0x8'));var querystring=require(_0xdbcc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbcc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdbcc('0x12'));var hardwareService=require(_0xdbcc('0x13'));var logger=require(_0xdbcc('0x14'))(_0xdbcc('0x15'));var utils=require(_0xdbcc('0x16'));var config=require(_0xdbcc('0x17'));var licenseUtil=require(_0xdbcc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fbd02,_0x4c8384){_0x4c8384=_0x4c8384||0xcc;return function(_0x52b3bf){if(_0x52b3bf){return _0x2fbd02['sendStatus'](_0x4c8384);}return _0x2fbd02[_0xdbcc('0x19')](_0x4c8384)[_0xdbcc('0x1a')]();};}function respondWithResult(_0x290b93,_0xa799eb){_0xa799eb=_0xa799eb||0xc8;return function(_0x381f22){if(_0x381f22){return _0x290b93[_0xdbcc('0x19')](_0xa799eb)[_0xdbcc('0x1b')](_0x381f22);}};}function respondWithFilteredResult(_0x4649d2,_0x5c53a1){return function(_0x5688ce){if(_0x5688ce){var _0x2b189a=typeof _0x5c53a1[_0xdbcc('0x1c')]===_0xdbcc('0x1d')&&typeof _0x5c53a1[_0xdbcc('0x1e')]===_0xdbcc('0x1d');var _0x2df00c=_0x5688ce[_0xdbcc('0x1f')];var _0x3bfeb0=_0x2b189a?0x0:_0x5c53a1[_0xdbcc('0x1c')];var _0x3d9bda=_0x2b189a?_0x5688ce[_0xdbcc('0x1f')]:_0x5c53a1[_0xdbcc('0x1c')]+_0x5c53a1[_0xdbcc('0x1e')];var _0x4dd404;if(_0x3d9bda>=_0x2df00c){_0x3d9bda=_0x2df00c;_0x4dd404=0xc8;}else{_0x4dd404=0xce;}_0x4649d2['status'](_0x4dd404);return _0x4649d2[_0xdbcc('0x20')](_0xdbcc('0x21'),_0x3bfeb0+'-'+_0x3d9bda+'/'+_0x2df00c)['json'](_0x5688ce);}return null;};}function patchUpdates(_0x447f70){return function(_0x47990b){try{jsonpatch[_0xdbcc('0x22')](_0x47990b,_0x447f70,!![]);}catch(_0x500ec4){return BPromise['reject'](_0x500ec4);}return _0x47990b[_0xdbcc('0x23')]();};}function saveUpdates(_0x3c321f,_0x40d7d0){return function(_0x6eee38){if(_0x6eee38){return _0x6eee38[_0xdbcc('0x24')](_0x3c321f)[_0xdbcc('0x25')](function(_0x2d797a){return _0x2d797a;});}return null;};}function removeEntity(_0x18d47f,_0x591962){return function(_0x343523){if(_0x343523){return _0x343523['destroy']()[_0xdbcc('0x25')](function(){_0x18d47f[_0xdbcc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18d76d,_0xb2a8b4){return function(_0x2df594){if(!_0x2df594){_0x18d76d['sendStatus'](0x194);}return _0x2df594;};}function handleError(_0x50e23c,_0xbe9ba3){_0xbe9ba3=_0xbe9ba3||0x1f4;return function(_0x17e223){logger[_0xdbcc('0x26')](_0x17e223['stack']);if(_0x17e223[_0xdbcc('0x27')]){delete _0x17e223[_0xdbcc('0x27')];}_0x50e23c['status'](_0xbe9ba3)[_0xdbcc('0x28')](_0x17e223);};}exports[_0xdbcc('0x29')]=function(_0x26cf3a,_0x59b175){var _0x31412c={},_0x548047={},_0x1b4425={'count':0x0,'rows':[]};var _0x57d722=_[_0xdbcc('0x2a')](db['ChatQueueReport'][_0xdbcc('0x2b')],function(_0x38b9ac){return{'name':_0x38b9ac[_0xdbcc('0x2c')],'type':_0x38b9ac[_0xdbcc('0x2d')][_0xdbcc('0x2e')]};});_0x548047[_0xdbcc('0x2f')]=_[_0xdbcc('0x2a')](_0x57d722,'name');_0x548047[_0xdbcc('0x30')]=_['keys'](_0x26cf3a[_0xdbcc('0x30')]);_0x548047['filters']=_['intersection'](_0x548047[_0xdbcc('0x2f')],_0x548047[_0xdbcc('0x30')]);_0x31412c['attributes']=_[_0xdbcc('0x31')](_0x548047['model'],qs[_0xdbcc('0x32')](_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x32')]));_0x31412c[_0xdbcc('0x33')]=_0x31412c[_0xdbcc('0x33')]['length']?_0x31412c[_0xdbcc('0x33')]:_0x548047[_0xdbcc('0x2f')];if(!_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x34')]('nolimit')){_0x31412c['limit']=qs[_0xdbcc('0x1e')](_0x26cf3a['query']['limit']);_0x31412c[_0xdbcc('0x1c')]=qs[_0xdbcc('0x1c')](_0x26cf3a[_0xdbcc('0x30')]['offset']);}_0x31412c['order']=qs[_0xdbcc('0x35')](_0x26cf3a[_0xdbcc('0x30')]['sort']);_0x31412c['where']=qs[_0xdbcc('0x36')](_[_0xdbcc('0x37')](_0x26cf3a[_0xdbcc('0x30')],_0x548047[_0xdbcc('0x36')]),_0x57d722);if(_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]){_0x31412c[_0xdbcc('0x39')]=_['merge'](_0x31412c[_0xdbcc('0x39')],{'$or':_['map'](_0x57d722,function(_0x2826d5){if(_0x2826d5[_0xdbcc('0x2d')]!=='VIRTUAL'){var _0xfc5684={};_0xfc5684[_0x2826d5[_0xdbcc('0x27')]]={'$like':'%'+_0x26cf3a[_0xdbcc('0x30')][_0xdbcc('0x38')]+'%'};return _0xfc5684;}})});}_0x31412c=_[_0xdbcc('0x3a')]({},_0x31412c,_0x26cf3a[_0xdbcc('0x3b')]);var _0x193651={'where':_0x31412c[_0xdbcc('0x39')]};return db['ChatQueueReport'][_0xdbcc('0x1f')](_0x193651)[_0xdbcc('0x25')](function(_0x298e63){_0x1b4425[_0xdbcc('0x1f')]=_0x298e63;if(_0x26cf3a['query'][_0xdbcc('0x3c')]){_0x31412c[_0xdbcc('0x3d')]=[{'all':!![]}];}return db[_0xdbcc('0x3e')][_0xdbcc('0x3f')](_0x31412c);})[_0xdbcc('0x25')](function(_0x24b4d5){_0x1b4425['rows']=_0x24b4d5;return _0x1b4425;})[_0xdbcc('0x25')](respondWithFilteredResult(_0x59b175,_0x31412c))['catch'](handleError(_0x59b175,null));};exports['show']=function(_0x3d4371,_0x3de65f){var _0x1c1ea8={'raw':!![],'where':{'id':_0x3d4371[_0xdbcc('0x40')]['id']}},_0x5c32db={};_0x5c32db['model']=_[_0xdbcc('0x41')](db[_0xdbcc('0x3e')][_0xdbcc('0x2b')]);_0x5c32db['query']=_[_0xdbcc('0x41')](_0x3d4371[_0xdbcc('0x30')]);_0x5c32db[_0xdbcc('0x36')]=_['intersection'](_0x5c32db[_0xdbcc('0x2f')],_0x5c32db[_0xdbcc('0x30')]);_0x1c1ea8['attributes']=_[_0xdbcc('0x31')](_0x5c32db[_0xdbcc('0x2f')],qs[_0xdbcc('0x32')](_0x3d4371['query'][_0xdbcc('0x32')]));_0x1c1ea8[_0xdbcc('0x33')]=_0x1c1ea8[_0xdbcc('0x33')][_0xdbcc('0x42')]?_0x1c1ea8['attributes']:_0x5c32db[_0xdbcc('0x2f')];if(_0x3d4371[_0xdbcc('0x30')]['includeAll']){_0x1c1ea8[_0xdbcc('0x3d')]=[{'all':!![]}];}_0x1c1ea8=_[_0xdbcc('0x3a')]({},_0x1c1ea8,_0x3d4371[_0xdbcc('0x3b')]);return db['ChatQueueReport'][_0xdbcc('0x43')](_0x1c1ea8)[_0xdbcc('0x25')](handleEntityNotFound(_0x3de65f,null))[_0xdbcc('0x25')](respondWithResult(_0x3de65f,null))['catch'](handleError(_0x3de65f,null));};exports[_0xdbcc('0x44')]=function(_0x301f00,_0x2b2172){return db[_0xdbcc('0x3e')]['create'](_0x301f00['body'],{})[_0xdbcc('0x25')](respondWithResult(_0x2b2172,0xc9))[_0xdbcc('0x45')](handleError(_0x2b2172,null));};exports[_0xdbcc('0x24')]=function(_0x5da133,_0x16f783){if(_0x5da133[_0xdbcc('0x46')]['id']){delete _0x5da133[_0xdbcc('0x46')]['id'];}return db[_0xdbcc('0x3e')]['find']({'where':{'id':_0x5da133[_0xdbcc('0x40')]['id']}})[_0xdbcc('0x25')](handleEntityNotFound(_0x16f783,null))[_0xdbcc('0x25')](saveUpdates(_0x5da133[_0xdbcc('0x46')],null))[_0xdbcc('0x25')](respondWithResult(_0x16f783,null))[_0xdbcc('0x45')](handleError(_0x16f783,null));};exports['destroy']=function(_0x534063,_0x1470e9){return db['ChatQueueReport'][_0xdbcc('0x43')]({'where':{'id':_0x534063['params']['id']}})['then'](handleEntityNotFound(_0x1470e9,null))[_0xdbcc('0x25')](removeEntity(_0x1470e9,null))['catch'](handleError(_0x1470e9,null));};exports[_0xdbcc('0x47')]=function(_0xe005aa,_0x5e2656){return db[_0xdbcc('0x3e')][_0xdbcc('0x47')]()['then'](respondWithResult(_0x5e2656,null))[_0xdbcc('0x45')](handleError(_0x5e2656,null));};
\ No newline at end of file
+var _0xc4aa=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x17d76b,_0x54345b){var _0x16f3ac=function(_0x315442){while(--_0x315442){_0x17d76b['push'](_0x17d76b['shift']());}};_0x16f3ac(++_0x54345b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xc4aa[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')](_0x5a7f6e['body'],{})['then'](respondWithResult(_0x244950,0xc9))[_0xac4a('0x44')](handleError(_0x244950,null));};exports['update']=function(_0x18ae96,_0x566258){if(_0x18ae96[_0xac4a('0x4a')]['id']){delete _0x18ae96['body']['id'];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'id':_0x18ae96[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x566258,null))['then'](saveUpdates(_0x18ae96[_0xac4a('0x4a')],null))[_0xac4a('0x24')](respondWithResult(_0x566258,null))[_0xac4a('0x44')](handleError(_0x566258,null));};exports[_0xac4a('0x25')]=function(_0x2f30e2,_0x138876){return db[_0xac4a('0x2c')]['find']({'where':{'id':_0x2f30e2[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x138876,null))['then'](removeEntity(_0x138876,null))[_0xac4a('0x44')](handleError(_0x138876,null));};exports[_0xac4a('0x4c')]=function(_0x26e716,_0x3ac36e){return db['ChatQueueReport'][_0xac4a('0x4c')]()[_0xac4a('0x24')](respondWithResult(_0x3ac36e,null))[_0xac4a('0x44')](handleError(_0x3ac36e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 2977911..349b94e 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x31f5b0,_0x3ceb60){var _0x25dfd3=function(_0x4f81da){while(--_0x4f81da){_0x31f5b0['push'](_0x31f5b0['shift']());}};_0x25dfd3(++_0x3ceb60);}(_0xe706,0xa3));var _0x6e70=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0xe706[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index db24446..84fd5dd 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 _0xdc91=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','UpdateChatQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x581feb,_0x475a85){var _0x29fe1a=function(_0x34b44d){while(--_0x34b44d){_0x581feb['push'](_0x581feb['shift']());}};_0x29fe1a(++_0x475a85);}(_0xdc91,0x10c));var _0x1dc9=function(_0x2da629,_0x1b1f12){_0x2da629=_0x2da629-0x0;var _0x34b6f7=_0xdc91[_0x2da629];return _0x34b6f7;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require(_0x1dc9('0x2'));var BPromise=require(_0x1dc9('0x3'));var rs=require(_0x1dc9('0x4'));var fs=require('fs');var Redis=require(_0x1dc9('0x5'));var db=require(_0x1dc9('0x6'))['db'];var utils=require(_0x1dc9('0x7'));var logger=require(_0x1dc9('0x8'))(_0x1dc9('0x9'));var config=require(_0x1dc9('0xa'));var jayson=require(_0x1dc9('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x358946,_0x3323f,_0x598916){return new BPromise(function(_0x549f73,_0xf6e540){return client[_0x1dc9('0xc')](_0x358946,_0x598916)[_0x1dc9('0xd')](function(_0x3c074b){logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));logger[_0x1dc9('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x3323f,_0x1dc9('0x10'),JSON[_0x1dc9('0x12')](_0x3c074b));if(_0x3c074b[_0x1dc9('0x13')]){if(_0x3c074b['error'][_0x1dc9('0x14')]===0x1f4){logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')][_0x1dc9('0x15')]);return _0xf6e540(_0x3c074b['error'][_0x1dc9('0x15')]);}logger[_0x1dc9('0x13')](_0x1dc9('0xf'),_0x3323f,_0x3c074b[_0x1dc9('0x13')]['message']);return _0x549f73(_0x3c074b['error'][_0x1dc9('0x15')]);}else{logger[_0x1dc9('0xe')](_0x1dc9('0xf'),_0x3323f,_0x1dc9('0x10'));_0x549f73(_0x3c074b[_0x1dc9('0x16')][_0x1dc9('0x15')]);}})[_0x1dc9('0x17')](function(_0x30f908){logger[_0x1dc9('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x3323f,_0x30f908);_0xf6e540(_0x30f908);});});}exports[_0x1dc9('0x18')]=function(_0x460bae){var _0x4b7123=this;return new Promise(function(_0x230148,_0x5553d6){return db[_0x1dc9('0x19')]['create'](_0x460bae['body'],{'raw':_0x460bae[_0x1dc9('0x1a')]?_0x460bae['options'][_0x1dc9('0x1b')]===undefined?!![]:![]:!![]})[_0x1dc9('0xd')](function(_0x197e1c){logger[_0x1dc9('0xe')](_0x1dc9('0x18'),_0x460bae);logger[_0x1dc9('0x11')]('CreateChatQueueReport',_0x460bae,JSON['stringify'](_0x197e1c));_0x230148(_0x197e1c);})[_0x1dc9('0x17')](function(_0x586886){logger[_0x1dc9('0x13')](_0x1dc9('0x18'),_0x586886[_0x1dc9('0x15')],_0x460bae);_0x5553d6(_0x4b7123[_0x1dc9('0x13')](0x1f4,_0x586886[_0x1dc9('0x15')]));});});};exports[_0x1dc9('0x1c')]=function(_0x27011a){var _0x1a2dd4=this;return new Promise(function(_0x5babc9,_0x2159c7){return db[_0x1dc9('0x19')][_0x1dc9('0x1d')](_0x27011a[_0x1dc9('0x1e')],{'raw':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x1f')]||null:null,'attributes':_0x27011a['options']?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x20')]||null:null,'limit':_0x27011a[_0x1dc9('0x1a')]?_0x27011a[_0x1dc9('0x1a')][_0x1dc9('0x21')]||null:null})['then'](function(_0x2a6893){logger[_0x1dc9('0xe')]('UpdateChatQueueReport',_0x27011a);logger[_0x1dc9('0x11')](_0x1dc9('0x1c'),_0x27011a,JSON['stringify'](_0x2a6893));_0x5babc9(_0x2a6893);})[_0x1dc9('0x17')](function(_0x3d4a94){logger[_0x1dc9('0x13')](_0x1dc9('0x1c'),_0x3d4a94[_0x1dc9('0x15')],_0x27011a);_0x2159c7(_0x1a2dd4['error'](0x1f4,_0x3d4a94[_0x1dc9('0x15')]));});});};
\ No newline at end of file
+var _0xeb79=['error','ChatQueueReport,\x20%s,\x20%s','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','update','attributes','UpdateChatQueueReport','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x76baa8,_0xbc5f21){var _0xc6ca5f=function(_0x46a42c){while(--_0x46a42c){_0x76baa8['push'](_0x76baa8['shift']());}};_0xc6ca5f(++_0xbc5f21);}(_0xeb79,0x143));var _0x9eb7=function(_0x55732c,_0x4da144){_0x55732c=_0x55732c-0x0;var _0x24887a=_0xeb79[_0x55732c];return _0x24887a;};'use strict';var _=require(_0x9eb7('0x0'));var util=require(_0x9eb7('0x1'));var moment=require(_0x9eb7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9eb7('0x3'))['db'];var utils=require(_0x9eb7('0x4'));var logger=require(_0x9eb7('0x5'))('rpc');var config=require(_0x9eb7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9eb7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x276ee1,_0x4ed9a3,_0x43074d){return new BPromise(function(_0x39b77a,_0x7acd19){return client[_0x9eb7('0x8')](_0x276ee1,_0x43074d)['then'](function(_0xbd2855){logger[_0x9eb7('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x4ed9a3,_0x9eb7('0xa'));logger['debug'](_0x9eb7('0xb'),_0x4ed9a3,_0x9eb7('0xa'),JSON[_0x9eb7('0xc')](_0xbd2855));if(_0xbd2855['error']){if(_0xbd2855[_0x9eb7('0xd')]['code']===0x1f4){logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);return _0x7acd19(_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);}logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0xbd2855[_0x9eb7('0xd')]['message']);return _0x39b77a(_0xbd2855[_0x9eb7('0xd')][_0x9eb7('0xf')]);}else{logger[_0x9eb7('0x9')]('ChatQueueReport,\x20%s,\x20%s',_0x4ed9a3,'request\x20sent');_0x39b77a(_0xbd2855['result']['message']);}})[_0x9eb7('0x10')](function(_0x172aa6){logger[_0x9eb7('0xd')](_0x9eb7('0xe'),_0x4ed9a3,_0x172aa6);_0x7acd19(_0x172aa6);});});}exports[_0x9eb7('0x11')]=function(_0x1bb1ae){var _0x57a19b=this;return new Promise(function(_0x4c1398,_0x304f44){return db[_0x9eb7('0x12')][_0x9eb7('0x13')](_0x1bb1ae[_0x9eb7('0x14')],{'raw':_0x1bb1ae[_0x9eb7('0x15')]?_0x1bb1ae[_0x9eb7('0x15')][_0x9eb7('0x16')]===undefined?!![]:![]:!![]})[_0x9eb7('0x17')](function(_0x4a13c1){logger[_0x9eb7('0x9')]('CreateChatQueueReport',_0x1bb1ae);logger[_0x9eb7('0x18')](_0x9eb7('0x11'),_0x1bb1ae,JSON[_0x9eb7('0xc')](_0x4a13c1));_0x4c1398(_0x4a13c1);})['catch'](function(_0xb940ca){logger[_0x9eb7('0xd')](_0x9eb7('0x11'),_0xb940ca[_0x9eb7('0xf')],_0x1bb1ae);_0x304f44(_0x57a19b['error'](0x1f4,_0xb940ca[_0x9eb7('0xf')]));});});};exports['UpdateChatQueueReport']=function(_0x3624f2){var _0x460cd1=this;return new Promise(function(_0x2e924e,_0x4aea1f){return db['ChatQueueReport'][_0x9eb7('0x19')](_0x3624f2[_0x9eb7('0x14')],{'raw':_0x3624f2['options']?_0x3624f2[_0x9eb7('0x15')][_0x9eb7('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3624f2[_0x9eb7('0x15')]?_0x3624f2[_0x9eb7('0x15')]['where']||null:null,'attributes':_0x3624f2['options']?_0x3624f2[_0x9eb7('0x15')][_0x9eb7('0x1a')]||null:null,'limit':_0x3624f2[_0x9eb7('0x15')]?_0x3624f2[_0x9eb7('0x15')]['limit']||null:null})['then'](function(_0x3275ba){logger[_0x9eb7('0x9')](_0x9eb7('0x1b'),_0x3624f2);logger[_0x9eb7('0x18')](_0x9eb7('0x1b'),_0x3624f2,JSON[_0x9eb7('0xc')](_0x3275ba));_0x2e924e(_0x3275ba);})[_0x9eb7('0x10')](function(_0x27a553){logger[_0x9eb7('0xd')](_0x9eb7('0x1b'),_0x27a553['message'],_0x3624f2);_0x4aea1f(_0x460cd1[_0x9eb7('0xd')](0x1f4,_0x27a553[_0x9eb7('0xf')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index ac145e3..addb32f 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 _0x56da=['delete','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x562bc8,_0x1b1c19){var _0x2a37d3=function(_0x180ba9){while(--_0x180ba9){_0x562bc8['push'](_0x562bc8['shift']());}};_0x2a37d3(++_0x1b1c19);}(_0x56da,0x1e1));var _0xa56d=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x56da[_0xe66cf2];return _0x2d84e7;};'use strict';var multer=require('multer');var util=require(_0xa56d('0x0'));var path=require('path');var timeout=require(_0xa56d('0x1'));var express=require(_0xa56d('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa56d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa56d('0x4'));var controller=require(_0xa56d('0x5'));router[_0xa56d('0x6')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0x8')]);router[_0xa56d('0x6')]('/describe',auth[_0xa56d('0x7')](),controller['describe']);router[_0xa56d('0x6')]('/:id',auth[_0xa56d('0x7')](),controller[_0xa56d('0x9')]);router[_0xa56d('0xa')]('/',auth[_0xa56d('0x7')](),controller[_0xa56d('0xb')]);router[_0xa56d('0xc')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller[_0xa56d('0xe')]);router[_0xa56d('0xf')](_0xa56d('0xd'),auth[_0xa56d('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8516=['destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x8516,0x131));var _0x6851=function(_0x21f843,_0x6e15b3){_0x21f843=_0x21f843-0x0;var _0x1ee7da=_0x8516[_0x21f843];return _0x1ee7da;};'use strict';var multer=require(_0x6851('0x0'));var util=require(_0x6851('0x1'));var path=require('path');var timeout=require(_0x6851('0x2'));var express=require('express');var router=express[_0x6851('0x3')]();var fs_extra=require(_0x6851('0x4'));var auth=require(_0x6851('0x5'));var interaction=require(_0x6851('0x6'));var config=require(_0x6851('0x7'));var controller=require(_0x6851('0x8'));router[_0x6851('0x9')]('/',auth[_0x6851('0xa')](),controller[_0x6851('0xb')]);router[_0x6851('0x9')]('/describe',auth[_0x6851('0xa')](),controller['describe']);router[_0x6851('0x9')](_0x6851('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6851('0xd')]('/',auth[_0x6851('0xa')](),controller['create']);router[_0x6851('0xe')]('/:id',auth[_0x6851('0xa')](),controller['update']);router['delete'](_0x6851('0xc'),auth[_0x6851('0xa')](),controller[_0x6851('0xf')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0fcd93d..769881a 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4918c6,_0x5cc45a){var _0x585f66=function(_0xfacd7f){while(--_0xfacd7f){_0x4918c6['push'](_0x4918c6['shift']());}};_0x585f66(++_0x5cc45a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0xf3cd[_0x434783];return _0x13efcf;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x4d73b1,_0x91ab71){var _0xe394f9=function(_0x47dd5d){while(--_0x47dd5d){_0x4d73b1['push'](_0x4d73b1['shift']());}};_0xe394f9(++_0x91ab71);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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 608bf99..169a816 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 _0x0a3b=['util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','update','then','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','includeAll','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3ae3fe,_0x2f1ea3){var _0xf25a7f=function(_0x51c3cc){while(--_0x51c3cc){_0x3ae3fe['push'](_0x3ae3fe['shift']());}};_0xf25a7f(++_0x2f1ea3);}(_0x0a3b,0xdc));var _0xb0a3=function(_0x43b06b,_0x1929c7){_0x43b06b=_0x43b06b-0x0;var _0x2c555b=_0x0a3b[_0x43b06b];return _0x2c555b;};'use strict';var emlformat=require(_0xb0a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0a3('0x1'));var jsonpatch=require(_0xb0a3('0x2'));var rp=require(_0xb0a3('0x3'));var moment=require(_0xb0a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb0a3('0x5'));var path=require('path');var sox=require(_0xb0a3('0x6'));var csv=require(_0xb0a3('0x7'));var ejs=require(_0xb0a3('0x8'));var fs=require('fs');var fs_extra=require(_0xb0a3('0x9'));var _=require(_0xb0a3('0xa'));var squel=require('squel');var crypto=require(_0xb0a3('0xb'));var jsforce=require(_0xb0a3('0xc'));var deskjs=require(_0xb0a3('0xd'));var toCsv=require(_0xb0a3('0x7'));var querystring=require(_0xb0a3('0xe'));var Papa=require(_0xb0a3('0xf'));var Redis=require(_0xb0a3('0x10'));var authService=require(_0xb0a3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb0a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb0a3('0x13'))(_0xb0a3('0x14'));var utils=require(_0xb0a3('0x15'));var config=require(_0xb0a3('0x16'));var licenseUtil=require(_0xb0a3('0x17'));var db=require(_0xb0a3('0x18'))['db'];function respondWithStatusCode(_0xd7d198,_0x35cbde){_0x35cbde=_0x35cbde||0xcc;return function(_0x537270){if(_0x537270){return _0xd7d198[_0xb0a3('0x19')](_0x35cbde);}return _0xd7d198['status'](_0x35cbde)[_0xb0a3('0x1a')]();};}function respondWithResult(_0x30b411,_0x1afb35){_0x1afb35=_0x1afb35||0xc8;return function(_0x5857df){if(_0x5857df){return _0x30b411[_0xb0a3('0x1b')](_0x1afb35)[_0xb0a3('0x1c')](_0x5857df);}};}function respondWithFilteredResult(_0x4280b9,_0x393752){return function(_0x3eb554){if(_0x3eb554){var _0x17f04f=typeof _0x393752[_0xb0a3('0x1d')]===_0xb0a3('0x1e')&&typeof _0x393752['limit']===_0xb0a3('0x1e');var _0x10d5de=_0x3eb554['count'];var _0x5d76ca=_0x17f04f?0x0:_0x393752['offset'];var _0x59d0ad=_0x17f04f?_0x3eb554[_0xb0a3('0x1f')]:_0x393752[_0xb0a3('0x1d')]+_0x393752['limit'];var _0x211c1d;if(_0x59d0ad>=_0x10d5de){_0x59d0ad=_0x10d5de;_0x211c1d=0xc8;}else{_0x211c1d=0xce;}_0x4280b9[_0xb0a3('0x1b')](_0x211c1d);return _0x4280b9[_0xb0a3('0x20')]('Content-Range',_0x5d76ca+'-'+_0x59d0ad+'/'+_0x10d5de)['json'](_0x3eb554);}return null;};}function patchUpdates(_0x5b1d72){return function(_0x3db119){try{jsonpatch[_0xb0a3('0x21')](_0x3db119,_0x5b1d72,!![]);}catch(_0x76acfc){return BPromise[_0xb0a3('0x22')](_0x76acfc);}return _0x3db119['save']();};}function saveUpdates(_0x399d33,_0x3403c4){return function(_0x40ca0f){if(_0x40ca0f){return _0x40ca0f[_0xb0a3('0x23')](_0x399d33)[_0xb0a3('0x24')](function(_0x522d49){return _0x522d49;});}return null;};}function removeEntity(_0x8c48d5,_0x26fbdf){return function(_0x56a1ba){if(_0x56a1ba){return _0x56a1ba[_0xb0a3('0x25')]()[_0xb0a3('0x24')](function(){_0x8c48d5['status'](0xcc)[_0xb0a3('0x1a')]();});}};}function handleEntityNotFound(_0xdd5a77,_0x5f47f6){return function(_0x209034){if(!_0x209034){_0xdd5a77[_0xb0a3('0x19')](0x194);}return _0x209034;};}function handleError(_0x1791cc,_0x4b08ab){_0x4b08ab=_0x4b08ab||0x1f4;return function(_0x2507aa){logger[_0xb0a3('0x26')](_0x2507aa['stack']);if(_0x2507aa[_0xb0a3('0x27')]){delete _0x2507aa[_0xb0a3('0x27')];}_0x1791cc['status'](_0x4b08ab)[_0xb0a3('0x28')](_0x2507aa);};}exports[_0xb0a3('0x29')]=function(_0x49a7d8,_0x3d2321){var _0x41fb72={},_0xc29a1b={},_0x4f17b1={'count':0x0,'rows':[]};var _0x967090=_[_0xb0a3('0x2a')](db[_0xb0a3('0x2b')][_0xb0a3('0x2c')],function(_0xd79238){return{'name':_0xd79238[_0xb0a3('0x2d')],'type':_0xd79238[_0xb0a3('0x2e')][_0xb0a3('0x2f')]};});_0xc29a1b[_0xb0a3('0x30')]=_[_0xb0a3('0x2a')](_0x967090,_0xb0a3('0x27'));_0xc29a1b['query']=_[_0xb0a3('0x31')](_0x49a7d8['query']);_0xc29a1b[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0xc29a1b[_0xb0a3('0x30')],_0xc29a1b[_0xb0a3('0x34')]);_0x41fb72['attributes']=_['intersection'](_0xc29a1b[_0xb0a3('0x30')],qs[_0xb0a3('0x35')](_0x49a7d8[_0xb0a3('0x34')]['fields']));_0x41fb72[_0xb0a3('0x36')]=_0x41fb72['attributes'][_0xb0a3('0x37')]?_0x41fb72['attributes']:_0xc29a1b['model'];if(!_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x38')](_0xb0a3('0x39'))){_0x41fb72[_0xb0a3('0x3a')]=qs[_0xb0a3('0x3a')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3a')]);_0x41fb72['offset']=qs[_0xb0a3('0x1d')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x1d')]);}_0x41fb72[_0xb0a3('0x3b')]=qs[_0xb0a3('0x3c')](_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3c')]);_0x41fb72[_0xb0a3('0x3d')]=qs['filters'](_['pick'](_0x49a7d8[_0xb0a3('0x34')],_0xc29a1b[_0xb0a3('0x32')]),_0x967090);if(_0x49a7d8[_0xb0a3('0x34')][_0xb0a3('0x3e')]){_0x41fb72[_0xb0a3('0x3d')]=_[_0xb0a3('0x3f')](_0x41fb72[_0xb0a3('0x3d')],{'$or':_[_0xb0a3('0x2a')](_0x967090,function(_0xaf9027){if(_0xaf9027[_0xb0a3('0x2e')]!==_0xb0a3('0x40')){var _0x36ecf9={};_0x36ecf9[_0xaf9027['name']]={'$like':'%'+_0x49a7d8[_0xb0a3('0x34')]['filter']+'%'};return _0x36ecf9;}})});}_0x41fb72=_['merge']({},_0x41fb72,_0x49a7d8['options']);var _0xc092c9={'where':_0x41fb72['where']};return db['ChatTransferReport'][_0xb0a3('0x1f')](_0xc092c9)[_0xb0a3('0x24')](function(_0x4aca30){_0x4f17b1[_0xb0a3('0x1f')]=_0x4aca30;if(_0x49a7d8['query']['includeAll']){_0x41fb72[_0xb0a3('0x41')]=[{'all':!![]}];}return db[_0xb0a3('0x2b')][_0xb0a3('0x42')](_0x41fb72);})[_0xb0a3('0x24')](function(_0xf98837){_0x4f17b1[_0xb0a3('0x43')]=_0xf98837;return _0x4f17b1;})[_0xb0a3('0x24')](respondWithFilteredResult(_0x3d2321,_0x41fb72))[_0xb0a3('0x44')](handleError(_0x3d2321,null));};exports['show']=function(_0x32e9d9,_0x88ae47){var _0xc5cd32={'raw':!![],'where':{'id':_0x32e9d9['params']['id']}},_0x5a1ed2={};_0x5a1ed2[_0xb0a3('0x30')]=_[_0xb0a3('0x31')](db[_0xb0a3('0x2b')]['rawAttributes']);_0x5a1ed2['query']=_[_0xb0a3('0x31')](_0x32e9d9[_0xb0a3('0x34')]);_0x5a1ed2[_0xb0a3('0x32')]=_[_0xb0a3('0x33')](_0x5a1ed2[_0xb0a3('0x30')],_0x5a1ed2[_0xb0a3('0x34')]);_0xc5cd32[_0xb0a3('0x36')]=_[_0xb0a3('0x33')](_0x5a1ed2['model'],qs[_0xb0a3('0x35')](_0x32e9d9[_0xb0a3('0x34')][_0xb0a3('0x35')]));_0xc5cd32[_0xb0a3('0x36')]=_0xc5cd32['attributes'][_0xb0a3('0x37')]?_0xc5cd32[_0xb0a3('0x36')]:_0x5a1ed2[_0xb0a3('0x30')];if(_0x32e9d9['query'][_0xb0a3('0x45')]){_0xc5cd32[_0xb0a3('0x41')]=[{'all':!![]}];}_0xc5cd32=_[_0xb0a3('0x3f')]({},_0xc5cd32,_0x32e9d9['options']);return db['ChatTransferReport'][_0xb0a3('0x46')](_0xc5cd32)['then'](handleEntityNotFound(_0x88ae47,null))['then'](respondWithResult(_0x88ae47,null))[_0xb0a3('0x44')](handleError(_0x88ae47,null));};exports[_0xb0a3('0x47')]=function(_0x47117e,_0x59d274){return db[_0xb0a3('0x2b')][_0xb0a3('0x47')](_0x47117e['body'],{})[_0xb0a3('0x24')](respondWithResult(_0x59d274,0xc9))[_0xb0a3('0x44')](handleError(_0x59d274,null));};exports[_0xb0a3('0x23')]=function(_0x260c7b,_0x57c294){if(_0x260c7b[_0xb0a3('0x48')]['id']){delete _0x260c7b['body']['id'];}return db[_0xb0a3('0x2b')][_0xb0a3('0x46')]({'where':{'id':_0x260c7b[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x57c294,null))[_0xb0a3('0x24')](saveUpdates(_0x260c7b[_0xb0a3('0x48')],null))[_0xb0a3('0x24')](respondWithResult(_0x57c294,null))[_0xb0a3('0x44')](handleError(_0x57c294,null));};exports[_0xb0a3('0x25')]=function(_0x3e3b85,_0x252da1){return db[_0xb0a3('0x2b')]['find']({'where':{'id':_0x3e3b85[_0xb0a3('0x49')]['id']}})[_0xb0a3('0x24')](handleEntityNotFound(_0x252da1,null))['then'](removeEntity(_0x252da1,null))['catch'](handleError(_0x252da1,null));};exports[_0xb0a3('0x4a')]=function(_0xa14bcb,_0x1037f6){return db[_0xb0a3('0x2b')][_0xb0a3('0x4a')]()[_0xb0a3('0x24')](respondWithResult(_0x1037f6,null))['catch'](handleError(_0x1037f6,null));};
\ No newline at end of file
+var _0x6fc9=['length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','update','then','destroy','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0xbb3ab4,_0x14a77d){var _0x3853f1=function(_0xbab961){while(--_0xbab961){_0xbb3ab4['push'](_0xbb3ab4['shift']());}};_0x3853f1(++_0x14a77d);}(_0x6fc9,0xf6));var _0x96fc=function(_0x422fac,_0x2e9a25){_0x422fac=_0x422fac-0x0;var _0x3fdf64=_0x6fc9[_0x422fac];return _0x3fdf64;};'use strict';var emlformat=require(_0x96fc('0x0'));var rimraf=require(_0x96fc('0x1'));var zipdir=require(_0x96fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96fc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96fc('0x4'));var util=require(_0x96fc('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x96fc('0x6'));var ejs=require(_0x96fc('0x7'));var fs=require('fs');var fs_extra=require(_0x96fc('0x8'));var _=require('lodash');var squel=require(_0x96fc('0x9'));var crypto=require(_0x96fc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x96fc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x96fc('0xc'));var Papa=require(_0x96fc('0xd'));var Redis=require('ioredis');var authService=require(_0x96fc('0xe'));var qs=require(_0x96fc('0xf'));var as=require(_0x96fc('0x10'));var hardwareService=require(_0x96fc('0x11'));var logger=require(_0x96fc('0x12'))('api');var utils=require(_0x96fc('0x13'));var config=require(_0x96fc('0x14'));var licenseUtil=require(_0x96fc('0x15'));var db=require(_0x96fc('0x16'))['db'];function respondWithStatusCode(_0x9d6a3c,_0x3164d5){_0x3164d5=_0x3164d5||0xcc;return function(_0x1ffa86){if(_0x1ffa86){return _0x9d6a3c[_0x96fc('0x17')](_0x3164d5);}return _0x9d6a3c[_0x96fc('0x18')](_0x3164d5)[_0x96fc('0x19')]();};}function respondWithResult(_0x39319e,_0x16b1ac){_0x16b1ac=_0x16b1ac||0xc8;return function(_0xeff20d){if(_0xeff20d){return _0x39319e['status'](_0x16b1ac)['json'](_0xeff20d);}};}function respondWithFilteredResult(_0x645fa0,_0x5edb47){return function(_0xbd38d5){if(_0xbd38d5){var _0x54ce40=typeof _0x5edb47['offset']===_0x96fc('0x1a')&&typeof _0x5edb47[_0x96fc('0x1b')]===_0x96fc('0x1a');var _0x3fba66=_0xbd38d5[_0x96fc('0x1c')];var _0x212273=_0x54ce40?0x0:_0x5edb47[_0x96fc('0x1d')];var _0x1e733f=_0x54ce40?_0xbd38d5[_0x96fc('0x1c')]:_0x5edb47[_0x96fc('0x1d')]+_0x5edb47[_0x96fc('0x1b')];var _0x2f78ac;if(_0x1e733f>=_0x3fba66){_0x1e733f=_0x3fba66;_0x2f78ac=0xc8;}else{_0x2f78ac=0xce;}_0x645fa0[_0x96fc('0x18')](_0x2f78ac);return _0x645fa0[_0x96fc('0x1e')]('Content-Range',_0x212273+'-'+_0x1e733f+'/'+_0x3fba66)[_0x96fc('0x1f')](_0xbd38d5);}return null;};}function patchUpdates(_0x5a25cf){return function(_0x47bcaa){try{jsonpatch[_0x96fc('0x20')](_0x47bcaa,_0x5a25cf,!![]);}catch(_0x22b9da){return BPromise[_0x96fc('0x21')](_0x22b9da);}return _0x47bcaa['save']();};}function saveUpdates(_0x196fbb,_0x5a56f7){return function(_0x170fc1){if(_0x170fc1){return _0x170fc1[_0x96fc('0x22')](_0x196fbb)[_0x96fc('0x23')](function(_0x40bac6){return _0x40bac6;});}return null;};}function removeEntity(_0x202537,_0x362b93){return function(_0x14e382){if(_0x14e382){return _0x14e382[_0x96fc('0x24')]()[_0x96fc('0x23')](function(){_0x202537[_0x96fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168a2a,_0x4265e3){return function(_0x1ff151){if(!_0x1ff151){_0x168a2a[_0x96fc('0x17')](0x194);}return _0x1ff151;};}function handleError(_0x363e9f,_0x45feed){_0x45feed=_0x45feed||0x1f4;return function(_0x4b37cb){logger['error'](_0x4b37cb['stack']);if(_0x4b37cb['name']){delete _0x4b37cb[_0x96fc('0x25')];}_0x363e9f[_0x96fc('0x18')](_0x45feed)[_0x96fc('0x26')](_0x4b37cb);};}exports['index']=function(_0x12c89f,_0x367fb3){var _0x42ef34={},_0x1ab3e1={},_0x2c8f83={'count':0x0,'rows':[]};var _0x3969f8=_[_0x96fc('0x27')](db[_0x96fc('0x28')][_0x96fc('0x29')],function(_0x5edc66){return{'name':_0x5edc66[_0x96fc('0x2a')],'type':_0x5edc66['type'][_0x96fc('0x2b')]};});_0x1ab3e1[_0x96fc('0x2c')]=_[_0x96fc('0x27')](_0x3969f8,_0x96fc('0x25'));_0x1ab3e1[_0x96fc('0x2d')]=_[_0x96fc('0x2e')](_0x12c89f['query']);_0x1ab3e1[_0x96fc('0x2f')]=_[_0x96fc('0x30')](_0x1ab3e1[_0x96fc('0x2c')],_0x1ab3e1[_0x96fc('0x2d')]);_0x42ef34['attributes']=_['intersection'](_0x1ab3e1[_0x96fc('0x2c')],qs[_0x96fc('0x31')](_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x31')]));_0x42ef34['attributes']=_0x42ef34['attributes'][_0x96fc('0x32')]?_0x42ef34[_0x96fc('0x33')]:_0x1ab3e1[_0x96fc('0x2c')];if(!_0x12c89f['query'][_0x96fc('0x34')](_0x96fc('0x35'))){_0x42ef34[_0x96fc('0x1b')]=qs[_0x96fc('0x1b')](_0x12c89f['query'][_0x96fc('0x1b')]);_0x42ef34[_0x96fc('0x1d')]=qs['offset'](_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x1d')]);}_0x42ef34[_0x96fc('0x36')]=qs[_0x96fc('0x37')](_0x12c89f[_0x96fc('0x2d')]['sort']);_0x42ef34[_0x96fc('0x38')]=qs[_0x96fc('0x2f')](_[_0x96fc('0x39')](_0x12c89f[_0x96fc('0x2d')],_0x1ab3e1[_0x96fc('0x2f')]),_0x3969f8);if(_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3a')]){_0x42ef34[_0x96fc('0x38')]=_[_0x96fc('0x3b')](_0x42ef34[_0x96fc('0x38')],{'$or':_[_0x96fc('0x27')](_0x3969f8,function(_0x510425){if(_0x510425[_0x96fc('0x3c')]!==_0x96fc('0x3d')){var _0x2520c5={};_0x2520c5[_0x510425[_0x96fc('0x25')]]={'$like':'%'+_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3a')]+'%'};return _0x2520c5;}})});}_0x42ef34=_['merge']({},_0x42ef34,_0x12c89f['options']);var _0x5be071={'where':_0x42ef34['where']};return db[_0x96fc('0x28')]['count'](_0x5be071)[_0x96fc('0x23')](function(_0x273dc3){_0x2c8f83[_0x96fc('0x1c')]=_0x273dc3;if(_0x12c89f[_0x96fc('0x2d')][_0x96fc('0x3e')]){_0x42ef34[_0x96fc('0x3f')]=[{'all':!![]}];}return db[_0x96fc('0x28')][_0x96fc('0x40')](_0x42ef34);})['then'](function(_0x33caaa){_0x2c8f83[_0x96fc('0x41')]=_0x33caaa;return _0x2c8f83;})[_0x96fc('0x23')](respondWithFilteredResult(_0x367fb3,_0x42ef34))[_0x96fc('0x42')](handleError(_0x367fb3,null));};exports[_0x96fc('0x43')]=function(_0x179418,_0x5826de){var _0x54a324={'raw':!![],'where':{'id':_0x179418[_0x96fc('0x44')]['id']}},_0x243101={};_0x243101[_0x96fc('0x2c')]=_[_0x96fc('0x2e')](db[_0x96fc('0x28')]['rawAttributes']);_0x243101['query']=_['keys'](_0x179418[_0x96fc('0x2d')]);_0x243101[_0x96fc('0x2f')]=_[_0x96fc('0x30')](_0x243101[_0x96fc('0x2c')],_0x243101[_0x96fc('0x2d')]);_0x54a324[_0x96fc('0x33')]=_[_0x96fc('0x30')](_0x243101[_0x96fc('0x2c')],qs['fields'](_0x179418['query'][_0x96fc('0x31')]));_0x54a324['attributes']=_0x54a324[_0x96fc('0x33')][_0x96fc('0x32')]?_0x54a324[_0x96fc('0x33')]:_0x243101[_0x96fc('0x2c')];if(_0x179418[_0x96fc('0x2d')][_0x96fc('0x3e')]){_0x54a324[_0x96fc('0x3f')]=[{'all':!![]}];}_0x54a324=_['merge']({},_0x54a324,_0x179418[_0x96fc('0x45')]);return db[_0x96fc('0x28')][_0x96fc('0x46')](_0x54a324)[_0x96fc('0x23')](handleEntityNotFound(_0x5826de,null))['then'](respondWithResult(_0x5826de,null))[_0x96fc('0x42')](handleError(_0x5826de,null));};exports[_0x96fc('0x47')]=function(_0x345bd3,_0x1d95c8){return db[_0x96fc('0x28')][_0x96fc('0x47')](_0x345bd3[_0x96fc('0x48')],{})[_0x96fc('0x23')](respondWithResult(_0x1d95c8,0xc9))[_0x96fc('0x42')](handleError(_0x1d95c8,null));};exports[_0x96fc('0x22')]=function(_0x42e41e,_0x19a921){if(_0x42e41e['body']['id']){delete _0x42e41e[_0x96fc('0x48')]['id'];}return db[_0x96fc('0x28')][_0x96fc('0x46')]({'where':{'id':_0x42e41e['params']['id']}})['then'](handleEntityNotFound(_0x19a921,null))['then'](saveUpdates(_0x42e41e[_0x96fc('0x48')],null))[_0x96fc('0x23')](respondWithResult(_0x19a921,null))[_0x96fc('0x42')](handleError(_0x19a921,null));};exports['destroy']=function(_0x4f8730,_0x34bb95){return db['ChatTransferReport'][_0x96fc('0x46')]({'where':{'id':_0x4f8730[_0x96fc('0x44')]['id']}})[_0x96fc('0x23')](handleEntityNotFound(_0x34bb95,null))[_0x96fc('0x23')](removeEntity(_0x34bb95,null))['catch'](handleError(_0x34bb95,null));};exports[_0x96fc('0x49')]=function(_0xe58152,_0xe803ae){return db[_0x96fc('0x28')][_0x96fc('0x49')]()[_0x96fc('0x23')](respondWithResult(_0xe803ae,null))['catch'](handleError(_0xe803ae,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index fbf3360..761ab56 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 _0x0a6a=['report_chat_transfer','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0xf7b425,_0x4e8416){var _0x2a16ba=function(_0x3a600b){while(--_0x3a600b){_0xf7b425['push'](_0xf7b425['shift']());}};_0x2a16ba(++_0x4e8416);}(_0x0a6a,0x6f));var _0xa0a6=function(_0x4ba105,_0xf97073){_0x4ba105=_0x4ba105-0x0;var _0x5eee7b=_0x0a6a[_0x4ba105];return _0x5eee7b;};'use strict';var _=require(_0xa0a6('0x0'));var util=require('util');var logger=require(_0xa0a6('0x1'))('api');var moment=require(_0xa0a6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0a6('0x3'));var rimraf=require(_0xa0a6('0x4'));var config=require(_0xa0a6('0x5'));var attributes=require(_0xa0a6('0x6'));module[_0xa0a6('0x7')]=function(_0x5dfde9,_0x57e1d0){return _0x5dfde9[_0xa0a6('0x8')](_0xa0a6('0x9'),attributes,{'tableName':_0xa0a6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa538=['moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','../../config/logger','api'];(function(_0x3509b9,_0x38bb75){var _0x11704f=function(_0x37a435){while(--_0x37a435){_0x3509b9['push'](_0x3509b9['shift']());}};_0x11704f(++_0x38bb75);}(_0xa538,0xb2));var _0x8a53=function(_0x31c1d9,_0xf3b483){_0x31c1d9=_0x31c1d9-0x0;var _0x2ccc8d=_0xa538[_0x31c1d9];return _0x2ccc8d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8a53('0x0'))(_0x8a53('0x1'));var moment=require(_0x8a53('0x2'));var BPromise=require(_0x8a53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a53('0x4'));var rimraf=require('rimraf');var config=require(_0x8a53('0x5'));var attributes=require(_0x8a53('0x6'));module[_0x8a53('0x7')]=function(_0x20a7f3,_0x2db190){return _0x20a7f3[_0x8a53('0x8')](_0x8a53('0x9'),attributes,{'tableName':_0x8a53('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8a53('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 2527155..0751149 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 _0x2afd=['then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2afd,0xbc));var _0xd2af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2afd[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xd2af('0x0'));var moment=require(_0xd2af('0x1'));var BPromise=require(_0xd2af('0x2'));var rs=require(_0xd2af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd2af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2af('0x5'))(_0xd2af('0x6'));var config=require(_0xd2af('0x7'));var jayson=require(_0xd2af('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a2dd3,_0x4102e6,_0x3cae3b){return new BPromise(function(_0x5295a2,_0x17fe9e){return client[_0xd2af('0x9')](_0x4a2dd3,_0x3cae3b)[_0xd2af('0xa')](function(_0x54dbad){logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,'request\x20sent');logger[_0xd2af('0xd')](_0xd2af('0xe'),_0x4102e6,_0xd2af('0xf'),JSON[_0xd2af('0x10')](_0x54dbad));if(_0x54dbad[_0xd2af('0x11')]){if(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x12')]===0x1f4){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x17fe9e(_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);}logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x54dbad[_0xd2af('0x11')][_0xd2af('0x13')]);return _0x5295a2(_0x54dbad['error'][_0xd2af('0x13')]);}else{logger[_0xd2af('0xb')](_0xd2af('0xc'),_0x4102e6,_0xd2af('0xf'));_0x5295a2(_0x54dbad[_0xd2af('0x14')][_0xd2af('0x13')]);}})[_0xd2af('0x15')](function(_0x1024c9){logger[_0xd2af('0x11')](_0xd2af('0xc'),_0x4102e6,_0x1024c9);_0x17fe9e(_0x1024c9);});});}
\ No newline at end of file
+var _0x9c44=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c44,0xf1));var _0x49c4=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x9c44[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x49c4('0x0'));var util=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rs=require(_0x49c4('0x4'));var fs=require('fs');var Redis=require(_0x49c4('0x5'));var db=require(_0x49c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c4('0x7'))('rpc');var config=require(_0x49c4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x9')][_0x49c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bbcb7,_0x2ca38b,_0x4a48dd){return new BPromise(function(_0x26dba2,_0x2b5f93){return client[_0x49c4('0xb')](_0x1bbcb7,_0x4a48dd)[_0x49c4('0xc')](function(_0x227492){logger[_0x49c4('0xd')](_0x49c4('0xe'),_0x2ca38b,_0x49c4('0xf'));logger[_0x49c4('0x10')](_0x49c4('0x11'),_0x2ca38b,'request\x20sent',JSON['stringify'](_0x227492));if(_0x227492[_0x49c4('0x12')]){if(_0x227492[_0x49c4('0x12')][_0x49c4('0x13')]===0x1f4){logger['error'](_0x49c4('0xe'),_0x2ca38b,_0x227492[_0x49c4('0x12')][_0x49c4('0x14')]);return _0x2b5f93(_0x227492[_0x49c4('0x12')]['message']);}logger[_0x49c4('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x2ca38b,_0x227492['error'][_0x49c4('0x14')]);return _0x26dba2(_0x227492[_0x49c4('0x12')]['message']);}else{logger[_0x49c4('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x2ca38b,_0x49c4('0xf'));_0x26dba2(_0x227492[_0x49c4('0x15')][_0x49c4('0x14')]);}})['catch'](function(_0x3dac25){logger[_0x49c4('0x12')](_0x49c4('0xe'),_0x2ca38b,_0x3dac25);_0x2b5f93(_0x3dac25);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 12ab079..ea1851e 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 _0x3987=['index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x3840a0,_0x1c2617){var _0x441d3f=function(_0x5ec5d3){while(--_0x5ec5d3){_0x3840a0['push'](_0x3840a0['shift']());}};_0x441d3f(++_0x1c2617);}(_0x3987,0xb3));var _0x7398=function(_0x486a06,_0x46d2dd){_0x486a06=_0x486a06-0x0;var _0x88198c=_0x3987[_0x486a06];return _0x88198c;};'use strict';var multer=require(_0x7398('0x0'));var util=require(_0x7398('0x1'));var path=require(_0x7398('0x2'));var timeout=require(_0x7398('0x3'));var express=require(_0x7398('0x4'));var router=express[_0x7398('0x5')]();var fs_extra=require(_0x7398('0x6'));var auth=require(_0x7398('0x7'));var interaction=require(_0x7398('0x8'));var config=require(_0x7398('0x9'));var controller=require(_0x7398('0xa'));router[_0x7398('0xb')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0xd')]);router[_0x7398('0xb')]('/describe',auth[_0x7398('0xc')](),controller[_0x7398('0xe')]);router[_0x7398('0xb')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x10')]);router[_0x7398('0x11')]('/',auth[_0x7398('0xc')](),controller[_0x7398('0x12')]);router[_0x7398('0x13')](_0x7398('0xf'),auth['isAuthenticated'](),controller[_0x7398('0x14')]);router[_0x7398('0x15')](_0x7398('0xf'),auth[_0x7398('0xc')](),controller[_0x7398('0x16')]);module[_0x7398('0x17')]=router;
\ No newline at end of file
+var _0xbd7b=['/describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index'];(function(_0x142733,_0x19bf15){var _0xd17009=function(_0x1db652){while(--_0x1db652){_0x142733['push'](_0x142733['shift']());}};_0xd17009(++_0x19bf15);}(_0xbd7b,0x10c));var _0xbbd7=function(_0x5303a2,_0x49716b){_0x5303a2=_0x5303a2-0x0;var _0x448ac5=_0xbd7b[_0x5303a2];return _0x448ac5;};'use strict';var multer=require(_0xbbd7('0x0'));var util=require('util');var path=require(_0xbbd7('0x1'));var timeout=require(_0xbbd7('0x2'));var express=require(_0xbbd7('0x3'));var router=express[_0xbbd7('0x4')]();var fs_extra=require(_0xbbd7('0x5'));var auth=require(_0xbbd7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbbd7('0x7'));var controller=require(_0xbbd7('0x8'));router[_0xbbd7('0x9')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xb')]);router[_0xbbd7('0x9')](_0xbbd7('0xc'),auth[_0xbbd7('0xa')](),controller['describe']);router[_0xbbd7('0x9')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller['show']);router[_0xbbd7('0xe')]('/',auth[_0xbbd7('0xa')](),controller[_0xbbd7('0xf')]);router[_0xbbd7('0x10')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller['update']);router[_0xbbd7('0x11')](_0xbbd7('0xd'),auth[_0xbbd7('0xa')](),controller[_0xbbd7('0x12')]);module[_0xbbd7('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index dea571f..97fc5e1 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 _0xa8d3=['squared','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','text','getDataValue','parse','onlineForm','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','Skip','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xa8d3,0x15b));var _0x3a8d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa8d3[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x3a8d('0x0'));var rs=require(_0x3a8d('0x1'));module[_0x3a8d('0x2')]={'name':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'unique':_0x3a8d('0x4')},'description':{'type':Sequelize[_0x3a8d('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x5')},'mapKeyOffline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x5')},'key':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x3a8d('0x3')]},'animation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0xc'),_0x3a8d('0xd')),'defaultValue':_0x3a8d('0xc')},'header_online':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0xe')},'download_transcript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3a8d('0x10')]},'closingQuestion':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x13')},'closingMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x3a8d('0xb')](_0x3a8d('0x14'),_0x3a8d('0x15')),'defaultValue':_0x3a8d('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'variable':null,'config':{'placeholder':_0x3a8d('0x18'),'type':_0x3a8d('0x19'),'required':!![]},'props':{'title':_0x3a8d('0x18'),'helpText':''}},{'type':_0x3a8d('0x17'),'props':{'title':_0x3a8d('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3a8d('0x1a')]('onlineForm')?JSON[_0x3a8d('0x1b')](this['getDataValue'](_0x3a8d('0x1c'))):{};},'set':function(_0xaf5085){return this[_0x3a8d('0x1d')](_0x3a8d('0x1c'),JSON[_0x3a8d('0x16')](_0xaf5085));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x3a8d('0x16')]({'items':[{'type':_0x3a8d('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x3a8d('0x5'),'type':_0x3a8d('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x3a8d('0x1e')},'props':{'title':_0x3a8d('0x1e'),'helpText':_0x3a8d('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x3a8d('0x1a')](_0x3a8d('0x20'))?JSON['parse'](this[_0x3a8d('0x1a')](_0x3a8d('0x20'))):{};},'set':function(_0x474cbe){return this['setDataValue']('offlineForm',JSON['stringify'](_0x474cbe));}},'token':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3a8d('0x3')]},'waitingTitle':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x21')},'waitingMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x22')},'offlineMessageBody':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x23')},'sendUnmanaged':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':_0x3a8d('0x24')},'enableCustomerAttachment':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3a8d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':function(){return _0x3a8d('0x25');}},'notificationSound':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x26')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x27')},'defaultTitle':{'type':Sequelize[_0x3a8d('0x3')]},'customerAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3a8d('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':_0x3a8d('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a8d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3a8d('0x29')},'systemAvatar':{'type':Sequelize[_0x3a8d('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a8d('0x9')],'comment':_0x3a8d('0x2a')},'mandatoryDisposition':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'comment':_0x3a8d('0x2b'),'set':function(_0xd6615d){if(!_0xd6615d)this[_0x3a8d('0x1d')](_0x3a8d('0x2c'),null);this[_0x3a8d('0x1d')]('mandatoryDisposition',_0xd6615d);}},'vidaooEscalation':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3a8d('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3a8d('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x3a8d('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x3a8d('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3a8d('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3a8d('0x10')]}};
\ No newline at end of file
+var _0x5542=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20submission\x20error','Type\x20a\x20message','Skip','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate'];(function(_0x417955,_0x4ed8c8){var _0x3a94ef=function(_0xa3a38d){while(--_0xa3a38d){_0x417955['push'](_0x417955['shift']());}};_0x3a94ef(++_0x4ed8c8);}(_0x5542,0xcf));var _0x2554=function(_0x2a557a,_0x585b4a){_0x2a557a=_0x2a557a-0x0;var _0x439f83=_0x5542[_0x2a557a];return _0x439f83;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2554('0x0'));module[_0x2554('0x1')]={'name':{'type':Sequelize[_0x2554('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'unique':_0x2554('0x3')},'description':{'type':Sequelize[_0x2554('0x2')]},'mapKey':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x4')},'mapKeyOffline':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x4')},'key':{'type':Sequelize[_0x2554('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0x5')},'customerAlias':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2554('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2554('0x2')]},'animation':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2554('0xa')](_0x2554('0xb'),_0x2554('0xc')),'defaultValue':_0x2554('0xb')},'header_online':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xd')},'offline_chat_button':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xe')},'header_offline':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2554('0x10')]},'closingQuestion':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x11')},'noteTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x13')},'conditionAgreement':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x2554('0xa')](_0x2554('0x14'),'thumb'),'defaultValue':_0x2554('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2554('0x10')],'defaultValue':function(){return JSON[_0x2554('0x15')]({'items':[{'type':_0x2554('0x16'),'variable':null,'config':{'placeholder':_0x2554('0x17'),'type':'text','required':!![]},'props':{'title':_0x2554('0x17'),'helpText':''}},{'type':'input','props':{'title':_0x2554('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x2554('0x4'),'type':_0x2554('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2554('0x18')](_0x2554('0x19'))?JSON[_0x2554('0x1a')](this[_0x2554('0x18')](_0x2554('0x19'))):{};},'set':function(_0x4d650b){return this[_0x2554('0x1b')](_0x2554('0x19'),JSON['stringify'](_0x4d650b));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x2554('0x15')]({'items':[{'type':_0x2554('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x2554('0x4'),'type':_0x2554('0x4')},'variable':null},{'type':_0x2554('0x1c'),'config':{'placeholder':_0x2554('0x1d')},'props':{'title':'Comments','helpText':_0x2554('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x2554('0x18')](_0x2554('0x1f'))?JSON[_0x2554('0x1a')](this[_0x2554('0x18')]('offlineForm')):{};},'set':function(_0xa98fb1){return this[_0x2554('0x1b')](_0x2554('0x1f'),JSON[_0x2554('0x15')](_0xa98fb1));}},'token':{'type':Sequelize[_0x2554('0x2')],'defaultValue':function(){return rs[_0x2554('0x20')]();}},'autoclose':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2554('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2554('0x2')]},'waitingTitle':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2554('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x23')},'offlineMessageBody':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2554('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2554('0x10')],'defaultValue':function(){return _0x2554('0x26');}},'notificationSound':{'type':Sequelize[_0x2554('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2554('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x27')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x28')},'messagesAlignment':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x29')},'defaultTitle':{'type':Sequelize[_0x2554('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2554('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2554('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2554('0x2')],'defaultValue':_0x2554('0x2b')},'systemAvatar':{'type':Sequelize[_0x2554('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2554('0x8')],'comment':_0x2554('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2554('0x2d'),'set':function(_0x181292){if(!_0x181292)this[_0x2554('0x1b')]('mandatoryDispositionPauseId',null);this[_0x2554('0x1b')]('mandatoryDisposition',_0x181292);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2554('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2554('0x2')],'allowNull':![],'defaultValue':_0x2554('0x2e')},'vidaooNote':{'type':Sequelize[_0x2554('0x2')],'defaultValue':function(){return _0x2554('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x2554('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2554('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2554('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index c450796..d66a8a1 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 _0x9944=['notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','License','increment','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','URL','address','origin','3.5.0','x-real-ip','connection','virtual','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','stack','finally','getApplications','ChatProactiveAction','getFields','offlineForm','onlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','mustache','path','ejs','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','ChatWebsites','UserProfileResource','name','Command','getSnippet','timezone','format','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','all','some','user-agent-parser','setUA','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','fieldName','key','query','keys','filters','intersection','fields','attributes','length','order','sort','where','filter','merge','ChatWebsite','includeAll','include','findAll','rows','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','ChatWebsiteId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','pick','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','CmContact','Contacts','Applications','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','headers','threadId','ChatInteraction','externalUrl','interaction','contact','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','EventManager','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount'];(function(_0x32b9c5,_0x1c165d){var _0x589f31=function(_0x2e2ddf){while(--_0x2e2ddf){_0x32b9c5['push'](_0x32b9c5['shift']());}};_0x589f31(++_0x1c165d);}(_0x9944,0x16e));var _0x4994=function(_0xae32a4,_0x4d8d00){_0xae32a4=_0xae32a4-0x0;var _0x43d4f7=_0x9944[_0xae32a4];return _0x43d4f7;};'use strict';var Mustache=require(_0x4994('0x0'));var util=require('util');var path=require(_0x4994('0x1'));var ejs=require(_0x4994('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4994('0x3'));var querystring=require(_0x4994('0x4'));var htmlToText=require(_0x4994('0x5'));var Redis=require('ioredis');var jayson=require(_0x4994('0x6'));var url=require(_0x4994('0x7'));var qs=require(_0x4994('0x8'));var logger=require(_0x4994('0x9'))(_0x4994('0xa'));var config=require(_0x4994('0xb'));var APIOutOfIntervalError=require('../../errors/api')['APIOutOfIntervalError'];var APINotFoundError=require(_0x4994('0xc'))['APINotFoundError'];var APIHandleError=require('../../errors/api')[_0x4994('0xd')];var db=require(_0x4994('0xe'))['db'];config[_0x4994('0xf')]=_[_0x4994('0x10')](config[_0x4994('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x4994('0x11'))(new Redis(config[_0x4994('0xf')]));require(_0x4994('0x12'))[_0x4994('0x13')](socket);var client=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232c});var client9002=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232a});var client9003=jayson[_0x4994('0x14')][_0x4994('0x15')]({'port':0x232b});var client9001=jayson[_0x4994('0x14')]['http']({'port':0x2329});function respondWithRpcPromise(_0x26b9fe,_0x5ea1ec,_0x4ad064,_0x1436e1){return new Promise(function(_0x4ae812,_0x36724e){var _0x16e75b=_0x1436e1||client;return _0x16e75b[_0x4994('0x16')](_0x26b9fe,_0x4ad064)[_0x4994('0x17')](function(_0x211cb0){logger[_0x4994('0x18')](_0x4994('0x19'),_0x5ea1ec,_0x4994('0x1a'));logger[_0x4994('0x1b')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'),JSON[_0x4994('0x1c')](_0x211cb0));if(_0x211cb0[_0x4994('0x1d')]){if(_0x211cb0['error']['code']===0x1f4){logger['error'](_0x4994('0x19'),_0x5ea1ec,_0x211cb0['error'][_0x4994('0x1e')]);return _0x36724e(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);return _0x4ae812(_0x211cb0[_0x4994('0x1d')][_0x4994('0x1e')]);}else{logger[_0x4994('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x5ea1ec,_0x4994('0x1a'));_0x4ae812(_0x211cb0[_0x4994('0x1f')][_0x4994('0x1e')]);}})[_0x4994('0x20')](function(_0x6f2734){logger[_0x4994('0x1d')](_0x4994('0x19'),_0x5ea1ec,_0x6f2734);_0x36724e(_0x6f2734);});});}function respondWithStatusCode(_0x5d872c,_0x336b14){_0x336b14=_0x336b14||0xcc;return function(_0x31d249){if(_0x31d249){return _0x5d872c[_0x4994('0x21')](_0x336b14);}return _0x5d872c[_0x4994('0x22')](_0x336b14)[_0x4994('0x23')]();};}function respondWithResult(_0x521c10,_0xf0890){_0xf0890=_0xf0890||0xc8;return function(_0x250472){if(_0x250472){return _0x521c10[_0x4994('0x22')](_0xf0890)['json'](_0x250472);}};}function respondWithFilteredResult(_0x158fe8,_0x2ae073){return function(_0x1cd7c3){if(_0x1cd7c3){var _0x1b3826=typeof _0x2ae073[_0x4994('0x24')]===_0x4994('0x25')&&typeof _0x2ae073[_0x4994('0x26')]===_0x4994('0x25');var _0x279aab=_0x1cd7c3[_0x4994('0x27')];var _0x5d0492=_0x1b3826?0x0:_0x2ae073[_0x4994('0x24')];var _0x22b525=_0x1b3826?_0x1cd7c3[_0x4994('0x27')]:_0x2ae073[_0x4994('0x24')]+_0x2ae073[_0x4994('0x26')];var _0x5c8195;if(_0x22b525>=_0x279aab){_0x22b525=_0x279aab;_0x5c8195=0xc8;}else{_0x5c8195=0xce;}_0x158fe8['status'](_0x5c8195);return _0x158fe8[_0x4994('0x28')](_0x4994('0x29'),_0x5d0492+'-'+_0x22b525+'/'+_0x279aab)[_0x4994('0x2a')](_0x1cd7c3);}return null;};}function saveUpdates(_0x408a03){return function(_0x252ac8){if(_0x252ac8){return _0x252ac8[_0x4994('0x2b')](_0x408a03)['then'](function(_0x5d4f80){return _0x5d4f80;});}return null;};}function removeEntity(_0x1ec75a){return function(_0x30a7eb){if(_0x30a7eb){return _0x30a7eb[_0x4994('0x2c')]()[_0x4994('0x17')](function(){var _0x1ac13a=_0x30a7eb[_0x4994('0x2d')]({'plain':!![]});var _0x1e90ea=_0x4994('0x2e');return db[_0x4994('0x2f')]['destroy']({'where':{'type':_0x1e90ea,'resourceId':_0x1ac13a['id']}})[_0x4994('0x17')](function(){return _0x30a7eb;});})[_0x4994('0x17')](function(){_0x1ec75a[_0x4994('0x22')](0xcc)[_0x4994('0x23')]();});}};}function handleEntityNotFound(_0x513cd3){return function(_0x2b40a6){if(!_0x2b40a6){_0x513cd3['sendStatus'](0x194);}return _0x2b40a6;};}function handleError(_0x3431d2,_0x918041){_0x918041=_0x918041||0x1f4;return function(_0x357543){logger[_0x4994('0x1d')](_0x357543['stack']);if(_0x357543[_0x4994('0x30')]){delete _0x357543[_0x4994('0x30')];}_0x3431d2[_0x4994('0x22')](_0x918041)['send'](_0x357543);};}function iftimePromise(_0x59f43d,_0x478e6b){return respondWithRpcPromise(_0x4994('0x31'),_0x4994('0x32'),{'command':_0x478e6b[_0x4994('0x33')]?util[_0x4994('0x34')]('iftime\x20%s,%s',_0x59f43d['interval'],_0x478e6b[_0x4994('0x33')]):util[_0x4994('0x34')](_0x4994('0x35'),_0x59f43d['interval'])},client9002)[_0x4994('0x17')](function(_0x507f7b){var _0x198b64=_0x507f7b&&_0x507f7b[_0x4994('0x36')]('true')>=0x0?!![]:![];logger[_0x4994('0x18')](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],_0x198b64?_0x4994('0x39'):_0x4994('0x3a'),_0x478e6b[_0x4994('0x33')]?_0x478e6b[_0x4994('0x33')]:_0x4994('0x3b'));return _0x198b64;})[_0x4994('0x20')](function(_0x1ccad7){logger['error'](_0x4994('0x37'),_0x478e6b['id'],_0x59f43d['id'],_0x59f43d[_0x4994('0x38')],util[_0x4994('0x3c')](_0x1ccad7,{'showHidden':![],'depth':null}),_0x478e6b['timezone']?_0x478e6b['timezone']:_0x4994('0x3b'));return![];});}function checkWebsiteIntervals(_0x5182b0){var _0x52f334=_[_0x4994('0x3d')](_0x5182b0[_0x4994('0x3e')]['Intervals'],function(_0x1e8a2d){var _0x1bb36a=_0x1e8a2d[_0x4994('0x2d')]({'plain':!![]});return iftimePromise(_0x1bb36a,_0x5182b0);});return Promise[_0x4994('0x3f')](_0x52f334)[_0x4994('0x17')](function(_0x222d61){return _[_0x4994('0x40')](_0x222d61);});}function createInteractionObject(_0x11766c,_0x342876,_0x40ac64,_0x154a53){var _0x215dff=require(_0x4994('0x41'));var _0x1ae37d=new _0x215dff();var _0x298932=_0x1ae37d[_0x4994('0x42')](_0x40ac64['user-agent'])[_0x4994('0x43')]();var _0x24e263=_0x342876[_0x4994('0x44')];if(_0x40ac64[_0x4994('0x45')]){_0x24e263=_0x40ac64[_0x4994('0x45')];}else if(_0x40ac64[_0x4994('0x46')]){_0x24e263=_[_0x4994('0x47')](_0x40ac64[_0x4994('0x46')][_0x4994('0x48')](','));}return{'ContactId':_0x154a53['id'],'ChatWebsiteId':_0x11766c,'from':(_0x154a53[_0x4994('0x49')]||'')+'\x20'+(_0x154a53['lastName']||''),'customerIp':_0x24e263,'customerPort':_0x40ac64[_0x4994('0x4a')]?_0x40ac64['x-real-port']:null,'referer':_0x342876[_0x4994('0x4b')],'browserName':_0x298932['browser'][_0x4994('0x30')]&&_0x298932[_0x4994('0x4c')][_0x4994('0x4d')]?util['format'](_0x4994('0x4e'),_0x298932['browser']['name'],_0x298932['browser'][_0x4994('0x4d')]):_0x4994('0x4f'),'browserVersion':_0x298932['browser']['version']||_0x4994('0x4f'),'osName':util[_0x4994('0x34')](_0x4994('0x4e'),_0x298932['os'][_0x4994('0x30')],_0x298932['os']['version']),'osVersion':_0x298932['os'][_0x4994('0x4d')],'deviceModel':_0x298932[_0x4994('0x50')][_0x4994('0x51')]&&_0x298932['device'][_0x4994('0x52')]?util[_0x4994('0x34')](_0x4994('0x53'),_0x298932['device'][_0x4994('0x51')],_0x298932[_0x4994('0x50')][_0x4994('0x52')],_0x298932[_0x4994('0x50')][_0x4994('0x54')]):null,'deviceVendor':_0x298932[_0x4994('0x50')][_0x4994('0x52')],'deviceType':_0x298932['device'][_0x4994('0x54')],'formData':JSON[_0x4994('0x1c')](_0x342876)};}exports[_0x4994('0x55')]=function(_0x3da4f4,_0x7cd695){var _0x23d2f0={'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x39193d={},_0x2db1b2={'count':0x0,'rows':[]};var _0x115d7d=_[_0x4994('0x3d')](db['ChatWebsite']['rawAttributes'],function(_0x54cfe3){return{'name':_0x54cfe3[_0x4994('0x58')],'type':_0x54cfe3['type'][_0x4994('0x59')]};});_0x39193d[_0x4994('0x51')]=_['map'](_0x115d7d,'name');_0x39193d[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3da4f4['query']);_0x39193d[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x39193d[_0x4994('0x51')],_0x39193d['query']);_0x23d2f0['attributes']=_['intersection'](_0x39193d['model'],qs[_0x4994('0x5e')](_0x3da4f4['query'][_0x4994('0x5e')]));_0x23d2f0[_0x4994('0x5f')]=_0x23d2f0[_0x4994('0x5f')][_0x4994('0x60')]?_0x23d2f0[_0x4994('0x5f')]:_0x39193d['model'];if(!_0x3da4f4[_0x4994('0x5a')]['hasOwnProperty']('nolimit')){_0x23d2f0[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3da4f4['query'][_0x4994('0x26')]);_0x23d2f0[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3da4f4[_0x4994('0x5a')][_0x4994('0x24')]);}_0x23d2f0[_0x4994('0x61')]=qs['sort'](_0x3da4f4['query'][_0x4994('0x62')]);_0x23d2f0[_0x4994('0x63')]=qs['filters'](_['pick'](_0x3da4f4['query'],_0x39193d[_0x4994('0x5c')]),_0x115d7d);if(_0x3da4f4['query'][_0x4994('0x64')]){_0x23d2f0[_0x4994('0x63')]=_[_0x4994('0x65')](_0x23d2f0['where'],{'$or':_[_0x4994('0x3d')](_0x115d7d,function(_0x3d18e1){if(_0x3d18e1['type']!=='VIRTUAL'){var _0xb5845d={};_0xb5845d[_0x3d18e1[_0x4994('0x30')]]={'$like':'%'+_0x3da4f4[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0xb5845d;}})});}_0x23d2f0=_[_0x4994('0x65')]({},_0x23d2f0,_0x3da4f4['options']);var _0x4ebba7={'where':_0x23d2f0['where']};return db[_0x4994('0x66')][_0x4994('0x27')](_0x4ebba7)[_0x4994('0x17')](function(_0x20e102){_0x2db1b2[_0x4994('0x27')]=_0x20e102;if(_0x3da4f4['query'][_0x4994('0x67')]){_0x23d2f0[_0x4994('0x68')]=[{'all':!![]}];}return db['ChatWebsite'][_0x4994('0x69')](_0x23d2f0);})['then'](function(_0x191699){_0x2db1b2[_0x4994('0x6a')]=_0x191699;return _0x2db1b2;})[_0x4994('0x17')](respondWithFilteredResult(_0x7cd695,_0x23d2f0))['catch'](handleError(_0x7cd695,null));};exports['show']=function(_0x52d8e4,_0x3105db){var _0x59c7a4={'raw':![],'where':{'id':_0x52d8e4[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]},_0x2361e5={};_0x2361e5[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x66')][_0x4994('0x6c')]);_0x2361e5[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x52d8e4[_0x4994('0x5a')]);_0x2361e5[_0x4994('0x5c')]=_['intersection'](_0x2361e5['model'],_0x2361e5[_0x4994('0x5a')]);_0x59c7a4[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2361e5[_0x4994('0x51')],qs['fields'](_0x52d8e4[_0x4994('0x5a')][_0x4994('0x5e')]));_0x59c7a4[_0x4994('0x5f')]=_0x59c7a4[_0x4994('0x5f')][_0x4994('0x60')]?_0x59c7a4[_0x4994('0x5f')]:_0x2361e5[_0x4994('0x51')];if(_0x52d8e4['query'][_0x4994('0x67')]){_0x59c7a4['include']=[{'all':!![]}];}_0x59c7a4=_[_0x4994('0x65')]({},_0x59c7a4,_0x52d8e4['options']);return db['ChatWebsite']['find'](_0x59c7a4)[_0x4994('0x17')](handleEntityNotFound(_0x3105db,null))[_0x4994('0x17')](respondWithResult(_0x3105db,null))[_0x4994('0x20')](handleError(_0x3105db,null));};exports[_0x4994('0x6d')]=function(_0x473d68,_0x2279f6){return db[_0x4994('0x66')][_0x4994('0x6d')](_0x473d68[_0x4994('0x6e')],{})[_0x4994('0x17')](function(_0x4b9095){var _0x24eaff=_0x473d68[_0x4994('0x6f')][_0x4994('0x2d')]({'plain':!![]});if(!_0x24eaff)throw new Error(_0x4994('0x70'));if(_0x24eaff[_0x4994('0x71')]===_0x4994('0x6f')){var _0x55b8c4=_0x4b9095[_0x4994('0x2d')]({'plain':!![]});var _0x21b622=_0x4994('0x2e');return db[_0x4994('0x72')]['find']({'where':{'name':_0x21b622,'userProfileId':_0x24eaff['userProfileId']},'raw':!![]})[_0x4994('0x17')](function(_0x3362c7){if(_0x3362c7&&_0x3362c7[_0x4994('0x73')]===0x0){return db[_0x4994('0x2f')][_0x4994('0x6d')]({'name':_0x55b8c4[_0x4994('0x30')],'resourceId':_0x55b8c4['id'],'type':_0x3362c7['name'],'sectionId':_0x3362c7['id']},{})[_0x4994('0x17')](function(){return _0x4b9095;});}else{return _0x4b9095;}})[_0x4994('0x20')](function(_0xd8762f){logger[_0x4994('0x1d')](_0x4994('0x74'),_0xd8762f);throw _0xd8762f;});}return _0x4b9095;})[_0x4994('0x17')](respondWithResult(_0x2279f6,0xc9))[_0x4994('0x20')](handleError(_0x2279f6,null));};exports['update']=function(_0x40b194,_0xad7d04){if(_0x40b194[_0x4994('0x6e')]['id']){delete _0x40b194[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x40b194['params']['id']},'include':[{'model':db[_0x4994('0x56')],'as':_0x4994('0x57')}]})[_0x4994('0x17')](handleEntityNotFound(_0xad7d04,null))[_0x4994('0x17')](saveUpdates(_0x40b194[_0x4994('0x6e')],null))['then'](respondWithResult(_0xad7d04,null))[_0x4994('0x20')](handleError(_0xad7d04,null));};exports[_0x4994('0x2c')]=function(_0x471a01,_0x401046){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x471a01[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x401046,null))[_0x4994('0x17')](removeEntity(_0x401046,null))[_0x4994('0x20')](handleError(_0x401046,null));};exports[_0x4994('0x76')]=function(_0xd66338,_0x308030){return db['ChatWebsite'][_0x4994('0x76')]()[_0x4994('0x17')](respondWithResult(_0x308030,null))[_0x4994('0x20')](handleError(_0x308030,null));};exports['addDisposition']=function(_0x4399a9,_0x5d4e70){if(_0x4399a9[_0x4994('0x6e')]['id']){delete _0x4399a9[_0x4994('0x6e')]['id'];}return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x4399a9[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x5d4e70,null))[_0x4994('0x17')](function(_0x3a8261){if(_0x3a8261){_0x4399a9['body'][_0x4994('0x77')]=_0x3a8261['id'];return db[_0x4994('0x78')][_0x4994('0x6d')](_0x4399a9[_0x4994('0x6e')]);}})['then'](respondWithResult(_0x5d4e70,null))[_0x4994('0x20')](handleError(_0x5d4e70,null));};exports[_0x4994('0x79')]=function(_0x3761c0,_0x22aa0f){var _0x2c9884={'raw':![],'where':{}};var _0x5ef0c0={};var _0x1363b7={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3761c0['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x22aa0f,null))[_0x4994('0x17')](function(_0x414f94){if(_0x414f94){_0x5ef0c0[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x78')][_0x4994('0x6c')]);_0x5ef0c0[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x3761c0['query']);_0x5ef0c0[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5ef0c0['model'],_0x5ef0c0[_0x4994('0x5a')]);_0x2c9884[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x5ef0c0[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x3761c0[_0x4994('0x5a')]['fields']));_0x2c9884[_0x4994('0x5f')]=_0x2c9884['attributes'][_0x4994('0x60')]?_0x2c9884[_0x4994('0x5f')]:_0x5ef0c0[_0x4994('0x51')];if(!_0x3761c0[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x2c9884[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x3761c0[_0x4994('0x5a')][_0x4994('0x26')]);_0x2c9884[_0x4994('0x24')]=qs['offset'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x24')]);}_0x2c9884[_0x4994('0x61')]=qs['sort'](_0x3761c0[_0x4994('0x5a')][_0x4994('0x62')]);_0x2c9884[_0x4994('0x63')]=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3761c0['query'],_0x5ef0c0[_0x4994('0x5c')]));_0x2c9884['where'][_0x4994('0x77')]=_0x414f94['id'];if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x64')]){_0x2c9884[_0x4994('0x63')]=_['merge'](_0x2c9884[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x2c9884[_0x4994('0x5f')],function(_0x588162){var _0x277f76={};_0x277f76[_0x588162]={'$like':'%'+_0x3761c0[_0x4994('0x5a')]['filter']+'%'};return _0x277f76;})});}_0x2c9884=_[_0x4994('0x65')]({},_0x2c9884,_0x3761c0[_0x4994('0x7e')]);return db[_0x4994('0x78')][_0x4994('0x27')]({'where':_0x2c9884[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x42095c){_0x1363b7['count']=_0x42095c;if(_0x3761c0[_0x4994('0x5a')][_0x4994('0x67')]){_0x2c9884[_0x4994('0x68')]=[{'all':!![]}];}return db['Disposition'][_0x4994('0x69')](_0x2c9884);})[_0x4994('0x17')](function(_0x43551b){_0x1363b7['rows']=_0x43551b;return _0x1363b7;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x22aa0f,_0x2c9884))[_0x4994('0x20')](handleError(_0x22aa0f,null));};exports[_0x4994('0x7f')]=function(_0x36108f,_0x327513){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x36108f[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x327513,null))[_0x4994('0x17')](function(_0x1c22f4){if(_0x1c22f4){return _0x1c22f4[_0x4994('0x7f')](_0x36108f[_0x4994('0x5a')][_0x4994('0x80')]);}})[_0x4994('0x17')](respondWithStatusCode(_0x327513,null))[_0x4994('0x20')](handleError(_0x327513,null));};exports[_0x4994('0x81')]=function(_0x171a61,_0x3f69f0){if(_0x171a61[_0x4994('0x6e')]['id']){delete _0x171a61[_0x4994('0x6e')]['id'];}return db[_0x4994('0x66')]['find']({'where':{'id':_0x171a61[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3f69f0,null))[_0x4994('0x17')](function(_0x1eb162){if(_0x1eb162){_0x171a61[_0x4994('0x6e')][_0x4994('0x77')]=_0x1eb162['id'];return db[_0x4994('0x82')][_0x4994('0x6d')](_0x171a61[_0x4994('0x6e')]);}})[_0x4994('0x17')](respondWithResult(_0x3f69f0,null))['catch'](handleError(_0x3f69f0,null));};exports[_0x4994('0x83')]=function(_0x42cdd6,_0x4fb9ef){var _0x10cffe={'raw':![],'where':{}};var _0x2cd432={};var _0x5e3285={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x42cdd6[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4fb9ef,null))[_0x4994('0x17')](function(_0x1366e3){if(_0x1366e3){_0x2cd432[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0x82')][_0x4994('0x6c')]);_0x2cd432['query']=_[_0x4994('0x5b')](_0x42cdd6[_0x4994('0x5a')]);_0x2cd432['filters']=_['intersection'](_0x2cd432[_0x4994('0x51')],_0x2cd432['query']);_0x10cffe[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x2cd432['model'],qs[_0x4994('0x5e')](_0x42cdd6[_0x4994('0x5a')]['fields']));_0x10cffe['attributes']=_0x10cffe['attributes'][_0x4994('0x60')]?_0x10cffe['attributes']:_0x2cd432[_0x4994('0x51')];if(!_0x42cdd6[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x10cffe[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x26')]);_0x10cffe['offset']=qs[_0x4994('0x24')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x24')]);}_0x10cffe[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x42cdd6[_0x4994('0x5a')][_0x4994('0x62')]);_0x10cffe[_0x4994('0x63')]=qs[_0x4994('0x5c')](_['pick'](_0x42cdd6['query'],_0x2cd432['filters']));_0x10cffe[_0x4994('0x63')][_0x4994('0x77')]=_0x1366e3['id'];if(_0x42cdd6[_0x4994('0x5a')]['filter']){_0x10cffe['where']=_[_0x4994('0x65')](_0x10cffe[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x10cffe['attributes'],function(_0x3a9a79){var _0x3deb9d={};_0x3deb9d[_0x3a9a79]={'$like':'%'+_0x42cdd6[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x3deb9d;})});}_0x10cffe=_['merge']({},_0x10cffe,_0x42cdd6[_0x4994('0x7e')]);return db[_0x4994('0x82')][_0x4994('0x27')]({'where':_0x10cffe[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x9329b7){_0x5e3285[_0x4994('0x27')]=_0x9329b7;if(_0x42cdd6[_0x4994('0x5a')][_0x4994('0x67')]){_0x10cffe[_0x4994('0x68')]=[{'all':!![]}];}return db[_0x4994('0x82')][_0x4994('0x69')](_0x10cffe);})[_0x4994('0x17')](function(_0x5cea1b){_0x5e3285[_0x4994('0x6a')]=_0x5cea1b;return _0x5e3285;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x4fb9ef,_0x10cffe))[_0x4994('0x20')](handleError(_0x4fb9ef,null));};exports[_0x4994('0x84')]=function(_0xd9865,_0x7269f9){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xd9865[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x7269f9,null))[_0x4994('0x17')](function(_0x5ef3b7){if(_0x5ef3b7){return _0x5ef3b7['removeAnswers'](_0xd9865['query']['ids']);}})[_0x4994('0x17')](respondWithStatusCode(_0x7269f9,null))[_0x4994('0x20')](handleError(_0x7269f9,null));};exports[_0x4994('0x85')]=function(_0x73a51c,_0xef88f4){_0x73a51c[_0x4994('0x6e')][_0x4994('0x86')]=_0x73a51c[_0x4994('0x87')][_0x4994('0x88')];return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x73a51c[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0xef88f4,null))[_0x4994('0x17')](saveUpdates(_0x73a51c[_0x4994('0x6e')],null))[_0x4994('0x17')](respondWithResult(_0xef88f4,null))['catch'](handleError(_0xef88f4,null));};exports[_0x4994('0x89')]=function(_0x2c672d,_0x49a131){_0x2c672d[_0x4994('0x6e')]['agentAvatar']=_0x2c672d[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x2c672d['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x49a131,null))['then'](saveUpdates(_0x2c672d['body'],null))[_0x4994('0x17')](respondWithResult(_0x49a131,null))[_0x4994('0x20')](handleError(_0x49a131,null));};exports['addCustomerAvatar']=function(_0xb62458,_0x3ae9f5){_0xb62458['body'][_0x4994('0x8a')]=_0xb62458[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0xb62458['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x3ae9f5,null))[_0x4994('0x17')](saveUpdates(_0xb62458[_0x4994('0x6e')],null))['then'](respondWithResult(_0x3ae9f5,null))['catch'](handleError(_0x3ae9f5,null));};exports[_0x4994('0x8b')]=function(_0x4efb77,_0x561e7d){_0x4efb77[_0x4994('0x6e')][_0x4994('0x8c')]=_0x4efb77[_0x4994('0x87')][_0x4994('0x88')];return db[_0x4994('0x66')]['find']({'where':{'id':_0x4efb77[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x561e7d,null))['then'](saveUpdates(_0x4efb77['body'],null))['then'](respondWithResult(_0x561e7d,null))[_0x4994('0x20')](handleError(_0x561e7d,null));};exports[_0x4994('0x8d')]=function(_0x454649,_0x102206){var _0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x90'));var _0xd61309={'where':{'id':_0x454649[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x86')],'raw':!![]};var _0xa0eb0=![];return require(_0x4994('0x91'))[_0x4994('0x92')]()[_0x4994('0x17')](function(_0x5460b9){if(_0x5460b9){_0xa0eb0=_0x5460b9[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0x66')]['find'](_0xd61309);})['then'](handleEntityNotFound(_0x102206,null))[_0x4994('0x17')](function(_0x52233b){if(_0x52233b){if(!_[_0x4994('0x94')](_0x52233b['sitepic'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b['sitepic']))&&_0xa0eb0){_0x32792f=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x96'),_0x52233b[_0x4994('0x86')]);}}return _0x102206[_0x4994('0x97')](_0x32792f);}})[_0x4994('0x20')](handleError(_0x102206,null));};exports['getAvatar']=function(_0x1669d0,_0x158bb8){var _0x3d7f3b=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x98'));var _0x33974e={'where':{'id':_0x1669d0[_0x4994('0x6b')]['id']},'attributes':['id',_0x4994('0x99')],'raw':!![]};return db[_0x4994('0x66')][_0x4994('0x75')](_0x33974e)[_0x4994('0x17')](handleEntityNotFound(_0x158bb8,null))['then'](function(_0x40c2b5){if(_0x40c2b5){if(!_[_0x4994('0x94')](_0x40c2b5[_0x4994('0x99')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]))){_0x3d7f3b=path['join'](config['root'],_0x4994('0x9a'),_0x40c2b5[_0x4994('0x99')]);}}return _0x158bb8['download'](_0x3d7f3b);}})['catch'](handleError(_0x158bb8,null));};exports['getCustomerAvatar']=function(_0x2a7dfa,_0x13d3ba){var _0x819237=path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9b'));var _0x45f61a={'where':{'id':_0x2a7dfa[_0x4994('0x6b')]['id']},'attributes':['id','customerAvatar',_0x4994('0x9c')],'raw':!![]};return db['ChatWebsite'][_0x4994('0x75')](_0x45f61a)[_0x4994('0x17')](handleEntityNotFound(_0x13d3ba,null))['then'](function(_0x24b6b8){if(_0x24b6b8){if(!_[_0x4994('0x94')](_0x24b6b8['customerAvatar'])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]))&&_0x24b6b8[_0x4994('0x9c')]){_0x819237=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x24b6b8[_0x4994('0x8a')]);}}return _0x13d3ba['download'](_0x819237);}})[_0x4994('0x20')](handleError(_0x13d3ba,null));};exports[_0x4994('0x9d')]=function(_0x4eeb52,_0x232253){var _0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9e'));var _0x1af2fc={'where':{'id':_0x4eeb52['params']['id']},'attributes':['id',_0x4994('0x8c')],'raw':!![]};return db[_0x4994('0x66')]['find'](_0x1af2fc)['then'](handleEntityNotFound(_0x232253,null))[_0x4994('0x17')](function(_0x22c959){if(_0x22c959){if(!_[_0x4994('0x94')](_0x22c959[_0x4994('0x8c')])){if(fs[_0x4994('0x95')](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]))){_0x216999=path[_0x4994('0x8e')](config['root'],_0x4994('0x9a'),_0x22c959[_0x4994('0x8c')]);}}return _0x232253[_0x4994('0x97')](_0x216999);}})['catch'](handleError(_0x232253,null));};exports[_0x4994('0x9f')]=function(_0x152624,_0x24c7fd){var _0x234026={'body':_0x152624[_0x4994('0x6e')],'channel':_0x4994('0xa0')};var _0x4a50f9=[];var _0x406d9e=[];var _0x11cb69={};var _0x57de26=![];return db['CmContact'][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x3a21cb){if(!_0x3a21cb){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x4a50f9=_['difference'](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5')]);_0x406d9e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x3a21cb),[_0x4994('0xa4'),_0x4994('0xa5'),_0x4994('0xa7'),_0x4994('0xa8')]);if(_0x152624[_0x4994('0x6e')]['id']){delete _0x152624['body']['id'];}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['from'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory');}if(_[_0x4994('0x94')](_0x152624['body'][_0x4994('0x6e')])||_0x152624[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4994('0x94')](_0x152624[_0x4994('0x6e')]['mapKey'])){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa9')+_0x406d9e);}if(!_[_0x4994('0xaa')](_0x406d9e,_0x152624[_0x4994('0x6e')][_0x4994('0xab')])){throw new db[(_0x4994('0xa1'))]['ValidationError'](_0x4994('0xac')+_0x406d9e);}_0x11cb69[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db['ChatWebsite'][_0x4994('0x75')]({'where':{'id':_0x152624[_0x4994('0x6b')]['id']},'include':[{'model':db[_0x4994('0xae')],'as':_0x4994('0xaf'),'include':[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xb1'),'where':_0x11cb69,'limit':0x1,'order':[[_0x4994('0xa5'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x4994('0xb2')},{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id',_0x4994('0x38')],'raw':!![]}]}]});})[_0x4994('0x17')](function(_0x582557){if(!_0x582557)throw new APINotFoundError(util['format'](_0x4994('0xb4'),_0x152624[_0x4994('0x6b')]['id']));if(!_0x582557[_0x4994('0x3e')]||!_0x582557[_0x4994('0x3e')][_0x4994('0xb3')])return[_0x582557,!![]];return[_0x582557,checkWebsiteIntervals(_0x582557)];})[_0x4994('0xb5')](function(_0x30217c,_0x46a59e){if(!_0x46a59e)throw new APIOutOfIntervalError();if(!_0x30217c[_0x4994('0xaf')])return;_0x234026[_0x4994('0xb6')]=_0x30217c;_0x234026[_0x4994('0xb7')]=_0x30217c[_0x4994('0xaf')];_0x234026[_0x4994('0xb8')]=_[_0x4994('0xb9')](_0x30217c[_0x4994('0xb2')],[_0x4994('0xba')],[_0x4994('0xbb')]);if(_0x234026[_0x4994('0xb6')]['Applications']){delete _0x234026['account'][_0x4994('0xb2')];}if(_0x234026[_0x4994('0xb6')][_0x4994('0xaf')]&&_0x234026['account'][_0x4994('0xaf')][_0x4994('0xb1')][_0x4994('0x60')]){return _0x234026[_0x4994('0xb6')][_0x4994('0xaf')][_0x4994('0xb1')][0x0];}var _0x5ac49=_[_0x4994('0x10')](_0x152624[_0x4994('0x6e')],{'firstName':_0x152624[_0x4994('0x6e')][_0x4994('0xad')],'ListId':_0x30217c[_0x4994('0xa8')]});_0x5ac49[_0x152624[_0x4994('0x6e')][_0x4994('0xab')]]=_0x152624['body'][_0x4994('0xad')];return db[_0x4994('0xb0')]['create'](_0x5ac49,{'fields':_0x4a50f9,'raw':!![]});})['then'](function(_0x4b6843){_0x234026['contact']=_0x4b6843;var _0x33e30b=createInteractionObject(_0x152624[_0x4994('0x6b')]['id'],_0x152624[_0x4994('0x6e')],_0x152624[_0x4994('0xbc')],_0x4b6843);var _0x18ea85={'ChatWebsiteId':_0x152624[_0x4994('0x6b')]['id'],'closed':![]};if(_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]){_0x18ea85['threadId']=_0x152624[_0x4994('0x6e')][_0x4994('0xbd')];return db[_0x4994('0xbe')]['find']({'where':_0x18ea85})[_0x4994('0x17')](function(_0x3b8d03){if(_0x3b8d03){_0x57de26=!![];return _0x3b8d03;}_0x33e30b[_0x4994('0xbd')]=_0x152624['body']['threadId'];_0x33e30b[_0x4994('0xbf')]=_0x152624[_0x4994('0x6e')][_0x4994('0xbf')];return db[_0x4994('0xbe')]['create'](_0x33e30b);});}_0x18ea85['ContactId']=_0x4b6843['id'];if(_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xc0')]['id']){_0x18ea85['id']=_0x152624['body'][_0x4994('0xc0')]['id'];return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':_0x18ea85})['then'](function(_0x29c20e){if(_0x29c20e){_0x57de26=!![];return _0x29c20e;}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);});}return db[_0x4994('0xbe')][_0x4994('0x6d')](_0x33e30b);})['then'](function(_0x9c5e94){if(!_0x57de26)return _0x9c5e94;var _0x9905a={'from':(_0x234026[_0x4994('0xc1')][_0x4994('0x49')]||'')+'\x20'+(_0x234026[_0x4994('0xc1')][_0x4994('0xc2')]||'')};if(_0x152624['body']['threadId']&&_0x152624[_0x4994('0x6e')][_0x4994('0xc3')]&&_0x152624[_0x4994('0x6e')][_0x4994('0xbd')]!=_0x152624[_0x4994('0x6e')]['messageId']){_0x9905a[_0x4994('0xbd')]=_0x152624['body'][_0x4994('0xc3')];}return _0x9c5e94[_0x4994('0x2b')](_0x9905a);})['then'](function(_0x580168){_0x234026[_0x4994('0xc0')]=_0x580168['get']({'plain':!![]});_0x234026[_0x4994('0xc0')][_0x4994('0xc4')]=!_0x57de26;if(_0x234026[_0x4994('0xc0')]['created']){if(_0x234026[_0x4994('0xb6')][_0x4994('0xc5')]){_0x234026[_0x4994('0xb8')]['push']({'id':0x0,'priority':_0x234026[_0x4994('0xb8')][_0x4994('0x60')]+0x1,'app':_0x4994('0xc6'),'appdata':_0x4994('0xc7'),'interval':_0x4994('0xc8')});}}return db[_0x4994('0xc9')][_0x4994('0x6d')]({'body':_0x152624[_0x4994('0x6e')][_0x4994('0x6e')],'ChatWebsiteId':_0x152624['params']['id'],'ChatInteractionId':_0x580168['id'],'direction':'in','ContactId':_0x234026[_0x4994('0xc1')]['id'],'AttachmentId':_0x152624[_0x4994('0x6e')]['AttachmentId']});})[_0x4994('0x17')](function(_0x4314fd){_0x234026[_0x4994('0x1e')]=_0x4314fd;if(!_0x234026[_0x4994('0xc0')]['UserId']){return;}return db['User'][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026[_0x4994('0xc0')][_0x4994('0xca')]}});})[_0x4994('0x17')](function(_0x242040){if(_0x242040){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x0,'app':_0x4994('0xcc'),'appdata':_0x242040['name']+','+(_0x234026['account'][_0x4994('0xcd')]||0xa),'interval':_0x4994('0xc8')});_0x234026[_0x4994('0xce')]=!![];}if(!_0x234026[_0x4994('0xc0')][_0x4994('0xcf')]){return;}return db[_0x4994('0xd0')][_0x4994('0x75')]({'attributes':['id',_0x4994('0x30')],'where':{'id':_0x234026['interaction']['queueId']}});})['then'](function(_0x464283){if(_0x464283){_0x234026[_0x4994('0xb8')][_0x4994('0xcb')]({'id':0x0,'priority':0x1,'app':_0x4994('0xd1'),'appdata':_0x464283[_0x4994('0x30')]+','+(_0x234026[_0x4994('0xb6')][_0x4994('0xd2')]||0x12c),'interval':_0x4994('0xc8')});}return respondWithRpcPromise(_0x4994('0xd3'),'startRouting',_0x234026);})['then'](function(_0x363cfc){respondWithRpcPromise(_0x4994('0xd4'),_0x4994('0xd4'),{'event':_0x4994('0x9f'),'message':_0x363cfc},client9002);return _0x363cfc;})['then'](respondWithResult(_0x24c7fd,null))[_0x4994('0x20')](APIHandleError(_0x24c7fd));};exports['offline']=function(_0x1bcdc6,_0x4010a8){var _0x46f75a,_0x1070a8,_0xf51fc6;var _0x7b727e=[];var _0x21bf56={};var _0x456615=_0x1bcdc6[_0x4994('0xd5')]||[];var _0x54de8c=[];var _0x4b9438;return db[_0x4994('0xb0')][_0x4994('0x76')]()[_0x4994('0x17')](function(_0x4ac490){if(!_0x4ac490){throw new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xa3'));}_0x7b727e=_[_0x4994('0xa6')](_[_0x4994('0x5b')](_0x4ac490),[_0x4994('0xa4'),_0x4994('0xa5'),'CompanyId',_0x4994('0xa8')]);if(_0x1bcdc6[_0x4994('0x6e')]['id']){delete _0x1bcdc6[_0x4994('0x6e')]['id'];}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('from\x20is\x20mandatory'));}if(_[_0x4994('0x94')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')])||_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]===''){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db['Sequelize'][(_0x4994('0xa2'))](_0x4994('0xd7')));}if(_[_0x4994('0x94')](_0x1bcdc6['body']['mapKeyOffline'])){throw _0x4010a8['status'](0x1f4)[_0x4994('0xd6')](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))](_0x4994('0xd8')+_0x7b727e));}if(!_[_0x4994('0xaa')](_0x7b727e,_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')])){throw _0x4010a8[_0x4994('0x22')](0x1f4)['send'](new db[(_0x4994('0xa1'))][(_0x4994('0xa2'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x7b727e));}_0x21bf56[_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];})[_0x4994('0x17')](function(){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x1bcdc6[_0x4994('0x6b')]['id']},'include':[{'model':db['CmList'],'as':_0x4994('0xaf')},{'model':db[_0x4994('0xda')],'as':_0x4994('0xda')}]});})[_0x4994('0x17')](handleEntityNotFound(_0x4010a8,null))[_0x4994('0x17')](function(_0x51ec8f){if(_0x51ec8f&&_0x51ec8f[_0x4994('0xaf')]){_0x1070a8=_0x51ec8f;var _0x56d3b3=_[_0x4994('0x10')](_0x1bcdc6[_0x4994('0x6e')],{'firstName':_0x1bcdc6[_0x4994('0x6e')]['from'],'phone':_0x1bcdc6[_0x4994('0x6e')]['from'],'ListId':_0x51ec8f['ListId']});_0x56d3b3[_0x1bcdc6['body'][_0x4994('0xd9')]]=_0x1bcdc6[_0x4994('0x6e')][_0x4994('0xad')];return db['CmContact']['findOrCreate']({'where':_0x21bf56,'defaults':_0x56d3b3});}})[_0x4994('0xb5')](function(_0x514f4e){if(_0x514f4e){_0xf51fc6=_0x514f4e;var _0x227f82=fs['readFileSync'](path[_0x4994('0x8e')](config[_0x4994('0x8f')],_0x4994('0xdb')),_0x4994('0xdc'));var _0x313165=ejs['render'](_0x227f82,{'body':_[_0x4994('0xdd')](_0x1bcdc6[_0x4994('0x6e')][_0x4994('0x6e')]),'bodyTitle':_0x1070a8[_0x4994('0xde')]});return db[_0x4994('0xdf')][_0x4994('0x6d')]({'body':_0x313165,'plainBody':htmlToText[_0x4994('0xe0')](_0x313165),'ContactId':_0x514f4e['id'],'ChatWebsiteId':_0x1070a8['id']});}})[_0x4994('0x17')](function(_0x59826d){_0x4b9438=_0x59826d;if(_0x456615[_0x4994('0x60')]){var _0x67fd48=_0x456615[_0x4994('0x3d')](function(_0x56e915){return{'name':_0x56e915[_0x4994('0xe1')],'basename':_0x56e915[_0x4994('0x88')],'type':_0x56e915[_0x4994('0xe2')],'ChatOfflineMessageId':_0x59826d['id']};});_0x54de8c=_0x67fd48[_0x4994('0x3d')](_0x346308=>{var _0x271606={'filename':_0x346308[_0x4994('0x30')],'path':path['join'](config[_0x4994('0x8f')],_0x4994('0xe3'),_0x4994('0xd5'),_0x4994('0xe4'),_0x4994('0xe5'),_0x346308[_0x4994('0xe6')])};return _0x271606;});if(!_0x1070a8[_0x4994('0xe7')]){return db['sequelize'][_0x4994('0xe8')](function(_0x1bcef1){return db[_0x4994('0xe9')][_0x4994('0xea')](_0x67fd48,{'transaction':_0x1bcef1});});}}})[_0x4994('0x17')](function(){if(_0x4b9438){_0x46f75a=_0x4b9438;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4994('0xeb'),'raw':!![],'include':[{'model':db[_0x4994('0xec')],'as':'CloudProvider','raw':!![]}]}]});}})['then'](function(_0x293707){if(_0x293707&&_0x293707['Smtp']&&_0x1070a8[_0x4994('0xed')]&&_0x1070a8[_0x4994('0xee')]){var _0xd6cd54=_0x293707['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x4994('0xef'),{'account':_0xd6cd54,'message':{'from':util[_0x4994('0x34')](_0x4994('0xf0'),_0x293707[_0x4994('0x30')],_0x293707[_0x4994('0xf1')]||_0x293707[_0x4994('0xeb')]['user']),'to':_0x1070a8[_0x4994('0xee')],'subject':_0x1070a8['offlineMessageSubject'],'html':_0x46f75a['body'],'attachments':_0x54de8c}},client9003)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0xae376c){logger[_0x4994('0x1d')](_0xae376c);});}})[_0x4994('0x17')](function(){if(_0x1070a8&&_0x1070a8[_0x4994('0xe7')]&&_0x1070a8[_0x4994('0xf2')]){var _0x480db3=[];if(_0x456615[_0x4994('0x60')]){_0x480db3=_0x456615[_0x4994('0x3d')](function(_0x208970){return{'name':_0x208970[_0x4994('0xe1')],'basename':_0x208970[_0x4994('0x88')],'type':_0x208970[_0x4994('0xe2')],'ChatOfflineMessageId':_0x4b9438['id']};});}var _0x5b12a4;if(!_['isNil'](_0x1070a8[_0x4994('0xf3')])){var _0x39c3ce=_['map'](_0x1bcdc6['body'],function(_0x51d051){return _0x51d051;});var _0x20535e=_[_0x4994('0xf4')](_0x39c3ce)[0x0];var _0x49be37=_['mapValues'](_0x20535e,function(_0x1b2ba6){return _0x1b2ba6;});_0x5b12a4=_0x49be37[0x1][_0x1070a8['subjectOffline']];}var _0x5489a0={'from':_0xf51fc6[_0x4994('0xf1')],'firstName':_0xf51fc6[_0x4994('0x49')],'lastName':_0xf51fc6['lastName'],'mapKey':_0x4994('0xf1'),'message':{'from':_0xf51fc6[_0x4994('0xf1')],'to':_0x1070a8[_0x4994('0xda')][_0x4994('0xf1')],'cc':'','subject':_['isNil'](_0x5b12a4)?_0x1070a8[_0x4994('0xf5')]:_0x5b12a4,'messageId':'','sentAt':new Date(),'attach':_0x480db3[_0x4994('0x60')],'attachments':_0x480db3,'originChannel':_0x4994('0xf6'),'ChatWebsiteId':_0x1070a8['id'],'ChatOfflineMessageId':_0x46f75a['id'],'originTo':_0x1070a8['MailAccount'][_0x4994('0xf1')]},'body':_0x46f75a[_0x4994('0x6e')]};var _0x45b368={'account':{'id':_0x1070a8['MailAccountId']},'body':_0x5489a0,'log':_0x4994('0xf7')};return respondWithRpcPromise('NotifyMailAccount',_0x4994('0xf8'),_0x45b368,client9001)[_0x4994('0x17')](function(){return _0x46f75a;})[_0x4994('0x20')](function(_0x49ebac){logger[_0x4994('0x1d')](_0x49ebac);});}return;})[_0x4994('0x17')](function(){if(_0x46f75a){return _0x46f75a;}})[_0x4994('0x17')](respondWithResult(_0x4010a8,null))['catch'](function(){for(var _0x1aa86e of _0x456615){var _0x1889af=path[_0x4994('0x8e')](config[_0x4994('0x8f')],'server','files',_0x4994('0xe4'),_0x4994('0xe5'),_0x1aa86e[_0x4994('0x88')]);fs_extra[_0x4994('0xf9')](_0x1889af)[_0x4994('0x20')](function(_0x265381){logger['error'](_0x4994('0xfa'),_0x1889af,_0x265381);});}});};exports['addInteraction']=function(_0x53d026,_0x247e6e){return db[_0x4994('0xbe')][_0x4994('0x75')]({'where':{'id':_0x53d026[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x247e6e,null))[_0x4994('0x17')](function(_0x3cf36b){if(_0x3cf36b){return _0x3cf36b[_0x4994('0xfb')](_0x53d026[_0x4994('0x6e')][_0x4994('0x80')],_[_0x4994('0xfc')](_0x53d026[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x247e6e,null))['catch'](handleError(_0x247e6e,null));};exports[_0x4994('0xfd')]=function(_0x3cdc05,_0x331858){var _0x90f17a={'raw':![],'where':{}};var _0x15c927={};var _0x2b4216={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x3cdc05[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x331858,null))[_0x4994('0x17')](function(_0x4a0d24){if(_0x4a0d24){_0x15c927[_0x4994('0x51')]=_['keys'](db[_0x4994('0xbe')]['rawAttributes']);_0x15c927[_0x4994('0x5a')]=_['keys'](_0x3cdc05[_0x4994('0x5a')]);_0x15c927[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x15c927[_0x4994('0x51')],_0x15c927[_0x4994('0x5a')]);_0x90f17a['attributes']=_['intersection'](_0x15c927['model'],qs[_0x4994('0x5e')](_0x3cdc05[_0x4994('0x5a')]['fields']));_0x90f17a['attributes']=_0x90f17a[_0x4994('0x5f')][_0x4994('0x60')]?_0x90f17a['attributes']:_0x15c927[_0x4994('0x51')];if(!_0x3cdc05[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x90f17a['limit']=qs[_0x4994('0x26')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x26')]);_0x90f17a[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x3cdc05[_0x4994('0x5a')][_0x4994('0x24')]);}_0x90f17a[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x3cdc05['query']['sort']);_0x90f17a['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x3cdc05[_0x4994('0x5a')],_0x15c927[_0x4994('0x5c')]));_0x90f17a[_0x4994('0x63')][_0x4994('0x77')]=_0x4a0d24['id'];if(_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]){_0x90f17a[_0x4994('0x63')]=_[_0x4994('0x65')](_0x90f17a['where'],{'$or':_[_0x4994('0x3d')](_0x90f17a['attributes'],function(_0x322f25){var _0x299331={};_0x299331[_0x322f25]={'$like':'%'+_0x3cdc05[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x299331;})});}_0x90f17a=_[_0x4994('0x65')]({},_0x90f17a,_0x3cdc05['options']);return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':_0x90f17a[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x45b3f0){_0x2b4216['count']=_0x45b3f0;if(_0x3cdc05['query'][_0x4994('0x67')]){_0x90f17a[_0x4994('0x68')]=[{'model':db[_0x4994('0xb0')],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xff')],'as':_0x4994('0x100'),'attributes':[_0x4994('0x30'),_0x4994('0x101'),_0x4994('0x102')],'required':![]},{'model':db[_0x4994('0x103')],'as':_0x4994('0x104'),'attributes':['id','name',_0x4994('0x105')],'where':_0x3cdc05[_0x4994('0x5a')][_0x4994('0x106')]?{'id':_0x3cdc05['query'][_0x4994('0x106')]}:undefined,'required':_0x3cdc05[_0x4994('0x5a')]['tag']?!![]:![]}];}return db[_0x4994('0xbe')][_0x4994('0x69')](_0x90f17a);})['then'](function(_0x1ee117){_0x2b4216[_0x4994('0x6a')]=_0x1ee117;return _0x2b4216;});}})[_0x4994('0x17')](respondWithFilteredResult(_0x331858,_0x90f17a))[_0x4994('0x20')](handleError(_0x331858,null));};exports[_0x4994('0x32')]=function(_0x17ef96,_0x245b89){var _0xba8540=0x0;var _0x311f1b=0x0;var _0x3eda07=![];var _0xeb5422;var _0x4b379a;return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x17ef96['params']['id']},'include':[{'model':db[_0x4994('0x3e')],'as':'Interval','include':[{'model':db[_0x4994('0x3e')],'as':_0x4994('0xb3'),'attributes':['id','interval']}]}]})['then'](handleEntityNotFound(_0x245b89,null))['then'](function(_0x1a3fe7){if(_0x1a3fe7){_0xeb5422=_0x1a3fe7;return _0x1a3fe7[_0x4994('0x107')]({'raw':!![]});}})[_0x4994('0x17')](function(_0x28de10){if(_0xeb5422){if(_0x28de10){_0x4b379a=_0x28de10;}}return require('../../config/license/util')['getLicense']();})[_0x4994('0x17')](function(_0x368a6e){if(_0x368a6e){_0x311f1b=_0x368a6e['virtual'];_0x3eda07=_0x368a6e[_0x4994('0x93')];}})[_0x4994('0x17')](function(){return db[_0x4994('0xbe')][_0x4994('0x27')]({'where':{'closed':![]}});})[_0x4994('0x17')](function(_0x43043e){_0xba8540=_0x43043e;if(_0x311f1b&&_0x43043e>_0x311f1b){return db[_0x4994('0x108')]['findOne']({'where':{'id':0x1}})[_0x4994('0x17')](function(_0x241a6e){if(_0x241a6e){_0x241a6e[_0x4994('0x109')](_0x4994('0x10a'));}});}})[_0x4994('0x17')](function(){if(!_0xeb5422['Interval']||!_0xeb5422['Interval'][_0x4994('0xb3')])return!![];return checkWebsiteIntervals(_0xeb5422);})[_0x4994('0x17')](function(_0x1fe81a){var _0x41bd91=fs[_0x4994('0x10b')](path[_0x4994('0x8e')](config['root'],_0x4994('0x10c')),'utf8');var _0x249ffb=new url[(_0x4994('0x10d'))](_0xeb5422[_0x4994('0x10e')])[_0x4994('0x10f')];var _0x40a50f=_0x4994('0x110');var _0x3bd881=![];var _0x374109={'chatVersion':_0x40a50f,'chatWebsiteAddressOrigin':_0x249ffb,'remote':_0xeb5422['remote'],'query':querystring[_0x4994('0x1c')](_[_0x4994('0x65')](_0xeb5422['get']({'plain':!![]}),{'customerIp':_0x17ef96['headers'][_0x4994('0x46')]||_0x17ef96[_0x4994('0xbc')][_0x4994('0x111')]||_0x17ef96[_0x4994('0x112')]['remoteAddress']||_0x17ef96['ip'],'referer':_0x17ef96['headers'][_0x4994('0x4b')],'openedInteractions':_0xba8540,'maxInteractions':_0x311f1b,'virtual':_0x3eda07[_0x4994('0x113')],'online':_0x1fe81a,'custom':_0x3eda07}))[_0x4994('0x114')](/'/g,'\x5c\x27')};_0x245b89[_0x4994('0xd6')](ejs[_0x4994('0x115')](Mustache[_0x4994('0x115')](_0x41bd91,_0x374109),{'proactiveActions':_0x4b379a,'alignment':_0xeb5422[_0x4994('0x116')],'verticalAlignment':_0xeb5422[_0x4994('0x117')],'div_color':_0xeb5422[_0x4994('0x105')],'labelText':_0xeb5422[_0x4994('0x118')],'text_color':_0xeb5422[_0x4994('0x119')],'text_button_color':_0xeb5422[_0x4994('0x11a')],'button_color':_0xeb5422['color_button'],'background_color':_0xeb5422[_0x4994('0x11b')],'hideWhenOffline':_0xeb5422[_0x4994('0x11c')],'intervalId':_0xeb5422[_0x4994('0x11d')],'isDevelopment':_0x3bd881,'chatVersion':_0x40a50f}));})[_0x4994('0x20')](handleError(_0x245b89,null));};exports[_0x4994('0x11e')]=function(_0x2c2b5d,_0x247cd7){var _0x1a6855=_0x2c2b5d[_0x4994('0x6b')]['id'];var _0x4c5e74=_0x2c2b5d['body'];var _0x2dfe8d=0xc8;var _0x51e398=null;return db['sequelize'][_0x4994('0xe8')]({'isolationLevel':db['sequelize'][_0x4994('0x11f')][_0x4994('0x120')][_0x4994('0x121')]},function(_0x183239){return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1a6855},'transaction':_0x183239})['then'](function(_0x49473b){if(_0x49473b){return db[_0x4994('0x122')][_0x4994('0x2c')]({'where':{'ChatWebsiteId':_0x1a6855},'transaction':_0x183239})[_0x4994('0x17')](function(){var _0x5e3bfe=_[_0x4994('0x3d')](_0x4c5e74,function(_0x298a08){_0x298a08['ChatWebsiteId']=_0x1a6855;return _0x298a08;});return db[_0x4994('0x122')]['bulkCreate'](_0x5e3bfe,{'transaction':_0x183239});});}else{_0x2dfe8d=0x194;_0x51e398=[];}});})[_0x4994('0x17')](function(){if(_0x2dfe8d!==0x194){return db[_0x4994('0x122')][_0x4994('0x123')]({'where':{'ChatWebsiteId':_0x1a6855},'order':_0x4994('0xba')})[_0x4994('0x17')](function(_0xade7c6){_0x51e398=_0xade7c6;});}})[_0x4994('0x20')](function(_0x346138){_0x2dfe8d=0x1f4;logger[_0x4994('0x1d')](_0x346138[_0x4994('0x124')]);if(_0x346138['name']){delete _0x346138[_0x4994('0x30')];}_0x51e398=_0x346138;})[_0x4994('0x125')](function(){if(_0x51e398===null){_0x247cd7[_0x4994('0x21')](_0x2dfe8d);}else{if(_0x2dfe8d===0x1f4){_0x247cd7['status'](_0x2dfe8d)[_0x4994('0xd6')](_0x51e398);}else{_0x247cd7[_0x4994('0x22')](_0x2dfe8d)['json'](_0x51e398);}}});};exports[_0x4994('0x126')]=function(_0xd6fdbe,_0x1b47d1){var _0x166666={};var _0x40beb2={};var _0x1fd62d;var _0x219cf3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0xd6fdbe['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x1b47d1,null))[_0x4994('0x17')](function(_0x48ea62){if(_0x48ea62){_0x1fd62d=_0x48ea62;_0x40beb2[_0x4994('0x51')]=_[_0x4994('0x5b')](db['ChatApplication']['rawAttributes']);_0x40beb2['query']=_[_0x4994('0x5b')](_0xd6fdbe[_0x4994('0x5a')]);_0x40beb2[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x40beb2['model'],_0x40beb2[_0x4994('0x5a')]);_0x166666[_0x4994('0x5f')]=_['intersection'](_0x40beb2[_0x4994('0x51')],qs[_0x4994('0x5e')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x5e')]));_0x166666['attributes']=_0x166666[_0x4994('0x5f')][_0x4994('0x60')]?_0x166666[_0x4994('0x5f')]:_0x40beb2[_0x4994('0x51')];_0x166666['order']=qs[_0x4994('0x62')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x62')]);_0x166666['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0xd6fdbe[_0x4994('0x5a')],_0x40beb2[_0x4994('0x5c')]));if(_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x64')]){_0x166666[_0x4994('0x63')]=_['merge'](_0x166666[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x166666['attributes'],function(_0x32d8b2){var _0x12b6ce={};_0x12b6ce[_0x32d8b2]={'$like':'%'+_0xd6fdbe['query'][_0x4994('0x64')]+'%'};return _0x12b6ce;})});}_0x166666=_['merge']({},_0x166666,_0xd6fdbe['options']);return _0x1fd62d['getApplications'](_0x166666);}})['then'](function(_0x4529e7){if(_0x4529e7){_0x219cf3=_0x4529e7[_0x4994('0x60')];if(!_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x166666['limit']=qs['limit'](_0xd6fdbe[_0x4994('0x5a')]['limit']);_0x166666[_0x4994('0x24')]=qs[_0x4994('0x24')](_0xd6fdbe[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x1fd62d[_0x4994('0x126')](_0x166666);}})[_0x4994('0x17')](function(_0x157d34){if(_0x157d34){return _0x157d34?{'count':_0x219cf3,'rows':_0x157d34}:null;}})[_0x4994('0x17')](respondWithResult(_0x1b47d1,null))[_0x4994('0x20')](handleError(_0x1b47d1,null));};exports['addProactiveActions']=function(_0x491582,_0x2063ab){return db['chatProactiveAction'][_0x4994('0x75')]({'where':{'id':_0x491582[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2063ab,null))[_0x4994('0x17')](function(_0x359ac6){if(_0x359ac6){return _0x359ac6['addProactiveActions'](_0x491582[_0x4994('0x6e')]['ids'],_[_0x4994('0xfc')](_0x491582[_0x4994('0x6e')],['ids','id'])||{});}})[_0x4994('0x17')](respondWithResult(_0x2063ab,null))[_0x4994('0x20')](handleError(_0x2063ab,null));};exports['getProactiveActions']=function(_0x141d27,_0x2e76fd){var _0x30ba11={};var _0x5e6293={};var _0x9124fa;var _0x3dfee3;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x141d27[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x2e76fd,null))[_0x4994('0x17')](function(_0x5ba198){if(_0x5ba198){_0x9124fa=_0x5ba198;_0x5e6293[_0x4994('0x51')]=_['keys'](db[_0x4994('0x127')][_0x4994('0x6c')]);_0x5e6293[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x141d27[_0x4994('0x5a')]);_0x5e6293[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x5e6293[_0x4994('0x51')],_0x5e6293[_0x4994('0x5a')]);_0x30ba11[_0x4994('0x5f')]=_['intersection'](_0x5e6293[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x141d27[_0x4994('0x5a')][_0x4994('0x5e')]));_0x30ba11[_0x4994('0x5f')]=_0x30ba11[_0x4994('0x5f')][_0x4994('0x60')]?_0x30ba11['attributes']:_0x5e6293[_0x4994('0x51')];_0x30ba11['order']=qs[_0x4994('0x62')](_0x141d27['query'][_0x4994('0x62')]);_0x30ba11['where']=qs[_0x4994('0x5c')](_[_0x4994('0x7d')](_0x141d27[_0x4994('0x5a')],_0x5e6293['filters']));if(_0x141d27[_0x4994('0x5a')]['filter']){_0x30ba11[_0x4994('0x63')]=_[_0x4994('0x65')](_0x30ba11[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x30ba11[_0x4994('0x5f')],function(_0x3be37f){var _0x1c1a31={};_0x1c1a31[_0x3be37f]={'$like':'%'+_0x141d27[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x1c1a31;})});}_0x30ba11=_[_0x4994('0x65')]({},_0x30ba11,_0x141d27[_0x4994('0x7e')]);return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x5999a2){if(_0x5999a2){_0x3dfee3=_0x5999a2[_0x4994('0x60')];if(!_0x141d27[_0x4994('0x5a')][_0x4994('0x7b')](_0x4994('0x7c'))){_0x30ba11[_0x4994('0x26')]=qs[_0x4994('0x26')](_0x141d27[_0x4994('0x5a')]['limit']);_0x30ba11['offset']=qs[_0x4994('0x24')](_0x141d27[_0x4994('0x5a')][_0x4994('0x24')]);}return _0x9124fa[_0x4994('0x107')](_0x30ba11);}})[_0x4994('0x17')](function(_0x4cb8fe){if(_0x4cb8fe){return _0x4cb8fe?{'count':_0x3dfee3,'rows':_0x4cb8fe}:null;}})[_0x4994('0x17')](respondWithResult(_0x2e76fd,null))[_0x4994('0x20')](handleError(_0x2e76fd,null));};exports[_0x4994('0x128')]=function(_0x51cc49,_0x30e418){var _0x50031b=_0x51cc49[_0x4994('0x5a')]['online']==='false'?_0x4994('0x129'):_0x4994('0x12a');return db['ChatWebsite'][_0x4994('0x75')]({'attributes':['id',_0x50031b],'where':{'id':_0x51cc49[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x30e418,null))[_0x4994('0x17')](function(_0x5214f5){if(_0x5214f5){var _0x57a913=_0x5214f5[_0x50031b];var _0x4fefe2=_0x57a913&&_0x57a913[_0x4994('0x12b')]?_0x57a913[_0x4994('0x12b')]:[];_0x30e418[_0x4994('0xd6')]({'fromKey':_[_0x4994('0x94')](_0x57a913[_0x4994('0x12c')])?undefined:_0x57a913['fromKey'],'count':_0x4fefe2[_0x4994('0x60')],'rows':_0x4fefe2});}})[_0x4994('0x20')](handleError(_0x30e418,null));};exports[_0x4994('0x12d')]=function(_0x50d7e8,_0x1cabb2){var _0x58de8d={'raw':![],'where':{}};var _0x20bb8c={};var _0x966f40={'count':0x0,'rows':[]};return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x50d7e8[_0x4994('0x6b')]['id']}})['then'](handleEntityNotFound(_0x1cabb2,null))[_0x4994('0x17')](function(_0x12c190){if(_0x12c190){_0x20bb8c[_0x4994('0x51')]=_[_0x4994('0x5b')](db[_0x4994('0xdf')]['rawAttributes']);_0x20bb8c[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x50d7e8[_0x4994('0x5a')]);_0x20bb8c['filters']=_['intersection'](_0x20bb8c[_0x4994('0x51')],_0x20bb8c[_0x4994('0x5a')]);_0x58de8d[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x20bb8c[_0x4994('0x51')],qs[_0x4994('0x5e')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x5e')]));_0x58de8d['attributes']=_0x58de8d[_0x4994('0x5f')]['length']?_0x58de8d[_0x4994('0x5f')]:_0x20bb8c['model'];if(!_0x50d7e8[_0x4994('0x5a')][_0x4994('0x7b')]('nolimit')){_0x58de8d['limit']=qs['limit'](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x26')]);_0x58de8d[_0x4994('0x24')]=qs[_0x4994('0x24')](_0x50d7e8['query'][_0x4994('0x24')]);}_0x58de8d[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x50d7e8[_0x4994('0x5a')][_0x4994('0x62')]);_0x58de8d[_0x4994('0x63')]=qs['filters'](_['pick'](_0x50d7e8[_0x4994('0x5a')],_0x20bb8c[_0x4994('0x5c')]));_0x58de8d['where'][_0x4994('0x77')]=_0x12c190['id'];if(_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]){_0x58de8d['where']=_[_0x4994('0x65')](_0x58de8d[_0x4994('0x63')],{'$or':_['map'](_0x58de8d[_0x4994('0x5f')],function(_0x5e6af8){var _0x4779c9={};_0x4779c9[_0x5e6af8]={'$like':'%'+_0x50d7e8[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4779c9;})});}_0x58de8d=_[_0x4994('0x65')]({},_0x58de8d,_0x50d7e8[_0x4994('0x7e')]);return db['ChatOfflineMessage'][_0x4994('0x27')]({'where':_0x58de8d[_0x4994('0x63')]})[_0x4994('0x17')](function(_0x2598d6){_0x966f40['count']=_0x2598d6;if(_0x50d7e8['query'][_0x4994('0x67')]){_0x58de8d['include']=[{'all':!![]}];}else{_0x58de8d[_0x4994('0x68')]=[{'model':db['CmContact'],'as':_0x4994('0xfe'),'required':![]},{'model':db[_0x4994('0xe9')],'as':'Attachments','required':![]}];}return db[_0x4994('0xdf')]['findAll'](_0x58de8d);})['then'](function(_0x14236c){_0x966f40[_0x4994('0x6a')]=_0x14236c;return _0x966f40;});}})['then'](respondWithFilteredResult(_0x1cabb2,_0x58de8d))[_0x4994('0x20')](handleError(_0x1cabb2,null));};exports['addAgents']=function(_0x4a5bd5,_0x30b6ac){return db[_0x4994('0x66')][_0x4994('0x75')]({'where':{'id':_0x4a5bd5['params']['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x30b6ac,null))[_0x4994('0x17')](function(_0x20fa8c){if(_0x20fa8c){return _0x20fa8c['addAgents'](_0x4a5bd5['body'][_0x4994('0x80')],_[_0x4994('0xfc')](_0x4a5bd5[_0x4994('0x6e')],[_0x4994('0x80'),'id'])||{})[_0x4994('0xb5')](function(_0x16b323){for(var _0x29fce8=0x0;_0x29fce8<_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x4994('0x60')];_0x29fce8+=0x1){socket['emit'](_0x4994('0x12e'),{'UserId':Number(_0x4a5bd5[_0x4994('0x6e')]['ids'][_0x29fce8]),'ChatWebsiteId':Number(_0x4a5bd5[_0x4994('0x6b')]['id'])});}return _0x16b323;});}})[_0x4994('0x17')](respondWithResult(_0x30b6ac,null))[_0x4994('0x20')](handleError(_0x30b6ac,null));};exports[_0x4994('0x12f')]=function(_0x383552,_0xa392e3){return db['ChatWebsite']['find']({'where':{'id':_0x383552['params']['id']}})['then'](handleEntityNotFound(_0xa392e3,null))['then'](function(_0x4cf294){if(_0x4cf294){return _0x4cf294[_0x4994('0x12f')](_0x383552[_0x4994('0x5a')][_0x4994('0x80')])[_0x4994('0x17')](function(){if(_['isArray'](_0x383552['query'][_0x4994('0x80')])){for(var _0x5586e2=0x0;_0x5586e2<_0x383552['query']['ids'][_0x4994('0x60')];_0x5586e2+=0x1){socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')]['ids'][_0x5586e2]),'ChatWebsiteId':Number(_0x383552[_0x4994('0x6b')]['id'])});}}else{socket[_0x4994('0x130')](_0x4994('0x131'),{'UserId':Number(_0x383552[_0x4994('0x5a')][_0x4994('0x80')]),'ChatWebsiteId':Number(_0x383552['params']['id'])});}});}})[_0x4994('0x17')](respondWithStatusCode(_0xa392e3,null))[_0x4994('0x20')](handleError(_0xa392e3,null));};exports[_0x4994('0x132')]=function(_0x1f2c6d,_0x4f5787){var _0x406daa={};var _0x1b3be3={};var _0x3a7177;var _0x430009;return db[_0x4994('0x66')][_0x4994('0x7a')]({'where':{'id':_0x1f2c6d[_0x4994('0x6b')]['id']}})[_0x4994('0x17')](handleEntityNotFound(_0x4f5787,null))[_0x4994('0x17')](function(_0x4a8bd6){if(_0x4a8bd6){_0x3a7177=_0x4a8bd6;_0x1b3be3['model']=_['keys'](db[_0x4994('0xff')][_0x4994('0x6c')]);_0x1b3be3[_0x4994('0x5a')]=_[_0x4994('0x5b')](_0x1f2c6d[_0x4994('0x5a')]);_0x1b3be3[_0x4994('0x5c')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],_0x1b3be3[_0x4994('0x5a')]);_0x406daa[_0x4994('0x5f')]=_[_0x4994('0x5d')](_0x1b3be3[_0x4994('0x51')],qs['fields'](_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x5e')]));_0x406daa['attributes']=_0x406daa[_0x4994('0x5f')][_0x4994('0x60')]?_0x406daa[_0x4994('0x5f')]:_0x1b3be3['model'];_0x406daa[_0x4994('0x61')]=qs[_0x4994('0x62')](_0x1f2c6d[_0x4994('0x5a')]['sort']);_0x406daa[_0x4994('0x63')]=qs['filters'](_['pick'](_0x1f2c6d[_0x4994('0x5a')],_0x1b3be3[_0x4994('0x5c')]));if(_0x1f2c6d['query'][_0x4994('0x64')]){_0x406daa[_0x4994('0x63')]=_[_0x4994('0x65')](_0x406daa[_0x4994('0x63')],{'$or':_[_0x4994('0x3d')](_0x406daa[_0x4994('0x5f')],function(_0xa448){var _0x4dc10b={};_0x4dc10b[_0xa448]={'$like':'%'+_0x1f2c6d[_0x4994('0x5a')][_0x4994('0x64')]+'%'};return _0x4dc10b;})});}_0x406daa=_[_0x4994('0x65')]({},_0x406daa,_0x1f2c6d[_0x4994('0x7e')]);return _0x3a7177['getAgents'](_0x406daa);}})['then'](function(_0x1d48fc){if(_0x1d48fc){_0x430009=_0x1d48fc[_0x4994('0x60')];if(!_0x1f2c6d['query'][_0x4994('0x7b')](_0x4994('0x7c'))){_0x406daa[_0x4994('0x26')]=qs['limit'](_0x1f2c6d[_0x4994('0x5a')]['limit']);_0x406daa['offset']=qs['offset'](_0x1f2c6d['query'][_0x4994('0x24')]);}return _0x3a7177[_0x4994('0x132')](_0x406daa);}})[_0x4994('0x17')](function(_0x582c7a){if(_0x582c7a){return _0x582c7a?{'count':_0x430009,'rows':_0x582c7a}:null;}})[_0x4994('0x17')](respondWithResult(_0x4f5787,null))[_0x4994('0x20')](handleError(_0x4f5787,null));};
\ No newline at end of file
+var _0xe37a=['firstName','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','mapValues','subjectOffline','NotifyMailAccount','notifyMail','server','addInteraction','omit','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','getProactiveActions','getLicense','License','readFileSync','utf8','URL','address','origin','remote','headers','x-real-ip','connection','remoteAddress','virtual','alignment','labelText','textColor','hideWhenOffline','IntervalId','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','getOfflineMessages','Attachment','Attachments','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','util','path','fs-extra','lodash','querystring','html-to-text','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','handleError','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','then','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','get','UserProfileResource','name','send','Command','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','map','Interval','Intervals','all','some','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','index','Pause','ChatWebsite','fieldName','key','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','intersection','length','include','create','user','role','ChatWebsites','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','sort','filter','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','contact','threadId','externalUrl','ChatInteraction','interaction'];(function(_0xe5f973,_0x1edce7){var _0x34d054=function(_0x2dba4d){while(--_0x2dba4d){_0xe5f973['push'](_0xe5f973['shift']());}};_0x34d054(++_0x1edce7);}(_0xe37a,0x69));var _0xae37=function(_0x43b045,_0x8ae9ce){_0x43b045=_0x43b045-0x0;var _0x48e7ee=_0xe37a[_0x43b045];return _0x48e7ee;};'use strict';var Mustache=require(_0xae37('0x0'));var util=require(_0xae37('0x1'));var path=require(_0xae37('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae37('0x3'));var _=require(_0xae37('0x4'));var querystring=require(_0xae37('0x5'));var htmlToText=require(_0xae37('0x6'));var Redis=require('ioredis');var jayson=require(_0xae37('0x7'));var url=require(_0xae37('0x8'));var qs=require(_0xae37('0x9'));var logger=require(_0xae37('0xa'))('api');var config=require(_0xae37('0xb'));var APIOutOfIntervalError=require(_0xae37('0xc'))[_0xae37('0xd')];var APINotFoundError=require(_0xae37('0xc'))['APINotFoundError'];var APIHandleError=require(_0xae37('0xc'))[_0xae37('0xe')];var db=require('../../mysqldb')['db'];config['redis']=_[_0xae37('0xf')](config[_0xae37('0x10')],{'host':_0xae37('0x11'),'port':0x18eb});var socket=require(_0xae37('0x12'))(new Redis(config['redis']));require(_0xae37('0x13'))[_0xae37('0x14')](socket);var client=jayson[_0xae37('0x15')]['http']({'port':0x232c});var client9002=jayson[_0xae37('0x15')][_0xae37('0x16')]({'port':0x232a});var client9003=jayson['client'][_0xae37('0x16')]({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x4a977a,_0x2928d4,_0x1f4c3b,_0x38e1fe){return new Promise(function(_0x4b8612,_0x5e998f){var _0x42a88e=_0x38e1fe||client;return _0x42a88e['request'](_0x4a977a,_0x1f4c3b)[_0xae37('0x17')](function(_0x2257c2){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2928d4,'request\x20sent');logger['debug'](_0xae37('0x18'),_0x2928d4,_0xae37('0x19'),JSON[_0xae37('0x1a')](_0x2257c2));if(_0x2257c2[_0xae37('0x1b')]){if(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1c')]===0x1f4){logger[_0xae37('0x1b')](_0xae37('0x1d'),_0x2928d4,_0x2257c2['error']['message']);return _0x5e998f(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);}logger['error'](_0xae37('0x1d'),_0x2928d4,_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);return _0x4b8612(_0x2257c2[_0xae37('0x1b')][_0xae37('0x1e')]);}else{logger[_0xae37('0x1f')](_0xae37('0x1d'),_0x2928d4,_0xae37('0x19'));_0x4b8612(_0x2257c2[_0xae37('0x20')][_0xae37('0x1e')]);}})[_0xae37('0x21')](function(_0x213b6c){logger[_0xae37('0x1b')](_0xae37('0x1d'),_0x2928d4,_0x213b6c);_0x5e998f(_0x213b6c);});});}function respondWithStatusCode(_0x845390,_0x37e922){_0x37e922=_0x37e922||0xcc;return function(_0x337179){if(_0x337179){return _0x845390[_0xae37('0x22')](_0x37e922);}return _0x845390[_0xae37('0x23')](_0x37e922)[_0xae37('0x24')]();};}function respondWithResult(_0x18d125,_0x542149){_0x542149=_0x542149||0xc8;return function(_0x5cfe59){if(_0x5cfe59){return _0x18d125['status'](_0x542149)[_0xae37('0x25')](_0x5cfe59);}};}function respondWithFilteredResult(_0x4bfba0,_0x1c5571){return function(_0x2b9699){if(_0x2b9699){var _0x54e95a=typeof _0x1c5571[_0xae37('0x26')]===_0xae37('0x27')&&typeof _0x1c5571[_0xae37('0x28')]==='undefined';var _0x3492f3=_0x2b9699['count'];var _0x1aed00=_0x54e95a?0x0:_0x1c5571[_0xae37('0x26')];var _0x31ac5f=_0x54e95a?_0x2b9699[_0xae37('0x29')]:_0x1c5571[_0xae37('0x26')]+_0x1c5571[_0xae37('0x28')];var _0x90a55c;if(_0x31ac5f>=_0x3492f3){_0x31ac5f=_0x3492f3;_0x90a55c=0xc8;}else{_0x90a55c=0xce;}_0x4bfba0[_0xae37('0x23')](_0x90a55c);return _0x4bfba0[_0xae37('0x2a')]('Content-Range',_0x1aed00+'-'+_0x31ac5f+'/'+_0x3492f3)['json'](_0x2b9699);}return null;};}function saveUpdates(_0x935ef7){return function(_0x24413c){if(_0x24413c){return _0x24413c[_0xae37('0x2b')](_0x935ef7)[_0xae37('0x17')](function(_0x34362b){return _0x34362b;});}return null;};}function removeEntity(_0x2b87f0){return function(_0x55d379){if(_0x55d379){return _0x55d379[_0xae37('0x2c')]()[_0xae37('0x17')](function(){var _0x37ff2e=_0x55d379[_0xae37('0x2d')]({'plain':!![]});var _0x56f9f1='ChatWebsites';return db[_0xae37('0x2e')][_0xae37('0x2c')]({'where':{'type':_0x56f9f1,'resourceId':_0x37ff2e['id']}})[_0xae37('0x17')](function(){return _0x55d379;});})[_0xae37('0x17')](function(){_0x2b87f0[_0xae37('0x23')](0xcc)[_0xae37('0x24')]();});}};}function handleEntityNotFound(_0x35afd0){return function(_0x59288e){if(!_0x59288e){_0x35afd0['sendStatus'](0x194);}return _0x59288e;};}function handleError(_0x3c9df4,_0x5bed43){_0x5bed43=_0x5bed43||0x1f4;return function(_0x5359b4){logger[_0xae37('0x1b')](_0x5359b4['stack']);if(_0x5359b4['name']){delete _0x5359b4[_0xae37('0x2f')];}_0x3c9df4['status'](_0x5bed43)[_0xae37('0x30')](_0x5359b4);};}function iftimePromise(_0x52b168,_0x524e64){return respondWithRpcPromise(_0xae37('0x31'),'getSnippet',{'command':_0x524e64[_0xae37('0x32')]?util[_0xae37('0x33')](_0xae37('0x34'),_0x52b168[_0xae37('0x35')],_0x524e64[_0xae37('0x32')]):util[_0xae37('0x33')](_0xae37('0x36'),_0x52b168[_0xae37('0x35')])},client9002)[_0xae37('0x17')](function(_0x295a29){var _0x1e02c8=_0x295a29&&_0x295a29['indexOf']('true')>=0x0?!![]:![];logger[_0xae37('0x1f')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x524e64['id'],_0x52b168['id'],_0x52b168[_0xae37('0x35')],_0x1e02c8?_0xae37('0x37'):'OFFLINE',_0x524e64[_0xae37('0x32')]?_0x524e64[_0xae37('0x32')]:_0xae37('0x38'));return _0x1e02c8;})[_0xae37('0x21')](function(_0x5929f6){logger['error'](_0xae37('0x39'),_0x524e64['id'],_0x52b168['id'],_0x52b168[_0xae37('0x35')],util[_0xae37('0x3a')](_0x5929f6,{'showHidden':![],'depth':null}),_0x524e64['timezone']?_0x524e64['timezone']:_0xae37('0x38'));return![];});}function checkWebsiteIntervals(_0x4a1510){var _0x23e553=_[_0xae37('0x3b')](_0x4a1510[_0xae37('0x3c')][_0xae37('0x3d')],function(_0x53264d){var _0x5777ea=_0x53264d[_0xae37('0x2d')]({'plain':!![]});return iftimePromise(_0x5777ea,_0x4a1510);});return Promise[_0xae37('0x3e')](_0x23e553)[_0xae37('0x17')](function(_0x38666a){return _[_0xae37('0x3f')](_0x38666a);});}function createInteractionObject(_0x41cd85,_0x1bdadc,_0x2350f5,_0x207429){var _0x2489a5=require(_0xae37('0x40'));var _0x4d6942=new _0x2489a5();var _0x3c5c28=_0x4d6942['setUA'](_0x2350f5[_0xae37('0x41')])[_0xae37('0x42')]();var _0x3d62e5=_0x1bdadc[_0xae37('0x43')];if(_0x2350f5[_0xae37('0x44')]){_0x3d62e5=_0x2350f5[_0xae37('0x44')];}else if(_0x2350f5[_0xae37('0x45')]){_0x3d62e5=_[_0xae37('0x46')](_0x2350f5[_0xae37('0x45')][_0xae37('0x47')](','));}return{'ContactId':_0x207429['id'],'ChatWebsiteId':_0x41cd85,'from':(_0x207429['firstName']||'')+'\x20'+(_0x207429['lastName']||''),'customerIp':_0x3d62e5,'customerPort':_0x2350f5[_0xae37('0x48')]?_0x2350f5[_0xae37('0x48')]:null,'referer':_0x1bdadc[_0xae37('0x49')],'browserName':_0x3c5c28[_0xae37('0x4a')][_0xae37('0x2f')]&&_0x3c5c28[_0xae37('0x4a')][_0xae37('0x4b')]?util['format'](_0xae37('0x4c'),_0x3c5c28[_0xae37('0x4a')][_0xae37('0x2f')],_0x3c5c28[_0xae37('0x4a')]['version']):'unknown','browserVersion':_0x3c5c28[_0xae37('0x4a')][_0xae37('0x4b')]||_0xae37('0x4d'),'osName':util[_0xae37('0x33')](_0xae37('0x4c'),_0x3c5c28['os']['name'],_0x3c5c28['os'][_0xae37('0x4b')]),'osVersion':_0x3c5c28['os']['version'],'deviceModel':_0x3c5c28[_0xae37('0x4e')][_0xae37('0x4f')]&&_0x3c5c28[_0xae37('0x4e')][_0xae37('0x50')]?util[_0xae37('0x33')]('%s\x20%s\x20%s',_0x3c5c28[_0xae37('0x4e')][_0xae37('0x4f')],_0x3c5c28[_0xae37('0x4e')][_0xae37('0x50')],_0x3c5c28['device'][_0xae37('0x51')]):null,'deviceVendor':_0x3c5c28[_0xae37('0x4e')]['vendor'],'deviceType':_0x3c5c28[_0xae37('0x4e')][_0xae37('0x51')],'formData':JSON[_0xae37('0x1a')](_0x1bdadc)};}exports[_0xae37('0x52')]=function(_0x738bd1,_0x3cef96){var _0x4aa6d5={'include':[{'model':db[_0xae37('0x53')],'as':'mandatoryDispositionPause'}]},_0x11dc3f={},_0x3c24ce={'count':0x0,'rows':[]};var _0x464f8d=_[_0xae37('0x3b')](db[_0xae37('0x54')]['rawAttributes'],function(_0x24ad3a){return{'name':_0x24ad3a[_0xae37('0x55')],'type':_0x24ad3a[_0xae37('0x51')][_0xae37('0x56')]};});_0x11dc3f[_0xae37('0x4f')]=_[_0xae37('0x3b')](_0x464f8d,_0xae37('0x2f'));_0x11dc3f[_0xae37('0x57')]=_[_0xae37('0x58')](_0x738bd1['query']);_0x11dc3f[_0xae37('0x59')]=_['intersection'](_0x11dc3f[_0xae37('0x4f')],_0x11dc3f[_0xae37('0x57')]);_0x4aa6d5[_0xae37('0x5a')]=_['intersection'](_0x11dc3f[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x738bd1[_0xae37('0x57')][_0xae37('0x5b')]));_0x4aa6d5[_0xae37('0x5a')]=_0x4aa6d5[_0xae37('0x5a')]['length']?_0x4aa6d5[_0xae37('0x5a')]:_0x11dc3f[_0xae37('0x4f')];if(!_0x738bd1['query'][_0xae37('0x5c')](_0xae37('0x5d'))){_0x4aa6d5[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x738bd1[_0xae37('0x57')]['limit']);_0x4aa6d5[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x738bd1[_0xae37('0x57')][_0xae37('0x26')]);}_0x4aa6d5[_0xae37('0x5e')]=qs['sort'](_0x738bd1['query']['sort']);_0x4aa6d5[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x738bd1['query'],_0x11dc3f['filters']),_0x464f8d);if(_0x738bd1[_0xae37('0x57')]['filter']){_0x4aa6d5['where']=_[_0xae37('0x61')](_0x4aa6d5[_0xae37('0x5f')],{'$or':_['map'](_0x464f8d,function(_0x3451ac){if(_0x3451ac[_0xae37('0x51')]!==_0xae37('0x62')){var _0x342805={};_0x342805[_0x3451ac['name']]={'$like':'%'+_0x738bd1['query']['filter']+'%'};return _0x342805;}})});}_0x4aa6d5=_['merge']({},_0x4aa6d5,_0x738bd1[_0xae37('0x63')]);var _0x3e4022={'where':_0x4aa6d5[_0xae37('0x5f')]};return db[_0xae37('0x54')][_0xae37('0x29')](_0x3e4022)[_0xae37('0x17')](function(_0x13b058){_0x3c24ce['count']=_0x13b058;if(_0x738bd1[_0xae37('0x57')][_0xae37('0x64')]){_0x4aa6d5['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xae37('0x65')](_0x4aa6d5);})[_0xae37('0x17')](function(_0x497809){_0x3c24ce[_0xae37('0x66')]=_0x497809;return _0x3c24ce;})[_0xae37('0x17')](respondWithFilteredResult(_0x3cef96,_0x4aa6d5))['catch'](handleError(_0x3cef96,null));};exports[_0xae37('0x67')]=function(_0x2078b5,_0x3a38f3){var _0x232090={'raw':![],'where':{'id':_0x2078b5[_0xae37('0x68')]['id']},'include':[{'model':db[_0xae37('0x53')],'as':_0xae37('0x69')}]},_0x4226ab={};_0x4226ab[_0xae37('0x4f')]=_[_0xae37('0x58')](db['ChatWebsite'][_0xae37('0x6a')]);_0x4226ab[_0xae37('0x57')]=_[_0xae37('0x58')](_0x2078b5[_0xae37('0x57')]);_0x4226ab[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x4226ab[_0xae37('0x4f')],_0x4226ab[_0xae37('0x57')]);_0x232090['attributes']=_[_0xae37('0x6b')](_0x4226ab['model'],qs[_0xae37('0x5b')](_0x2078b5[_0xae37('0x57')][_0xae37('0x5b')]));_0x232090[_0xae37('0x5a')]=_0x232090['attributes'][_0xae37('0x6c')]?_0x232090['attributes']:_0x4226ab[_0xae37('0x4f')];if(_0x2078b5[_0xae37('0x57')][_0xae37('0x64')]){_0x232090[_0xae37('0x6d')]=[{'all':!![]}];}_0x232090=_['merge']({},_0x232090,_0x2078b5[_0xae37('0x63')]);return db['ChatWebsite']['find'](_0x232090)[_0xae37('0x17')](handleEntityNotFound(_0x3a38f3,null))[_0xae37('0x17')](respondWithResult(_0x3a38f3,null))['catch'](handleError(_0x3a38f3,null));};exports[_0xae37('0x6e')]=function(_0x2462ae,_0x2ea4fe){return db[_0xae37('0x54')][_0xae37('0x6e')](_0x2462ae['body'],{})[_0xae37('0x17')](function(_0x3b32ea){var _0x25af62=_0x2462ae[_0xae37('0x6f')][_0xae37('0x2d')]({'plain':!![]});if(!_0x25af62)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25af62[_0xae37('0x70')]==='user'){var _0x571e26=_0x3b32ea[_0xae37('0x2d')]({'plain':!![]});var _0x49fc2d=_0xae37('0x71');return db[_0xae37('0x72')][_0xae37('0x73')]({'where':{'name':_0x49fc2d,'userProfileId':_0x25af62['userProfileId']},'raw':!![]})['then'](function(_0x158d79){if(_0x158d79&&_0x158d79[_0xae37('0x74')]===0x0){return db[_0xae37('0x2e')][_0xae37('0x6e')]({'name':_0x571e26[_0xae37('0x2f')],'resourceId':_0x571e26['id'],'type':_0x158d79['name'],'sectionId':_0x158d79['id']},{})[_0xae37('0x17')](function(){return _0x3b32ea;});}else{return _0x3b32ea;}})['catch'](function(_0x26d95a){logger[_0xae37('0x1b')](_0xae37('0x75'),_0x26d95a);throw _0x26d95a;});}return _0x3b32ea;})[_0xae37('0x17')](respondWithResult(_0x2ea4fe,0xc9))[_0xae37('0x21')](handleError(_0x2ea4fe,null));};exports[_0xae37('0x2b')]=function(_0x40a8d4,_0xbba271){if(_0x40a8d4[_0xae37('0x76')]['id']){delete _0x40a8d4[_0xae37('0x76')]['id'];}return db[_0xae37('0x54')]['find']({'where':{'id':_0x40a8d4[_0xae37('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0xae37('0x69')}]})[_0xae37('0x17')](handleEntityNotFound(_0xbba271,null))[_0xae37('0x17')](saveUpdates(_0x40a8d4[_0xae37('0x76')],null))['then'](respondWithResult(_0xbba271,null))[_0xae37('0x21')](handleError(_0xbba271,null));};exports[_0xae37('0x2c')]=function(_0x3404b6,_0x49e86d){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x3404b6[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x49e86d,null))[_0xae37('0x17')](removeEntity(_0x49e86d,null))[_0xae37('0x21')](handleError(_0x49e86d,null));};exports['describe']=function(_0xa6f321,_0x1c8b71){return db[_0xae37('0x54')][_0xae37('0x77')]()['then'](respondWithResult(_0x1c8b71,null))[_0xae37('0x21')](handleError(_0x1c8b71,null));};exports[_0xae37('0x78')]=function(_0x45fe97,_0x1e4a60){if(_0x45fe97[_0xae37('0x76')]['id']){delete _0x45fe97[_0xae37('0x76')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x45fe97[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x1e4a60,null))[_0xae37('0x17')](function(_0x2a4955){if(_0x2a4955){_0x45fe97[_0xae37('0x76')][_0xae37('0x79')]=_0x2a4955['id'];return db[_0xae37('0x7a')]['create'](_0x45fe97[_0xae37('0x76')]);}})[_0xae37('0x17')](respondWithResult(_0x1e4a60,null))['catch'](handleError(_0x1e4a60,null));};exports[_0xae37('0x7b')]=function(_0x1e8b2a,_0x82c671){var _0x564247={'raw':![],'where':{}};var _0x492582={};var _0x5734e7={'count':0x0,'rows':[]};return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x1e8b2a[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x82c671,null))[_0xae37('0x17')](function(_0x21c0a9){if(_0x21c0a9){_0x492582[_0xae37('0x4f')]=_['keys'](db[_0xae37('0x7a')][_0xae37('0x6a')]);_0x492582['query']=_['keys'](_0x1e8b2a[_0xae37('0x57')]);_0x492582[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x492582[_0xae37('0x4f')],_0x492582['query']);_0x564247[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x492582[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x5b')]));_0x564247[_0xae37('0x5a')]=_0x564247['attributes'][_0xae37('0x6c')]?_0x564247[_0xae37('0x5a')]:_0x492582[_0xae37('0x4f')];if(!_0x1e8b2a['query'][_0xae37('0x5c')](_0xae37('0x5d'))){_0x564247[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x28')]);_0x564247[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x1e8b2a['query'][_0xae37('0x26')]);}_0x564247[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7d')]);_0x564247['where']=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x1e8b2a[_0xae37('0x57')],_0x492582[_0xae37('0x59')]));_0x564247[_0xae37('0x5f')][_0xae37('0x79')]=_0x21c0a9['id'];if(_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7e')]){_0x564247[_0xae37('0x5f')]=_[_0xae37('0x61')](_0x564247[_0xae37('0x5f')],{'$or':_['map'](_0x564247[_0xae37('0x5a')],function(_0x1a3a7e){var _0xdb921={};_0xdb921[_0x1a3a7e]={'$like':'%'+_0x1e8b2a[_0xae37('0x57')][_0xae37('0x7e')]+'%'};return _0xdb921;})});}_0x564247=_['merge']({},_0x564247,_0x1e8b2a[_0xae37('0x63')]);return db[_0xae37('0x7a')][_0xae37('0x29')]({'where':_0x564247[_0xae37('0x5f')]})['then'](function(_0x4b4cc1){_0x5734e7[_0xae37('0x29')]=_0x4b4cc1;if(_0x1e8b2a[_0xae37('0x57')][_0xae37('0x64')]){_0x564247[_0xae37('0x6d')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x564247);})[_0xae37('0x17')](function(_0x3f6481){_0x5734e7[_0xae37('0x66')]=_0x3f6481;return _0x5734e7;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x82c671,_0x564247))[_0xae37('0x21')](handleError(_0x82c671,null));};exports[_0xae37('0x7f')]=function(_0x5554a8,_0x35a382){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x5554a8[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35a382,null))[_0xae37('0x17')](function(_0x2abceb){if(_0x2abceb){return _0x2abceb['removeDispositions'](_0x5554a8['query'][_0xae37('0x80')]);}})[_0xae37('0x17')](respondWithStatusCode(_0x35a382,null))[_0xae37('0x21')](handleError(_0x35a382,null));};exports[_0xae37('0x81')]=function(_0x44efa7,_0x458791){if(_0x44efa7['body']['id']){delete _0x44efa7[_0xae37('0x76')]['id'];}return db[_0xae37('0x54')]['find']({'where':{'id':_0x44efa7[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x458791,null))[_0xae37('0x17')](function(_0x88cedf){if(_0x88cedf){_0x44efa7[_0xae37('0x76')][_0xae37('0x79')]=_0x88cedf['id'];return db[_0xae37('0x82')][_0xae37('0x6e')](_0x44efa7[_0xae37('0x76')]);}})[_0xae37('0x17')](respondWithResult(_0x458791,null))['catch'](handleError(_0x458791,null));};exports['getAnswers']=function(_0x53b47e,_0x35a830){var _0x156dbc={'raw':![],'where':{}};var _0x1c8152={};var _0x4dc8de={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x53b47e[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35a830,null))['then'](function(_0x10b32c){if(_0x10b32c){_0x1c8152['model']=_[_0xae37('0x58')](db['CannedAnswer'][_0xae37('0x6a')]);_0x1c8152['query']=_[_0xae37('0x58')](_0x53b47e[_0xae37('0x57')]);_0x1c8152[_0xae37('0x59')]=_['intersection'](_0x1c8152[_0xae37('0x4f')],_0x1c8152[_0xae37('0x57')]);_0x156dbc['attributes']=_['intersection'](_0x1c8152['model'],qs[_0xae37('0x5b')](_0x53b47e['query'][_0xae37('0x5b')]));_0x156dbc[_0xae37('0x5a')]=_0x156dbc[_0xae37('0x5a')][_0xae37('0x6c')]?_0x156dbc['attributes']:_0x1c8152[_0xae37('0x4f')];if(!_0x53b47e['query']['hasOwnProperty'](_0xae37('0x5d'))){_0x156dbc[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x53b47e['query'][_0xae37('0x28')]);_0x156dbc[_0xae37('0x26')]=qs['offset'](_0x53b47e[_0xae37('0x57')]['offset']);}_0x156dbc['order']=qs[_0xae37('0x7d')](_0x53b47e['query'][_0xae37('0x7d')]);_0x156dbc[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x53b47e[_0xae37('0x57')],_0x1c8152[_0xae37('0x59')]));_0x156dbc['where'][_0xae37('0x79')]=_0x10b32c['id'];if(_0x53b47e['query'][_0xae37('0x7e')]){_0x156dbc[_0xae37('0x5f')]=_['merge'](_0x156dbc[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x156dbc[_0xae37('0x5a')],function(_0x857872){var _0xdcda3={};_0xdcda3[_0x857872]={'$like':'%'+_0x53b47e[_0xae37('0x57')]['filter']+'%'};return _0xdcda3;})});}_0x156dbc=_[_0xae37('0x61')]({},_0x156dbc,_0x53b47e[_0xae37('0x63')]);return db[_0xae37('0x82')][_0xae37('0x29')]({'where':_0x156dbc['where']})[_0xae37('0x17')](function(_0x516aaf){_0x4dc8de['count']=_0x516aaf;if(_0x53b47e[_0xae37('0x57')][_0xae37('0x64')]){_0x156dbc[_0xae37('0x6d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xae37('0x65')](_0x156dbc);})['then'](function(_0x583403){_0x4dc8de[_0xae37('0x66')]=_0x583403;return _0x4dc8de;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x35a830,_0x156dbc))['catch'](handleError(_0x35a830,null));};exports[_0xae37('0x83')]=function(_0x2fcceb,_0x279765){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x2fcceb[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x279765,null))[_0xae37('0x17')](function(_0x16d92d){if(_0x16d92d){return _0x16d92d['removeAnswers'](_0x2fcceb[_0xae37('0x57')]['ids']);}})[_0xae37('0x17')](respondWithStatusCode(_0x279765,null))[_0xae37('0x21')](handleError(_0x279765,null));};exports[_0xae37('0x84')]=function(_0x26056d,_0x5a11e1){_0x26056d[_0xae37('0x76')][_0xae37('0x85')]=_0x26056d[_0xae37('0x86')][_0xae37('0x87')];return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x26056d['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x5a11e1,null))['then'](saveUpdates(_0x26056d['body'],null))['then'](respondWithResult(_0x5a11e1,null))[_0xae37('0x21')](handleError(_0x5a11e1,null));};exports[_0xae37('0x88')]=function(_0x3fb3e8,_0x27acce){_0x3fb3e8[_0xae37('0x76')][_0xae37('0x89')]=_0x3fb3e8['file']['filename'];return db['ChatWebsite'][_0xae37('0x73')]({'where':{'id':_0x3fb3e8[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x27acce,null))['then'](saveUpdates(_0x3fb3e8[_0xae37('0x76')],null))[_0xae37('0x17')](respondWithResult(_0x27acce,null))[_0xae37('0x21')](handleError(_0x27acce,null));};exports[_0xae37('0x8a')]=function(_0x1c730b,_0x4a3c68){_0x1c730b[_0xae37('0x76')][_0xae37('0x8b')]=_0x1c730b['file']['filename'];return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x1c730b[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x4a3c68,null))[_0xae37('0x17')](saveUpdates(_0x1c730b[_0xae37('0x76')],null))[_0xae37('0x17')](respondWithResult(_0x4a3c68,null))[_0xae37('0x21')](handleError(_0x4a3c68,null));};exports['addSystemAvatar']=function(_0x1f4905,_0x45ec35){_0x1f4905[_0xae37('0x76')][_0xae37('0x8c')]=_0x1f4905[_0xae37('0x86')]['filename'];return db[_0xae37('0x54')]['find']({'where':{'id':_0x1f4905[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x45ec35,null))[_0xae37('0x17')](saveUpdates(_0x1f4905['body'],null))[_0xae37('0x17')](respondWithResult(_0x45ec35,null))['catch'](handleError(_0x45ec35,null));};exports[_0xae37('0x8d')]=function(_0x1e6633,_0x53ccdb){var _0x193f38=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x90'));var _0x5aabca={'where':{'id':_0x1e6633[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x85')],'raw':!![]};var _0x59bfcb=![];return require(_0xae37('0x91'))['getLicense']()['then'](function(_0x27d052){if(_0x27d052){_0x59bfcb=_0x27d052[_0xae37('0x92')];}})['then'](function(){return db['ChatWebsite'][_0xae37('0x73')](_0x5aabca);})[_0xae37('0x17')](handleEntityNotFound(_0x53ccdb,null))[_0xae37('0x17')](function(_0x13a185){if(_0x13a185){if(!_[_0xae37('0x93')](_0x13a185[_0xae37('0x85')])){if(fs[_0xae37('0x94')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/images/logos/',_0x13a185['sitepic']))&&_0x59bfcb){_0x193f38=path['join'](config['root'],'server/files/images/logos/',_0x13a185[_0xae37('0x85')]);}}return _0x53ccdb['download'](_0x193f38);}})['catch'](handleError(_0x53ccdb,null));};exports[_0xae37('0x95')]=function(_0x1552fa,_0x5d77a1){var _0x1e0d4e=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x96'));var _0x1000ef={'where':{'id':_0x1552fa[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x89')],'raw':!![]};return db[_0xae37('0x54')]['find'](_0x1000ef)['then'](handleEntityNotFound(_0x5d77a1,null))['then'](function(_0x1eec26){if(_0x1eec26){if(!_[_0xae37('0x93')](_0x1eec26[_0xae37('0x89')])){if(fs[_0xae37('0x94')](path['join'](config[_0xae37('0x8f')],_0xae37('0x97'),_0x1eec26[_0xae37('0x89')]))){_0x1e0d4e=path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/images/avatars/',_0x1eec26[_0xae37('0x89')]);}}return _0x5d77a1[_0xae37('0x98')](_0x1e0d4e);}})[_0xae37('0x21')](handleError(_0x5d77a1,null));};exports[_0xae37('0x99')]=function(_0xaa76c6,_0x1b38c1){var _0x3259e6=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x9a'));var _0x204431={'where':{'id':_0xaa76c6[_0xae37('0x68')]['id']},'attributes':['id','customerAvatar',_0xae37('0x9b')],'raw':!![]};return db['ChatWebsite'][_0xae37('0x73')](_0x204431)['then'](handleEntityNotFound(_0x1b38c1,null))['then'](function(_0x367542){if(_0x367542){if(!_[_0xae37('0x93')](_0x367542[_0xae37('0x8b')])){if(fs[_0xae37('0x94')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x97'),_0x367542[_0xae37('0x8b')]))&&_0x367542[_0xae37('0x9b')]){_0x3259e6=path[_0xae37('0x8e')](config[_0xae37('0x8f')],_0xae37('0x97'),_0x367542[_0xae37('0x8b')]);}}return _0x1b38c1[_0xae37('0x98')](_0x3259e6);}})[_0xae37('0x21')](handleError(_0x1b38c1,null));};exports[_0xae37('0x9c')]=function(_0x4244a2,_0x3fe905){var _0x239732=path['join'](config[_0xae37('0x8f')],'server/files/images/avatars/system_avatar.png');var _0x10b6e1={'where':{'id':_0x4244a2[_0xae37('0x68')]['id']},'attributes':['id',_0xae37('0x8c')],'raw':!![]};return db[_0xae37('0x54')][_0xae37('0x73')](_0x10b6e1)[_0xae37('0x17')](handleEntityNotFound(_0x3fe905,null))[_0xae37('0x17')](function(_0x21a6d0){if(_0x21a6d0){if(!_[_0xae37('0x93')](_0x21a6d0[_0xae37('0x8c')])){if(fs[_0xae37('0x94')](path['join'](config['root'],'server/files/images/avatars/',_0x21a6d0[_0xae37('0x8c')]))){_0x239732=path[_0xae37('0x8e')](config['root'],'server/files/images/avatars/',_0x21a6d0[_0xae37('0x8c')]);}}return _0x3fe905[_0xae37('0x98')](_0x239732);}})[_0xae37('0x21')](handleError(_0x3fe905,null));};exports[_0xae37('0x9d')]=function(_0x176cd5,_0x357a54){var _0x4f4fc5={'body':_0x176cd5['body'],'channel':'chat'};var _0x45b447=[];var _0x560bba=[];var _0x22b11f={};var _0xb15878=![];return db['CmContact'][_0xae37('0x77')]()[_0xae37('0x17')](function(_0x9be747){if(!_0x9be747){throw new db['Sequelize'][(_0xae37('0x9e'))]('no\x20available\x20attributes');}_0x45b447=_[_0xae37('0x9f')](_['keys'](_0x9be747),[_0xae37('0xa0'),_0xae37('0xa1')]);_0x560bba=_[_0xae37('0x9f')](_['keys'](_0x9be747),[_0xae37('0xa0'),_0xae37('0xa1'),_0xae37('0xa2'),_0xae37('0xa3')]);if(_0x176cd5['body']['id']){delete _0x176cd5[_0xae37('0x76')]['id'];}if(_[_0xae37('0x93')](_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')])){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xa6'));}if(_[_0xae37('0x93')](_0x176cd5['body'][_0xae37('0x76')])||_0x176cd5[_0xae37('0x76')][_0xae37('0x76')]===''){throw new db[(_0xae37('0xa5'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xae37('0x93')](_0x176cd5[_0xae37('0x76')][_0xae37('0xa7')])){throw new db['Sequelize'][(_0xae37('0x9e'))](_0xae37('0xa8')+_0x560bba);}if(!_[_0xae37('0xa9')](_0x560bba,_0x176cd5['body'][_0xae37('0xa7')])){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xaa')+_0x560bba);}_0x22b11f[_0x176cd5['body'][_0xae37('0xa7')]]=_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')];})[_0xae37('0x17')](function(){return db[_0xae37('0x54')]['find']({'where':{'id':_0x176cd5['params']['id']},'include':[{'model':db[_0xae37('0xab')],'as':_0xae37('0xac'),'include':[{'model':db[_0xae37('0xad')],'as':_0xae37('0xae'),'where':_0x22b11f,'limit':0x1,'order':[[_0xae37('0xa1'),_0xae37('0xaf')]]}]},{'model':db[_0xae37('0xb0')],'as':_0xae37('0xb1')},{'model':db[_0xae37('0x3c')],'as':'Interval','include':[{'model':db[_0xae37('0x3c')],'as':_0xae37('0x3d'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0xae37('0x17')](function(_0x5af5c7){if(!_0x5af5c7)throw new APINotFoundError(util[_0xae37('0x33')](_0xae37('0xb2'),_0x176cd5[_0xae37('0x68')]['id']));if(!_0x5af5c7[_0xae37('0x3c')]||!_0x5af5c7[_0xae37('0x3c')][_0xae37('0x3d')])return[_0x5af5c7,!![]];return[_0x5af5c7,checkWebsiteIntervals(_0x5af5c7)];})[_0xae37('0xb3')](function(_0x41ec26,_0x4c49c5){if(!_0x4c49c5)throw new APIOutOfIntervalError();if(!_0x41ec26[_0xae37('0xac')])return;_0x4f4fc5[_0xae37('0xb4')]=_0x41ec26;_0x4f4fc5[_0xae37('0xb5')]=_0x41ec26[_0xae37('0xac')];_0x4f4fc5[_0xae37('0xb6')]=_[_0xae37('0xb7')](_0x41ec26[_0xae37('0xb1')],['priority'],[_0xae37('0xb8')]);if(_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xb1')]){delete _0x4f4fc5[_0xae37('0xb4')]['Applications'];}if(_0x4f4fc5['account'][_0xae37('0xac')]&&_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xac')][_0xae37('0xae')][_0xae37('0x6c')]){return _0x4f4fc5[_0xae37('0xb4')][_0xae37('0xac')][_0xae37('0xae')][0x0];}var _0x5255b7=_['defaults'](_0x176cd5[_0xae37('0x76')],{'firstName':_0x176cd5[_0xae37('0x76')]['from'],'ListId':_0x41ec26[_0xae37('0xa3')]});_0x5255b7[_0x176cd5[_0xae37('0x76')][_0xae37('0xa7')]]=_0x176cd5[_0xae37('0x76')][_0xae37('0xa4')];return db[_0xae37('0xad')][_0xae37('0x6e')](_0x5255b7,{'fields':_0x45b447,'raw':!![]});})[_0xae37('0x17')](function(_0x1d0a6d){_0x4f4fc5[_0xae37('0xb9')]=_0x1d0a6d;var _0x23a11a=createInteractionObject(_0x176cd5[_0xae37('0x68')]['id'],_0x176cd5[_0xae37('0x76')],_0x176cd5['headers'],_0x1d0a6d);var _0x48a4a9={'ChatWebsiteId':_0x176cd5[_0xae37('0x68')]['id'],'closed':![]};if(_0x176cd5[_0xae37('0x76')][_0xae37('0xba')]){_0x48a4a9[_0xae37('0xba')]=_0x176cd5[_0xae37('0x76')]['threadId'];return db['ChatInteraction'][_0xae37('0x73')]({'where':_0x48a4a9})[_0xae37('0x17')](function(_0x4c97c6){if(_0x4c97c6){_0xb15878=!![];return _0x4c97c6;}_0x23a11a[_0xae37('0xba')]=_0x176cd5['body'][_0xae37('0xba')];_0x23a11a[_0xae37('0xbb')]=_0x176cd5[_0xae37('0x76')][_0xae37('0xbb')];return db[_0xae37('0xbc')]['create'](_0x23a11a);});}_0x48a4a9['ContactId']=_0x1d0a6d['id'];if(_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]&&_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]['id']){_0x48a4a9['id']=_0x176cd5[_0xae37('0x76')][_0xae37('0xbd')]['id'];return db[_0xae37('0xbc')][_0xae37('0x73')]({'where':_0x48a4a9})[_0xae37('0x17')](function(_0x430ab5){if(_0x430ab5){_0xb15878=!![];return _0x430ab5;}return db['ChatInteraction'][_0xae37('0x6e')](_0x23a11a);});}return db[_0xae37('0xbc')]['create'](_0x23a11a);})['then'](function(_0xbc07e){if(!_0xb15878)return _0xbc07e;var _0x48d7a6={'from':(_0x4f4fc5[_0xae37('0xb9')][_0xae37('0xbe')]||'')+'\x20'+(_0x4f4fc5[_0xae37('0xb9')][_0xae37('0xbf')]||'')};if(_0x176cd5[_0xae37('0x76')]['threadId']&&_0x176cd5['body'][_0xae37('0xc0')]&&_0x176cd5[_0xae37('0x76')][_0xae37('0xba')]!=_0x176cd5[_0xae37('0x76')][_0xae37('0xc0')]){_0x48d7a6[_0xae37('0xba')]=_0x176cd5[_0xae37('0x76')][_0xae37('0xc0')];}return _0xbc07e['update'](_0x48d7a6);})[_0xae37('0x17')](function(_0x247f97){_0x4f4fc5[_0xae37('0xbd')]=_0x247f97[_0xae37('0x2d')]({'plain':!![]});_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc1')]=!_0xb15878;if(_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc1')]){if(_0x4f4fc5[_0xae37('0xb4')]['autoclose']){_0x4f4fc5['applications'][_0xae37('0xc2')]({'id':0x0,'priority':_0x4f4fc5[_0xae37('0xb6')]['length']+0x1,'app':_0xae37('0xc3'),'appdata':_0xae37('0xc4'),'interval':_0xae37('0xc5')});}}return db[_0xae37('0xc6')][_0xae37('0x6e')]({'body':_0x176cd5[_0xae37('0x76')][_0xae37('0x76')],'ChatWebsiteId':_0x176cd5[_0xae37('0x68')]['id'],'ChatInteractionId':_0x247f97['id'],'direction':'in','ContactId':_0x4f4fc5['contact']['id'],'AttachmentId':_0x176cd5[_0xae37('0x76')][_0xae37('0xc7')]});})[_0xae37('0x17')](function(_0x11bc00){_0x4f4fc5['message']=_0x11bc00;if(!_0x4f4fc5[_0xae37('0xbd')]['UserId']){return;}return db[_0xae37('0xc8')]['find']({'attributes':['id',_0xae37('0x2f')],'where':{'id':_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xc9')]}});})[_0xae37('0x17')](function(_0x28b90d){if(_0x28b90d){_0x4f4fc5[_0xae37('0xb6')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x28b90d['name']+','+(_0x4f4fc5['account'][_0xae37('0xca')]||0xa),'interval':_0xae37('0xc5')});_0x4f4fc5[_0xae37('0xcb')]=!![];}if(!_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xcc')]){return;}return db[_0xae37('0xcd')][_0xae37('0x73')]({'attributes':['id',_0xae37('0x2f')],'where':{'id':_0x4f4fc5[_0xae37('0xbd')][_0xae37('0xcc')]}});})[_0xae37('0x17')](function(_0x158620){if(_0x158620){_0x4f4fc5[_0xae37('0xb6')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x158620['name']+','+(_0x4f4fc5[_0xae37('0xb4')][_0xae37('0xce')]||0x12c),'interval':_0xae37('0xc5')});}return respondWithRpcPromise(_0xae37('0xcf'),_0xae37('0xd0'),_0x4f4fc5);})[_0xae37('0x17')](function(_0x47941c){respondWithRpcPromise(_0xae37('0xd1'),_0xae37('0xd1'),{'event':'notify','message':_0x47941c},client9002);return _0x47941c;})['then'](respondWithResult(_0x357a54,null))[_0xae37('0x21')](APIHandleError(_0x357a54));};exports[_0xae37('0xd2')]=function(_0xf15b4f,_0x11908a){var _0x48b229,_0x378f3f,_0x2234f1;var _0x55bf3c=[];var _0x20fc4e={};var _0xcd61e6=_0xf15b4f[_0xae37('0xd3')]||[];var _0x1a692c=[];var _0x3b1111;return db[_0xae37('0xad')][_0xae37('0x77')]()['then'](function(_0x19615f){if(!_0x19615f){throw new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))]('no\x20available\x20attributes');}_0x55bf3c=_[_0xae37('0x9f')](_['keys'](_0x19615f),['createdAt',_0xae37('0xa1'),'CompanyId',_0xae37('0xa3')]);if(_0xf15b4f['body']['id']){delete _0xf15b4f['body']['id'];}if(_[_0xae37('0x93')](_0xf15b4f[_0xae37('0x76')]['from'])){throw _0x11908a[_0xae37('0x23')](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))]['ValidationError'](_0xae37('0xa6')));}if(_[_0xae37('0x93')](_0xf15b4f['body'][_0xae37('0x76')])||_0xf15b4f['body']['body']===''){throw _0x11908a[_0xae37('0x23')](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xd4')));}if(_[_0xae37('0x93')](_0xf15b4f['body'][_0xae37('0xd5')])){throw _0x11908a[_0xae37('0x23')](0x1f4)['send'](new db[(_0xae37('0xa5'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55bf3c));}if(!_[_0xae37('0xa9')](_0x55bf3c,_0xf15b4f['body'][_0xae37('0xd5')])){throw _0x11908a['status'](0x1f4)[_0xae37('0x30')](new db[(_0xae37('0xa5'))][(_0xae37('0x9e'))](_0xae37('0xd6')+_0x55bf3c));}_0x20fc4e[_0xf15b4f[_0xae37('0x76')][_0xae37('0xd5')]]=_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')];})['then'](function(){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0xf15b4f[_0xae37('0x68')]['id']},'include':[{'model':db[_0xae37('0xab')],'as':_0xae37('0xac')},{'model':db[_0xae37('0xd7')],'as':_0xae37('0xd7')}]});})[_0xae37('0x17')](handleEntityNotFound(_0x11908a,null))[_0xae37('0x17')](function(_0x256cae){if(_0x256cae&&_0x256cae[_0xae37('0xac')]){_0x378f3f=_0x256cae;var _0x68731a=_[_0xae37('0xf')](_0xf15b4f['body'],{'firstName':_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')],'phone':_0xf15b4f[_0xae37('0x76')][_0xae37('0xa4')],'ListId':_0x256cae['ListId']});_0x68731a[_0xf15b4f[_0xae37('0x76')][_0xae37('0xd5')]]=_0xf15b4f['body'][_0xae37('0xa4')];return db[_0xae37('0xad')][_0xae37('0xd8')]({'where':_0x20fc4e,'defaults':_0x68731a});}})[_0xae37('0xb3')](function(_0x426e25){if(_0x426e25){_0x2234f1=_0x426e25;var _0x33e481=fs['readFileSync'](path[_0xae37('0x8e')](config['root'],_0xae37('0xd9')),'utf8');var _0x5115a4=ejs[_0xae37('0xda')](_0x33e481,{'body':_['toPairs'](_0xf15b4f['body'][_0xae37('0x76')]),'bodyTitle':_0x378f3f[_0xae37('0xdb')]});return db[_0xae37('0xdc')][_0xae37('0x6e')]({'body':_0x5115a4,'plainBody':htmlToText[_0xae37('0xdd')](_0x5115a4),'ContactId':_0x426e25['id'],'ChatWebsiteId':_0x378f3f['id']});}})[_0xae37('0x17')](function(_0x58056c){_0x3b1111=_0x58056c;if(_0xcd61e6[_0xae37('0x6c')]){var _0x563928=_0xcd61e6['map'](function(_0x5e08e1){return{'name':_0x5e08e1[_0xae37('0xde')],'basename':_0x5e08e1['filename'],'type':_0x5e08e1[_0xae37('0xdf')],'ChatOfflineMessageId':_0x58056c['id']};});_0x1a692c=_0x563928[_0xae37('0x3b')](_0x3c87b9=>{var _0x2bf0f4={'filename':_0x3c87b9[_0xae37('0x2f')],'path':path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server','files','attachments',_0xae37('0xe0'),_0x3c87b9[_0xae37('0xe1')])};return _0x2bf0f4;});if(!_0x378f3f[_0xae37('0xe2')]){return db[_0xae37('0xe3')][_0xae37('0xe4')](function(_0x332370){return db['Attachment'][_0xae37('0xe5')](_0x563928,{'transaction':_0x332370});});}}})['then'](function(){if(_0x3b1111){_0x48b229=_0x3b1111;return db[_0xae37('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xae37('0xe6')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xae37('0xe7')],'as':_0xae37('0xe7'),'raw':!![]}]}]});}})[_0xae37('0x17')](function(_0x1a02a8){if(_0x1a02a8&&_0x1a02a8['Smtp']&&_0x378f3f[_0xae37('0xe8')]&&_0x378f3f[_0xae37('0xe9')]){var _0x4184b4=_0x1a02a8[_0xae37('0xea')]();return respondWithRpcPromise(_0xae37('0xeb'),'sendMail',{'account':_0x4184b4,'message':{'from':util['format'](_0xae37('0xec'),_0x1a02a8[_0xae37('0x2f')],_0x1a02a8[_0xae37('0xed')]||_0x1a02a8['Smtp'][_0xae37('0x6f')]),'to':_0x378f3f[_0xae37('0xe9')],'subject':_0x378f3f[_0xae37('0xee')],'html':_0x48b229[_0xae37('0x76')],'attachments':_0x1a692c}},client9003)[_0xae37('0x17')](function(){return _0x48b229;})[_0xae37('0x21')](function(_0x25a3f8){logger[_0xae37('0x1b')](_0x25a3f8);});}})[_0xae37('0x17')](function(){if(_0x378f3f&&_0x378f3f[_0xae37('0xe2')]&&_0x378f3f[_0xae37('0xef')]){var _0x21d848=[];if(_0xcd61e6[_0xae37('0x6c')]){_0x21d848=_0xcd61e6[_0xae37('0x3b')](function(_0x181e36){return{'name':_0x181e36['originalname'],'basename':_0x181e36[_0xae37('0x87')],'type':_0x181e36['mimetype'],'ChatOfflineMessageId':_0x3b1111['id']};});}var _0x15698a;if(!_[_0xae37('0x93')](_0x378f3f['subjectOffline'])){var _0x15373e=_[_0xae37('0x3b')](_0xf15b4f['body'],function(_0x1a2467){return _0x1a2467;});var _0x662677=_[_0xae37('0xf0')](_0x15373e)[0x0];var _0x2bb2ec=_[_0xae37('0xf1')](_0x662677,function(_0x5603ad){return _0x5603ad;});_0x15698a=_0x2bb2ec[0x1][_0x378f3f[_0xae37('0xf2')]];}var _0x212e5f={'from':_0x2234f1['email'],'firstName':_0x2234f1[_0xae37('0xbe')],'lastName':_0x2234f1[_0xae37('0xbf')],'mapKey':_0xae37('0xed'),'message':{'from':_0x2234f1[_0xae37('0xed')],'to':_0x378f3f[_0xae37('0xd7')]['email'],'cc':'','subject':_['isNil'](_0x15698a)?_0x378f3f[_0xae37('0xee')]:_0x15698a,'messageId':'','sentAt':new Date(),'attach':_0x21d848[_0xae37('0x6c')],'attachments':_0x21d848,'originChannel':'Chat','ChatWebsiteId':_0x378f3f['id'],'ChatOfflineMessageId':_0x48b229['id'],'originTo':_0x378f3f['MailAccount'][_0xae37('0xed')]},'body':_0x48b229[_0xae37('0x76')]};var _0x2d04b6={'account':{'id':_0x378f3f[_0xae37('0xef')]},'body':_0x212e5f,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xae37('0xf3'),_0xae37('0xf4'),_0x2d04b6,client9001)[_0xae37('0x17')](function(){return _0x48b229;})[_0xae37('0x21')](function(_0x45b49f){logger[_0xae37('0x1b')](_0x45b49f);});}return;})[_0xae37('0x17')](function(){if(_0x48b229){return _0x48b229;}})[_0xae37('0x17')](respondWithResult(_0x11908a,null))[_0xae37('0x21')](function(){for(var _0x10b636 of _0xcd61e6){var _0xbdf25d=path['join'](config[_0xae37('0x8f')],_0xae37('0xf5'),'files','attachments',_0xae37('0xe0'),_0x10b636['filename']);fs_extra['remove'](_0xbdf25d)[_0xae37('0x21')](function(_0x3ff06a){logger[_0xae37('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0xbdf25d,_0x3ff06a);});}});};exports[_0xae37('0xf6')]=function(_0x3d3dae,_0x35288e){return db[_0xae37('0xbc')][_0xae37('0x73')]({'where':{'id':_0x3d3dae['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x35288e,null))[_0xae37('0x17')](function(_0x19c6d4){if(_0x19c6d4){return _0x19c6d4[_0xae37('0xf6')](_0x3d3dae['body'][_0xae37('0x80')],_[_0xae37('0xf7')](_0x3d3dae[_0xae37('0x76')],['ids','id'])||{});}})['then'](respondWithResult(_0x35288e,null))[_0xae37('0x21')](handleError(_0x35288e,null));};exports['getInteractions']=function(_0x5997dc,_0x3903db){var _0x504800={'raw':![],'where':{}};var _0x3cdc8e={};var _0x1f0139={'count':0x0,'rows':[]};return db[_0xae37('0x54')]['findOne']({'where':{'id':_0x5997dc[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0x3903db,null))[_0xae37('0x17')](function(_0x30ce42){if(_0x30ce42){_0x3cdc8e[_0xae37('0x4f')]=_['keys'](db[_0xae37('0xbc')][_0xae37('0x6a')]);_0x3cdc8e['query']=_[_0xae37('0x58')](_0x5997dc[_0xae37('0x57')]);_0x3cdc8e[_0xae37('0x59')]=_['intersection'](_0x3cdc8e[_0xae37('0x4f')],_0x3cdc8e[_0xae37('0x57')]);_0x504800[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x3cdc8e[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x5997dc['query'][_0xae37('0x5b')]));_0x504800[_0xae37('0x5a')]=_0x504800[_0xae37('0x5a')][_0xae37('0x6c')]?_0x504800['attributes']:_0x3cdc8e['model'];if(!_0x5997dc[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x504800[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x5997dc[_0xae37('0x57')][_0xae37('0x28')]);_0x504800[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x5997dc[_0xae37('0x57')][_0xae37('0x26')]);}_0x504800[_0xae37('0x5e')]=qs['sort'](_0x5997dc[_0xae37('0x57')][_0xae37('0x7d')]);_0x504800[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x5997dc['query'],_0x3cdc8e['filters']));_0x504800[_0xae37('0x5f')][_0xae37('0x79')]=_0x30ce42['id'];if(_0x5997dc[_0xae37('0x57')][_0xae37('0x7e')]){_0x504800['where']=_[_0xae37('0x61')](_0x504800['where'],{'$or':_[_0xae37('0x3b')](_0x504800[_0xae37('0x5a')],function(_0x24bd9d){var _0x1b76f4={};_0x1b76f4[_0x24bd9d]={'$like':'%'+_0x5997dc['query']['filter']+'%'};return _0x1b76f4;})});}_0x504800=_[_0xae37('0x61')]({},_0x504800,_0x5997dc['options']);return db['ChatInteraction'][_0xae37('0x29')]({'where':_0x504800[_0xae37('0x5f')]})['then'](function(_0x48a36f){_0x1f0139[_0xae37('0x29')]=_0x48a36f;if(_0x5997dc[_0xae37('0x57')]['includeAll']){_0x504800[_0xae37('0x6d')]=[{'model':db[_0xae37('0xad')],'as':_0xae37('0xf8'),'required':![]},{'model':db[_0xae37('0xc8')],'as':_0xae37('0xf9'),'attributes':['name',_0xae37('0xfa'),'internal'],'required':![]},{'model':db[_0xae37('0xfb')],'as':_0xae37('0xfc'),'attributes':['id',_0xae37('0x2f'),_0xae37('0xfd')],'where':_0x5997dc['query'][_0xae37('0xfe')]?{'id':_0x5997dc[_0xae37('0x57')][_0xae37('0xfe')]}:undefined,'required':_0x5997dc[_0xae37('0x57')][_0xae37('0xfe')]?!![]:![]}];}return db[_0xae37('0xbc')]['findAll'](_0x504800);})[_0xae37('0x17')](function(_0xd42d1d){_0x1f0139[_0xae37('0x66')]=_0xd42d1d;return _0x1f0139;});}})[_0xae37('0x17')](respondWithFilteredResult(_0x3903db,_0x504800))[_0xae37('0x21')](handleError(_0x3903db,null));};exports[_0xae37('0xff')]=function(_0x4bc63b,_0x303460){var _0xa71229=0x0;var _0x4fcf33=0x0;var _0x12c314=![];var _0x1dd219;var _0x238b4d;return db['ChatWebsite']['find']({'where':{'id':_0x4bc63b['params']['id']},'include':[{'model':db['Interval'],'as':_0xae37('0x3c'),'include':[{'model':db[_0xae37('0x3c')],'as':_0xae37('0x3d'),'attributes':['id','interval']}]}]})[_0xae37('0x17')](handleEntityNotFound(_0x303460,null))[_0xae37('0x17')](function(_0x1ce492){if(_0x1ce492){_0x1dd219=_0x1ce492;return _0x1ce492[_0xae37('0x100')]({'raw':!![]});}})[_0xae37('0x17')](function(_0x509a46){if(_0x1dd219){if(_0x509a46){_0x238b4d=_0x509a46;}}return require(_0xae37('0x91'))[_0xae37('0x101')]();})[_0xae37('0x17')](function(_0x463c86){if(_0x463c86){_0x4fcf33=_0x463c86['virtual'];_0x12c314=_0x463c86[_0xae37('0x92')];}})[_0xae37('0x17')](function(){return db[_0xae37('0xbc')][_0xae37('0x29')]({'where':{'closed':![]}});})[_0xae37('0x17')](function(_0x7c85bc){_0xa71229=_0x7c85bc;if(_0x4fcf33&&_0x7c85bc>_0x4fcf33){return db[_0xae37('0x102')][_0xae37('0x7c')]({'where':{'id':0x1}})[_0xae37('0x17')](function(_0x325662){if(_0x325662){_0x325662['increment']('chatLicenseExceeded');}});}})[_0xae37('0x17')](function(){if(!_0x1dd219['Interval']||!_0x1dd219[_0xae37('0x3c')][_0xae37('0x3d')])return!![];return checkWebsiteIntervals(_0x1dd219);})['then'](function(_0x49a366){var _0x591c06=fs[_0xae37('0x103')](path[_0xae37('0x8e')](config[_0xae37('0x8f')],'server/files/chat/iframe.ejs'),_0xae37('0x104'));var _0x46c840=new url[(_0xae37('0x105'))](_0x1dd219[_0xae37('0x106')])[_0xae37('0x107')];var _0x4e48ac='3.5.0';var _0x2ed891=![];var _0x32ea88={'chatVersion':_0x4e48ac,'chatWebsiteAddressOrigin':_0x46c840,'remote':_0x1dd219[_0xae37('0x108')],'query':querystring[_0xae37('0x1a')](_[_0xae37('0x61')](_0x1dd219[_0xae37('0x2d')]({'plain':!![]}),{'customerIp':_0x4bc63b[_0xae37('0x109')][_0xae37('0x45')]||_0x4bc63b[_0xae37('0x109')][_0xae37('0x10a')]||_0x4bc63b[_0xae37('0x10b')][_0xae37('0x10c')]||_0x4bc63b['ip'],'referer':_0x4bc63b[_0xae37('0x109')][_0xae37('0x49')],'openedInteractions':_0xa71229,'maxInteractions':_0x4fcf33,'virtual':_0x12c314[_0xae37('0x10d')],'online':_0x49a366,'custom':_0x12c314}))['replace'](/'/g,'\x5c\x27')};_0x303460[_0xae37('0x30')](ejs[_0xae37('0xda')](Mustache['render'](_0x591c06,_0x32ea88),{'proactiveActions':_0x238b4d,'alignment':_0x1dd219[_0xae37('0x10e')],'verticalAlignment':_0x1dd219['verticalAlignment'],'div_color':_0x1dd219['color'],'labelText':_0x1dd219[_0xae37('0x10f')],'text_color':_0x1dd219[_0xae37('0x110')],'text_button_color':_0x1dd219['textButtonColor'],'button_color':_0x1dd219['color_button'],'background_color':_0x1dd219['backgroundColor'],'hideWhenOffline':_0x1dd219[_0xae37('0x111')],'intervalId':_0x1dd219[_0xae37('0x112')],'isDevelopment':_0x2ed891,'chatVersion':_0x4e48ac}));})[_0xae37('0x21')](handleError(_0x303460,null));};exports['addApplications']=function(_0x2607a0,_0x7377f9){var _0x35fe4d=_0x2607a0['params']['id'];var _0x4fbe06=_0x2607a0[_0xae37('0x76')];var _0x407501=0xc8;var _0x95edaf=null;return db[_0xae37('0xe3')][_0xae37('0xe4')]({'isolationLevel':db[_0xae37('0xe3')]['Transaction'][_0xae37('0x113')][_0xae37('0x114')]},function(_0xc9569d){return db[_0xae37('0x54')]['findOne']({'where':{'id':_0x35fe4d},'transaction':_0xc9569d})[_0xae37('0x17')](function(_0x3c536a){if(_0x3c536a){return db[_0xae37('0xb0')][_0xae37('0x2c')]({'where':{'ChatWebsiteId':_0x35fe4d},'transaction':_0xc9569d})[_0xae37('0x17')](function(){var _0x3bae48=_[_0xae37('0x3b')](_0x4fbe06,function(_0x56a951){_0x56a951['ChatWebsiteId']=_0x35fe4d;return _0x56a951;});return db['ChatApplication'][_0xae37('0xe5')](_0x3bae48,{'transaction':_0xc9569d});});}else{_0x407501=0x194;_0x95edaf=[];}});})[_0xae37('0x17')](function(){if(_0x407501!==0x194){return db['ChatApplication'][_0xae37('0x115')]({'where':{'ChatWebsiteId':_0x35fe4d},'order':_0xae37('0x116')})['then'](function(_0x23000b){_0x95edaf=_0x23000b;});}})[_0xae37('0x21')](function(_0x5ca98d){_0x407501=0x1f4;logger['error'](_0x5ca98d['stack']);if(_0x5ca98d[_0xae37('0x2f')]){delete _0x5ca98d[_0xae37('0x2f')];}_0x95edaf=_0x5ca98d;})[_0xae37('0x117')](function(){if(_0x95edaf===null){_0x7377f9['sendStatus'](_0x407501);}else{if(_0x407501===0x1f4){_0x7377f9[_0xae37('0x23')](_0x407501)[_0xae37('0x30')](_0x95edaf);}else{_0x7377f9[_0xae37('0x23')](_0x407501)['json'](_0x95edaf);}}});};exports[_0xae37('0x118')]=function(_0x4afffc,_0x2ad93b){var _0x359b49={};var _0x14129f={};var _0x5e76bf;var _0x1718b5;return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x4afffc[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0x2ad93b,null))[_0xae37('0x17')](function(_0xcc1ab1){if(_0xcc1ab1){_0x5e76bf=_0xcc1ab1;_0x14129f[_0xae37('0x4f')]=_['keys'](db[_0xae37('0xb0')][_0xae37('0x6a')]);_0x14129f[_0xae37('0x57')]=_[_0xae37('0x58')](_0x4afffc['query']);_0x14129f['filters']=_['intersection'](_0x14129f['model'],_0x14129f[_0xae37('0x57')]);_0x359b49['attributes']=_[_0xae37('0x6b')](_0x14129f['model'],qs[_0xae37('0x5b')](_0x4afffc[_0xae37('0x57')][_0xae37('0x5b')]));_0x359b49[_0xae37('0x5a')]=_0x359b49[_0xae37('0x5a')]['length']?_0x359b49[_0xae37('0x5a')]:_0x14129f[_0xae37('0x4f')];_0x359b49[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x4afffc[_0xae37('0x57')][_0xae37('0x7d')]);_0x359b49[_0xae37('0x5f')]=qs['filters'](_[_0xae37('0x60')](_0x4afffc['query'],_0x14129f[_0xae37('0x59')]));if(_0x4afffc['query']['filter']){_0x359b49[_0xae37('0x5f')]=_['merge'](_0x359b49[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x359b49[_0xae37('0x5a')],function(_0x46e098){var _0x49ab72={};_0x49ab72[_0x46e098]={'$like':'%'+_0x4afffc[_0xae37('0x57')]['filter']+'%'};return _0x49ab72;})});}_0x359b49=_[_0xae37('0x61')]({},_0x359b49,_0x4afffc[_0xae37('0x63')]);return _0x5e76bf[_0xae37('0x118')](_0x359b49);}})[_0xae37('0x17')](function(_0x2f22ac){if(_0x2f22ac){_0x1718b5=_0x2f22ac[_0xae37('0x6c')];if(!_0x4afffc[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x359b49[_0xae37('0x28')]=qs[_0xae37('0x28')](_0x4afffc[_0xae37('0x57')][_0xae37('0x28')]);_0x359b49[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x4afffc[_0xae37('0x57')][_0xae37('0x26')]);}return _0x5e76bf[_0xae37('0x118')](_0x359b49);}})[_0xae37('0x17')](function(_0x322025){if(_0x322025){return _0x322025?{'count':_0x1718b5,'rows':_0x322025}:null;}})[_0xae37('0x17')](respondWithResult(_0x2ad93b,null))[_0xae37('0x21')](handleError(_0x2ad93b,null));};exports['addProactiveActions']=function(_0x3191a6,_0x131758){return db[_0xae37('0x119')][_0xae37('0x73')]({'where':{'id':_0x3191a6[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x131758,null))[_0xae37('0x17')](function(_0x4bfad5){if(_0x4bfad5){return _0x4bfad5['addProactiveActions'](_0x3191a6[_0xae37('0x76')][_0xae37('0x80')],_['omit'](_0x3191a6[_0xae37('0x76')],[_0xae37('0x80'),'id'])||{});}})[_0xae37('0x17')](respondWithResult(_0x131758,null))[_0xae37('0x21')](handleError(_0x131758,null));};exports[_0xae37('0x100')]=function(_0xa7d796,_0x135061){var _0x4d8640={};var _0x33de9f={};var _0x1c985a;var _0x2a5464;return db[_0xae37('0x54')]['findOne']({'where':{'id':_0xa7d796['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x135061,null))[_0xae37('0x17')](function(_0x34f96d){if(_0x34f96d){_0x1c985a=_0x34f96d;_0x33de9f[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0x11a')][_0xae37('0x6a')]);_0x33de9f[_0xae37('0x57')]=_[_0xae37('0x58')](_0xa7d796[_0xae37('0x57')]);_0x33de9f[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x33de9f[_0xae37('0x4f')],_0x33de9f[_0xae37('0x57')]);_0x4d8640[_0xae37('0x5a')]=_['intersection'](_0x33de9f['model'],qs[_0xae37('0x5b')](_0xa7d796[_0xae37('0x57')]['fields']));_0x4d8640['attributes']=_0x4d8640[_0xae37('0x5a')][_0xae37('0x6c')]?_0x4d8640['attributes']:_0x33de9f['model'];_0x4d8640['order']=qs[_0xae37('0x7d')](_0xa7d796[_0xae37('0x57')][_0xae37('0x7d')]);_0x4d8640[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0xa7d796[_0xae37('0x57')],_0x33de9f[_0xae37('0x59')]));if(_0xa7d796[_0xae37('0x57')]['filter']){_0x4d8640['where']=_[_0xae37('0x61')](_0x4d8640[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x4d8640[_0xae37('0x5a')],function(_0x3299ec){var _0xb2faf3={};_0xb2faf3[_0x3299ec]={'$like':'%'+_0xa7d796['query'][_0xae37('0x7e')]+'%'};return _0xb2faf3;})});}_0x4d8640=_[_0xae37('0x61')]({},_0x4d8640,_0xa7d796['options']);return _0x1c985a[_0xae37('0x100')](_0x4d8640);}})['then'](function(_0x5b7900){if(_0x5b7900){_0x2a5464=_0x5b7900['length'];if(!_0xa7d796[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x4d8640[_0xae37('0x28')]=qs[_0xae37('0x28')](_0xa7d796['query'][_0xae37('0x28')]);_0x4d8640[_0xae37('0x26')]=qs['offset'](_0xa7d796[_0xae37('0x57')][_0xae37('0x26')]);}return _0x1c985a[_0xae37('0x100')](_0x4d8640);}})[_0xae37('0x17')](function(_0xa68616){if(_0xa68616){return _0xa68616?{'count':_0x2a5464,'rows':_0xa68616}:null;}})['then'](respondWithResult(_0x135061,null))['catch'](handleError(_0x135061,null));};exports[_0xae37('0x11b')]=function(_0x3512ad,_0x3e0a74){var _0x25955f=_0x3512ad[_0xae37('0x57')][_0xae37('0x11c')]==='false'?_0xae37('0x11d'):'onlineForm';return db[_0xae37('0x54')][_0xae37('0x73')]({'attributes':['id',_0x25955f],'where':{'id':_0x3512ad['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x3e0a74,null))[_0xae37('0x17')](function(_0x5ad4f1){if(_0x5ad4f1){var _0x14728c=_0x5ad4f1[_0x25955f];var _0x36ff36=_0x14728c&&_0x14728c[_0xae37('0x11e')]?_0x14728c[_0xae37('0x11e')]:[];_0x3e0a74[_0xae37('0x30')]({'fromKey':_['isNil'](_0x14728c['fromKey'])?undefined:_0x14728c['fromKey'],'count':_0x36ff36['length'],'rows':_0x36ff36});}})[_0xae37('0x21')](handleError(_0x3e0a74,null));};exports[_0xae37('0x11f')]=function(_0x5e536a,_0xa8362d){var _0x44eaa4={'raw':![],'where':{}};var _0x33212d={};var _0x471d52={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xae37('0x7c')]({'where':{'id':_0x5e536a[_0xae37('0x68')]['id']}})['then'](handleEntityNotFound(_0xa8362d,null))[_0xae37('0x17')](function(_0x3606f9){if(_0x3606f9){_0x33212d[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0xdc')]['rawAttributes']);_0x33212d['query']=_['keys'](_0x5e536a[_0xae37('0x57')]);_0x33212d[_0xae37('0x59')]=_[_0xae37('0x6b')](_0x33212d[_0xae37('0x4f')],_0x33212d[_0xae37('0x57')]);_0x44eaa4[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x33212d['model'],qs[_0xae37('0x5b')](_0x5e536a[_0xae37('0x57')][_0xae37('0x5b')]));_0x44eaa4[_0xae37('0x5a')]=_0x44eaa4[_0xae37('0x5a')][_0xae37('0x6c')]?_0x44eaa4[_0xae37('0x5a')]:_0x33212d[_0xae37('0x4f')];if(!_0x5e536a[_0xae37('0x57')][_0xae37('0x5c')](_0xae37('0x5d'))){_0x44eaa4[_0xae37('0x28')]=qs['limit'](_0x5e536a['query'][_0xae37('0x28')]);_0x44eaa4[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x5e536a[_0xae37('0x57')][_0xae37('0x26')]);}_0x44eaa4[_0xae37('0x5e')]=qs['sort'](_0x5e536a[_0xae37('0x57')][_0xae37('0x7d')]);_0x44eaa4[_0xae37('0x5f')]=qs[_0xae37('0x59')](_[_0xae37('0x60')](_0x5e536a[_0xae37('0x57')],_0x33212d[_0xae37('0x59')]));_0x44eaa4['where'][_0xae37('0x79')]=_0x3606f9['id'];if(_0x5e536a['query']['filter']){_0x44eaa4[_0xae37('0x5f')]=_['merge'](_0x44eaa4[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x44eaa4[_0xae37('0x5a')],function(_0x50b6ed){var _0x2f7d6c={};_0x2f7d6c[_0x50b6ed]={'$like':'%'+_0x5e536a[_0xae37('0x57')]['filter']+'%'};return _0x2f7d6c;})});}_0x44eaa4=_[_0xae37('0x61')]({},_0x44eaa4,_0x5e536a[_0xae37('0x63')]);return db[_0xae37('0xdc')][_0xae37('0x29')]({'where':_0x44eaa4['where']})[_0xae37('0x17')](function(_0x4edf14){_0x471d52['count']=_0x4edf14;if(_0x5e536a[_0xae37('0x57')][_0xae37('0x64')]){_0x44eaa4['include']=[{'all':!![]}];}else{_0x44eaa4[_0xae37('0x6d')]=[{'model':db[_0xae37('0xad')],'as':_0xae37('0xf8'),'required':![]},{'model':db[_0xae37('0x120')],'as':_0xae37('0x121'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x44eaa4);})['then'](function(_0x33bcf1){_0x471d52[_0xae37('0x66')]=_0x33bcf1;return _0x471d52;});}})[_0xae37('0x17')](respondWithFilteredResult(_0xa8362d,_0x44eaa4))[_0xae37('0x21')](handleError(_0xa8362d,null));};exports['addAgents']=function(_0x43071e,_0xaea7af){return db[_0xae37('0x54')][_0xae37('0x73')]({'where':{'id':_0x43071e[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0xaea7af,null))['then'](function(_0x4334ee){if(_0x4334ee){return _0x4334ee['addAgents'](_0x43071e[_0xae37('0x76')]['ids'],_[_0xae37('0xf7')](_0x43071e[_0xae37('0x76')],['ids','id'])||{})['spread'](function(_0x4a1996){for(var _0x43f3f9=0x0;_0x43f3f9<_0x43071e[_0xae37('0x76')][_0xae37('0x80')][_0xae37('0x6c')];_0x43f3f9+=0x1){socket[_0xae37('0x122')](_0xae37('0x123'),{'UserId':Number(_0x43071e['body']['ids'][_0x43f3f9]),'ChatWebsiteId':Number(_0x43071e[_0xae37('0x68')]['id'])});}return _0x4a1996;});}})['then'](respondWithResult(_0xaea7af,null))[_0xae37('0x21')](handleError(_0xaea7af,null));};exports[_0xae37('0x124')]=function(_0x4afae3,_0x4a4a4c){return db['ChatWebsite']['find']({'where':{'id':_0x4afae3[_0xae37('0x68')]['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x4a4a4c,null))[_0xae37('0x17')](function(_0x7c615e){if(_0x7c615e){return _0x7c615e[_0xae37('0x124')](_0x4afae3[_0xae37('0x57')][_0xae37('0x80')])[_0xae37('0x17')](function(){if(_['isArray'](_0x4afae3[_0xae37('0x57')][_0xae37('0x80')])){for(var _0xb70b6f=0x0;_0xb70b6f<_0x4afae3['query'][_0xae37('0x80')][_0xae37('0x6c')];_0xb70b6f+=0x1){socket[_0xae37('0x122')](_0xae37('0x125'),{'UserId':Number(_0x4afae3[_0xae37('0x57')][_0xae37('0x80')][_0xb70b6f]),'ChatWebsiteId':Number(_0x4afae3[_0xae37('0x68')]['id'])});}}else{socket['emit'](_0xae37('0x125'),{'UserId':Number(_0x4afae3[_0xae37('0x57')][_0xae37('0x80')]),'ChatWebsiteId':Number(_0x4afae3[_0xae37('0x68')]['id'])});}});}})[_0xae37('0x17')](respondWithStatusCode(_0x4a4a4c,null))['catch'](handleError(_0x4a4a4c,null));};exports['getAgents']=function(_0x56278a,_0x2f1471){var _0x2a4938={};var _0x184469={};var _0x3b1b62;var _0x265fef;return db[_0xae37('0x54')][_0xae37('0x7c')]({'where':{'id':_0x56278a['params']['id']}})[_0xae37('0x17')](handleEntityNotFound(_0x2f1471,null))[_0xae37('0x17')](function(_0x2c1432){if(_0x2c1432){_0x3b1b62=_0x2c1432;_0x184469[_0xae37('0x4f')]=_[_0xae37('0x58')](db[_0xae37('0xc8')]['rawAttributes']);_0x184469[_0xae37('0x57')]=_[_0xae37('0x58')](_0x56278a['query']);_0x184469['filters']=_[_0xae37('0x6b')](_0x184469[_0xae37('0x4f')],_0x184469[_0xae37('0x57')]);_0x2a4938[_0xae37('0x5a')]=_[_0xae37('0x6b')](_0x184469[_0xae37('0x4f')],qs[_0xae37('0x5b')](_0x56278a['query']['fields']));_0x2a4938[_0xae37('0x5a')]=_0x2a4938[_0xae37('0x5a')][_0xae37('0x6c')]?_0x2a4938[_0xae37('0x5a')]:_0x184469['model'];_0x2a4938[_0xae37('0x5e')]=qs[_0xae37('0x7d')](_0x56278a[_0xae37('0x57')][_0xae37('0x7d')]);_0x2a4938['where']=qs['filters'](_[_0xae37('0x60')](_0x56278a[_0xae37('0x57')],_0x184469['filters']));if(_0x56278a['query'][_0xae37('0x7e')]){_0x2a4938[_0xae37('0x5f')]=_[_0xae37('0x61')](_0x2a4938[_0xae37('0x5f')],{'$or':_[_0xae37('0x3b')](_0x2a4938[_0xae37('0x5a')],function(_0xda617c){var _0x1e83d7={};_0x1e83d7[_0xda617c]={'$like':'%'+_0x56278a[_0xae37('0x57')][_0xae37('0x7e')]+'%'};return _0x1e83d7;})});}_0x2a4938=_['merge']({},_0x2a4938,_0x56278a[_0xae37('0x63')]);return _0x3b1b62[_0xae37('0x126')](_0x2a4938);}})[_0xae37('0x17')](function(_0x3e62cf){if(_0x3e62cf){_0x265fef=_0x3e62cf['length'];if(!_0x56278a[_0xae37('0x57')]['hasOwnProperty']('nolimit')){_0x2a4938[_0xae37('0x28')]=qs['limit'](_0x56278a[_0xae37('0x57')][_0xae37('0x28')]);_0x2a4938[_0xae37('0x26')]=qs[_0xae37('0x26')](_0x56278a[_0xae37('0x57')][_0xae37('0x26')]);}return _0x3b1b62[_0xae37('0x126')](_0x2a4938);}})[_0xae37('0x17')](function(_0x535649){if(_0x535649){return _0x535649?{'count':_0x265fef,'rows':_0x535649}:null;}})[_0xae37('0x17')](respondWithResult(_0x2f1471,null))['catch'](handleError(_0x2f1471,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index b82d80f..a648404 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 _0xd246=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0xd0d541,_0x4cf939){var _0x488821=function(_0x5e01e3){while(--_0x5e01e3){_0xd0d541['push'](_0xd0d541['shift']());}};_0x488821(++_0x4cf939);}(_0xd246,0xf5));var _0x6d24=function(_0x4eeca4,_0x5901c9){_0x4eeca4=_0x4eeca4-0x0;var _0x430031=_0xd246[_0x4eeca4];return _0x430031;};'use strict';var EventEmitter=require(_0x6d24('0x0'));var ChatWebsite=require(_0x6d24('0x1'))['db'][_0x6d24('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d24('0x3')](0x0);var events={'afterCreate':_0x6d24('0x4'),'afterUpdate':_0x6d24('0x5'),'afterDestroy':_0x6d24('0x6')};function emitEvent(_0x51c18f){return function(_0x4e76e1,_0xfa68f3,_0x58e7fc){ChatWebsiteEvents[_0x6d24('0x7')](_0x51c18f+':'+_0x4e76e1['id'],_0x4e76e1);ChatWebsiteEvents['emit'](_0x51c18f,_0x4e76e1);_0x58e7fc(null);};}for(var e in events){if(events[_0x6d24('0x8')](e)){var event=events[e];ChatWebsite[_0x6d24('0x9')](e,emitEvent(event));}}module[_0x6d24('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2a9a=['hasOwnProperty','hook','events','ChatWebsite','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a9a,0x64));var _0xa2a9=function(_0xfba519,_0x7b249b){_0xfba519=_0xfba519-0x0;var _0x15a578=_0x2a9a[_0xfba519];return _0x15a578;};'use strict';var EventEmitter=require(_0xa2a9('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa2a9('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa2a9('0x2'),'afterDestroy':_0xa2a9('0x3')};function emitEvent(_0x39eca6){return function(_0x1a817a,_0x593d5c,_0x55dc29){ChatWebsiteEvents[_0xa2a9('0x4')](_0x39eca6+':'+_0x1a817a['id'],_0x1a817a);ChatWebsiteEvents[_0xa2a9('0x4')](_0x39eca6,_0x1a817a);_0x55dc29(null);};}for(var e in events){if(events[_0xa2a9('0x5')](e)){var event=events[e];ChatWebsite[_0xa2a9('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index fbdd643..85899d1 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 _0xa2d1=['rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5747b7,_0x365173){var _0x5219a1=function(_0x26325a){while(--_0x26325a){_0x5747b7['push'](_0x5747b7['shift']());}};_0x5219a1(++_0x365173);}(_0xa2d1,0x6f));var _0x1a2d=function(_0x55eb57,_0x1011e2){_0x55eb57=_0x55eb57-0x0;var _0x55ca29=_0xa2d1[_0x55eb57];return _0x55ca29;};'use strict';var _=require(_0x1a2d('0x0'));var util=require(_0x1a2d('0x1'));var logger=require(_0x1a2d('0x2'))(_0x1a2d('0x3'));var moment=require(_0x1a2d('0x4'));var BPromise=require(_0x1a2d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a2d('0x6'));var config=require(_0x1a2d('0x7'));var attributes=require(_0x1a2d('0x8'));module[_0x1a2d('0x9')]=function(_0x45f868,_0x449eb6){return _0x45f868[_0x1a2d('0xa')](_0x1a2d('0xb'),attributes,{'tableName':_0x1a2d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6170=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','chat_websites','util','../../config/logger','api','bluebird'];(function(_0x50a171,_0x46a5a7){var _0x51999c=function(_0x3c3dab){while(--_0x3c3dab){_0x50a171['push'](_0x50a171['shift']());}};_0x51999c(++_0x46a5a7);}(_0x6170,0x164));var _0x0617=function(_0x1c048a,_0x138c9f){_0x1c048a=_0x1c048a-0x0;var _0x828391=_0x6170[_0x1c048a];return _0x828391;};'use strict';var _=require('lodash');var util=require(_0x0617('0x0'));var logger=require(_0x0617('0x1'))(_0x0617('0x2'));var moment=require('moment');var BPromise=require(_0x0617('0x3'));var rp=require(_0x0617('0x4'));var fs=require('fs');var path=require(_0x0617('0x5'));var rimraf=require(_0x0617('0x6'));var config=require(_0x0617('0x7'));var attributes=require(_0x0617('0x8'));module['exports']=function(_0x39af8f,_0x5eda8a){return _0x39af8f['define']('ChatWebsite',attributes,{'tableName':_0x0617('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 7cc5690..5e299c3 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 _0xf381=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result'];(function(_0x608efe,_0x4516e6){var _0x18f678=function(_0x4b3c7c){while(--_0x4b3c7c){_0x608efe['push'](_0x608efe['shift']());}};_0x18f678(++_0x4516e6);}(_0xf381,0x160));var _0x1f38=function(_0x5078d7,_0x1ff80a){_0x5078d7=_0x5078d7-0x0;var _0x143fee=_0xf381[_0x5078d7];return _0x143fee;};'use strict';var _=require(_0x1f38('0x0'));var util=require(_0x1f38('0x1'));var moment=require(_0x1f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x1f38('0x3'));var fs=require('fs');var Redis=require(_0x1f38('0x4'));var db=require(_0x1f38('0x5'))['db'];var utils=require(_0x1f38('0x6'));var logger=require('../../config/logger')(_0x1f38('0x7'));var config=require(_0x1f38('0x8'));var jayson=require(_0x1f38('0x9'));var client=jayson[_0x1f38('0xa')][_0x1f38('0xb')]({'port':0x232a});config[_0x1f38('0xc')]=_[_0x1f38('0xd')](config[_0x1f38('0xc')],{'host':_0x1f38('0xe'),'port':0x18eb});var socket=require(_0x1f38('0xf'))(new Redis(config[_0x1f38('0xc')]));require(_0x1f38('0x10'))['register'](socket);function respondWithRpcPromise(_0x27995c,_0x374302,_0x5e94da){return new BPromise(function(_0x44364c,_0x18b8f0){return client[_0x1f38('0x11')](_0x27995c,_0x5e94da)[_0x1f38('0x12')](function(_0x3e1cf8){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x374302,_0x1f38('0x13'),JSON['stringify'](_0x3e1cf8));if(_0x3e1cf8[_0x1f38('0x14')]){if(_0x3e1cf8['error'][_0x1f38('0x15')]===0x1f4){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x3e1cf8[_0x1f38('0x14')]['message']);return _0x18b8f0(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}logger[_0x1f38('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x374302,_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);return _0x44364c(_0x3e1cf8[_0x1f38('0x14')][_0x1f38('0x17')]);}else{logger[_0x1f38('0x18')](_0x1f38('0x16'),_0x374302,'request\x20sent');_0x44364c(_0x3e1cf8[_0x1f38('0x19')]['message']);}})[_0x1f38('0x1a')](function(_0x13babe){logger[_0x1f38('0x14')](_0x1f38('0x16'),_0x374302,_0x13babe);_0x18b8f0(_0x13babe);});});}
\ No newline at end of file
+var _0x9e1f=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x123414,_0x4f85f6){var _0x50e83a=function(_0x585a1e){while(--_0x585a1e){_0x123414['push'](_0x123414['shift']());}};_0x50e83a(++_0x4f85f6);}(_0x9e1f,0xfd));var _0xf9e1=function(_0x50e425,_0x3ca8d7){_0x50e425=_0x50e425-0x0;var _0x4b985d=_0x9e1f[_0x50e425];return _0x4b985d;};'use strict';var _=require(_0xf9e1('0x0'));var util=require(_0xf9e1('0x1'));var moment=require(_0xf9e1('0x2'));var BPromise=require(_0xf9e1('0x3'));var rs=require(_0xf9e1('0x4'));var fs=require('fs');var Redis=require(_0xf9e1('0x5'));var db=require(_0xf9e1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9e1('0x7'))(_0xf9e1('0x8'));var config=require('../../config/environment');var jayson=require(_0xf9e1('0x9'));var client=jayson['client'][_0xf9e1('0xa')]({'port':0x232a});config[_0xf9e1('0xb')]=_['defaults'](config[_0xf9e1('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9e1('0xb')]));require(_0xf9e1('0xc'))[_0xf9e1('0xd')](socket);function respondWithRpcPromise(_0x18492c,_0x3c8260,_0x321a85){return new BPromise(function(_0x27ca46,_0x28f165){return client[_0xf9e1('0xe')](_0x18492c,_0x321a85)['then'](function(_0x1bf640){logger[_0xf9e1('0xf')](_0xf9e1('0x10'),_0x3c8260,_0xf9e1('0x11'));logger[_0xf9e1('0x12')](_0xf9e1('0x13'),_0x3c8260,_0xf9e1('0x11'),JSON[_0xf9e1('0x14')](_0x1bf640));if(_0x1bf640[_0xf9e1('0x15')]){if(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x16')]===0x1f4){logger['error'](_0xf9e1('0x10'),_0x3c8260,_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);return _0x28f165(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);}logger[_0xf9e1('0x15')](_0xf9e1('0x10'),_0x3c8260,_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);return _0x27ca46(_0x1bf640[_0xf9e1('0x15')][_0xf9e1('0x17')]);}else{logger[_0xf9e1('0xf')](_0xf9e1('0x10'),_0x3c8260,'request\x20sent');_0x27ca46(_0x1bf640['result']['message']);}})[_0xf9e1('0x18')](function(_0x4851a9){logger['error'](_0xf9e1('0x10'),_0x3c8260,_0x4851a9);_0x28f165(_0x4851a9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d49fded..646ee4f 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 _0x5839=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x2b9d5c,_0x173518){var _0x37bb93=function(_0x5515cd){while(--_0x5515cd){_0x2b9d5c['push'](_0x2b9d5c['shift']());}};_0x37bb93(++_0x173518);}(_0x5839,0x158));var _0x9583=function(_0x480957,_0x2632b7){_0x480957=_0x480957-0x0;var _0x5101d3=_0x5839[_0x480957];return _0x5101d3;};'use strict';var ChatWebsiteEvents=require(_0x9583('0x0'));var events=[_0x9583('0x1'),_0x9583('0x2'),_0x9583('0x3')];function createListener(_0x1973a3,_0x2dcfb9){return function(_0x3652ee){_0x2dcfb9[_0x9583('0x4')](_0x1973a3,_0x3652ee);};}function removeListener(_0x2a8679,_0xf89270){return function(){ChatWebsiteEvents[_0x9583('0x5')](_0x2a8679,_0xf89270);};}exports[_0x9583('0x6')]=function(_0x32bed7){for(var _0xf16798=0x0,_0x2d2d76=events[_0x9583('0x7')];_0xf16798<_0x2d2d76;_0xf16798++){var _0x1e2720=events[_0xf16798];var _0x57e550=createListener(_0x9583('0x8')+_0x1e2720,_0x32bed7);ChatWebsiteEvents['on'](_0x1e2720,_0x57e550);}};
\ No newline at end of file
+var _0x79fd=['register','length','chatWebsite:','save','remove','emit','removeListener'];(function(_0x60fa35,_0x12abc6){var _0x2d9933=function(_0x310304){while(--_0x310304){_0x60fa35['push'](_0x60fa35['shift']());}};_0x2d9933(++_0x12abc6);}(_0x79fd,0x114));var _0xd79f=function(_0xb48c0,_0x35e2c1){_0xb48c0=_0xb48c0-0x0;var _0x196404=_0x79fd[_0xb48c0];return _0x196404;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd79f('0x0'),_0xd79f('0x1'),'update'];function createListener(_0x1450d7,_0x494ce3){return function(_0x1e3d77){_0x494ce3[_0xd79f('0x2')](_0x1450d7,_0x1e3d77);};}function removeListener(_0x281ab9,_0x509f19){return function(){ChatWebsiteEvents[_0xd79f('0x3')](_0x281ab9,_0x509f19);};}exports[_0xd79f('0x4')]=function(_0x56737e){for(var _0x2d5c2d=0x0,_0x4dcfb1=events[_0xd79f('0x5')];_0x2d5c2d<_0x4dcfb1;_0x2d5c2d++){var _0x9ba835=events[_0x2d5c2d];var _0x7b155d=createListener(_0xd79f('0x6')+_0x9ba835,_0x56737e);ChatWebsiteEvents['on'](_0x9ba835,_0x7b155d);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 538c2a7..21ce322 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 _0xb1f8=['originalname','/:id/logo','single','file','addLogo','root','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now'];(function(_0x5c0dd9,_0x543e97){var _0x51b27e=function(_0x188c6d){while(--_0x188c6d){_0x5c0dd9['push'](_0x5c0dd9['shift']());}};_0x51b27e(++_0x543e97);}(_0xb1f8,0xb2));var _0x8b1f=function(_0x33fa50,_0x281caa){_0x33fa50=_0x33fa50-0x0;var _0x52d1c3=_0xb1f8[_0x33fa50];return _0x52d1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8b1f('0x0'));var timeout=require(_0x8b1f('0x1'));var express=require(_0x8b1f('0x2'));var router=express[_0x8b1f('0x3')]();var fs_extra=require(_0x8b1f('0x4'));var auth=require(_0x8b1f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b1f('0x6'));var controller=require('./chatWebsite.controller');router[_0x8b1f('0x7')]('/',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x9')]);router[_0x8b1f('0x7')](_0x8b1f('0xa'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xb')]);router['get']('/:id',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xc')]);router['get'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0xe')]);router[_0x8b1f('0x7')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x8b1f('0xf')]);router[_0x8b1f('0x7')]('/:id/logo',controller[_0x8b1f('0x10')]);router[_0x8b1f('0x7')](_0x8b1f('0x11'),controller[_0x8b1f('0x12')]);router[_0x8b1f('0x7')](_0x8b1f('0x13'),controller[_0x8b1f('0x14')]);router[_0x8b1f('0x7')]('/:id/system_avatar',controller[_0x8b1f('0x15')]);router[_0x8b1f('0x7')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x17')]);router[_0x8b1f('0x7')](_0x8b1f('0x18'),controller['getSnippet']);router[_0x8b1f('0x7')](_0x8b1f('0x19'),auth[_0x8b1f('0x8')](),controller['getApplications']);router[_0x8b1f('0x7')](_0x8b1f('0x1a'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1b')]);router[_0x8b1f('0x7')](_0x8b1f('0x1c'),controller[_0x8b1f('0x1d')]);router[_0x8b1f('0x7')](_0x8b1f('0x1e'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x1f')]);router[_0x8b1f('0x7')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x21')]);router[_0x8b1f('0x22')]('/',auth[_0x8b1f('0x8')](),controller['create']);router['post'](_0x8b1f('0xd'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x23')]);router[_0x8b1f('0x22')](_0x8b1f('0x24'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x25')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5955cc,_0x44625f,_0x18336d){_0x18336d(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x28')));},'filename':function(_0x5f233a,_0x252929,_0x2d1c9e){_0x2d1c9e(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x252929[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x2d'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x30')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x27fca4,_0x485bba,_0x5cd42c){_0x5cd42c(null,path[_0x8b1f('0x27')](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x18f0d2,_0x1e6262,_0x2850f1){_0x2850f1(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x1e6262[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x11'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x33')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0xf73504,_0x6713d,_0x308cbc){_0x308cbc(null,path[_0x8b1f('0x27')](config['root'],_0x8b1f('0x32')));},'filename':function(_0x6afd48,_0x26525b,_0x1f2ff5){_0x1f2ff5(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date['now'](),_0x26525b[_0x8b1f('0x2c')]));}})});router['post'](_0x8b1f('0x13'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x34')]);var upload=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x5062ca,_0x35a282,_0x5e99e2){_0x5e99e2(null,path['join'](config[_0x8b1f('0x31')],_0x8b1f('0x32')));},'filename':function(_0x22eb34,_0x52b4bb,_0x4be9e9){_0x4be9e9(null,util[_0x8b1f('0x29')](_0x8b1f('0x2a'),Date[_0x8b1f('0x2b')](),_0x52b4bb[_0x8b1f('0x2c')]));}})});router[_0x8b1f('0x22')](_0x8b1f('0x35'),upload[_0x8b1f('0x2e')](_0x8b1f('0x2f')),controller[_0x8b1f('0x36')]);router['post'](_0x8b1f('0x37'),controller[_0x8b1f('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x8b1f('0x26')]({'destination':function(_0x183942,_0x13cc19,_0x10f4e1){const _0x5ab45c=path[_0x8b1f('0x27')](config['root'],'server/files','attachments',_0x8b1f('0x39'));fs_extra[_0x8b1f('0x3a')](_0x5ab45c,function(){_0x10f4e1(null,_0x5ab45c);});},'filename':function(_0x2eda1c,_0x52f758,_0x84b58b){const _0x4a2fe4=_0x52f758[_0x8b1f('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5bfdb2=path['extname'](_0x4a2fe4);const _0xcfd715=Date[_0x8b1f('0x2b')]()+'-'+_0x4a2fe4[_0x8b1f('0x3b')](_0x5bfdb2,'')+_0x5bfdb2;_0x84b58b(null,_0xcfd715);}})});router[_0x8b1f('0x22')](_0x8b1f('0x3c'),offlineUploadMulter[_0x8b1f('0x3d')](),controller[_0x8b1f('0x3e')]);router[_0x8b1f('0x22')](_0x8b1f('0x16'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x3f')]);router[_0x8b1f('0x22')]('/:id/applications',auth[_0x8b1f('0x8')](),controller['addApplications']);router['post']('/:id/proactive_actions',auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x40')]);router[_0x8b1f('0x22')](_0x8b1f('0x20'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x41')]);router[_0x8b1f('0x42')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x44')]);router[_0x8b1f('0x45')](_0x8b1f('0x43'),auth[_0x8b1f('0x8')](),controller[_0x8b1f('0x46')]);router[_0x8b1f('0x45')](_0x8b1f('0xd'),auth['isAuthenticated'](),controller[_0x8b1f('0x47')]);router[_0x8b1f('0x45')](_0x8b1f('0x24'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x8b1f('0x45')](_0x8b1f('0x20'),auth['isAuthenticated'](),controller[_0x8b1f('0x48')]);module[_0x8b1f('0x49')]=router;
\ No newline at end of file
+var _0xe22e=['post','/:id/dispositions','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','single','addLogo','diskStorage','server/files/images/avatars/','originalname','/:id/avatar','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline-chat','ensureDir','extname','replace','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x18295a,_0x381298){var _0x2a22a1=function(_0x57151d){while(--_0x57151d){_0x18295a['push'](_0x18295a['shift']());}};_0x2a22a1(++_0x381298);}(_0xe22e,0xfa));var _0xee22=function(_0x14790f,_0x432b5f){_0x14790f=_0x14790f-0x0;var _0x5acc1f=_0xe22e[_0x14790f];return _0x5acc1f;};'use strict';var multer=require(_0xee22('0x0'));var util=require(_0xee22('0x1'));var path=require(_0xee22('0x2'));var timeout=require(_0xee22('0x3'));var express=require(_0xee22('0x4'));var router=express['Router']();var fs_extra=require(_0xee22('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee22('0x6'));var config=require(_0xee22('0x7'));var controller=require(_0xee22('0x8'));router[_0xee22('0x9')]('/',auth[_0xee22('0xa')](),controller[_0xee22('0xb')]);router[_0xee22('0x9')](_0xee22('0xc'),auth[_0xee22('0xa')](),controller[_0xee22('0xd')]);router[_0xee22('0x9')](_0xee22('0xe'),auth[_0xee22('0xa')](),controller[_0xee22('0xf')]);router[_0xee22('0x9')]('/:id/dispositions',auth[_0xee22('0xa')](),controller[_0xee22('0x10')]);router[_0xee22('0x9')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x12')]);router[_0xee22('0x9')](_0xee22('0x13'),controller['getLogo']);router[_0xee22('0x9')]('/:id/avatar',controller[_0xee22('0x14')]);router[_0xee22('0x9')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xee22('0x9')](_0xee22('0x15'),controller[_0xee22('0x16')]);router[_0xee22('0x9')](_0xee22('0x17'),auth[_0xee22('0xa')](),controller[_0xee22('0x18')]);router[_0xee22('0x9')](_0xee22('0x19'),controller[_0xee22('0x1a')]);router[_0xee22('0x9')](_0xee22('0x1b'),auth['isAuthenticated'](),controller[_0xee22('0x1c')]);router['get']('/:id/proactive_actions',auth[_0xee22('0xa')](),controller[_0xee22('0x1d')]);router['get']('/:id/fields',controller[_0xee22('0x1e')]);router[_0xee22('0x9')](_0xee22('0x1f'),auth[_0xee22('0xa')](),controller['getOfflineMessages']);router[_0xee22('0x9')](_0xee22('0x20'),auth[_0xee22('0xa')](),controller[_0xee22('0x21')]);router[_0xee22('0x22')]('/',auth[_0xee22('0xa')](),controller['create']);router['post'](_0xee22('0x23'),auth[_0xee22('0xa')](),controller[_0xee22('0x24')]);router[_0xee22('0x22')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22d46f,_0x209e7e,_0x386d64){_0x386d64(null,path[_0xee22('0x26')](config[_0xee22('0x27')],_0xee22('0x28')));},'filename':function(_0x16c919,_0x2bdc08,_0x594f2b){_0x594f2b(null,util[_0xee22('0x29')](_0xee22('0x2a'),Date[_0xee22('0x2b')](),_0x2bdc08['originalname']));}})});router['post'](_0xee22('0x13'),upload[_0xee22('0x2c')]('file'),controller[_0xee22('0x2d')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x163da5,_0x23cac2,_0x5792a1){_0x5792a1(null,path[_0xee22('0x26')](config[_0xee22('0x27')],_0xee22('0x2f')));},'filename':function(_0x1aac97,_0x5468ef,_0x5496e4){_0x5496e4(null,util[_0xee22('0x29')](_0xee22('0x2a'),Date[_0xee22('0x2b')](),_0x5468ef[_0xee22('0x30')]));}})});router[_0xee22('0x22')](_0xee22('0x31'),upload[_0xee22('0x2c')]('file'),controller[_0xee22('0x32')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x4e194d,_0x376545,_0x59852f){_0x59852f(null,path[_0xee22('0x26')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xdceca5,_0x38c1f0,_0x4c7713){_0x4c7713(null,util['format']('%s-%s',Date[_0xee22('0x2b')](),_0x38c1f0['originalname']));}})});router[_0xee22('0x22')](_0xee22('0x33'),upload['single']('file'),controller[_0xee22('0x34')]);var upload=multer({'storage':multer[_0xee22('0x2e')]({'destination':function(_0x5230e2,_0x7f8b47,_0x465bbd){_0x465bbd(null,path[_0xee22('0x26')](config['root'],_0xee22('0x2f')));},'filename':function(_0x4b0a2c,_0x4575d9,_0xefe1ad){_0xefe1ad(null,util[_0xee22('0x29')]('%s-%s',Date[_0xee22('0x2b')](),_0x4575d9[_0xee22('0x30')]));}})});router[_0xee22('0x22')](_0xee22('0x15'),upload['single']('file'),controller[_0xee22('0x35')]);router[_0xee22('0x22')](_0xee22('0x36'),controller[_0xee22('0x37')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x14a2df,_0x2e5e96,_0x362db0){const _0x4b0862=path[_0xee22('0x26')](config[_0xee22('0x27')],'server/files','attachments',_0xee22('0x38'));fs_extra[_0xee22('0x39')](_0x4b0862,function(){_0x362db0(null,_0x4b0862);});},'filename':function(_0x4e617f,_0x5c7669,_0x21f886){const _0x54e0f7=_0x5c7669[_0xee22('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x47f378=path[_0xee22('0x3a')](_0x54e0f7);const _0xb6128c=Date[_0xee22('0x2b')]()+'-'+_0x54e0f7[_0xee22('0x3b')](_0x47f378,'')+_0x47f378;_0x21f886(null,_0xb6128c);}})});router['post']('/:id/offline',offlineUploadMulter['any'](),controller[_0xee22('0x3c')]);router[_0xee22('0x22')]('/:id/interactions',auth[_0xee22('0xa')](),controller['addInteraction']);router['post'](_0xee22('0x1b'),auth[_0xee22('0xa')](),controller[_0xee22('0x3d')]);router[_0xee22('0x22')]('/:id/proactive_actions',auth[_0xee22('0xa')](),controller[_0xee22('0x3e')]);router[_0xee22('0x22')](_0xee22('0x20'),auth[_0xee22('0xa')](),controller[_0xee22('0x3f')]);router[_0xee22('0x40')]('/:id',auth[_0xee22('0xa')](),controller[_0xee22('0x41')]);router[_0xee22('0x42')]('/:id',auth[_0xee22('0xa')](),controller[_0xee22('0x43')]);router[_0xee22('0x42')](_0xee22('0x23'),auth[_0xee22('0xa')](),controller[_0xee22('0x44')]);router[_0xee22('0x42')](_0xee22('0x11'),auth[_0xee22('0xa')](),controller[_0xee22('0x45')]);router[_0xee22('0x42')]('/:id/users',auth[_0xee22('0xa')](),controller['removeAgents']);module[_0xee22('0x46')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index edd1cb5..98f0c59 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x57b3=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','beaver-logger/server','../components/auth/service','Router'];(function(_0x125da9,_0x559df9){var _0x1426b4=function(_0x5492b8){while(--_0x5492b8){_0x125da9['push'](_0x125da9['shift']());}};_0x1426b4(++_0x559df9);}(_0x57b3,0x72));var _0x357b=function(_0x5e9b88,_0x320778){_0x5e9b88=_0x5e9b88-0x0;var _0x471af0=_0x57b3[_0x5e9b88];return _0x471af0;};var beaverLogger=require(_0x357b('0x0'));var express=require('express');var auth=require(_0x357b('0x1'));var config=require('../config/environment');var router=express[_0x357b('0x2')]();var isProduction=config[_0x357b('0x3')]===_0x357b('0x4')||![];function clientSideLogs(_0x39a277,_0x10dccf,_0x5aed32){var _0x5d69bd=_0x39a277[_0x357b('0x5')][_0x357b('0x6')](_0x357b('0x7'));if(!_0x5d69bd){throw new Error(_0x357b('0x8'));}return beaverLogger[_0x357b('0x9')]({'uri':_0x357b('0xa'),'logger':_0x5d69bd,'enableCors':!isProduction})(_0x39a277,_0x10dccf,_0x5aed32);}router[_0x357b('0xb')](auth[_0x357b('0xc')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
+var _0x1740=['express','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','expressEndpoint','/client-logs','exports','beaver-logger/server'];(function(_0x26c559,_0x3421ec){var _0x262123=function(_0x194378){while(--_0x194378){_0x26c559['push'](_0x26c559['shift']());}};_0x262123(++_0x3421ec);}(_0x1740,0x143));var _0x0174=function(_0x19efa0,_0x245b7b){_0x19efa0=_0x19efa0-0x0;var _0x374b08=_0x1740[_0x19efa0];return _0x374b08;};var beaverLogger=require(_0x0174('0x0'));var express=require(_0x0174('0x1'));var auth=require(_0x0174('0x2'));var config=require(_0x0174('0x3'));var router=express[_0x0174('0x4')]();var isProduction=config['env']===_0x0174('0x5')||![];function clientSideLogs(_0x5a2059,_0xca4224,_0x4c3726){var _0x1a3f9e=_0x5a2059[_0x0174('0x6')][_0x0174('0x7')](_0x0174('0x8'));if(!_0x1a3f9e){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x0174('0x9')]({'uri':_0x0174('0xa'),'logger':_0x1a3f9e,'enableCors':!isProduction})(_0x5a2059,_0xca4224,_0x4c3726);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x0174('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 09c2b25..c54c1c9 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 _0xe6ca=['Google','Outlook365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x5a04ac,_0x2b8b74){var _0x2406d9=function(_0x3e4237){while(--_0x3e4237){_0x5a04ac['push'](_0x5a04ac['shift']());}};_0x2406d9(++_0x2b8b74);}(_0xe6ca,0xd8));var _0xae6c=function(_0xe69ec7,_0x44d820){_0xe69ec7=_0xe69ec7-0x0;var _0x164d47=_0xe6ca[_0xe69ec7];return _0x164d47;};'use strict';var Sequelize=require(_0xae6c('0x0'));module[_0xae6c('0x1')]={'name':{'type':Sequelize[_0xae6c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xae6c('0x3')](_0xae6c('0x4'),_0xae6c('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xae6c('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x7')},'data3':{'type':Sequelize[_0xae6c('0x2')],'comment':_0xae6c('0x8')},'data4':{'type':Sequelize[_0xae6c('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xa')},'data6':{'type':Sequelize[_0xae6c('0x9')],'comment':_0xae6c('0xb')},'data7':{'type':Sequelize['TEXT'],'comment':_0xae6c('0xc')}};
\ No newline at end of file
+var _0x62d7=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure','ENUM','Outlook365','Dynamics365'];(function(_0x52969b,_0x35eb2e){var _0x157c5b=function(_0x26ffef){while(--_0x26ffef){_0x52969b['push'](_0x52969b['shift']());}};_0x157c5b(++_0x35eb2e);}(_0x62d7,0x168));var _0x762d=function(_0x29c54e,_0xd415a2){_0x29c54e=_0x29c54e-0x0;var _0x142be0=_0x62d7[_0x29c54e];return _0x142be0;};'use strict';var Sequelize=require(_0x762d('0x0'));module[_0x762d('0x1')]={'name':{'type':Sequelize[_0x762d('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x762d('0x3'),_0x762d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x762d('0x5')](_0x762d('0x6'),_0x762d('0x7'))},'data1':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0x8')},'data2':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0x9')},'data3':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0xa')},'data4':{'type':Sequelize[_0x762d('0x2')],'comment':_0x762d('0xb')},'data5':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xd')},'data6':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xe')},'data7':{'type':Sequelize[_0x762d('0xc')],'comment':_0x762d('0xf')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index e472413..8951d76 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 _0xdc27=['json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','name','send','slice','index','map','CloudProvider','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','where','filter','merge','VIRTUAL','options','includeAll','rows','MicrosoftAzure','data3','show','include','service','catch','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','findOne','generateMicrosoftAuthorizationUrl','get','Invalid\x20state\x20parameter','from','state','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','status','end'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xdc27,0x1b4));var _0x7dc2=function(_0x363d9c,_0x40fd02){_0x363d9c=_0x363d9c-0x0;var _0x1d1c0c=_0xdc27[_0x363d9c];return _0x1d1c0c;};'use strict';var _=require(_0x7dc2('0x0'));var Redis=require(_0x7dc2('0x1'));var qs=require(_0x7dc2('0x2'));var encryptor=require(_0x7dc2('0x3'));var config=require(_0x7dc2('0x4'));var logger=require(_0x7dc2('0x5'))(_0x7dc2('0x6'));var db=require(_0x7dc2('0x7'))['db'];var oauth=require(_0x7dc2('0x8'));config[_0x7dc2('0x9')]=_[_0x7dc2('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7dc2('0xb'))(new Redis(config[_0x7dc2('0x9')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x5b059b,_0xcb6be8){_0xcb6be8=_0xcb6be8||0xcc;return function(_0x1de6ae){if(_0x1de6ae){return _0x5b059b['sendStatus'](_0xcb6be8);}return _0x5b059b[_0x7dc2('0xc')](_0xcb6be8)[_0x7dc2('0xd')]();};}function respondWithResult(_0x1d83fb,_0x52c651){_0x52c651=_0x52c651||0xc8;return function(_0x2d7ed7){if(_0x2d7ed7){return _0x1d83fb[_0x7dc2('0xc')](_0x52c651)[_0x7dc2('0xe')](_0x2d7ed7);}};}function respondWithFilteredResult(_0x3c3017,_0xc7df69){return function(_0x4072c9){if(_0x4072c9){var _0x48da8f=typeof _0xc7df69[_0x7dc2('0xf')]===_0x7dc2('0x10')&&typeof _0xc7df69[_0x7dc2('0x11')]===_0x7dc2('0x10');var _0xc9d90f=_0x4072c9[_0x7dc2('0x12')];var _0x46d2b6=_0x48da8f?0x0:_0xc7df69[_0x7dc2('0xf')];var _0x55e544=_0x48da8f?_0x4072c9[_0x7dc2('0x12')]:_0xc7df69[_0x7dc2('0xf')]+_0xc7df69[_0x7dc2('0x11')];var _0x1f8580;if(_0x55e544>=_0xc9d90f){_0x55e544=_0xc9d90f;_0x1f8580=0xc8;}else{_0x1f8580=0xce;}_0x3c3017['status'](_0x1f8580);return _0x3c3017[_0x7dc2('0x13')](_0x7dc2('0x14'),_0x46d2b6+'-'+_0x55e544+'/'+_0xc9d90f)[_0x7dc2('0xe')](_0x4072c9);}return null;};}function saveUpdates(_0x2ccbc3){return function(_0x2f1731){if(_0x2f1731){return _0x2f1731[_0x7dc2('0x15')](_0x2ccbc3)[_0x7dc2('0x16')](function(_0x189f03){return _0x189f03;});}return null;};}function removeEntity(_0x591839){return function(_0x5075fe){if(_0x5075fe){return _0x5075fe[_0x7dc2('0x17')]()[_0x7dc2('0x16')](function(){_0x591839[_0x7dc2('0xc')](0xcc)[_0x7dc2('0xd')]();});}};}function handleEntityNotFound(_0x5a0478){return function(_0x51c448){if(!_0x51c448){_0x5a0478[_0x7dc2('0x18')](0x194);}return _0x51c448;};}function handleError(_0x2ceed4,_0x43a113){_0x43a113=_0x43a113||0x1f4;return function(_0x4ef7c9){logger[_0x7dc2('0x19')](_0x4ef7c9['stack']);if(_0x4ef7c9[_0x7dc2('0x1a')]){delete _0x4ef7c9[_0x7dc2('0x1a')];}_0x2ceed4[_0x7dc2('0xc')](_0x43a113)[_0x7dc2('0x1b')](_0x4ef7c9);};}function maskClientSecret(_0x357de6){return _['padEnd'](_0x357de6[_0x7dc2('0x1c')](0x0,0x3),0x14,'*');}exports[_0x7dc2('0x1d')]=function(_0x4bdf77,_0x4809e8){var _0x2c3294={},_0x27703d={},_0x2d7b90={'count':0x0,'rows':[]};var _0x35c6a9=_[_0x7dc2('0x1e')](db[_0x7dc2('0x1f')][_0x7dc2('0x20')],function(_0x37d774){return{'name':_0x37d774['fieldName'],'type':_0x37d774[_0x7dc2('0x21')][_0x7dc2('0x22')]};});_0x27703d['model']=_[_0x7dc2('0x1e')](_0x35c6a9,_0x7dc2('0x1a'));_0x27703d[_0x7dc2('0x23')]=_[_0x7dc2('0x24')](_0x4bdf77['query']);_0x27703d[_0x7dc2('0x25')]=_['intersection'](_0x27703d[_0x7dc2('0x26')],_0x27703d[_0x7dc2('0x23')]);_0x2c3294[_0x7dc2('0x27')]=_[_0x7dc2('0x28')](_0x27703d[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x4bdf77[_0x7dc2('0x23')]['fields']));_0x2c3294[_0x7dc2('0x27')]=_0x2c3294[_0x7dc2('0x27')]['length']?_0x2c3294['attributes']:_0x27703d['model'];if(!_0x4bdf77[_0x7dc2('0x23')]['hasOwnProperty'](_0x7dc2('0x2a'))){_0x2c3294['limit']=qs[_0x7dc2('0x11')](_0x4bdf77[_0x7dc2('0x23')]['limit']);_0x2c3294[_0x7dc2('0xf')]=qs[_0x7dc2('0xf')](_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0xf')]);}_0x2c3294['order']=qs['sort'](_0x4bdf77['query']['sort']);_0x2c3294[_0x7dc2('0x2b')]=qs[_0x7dc2('0x25')](_['pick'](_0x4bdf77[_0x7dc2('0x23')],_0x27703d['filters']),_0x35c6a9);if(_0x4bdf77['query'][_0x7dc2('0x2c')]){_0x2c3294['where']=_[_0x7dc2('0x2d')](_0x2c3294[_0x7dc2('0x2b')],{'$or':_[_0x7dc2('0x1e')](_0x35c6a9,function(_0x5cf428){if(_0x5cf428[_0x7dc2('0x21')]!==_0x7dc2('0x2e')){var _0x533177={};_0x533177[_0x5cf428[_0x7dc2('0x1a')]]={'$like':'%'+_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x2c')]+'%'};return _0x533177;}})});}_0x2c3294=_['merge']({},_0x2c3294,_0x4bdf77[_0x7dc2('0x2f')]);var _0x411125={'where':_0x2c3294[_0x7dc2('0x2b')]};return db[_0x7dc2('0x1f')][_0x7dc2('0x12')](_0x411125)[_0x7dc2('0x16')](function(_0x49d9b9){_0x2d7b90[_0x7dc2('0x12')]=_0x49d9b9;if(_0x4bdf77[_0x7dc2('0x23')][_0x7dc2('0x30')]){_0x2c3294['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x2c3294);})[_0x7dc2('0x16')](function(_0x1498f6){_0x2d7b90[_0x7dc2('0x31')]=_[_0x7dc2('0x1e')](_0x1498f6,function(_0xda1e8e){if(_0xda1e8e['service']===_0x7dc2('0x32')){var _0xcb1ee1=encryptor['decryptString'](_0xda1e8e['data3']);_0xda1e8e[_0x7dc2('0x33')]=maskClientSecret(_0xcb1ee1);}return _0xda1e8e;});return _0x2d7b90;})[_0x7dc2('0x16')](respondWithFilteredResult(_0x4809e8,_0x2c3294))['catch'](handleError(_0x4809e8,null));};exports[_0x7dc2('0x34')]=function(_0x5ebdb4,_0x3628c7){var _0x4d0ed3={'raw':!![],'where':{'id':_0x5ebdb4['params']['id']}},_0x1f8b88={};_0x1f8b88['model']=_[_0x7dc2('0x24')](db['CloudProvider']['rawAttributes']);_0x1f8b88[_0x7dc2('0x23')]=_['keys'](_0x5ebdb4[_0x7dc2('0x23')]);_0x1f8b88['filters']=_[_0x7dc2('0x28')](_0x1f8b88[_0x7dc2('0x26')],_0x1f8b88[_0x7dc2('0x23')]);_0x4d0ed3[_0x7dc2('0x27')]=_['intersection'](_0x1f8b88[_0x7dc2('0x26')],qs[_0x7dc2('0x29')](_0x5ebdb4[_0x7dc2('0x23')][_0x7dc2('0x29')]));_0x4d0ed3['attributes']=_0x4d0ed3[_0x7dc2('0x27')]['length']?_0x4d0ed3[_0x7dc2('0x27')]:_0x1f8b88['model'];if(_0x5ebdb4['query'][_0x7dc2('0x30')]){_0x4d0ed3[_0x7dc2('0x35')]=[{'all':!![]}];}_0x4d0ed3=_[_0x7dc2('0x2d')]({},_0x4d0ed3,_0x5ebdb4[_0x7dc2('0x2f')]);return db[_0x7dc2('0x1f')]['find'](_0x4d0ed3)[_0x7dc2('0x16')](handleEntityNotFound(_0x3628c7,null))['then'](function(_0x4e1a00){if(_0x4e1a00[_0x7dc2('0x36')]===_0x7dc2('0x32')){var _0x59b8ab=encryptor['decryptString'](_0x4e1a00[_0x7dc2('0x33')]);_0x4e1a00[_0x7dc2('0x33')]=maskClientSecret(_0x59b8ab);}return _0x4e1a00;})[_0x7dc2('0x16')](respondWithResult(_0x3628c7,null))[_0x7dc2('0x37')](handleError(_0x3628c7,null));};exports[_0x7dc2('0x38')]=function(_0x1a49e5,_0x49bcfc){if(!_0x1a49e5['body'][_0x7dc2('0x1a')])throw new Error(_0x7dc2('0x39'));if(!_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x5903e4=db[_0x7dc2('0x1f')][_0x7dc2('0x20')][_0x7dc2('0x36')][_0x7dc2('0x3b')];if(!_0x5903e4[_0x7dc2('0x3c')](_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]))throw new Error(_0x7dc2('0x3d')+_0x5903e4[_0x7dc2('0x3e')](',\x20'));if(_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x36')]===_0x7dc2('0x32')&&_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1a49e5[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1a49e5[_0x7dc2('0x3a')]['data3']);}return db[_0x7dc2('0x1f')][_0x7dc2('0x38')](_0x1a49e5[_0x7dc2('0x3a')],{})['then'](respondWithResult(_0x49bcfc,0xc9))['catch'](handleError(_0x49bcfc,null));};exports['update']=function(_0x1f2159,_0x505282){if(_0x1f2159['body']['id']){delete _0x1f2159[_0x7dc2('0x3a')]['id'];}return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x1f2159[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x505282,null))[_0x7dc2('0x16')](function(_0x22e619){if(_0x22e619[_0x7dc2('0x36')]==='MicrosoftAzure'&&_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]){_0x1f2159[_0x7dc2('0x3a')][_0x7dc2('0x33')]=encryptor[_0x7dc2('0x3f')](_0x1f2159[_0x7dc2('0x3a')]['data3']);}return _0x22e619;})[_0x7dc2('0x16')](saveUpdates(_0x1f2159[_0x7dc2('0x3a')],null))['then'](respondWithResult(_0x505282,null))['catch'](handleError(_0x505282,null));};exports[_0x7dc2('0x17')]=function(_0x181e7d,_0x415913){return db['CloudProvider'][_0x7dc2('0x40')]({'where':{'id':_0x181e7d[_0x7dc2('0x41')]['id']}})['then'](handleEntityNotFound(_0x415913,null))['then'](removeEntity(_0x415913,null))[_0x7dc2('0x37')](handleError(_0x415913,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2e360e,_0x3ff018){return db[_0x7dc2('0x1f')][_0x7dc2('0x42')]({'where':{'id':_0x2e360e[_0x7dc2('0x41')]['id']},'raw':!![]})[_0x7dc2('0x16')](function(_0x32a48a){if(!_0x32a48a)return _0x3ff018['sendStatus'](0x194);return{'url':oauth[_0x7dc2('0x43')](_0x32a48a,_0x2e360e['user']['id'])};})['then'](respondWithResult(_0x3ff018,null))[_0x7dc2('0x37')](handleError(_0x3ff018,null));};exports['oauth2MicrosoftCallback']=function(_0x3c8fa8,_0x4998b4){var _0x389826=_0x3c8fa8[_0x7dc2('0x3a')];var _0x2311db;var _0x5ba59b;if(_0x389826[_0x7dc2('0x19')])throw _0x389826;redis[_0x7dc2('0x44')](_0x389826['state'])[_0x7dc2('0x16')](function(_0x1a060e){if(!_0x1a060e)throw new Error(_0x7dc2('0x45'));_0x2311db=JSON['parse'](_0x1a060e);var _0x932c35=Buffer[_0x7dc2('0x46')](_0x389826[_0x7dc2('0x47')],_0x7dc2('0x48'))[_0x7dc2('0x49')]('ascii');_0x5ba59b=JSON[_0x7dc2('0x4a')](_0x932c35);if(!oauth[_0x7dc2('0x4b')](_0x389826[_0x7dc2('0x4c')],_0x2311db[_0x7dc2('0x4d')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x389826['state']);return oauth[_0x7dc2('0x4e')](_0x389826[_0x7dc2('0x4f')],_0x2311db);})['then'](function(_0x329803){_0x2311db[_0x7dc2('0x50')]=_0x329803[_0x7dc2('0x51')];_0x2311db[_0x7dc2('0x52')]=_0x329803[_0x7dc2('0x53')];return db[_0x7dc2('0x1f')][_0x7dc2('0x15')]({'data5':_0x2311db[_0x7dc2('0x50')],'data6':_0x2311db[_0x7dc2('0x52')]},{'where':{'id':_0x2311db['id']}});})[_0x7dc2('0x16')](function(){oauth[_0x7dc2('0x54')](_0x2311db);socket[_0x7dc2('0x55')](_0x7dc2('0x56'),{'id':_0x5ba59b['id']});return;})[_0x7dc2('0x16')](respondWithStatusCode(_0x4998b4,null))[_0x7dc2('0x37')](function(_0x57d050){if(_0x5ba59b){socket[_0x7dc2('0x55')](_0x7dc2('0x57'),{'id':_0x5ba59b['id']});}if(!_0x2311db){logger[_0x7dc2('0x19')](_0x7dc2('0x58'),_0x57d050);return _0x4998b4['status'](0x1f4)[_0x7dc2('0x1b')](_0x57d050['message']);}logger[_0x7dc2('0x19')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x2311db['id'],JSON[_0x7dc2('0x59')](_0x57d050));});};
\ No newline at end of file
+var _0x2baf=['status','json','offset','undefined','limit','count','set','Content-Range','destroy','then','sendStatus','error','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','show','params','options','find','decryptString','create','Name\x20parameter\x20not\x20specified','values','includes','body','join','encryptString','catch','oauth2MicrosoftAuthorize','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','update','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','socket.io-emitter','end'];(function(_0x58d5ac,_0x11c4bc){var _0x37985c=function(_0x419671){while(--_0x419671){_0x58d5ac['push'](_0x58d5ac['shift']());}};_0x37985c(++_0x11c4bc);}(_0x2baf,0x1cd));var _0xf2ba=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x2baf[_0x2afbb0];return _0x411ff2;};'use strict';var _=require(_0xf2ba('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var encryptor=require('../../components/encryptor');var config=require(_0xf2ba('0x1'));var logger=require('../../config/logger')(_0xf2ba('0x2'));var db=require(_0xf2ba('0x3'))['db'];var oauth=require(_0xf2ba('0x4'));config[_0xf2ba('0x5')]=_[_0xf2ba('0x6')](config[_0xf2ba('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xf2ba('0x7'))(new Redis(config[_0xf2ba('0x5')]));var redis=new Redis(config[_0xf2ba('0x5')]);function respondWithStatusCode(_0x22f241,_0x3cda5e){_0x3cda5e=_0x3cda5e||0xcc;return function(_0x404681){if(_0x404681){return _0x22f241['sendStatus'](_0x3cda5e);}return _0x22f241['status'](_0x3cda5e)[_0xf2ba('0x8')]();};}function respondWithResult(_0x8b9c94,_0x2b84bf){_0x2b84bf=_0x2b84bf||0xc8;return function(_0x21ae11){if(_0x21ae11){return _0x8b9c94[_0xf2ba('0x9')](_0x2b84bf)[_0xf2ba('0xa')](_0x21ae11);}};}function respondWithFilteredResult(_0x1c1c9d,_0x4a55c9){return function(_0x15d5c6){if(_0x15d5c6){var _0x4616a2=typeof _0x4a55c9[_0xf2ba('0xb')]===_0xf2ba('0xc')&&typeof _0x4a55c9[_0xf2ba('0xd')]===_0xf2ba('0xc');var _0x266448=_0x15d5c6[_0xf2ba('0xe')];var _0x2e06d1=_0x4616a2?0x0:_0x4a55c9[_0xf2ba('0xb')];var _0x1ebec7=_0x4616a2?_0x15d5c6[_0xf2ba('0xe')]:_0x4a55c9['offset']+_0x4a55c9[_0xf2ba('0xd')];var _0x1a02ac;if(_0x1ebec7>=_0x266448){_0x1ebec7=_0x266448;_0x1a02ac=0xc8;}else{_0x1a02ac=0xce;}_0x1c1c9d[_0xf2ba('0x9')](_0x1a02ac);return _0x1c1c9d[_0xf2ba('0xf')](_0xf2ba('0x10'),_0x2e06d1+'-'+_0x1ebec7+'/'+_0x266448)[_0xf2ba('0xa')](_0x15d5c6);}return null;};}function saveUpdates(_0x3f47ea){return function(_0xdaceab){if(_0xdaceab){return _0xdaceab['update'](_0x3f47ea)['then'](function(_0x140fbe){return _0x140fbe;});}return null;};}function removeEntity(_0x1097cf){return function(_0xed32a8){if(_0xed32a8){return _0xed32a8[_0xf2ba('0x11')]()[_0xf2ba('0x12')](function(){_0x1097cf[_0xf2ba('0x9')](0xcc)[_0xf2ba('0x8')]();});}};}function handleEntityNotFound(_0x5d5b82){return function(_0x22d884){if(!_0x22d884){_0x5d5b82[_0xf2ba('0x13')](0x194);}return _0x22d884;};}function handleError(_0xbe698f,_0x52c8ef){_0x52c8ef=_0x52c8ef||0x1f4;return function(_0xa0436a){logger[_0xf2ba('0x14')](_0xa0436a[_0xf2ba('0x15')]);if(_0xa0436a[_0xf2ba('0x16')]){delete _0xa0436a[_0xf2ba('0x16')];}_0xbe698f[_0xf2ba('0x9')](_0x52c8ef)[_0xf2ba('0x17')](_0xa0436a);};}function maskClientSecret(_0x314c5b){return _[_0xf2ba('0x18')](_0x314c5b[_0xf2ba('0x19')](0x0,0x3),0x14,'*');}exports[_0xf2ba('0x1a')]=function(_0x248ff9,_0x61c2fc){var _0x5f3d62={},_0x4146bc={},_0x49894a={'count':0x0,'rows':[]};var _0x384a6f=_[_0xf2ba('0x1b')](db[_0xf2ba('0x1c')][_0xf2ba('0x1d')],function(_0x3ef2b8){return{'name':_0x3ef2b8[_0xf2ba('0x1e')],'type':_0x3ef2b8[_0xf2ba('0x1f')][_0xf2ba('0x20')]};});_0x4146bc['model']=_['map'](_0x384a6f,_0xf2ba('0x16'));_0x4146bc[_0xf2ba('0x21')]=_[_0xf2ba('0x22')](_0x248ff9[_0xf2ba('0x21')]);_0x4146bc['filters']=_[_0xf2ba('0x23')](_0x4146bc[_0xf2ba('0x24')],_0x4146bc[_0xf2ba('0x21')]);_0x5f3d62[_0xf2ba('0x25')]=_['intersection'](_0x4146bc[_0xf2ba('0x24')],qs[_0xf2ba('0x26')](_0x248ff9['query'][_0xf2ba('0x26')]));_0x5f3d62['attributes']=_0x5f3d62[_0xf2ba('0x25')][_0xf2ba('0x27')]?_0x5f3d62[_0xf2ba('0x25')]:_0x4146bc[_0xf2ba('0x24')];if(!_0x248ff9['query'][_0xf2ba('0x28')](_0xf2ba('0x29'))){_0x5f3d62[_0xf2ba('0xd')]=qs['limit'](_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0xd')]);_0x5f3d62[_0xf2ba('0xb')]=qs[_0xf2ba('0xb')](_0x248ff9['query'][_0xf2ba('0xb')]);}_0x5f3d62[_0xf2ba('0x2a')]=qs[_0xf2ba('0x2b')](_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2b')]);_0x5f3d62[_0xf2ba('0x2c')]=qs[_0xf2ba('0x2d')](_['pick'](_0x248ff9['query'],_0x4146bc[_0xf2ba('0x2d')]),_0x384a6f);if(_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2e')]){_0x5f3d62[_0xf2ba('0x2c')]=_['merge'](_0x5f3d62[_0xf2ba('0x2c')],{'$or':_[_0xf2ba('0x1b')](_0x384a6f,function(_0x532063){if(_0x532063[_0xf2ba('0x1f')]!=='VIRTUAL'){var _0x1e375e={};_0x1e375e[_0x532063[_0xf2ba('0x16')]]={'$like':'%'+_0x248ff9[_0xf2ba('0x21')][_0xf2ba('0x2e')]+'%'};return _0x1e375e;}})});}_0x5f3d62=_[_0xf2ba('0x2f')]({},_0x5f3d62,_0x248ff9['options']);var _0x2cd520={'where':_0x5f3d62[_0xf2ba('0x2c')]};return db[_0xf2ba('0x1c')][_0xf2ba('0xe')](_0x2cd520)[_0xf2ba('0x12')](function(_0x3da1cd){_0x49894a['count']=_0x3da1cd;if(_0x248ff9['query'][_0xf2ba('0x30')]){_0x5f3d62[_0xf2ba('0x31')]=[{'all':!![]}];}return db[_0xf2ba('0x1c')][_0xf2ba('0x32')](_0x5f3d62);})[_0xf2ba('0x12')](function(_0x314b9f){_0x49894a[_0xf2ba('0x33')]=_[_0xf2ba('0x1b')](_0x314b9f,function(_0x4362a0){if(_0x4362a0[_0xf2ba('0x34')]===_0xf2ba('0x35')){var _0x50a991=encryptor['decryptString'](_0x4362a0[_0xf2ba('0x36')]);_0x4362a0[_0xf2ba('0x36')]=maskClientSecret(_0x50a991);}return _0x4362a0;});return _0x49894a;})[_0xf2ba('0x12')](respondWithFilteredResult(_0x61c2fc,_0x5f3d62))['catch'](handleError(_0x61c2fc,null));};exports[_0xf2ba('0x37')]=function(_0x1a65bb,_0x520abc){var _0x4c435d={'raw':!![],'where':{'id':_0x1a65bb[_0xf2ba('0x38')]['id']}},_0x174a83={};_0x174a83[_0xf2ba('0x24')]=_['keys'](db['CloudProvider'][_0xf2ba('0x1d')]);_0x174a83[_0xf2ba('0x21')]=_[_0xf2ba('0x22')](_0x1a65bb[_0xf2ba('0x21')]);_0x174a83[_0xf2ba('0x2d')]=_['intersection'](_0x174a83[_0xf2ba('0x24')],_0x174a83[_0xf2ba('0x21')]);_0x4c435d[_0xf2ba('0x25')]=_[_0xf2ba('0x23')](_0x174a83[_0xf2ba('0x24')],qs[_0xf2ba('0x26')](_0x1a65bb[_0xf2ba('0x21')]['fields']));_0x4c435d[_0xf2ba('0x25')]=_0x4c435d[_0xf2ba('0x25')][_0xf2ba('0x27')]?_0x4c435d[_0xf2ba('0x25')]:_0x174a83[_0xf2ba('0x24')];if(_0x1a65bb[_0xf2ba('0x21')]['includeAll']){_0x4c435d[_0xf2ba('0x31')]=[{'all':!![]}];}_0x4c435d=_[_0xf2ba('0x2f')]({},_0x4c435d,_0x1a65bb[_0xf2ba('0x39')]);return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')](_0x4c435d)[_0xf2ba('0x12')](handleEntityNotFound(_0x520abc,null))[_0xf2ba('0x12')](function(_0x23a300){if(_0x23a300[_0xf2ba('0x34')]===_0xf2ba('0x35')){var _0x57bf3c=encryptor[_0xf2ba('0x3b')](_0x23a300['data3']);_0x23a300['data3']=maskClientSecret(_0x57bf3c);}return _0x23a300;})[_0xf2ba('0x12')](respondWithResult(_0x520abc,null))['catch'](handleError(_0x520abc,null));};exports[_0xf2ba('0x3c')]=function(_0x56816f,_0x420925){if(!_0x56816f['body'][_0xf2ba('0x16')])throw new Error(_0xf2ba('0x3d'));if(!_0x56816f['body']['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x229f62=db[_0xf2ba('0x1c')][_0xf2ba('0x1d')]['service'][_0xf2ba('0x3e')];if(!_0x229f62[_0xf2ba('0x3f')](_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x34')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x229f62[_0xf2ba('0x41')](',\x20'));if(_0x56816f[_0xf2ba('0x40')]['service']===_0xf2ba('0x35')&&_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x36')]){_0x56816f[_0xf2ba('0x40')][_0xf2ba('0x36')]=encryptor[_0xf2ba('0x42')](_0x56816f[_0xf2ba('0x40')]['data3']);}return db['CloudProvider'][_0xf2ba('0x3c')](_0x56816f['body'],{})[_0xf2ba('0x12')](respondWithResult(_0x420925,0xc9))['catch'](handleError(_0x420925,null));};exports['update']=function(_0x3f17c5,_0x4552c5){if(_0x3f17c5[_0xf2ba('0x40')]['id']){delete _0x3f17c5[_0xf2ba('0x40')]['id'];}return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')]({'where':{'id':_0x3f17c5[_0xf2ba('0x38')]['id']}})[_0xf2ba('0x12')](handleEntityNotFound(_0x4552c5,null))['then'](function(_0x12f45c){if(_0x12f45c[_0xf2ba('0x34')]===_0xf2ba('0x35')&&_0x3f17c5[_0xf2ba('0x40')][_0xf2ba('0x36')]){_0x3f17c5['body'][_0xf2ba('0x36')]=encryptor['encryptString'](_0x3f17c5[_0xf2ba('0x40')][_0xf2ba('0x36')]);}return _0x12f45c;})[_0xf2ba('0x12')](saveUpdates(_0x3f17c5[_0xf2ba('0x40')],null))[_0xf2ba('0x12')](respondWithResult(_0x4552c5,null))['catch'](handleError(_0x4552c5,null));};exports[_0xf2ba('0x11')]=function(_0x496e50,_0x2afe6d){return db[_0xf2ba('0x1c')][_0xf2ba('0x3a')]({'where':{'id':_0x496e50['params']['id']}})[_0xf2ba('0x12')](handleEntityNotFound(_0x2afe6d,null))[_0xf2ba('0x12')](removeEntity(_0x2afe6d,null))[_0xf2ba('0x43')](handleError(_0x2afe6d,null));};exports[_0xf2ba('0x44')]=function(_0x239142,_0x570282){return db[_0xf2ba('0x1c')]['findOne']({'where':{'id':_0x239142[_0xf2ba('0x38')]['id']},'raw':!![]})['then'](function(_0x36f413){if(!_0x36f413)return _0x570282['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x36f413,_0x239142[_0xf2ba('0x45')]['id'])};})[_0xf2ba('0x12')](respondWithResult(_0x570282,null))[_0xf2ba('0x43')](handleError(_0x570282,null));};exports['oauth2MicrosoftCallback']=function(_0x135851,_0x553759){var _0x384453=_0x135851[_0xf2ba('0x40')];var _0x529656;var _0x1d9aac;if(_0x384453[_0xf2ba('0x14')])throw _0x384453;redis[_0xf2ba('0x46')](_0x384453[_0xf2ba('0x47')])['then'](function(_0x2ab535){if(!_0x2ab535)throw new Error(_0xf2ba('0x48'));_0x529656=JSON[_0xf2ba('0x49')](_0x2ab535);var _0x50230b=Buffer[_0xf2ba('0x4a')](_0x384453['state'],_0xf2ba('0x4b'))[_0xf2ba('0x4c')](_0xf2ba('0x4d'));_0x1d9aac=JSON[_0xf2ba('0x49')](_0x50230b);if(!oauth[_0xf2ba('0x4e')](_0x384453[_0xf2ba('0x4f')],_0x529656[_0xf2ba('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xf2ba('0x51')](_0x384453['state']);return oauth[_0xf2ba('0x52')](_0x384453[_0xf2ba('0x53')],_0x529656);})['then'](function(_0x92bb48){_0x529656['data5']=_0x92bb48[_0xf2ba('0x54')];_0x529656['data6']=_0x92bb48[_0xf2ba('0x55')];return db[_0xf2ba('0x1c')][_0xf2ba('0x56')]({'data5':_0x529656['data5'],'data6':_0x529656['data6']},{'where':{'id':_0x529656['id']}});})[_0xf2ba('0x12')](function(){oauth[_0xf2ba('0x57')](_0x529656);socket[_0xf2ba('0x58')]('microsoftAuthorization:success',{'id':_0x1d9aac['id']});return;})[_0xf2ba('0x12')](respondWithStatusCode(_0x553759,null))[_0xf2ba('0x43')](function(_0x30496c){if(_0x1d9aac){socket[_0xf2ba('0x58')](_0xf2ba('0x59'),{'id':_0x1d9aac['id']});}if(!_0x529656){logger[_0xf2ba('0x14')](_0xf2ba('0x5a'),_0x30496c);return _0x553759[_0xf2ba('0x9')](0x1f4)[_0xf2ba('0x17')](_0x30496c[_0xf2ba('0x5b')]);}logger[_0xf2ba('0x14')](_0xf2ba('0x5c'),_0x529656['id'],JSON[_0xf2ba('0x5d')](_0x30496c));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index a6d5e7e..e3b5ead 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 _0xa061=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','util','../../config/logger','api','moment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa061,0x194));var _0x1a06=function(_0x1e8f35,_0x3db390){_0x1e8f35=_0x1e8f35-0x0;var _0x446c13=_0xa061[_0x1e8f35];return _0x446c13;};'use strict';var _=require('lodash');var util=require(_0x1a06('0x0'));var logger=require(_0x1a06('0x1'))(_0x1a06('0x2'));var moment=require(_0x1a06('0x3'));var BPromise=require(_0x1a06('0x4'));var rp=require(_0x1a06('0x5'));var fs=require('fs');var path=require(_0x1a06('0x6'));var rimraf=require(_0x1a06('0x7'));var config=require(_0x1a06('0x8'));var attributes=require(_0x1a06('0x9'));module['exports']=function(_0x6cd83c,_0xe07b0){return _0x6cd83c[_0x1a06('0xa')](_0x1a06('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3af5=['CloudProvider','cloud_providers','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3af5,0x1db));var _0x53af=function(_0x4277b0,_0x2b2cf6){_0x4277b0=_0x4277b0-0x0;var _0x57c93f=_0x3af5[_0x4277b0];return _0x57c93f;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var logger=require(_0x53af('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x53af('0x3'));var fs=require('fs');var path=require(_0x53af('0x4'));var rimraf=require(_0x53af('0x5'));var config=require(_0x53af('0x6'));var attributes=require(_0x53af('0x7'));module['exports']=function(_0x41c533,_0xcb68dc){return _0x41c533[_0x53af('0x8')](_0x53af('0x9'),attributes,{'tableName':_0x53af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 75de99b..f4551a1 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf65b=['https://outlook.office365.com/IMAP.AccessAsUser.All','replace','data2','code','id_token','from','toString','base64','randomBytes','hex','response_type','data4','form_post','scope','state','nonce','login','oauth2Claims','oauth2/','data1','set','stringify','payload','issuer','aud','audience','unix','exp','then','data3','CloudProvider','findOne','refresh_token','data6','POST','{TENANT_ID}','data5','access_token','update','error','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join'];(function(_0x3d3c35,_0x4957eb){var _0x1ae732=function(_0x487c49){while(--_0x487c49){_0x3d3c35['push'](_0x3d3c35['shift']());}};_0x1ae732(++_0x4957eb);}(_0xf65b,0x78));var _0xbf65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf65b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbf65('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xbf65('0x1'));var Redis=require(_0xbf65('0x2'));var rp=require(_0xbf65('0x3'));var util=require('util');var encryptor=require(_0xbf65('0x4'));var config=require(_0xbf65('0x5'));var logger=require(_0xbf65('0x6'))('api');var schedule=require(_0xbf65('0x7'));var db=require(_0xbf65('0x8'))['db'];config[_0xbf65('0x9')]=_['defaults'](config[_0xbf65('0x9')],{'host':_0xbf65('0xa'),'port':0x18eb});var redis=new Redis(config[_0xbf65('0x9')]);var MICROSOFT_AUTH_URL=_0xbf65('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xbf65('0xc'),_0xbf65('0xd'),_0xbf65('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xbf65('0xf'),_0xbf65('0x10')],'Dynamics365':[_0xbf65('0xc'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xbf65('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0xbf65('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3938bc){var _0x2ddf0d=_[_0xbf65('0x13')](AZURE_AUTH_SCOPES[_0x3938bc[_0xbf65('0x14')]]);if(_0x3938bc[_0xbf65('0x14')]===_0xbf65('0x15'))_0x2ddf0d[_0xbf65('0x16')](_0x3938bc[_0xbf65('0x17')]+_0xbf65('0x18'));return _0x2ddf0d[_0xbf65('0x19')]('\x20');}function getAccessTokenScope(_0x62780d){if(_0x62780d['type']==='Outlook365')return _0xbf65('0x1a');if(_0x62780d[_0xbf65('0x14')]==='Dynamics365')return _0x62780d[_0xbf65('0x17')]+_0xbf65('0x18');}function generateMicrosoftAuthorizationUrl(_0x4eeb47,_0xa03291){var _0x5c3441=MICROSOFT_AUTH_URL[_0xbf65('0x1b')]('{TENANT_ID}',_0x4eeb47[_0xbf65('0x1c')]);var _0x4b3a87=[_0xbf65('0x1d'),_0xbf65('0x1e')];var _0x3146e7=Buffer[_0xbf65('0x1f')](JSON['stringify']({'id':_0xa03291}))[_0xbf65('0x20')](_0xbf65('0x21'));var _0x40f866=crypto[_0xbf65('0x22')](0x10)[_0xbf65('0x20')](_0xbf65('0x23'));var _0x3f8cc7=getAuthorizationScopes(_0x4eeb47);var _0x32382f=[{'key':'client_id','value':_0x4eeb47['data1']},{'key':_0xbf65('0x24'),'value':encodeURIComponent(_0x4b3a87[_0xbf65('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x4eeb47[_0xbf65('0x25')]},{'key':'response_mode','value':_0xbf65('0x26')},{'key':_0xbf65('0x27'),'value':encodeURIComponent(_0x3f8cc7)},{'key':_0xbf65('0x28'),'value':_0x3146e7},{'key':_0xbf65('0x29'),'value':_0x40f866},{'key':'prompt','value':_0xbf65('0x2a')}];var _0x247cca=_0x5c3441+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xbf65('0x13')](_0x32382f,function(_0x15e705){return _0x15e705['key']+'='+_0x15e705['value'];})['join']('&');_0x4eeb47[_0xbf65('0x2b')]={'issuer':_0x5c3441[_0xbf65('0x1b')](_0xbf65('0x2c'),''),'audience':_0x4eeb47[_0xbf65('0x2d')],'state':_0x3146e7,'nonce':_0x40f866};redis[_0xbf65('0x2e')](_0x3146e7,JSON[_0xbf65('0x2f')](_0x4eeb47));return _0x247cca;}function isValidIdToken(_0x48177c,_0x5da0d5){try{var _0x5e05b9=jwt['decode'](_0x48177c,{'complete':!![]});var _0x3847bf=_0x5e05b9[_0xbf65('0x30')];if(_0x3847bf['iss']!==_0x5da0d5[_0xbf65('0x31')])return![];if(_0x3847bf[_0xbf65('0x32')]!==_0x5da0d5[_0xbf65('0x33')])return![];if(_0x3847bf[_0xbf65('0x29')]!==_0x5da0d5['nonce'])return![];if(moment()['isAfter'](moment[_0xbf65('0x34')](_0x3847bf[_0xbf65('0x35')])))return![];return!![];}catch(_0x1d2aed){throw _0x1d2aed;}}function refreshOauth2MicrosoftAccessToken(_0x52a09c){return Promise['resolve']()[_0xbf65('0x36')](function(){if(_0x52a09c[_0xbf65('0x37')])return _0x52a09c;return db[_0xbf65('0x38')][_0xbf65('0x39')]({'where':{'id':_0x52a09c['id']},'raw':!![]});})['then'](function(_0x35ab4d){var _0x1f958a={'grant_type':_0xbf65('0x3a'),'refresh_token':_0x35ab4d[_0xbf65('0x3b')],'scope':getAccessTokenScope(_0x35ab4d),'redirect_uri':_0x35ab4d[_0xbf65('0x25')],'client_id':_0x35ab4d[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x35ab4d[_0xbf65('0x37')])};var _0x46d0d6={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x35ab4d['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1f958a,'json':!![]};return rp(_0x46d0d6);})['then'](function(_0xef712a){_0x52a09c[_0xbf65('0x3e')]=_0xef712a[_0xbf65('0x3f')];_0x52a09c[_0xbf65('0x3b')]=_0xef712a[_0xbf65('0x3a')];return db[_0xbf65('0x38')][_0xbf65('0x40')]({'data5':_0x52a09c[_0xbf65('0x3e')],'data6':_0x52a09c['data6']},{'where':{'id':_0x52a09c['id']}});})['then'](function(){return _0x52a09c;})['catch'](function(_0x2ecd4e){logger[_0xbf65('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x52a09c['id'],_0x2ecd4e);});}function getOauth2MicrosoftAccessToken(_0x99bc59,_0x4abf68){var _0x4d712d={'grant_type':'authorization_code','code':_0x99bc59,'scope':getAccessTokenScope(_0x4abf68),'redirect_uri':_0x4abf68[_0xbf65('0x25')],'client_id':_0x4abf68[_0xbf65('0x2d')],'client_secret':encryptor['decryptString'](_0x4abf68['data3'])};var _0x577871={'method':_0xbf65('0x3c'),'uri':MICROSOFT_AUTH_URL[_0xbf65('0x1b')](_0xbf65('0x3d'),_0x4abf68[_0xbf65('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4d712d,'json':!![]};return rp(_0x577871);}function startRefreshInterval(_0x2941be){var _0x3f01eb=schedule[_0xbf65('0x42')];if(_0x3f01eb[_0x2941be['id']])clearInterval(_0x3f01eb[_0x2941be['id']]);_0x3f01eb[_0x2941be['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xbf65('0x43')](this,{'id':_0x2941be['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3f01eb;}function startAllRefreshIntervals(){return db[_0xbf65('0x38')][_0xbf65('0x44')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xae8d45){var _0x4ffaf0=_0xae8d45['map'](function(_0x4351a8){return refreshOauth2MicrosoftAccessToken(_0x4351a8)[_0xbf65('0x36')](function(_0x1f3126){startRefreshInterval(_0x1f3126);});});return Promise[_0xbf65('0x45')](_0x4ffaf0);})['catch'](function(_0x22625b){var _0x47a76f=_0x22625b?util[_0xbf65('0x46')](_0x22625b,{'showHidden':![],'depth':null}):'';logger[_0xbf65('0x41')](_0xbf65('0x47'),_0x47a76f);});}module[_0xbf65('0x48')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0xdbb3=['bind','findAll','all','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','data7','/.default','join','replace','data2','code','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','POST','intervals'];(function(_0x8d5e52,_0x40df7b){var _0x563f85=function(_0xcd4da7){while(--_0xcd4da7){_0x8d5e52['push'](_0x8d5e52['shift']());}};_0x563f85(++_0x40df7b);}(_0xdbb3,0x1ea));var _0x3dbb=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xdbb3[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x3dbb('0x0'));var crypto=require(_0x3dbb('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x3dbb('0x2'));var Redis=require(_0x3dbb('0x3'));var rp=require(_0x3dbb('0x4'));var util=require(_0x3dbb('0x5'));var encryptor=require(_0x3dbb('0x6'));var config=require(_0x3dbb('0x7'));var logger=require(_0x3dbb('0x8'))(_0x3dbb('0x9'));var schedule=require(_0x3dbb('0xa'));var db=require(_0x3dbb('0xb'))['db'];config[_0x3dbb('0xc')]=_[_0x3dbb('0xd')](config[_0x3dbb('0xc')],{'host':_0x3dbb('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x3dbb('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x3dbb('0x10'),_0x3dbb('0x11'),_0x3dbb('0x12'),_0x3dbb('0x13'),_0x3dbb('0x14'),_0x3dbb('0x15'),_0x3dbb('0x16')],'Dynamics365':['openid',_0x3dbb('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0x3dbb('0x17');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x334860){var _0x3a3dc0=_[_0x3dbb('0x18')](AZURE_AUTH_SCOPES[_0x334860[_0x3dbb('0x19')]]);if(_0x334860[_0x3dbb('0x19')]===_0x3dbb('0x1a'))_0x3a3dc0['push'](_0x334860[_0x3dbb('0x1b')]+_0x3dbb('0x1c'));return _0x3a3dc0[_0x3dbb('0x1d')]('\x20');}function getAccessTokenScope(_0x5b7f2d){if(_0x5b7f2d[_0x3dbb('0x19')]==='Outlook365')return _0x3dbb('0x14');if(_0x5b7f2d[_0x3dbb('0x19')]===_0x3dbb('0x1a'))return _0x5b7f2d[_0x3dbb('0x1b')]+_0x3dbb('0x1c');}function generateMicrosoftAuthorizationUrl(_0x141ba0,_0x39293b){var _0x2eb46c=MICROSOFT_AUTH_URL[_0x3dbb('0x1e')]('{TENANT_ID}',_0x141ba0[_0x3dbb('0x1f')]);var _0x5ce3a7=[_0x3dbb('0x20'),'id_token'];var _0x504686=Buffer[_0x3dbb('0x21')](JSON[_0x3dbb('0x22')]({'id':_0x39293b}))[_0x3dbb('0x23')]('base64');var _0x33aea8=crypto[_0x3dbb('0x24')](0x10)['toString'](_0x3dbb('0x25'));var _0x25330e=getAuthorizationScopes(_0x141ba0);var _0x341ae3=[{'key':_0x3dbb('0x26'),'value':_0x141ba0[_0x3dbb('0x27')]},{'key':_0x3dbb('0x28'),'value':encodeURIComponent(_0x5ce3a7['join']('\x20'))},{'key':_0x3dbb('0x29'),'value':_0x141ba0['data4']},{'key':_0x3dbb('0x2a'),'value':_0x3dbb('0x2b')},{'key':_0x3dbb('0x2c'),'value':encodeURIComponent(_0x25330e)},{'key':_0x3dbb('0x2d'),'value':_0x504686},{'key':_0x3dbb('0x2e'),'value':_0x33aea8},{'key':_0x3dbb('0x2f'),'value':'login'}];var _0x560c6d=_0x2eb46c+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x341ae3,function(_0x3b15cc){return _0x3b15cc['key']+'='+_0x3b15cc[_0x3dbb('0x30')];})[_0x3dbb('0x1d')]('&');_0x141ba0[_0x3dbb('0x31')]={'issuer':_0x2eb46c[_0x3dbb('0x1e')](_0x3dbb('0x32'),''),'audience':_0x141ba0[_0x3dbb('0x27')],'state':_0x504686,'nonce':_0x33aea8};redis[_0x3dbb('0x33')](_0x504686,JSON[_0x3dbb('0x22')](_0x141ba0));return _0x560c6d;}function isValidIdToken(_0x1813ee,_0x423641){try{var _0x18ccd=jwt[_0x3dbb('0x34')](_0x1813ee,{'complete':!![]});var _0xe30df1=_0x18ccd[_0x3dbb('0x35')];if(_0xe30df1[_0x3dbb('0x36')]!==_0x423641[_0x3dbb('0x37')])return![];if(_0xe30df1[_0x3dbb('0x38')]!==_0x423641[_0x3dbb('0x39')])return![];if(_0xe30df1[_0x3dbb('0x2e')]!==_0x423641[_0x3dbb('0x2e')])return![];if(moment()[_0x3dbb('0x3a')](moment[_0x3dbb('0x3b')](_0xe30df1[_0x3dbb('0x3c')])))return![];return!![];}catch(_0x5e5ec4){throw _0x5e5ec4;}}function refreshOauth2MicrosoftAccessToken(_0x41a73a){return Promise[_0x3dbb('0x3d')]()[_0x3dbb('0x3e')](function(){if(_0x41a73a[_0x3dbb('0x3f')])return _0x41a73a;return db[_0x3dbb('0x40')]['findOne']({'where':{'id':_0x41a73a['id']},'raw':!![]});})[_0x3dbb('0x3e')](function(_0x18b66f){var _0x4453dd={'grant_type':_0x3dbb('0x41'),'refresh_token':_0x18b66f[_0x3dbb('0x42')],'scope':getAccessTokenScope(_0x18b66f),'redirect_uri':_0x18b66f['data4'],'client_id':_0x18b66f[_0x3dbb('0x27')],'client_secret':encryptor[_0x3dbb('0x43')](_0x18b66f[_0x3dbb('0x3f')])};var _0x42006e={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x3dbb('0x44'),_0x18b66f[_0x3dbb('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4453dd,'json':!![]};return rp(_0x42006e);})['then'](function(_0x339a6a){_0x41a73a[_0x3dbb('0x45')]=_0x339a6a[_0x3dbb('0x46')];_0x41a73a['data6']=_0x339a6a[_0x3dbb('0x41')];return db[_0x3dbb('0x40')]['update']({'data5':_0x41a73a[_0x3dbb('0x45')],'data6':_0x41a73a['data6']},{'where':{'id':_0x41a73a['id']}});})[_0x3dbb('0x3e')](function(){return _0x41a73a;})['catch'](function(_0x118c69){logger[_0x3dbb('0x47')](_0x3dbb('0x48'),_0x41a73a['id'],_0x118c69);});}function getOauth2MicrosoftAccessToken(_0x2f9fc4,_0x15a44e){var _0x57ac89={'grant_type':_0x3dbb('0x49'),'code':_0x2f9fc4,'scope':getAccessTokenScope(_0x15a44e),'redirect_uri':_0x15a44e[_0x3dbb('0x4a')],'client_id':_0x15a44e[_0x3dbb('0x27')],'client_secret':encryptor['decryptString'](_0x15a44e[_0x3dbb('0x3f')])};var _0x239cc7={'method':_0x3dbb('0x4b'),'uri':MICROSOFT_AUTH_URL['replace'](_0x3dbb('0x44'),_0x15a44e[_0x3dbb('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x57ac89,'json':!![]};return rp(_0x239cc7);}function startRefreshInterval(_0x275144){var _0x2249b9=schedule[_0x3dbb('0x4c')];if(_0x2249b9[_0x275144['id']])clearInterval(_0x2249b9[_0x275144['id']]);_0x2249b9[_0x275144['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x3dbb('0x4d')](this,{'id':_0x275144['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x3dbb('0x4c')]=_0x2249b9;}function startAllRefreshIntervals(){return db[_0x3dbb('0x40')][_0x3dbb('0x4e')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x17999d){var _0x2b983e=_0x17999d['map'](function(_0x132867){return refreshOauth2MicrosoftAccessToken(_0x132867)[_0x3dbb('0x3e')](function(_0xa89f1e){startRefreshInterval(_0xa89f1e);});});return Promise[_0x3dbb('0x4f')](_0x2b983e);})['catch'](function(_0x249ce6){var _0x33d9cf=_0x249ce6?util['inspect'](_0x249ce6,{'showHidden':![],'depth':null}):'';logger[_0x3dbb('0x47')](_0x3dbb('0x50'),_0x33d9cf);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 1c5966d..894586b 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 _0xd05a=['info','result','catch','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd05a,0x143));var _0xad05=function(_0x4433f9,_0xa9dd70){_0x4433f9=_0x4433f9-0x0;var _0x1bc092=_0xd05a[_0x4433f9];return _0x1bc092;};'use strict';var _=require('lodash');var util=require(_0xad05('0x0'));var moment=require(_0xad05('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xad05('0x2'));var logger=require(_0xad05('0x3'))(_0xad05('0x4'));var config=require(_0xad05('0x5'));var jayson=require(_0xad05('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39ddaf,_0x45303c,_0xd12d76){return new BPromise(function(_0x565f85,_0x17ec26){return client[_0xad05('0x7')](_0x39ddaf,_0xd12d76)[_0xad05('0x8')](function(_0x573acb){logger['info'](_0xad05('0x9'),_0x45303c,'request\x20sent');logger[_0xad05('0xa')](_0xad05('0xb'),_0x45303c,_0xad05('0xc'),JSON[_0xad05('0xd')](_0x573acb));if(_0x573acb[_0xad05('0xe')]){if(_0x573acb[_0xad05('0xe')][_0xad05('0xf')]===0x1f4){logger[_0xad05('0xe')](_0xad05('0x9'),_0x45303c,_0x573acb[_0xad05('0xe')]['message']);return _0x17ec26(_0x573acb[_0xad05('0xe')]['message']);}logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x573acb[_0xad05('0xe')][_0xad05('0x10')]);return _0x565f85(_0x573acb[_0xad05('0xe')]['message']);}else{logger[_0xad05('0x11')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0xad05('0xc'));_0x565f85(_0x573acb[_0xad05('0x12')][_0xad05('0x10')]);}})[_0xad05('0x13')](function(_0x43ab03){logger[_0xad05('0xe')]('CloudProvider,\x20%s,\x20%s',_0x45303c,_0x43ab03);_0x17ec26(_0x43ab03);});});}
\ No newline at end of file
+var _0x7d06=['CloudProvider,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7d06,0x158));var _0x67d0=function(_0x204a77,_0x40ae18){_0x204a77=_0x204a77-0x0;var _0x348407=_0x7d06[_0x204a77];return _0x348407;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 3885a40..52d0047 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x7a54,0x106));var _0x47a5=function(_0x3c03e6,_0x2a7f15){_0x3c03e6=_0x3c03e6-0x0;var _0xf6c0e7=_0x7a54[_0x3c03e6];return _0xf6c0e7;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x39bf17,_0x319d5e){var _0x1ccf1d=function(_0x1244ec){while(--_0x1244ec){_0x39bf17['push'](_0x39bf17['shift']());}};_0x1ccf1d(++_0x319d5e);}(_0x2ef3,0xba));var _0x32ef=function(_0x28cffc,_0x59e0c3){_0x28cffc=_0x28cffc-0x0;var _0x4253d4=_0x2ef3[_0x28cffc];return _0x4253d4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('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 9ae73f9..faa2c47 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 _0x47b4=['STRING','name','sequelize'];(function(_0x47c88e,_0x404a49){var _0x301c8c=function(_0x4abf34){while(--_0x4abf34){_0x47c88e['push'](_0x47c88e['shift']());}};_0x301c8c(++_0x404a49);}(_0x47b4,0x1e2));var _0x447b=function(_0x22f215,_0x1e877c){_0x22f215=_0x22f215-0x0;var _0x3971a5=_0x47b4[_0x22f215];return _0x3971a5;};'use strict';var Sequelize=require(_0x447b('0x0'));module['exports']={'name':{'type':Sequelize[_0x447b('0x1')],'unique':_0x447b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x447b('0x1')]},'website':{'type':Sequelize[_0x447b('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x447b('0x1')]},'type':{'type':Sequelize[_0x447b('0x1')]},'street':{'type':Sequelize[_0x447b('0x1')]},'postalCode':{'type':Sequelize[_0x447b('0x1')]},'city':{'type':Sequelize[_0x447b('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x447b('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x447b('0x1')]},'sCity':{'type':Sequelize[_0x447b('0x1')]},'sCountry':{'type':Sequelize[_0x447b('0x1')]},'description':{'type':Sequelize[_0x447b('0x1')]}};
\ No newline at end of file
+var _0x6824=['exports','STRING','sequelize'];(function(_0xbb0ce8,_0xb63549){var _0x1a1b17=function(_0x171af3){while(--_0x171af3){_0xbb0ce8['push'](_0xbb0ce8['shift']());}};_0x1a1b17(++_0xb63549);}(_0x6824,0x80));var _0x4682=function(_0x248d93,_0xf9322c){_0x248d93=_0x248d93-0x0;var _0x1abac3=_0x6824[_0x248d93];return _0x1abac3;};'use strict';var Sequelize=require(_0x4682('0x0'));module[_0x4682('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4682('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x4682('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4682('0x2')]},'type':{'type':Sequelize[_0x4682('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4682('0x2')]},'country':{'type':Sequelize[_0x4682('0x2')]},'email':{'type':Sequelize[_0x4682('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x4682('0x2')]},'sPostalCode':{'type':Sequelize[_0x4682('0x2')]},'sCity':{'type':Sequelize[_0x4682('0x2')]},'sCountry':{'type':Sequelize[_0x4682('0x2')]},'description':{'type':Sequelize[_0x4682('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 2ba454f..b41ee60 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 _0xb835=['query','intersection','attributes','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Companies','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','CmCompany','model','keys'];(function(_0xabfe60,_0x2c61fe){var _0x3aa022=function(_0xcb4e81){while(--_0xcb4e81){_0xabfe60['push'](_0xabfe60['shift']());}};_0x3aa022(++_0x2c61fe);}(_0xb835,0xd3));var _0x5b83=function(_0x5bb1f2,_0x18a496){_0x5bb1f2=_0x5bb1f2-0x0;var _0xc894b5=_0xb835[_0x5bb1f2];return _0xc894b5;};'use strict';var emlformat=require(_0x5b83('0x0'));var rimraf=require(_0x5b83('0x1'));var zipdir=require(_0x5b83('0x2'));var jsonpatch=require(_0x5b83('0x3'));var rp=require('request-promise');var moment=require(_0x5b83('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5b83('0x5'));var util=require(_0x5b83('0x6'));var path=require(_0x5b83('0x7'));var sox=require('sox');var csv=require(_0x5b83('0x8'));var ejs=require(_0x5b83('0x9'));var fs=require('fs');var fs_extra=require(_0x5b83('0xa'));var _=require(_0x5b83('0xb'));var squel=require(_0x5b83('0xc'));var crypto=require(_0x5b83('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5b83('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b83('0xf'));var Papa=require(_0x5b83('0x10'));var Redis=require(_0x5b83('0x11'));var authService=require(_0x5b83('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b83('0x13'));var hardwareService=require(_0x5b83('0x14'));var logger=require('../../config/logger')(_0x5b83('0x15'));var utils=require(_0x5b83('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5b83('0x17'));var db=require(_0x5b83('0x18'))['db'];function respondWithStatusCode(_0x3fdbcc,_0x1405d0){_0x1405d0=_0x1405d0||0xcc;return function(_0x2832d9){if(_0x2832d9){return _0x3fdbcc['sendStatus'](_0x1405d0);}return _0x3fdbcc[_0x5b83('0x19')](_0x1405d0)['end']();};}function respondWithResult(_0x3a457e,_0x3ef26e){_0x3ef26e=_0x3ef26e||0xc8;return function(_0x15009c){if(_0x15009c){return _0x3a457e[_0x5b83('0x19')](_0x3ef26e)[_0x5b83('0x1a')](_0x15009c);}};}function respondWithFilteredResult(_0x425721,_0x16690f){return function(_0x5d3905){if(_0x5d3905){var _0x3bc03b=typeof _0x16690f[_0x5b83('0x1b')]==='undefined'&&typeof _0x16690f[_0x5b83('0x1c')]===_0x5b83('0x1d');var _0x4f71c5=_0x5d3905[_0x5b83('0x1e')];var _0x1fc455=_0x3bc03b?0x0:_0x16690f[_0x5b83('0x1b')];var _0x38d642=_0x3bc03b?_0x5d3905[_0x5b83('0x1e')]:_0x16690f[_0x5b83('0x1b')]+_0x16690f['limit'];var _0x2ffbe2;if(_0x38d642>=_0x4f71c5){_0x38d642=_0x4f71c5;_0x2ffbe2=0xc8;}else{_0x2ffbe2=0xce;}_0x425721['status'](_0x2ffbe2);return _0x425721[_0x5b83('0x1f')](_0x5b83('0x20'),_0x1fc455+'-'+_0x38d642+'/'+_0x4f71c5)['json'](_0x5d3905);}return null;};}function patchUpdates(_0x419ea9){return function(_0x404190){try{jsonpatch[_0x5b83('0x21')](_0x404190,_0x419ea9,!![]);}catch(_0x544920){return BPromise[_0x5b83('0x22')](_0x544920);}return _0x404190[_0x5b83('0x23')]();};}function saveUpdates(_0x208da5,_0x5b3214){return function(_0x20c599){if(_0x20c599){return _0x20c599[_0x5b83('0x24')](_0x208da5)[_0x5b83('0x25')](function(_0x2517e0){return _0x2517e0;});}return null;};}function removeEntity(_0x106c8d,_0x18fa83){return function(_0x5425f2){if(_0x5425f2){return _0x5425f2[_0x5b83('0x26')]()['then'](function(){var _0x247b01=_0x5425f2['get']({'plain':!![]});var _0x5c1f70='Companies';return db[_0x5b83('0x27')]['destroy']({'where':{'type':_0x5c1f70,'resourceId':_0x247b01['id']}})[_0x5b83('0x25')](function(){return _0x5425f2;});})[_0x5b83('0x25')](function(){_0x106c8d[_0x5b83('0x19')](0xcc)[_0x5b83('0x28')]();});}};}function handleEntityNotFound(_0x2123d2,_0x1049e2){return function(_0x366b91){if(!_0x366b91){_0x2123d2[_0x5b83('0x29')](0x194);}return _0x366b91;};}function handleError(_0x5c4ed0,_0x50d8bf){_0x50d8bf=_0x50d8bf||0x1f4;return function(_0xfb5327){logger[_0x5b83('0x2a')](_0xfb5327[_0x5b83('0x2b')]);if(_0xfb5327[_0x5b83('0x2c')]){delete _0xfb5327[_0x5b83('0x2c')];}_0x5c4ed0['status'](_0x50d8bf)[_0x5b83('0x2d')](_0xfb5327);};}exports[_0x5b83('0x2e')]=function(_0xadf965,_0x30beba){var _0x31ce6f={},_0x4d6c34={},_0x12623b={'count':0x0,'rows':[]};return db[_0x5b83('0x2f')]['describe']()[_0x5b83('0x25')](function(_0x22c5be){_0x4d6c34[_0x5b83('0x30')]=_[_0x5b83('0x31')](_0x22c5be);_0x4d6c34[_0x5b83('0x32')]=_[_0x5b83('0x31')](_0xadf965[_0x5b83('0x32')]);_0x4d6c34['filters']=_[_0x5b83('0x33')](_0x4d6c34[_0x5b83('0x30')],_0x4d6c34[_0x5b83('0x32')]);_0x31ce6f[_0x5b83('0x34')]=_[_0x5b83('0x33')](_0x4d6c34['model'],qs['fields'](_0xadf965[_0x5b83('0x32')]['fields']));_0x31ce6f[_0x5b83('0x34')]=_0x31ce6f[_0x5b83('0x34')]['length']?_0x31ce6f['attributes']:_0x4d6c34['model'];if(!_0xadf965[_0x5b83('0x32')][_0x5b83('0x35')](_0x5b83('0x36'))){_0x31ce6f[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1c')]);_0x31ce6f['offset']=qs[_0x5b83('0x1b')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x1b')]);}_0x31ce6f['order']=qs[_0x5b83('0x37')](_0xadf965[_0x5b83('0x32')][_0x5b83('0x37')]);_0x31ce6f['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0xadf965[_0x5b83('0x32')],_0x4d6c34[_0x5b83('0x38')]),_0x22c5be);if(_0xadf965[_0x5b83('0x32')][_0x5b83('0x3a')]){_0x31ce6f[_0x5b83('0x3b')]=_[_0x5b83('0x3c')](_0x31ce6f['where'],{'$or':_[_0x5b83('0x3d')](_0x31ce6f[_0x5b83('0x34')],function(_0x308ce6){var _0x1dd83d={};_0x1dd83d[_0x308ce6]={'$like':'%'+_0xadf965['query']['filter']+'%'};return _0x1dd83d;})});}_0x31ce6f=_[_0x5b83('0x3c')]({},_0x31ce6f,_0xadf965[_0x5b83('0x3e')]);var _0x592931={'where':_0x31ce6f['where']};return db[_0x5b83('0x2f')][_0x5b83('0x1e')](_0x592931)[_0x5b83('0x25')](function(_0x96b606){_0x12623b['count']=_0x96b606;if(_0xadf965['query'][_0x5b83('0x3f')]){_0x31ce6f[_0x5b83('0x40')]=[{'all':!![]}];}return db[_0x5b83('0x2f')]['findAll'](_0x31ce6f);})[_0x5b83('0x25')](function(_0x3d3591){_0x12623b[_0x5b83('0x41')]=_0x3d3591;return _0x12623b;})[_0x5b83('0x25')](respondWithFilteredResult(_0x30beba,_0x31ce6f))[_0x5b83('0x42')](handleError(_0x30beba,null));})[_0x5b83('0x42')](handleError(_0x30beba,null));};exports[_0x5b83('0x43')]=function(_0xec61fe,_0x5260bc){var _0x300311={'raw':![],'where':{'id':_0xec61fe[_0x5b83('0x44')]['id']}},_0x196ad1={};_0x196ad1[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x2f')][_0x5b83('0x45')]);_0x196ad1['query']=_[_0x5b83('0x31')](_0xec61fe[_0x5b83('0x32')]);_0x196ad1[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],_0x196ad1[_0x5b83('0x32')]);_0x300311['attributes']=_[_0x5b83('0x33')](_0x196ad1[_0x5b83('0x30')],qs['fields'](_0xec61fe['query'][_0x5b83('0x46')]));_0x300311[_0x5b83('0x34')]=_0x300311[_0x5b83('0x34')][_0x5b83('0x47')]?_0x300311[_0x5b83('0x34')]:_0x196ad1[_0x5b83('0x30')];if(_0xec61fe[_0x5b83('0x32')][_0x5b83('0x3f')]){_0x300311['include']=[{'all':!![]}];}_0x300311=_[_0x5b83('0x3c')]({},_0x300311,_0xec61fe[_0x5b83('0x3e')]);return db[_0x5b83('0x2f')][_0x5b83('0x48')](_0x300311)['then'](handleEntityNotFound(_0x5260bc,null))[_0x5b83('0x25')](respondWithResult(_0x5260bc,null))[_0x5b83('0x42')](handleError(_0x5260bc,null));};exports['create']=function(_0x277042,_0x465cf1){return db[_0x5b83('0x2f')][_0x5b83('0x49')](_0x277042[_0x5b83('0x4a')],{})[_0x5b83('0x25')](function(_0x72fdfc){var _0x41b23e=_0x277042[_0x5b83('0x4b')]['get']({'plain':!![]});if(!_0x41b23e)throw new Error(_0x5b83('0x4c'));if(_0x41b23e['role']===_0x5b83('0x4b')){var _0x1819e6=_0x72fdfc[_0x5b83('0x4d')]({'plain':!![]});var _0x2239c5=_0x5b83('0x4e');return db[_0x5b83('0x4f')]['find']({'where':{'name':_0x2239c5,'userProfileId':_0x41b23e['userProfileId']},'raw':!![]})[_0x5b83('0x25')](function(_0x53b65f){if(_0x53b65f&&_0x53b65f['autoAssociation']===0x0){return db[_0x5b83('0x27')][_0x5b83('0x49')]({'name':_0x1819e6[_0x5b83('0x2c')],'resourceId':_0x1819e6['id'],'type':_0x53b65f[_0x5b83('0x2c')],'sectionId':_0x53b65f['id']},{})[_0x5b83('0x25')](function(){return _0x72fdfc;});}else{return _0x72fdfc;}})[_0x5b83('0x42')](function(_0x20c6cb){logger['error'](_0x5b83('0x50'),_0x20c6cb);throw _0x20c6cb;});}return _0x72fdfc;})[_0x5b83('0x25')](respondWithResult(_0x465cf1,0xc9))['catch'](handleError(_0x465cf1,null));};exports['update']=function(_0x551269,_0x50a3ad){if(_0x551269[_0x5b83('0x4a')]['id']){delete _0x551269[_0x5b83('0x4a')]['id'];}return db[_0x5b83('0x2f')]['find']({'where':{'id':_0x551269[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x50a3ad,null))['then'](saveUpdates(_0x551269['body'],null))[_0x5b83('0x25')](respondWithResult(_0x50a3ad,null))[_0x5b83('0x42')](handleError(_0x50a3ad,null));};exports['destroy']=function(_0x4c49b5,_0x5d26d6){return db['CmCompany'][_0x5b83('0x48')]({'where':{'id':_0x4c49b5[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d26d6,null))[_0x5b83('0x25')](removeEntity(_0x5d26d6,null))[_0x5b83('0x42')](handleError(_0x5d26d6,null));};exports['describe']=function(_0x138b3c,_0x3d9be8){return db[_0x5b83('0x2f')][_0x5b83('0x51')]()[_0x5b83('0x25')](respondWithResult(_0x3d9be8,null))[_0x5b83('0x42')](handleError(_0x3d9be8,null));};exports[_0x5b83('0x52')]=function(_0x49851f,_0x3aaa97,_0x5e307f){return db[_0x5b83('0x53')][_0x5b83('0x48')]({'where':{'id':_0x49851f[_0x5b83('0x44')]['id']}})['then'](handleEntityNotFound(_0x3aaa97,null))[_0x5b83('0x25')](function(_0x42a687){if(_0x42a687){return _0x42a687[_0x5b83('0x52')](_0x49851f['body'][_0x5b83('0x54')],_['omit'](_0x49851f[_0x5b83('0x4a')],[_0x5b83('0x54'),'id'])||{});}})[_0x5b83('0x25')](respondWithResult(_0x3aaa97,null))['catch'](handleError(_0x3aaa97,null));};exports[_0x5b83('0x55')]=function(_0x509753,_0x4d6736,_0x5afaab){var _0x10ee37={};var _0x5437f2={};var _0x5a2873;var _0x47d28c;return db['CmCompany'][_0x5b83('0x56')]({'where':{'id':_0x509753[_0x5b83('0x44')]['id']}})[_0x5b83('0x25')](handleEntityNotFound(_0x4d6736,null))[_0x5b83('0x25')](function(_0x55e5b7){if(_0x55e5b7){_0x5a2873=_0x55e5b7;_0x5437f2[_0x5b83('0x30')]=_[_0x5b83('0x31')](db[_0x5b83('0x53')]['rawAttributes']);_0x5437f2[_0x5b83('0x32')]=_['keys'](_0x509753[_0x5b83('0x32')]);_0x5437f2[_0x5b83('0x38')]=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],_0x5437f2['query']);_0x10ee37['attributes']=_[_0x5b83('0x33')](_0x5437f2[_0x5b83('0x30')],qs['fields'](_0x509753[_0x5b83('0x32')]['fields']));_0x10ee37['attributes']=_0x10ee37[_0x5b83('0x34')][_0x5b83('0x47')]?_0x10ee37['attributes']:_0x5437f2[_0x5b83('0x30')];_0x10ee37['order']=qs[_0x5b83('0x37')](_0x509753[_0x5b83('0x32')][_0x5b83('0x37')]);_0x10ee37['where']=qs[_0x5b83('0x38')](_[_0x5b83('0x39')](_0x509753[_0x5b83('0x32')],_0x5437f2[_0x5b83('0x38')]));if(_0x509753['query'][_0x5b83('0x3a')]){_0x10ee37['where']=_[_0x5b83('0x3c')](_0x10ee37[_0x5b83('0x3b')],{'$or':_[_0x5b83('0x3d')](_0x10ee37['attributes'],function(_0x75c334){var _0x54381f={};_0x54381f[_0x75c334]={'$like':'%'+_0x509753[_0x5b83('0x32')][_0x5b83('0x3a')]+'%'};return _0x54381f;})});}_0x10ee37=_[_0x5b83('0x3c')]({},_0x10ee37,_0x509753['options']);return _0x5a2873[_0x5b83('0x55')](_0x10ee37);}})[_0x5b83('0x25')](function(_0x33d296){if(_0x33d296){_0x47d28c=_0x33d296[_0x5b83('0x47')];if(!_0x509753[_0x5b83('0x32')][_0x5b83('0x35')]('nolimit')){_0x10ee37[_0x5b83('0x1c')]=qs[_0x5b83('0x1c')](_0x509753['query'][_0x5b83('0x1c')]);_0x10ee37[_0x5b83('0x1b')]=qs[_0x5b83('0x1b')](_0x509753['query'][_0x5b83('0x1b')]);}return _0x5a2873['getContacts'](_0x10ee37);}})[_0x5b83('0x25')](function(_0x258dda){if(_0x258dda){return _0x258dda?{'count':_0x47d28c,'rows':_0x258dda}:null;}})[_0x5b83('0x25')](respondWithResult(_0x4d6736,null))[_0x5b83('0x42')](handleError(_0x4d6736,null));};
\ No newline at end of file
+var _0x56cc=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','save','update','then','destroy','get','UserProfileResource','error','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','count','include','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection'];(function(_0x1f0f46,_0x3873ff){var _0x5d12f8=function(_0x455bf7){while(--_0x455bf7){_0x1f0f46['push'](_0x1f0f46['shift']());}};_0x5d12f8(++_0x3873ff);}(_0x56cc,0x1db));var _0xc56c=function(_0x20dbe5,_0x15a188){_0x20dbe5=_0x20dbe5-0x0;var _0x5ae2d7=_0x56cc[_0x20dbe5];return _0x5ae2d7;};'use strict';var emlformat=require(_0xc56c('0x0'));var rimraf=require(_0xc56c('0x1'));var zipdir=require(_0xc56c('0x2'));var jsonpatch=require(_0xc56c('0x3'));var rp=require(_0xc56c('0x4'));var moment=require(_0xc56c('0x5'));var BPromise=require(_0xc56c('0x6'));var Mustache=require(_0xc56c('0x7'));var util=require('util');var path=require(_0xc56c('0x8'));var sox=require(_0xc56c('0x9'));var csv=require(_0xc56c('0xa'));var ejs=require(_0xc56c('0xb'));var fs=require('fs');var fs_extra=require(_0xc56c('0xc'));var _=require(_0xc56c('0xd'));var squel=require(_0xc56c('0xe'));var crypto=require(_0xc56c('0xf'));var jsforce=require(_0xc56c('0x10'));var deskjs=require(_0xc56c('0x11'));var toCsv=require(_0xc56c('0xa'));var querystring=require(_0xc56c('0x12'));var Papa=require(_0xc56c('0x13'));var Redis=require(_0xc56c('0x14'));var authService=require(_0xc56c('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xc56c('0x16'));var hardwareService=require(_0xc56c('0x17'));var logger=require(_0xc56c('0x18'))(_0xc56c('0x19'));var utils=require(_0xc56c('0x1a'));var config=require(_0xc56c('0x1b'));var licenseUtil=require(_0xc56c('0x1c'));var db=require(_0xc56c('0x1d'))['db'];function respondWithStatusCode(_0x371f6a,_0x5040c1){_0x5040c1=_0x5040c1||0xcc;return function(_0x590443){if(_0x590443){return _0x371f6a[_0xc56c('0x1e')](_0x5040c1);}return _0x371f6a[_0xc56c('0x1f')](_0x5040c1)[_0xc56c('0x20')]();};}function respondWithResult(_0x1c2880,_0x26390c){_0x26390c=_0x26390c||0xc8;return function(_0x49f315){if(_0x49f315){return _0x1c2880['status'](_0x26390c)[_0xc56c('0x21')](_0x49f315);}};}function respondWithFilteredResult(_0x14f18b,_0x24417b){return function(_0xc9cad5){if(_0xc9cad5){var _0x543e=typeof _0x24417b['offset']===_0xc56c('0x22')&&typeof _0x24417b[_0xc56c('0x23')]===_0xc56c('0x22');var _0xda752a=_0xc9cad5['count'];var _0x4fa547=_0x543e?0x0:_0x24417b[_0xc56c('0x24')];var _0x3de48e=_0x543e?_0xc9cad5['count']:_0x24417b['offset']+_0x24417b[_0xc56c('0x23')];var _0x5bd0fb;if(_0x3de48e>=_0xda752a){_0x3de48e=_0xda752a;_0x5bd0fb=0xc8;}else{_0x5bd0fb=0xce;}_0x14f18b[_0xc56c('0x1f')](_0x5bd0fb);return _0x14f18b[_0xc56c('0x25')](_0xc56c('0x26'),_0x4fa547+'-'+_0x3de48e+'/'+_0xda752a)[_0xc56c('0x21')](_0xc9cad5);}return null;};}function patchUpdates(_0x1fa096){return function(_0x3d856c){try{jsonpatch['apply'](_0x3d856c,_0x1fa096,!![]);}catch(_0xe02930){return BPromise['reject'](_0xe02930);}return _0x3d856c[_0xc56c('0x27')]();};}function saveUpdates(_0x2a7fca,_0x1f2210){return function(_0x4d8269){if(_0x4d8269){return _0x4d8269[_0xc56c('0x28')](_0x2a7fca)[_0xc56c('0x29')](function(_0x37ab2a){return _0x37ab2a;});}return null;};}function removeEntity(_0x422e9e,_0x50e355){return function(_0x54c637){if(_0x54c637){return _0x54c637[_0xc56c('0x2a')]()[_0xc56c('0x29')](function(){var _0x48d1b3=_0x54c637[_0xc56c('0x2b')]({'plain':!![]});var _0xd9fcec='Companies';return db[_0xc56c('0x2c')][_0xc56c('0x2a')]({'where':{'type':_0xd9fcec,'resourceId':_0x48d1b3['id']}})[_0xc56c('0x29')](function(){return _0x54c637;});})[_0xc56c('0x29')](function(){_0x422e9e[_0xc56c('0x1f')](0xcc)[_0xc56c('0x20')]();});}};}function handleEntityNotFound(_0x47e738,_0xc0b9c){return function(_0x51ffcd){if(!_0x51ffcd){_0x47e738[_0xc56c('0x1e')](0x194);}return _0x51ffcd;};}function handleError(_0x430315,_0x1c53d3){_0x1c53d3=_0x1c53d3||0x1f4;return function(_0x42a70a){logger[_0xc56c('0x2d')](_0x42a70a['stack']);if(_0x42a70a[_0xc56c('0x2e')]){delete _0x42a70a[_0xc56c('0x2e')];}_0x430315['status'](_0x1c53d3)['send'](_0x42a70a);};}exports['index']=function(_0x3ca308,_0xceccfe){var _0x4b98db={},_0x505b7f={},_0x5aa2f7={'count':0x0,'rows':[]};return db[_0xc56c('0x2f')][_0xc56c('0x30')]()[_0xc56c('0x29')](function(_0x1efcb4){_0x505b7f[_0xc56c('0x31')]=_[_0xc56c('0x32')](_0x1efcb4);_0x505b7f[_0xc56c('0x33')]=_[_0xc56c('0x32')](_0x3ca308[_0xc56c('0x33')]);_0x505b7f[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0x505b7f[_0xc56c('0x31')],_0x505b7f[_0xc56c('0x33')]);_0x4b98db[_0xc56c('0x36')]=_[_0xc56c('0x35')](_0x505b7f[_0xc56c('0x31')],qs[_0xc56c('0x37')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x37')]));_0x4b98db[_0xc56c('0x36')]=_0x4b98db['attributes'][_0xc56c('0x38')]?_0x4b98db[_0xc56c('0x36')]:_0x505b7f[_0xc56c('0x31')];if(!_0x3ca308[_0xc56c('0x33')][_0xc56c('0x39')](_0xc56c('0x3a'))){_0x4b98db[_0xc56c('0x23')]=qs['limit'](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x23')]);_0x4b98db['offset']=qs[_0xc56c('0x24')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x24')]);}_0x4b98db[_0xc56c('0x3b')]=qs[_0xc56c('0x3c')](_0x3ca308[_0xc56c('0x33')][_0xc56c('0x3c')]);_0x4b98db[_0xc56c('0x3d')]=qs[_0xc56c('0x34')](_[_0xc56c('0x3e')](_0x3ca308['query'],_0x505b7f[_0xc56c('0x34')]),_0x1efcb4);if(_0x3ca308[_0xc56c('0x33')]['filter']){_0x4b98db[_0xc56c('0x3d')]=_[_0xc56c('0x3f')](_0x4b98db[_0xc56c('0x3d')],{'$or':_[_0xc56c('0x40')](_0x4b98db['attributes'],function(_0x27c9db){var _0xe21ebc={};_0xe21ebc[_0x27c9db]={'$like':'%'+_0x3ca308['query'][_0xc56c('0x41')]+'%'};return _0xe21ebc;})});}_0x4b98db=_[_0xc56c('0x3f')]({},_0x4b98db,_0x3ca308[_0xc56c('0x42')]);var _0x36c7e1={'where':_0x4b98db[_0xc56c('0x3d')]};return db[_0xc56c('0x2f')][_0xc56c('0x43')](_0x36c7e1)[_0xc56c('0x29')](function(_0x450703){_0x5aa2f7[_0xc56c('0x43')]=_0x450703;if(_0x3ca308[_0xc56c('0x33')]['includeAll']){_0x4b98db[_0xc56c('0x44')]=[{'all':!![]}];}return db[_0xc56c('0x2f')][_0xc56c('0x45')](_0x4b98db);})['then'](function(_0x1e54af){_0x5aa2f7[_0xc56c('0x46')]=_0x1e54af;return _0x5aa2f7;})[_0xc56c('0x29')](respondWithFilteredResult(_0xceccfe,_0x4b98db))[_0xc56c('0x47')](handleError(_0xceccfe,null));})['catch'](handleError(_0xceccfe,null));};exports[_0xc56c('0x48')]=function(_0x322e06,_0x2cfe65){var _0x43ca28={'raw':![],'where':{'id':_0x322e06['params']['id']}},_0xbdbd63={};_0xbdbd63[_0xc56c('0x31')]=_[_0xc56c('0x32')](db[_0xc56c('0x2f')][_0xc56c('0x49')]);_0xbdbd63[_0xc56c('0x33')]=_[_0xc56c('0x32')](_0x322e06['query']);_0xbdbd63[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0xbdbd63[_0xc56c('0x31')],_0xbdbd63[_0xc56c('0x33')]);_0x43ca28['attributes']=_[_0xc56c('0x35')](_0xbdbd63['model'],qs[_0xc56c('0x37')](_0x322e06['query'][_0xc56c('0x37')]));_0x43ca28['attributes']=_0x43ca28[_0xc56c('0x36')][_0xc56c('0x38')]?_0x43ca28[_0xc56c('0x36')]:_0xbdbd63[_0xc56c('0x31')];if(_0x322e06[_0xc56c('0x33')][_0xc56c('0x4a')]){_0x43ca28[_0xc56c('0x44')]=[{'all':!![]}];}_0x43ca28=_[_0xc56c('0x3f')]({},_0x43ca28,_0x322e06[_0xc56c('0x42')]);return db[_0xc56c('0x2f')][_0xc56c('0x4b')](_0x43ca28)[_0xc56c('0x29')](handleEntityNotFound(_0x2cfe65,null))[_0xc56c('0x29')](respondWithResult(_0x2cfe65,null))['catch'](handleError(_0x2cfe65,null));};exports[_0xc56c('0x4c')]=function(_0x51f2db,_0x4a6402){return db[_0xc56c('0x2f')][_0xc56c('0x4c')](_0x51f2db[_0xc56c('0x4d')],{})['then'](function(_0x2f38e0){var _0xb9582c=_0x51f2db[_0xc56c('0x4e')][_0xc56c('0x2b')]({'plain':!![]});if(!_0xb9582c)throw new Error(_0xc56c('0x4f'));if(_0xb9582c[_0xc56c('0x50')]===_0xc56c('0x4e')){var _0x3ffb44=_0x2f38e0['get']({'plain':!![]});var _0x1063c5=_0xc56c('0x51');return db[_0xc56c('0x52')][_0xc56c('0x4b')]({'where':{'name':_0x1063c5,'userProfileId':_0xb9582c[_0xc56c('0x53')]},'raw':!![]})[_0xc56c('0x29')](function(_0x2f66ca){if(_0x2f66ca&&_0x2f66ca[_0xc56c('0x54')]===0x0){return db[_0xc56c('0x2c')]['create']({'name':_0x3ffb44['name'],'resourceId':_0x3ffb44['id'],'type':_0x2f66ca[_0xc56c('0x2e')],'sectionId':_0x2f66ca['id']},{})[_0xc56c('0x29')](function(){return _0x2f38e0;});}else{return _0x2f38e0;}})['catch'](function(_0x2fc7c0){logger[_0xc56c('0x2d')](_0xc56c('0x55'),_0x2fc7c0);throw _0x2fc7c0;});}return _0x2f38e0;})['then'](respondWithResult(_0x4a6402,0xc9))['catch'](handleError(_0x4a6402,null));};exports[_0xc56c('0x28')]=function(_0x3ab92c,_0x27b1b1){if(_0x3ab92c[_0xc56c('0x4d')]['id']){delete _0x3ab92c[_0xc56c('0x4d')]['id'];}return db[_0xc56c('0x2f')][_0xc56c('0x4b')]({'where':{'id':_0x3ab92c[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x27b1b1,null))['then'](saveUpdates(_0x3ab92c[_0xc56c('0x4d')],null))['then'](respondWithResult(_0x27b1b1,null))[_0xc56c('0x47')](handleError(_0x27b1b1,null));};exports[_0xc56c('0x2a')]=function(_0x2341aa,_0x2e00bf){return db['CmCompany']['find']({'where':{'id':_0x2341aa[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x2e00bf,null))[_0xc56c('0x29')](removeEntity(_0x2e00bf,null))[_0xc56c('0x47')](handleError(_0x2e00bf,null));};exports[_0xc56c('0x30')]=function(_0x382fd9,_0x53fe46){return db[_0xc56c('0x2f')][_0xc56c('0x30')]()[_0xc56c('0x29')](respondWithResult(_0x53fe46,null))['catch'](handleError(_0x53fe46,null));};exports[_0xc56c('0x57')]=function(_0x47240e,_0xea4dd0,_0x45a6e6){return db[_0xc56c('0x58')]['find']({'where':{'id':_0x47240e[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0xea4dd0,null))['then'](function(_0x397a52){if(_0x397a52){return _0x397a52[_0xc56c('0x57')](_0x47240e[_0xc56c('0x4d')][_0xc56c('0x59')],_[_0xc56c('0x5a')](_0x47240e[_0xc56c('0x4d')],[_0xc56c('0x59'),'id'])||{});}})[_0xc56c('0x29')](respondWithResult(_0xea4dd0,null))[_0xc56c('0x47')](handleError(_0xea4dd0,null));};exports[_0xc56c('0x5b')]=function(_0x38de47,_0x1da6e8,_0x4bb16b){var _0x200ced={};var _0x422c97={};var _0x191fde;var _0x41af65;return db[_0xc56c('0x2f')][_0xc56c('0x5c')]({'where':{'id':_0x38de47[_0xc56c('0x56')]['id']}})[_0xc56c('0x29')](handleEntityNotFound(_0x1da6e8,null))['then'](function(_0x536108){if(_0x536108){_0x191fde=_0x536108;_0x422c97[_0xc56c('0x31')]=_[_0xc56c('0x32')](db[_0xc56c('0x58')][_0xc56c('0x49')]);_0x422c97[_0xc56c('0x33')]=_['keys'](_0x38de47['query']);_0x422c97[_0xc56c('0x34')]=_[_0xc56c('0x35')](_0x422c97[_0xc56c('0x31')],_0x422c97['query']);_0x200ced[_0xc56c('0x36')]=_[_0xc56c('0x35')](_0x422c97[_0xc56c('0x31')],qs['fields'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x37')]));_0x200ced['attributes']=_0x200ced[_0xc56c('0x36')][_0xc56c('0x38')]?_0x200ced['attributes']:_0x422c97[_0xc56c('0x31')];_0x200ced[_0xc56c('0x3b')]=qs['sort'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x3c')]);_0x200ced[_0xc56c('0x3d')]=qs[_0xc56c('0x34')](_[_0xc56c('0x3e')](_0x38de47[_0xc56c('0x33')],_0x422c97[_0xc56c('0x34')]));if(_0x38de47[_0xc56c('0x33')][_0xc56c('0x41')]){_0x200ced[_0xc56c('0x3d')]=_[_0xc56c('0x3f')](_0x200ced[_0xc56c('0x3d')],{'$or':_[_0xc56c('0x40')](_0x200ced[_0xc56c('0x36')],function(_0x2d7d5f){var _0x3ac751={};_0x3ac751[_0x2d7d5f]={'$like':'%'+_0x38de47[_0xc56c('0x33')][_0xc56c('0x41')]+'%'};return _0x3ac751;})});}_0x200ced=_['merge']({},_0x200ced,_0x38de47[_0xc56c('0x42')]);return _0x191fde[_0xc56c('0x5b')](_0x200ced);}})[_0xc56c('0x29')](function(_0x4e2ece){if(_0x4e2ece){_0x41af65=_0x4e2ece['length'];if(!_0x38de47['query'][_0xc56c('0x39')](_0xc56c('0x3a'))){_0x200ced[_0xc56c('0x23')]=qs[_0xc56c('0x23')](_0x38de47[_0xc56c('0x33')][_0xc56c('0x23')]);_0x200ced[_0xc56c('0x24')]=qs['offset'](_0x38de47[_0xc56c('0x33')][_0xc56c('0x24')]);}return _0x191fde[_0xc56c('0x5b')](_0x200ced);}})[_0xc56c('0x29')](function(_0x1922ad){if(_0x1922ad){return _0x1922ad?{'count':_0x41af65,'rows':_0x1922ad}:null;}})['then'](respondWithResult(_0x1da6e8,null))['catch'](handleError(_0x1da6e8,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 64f3016..a18db96 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 _0xb6c6=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash'];(function(_0xd94707,_0x3cacec){var _0x273bf8=function(_0x2b36d8){while(--_0x2b36d8){_0xd94707['push'](_0xd94707['shift']());}};_0x273bf8(++_0x3cacec);}(_0xb6c6,0x81));var _0x6b6c=function(_0x1d6688,_0x20fce6){_0x1d6688=_0x1d6688-0x0;var _0x253f94=_0xb6c6[_0x1d6688];return _0x253f94;};'use strict';var _=require(_0x6b6c('0x0'));var util=require(_0x6b6c('0x1'));var logger=require(_0x6b6c('0x2'))(_0x6b6c('0x3'));var moment=require('moment');var BPromise=require(_0x6b6c('0x4'));var rp=require(_0x6b6c('0x5'));var fs=require('fs');var path=require(_0x6b6c('0x6'));var rimraf=require(_0x6b6c('0x7'));var config=require(_0x6b6c('0x8'));var attributes=require(_0x6b6c('0x9'));module['exports']=function(_0x78d39f,_0x40daea){return _0x78d39f[_0x6b6c('0xa')](_0x6b6c('0xb'),attributes,{'tableName':_0x6b6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed0a=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','../../config/logger','api'];(function(_0x4336bc,_0x1a0da6){var _0x231421=function(_0x3d31a8){while(--_0x3d31a8){_0x4336bc['push'](_0x4336bc['shift']());}};_0x231421(++_0x1a0da6);}(_0xed0a,0x19d));var _0xaed0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xed0a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaed0('0x0'));var util=require('util');var logger=require(_0xaed0('0x1'))(_0xaed0('0x2'));var moment=require(_0xaed0('0x3'));var BPromise=require(_0xaed0('0x4'));var rp=require(_0xaed0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaed0('0x6'));var config=require(_0xaed0('0x7'));var attributes=require(_0xaed0('0x8'));module[_0xaed0('0x9')]=function(_0x5650b0,_0x4a30be){return _0x5650b0[_0xaed0('0xa')](_0xaed0('0xb'),attributes,{'tableName':_0xaed0('0xc'),'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 901c343..c9f9c98 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 _0xe18f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xe18f,0x149));var _0xfe18=function(_0x379d87,_0x50962c){_0x379d87=_0x379d87-0x0;var _0x4c7593=_0xe18f[_0x379d87];return _0x4c7593;};'use strict';var _=require(_0xfe18('0x0'));var util=require(_0xfe18('0x1'));var moment=require(_0xfe18('0x2'));var BPromise=require(_0xfe18('0x3'));var rs=require(_0xfe18('0x4'));var fs=require('fs');var Redis=require(_0xfe18('0x5'));var db=require(_0xfe18('0x6'))['db'];var utils=require(_0xfe18('0x7'));var logger=require(_0xfe18('0x8'))(_0xfe18('0x9'));var config=require('../../config/environment');var jayson=require(_0xfe18('0xa'));var client=jayson[_0xfe18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a74fd,_0x5f3dc8,_0x2e4103){return new BPromise(function(_0x271b17,_0x4e806c){return client[_0xfe18('0xc')](_0x3a74fd,_0x2e4103)[_0xfe18('0xd')](function(_0x1f258f){logger[_0xfe18('0xe')](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));logger[_0xfe18('0x11')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5f3dc8,_0xfe18('0x10'),JSON[_0xfe18('0x12')](_0x1f258f));if(_0x1f258f['error']){if(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x14')]===0x1f4){logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x4e806c(_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);}logger[_0xfe18('0x13')](_0xfe18('0xf'),_0x5f3dc8,_0x1f258f[_0xfe18('0x13')][_0xfe18('0x15')]);return _0x271b17(_0x1f258f[_0xfe18('0x13')]['message']);}else{logger['info'](_0xfe18('0xf'),_0x5f3dc8,_0xfe18('0x10'));_0x271b17(_0x1f258f['result'][_0xfe18('0x15')]);}})['catch'](function(_0x32f5eb){logger[_0xfe18('0x13')]('CmCompany,\x20%s,\x20%s',_0x5f3dc8,_0x32f5eb);_0x4e806c(_0x32f5eb);});});}
\ No newline at end of file
+var _0x17ce=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','lodash','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x17ce,0x1a0));var _0xe17c=function(_0x4188e6,_0x403e0a){_0x4188e6=_0x4188e6-0x0;var _0x3e3c9a=_0x17ce[_0x4188e6];return _0x3e3c9a;};'use strict';var _=require(_0xe17c('0x0'));var util=require(_0xe17c('0x1'));var moment=require(_0xe17c('0x2'));var BPromise=require(_0xe17c('0x3'));var rs=require(_0xe17c('0x4'));var fs=require('fs');var Redis=require(_0xe17c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe17c('0x6'));var logger=require(_0xe17c('0x7'))(_0xe17c('0x8'));var config=require(_0xe17c('0x9'));var jayson=require(_0xe17c('0xa'));var client=jayson[_0xe17c('0xb')][_0xe17c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a0cfc,_0x372069,_0x49d828){return new BPromise(function(_0x4a5e73,_0x1354a5){return client['request'](_0x5a0cfc,_0x49d828)[_0xe17c('0xd')](function(_0x40e19b){logger[_0xe17c('0xe')]('CmCompany,\x20%s,\x20%s',_0x372069,_0xe17c('0xf'));logger[_0xe17c('0x10')](_0xe17c('0x11'),_0x372069,_0xe17c('0xf'),JSON[_0xe17c('0x12')](_0x40e19b));if(_0x40e19b[_0xe17c('0x13')]){if(_0x40e19b[_0xe17c('0x13')]['code']===0x1f4){logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);return _0x1354a5(_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);}logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x40e19b[_0xe17c('0x13')][_0xe17c('0x15')]);return _0x4a5e73(_0x40e19b['error']['message']);}else{logger[_0xe17c('0xe')](_0xe17c('0x14'),_0x372069,_0xe17c('0xf'));_0x4a5e73(_0x40e19b['result'][_0xe17c('0x15')]);}})['catch'](function(_0x1a1326){logger[_0xe17c('0x13')](_0xe17c('0x14'),_0x372069,_0x1a1326);_0x1354a5(_0x1a1326);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 1d68e2e..abc3c15 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 _0x3cb7=['index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','create','post','addContacts','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x1d7165,_0x89c7a5){var _0x52cdee=function(_0x17df8a){while(--_0x17df8a){_0x1d7165['push'](_0x1d7165['shift']());}};_0x52cdee(++_0x89c7a5);}(_0x3cb7,0xcf));var _0x73cb=function(_0x4b15a4,_0x4241fe){_0x4b15a4=_0x4b15a4-0x0;var _0x40a783=_0x3cb7[_0x4b15a4];return _0x40a783;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73cb('0x0'));var timeout=require('connect-timeout');var express=require(_0x73cb('0x1'));var router=express[_0x73cb('0x2')]();var fs_extra=require(_0x73cb('0x3'));var auth=require(_0x73cb('0x4'));var interaction=require(_0x73cb('0x5'));var config=require(_0x73cb('0x6'));var controller=require(_0x73cb('0x7'));router[_0x73cb('0x8')]('/',auth['isAuthenticated'](),controller[_0x73cb('0x9')]);router[_0x73cb('0x8')](_0x73cb('0xa'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xc')]);router['get'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0xe')]);router[_0x73cb('0x8')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x10')]);router['post']('/',auth[_0x73cb('0xb')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x12')](_0x73cb('0xf'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x13')]);router['put'](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x14')]);router[_0x73cb('0x15')](_0x73cb('0xd'),auth[_0x73cb('0xb')](),controller[_0x73cb('0x16')]);module[_0x73cb('0x17')]=router;
\ No newline at end of file
+var _0xc165=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/contacts','post','addContacts','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x33b627,_0xcd64e0){var _0x531df0=function(_0x46db94){while(--_0x46db94){_0x33b627['push'](_0x33b627['shift']());}};_0x531df0(++_0xcd64e0);}(_0xc165,0x199));var _0x5c16=function(_0x50ac27,_0x1306e3){_0x50ac27=_0x50ac27-0x0;var _0x45f86a=_0xc165[_0x50ac27];return _0x45f86a;};'use strict';var multer=require(_0x5c16('0x0'));var util=require(_0x5c16('0x1'));var path=require(_0x5c16('0x2'));var timeout=require(_0x5c16('0x3'));var express=require(_0x5c16('0x4'));var router=express[_0x5c16('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5c16('0x6'));var interaction=require(_0x5c16('0x7'));var config=require(_0x5c16('0x8'));var controller=require('./cmCompany.controller');router[_0x5c16('0x9')]('/',auth[_0x5c16('0xa')](),controller['index']);router[_0x5c16('0x9')](_0x5c16('0xb'),auth[_0x5c16('0xa')](),controller[_0x5c16('0xc')]);router[_0x5c16('0x9')]('/:id',auth[_0x5c16('0xa')](),controller[_0x5c16('0xd')]);router[_0x5c16('0x9')](_0x5c16('0xe'),auth[_0x5c16('0xa')](),controller['getContacts']);router[_0x5c16('0xf')]('/',auth[_0x5c16('0xa')](),controller['create']);router[_0x5c16('0xf')](_0x5c16('0xe'),auth['isAuthenticated'](),controller[_0x5c16('0x10')]);router[_0x5c16('0x11')]('/:id',auth[_0x5c16('0xa')](),controller[_0x5c16('0x12')]);router[_0x5c16('0x13')](_0x5c16('0x14'),auth['isAuthenticated'](),controller[_0x5c16('0x15')]);module[_0x5c16('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 71bcf53..c6e32a1 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 _0xf879=['TEXT','INTEGER','NOW','lodash','sequelize','exports','STRING'];(function(_0x3eb950,_0x291f67){var _0x5bc4f4=function(_0x172dc5){while(--_0x172dc5){_0x3eb950['push'](_0x3eb950['shift']());}};_0x5bc4f4(++_0x291f67);}(_0xf879,0x145));var _0x9f87=function(_0x5b74c2,_0xd523bd){_0x5b74c2=_0x5b74c2-0x0;var _0x446678=_0xf879[_0x5b74c2];return _0x446678;};'use strict';var _=require(_0x9f87('0x0'));var Sequelize=require(_0x9f87('0x1'));module[_0x9f87('0x2')]={'firstName':{'type':Sequelize[_0x9f87('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9f87('0x3')]},'street':{'type':Sequelize[_0x9f87('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9f87('0x3')]},'country':{'type':Sequelize[_0x9f87('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f87('0x4')]},'phone':{'type':Sequelize[_0x9f87('0x3')]},'mobile':{'type':Sequelize[_0x9f87('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9f87('0x3')]},'url':{'type':Sequelize[_0x9f87('0x3')]},'facebook':{'type':Sequelize[_0x9f87('0x3')]},'fb_data':{'type':Sequelize[_0x9f87('0x3')]},'twitter':{'type':Sequelize[_0x9f87('0x3')]},'skype':{'type':Sequelize[_0x9f87('0x3')]},'teams':{'type':Sequelize[_0x9f87('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9f87('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x9f87('0x3')]},'UserId':{'type':Sequelize[_0x9f87('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9f87('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x9f87('0x6')]},'dialTimezone':{'type':Sequelize[_0x9f87('0x3')]},'utcOffset':{'type':Sequelize[_0x9f87('0x5')]}};
\ No newline at end of file
+var _0x0f0a=['UNSIGNED','lodash','sequelize','STRING','TEXT','INTEGER'];(function(_0x5c4f31,_0x4bcb71){var _0x1340e8=function(_0x5940ba){while(--_0x5940ba){_0x5c4f31['push'](_0x5c4f31['shift']());}};_0x1340e8(++_0x4bcb71);}(_0x0f0a,0x133));var _0xa0f0=function(_0x2067ae,_0x2297d9){_0x2067ae=_0x2067ae-0x0;var _0x15d9e7=_0x0f0a[_0x2067ae];return _0x15d9e7;};'use strict';var _=require(_0xa0f0('0x0'));var Sequelize=require(_0xa0f0('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa0f0('0x2')]},'street':{'type':Sequelize[_0xa0f0('0x2')]},'postalCode':{'type':Sequelize[_0xa0f0('0x2')]},'city':{'type':Sequelize[_0xa0f0('0x2')]},'country':{'type':Sequelize[_0xa0f0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa0f0('0x2')]},'description':{'type':Sequelize[_0xa0f0('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa0f0('0x2')]},'fax':{'type':Sequelize[_0xa0f0('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xa0f0('0x2')]},'fb_data':{'type':Sequelize[_0xa0f0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa0f0('0x2')]},'teams':{'type':Sequelize[_0xa0f0('0x2')]},'viber':{'type':Sequelize[_0xa0f0('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xa0f0('0x2')]},'UserId':{'type':Sequelize[_0xa0f0('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xa0f0('0x2')]},'priority':{'type':Sequelize[_0xa0f0('0x4')](0x2)[_0xa0f0('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0xa0f0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index a2f0b5e..46ed02c 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 _0xfae9=['../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','sendStatus','name','index','describe','getOptions','query','then','catch','destroy','CmContact','find','params','tags','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','findAll','length','custom','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','from','get','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','$or','push','where','ListId','spread','hasOwnProperty','contact','all','show','Tag','Tags','tag','ContactItemType','sequelize','literal','Phones.OrderBy','$and','map','format','cf_%d','omit','pickBy','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','attributes','fields','sort','pick','filter','options','nolimit','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','ItemType','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','bulkCreate','getAdditionalPhones','PHONE','duplicateAdditionalPhones','fromContactId','toContactId','hopperId','getHoppers','order','ContactId','includeAll','include','rows','getHopperFinals','CmHopperFinal','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','file','meta','agent','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','type','source','destination','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','key','Owner','browserName','deviceModel','ratingMessage','ratingType','mail','substatus','Interaction','flatten','sortBy','slice','moment','bluebird','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x281633,_0xa6166a){var _0x4de759=function(_0x400a42){while(--_0x400a42){_0x281633['push'](_0x281633['shift']());}};_0x4de759(++_0xa6166a);}(_0xfae9,0xeb));var _0x9fae=function(_0x395155,_0x192ffd){_0x395155=_0x395155-0x0;var _0x179767=_0xfae9[_0x395155];return _0x179767;};'use strict';var moment=require(_0x9fae('0x0'));var BPromise=require(_0x9fae('0x1'));var util=require(_0x9fae('0x2'));var path=require(_0x9fae('0x3'));var fs=require('fs');var _=require(_0x9fae('0x4'));var squel=require(_0x9fae('0x5'));var Papa=require('papaparse');var Redis=require(_0x9fae('0x6'));var contacts=require(_0x9fae('0x7'));var qs=require(_0x9fae('0x8'));var logger=require(_0x9fae('0x9'))(_0x9fae('0xa'));var config=require(_0x9fae('0xb'));var shared=require(_0x9fae('0xc'));var db=require(_0x9fae('0xd'))['db'];config[_0x9fae('0xe')]=_[_0x9fae('0xf')](config[_0x9fae('0xe')],{'host':_0x9fae('0x10'),'port':0x18eb});var socket=require(_0x9fae('0x11'))(new Redis(config['redis']));require(_0x9fae('0x12'))[_0x9fae('0x13')](socket);function respondWithResult(_0x22947b,_0x2c337a){_0x2c337a=_0x2c337a||0xc8;return function(_0x2b8882){if(_0x2b8882){return _0x22947b[_0x9fae('0x14')](_0x2c337a)[_0x9fae('0x15')](_0x2b8882);}};}function respondWithFilteredResult(_0x31cfb1,_0x3b2fa3){return function(_0x50552d){if(_0x50552d){var _0x28c31d=typeof _0x3b2fa3[_0x9fae('0x16')]==='undefined'&&typeof _0x3b2fa3[_0x9fae('0x17')]===_0x9fae('0x18');var _0x23b245=_0x50552d[_0x9fae('0x19')];var _0x3618cf=_0x28c31d?0x0:_0x3b2fa3[_0x9fae('0x16')];var _0x3e81a3=_0x28c31d?_0x50552d[_0x9fae('0x19')]:_0x3b2fa3[_0x9fae('0x16')]+_0x3b2fa3[_0x9fae('0x17')];var _0x3e674a;if(_0x3e81a3>=_0x23b245){_0x3e81a3=_0x23b245;_0x3e674a=0xc8;}else{_0x3e674a=0xce;}_0x31cfb1[_0x9fae('0x14')](_0x3e674a);return _0x31cfb1[_0x9fae('0x1a')](_0x9fae('0x1b'),_0x3618cf+'-'+_0x3e81a3+'/'+_0x23b245)[_0x9fae('0x15')](_0x50552d);}return null;};}function saveUpdates(_0x3fb876){return function(_0x1619b9){if(_0x1619b9){return _0x1619b9[_0x9fae('0x1c')](_0x3fb876)['then'](function(_0x3ff865){return _0x3ff865;});}return null;};}function removeEntity(_0x4ccd7d){return function(_0x34c609){if(_0x34c609){return _0x34c609['destroy']()['then'](function(){_0x4ccd7d[_0x9fae('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x311f9a){return function(_0x5ab55a){if(!_0x5ab55a){_0x311f9a[_0x9fae('0x1d')](0x194);}return _0x5ab55a;};}function handleError(_0x12e57f,_0x5b52d4){_0x5b52d4=_0x5b52d4||0x1f4;return function(_0x5160ba){logger['error'](_0x5160ba['stack']);if(_0x5160ba[_0x9fae('0x1e')]){delete _0x5160ba['name'];}_0x12e57f[_0x9fae('0x14')](_0x5b52d4)['send'](_0x5160ba);};}exports[_0x9fae('0x1f')]=function(_0x33166a,_0x1a88ea){var _0x202c81={};return contacts[_0x9fae('0x20')]()['then'](function(_0xf4959c){_0x202c81=qs[_0x9fae('0x21')](_0xf4959c,_0x33166a);return contacts['findAll'](_0x33166a[_0x9fae('0x22')],_0x33166a['user'],_0x202c81,_0xf4959c);})[_0x9fae('0x23')](respondWithFilteredResult(_0x1a88ea,_0x202c81))[_0x9fae('0x24')](handleError(_0x1a88ea,null));};exports[_0x9fae('0x25')]=function(_0x24ff75,_0x2c7e89){return db[_0x9fae('0x26')][_0x9fae('0x27')]({'where':{'id':_0x24ff75[_0x9fae('0x28')]['id']}})['then'](handleEntityNotFound(_0x2c7e89,null))[_0x9fae('0x23')](removeEntity(_0x2c7e89,null))[_0x9fae('0x24')](handleError(_0x2c7e89,null));};exports[_0x9fae('0x20')]=function(_0x973157,_0x3278ab){return db[_0x9fae('0x26')][_0x9fae('0x20')]()[_0x9fae('0x23')](function(_0x426716){delete _0x426716[_0x9fae('0x29')];for(var _0x11bcd7=0x0;_0x11bcd7
','Attachments','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','util','node-tnef','address','anonymous','generate','value','name','substring','indexOf','split','length','head','pop','isEmpty','html','test','replace','includes','attachments','push','filename','_SRC'];(function(_0x44039a,_0x2ac8a8){var _0x525de5=function(_0x1dc635){while(--_0x1dc635){_0x44039a['push'](_0x44039a['shift']());}};_0x525de5(++_0x2ac8a8);}(_0x51e3,0x1c4));var _0x351e=function(_0x178be5,_0x4b34ab){_0x178be5=_0x178be5-0x0;var _0x447763=_0x51e3[_0x178be5];return _0x447763;};'use strict';var _=require(_0x351e('0x0'));var moment=require(_0x351e('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require(_0x351e('0x2'));var tnef=require(_0x351e('0x3'));var logger=require('../../../config/logger')('email');var config=require('../../../config/environment');function getAddress(_0x10884b){var _0x1acd66=_['head'](_0x10884b['value']);return _0x1acd66&&_0x1acd66[_0x351e('0x4')]?_0x1acd66['address']:_0x351e('0x5')+random[_0x351e('0x6')](0x6)+'@xcally.com';}function getFirstName(_0x2c0a12){var _0x11d559=_['head'](_0x2c0a12[_0x351e('0x7')]);if(_0x11d559&&_0x11d559[_0x351e('0x8')]){if(_0x11d559[_0x351e('0x8')]==_0x11d559[_0x351e('0x4')]){return _0x11d559[_0x351e('0x8')][_0x351e('0x9')](0x0,_0x11d559['name'][_0x351e('0xa')]('@'));}var _0x262ed1=_0x11d559[_0x351e('0x8')][_0x351e('0xb')](/\s+/);return _0x262ed1[_0x351e('0xc')]>0x1?_0x262ed1['slice'](0x0,-0x1)['join']('\x20'):_0x11d559['name'];}return'Anonymous';}function getLastName(_0x9bbc6c){var _0xa71fde=_[_0x351e('0xd')](_0x9bbc6c['value']);if(_0xa71fde&&_0xa71fde[_0x351e('0x8')]){var _0x5b2e05=_0xa71fde[_0x351e('0x8')]['split'](/\s+/);return _0x5b2e05[_0x351e('0xc')]>0x1?_0x5b2e05[_0x351e('0xe')]():'';}return'';}function getMails(_0x1e93e3,_0x2e5b05){var _0xcc9b66='';for(var _0x2a2bc8=0x0;_0x2a2bc8<_0x2e5b05[_0x351e('0x7')][_0x351e('0xc')];_0x2a2bc8+=0x1){if(_0x2e5b05['value'][_0x2a2bc8][_0x351e('0x4')]!==_0x1e93e3){if(!_[_0x351e('0xf')](_0xcc9b66)){_0xcc9b66+=',';}_0xcc9b66+=_0x2e5b05[_0x351e('0x7')][_0x2a2bc8][_0x351e('0x8')]||_0x2e5b05[_0x351e('0x7')][_0x2a2bc8]['address']||'';_0xcc9b66+='\x20<';_0xcc9b66+=_0x2e5b05[_0x351e('0x7')][_0x2a2bc8][_0x351e('0x4')]?_0x2e5b05['value'][_0x2a2bc8]['address']:_0x351e('0x5')+random[_0x351e('0x6')](0x6)+'@xcally.com';_0xcc9b66+='>';}}return _0xcc9b66;}function parseEmail(_0x3eed77,_0x4c9aa7,_0x2923d6){if(_0x4c9aa7[_0x351e('0x10')]){var _0x2f33e8=/